;;;; SUMMARY ;; A game of clicking and sorting ;;;; COPYRIGHT ;; Copyright (C) 2006, James P. Steiner ;; ;; ;; __extensions [ "sound.jar" ] ;; to activate sound effects, remove uncomment the previous line globals [ click? click-start click-end selected1 selected2 patch1 patch2 game-mode high-score goal-score score last-swap-time ;; the time of the last successful swap (or rather, the last explode from that swap) suggested ;; a thing that the computer suggests you might like to click cascade-counter ;; counts the number of continuous test/explode/drop cycles before going normal again message-patch ;; patch that is the target of messages to player message-text ;; the text of the message message-index ;; message-length playfield ;; patches in the play field combo-list pixels-per-patch ;; set to match view settings, to enable accurate single-pixel movement one-pixel ;; 1 / pixels-per-patch -- the increment that moves a coordinate one pixel play-height ;; height, in patches of the playfield play-width ;; height, in patches, of the playfield play-min-pycor ;; bottom row of the playfield play-max-pycor ;; top-row of the playfield play-min-pxcor ;; left-most column of the playfield play-max-pxcor ;; right-most column of the play-field sound-on? sound-q ;; contains the sound playing instructions to run ] breed [ things thing ] breed [ logos logo ] things-own [ index ;; what shape and color? selected? ;; deprectated dir ;; the direction of the color pulse me-mode ;; the current mode of this thing ] to startup setup end to setup global-safe-clear-all setup-constants setup-playfield set sound-q "" set sound-on? false carefully [ run " set sound-on? is-list? instruments "] [ ] ;; setup-items update-score 0 send-message "Get Ready!" set click? false set game-mode "f" while [ game-mode = "f" ] [ go set plabel-of message-patch "" set message-text "" set message-index 0 set score 0 update-score 0] ;; go once to make the first fill happen let matched! things with [ count ((things at-points [[ -1 0 ][ 1 0 ]]) with [index = index-of myself ]) = 2 or count ((things at-points [[ 0 -1 ][ 0 1 ]]) with [index = index-of myself ]) = 2 ] while [ any? matched! ] [ ask matched! [ set-shape-and-color ] set matched! things with [ count ((things at-points [[ -1 0 ][ 1 0 ]]) with [index = index-of myself ]) = 2 or count ((things at-points [[ 0 -1 ][ 0 1 ]]) with [index = index-of myself ]) = 2 ] ] set game-mode "n" send-message "Click PLAY to begin!" set message-index message-length - 1 update-messages ;; carefully (and in a way that will compile if the ;; sound.jar extension is not installed ) ;; see if sounds are available end to global-safe-clear-all ;; saves the state of some variables in local variables ;; then uses clear-all ;; then restores those variables from the local variables let save-high-score high-score ca set high-score save-high-score end to setup-constants set pixels-per-patch 25 ;; set to match view settings, to enable accurate single-pixel movement set one-pixel 1 / pixels-per-patch ;; 1 / pixels-per-patch -- the increment that moves a coordinate one pixel set play-min-pycor min-pycor + 1 ;; bottom row of the playfield set play-max-pycor max-pycor - 1 - 3 - 1 ;; top-row of the playfield set play-min-pxcor min-pxcor + 1 ;; left-most column of the playfield set play-max-pxcor max-pxcor - 1 - 3 - 1 ;; right-most column of the play-field set play-height play-max-pycor - play-min-pycor ;; height, in patches, of the playfield set play-width play-max-pxcor - play-min-pxcor ;; width, in patches, of the playfield set message-patch patch-at (play-max-pxcor ) (play-max-pycor + 1) set playfield patches with [ pxcor >= play-min-pxcor and pxcor <= play-max-pxcor and pycor >= play-min-pycor and pycor <= play-max-pxcor ] set combo-list generate-valid-combos end to setup-playfield ;; draw background-color (borders) ask patches [ set pcolor brown - 4 + .5 * scale-color gray pycor min-pycor max-pycor ] ;; draw top / logo area ask patches with [ pycor < max-pycor and pycor > play-max-pycor + 1 and pxcor > min-pxcor and pxcor < max-pxcor ] [ set pcolor sky - 2 ] ;; draw score area ask patches with [ pxcor > play-max-pxcor + 1 and pxcor < max-pxcor and pycor > play-max-pycor - 2 and pycor <= play-max-pycor ] [ set pcolor lime - 2 ] ;; draw (clear) playfield ask playfield [ set pcolor 1 + 1 * ((pxcor + pycor) mod 2) ] ;; create logo turtle cct-logos 1 [ set shape "logo1" setxy (min-pxcor + .30 * world-width) ( max-pycor - .5 * (max-pxcor - (play-max-pxcor + 1) )) set size world-width * .45 set color yellow set heading -5 ] ;; create logo turtle cct-logos 1 [ set shape "logo2" setxy (min-pxcor + .66 * world-width) ( max-pycor - .5 * (max-pxcor - (play-max-pxcor + 1) )) set size world-width * .45 set color orange + 2 set heading -5 ] ;; copyright ask patch max-pxcor min-pycor [ set plabel-color brown set plabel "Copyright (C) 2006 James P. Steiner " ] end to setup-items ;; deprecated ;; fills the playfield with items ask playfield [ fill-me ] end to go ;; the main program loop runs the game. ;; all game activities are coded iterively, ;; so the ifelse chain below makes sure the right ;; iterated procedure occurs at the right time. ;; each procedure changes the mode to ;; the correct subsequent mode every 1 / 10 [ no-display update-messages ifelse game-mode = "s" ;; swap [ swap ][ ifelse game-mode = "ts" or game-mode = "ta" or game-mode = "taf";; test selected, test all [ test game-mode ][ ifelse game-mode = "u" ;; unswap (no match) [ swap ][ ifelse game-mode = "e" ;; explode [ explode ][ ifelse game-mode = "d" ;; drop [ drop "ta" ][ ifelse game-mode = "f" ;; fill [ fill ][]]]]]] ] ifelse game-mode = "n" ;; normal [ ifelse auto-play? [ auto-play ] [ mouse pulse-pick ] ifelse timer - last-swap-time >= hint-speed and timer - last-swap-time < hint-speed + 5 [ ;; some seconds after last move, suggest a move for some seconds ifelse is-agentset? suggested [ ;; if suggestion exists, just display it ask suggested [ pulse-me ] ] [ ;; otherwise, create a suggestion make-suggestion ] ] [ if is-agentset? suggested [ ;; not time for suggestion, but a suggestion exists, means the end of suggestion time. ;; so clear suggestion and reset timer clear-suggestion ;;reset timer, so another hint appears in a few seconds set last-swap-time timer ] ] ][ if game-mode = "x" [ ;; if game-mode = "x" ;; game-over ask message-patch [ set plabel-color white set plabel "No more moves! Click RESET to restart." ] stop ] ] if sound-on? = true [ if sound-q != "" [ carefully [ run sound-q ] [] set sound-q "" ] ] display end to mouse ;; handles all mouse events ifelse mouse-down? [ mouse-down ] [ mouse-up ] end to mouse-down ;; handles events that happen when the mouse is down ifelse click? [ ] [ set click? true set click-start patch-at mouse-xcor mouse-ycor ] end to mouse-up ;; handles events that happen when the mouse is up ifelse click? [ ;; mouse click / drag complete let drag? false set click? false set click-end patch-at mouse-xcor mouse-ycor ifelse is-turtle? selected1 and click-end = click-start [ ;; click 2 of 2 click sequence\ ;; selected 1 are turtle from last click, ;; and start turtle from this click set selected2 one-of turtles-on click-start set patch2 click-start ] [ ;; either single click, or click-n-drag ;; either way, selected1 is from the start patch of this click if is-turtle? selected1 [ ask selected1 [ fix-color] ] set selected1 one-of turtles-on click-start set patch1 click-start ifelse click-end = click-start [ ;; click in place, just a selection ] [ ;; drag, set selection2 from direction set drag? true let xdrag pxcor-of click-end - pxcor-of click-start let ydrag pycor-of click-end - pycor-of click-start ifelse abs xdrag > abs ydrag [ set ydrag 0 ] [ set xdrag 0 ] set xdrag sign xdrag set ydrag sign ydrag set patch2 value-from patch1 [ patch-at xdrag ydrag ] set selected2 one-of turtles-on patch2 ] ] if is-turtle? selected1 [ queue-sound (one-of ["LOW WOOD BLOCK" "HI WOOD BLOCK"]) volume ] if is-turtle? selected2 [ ifelse value-from patch1 [ any? neighbors4 with [ self = patch2 ] ] [ ask selected1 [ face patch2 ] ask selected2 [ face patch1 ] set game-mode "s" ;; swap if is-agentset? suggested [ clear-suggestion ] ] [ ;; if a drag, clear selections ifelse drag? [ clear-selection ] [ ;; otherwise, set selected1 to selected2 ;; i.e. second click becomes new first click ask selected1 [ fix-color ] set selected1 selected2 set patch1 patch2 set selected2 nobody set patch2 nobody ] ] ] ] [ ;; mouse-down, drag, etc in progress ;; nothing at the moment ] end to fix-color ;; returns the color of the calling item to ;; the center tint of that HUE set color color - ( color mod 10 ) + 5 end to-report sign [ value ] ;; reports the sign of the given number ifelse value = 0 [ report 0 ] [ ifelse value < 0 [ report -1] [ report 1 ] ] end to swap ;; causes the things stored in selection1 and selection2 ;; to swap positions let swap-done? false let step-size .25 ask selected1 [ pulse-me face patch2 jump step-size ;; rather than assume that if abs (xcor - pxcor-of patch2) < step-size and abs (ycor - pycor-of patch2) < 5 * one-pixel [ set swap-done? true ] ] ask selected2 [ pulse-me face patch1 jump step-size if abs (xcor - pxcor-of patch1) < step-size and abs (ycor - pycor-of patch1) < 5 * one-pixel [ set swap-done? true ] ] if swap-done? [ ask selected1 [ setxy pxcor pycor set heading 0 fix-color ] ask selected2 [ setxy pxcor pycor set heading 0 fix-color ] if game-mode = "s" [ set game-mode "ts" ] ;; test after swap if game-mode = "u" [ set game-mode "n" ;; normal after unswap clear-selection ] ] end to unswap-start ;; prepares for swap to do an unswap, ;; by reversing selection1 and 2 ;; (leaving patch1 and 2 alone) let temp-s1 selected1 set selected1 selected2 set selected2 temp-s1 set game-mode "u" queue-sound "Long Guiro" volume end to clear-selection ;; clears the selected status of any selected turtles. ;; also fixes the colors, in case the items have been pulsed. if is-turtle? selected1 [ ask selected1 [ fix-color ] ] if is-turtle? selected2 [ ask selected2 [ fix-color ] ] set selected1 nobody set selected2 nobody set patch1 nobody set patch2 nobody end to drop [ next-mode ] ;; causes all things that have space below them to fall ;; also used by fill to cause newly created things to fall into position ;; the "next-mode" indicates whether the next mode will be ;; "ta" (test all), as after an explode/drop, ;; or "f" again, as after a fill/drop let drop-step 1 ask things with [ pycor > play-min-pycor and not any? turtles at-points [ [ 0 -1 ] ] ] [ set me-mode "d" ] ifelse any? things with [ me-mode = "d" ] [ ask things with [ me-mode = "d" ] [ set ycor ycor - drop-step ;if abs ( ycor - pycor) < drop-step ;[ setxy pxcor pycor if pycor = play-min-pycor or any? turtles at-points [ [ 0 -1 ] ] [ set me-mode "i" ] ;;] ] ] [ set game-mode next-mode ;; test or fill again when drops completed ] end to pulse-pick ;; causes the first selected thing to pulse, ;; showing that it is selected if is-turtle? selected1 [ ask selected1 [ pulse-me ] ] end to pulse-me ;; occilates the brightness of the calling turtle set color color + dir if (color * 10) mod 100 >= 90 or (color * 10 ) mod 100 < 10 [ set dir dir * -1 ] end to test [ who? ] ;; manages the test process ;; asks all things to test themselves. ;; if groups that need to explode are found, updates the cascade counter ;; and score based on the number of things exploding, and the cascade counter ;; if nothing needs to explode, then either goes into fill mode, or back to normal mode ;; either test all (after fill ) ;; or test just the selected (swapped) items ifelse who? = "ta" or who? = "taf" [ ask things [ test-me [] ] ] [ ask selected1 [ test-me [] ] ask selected2 [ test-me [] ] ] ifelse any? things with [ me-mode = "e" ] [ clear-selection set last-swap-time timer set cascade-counter cascade-counter + 1 update-score (10 * cascade-counter * count things with [ me-mode = "e" ]) set game-mode "e" ask things with [ me-mode = "e" ] [ explode-me-start ] ] [ ;; nothing to explode ifelse is-turtle? selected1 [ ;; if a selected turtle exists, here ;; this test is the result of a user swap, ;; so we need to unswap unswap-start ] [ ifelse game-mode = "taf" [ ;; this test was started by the fill function, ;; and didn't cause any cascades. Go back to normal mode set game-mode "n" ] [ ;; this test is the result of a swap or cascade ;; (i.e. after swap, test, explode, drop, test cycle) ;; which probably left open spaces ;; so we need to fill set game-mode "f" ; fill if needed ] ] ] end to test-me [ queue ] ;; used recursively by the item to test whether the item is part of a shape group ;; the queue is used to prevent testing loops ;; looks to see if there are like-shaped items above (and below) the item, ;; or on both sides of the item. ;; uses the INDEX to compare, so that the actual shapes can be diffent (ie, a mix of animals and shapes) ;; If so, those matches are asked to test themselves, thus ;; ensuring that chains of like-colored items are properly detected. if member? self queue [ stop ] let above ( turtles-on patches at-points [ [ 0 1 ] [ 0 -1 ] ] ) with [ index = index-of myself ] let beside ( turtles-on patches at-points [ [ 1 0 ] [ -1 0 ] ] ) with [ index = index-of myself ] set queue lput self queue if any? beside [ ifelse count beside = 1 and me-mode != "e" ;; in an explode group [ ask beside [ test-me queue ] ] [ if count beside = 2 [ set me-mode "e" ;; in a group ask beside with [ me-mode != "e" ] [ set me-mode "e" test-me queue ] ] ] ] if any? above [ ifelse count above = 1 and me-mode != "e" [ ask above [ test-me queue ] ] [ if count above = 2 [ set me-mode "e" ask above with [ me-mode != "e" ] [ set me-mode "e" test-me queue ] ] ] ] end to explode ;; manages animation of all exploding items ;; when all exploding items have vanished, switches to DROP mode if any? things with [ me-mode = "e" ] [ queue-sound "VibraSlap" volume ] ask things with [ me-mode = "e" ] [ explode-me ] if not any? things with [ me-mode = "e" ] [ set game-mode "d" ] ;; drop end to explode-me-start ;; prepares an exploded item for the explosion animation set color white set index 0 set shape (word "explode" index) end to explode-me ;; animates an exploded item, then removes it ifelse index < 3 [ set index index + 1 set shape (word "explode" (int (index mod 2))) ] [ die ] end to fill ;; this procedure looks for and fills empty spaces. ;; if empty spaces exist, then ;; empty spaces across the top are filled ;; and all are allowed to drop ;; this works because until the newly made and dropping items fall below ;; into the next row (if they need to), they make the top row not empty. set cascade-counter 0 ifelse any? playfield with [ not any? turtles-here ] [ let spaces ( playfield with [ pycor = play-max-pycor and not any? turtles-here ] ) if any? spaces [ ask spaces ;; one-of spaces [ fill-me ] ] drop "f" ] [ set game-mode "taf" ;; test all ] end to fill-me ;; creates a new item in the calling patch sprout 1 [ set breed things set-shape-and-color set heading 0 set selected? false set dir 1 set me-mode "i" ;; idle ] end to set-shape-and-color set index random ( difficulty + 3) set shape (word theme (index + 1)) set color item index [ orange magenta blue green yellow red pink violet] end to update-score [ amount ] ;; updates the score, and (fi the update is not 0) ;; delivers a message of support set score score + amount ask patch ( max-pxcor - 1 ) ( play-max-pycor - 1) [ set plabel (word score " ") set plabel-of (patch-at 0 1) "Score: " ] if amount > 0 [ send-message (word one-of [ "Yahoo!" "Good --" "Diggum!" "By Gum," "Squee!" "Meep!" "Lawds!" ] " " amount " " one-of [ "points!" "big ones." "more reasons to live..." "clams!" ] ) ] end to send-message [ text ] ;; posts a message to the message area ask message-patch [ set message-text text set plabel-of message-patch "" set plabel-color pcolor + 4.9 set message-index 0 set message-length length message-text ] end to update-messages ;; fades out any posted message ask message-patch [ if message-text != "" [ ifelse abs (plabel-color - pcolor) < .2 [ set plabel-color pcolor set plabel "" set message-text "" ] [ ifelse message-index < message-length [ set message-index message-index + 1 set plabel substring message-text 0 message-index ] [ set plabel-color plabel-color - .2 ] ] ] ] end to-report generate-valid-combos let combo [] let combos [] set combo [ [[ 2 0 ] [ 3 0 ]] "\n1233" [[ 1 0 ]] ] set combos lput combo combos ;; 1233 [ [ 2 0 ] [ 3 0 ] ] [ 1 0 ] ;; arrangement: . .. ;; ;; 3321 [ [ -3 0 ] [ -2 0 ] ] [ -1 0 ] ;; transform: negative of x ;; ;; 3 [ [ 0 2 ] [ 0 3 ] ] [ 0 1 ] ... transform, flip x and y ;; 3 ;; 2 ;; 1 ;; ;; 1 .. transform, negative y, flip x and y ;; 2 ;; 3 ;; 3 ;; ;; ;; set combo [ [[ 1 1 ] [ 1 -1 ]] "\n03\n12\n03" [[1 0]] ] set combos lput combo combos ;; 03 [[1 1][1 -1]] [1 0] ;; arrangement: < ;; 12 ;; 03 ;; ;; 30 [[-1 1][-1 -1]] [-1 0] ;; arrangement: > trandform: negative of x ;; 21 ;; 30 ;; ;; 010 [[-1 -1][1 -1]] [0 -1] ;; arrangement: ^ transform: flip x and y ;; 323 ;; ;; 323 [[-1 1][1 1]] [0 1] ;; arrangement: v transform: negative x, flip x,y ;; 010 ;; set combo [ [[ 1 1 ][ 1 2 ]] "\n03\n03\n12" [[ 1 0 ]] ] set combos lput combo combos ;; 233 [[1 1][2 1]] [0 1] ;; arrangement: F ;; 100 ;; ;; 332 [[-2 1][-1 1]] [ 0 1] ;; transform: negative x ;; 001 ;; ;; 100 [[1 -1][2 -1] [ 0 -1] ;; transform: negative y ;; 233 ;; ;; 001 [[-1 -1][-2 -1]] [0 -1] ;; trandform: negative x, negative y ;; 332 ;; ;; 03 [[ ]] [ ] ;; transform: flip x, y of arragement F ;; 03 ;; 12 ;; ;; 12 negative x, flip x,y ;; 03 ;; 03 ;; ;; 30 negative y, flip x,y ;; 30 ;; 21 ;; ;; 21 negative x, negative y, flip x,y ;; 30 ;; 30 let new-combos [] foreach combos [ ;; first, write this combo (?) to the lsit set new-combos lput ? new-combos let matches first ? let swapt last ? let new-combo [] let new-matches matches let new-swapt swapt let text item 1 ? ;; now flip x and y of this version set new-matches map [ (list (last ?) (first ?) ) ] new-matches set new-swapt map [ (list (last ?) (first ?) ) ] new-swapt set new-combo (list new-matches (text + "-flip") new-swapt) set new-combos lput new-combo new-combos ;; next, generate negative x version set new-matches map [ (list (-1 * first ?) ( last ?) ) ] matches set new-swapt map [ (list (-1 * first ?) ( last ?) ) ] swapt set new-combo (list new-matches (text + "-neg-x") new-swapt) set new-combos lput new-combo new-combos ;; now flip x and y of this version set new-matches map [ (list (last ?) (first ?) ) ] new-matches set new-swapt map [ (list (last ?) (first ?) ) ] new-swapt set new-combo (list new-matches (text + "-neg-x-flip") new-swapt) set new-combos lput new-combo new-combos ;; now generate negative y version set new-matches map [ (list ( first ?) (-1 * last ?) ) ] matches set new-swapt map [ (list ( first ?) (-1 * last ?) ) ] swapt set new-combo (list new-matches (text + "-neg-y") new-swapt) set new-combos lput new-combo new-combos ;; now flip x and y of this version set new-matches map [ (list (last ?) (first ?) ) ] new-matches set new-swapt map [ (list (last ?) (first ?) ) ] new-swapt set new-combo (list new-matches (text + "-neg-y-flip") new-swapt) set new-combos lput new-combo new-combos ;; now generate negative x and y version set new-matches map [ (list (-1 * first ?) (-1 * last ?) ) ] matches set new-swapt map [ (list (-1 * first ?) (-1 * last ?) ) ] swapt set new-combo (list new-matches (text + "-neg-xy") new-swapt) set new-combos lput new-combo new-combos ;; now flip x and y of this version set new-matches map [ (list (last ?) (first ?) ) ] new-matches set new-swapt map [ (list (last ?) (first ?) ) ] new-swapt set new-combo (list new-matches (text + "-neg-xy-flip") new-swapt) set new-combos lput new-combo new-combos ;; all alternate versions created. ;; some transformations generate redundant versions ;; use remove duplicates to remove redundant versions ] ;; sort the coordinates within the combos let sorted-combos [] ;; repeat 10 [ print "" ] foreach new-combos [ let matches first ? let swapt last ? let text item 1 ? ;;print ? ;;print (word " ---- " matches " ---- " swapt ) ;;print (word " ---- ---- " first matches ) set matches sort-by [ first ?1 < first ?2 or last ?1 < last ?2 ] matches let new-combo (list matches text swapt) set sorted-combos lput new-combo sorted-combos ] report sorted-combos end to-report find-good-combos let successful-combos [] foreach combo-list [ let match-points first ? let swap-points last ? let matches (things at-points match-points) with [ index = index-of myself ] if count matches = 2 [ set successful-combos lput ? successful-combos ] ] report successful-combos end to show-good-combo let successful-combos find-good-combos if length successful-combos > 0 [ let combo one-of successful-combos let match-points first combo let swapt-points last combo let matches (things at-points match-points) with [ index = index-of myself ] let swapt one-of (things at-points swapt-points) fix-color set color color + 2 ask matches [ set size .5 ] ask swapt [ set size .5 ] ] end to make-suggestion let candidates things with [ find-good-combos != [] ] if any? candidates [ let swapt nobody set candidates one-of candidates ask candidates [ set swapt one-of (things at-points (last (one-of find-good-combos) ) ) ] set dir-of candidates 1 set dir-of swapt -1 set candidates (list candidates swapt) set suggested things with [ member? self candidates ] ] end to clear-suggestion ask suggested [ fix-color ] set suggested nobody end to auto-play let candidate things with [ find-good-combos != [] ] ifelse any? candidate [ set candidate one-of candidate ask candidate [ let good-combos find-good-combos let combo one-of good-combos ;; type (word combo "\n\n") ;; let match-points first combo let swapt-points last combo ;; let matches (things at-points match-points) with [ index = index-of myself ] let swapt one-of (things at-points swapt-points) ;; ask matches [ set size .5 ] ;; ask swapt [ set size .5 ] set selected1 self set selected2 swapt set patch1 patch-here set patch2 value-from selected2 [ patch-here ] ;; solve that one set game-mode "s" queue-sound (one-of ["LOW WOOD BLOCK" "HI WOOD BLOCK"]) volume ] ] [ set game-mode "x" ;; game-over! ] end to queue-sound [ drum vel ] if sound-on? [ set sound-q (word sound-q " play-drum \"" drum "\" " vel ) ] end ;; 35. Acoustic Bass Drum 59. Ride Cymbal 2 ;; 36. Bass Drum 1 60. Hi Bongo ;; 37. Side Stick 61. Low Bongo ;; 38. Acoustic Snare 62. Mute Hi Conga ;; 39. Hand Clap 63. Open Hi Conga ;; 40. Electric Snare 64. Low Conga ;; 41. Low Floor Tom 65. Hi Timbale ;; 42. Closed Hi Hat 66. Low Timbale ;; 43. Hi Floor Tom 67. Hi Agogo ;; 44. Pedal Hi Hat 68. Low Agogo ;; 45. Low Tom 69. Cabasa ;; 47. Open Hi Hat 70. Maracas ;; 47. Low Mid Tom 71. Short Whistle ;; 48. Hi Mid Tom 72. Long Whistle ;; 49. Crash Cymbal 1 73. Short Guiro ;; 50. Hi Tom 74. Long Guiro ;; 51. Ride Cymbal 1 75. Claves ;; 52. Chinese Cymbal 76. Hi Wood Block ;; 53. Ride Bell 77. Low Wood Block ;; 54. Tambourine 78. Mute Cuica ;; 55. Splash Cymbal 79. Open Cuica ;; 56. Cowbell 80. Mute Triangle ;; 57. Crash Cymbal 2 81. Open Triangle ;; 58. Vibraslap @#$#@#$#@ GRAPHICS-WINDOW 136 32 786 703 -1 -1 40.0 1 20 1 1 1 0 0 0 1 0 15 0 15 CC-WINDOW 5 717 795 812 Command Center 0 BUTTON 8 84 63 117 RESET setup NIL 1 T OBSERVER T NIL BUTTON 8 124 63 157 PLAY go T 1 T OBSERVER NIL NIL TEXTBOX 8 10 499 28 Click RESET to prepare for a new game (or restart an on-going game). Click PLAY to play the game. CHOOSER 7 33 99 78 Theme Theme "animal" "shape" "simple" 2 SWITCH 8 327 108 360 Auto-Play? Auto-Play? 1 1 -1000 SLIDER 8 199 100 232 hint-speed hint-speed 0 30 10 5 1 NIL TEXTBOX 8 179 129 197 How quickly to give hints TEXTBOX 8 309 118 327 Let the computer play SLIDER 8 253 100 286 difficulty difficulty 1 5 5 1 1 NIL SLIDER 9 428 101 461 volume volume 0 127 61 1 1 NIL TEXTBOX 9 235 100 253 How many colors TEXTBOX 12 380 109 423 Sound effects are disabled in the applet. @#$#@#$#@ WHAT IS IT? ----------- This is a game modeled after "bejeweled" by PopCap Games HOW DOES IT WORK? ----------------- RESET sets up a new game. PLAY runs the game. Click on two adjacent "gems" to swap places. If three or more gems line up vertically or horizontally, they vanish. If not, the two gems switch back to their original places When gems vanish, the gems above fall into the empty spaces, possibly making more combinations. Finally, the empty spaces are filled in with more gems! If you get stumped, after a while, the game will suggest a play for you! NETLOGO FEATURES ---------------- This model is a conucopia of useful programming techniques. The mouse handler is a basic one that can handle events at mouse-button-down, mouse-drag, and mouse-button-up. Lots of custom shapes here. NOTES ----- any more move detection... how to detect if any gem can be used in a valid move? for any gem, look to see if there are two other gems of the same shape in the right positions to make it possible for this gem to swap into a valid move... e.g. in the below charts, 0 doesn't matter... if 1 and 3 are the same color, then 1 can swap with 2 to make group with 3-- 0 doesn't matter wil be encoded with 2 lists-- patch coords for 3's relative to 1, and patch coord of 2 relative to 1. E.g: 1233 --> [ "match" [ [ 2 0] [ 3 0 ] ] "swap" [ 1 0 ] ] 1233 [ [ 2 0 ] [ 3 0 ] ] [ 1 0 ] ;; arrangement: . .. 3321 [ [ -3 0 ] [ -2 0 ] ] [ -1 0 ] ;; transform: negative of x 3 [ [ 0 2 ] [ 0 3 ] ] [ 0 1 ] ... transform, flip x and y 3 2 1 1 .. transform, negative y, flip x and y 2 3 3 03 [[1 1][1 -1]] [1 0] ;; arrangement: < 12 03 30 [[-1 1][-1 -1]] [-1 0] ;; arrangement: > trandform: negative of x 21 30 010 [[-1 -1][1 -1]] [0 -1] ;; arrangement: ^ transform: flip x and y 323 323 [[-1 1][1 1]] [0 1] ;; arrangement: v transform: negative x, flip x,y 010 233 [[1 1][2 1]] [0 1] ;; arrangement: F 100 332 [[-2 1][-1 1]] [ 0 1] ;; transform: negative x 001 100 [[1 -1][2 -1] [ 0 -1] ;; transform: negative y 233 001 [[-1 -1][-2 -1]] [0 -1] ;; trandform: negative x, negative y 332 03 [[ ]] [ ] ;; transform: flip x, y of arragement F 03 12 12 negative x, flip x,y 03 03 30 negative y, flip x,y 30 21 21 negative x, negative y, flip x,y 30 30 @#$#@#$#@ default true 0 Polygon -7500403 true true 150 5 40 250 150 205 260 250 link true 0 Line -7500403 true 150 0 150 300 link direction true 0 Line -7500403 true 150 150 30 225 Line -7500403 true 150 150 270 225 0 false 0 Polygon -16777216 true false 60 45 75 30 90 15 105 15 120 30 210 30 255 75 255 240 270 270 240 300 75 300 45 270 30 165 45 60 Polygon -7500403 true true 60 77 93 76 93 242 119 257 185 255 193 282 120 285 64 260 Polygon -7500403 true true 74 41 213 281 243 262 96 25 Polygon -7500403 true true 127 59 182 60 200 76 204 185 226 218 229 77 201 36 111 35 1 false 0 Polygon -16777216 true false 45 60 105 0 195 0 195 210 225 210 240 285 210 300 75 300 45 270 60 210 75 210 75 90 Polygon -7500403 true true 76 272 78 237 119 236 121 59 73 61 116 15 167 15 166 243 216 237 206 287 10 false 0 Polygon -7500403 true true 41 88 62 109 98 72 95 255 47 254 50 282 150 285 159 253 129 249 135 53 109 26 Polygon -7500403 true true 168 77 191 52 264 50 293 82 290 241 265 275 229 279 228 243 265 235 267 88 210 88 195 233 215 246 214 279 179 269 164 240 2 false 0 Polygon -16777216 true false 45 135 15 75 60 15 105 0 150 0 225 0 270 75 270 135 195 195 270 195 285 285 150 300 15 285 30 210 105 150 Rectangle -7500403 true true 223 223 223 225 Polygon -7500403 true true 254 242 229 277 53 268 63 226 146 152 177 116 174 37 127 35 122 91 103 117 59 106 53 73 100 22 151 9 218 27 237 82 233 118 145 192 97 228 230 208 3 false 0 Polygon -16777216 true false 90 105 30 60 60 0 150 0 225 0 255 60 240 135 270 225 240 300 150 300 60 300 15 240 75 180 Polygon -7500403 true true 108 87 132 53 176 57 191 88 160 125 113 130 112 169 163 171 191 209 190 227 152 257 124 254 91 212 53 228 91 282 150 297 217 275 244 216 228 162 191 147 229 115 231 68 207 30 163 9 107 7 56 50 4 false 0 Polygon -16777216 true false 15 135 105 0 255 0 225 105 270 120 285 195 210 210 255 255 255 300 60 300 60 255 90 225 15 195 Polygon -7500403 true true 139 16 47 142 49 176 144 176 137 253 108 255 106 285 226 283 232 249 181 248 189 178 250 177 256 135 193 141 213 13 176 12 144 148 91 140 162 13 5 false 0 Polygon -16777216 true false 15 180 60 15 120 0 270 15 225 90 120 60 120 105 210 105 270 165 255 255 210 300 75 300 0 225 30 180 Polygon -7500403 true true 245 24 213 70 106 36 91 135 137 121 189 122 226 161 233 196 225 246 174 282 105 288 54 242 29 220 75 196 115 268 161 259 178 206 173 144 127 148 85 173 39 160 96 15 6 false 0 Polygon -16777216 true false 30 60 75 0 240 0 285 60 270 120 240 120 285 180 285 255 225 300 75 300 15 255 0 120 Polygon -7500403 true true 254 97 260 67 216 27 174 12 101 17 57 65 24 156 44 229 92 276 170 288 227 259 271 220 254 158 197 122 131 113 99 124 95 138 121 169 143 136 199 149 211 217 168 268 102 258 84 166 91 112 115 38 178 37 193 74 226 97 7 false 0 Polygon -16777216 true false 45 15 270 15 270 60 165 300 45 300 150 105 15 105 Polygon -7500403 true true 81 27 242 35 131 286 88 284 188 68 58 76 8 false 0 Polygon -16777216 true false 60 105 45 45 75 0 225 0 270 45 270 120 225 150 255 210 255 270 210 300 75 300 15 255 15 180 Polygon -7500403 true true 99 84 177 215 181 258 147 260 105 240 101 180 117 164 92 127 63 153 38 197 88 276 159 296 232 269 218 195 183 146 142 74 140 31 185 35 196 85 179 94 194 133 229 102 243 51 188 7 121 0 85 25 81 63 9 false 0 Polygon -16777216 true false 30 180 15 135 15 45 60 0 240 0 285 45 285 240 255 285 195 300 90 300 30 270 30 225 90 195 135 225 135 195 Polygon -7500403 true true 180 134 123 133 96 114 95 58 129 34 185 35 205 55 205 212 168 260 106 258 85 231 56 242 72 266 94 278 155 291 224 266 254 211 251 47 221 23 169 1 122 4 83 21 49 52 50 100 57 129 78 153 141 170 186 171 animal1 true 0 Circle -16777216 true false 0 0 300 Polygon -10899396 true false 151 76 138 91 138 284 150 296 162 286 162 91 Polygon -7500403 true true 164 106 184 79 205 61 236 48 259 53 279 86 287 119 289 158 278 177 256 182 164 181 Polygon -7500403 true true 136 110 119 82 110 71 85 61 59 48 36 56 17 88 6 115 2 147 15 178 134 178 Polygon -7500403 true true 46 181 28 227 50 255 77 273 112 283 135 274 135 180 Polygon -7500403 true true 165 185 254 184 272 224 255 251 236 267 191 283 164 276 Line -7500403 true 167 47 159 82 Line -7500403 true 136 47 145 81 Circle -7500403 true true 165 45 8 Circle -7500403 true true 134 45 6 Circle -7500403 true true 133 44 7 Circle -7500403 true true 133 43 8 animal2 true 0 Circle -16777216 true false -1 -1 301 Line -16777216 false 150 270 150 285 Line -16777216 false 15 75 15 120 Polygon -7500403 true true 300 15 285 30 255 30 225 75 195 60 255 15 Polygon -7500403 true true 285 135 210 135 180 150 180 45 285 90 Polygon -7500403 true true 120 45 120 210 180 210 180 45 Polygon -7500403 true true 180 195 165 300 240 285 255 225 285 195 Polygon -7500403 true true 180 225 195 285 165 300 150 300 150 255 165 225 Polygon -7500403 true true 195 195 195 165 225 150 255 135 285 135 285 195 Polygon -7500403 true true 16 136 91 136 121 151 121 46 16 91 Polygon -7500403 true true 120 195 135 300 60 285 45 225 15 195 Polygon -7500403 true true 122 226 107 286 137 301 152 301 152 256 137 226 Polygon -7500403 true true 105 195 105 165 75 150 45 135 15 135 15 195 Polygon -7500403 true true 285 120 270 90 285 15 300 15 Line -1 false 15 285 105 240 Polygon -7500403 true true 15 120 30 90 15 15 0 15 Polygon -7500403 true true 0 15 15 30 45 30 75 75 105 60 45 15 Polygon -1184463 true false 255 135 212 135 182 148 182 193 195 193 195 166 Polygon -1184463 true false 45 135 88 135 118 148 118 193 105 193 105 166 Polygon -2064490 true false 124 212 127 225 135 225 150 254 163 227 173 224 179 210 Line -1 false 25 229 100 229 Line -1 false 80 295 110 250 Line -1 false 215 296 185 251 Line -1 false 285 285 195 240 Line -1 false 275 233 200 233 Polygon -2064490 true false 19 33 29 80 67 67 48 30 Polygon -2064490 true false 231 66 271 84 281 30 259 29 Polygon -16777216 true false 79 241 102 265 153 278 211 261 226 230 207 259 156 273 150 254 148 273 104 261 animal3 true 0 Circle -16777216 true false 0 0 300 Polygon -7500403 true true 87 267 106 290 145 292 157 288 175 292 209 292 207 281 190 276 174 277 156 271 154 261 157 245 151 230 156 221 171 209 214 165 231 171 239 171 263 154 281 137 294 136 297 126 295 119 279 117 241 145 242 128 262 132 282 124 288 108 269 88 247 73 226 72 213 76 208 88 190 112 151 107 119 117 84 139 61 175 57 210 65 231 79 253 65 243 46 187 49 157 82 109 115 93 146 83 202 49 231 13 181 12 142 6 95 30 50 39 12 96 0 162 23 250 68 275 Polygon -16777216 true false 237 85 249 84 255 92 246 95 Line -16777216 false 221 82 213 93 Line -16777216 false 253 119 266 124 Line -16777216 false 278 110 278 116 Line -16777216 false 149 229 135 211 Line -16777216 false 134 211 115 207 Line -16777216 false 117 207 106 211 Line -16777216 false 91 268 131 290 Line -16777216 false 220 82 213 79 Line -16777216 false 286 126 294 128 Line -16777216 false 193 284 206 285 animal4 true 0 Circle -16777216 true false 0 0 300 Polygon -7500403 true true 300 165 300 195 270 210 183 204 180 240 165 270 165 300 120 300 0 240 45 165 75 90 75 45 105 15 135 45 165 45 180 15 225 15 255 30 225 30 210 60 225 90 225 105 Polygon -16777216 true false 0 240 120 300 165 300 165 285 120 285 10 221 Line -16777216 false 210 60 180 45 Line -16777216 false 90 45 90 90 Line -16777216 false 90 90 105 105 Line -16777216 false 105 105 135 60 Line -16777216 false 90 45 135 60 Line -16777216 false 135 60 135 45 Line -16777216 false 181 203 151 203 Line -16777216 false 150 201 105 171 Circle -16777216 true false 171 88 34 Circle -16777216 false false 261 162 30 animal5 true 0 Circle -16777216 true false 0 0 300 Polygon -1 true false 44 131 21 87 15 86 0 120 15 150 0 180 13 214 20 212 45 166 Polygon -1 true false 135 195 119 235 95 218 76 210 46 204 60 165 Polygon -1 true false 75 45 83 77 71 103 86 114 166 78 135 60 Polygon -7500403 true true 30 136 151 77 226 81 280 119 292 146 292 160 287 170 270 195 195 210 151 212 30 166 Circle -16777216 true false 215 106 30 animal6 true 0 Circle -16777216 true false 0 0 300 Polygon -7500403 true true 38 162 24 165 19 174 22 192 47 213 90 225 135 230 161 240 178 262 150 246 117 238 73 232 36 220 11 196 7 171 15 153 37 146 46 145 Polygon -7500403 true true 289 142 271 165 237 164 217 185 235 192 254 192 259 199 245 200 248 203 226 199 200 194 155 195 122 185 84 187 91 195 82 192 83 201 72 190 67 199 62 185 46 183 36 165 40 134 57 115 74 106 60 109 90 97 112 94 92 93 130 86 154 88 134 81 183 90 197 94 183 86 212 95 211 88 224 83 235 88 248 97 246 90 257 107 255 97 270 120 Polygon -16777216 true false 234 100 220 96 210 100 214 111 228 116 239 115 Circle -16777216 true false 246 117 20 Line -7500403 true 270 153 282 174 Line -7500403 true 272 153 255 173 Line -7500403 true 269 156 268 177 animal7 true 0 Circle -16777216 true false 0 0 300 Polygon -7500403 true true 61 150 76 180 91 195 103 214 91 240 76 255 61 270 76 270 106 255 132 209 151 210 181 210 211 240 196 255 181 255 166 247 151 255 166 270 211 270 241 255 240 210 270 225 285 165 256 135 226 105 166 90 91 105 Polygon -7500403 true true 75 164 94 104 70 82 45 89 19 104 4 149 19 164 37 162 59 153 Polygon -7500403 true true 64 98 96 87 138 26 130 15 97 36 54 86 Polygon -7500403 true true 49 89 57 47 78 4 89 20 70 88 Circle -16777216 true false 37 103 16 Line -16777216 false 44 150 104 150 Line -16777216 false 39 158 84 175 Line -16777216 false 29 159 57 195 Polygon -5825686 true false 0 150 15 165 15 150 Polygon -5825686 true false 76 90 97 47 130 32 Line -16777216 false 180 210 165 180 Line -16777216 false 165 180 180 165 Line -16777216 false 180 165 225 165 Line -16777216 false 180 210 210 240 animal8 true 0 Circle -16777216 true false 0 0 300 Polygon -10899396 true false 132 70 134 49 130 42 132 17 151 7 171 18 173 42 169 50 172 72 Polygon -10899396 true false 180 210 210 210 255 240 255 255 225 285 210 255 Polygon -10899396 true false 75 210 45 240 45 255 75 285 90 255 105 210 Polygon -7500403 true true 105 60 195 60 225 90 240 135 225 225 165 270 135 270 75 225 60 135 75 90 Polygon -10899396 true false 195 60 225 45 255 45 270 60 285 90 285 120 240 75 225 75 210 75 Polygon -10899396 true false 105 60 75 45 45 45 30 60 15 90 15 120 60 75 75 75 90 75 burst true 0 Line -7500403 true 146 16 150 36 Line -7500403 true 191 23 184 41 Line -7500403 true 240 52 215 73 Line -7500403 true 270 101 229 119 Line -7500403 true 259 152 276 147 Line -7500403 true 252 180 285 199 Line -7500403 true 239 211 250 219 Line -7500403 true 202 237 223 261 Line -7500403 true 184 255 184 260 Line -7500403 true 143 259 156 300 Line -7500403 true 118 247 89 285 Line -7500403 true 86 230 77 235 Line -7500403 true 72 207 34 220 Line -7500403 true 56 162 46 160 Line -7500403 true 58 134 3 130 Line -7500403 true 21 183 43 177 Line -7500403 true 61 195 57 198 Line -7500403 true 38 109 46 112 Line -7500403 true 24 77 62 93 Line -7500403 true 62 62 67 66 Line -7500403 true 62 28 117 66 Line -7500403 true 116 12 128 41 Line -7500403 true 124 93 126 125 Line -7500403 true 186 97 178 106 Line -7500403 true 107 194 124 181 Line -7500403 true 202 203 189 191 double! false 6 Polygon -13840069 true true 3 88 33 88 66 119 43 163 3 163 18 148 18 103 27 114 24 156 52 124 22 99 Polygon -13840069 true true 67 147 84 166 101 142 84 119 68 139 84 131 92 145 83 154 Polygon -13840069 true true 108 127 110 163 135 163 143 127 131 127 127 157 115 158 119 126 Polygon -13840069 true true 150 109 136 94 161 94 160 143 175 129 190 155 159 170 141 169 154 161 150 143 162 160 179 152 172 142 156 149 Polygon -13840069 true true 185 95 206 100 208 159 216 176 199 164 197 109 Polygon -13840069 true true 242 155 247 144 237 135 233 156 243 169 268 156 245 176 227 161 232 127 262 142 Polygon -13840069 true true 270 78 282 65 296 72 276 167 285 177 294 166 explode0 true 6 Polygon -13840069 true true 150 15 165 105 210 45 210 120 285 135 195 180 255 255 150 225 120 285 120 210 15 195 90 165 30 75 120 105 explode1 true 6 Polygon -13840069 true true 105 164 73 151 104 139 85 110 133 127 128 88 148 105 170 90 174 117 206 119 179 140 209 155 157 158 178 179 148 175 148 206 127 181 84 200 86 173 1 165 56 136 26 83 96 89 105 15 145 63 204 14 196 79 281 70 245 105 296 129 223 143 295 175 210 184 244 262 196 209 182 285 167 209 100 283 115 224 31 234 hat false 0 Polygon -10899396 true false 45 150 45 135 75 120 135 105 165 105 225 120 255 135 255 150 225 165 165 180 135 180 75 165 Polygon -16777216 false false 45 150 45 135 75 120 135 105 165 105 225 120 255 135 255 150 225 165 165 180 135 180 75 165 Polygon -13840069 true false 105 135 105 105 135 75 150 90 165 75 195 105 195 135 165 150 135 150 Polygon -16777216 false false 105 135 105 105 135 75 150 90 165 75 195 105 195 135 165 150 135 150 letters pool false 6 Polygon -13840069 true true 115 17 103 65 131 63 133 77 139 41 121 43 130 48 129 55 109 56 119 21 140 28 140 15 Polygon -13840069 true true 73 26 72 59 65 64 95 62 95 49 77 58 78 41 84 44 84 33 79 35 80 23 92 27 91 15 68 18 Polygon -13840069 true true 11 139 18 133 12 93 29 110 46 92 43 133 51 140 35 139 39 109 30 123 18 109 25 140 Polygon -13840069 true true 119 137 130 147 149 103 116 93 118 132 124 105 137 108 131 137 Polygon -13840069 true true 232 110 227 93 203 92 193 103 222 130 197 136 194 128 193 154 198 142 227 139 230 125 202 102 222 101 Polygon -13840069 true true 146 140 155 134 158 101 149 94 172 95 188 114 168 122 183 139 190 140 172 144 163 128 165 113 176 112 162 101 161 137 Polygon -13840069 true true 241 106 241 94 277 85 284 103 271 94 262 96 264 135 274 143 245 143 256 135 255 96 247 96 Polygon -13840069 true true 10 63 17 59 25 22 19 19 42 17 34 22 50 58 56 62 47 62 31 29 29 43 37 46 23 47 22 65 Polygon -13840069 true true 57 138 65 132 60 92 87 123 92 100 82 94 106 93 96 98 94 134 101 141 88 139 67 108 71 133 75 139 logo1 true 6 Polygon -13840069 true true 141 122 129 170 157 168 159 182 165 146 147 148 156 153 155 160 135 161 145 126 166 133 166 120 Polygon -13840069 true true 170 128 169 161 162 166 192 164 192 151 174 160 175 143 181 146 181 135 176 137 177 125 189 129 188 117 165 120 Polygon -13840069 true true 63 140 58 123 34 122 24 133 53 160 28 166 25 158 24 184 29 172 58 169 61 155 33 132 53 131 Polygon -13840069 true true 89 162 98 156 101 123 92 116 115 117 131 136 111 144 126 161 133 162 115 166 106 150 108 135 119 134 105 123 104 159 Polygon -13840069 true true 229 127 229 115 265 106 272 124 259 115 250 117 252 156 262 164 233 164 244 156 243 117 235 117 Polygon -13840069 true true 57 170 64 166 72 129 66 126 89 124 81 129 97 165 103 169 94 169 78 136 76 150 84 153 70 154 69 172 Polygon -13840069 true true 192 175 200 169 195 129 222 160 227 137 217 131 241 130 231 135 229 171 236 178 223 176 202 145 206 170 210 176 logo2 true 6 Polygon -13840069 true true 90 170 101 180 120 136 87 126 89 165 95 138 108 141 102 170 Polygon -13840069 true true 78 140 73 123 49 122 39 133 68 160 43 166 40 158 39 184 44 172 73 169 76 155 48 132 68 131 Polygon -13840069 true true 119 177 128 171 131 138 122 131 145 132 161 151 141 159 156 176 163 177 145 181 136 165 138 150 149 149 135 138 134 174 Polygon -13840069 true true 154 142 154 130 190 121 197 139 184 130 175 132 177 171 187 179 158 179 169 171 168 132 160 132 Polygon -13840069 true true 201 136 200 169 193 174 223 172 223 159 205 168 206 151 212 154 212 143 207 145 208 133 220 137 219 125 196 128 Polygon -13840069 true true 218 173 227 167 230 134 221 127 244 128 260 147 240 155 255 172 262 173 244 177 235 161 237 146 248 145 234 134 233 170 shape1 true 6 Circle -13840069 true true 0 0 300 Polygon -1 true false 105 60 135 30 135 45 105 75 105 90 135 60 135 75 105 105 105 165 90 150 90 120 75 135 75 180 60 165 60 150 30 180 30 165 60 135 60 120 30 150 30 135 60 105 60 75 75 60 75 90 90 75 90 45 105 30 Polygon -13840069 true true 75 105 75 120 90 105 90 90 Circle -16777216 false false 0 0 300 shape2 true 6 Polygon -13840069 true true 151 1 185 108 298 108 207 175 242 282 151 216 59 282 94 175 3 108 116 108 Polygon -1 true false 30 120 255 120 90 240 210 135 Polygon -16777216 false false 3 108 116 108 150 0 185 107 299 107 208 174 243 283 151 217 58 284 94 174 shape3 true 6 Circle -13840069 true true 135 43 122 Circle -13840069 true true 43 43 122 Polygon -13840069 true true 255 120 240 150 210 180 180 210 150 240 135 135 Polygon -13840069 true true 45 120 60 150 90 180 120 210 150 240 165 135 Polygon -1 true false 75 75 105 60 120 75 75 105 Polygon -1 true false 165 75 195 60 210 75 165 105 Polygon -1 true false 150 180 90 120 150 165 210 120 Polygon -16777216 false false 150 240 180 210 240 150 255 120 255 90 240 60 210 45 180 45 150 60 120 45 90 45 60 60 45 90 45 120 60 150 shape4 true 6 Polygon -13840069 true true 150 15 45 150 150 285 255 150 Polygon -1 true false 150 15 135 90 150 150 105 135 45 150 150 150 Polygon -16777216 false false 45 150 150 15 255 150 150 285 shape5 true 6 Circle -13840069 true true 90 30 120 Circle -13840069 true true 148 119 122 Circle -13840069 true true 30 119 122 Polygon -13840069 true true 134 137 135 253 121 273 105 284 195 284 180 273 165 253 159 138 Circle -16777216 false false 88 28 124 Circle -16777216 false false 28 118 124 Circle -16777216 false false 148 118 124 Polygon -16777216 false false 151 189 135 225 135 255 120 270 105 285 195 285 180 270 165 255 165 225 Circle -13840069 true true 90 90 120 Polygon -1 true false 45 165 120 135 135 60 135 150 Polygon -1 true false 255 165 180 135 165 60 165 150 Polygon -1 true false 75 225 150 180 210 225 150 165 shape6 true 6 Polygon -13840069 true true 150 0 0 120 60 285 240 285 300 120 Polygon -16777216 false false 0 120 150 0 300 120 240 285 60 285 Polygon -1 true false 0 120 150 150 150 0 135 120 Polygon -1 true false 60 285 150 150 240 285 150 180 shape7 true 6 Polygon -13840069 true true 0 150 75 30 225 30 300 150 225 270 75 270 Polygon -1 true false 150 150 225 240 210 255 90 255 75 240 150 150 105 240 195 240 Polygon -1 true false 150 150 195 45 225 60 270 135 270 165 150 150 255 150 210 60 Polygon -1 true false 150 150 105 45 75 60 30 135 30 165 150 150 45 150 90 60 Polygon -16777216 false false 0 150 75 30 225 30 300 150 225 270 75 270 shape8 true 6 Polygon -13840069 true true 151 11 181 31 177 64 190 70 209 44 246 49 257 81 232 108 236 121 271 121 288 150 272 178 235 178 230 191 255 212 247 250 215 256 190 230 177 235 181 269 150 288 120 270 121 235 108 230 76 260 43 242 41 210 70 190 65 177 37 182 9 150 22 122 62 120 69 106 44 90 45 55 80 40 107 69 121 64 117 33 Polygon -1 true false 135 195 150 285 150 180 Polygon -1 true false 195 165 285 150 180 150 Polygon -1 true false 165 105 150 15 150 120 Polygon -1 true false 105 135 15 150 120 150 Polygon -16777216 false false 148 11 182 30 176 63 189 69 209 44 240 49 256 82 232 108 237 122 270 121 290 149 271 178 237 178 230 191 256 214 248 250 214 257 189 229 177 233 182 270 149 287 120 269 120 235 105 228 74 259 42 241 38 207 70 191 65 176 36 181 8 151 27 115 60 121 70 106 44 92 44 54 78 39 105 67 118 65 116 31 simple1 true 6 Polygon -13840069 true true 15 285 150 15 285 285 simple2 true 6 Rectangle -13840069 true true 15 15 285 285 simple3 true 6 Polygon -13840069 true true 15 105 150 15 285 105 240 270 60 270 simple4 true 6 Polygon -13840069 true true 75 30 225 30 285 150 225 270 75 270 15 150 simple5 true 6 Polygon -13840069 true true 15 105 90 75 150 0 210 75 285 105 240 180 240 270 150 240 60 270 60 180 simple6 true 6 Polygon -13840069 true true 90 15 210 15 285 90 285 210 210 285 90 285 15 210 15 90 simple7 true 6 Circle -13840069 true true 30 45 120 Circle -13840069 true true 150 45 120 Polygon -13840069 true true 30 120 45 165 105 225 150 270 195 225 255 165 270 120 simple8 false 6 Circle -13840069 true true 0 0 300 @#$#@#$#@ NetLogo 3.1.1 @#$#@#$#@ @#$#@#$#@ @#$#@#$#@ @#$#@#$#@