HPS321H1 Lecture Notes - Lecture 10: Connect Four

35 views3 pages

Document Summary

We plan on using a series of nested loops to do game logic. Note we call our balls a and the opponent"s balls b. If (3 a balls in a row & a can make a connect 4 & column not full): Else if (3 b balls in a row & b can make a connect 4 & column not full) Else if {2 a balls in a row & a can connect 3 balls & column not full) Else if {2 b balls in a row & b can connect 3 balls & column not full) {block potential 3 b balls in a row} Else if {1 a ball & a can connect 2 balls & column not full} If (more than 2 open spaces on any side side) {place ball on side with more open spaces} Else if (no ball on top & column not full) Else if (ball on top & columns not full)

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents