mirror of
https://github.moeyy.xyz/https://github.com/TheAlgorithms/C.git
synced 2023-10-11 15:56:24 +08:00
less code
This commit is contained in:
parent
8914128e13
commit
74c091b1aa
@ -5,11 +5,7 @@
|
|||||||
// Function for Tower of Hanoi algorithm
|
// Function for Tower of Hanoi algorithm
|
||||||
void hanoi(int noOfDisks, char where, char to, char extra)
|
void hanoi(int noOfDisks, char where, char to, char extra)
|
||||||
{
|
{
|
||||||
if (noOfDisks == 0)
|
if (noOfDisks != 0)
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
hanoi(noOfDisks - 1, where, extra, to);
|
hanoi(noOfDisks - 1, where, extra, to);
|
||||||
printf("Move disk : %d from %c to %c\n", noOfDisks, where, to);
|
printf("Move disk : %d from %c to %c\n", noOfDisks, where, to);
|
||||||
|
Loading…
Reference in New Issue
Block a user