ws9

jpg

School

Seneca College *

*We aren’t endorsed by this school

Course

145

Subject

Computer Science

Date

Jan 9, 2024

Type

jpg

Pages

1

Uploaded by DeanOwl3040

Report
Data Structure Black Box: RandomBinary MakeMove CheckWinner ClearBoard Room-A player Player-1 Player-2 winner overAllWinner symbol symbolX symbolO ExploreRoom-A Declare Variables: totalTime maxGames gameCount v the user grabs the handheld "X" and "O" game machine v call RandomBinary to determine which player should go first set player-1 = player l set player-2 = player prompt "please select a symbol "X" or"o" user selection ? computer select a symbol set symbol=symbolX set symbol = set symbol = symbolX symbolO let computer use the alternate symbol eached maximum No game count? eCount = maxGal Start game add game to game Count gameCount +1 player select a square call MakeMove totalTime=totalTime+4 ) 3= display "It's a Tie" a winner has bee announced? all checkWinner, display "sorry you lost" totalTime =totalTime +15 1 v display "Winner!" player-1 = winner |remove all "X"s and "O"s call ClearBoard ayer win the best of 5 games? overAllWinner = winner >2 display "you win the best 5 | games" display "Sorry , you lost the best 5 games" display "your total explore time is totalTime"
Discover more documents: Sign up today!
Unlock a world of knowledge! Explore tailored content for a richer learning experience. Here's what you'll get:
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help