Page 1 of 1

Towers of Hanoi

Posted: Sun Jun 05, 2016 8:23 am
by dessony
Typed in from SYNTAX Oct. 1984 magazine. Enjoy this program! :)

Re: Towers of Hanoi

Posted: Thu Jun 09, 2016 4:13 pm
by zsolt
Hi,
It was a little bit buggy (movements from empty locations, missing column control at the end)
TowersOfHanoi.zip
so i made some little changes
(8.02 KiB) Downloaded 247 times

Code: Select all

 515 IF P(10,C)=0 THEN GOTO 800            ; disable moves from empty positions -> see pictures TOH1,TOH2,TOH3

 690 IF (R=6) AND (C<>1) THEN GOTO 720     ; check the column too -> see picture TOH4

 780 PAUSE 4E4                             ; here was E4E

 820 SAVE "TOWER[S]"                       ; the autorun is activated :-)
Zsolt

Re: Towers of Hanoi

Posted: Fri Jun 10, 2016 12:58 am
by dessony
Thanks!

The author, himself, confessed that this program needed more error-checking sections, error traps and add an anti-cheating loop putting the piece back and charge a player two moves. And try to use less array space without changing the 10 by 23 part of the DIM statements. Does N$ need 9-charactor strings? Does P need to be a number (7 bytes for each location)? :idea:

I think that the program is real cool. 8-)

Re: Towers of Hanoi

Posted: Fri Jun 10, 2016 7:50 am
by sirmorris
I always enjoy a good (or bad!) pun, and PAUSE 4E4 is one of the best.

4E4

geddit? forever? Hehe.

Re: Towers of Hanoi

Posted: Fri Jun 10, 2016 10:11 am
by dr beep
4e4, which is def. not forever.
"Just" 13 minutes and 20 sec.
(@ 50 Hz)

Re: Towers of Hanoi

Posted: Fri Jun 10, 2016 10:27 am
by dessony
The author decided to use this line (PAUSE 4E4) two times for his game program. :arrow: He also wrote the same exact game program for the TS2068. He also had a solution to this game. Anybody want the TS2068 program or the solution, please let me know.

Re: Towers of Hanoi

Posted: Thu Jun 23, 2016 8:06 am
by dessony
Scanned SYNTAX Oct. 1984 game program for TS1000,TS1500 and TS2068.
Printed T o H.pdf
T o H
(472.17 KiB) Downloaded 305 times

Re: Towers of Hanoi

Posted: Thu Jun 23, 2016 10:17 am
by siggi
dr beep wrote:4e4, which is def. not forever.
"Just" 13 minutes and 20 sec.
(@ 50 Hz)
Sorry Dr. Beep, that's wrong.
According to the manual (Chapter 19 - Time & motion)
"PAUSE n

stops computing & displays the picture for n frames of the television (at 50 frames per second, or 60 in America). n can be up to 32767, which gives you just under 11 minutes; if n is any bigger then it means 'PAUSE for ever'.
4E4=40000 > 32767

PAUSE 4E4 is commonly used to wait for any keypress (which terminates the "forever" PAUSE).

Siggi

http://www.worldofspectrum.org/ZX81BasicProgramming/

Re: Towers of Hanoi

Posted: Fri Jun 24, 2016 3:43 pm
by dr beep
siggi wrote:
dr beep wrote:4e4, which is def. not forever.
"Just" 13 minutes and 20 sec.
(@ 50 Hz)
Sorry Dr. Beep, that's wrong.
According to the manual (Chapter 19 - Time & motion)
"PAUSE n

stops computing & displays the picture for n frames of the television (at 50 frames per second, or 60 in America). n can be up to 32767, which gives you just under 11 minutes; if n is any bigger then it means 'PAUSE for ever'.
4E4=40000 > 32767

PAUSE 4E4 is commonly used to wait for any keypress (which terminates the "forever" PAUSE).

Siggi

http://www.worldofspectrum.org/ZX81BasicProgramming/
Busted as a Spectrum-starter where we use PAUSE 0

Re: Towers of Hanoi

Posted: Wed Aug 24, 2016 4:36 pm
by zsolt
Hi,

This project inspired me to create an 1k version of the game (before Pokemon asks, "just because" :mrgreen: ).
The first attempts in BASIC were unsuccessful, so I wrote a machine code version (see TOH1Kgzs.P in the attachment).
But now i am proud to present a well playable, fast enough 1K BASIC variant: :D

- all necessary parameters of the game board (and the disk-shapes too) are stored in a long string
- the numerical constants come from character-code expressions or from some simple functions using PI
TOH1KBAS_5D.png
TOH1KBAS_5D.png (38.61 KiB) Viewed 5856 times
This little video shows both games in action.

Enjoy,
Zsolt

ps: I found some other variants from 80's:

on Simon Holdsworth's page a solver

on Berto's ZX-81 Page a game

on Old Games Finder

- a game: "Tower of Hanoi, The (1983)(Kenneth Baker).zip"
- a solver: "Towers of Hanoi (19xx)(Logical Computers).zip"

on THE TYPE FANTASTIC a game