Logic2-MohammedAl-Saadi (1)

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
ExploreRoom-A Declare Variables: totalTime maxGames gameCount v | | | | | | | | the user grabs the Black Box: RandomBinary MakeMove CheckWinner ClearBoard handheld "X" and "O" game machine v call RandomBinary to determine which player should go first Room-A player Player-1 Player-2 winner overAllWinner symbol symbolX symbolO 2_| set player-1 = player set player-2 = player l prompt "please select a symbol "X" or "O" A computer select a symbol set symbol=symbolX user selection ? set symbol = symbolX set symbol = symbolO | | ! let computer use the alternate symbol eached maximum game count? eCount = maxGal Start game add game to game Count gameCount +1 3——> display "It's a Tie" a winner has bee announced? all checkWinner, player select a square call MakeMove «<—0 totalTime=totalTime+4 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 "Sorry , you lost the best 5 games" “display "you win the best 5 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