Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Takuzu

35 views
Skip to first unread message

Mike Sanders

unread,
Jun 1, 2017, 8:38:18 AM6/1/17
to
The Takuzu (or Binary) puzzle with 9 embedded puzzles...


@echo off & title=Takuzu Puzzle

:: Takuzu Puzzle: Michael Sanders - 2017
:: https://busybox.hypermart.net/takuzu.html
::
:: rules...
::
:: each row & column must contain an equal number of 0s & 1s
::
:: no more than two 0s or two 1s adjacent by row or column
::
:: each row & column is unique
::
:: play...
::
:: this script launches two instances of notepad
:: the 1st instance contains the puzzle to solve
:: the 2nd instance (minimized) the solution which
:: should *only* be used if you need help...
::
:: to ensure the puzzle's grid is properly rendered
:: consider using a monospaced font like Courier
:: to view/print the puzzle

:setup

setlocal enabledelayedexpansion
set m[1]=110010011001100110010101001011101100
set m[2]=011010100101101001010110010101101010
set m[3]=110100011001101010010101100110001011
set m[4]=101001011010110100001101010011100110
set m[5]=001101010011110010101100011001100110
set m[6]=101100001011110100010011001101110010
set m[7]=110010001101011001100110101100010011
set m[8]=011001100101010110001011101100110010
set m[9]=100110101001010110011001101100010011
set \n=^&echo.
set/a x=0
set/a r=(%random%%%9)+1
set z=puzzle.txt
set u=puzzle-solution.txt
(echo takuzu puzzle %r%:%\n%) > %z%
(echo takuzu puzzle %r% solution:%\n%) > %u%

:takuzu

set/a c=(%x%+1)%%6
set/a b=!random!%%2
set t=!m[%r%]:~%x%,1! &::
set s=!s!!t!
if !b! equ 0 (set p=!p!!t!) else (set p=!p!. )
if !c! equ 0 (
echo.!p!>> %z% & set p=
echo.!s!>> %u% & set s=
)
set/a x+=1 & if %x% lss 36 goto :takuzu

:done

start "" /min %u%
start "" %z%
endlocal & exit/b



--
later on,
Mike

https://busybox.hypermart.net

JJ

unread,
Jun 1, 2017, 8:56:26 AM6/1/17
to
On Thu, 1 Jun 2017 12:34:47 -0000 (UTC), Mike Sanders wrote:
> The Takuzu (or Binary) puzzle with 9 embedded puzzles...

Please post any batch file which is actually related to computer.

Mike Sanders

unread,
Jun 1, 2017, 9:20:58 AM6/1/17
to
JJ <jj4p...@vfemail.net> wrote:

> Please post any batch file which is actually related to computer.

Not sure I understand your comment, but if you're
suggesting I shouldn't post what I want, I'll tell
you straight up JJ:

I'll post whatever I damn feel like posting so
learn to deal with it right now...

Tom Del Rosso

unread,
Jun 4, 2017, 2:56:54 PM6/4/17
to
Mike Sanders wrote:
> JJ <jj4p...@vfemail.net> wrote:
>
>> Please post any batch file which is actually related to computer.
>
> Not sure I understand your comment, but if you're
> suggesting I shouldn't post what I want, I'll tell
> you straight up JJ:
>
> I'll post whatever I damn feel like posting so
> learn to deal with it right now...

Right. The group is for any batch programming, not just utility batch
programming. Many times people have posted scripts for non-utility
purposes. I think there was one that drew a Christmas tree on the
screen.



pro...@berkeley.edu

unread,
Jun 4, 2017, 6:27:11 PM6/4/17
to
C:\Users\JoeUser\temp>showme smiley
==========begin "c:\Cmd\util\smiley.cmd" ==========
01. @echo off & cls
02. echo/0000000000000000000000000000000000000000000000000000000000000000
03. echo/000000000000000000000000################000000000000000000000000
04. echo/0000000000000000000#####________________#####0000000000000000000
05. echo/000000000000000####__________________________####000000000000000
06. echo/0000000000000##__________________________________##0000000000000
07. echo/0000000000###______________________________________###0000000000
08. echo/000000000#____________________________________________#000000000
09. echo/0000000##__________#####________________######_________##0000000
10. echo/000000#___________#######______________########__________#000000
11. echo/00000#___________#########____________##########__________#00000
12. echo/0000#____________#########____________##########___________#0000
13. echo/000#_____________#########____________##########____________#000
14. echo/00#______________#########____________##########_____________#00
15. echo/00#_______________#######______________########______________#00
16. echo/0#_________________#####________________######________________#0
17. echo/0#____________________________________________________________#0
18. echo/0#____________________________________________________________#0
19. echo/0#____________________________________________________________#0
20. echo/0#____________________________________________________________#0
21. echo/0#____________________________________________________________#0
22. echo/0#____________________________________________________________#0
23. echo/0#____________________________________________________________#0
24. echo/00#_______#__________________________________________#_______#00
25. echo/00#_______##________________________________________##_______#00
26. echo/000#________###__________________________________###________#000
27. echo/0000#__________######______________________######__________#0000
28. echo/00000#_______________######################_______________#00000
29. echo/000000#__________________________________________________#000000
30. echo/0000000##______________________________________________##0000000
31. echo/000000000#____________________________________________#000000000
32. echo/0000000000###______________________________________###0000000000
33. echo/0000000000000##__________________________________##0000000000000
34. echo/000000000000000####__________________________####000000000000000
35. echo/0000000000000000000#####________________#####0000000000000000000
36. echo/000000000000000000000000################000000000000000000000000
37. echo/0000000000000000000000000000000000000000000000000000000000000000
==========end "c:\Cmd\util\smiley.cmd" ==========

--
Phil Robyn

Batchman

unread,
Jun 4, 2017, 6:55:43 PM6/4/17
to
pro...@berkeley.edu wrote:

> On Sunday, June 4, 2017 at 11:56:54 AM UTC-7, Tom Del Rosso wrote:
>> Right. The group is for any batch programming, not just utility batch
>> programming. Many times people have posted scripts for non-utility
>> purposes. I think there was one that drew a Christmas tree on the
>> screen.
>
> C:\Users\JoeUser\temp>showme smiley
> ==========begin "c:\Cmd\util\smiley.cmd" ==========
> 01. @echo off & cls

It was the same in ancient Rome, when the creative types are allowed to run
loose B*A*N*G goes the empire!

Mike Sanders

unread,
Jun 5, 2017, 1:46:43 PM6/5/17
to
Tom Del Rosso <fizzbin...@that-google-mail-domain.com> wrote:

> Right. The group is for any batch programming, not just utility batch
> programming. Many times people have posted scripts for non-utility
> purposes. I think there was one that drew a Christmas tree on the
> screen.

Oh yeah, bet ol' JJ was simply having a bad day, no biggie =)
Speaking only for myself, everyone should always feel free to
add to the mix (related content or not, its all good) when I
post something. I'd rather learn new things than keep it locked
down.

Have fun.

Mike Sanders

unread,
Jun 7, 2017, 7:38:55 AM6/7/17
to
> I think there was one that drew a Christmas tree on the screen.


@echo off & setlocal enabledelayedexpansion

:: just thinking aloud about animation...

set x[1]= o
set x[2]= o/
set x[3]=\o

set y[1]=^<^|^>
set y[2]=^<^|
set y[3]= ^|^>

set z[1]=/ \

set \n=^&echo.

:animate

set/a q+=1 & if !q! gtr 3 set/a q=1
@cls
echo !x[%q%]!%\n%!y[%q%]!%\n%!z[1]!
ping -n 2 -w 1 127.0.0.1 > nul
set/a c+=1 & if %c% lss 4 goto :animate

endlocal & exit/b
0 new messages