Oberon Community Platform Forum
October 13, 2019, 08:50:22 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Recursively solving the Towers of Hanoi in Oberon-2  (Read 3276 times)
Wouter
Newbie
*
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 357 times.)
« Last Edit: December 05, 2010, 07:41:00 PM by Wouter » Logged
Pages: [1]
  Print  
 
Jump to:  

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