On OpenCard
If Game_on is not 1 then
  play doriru
    put 3 into ntx
   naratoranimex
wait 2 seconds
  play bokuwo
    put 5 into ntx
   naratoranimex
end if

repeat with i = 1 to 16
put random(5) into digit_a
   
        
if digit_a = 1  then
put random(9) into a_number

put a_number  into Item i of fldarray
putInt Item i of fldarray into fld %i%

end if



if  digit_a = 2 then
put random(9) into a_number
put random(9) into b_number
put a_number * 10 + b_number into Item i of fldarray
putInt Item i of fldarray into fld %i%

end if




if  digit_a = 3 then
put random(9) into a_number
put random(9) into b_number
put random(9) into c_number
put a_number * 100 + b_number*10 + c_number into Item i of fldarray
putInt Item i of fldarray into fld %i%

end if


if digit_a = 4 then
put random(9) into a_number
put random(9) into b_number
put random(9) into c_number
put random(9) into d_number
put a_number * 1000 + b_number*100 + c_number*10 + d_number into Item i of fldarray
putInt Item i of fldarray into fld %i%

end if


if digit_a = 5  then
put random(9) into a_number
put random(9) into b_number
put random(9) into c_number
put random(9) into d_number
put random(9) into e_number
put a_number * 10000 + b_number*1000 + c_number*100 + d_number*10 + e_number into Item i of fldarray
putInt Item i of fldarray into fld %i%

end if



put 0 into Item i of checkarray
end repeat


put 25 into Item 1 of btnarray
put 24 into Item 2 of btnarray
put 15 into Item 3 of btnarray
put 18 into Item 4 of btnarray
put 12 into Item 5 of btnarray
put 26 into Item 6 of btnarray
put 19 into Item 7 of btnarray
put 14 into Item 8 of btnarray
put 16 into Item 9 of btnarray
put 20 into Item 10 of btnarray
put 13 into Item 11 of btnarray
put 23 into Item 12 of btnarray
put 21 into Item 13 of btnarray
put 17 into Item 14 of btnarray
put 22 into Item 15 of btnarray
put 27 into Item 16 of btnarray


put 29 into Item 1 of hotaruarray
put 32 into Item 2 of hotaruarray
put 37 into Item 3 of hotaruarray
put 38 into Item 4 of hotaruarray
put 64 into Item 5 of hotaruarray
put 33 into Item 6 of hotaruarray
put 39 into Item 7 of hotaruarray
put 41 into Item 8 of hotaruarray
put 30 into Item 9 of hotaruarray
put 34 into Item 10 of hotaruarray
put 42 into Item 11 of hotaruarray
put 40 into Item 12 of hotaruarray
put 31 into Item 13 of hotaruarray
put 35 into Item 14 of hotaruarray
put 36 into Item 15 of hotaruarray
put 43 into Item 16 of hotaruarray




End OpenCard







On Reset34



repeat with i = 1 to 16
put random(5) into digit_a
   
        
if digit_a = 1  then
put random(9) into a_number

put a_number  into Item i of fldarray
putInt Item i of fldarray into fld %i%

end if



if  digit_a = 2 then
put random(9) into a_number
put random(9) into b_number
put a_number * 10 + b_number into Item i of fldarray
putInt Item i of fldarray into fld %i%

end if




if  digit_a = 3 then
put random(9) into a_number
put random(9) into b_number
put random(9) into c_number
put a_number * 100 + b_number*10 + c_number into Item i of fldarray
putInt Item i of fldarray into fld %i%

end if


if digit_a = 4 then
put random(9) into a_number
put random(9) into b_number
put random(9) into c_number
put random(9) into d_number
put a_number * 1000 + b_number*100 + c_number*10 + d_number into Item i of fldarray
putInt Item i of fldarray into fld %i%

end if


if digit_a = 5  then
put random(9) into a_number
put random(9) into b_number
put random(9) into c_number
put random(9) into d_number
put random(9) into e_number
put a_number * 10000 + b_number*1000 + c_number*100 + d_number*10 + e_number into Item i of fldarray
putInt Item i of fldarray into fld %i%

end if



put 0 into Item i of checkarray
end repeat



put 25 into Item 1 of btnarray
put 24 into Item 2 of btnarray
put 15 into Item 3 of btnarray
put 18 into Item 4 of btnarray
put 12 into Item 5 of btnarray
put 26 into Item 6 of btnarray
put 19 into Item 7 of btnarray
put 14 into Item 8 of btnarray
put 16 into Item 9 of btnarray
put 20 into Item 10 of btnarray
put 13 into Item 11 of btnarray
put 23 into Item 12 of btnarray
put 21 into Item 13 of btnarray
put 17 into Item 14 of btnarray
put 22 into Item 15 of btnarray
put 27 into Item 16 of btnarray




put 29 into Item 1 of hotaruarray
put 32 into Item 2 of hotaruarray
put 37 into Item 3 of hotaruarray
put 38 into Item 4 of hotaruarray
put 64 into Item 5 of hotaruarray
put 33 into Item 6 of hotaruarray
put 39 into Item 7 of hotaruarray
put 41 into Item 8 of hotaruarray
put 30 into Item 9 of hotaruarray
put 34 into Item 10 of hotaruarray
put 42 into Item 11 of hotaruarray
put 40 into Item 12 of hotaruarray
put 31 into Item 13 of hotaruarray
put 35 into Item 14 of hotaruarray
put 36 into Item 15 of hotaruarray
put 43 into Item 16 of hotaruarray






lock screen
repeat with Original = 1 to 16
put Item Original of btnarray into oo
put Item Original of hotaruarray into ooo
show btn %oo%
show btn %ooo%
hide fld %Original%
end repeat

unlock screen




End Reset34















On hotaruleft
put LocH of btn %hotaru_btn_no% into x0
put LocV of btn %hotaru_btn_no% into y0
hide btn  %hotaru_btn_no%
End hotaruleft


On hotaruright
put LocH of btn %hotaru_btn_no% into x0
put LocV of btn %hotaru_btn_no% into y0
hide btn  %hotaru_btn_no%
End hotaruright



On GetNumber
put random(16) into r1
put 0 into found
repeat with j = r1 to 16
  if Item j of checkarray = 0 then
     put 1 into found
     exit repeat
  end if
end repeat
if found = 1 then
  exit GetNumber
end if

if found = 0 then
repeat with j = 1 to r1-1
  if Item j of checkarray = 0 then
     put 1 into found
     exit repeat
  end if
end repeat
end if 

End GetNumber




On GameStart
put 0 into rightanswer
put 0 into mistake
putInt 0 into fld right_ans
putInt 0 into fld TotalQ
Repeat while 1=1
 GetNumber
 if found is not 0 then
      put 0 into m
      put 0 into l
      put j into jjj
      put Item jjj of Hotaruarray into hh1
            put hh1 into hotaru_btn_no
       play chirps

       if hh1 = 38 or hh1 = 30 or hh1 = 34 or hh1 = 42 or hh1 = 31 or hh1=35 then
          HotaruRight
       else
          HotaruLeft
       end if

       put x0 into h1x
       put y0 into h1y
       Lock screen
       put Item jjj of btnarray into bbb
        hide btn %bbb%
          putInt Item jjj of fldarray into fld %jjj%

       show fld %jjj%
        set loc of btn hidebtn1 to LocH of btn %bbb%, LocV of btn %bbb%
       show btn hidebtn1
       unlock screen









-------------------
     repeat while 1 = 1
       GetNumber
       if j is not jjj then
          exit repeat
       end if
     end repeat
        put j into kkk
         
      put Item kkk of Hotaruarray into hh2
            put hh2 into hotaru_btn_no
       if hh2 = 38 or hh2 = 30 or hh2 = 34 or hh2 = 42 or hh2 = 31 or hh2=35 then
          HotaruRight
       else
          HotaruLeft
       end if
         put x0 into h2x
        put y0 into h2y

     Lock screen
       put Item kkk of btnarray into ccc
        hide btn %ccc%


       putInt Item kkk of fldarray into fld %kkk%
 

        show fld %kkk%
        set loc of btn hidebtn2 to LocH of btn %ccc%, LocV of btn %ccc%
       show btn hidebtn2
      unlock screen

if  Item jjj of fldarray >  Item kkk of fldarray then
     put 1 into JBIG
     put 0 into KBIG
       if  Item jjj of fldarray > 9999 then
           put random(4) + 1  into m
       else

          if  Item jjj of fldarray > 999 then
              put random(3) + 1  into m
          else
             if  Item jjj of fldarray > 99 then
                put random(2) + 1  into m
             else
                 if  Item jjj of fldarray >= 0 then
                    put 2  into m
                 end if
             end if
           end if
        end if

else
     put 0 into JBIG
     put 1 into KBIG

      if  Item kkk of fldarray > 9999 then
           put random(4) + 1  into l
       else

          if  Item kkk of fldarray > 999 then
              put random(3) + 1  into l
          else
             if  Item kkk of fldarray > 99 then
                put random(2) + 1  into l
             else
                 if  Item kkk of fldarray >= 0 then
                    put 2  into l
                 end if
             end if
           end if
        end if
 end if     

 if JBIG > KBIG and  m = 5  then
           put  (Item jjj of fldarray) MOD 10000 into MODNUM
           if MODNUM >= 5000 then
               put Item jjj of fldarray + 10000 - MODNUM into number1
            else
               put Item jjj of fldarray  - MODNUM into number1
            end if

           put  (Item kkk of fldarray) MOD 10000 into MODNUM
           if MODNUM >= 5000 then
               put Item kkk of fldarray + 10000 - MODNUM into number2
            else
               put Item kkk of fldarray  - MODNUM into number2
            end if
   end if

   if JBIG > KBIG and m = 4  then
           put  (Item jjj of fldarray) MOD 1000 into MODNUM
           if MODNUM >= 500 then
               put Item jjj of fldarray + 1000 - MODNUM into number1
            else
               put Item jjj of fldarray  - MODNUM into number1
            end if

           put  (Item kkk of fldarray) MOD 1000 into MODNUM
           if MODNUM >= 500 then
               put Item kkk of fldarray + 1000 - MODNUM into number2
            else
               put Item kkk of fldarray  - MODNUM into number2
            end if


   end if

   if JBIG > KBIG and m = 3  then
           put  (Item jjj of fldarray) MOD 100 into MODNUM
           if MODNUM >= 50 then
               put Item jjj of fldarray + 100 - MODNUM into number1
            else
               put Item jjj of fldarray  - MODNUM into number1
            end if

           put  (Item kkk of fldarray) MOD 100 into MODNUM
           if MODNUM >= 50 then
               put Item kkk of fldarray + 100 - MODNUM into number2
            else
               put Item kkk of fldarray  - MODNUM into number2
            end if



   end if

   if JBIG > KBIG and m = 2  then
           put  (Item jjj of fldarray) MOD 10 into MODNUM
           if MODNUM >= 5 then
               put Item jjj of fldarray + 10 - MODNUM into number1
            else
               put Item jjj of fldarray  - MODNUM into number1
            end if

           put  (Item kkk of fldarray) MOD 10 into MODNUM
           if MODNUM >= 5 then
               put Item kkk of fldarray + 10 - MODNUM into number2
            else
               put Item kkk of fldarray  - MODNUM into number2
            end if

   end if

----------


 if JBIG < KBIG and l = 5  then
           put  (Item kkk of fldarray) MOD 10000 into MODNUM
           if MODNUM >= 5000 then
               put Item kkk of fldarray + 10000 - MODNUM into number2
            else
               put Item kkk of fldarray  - MODNUM into number2
            end if

           put  (Item jjj of fldarray) MOD 10000 into MODNUM
           if MODNUM >= 5000 then
               put Item jjj of fldarray + 10000 - MODNUM into number1
            else
               put Item jjj of fldarray  - MODNUM into number1
            end if


   end if

  if JBIG < KBIG and  l = 4  then
           put  (Item kkk of fldarray) MOD 1000 into MODNUM
           if MODNUM >= 500 then
               put Item kkk of fldarray + 1000 - MODNUM into number2
            else
               put Item kkk of fldarray  - MODNUM into number2
            end if

           put  (Item jjj of fldarray) MOD 1000 into MODNUM
           if MODNUM >= 500 then
               put Item jjj of fldarray + 1000 - MODNUM into number1
            else
               put Item jjj of fldarray  - MODNUM into number1
            end if

  end if

  if JBIG < KBIG and  l = 3  then
           put  (Item kkk of fldarray) MOD 100 into MODNUM
           if MODNUM >= 50 then
               put Item kkk of fldarray + 100 - MODNUM into number2
            else
               put Item kkk of fldarray  - MODNUM into number2
            end if

           put  (Item jjj of fldarray) MOD 100 into MODNUM
           if MODNUM >= 50 then
               put Item jjj of fldarray + 100 - MODNUM into number1
            else
               put Item jjj of fldarray  - MODNUM into number1
            end if

   end if

  if JBIG < KBIG and  l = 2  then
           put  (Item kkk of fldarray) MOD 10 into MODNUM
           if MODNUM >= 5 then
               put Item kkk of fldarray + 10 - MODNUM into number2
            else
               put Item kkk of fldarray  - MODNUM into number2
            end if

           put  (Item jjj of fldarray) MOD 10 into MODNUM
           if MODNUM >= 5 then
               put Item jjj of fldarray + 10 - MODNUM into number1
            else
               put Item jjj of fldarray  - MODNUM into number1
            end if

   end if






       show btn hidebtn1
       show btn hidebtn2

--       hide btn %hh1%
--       hide btn %hh2%


if random(2) = 1 then
     put  number1  + number2 into ans31
     
  if m > 0 then

      if m = 5  then
      putstring " Round each score to the nearest ten thousand before the addition!" into fld condition
       end if

     if m = 4  then
      putstring " Round each score to the nearest thousand before the addition!" into fld condition
     end if

      if m = 3  then
      putstring " Round each score to the nearest hundred before the addition!" into fld condition
       end if

      if m = 2  then
      putstring " Round each score to the nearest tenth before the addition!" into fld condition
      end if

     if m = 1  then
     putstring "There is no condition!" into fld condition
      end if



      QuizDlg8 "Add the two scores", ans31
 

   else

      if l = 5  then
      putstring " Round each score to the nearest ten thousand before the addition!" into fld condition
       end if

     if l = 4  then
      putstring " Round each score to the nearest thousand before the addition!" into fld condition
     end if

      if l = 3  then
      putstring " Round each score to the nearest hundred before the addition!" into fld condition
       end if

      if l = 2  then
      putstring " Round each score to the nearest tenth before the addition!" into fld condition
      end if

     if l = 1  then
     putstring "There is no condition!" into fld condition
      end if



    QuizDlg8 "Add the two scores", ans31
 
  end if

else



     
  if m > 0 then
       put  number1  - number2 into ans31

     if m = 5  then
      putstring " Round each score to the nearest ten thousand before the subtraction!" into fld condition
       end if

     if m = 4  then
      putstring " Round each score to the nearest thousand before the subtraction!" into fld condition
     end if

      if m = 3  then
      putstring " Round each score to the nearest hundred before the subtraction!" into fld condition
       end if

      if m = 2  then
      putstring " Round each score to the nearest tenth before the subtraction!" into fld condition
      end if

     if m = 1  then
     putstring "There is no condition!" into fld condition
      end if



 
     QuizDlg8 "The two scores differ by __", ans31
 

   else
       put  number2  - number1 into ans31

     if l = 5  then
      putstring " Round each score to the nearest ten thousand before the subtraction!" into fld condition
       end if

     if l = 4  then
      putstring " Round each score to the nearest thousand before the subtraction!" into fld condition
     end if

      if l = 3  then
      putstring " Round each score to the nearest hundred before the subtraction!" into fld condition
       end if

      if l = 2  then
      putstring " Round each score to the nearest tenth before the subtraction!" into fld condition
      end if

     if l = 1  then
     putstring "There is no condition!" into fld condition
      end if





       QuizDlg8 "The two scores differ by __", ans31
 

      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
        lock screen
        show btn %ccc%
        hide fld %kkk%
        show btn %bbb%
        hide fld %jjj%
        set loc of btn %hh1% to h1x, h1y
        set loc of btn %hh2% to h2x, h2y
       show btn %hh1%
       show btn %hh2%
       hide btn hidebtn1
       hide btn hidebtn2
        unlock screen
          exit repeat
        else
              play jawharp
          showwitch_surprised
            put mistake + 1 into mistake
            putInt rightanswer + mistake into fld TotalQ
      end if


        lock screen
        show btn %ccc%
        hide fld %kkk%
        show btn %bbb%
        hide fld %jjj%
        set loc of btn %hh1% to h1x, h1y
        set loc of btn %hh2% to h2x, h2y
       show btn %hh1%
       show btn %hh2%
       hide btn hidebtn1
       hide btn hidebtn2
        unlock screen
   else
           play good
           show_frog_good
          put rightanswer + 1 into rightanswer
          putInt rightanswer + mistake into fld TotalQ
          putInt rightanswer into fld right_ans
     put 1 into Item jjj of checkarray
     put 1 into Item kkk of checkarray
    lock screen
     hide btn %hh1%
     hide btn %hh2%
     hide btn hidebtn1
     hide btn hidebtn2
     hide fld %jjj%
     hide fld %kkk%
        set loc of btn %hh1% to h1x, h1y
        set loc of btn %hh2% to h2x, h2y
     unlock screen

      end if
 else
     play AlRightL

    repeat  2 times

    set bitmap of btn 2 to orantmp2
    set bitmap of btn 2 to orantmp3
    set bitmap of btn 2 to orantmp4
    set bitmap of btn 2 to orantmp3

    end repeat
    play chipmonk
     
    set bitmap of btn 2 to orantmp1
  wait 2 seconds

   play toomuch
--   RePlace by New Anime        show_frog_good
       exit repeat
 end if  


--PutFloat2 ans31 into fld rightanswer



End Repeat 

reset34


     
    
 
End GameStart















------------------------Animation



----------
On Idle

if MOUSEH() > LocH of btn hachi1ss -40 and  MOUSEH() < LocH of btn hachi1ss + 30 and  MOUSEV() < LocV of btn hachi1ss + 20 and  MOUSEV() > LocV of btn hachi1ss - 20 then

click at btn Hachi1ss
end if

if MOUSEH() > LocH of btn jagrtiny -40 and  MOUSEH() < LocH of btn jagrtiny + 30 and  MOUSEV() < LocV of btn jagrtiny + 20 and  MOUSEV() > LocV of btn jagrtiny - 20 then
click at btn jagrtiny
end if


if MOUSEH() > LocH of btn elp_i_ss -40 and  MOUSEH() < LocH of btn elp_i_ss + 30 and  MOUSEV() < LocV of btn elp_i_ss + 20 and  MOUSEV() > LocV of btn elp_i_ss - 20 then
click at btn elp_i_ss
end if


if MOUSEH() > LocH of btn squirl1 -40 and  MOUSEH() < LocH of btn squirl1 + 30 and  MOUSEV() < LocV of btn squirl1 + 20 and  MOUSEV() > LocV of btn squirl1 - 20 then
click at btn squirl1
end if


if MOUSEH() > LocH of btn mang -40 and  MOUSEH() < LocH of btn mang + 30 and  MOUSEV() < LocV of btn mang + 20 and  MOUSEV() > LocV of btn mang - 20 then
click at btn mang
end if


if MOUSEH() > LocH of btn lizrd1 -40 and  MOUSEH() < LocH of btn lizrd1 + 30 and  MOUSEV() < LocV of btn lizrd1 + 20 and  MOUSEV() > LocV of btn lizrd1 - 20 then
click at btn lizrd1
end if


if MOUSEH() > LocH of btn Kumo -40 and  MOUSEH() < LocH of btn Kumo + 30 and  MOUSEV() < LocV of btn Kumo + 20 and  MOUSEV() > LocV of btn Kumo - 20 then
click at btn Kumo
end if


if MOUSEH() > LocH of btn okapiss -40 and  MOUSEH() < LocH of btn okapiss + 30 and  MOUSEV() < LocV of btn okapiss + 20 and  MOUSEV() > LocV of btn okapiss - 20 then
click at btn okapiss
end if


if MOUSEH() > LocH of btn bat_fshs -40 and  MOUSEH() < LocH of btn bat_fshs + 30 and  MOUSEV() < LocV of btn bat_fshs + 20 and  MOUSEV() > LocV of btn bat_fshs - 20 then
click at btn bat_fshs
end if


if MOUSEH() > LocH of btn monk_ss -40 and  MOUSEH() < LocH of btn monk_ss + 30 and  MOUSEV() < LocV of btn monk_ss + 20 and  MOUSEV() > LocV of btn monk_ss - 20 then
click at btn monk_ss
end if


if MOUSEH() > LocH of btn ougiwasi -40 and  MOUSEH() < LocH of btn ougiwasi + 30 and  MOUSEV() < LocV of btn ougiwasi + 20 and  MOUSEV() > LocV of btn ougiwasi - 20 then
click at btn ougiwasi
end if

if MOUSEH() > LocH of btn gorilla -40 and  MOUSEH() < LocH of btn gorilla + 30 and  MOUSEV() < LocV of btn gorilla + 20 and  MOUSEV() > LocV of btn gorilla - 20 then
play gorilla
end if

if MOUSEH() > LocH of btn orange3 -40 and  MOUSEH() < LocH of btn orange3 + 30 and  MOUSEV() < LocV of btn orange3 + 20 and  MOUSEV() > LocV of btn orange3 - 20 then
click at btn orange3
end if

if MOUSEH() > LocH of btn tiger2s -40 and  MOUSEH() < LocH of btn tiger2s + 30 and  MOUSEV() < LocV of btn tiger2s + 20 and  MOUSEV() > LocV of btn tiger2s - 20 then
click at btn tiger2s
end if

if MOUSEH() > LocH of btn s_raf -40 and  MOUSEH() < LocH of btn s_raf + 30 and  MOUSEV() < LocV of btn s_raf + 20 and  MOUSEV() > LocV of btn s_raf - 20 then
click at btn s_raf
end if

if MOUSEH() > LocH of btn banana -40 and  MOUSEH() < LocH of btn banana + 30 and  MOUSEV() < LocV of btn banana + 20 and  MOUSEV() > LocV of btn banana - 20 then
click at btn banana
end if

end Idle


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

On HachissMOve

play morning
put LocH of btn hachi1ss into hx
put LocV of btn hachi1ss into hy


put random(2) into k

put random(200) into n

if k = 1 then
  put 10 into m
else
  put 13 into m
end if
repeat with i = 1 to m
lock screen

if i MOD 2 = 0 then
 set bitmap of btn  hachi1ss to hachi1ss
else
 set bitmap of btn  hachi1ss to hachi2ss
end if
if k = 1 then
set loc of btn hachi1ss to hx - 10*(i-1) - random(5), hy - 15 * (i -1) - random(7)
else
set loc of btn hachi1ss to hx - 10*(i-1) - random(5), hy + 15 * (i -1) - random(7)
end if


unlock screen
end repeat


put LocH of btn hachi1ss into x2
put LocV of btn hachi1ss into y2

put random(2) into j
repeat with i = 1 to 60
lock screen

if i MOD 2 = 0 then
 set bitmap of btn  hachi1ss to hachi1ss
else
 set bitmap of btn  hachi1ss to hachi2ss
end if
if j = 1 and k = 1 then
set loc of btn hachi1ss to x2 + 10*(i-1), y2 - n/60 * (i -1)
else
set loc of btn hachi1ss to x2 + 10*(i-1), y2 + n/60 * (i -1)
end if
unlock screen
end repeat
set loc of btn hachi1ss to hx, hy
End HachissMOve



On JagarMove
play growling

put random(4) into n

repeat with i = 1 to 2
 set bitmap of btn  jagrtiny to jagrtin2
wait 30 ticks
 set bitmap of btn  jagrtiny to jagrtiny
wait 30 ticks

end repeat
End JagarMove





On elephantMove
play elephant

put random(4) into n

repeat with i = 1 to n
 set bitmap of btn  elp_i_ss to elp_i_s2
wait 20 ticks
 set bitmap of btn  elp_i_ss to elp_i_ss
wait 20 ticks

end repeat
End elephantMove

On squirlMove
play squeakie

put random(4) into n

repeat with i = 1 to 2
 set bitmap of btn  squirl1 to squirl2
 set bitmap of btn  squirl1 to squirl3
 set bitmap of btn  squirl1 to squirl2
 set bitmap of btn  squirl1 to squirl1

end repeat

End squirlMove



On mangMove
play pyu_

put random(2) into n

repeat with i = 1 to n
 set bitmap of btn  mang to mang2
 set bitmap of btn  mang to mang

end repeat

End mangMove




On kumoMove
play gullbee
put random(5) into n

repeat with i = 1 to n
 set bitmap of btn  Kumo to Kumo2
wait 1 ticks
 set bitmap of btn  Kumo to Kumo
wait 1 ticks

end repeat

End kumoMove


On lizrdMove
play chirps2
put random(10) into n
put LocH of btn lizrd1 into xxx
put LocV of btn lizrd1 into yyy
put 0 into addn

repeat with i = 1 to 18
lock screen
if i MOD 3 = 0 then
set loc of btn lizrd1 to xxx + (i - 1) *40 + addn, yyy
 set bitmap of btn lizrd1 to lizrd1
end if
if i MOD 3 = 1 then
set loc of btn lizrd1 to xxx+ (i - 1) *40 + addn, yyy
 set bitmap of btn lizrd1 to lizrd2
end if
if i MOD 3 = 2 then
set loc of btn lizrd1 to xxx+ (i - 1) *40 + addn, yyy
 set bitmap of btn lizrd1 to lizrd3
end if
put addn + 20 into addn
unlock screen
end repeat
lock screen
set loc of btn lizrd1 to xxx , yyy
 set bitmap of btn lizrd1 to lizrd1
unlock screen
End lizrdMove


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





On GameStart2
put 0 into rightanswer
put 0 into mistake
putInt 0 into fld right_ans
putInt 0 into fld TotalQ
Repeat 2 times
 GetNumber
 if found is not 0 then
      put 0 into m
      put 0 into l
      put j into jjj
      put Item jjj of Hotaruarray into hh1
            put hh1 into hotaru_btn_no
       play chirps

       if hh1 = 38 or hh1 = 30 or hh1 = 34 or hh1 = 42 or hh1 = 31 or hh1=35 then
          HotaruRight
       else
          HotaruLeft
       end if

       put x0 into h1x
       put y0 into h1y
       Lock screen
       put Item jjj of btnarray into bbb
        hide btn %bbb%
          putInt Item jjj of fldarray into fld %jjj%

       show fld %jjj%
        set loc of btn hidebtn1 to LocH of btn %bbb%, LocV of btn %bbb%
       show btn hidebtn1
       unlock screen









-------------------
     repeat while 1 = 1
       GetNumber
       if j is not jjj then
          exit repeat
       end if
     end repeat
        put j into kkk
         
      put Item kkk of Hotaruarray into hh2
            put hh2 into hotaru_btn_no
       if hh2 = 38 or hh2 = 30 or hh2 = 34 or hh2 = 42 or hh2 = 31 or hh2=35 then
          HotaruRight
       else
          HotaruLeft
       end if
         put x0 into h2x
        put y0 into h2y

     Lock screen
       put Item kkk of btnarray into ccc
        hide btn %ccc%


       putInt Item kkk of fldarray into fld %kkk%
 

        show fld %kkk%
        set loc of btn hidebtn2 to LocH of btn %ccc%, LocV of btn %ccc%
       show btn hidebtn2
      unlock screen

if  Item jjj of fldarray >  Item kkk of fldarray then
     put 1 into JBIG
     put 0 into KBIG
       if  Item jjj of fldarray > 9999 then
           put random(4) + 1  into m
       else

          if  Item jjj of fldarray > 999 then
              put random(3) + 1  into m
          else
             if  Item jjj of fldarray > 99 then
                put random(2) + 1  into m
             else
                 if  Item jjj of fldarray >= 0 then
                    put 2  into m
                 end if
             end if
           end if
        end if

else
     put 0 into JBIG
     put 1 into KBIG

      if  Item kkk of fldarray > 9999 then
           put random(4) + 1  into l
       else

          if  Item kkk of fldarray > 999 then
              put random(3) + 1  into l
          else
             if  Item kkk of fldarray > 99 then
                put random(2) + 1  into l
             else
                 if  Item kkk of fldarray >= 0 then
                    put 2  into l
                 end if
             end if
           end if
        end if
 end if     

 if JBIG > KBIG and  m = 5  then
           put  (Item jjj of fldarray) MOD 10000 into MODNUM
           if MODNUM >= 5000 then
               put Item jjj of fldarray + 10000 - MODNUM into number1
            else
               put Item jjj of fldarray  - MODNUM into number1
            end if

           put  (Item kkk of fldarray) MOD 10000 into MODNUM
           if MODNUM >= 5000 then
               put Item kkk of fldarray + 10000 - MODNUM into number2
            else
               put Item kkk of fldarray  - MODNUM into number2
            end if
   end if

   if JBIG > KBIG and m = 4  then
           put  (Item jjj of fldarray) MOD 1000 into MODNUM
           if MODNUM >= 500 then
               put Item jjj of fldarray + 1000 - MODNUM into number1
            else
               put Item jjj of fldarray  - MODNUM into number1
            end if

           put  (Item kkk of fldarray) MOD 1000 into MODNUM
           if MODNUM >= 500 then
               put Item kkk of fldarray + 1000 - MODNUM into number2
            else
               put Item kkk of fldarray  - MODNUM into number2
            end if


   end if

   if JBIG > KBIG and m = 3  then
           put  (Item jjj of fldarray) MOD 100 into MODNUM
           if MODNUM >= 50 then
               put Item jjj of fldarray + 100 - MODNUM into number1
            else
               put Item jjj of fldarray  - MODNUM into number1
            end if

           put  (Item kkk of fldarray) MOD 100 into MODNUM
           if MODNUM >= 50 then
               put Item kkk of fldarray + 100 - MODNUM into number2
            else
               put Item kkk of fldarray  - MODNUM into number2
            end if



   end if

   if JBIG > KBIG and m = 2  then
           put  (Item jjj of fldarray) MOD 10 into MODNUM
           if MODNUM >= 5 then
               put Item jjj of fldarray + 10 - MODNUM into number1
            else
               put Item jjj of fldarray  - MODNUM into number1
            end if

           put  (Item kkk of fldarray) MOD 10 into MODNUM
           if MODNUM >= 5 then
               put Item kkk of fldarray + 10 - MODNUM into number2
            else
               put Item kkk of fldarray  - MODNUM into number2
            end if

   end if

----------


 if JBIG < KBIG and l = 5  then
           put  (Item kkk of fldarray) MOD 10000 into MODNUM
           if MODNUM >= 5000 then
               put Item kkk of fldarray + 10000 - MODNUM into number2
            else
               put Item kkk of fldarray  - MODNUM into number2
            end if

           put  (Item jjj of fldarray) MOD 10000 into MODNUM
           if MODNUM >= 5000 then
               put Item jjj of fldarray + 10000 - MODNUM into number1
            else
               put Item jjj of fldarray  - MODNUM into number1
            end if


   end if

  if JBIG < KBIG and  l = 4  then
           put  (Item kkk of fldarray) MOD 1000 into MODNUM
           if MODNUM >= 500 then
               put Item kkk of fldarray + 1000 - MODNUM into number2
            else
               put Item kkk of fldarray  - MODNUM into number2
            end if

           put  (Item jjj of fldarray) MOD 1000 into MODNUM
           if MODNUM >= 500 then
               put Item jjj of fldarray + 1000 - MODNUM into number1
            else
               put Item jjj of fldarray  - MODNUM into number1
            end if

  end if

  if JBIG < KBIG and  l = 3  then
           put  (Item kkk of fldarray) MOD 100 into MODNUM
           if MODNUM >= 50 then
               put Item kkk of fldarray + 100 - MODNUM into number2
            else
               put Item kkk of fldarray  - MODNUM into number2
            end if

           put  (Item jjj of fldarray) MOD 100 into MODNUM
           if MODNUM >= 50 then
               put Item jjj of fldarray + 100 - MODNUM into number1
            else
               put Item jjj of fldarray  - MODNUM into number1
            end if

   end if

  if JBIG < KBIG and  l = 2  then
           put  (Item kkk of fldarray) MOD 10 into MODNUM
           if MODNUM >= 5 then
               put Item kkk of fldarray + 10 - MODNUM into number2
            else
               put Item kkk of fldarray  - MODNUM into number2
            end if

           put  (Item jjj of fldarray) MOD 10 into MODNUM
           if MODNUM >= 5 then
               put Item jjj of fldarray + 10 - MODNUM into number1
            else
               put Item jjj of fldarray  - MODNUM into number1
            end if

   end if






       show btn hidebtn1
       show btn hidebtn2

--       hide btn %hh1%
--       hide btn %hh2%

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



if random(2) = 1 then
     put  number1  + number2 into ans31
----------------------------------------
 
  if m > 0 then

      if m = 5  then
      putstring " Round each score has to the nearest ten thousand before the addition!" into fld condition
       end if

     if m = 4  then
      putstring " Round each score to the nearest thousand before the addition!" into fld condition
     end if

      if m = 3  then
      putstring " Round each score to the nearest hundred before the addition!" into fld condition
       end if

      if m = 2  then
      putstring " Round each score to the nearest tenth before the addition!" into fld condition
      end if

     if m = 1  then
     putstring "There is no condition!" into fld condition
      end if


 
 
     QuizDlg8 "Add the two scores", ans31
 
   else


     if l = 5  then
      putstring " Round each score to the nearest ten thousand before the addition!" into fld condition
       end if

     if l = 4  then
      putstring " Round each score to the nearest thousand before the addition!" into fld condition
     end if

      if l = 3  then
      putstring " Round each score to the nearest hundred before the addition!" into fld condition
       end if

      if l = 2  then
      putstring " Round each score to the nearest tenth before the addition!" into fld condition
      end if

     if l = 1  then
     putstring "There is no condition!" into fld condition
      end if





    QuizDlg8 "Add the two scores", ans31
  

 end if

else



     
  if m > 0 then
       put  number1  - number2 into ans31

     if m = 5  then
      putstring " Round each score to the nearest ten thousand before the subtraction!" into fld condition
       end if

     if m = 4  then
      putstring " Round each score to the nearest thousand before the subtraction!" into fld condition
     end if

      if m = 3  then
      putstring " Round each score to the nearest hundred before the subtraction!" into fld condition
       end if

      if m = 2  then
      putstring " Round each score to the nearest tenth before the subtraction!" into fld condition
      end if

     if m = 1  then
     putstring "There is no condition!" into fld condition
      end if




      QuizDlg8 "The two scores differ by __", ans31

   else
       put  number2  - number1 into ans31


     if l = 5  then
      putstring " Round each score to the nearest ten thousand before the subtraction!" into fld condition
       end if

     if l = 4  then
      putstring " Round each score to the nearest thousand before the subtraction!" into fld condition
     end if

      if l = 3  then
      putstring " Round each score to the nearest hundred before the subtraction!" into fld condition
       end if

      if l = 2  then
      putstring " Round each score to the nearest tenth before the subtraction!" into fld condition
      end if

     if l = 1  then
     putstring "There is no condition!" into fld condition
      end if



     QuizDlg8 "The two scores differ by __", ans31

      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
        lock screen
        show btn %ccc%
        hide fld %kkk%
        show btn %bbb%
        hide fld %jjj%
        set loc of btn %hh1% to h1x, h1y
        set loc of btn %hh2% to h2x, h2y
       show btn %hh1%
       show btn %hh2%
       hide btn hidebtn1
       hide btn hidebtn2
        unlock screen
          exit repeat
        else
              play jawharp
          showwitch_surprised
            put mistake + 1 into mistake
            putInt rightanswer + mistake into fld TotalQ
      end if


        lock screen
        show btn %ccc%
        hide fld %kkk%
        show btn %bbb%
        hide fld %jjj%
        set loc of btn %hh1% to h1x, h1y
        set loc of btn %hh2% to h2x, h2y
       show btn %hh1%
       show btn %hh2%
       hide btn hidebtn1
       hide btn hidebtn2
        unlock screen
        exit repeat
   else
           play good
           show_frog_good
          put rightanswer + 1 into rightanswer
          putInt rightanswer + mistake into fld TotalQ
          putInt rightanswer into fld right_ans
     put 1 into Item jjj of checkarray
     put 1 into Item kkk of checkarray
    lock screen
     hide btn %hh1%
     hide btn %hh2%
     hide btn hidebtn1
     hide btn hidebtn2
     hide fld %jjj%
     hide fld %kkk%
        set loc of btn %hh1% to h1x, h1y
        set loc of btn %hh2% to h2x, h2y
     unlock screen

      end if
 else
     play AlRightL

    repeat  2 times

    set bitmap of btn 2 to orantmp2
    set bitmap of btn 2 to orantmp3
    set bitmap of btn 2 to orantmp4
    set bitmap of btn 2 to orantmp3

    end repeat
    play chipmonk
     
    set bitmap of btn 2 to orantmp1
  wait 2 seconds

   play toomuch
--   RePlace by New Anime        show_frog_good
       exit repeat
 end if  


--PutFloat2 ans31 into fld rightanswer



End Repeat 

reset34


     
    
 
End GameStart2






