ScratchData LogoScratchData
Back to crkcity's profile

tic-tac-toe

CRcrkcity•Created May 15, 2018
tic-tac-toe
5
2
198 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.

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. The NetLogo version of (on flockecogames.com) 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. This program is part of a course offered through www.flockecogames.com

Project Details

Project ID222981184
CreatedMay 15, 2018
Last ModifiedDecember 7, 2018
SharedMay 15, 2018
Visibilityvisible
CommentsAllowed