Presentation is loading. Please wait.

Presentation is loading. Please wait.

Spring, 2009Purchase College/SUNY The Set Game Jeanine Meyer Mathematics/Computer Science Senior Seminar.

Similar presentations


Presentation on theme: "Spring, 2009Purchase College/SUNY The Set Game Jeanine Meyer Mathematics/Computer Science Senior Seminar."— Presentation transcript:

1 Spring, 2009Purchase College/SUNY The Set Game Jeanine Meyer Mathematics/Computer Science Senior Seminar

2 Spring, 2009Purchase College/SUNY Outline http://www.setgame.com My Flash implementation http://newmedia.purchase.edu/~Jeanine/as30/s etgameas3.html Tutorial/notes and other examples: http://newmedia.purchase.edu/~Jeanine/as30/fl ashas3labs.html Questions (mathematics and cognition)

3 Spring, 2009Purchase College/SUNY The Set Game Patterns (blocks) have 4 attributes: –Count: 1, 2 or 3 symbols –Shape: diamonds, ovals, swirls –Color: red, green, blue –Fill: empty, hatched, filled 3*3*3*3 = 81 possible blocks Board has 12 unique blocks

4 Spring, 2009Purchase College/SUNY The Set Game Goal is to indicate 6 sets. A set has blocks for which for each attribute –All the same or –All different

5 Spring, 2009Purchase College/SUNY The Set Game Play the game: http://www.setgame.com/set/puzzle_frame.htm

6 Spring, 2009Purchase College/SUNY My history Took several months to complete the game reliably –20 minutes…. –Seemed to be sudden jump to 2 to 4 minutes –Best times (under a minute) have occurred when I am tired ?????

7 Spring, 2009Purchase College/SUNY Implementation Always looking for [reasonably sized] applications to implement as lessons Flash ActionScript –Interplay of graphics in an.fla file and –setstuff folder (package) Board.as (class, linked to movie instance on Stage) Okbutton.as (class extends Simplebutton, no new behavior, created dynamically) Pattern.as (class, created dynamically)

8 Spring, 2009Purchase College/SUNY My game(s) Start at http://newmedia.purchase.edu/~Jeanine http://newmedia.purchase.edu/~Jeanine –See other examples, most with explanations

9 Spring, 2009Purchase College/SUNY Implementation Building a game is not playing the game Try to avoid need to play the game while building it. First step: producing a valid board –12 unique patterns with [at least or exactly?] 6 sets Set up checking, producing feedback to player, keeping time Set up to determine completion, with final time

10 Spring, 2009Purchase College/SUNY Encoding Pattern is a set of choices for shape, color, number and fill Use arrays of length 4 and also numbers (0 to 80) –Number goes to number-1 public static function encode3(can:Array):int { return can[0] * 27 + can[1] * 9 + can[2] * 3 + can[3]; }

11 Spring, 2009Purchase College/SUNY Algorithm for Board 3 times: –randomly define 2 new patterns –Determine/calculate the pattern that completes a set with these two patterns. NOTE: this always is possible. Think of attributes as dimensions. Two values define the third. If this pattern already is on the Board, re-do step. Make random choice from the 1 st 3 and 2 nd 3. Determine completing pattern. If new, add, else re-do. Make random choice from the 1 st 3 and 3 rd 3. Determine completing pattern. If new, add, else re-do Make random choice from the 2 nd 3 and 3 rd 3. Determine completing pattern. If new, add, else re-do Mix up all these patterns –NOTE: hold off while implementing.

12 Spring, 2009Purchase College/SUNY Pattern Dynamically created using algorithm in Board method (constructor called since Board symbol is linked to Board class) Pattern contains a pattern plus a check box –Event handle for checkbox goes to method that starts clock, if first one clicked, and –If 3 rd pattern checked, checks if a valid set. Check if a new set. If so, produces small version on the right. If not, produces feedback

13 Spring, 2009Purchase College/SUNY From checkcurrentseq for (f=0;f<4;f++) { if (firsta[f]==seconda[f]) { if (thirda[f]!=firsta[f]) { explain = Board.buildexplain(firsta[f],f,explain); ok = false; } } else { if ((firsta[f]==thirda[f])|| (seconda[f]==thirda[f])) { explain = Board.buildexplain(thirda[f],f,explain); ok = false; }

14 Spring, 2009Purchase College/SUNY Feedback to player Determine what was the problem with a player's attempt at a set. From code: private static functionbuildexplain(val:int,factor:int,explain:String):String { return explain + "Two "+FACTORS[factor]+ EXP[factor][val]+" and one does not."; } FACTORS and EXP are constants, see next slide.

15 Spring, 2009Purchase College/SUNY FACTORS and EXP static const FACTORS:Array = ["have ", "have color ","have ","have fill pattern "]; static const EXP:Array = [ ["diamonds","ovals","swirls"], ["red","green","blue"], ["one symbol","two symbols","three symbols"], ["empty", "hatched","filled"]];

16 Spring, 2009Purchase College/SUNY Generation of board Is there a better way? Is my way guaranteed to complete? –Always has, but… Can my way produce a board with more than 6 possible sets?

17 Spring, 2009Purchase College/SUNY Coding Graphics (movie clip symbols) in the.fla file Interplay of code in Board class and in Pattern class Better way?

18 Spring, 2009Purchase College/SUNY Cognition Is my development in playing the game (the jumps) typical? Is there an explanation for the phenomenon of doing-better-when-tired? –Possible to solve the puzzle using different parts of the brain?

19 Spring, 2009Purchase College/SUNY Discussion Brain calisthenics good for you! Comments? Thank you


Download ppt "Spring, 2009Purchase College/SUNY The Set Game Jeanine Meyer Mathematics/Computer Science Senior Seminar."

Similar presentations


Ads by Google