home *** CD-ROM | disk | FTP | other *** search
- /////////
- // init //
- /////////
- Function init()
- bottom = -height()/2+20
- Clear 53720,64909,65535
- starSize = 30
- randomize()
-
- ///////////////
- // make star //
- ///////////////
- Function makeStar(frac,max)
- Picture "a star"
- Fill 1,64432,65535,7165
- Repeat 5
- Forward starSize
- Left 144
-
- //////////////
- // roll a star //
- //////////////
- Function rollStar(starNum, fx,last,n,x,n2)
- Pen name=starNum, move="above", end="no"
- Sound "Flens"
- last = -width()/2
- Repeat n, 15, 5, -1
- Pen picture="a star"
- n2 = n*n
- Curve last+2*x, rollY(), x, -n, n
- last = last+4*n
- Sound "Pop",nowait
- Sound "Boing",nowait
- Pen speed=800, end="copy"
- Goto width()/2 - 30*starNum, height()/2-30,0
- Function rollY()
- x2 = x*x
- myY = n2-x2
- Pen speed=sqrt(n2-myY+5)*10
- Return myY+bottom
-
- ///////////////
- // drop a star //
- ///////////////
- Function dropStar(n,sx,sy)
- Pen name=n, picture=""
- sx = x()
- sy = y()
- Goto x()-3,y()-starSize/3-3,0
- Fill 1,65535,65535,65535
- Repeat 4
- Forward starSize+6
- Left 90
- Sound "Eagle",nowait
- Pen picture="a star",end="no",speed=200
- Up
- Goto sx,sy,0
- Down
- Goto x(), -height()/2,0
- Sound "Smack"
-
- /////////////////////////////
- // compose a question, ask it //
- /////////////////////////////
- Function AddQuestion()
- n1 = int(random(11))
- n2 = int(random(11))
- askClear()
- Print n1 . " + " . n2 . " = ", move
- r = ask(100)
- checkIfStop(r)
- Return (r = n1+n2)
- Function SubQuestion()
- n1 = int(random(10))
- n2 = int(random(10))
- askClear()
- Print (n1+n2) . " - " . n2 . " = ", move
- r = ask(100)
- checkIfStop(r)
- Return (r = n1)
- Function askClear()
- Pen name="question"
- Up
- Goto -100,-20,0
- Down
- Fill 1, 65535,65535,65535
- Repeat 2
- Forward 200
- Left 90
- Forward 20
- Left 90
- Up
- Goto x()+10,y()+5,0
-
- Function checkIfStop(r)
- If r = ""
- Sound "Okie Dokey"
- Pen name=0,fontstyle="Bold",fontsize=20
- Up
- Goto -100,-100,0
- Print "DONE"
- Halt
-
- Function Score()
- Pen name=0,fontstyle="Bold",fontsize=20
- Up
- Goto -100,-100,-90
- Color 6154,23658,65535
- Print "Good Answers: " . goodAnswers
- Color 65535,29587,9068
- Forward 40
- Print "BAD Answers: " . badAnswers
-