ScratchData LogoScratchData
Back to crkcity's profile

tic-tac-toe-bugs

CRcrkcity•Created May 16, 2018
tic-tac-toe-bugs
0
0
23 views
View on Scratch

Instructions

Click the flag. On your turn (indicated in upper left), click on your chosen space. Once a player, X or O, has three in a row, the game is over. We use a Spider for an X and a Ladybug for an O.

Description

Chris Keane wrote this, using a "ghost" sprite that you don't see, that counts Xs and Os in a row. See our more complete simulations of tic-tac-toe in NetLogo and Python at www.flockecogames.com The comparison of this Scratch version with the versions in NetLogo and Python should be instructive. NetLogo has a built in neighbor counter, so we only need a few lines of code to make tic tac toe work. The Python version is more complex. This Scratch program here requires a few more commands because there is no built in neighbor counter or row counter. Instead we have a sprite (what I call a "ghost sprite") move around to count the Xs and Os. This Scratch version has a sprite, colored white as a ghost so you don't see it, that travels down all the rows columns and diagonals checking for three blue in a row or three red in a row, taking advantage of the color detector in Scratch. This "ghost" sprite is a simple pattern detector. Kathy drew a Ladybug, which is like an O, once abstracted. The Spider, when abstracted, is like an X. This program is part of our course (see www.flockecogames.com)

Project Details

Project ID223527500
CreatedMay 16, 2018
Last ModifiedMay 16, 2018
SharedMay 16, 2018
Visibilityvisible
CommentsAllowed