wheel_skeleton.cpp - / Author: Brian Choi...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
// Author: Brian Choi (schoi@cs.ucla.edu) // CS 31 Practice. #include <cassert> #include <cctype> #include <cstdlib> #include <cstring> #include <ctime> #include <fstream> #include <iostream> #include <vector> using namespace std; class WheelOfFortune { public: WheelOfFortune(const char* puzzle); ~WheelOfFortune(); bool resetPuzzle(const char* puzzle); int guess(char c); bool solvePuzzle(const char* puzzle); void printPuzzle() const; bool solved() const; private: bool validPuzzle(const char* puzzle) const; char* m_solution; // Solution. char* m_solvedPuzzle; // (Maybe partially) solved puzzle. }; WheelOfFortune::WheelOfFortune(const char* puzzle) { m_solution = NULL; m_solvedPuzzle = NULL; assert(resetPuzzle(puzzle)); // Initial puzzle must be valid. } WheelOfFortune::~WheelOfFortune() { // TODO: Implement the destructor. } bool WheelOfFortune::resetPuzzle(const char* puzzle) { if (validPuzzle(puzzle)) { // TODO: If "puzzle" is a valid word puzzle, reset the solution and // m_solvedPuzzle, and return true. Otherwise, don't do anything and return // false. return true; } return false;
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
} int WheelOfFortune::guess(char c) { // If c is not a letter, return 0. if (!isalpha(c))
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/06/2011 for the course CS 31 taught by Professor Melkanoff during the Spring '00 term at UCLA.

Page1 / 5

wheel_skeleton.cpp - / Author: Brian Choi...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online