{"id":5262,"date":"2025-01-09T14:09:34","date_gmt":"2025-01-09T13:09:34","guid":{"rendered":"https:\/\/www.islandwalking.com\/wordpress\/?p=5262"},"modified":"2025-01-09T14:47:15","modified_gmt":"2025-01-09T13:47:15","slug":"tower-of-hanoi-on-a-ti-84-plus-ce-t","status":"publish","type":"post","link":"https:\/\/www.islandwalking.com\/wordpress\/tower-of-hanoi-on-a-ti-84-plus-ce-t\/","title":{"rendered":"Tower of Hanoi on a TI-84 Plus CE-T"},"content":{"rendered":"<p>The <a href=\"https:\/\/en.wikipedia.org\/wiki\/Tower_of_Hanoi\">Tower of Hanoi<\/a> is something I &#8220;have to&#8221; do on any calculator I encounter, but using Python feels almost like cheating, it is just too easy. Unfortunately there is little else of interest for this task on this calculator.<\/p>\n<blockquote>\n<pre>def hanoi(n,a,b,c):\r\n  if n==1:\r\n    print(a,\" &gt;&gt; \",b)\r\n  else:\r\n   hanoi(n-1,a,c,b)\r\n   hanoi(1,a,b,c)\r\n   hanoi(n-1,c,b,a)\r\n\r\nhanoi(3,1,2,3)<\/pre>\n<\/blockquote>\n<p>To fit it on one screen we are just moving 3 disks from peg 1 to peg 2, using peg 3 as a helper:<\/p>\n<p><a href=\"https:\/\/www.islandwalking.com\/wordpress\/wp-content\/uploads\/2025\/01\/Capture-1-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5263\" src=\"https:\/\/www.islandwalking.com\/wordpress\/wp-content\/uploads\/2025\/01\/Capture-1-1.png\" alt=\"\" width=\"324\" height=\"244\" srcset=\"https:\/\/www.islandwalking.com\/wordpress\/wp-content\/uploads\/2025\/01\/Capture-1-1.png 324w, https:\/\/www.islandwalking.com\/wordpress\/wp-content\/uploads\/2025\/01\/Capture-1-1-300x226.png 300w\" sizes=\"auto, (max-width: 324px) 100vw, 324px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Tower of Hanoi is something I &#8220;have to&#8221; do on any calculator I encounter, but using Python feels almost like cheating, it is just too easy. Unfortunately there is little else of interest for this task on this calculator. def hanoi(n,a,b,c): if n==1: print(a,&#8221; &gt;&gt; &#8220;,b) else: hanoi(n-1,a,c,b) hanoi(1,a,b,c) hanoi(n-1,c,b,a) hanoi(3,1,2,3) To fit it &hellip; <a class=\"read-excerpt\" href=\"https:\/\/www.islandwalking.com\/wordpress\/tower-of-hanoi-on-a-ti-84-plus-ce-t\/\">Continue reading <span class=\"meta-nav\">&raquo;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5262","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.islandwalking.com\/wordpress\/wp-json\/wp\/v2\/posts\/5262","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.islandwalking.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.islandwalking.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.islandwalking.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.islandwalking.com\/wordpress\/wp-json\/wp\/v2\/comments?post=5262"}],"version-history":[{"count":3,"href":"https:\/\/www.islandwalking.com\/wordpress\/wp-json\/wp\/v2\/posts\/5262\/revisions"}],"predecessor-version":[{"id":5266,"href":"https:\/\/www.islandwalking.com\/wordpress\/wp-json\/wp\/v2\/posts\/5262\/revisions\/5266"}],"wp:attachment":[{"href":"https:\/\/www.islandwalking.com\/wordpress\/wp-json\/wp\/v2\/media?parent=5262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.islandwalking.com\/wordpress\/wp-json\/wp\/v2\/categories?post=5262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.islandwalking.com\/wordpress\/wp-json\/wp\/v2\/tags?post=5262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}