{"id":1133,"date":"2020-06-09T13:32:21","date_gmt":"2020-06-09T13:32:21","guid":{"rendered":"https:\/\/computerscienced.co.uk\/site\/?page_id=1133"},"modified":"2022-07-18T11:55:40","modified_gmt":"2022-07-18T11:55:40","slug":"towers-of-hanoi","status":"publish","type":"page","link":"https:\/\/computerscienced.co.uk\/site\/towers-of-hanoi\/","title":{"rendered":"Towers of Hanoi"},"content":{"rendered":"\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:33.33%\">\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/computerscienced.co.uk\/site\/wp-content\/uploads\/2021\/09\/undraw_Detailed_analysis_re_tk6j.svg\"><img loading=\"lazy\" decoding=\"async\" width=\"925\" height=\"570\" src=\"https:\/\/computerscienced.co.uk\/site\/wp-content\/uploads\/2021\/09\/undraw_Detailed_analysis_re_tk6j.svg\" alt=\"\" class=\"wp-image-2609\"\/><\/a><\/figure>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.66%\">\n<p>The Towers of Hanoi is a mathematical puzzle that consists of three rods and a number of disks of different sizes which can slide onto any rod. The puzzle starts with the disks in a neat stack in ascending order of size on one rod, the smallest at the top, thus making a conical shape.<\/p>\n\n\n\n<p>The objective is to move all the disks from one rod to another, obeying these rules:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li style=\"list-style-type:disc; margin:10px;\">Only one disk may be moved at a time.<\/li><li style=\"list-style-type:disc; margin:10px;\">No disk may be placed on top of a smaller disk.<\/li><li style=\"list-style-type:disc; margin:10px;\">A larger disk may not be placed on top of a smaller disk.<\/li><\/ul>\n\n\n\n<p>The puzzle can be solved by moving all the disks from one rod to another in as few moves as possible.<\/p>\n\n\n\n<p>The more blocks there are the more difficult the puzzle becomes.  <\/p>\n\n\n\n<p>This is a great puzzle to get you thinking logically about the sequence of events \/ moves that you are making.  <\/p>\n<\/div>\n<\/div>\n\n\n\n<hr class=\"wp-block-separator has-text-color has-title-color has-alpha-channel-opacity has-title-background-color has-background is-style-wide\"\/>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:33.33%\">\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-width wp-block-button__width-100\"><a class=\"wp-block-button__link\" href=\"https:\/\/computerscienced.co.uk\/site\/towers-of-hanoi-3-discs\/\">Towers of Hanoi 3 disks<\/a><\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.66%\">\n<p>The Towers of Hanoi puzzle using just 3 disks. Suitable for beginners to the Towers of Hanoi puzzle. <\/p>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:33.33%\">\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-width wp-block-button__width-100\"><a class=\"wp-block-button__link\" href=\"https:\/\/computerscienced.co.uk\/site\/towers-of-hanoi-4-discs\/\">Towers of Hanoi 4 disks<\/a><\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.66%\">\n<p>The Towers of Hanoi puzzle using 4 disks. Suitable for those who already know how the Towers of Hanoi puzzle works.  <\/p>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-columns is-layout-flex wp-container-core-columns-is-layout-9d6595d7 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:33.33%\">\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button has-custom-width wp-block-button__width-100\"><a class=\"wp-block-button__link\" href=\"https:\/\/computerscienced.co.uk\/site\/towers-of-hanoi-5-discs\/\">Towers of Hanoi 5 disks<\/a><\/div>\n<\/div>\n<\/div>\n\n\n\n<div class=\"wp-block-column is-vertically-aligned-center is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:66.66%\">\n<p>The Towers of Hanoi puzzle using 5 disks. Suitable for those who already know how the Towers of Hanoi puzzle works.  <\/p>\n<\/div>\n<\/div>\n\n\n\n<figure class=\"wp-block-image size-medium is-style-rounded\"><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"143\" src=\"https:\/\/computerscienced.co.uk\/site\/wp-content\/uploads\/2020\/06\/towersofhanoi-300x143.png\" alt=\"\" class=\"wp-image-1229\" srcset=\"https:\/\/computerscienced.co.uk\/site\/wp-content\/uploads\/2020\/06\/towersofhanoi-300x143.png 300w, https:\/\/computerscienced.co.uk\/site\/wp-content\/uploads\/2020\/06\/towersofhanoi-600x286.png 600w, https:\/\/computerscienced.co.uk\/site\/wp-content\/uploads\/2020\/06\/towersofhanoi.png 669w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/figure>\n\n\n\n<p class=\"has-small-font-size\"><strong>NB<\/strong> &#8211; the base for this code came from <a href=\"https:\/\/blogocode.wordpress.com\/\"><\/a><a href=\"https:\/\/bitbucket.org\/ninchester\/towers-of-hanoi\/src\/0db42396423d9bb15f542fbfc81302593e0a2db2\/TowersOfHanoi\/?at=master\">https:\/\/bitbucket.org\/ninchester\/towers-of-hanoi\/src\/0db42396423d9bb15f542fbfc81302593e0a2db2\/TowersOfHanoi\/?at=master<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Towers of Hanoi is a mathematical puzzle that consists of three rods and a number of disks of different&#8230;<\/p>\n","protected":false},"author":1,"featured_media":2609,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"disable_featured_image":true,"footnotes":""},"class_list":["post-1133","page","type-page","status-publish","has-post-thumbnail","hentry"],"blog_post_layout_featured_media_urls":{"thumbnail":["https:\/\/computerscienced.co.uk\/site\/wp-content\/uploads\/2021\/09\/undraw_Detailed_analysis_re_tk6j.svg",150,150,true],"full":["https:\/\/computerscienced.co.uk\/site\/wp-content\/uploads\/2021\/09\/undraw_Detailed_analysis_re_tk6j.svg",925,570,false]},"categories_names":null,"comments_number":"0","_links":{"self":[{"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/pages\/1133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/comments?post=1133"}],"version-history":[{"count":17,"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/pages\/1133\/revisions"}],"predecessor-version":[{"id":5675,"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/pages\/1133\/revisions\/5675"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/media\/2609"}],"wp:attachment":[{"href":"https:\/\/computerscienced.co.uk\/site\/wp-json\/wp\/v2\/media?parent=1133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}