on OpenCard 1
disable menu "Option"
disable menu "Index"
ExplanationMenuName help
put 0 into firstonlyonetime
wait 90 ticks
play organch1
wait 210 ticks

play creak
dooropen
wait 60 ticks
play horror1
wait 300 ticks
go cd 16
end opencard






On opencard 16


put 9 into w1x
play miyako1
witchanime1
wait 90 ticks

play muon


put 10 into w1x
play miyako2
witchanime1
wait 90 ticks

play muon



go card 3
End OpenCard




on OpenCard 100
go card 3
End OpenCard

on dooropen
set bitmap of btn door1 to door2
wait 20 ticks
set bitmap of btn door1 to door3
wait 20 ticks
end dooropen
-------------------card3------------------------
On notabletogo
End notabletogo

On set_gradel
 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
 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
 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 0 into frogloc
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
set bitmap of btn witch1 to witch1
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

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

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

end if

set bitmap of btn witchl1 to witchl1
wait 5 ticks
set bitmap of btn witchl1 to witchl2
wait 5 ticks
if random(20) = 8 then
   wait 7 ticks
end if
set bitmap of btn witchl1 to witchl1
wait 5 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
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
  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
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 2 into ntx
naratoranimex
End show_frog_good


On k_froganime2
repeat with j = 1 to 2
set bitmap of btn k_frog1 to k_frog1
wait 2 ticks
set bitmap of btn k_frog1 to k_frog3
wait 2 ticks
set bitmap of btn k_frog1 to k_frog4
wait 2 ticks
set bitmap of btn k_frog1 to k_frog3
wait 2 ticks
end repeat
set bitmap of btn k_frog1 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 kiddyanime 
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 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 2 ticks
if random(15) = 8 then
 wait 3 ticks
 if mouseclick() then
   exit repeat
 end if
end if
set bitmap of btn narator1 to narator1
wait 2 ticks
if random(15) = 8 then
 wait 3 ticks
 if mouseclick() then
   exit repeat
 end if
end if
set bitmap of btn narator1 to narator2
wait 2 ticks
 if mouseclick() then
   exit repeat
 end if
set bitmap of btn narator1 to narator3
wait 2 ticks
 if mouseclick() then
   exit repeat
 end if
if random(15) = 8 then
 wait 3 ticks
 if mouseclick() then
   exit repeat
 end if
end if
end repeat

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
if game_on = 1 then
SoundRandom
lock screen
show btn witch1
show btn k_frog1
--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 k_frog1 to locH of btn %frogloc%, locV of btn %frogloc%

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 if




if grade_level_ini is not 1 then
   put 1 into grade_level
   put 1 into grade_level_ini
end if



if( game_on is not 1)  then
lock screen
show btn witch1
show btn gradeh
show btn gradem
show btn gradel
hide btn k_frog1
if grade_level = 0 then
   set bitmap of btn gradel to gradels
   set bitmap of btn gradem to gradem
   set bitmap of btn gradeh to gradeh
end if
if grade_level = 1 then
   set bitmap of btn gradel to gradel
   set bitmap of btn gradem to gradems
   set bitmap of btn gradeh to gradeh
end if
if grade_level = 2 then
   set bitmap of btn gradel to gradel
   set bitmap of btn gradem to gradem
   set bitmap of btn gradeh to gradehs
end if
unlock screen
set the loc of btn k_frog1 to 551,370
set the loc of btn narator1 to 551,370
-------- onlyonetimeanime
if  (theonlyonetime is not 999) then
play eatingc
wait 1 seconds
play muon

put 999 into theonlyonetime
kingdom
end if
end if
put 0 into xend
End opencard





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



On kingdom
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 k_frog1 to 565,251
show btn k_frog1
unlock screen




if grade_level = 0 then
  put 10 into dragontimes
  put 18 into responselimit
  put 17 into  maxeggnumber
end if
if grade_level = 1 then
  put 7 into dragontimes
  put 16 into responselimit
  put 14 into  maxeggnumber
end if
if grade_level = 2 then
  put 6 into dragontimes
  put 14 into responselimit
  put 12 into  maxeggnumber
end if

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

SoundRandom
put random(3) into initialroute
if initialroute = 1 then
    click at btn 1
  else
    if initialroute = 2 then
          click at btn 17
     else
          click at btn 27
     end if
 end if
End kingdom

On checkegg

if crackedegg < maxcrackedegg then
put random(26) into j
repeat 26 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 j + 1 into j
if j > 26 then
put 1 into j
end if
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
if mouseclick() and quiz_quit= 0 and quizongoing = 0 then
put 0 into timecounter
 click at clickh(), clickv()
end if
set bitmap of btn mdragon1 to mdragon3
wait 7 ticks
if quiz_quit = 1 then 
exit repeat
end if
if mouseclick() and quiz_quit= 0  and quizongoing = 0 then
put 0 into timecounter
 click at clickh(), clickv()
 
end if
set bitmap of btn mdragon1 to mdragon2
wait 7 ticks
if quiz_quit = 1 then 
exit repeat
end if
if mouseclick() and quiz_quit= 0  and quizongoing = 0 then
put 0 into timecounter
 click at clickh(), clickv()

end if

set bitmap of btn mdragon1 to mdragon1
wait 7 ticks
if quiz_quit = 1 then 
exit repeat
end if
if mouseclick() and  quiz_quit= 0  and quizongoing = 0 then
put 0 into timecounter
 click at clickh(), clickv()

end if
end repeat
put timecounter + 1 into timecounter
end basicdragonmove


On dragonmove1
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 56 to 32,130
end if
if k = 2 then
  set the loc of btn 56 to 44,130
end if
if k =3 then
  set the loc of btn 56 to 59,127
end if
if k =4 then
  set the loc of btn 56 to 75,122
end if
if k =5 then
  set the loc of btn 56 to 98,124
end if
if k =6 then
  set the loc of btn 56 to 109,115
end if
basicdragonmove
end repeat



End dragonmove1

On dragonmove2
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 56 to 12,236
end if
if k = 2 then
  set the loc of btn 56 to 19,243
end if
if k =3 then
  set the loc of btn 56 to 7,251
end if
basicdragonmove
end repeat

End dragonmove2

On dragonmove3
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 56 to 117,272
end if
if k = 2 then
  set the loc of btn 56 to 136,276
end if
if k = 3 then
  set the loc of btn 56 to 157,287
end if
if k =4 then
  set the loc of btn 56 to 145,297
end if
if k =5 then
  set the loc of btn 56 to 171,298
end if
basicdragonmove
end repeat


End dragonmove3

On dragonmove4
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 56 to 22,351
end if
if k = 2 then
  set the loc of btn 56 to 36,361
end if
if k =3 then
  set the loc of btn 56 to 47,373
end if
if k =4 then
  set the loc of btn 56 to 37,384
end if
basicdragonmove
end repeat


End dragonmove4


On dragonmove5
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 56 to 192,419
end if
if k = 2 then
  set the loc of btn 56 to 218,415
end if
if k =3 then
  set the loc of btn 56 to 238,423
end if
if k =4 then
  set the loc of btn 56 to 264,430
end if
basicdragonmove
end repeat


End dragonmove5


On dragonmove6
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 56 to 328,371
end if
if k = 2 then
  set the loc of btn 56 to 344,372
end if
if k =3 then
  set the loc of btn 56 to 364,373
end if
if k =4 then
  set the loc of btn 56 to 374,374
end if
basicdragonmove
end repeat


End dragonmove6

On dragonmove7
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 56 to 261,322
end if
if k = 2 then
  set the loc of btn 56 to 276,321
end if
if k =3 then
  set the loc of btn 56 to 288,320
end if
basicdragonmove
end repeat


End dragonmove7

On dragonmove8
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 56 to 340,197
end if
if k = 2 then
  set the loc of btn 56 to 353,207
end if
if k =3 then
  set the loc of btn 56 to 361,222
end if
if k =4 then
  set the loc of btn 56 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 k_frog1 to locH of btn %frogloc%, locV of btn %frogloc%
end if
if game_on = 1 and random(3) = 1 then
    dragonmoves
end if
if game_on = 1 and random(2) = 1 then
  checkegg
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

lock screen
show btn 64
set the loc of btn mdragon1 to 507,191
set the loc of btn k_frog1 to 551,370
set the loc of btn witch1 to 551,87
show btn 67
hide btn 66
    set bitmap of btn 2 to bw
    set bitmap of btn 5 to bw
    set bitmap of btn 8 to bw
    set bitmap of btn 14 to bw
    set bitmap of btn 18 to bw
    set bitmap of btn 21 to bw
    set bitmap of btn 22 to bw
    set bitmap of btn 23 to bw
    set bitmap of btn 25 to bw
    set bitmap of btn 26 to bw
    set bitmap of btn 28 to bw
    set bitmap of btn 31 to bw
    set bitmap of btn 32 to bw
    set bitmap of btn 34 to bw
    set bitmap of btn 38 to egg
    set bitmap of btn 39 to egg
    set bitmap of btn 41 to egg
    set bitmap of btn 42 to egg
    set bitmap of btn 43 to egg
    set bitmap of btn 44 to egg
    set bitmap of btn 45 to egg
    set bitmap of btn 46 to egg
    set bitmap of btn 47 to egg
    set bitmap of btn 49 to egg
    set bitmap of btn 50 to egg
    set bitmap of btn 51 to egg
hide btn 38
hide btn 39
hide btn 41
hide  btn 42
hide btn 45
hide btn 46
hide btn 47
hide btn 49
hide btn 50
hide btn 51
show btn gradeh
show btn gradem
show btn gradel
hide btn wichback
hide btn k_frog1
if grade_level = 0 then
   set bitmap of btn gradel to gradels
 set bitmap of btn gradem to gradem
 set bitmap of btn gradeh to gradeh
end if
if grade_level = 1 then
 set bitmap of btn gradel to gradel
   set bitmap of btn gradem to gradems
 set bitmap of btn gradeh to gradeh
end if
if grade_level = 2 then
 set bitmap of btn gradel to gradel
 set bitmap of btn gradem to gradem
 set bitmap of btn gradeh to gradehs
end if
show fld easy
show fld soso
show fld hard
unlock screen
put 0 into game_on
initialize
click at btn narator1
end exitkingdom


On entrancemessage
show btn t_writer
message2 LocH of btn t_writer - 86, LocV of btn t_writer - 41, 9, "Proceed from here toward the witch's castle 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 frogloc into pre_frogloc
put 1 into frogloc
basicstepaction
end if
End step1


On step2
if game_on = 1 then
if  step2_egg = 0 then
put frogloc into pre_frogloc
put 2 into frogloc
basicstepaction
end if
end if
End step2

On step3
if game_on = 1 then
put frogloc into pre_frogloc
put 3 into frogloc
basicstepaction
end if
End step3

On step4
if game_on = 1 then
put frogloc into pre_frogloc
put 4 into frogloc
basicstepaction
end if
End step4

On step5
if game_on = 1 then
if  step5_egg = 0 then
put frogloc into pre_frogloc
put 5 into frogloc
basicstepaction
end if
end if
End step5


On step6
if game_on = 1 then
put frogloc into pre_frogloc
put 6 into frogloc
basicstepaction
end if
End step6


On step7
if game_on = 1 then
put frogloc into pre_frogloc
put 7 into frogloc
basicstepaction
end if
End step7


On step8
if game_on = 1 then
if step8_egg = 0 then
put frogloc into pre_frogloc
put 8 into frogloc
basicstepaction
end if
end if
End step8


On step9
if game_on = 1 then
put frogloc into pre_frogloc
put 9 into frogloc
basicstepaction
end if
End step9


On step10
if game_on = 1 then
put frogloc into pre_frogloc
put 10 into frogloc
basicstepaction
end if
End step10

On step11
if game_on = 1 then
put frogloc into pre_frogloc
put 11 into frogloc
basicstepaction
end if
End step11

On step12
if game_on = 1 then
put frogloc into pre_frogloc
put 12 into frogloc
basicstepaction
end if
End step12

On step13
if game_on = 1 then
put frogloc into pre_frogloc
put 13 into frogloc
basicstepaction
end if
End step13

On step14
if game_on = 1 then
if step14_egg = 0 then
put frogloc into pre_frogloc
put 14 into frogloc
basicstepaction
end if
end if
End step14


On step15
if game_on = 1 then
put frogloc into pre_frogloc
put 15 into frogloc
basicstepaction
end if
End step15


On step17
if game_on = 1 then
put frogloc into pre_frogloc
put 17 into frogloc
basicstepaction
end if
End step17


On step18
if game_on = 1 then
if step18_egg = 0 then
put frogloc into pre_frogloc
put 18 into frogloc
basicstepaction
end if
end if
End step18


On step19
if game_on = 1 then
put frogloc into pre_frogloc
put 19 into frogloc
basicstepaction
end if
End step19

On step20
if game_on = 1 then
put frogloc into pre_frogloc
put 20 into frogloc
basicstepaction
end if
End step20


On step21
if game_on = 1 then
if step21_egg = 0 then
put frogloc into pre_frogloc
put 21 into frogloc
basicstepaction
end if
end if
End step21


On step22
if game_on = 1 then
if  step22_egg = 0 then
put frogloc into pre_frogloc
put 22 into frogloc
basicstepaction
end if
end if
End step22


On step23
if game_on = 1 then
if step23_egg = 0 then
put frogloc into pre_frogloc
put 23 into frogloc
basicstepaction
end if
end if
End step23


On step24
if game_on = 1 then
put frogloc into pre_frogloc
put 24 into frogloc
basicstepaction
end if
End step24


On step25
if game_on = 1 then
if step25_egg = 0 then
put frogloc into pre_frogloc
put 25 into frogloc
basicstepaction
end if
end if
End step25


On step26
if game_on = 1 then
put frogloc into pre_frogloc
put 26 into frogloc
basicstepaction
end if
End step26


On step27
if game_on = 1 then
put frogloc into pre_frogloc
put 27 into frogloc
basicstepaction
end if
End step27


On step28
if game_on = 1 then
if step28_egg = 0  then
put frogloc into pre_frogloc
put 28 into frogloc
basicstepaction
end if
end if
End step28


On step29
if game_on = 1 then
put frogloc into pre_frogloc
put 29 into frogloc
basicstepaction
end if
End step29


On step30
if game_on = 1 then
put frogloc into pre_frogloc
put 30 into frogloc
basicstepaction
end if
End step30


On step31
if game_on = 1 then
put frogloc into pre_frogloc
put 31 into frogloc
basicstepaction
end if
End step31


On step32
if game_on = 1 then
if step32_egg = 0 then
put frogloc into pre_frogloc
put 32 into frogloc
basicstepaction
end if
end if
End step32


On step33
if game_on = 1 then
put frogloc into pre_frogloc
put 33 into frogloc
basicstepaction
end if
End step33


On step34
if game_on = 1 then
if  step34_egg = 0 then
put frogloc into pre_frogloc
put 34 into frogloc
basicstepaction
end if
end if
End step34


On step35
if game_on = 1 then
put frogloc into pre_frogloc
put 35 into frogloc
basicstepaction
end if
End step35




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
End SoundRandom


On basicstepaction
if game_on is not 1 then
   exit basicstepaction
end if
put 0 into  quiz_quit
checkegg
if game_on is not 1 then
   exit basicstepaction
end if
SoundRandom
set the loc of btn k_frog1 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
        M_KingdomTours
      if math_answer = 1 then
        checkroute
       else
            checkzonex
         click at %frogloc%
       end if


           exit basicstepaction
      end if
   end if

   if(frogloc = 21 or frogloc = 23 or frogloc = 11 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

        M_KingdomTours
       if math_answer = 1 then
        checkroute
       else
         checkzonex
         click at %frogloc%
       end if
           exit basicstepaction
      end if
   end if







     if grade_level = 0 then
                quiz100
     end if

     if grade_level = 1 then
           quiz101
    end if

      if grade_level = 2 then
                quiz102
      end if

  set the loc of btn k_frog1 to  locH of btn %frogloc% , locV of btn %frogloc%

 end if


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 89 into totalquiznum
put 0 into quiz_quit
put 0 into foundquiz
put 1 into quizongoing
put random(89) into chosenedquiz


repeat 101 times

if chosenedquiz = 1 and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "What added to 5 equals 10 ? ", 5

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 2 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "What added to 4 equals 10 ? ", 6

put 1 into Item chosenedquiz of xquiztbl
exit repeat

end if

if chosenedquiz = 3 and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "What added to 2 equals 10 ? ",8
"
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 4  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "What added to 1 equals 10 ? ", 9

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 5 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "6 + 1 = ?", 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

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

if chosenedquiz = 7 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "1 + 2 = ?",3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 8 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "2 + 3 = ?", 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 9 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "3 + 3 = ?", 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 10  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "2 + 7 = ?", 9
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 11  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "8 + 2 = ?", 10
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 12  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "1 + 9 = ?", 10
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 13  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "7 + 0 = ?", 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 14  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "0 + 9 = ?", 9
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 15  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "One out of four squirrels is missing. How many squirrels remain?
", 3


put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 16  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "3 out of 5 flower stalks were cut down. How many stalks remain? ", 2

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 17  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "I ate 1 out of 4 bananas, how many bananas are left?", 3

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 18  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "5 - 3 = ?", 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 19  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "8 - 1 = ?", 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 20  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "6 - 4 = ?", 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 21  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "6 - 1 = ?", 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 22  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "9 - 6 = ?", 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 23  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "10 - 4 = ?", 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 24  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "10 - 2 = ?", 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 25  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "If you add 10 to 4, the sum will be __", 14
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 26  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "If you add 10 to 8, the sum will be  ___", 18

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 27  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "If you add 10 to 3, the sum will be ___", 13
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 28  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "If you add 10 to 1, the sum will be ___", 11
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 29  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "If you add 10 to 0, the sum will be __", 10
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 30  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "One before 12  is  __", 11
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 31  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "One less than 27  is  __", 26
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 32  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "One before 23 is  __", 22
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 33  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "One less than 30 is __", 29
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 34  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "One before 30 is  __", 29
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 35  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "One after 30  is  __", 31
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 36  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "One after 23 is  __", 24
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 37  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "One after 18  is __", 19
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 38  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "One greater than 12  is  __", 13
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 39  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "One greater than 28 is __", 29
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 40  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "One greater than 29 is equal to __", 30
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 41  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "7 + 3  = ?", 10
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 42  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "3 + 4 = ?", 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 43  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "9 + 1  = ?", 10
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 44  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "2 + 8  = ?", 10
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 45  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "10 - 6 = ?", 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 46  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "9 - 4 = ?", 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 47  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "7 - 6 = ?", 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 48  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "3 - 2 = ?", 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 49  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "5 + 3 = ?", 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 50  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "6 - 3 = ?", 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 51  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "3 + 3  = ?", 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 52  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "4 + 3 = ?", 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 53  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "5 + 4 = ?", 9
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 54  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "30 + 4 = ?", 34
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 55  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "70 + 2 = ?", 72
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 56  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "4 + 40 = ?", 44
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 57  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "3 + 50 = ?", 53
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 58  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "5 + 3 = ?", 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 59  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "3 + 7 = ?", 10
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 60  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "8 + 1 = ?", 9
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 61  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "8 - 3 = ?", 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 62  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "7 - 5 = ?", 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 63  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "9 - 4 = ?", 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 64  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "8 - 2 = ?", 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 65  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "8 - 4 = ?", 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 66  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "5 - 1 = ?", 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 67  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "10 - 2 = ?", 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 68  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "10 + 7 = ?", 17
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 69  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "7 - 3 = ?", 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 70  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "10 + 6 = ?", 16
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

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

if chosenedquiz = 72  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "10 - 6 = ?", 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 73  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "17 - 2 = ?",15
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if




if chosenedquiz = 74  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which figure is a circle ?", m_square, m_circle, m_rect, m_tri, 2
exit repeat
end if

if chosenedquiz = 75  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Point out a rectangle! ", m_r_tri, m_circle, m_rect, m_tri, 3
exit repeat
end if

if chosenedquiz = 76  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Point out a triangle!", m_square, m_circle, m_rect, m_tri, 4
exit repeat
end if

if chosenedquiz = 77  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which figure is a rectangle?", m_square, m_daikei, m_circle, m_tri, 1
exit repeat
end if



if chosenedquiz = 78  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which group has the most animals? ", m_hotar3, m_aunt5, m_crab4, m_lb2, 2
exit repeat
end if



if chosenedquiz = 79  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which group has the most animals ?", m_hotar2, m_aunt3, m_crab5, m_lb4, 3
exit repeat
end if

if chosenedquiz = 80  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which group has the most animals ?", m_lb5, m_hotar3, m_aunt2, m_crab4, 1
exit repeat
end if


if chosenedquiz = 81  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which group has the fewest animals ?", m_lb4, m_hotar2, m_aunt3, m_crab4, 2
exit repeat
end if

if chosenedquiz = 82  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which group has the fewest animals ?", m_hotar3, m_aunt4, m_crab5, m_lb4, 1
exit repeat
end if



if chosenedquiz = 83  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which group has the fewest animals ?", m_hotar4, m_aunt5, m_crab4, m_lb1, 4
exit repeat
end if

if chosenedquiz = 84  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input fifty-four ", 54
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 85  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input fifteen", 15
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 86  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input seventy-two", 72
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 87  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input nine", 9
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 88  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which figure is not a triangle ? ", m_square, m_r_tri, m_tri3, m_tri, 1
exit repeat
end if

if chosenedquiz = 89  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which animal is the most dominant? ", m_hotar2, m_aunt3, m_crab5, m_lb4, 3
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

dragonmoves
checkegg
 eggtodragon
end repeat

put 0 into quiz_quit
put 0 into quizongoing

if math_answer = 1 and math_time < responselimit then
    randomok
    k_froganime2
---------------------------------------------------
   if frogloc = 35 or frogloc = 26 or frogloc = 15 then
      mdoor_open
       go cd 9
        action9
        exit quiz100
--------------------------- end game


    else 
      checkroute
      exit quiz100
   end if

else
if math_answer = -1 then
  game_over2
  exit quiz100
end if
   if(math_answer is not 1 ) then
   play jawharp
   set bitmap of btn witch1 to witchspr
   wait 2 seconds
   set bitmap of btn witch1 to witch1
   end if
if (math_time > responselimit) or ( math_answer is not 1 ) then 
   checkzonex
end if
click at btn %frogloc%
end if
end quiz100










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


repeat 101 times

if chosenedquiz = 1 and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "What added to 5 equals 10 ?", 5

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 2 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "What added to 4 equals 10 ?", 6

put 1 into Item chosenedquiz of xquiztbl
exit repeat

end if

if chosenedquiz = 3 and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "What added to 2 equals 10 ?",8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 4  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "What added to 1 equals 10?", 9

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 5 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "6 + 1 = ?", 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

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

if chosenedquiz = 7 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "1 + 2 = ?",3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 8 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "2 + 3 = ?", 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 9 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "3 + 3 = ?", 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 10  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "2 + 7 = ?", 9
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 11  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "8 + 2 = ?", 10
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 12  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "1 + 9 = ?", 10
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 13  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "7 + 0 = ?", 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 14  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "0 + 9 = ?", 9
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 15  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "2 out of 4 squirrels are missing.  How many remain?", 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 "4 out of 6 flower stalks were cut down. How many remain?", 2

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 17  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "You ate 2 out of 5 bananas. How many remain?", 3

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 18  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "5 - 3 = ?", 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 19  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "8 - 1 = ?", 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 20  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "6 - 4 = ?", 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 21  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "9 - 4 = ?", 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 22  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "9 - 6 = ?", 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 23  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "10 - 4 = ?", 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 24  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "10 - 2 = ?", 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 25  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Adding 10 to 3 makes __", 13
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 26  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Adding 9 to 9 makes __", 18

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 27  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Adding 9 to 3 makes __", 12
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 28  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Adding 10 to 10 makes __", 20
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 29  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Adding 10 to 7 makes __",17
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 30  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "One before 17 is __", 16
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 31  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "3 fewer than 29  is __", 26
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 32  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "2 numbers before 24 is __", 22
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 33  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "6 fewer than 35 is __", 29
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 34  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "2 numbers before 40  is  __", 38
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 35  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "One after 30  is __", 31
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 36  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "One after 23 is ?", 24
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 37  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "4 after 23 is ?", 27
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 38  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "One greater than 12 is __", 13
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 39  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "One greater than 28 is __", 29
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 40  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "2 greater than 29 is __", 31
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 41  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "7 + 3 + 6 = ?", 16
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 42  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "6 + 3 + 4 = ?", 13
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 43  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "9 + 1 + 7 = ?", 17
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 44  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "2 + 8 + 9 = ?", 19
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 45  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "10 - 1 - 6 = ?", 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 46  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "9 - 4 - 2 = ?", 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 47  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "17 - 7 - 6 = ?", 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 48  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "13 - 3 - 2 = ?", 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 "5 + 3 - 2 = ?", 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 50  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "6 - 3 + 2 = ?", 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 51  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "13 + 3 - 2 = ?", 14
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 52  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "74 + 3 = ?", 77
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 53  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "95 + 4 = ?", 99
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 54  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "30 + 40 = ?", 70
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 55  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "70 + 20 = ?", 90
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 56  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "40 + 40 = ?", 80
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 57  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "4 + 53 = ?", 57
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 58  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "25 + 3 = ?", 28
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 59  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "63 + 4 = ?", 67
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 60  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "87 + 2 = ?", 89
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 61  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "68 - 3 = ?", 65
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 62  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "77 - 5 = ?", 72
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 63  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "99 - 4 = ?", 95
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 64  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "80 - 20 = ?", 60
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 65  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "80 - 40 = ?", 40
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 66  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "50 - 10 = ?", 40
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 67  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "100 - 20 = ?", 80
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 68  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "100 - 70 = ?", 30
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 69  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "73 - 30 = ?", 43
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 70  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "96 - 60 = ?", 36
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 71  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "43 - 3 = ?", 40
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 72  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "96 -6 = ?", 90
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 73  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "77 - 4 = ?", 73
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if





if chosenedquiz = 74  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which figure is a rectangle?", m_daikei, m_circle, m_rect, m_tri, 3
exit repeat
end if

if chosenedquiz = 75  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which figure is a triangle?", m_daikei, m_circle, m_rect, m_tri, 4
exit repeat
end if

if chosenedquiz = 76  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which figure is a right triangle?", m_tri3, m_r_tri, m_ensui, m_tri, 2
exit repeat
end if

if chosenedquiz = 77  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which figure is a rectangle?", m_ensui, m_daikei, m_rect, m_tri, 3
exit repeat
end if



if chosenedquiz = 78  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which group has the most animals ?", m_hotar3, m_aunt5, m_crab4, m_lb2, 2
exit repeat
end if



if chosenedquiz = 79  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which group has the most animals ?", m_hotar2, m_aunt3, m_crab5, m_lb4, 3
exit repeat
end if

if chosenedquiz = 80  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which group has the most animals ?", m_lb5, m_hotar3, m_aunt2, m_crab4, 1
exit repeat
end if


if chosenedquiz = 81  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which group has the most animals ?", m_lb4, m_hotar2, m_aunt3, m_crab4, 2
exit repeat
end if

if chosenedquiz = 82  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which group has the fewest animals?", m_hotar3, m_aunt4, m_crab5, m_lb4, 1
exit repeat
end if



if chosenedquiz = 83  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which group has the fewest animals?"", m_hotar4, m_aunt5, m_crab4, m_lb1, 4
exit repeat
end if

if chosenedquiz = 84  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input seven hundred fifty-four", 754
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 85  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input three hundered fifteen", 315
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 86  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input seven hundred twenty-eight", 728
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 87  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input one hundred nine.",109
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 88  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which figure is not a triangle ?", m_square, m_r_tri, m_tri3, m_tri, 1
exit repeat
end if

if chosenedquiz = 89  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which group has the most animals ?", m_hotar2, m_aunt3, m_crab5, m_lb4, 3
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

dragonmoves
checkegg
if random(3) is not 3 then
 eggtodragon
end if
end repeat

put 0 into quiz_quit
put 0 into quizongoing

if math_answer = 1  then
    randomok
    k_froganime2
---------------------------------------------------
   if frogloc = 35 or frogloc = 26 or frogloc = 15 then
      mdoor_open
       go cd 9
        action9
        exit quiz101
--------------------------- end game
    else
       checkroute
      exit quiz101
   end if

else
if math_answer = -1 then
  game_over2
  exit quiz101
end if
   if(math_answer is not 1 ) then
   play jawharp
   set bitmap of btn witch1 to witchspr
   wait 2 seconds
   set bitmap of btn witch1 to witch1
   end if
if (math_time > responselimit) or ( math_answer is not 1 ) then 
   checkzonex
end if
click at btn %frogloc%
end if
end quiz101








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


repeat 102 times

if chosenedquiz = 1 and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "100 multiplied by 10 equals  __", 1000

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 2 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "Input two hundred fifty-six!", 256

put 1 into Item chosenedquiz of xquiztbl
exit repeat

end if

if chosenedquiz = 3 and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input two thousand three hundred forty-six!",2346
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 4  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4  "Input fifty-seven!",57

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 5 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "Input three hundred three!", 303
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 6 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "Input three hundred seventy-two!", 372
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 7 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "Input nine hundred sixteen!",916
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 8 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "Input seven hundred fifty-seven!", 757
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 9 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg4 "Input five hundred thirty-two!", 532


put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 10  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input three hundred fifty-four!", 354
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 11  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Input eight hundred nine!", 809
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 12  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "100 multiplied by 3 equals ___", 300
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 sum of 8 hundreds and 3 tens and 2 ones  is ? ", 832

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 sum of 4 hundreds and 8 tens and 6 ones is ?", 486
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 15  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "20  and __ are added to make 29" , 9


put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 16  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "37 kids shared 31 toys. __ kids had no toys", 6

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 17  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Adding 5 to 9 makes ____ ", 14

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 18  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "___ is one less than one thousand", 999
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 19  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "___ is one less than seven hundred", 699
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 20  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "___ is one less than nine hundred and one", 900
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 21  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "___ is thirty greater than 603", 633
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 22  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "___ is twenty greater than 980", 1000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 23  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "___ is two hundred fewer than 980", 780
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 24  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "___ is one hundred greater than 450", 550
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 25  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg3 " 878  __  900 ", 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 26  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg3 "400 __ 300 ", 7

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 27  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg3 "810 __ 809 ", 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 28  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg3 "257 __ 267 ", 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 29  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "66 + 4 = ?",70
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 30  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "58 + 7 = ?", 65
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 31  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "96 + 4 = ?", 100
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 32  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "76 + 4 = ?", 80
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 33  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "56 + 7 = ?", 63
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 34  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "7 + 48 = ?", 55
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 35  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "44 + 9 = ?", 53
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 36  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "96 + 7 = ?", 103
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 37  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "12 - 6 = ?", 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 38  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "30 - 3 = ?", 27
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 39  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "90 - 8 = ?", 82
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 40  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "55 - 9 = ?", 46
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 41  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "103 - 8 = ?", 95
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 42  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "106 - 9 = ?", 97
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 43  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "427 + 6 = ?", 433
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 44  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "718 + 8  = ?", 726
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 45  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "5 + 802 = ?", 807
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 46  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "519 + 50  = ?", 569
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 47  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "90 + 504 = ?", 594
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 48  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "847 + 10 = ?", 857
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 49  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "535 + 85 = ?", 620
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 50  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "93 + 507 = ?", 600
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 51  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "584 + 26 = ?", 610
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 52  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "993 + 37 = ?", 1030
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 53  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "974 + 28 = ?", 1002
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 54  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Subtracting 5 from 36 makes __", 31
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 55  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Adding 12 to 4 makes __", 16
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 56  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "30 cm short of 50 cm is ____cm.", 20
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 57  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "422 - 75 = 347","Yes","No","","",1 
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 58  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "325 - 14 = 311 ","Yes","No","","",1 
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 59  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "514 - 36 = 488","Yes","No","","",2 
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 60  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "751 - 64 = 687","Yes","No","","",1 
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 61  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "73 - 25 = 38","Yes","No","","",2 
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 62  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "95 + 16 + 20 = ?","111","131","136","141",2 
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 63  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "48 + 34 + 25 = ?","98","103","107","115",3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 64  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "69 + 21 - 15 = ? ","60","65","70","75",4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 65  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "11 + 6 + 9 = ?", 26
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 66  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "15 - 9 + 2 = ?", 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 67  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "20 - 2 = ?", 18
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 68  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "131 -30 + 4 = ?", 105
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 69  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "The total of the legs of 8 turtles is __", 32
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 70  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "The total of the legs of 4 cranes is ___", 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 71  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "2m and 8cm  is equal to __cm", 208
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 72  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg6 "365 mm is equal to ___cm and __mm", 365
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 73  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "4 m and 28 cm  is equivalent to __cm", 428
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 74  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which figure is a square?", m_square, m_daikei, m_rect, m_tri, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 75  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which figure is a rectangle?", m_tri, m_rect, m_daikei, m_square, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 76  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which figure is a triangle?", m_circle, m_rect, m_square, m_tri, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 77  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which figure is a right triangle?", m_r_tri, m_ensui, m_tri3, m_tri, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 78  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Point out the polygon with 3 sides.", m_r_tri, m_ensui, m_square, m_circle, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 79  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Point out the polygon with 4 sides.", m_r_tri, m_ensui, m_square, m_circle, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 80  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Point out the polygon with 4 vertexes.", m_r_tri, m_rect, m_ensui, m_circle, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 81  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Point out the polygon with 3 vertexes.", m_tri3, m_rect, m_square, m_circle, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 82  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Point out the polygon with 4 right angles.", m_tri3, m_rect, m_ensui, m_circle, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 83  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Point out the polygon with all sides of equal length.", m_tri3, m_rect, m_ensui, m_square, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 84  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Point out the polygon with all sides of equal length.", m_r_tri, m_rect, m_ensui, m_daikei, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if






if chosenedquiz = 85  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Point out the figure with a right angle.", m_tri3, m_tri, m_ensui, m_r_tri, 4
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

dragonmoves
checkegg
if random(3) is not 3 then
 eggtodragon
end if
end repeat

put 0 into quiz_quit
put 0 into quizongoing

if math_answer = 1  then
    randomok
    k_froganime2
---------------------------------------------------
   if frogloc = 35 or frogloc = 26 or frogloc = 15 then
      mdoor_open
       go cd 9
        action9
        exit quiz102
--------------------------- end game
    else
       checkroute
      exit quiz102
   end if

else
if math_answer = -1 then
  game_over2
  exit quiz102
end if
   if(math_answer is not 1 ) then
   play jawharp
   set bitmap of btn witch1 to witchspr
   wait 2 seconds
   set bitmap of btn witch1 to witch1
   end if
if (math_time > responselimit) or ( math_answer is not 1 ) then 
   checkzonex
end if
click at btn %frogloc%
end if
end quiz102



















On randomok
put random(3) into rdmok
play muon
wait 30 ticks
if rdmok = 1 then
   play good
end if
if rdmok = 2 then
   play alright
end if
if rdmok = 3 then
   play alrighth
end if
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
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 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
  game_Over
  exit checkroute
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
      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
         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
                     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
                  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
                 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
              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
                else
                  game_over
                  exit checkroute
                end if
           end if

    end if
end if

if frogloc >= 4 and frogloc <=6 then
     if frogloc = 4 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
              put frogloc + 1 into clickclick
                 click at btn %clickclick%
         else
                 put frogloc - 1 into clickclick
                 click at btn %clickclick%
         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
             else
                 if route3 = 0 then
                     click at btn 17
                  end if
             end if
             exit checkroute
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
      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
              else
                  if route2 = 0 and route3 = 0 then
                      click at btn 17
                  else
                      game_over
                   end if
                       exit checkroute
               end if
         end if
  else
       put frogloc + 1 into clickclick
       if clickclick = 33 then
             put 11 into clickclick
             click at btn %clickclick%
             exit checkroute
        end if
  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
      else
            put frogloc + 1 into clickclick
            click at btn %clickclick%
       end if
       exit checkroute
end if

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

if frogloc >=33 and frogloc <=34 then
      if frogloc = 33 and (step34_egg is not 0) then
          click at btn 11
      else
          put frogloc + 1 into clickclick
          click at btn %clickclick%
       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
     else
        if route5 = 0 then 
             click at btn 29
         else
             if route2 is not 0  then
                game_over
                exit checkroute
            else
                if route4 = 0 then
                    click at btn 6
                 else
                      if route1 = 0 then
                          click at btn 1
                      else
                              if route3 = 0 then
                                   click at btn 17
                              else
                                   game_over
                               end if
                       end if
                  end if
                   exit checkroute
              end if
                        
           end if
      end if

end if


End checkroute


On game_Over
play uhoohhh
lock screen
show btn wichback
set bitmap of btn witch1 to witch1
set loc of btn witch1 to locH of btn wichback, locV of btn wichback
unlock screen
wait 200 ticks
play madwoman

witchanime2
wait 1 seconds
play Beethovn
exitkingdom
End game_Over

On game_Over2
play uhoohhh
set bitmap of btn witch1 to witch1
wait 30 ticks
set bitmap of btn witch1 to witchspr
wait 170 ticks
play Beethovn
exitkingdom
End game_Over2

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

---------- card30-----

On opencard 30
put random(3) into rgtbees
put random(3) into lftbees
put 0 into floweropened
if game_on is not 1 then
   wait 1 seconds
play nakani1
put 3 into ntx
naratoranimex
openflower
wait 5 seconds
openflower
play bokuwo
put 5 into ntx
naratoranimex
end if

end opencard

On openflower
if floweropened = 0 then
     lock screen
     set bitmap of btn tulip to untulip
     repeat with xxx = 4 to 17
       hide btn %xxx%
     end repeat
     repeat with xxx = 11 to 11 + (rgtbees-1)
          show btn %xxx%
     end repeat
     repeat with xxx = 4 to 4 + (lftbees-1)
          show btn %xxx%
     end repeat
     unlock screen
     put 1 into floweropened

else

     lock screen
     repeat with xxx = 11 to 11 + (rgtbees-1)
          hide btn %xxx%
     end repeat
     repeat with xxx = 4 to 4 + (lftbees-1)
          hide btn %xxx%
     end repeat
     set bitmap of btn tulip to tulip
     unlock screen
     put 0 into floweropened
     end if
end openflower

on s1beeflylft
if floweropened = 1 then 
  exit s1beeflylft
end if
if lftbees + 1 > 7 then
   if rgtbees +1 > 7 then
      show btn t_writer
    message2 LocH of btn t_writer - 86, LocV of btn t_writer - 41, 9, "The tulip is full of bees and no more bees can come in!"
    hide btn t_writer
      exit s1beeflylft
   else
     s1beeflyrgt
     exit s1beeflylft
   end if
end if

put lftbees + 1 into lftbees
play bee
set the loc of btn 19 to 444,81
set bitmap of btn 19 to bee_lft
show btn 19
repeat with xxx = 1 to 6
put random( 5) into yyy
set the loc of btn 19 to 444 - 35 * xxx,81 - yyy
wait 5 ticks
end repeat
set the loc of btn 19 to 213,88
wait 5 ticks
set the loc of btn 19 to 205,109
wait 5 ticks
hide btn 19

end s1beeflylft
 
 
on s1beeflyrgtout
if floweropened = 1 then 
  exit s1beeflyrgtout
end if
if rgtbees - 1 < 0 then
   if lftbees -1 < 0 then
      show btn t_writer
    message2 LocH of btn t_writer - 86, LocV of btn t_writer - 41, 9, "No more bees!"
    hide btn t_writer
      exit s1beeflyrgtout
   else
     s1beeflylftout
     exit s1beeflyrgtout
   end if
end if

put rgtbees - 1 into rgtbees
play bee

set the loc of btn 19 to 205,109
set bitmap of btn 19 to bee_rgt
wait 5 ticks
show btn 19
set the loc of btn 19 to 213,88
wait 5 ticks

repeat with xxx = 1 to 6
put random( 5) into yyy
set the loc of btn 19 to 234 + 35 * xxx,81 - yyy
wait 5 ticks
end repeat


set the loc of btn 19 to 444,81
hide btn 19

end s1beeflyrgtout




on s1beeflyrgt
if floweropened = 1 then 
  exit s1beeflyrgt
end if
if rgtbees + 1 > 7 then
   if lftbees + 1 > 7 then
      show btn t_writer
      message2 LocH of btn t_writer - 86, LocV of btn t_writer - 41, 9, "The tulip is full of bees and no more bees can come in!"
      hide btn t_writer
      exit s1beeflyrgt
   else
     s1beeflylft
     exit s1beeflyrgt
   end if
end if
       
put rgtbees + 1 into rgtbees
play bee
set the loc of btn 19 to 11,72
set bitmap of btn 19 to bee_rgt
show btn 19
repeat with xxx = 1 to 4
put random( 5) into yyy
set the loc of btn 19 to 11 + 37 * xxx,72 - yyy
wait 5 ticks
end repeat
set the loc of btn 19 to 181, 89
wait 5 ticks
set the loc of btn 19 to 185,121
wait 5 ticks
hide btn 19
end s1beeflyrgt



on s1beeflylftout
if floweropened = 1 then 
  exit s1beeflylftout
end if

if lftbees - 1 < 0 then
   if rgtbees - 1 < 0 then
      show btn t_writer
      message2 LocH of btn t_writer - 86, LocV of btn t_writer - 41, 9, "No more bees!"
      hide btn t_writer
      exit s1beeflylftout
   else
     s1beeflyrgtout
     exit s1beeflylftout
   end if
end if
       
put lftbees - 1 into lftbees
play bee
hide btn 19
set the loc of btn 19 to 185,121
set bitmap of btn 19 to bee_lft
show btn 19
wait 5 ticks
set the loc of btn 19 to 181, 89
wait 5 ticks
set the loc of btn 19 to 159, 72
wait 5 ticks
repeat with xxx = 1 to 4
put random( 5) into yyy
set the loc of btn 19 to 159 - 37 * xxx,72 - yyy
wait 5 ticks
end repeat
hide btn 19
end s1beeflylftout



On letbeefly
if random(2) = 1 then
  s1beeflyrgt
else
  s1beeflylft
end if
End letbeefly

On letbeeflyout
if random(2) = 1 then
  s1beeflyrgtout
else
  s1beeflylftout
end if
End letbeeflyout


On letbeeflyrandom
if rgtbees=0 and lftbees=0 then
    letbeefly
else
    if rgtbees = 7 and lftbees = 7 then
          letbeeflyout
    else

       if random(2) = 1 then
          letbeefly
       else
          letbeeflyout
       end if

     end if

end if

End letbeeflyrandom

On q_letbeeflyrandom
if floweropened = 1 then
 openflower
end if
put random(10) into rdmbeeno
repeat 10 times
letbeeflyrandom
end repeat
  put 0 into quiz_quit
put lftbees + rgtbees into totalbees
 quizdlg4 "How many bees are inside of the tulip?", totalbees
   repeat while quiz_quit = 0
           wait 30 ticks
    end repeat
   if math_answer is  1 then
        play good
        show_frog_good
       openflower
       wait 5 seconds
       openflower

   else
       if math_answer is  -1 then
          play  Uhoh2
        else
         play jawharp
       showwitch_surprised
       openflower
       wait 5 seconds
       openflower
       end if

  end if
   put 0 into quiz_quit

End q_letbeeflyrandom


----------- End card30-----


-----------card40----------
On opencard 40
if game_on is not 1 then
  play howmany
   put 3 into ntx
   naratoranimex
   wait 1 seconds
   play bokuwo
   put 4 into ntx
   naratoranimex


 end if
  put 0 into init40
  put 40 into presentcard
end opencard

On howmanycandy10
lock screen
put 0 into count1
put 0 into count10
repeat with xxx= 2 to 10
if random(2) = 1 then
  put count1 + 1 into count1
  show btn %xxx%
else 
  hide btn %xxx%
end if
end repeat
put 0 into count10
repeat with xxx= 11 to 16
if random(2) = 1 then
  put count10 + 1 into count10
  show btn %xxx%
else 
  hide btn %xxx%
end if
end repeat
-----------
put 10 * count10 + count1 into totalcandy
----------
unlock screen
 if game_on is  1 and init40 = 0 then
  play howmany
   put 3 into ntx
   naratoranimex
 put 1 into init40
  end if

  put 0 into quiz_quit
 quizdlg4 "How many candies are there?", totalcandy
   repeat while quiz_quit = 0
           wait 30 ticks
    end repeat

  if math_answer is not 1 then
        if math_answer is  -1 then
          play  Uhoh2
        else
              play jawharp
          showwitch_surprised
         end if
       else
           play good
           show_frog_good
      end if




   put 0 into quiz_quit

  end howmanycandy10

--------- end card40 ------------

-----------card41----------
On opencard 41
 if game_on is not 1 then
  play howmany
   put 3 into ntx
   naratoranimex
   wait 1 seconds
   play bokuwo
   put 4 into ntx
   naratoranimex

  end if
  put 41 into presentcard
put 0 into init41
end opencard

On howmanycandy100
lock screen
put 0 into count1
put 0 into count10
put 0 into count100
repeat with xxx= 2 to 10
if random(2) = 1 then
  put count1 + 1 into count1
  show btn %xxx%
else 
  hide btn %xxx%
end if
end repeat
put 0 into count10
repeat with xxx= 11 to 19
if random(2) = 1 then
  put count10 + 1 into count10
  show btn %xxx%
else 
  hide btn %xxx%
end if
end repeat

put 0 into count100
repeat with xxx= 20 to 24
if random(2) = 1 then
  put count100 + 1 into count100
  show btn %xxx%
else 
  hide btn %xxx%
end if
end repeat



-----------
put (100 * count100 + 10 * count10) + count1 into totalcandy
----------
unlock screen

 if game_on is  1 and init40 = 0 then
  play howmany
   put 3 into ntx
   naratoranimex
 put 1 into init41
  end if


  put 0 into quiz_quit
 quizdlg4 "How many candies are there?", totalcandy
   repeat while quiz_quit = 0
           wait 30 ticks
    end repeat

  if math_answer is not 1 then
         if math_answer is  -1 then
             play  uhoh2
         else
             play jawharp
             showwitch_surprised
         end if

       else
           play good
           show_frog_good
      end if


   put 0 into quiz_quit


end howmanycandy100
--------- end card41 ------------


---------card32----------

On opencard 32
  put 32 into presentcard
put 0 into init32
put 6 into Item 1 of order32
put 1 into Item 2 of  order32
put 5 into Item 3 of  order32
put 7 into Item 4 of order32
put 4 into Item 5 of  order32
put 3 into Item 6 of  order32
put 2 into Item 7 of  order32
----------------------------------
put 268 into Item 1 of order32v
put 241 into Item 2 of order32v
put 234 into Item 3 of order32v
put 218 into Item 4 of order32v
put 199 into Item 5 of order32v
put 238 into Item 6 of order32v
put 292 into Item 7 of order32v
-------------------------------
put 353 into Item 6 of order32h
put 48 into Item 1 of order32h
put 294 into Item 5 of order32h
put 420 into Item 7 of order32h
put 241 into Item 4 of order32h
put 175 into Item 3 of order32h
put 110 into Item 2 of order32h
------------------------------------
if game_on is not 1 then
  play ikimono
   put 4 into ntx
   naratoranimex
  wait 1 seconds
   play bokuwo
   put 4 into ntx
   naratoranimex

end if
end opencard







On makeorder

put Item 1 of order32 into tmpvar32
put random(7) into xxx
if xxx is not 1 then
put Item xxx of order32 into Item 1 of order32
put tmpvar32 into Item xxx of order32
else 
put Item 2 of order32 into Item 1 of order32
put tmpvar32 into Item 2 of order32
end if

put Item 2 of order32 into tmpvar32
put random(7) into xxx
if xxx is not 2 then
put Item xxx of order32 into Item 2 of order32
put tmpvar32 into Item xxx of order32
else 
put Item 3 of order32 into Item 2 of order32
put tmpvar32 into Item 3 of order32
end if

put Item 3 of order32 into tmpvar32
put random(7) into xxx
if xxx is not 3 then
put Item xxx of order32 into Item 3 of order32
put tmpvar32 into Item xxx of order32
else 
put Item 4 of order32 into Item 3 of order32
put tmpvar32 into Item 4 of order32
end if

put Item 4 of order32 into tmpvar32
put random(7) into xxx
if xxx is not 4 then
put Item xxx of order32 into Item 4 of order32
put tmpvar32 into Item xxx of order32
else 
put Item 5 of order32 into Item 4 of order32
put tmpvar32 into Item 5 of order32
end if

put Item 5 of order32 into tmpvar32
put random(7) into xxx
if xxx is not 5 then
put Item xxx of order32 into Item 5 of order32
put tmpvar32 into Item xxx of order32
else 
put Item 6 of order32 into Item 5 of order32
put tmpvar32 into Item 6 of order32
end if

put Item 6 of order32 into tmpvar32
put random(7) into xxx
if xxx is not 6 then
put Item xxx of order32 into Item 6 of order32
put tmpvar32 into Item xxx of order32
else 
put Item 7 of order32 into Item 6 of order32
put tmpvar32 into Item 7 of order32
end if

put Item 7 of order32 into tmpvar32
put random(7) into xxx
if xxx is not 7 then
put Item xxx of order32 into Item 7 of order32
put tmpvar32 into Item xxx of order32
else 
put Item 3 of order32 into Item 7 of order32
put tmpvar32 into Item 3 of order32
end if
lock screen


repeat with n = 1 to 7

put Item n  of order32 into tmpvar32
set the loc of btn %n% to Item tmpvar32  of order32h, Item tmpvar32 of order32v
end repeat
 


unlock screen
 if game_on is  1 and init32 = 0 then
  play ikimono
   put 4 into ntx
   naratoranimex
 put 1 into init32
end if

put random( 7 ) into n
put random(2) into selectedside
if n = 1 then
   if selectedside = 1 then
       put Item n of order32 into nnn
       QuizDlg4 "The dog is ___('st/'nd /'rd /'th) from left.", nnn
   else
      put 7 - Item n of order32 + 1 into nnn
      QuizDlg4 "The dog is ___('st/'nd /'rd /'th) from right.",nnn
   end if
end if

if n = 2 then
   if selectedside = 1 then
       put Item n of order32 into nnn
       QuizDlg4 "The cat is ___('st/'nd /'rd /'th) from left.", nnn
   else
      put 7 - Item n of order32 + 1 into nnn
      QuizDlg4 "The cat is ___('st/'nd /'rd /'th) from right.",nnn
   end if
end if
if n = 3 then
   if selectedside = 1 then
      put Item n of order32 into nnn
     QuizDlg4 "The frog  is ___('st/'nd /'rd /'th) from left.", nnn
   else
      put 7 - Item n of order32 + 1 into nnn
      QuizDlg4 "The frog  is ___('st/'nd /'rd /'th) from right.",nnn
   end if
end if

if n = 4 then
   if selectedside = 1 then
       put Item n of order32 into nnn
       QuizDlg4 "The bird is ___('st/'nd /'rd /'th) from left.", nnn
   else
      put 7 - Item n of order32 + 1 into nnn
      QuizDlg4 "The bird is ___('st/'nd /'rd /'th) from right.",nnn
   end if
end if

if n = 5 then
   if selectedside = 1 then
       put Item n of order32 into nnn
       QuizDlg4 "The rabbit is ___('st/'nd /'rd /'th) from left.", nnn
   else
      put 7 - Item n of order32 + 1 into nnn
      QuizDlg4 "The rabbit is ___('st/'nd /'rd /'th) from right.",nnn
   end if
end if

if n = 6 then
   if selectedside = 1 then
       put Item n of order32 into nnn
       QuizDlg4 "The panda is ___('st/'nd /'rd /'th) from left.", nnn
   else
      put 7 - Item n of order32 + 1 into nnn
      QuizDlg4 "The panda is ___('st/'nd /'rd /'th) from right.",nnn
   end if
end if

if n = 7 then
   if selectedside = 1 then
       put Item n of order32 into nnn
       QuizDlg4 "The crab is ___('st/'nd /'rd /'th) from left.", nnn
   else
      put 7 - Item n of order32 + 1 into nnn
      QuizDlg4 "The crab is ___('st/'nd /'rd /'th) from right.",nnn
   end if
end if

      repeat while quiz_quit = 0
         wait 30 ticks
      end repeat
      put 0 into quiz_quit

  if math_answer is not 1 then
          if math_answer is  -1 then
              play  uhoh2
           else
              play jawharp
          showwitch_surprised
          end if
       else
           play good
           show_frog_good
      end if



End makeorder


--------end card32------ 

-------------------card 36 --------------------

On opencard 36
   put random(18 ) into numberpolliwog
   if game_on is not 1 then
   wait 1 seconds
   play nakani1
   put 3 into ntx
   naratoranimex
   cover36hide2
   play bokuwo
   put 4 into ntx
   naratoranimex

   end if

   

end opencard




On quiz36
  put random(numberpolliwog) into sub36
     repeat sub36 times
       psubtract
     end repeat
     QuizDlg4 "How many tadpoles are in the pond?", numberpolliwog
      repeat while quiz_quit = 0
         wait 30 ticks
      end repeat
      put 0 into quiz_quit
       if math_answer is not 1 then
            if math_answer is  -1 then
              play  uhoh2
            else
               play jawharp
               showwitch_surprised
            end if
       else
           play good
           show_frog_good
      end if

End quiz36

------ usuful when game is  on ------------
On kingdom_quiz36
      wait 1 seconds
      play nakani1
      put 3 into ntx 
      naratoranimex
      wait 1 seconds
      cover36hide2
   put random(numberpolliwog) into sub36
   if (sub36 < 1 or numberpolliwog = sub36) and numberpolliwog > 0 then
     psubtract
  else
   if numberpolliwog - sub36 > 0 then 
     repeat sub36 times
       psubtract
     end repeat
    end if
   end if
     QuizDlg4 "How many tadpoles are in the pond?", numberpolliwog
      repeat while quiz_quit = 0
         wait 30 ticks
      end repeat
      put 0 into quiz_quit
      if math_answer is not 1 then
          if math_answer is  -1 then
              play  uhoh2
           else
            play jawharp
          showwitch_surprised
          end if
       else
           play good
           show_frog_good
      end if
      cover36hide3

End kingdom_quiz36


------ end usuful when game is  on ------------









On polliwogmultiple
 play frog
if  numberpolliwog = 0 then
  put random(18 ) into numberpolliwog
end if
end polliwogmultiple

On cover36hide
  play click
  lock screen
  hide btn cover36
  repeat with i36 = 1 to 18
     if i36 <= numberpolliwog then
        show btn %i36%
     else
         hide btn %i36%
     end if
  end repeat
  unlock screen
 repeat until  mouseclick()
  wait 1 ticks
 end repeat
     play click
     show btn cover36

End cover36hide


On cover36hide2
  lock screen
  hide btn cover36
  repeat with i36 = 1 to 18
     if i36 <= numberpolliwog then
        show btn %i36%
     else
         hide btn %i36%
     end if
  end repeat
  unlock screen
     wait 5 seconds
     show btn cover36

End cover36hide2

On cover36hide3
  lock screen
  hide btn cover36
  repeat with i36 = 1 to 18
     if i36 <= numberpolliwog then
        show btn %i36%
     else
         hide btn %i36%
     end if
  end repeat
  unlock screen

End cover36hide3





On psubtract
   play frog
      if numberpolliwog <= 0 then
            show btn t_writer
            message2 LocH of btn t_writer - 86, LocV of btn t_writer - 41, 9, "No tadpoles are in the pond. The tadpoles will appear in the pond when you click on the frog!"
            hide btn t_writer
       else
           put numberpolliwog - 1 into numberpolliwog
           frog36anime
      end if
end  psubtract

On frog36anime
  play frog
  set the loc of btn k_frogb1 to 224,280
  set bitmap of btn k_frogb1 to k_frog1
   show btn k_frogb1
   wait 5 ticks
   set the loc of btn k_frogb1 to 70,369
   k_frogbanime
   set the loc of btn k_frogb1 to 0,400
wait 15 ticks
hide btn k_frogb1
end frog36anime




On k_frogbanime
repeat 2 times
set bitmap of btn k_frogb1 to k_frogb1
wait 2 ticks
set bitmap of btn k_frogb1 to k_frogb3
wait 2 ticks
set bitmap of btn k_frogb1 to k_frogb4
wait 2 ticks
set bitmap of btn k_frogb1 to k_frogb3
wait 2 ticks
end repeat

End k_frogbanime





------------------end card36 -----------------

----------------- card 37 ----------


On opencard  37
  put 37 into presentcard

if game_on is not 1 then
  put 37 into presentcard
  play measure
   put 3 into ntx
   naratoranimex
  wait 2 seconds
  play bokuwo
   put 5 into ntx
   naratoranimex
end if
End opencard

On howtomeasure123
put random(6) into selectedworm
if selectedworm = 1 then
 tonbocome
 put random(3) into selectedpoint
 if selectedpoint = 1 then
      put (278 + rdm37 * 4 -30) / 4 into ans_37
      QuizDlg6 "The tip of the dragonfly's head is located at __cm__mm ", ans_37
 end if
 if selectedpoint = 2 then
      put rdm37 into ans_37
      QuizDlg6 "The tip of the dragonfly's tail is located at __cm__mm", ans_37
 end if
 if selectedpoint = 3  then
      put (278 + rdm37 * 4 -30) / 4 - rdm37 into ans_37
      QuizDlg6 "The dragonfly is __cm__mm long", ans_37
 end if

end if

if selectedworm = 2 then
auntcome
 put random(3) into selectedpoint
 if selectedpoint = 1 then
      put (86 + rdm37 * 4 -30) / 4 into ans_37
      QuizDlg6 "The tip of the ant's foreleg is located at  __cm__mm", ans_37
 end if
 if selectedpoint = 2 then
      put rdm37 into ans_37
      QuizDlg6 "The tip of the ant's hind leg is located at __cm__mm", ans_37
 end if
 if selectedpoint = 3  then
      put (86 + rdm37 * 4 -30) / 4 - rdm37 into ans_37
      QuizDlg6 "The ant  is __cm__mm long", ans_37
 end if
end if

if selectedworm = 3 then
spidercome
 put random(3) into selectedpoint
 if selectedpoint = 1 then
      put (98 + rdm37 * 4 -30) / 4 into ans_37
      QuizDlg6 "The tip of spider's foreleg is located at  __cm__mm", ans_37
 end if
 if selectedpoint = 2 then
      put rdm37 into ans_37
      QuizDlg6 "The tip of spider's hind leg is located at __cm__mm", ans_37
 end if
 if selectedpoint = 3  then
      put (98 + rdm37 * 4 -30) / 4 - rdm37 into ans_37
      QuizDlg6 "The spider is __cm__mm long", ans_37
 end if
end if

if selectedworm = 4 then
kwgatacome
 put random(3) into selectedpoint
 if selectedpoint = 1 then
      put (170 + rdm37 * 4 -30) / 4 into ans_37
      QuizDlg6 "The tip of the stag beetle's jaw is located at __cm__mm", ans_37
 end if
 if selectedpoint = 2 then
      put rdm37 into ans_37
      QuizDlg6 "The tip of the stag beetle's hind leg is located at __cm__mm", ans_37
 end if
 if selectedpoint = 3  then
      put (170 + rdm37 * 4 -30) / 4 - rdm37 into ans_37
      QuizDlg6 "The stag beetle is __cm__mm long", ans_37
 end if
end if

if selectedworm = 5 then
mimizucome
 put random(3) into selectedpoint
 if selectedpoint = 1 then
      put (266 + rdm37 * 4 -30) / 4 into ans_37
      QuizDlg6 "The tip of the earthworm's head is located at __cm__mm", ans_37
 end if
 if selectedpoint = 2 then
      put rdm37 into ans_37
      QuizDlg6 "The tip of the earthworm's tail is located at  __cm__mm", ans_37
 end if
 if selectedpoint = 3  then
      put (266 + rdm37 * 4 -30) / 4 - rdm37 into ans_37
      QuizDlg6 "The earthworm is __cm__mm long", ans_37
 end if
end if

if selectedworm = 6 then
 kmkiricome
 put random(3) into selectedpoint
 if selectedpoint = 1 then
      put (294 + rdm37 * 4 -30) / 4 into ans_37
      QuizDlg6 "The tip of the mantis's foreleg is located at  __cm__mm", ans_37
 end if
 if selectedpoint = 2 then
      put rdm37 into ans_37
      QuizDlg6 "The tip of the mantis's wing is located at __cm__mm", ans_37
 end if
 if selectedpoint = 3  then
      put (294 + rdm37 * 4 -30) / 4 - rdm37 into ans_37
      QuizDlg6 "The mantis is __cm__mm long", ans_37
 end if
end if
      repeat while quiz_quit = 0
         wait 30 ticks
      end repeat
      put 0 into quiz_quit

  if math_answer is not 1 then
          if math_answer is  -1 then
             play  uhoh2
           else
              play jawharp
              showwitch_surprised
           end if
       else
           play good
           show_frog_good
      end if



   resetcard37
End howtomeasure123






On tonbocome
set the loc of btn tonbo to -300, 0
show btn tonbo
play bee
repeat with xxx = 1 to 20
 set the loc of btn tonbo to -300 + 22 * xxx, 12 * xxx
 wait 3 ticks
end repeat
 put random(20) into rdm37
 set the loc of btn tonbo to 157 + rdm37 * 4,251
lock screen
show btn measure1
show btn measure2
set the loc of btn measure1 to 30 + rdm37 * 4,255
set the loc of btn measure2 to 278 + rdm37 * 4,255
unlock screen
End tonbocome

On auntcome
hide btn aunt
lock screen
set the loc of btn aunt to 380, 431
set bitmap of btn aunt to aunt2
show btn aunt
unlock screen
play chirps
wait 5 ticks
set the loc of btn aunt to 250, 334
wait 15 ticks
set the loc of btn aunt to 156, 280
wait 5 ticks
set the loc of btn aunt to 18, 257
wait 10 ticks
set bitmap of btn aunt to aunt
 put random(30) into rdm37
 set the loc of btn aunt to 62 + rdm37 * 4,200
lock screen
show btn measure1
show btn measure2
set the loc of btn measure1 to 30 + rdm37 * 4,255
set the loc of btn measure2 to 86 + rdm37 * 4,255
unlock screen
End auntcome


On spidercome
set the loc of btn spiderv1 to 292, 419
show btn spiderv1
play flicker
repeat with xxx = 1 to 20
 put xxx mod 4 into xxxnum
if xxxnum = 0 then
 set bitmap of btn spiderv1  to spiderv1
end if
if xxxnum = 1 then
     set bitmap of btn spiderv1  to spiderv2
end if
 if xxxnum = 2 then
     set bitmap of btn spiderv1  to spiderv3
end if
 if xxxnum = 3 then
     set bitmap of btn spiderv1  to spiderv2
end if


 set the loc of btn spiderv1 to 292 - 12 * xxx, 419 - 11 * xxx
 wait 5 ticks
end repeat

set bitmap of btn spiderv1 to spiderh1
 put random(20) into rdm37

set the loc of btn spiderv1 to 65 + rdm37 * 4,200

repeat 2 times
set bitmap of btn spiderv1 to spiderh2
wait 10 ticks
set bitmap of btn spiderv1 to spiderh3
wait 10 ticks
set bitmap of btn spiderv1 to spiderh2
wait 10 ticks
set bitmap of btn spiderv1 to spiderh1
wait 10 ticks
end repeat

lock screen
show btn measure1
show btn measure2
set the loc of btn measure1 to 30 + rdm37 * 4 ,255
set the loc of btn measure2 to 98 + rdm37 * 4 ,255
unlock screen
End spidercome


On kwgatacome
lock screen
set the loc of btn kwgata1 to 298,413
set bitmap of btn kwagata1 to kwagatav1
show btn kwgata1
unlock screen
play flicker
repeat with xxx = 1 to 20
 put xxx mod 2 into xxxnum
if xxxnum = 0 then
 set bitmap of btn kwgata1  to kwgatav2
end if
if xxxnum = 1 then
     set bitmap of btn kwgata1  to kwgatav1
end if


 set the loc of btn kwgata1 to 298 - 10 * xxx, 413 - 9 * xxx
 wait 5 ticks
end repeat

put random(20) into rdm37
set the loc of btn kwgata1 to 102 + rdm37 * 4 , 219
repeat 2 times
set bitmap of btn kwgata1  to kwgata2
wait 5 ticks
set bitmap of btn kwgata1  to kwgata1
wait 5 ticks
end repeat

lock screen
show btn measure1
show btn measure2
set the loc of btn measure1 to 30 + rdm37 * 4 ,255
set the loc of btn measure2 to 170 + rdm37 * 4 ,255
unlock screen
End kwgatacome

On mimizucome
set the loc of btn mimizu1 to -30, 400
show btn mimizu1
play bombom
repeat with xxx = 1 to 10
 put xxx mod 2 into xxxnum
if xxxnum = 0 then
 set bitmap of btn mimizu1  to mimizu2
end if
if xxxnum = 1 then
     set bitmap of btn mimizu1  to mimizu1
end if


 set the loc of btn mimizu1 to -30 + 18 * xxx, 400 - 21 * xxx
 wait 15 ticks
end repeat

put random(20) into rdm37

set the loc of btn mimizu1 to 156 + rdm37 * 4, 183

 set bitmap of btn mimizu1  to mimizu2

lock screen
show btn measure1
show btn measure2
set the loc of btn measure1 to 30 + rdm37 * 4,255
set the loc of btn measure2 to 266 + rdm37 * 4,255
unlock screen
End mimizucome



On kmkiricome
set the loc of btn kmkiri1 to -300, 219
show btn kmkiri1
play chirps
repeat with xxx = 1 to 10
 put xxx mod 2 into xxxnum
if xxxnum = 0 then
 set bitmap of btn kmkiri1  to kmkiri2
end if
if xxxnum = 1 then
     set bitmap of btn kmkiri1  to kmkiri1
end if


 set the loc of btn kmkiri1 to -300 + 47 * xxx, 219
 wait 20 ticks
end repeat

put random(10) into rdm37
set the loc of btn kmkiri1 to 178 + rdm37 * 4,219

 set bitmap of btn kmkiri1  to kmkiri1

lock screen
show btn measure1
show btn measure2
set the loc of btn measure1 to 30 + rdm37 * 4,255
set the loc of btn measure2 to 294 + rdm37 * 4,255
unlock screen
End kmkiricome

On resetcard37
repeat with xxx = 1 to 16
hide btn %xxx%
end repeat
end resetcard37




---------------- end card37 ----------


----------card39------------------
On opencard 39

  put 39 into presentcard
if game_on is not 1 then
     if game_on is not 1 then
      play ikiclick
      put 4 into ntx
      naratoranimex
     end if
 end if
put 0 into chosened39
    

End opencard

On bolzhide
lock screen
hide btn bird2
hide btn octpus
hide btn ladybugs
hide btn zebra
unlock screen
End bolzhide

on bolzshow
lock screen
show btn bird2
show btn octpus
show btn ladybugs
show btn zebra
unlock screen
end bolzshow

On bird2_chosen
 bolzhide
      bird2mquiz
      put rdm39 * 2 into ans39
      QuizDlg4 "How many birds' legs are there? ", ans39
      repeat while quiz_quit = 0
         wait 30 ticks
      end repeat
      put 0 into quiz_quit

  if math_answer is not 1 then
        if math_answer is  -1 then
            play  uhoh2
        else
              play jawharp
          showwitch_surprised
         end if
       else
           play good
           show_frog_good
      end if



lock screen
repeat with x39 = 5 to 13
 hide btn %x39%
end repeat
unlock screen
bolzshow

End bird2_chosen


On octpus_chosen
bolzhide

      octpusmquiz
      put rdm39 * 8 into ans39
      QuizDlg4 "How many octopus legs are there?", ans39
      repeat while quiz_quit = 0
         wait 30 ticks
      end repeat
      put 0 into quiz_quit

  if math_answer is not 1 then
       if math_answer is  -1 then
          play  uhoh2
        else
             play jawharp
          showwitch_surprised
        end if
       else
           play good
           show_frog_good
      end if



lock screen
repeat with x39 = 5 to 13
 hide btn %x39%
end repeat
unlock screen
bolzshow

End octpus_chosen






On zebra_chosen
 bolzhide
     
      zebramquiz
      put rdm39 * 4 into ans39
      QuizDlg4 "How many zebras' legs are there?", ans39
      repeat while quiz_quit = 0
         wait 30 ticks
      end repeat
      put 0 into quiz_quit
  if math_answer is not 1 then
       if math_answer is  -1 then
          play  uhoh2
        else
              play jawharp
          showwitch_surprised
         end if
       else
           play good
           show_frog_good
      end if


lock screen
repeat with x39 = 5 to 13
 hide btn %x39%
end repeat
 unlock screen
 bolzshow

End zebra_chosen

On ladybugs_chosen
 bolzhide
     
      ladybugmquiz
      put rdm39 * 6 into ans39
      QuizDlg4 "How many ladybugs' legs are there?", ans39
      repeat while quiz_quit = 0
         wait 30 ticks
      end repeat
      put 0 into quiz_quit
  if math_answer is not 1 then
         if math_answer is  -1 then
          play  uhoh2
              else
             play jawharp
          showwitch_surprised
         end if
       else
           play good
           show_frog_good
      end if



lock screen
repeat with x39 = 5 to 13
 hide btn %x39%
end repeat
unlock screen
 bolzshow

End ladybugs_chosen














On bird2mquiz
lock screen
put random(9) into rdm39
repeat with n = 5 to 5 + rdm39 -1
 show btn %n%
 set bitmap of btn %n% to bird2
end repeat
repeat with n = 5 + rdm39  to 13
  hide btn %n%
end repeat
unlock screen
End bird2mquiz

On zebramquiz
lock screen
put random(9) into rdm39
repeat with n = 5 to 5 + rdm39 -1
 show btn %n%
 set bitmap of btn %n% to zebra
end repeat
repeat with n = 5 + rdm39  to 13
  hide btn %n%
end repeat
unlock screen
End Zebramquiz


On ladybugmquiz
lock screen
put random(9) into rdm39
repeat with n = 5 to 5 + rdm39 -1
 show btn %n%
 set bitmap of btn %n% to ladybugs
end repeat
repeat with n = 5 + rdm39  to 13
  hide btn %n%
end repeat
unlock screen
end ladybugmquiz

On octpusmquiz
lock screen
put random(9) into rdm39
repeat with n = 5 to 5 + rdm39 -1
 show btn %n%
 set bitmap of btn %n% to octpus
end repeat
repeat with n = 5 + rdm39  to 13
  hide btn %n%
end repeat
unlock screen
end octpusmquiz


-----------end card39--------------

-------------- card 31 --------------


On opencard 31
put random(10) into hotarusu
put 0 into grassopened
if game_on is not 1 then
wait 1 seconds
play nakani1
put 3 into ntx
naratoranimex
opengrass
wait 5 seconds
opengrass
play bokuwo
put 4 into ntx
naratoranimex

end if

end opencard


On hotar_come
if grassopened = 1 then
  opengrass
end if

if grassopened = 0 then
   play flicker
   hotaruflyin
    QuizDlg4 "How many fireflies are left behind the grass ?", hotarusu
      repeat while quiz_quit = 0
         wait 30 ticks
      end repeat
      put 0 into quiz_quit
  if math_answer is not 1 then
        if math_answer is  -1 then
              play  uhoh2
        else
              play jawharp
          showwitch_surprised
          opengrass
          wait 5 seconds
          opengrass
        end if
       else
           play good
           show_frog_good
          opengrass
          wait 5 seconds
          opengrass
 
      end if

end if

End hotar_come



On opengrass

if grassopened = 0 then
     lock screen
     hide  btn 15
     repeat with xxx = 2 to 11
       hide btn %xxx%
     end repeat
     repeat with xxx = 2 to 2 + hotarusu -1
          show btn %xxx%
     end repeat
       unlock screen
     put 1 into grassopened

else

     lock screen
      show btn 15
      unlock screen
     put 0 into grassopened
  end if
end opengrass

on hotaruflyin
if grassopened = 1 then 
  exit hotaruflyin
end if
if hotarusu = 10 then
  hotaruflyout
  exit hotaruflyin
end if
 put random(10) into targethotarusu
 if targethotarusu + hotarusu  > 10 then
    put random( 10 - hotarusu) into targethotarusu
 end if

repeat targethotarusu times
  hotaruflyin1time
end repeat
end hotaruflyin

 
on hotaruflyout
if grassopened = 1 then 
  exit hotaruflyout
end if
if hotarusu = 0 then
  hotarflyin
  exit hotaruflyout
end if
 put random(hotarusu) into targethotarusu

repeat targethotarusu times
  hotaruflyout1time
end repeat
end hotaruflyout






on hotaruflyin1time
if grassopened = 1 then
  exit hotaruflyin1time
end if
set the loc of btn hotarfly to 581,169
set bitmap of btn hotarfly to hotarfly
show btn hotarfly
wait 10 ticks
set the loc of btn hotarfly to 455,312 + random(10)
wait 10 ticks
set the loc of btn hotarfly to 407, 208 + random(10)
wait 10 ticks
set the loc of btn hotarfly to 310,260 + random(10)
wait 10 ticks
set the loc of btn hotarfly to 263,313 + random(10)
wait 10 ticks
hide btn hotarfly
put hotarusu + 1 into hotarusu
end hotaruflyin1time

on hotaruflyout1time
if grassopened = 1 then
  exit hotaruflyout1time
end if
set the loc of btn hotarfly to 263,313 + random(10)
set bitmap of btn hotarfly to hotarflr
show btn hotarfly
wait 10 ticks
set the loc of btn hotarfly to 310,260 + random(10)
wait 10 ticks
set the loc of btn hotarfly to 407, 208 + random(10)
wait 10 ticks
set the loc of btn hotarfly to 455,312 + random(10)
wait 10 ticks
set the loc of btn hotarfly to 581,169
wait 10 ticks
hide btn hotarfly
put hotarusu - 1 into hotarusu
end hotaruflyout1time






-------------- end card 31 ---------
--------------  card 33 ---------
On opencard 33
  put 33 into presentcard
  put 0 into init33
if game_on is not 1 then
  play imananji
   put 3 into ntx
   naratoranimex
   wait 1 seconds
   play bokuwo
   put 4 into ntx
   naratoranimex

end if
end opencard

On q_clock33
put random(720) into clock33
Setclock33
 if game_on is  1 and init33 = 0 then
  play imananji
   put 3 into ntx
   naratoranimex
 put 1 into init33
  end if

  QuizDlg18 "What time is it now?  It is ___minute(s) (past/to) ___", clock33
      repeat while quiz_quit = 0
         wait 30 ticks
      end repeat
      put 0 into quiz_quit
  if math_answer is not 1 then
         if math_answer is  -1 then
          play  uhoh2
          else
              play jawharp
              showwitch_surprised
          end if
       else
           play good
           show_frog_good
      end if

End q_clock33






On OpenCard 33
    put 0 into clock33
	SetClock33
end OpenCard

On SetClock33
	put clock33 mod 60 into fun
	set data of btn "PinLong" to fun * 6
	set data of btn "PinShort" to clock33 * 0.5
end SetClock33

On FunUp33
	repeat while mouse() is down
		put clock33 + 1 into clock33
		if clock33 >= 720 then
			put clock33 - 720 into clock33
		end if
		SetClock33
		wait 10 ticks
	end repeat
end FunUp33

On FunDown33
	repeat while mouse() is down
		put clock33 - 1 into clock33
		if clock33 < 0 then
			put clock33 + 720 into clock33
		end if
		SetClock33
		wait 10 ticks
	end repeat
end FunDown33

On JikanUp33
	repeat while mouse() is down
		put clock33 + 60 into clock33
		if clock33 >= 720 then
			put clock33 - 720 into clock33
		end if
		SetClock33
		wait 10 ticks
	end repeat
end JikanUp33

On JikanDown33
	repeat while mouse() is down
		put clock33 - 60 into clock33
		if clock33 < 0 then
			put clock33 + 720 into clock33
		end if
		SetClock33
		wait 10 ticks
	end repeat
end JikanDown33

-------------- end card 33 ---------
--------------  card 35 ---------

On OpenCard 35
if game_on is not 1 then
  play nanjikan
  put 3 into ntx
  naratoranimex
   wait 1 seconds
   play bokuwo
   put 4 into ntx
   naratoranimex

 end if
   put 0 into init35
   put 0 into clock35_1
   put 0 into clock35_2

	SetClock35
end OpenCard

On q_clock35
put random(720) into clock35_1
put random(720) into clock35_2
Setclock35

 if game_on is  1 and init35 = 0 then
  play nanjikan
  put 3 into ntx
  naratoranimex
 put 1 into init35
  end if


 if clock35_1 >= clock35_2 then

put (clock35_1 - clock35_2) into difference 
  QuizDlg7 "The yellow clock is __hrs__min faster than the purple clock", difference
 else
 put (clock35_2 - clock35_1) into difference 
  QuizDlg7 "The purple clock is __hrs__min faster than the yellow clock", difference
end if

     repeat while quiz_quit = 0
         wait 30 ticks
      end repeat
      put 0 into quiz_quit
  if math_answer is not 1 then
         if math_answer is  -1 then
             play  uhoh2
          else
              play jawharp
             showwitch_surprised
          end if
       else
           play good
           show_frog_good
      end if


End q_clock35



On SetClock35
	put clock35_1 mod 60 into fun
	set data of btn "PinLong1" to fun * 6
	set data of btn "PinShort1" to clock35_1 * 0.5

	put clock35_2 mod 60 into fun
	set data of btn "PinLong2" to fun * 6
	set data of btn "PinShort2" to clock35_2 * 0.5
end SetClock35

On FunUp35_1
	repeat while mouse() is down
		put clock35_1 + 1 into clock35_1
		if clock35_1 >= 720 then
			put clock35_1 - 720 into clock35_1
		end if
		SetClock35
		wait 10 ticks
	end repeat
end FunUp35_1

On FunDown35_1
	repeat while mouse() is down
		put clock35_1 - 1 into clock35_1
		if clock35_1 < 0 then
			put clock35_1 + 720 into clock35_1
		end if
		SetClock35
		wait 10 ticks
	end repeat
end FunDown35_1

On JikanUp35_1
	repeat while mouse() is down
		put clock35_1 + 60 into clock35_1
		if clock35_1 >= 720 then
			put clock35_1 - 720 into clock35_1
		end if
		SetClock35
		wait 10 ticks
	end repeat
end JikanUp35_1

On JikanDown35_1
	repeat while mouse() is down
		put clock35_1 - 60 into clock35_1
		if clock35_1 < 0 then
			put clock35_1 + 720 into clock35_1
		end if
		SetClock35
		wait 10 ticks
	end repeat
end JikanDown35_1

On FunUp35_2
	repeat while mouse() is down
		put clock35_2 + 1 into clock35_2
		if clock35_2 >= 720 then
			put clock35_2 - 720 into clock35_2
		end if
		SetClock35
		wait 10 ticks
	end repeat
end FunUp35_2

On FunDown35_2
	repeat while mouse() is down
		put clock35_2 - 1 into clock35_2
		if clock35_2 >= 720 then
			put clock35_2 - 720 into clock35_2
		end if
		SetClock35
		wait 10 ticks
	end repeat
end FunDown35_2

On JikanUp35_2
	repeat while mouse() is down
		put clock35_2 + 60 into clock35_2
		if clock35_2 >= 720 then
			put clock35_2 - 720 into clock35_2
		end if
		SetClock35
		wait 10 ticks
	end repeat
end JikanUp35_2

On JikanDown35_2
	repeat while mouse() is down
		put clock35_2 - 60 into clock35_2
		if clock35_2 < 0 then
			put clock35_2 + 720 into clock35_2
		end if
		SetClock35
		wait 10 ticks
	end repeat
end JikanDown35_2

-------------- end card 35---------



--------------------card 42 -----------------
On opencard 42
  put 42 into presentcard
  if game_on is not 1 then
  play x99
   put 2 into ntx
   naratoranimex
  wait 1 seconds

  play bokuwo
   put 3 into ntx
   naratoranimex
  put 0 into x99selectedcolumn
  end if

end opencard

On random_selection_of_column
put random(19) into x99_number_random
if x99_number_random = 10 then
  put random(9) into x99_number_random
end if
if x99_number_random = 1 then
  hx1
end if
if x99_number_random = 2 then
  hx2
end if
if x99_number_random = 3 then
  hx3
end if
if x99_number_random = 4 then
  hx4
end if
if x99_number_random = 5 then
  hx5
end if
if x99_number_random = 6 then
  hx6
end if
if x99_number_random = 7 then
  hx7
end if
if x99_number_random = 8 then
  hx8
end if
if x99_number_random = 9 then
  hx9
end if
if x99_number_random = 11 then
  v1x
end if
if x99_number_random = 12 then
  v2x
end if
if x99_number_random = 13 then
  v3x
end if

if x99_number_random = 14 then
  v4x
end if

if x99_number_random = 15 then
  v5x
end if

if x99_number_random = 16 then
  v6x
end if

if x99_number_random = 17 then
  v7x
end if

if x99_number_random = 18 then
  v8x
end if

if x99_number_random = 19 then
  v9x
end if


End random_selection_of_column






On hx1
lock screen
vhbarhide
set the loc of btn x99v1 to 107,249
show btn x99v1
unlock screen
put 1 into x99selectedcolumn
end hx1

On hx3
lock screen
vhbarhide
set the loc of btn x99v1 to 107 + 71 * 1,249
show btn x99v1
unlock screen
put 3 into x99selectedcolumn
end hx3

On hx5
lock screen
vhbarhide
set the loc of btn x99v1 to 107 + 71 * 2,249
show btn x99v1
unlock screen
put 5 into x99selectedcolumn
end hx5

On hx7
lock screen
vhbarhide
set the loc of btn x99v1 to 107 + 71 * 3 - 1, 249
show btn x99v1
unlock screen
put 7 into x99selectedcolumn
end hx7

On hx9
lock screen
vhbarhide
set the loc of btn x99v1 to 107 + 71 * 4 - 2,249
show btn x99v1
unlock screen
put 9 into x99selectedcolumn
end hx9

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

On hx2
lock screen
vhbarhide
set the loc of btn x99v2 to 143 ,249
show btn x99v2
unlock screen
put 2 into x99selectedcolumn
end hx2

On hx4
lock screen
vhbarhide
set the loc of btn x99v2 to 143 + 71 * 1 ,249
show btn x99v2
unlock screen
put 4 into x99selectedcolumn
end hx4

On hx6
lock screen
vhbarhide
set the loc of btn x99v2 to 143 + 71 * 2 ,249
show btn x99v2
unlock screen
put 6 into x99selectedcolumn
end hx6

On hx8
lock screen
vhbarhide
set the loc of btn x99v2 to 143 + 71 * 3 ,249
show btn x99v2
unlock screen
put 8 into x99selectedcolumn
end hx8

-----------------------------
On v1x
lock screen
vhbarhide
set the loc of btn x99h1 to 249, 110
show btn x99h1
unlock screen
put 11 into x99selectedcolumn
end v1x

On v3x
lock screen
vhbarhide
set the loc of btn x99h1 to 249, 110 + 71 * 1
show btn x99h1
unlock screen
put 13 into x99selectedcolumn
end v3x

On v5x
lock screen
vhbarhide
set the loc of btn x99h1 to 249, 110 + 71 * 2
show btn x99h1
unlock screen
put 15 into x99selectedcolumn
end v5x

On v7x
lock screen
vhbarhide
set the loc of btn x99h1 to 249, 110 + 71 * 3 - 1
show btn x99h1
unlock screen
put 17 into x99selectedcolumn
end v7x

On v9x
lock screen
vhbarhide
set the loc of btn x99h1 to 249, 110 + 71 * 4 - 3
show btn x99h1
unlock screen
put 19 into x99selectedcolumn
end v9x

On v2x
lock screen
vhbarhide
set the loc of btn x99h2 to 249, 143
show btn x99h2
unlock screen
put 12 into x99selectedcolumn
end v2x

On v4x
lock screen
vhbarhide
set the loc of btn x99h2 to 249 + 1, 143 + 71 * 1
show btn x99h2
unlock screen
put 14 into x99selectedcolumn
end v4x

On v6x
lock screen
vhbarhide
set the loc of btn x99h2 to 249, 143 + 71 * 2
show btn x99h2
unlock screen
put 16 into x99selectedcolumn
end v6x

On v8x
lock screen
vhbarhide
set the loc of btn x99h2 to 249, 143 + 71 * 3
show btn x99h2
unlock screen
put 18 into x99selectedcolumn
end v8x

On vhbarhide
hide btn x99v1
hide btn x99v2
hide btn x99h1
hide btn x99h2
End vhbarhide



On q_multiplication
if  x99selectedcolumn = 0 then
    show btn t_writer
       message2 LocH of btn t_writer - 86, LocV of btn t_writer - 41, 9, "Click after you select a row or a columnon the board !"
    hide btn t_writer
   exit q_multiplication
end if
   if x99selectedcolumn < 10 then
       put 107 + 35 * ( x99selectedcolumn -1 ) into qmrkx
       put x99selectedcolumn into x_value
       put random( 9) into y_value
       put 110 + 35 * ( y_value -1 ) into qmrky
   else
       put x99selectedcolumn - 10 into y_value
       put random(9) into x_value
       put 107 + 35 * ( x_value - 1 ) into qmrkx
       put 110 + 35 * ( y_value  -1 ) into qmrky
   end if
    set the loc of btn x99qmrkr to qmrkx, qmrky
    repeat 4 times
    show btn x99qmrkr
    play click
    wait 10 ticks
    hide btn x99qmrkr
    end repeat
    show btn x99qmrkr
   put  x_value * y_value into x99ans
    QuizDlg4 "What number do you expect?", x99ans
 
      repeat while quiz_quit = 0
         wait 30 ticks
      end repeat
      put 0 into quiz_quit
 
  if math_answer is not 1 then
        if math_answer is  -1 then
            play  uhoh2
        else
            play jawharp
          showwitch_surprised
         end if
       else
           play good
           show_frog_good
      end if

    hide btn x99qmrkr
End  q_multiplication

On q_multi5
    put 0 into q5_score
     repeat 5 times
           random_selection_of_column
           q_multiplication
      if math_answer is not 1 then
           if math_answer = -1 then
              exit q_multi5
            end if

        else
          put q5_score +1 into q5_score
       end if
   end repeat

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 q_multi5






-------------------end card 42 ----------



-----------card 10------------


---------- end card 10 ----------
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

End Entranceback


On M_KingdomTours

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

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

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

if selectedcardtogo = 1 then
     go cd 30
   wait 1 seconds
    play nakani1
    put 3 into ntx
    naratoranimex
    wait 2 seconds
    openflower
    wait 6 seconds
    openflower
    q_letbeeflyrandom
   if math_answer is not 1 then
          go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
          entranceback
          click at btn %frogloc%
   exit M_KingdomTours
   end if
end if

if selectedcardtogo = 2 then

  dblqandwait
 show btn t_writer
  message2 LocH of btn t_writer - 86, LocV of btn t_writer - 41, 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer
  go cd 40
  repeat 2 times
    howmanycandy10
   if math_answer is not 1 then
           go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
          entranceback
          click at btn %frogloc%
     exit M_KingdomTours
   end if
   end repeat
end if
if selectedcardtogo = 3 then
  dblqandwait
show btn t_writer
message2 LocH of btn t_writer - 86, LocV of btn t_writer - 41, 9, "If you fail to solve the question, you will be returned to the entrance !"
hide btn t_writer
  go cd 32
  repeat 2 times
    makeorder
   if math_answer is not 1 then
           go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
          entranceback
          click at btn %frogloc%
     exit M_KingdomTours
   end if
   end repeat
end if

if selectedcardtogo = 5 then
  go cd 36
     Kingdom_quiz36
     if math_answer is not 1 then
           go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
          entranceback
          click at btn %frogloc%
     exit M_KingdomTours
     end if


end if
if selectedcardtogo = 4 then
    go cd 31
   wait 1 seconds
   put 3 into ntx
   play nakani1
     naratoranimex
   wait 2 seconds
    opengrass
    wait 5 seconds
    opengrass
    hotar_come
   if math_answer is not 1 then
           go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
          entranceback
          click at btn %frogloc%
   exit M_KingdomTours
   end if

end if

if selectedcardtogo = 6 then
  dblqandwait
show btn t_writer
 message2 LocH of btn t_writer - 86, LocV of btn t_writer - 41, 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer

  go cd 33
  repeat 2 times
   q_clock33
   if math_answer is not 1 then
           go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
          entranceback
          click at btn %frogloc%
     exit M_KingdomTours
   end if
  end repeat

end if
if selectedcardtogo = 7 then
 
  dblqandwait
show btn t_writer
message2 LocH of btn t_writer - 86, LocV of btn t_writer - 41, 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer
  go cd 41
  repeat 2 times
    howmanycandy100
   if math_answer is not 1 then
           go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
         entranceback
          click at btn %frogloc%
     exit M_KingdomTours
   end if
   end repeat

end if
if selectedcardtogo = 8 then
  dblqandwait
show btn t_writer
message2 LocH of btn t_writer - 86, LocV of btn t_writer - 41, 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer
  go cd 37
  repeat 2 times
    howtomeasure123
   if math_answer is not 1 then
           go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
           entranceback
           click at btn %frogloc%
     exit M_KingdomTours
   end if
   end repeat

end if
if selectedcardtogo = 9 then
  dblqandwait
show btn t_writer
 message2 LocH of btn t_writer - 86, LocV of btn t_writer - 41, 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer
  go cd 42
  repeat 2 times
       random_selection_of_column
       q_multiplication
      if math_answer is not 1 then
             go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
           entranceback
          click at btn %frogloc%
     exit M_KingdomTours
    end if
   end repeat

end if
if selectedcardtogo = 10 then
  dblqandwait
show btn t_writer
message2 LocH of btn t_writer - 86, LocV of btn t_writer - 41, 9, "If you fail to solve the question, you will be returned to the entrance!"
 hide btn t_writer
  go cd 35
  repeat 2 times
   q_clock35
   if math_answer is not 1 then
          go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
           entranceback
          click at btn %frogloc%

     exit M_KingdomTours
   end if
  end repeat

end if
if selectedcardtogo = 11 then
  dblqandwait
show btn t_writer
message2 LocH of btn t_writer - 86, LocV of btn t_writer - 41, 9, "If you fail to solve the question, you will be returned to the entrance!"
 hide btn t_writer
  go cd 39
   repeat 2 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
          go cd 3
          if math_answer = -1 then
            game_over2
            exit M_KingdomTours

           end if
           entranceback
          click at btn %frogloc%
        exit M_KingdomTours
      end if
  end repeat
end if

 go cd 3


End M_KingdomTours




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 OK100
    show btn t_writer
  message2 LocH of btn t_writer - 86, LocV of btn t_writer - 41, 9, "Congratulations!  Your answers are 100% correct!"
  hide btn t_writer
End OK100
On OK80
    show btn t_writer
  message2 LocH of btn t_writer - 86, LocV of btn t_writer - 41, 9, "Congratulations!  Your answers are 80% correct!"
  hide btn t_writer
End OK80

On OK60
    show btn t_writer
  message2 LocH of btn t_writer - 86, LocV of btn t_writer - 41, 9, "Congratulations!  Your answers are 60% correct !"
  hide btn t_writer
End OK60

On dblqandwait
play dblquiz
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 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 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 gocd99
go cd 99
End gocd99

On gocd100
go cd 100
End gocd100

On gocd101
go cd 101
End gocd101


On Sansu_owaru
 quit
End Sansu_owaru
-------------------------- card 4 ---------------

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

if random(35) = 7  then
  idle_anime_bee
end if

if rdm4 = 9  then
  idle_anime_oct
end if

if rdm4 = 11  then
  idle_anime_frg
end if

if rdm4 = 13  then
  idle_anime_clock
end if

if rdm4 = 10  then
  idle_anime_flag
end if






End idle




On  idle_anime_flag
play pyu_
repeat 4 times
set bitmap of btn flagmthg to flagmthh
wait 1 ticks
set bitmap of btn flagmthg to flagmthg
wait 1 ticks
end repeat

End  idle_anime_flag






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 3
   exit idle_anime_baloon
  end if
  
end repeat
 hide btn baloon

End idle_anime_baloon


On idle_anime_bee
set the loc of btn bee_lfts  to 576, 380
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 576 - 10 * idle4x + xx4, 380 - 5 * idle4x - idle4y
  wait 5 ticks
  if mouseclick() then
   exit repeat
  end if
  
end repeat

set the loc of btn bee_lfts  to 576, 380

End idle_anime_bee

On idle_anime_oct
play ocean
repeat with idle4x = 1 to 3
  set bitmap of btn oct0 to oct2
    wait 10 ticks
  set bitmap of btn oct0 to oct1
    wait 10 ticks
  if mouseclick() then
   exit repeat
  end if
end repeat
   set bitmap of btn oct0 to oct0
 

End idle_anime_oct

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
repeat with idle4x = 1 to 2
  set bitmap of btn clock1 to clock2
    wait 10 ticks
  if mouseclick() then
   exit repeat
  end if
  set bitmap of btn clock1 to clock3
    wait 10 ticks
  if mouseclick() then
   exit repeat
  end if
  set bitmap of btn clock1 to clock2
    wait 10 ticks
  if mouseclick() then
   exit repeat
  end if
  set bitmap of btn clock1 to clock1
    wait 20 ticks
  if mouseclick() then
   exit repeat
  end if
end repeat
   set bitmap of btn clock1 to clock1
 

End idle_anime_clock
----------------------------- end card 4 ------------------
--------------action9-------
On action9
play thunder
flash 2
repeat 3 times
show btn thnder21
hide btn thnder21
end repeat
set bitmap of btn nwitchl2 to nwitchl3
play scaryscr
wait 2 seconds
set bitmap of btn nwitchl2 to kiddy1
wait 2 seconds

       wait 40 ticks

       play magice
        set bitmap of btn nwitchl2 to kiddy3
        wait 30 ticks
        set bitmap of btn nwitchl2 to kiddy4
        wait  2 seconds
        play hallel2

        wait 4 seconds
        play Beethovn
        put 0 into game_on
        go cd 3
        exitkingdom


end action9

-------------end action9
On mdoor_open
       play creak
       set bitmap of btn s_door1 to s_door2
        wait 20 ticks
       set bitmap of btn s_door1 to s_door3
        wait 20 ticks
End mdoor_open

--------------erase sound
On erase_sound
	SoundOnOff
End erase_sound

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


On inputkey
set_key
End inputkey

On go_registration
go cd 110
End go_registration

