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