do#puyo_aGameLikeTetris( list#globalVars( 0#playerSquare 0#playerVerticalNotHorizontal 3.999#blockLimit ) list#theMousePanels( 'these 4 mousepanels are the controls for the game. move the mouse in and out of them.' mousePanel#leftMousePanel(0 0 0 0 0) mousePanel#rightMousePanel(0 0 0 0 0) mousePanel#topMousePanel(0 0 0 0 0) mousePanel#bottomMousePanel(0 0 0 0 0) ) 'squares is the grid of squares the game is played on' squares#sq( list#theSquares('click' 'new' 'game' a b c d e f) 6#squaresWide ) 'the right column is 0, and if there are X columns then the left column is X-1' %#playerIsInWhichColumn(playerSquare squaresWide) list#groupsOfBlocks( list#blockTypes( image('red.jpg') image('blue.jpg') image('yellow.jpg') image('green.jpg') image('black.jpg') ) list#rareBlocks( button#deleteAllRedSquares( method#codesimian.PuyoGame.changeAllOfOneFileNameToAnOther(0 0 theSquares 'red.jpg' 'black.jpg') ) mousePanel(.45#mousePanelBlockX .5) ) theSquares ) int#dropFromWhichColumn(*(mousePanelBlockX -(squaresWide 1.0000000001))) do#functions( func#putRandomBlockSomewhere( 0#putRandomBlockInThisIndex do( list(new#newRBS(0 0)) copyParamToParam(newRBS 1 blockTypes rr(0 blockLimit)) newRBS copyParamToParam(theSquares putRandomBlockInThisIndex newRBS 0) ) ) 'moves a square from one index to an other, and leaves black.jpg in the old square' func#moveSquare( 0#toIndex 0#fromIndex do( list#temp copyParamToParam(temp 0 theSquares fromIndex) new#newempty(0 image('black.jpg')) copyParamToParam( setP#setpe(theSquares fromIndex 0) 2 newempty 0 ) setpe copyParamToParam(theSquares toIndex temp 0) ) ) 'do 2 squares have the same filename?' func#squaresSameColor( 0#firstSquareIndex 0#secondSquareIndex do( recurseP#getstr1(0 theSquares firstSquareIndex 0#indexOfStringInFirstSquare) recurseP#getstr2(0 theSquares secondSquareIndex 0#indexOfStringInSecondSquare) copyParamToParam( method#java.lang.String.equalsIgnoreCase(0 0 0) 1 getstr1 0) copyParamToParam( java.lang.String.equalsIgnoreCase 2 getstr2 0) printCode(java.lang.String.equalsIgnoreCase) java.lang.String.equalsIgnoreCase ) ) 'the difference between squares is judged by the string in the square: square.P(0).L(String.class)' func#squareHasFileName( 0#indexOfTheSquare 0#doesTheSquareHaveThisFileName do( recurseP#getstr3(0 theSquares indexOfTheSquare 0) copyParamToParam( java.lang.String.equalsIgnoreCase 1 getstr3 0 ) setP( java.lang.String.equalsIgnoreCase 2 doesTheSquareHaveThisFileName ) java.lang.String.equalsIgnoreCase ) ) 'does a square with specified index fall or is it on top of something?' func#falls( 0#indexOfSquareThatMightFall and( >I(indexOfSquareThatMightFall -(squaresWide 1)) do#emptySquareIsBelow( setP(squareHasFileName 0 -(indexOfSquareThatMightFall squaresWide)) setP(squareHasFileName 1 'black.jpg') =Z(0#emptySquareIsBelow squareHasFileName) indexOfSquareThatMightFall setP(squareHasFileName 0 indexOfSquareThatMightFall) =Z(0#emptySquareIsHere squareHasFileName) and(emptySquareIsBelow not(emptySquareIsHere)) ) ) ) ) list#dontExecuteThisStuffYet( button#update(sq) button#dropARareBlock( if(