Oberon Community Platform Forum
December 07, 2019, 07:01:17 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
   Home   Help Search Login Register  
Pages: [1]
Author Topic: Recursively solving the Towers of Hanoi in Oberon-2  (Read 3351 times)
Posts: 1

« on: December 05, 2010, 06:49:13 PM »

Hi, I've been working on this recursive way to solve a game of the Towers of Hanoi in Oberon-2. I seem to have made an error somewhere, but cannot for the love of me find it. I know there's probably something wrong with the way I am moving the disks around, because I am able to get as far as taking of the top disk and placing it onto the third tower but then I get a TRAP error (access violation). If I make the tower parameters (which are RECORDS, see code below) variable, I get one step further: moving the second disk onto the second tower. But then, TRAP. My programming code can be found in the .arc-file attached.

* Hanoi.Arc (2.99 KB - downloaded 370 times.)
« Last Edit: December 05, 2010, 07:41:00 PM by Wouter » Logged
Pages: [1]
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!