# # Copyright 2005 by Mark Weyer # # Partly based on code by (in alphabetical order) Berni, Immi, and Jela # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Maennchen = { name = "Männchen" author = "Mark Weyer" pics = blau,zahl greypic = inGrau.xpm startpic = inGras.xpm startdist = "AAAAAAAAAA" << var wert; >> blau = { pics = mmBlau.xpm << blau.init = {wert = rnd(3)+1;}; blau = {pos=wert+3; *; schema4;}; >> numexplode = 10 } zahl = { pics = mmZahl.xpm << var operator; zahl.init = { if 1:3 -> {operator = 1; wert=10+rnd(2)} else {wert = rnd(11)}; }; zahl = { if operator -> { if ??1???1? && !operator@(1,0) && !operator@(-1,0) -> { kind@(1,0)=nothing; kind@(-1,0)=nothing; operator=0; if wert==10 # Addition -> wert=wert@(1,0)+wert@(-1,0) else wert=wert@(1,0)*wert@(-1,0); } else if 1???1??? && !operator@(0,1) && !operator@(0,-1) -> { kind@(0,1)=nothing; kind@(0,-1)=nothing; operator=0; if wert==10 # Addition -> wert=wert@(0,1)+wert@(0,-1) else wert=wert@(0,1)*wert@(0,-1); }; }; if operator -> {pos=wert; *;} else { pos=(wert/10)%10; if pos>0 -> {qu=Q_TL; *; qu=Q_BL; *;}; pos=wert%10; qu=Q_TR; *; qu=Q_BR; *; }; }; >> numexplode = 100 } }