global  WhichGame
global InitialCard6
global InitialYet


on OpenCard 1
disable menu "Options"
disable menu "Index"

ExplanationMenuName help
put 0 into grade_level
put 0 into thefirsttime
put 0 into InitialYet
wait 1 ticks
set loc of btn other27l to 659, 466
show btn other27l
play windx
put (669 - 136)/5 into k
repeat with i = 1 to k
set loc of btn other27l to 659 - (i-1)*5, 466 - (466 +80)/k *(i-1)
wait 1 ticks
if i = 30 then
  play horncall
end if
if mouseclick() then
exit repeat
end if
end repeat
show btn title
wait 100 ticks
show btn narator
wait 50 ticks
put 3 into ntx
play alright
naratoranimex

wait 200 ticks
go cd 6 
end OpenCard

On satelitemove2
repeat with i = 1 to 200
lock screen
set loc of btn satelite to 670 - (i-1)*10, 133-30
set loc of btn allright to 670 - (i-1)*10 + 340, 133+107-30
unlock screen
wait 1 ticks
if  i = 25 then
play horncall
end if
if 670 - (i -1) * 10 + 340 < 295 then
exit repeat
end if
if mouseclick() then
 exit satelitemove2
end if
end repeat
End satelitemove2


On Other27s_back



     go cd 7
     set loc of btn other27s to -200, 466
     show btn other27s
      put (669 + 200)/10 into k
    repeat with i = 1 to k
    set loc of btn other27s to -200 + (i-1)*10, 466 - (466 +80)/k *(i-1)
     if i = 10 then
       play horncall
     end if
     wait 2 ticks
     if mouseclick() then
   exit repeat
   end if
    end repeat

     go cd 4
     set loc of btn other27s to -200, 380
    show btn other27s
      put (669 + 200 + 200)/10 into k

    repeat with i = 1 to k
     set loc of btn other27s to -200 + (i-1)*10, 380 - (380-100)/k *(i-1)
 if i = 10 then
  play Hallel2
  end if
  if mouseclick() then
   exit repeat
     end if

     end repeat


End Other27s_back

On MoveKnoby_and_wmap
play switch
set loc of btn knoby to 224, 356
ss033MoveLast
put 1 into whichgame
go cd 2
End MoveKnoby_and_wmap


On MoveKnobp_and_start
play switch
set loc of btn Knobp to 470, 361
ss033MoveLast
go cd 3
kingdom
End MoveKnobp_and_start


On gocd3andopen
go cd 3
End gocd3andopen


On ss033Moveinitial
play windx
repeat with i = 1 to 7
 set loc of btn ss033 to x0 - (i-1)*10 , 265 
end repeat
End ss033Moveinitial

On ss033MoveLast
ss033setnormal
play windx
repeat with i = 1 to 7
 set loc of btn ss033 to xm - (i-1)*10, 265
end repeat
End ss033MoveLast

On ss033setFirst
put 340 into xm
put 265 into ym
put 400 into x0
put 265 into y0
set loc of btn ss033 to x0, y0
set loc of btn cover6 to 320, 219
End ss033setFirst

On ss033setnormal
put 280  into xe
put 265 into ye
put 340 into x0
put 265 into y0
set loc of btn ss033 to x0, y0
set loc of btn cover6 to 320, 219
end ss033setnormal


-------------------card3------------------------
On notabletogo
End notabletogo

On set_gradel
play switchb

 set bitmap of btn gradel to gradels
 set bitmap of btn gradem to gradem
 set bitmap of btn gradeh to gradeh
 put 0 into grade_level
End set_gradel

On set_gradem
play switchb

 set bitmap of btn gradel to gradel
 set bitmap of btn gradem to gradems
 set bitmap of btn gradeh to gradeh
 put 1 into grade_level
End set_gradem

On set_gradeh
play switchb

 set bitmap of btn gradel to gradel
 set bitmap of btn gradem to gradem
 set bitmap of btn gradeh to gradehs
 put 2 into grade_level
End set_gradeh





On initialize
put 2 into step1_1
put 36 into step1_2
put 3 into step2_1
put 1 into step2_2
put 0 into step2_egg
put 4 into step3_1
put 19 into step3_2
put 2 into step3_3
put 20 into step3_4
put 5 into step4_1
put 3 into step4_2
put 6 into step5_1
put 4 into step5_2
put 0 into step5_egg
put 7 into step6_1
put 5 into step6_2
put 8 into step7_1
put 6 into step7_2
put 28 into step7_3
put 29 into step7_4
put 9 into step8_1
put 7 into step8_2
put 0 into step8_egg
put 10 into step9_1
put 8 into step9_2
put 11 into step10_1
put 9 into step10_2
put 12 into step11_1
put 10 into step11_2
put 32 into step11_3
put 24 into step11_4
put 33 into step11_5
put 25 into step11_6
put 13 into step12_1
put 11 into step12_2
put 14 into step13_1
put 12 into step13_2
put 15 into step14_1
put 13 into step14_2
put 0 into step14_egg
put 999 into step15_1
put 14 into step15_2
put 17 into step16_1
put 36 into step16_2
put 37 into step16_3
put 18 into step17_1
put 16 into step17_2
put 19 into step18_1
put 17 into step18_2
put 0 into step18_egg
put 3 into step19_1
put 18 into step19_2
put 21 into step20_1
put 3 into step20_2
put 22 into step21_1
put 20 into step21_2
put 0 into step21_egg
put 23 into step22_1
put 21 into step22_2
put 0 into step22_egg
put 24 into step23_1
put 22 into step23_2
put 0 into step23_egg
put 11 into step24_1
put 23 into step24_2
put 26 into step25_1
put 11 into step25_2
put 0 into step25_egg
put 999 into step26_1
put 25 into step26_2
put 0 into step26_egg
put 28 into step27_1
put 37 into step27_2
put 7 into step28_1
put 27 into step28_2
put 0 into step28_egg
put 30 into step29_1
put 7 into step29_2
put 31 into step30_1
put 29 into step30_2
put 32 into step31_1
put 30 into step31_2
put 0 into step31_egg
put 11 into step32_1
put 31 into step32_2
put 0 into step32_egg
put 34 into step33_1
put 11 into step33_2
put 35 into step34_1
put 33 into step34_2
put 0 into step34_egg
put 999 into step35_1
put 34 into step35_2
put 1 into step36_1
put 16 into step36_2
put 37 into step36_3
put 27 into step37_1
put 16 into step37_2
put 36 into step37_3
put 18000 into final_time
put 720 into limit_time
put 1 into correct_ans
put 1 into math_answer
put 600 into math_time
--------------------------------------------------
put 0 into step38_egg
put 0 into step39_egg
put 0 into step41_egg
put 0 into step42_egg
put 1 into step43_egg
put 1 into step44_egg
put 0 into step45_egg
put 0 into step46_egg
put 0 into step47_egg
put 0 into step49_egg
put 0 into step50_egg
put 0 into step51_egg
---------------------------------
put 2 into eggnumber
put 0 into crackedegg
put 50 into maxcrackedegg
put 8 into maxeggnumber
-----------------------------
put 0 into zone1
put 0 into zone2
put 0 into zone3
put 0 into zone4
put 0 into zone5
put 0 into zone6
put 0 into zone7
put 0 into zone8
-----------------------
put 0 into dragontimeup
put 0 into selectedzone
put 0 into clicked
put 0 into game_on
repeat with xxx = 1 to 101
 put 0 into Item xxx of xquiztbl
end repeat
put 0 into quizongoing





End initialize

On finalize
wait 10 ticks
End finalize

On clickfrogbutton
  click at clickh(), clickv()
end clickfrogbutton


On witchanime1
repeat w1x times
if mouseclick() then
  put 999 into xend
  exit witchanime1
end if

set bitmap of btn witchl1 to witchl2
if random(10) = 1 then
   wait 6 ticks
else 
   wait 10 ticks
end if
set bitmap of btn witchl1 to witchl1
if random(25) = 8 then
   wait 15 ticks
else
wait 10 ticks

end if
set bitmap of btn witchl1 to witchl3
if random(30) = 1 then
   wait 20 ticks
else
wait 10 ticks

end if

set bitmap of btn witchl1 to witchl1
wait 10 ticks
if mouseclick() then
  put 999 into xend
  exit witchanime1
end if
set bitmap of btn witchl1 to witchl2
wait 10 ticks
if random(20) = 8 then
   wait 15 ticks
end if
set bitmap of btn witchl1 to witchl1
wait 10 ticks
end repeat
End witchanime1


On witchanime2
repeat with j = 1 to 4
if mouseclick() then
  exit witchanime2
end if
set bitmap of btn witch1 to witch2
wait 6 ticks
if random(15) = 8 then
  wait 15 ticks
end if
set bitmap of btn witch1 to witch1
wait 6 ticks
set bitmap of btn witch1 to witch3
wait 6 ticks
if random(15) = 8 then
  wait 15 ticks
end if
set bitmap of btn witch1 to witch1
wait 6 ticks
if mouseclick() then
  exit witchanime2
end if
set bitmap of btn witch1 to witch2
wait 6 ticks
if random(15) = 8 then
  wait 15 ticks
end if
set bitmap of btn witch1 to witch1
wait 6 ticks
end repeat
End witchanime2


On witchanime3
repeat with j = 1 to w3x
if mouseclick() then
  exit witchanime3
end if
set bitmap of btn witch1 to witch2
wait 10 ticks
if mouseclick() then
   put 999 into xend 
   exit witchanime3
end if
set bitmap of btn witch1 to witch1
wait 10 ticks
set bitmap of btn witch1 to witch3
wait 10 ticks
set bitmap of btn witch1 to witch1
wait 10 ticks
if mouseclick() then
   put 999 into xend 
   exit witchanime3
end if
set bitmap of btn witch1 to witch2
wait 10 ticks
set bitmap of btn witch1 to witch1
wait 10 ticks
end repeat
End witchanime3


On witchspranime
repeat 5 times
set bitmap of btn witch1 to wichspra
wait 2 ticks
set bitmap of btn witch1 to wichsprb
wait 2 ticks
set bitmap of btn witch1 to wichsprc
wait 2 ticks
set bitmap of btn witch1 to wichsprd
wait 2 ticks
set bitmap of btn witch1 to wichspre
wait 2 ticks
end repeat
set bitmap of btn witch1 to witchspr
wait 10 ticks
End witchspranime


On Showwitch_surprised
put 0 into surprised
End Showwitch_surprised


On Showwitch_surprised
lock screen
hide btn sansumap
hide btn narator1
set bitmap of btn witch1 to witch1
show btn witch1
unlock screen
wait 10 ticks
set bitmap of btn witch1 to witchspr
wait 120 ticks
lock screen
hide btn witch1
show btn sansumap
show btn narator1
unlock screen
End Showwitch_surprised

On show_frog_good
put 3 into ntx
naratoranimex
End show_frog_good


On k_froganime2
repeat with j = 1 to 2
set bitmap of btn satelite to satelite
wait 2 ticks
set bitmap of btn satelite to k_frog3
wait 2 ticks
set bitmap of btn satelite to k_frog4
wait 2 ticks
set bitmap of btn satelite to k_frog3
wait 2 ticks
end repeat
set bitmap of btn satelite to k_frog2
wait 2 ticks

End k_froganime2


On k_froganime3
   put 0 into xend

repeat with j = 1 to f3x
if mouseclick() then
  put 999 into xend
exit k_froganime3
end if
set bitmap of btn narator1 to narator1
wait 7 ticks
set bitmap of btn narator1 to narator2
wait 7 ticks
set bitmap of btn narator1 to narator3
wait 7 ticks
set bitmap of btn narator1 to narator2
wait 7 ticks
end repeat
set bitmap of btn narator1 to narator1
wait 7 ticks

End k_froganime3





On kiddyanime
if xend = 999 then
    exit kiddyanime
end if
set bitmap of btn witch1 to kiddy1
wait 10 ticks
set bitmap of btn witch1 to kiddy2
wait 10 ticks
set bitmap of btn witch1 to kiddy3
wait 10 ticks
repeat with j = 1 to 3
if mouseclick() then
   put 999 into xend
   exit kiddyanime 
end if
set bitmap of btn witch1 to kiddy4
wait 5 ticks
set bitmap of btn witch1 to kiddy5
wait 5 ticks
set bitmap of btn witch1 to kiddy4
wait 5 ticks
set bitmap of btn witch1 to kiddy3
wait 5 ticks
end repeat

end kiddyanime




On kiddyanime16
if xend = 999 then
    exit kiddyanime16
end if
set bitmap of btn kiddy1 to kiddy1
wait 5 ticks
set bitmap of btn kiddy1 to kiddy2
wait 5 ticks
set bitmap of btn kiddy1 to kiddy3
wait 5 ticks
repeat with j = 1 to 4
if mouseclick() then
   put 999 into xend
   exit kiddyanime16 
end if
set bitmap of btn kiddy1 to kiddy4
wait 5 ticks
set bitmap of btn kiddy1 to kiddy5
wait 5 ticks
set bitmap of btn kiddy1 to kiddy4
wait 5 ticks
set bitmap of btn kiddy1 to kiddy3
wait 5 ticks
end repeat

end kiddyanime16








On mdragonanime1
repeat with j = 1 to 3
set bitmap of btn mdragon1 to mdragon2
wait 10 ticks
set bitmap of btn mdragon1 to mdragon3
wait 10 ticks
set bitmap of btn mdragon1 to mdragon2
wait 10 ticks
set bitmap of btn mdragon1 to mdragon1
wait 10 ticks
end repeat
end mdragonanime1

On ldragonanime
repeat with j = 1 to 4
set bitmap of btn ldragon1 to ldragon2
wait 10 ticks
set bitmap of btn ldragon1 to ldragon3
wait 10 ticks
set bitmap of btn ldragon1 to ldragon2
wait 10 ticks
set bitmap of btn ldragon1 to ldragon1
wait 10 ticks
end repeat
end ldragonanime


On k_froganime1
set the loc of btn k_froga to 93,318
show btn k_froga
repeat with j = 1 to 6
set bitmap of btn k_froga to k_frogc
wait 2 ticks
set bitmap of btn k_froga to k_frogd
wait 2 ticks
set bitmap of btn k_froga to k_frogc
wait 2 ticks
set bitmap of btn k_froga to k_froga
wait 2 ticks
end repeat
set bitmap of btn k_froga to k_frogb
wait 100 ticks
set the loc of btn k_froga to -250,318

set bitmap of btn k_froga to k_froga
hide btn k_froga

End k_froganime1


On naratoranime
show btn narator1
repeat 3 times
set bitmap of btn narator1 to narator2
wait 5 ticks
set bitmap of btn narator1 to narator1
wait 5 ticks
if random(10) = 8 then
 wait 10 ticks
end if
set bitmap of btn narator1 to narator2
wait 5 ticks
set bitmap of btn narator1 to narator3
wait 5 ticks
if random(10) = 8 then
 wait 10 ticks
end if
end repeat

End naratoranime

On naratoranimex
show btn narator1
repeat ntx times
set bitmap of btn narator1 to narator2
wait 5 ticks
if mouseclick() then
 exit naratoranimex
end if
if random(15) = 8 then
 wait 10 ticks
end if
set bitmap of btn narator1 to narator1
wait 5 ticks
if random(15) = 8 then
 wait 10 ticks
end if
set bitmap of btn narator1 to narator2
wait 5 ticks
set bitmap of btn narator1 to narator3
wait 5 ticks
if random(15) = 8 then
 wait 10 ticks
end if
end repeat
wait 1 seconds
if mouseclick() then
 exit naratoranimex
end if

End naratoranimex



On naratoranimedummy
show btn narator1
repeat 3 times
set bitmap of btn narator1 to narator1
wait 5 ticks
set bitmap of btn narator1 to narator1
wait 5 ticks
end repeat

End naratoranimedummy







On opencard 3
lock screen

if game_on = 1 then
-----------
if xkey = 32 then
  put 32 into frogloc
-- put 31 into pre_frogloc
put 0 into xkey
end if

if xkey = 24 then
  put 24 into frogloc
-- put 23 into pre_frogloc
put 0 into xkey
end if
if xkey = 10 then
  put 10 into frogloc
put 0 into xkey
--put 5 into pre_frogloc
end if
if xkey = 5 then
  put 5 into frogloc
 put 4 into pre_frogloc
end if
if xkey = 6 then
  put 6 into frogloc
 put 7 into pre_frogloc
end if

---------
if JustBeginKingdom = 9999 then
  set the  loc of btn satelite  to locH of btn %frogloc%, LocV of btn %frogloc%
  put 0 into 9999
end if

SoundRandom


put step2_egg into egg_cond_number

put 2 into target_egg
refreshegg
put step5_egg into egg_cond_number
put 5 into target_egg
refreshegg
put step8_egg into egg_cond_number
put 8 into target_egg
refreshegg
put step14_egg into egg_cond_number
put 14 into target_egg
refreshegg
put step18_egg into egg_cond_number
put 18 into target_egg
refreshegg
put step21_egg into egg_cond_number
put 21 into target_egg
refreshegg
put step22_egg into egg_cond_number
put 22 into target_egg
refreshegg
put step23_egg into egg_cond_number
put 23 into target_egg
refreshegg
put step25_egg into egg_cond_number
put 25 into target_egg
refreshegg
put step26_egg into egg_cond_number
put 26 into target_egg
refreshegg
put step28_egg into egg_cond_number
put 28 into target_egg
refreshegg
put step31_egg into egg_cond_number
put 31 into target_egg
refreshegg
put step32_egg into egg_cond_number
put 32 into target_egg
refreshegg
put step34_egg into egg_cond_number
put 34 into target_egg
refreshegg
--------------------------------------------------
put step38_egg into egg_cond_number

put 38 into target_egg
refreshegg
put step39_egg into egg_cond_number
put 39 into target_egg
refreshegg
put step41_egg into egg_cond_number
put 41 into target_egg
refreshegg
put step42_egg into egg_cond_number
put 42 into target_egg
refreshegg
put step43_egg into egg_cond_number
put 43 into target_egg
refreshegg
put step44_egg into egg_cond_number
put 44 into target_egg
refreshegg
put step45_egg into egg_cond_number
put 45 into target_egg
refreshegg
put step46_egg into egg_cond_number
put 46 into target_egg
refreshegg
put step47_egg into egg_cond_number
put 47 into target_egg
refreshegg
put step49_egg into egg_cond_number
put 49 into target_egg
refreshegg
put step50_egg into egg_cond_number
put 50 into target_egg
refreshegg
put step51_egg into egg_cond_number
put 51 into target_egg
refreshegg
else
put 0 into game_on
end if

set the loc of btn satelite to locH of btn %frogloc%, locV of btn %frogloc%
--if frogloc = 1 or  frogloc = 17 or frogloc = 27 then
--wait 1 ticks
--else
show btn satelite
--end if


unlock screen


if game_on =1 then
 put random( 7 ) into animekind
put 0 into xend

--if animekind = 1 then
--   spacerokMove
--end if

if animekind = 2 then
   cd3westMove
   exit opencard
end if

if animekind = 3 then
   cd3comet1Move
   exit opencard
end if

if animekind = 4 then
   cd3gaspragMove
   exit opencard
end if

if animekind = 5 then
   cd3gaspralMove
   exit opencard
end if

if animekind = 6 then
   cd3gaspramMove
   exit opencard
end if

if animekind = 7 then
   cd3gasprasMove
   exit opencard
end if

end if

put 0 into xend
End opencard

--------------------------------------------


On All_Egg_REfresh
lock screen
put step2_egg into egg_cond_number

put 2 into target_egg
refreshegg
put step5_egg into egg_cond_number
put 5 into target_egg
refreshegg
put step8_egg into egg_cond_number
put 8 into target_egg
refreshegg
put step14_egg into egg_cond_number
put 14 into target_egg
refreshegg
put step18_egg into egg_cond_number
put 18 into target_egg
refreshegg
put step21_egg into egg_cond_number
put 21 into target_egg
refreshegg
put step22_egg into egg_cond_number
put 22 into target_egg
refreshegg
put step23_egg into egg_cond_number
put 23 into target_egg
refreshegg
put step25_egg into egg_cond_number
put 25 into target_egg
refreshegg
put step26_egg into egg_cond_number
put 26 into target_egg
refreshegg
put step28_egg into egg_cond_number
put 28 into target_egg
refreshegg
put step31_egg into egg_cond_number
put 31 into target_egg
refreshegg
put step32_egg into egg_cond_number
put 32 into target_egg
refreshegg
put step34_egg into egg_cond_number
put 34 into target_egg
refreshegg
--------------------------------------------------
put step38_egg into egg_cond_number

put 38 into target_egg
refreshegg
put step39_egg into egg_cond_number
put 39 into target_egg
refreshegg
put step41_egg into egg_cond_number
put 41 into target_egg
refreshegg
put step42_egg into egg_cond_number
put 42 into target_egg
refreshegg
put step43_egg into egg_cond_number
put 43 into target_egg
refreshegg
put step44_egg into egg_cond_number
put 44 into target_egg
refreshegg
put step45_egg into egg_cond_number
put 45 into target_egg
refreshegg
put step46_egg into egg_cond_number
put 46 into target_egg
refreshegg
put step47_egg into egg_cond_number
put 47 into target_egg
refreshegg
put step49_egg into egg_cond_number
put 49 into target_egg
refreshegg
put step50_egg into egg_cond_number
put 50 into target_egg
refreshegg
put step51_egg into egg_cond_number
put 51 into target_egg
refreshegg
unlock screen

End All_Egg_REfresh






On opencard 8
lock screen
if game_on = 1 then
SoundRandom


put step2_egg into egg_cond_number

put 2 into target_egg
refreshegg
put step5_egg into egg_cond_number
put 5 into target_egg
refreshegg
put step8_egg into egg_cond_number
put 8 into target_egg
refreshegg
put step14_egg into egg_cond_number
put 14 into target_egg
refreshegg
put step18_egg into egg_cond_number
put 18 into target_egg
refreshegg
put step21_egg into egg_cond_number
put 21 into target_egg
refreshegg
put step22_egg into egg_cond_number
put 22 into target_egg
refreshegg
put step23_egg into egg_cond_number
put 23 into target_egg
refreshegg
put step25_egg into egg_cond_number
put 25 into target_egg
refreshegg
put step26_egg into egg_cond_number
put 26 into target_egg
refreshegg
put step28_egg into egg_cond_number
put 28 into target_egg
refreshegg
put step31_egg into egg_cond_number
put 31 into target_egg
refreshegg
put step32_egg into egg_cond_number
put 32 into target_egg
refreshegg
put step34_egg into egg_cond_number
put 34 into target_egg
refreshegg
--------------------------------------------------
put step38_egg into egg_cond_number

put 38 into target_egg
refreshegg
put step39_egg into egg_cond_number
put 39 into target_egg
refreshegg
put step41_egg into egg_cond_number
put 41 into target_egg
refreshegg
put step42_egg into egg_cond_number
put 42 into target_egg
refreshegg
put step43_egg into egg_cond_number
put 43 into target_egg
refreshegg
put step44_egg into egg_cond_number
put 44 into target_egg
refreshegg
put step45_egg into egg_cond_number
put 45 into target_egg
refreshegg
put step46_egg into egg_cond_number
put 46 into target_egg
refreshegg
put step47_egg into egg_cond_number
put 47 into target_egg
refreshegg
put step49_egg into egg_cond_number
put 49 into target_egg
refreshegg
put step50_egg into egg_cond_number
put 50 into target_egg
refreshegg
put step51_egg into egg_cond_number
put 51 into target_egg
refreshegg
else
put 0 into game_on
end if
unlock screen

if frogloc  = 24 or  frogloc = 32 or frogloc = 10 then
wait 1 ticks
else
set the loc of btn satelite to locH of btn %frogloc%, locV of btn %frogloc%
show btn satelite
end if




put 0 into xend
End opencard





--------------------------------------------




On refreshegg
if egg_cond_number = 1 then 
   set bitmap of btn %target_egg% to egg
   show btn %target_egg% 
else
   if egg_cond_number = 2 then
   set bitmap of btn %target_egg% to crackegg
   show btn %target_egg% 
   end if
   if egg_cond_number = 3 then
   set bitmap of btn %target_egg% to mdragon1
   show btn %target_egg% 
   end if
end if
   
End refreshegg










On kingdomtest
initialize
put 1 into game_on
put 0 into timecounter
lock screen
--hide btn 64
--show btn 66
hide btn 67
--hide btn gradeh
--hide btn gradem
--hide btn gradel
--hide fld easy
--hide fld soso
--hide fld hard
set the loc of btn satelite to 565,251
show btn satelite
unlock screen
if grade_level = 0 then
  put 10 into dragontimes
  put 34 into responselimit
  put 17 into  maxeggnumber
end if
if grade_level = 1 then
  put 7 into dragontimes
  put 24 into responselimit
  put 14 into  maxeggnumber
end if
if grade_level = 2 then
  put 6 into dragontimes
  put 19 into responselimit
  put 12 into  maxeggnumber
end if

repeat with pointx = 1 to 12
  put 0 into Item pointx of checkcardlist
 end repeat  
put 0 into  minimum_level

SoundRandom
put random(3) into initialroute
if initialroute = 1 then
    put 25 into frogloc
     step25
  else
    if initialroute = 2 then
          put 25 into frogloc
          step25
     else
          put  25 into frogloc
          step25
     end if
 end if
End kingdomtest















On kingdom
play synthri

initialize
put 1 into game_on
put 0 into timecounter
if grade_level = 0 then
  put 6 into dragontimes
  put 32 into responselimit
  put 13 into  maxeggnumber
end if
if grade_level = 1 then
  put 5 into dragontimes
  put 27 into responselimit
  put 10 into  maxeggnumber
end if
if grade_level = 2 then
  put 4 into dragontimes
  put 22 into responselimit
  put 8 into  maxeggnumber
end if

repeat with pointx = 1 to 12
  put 0 into Item pointx of checkcardlist
 end repeat  
put 0 into  minimum_level


put random(3) into initialroute
if initialroute = 1 then
    put 1 into frogloc
  else
    if initialroute = 2 then
          put 17 into frogloc
     else
          put  27 into frogloc
     end if
 end if

put 9999 into JustBeginKingdom
SoundRandom
 go cd 3
click at btn %frogloc%

exit kingdom


End kingdom

On checkegg

if crackedegg < maxcrackedegg then
put random(26) into j
repeat 2 times
 
if quiz_quit = 1 then
   exit repeat
end if
if  step2_egg = 1 and j < 1 then
    set bitmap of btn 2 to crackegg
    put 2 into step2_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if

if   step5_egg = 1 and j < 2 then
    set bitmap of btn 5 to crackegg
    put 2 into step5_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step8_egg = 1 and j < 3 then
    set bitmap of btn 8 to crackegg
    put 2 into step8_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step14_egg = 1 and j < 4 then
    set bitmap of btn 14 to crackegg
    put 2 into step14_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if  step18_egg = 1  and j < 5 then
    set bitmap of btn 18 to crackegg
    put 2 into step18_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step21_egg = 1  and j < 6 then
    set bitmap of btn 21 to crackegg
    put 2 into step21_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step22_egg = 1 and j < 7 then
    set bitmap of btn 22 to crackegg
    put 2 into step22_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step23_egg = 1 and j < 8 then
    set bitmap of btn 23 to crackegg
    put 2 into step23_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step25_egg = 1 and j < 9 then
    set bitmap of btn 25 to crackegg
    put 2 into step25_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step26_egg = 1 and j < 10 then
    set bitmap of btn 26 to crackegg
    put 2 into step26_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step28_egg = 1 and j < 11 then
    set bitmap of btn 28 to crackegg
    put 2 into step28_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step31_egg = 1 and j < 12 then
    set bitmap of btn 31 to crackegg
    put 2 into step31_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step32_egg = 1 and j < 13 then
    set bitmap of btn 32 to crackegg
    put 2 into step32_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step34_egg = 1 and j < 14 then
    set bitmap of btn 34 to crackegg
    put 2 into step34_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if


if   step38_egg = 1 and j < 15 then
    set bitmap of btn 38 to crackegg
    put 2 into step38_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step39_egg = 1 and j < 16 then
    set bitmap of btn 39 to crackegg
    put 2 into step39_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step41_egg = 1 and j < 17 then
    set bitmap of btn 41 to crackegg
    put 2 into step41_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step42_egg = 1 and j < 18 then
    set bitmap of btn 42 to crackegg
    put 2 into step42_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step43_egg = 1 and j < 19 then
    set bitmap of btn 43 to crackegg
    put 2 into step43_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
 if  step44_egg = 1 and j < 20  then
    set bitmap of btn 44 to crackegg
    put 2 into step44_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
 if  step45_egg = 1 and j < 21  then
    set bitmap of btn 45 to crackegg
    put 2 into step45_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step46_egg = 1 and j < 22  then
    set bitmap of btn 46 to crackegg
    put 2 into step46_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step47_egg = 1 and j < 23  then
    set bitmap of btn 47 to crackegg
    put 2 into step47_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step49_egg = 1 and j < 24  then
    set bitmap of btn 49 to crackegg
    put 2 into step49_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step50_egg = 1 and j < 25  then
    set bitmap of btn 50 to crackegg
    put 2 into step50_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step51_egg = 1 and j < 26  then
    set bitmap of btn 51 to crackegg
    put 2 into step51_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
put 0 into j
end repeat
end if

if  eggnumber >= maxeggnumber  and  quizongoing = 0 then
Game_Over
exit checkegg
end if


End checkegg

 
On checkzone1
if zone1 = 0 then
put random(6) into j
repeat with i = 1 to 6
if  step38_egg = 0  and j = 1 then
    show btn 38
    set bitmap of btn 38  to egg
    put 1 into step38_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step39_egg = 0  and j = 2 then
    show btn 39
    set bitmap of btn 39 to egg
    put 1 into step39_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step26_egg = 0  and j = 3 and frogloc is not 26 then
    show btn 26 
    set bitmap of btn 26 to egg
    put 1 into step26_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step25_egg = 0  and j = 4 and frogloc is not 25 then
    show btn 25 
    set bitmap of btn 25 to egg
    put 1 into step25_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step34_egg = 0  and j = 5 and frogloc is not 34 then
    show btn 34 
    set bitmap of btn 34 to egg
    put 1 into step34_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step14_egg = 0  and j = 6 and frogloc is not 14 then
    show btn 14 
    set bitmap of btn 14 to egg
    put 1 into step14_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if

put j + 1 into j

if j > 6 then
put 1 into j
end if

end repeat
end if 

if step38_egg = 1 and step39_egg = 1  and step26_egg = 1  and step25_egg = 1  and step34_egg = 1  and step14_egg = 1 then
put 1 into zone1
end if

end checkzone1


On checkzone2
if zone2 = 0 then
put random(3) into j
repeat with i = 1 to 3
if  step41_egg = 0  and j = 1 then
    show btn 41 
    set bitmap of btn 41 to egg
    put 1 into step41_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step42_egg = 0  and j = 2 then
    show btn 42 
    set bitmap of btn 42 to egg
    put 1 into step42_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step23_egg = 0  and j = 3 and frogloc is not 23 then
    show btn 23 
    set bitmap of btn 23 to egg
    put 1 into step23_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if

put j + 1 into j

if j > 3 then
put 1 into j
end if

end repeat
end if 

if step41_egg = 1 and step42_egg = 1  and step23_egg = 1 then
put 1 into zone2
end if

end checkzone2


On checkzone3
if zone3 = 0 then
put random(4) into j
repeat with i = 1 to 4
if  step43_egg = 0  and j = 1 then
    show btn 43
    set bitmap of btn 43 to egg
    put 1 into step43_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step44_egg = 0  and j = 2 then
    show btn 44 
    set bitmap of btn 44 to egg
    put 1 into step44_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step31_egg = 0  and j = 3 and frogloc is not 31 then
    show btn 31 
    set bitmap of btn 31 to egg
    put 1 into step31_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if

if  step32_egg = 0  and j = 4 and frogloc is not 32 then
    show btn 32 
    set bitmap of btn 32 to egg
    put 1 into step32_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if


put j + 1 into j

if j > 4 then
put 1 into j
end if

end repeat
end if 


if  step43_egg = 1  and step44_egg = 1  and step31_egg = 1  and step32_egg = 1 then
put 1 into zone3
end if

end checkzone3


On checkzone4
if zone4 = 0 then
put random(3) into j
repeat with i = 1 to 3
if  step21_egg = 0  and j = 1 and frogloc is not 21 then
    show btn 21 
    set bitmap of btn 21 to egg
    put 1 into step21_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step22_egg = 0  and j = 2 and frogloc is not 22 then
    show btn 22 
    set bitmap of btn 22 to egg
    put 1 into step22_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step50_egg = 0  and j = 3 then
    show btn 50 
    set bitmap of btn 50 to egg
    put 1 into step50_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if

put j + 1 into j

if j > 3 then
put 1 into j
end if

end repeat
end if 

if  step21_egg = 1  and step22_egg = 1  and step50_egg = 1 then
put 1 into zone4
end if

end checkzone4


On checkzone5
if zone5 = 0 then
put random(3) into j
repeat with i = 1 to 3
if  step49_egg = 0  and j = 1 then
    show btn 49 
    set bitmap of btn 49 to egg
    put 1 into step49_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step2_egg = 0  and j = 2 and frogloc is not 2 then
    show btn 2 
    set bitmap of btn 2 to egg
    put 1 into step2_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step18_egg = 0  and j = 3 and frogloc is not 18  then
    show btn 18 
    set bitmap of btn 18 to egg
    put 1 into step18_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if

put j + 1 into j

if j > 3 then
put 1 into j
end if

end repeat
end if 

if  step49_egg = 1  and step2_egg = 1  and step18_egg = 1 then
put 1 into zone5
end if

end checkzone5



On checkzone6
if zone6 = 0 then
put random(2) into j
repeat with i = 1 to 2
if  step5_egg = 0  and j = 1 then
    show btn 5 
    set bitmap of btn 5 to egg
    put 1 into step5_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step51_egg = 0  and j = 2 then
    show btn 51 
    set bitmap of btn 51 to egg
    put 1 into step51_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if

put j + 1 into j

if j > 2 then
put 1 into j
end if

end repeat
end if 

if  step5_egg = 1  and step51_egg = 1 and frogloc is not 5  then
put 1 into zone6
end if

end checkzone6

On checkzone7
if zone7 = 0 then

if  step47_egg = 0   then
    show btn 47 
    set bitmap of btn 47 to egg
    put 1 into step47_egg
    put eggnumber + 1 into eggnumber
    
end if
    put 1 into zone7
end if


end checkzone7


On checkzone8
if zone8 = 0 then
put random(4) into j
repeat with i = 1 to 4
if  step8_egg = 0  and j = 1 and frogloc is not 8 then
    show btn 8
    set bitmap of btn 8 to egg
    put 1 into step8_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step45_egg = 0  and j = 2 then
    show btn 45 
    set bitmap of btn 45 to egg
    put 1 into step45_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step46_egg = 0  and j = 3 then
    show btn 46 
    set bitmap of btn 46 to egg
    put 1 into step46_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if

if  step28_egg = 0  and j = 4 and frogloc is not 28 then
    show btn 28 
    set bitmap of btn 28 to egg
    put 1 into step28_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if


put j + 1 into j

if j > 4 then
put 1 into j
end if

end repeat
end if 

if  step8_egg = 1 and step45_egg = 1  and step46_egg = 1  and step28_egg = 1 then
put 1 into zone8
end if

end checkzone8

On dragonmoves
put random(8) into pos
repeat with m = 1 to 8
 if zone1 = 0 and pos = 1 then
   if random(4) = 2 then
   play eatingc
   else 
    SoundRandom
   end if
    put 1 into selectedzone
    dragonmove1
      if clicked = 1 or quiz_quit = 1 then
         exit repeat
      end if
    if timecounter > 2 then
      checkzone1
      put 0 into timecounter
    end if
  exit repeat
 end if

if zone2 = 0 and pos = 2 then
     if random(4) = 2 then
     play eatingc
      else 
    SoundRandom
    end if
 put 2 into selectedzone
    dragonmove2
         if clicked = 1 or quiz_quit = 1 then
          exit repeat
         end if
       if timecounter > 2 then
         checkzone2
       put 0 into timecounter
       end if
    exit repeat
 end if

if zone3 = 0 and pos = 3 then
   if random(4) = 2 then
    play eatingc
      else 
    SoundRandom
    end if
  put 3 into selectedzone
    dragonmove3
          if clicked = 1  or quiz_quit = 1 then
         exit repeat
      end if

   if timecounter > 2 then
         checkzone3
       put 0 into timecounter
       end if
 

  exit repeat
 end if


if zone4 = 0 and pos = 4 then
     if random(4) = 2 then
     play eatingc
      else 
       SoundRandom
     end if
 put 4 into selectedzone
    dragonmove4
      if clicked = 1 or quiz_quit = 1  then
         exit repeat
      end if

      if timecounter > 2 then
         checkzone4
       put 0 into timecounter
       end if


       exit repeat
 end if

if zone5 = 0 and pos = 5 then
     if random(4) = 2 then
     play eatingc
     else 
    SoundRandom
     end if
 put 5 into selectedzone
    dragonmove5
      if clicked = 1  or quiz_quit = 1 then
         exit repeat
      end if

  if timecounter > 2 then
         checkzone5
       put 0 into timecounter
       end if


  exit repeat
 end if

if zone6 = 0 and pos = 6 then
    if random(4) = 2 then
    play eatingc
    else 
    SoundRandom
    end if
  put 6 into selectedzone
       if clicked = 1  or quiz_quit = 1 then
         exit repeat
      end if
   dragonmove6

  if timecounter > 2 then
         checkzone6
       put 0 into timecounter
       end if

  exit repeat
 end if

if zone7 = 0 and pos = 7 then
  if random(4) = 2 then
  play eatingc
     else 
    SoundRandom
   end if
    put 7 into selectedzone
    dragonmove7
      if clicked = 1  or quiz_quit = 1 then
         exit repeat
      end if

  if timecounter > 2 then
         checkzone7
       put 0 into timecounter
       end if

  exit repeat
 end if

if zone8 = 0 and pos = 8 then
  if random(4) = 2 then
   play eatingc
     else 
    SoundRandom
   end if
    put 8 into selectedzone
    dragonmove8
      if clicked = 1 or quiz_quit = 1  then
         exit repeat
      end if

  if timecounter > 2 then
         checkzone8
       put 0 into timecounter
       end if


  exit repeat
 end if

put pos + 1 into pos
if pos > 8 then
  put 1 into pos
end if

end repeat





End dragonmoves

On basicdragonmove

repeat dragontimes times
set bitmap of btn mdragon1 to mdragon2
wait 7 ticks
if quiz_quit = 1 then 
exit repeat
end if
set bitmap of btn mdragon1 to mdragon3
wait 7 ticks
set bitmap of btn mdragon1 to mdragon2
wait 7 ticks

set bitmap of btn mdragon1 to mdragon1
wait 7 ticks
end repeat
put timecounter + 1 into timecounter
end basicdragonmove


On dragonmove1
show btn mdragon1
repeat 2 times
put random(6) into k
if quiz_quit = 1 then
exit repeat
end if
if k =1 then
  set the loc of btn mdragon1 to 32,130
end if
if k = 2 then
  set the loc of btn mdragon1 to 44,130
end if
if k =3 then
  set the loc of btn mdragon1 to 59,127
end if
if k =4 then
  set the loc of btn mdragon1 to 75,122
end if
if k =5 then
  set the loc of btn mdragon1 to 98,124
end if
if k =6 then
  set the loc of btn mdragon1 to 109,115
end if
basicdragonmove
end repeat



End dragonmove1

On dragonmove2
show btn mdragon1
put 0 into dragontimeup
repeat 2 times
if quiz_quit = 1 then
exit repeat
end if
put random(3) into k
if k =1 then
  set the loc of btn mdragon1 to 12,236
end if
if k = 2 then
  set the loc of btn mdragon1 to 19,243
end if
if k =3 then
  set the loc of btn mdragon1 to 7,251
end if
basicdragonmove
end repeat

End dragonmove2

On dragonmove3
show btn mdragon1
put 0 into dragontimeup
repeat 3 times
if quiz_quit = 1 then
exit repeat
end if
put random(5) into k
if k =1 then
  set the loc of btn mdragon1 to 117,272
end if
if k = 2 then
  set the loc of btn mdragon1 to 136,276
end if
if k = 3 then
  set the loc of btn mdragon1 to 157,287
end if
if k =4 then
  set the loc of btn mdragon1 to 145,297
end if
if k =5 then
  set the loc of btn mdragon1 to 171,298
end if
basicdragonmove
end repeat


End dragonmove3

On dragonmove4
show btn mdragon1
put 0 into dragontimeup
repeat 2 times
if quiz_quit = 1 then
exit repeat
end if
put random(4) into k
if k =1 then
  set the loc of btn mdragon1 to 22,351
end if
if k = 2 then
  set the loc of btn mdragon1 to 36,361
end if
if k =3 then
  set the loc of btn mdragon1 to 47,373
end if
if k =4 then
  set the loc of btn mdragon1 to 37,384
end if
basicdragonmove
end repeat


End dragonmove4


On dragonmove5
show btn mdragon1
put 0 into dragontimeup
repeat 2 times
if quiz_quit = 1 then
exit repeat
end if
put random(4) into k
if k =1 then
  set the loc of btn mdragon1 to 192,419
end if
if k = 2 then
  set the loc of btn mdragon1 to 218,415
end if
if k =3 then
  set the loc of btn mdragon1 to 238,423
end if
if k =4 then
  set the loc of btn mdragon1 to 264,430
end if
basicdragonmove
end repeat


End dragonmove5


On dragonmove6
show btn mdragon1
put 0 into dragontimeup
repeat 2 times
if quiz_quit = 1 then
exit repeat
end if
put random(4) into k
if k =1 then
  set the loc of btn mdragon1 to 328,371
end if
if k = 2 then
  set the loc of btn mdragon1 to 344,372
end if
if k =3 then
  set the loc of btn mdragon1 to 364,373
end if
if k =4 then
  set the loc of btn mdragon1 to 374,374
end if
basicdragonmove
end repeat


End dragonmove6

On dragonmove7
show btn mdragon1
put 0 into dragontimeup
repeat 2 times
if quiz_quit = 1 then
exit repeat
end if
put random(3) into k
if k =1 then
  set the loc of btn mdragon1 to 261,322
end if
if k = 2 then
  set the loc of btn mdragon1 to 276,321
end if
if k =3 then
  set the loc of btn mdragon1 to 288,320
end if
basicdragonmove
end repeat


End dragonmove7

On dragonmove8
show btn mdragon1
put 0 into dragontimeup
repeat 2 times
if quiz_quit = 1 then
exit repeat
end if
put random(4) into k
if k =1 then
  set the loc of btn mdragon1 to 340,197
end if
if k = 2 then
  set the loc of btn mdragon1 to 353,207
end if
if k =3 then
  set the loc of btn mdragon1 to 361,222
end if
if k =4 then
  set the loc of btn mdragon1 to 344,230
end if
basicdragonmove
end repeat



End dragonmove8

On idle 3
if game_on = 1 and random(3) = 1 and frogloc is not 0 then
    set the loc of btn satelite to locH of btn %frogloc%, locV of btn %frogloc%
end if
if game_on = 1 and random(2) = 1 then
   eggtodragon
end if
if game_on = 1 then 
randomdragonmove
end if

end idle

On exitkingdom
put 0 into game_on
initialize
go cd 6
exit exitkingdom
end exitkingdom


On entrancemessage
show btn t_writer
message2 141, 28, 9, "You must proceed from here toward the goal step by step!"
hide btn t_writer

End entrancemessage


global frogloc
On step36
if game_on = 1 then
put frogloc into pre_frogloc
put 36 into frogloc
basicstepaction
end if
End step36

On step16
if game_on = 1 then
put frogloc into pre_frogloc
put 16 into frogloc
basicstepaction
end if
End step16

On step37
if game_on = 1 then
put frogloc into pre_frogloc
put 37 into frogloc
basicstepaction
end if
End step37

On step1
if game_on = 1 then
put 1 into pre_frogloc
put 1 into frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
show btn satelite
basicstepaction
end if
End step1


On step2
if game_on = 1 then
if  step2_egg = 0 then
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put frogloc into pre_frogloc
put 2 into frogloc
frogmovestep
basicstepaction
else 
checkroute

end if
end if
End step2

On step3
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 3 into frogloc
frogmovestep
go cd 61
basicstepaction
end if
End step3

On step4
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 4 into frogloc
frogmovestep
basicstepaction
end if
End step4

On step5
if game_on = 1 then
if  step5_egg = 0 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 5 into frogloc
frogmovestep
basicstepaction
else 
checkroute

end if
end if
End step5


On step6
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 6 into frogloc
frogmovestep
basicstepaction
end if
End step6


On step7
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 7 into frogloc
frogmovestep
go cd 60
basicstepaction
end if
End step7


On step8
if game_on = 1 then
if step8_egg = 0 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 8 into frogloc
frogmovestep
go cd 58
basicstepaction
else 
checkroute

end if
end if
End step8


On step9
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 9 into frogloc
frogmovestep
go cd 57
basicstepaction
end if
End step9


On step10
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 10 into frogloc
frogmovestep
go cd 61
basicstepaction
end if
End step10

On step11
if game_on = 1 then
put 11 into pre_frogloc
put 11 into frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
show btn satelite
basicstepaction
end if
End step11

On step12
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 12 into frogloc
frogmovestep
go cd 56
basicstepaction
end if
End step12

On step13
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 13 into frogloc
frogmovestep
go cd 27
basicstepaction
end if
End step13

On step14
if game_on = 1 then
if step14_egg = 0 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 14 into frogloc
frogmovestep
go cd 30
basicstepaction
else 
checkroute

end if
end if
End step14


On step15
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 15 into frogloc
frogmovestep
go cd 22
basicstepaction
end if
End step15


On step17
if game_on = 1 then
put 17 into pre_frogloc
put 17 into frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
show btn satelite
basicstepaction
end if
End step17


On step18
if game_on = 1 then
if step18_egg = 0 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 18 into frogloc
frogmovestep
basicstepaction
else 
checkroute
end if
end if
End step18


On step19
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 19 into frogloc
frogmovestep
basicstepaction
end if
End step19

On step20
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 20 into frogloc
frogmovestep
go cd 54
basicstepaction
end if
End step20


On step21
if game_on = 1 then
if step21_egg = 0 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 21 into frogloc
frogmovestep
go cd 52
basicstepaction
else 
checkroute
end if
end if
End step21


On step22
if game_on = 1 then
if  step22_egg = 0 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 22 into frogloc
frogmovestep
go cd 50
basicstepaction
else 
checkroute
end if
end if
End step22


On step23
if game_on = 1 then
if step23_egg = 0 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 23 into frogloc
frogmovestep
go cd 53
basicstepaction
else 
checkroute
end if
end if
End step23


On step24
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 24 into frogloc
frogmovestep
go cd 61
basicstepaction
end if
End step24


On step25
if game_on = 1 then
if step25_egg = 0 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 25 into frogloc
frogmovestep
go cd 51
basicstepaction
else 
checkroute
end if
end if
End step25


On step26
if game_on = 1 then
if step26_egg = 0 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 26 into frogloc
frogmovestep
go cd 62
basicstepaction
else 
checkroute
end if
end if
End step26


On step27
if game_on = 1 then
put 27 into pre_frogloc
put 27 into frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
show btn satelite
go cd 59
basicstepaction
end if
End step27


On step28
if game_on = 1 then
if step28_egg = 0  then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
show btn satelite
put 28 into frogloc
frogmovestep
go cd 20
basicstepaction
else 
checkroute
end if
end if
End step28


On step29
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 29 into frogloc
frogmovestep
go cd 58
basicstepaction
end if
End step29


On step30
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 30 into frogloc
frogmovestep
go cd 57
basicstepaction
end if
End step30


On step31
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 31 into frogloc
frogmovestep
go cd 54
basicstepaction
end if
End step31


On step32
if game_on = 1 then
if step32_egg = 0 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 32 into frogloc
frogmovestep
go cd 29
basicstepaction
else 
checkroute
end if
end if
End step32


On step33
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 33 into frogloc
frogmovestep
go cd 26
basicstepaction
end if
End step33


On step34
if game_on = 1 then
if  step34_egg = 0 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 34 into frogloc
frogmovestep
go cd 63
basicstepaction
else 
checkroute
end if
end if
End step34


On step35
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 35 into frogloc
frogmovestep
go cd 55
basicstepaction
end if
End step35


On frogmovestep

play ufo

put locH of btn satelite into x0
put locV of btn satelite into y0

put locH of btn %frogloc% - x0 into xfmove
put locV of btn %frogloc% - y0 into yfmove

if  xfmove < 0 then
   put xfmove * (-1) into xxx
else
   put xfmove into xxx
end if
if yfmove < 0 then
  put yfmove * (-1) into yyy
else
  put yfmove into yyy
end if

if xxx > yyy then

put xfmove/5 into xftimes
if xftimes < 0 then
  put xftimes * (-1) into xftimes
end if
repeat with ix = 1 to xftimes
if xfmove > 0 then
set the loc of btn satelite to  x0 + (ix-1)*5  , y0 + (yfmove/xftimes)*(ix-1)
end if
if xfmove < 0 then
set the loc of btn satelite to  x0 - (ix-1)*5  , y0 + (yfmove/xftimes)*(ix-1)
end if

end repeat
else
put yfmove/5 into yftimes
if yftimes < 0 then
  put yftimes * (-1) into yftimes
end if




repeat with iy = 1 to yftimes
if yfmove > 0 then
set the loc of btn satelite to  x0 + (iy-1)*(xfmove/yftimes)  , y0 + 5*(iy-1)
end if
if yfmove < 0 then
set the loc of btn satelite to  x0 + (iy-1)*(xfmove/yftimes)  , y0 - 5*(iy-1)
end if
end repeat
end if




repeat 2 times
set bitmap of btn satelite to satelit2
wait 5 ticks
set bitmap of btn satelite to satelit3
wait 5 ticks
set bitmap of btn satelite to satelit4
wait 5 ticks
set bitmap  of btn satelite to satelite
wait 5 ticks

end repeat

End frogmovestep


On SoundRandom
put random(5) into basicsnd
if basicsnd = 1 then 
   play mendel1
end if
if basicsnd = 2 then 
   play mendel2
end if
if basicsnd = 3 then 
   play mendel3
end if
if basicsnd = 4 then 
   play mendel5
end if
wait 20 ticks
End SoundRandom


On basicstepaction
show btn satelite
if game_on is not 1 then
   exit basicstepaction
end if
SoundRandom
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%



if (frogloc >= 1) and (frogloc < 36) and (frogloc is not 16) then

   if(frogloc = 3 or frogloc = 18 or frogloc = 5 or frogloc = 7 or frogloc = 8 or frogloc = 30 or frogloc = 2 or frogloc = 6)  then
      if random(3) is not 1 then
        put 0 into  quiz_quit
       M_KingdomTours
      if math_answer = 1 then
        checkroute
           exit basicstepaction

       else
            checkzonex
         click at btn %frogloc%
           exit basicstepaction

       end if


--       exit basicstepaction
      end if
   end if

   if(frogloc = 21 or frogloc = 23 or frogloc = 13 or frogloc = 25 or frogloc = 34 or frogloc = 22 or frogloc = 33 or frogloc = 14)  then
      if random(3) is not 1 then
       put 0 into  quiz_quit
 
        M_KingdomTours
       if math_answer = 1 then
        checkroute
           exit basicstepaction

       else
         checkzonex
         click at btn %frogloc%
           exit basicstepaction

       end if
      end if
   end if






  put 0 into  quiz_quit
 
     if grade_level = 0 then
                quiz100
     end if

     if grade_level = 1 then
           quiz101
    end if

      if grade_level = 2 then
                quiz102
      end if

if game_on = 0 then
    exit basicstepaction
end if



if math_answer = 1 then
    if   frogloc = 1 or frogloc = 2 or frogloc = 4 or  frogloc = 5 or frogloc = 6  or frogloc = 17 or frogloc = 18 then
     wait 1 ticks
    else
    if (frogloc >= 11 and frogloc <= 15 ) or (frogloc >= 33 and  frogloc <= 35)  or (frogloc >= 25 and  frogloc <= 26) or ((math_time <= responselimit)  and  (frogloc + 1 = 11 or frogloc + 1 = 33 or frogloc + 1 = 25 )) then
       go cd 8
    else 
       go cd 3
    end if
     wait 1 ticks

    end if

if (math_time > responselimit)  then 
  click at btn %frogloc%
  exit basicstepaction
else
  if frogloc + 1 = 11 or frogloc + 1 =  33 or frogloc + 1 = 25 then
    put 11 into frogloc
      click at btn %frogloc%
      exit basicstepaction
   end if

 end if


--------------



   checkroute
   exit basicstepaction
else


    if   frogloc = 1 or frogloc = 2 or frogloc = 4 or  frogloc = 5 or frogloc = 6  or frogloc = 17 or frogloc = 18 then

     wait 1 ticks
    else

    if (frogloc >= 11 and frogloc <= 15 ) or (frogloc >= 33 and  frogloc <= 35) or (frogloc >= 25 and  frogloc <= 26) then
       go cd 8
    else 
       go cd 3
   end if

  end if
         checkzonex
dragonmoves
checkegg
 eggtodragon


click at btn %frogloc%
 exit basicstepaction
         
 end if

-- set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
--exit basicstepaction

end if
dragonmoves
checkegg
 eggtodragon


if game_on is not 1 then
   exit basicstepaction
end if













wait 30 ticks
SoundRandom


checkzonex



End basicstepaction




On checkzonex

 if pos = 1 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone1
 end if

if pos = 2 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone2
 end if

 if pos = 3 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone3
 end if
if pos = 4 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone4
 end if

 if pos = 5 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone5
 end if
if pos = 6 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone6
 end if
if pos = 7 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone7
 end if
if pos = 8 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone8
 end if


End checkzonex






















On quiz100
put 98 into totalquiznum
put 0 into quiz_quit
put 0 into foundquiz
put 1 into quizongoing
put random(98) into chosenedquiz


repeat 101 times


if chosenedquiz = 1 and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Which is a common multiple of 3 and 2 ?", "2","4","6","8",3

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 2 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg2 "Which is a common multiple of 4 and 6 ?", "6","12","18","24",2

put 1 into Item chosenedquiz of xquiztbl
exit repeat

end if

if chosenedquiz = 3 and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Which is a common multiple of 5 and 4 ?", "5","10","15","20",4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 4  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Which is not a multiple of 2 ?", "16","20","24","37",4

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
---------------
if chosenedquiz = 5 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg2 "Which is not a  multiple of 4 ?", "16","20","24","37",4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 6 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg2 "Which is neither a  multiple of 3 or of 5 ?", "16","20","24","30",1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 7 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg2 "Which is the greatest common divisor of 2 and 5 ?", "1","2","5","10",1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 8 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg2 "Which is the greatest common divisor of 12 and 15 ?", "2","3","4","5",2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 9 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg2 "Which is the greatest common divisor of 12 and 18 ?", "2","4","6","8",3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 10  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Which is the greatest common divisor of 21 and 28 ?", "3","7","14","21",2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 11  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Which is the greatest common divisor of 8 and 12 and 20 ?", "2","4","6","8",2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 12  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Which is the common divisor of 8 and 12 ?", "3","4","5","6",2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 13  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Which is the common divisor of 6 and 18 ?", "4","5","6","7",3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 14  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Which is the greatest common divisor of 18 and 24 ?", "4","5","6","7",3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 15  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Which is the common divisor of 50 and 75 ?", "10","25","35","45",2


put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 16  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Which is the least common multiple of 2 and 4 and 5 ?", "5","10","15","20",4

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 17  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Which is the least common multiple of 2 and 3 and 4 ?", "6","8","12","18",3

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 18  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8   "1 / 8  multiplied by 8 is equal to ?" , 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 19  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "5 / 30  multiplied by 4 is equal to ?" , 30, 20
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 20  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "4 / 15  multiplied by 3 is equal to ?" , 15, 12
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 21  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "3 / 16  multiplied by 4 is equal to ?" , 16, 12
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 22  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10  "8 / 9  divided by 4 is equal to ?" , 36, 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
----------------------------------------------------------------------------
if chosenedquiz = 23  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "5 / 6  divided by 10 is equal to ?" , 60, 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 24  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "7 / 9  divided by 14 is equal to ?" , 18, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 25  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "16 / 21  divided by 8 is equal to ?" , 21, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 26  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   5bun3, "x", 2bun1,  "= ?" , 10, 3

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 27  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   8bun3, "x", 3bun1,  "= ?" , 8, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 28  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "Make 0.2 into a fractional number!" , 10, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 29  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "Make 0.75 into a fractional number!" , 4, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 30  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "Make 0.5 into a fractional number!" , 2, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 31  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "Make 0.4 into a fractional number!" , 10, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 32  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2  "Which is the greatest among the multiples of 6" , "4" ,"8", "12","24",4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 33  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2  "Which is the smallest among the multiples of 7" , "10" ,"35", "70","105",2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 34  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2  "Which is the greatest among the multiples of 3" , "7" ,"18", "24","36",4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 35  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   4bun1, "+", 2bun1,  "= ?" , 4, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 36  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   3bun2, "-", 6bun1,  "= ?" , 6, 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 37  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   8bun4, "+", 4bun1,  "= ?" , 8, 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 38  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   6bun1, "+", 2bun1,  "= ?" , 6, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 39  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   4bun1, "+", 2bun1,  "= ?" , 4, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 40  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   2bun1, "-", 5bun2,  "= ?" , 10, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 41  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun1, "+", 3bun1,  "= ?" , 9, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 42  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 9bun2,  "= ?" , 9, 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 43  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 9bun3,  "= ?" , 9, 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 44  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 7bun1,  "= ?" , 7, 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 45  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 8bun2,  "= ?" , 8, 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 46  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 5bun4,  "= ?" , 5, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
--------------------------------------
if chosenedquiz = 47  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10  "The total in 6 cups containing 1/2 liter oil apiece is ? L" , 2, 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 48  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4  "The total of 6 goods, weighing 2/3 Kg apiece is ? Kg" , 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 49  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4  "A car running at 60Km/hour runs  ____ Km in 2/3 hours." , 40
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 50  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4  "A train running at 120 Km/hr runs ___ Km in 5/6 hr." , 100
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 51  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   8bun3, "x", 3bun1,  "= ?" , 8, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 52  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   6bun1, "x", 2bun1,  "= ?" , 12, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 53  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   8bun1, "x", 3bun1,  "= ?" , 24, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
-----------------------
if chosenedquiz = 54  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   4bun3, "x", 9bun1,  "= ?" , 36, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
-------------------
if chosenedquiz = 55  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   8bun1, " / ", 3bun1,  "= ?" , 8, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 56  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   2bun1, " / ", 3bun1,  "= ?" , 2, 3

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 57  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   8bun2, " / ", 8bun1,  "= ?" , 1, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 58  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10  "A 6/8 meter ribbon is shared by 3 girls. Each gets __/__ meter" , 8,2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 59  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10  "10/12 Kg cake is shared by 5 men. Each gets __/__ Kg" , 12,2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 60  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10  "10/11 Kg clay is shared by 2 boys. Each gets __/__ Kg ." , 11,5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 61  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10  "8/12 Kg clay is shared by 4 boys. Each gets __/__ Kg." , 6,1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 62  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A=5 cm, B=10 cm, C=4cm, the volume is ___ cm3.",chokuhou, 200
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 63  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A=3 cm, B=5 cm, C=10 cm, the volume is ___ cm3.",chokuhou, 150
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 64  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "The volume of a cube with A = 4 cm is __ cm3.",cube, 64
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



-------------------------------------------------


if chosenedquiz = 65  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   8bun1, "+", 4bun1,  "= ?" , 8, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 66  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   6bun1, "+", 2bun1,  "= ?" , 12, 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 67  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   3bun1, "+", 6bun1,  "= ?" , 2, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if




if chosenedquiz = 68  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   2bun1, "-", 4bun1,  "= ?" , 4, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if




if chosenedquiz = 69  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   2bun1, "+", 6bun1,  "= ?" , 3, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



--------------------
if chosenedquiz = 70  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A=2m, B=3m, C=0.5 m, the volume is __ m3.",chokuhou, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 71  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If  A=3cm, B=4cm, C=0.5 cm, the volume is  ___ cm3.",chokuhou, 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 72  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "1 m3 = ___cm3.", 1000000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 73  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "1 Liter = ___ cm3.", 1000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if





if chosenedquiz = 74  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "1 m3 = ___liters.", 1000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 75  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "1 dl  =  ___ cm3.", 100
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 76  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Water fills a 1cm depth every 3 min. __cm is filled in 12 min.", 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 77  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Water fills a 1cm depth every 2 min.  __cm is filled in 12 min.", 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 78  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "Water fills a 4cm depth every 2 min. __cm is filled in 10 min.", 20.0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 79  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "A car running at 60Km/hr runs __Km in 3 hrs.", 180
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 80  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "A car running 90Km every 2 hrs runs __ Km in 1 hr.", 45
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 81  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "A car running 180Km every 3 hrs runs ___ Km in 1 hr.", 60
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 82  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "A car running 180Km every 3 hrs runs ___ Km in 2 hrs.", 120
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 83  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "A car running at 60Km/hr runs ___ Km in 1/4 hr", 15
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
------------------
if chosenedquiz = 84  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "5 / 5 is equal to ?", 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 85  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 " 12/ 6 is equal to ?", 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 86  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "15 / 5 is equal to ?", 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 87  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "18 / 6 is equal to ?", 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 88  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "24 / 8 is equal to ?", 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 89  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "24/2 is equal to ?", 12
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 90  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A=4cm, B=10cm, C=3cm, the volume is ___cm3.",chokuhou, 120
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 91  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A=5cm, B=10cm, C= __ cm,  the volume is 150cm3 ",chokuhou, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 92  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If  A=___cm, B=15cm, C=6cm, the volume is 180 cm3",chokuhou, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 93  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "The volume of a cube with A = 4 cm is ___ cm3",cube, 64
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 94  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "The volume of a cube with B = 3 cm is ___ cm3",cube,  27
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 95  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "The volume of a cube with A = 5 cm is ___ cm3",cube,  125
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 96  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "The volume of a cube with A = __ cm is 27 cm3",cube,  3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 97  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "The volume of a cube with B = __ cm is 1000cm3",cube,  10
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 98  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "The volume of a cube with C = ___ cm is 8 cm3",cube,  2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if









-------------------------------


-------------------------------
put chosenedquiz +1 into chosenedquiz
if chosenedquiz > totalquiznum then
put 1 into chosenedquiz
end if

end repeat




repeat while quiz_quit = 0
wait 30 ticks
if random(5) = 5 then
dragonmoves
checkegg
if random(3) is not 3 then
 eggtodragon
end if
refreshegg
end if
end repeat








--put 0 into quiz_quit
put 0 into quizongoing

-- Mathtime is set by system and the time unit is 


if math_answer = 1 and math_time <= responselimit then
    randomok

   if frogloc = 35 or frogloc = 26 or frogloc = 15 then

       Other27s_back

        wait 2 seconds
        play Beethovn
        wait 6 seconds
        exitkingdom
        exit quiz100
--------------------------- end game
   end if

else

  if math_answer = -1 then
  game_over2
  exit quiz100
  end if

   if(math_answer is not 1 ) then
   play jawharp
   end if




if (math_time > responselimit) and ( math_answer = 1 ) then 
   play bong
    wait 30 ticks

  end if



if (math_time > responselimit) or ( math_answer is not 1 ) then 
   checkzonex
  end if




end if
end quiz100




On quiz101
put 97 into totalquiznum
put 0 into quiz_quit
put 0 into foundquiz
put 1 into quizongoing
put random(98) into chosenedquiz


repeat 101 times
-------------------------------

if chosenedquiz = 1 and Item chosenedquiz of xquiztbl is not 1 then

QuizDlg4 "The least common multiple of 3 and 4 and 6 is __", 12
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 2 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "The least common multiple of 4 and 5 and 10 is __", 20

put 1 into Item chosenedquiz of xquiztbl
exit repeat

end if

if chosenedquiz = 3 and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "The least common multiple of 1 and 2 and 5 is __", 10
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 4  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "The common multiple of 3 and 4 is __", "15","20","24","37",3

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
---------------
if chosenedquiz = 5 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg2 "The common multiple of 4 and 5 is __", "16","20","24","35",2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 6 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg2 "The common multiple of 3 and 5 is __", "16","20","24","30",4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 7 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "The greatest common divisor of 6 and 8 is __", 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 8 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "The greatest common divisor of 12 and 18 is __", 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 9 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "The greatest common divisor of 16 and 24 is __", 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 10  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "The greatest common divisor of 36 and 54 is __", 18
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 11  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "The greatest common divisor of 4 and 12 and 20 is __", 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 12  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "The common divisor of 8 and 12 is __", "3","4","5","6",2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 13  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "The common divisor of 6 and 18 is  ?", "4","5","6","7",3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 14  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "The common divisor of 18 and 24 is __", "4","5","6","7",3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 15  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "The common divisor of 50 and 75 is __", "10","25","35","45",2


put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 16  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "The least common multiple of 2 and 3 and 5 is __", 30

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 17  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "The least common multiple of 8 and 10 and 24 is __", 120

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 18  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "2/3 multiplied by 8 is equal to __/__" , 3, 16
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 19  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "5/6 multiplied by 4 is equal to__/__" , 6, 20
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 20  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "4/15 multiplied by 3 is equal to __/__" , 15, 12
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 21  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "7/12 multiplied by 8 is equal to __/__ ", 12, 56
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 22  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "8/9 divided by 6 is equal to __/__" , 54, 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
----------------------------------------------------------------------------
if chosenedquiz = 23  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "5/6 divided by 10 is equal to __/__" , 60, 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 24  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "7/8 divided by 14 is equal to  __/__" , 16, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 25  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "16/21 divided by 4 is equal to __/__" , 21, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 26  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   5bun3, "x", 2bun1,  "= ?" , 10, 3

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 27  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   8bun3, "x", 3bun1,  "= ?" , 8, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 28  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "Make 0.3 into a fractional number" , 10, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 29  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "Make 0.8 into a fractional number" , 5, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 30  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "Make 0.5 into a fractional number" , 2, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 31  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "Make 0.4  into a fractional number" , 10, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 32  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2  "The smallest among the common multiples of 4 and 6" , "4" ,"8", "12","24",3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 33  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2  "The smallest among the common multiples of 5 and 12" , "10" ,"35", "60","90",3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 34  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2  "The smallest among the common multiples of 3 and 6 and 9" , "7" ,"18", "24","28",2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 35  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun1, "+", 5bun3,  "= ?" , 35, 26
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 36  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun6, "-", 2bun1,  "= ?" , 14, 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 37  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   8bun4, "+", 9bun3,  "= ?" , 6, 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 38  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun1, "+", 9bun4,  "= ?" , 63, 37
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 39  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   5bun1, "+", 9bun7,  "= ?" , 45, 44
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 40  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   2bun1, "-", 5bun2,  "= ?" , 10, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 41  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   8bun1, "+", 3bun1,  "= ?" , 24, 11
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 42  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 9bun2,  "= ?" , 9, 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 43  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 9bun3,  "= ?" , 9, 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 44  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 7bun1,  "= ?" , 7, 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 45  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 8bun2,  "= ?" , 8, 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 46  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 5bun4,  "= ?" , 5, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
--------------------------------------
if chosenedquiz = 47  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10  "8 bottles contain 5/8L of oil apiece. The total amount is _/_ L" , 8, 40
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 48  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10  "4 goods weighs 2/9 Kg apiece. The total weight is __/__Kg" , 9, 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 49  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4  "A car moving 60Km/hr runs __ Km in 7/12 hrs." , 35
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 50  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4  "A train moving 120Km/hr runs __Km in 5 hrs" , 75
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 51  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun2, "x", 2bun1,  "= ?" , 9, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 52  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   6bun1, "x", 8bun1,  "= ?" , 48, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 53  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   8bun7, "x", 3bun1,  "= ?" , 24, 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
-----------------------
if chosenedquiz = 54  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   4bun3, "x", 9bun1,  "= ?" , 36, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
-------------------
if chosenedquiz = 55  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   8bun7, " / ", 3bun1,  "= ?" , 8, 21
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 56  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   2bun1, " / ", 3bun1,  "= ?" , 2, 3

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 57  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   8bun2, " / ", 8bun1,  "= ? ", 1, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 58  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10  "9/11 m of ribbon shared by 2 men leaves a remainder __/__m" , 11,1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 59  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10  "15/20 Kg of cake shared by 4 men leaves a remainder __/__ Kg" , 20,3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 60  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10  "19/20 Kg of clay shared by 3 men leaves a remainder __/__Kg" , 20,1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 61  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10  "8/10 Kg of clay shared by 4 men yields __/__Kg a share" , 5,1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 62  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A=7cm, B=20cm, C=4cm, the volume is __ cm3",chokuhou, 560
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 63  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A=8 cm, B=14cm, C=5cm, the volume is __ cm3",chokuhou, 560
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 64  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "The volume of a cube with A = 10 cm is ___ cm3",cube, 1000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



-------------------------------------------------


if chosenedquiz = 65  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun1, "+", 4bun1,  "= ?" , 28, 11
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 66  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun8, "+", 2bun1,  "= ?" , 18, 25
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 67  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   3bun1, "+", 5bun2,  "= ?" , 15, 11
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if




if chosenedquiz = 68  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   3bun2, "-", 4bun1,  "= ?" , 12, 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if




if chosenedquiz = 69  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   2bun1, "+", 6bun1,  "= ?" , 3, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



--------------------
if chosenedquiz = 70  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A=2cm, B=3cm, C=0.5 cm, the volume is __cm3",chokuhou, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 71  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A=3cm, B=4cm, C=1.5 cm, the volume is __cm3.",chokuhou, 18
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 72  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "1 m3 = ___cm3", 1000000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 73  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "1 liter = ___ cm3.", 1000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if





if chosenedquiz = 74  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "1 m3 = ___liters", 1000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 75  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "1 dl = ___ cm3.", 100
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 76  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Water fills a  4 cm depth every 3 min. 20 cm is filled in __min.", 15
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 77  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "Water fills a 8 cm depth every 2 min. 20 cm is filled in __min.", 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 78  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "Water fills a 8 cm depth every 2 min.  __cm is filled in 10 min.", 40.0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 79  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "A car moving 60Km/hr runs __ Km in 3 hrs", 180.0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 80  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "A car moving 90Km every 3 hrs runs __ Km in 2 hrs", 60.0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 81  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "A car moving 90Km every 3 hrs runs __ Km in 5 hrs", 150.0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 82  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "A car moving 90Km every 3 hrs runs __ Km in 1/3 hr.", 10.0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 83  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "A car moving 60Km every hour runs __ Km in 3.5 hrs", 210.0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
------------------
if chosenedquiz = 84  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "5 divided by 5 is equal to ?", 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 85  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "12 divided by 6 is equal to ?", 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 86  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "15 divided by 5 is equal to ?", 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 87  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "18 divided by 6 is equal to ?", 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 88  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "24 divided by 8 is equal to ?", 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 89  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "24 divided by 2 is equal to ?", 12
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if




if chosenedquiz = 90  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A=4.5 cm, B=10 cm, C=3.0 cm, the volume is __ cm3",chokuhou, 135
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 91  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A=5.5cm, B=10cm, C= ___cm, the volume is 165 cm3",chokuhou, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 92  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16  "If A=__ cm, B=12 cm, C=5 cm, the volume is 360 cm3",chokuhou, 6

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 93  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "The volume of a cube with A = 7 cm is ___cm3",cube, 343
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 94  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "The volume of a cube with B=5cm is __cm3",cube,  125
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 95  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "The volume of a cube with C= 6 cm is ___cm3",cube,  216
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 96  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "The volume of a cube with A = __ cm is 125 cm3",cube,  5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 97  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If  B = __cm, the volume of a cube is 216cm3",cube,  6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if






-------------------------------
put chosenedquiz +1 into chosenedquiz
if chosenedquiz > totalquiznum then
put 1 into chosenedquiz
end if

end repeat




repeat while quiz_quit = 0
wait 30 ticks
if random(5) = 5 then
dragonmoves
checkegg
if random(3) is not 3 then
 eggtodragon
end if
refreshegg
end if
end repeat








--put 0 into quiz_quit
put 0 into quizongoing

-- Mathtime is set by system and the time unit is 


if math_answer = 1 and math_time <= responselimit then
    randomok

   if frogloc = 35 or frogloc = 26 or frogloc = 15 then

       Other27s_back

        wait 2 seconds
        play Beethovn
        wait 6 seconds
        exitkingdom
        exit quiz101
--------------------------- end game
   end if

else

  if math_answer = -1 then
  game_over2
  exit quiz101
  end if

   if(math_answer is not 1 ) then
   play jawharp
   end if




if (math_time > responselimit) and ( math_answer = 1 ) then 
   play bong
            wait 30 ticks

  end if



if (math_time > responselimit) or ( math_answer is not 1 ) then 
   checkzonex
  end if




end if
end quiz101




On quiz102
put 98 into totalquiznum
put 0 into quiz_quit
put 0 into foundquiz
put 1 into quizongoing
put random(98) into chosenedquiz


repeat 101 times
-------------------------------

if chosenedquiz = 1 and Item chosenedquiz of xquiztbl is not 1 then

QuizDlg4 "The least common multiple of 3 and 4 and 6 is __", 12
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 2 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "The least common multiple of 2 and 4 and 5 is __", 20

put 1 into Item chosenedquiz of xquiztbl
exit repeat

end if

if chosenedquiz = 3 and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "The least common multiple of 2 and 5 and 8 is __", 40
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 4  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "The least common multiple of 2 and 3 and 7 is __", 42

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
---------------
if chosenedquiz = 5 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "The least common multiple of 5 and 8 and 10 is __", 40
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 6 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "The least common multiple of 2 and 5 and 7 is __", 70
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 7 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "The greatest common divisor of 6 and 8 and 10 is __", 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 8 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "The greatest common divisor of 12 and 18 and 24 is __", 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 9 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "The greatest common divisor of 16 and 24  and 32 is __", 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 10  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "The greatest common divisor of 36 and 54 and 72 is __", 18
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 11  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "The greatest common divisor of 4 and 12 and 20 is __", 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 12  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "The greatest common divisor of 5 and 10 and 20 is __", 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 13  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "The greatest common divisor of 14 and 12 and 56 is __", 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 14  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "The greatest common divisor of 16 and 24 and 32 is __", 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 15  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "The greatest common divisor of 36 and 54 and 90 is __", 18


put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 16  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "The least common multiple of 2 and 3 and 5 is __", 30

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 17  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "The least common multiple of 8 and 10 and 24 is __", 120

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 18  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "2/3 multiplied by 8 is __/__" , 3, 16
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 19  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "5/6 multiplied by 4 is __/__" , 6, 20
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 20  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "4/15 multiplied by 3 is __/__" , 15, 12
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 21  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "7/12 multiplied by 8 is __/__" , 12, 56
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 22  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   " 8/9 divided by 6 is __/__" , 54, 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
----------------------------------------------------------------------------
if chosenedquiz = 23  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "5/6 divided by 10 is __/__" , 60, 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 24  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "7/8 divided by 14 is __/__" , 16, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 25  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10   "16/21 divided by 4 is __/__" , 21, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 26  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   5bun3, "x", 2bun1,  "= ?" , 10, 3

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 27  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   8bun3, "x", 3bun1,  "= ?" , 8, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 28  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   5bun3, "+", 2bun1,  "= ?" , 10, 11
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 29  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   5bun3, "-", 2bun1,  "= ?" , 10, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 30  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   6bun3, "-", 4bun1,  "= ?" , 4, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 31  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   4bun1, "+", 9bun1,  "= ?" , 36, 13
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 32  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   8bun3, "+", 2bun1,  "= ?" , 8, 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 33  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   6bun1, "+", 4bun1,  "= ?" , 24, 10
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 34  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   4bun1, "-", 5bun1,  "= ?" , 20, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 35  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun1, "+", 5bun3,  "= ?" , 35, 26
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 36  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun6, "-", 2bun1,  "= ?" , 14, 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 37  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   8bun4, "+", 9bun3,  "= ?" , 6, 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 38  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun1, "+", 9bun4,  "= ?" , 63, 37
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 39  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   5bun1, "+", 9bun7,  "= ?" , 45, 44
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 40  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   2bun1, "-", 5bun2,  "= ?" , 10, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 41  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   8bun1, "+", 3bun1,  "= ?" , 24, 11
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 42  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   2bun1, "-", 9bun2,  "= ?" , 18, 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 43  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   2bun1, "-", 9bun3,  "= ?" , 18, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 44  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   3bun1, "-", 7bun1,  "= ?" , 21, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 45  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   3bun1, "-", 8bun2,  "= ?" , 12, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 46  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   3bun2, "-", 5bun1,  "= ?" , 15, 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
--------------------------------------
if chosenedquiz = 47  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   4bun3, "x", 3bun1,  "= ?" , 12, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 48  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun3, "x", 6bun1,  "= ?" , 54, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 49  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun4, "x", 8bun1,  "= ?" , 14,1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 50  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   5bun4, "x", 6bun1,  "= ?" , 30, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 51  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun2, "x", 2bun1,  "= ?" , 9, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 52  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   6bun1, "x", 8bun1,  "= ?" , 48, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 53  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   8bun7, "x", 3bun1,  "= ?" , 24, 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
-----------------------
if chosenedquiz = 54  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   4bun3, "x", 9bun1,  "= ?" , 36, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
-------------------
if chosenedquiz = 55  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   8bun7, " / ", 3bun1,  "= ?" , 8, 21
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 56  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   2bun1, " / ", 3bun2,  "= ?" , 4, 3

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 57  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   8bun2, " / ", 8bun3,  "= ?" , 3, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 58  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun5, " / ", 8bun2,  "= ?" , 7, 20
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 59  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun4, " / ", 8bun3,  "= ?" , 27, 32
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 60  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   6bun5, " / ", 7bun2,  "= ?" , 12, 35
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 61  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   8bun3, " / ", 7bun3,  "= ?" , 8, 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 62  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "If A=20cm, B=7cm, C=2.5cm, the volume is ___cm3.", 350
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 63  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "If A=5cm, B=8cm, C=3.5cm, the volume is ___ cm3", 140
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 64  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round a cubic volume with 5cm per side to the nearest tenth", 130
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



-------------------------------------------------


if chosenedquiz = 65  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun1, "+", 4bun1,  "= ?" , 28, 11
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 66  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun8, "+", 2bun1,  "= ?" , 18, 25
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 67  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   3bun1, "+", 5bun2,  "= ?" , 15, 11
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if




if chosenedquiz = 68  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   3bun2, "-", 4bun1,  "= ?" , 12, 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if




if chosenedquiz = 69  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   2bun1, "+", 5bun1,  "= ?" , 10, 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



--------------------
if chosenedquiz = 70  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "The volume of a box 2m long, 3m wide, 0.5m high is __m3", 3.0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 71  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "The volume of a box 1.5m long, 3m wide, 4m high is __ m3.", 18.0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 72  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "1 m3 is _____cm3", 1000000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 73  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "1 liter is ____cm3", 1000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if





if chosenedquiz = 74  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "1 m3 is ____liters", 1000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 75  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "100 milliliters is ___cm3", 100
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 76  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Water fills a 4 cm depth every 3 min. 20cm is filled in __min.", 15
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 77  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "Water fills a 8 cm depth every 2 min. __cm is filled in 20 min.", 80
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 78  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "Water fills a 8 cm depth every 2 min. __cm is filled in 10 min.", 40.0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 79  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "A car moving 60Km every hr runs __ Km in 2 and 1/2 hrs", 150.0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 80  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "A car moving 180Km every 3hrs runs __ Km in 2 and 1/2 hrs", 150.0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 81  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "A car moving 180Km every 3hrs runs __ Km in 5 and 1/2 hrs", 330.0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 82  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "A car moving 180Km every 3hrs runs __Km in 1/3 hr", 20.0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 83  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "A car moving 120Km every 2hrs runs ___ Km in 3.5 hrs", 210.0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
------------------
if chosenedquiz = 84  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10 "8/5 = ?(simplest form)", 5,8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 85  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10 "13/6 = ?(simplest form)", 6,13
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 86  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10 "17/5 = ?(simplest form)", 5,17
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 87  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10 "25/6 = ?(simplest form)", 6,25
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 88  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10 "28/8 = ?(simplest form)", 8,28
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 89  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg10 "7/2 = ?(simplest form)", 2,7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if




if chosenedquiz = 90  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A=4.5cm, B=10cm, C=3.0cm,  the volume is __ cm3.",chokuhou, 135
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 91  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A=5.5cm, B=8cm, C=___ cm, the volume is 132 cm3.",chokuhou, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 92  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16  "If A=___cm, B=12.5 cm, C=4cm, the volume is 350 cm3.",chokuhou, 7

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 93  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A=3cm, the volume of the cube is ___cm3",cube, 27
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 94  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If B=6 cm, round the volume to the nearest tenth",cube,  220
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 95  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If C=7cm, round the volume to the nearest tenth",cube,  340
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 96  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A =__cm, the volume of the cube is 125 cm3",cube,  5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 97  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If B=__cm, the volume of the cube is 64 cm3",cube,  4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 98  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If C=__cm, the volume of the cube is 27 cm3",cube,  3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if









-------------------------------
put chosenedquiz +1 into chosenedquiz
if chosenedquiz > totalquiznum then
put 1 into chosenedquiz
end if

end repeat




repeat while quiz_quit = 0
wait 30 ticks
if random(5) = 5 then
dragonmoves
checkegg
if random(3) is not 3 then
 eggtodragon
end if
refreshegg
end if
end repeat








--put 0 into quiz_quit
put 0 into quizongoing

-- Mathtime is set by system and the time unit is 


if math_answer = 1 and math_time <= responselimit then
    randomok

   if frogloc = 35 or frogloc = 26 or frogloc = 15 then

       Other27s_back

        wait 2 seconds
        play Beethovn
        wait 6 seconds
        exitkingdom
        exit quiz102
--------------------------- end game
   end if

else

  if math_answer = -1 then
  game_over2
  exit quiz102
  end if

   if(math_answer is not 1 ) then
   play jawharp
   end if




if (math_time > responselimit) and ( math_answer = 1 ) then 
   play bong
            wait 30 ticks

  end if



if (math_time > responselimit) or ( math_answer is not 1 ) then 
   checkzonex
  end if




end if
end quiz102




























On randomok

put random(3) into rdmok
if rdmok = 1 then
   play good
end if
if rdmok = 2 then
   play alright
end if
if rdmok = 3 then
   play alrighth
end if
show btn narator1
repeat 2 times
set bitmap of btn narator1 to narator2
wait 3 ticks
if mouseclick() then
  exit repeat
end if
set bitmap of btn narator1 to narator1
wait 3 ticks
set bitmap of btn narator1 to narator2
wait 3 ticks
set bitmap of btn narator1 to narator3
wait 3 ticks
end repeat
wait 10 ticks
End randomok




On randomng
play muon
wait 30 ticks
put random(2) into rdmng
if rdmng = 1 then
   play jawharp
end if
if rdmng = 2 then
   play uhoh2
end if
wait 50 ticks
End randomng

On eggtodragon

if  step2_egg = 2 then
   put 2 into fuka_btn_no
    put 3 into step2_egg
    
    littledragonmove
end if

if   step5_egg = 2 then
   put 5 into fuka_btn_no
    put 3 into step5_egg
    
    littledragonmove
end if
if   step8_egg = 2  then
   put 8 into fuka_btn_no
    put 3 into step8_egg
    
    littledragonmove
end if
if   step14_egg = 2  then
   put 14 into fuka_btn_no
    put 3 into step14_egg
    
    littledragonmove
end if
if  step18_egg = 2  then
   put 18 into fuka_btn_no
    put 3 into step18_egg
    
    littledragonmove
end if
if   step21_egg = 2  then
   put 21 into fuka_btn_no
    put 3 into step21_egg
    
    littledragonmove
end if
 
if quiz_quit = 1 then
   exit eggtodragon
end if

if   step22_egg = 2 then
   put 22 into fuka_btn_no
    put 3 into step22_egg
    
    littledragonmove
end if
if   step23_egg = 2  then
   put 23 into fuka_btn_no
    put 3 into step23_egg
    
    littledragonmove
end if
if   step25_egg = 2  then
   put 25 into fuka_btn_no
    put 3 into step25_egg
    
    littledragonmove
end if
if   step26_egg = 2  then
   put 26 into fuka_btn_no
    put 3 into step26_egg
    
    littledragonmove
end if
if   step28_egg = 2  then
   put 28 into fuka_btn_no
    put 3 into step28_egg
    
    littledragonmove
end if
if   step31_egg = 2  then
   put 31 into fuka_btn_no
    put 3 into step31_egg
    
    littledragonmove
end if


if   step32_egg = 2  then
   put 32 into fuka_btn_no
    put 3 into step32_egg
    
    littledragonmove
end if
if   step34_egg = 2 then
   put 34 into fuka_btn_no
    put 3 into step34_egg
    
    littledragonmove
end if


if   step38_egg = 2  then
   put 38 into fuka_btn_no
    put 3 into step38_egg
    
    littledragonmove
end if
if   step39_egg = 2  then
   put 39 into fuka_btn_no
    put 3 into step39_egg
    
    littledragonmove
end if


if quiz_quit = 1 then
   exit eggtodragon
end if


if   step41_egg = 2  then
   put 41 into fuka_btn_no
    put 3 into step41_egg
    
    littledragonmove
end if
if   step42_egg = 2  then
   put 42 into fuka_btn_no
    put 3 into step42_egg
    
    littledragonmove
end if
if   step43_egg = 2  then
   put 43 into fuka_btn_no
    put 3 into step43_egg
    
    littledragonmove
end if
 if  step44_egg = 2  then
   put 44 into fuka_btn_no
    put 3 into step44_egg
    
    littledragonmove
end if
if   step46_egg = 2   then
   put 46 into fuka_btn_no
    put 3 into step46_egg
    
    littledragonmove
end if
if   step47_egg = 2  then
   put 47 into fuka_btn_no
    put 3 into step47_egg
    
    littledragonmove
end if
if   step49_egg = 2  then
   put 49 into fuka_btn_no
    put 3 into step49_egg
    
    littledragonmove
end if
if   step50_egg = 2   then
   put 50 into fuka_btn_no
    put 3 into step50_egg
    
    littledragonmove
end if
if   step51_egg = 2   then
   put 51 into fuka_btn_no
    put 3 into step51_egg
    
    littledragonmove
end if

end eggtodragon


On littledragonmove

repeat 2 times
if quiz_quit = 1 then
 exit repeat
end if
set bitmap of btn %fuka_btn_no% to mdragon2
wait 5 ticks
--if mouseclick()  and quizongoing = 0 then
--   click at clickh(), clickv()
--   exit littledragonmove
--end if
set bitmap of btn %fuka_btn_no% to mdragon3
wait 5 ticks
--if mouseclick() and quizongoing = 0  then
--   click at clickh(), clickv()
--   exit littledragonmove
--end if
set bitmap of btn %fuka_btn_no% to mdragon2
wait 5 ticks
--if mouseclick()  and quizongoing = 0 then
--   click at clickh(), clickv()
--   exit littledragonmove
--end if
set bitmap of btn %fuka_btn_no% to mdragon1
wait 5 ticks
--if mouseclick()  and quizongoing = 0 then
--   click at clickh(), clickv()
--   exit littledragonmove
--end if
end repeat

End littledragonmove

On randomdragonmove
put random(25) into jjj
repeat  25 times
if  step2_egg = 3 and jjj=1 then
   put 2 into fuka_btn_no
    littledragonmove
    exit repeat
end if

if   step5_egg = 3and jjj=2 then
   put 5 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step8_egg = 3 and jjj=3  then
   put 8 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step14_egg = 3 and jjj=4 then
   put 14 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if  step18_egg = 3 and jjj=5 then
   put 18 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step21_egg = 3 and jjj=6 then
   put 21 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step22_egg = 3 and jjj=7 then
   put 22 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step23_egg = 3 and jjj=8 then
   put 23 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step25_egg = 3 and jjj=9 then
   put 25 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step26_egg = 3 and jjj=10 then
   put 26 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step28_egg = 3 and jjj=11 then
   put 28 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step31_egg = 3 and jjj=12 then
   put 31 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step32_egg = 3 and jjj=13 then
   put 32 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step34_egg = 3 and jjj=14 then
   put 34 into fuka_btn_no
    littledragonmove
    exit repeat
end if


if   step38_egg = 3 and jjj=15 then
   put 38 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step39_egg = 3  and jjj=16 then
   put 39 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step41_egg = 3  and jjj=17 then
   put 41 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step42_egg = 3  and jjj=18 then
   put 42 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step43_egg = 3  and jjj=19 then
   put 43 into fuka_btn_no
    littledragonmove
    exit repeat
end if
 if  step44_egg = 3 and jjj=20  then
   put 44 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step46_egg = 3  and jjj=21 then
   put 46 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step47_egg = 3 and jjj=22 then
   put 47 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step49_egg = 3 and jjj=23 then
   put 49 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step50_egg = 3  and jjj=24 then
   put 50 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step51_egg = 3  and jjj=25 then
   put 51 into fuka_btn_no
    littledragonmove
    exit repeat
end if
put jjj + 1 into jjj
if jjj > 25 then
put 1 into jjj
end if
end repeat
end randomdragonmove





On checkroute1
put 0 into route1
if step2_egg = 0 then
   put 0 into route1
else
   put 1 into route1
end if
End checkroute1

On checkroute2
put 0 into route2
if step21_egg = 0 and step22_egg = 0 and step23_egg = 0 then
   put 0 into route2
else
   put 1 into route2
end if

End checkroute2

On checkroute3
put 0 into route3
if step18_egg = 0 then
   put 0 into route3
else
   put 1 into route3
end if

End checkroute3

On checkroute4
put 0 into route4
if step5_egg = 0 then
   put 0 into route4
else
   put 1 into route4
end if

End checkroute4

On checkroute5
put 0 into route5
if step31_egg = 0 and step32_egg = 0 then
   put 0 into route5
else
   put 1 into route5
end if

End checkroute5

On checkroute6
put 0 into route6
if step8_egg = 0  then
   put 0 into route6
else
   put 1 into route6
end if

End checkroute6

On checkroute7
put 0 into route7
if step28_egg = 0  then
   put 0 into route7
else
   put 1 into route7
end if

End checkroute7

On checkroute8
put 0 into route8
if step14_egg = 0  then
   put 0 into route8
else
   put 1 into route8
end if

End checkroute8


On Route8clear
put 0 into  step14_egg

End Route8clear







On checkroute9
put 0 into route9
if step25_egg = 0 and step26_egg = 0 then
   put 0 into route9
else
   put 1 into route9
end if

End checkroute9

On checkroute10
put 0 into route10
if step34_egg = 0 then
   put 0 into route10
else
   put 1 into route10
end if

End checkroute10

On checkroute
 if game_on is not 1 then
   exit checkroute
 end if

   put 0 into frogaction
    checkroute1
    checkroute2
    checkroute3
    checkroute4
    checkroute5
    checkroute6
    checkroute7
    checkroute8
    checkroute9
    checkroute10


if route8 = 1 and route9 = 1 and route10 = 1 then
     if (frogloc >= 11 and frogloc <= 15 ) or (flogloc >= 33 and  frogloc <= 35)  or (frogloc >= 25 and  frogloc <= 26) then
        game_Over
        exit checkroute
    else
        route8clear
        put 0 into route8
    end if
end if
if frogloc = 1 or frogloc = 2 then
   if route2 = 0 or (route4 = 0 and (route5=0 or route6= 0)) and (route1 is not 1) then
     put frogloc + 1 into clickclick
     click at btn %clickclick%
     exit checkroute
    else
      if (route7 = 0) and (route5=0 or route6= 0) and (frogloc = 1 ) then
        click at btn 27
         exit checkroute      
      else
        game_Over
        exit checkroute
      end if
   end if
end if

-------------------------------------
if frogloc >= 20 and  frogloc <= 24 then
        if route2 = 0  or frogloc >= 23 then
             put frogloc + 1 into clickclick
              if clickclick = 25 then 
                  put 11 into clickclick
         
              end if

         if clickclick = 11 then
                go cd 8
        click at btn %clickclick%
          exit checkroute
         end if
        click at btn %clickclick%
          exit checkroute
 else
------------
          if frogloc= 20 and ((step21_egg is not 0) or (step22_egg is not 0) or (step23_egg is not 0)) then
               if route4 = 0 and ( route5 = 0 or route6 = 0 ) then
                 click at btn 3
                 exit checkroute

               else
                    if (route4 is not 0) and route7 =0 and ( route5 is not 0 or route6 is not 0 ) then
                           click at btn 27
                             exit checkroute      
                     else
                       game_Over
                        exit checkroute
                    end if

               end if
         end if
---------------          
        if frogloc= 21 and ( (step22_egg is not 0) or (step23_egg is not 0)) then
            if route4 = 0 and ( route5 = 0 or route6 = 0 ) then
                 click at btn 3
                 exit checkroute
             else
                  if (route4 is not 0) and route7 =0 and ( route5 is not 0 or route6 is not 0 ) then
                  click at btn 27
                             exit checkroute      
                  else
                   game_Over
                   exit checkroute
                  end if
             end if
         end if
--------------------              

      if frogloc= 22 and ( step23_egg is not 0) then
            if route4 = 0 and ( route5 = 0 or route6 = 0 ) then
                 click at btn 3
                 exit checkroute
             else
                if (route4 is not 0) and route7 =0 and ( route5 is not 0 or route6 is not 0 ) then
                  click at btn 27
                             exit checkroute      
                 else
                   game_Over
                   exit checkroute
                 end if
              end if
      end if
-----------------------
    end if


end if
--------------------------------------------
if frogloc >=17 and frogloc <= 19 then
   if frogloc = 17 and (step18_egg is not 0) then
        if (route1 = 0 and route2 = 0) then
             click at btn 1
             exit checkroute
         else
             if route7 = 0 and (route5 = 0 or route6 = 0 ) then
              click at btn 27
                             exit checkroute      
              end if
          end if
    else
         if route2 = 0 or ( route4 = 0 and (route5 = 0 or route6 = 0)) then
           put frogloc + 1 into clickclick
             if clickclick =20 then
                 put 3 into clickclick
               end if
                 click at btn %clickclick%
                 exit checkroute
             
          else
               if route7 = 0 and (route5 = 0 or route6 = 0 ) then
                  click at btn 27
                              exit checkroute      
               else
                  game_over
                  exit checkroute
                end if
           end if

    end if
end if


---------------------



if frogloc >= 4 and frogloc <=6 then
     if frogloc = 4 and (route2 is not 0) and  (step5_egg is not 0) and (route7  = 0 and (route5 = 0 or route6 = 0)) then
         click at btn 27
          exit checkroute
     else
         if (frogloc = 6 and (step5_egg is not 0 )) and (route2 = 0 and (route1  = 0 or route3 = 0)) then
             if route1 = 0 then
                click at btn 1
             else
               click at btn 17
             end if
             exit checkroute
         end if


         if (pre_frogloc <= frogloc ) then

             if (route5 = 0 or route6 = 0) then
                 put frogloc + 1 into clickclick
                 click at btn %clickclick%
                             exit checkroute     
             else
                 if route2 = 0 and (route1 = 0 or route2 = 0 )  then
                     if route1 = 0 then 
                        click at btn 1
                             exit checkroute     
                     else
                        click at btn 17
                             exit checkroute     
                     end if
                  else
                     game_over
                              exit checkroute     
                     
                  end if
             end if
        end if
---
         if (pre_frogloc >= frogloc ) then
            if route2 = 0 then
                 put frogloc - 1 into clickclick
                 click at btn %clickclick%
                             exit checkroute     
             else
                 if route5=0 or route6 = 0 then
                  put frogloc + 1 into clickclick
                  click at btn %clickclick%
                             exit checkroute     
                 else
                         game_over
                             exit checkroute     
                 end if
              end if
   
                   
          end if
          
---


     end if
end if











---------------------------


if frogloc = 27 or frogloc = 28 then
     if ((route5 is not 0) and (route6 is not 0) and (route4 is not 0) and (route2 = 0 )) or ( (route7 is not 0) and frogloc = 27)) then
            if route1 = 0 then
               click at btn 1
                             exit checkroute      
             else
                 if route3 = 0 then
                     click at btn 17
                             exit checkroute      
                  end if
             end if
else
      put frogloc +1 into clickclick
      if clickclick = 29 then 
           put 7 into clickclick
      end if
      click at btn %clickclick%
     exit checkroute
end if
end if

if frogloc >=8 and frogloc <= 10 then
    put frogloc + 1 into clickclick
     if clickclick = 11 then
       go cd 8
    click at btn %clickclick%
   exit checkroute
       
     end if
    click at btn %clickclick%
       
     exit checkroute
 end if

if frogloc >=29 and frogloc <= 32 then
    if( (frogloc= 29 or frogloc = 30) and ((step31_egg is not 0) or(step30_egg is not 0))) or (frogloc = 31 and (step32_egg is not 0)) then
        if (route4 = 0 and route2 = 0) then 
              click at btn 7
            exit checkroute
         else
             if route2 = 0 and rout1 = 0 then
                 click at btn 1
                             exit checkroute      
              else
                  if route2 = 0 and route3 = 0 then
                      click at btn 17
                                exit checkroute      
                  else
                      game_over
                               exit checkroute      
                  end if
                       exit checkroute
               end if
          end if
     else
       put frogloc + 1 into clickclick
        if clickclick = 33 then
             put 11 into clickclick
             go cd 8
            click at btn %clickclick%
            exit checkroute

        end if
            click at btn %clickclick%
     
             exit checkroute

     end if

end if

If frogloc >= 12 and frogloc <= 14 then
      if (route8 is not 0) and (frogloc= 12 or frogloc = 13)) then
            
            click at btn 11
                             exit checkroute      
      else
            put frogloc + 1 into clickclick
            click at btn %clickclick%
                             exit checkroute      
       end if
end if

If frogloc = 25 then
   if step26_egg is not 0 then
       click at btn 11
                             exit checkroute      
    else
      click at btn 26
                             exit checkroute      
    end if
end if

if frogloc >=33 and frogloc <=34 then
      if frogloc = 33 and (step34_egg is not 0) then
          click at btn 11
                             exit checkroute      
      else
          put frogloc + 1 into clickclick
          click at btn %clickclick%
                             exit checkroute      
       end if
end if

if frogloc = 11 then

  put random(3) into n

  if n=1 then

    if route10 = 0 then
       click at btn 33
                             exit checkroute     
    else
       if  route9 = 0 then
          click at btn 25
                             exit checkroute      
       else
            if route8 = 0 then
               click at btn 12
                             exit checkroute      
             end if
                 
                        
       end if
     end if
   end if





  if n=2 then

    if route8 = 0 then
       click at btn 12
                             exit checkroute     
    else
       if  route9 = 0 then
          click at btn 25
                             exit checkroute      
       else
          if route10 = 0 then
           click at btn 33
                             exit checkroute      
          end if
       end if
     end if


 end if


  if n=3 then
       if  route9 = 0 then
          click at btn 25

                             exit checkroute     
        else
            if route8 = 0 then
                 click at btn 12
                             exit checkroute      
           else
             if route10 = 0 then
               click at btn 33
                             exit checkroute      
               end if
            end if
        end if


 end if




      game_over
      exit checkroute      












end if

if frogloc = 3 then
    if route2 = 0 then
       click at btn 20
       exit checkroute
    else
       if route4 = 0  and ( route5 = 0 or route6 = 0 ) then
         click at btn 4
         exit checkroute
        else
           if route7 = 0 and ( route5 = 0 or route6 = 0 ) then
              click at btn 27
              exit checkroute
            else
              game_over
              exit checkroute
            end if
         end if
     end if
end if

If frogloc = 7 then
     if route6 = 0 then
        click at btn 8
                             exit checkroute      
     else
        if route5 = 0 then 
             click at btn 29
                              exit checkroute      
        else
             if route2 is not 0  then
                game_over
                exit checkroute
            else
                if route4 = 0 then
                    click at btn 6
                                 exit checkroute      
                else
                         if route1 = 0 then
                           click at btn 1
                             exit checkroute      
                          else
                              if route3 = 0 then
                                   click at btn 17
                                  exit checkroute      
                              else
                                   game_over
                                    exit checkroute      
                              end if
                           end if
                 end if
                   exit checkroute
               end if
                        
           end if
      end if

end if

if frogloc = 15 or frogloc = 26 or frogloc = 35 then
   click at btn %frogloc%
 
end if

End checkroute


On game_Over

game_Over2
exit game_over

End game_Over

On game_Over2

play uhoohhh

lock screen
show btn wichback
play scaryscr
set loc of btn ldragon1 to locH of btn wichback, locV of btn wichback
show btn ldragon1
unlock screen

ldragonanime


wait 60 ticks
play Beethovn
wait 4 seconds
exitkingdom
exit game_over2
End game_Over2



On game_Over3
play uhoohhh

lock screen
show btn wichback
play scaryscr
set loc of btn ldragon1 to locH of btn wichback, locV of btn wichback
show btn ldragon1
unlock screen

ldragonanime


wait 60 ticks
play Beethovn
wait 4 seconds
exitkingdom
exit game_Over3
End game_Over3


-------------- end card 3 -----------------


On Entranceback
play uhoohhh
wait 150 ticks
put random(3) into rdmback
if rdmback = 1 then
  put 27 into frogloc
end if
if rdmback = 2 then
  put 17  into frogloc
end if
if rdmback = 3 then
  put 1 into frogloc
end if
go cd 3
click at btn %frogloc%
exit entranceback
End Entranceback


On M_KingdomTours

if grade_level = 0 then
  put  3 into  top_pos_x
  getcdtogo
end if

if grade_level = 1 then
  put  5 into  top_pos_x
  getcdtogo
end if

if grade_level = 2 then
  put  7  into  top_pos_x
  getcdtogo
 end if




if selectedcardtogo = 1 then
-- dblqandwait
show btn t_writer
 message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer

  go cd 48
  repeat 2 times
   q_clock48
   if math_answer is not 1 then
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
          entranceback
     exit M_KingdomTours
   end if
 wait 30 ticks
 end repeat

end if





if selectedcardtogo = 2 then
  dblqandwait
show btn t_writer
 message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer

  go cd 46

Game_BunboBunsi5_2

   if math_answer is not 1 then
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
          entranceback
     exit M_KingdomTours
   end if

end if




if selectedcardtogo = 3 then
--  dblqandwait
show btn t_writer
 message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer

  go cd 47


Game_SaidaiK

   if math_answer is not 1 then
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
          entranceback
     exit M_KingdomTours
   end if

end if




if selectedcardtogo = 4 then
  dblqandwait
show btn t_writer
 message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer

  go cd 41

Game_BunboBunsi5_2

   if math_answer is not 1 then
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
          entranceback
     exit M_KingdomTours
   end if

end if


if selectedcardtogo = 5 then
  dblqandwait
 show btn t_writer
  message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "IIf you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer
     go cd 34
GameStart2
   if math_answer is not 1 then
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
          entranceback
   exit M_KingdomTours
   end if
end if





if selectedcardtogo = 6 then

  dblqandwait
 show btn t_writer
  message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer
  go cd 31
  GameStart2
   if math_answer is not 1 then

          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
          entranceback
     exit M_KingdomTours
   end if
end if


if selectedcardtogo = 7 then
--  dblqandwait
show btn t_writer
 message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer

  go cd 104

GameStart

   if math_answer is not 1 then
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
          entranceback
     exit M_KingdomTours
   end if

end if







if frogloc > = 11 and frogloc <= 15 or frogloc > = 33 and frogloc <= 35 or frogloc >= 25 and frogloc <= 26 or  frogloc + 1 = 11 or frogloc + 1 = 33 or frogloc + 1 = 25  then

   if( frogloc = 35 or frogloc = 26 or frogloc = 15) and  math_answer = 1 then

       Other27s_back

        wait 4 seconds
        play Beethovn
        exitkingdom
        exit  M_KingdomTours
--------------------------- end game
  end if


go cd 8
       if math_answer = 1 then
        checkroute
        exit   M_KingdomTours
       else
        exit   M_KingdomTours
       end if
          
else
 go cd 3
        if math_answer = 1 then
        checkroute
        exit   M_KingdomTours
       else
        exit   M_KingdomTours
       end if
end if

End M_KingdomTours






On OK100
    set loc of btn t_writer to 143, 58
    put LocH of btn t_writer into xmessage
    put LocV of btn t_writer into ymessage

    show btn t_writer
  message2 xmessage-79,ymessage-38, 9, "Congratulations! Your answers are 100% correct!"
  hide btn t_writer
End OK100
On OK80
     set loc of btn t_writer to 143, 58
    put LocH of btn t_writer into xmessage
    put LocV of btn t_writer into ymessage

    show btn t_writer
  message2 xmessage-79,ymessage-38, 9, "Congratulations! Your answers are 80% correct!"
  hide btn t_writer
End OK80   


On OK60
    set loc of btn t_writer to 143, 58
    put LocH of btn t_writer into xmessage
    put LocV of btn t_writer into ymessage

    show btn t_writer
  message2 xmessage-79,ymessage-38, 9, "Congratulations! Your answers are 60% correct!"
  hide btn t_writer
End OK60

On dblqandwait
play dblquiz
put 1 into ntx
naratoranimex
wait 120 ticks
End dblqandwait


On getcdtogo

put random( top_pos_x ) into ctj
repeat top_pos_x times
 if Item ctj of checkcardlist = minimum_level then
     put ctj into selectedcardtogo
     put Item ctj of checkcardlist + 1 into Item ctj of checkcardlist
    exit getcdtogo
 else
    put ctj + 1 into ctj
 end if
   if  ctj > top_pos_x then
       put 1 into  ctj
   end if
 end repeat
   put minimum_level + 1 into minimum_level
   put random( top_pos_x ) into ctj
   put ctj into selectedcardtogo
  put Item ctj of checkcardlist + 1 into Item ctj  of checkcardlist

End getcdtogo


On gocd3
go cd 3
End gocd3

On gocd4
go cd 4
End gocd4
On gocd6
go cd 6
End gocd6

On gocd32
go cd 32
End gocd32

On gocd39
go cd 39
End gocd39

On gocd36
go cd 36
End gocd36

On gocd42
go cd 42
End gocd42

On gocd41
go cd 41
End gocd41
On gocd46
go cd 46
End gocd46
On gocd47
go cd 47
End gocd47
On gocd48
go cd 48
End gocd48
On gocd49
go cd 49
End gocd49

On gocd40
go cd 40
End gocd40

On gocd33
go cd 33
End gocd33

On gocd35
go cd 35
End gocd35

On gocd37
go cd 37
End gocd37

On gocd30
go cd 30
End gocd30

On gocd31
go cd 31
End gocd31

On gocd10
go cd 10
End gocd10

On gocd11
go cd 11
End gocd11

On gocd13
go cd 13
End gocd13

On gocd17
go cd 17
End gocd17

On gocd44
go cd 44
End gocd44

On gocd45
go cd 45
End gocd45

On gocd34
go cd 34
End gocd34
On gocd70
go cd 70
End gocd70
On gocd71
go cd 71
End gocd71


On gocd100
go cd 100
End gocd100

On gocd99
go cd 99
End gocd99

On gocd101
go cd 101
End gocd101


On gocd102
go cd 102
End gocd102


On gocd103
go cd 103
End gocd103


On gocd104
go cd 104
End gocd104


On gocd105
go cd 105
End gocd105


On gocd106
go cd 106
End gocd106


On gocd107
go cd 107
End gocd107


On gocd108
go cd 108
End gocd108


On Sansu_owaru
 quit
End Sansu_owaru

On Erase_Sound
	SoundOnOff
End Erase_Sound

-------------------------- card 4 ---------------

On idle 4
put random(20) into rdm4
if rdm4 = 5  then
  idle_anime_baloon
end if

if rdm4 = 7  then
  idle_anime_bee
end if


if rdm4 = 9  then
  play ocean
end if


if rdm4 = 11  then
  idle_anime_frg
end if

if rdm4 = 13  then
  idle_anime_clock
end if


if rdm4 = 15  then
horseminmove
end if

if rdm4 = 18  then
chitarun
end if

End idle



On idle_anime_baloon
set the loc of btn baloon  to 625, 105
show btn baloon
soundrandom
repeat with idle4x = 1 to 60
  put random(5) into idle4y
  if idle4x < 15 then
     put 105 - 2 * idle4x into nnnn
  else
     if idle4x = 15 then
          put nnnn into yyyy
     else
         if idle4x < 30  then
             put yyyy + 3 * idle4x   into nnnn
          else
              if idle4x = 30 then
                 put nnnn into yyyy
              else
                  put yyyy - 2 * (idle4x - 30 )  into nnnn
              end if
          end if

      end if
  end if

  set the loc of btn baloon to 625 - 10 * idle4x, nnnn - idle4y
  wait 5 ticks
  if mouseclick() then
    play click
    go cd 6
   exit idle_anime_baloon
  end if
  
end repeat
 hide btn baloon

End idle_anime_baloon


On idle_anime_bee
put LocH of btn bee_lfts  into c4bx
put LocV of btn bee_lfts  into c4by

set the loc of btn bee_lfts  to c4bx, c4by
show btn bee_lfts
play bee
repeat with idle4x = 1 to 57
  put random(10) into idle4y
  put random(10) into xx4
  set the loc of btn bee_lfts to c4bx - 10 * idle4x + xx4, c4by - 5 * idle4x - idle4y
  wait 5 ticks
  if mouseclick() then
   exit repeat
  end if
  
end repeat

set the loc of btn bee_lfts  to c4bx, c4by

End idle_anime_bee


On idle_anime_frg
play frog
repeat with idle4x = 1 to 3
  set bitmap of btn frg1 to frg2
    wait 10 ticks
  set bitmap of btn frg1 to frg1
    wait 10 ticks
  if mouseclick() then
   exit repeat
  end if
end repeat
   set bitmap of btn frg1 to frg1
 

End idle_anime_frg

On idle_anime_clock
play clock2

End idle_anime_clock
----------------------------- end card 4 ------------------



On Allcard_q5

put 0 into q5_score
if presentcard = 40 then
 
 repeat 5 times
    howmanycandy10
   if math_answer is not 1 then
      if math_answer = -1 then
          exit Allcard_q5
      end if
 
   else
    put q5_score +1 into q5_score
   end if
  end repeat

end if


if presentcard = 32 then
  repeat 5 times
    makeorder
   if math_answer is not 1 then
      if math_answer = -1 then
          exit Allcard_q5
      end if
 
   else
    put q5_score +1 into q5_score
   end if
   end repeat
end if


if presentcard = 33 then
  repeat 5 times
   q_clock33
     if math_answer is not 1 then
      if math_answer = -1 then
          exit Allcard_q5
      end if
 
   else
    put q5_score +1 into q5_score
   end if
 end repeat

end if

if presentcard = 41 then
 
  repeat 5 times
    howmanycandy100
     if math_answer is not 1 then
      if math_answer = -1 then
          exit Allcard_q5
      end if
 
   else
    put q5_score +1 into q5_score
   end if
 end repeat

end if

if presentcard = 37 then
      repeat 5 times
         howtomeasure123
   if math_answer is not 1 then
      if math_answer = -1 then
          exit Allcard_q5
      end if
 
   else
    put q5_score +1 into q5_score
   end if
   end repeat

end if

if presentcard = 42 then
     repeat 5 times
           random_selection_of_column
           q_multiplication
   if math_answer is not 1 then
      if math_answer = -1 then
          exit Allcard_q5
      end if
 
   else
    put q5_score +1 into q5_score
   end if

   end repeat

end if

if presentcard = 39 then
   repeat 5 times
   put random(4) into rdmlives
   if rdmlives = 1 then
        bird2_chosen
   end if
   if rdmlives = 2 then
       octpus_chosen
   end if
   if rdmlives = 3 then
       Zebra_chosen
   end if
   if rdmlives = 4 then
       Ladybugs_chosen
   end if

   if math_answer is not 1 then
      if math_answer = -1 then
          play uhoh2
          exit Allcard_q5
      end if
 
   else
    put q5_score +1 into q5_score
   end if
  end repeat
end if

if q5_score = 5 then
   play fanfar2
   wait 5 seconds
   ok100
end if
if q5_score = 4 then
   play fanfar2
   wait 5 seconds
  ok80
end if
if q5_score = 3 then
   play fanfar2
   wait 5 seconds
  ok60
end if
if q5_score = 2 or q5_score = 1 or q5_score = 0  then
   play Uhoohhh
   wait 2 seconds
end if
   

End Allcard_q5



On opencard 20
randomeyeanime
--show fld information
if random(2) = 1 then
Movebtn1
else
eachcardanime7
end if

End opencard

On opencard 21
randomeyeanime
--show fld information

Movebtn1
End opencard

On opencard 22
randomeyeanime
--show fld information
Movebtn1
End opencard

on opencard 23
randomeyeanime
--show fld information
Movebtn1
End opencard

On opencard 24
randomeyeanime
--show fld information
Movebtn1
End opencard

On opencard 25
randomeyeanime
--show fld information
Movebtn1
End opencard

On opencard 26
randomeyeanime
--show fld information
Movebtn1
End opencard

On opencard 27
randomeyeanime
--show fld information
Movebtn1
End opencard

On opencard 28
randomeyeanime
dragonmoves
End opencard

On opencard 29
randomeyeanime
--show fld information
Movebtn1up
End opencard


On opencard 30
randomeyeanime
--show fld information
Movebtn1
End opencard


On opencard 50
randomeyeanime
--show fld information
if random(2) = 1 then
Movebtn1up
else
eachcardanime4
end if
End opencard

On opencard 51
randomeyeanime
--show fld information
Movebtn1
End opencard

On opencard 52
randomeyeanime
--show fld information
Movebtn1
End opencard

On opencard 53
randomeyeanime
--show fld information
if random(2) = 1 then
Movebtn1
else
eachcardanime4
end if
End opencard

On opencard 54
randomeyeanime
--show fld information
Movebtn1
End opencard

On opencard 55
randomeyeanime
--show fld information
Movebtn1up
End opencard

On opencard 56
randomeyeanime
--show fld information
Movebtn1
End opencard

On opencard 57
randomeyeanime
--show fld information
if random(2) = 1 then
Movebtn1
else
eachcardanime7
end if
End opencard

On opencard 58
randomeyeanime
--show fld information
if random(2) = 1 then
Movebtn1
else
eachcardanime7
end if
End opencard

On opencard 59
randomeyeanime
--show fld information
if random(2) = 1 then
Movebtn1
else
eachcardanime7
end if
End opencard

On opencard 60
randomeyeanime
--show fld information
if random(2) = 1 then
Movebtn1
else
eachcardanime7
end if
End opencard

On opencard 61
randomeyeanime
--show fld information
if random(2) = 1 then
Movebtn1
else
eachcardanime4
end if
End opencard


On opencard 62
randomeyeanime
--show fld information
Movebtn1up
End opencard

On opencard 63
randomeyeanime
Movebtn1
End opencard

On opencard 64
randomeyeanime
--show fld information
if random(2) = 1 then
Movebtn1
else
eachcardanime4
end if
End opencard


On opencard 65
randomeyeanime
--show fld information
if random(2) = 1 then
Movebtn1
else
eachcardanime4
end if
End opencard


On opencard 66
randomeyeanime
--show fld information
if random(2) = 1 then
Movebtn1
else
eachcardanime7
end if
End opencard



On MoveBtn1
All_Egg_REfresh
put LocH of btn 1 into btn1x
put LocV of btn 1 into btn1y
repeat with i = 1 to 10
set loc of btn 1 to btn1x - 15 * (i-1), btn1y
wait 1 ticks
if mouseclick() then
  exit repeat
end if
end repeat
End MOvebtn1





On MoveBtn1Up
All_Egg_REfresh
put LocH of btn 1 into btn1x
put LocV of btn 1 into btn1y
repeat with i = 1 to 10
set loc of btn 1 to btn1x, btn1y - (i-1) * 20
wait 1 ticks
if mouseclick() then
  exit repeat
end if
end repeat
End MOvebtn1Up









On MoveBtn1130
All_Egg_REfresh
put LocH of btn 1 into btn1x
put LocV of btn 1 into btn1y
repeat with i = 1 to 10
set loc of btn 1 to btn1x - 13 * (i-1), btn1y
wait 1 ticks
if mouseclick() then
  exit repeat
end if
end repeat
End Movebtn1130






On MoveBtn1Up200
All_Egg_REfresh
put LocH of btn 1 into btn1x
put LocV of btn 1 into btn1y
repeat with i = 1 to 10
set loc of btn 1 to btn1x, btn1y - (i-1) * 20
wait 1 ticks
if mouseclick() then
  exit repeat
end if
end repeat
End MOvebtn1Up200

On MoveBtn1Up300
All_Egg_REfresh
put LocH of btn 1 into btn1x
put LocV of btn 1 into btn1y
repeat with i = 1 to 15
set loc of btn 1 to btn1x, btn1y - (i-1) * 20
wait 1 ticks
if mouseclick() then
  exit repeat
end if
end repeat
End MOvebtn1Up300



On MoveBtn1Up400
All_Egg_REfresh
put LocH of btn 1 into btn1x
put LocV of btn 1 into btn1y
repeat with i = 1 to 15
set loc of btn 1 to btn1x, btn1y - (i-1) * 26
wait 1 ticks
if mouseclick() then
  exit repeat
end if
end repeat
End MOvebtn1Up400



On MoveBtn1Up500
All_Egg_REfresh
put LocH of btn 1 into btn1x
put LocV of btn 1 into btn1y
repeat with i = 1 to 15
set loc of btn 1 to btn1x, btn1y - (i-1) * 30
wait 1 ticks
if mouseclick() then
  exit repeat
end if
end repeat
End MOvebtn1Up500


On MoveBtn1down150
All_Egg_REfresh
put LocH of btn 1 into btn1x
put LocV of btn 1 into btn1y
repeat with i = 1 to 10
set loc of btn 1 to btn1x, btn1y + (i-1) * 15
wait 1 ticks
if mouseclick() then
  exit repeat
end if
end repeat
End MOvebtn1down150
----------------------------------------------------



On Push_B_Blue
play click_a3
set bitmap of btn b_blue1 to b_blue2

put 1 into whichgame
go cd 2
End Push_B_Blue


On push_b_redl

play knob
if pbredl is not 9999 then
lock screen
hide btn opeboard
set bitmap of btn b_redl1 to b_redl2
unlock screen
put 9999 into pbredl
else
lock screen
show btn opeboard
set bitmap of btn b_redl1 to b_redl1
unlock screen
put 0 into pbredl

end if
if thefirsttime = 0 then
put 1 into thefirsttime
put 11 into ntx
wait 100 ticks
play at_begin
wait 50 ticks
if mouseclick() then
  play muon
click at btn b_green1
  exit push_b_redl

end if

naratoranimex
wait 200 ticks
message2 218, 163, 15, "Select the level of difficulty, click the launch button, and you can start the space tour! Good Luck!"


click at btn b_green1
exit push_b_redl
end if


End push_b_redl



On push_hassin
play knob
set bitmap of btn hassin1 to hassin2
wait 60 ticks
kingdom
End push_hassin


On push_b_green
play click_a3
lock screen
set bitmap of btn b_green1 to b_green2
set bitmap of btn b_yell1 to b_yell1
set bitmap of btn b_red1 to b_red1
unlock screen
set_gradel
wait 60 ticks
click at btn hassin1
End push_b_green


On push_b_yell
--play click_a3
lock screen
set bitmap of btn b_yell1 to b_yell2
set bitmap of btn b_green1 to b_green1
set bitmap of btn b_red1 to b_red1
unlock screen
set_gradem
End push_b_yell


On push_b_red
--play click_a3
lock screen
set bitmap of btn b_red1 to b_red2
set bitmap of btn b_yell1 to b_yell1
set bitmap of btn b_green1 to b_green1
unlock screen
set_gradeh
End push_b_red


----------------------------Animation foe card 3

On cd3comet1Move
play pyu_
put random(3) into whichline
if whichline = 1 then
 set loc of btn comet1 to 700, 151
 repeat with i = 1 to 26
 set loc of btn comet1 to 700 - (i-1) * 40, 151 - (i -1 ) * 40 * 223/359
 wait 1 ticks
 end repeat
else
 if whichline = 2 then
  set loc of btn comet1 to 545, 500
  repeat with i = 1 to 23
  set loc of btn comet1 to 545 - (i-1) * 40, 500 - (i -1 ) * 40 * 223/359
  wait 1 ticks
  end repeat
 else

  set loc of btn comet1 to 700, 500
  repeat with i = 1 to 23
  set loc of btn comet1 to 700 - (i-1) * 40, 500 - (i -1 ) * 40 * 223/359
  wait 1 ticks
  end repeat

end if



end if



End cd3comet1Move



On cd3gaspragMove
put random(400) into dx1
put random(400) into dx2
play stonfall
set loc of btn gasprag to 200 + dx1, -200
repeat with i = 1 to 44
 put 200 + (i-1) * (dx2- dx1)/44  into  x_check
 put -200 + (i-1) * 20 into y_check
 if LocV of btn %frogloc% <= y_check + 15 and LocV of btn %frogloc% >= y_check - 15 and locH of btn %frogloc% >= x_check - 15 and  locH of btn %frogloc% <= x_check + 15 then
 game_over3
 exit cd3gaspragMove
end if
 set loc of btn gasprag to 200 + (i-1) * (dx2- dx1)/44, -200 + (i-1) * 20
-- wait 1 ticks
end repeat

End cd3gaspragMove


On cd3gaspralMove
put random(400) into dx1
put random(400) into dx2
play stonfall
set loc of btn gaspral to 200 + dx1, -200
repeat with i = 1 to 44
 put  200 + (i-1) * (dx2- dx1)/44  into  x_check
 put -200 + (i-1) * 20 into y_check
 if LocV of btn %frogloc% <= y_check + 10 and LocV of btn %frogloc% >= y_check - 10 and locH of btn %frogloc% >= x_check - 10 and  locH of btn %frogloc% <= x_check + 10 then
 game_over3
 exit cd3gaspralMove
end if
 set loc of btn gaspral to 200 + (i-1) * (dx2- dx1)/44, -200 + (i-1) * 20
 --wait 1 ticks
end repeat
End cd3gaspralMove

On cd3gaspramMove
put random(400) into dx1
put random(400) into dx2
play stonfall
set loc of btn gaspram to 200 + dx1, -200
repeat with i = 1 to 44
 put  200 + (i-1) * (dx2- dx1)/44  into  x_check
 put -200 + (i-1) * 20 into y_check
 if LocV of btn %frogloc% <= y_check + 10 and LocV of btn %frogloc% >= y_check - 10 and locH of btn %frogloc% >= x_check - 10 and  locH of btn %frogloc% <= x_check + 10 then
 game_over3
 exit cd3gaspramMove
end if
 set loc of btn gaspram to 200 + (i-1) * (dx2- dx1)/44, -200 + (i-1) * 20
-- wait 1 ticks
end repeat
End cd3gaspramMove

On cd3gasprasMove
put random(400) into dx1
put random(400) into dx2
play stonfall
set loc of btn gaspras to 200 + dx1, -200
repeat with i = 1 to 44
 put  200 + (i-1) * (dx2- dx1)/44  into  x_check
 put -200 + (i-1) * 20 into y_check
 if (LocV of btn %frogloc% <= y_check + 5 and LocV of btn %frogloc% >= y_check - 5 and locH of btn %frogloc% >= x_check - 5 and  locH of btn %frogloc% <= x_check + 5 ) then
 game_over3
 exit cd3gasprasMove
end if
 set loc of btn gaspras to 200 + (i-1) * (dx2- dx1)/44, -200 + (i-1) * 20
-- wait 1 ticks
end repeat
End cd3gasprasMove



On cd3WestMove
play pyu_
put random(3) into whichline
if whichline = 1 then
 set loc of btn west to 450, -150
 repeat with i = 1 to 21
 set loc of btn west to 450 - (i-1) * 40*326/391, -150 + (i -1 ) * 40 
-- wait 1 ticks
 end repeat
else
 if whichline = 2 then
 set loc of btn west to 745, -107
 repeat with i = 1 to 21
 set loc of btn west to 745 - (i-1) * 40*326/391, -107 + (i -1 ) * 40 
-- wait 1 ticks
 end repeat

 else

 set loc of btn west to 600, -130
 repeat with i = 1 to 21
 set loc of btn west to 600 - (i-1) * 40*326/391, -130 + (i -1 ) * 40 
-- wait 1 ticks
 end repeat



end if



end if


End cd3WestMove



On spacerokMove
put random(200) into dx1
put random(100) into dx2
play stonfall
set loc of btn spacerok to 500 + dx1, -100
repeat with i = 1 to 20
 set loc of btn spacerok to 500 + dx1 - (i-1) * (500 + dx1- dx2-50)/20, -100 + (i-1) * 25
-- wait 1 ticks
end repeat

end spacerokMove

-------------------------------------------
On EachCardAnime7

 put random( 4 ) into animekind

if animekind = 1 then
 spacerokMovesmall
end if

if animekind = 2 then
   comet1Movesmall
end if


if animekind = 3 then
   gaspramMovesmall
end if

if animekind = 4 then
   gasprasMovesmall
end if



End EachCardAnime7








On EachCardAnime4

 put random( 2 ) into animekind



if animekind = 1 then
   gaspramMovesmall
end if

if animekind = 2 then
   gasprasMovesmall
end if


End EachCardAnime4


On EachCardAnime2

 put random( 2 ) into animekind

if animekind = 1 then
 spacerokMovesmall
end if


if animekind = 2 then
   comet1Movesmall
end if


End EachCardAnime2










On comet1Move
play pyu_
put random(3) into whichline
set bitmap of btn a_effect to comet1
if whichline = 1 then
 set loc of btn a_effect to 700, 151
 repeat with i = 1 to 23
 set loc of btn a_effect to 700 - (i-1) * 40, 151 - (i -1 ) * 40 * 223/359
 end repeat
else
 if whichline = 2 then
  set loc of btn a_effect to 545, 500
  repeat with i = 1 to 20
  set loc of btn a_effect to 545 - (i-1) * 40, 500 - (i -1 ) * 40 * 223/359
  end repeat
 else

  set loc of btn a_effect to 700, 500
  repeat with i = 1 to 20
  set loc of btn a_effect to 700 - (i-1) * 40, 500 - (i -1 ) * 40 * 223/359
  end repeat

end if



end if



End comet1Move


----------------------

On comet1Movesmall
play pyu_
put random(2) into whichline
set bitmap of btn a_effect to comet1
if whichline = 1 then
 set loc of btn a_effect to 500, 270
 repeat with i = 1 to 20
 set loc of btn a_effect to 500 - (i-1) * 20, 270 - (i -1 ) * 8
 end repeat
 else

  set loc of btn a_effect to 500, 270
  repeat with i = 1 to 23
  set loc of btn a_effect to 500 - (i-1) * 20, 270 - (i -1 ) * 150/25
  end repeat

end if


hide btn a_effect

End comet1Movesmall






On gaspragMove
put random(400) into dx1
put random(400) into dx2
play stonfall
set bitmap of btn a_effect to gasprag 
set loc of btn a_effect to 200 + dx1, -200
repeat with i = 1 to 44
 set loc of btn a_effect to 200 + (i-1) * (dx2- dx1)/44, -200 + (i-1) * 20
end repeat

End gaspragMove

----------------------------




On gaspralMove
put random(400) into dx1
put random(400) into dx2
play stonfall
set bitmap of btn a_effect to gaspral 
set loc of btn a_effect to 200 + dx1, -200
repeat with i = 1 to 44
 set loc of btn a_effect to 200 + (i-1) * (dx2- dx1)/44, -200 + (i-1) * 20
end repeat
End gaspralMove

On gaspramMove
put random(400) into dx1
put random(400) into dx2
play stonfall
set bitmap of btn a_effect to gaspram 
set loc of btn a_effect to 200 + dx1, -200
repeat with i = 1 to 44
 set loc of btn a_effect to 200 + (i-1) * (dx2- dx1)/44, -200 + (i-1) * 20
end repeat
End gaspramMove
--------------------------------
On gaspramMovesmall
put random(400) into dx1
put random(400) into dx2
play stonfall
lock screen
set loc of btn a_effect to 200 + dx1, 130
set bitmap of btn a_effect to gaspram 
show btn a_effect
unlock screen
repeat with i = 1 to 9
 set loc of btn a_effect to 200+dx1 + (i-1) * (dx2- dx1)/10, 130 + (i-1) * 15
end repeat
hide btn a_effect
End gaspramMovesmall

------------------------------------------
On gasprasMove
put random(400) into dx1
put random(400) into dx2
play stonfall
set bitmap of btn a_effect to gaspras
set loc of btn a_effect to 200 + dx1, -200
show btn a_effect
repeat with i = 1 to 44
 set loc of btn a_effect to 200 +dx1+ (i-1) * (dx2- dx1)/44, -200 + (i-1) * 20
end repeat
End gasprasMove

--------------------------------------

On gasprasMovesmall
put random(400) into dx1
put random(400) into dx2
play stonfall
lock screen
set bitmap of btn a_effect to gaspras
set loc of btn a_effect to 100 + dx1, 80
show btn a_effect
unlock screen
repeat with i = 1 to 14
 set loc of btn a_effect to 100 + dx1+(i-1) * (dx2- dx1)/10, 80 + (i-1) * 15
end repeat
hide btn a_effect
End gasprasMovesmall













On WestMove
play pyu_
put random(3) into whichline
set bitmap of btn a_effect to west 
if whichline = 1 then
 set loc of btn a_effect to 450, -150
 repeat with i = 1 to 37
 set loc of btn a_effect to 450 - (i-1) * 20*326/391, -150 + (i -1 ) * 20 
 end repeat
else
 if whichline = 2 then
 set loc of btn a_effect to 745, -107
 repeat with i = 1 to 37
 set loc of btn a_effect to 745 - (i-1) * 20*326/391, -107 + (i -1 ) * 20 
 end repeat

 else

 set loc of btn a_effect to 600, -130
 repeat with i = 1 to 37
 set loc of btn a_effect to 600 - (i-1) * 20*326/391, -130 + (i -1 ) * 20 
 end repeat



end if



end if


End WestMove



On spacerokMove
put random(200) into dx1
put random(100) into dx2
set bitmap of btn a_effect to spacerok
play stonfall
set loc of btn a_effect to 500 + dx1, -100
repeat with i = 1 to 33
 set loc of btn a_effect to 500 + dx1 - (i-1) * (500 + dx1- dx2-50)/33, -100 + (i-1) * 20
end repeat

end spacerokMove

---------------------------------



On spacerokMoveSmall
put random(200) into dx1
put random(100) into dx2
lock screen
set bitmap of btn a_effect to spacerok
play stonfall
set loc of btn a_effect to 300 + dx1, 120
show btn  a_effect
unlock screen
repeat with i = 1 to 12
 set loc of btn a_effect to 300 + dx1 - (i-1) * (300 + dx1- dx2-50)/33, 120 + (i-1) * 11
end repeat
hide btn a_effect

end spacerokMoveSmall





on randomeyeanime
if random(2) =  1 then
  set loc of btn eyeanim1 to 327,112

put random(10) into eye
if eye = 1 then
   show btn eyeanim1
  repeat 2 times
  set bitmap of btn eyeanim1 to eyeanim2
--   wait 2 ticks
  set bitmap of btn eyeanim1 to eyeanim1
--   wait 2 ticks
   end repeat
   hide btn eyeanim1
end if

if eye = 2 then
lock screen
   show btn eyeanim1
   set bitmap of btn eyeanim1 to eyeanim4
unlock screen
  repeat 2 times
  set bitmap of btn eyeanim1 to eyeanim3
--   wait 2 ticks
  set bitmap of btn eyeanim1 to eyeanim4
--   wait 2 ticks
   end repeat
   hide btn eyeanim1
end if

if eye = 3 then
lock screen
   show btn eyeanim1
   set bitmap of btn eyeanim1 to eyeanim5
unlock screen
  repeat 2 times
  set bitmap of btn eyeanim1 to eyeanim6
--   wait 2 ticks
  set bitmap of btn eyeanim1 to eyeanim5
--   wait 2 ticks
   end repeat
   hide btn eyeanim1
end if

if eye = 4 then
lock screen
   show btn eyeanim1
   set bitmap of btn eyeanim1 to eyeanim1
unlock screen
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanim4
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanim5
  wait 2 ticks



   hide btn eyeanim1
end if

if eye = 5 then
lock screen
   show btn eyeanim1
   set bitmap of btn eyeanim1 to eyeanim4
unlock screen
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanim4
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanim1
--  wait 2 ticks



   hide btn eyeanim1
end if


if eye = 6 then
lock screen
   show btn eyeanim1
   set bitmap of btn eyeanim1 to eyeanima
unlock screen
--  wait 2 ticks
repeat 2 times
   set bitmap of btn eyeanim1 to eyeanimf
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanima
--  wait 2 ticks
end repeat


   hide btn eyeanim1
end if

if eye = 7 then
lock screen
   show btn eyeanim1
   set bitmap of btn eyeanim1 to eyeanimb
unlock screen
--  wait 2 ticks
repeat 2 times
   set bitmap of btn eyeanim1 to eyeanime
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanimb
--  wait 2 ticks
end repeat


   hide btn eyeanim1
end if

if eye = 8 then
lock screen
   show btn eyeanim1
   set bitmap of btn eyeanim1 to eyeanimc
unlock screen
--  wait 2 ticks
repeat 2 times
   set bitmap of btn eyeanim1 to eyeanimd
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanimc
--  wait 2 ticks
end repeat


   hide btn eyeanim1
end if

if eye = 9 then
lock screen
   show btn eyeanim1
   set bitmap of btn eyeanim1 to eyeanimc
unlock screen
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanimb
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanima
--  wait 2 ticks



   hide btn eyeanim1
end if

if eye = 10 then
lock screen
   show btn eyeanim1
   set bitmap of btn eyeanim1 to eyeanima
unlock screen
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanimb
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanimc
--  wait 2 ticks



   hide btn eyeanim1
end if



end if

end randomeyeanime
---------------

On chitarun
put 40 into unitdot
put 0 into unitcount
play catyowl

put LocH of btn chita1 into schitax
put LocV of btn chita1 into schitay

put  schitay into YoriginalC
put  700 into XoriginalC

repeat with i = 1 to 3

put unitcount + 1 into unitcount

lock screen
set loc of btn chita1 to XoriginalC - unitcount * unitdot,YoriginalC
set bitmap of btn chita1 to chita2
unlock screen
 

put unitcount + 1 into unitcount

lock screen
set loc of btn chita1 to XoriginalC - unitcount * unitdot,YoriginalC
set bitmap of btn chita1 to chita3
unlock screen




put unitcount + 1 into unitcount

lock screen
set loc of btn chita1 to XoriginalC - unitcount * unitdot,YoriginalC
set bitmap of btn chita1 to chita4
unlock screen




put unitcount + 1 into unitcount

lock screen
set loc of btn chita1 to XoriginalC - unitcount * unitdot,YoriginalC
set bitmap of btn chita1 to chita5
unlock screen








put unitcount + 1 into unitcount

lock screen
set loc of btn chita1 to XoriginalC - unitcount * unitdot,YoriginalC
set bitmap of btn chita1 to chita6
unlock screen


put unitcount + 1 into unitcount

lock screen
set loc of btn chita1 to XoriginalC - unitcount * unitdot,YoriginalC
set bitmap of btn chita1 to chita7
unlock screen





put unitcount + 1 into unitcount

lock screen
set loc of btn chita1 to XoriginalC - unitcount * unitdot,YoriginalC
set bitmap of btn chita1 to chita8
unlock screen




put unitcount + 1 into unitcount

lock screen
set loc of btn chita1 to XoriginalC - unitcount * unitdot,YoriginalC
set bitmap of btn chita1 to chita1
unlock screen






end repeat

set loc of btn chita1 to schitax,YoriginalC

End chitarun

On horseminmove
put LOcH of btn horse1s into h1x0
put LOcV of btn horse1s into h1y0
put LOcH of btn horse2s into h2x0
put LOcV of btn horse2s into h2y0
play horse
if random(2) = 1 then

repeat with i = 1 to 20
lock screen
   if i mod 8 = 0 then
      set bitmap of btn horse1s to horse2s
   end if
   if i mod 8 = 1 then
      set bitmap of btn horse1s to horse3s
   end if
   if i mod 8 = 2 then
      set bitmap of btn horse1s to horse4s
   end if
   if i mod 8 = 3 then
      set bitmap of btn horse1s to horse5s
   end if
   if i mod 8 = 4 then
      set bitmap of btn horse1s to horse6s
   end if
   if i mod 8 = 5 then
      set bitmap of btn horse1s to horse7s
   end if
   if i mod 8 = 6 then
      set bitmap of btn horse1s to horse8s
   end if
   if i mod 8 = 7 then
      set bitmap of btn horse1s to horse1s
   end if
 set loc of btn horse1s to h1x0 - (i-1) * 5, h1y0
unlock screen
 end repeat
 set loc of btn horse1s to h1x0 , h1y0
else
repeat  with i = 1 to 20
  lock screen
   if i mod 8 = 0 then
      set bitmap of btn horse2s to horse2s
   end if
   if i mod 8 = 1 then
      set bitmap of btn horse2s to horse3s
   end if
   if i mod 8 = 2 then
      set bitmap of btn horse2s to horse4s
   end if
   if i mod 8 = 3 then
      set bitmap of btn horse2s to horse5s
   end if
   if i mod 8 = 4 then
      set bitmap of btn horse2s to horse6s
   end if
   if i mod 8 = 5 then
      set bitmap of btn horse2s to horse7s
   end if
   if i mod 8 = 6 then
      set bitmap of btn horse2s to horse8s
   end if
   if i mod 8 = 7 then
      set bitmap of btn horse2s to horse1s
   end if
 set loc of btn horse2s to h2x0 - (i-1) * 5, h2y0
 unlock screen
 end repeat
lock screen
 set loc of btn horse2s to h2x0 , h2y0
       set bitmap of btn horse2s to horse2s
unlock screen

end if


End horseminmove

-------------

on polygon
Omath Menu Polygon
end polygon


on pie
Omath Menu Sector
end pie


on colorit
Omath Menu ColorIt
end colorit






on colorit
Omath Menu ColorIt
end color it

On Oprint
OMath Menu Print

end Oprint


on file_omath
Omath Menu File
end file_omath

on plot_a_point
OMath Menu Plotapoint
end plot_a_point

on draw_line_with_2dots
OMath Menu LineSegment
end draw_line_with_2dots
on draw_vline
OMath Menu VerticalLine
end draw_vline
on draw_parallel_line
OMath Menu ParallelLine
end draw_parallel_line
on draw_circle_given_rad
OMath Menu Circle_radius
end draw_circle_given_rad
on hide_dot_line
OMath Menu Show/Hide
end hide_dot_line
on undo_operation
OMath Menu Undo
end undo_operation
on label_attach
OMath Menu Label
end label_attach
on set_commenting
OMath Menu Commenting
end set_commenting
on email_omath
OMath Mail

end email_omath

On move_object
OMath Menu Move
end move_object

On find_length
OMath Menu Length
End find_length

On find_angle
OMath Menu AngleSize
End find_angle

On erasing
OMath Menu Erase
End erasing

On point_intersection
OMath Menu Pointofintersection
End point_intersection



---------------Registration
On showstamp
show_lock
End showstamp


On inputkey
set_key
End inputkey

On go_registration
go cd 110
End go_registration


