Solved relates to initial post where did I go wrong

February 16, 2019 at 09:58:38
Specs: Windows 10
This relates to drank2much question


Started with this permalink:
http://www.extremesudoku.info/sudok...

I used this:
@echo off
if exist s.txt del s.txt>nul
batplace h.txt "-" "0">nul
batplace h.txt "www.extremesudoku.info" "">nul
batplace h.txt "/sudoku.html?pos=" "">nul
batplace h.txt "http://" "">nul
batplace h.txt "http://" "">nul
for %%x in (1,10,19,28,37,46,55,64,73,82) do lmod [%%x,9]<h.txt>>s.txt
copy s.txt h.txt
if exist a.bak del a.bak>nul
exit

To get this:

600000003
003106500
040070010
060509040
005000200
090607080
020080060
004201700
100000002

batplace.exe is a utility I renamed for my use, as Mickeysoft came out with a utility,
same-named around the same time.

REPLACE Version 2.01.15 1987-88 (C) Gene Garapic (1:157/502)

I have a 32 bit windows computer, so I can use this, as it's probably a 16 bit thing.
I also used Horst Schaeffer's lmod.exe.

Every day I send this Internet Sudoku puzzle to my sister. This format looks nicer, but not necessary.

I looked up hdde63 on the web and a German website came up.

So I'm thinking this programmer came from a long line of Germans.



See More: relates to initial post where did I go wrong

Report •

✔ Best Answer
February 17, 2019 at 21:31:47
Hah! My response was classic case of "overkill" I guess, but mostly just did it for kicks.
When I have a few weeks of free time, maybe I'll try that nasty Sudoku posted at telegraph.co.uk.
This might approximate your original intentions, using the url:
@echo off & setlocal
rem permalink.url:
rem <a href="http://www.extremesudoku.info/sudoku.html?pos=6-------3--31-65---4--7--1--6-5-9-4---5---2---9-6-7-8--2--8--6---42-17--1-------2" target="_blank" rel="nofollow">http://www.extremesudoku.info/sudok...</a>
for /f "tokens=2 delims==" %%a in (permalink.url) do set k=%%a
:aa
set nine=%k:~0,9%
set k=%k:~9%
set nine=%nine:-=0%
echo %nine%
if defined k goto :aa



#1
February 17, 2019 at 00:46:48
you mean this qestion right:
https://www.computing.net/answers/p...

in other words, im supposed to reorganise the output?

and with output i mean:

600000003
003106500
040070010
060509040
005000200
090607080
020080060
004201700
100000002

i5-6600K[delid]@4.7GHz/4.4GHz cache/@1.395v LLC=6 | 2x4GB Crucial-DDR4-2400CL17@14-15-15-28 1T 3000MHz@1.4v | MSI Armor RX 570 4GB@1425Mhz core@1.2v/1920MHz

message edited by hidde663


Report •

#2
February 17, 2019 at 12:11:15
I'm also kind of stymied as to exactly what you want. Being somewhat of a Sudoku enthusiast, I wrote a program in basic a few years back to print out puzzles (stored as ascii number-sets) into the blocks. Since I had that program already done, I figured I'd try it in batch. Whether this is what you wanted I cannot venture to guess, nor what your raw input looked like. I just used the Sudoku url:
http://www.extremesudoku.info/sudok...
and stripped it to the numbers:
6-------3--31-65---4--7--1--6-5-9-4---5---2---9-6-7-8--2--8--6---42-17--1-------2
That is my input, "puzzle". Here's the batch:
@echo off & setlocal enabledelayedexpansion
:: all the main settings are here: These are set for sudoku but could be
:: altered for other nefarious purposes if so desired.
set boxcount=8
set /a bc=boxcount+1
set rowcount=8
set boxtall=5
set /a bt=boxtall/2-1
set boxwide=5
set h1=Ú¿

set h2=ÃÅ´

set h3=ÀÁÙ
set h4=³

set /p j=<puzzle
call :line Ä
set v1=%line%
set /a boxwide=boxwide/2
call :line " "
set sp=%line%
set spc=%v1:Ä= %

set q=%h4%
for /l %%c in (1 1 %bc%) do set q=!q!%spc%%h4%
call :xx %h1%
for /l %%a in (1 1 %rowcount%) do call :xx %h2%
call :xx %h3%

goto :eof

:xx
set k=%1
set k1=%k:~0,1%
set k2=%k:~1,1%
set k3=%k:~2,1%
set k=%k1%
for /l %%c in (1 1 %boxcount%) do set k=!k!%v1%%k2%
set k=%k%%v1%%k3%
echo %k%
if "%1" equ "%h3%" goto :eof
set qq=%h4%
set c=0
:aa
set w=%j:~0,1%
set j=%j:~1%
set qq=%qq%%sp%%w%%sp%%h4%
set /a c+=1
if %c% lss 9 goto :aa
set qq=%qq:-= %
for /l %%w in (1 1 %bt%) do echo %q%
echo %qq%
for /l %%w in (1 1 %bt%) do echo %q%
goto :eof

:line
set line=
for /l %%a in (1 1 %boxwide%) do set line=!line!%~1
goto :eof

I don't know how to display graphic characters on this site, and the site said I was trying to "spam", and threatened to block my post, so I can't show the output. (That's why h1, h2, h3 and h4 variables look funny.)

message edited by nbrane


Report •

#3
February 17, 2019 at 13:19:43
That's really neat, nbrane. That took a lot of work. But from the gitgo, I only use
Simple Sudoku, and always have the candidates displayed. The simplest Sudoku puzzles
without candidates showing take forever to solve, so I don't go that route.

https://www.telegraph.co.uk/news/sc...

toughest man-made puzzle

8----------36------7--9-2---5---7-------457-------1---3---1----68--85---1--9----4--

your sudoku enthusiasm will go out the window on this one.

A friend of mine in Australia sent me a compiled basic answer that also worked great.

I tried getting rid of the initial web address of the permalink with batch, but the "equal sign"

messed me up. I'm certainly not the sharpest knife in the drawer. I might not even be
in the drawer. - Ha ha.


Report •

Related Solutions

#4
February 17, 2019 at 21:31:47
✔ Best Answer
Hah! My response was classic case of "overkill" I guess, but mostly just did it for kicks.
When I have a few weeks of free time, maybe I'll try that nasty Sudoku posted at telegraph.co.uk.
This might approximate your original intentions, using the url:
@echo off & setlocal
rem permalink.url:
rem <a href="http://www.extremesudoku.info/sudoku.html?pos=6-------3--31-65---4--7--1--6-5-9-4---5---2---9-6-7-8--2--8--6---42-17--1-------2" target="_blank" rel="nofollow">http://www.extremesudoku.info/sudok...</a>
for /f "tokens=2 delims==" %%a in (permalink.url) do set k=%%a
:aa
set nine=%k:~0,9%
set k=%k:~9%
set nine=%nine:-=0%
echo %nine%
if defined k goto :aa


Report •

#5
February 18, 2019 at 07:20:25
This latest by nbrane is best answer, as it is complete, but not to disparage hidde63, as he first and foremost
solved what I gave him as the problem. He was early on and right on. Both of you guys and a few others
really know your way around this batch stuff. It's all a dark closet for me. I used to do batch stuff when
Vernon Frazee was DOS king, but this stuff is all new to me. I kind of left that forum (or it died), and I didn't
know about this one. Tks to all you really superb batch-capable guys. You know your stuff plus.
What do you call this stuff - is it windows scripting host?? Can you recommend a book?

Report •

Ask Question