{"id":21280101,"url":"https://github.com/arezyhs/cplusplus-simple-hanoi-tower","last_synced_at":"2025-07-08T01:42:02.006Z","repository":{"id":206813181,"uuid":"717758390","full_name":"arezyhs/cplusplus-simple-hanoi-tower","owner":"arezyhs","description":"The Tower of Hanoi is a classic mathematical puzzle that involves moving a stack of disks from one peg (tower) to another, subject to the constraint that only one disk can be moved at a time and no disk can be placed on top of a smaller disk.","archived":false,"fork":false,"pushed_at":"2023-11-12T22:17:41.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T04:11:07.181Z","etag":null,"topics":["cplusplus","hanoi-towers"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arezyhs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-12T13:58:52.000Z","updated_at":"2023-11-12T14:07:27.000Z","dependencies_parsed_at":"2023-11-12T15:52:25.508Z","dependency_job_id":"aa0cda75-ca49-48aa-9513-107ef5972607","html_url":"https://github.com/arezyhs/cplusplus-simple-hanoi-tower","commit_stats":null,"previous_names":["arezyhs/cplusplus-simple-hanoi-tower"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arezyhs%2Fcplusplus-simple-hanoi-tower","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arezyhs%2Fcplusplus-simple-hanoi-tower/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arezyhs%2Fcplusplus-simple-hanoi-tower/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arezyhs%2Fcplusplus-simple-hanoi-tower/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arezyhs","download_url":"https://codeload.github.com/arezyhs/cplusplus-simple-hanoi-tower/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243738955,"owners_count":20339997,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cplusplus","hanoi-towers"],"created_at":"2024-11-21T10:28:05.432Z","updated_at":"2025-03-15T13:46:02.857Z","avatar_url":"https://github.com/arezyhs.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hanoi Tower\n\n\u003ch2\u003eIntroduction:\u003c/h2\u003e\nThis repository contains an implementation of the Tower of Hanoi problem in C++. The Tower of Hanoi is a classic mathematical puzzle that involves moving a stack of disks from one peg (tower) to another, subject to the constraint that only one disk can be moved at a time and no disk can be placed on top of a smaller disk.\n\n\u003ch2\u003eCode Overview!\u003c/h2\u003e\nThe main implementation of the Tower of Hanoi problem is encapsulated in the menaraHanoi function. The function takes four parameters: n (the number of disks), menaraAwal (the source tower), menaraTengah (the auxiliary tower), and menaraAkhir (the destination tower).\n\n\u003ch2\u003eRecursive Approach\u003c/h2\u003e\nThe solution employs a recursive approach to solve the Tower of Hanoi problem. When the number of disks (n) is equal to 1, the function prints a message indicating the move of the disk from the source tower to the destination tower. Otherwise, it recursively moves n-1 disks from the source tower to the auxiliary tower, then moves the remaining disk to the destination tower, and finally, recursively moves the n-1 disks from the auxiliary tower to the destination tower.\n\n\u003ch2\u003eUser Interaction\u003c/h2\u003e\nThe main function prompts the user to input the number of disks (n) they would like to solve the Tower of Hanoi problem for. It then calls the menaraHanoi function with the specified parameters and displays the sequence of moves required to solve the problem.\n\n\u003ch2\u003eUsage\u003c/h2\u003e\nTo use the program, compile the source code and run the executable. Enter the desired number of disks when prompted, and the program will output the step-by-step instructions to solve the Tower of Hanoi problem for the specified number of disks.\n\nFeel free to explore, modify, and build upon this implementation as needed. Contributions and improvements are welcome. Happy coding!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farezyhs%2Fcplusplus-simple-hanoi-tower","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farezyhs%2Fcplusplus-simple-hanoi-tower","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farezyhs%2Fcplusplus-simple-hanoi-tower/lists"}