how would i get the file below to display the number of moves by adding an output statement
after the call to move() in main() to display the value of moveNumber, which will be the number of the last move. Thanks!
#include <iostream>
#include <iomanip>
#include "timer.h"
using namespace std;
void move(unsigned n, unsigned & moveNumber,
char source, char destination, char spare);
int main()
{
Timer t;
const char PEG1 = 'A', // the three pegs
PEG2 = 'B',
PEG3 = 'C';
unsigned moveNumber = 0; // counts the moves
cout << "This program solves the Hanoi Towers puzzle.\n\n";
cout << "Enter the number of disks: ";
unsigned numDisks; // the number of disks to be moved
cin >> numDisks;
cout << endl;
t.start();
move(numDisks, moveNumber, PEG1, PEG3, PEG2); // the solution
t.stop();
cout << "The number of seconds processing was" <<
t << endl;
}