Tower of Hanoi problem
Sunday, March 29, 2020
Solution in C #include <stdio.h>#include <assert.h> /* To debug, define SIMULATE DEBUG or SIMULATE DEBUG ASSERT */ #define PILLAR_SIZE 10 #define PILLAR_NUM 3 #define PLATE_NUM 5 typedef struct hanoi_tower { int pillars[PILLAR_NUM][PILLAR_SIZE + 1]; /* position 0 will not be used*/ int offsets[PILLAR_NUM]; } hanoi_tower; typedef enum pillar {x, y, z} pillar; char pillar_names[PLATE_NUM] = {'x', 'y', 'z'}; typedef int counter; void status(hanoi_tower *ht) { for (pillar i = x;…more