Move_disk from= from to= to disk_number= disks Hanoi_move from= from temp= to to= temp disks= disks-1 I assume that you are familiar with the classic recursive Hanoi algorithm: procedure hanoi_move(from, temp, to, disks): However – moving disks all day might be getting boring soon and so the priests could just calculate the a position to skip 28800 steps (the number of moves that would be performed in an 8 hour shift with a rate of one move per second), rearrange the disks accordingly to the results and then take the rest of the day off. I don’t think that bringing the world to an early end is in their interest. The priests of Brahma might not necessarily use this formula to accelerate the process. In order to do so one just needs an algorithm to calculate the state (positions of all disks) of the game for a given move number. However – solving a Tower of Hanoi game with 64 disks move by move needs a long time and so one might want a solution for skipping a few billion moves. Many people have published algorithms for solving a towers of Hanoi game move by move. Unless of course the priests of Brahma do use the information here to play wrong. Fortunately a Tower of Hanoi game with 64 disks needs about 585 billion years when one is moving one disk per second and our sun will evolve into a red giant and then a white dwarf in about 5 billion years, so you we shouldn’t worry about the priests of Brahma finishing the game before you have finished whatever you think is important to finish in a mens life. Unfortunately the world will end when the last move of their game has been made. 2 How does it work? What is this formula about?Īccording to a legend the priests of Brahma are playing a Tower of Hanoi game with 64 disks.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |