SB_Fileset> Start>GBN684.sb< location="C:/Users/Abram/Desktop/Slayer" file1=location+"/slaycomplog.txt" file2=location+"/slayvariables.txt" file3=location+"/slaylog.txt" file4=location+"/slayresults.txt" Textwindow.ForegroundColor="White" If location="C:/Users/Name/Documents" then Textwindow.WriteLine("Please change first line of program to the location of your Documents") Textwindow.WriteLine("folder. Also make sure none of the 4 files used already exist,") Textwindow.WriteLine("so nothing is overwritten.") Textwindow.Pause() Program.End() endif ' The following line could be harmful and has been automatically commented. ' start = File.ReadLine(file2, 2) If start <>1 Then Textwindow.WriteLine("Preparing text document to store data...") ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file2,1,0) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file2,2,1) ' The following line could be harmful and has been automatically commented. ' start = File.ReadLine(file2, 2) If start <>1 then Textwindow.WriteLine(" ") Textwindow.WriteLine("Error: Location not found. Please check to make sure it is correct.") Textwindow.Pause() Program.End() else For n=1 To 322 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file3,n,0) EndFor ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file3,2,1) endif endif monster[1]= "Aberrant spectres" monster[2]= "Abyssal demons" monster[3]= "Aquanites" monster[4]= "Black demons" monster[5]= "Black dragons" monster[6]= "Bloodvelds" monster[7]= "Blue dragons" monster[8]= "Dagannoths" monster[9]= "Dark beasts" monster[10]= "Desert strykewyrms" monster[11]= "Dust devils" monster[12]= "Fire giants" monster[13]= "Gargoyles" monster[14]= "Greater demons monster[15]= "Hellhounds" monster[16]= "Ice strykewyrms" monster[17]= "Iron dragons" monster[18]= "Jungle strykewyrms" monster[19]= "Kalphites" monster[20]= "Living rock creatures" monster[21]= "Mithril dragons" monster[22]= "Nechryaels" monster[23]= "Skeletal wyverns" monster[24]= "Spiritual mages" monster[25]= "Steel dragons" monster[26]= "Suqahs" monster[27]= "Terror dogs" monster[28]= "TzHaar" monster[29]= "Warped tortoises" monster[30]= "Waterfiends" ' The following line could be harmful and has been automatically commented. ' tasks["total"]=File.ReadLine(file2, 1) For i = 1 To 30 ' The following line could be harmful and has been automatically commented. ' task[i]["tasks"]=File.ReadLine(file2, 10*i) ' The following line could be harmful and has been automatically commented. ' task[i]["number"]=File.ReadLine(file2, 10*i+1) ' The following line could be harmful and has been automatically commented. ' task[i]["effigy"]=File.ReadLine(file2, 10*i+2) ' The following line could be harmful and has been automatically commented. ' task[i]["gold"]=File.ReadLine(file2, 10*i+3) ' The following line could be harmful and has been automatically commented. ' task[i]["green"]=File.ReadLine(file2, 10*i+4 ) ' The following line could be harmful and has been automatically commented. ' task[i]["crimson"]=File.ReadLine(file2, 10*i+5) ' The following line could be harmful and has been automatically commented. ' task[i]["blue"]=File.ReadLine(file2, 10*i+6) ' The following line could be harmful and has been automatically commented. ' task[i]["numbercharmslogged"]=File.ReadLine(file2, 10*i+7) task[i]["numbercharmsloggedx"]=file.ReadLine(file2, 10*i+8) endfor ' The following line could be harmful and has been automatically commented. ' task[2]["whip"]=File.ReadLine(file2, 311) ' The following line could be harmful and has been automatically commented. ' task[17]["dleg"]=File.ReadLine(file2, 312) ' The following line could be harmful and has been automatically commented. ' task[11]["chain"]=File.ReadLine(file2, 313) ' The following line could be harmful and has been automatically commented. ' task[16]["sol"]=File.ReadLine(file2, 314) ' The following line could be harmful and has been automatically commented. ' task[9]["bow"]=File.ReadLine(file2, 315) ' The following line could be harmful and has been automatically commented. ' task[21]["dfull"]=File.ReadLine(file2, 321) ' The following line could be harmful and has been automatically commented. ' task[25]["dleg"]=File.readline(file2, 322) ' The following line could be harmful and has been automatically commented. ' task[5]["visage"]=File.ReadLine(file2, 316) ' The following line could be harmful and has been automatically commented. ' task[17]["visage"]=File.ReadLine(file2, 317) ' The following line could be harmful and has been automatically commented. ' task[21]["visage"]=File.ReadLine(file2, 318) ' The following line could be harmful and has been automatically commented. ' task[23]["visage"]=File.ReadLine(file2, 319) ' The following line could be harmful and has been automatically commented. ' task[25]["visage"]=File.ReadLine(file2, 320) task[1]["rate"]=700 task[2]["rate"]=240 task[3]["rate"]=250 task[4]["rate"]=300 task[5]["rate"]=180 task[6]["rate"]=424 task[7]["rate"]=300 task[8]["rate"]=1000 task[9]["rate"]=200 task[10]["rate"]=250 task[11]["rate"]=428 task[12]["rate"]=370 task[13]["rate"]=324 task[14]["rate"]=345 task[15]["rate"]=530 task[16]["rate"]=140 task[17]["rate"]=190 task[18]["rate"]=300 task[19]["rate"]=411 task[20]["rate"]=180 task[21]["rate"]=90 task[22]["rate"]=360 task[23]["rate"]=152 task[24]["rate"]=367 task[25]["rate"]=137 task[26]["rate"]=550 task[27]["rate"]=351 task[28]["rate"]=1.75 task[29]["rate"]=401 task[30]["rate"]=270 task[1]["xp"]= 90 task[2]["xp"]= 150 task[3]["xp"]= 125 task[4]["xp"]= 157 task[5]["xp"]= 199.4 task[6]["xp"]= 186 task[7]["xp"]= 107.6 task[8]["xp"]= 80 task[9]["xp"]= 225.4 task[10]["xp"]= 120 task[11]["xp"]= 105 task[12]["xp"]= 111 task[13]["xp"]= 105 task[14]["xp"]= 87 task[15]["xp"]= 116 task[16]["xp"]= 300 task[17]["xp"]= 173.2 task[18]["xp"]= 110 task[19]["xp"]= 88 task[20]["xp"]= 280 task[21]["xp"]= 273 task[22]["xp"]= 105 task[23]["xp"]= 210 task[24]["xp"]= 71 task[25]["xp"]= 220.4 task[26]["xp"]= 107.5 task[27]["xp"]= 84.5 task[28]["xp"]= 37000 task[29]["xp"]= 87 task[30]["xp"]= 128 optimize=0 onetaskdone=0 Textwindow.WriteLine("Enter last 5 digits of slayer xp.") currentxp=textwindow.read() beginning: repeat=0 k=0 goldx=0 greenx=0 crimsonx=0 bluex=0 specialx=0 visagex=0 skip=0 If optimize=0 then TextWindow.WriteLine("Enter task.") Textwindow.WriteLine("1 = aberrant spectres") TextWindow.WriteLine("2 = abyssal demons") TextWindow.WriteLine("3 = aquanites") Textwindow.Writeline("4 = black demons") TextWindow.WriteLine("5 = black dragons") TextWindow.WriteLine("6 = bloodvelds") Textwindow.Writeline("7 = blue dragons") TextWindow.WriteLine("8 = dagannoths") TextWindow.WriteLine("9 = dark beasts") Textwindow.Writeline("10 = desert strykewyrms") TextWindow.WriteLine("11 = dust devils") TextWindow.WriteLine("12 = fire giants") Textwindow.Writeline("13 = gargoyles") TextWindow.WriteLine("14 = greater demons") TextWindow.WriteLine("15 = hellhounds") Textwindow.Writeline("16 = ice strykewyrms") TextWindow.WriteLine("17 = iron dragons") TextWindow.WriteLine("18 = jungle strykewyrms") Textwindow.Writeline("19 = kalphites") TextWindow.WriteLine("20 = living rock creatures") TextWindow.WriteLine("21 = mithril dragons") Textwindow.Writeline("22 = nechryaels") TextWindow.WriteLine("23 = skeletal wyverns") TextWindow.WriteLine("24 = spiritual mages") Textwindow.Writeline("25 = steel dragons") TextWindow.WriteLine("26 = suqahs") TextWindow.WriteLine("27 = terror dogs") Textwindow.Writeline("28 = tzhaar") TextWindow.WriteLine("29 = warped tortoises") TextWindow.WriteLine("30 = waterfiends") Textwindow.Writeline("Enter 31 to save all your results.") else Textwindow.WriteLine("Enter task (1-30), or 31 for cumulative results.") endif input3: i = Textwindow.Read() input2=0 For input=1 to 31 If i=input Then input2=input2+1 EndIf endfor If input2<>1 then Textwindow.WriteLine("Error: Entry not recognized. Enter task number.") Goto input3 endif If i = 31 Then results() Goto beginning endif If optimize =1 then If i=7 Or i=11 or i=12 Or i=13 Or i=24 Or i=27 Or i=28 Or i=29 Then Goto zzz else Goto zzzz endif endif Textwindow.writeline("Skip? (y/n)") skip = Textwindow.read() If skip = "y" or skip = "Y" or skip = "yes" or skip = "Yes" then zzz: skip="yes" Textwindow.WriteLine("Cancelled "+monster[i]) task[i]["tasks"]=task[i]["tasks"]+1 tasks["total"]=tasks["total"]+1 ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 1, tasks["total"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 10*i, task[i]["tasks"]) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file1, 10*tasks["total"]-9, i) For x = 0 To 8 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file1, 10*tasks["total"]-8+x, 0) endfor logmaker() Goto beginning endif zzzz: If i=28 then Textwindow.WriteLine("Enter number assigned. Enter 1 if doing Fight Caves.") else Textwindow.WriteLine("Enter number assigned.") endif input4: numberassigned = Textwindow.Read() input2=0 For input=1 to 280 If numberassigned=input Then input2=input2+1 EndIf endfor If input2<>1 then Textwindow.WriteLine("Error: Entry not recognized. Enter # of monsters assigned.") Goto input4 endif Textwindow.WriteLine(numberassigned+" "+monster[i]) currentxp=currentxp+task[i]["xp"]*numberassigned If currentxp>99999 then currentxp=currentxp-100000 endif time=numberassigned/task[i]["rate"]*60 minutes = math.Round(time + Clock.Minute + 2.5) hour = Clock.hour a: If minutes>59 Then minutes = minutes -60 hour = hour + 1 If hour >23 Then hour = hour -24 EndIf Goto a EndIf If hour >12 Then hour = hour-12 elseif hour = 0 Then hour = hour +12 endif If minutes<10 then Textwindow.WriteLine("Estimated time of task completion: "+hour+":0"+minutes) Else Textwindow.WriteLine("Estimated time of task completion: "+hour+":"+minutes) EndIf timex=math.Round(time) timeseconds=math.round(60*Math.Abs(time-timex)) If timex>time Then timex=timex-1 endif Textwindow.WriteLine("Task is expected to take "+timex+" minutes, "+timeseconds+" seconds to complete") Textwindow.WriteLine("Expected slayer xp at task completion: "+currentxp) Textwindow.WriteLine("Press enter when starting task.") Textwindow.Read() time2["seconds"]=Clock.Second time2["minutes"]=clock.Minute+Clock.hour*60 If onetaskdone=0 then goto ee endif transitiontime["minutes"]=time2["minutes"]-time3["minutes"] transitiontime["seconds"]=time2["seconds"]-time3["seconds"] if transitiontime["minutes"]<0 then transitiontime["minutes"]=transitiontime["minutes"]+1440 endif if transitiontime["seconds"]<0 then transitiontime["seconds"]=transitiontime["seconds"]+60 transitiontime["minutes"]=transitiontime["minutes"]-1 endif ee: zminutes=0 zsec2=Clock.second zseconds=0 Timer.Resume() timer.Interval=987 Timer.Tick=tymer Sub tymer zsec1=Clock.Second If zsec159 Then zseconds=zseconds-60 zminutes=zminutes+1 endif If zsec1>59 Then zsec2=zsec1-60 Else zsec2=zsec1 endif If zseconds2<>zseconds then Textwindow.Clear() Textwindow.WriteLine(numberassigned+" "+monster[i]) If minutes<10 then Textwindow.WriteLine("Estimated time of task completion: "+hour+":0"+minutes) Else Textwindow.WriteLine("Estimated time of task completion: "+hour+":"+minutes) EndIf Textwindow.WriteLine("Expected slayer xp at task completion: "+currentxp) If onetaskdone=1 then Textwindow.WriteLine("Your transition time was "+transitiontime["minutes"]+" minutes, "+transitiontime["seconds"]+" seconds.") endif Textwindow.WriteLine(" ") Textwindow.WriteLine("Task is expected to take "+timex+" minutes, "+timeseconds+" seconds to complete") If zseconds<10 then Textwindow.WriteLine(zminutes+":0"+zseconds) Else Textwindow.WriteLine(zminutes+":"+zseconds) EndIf Textwindow.WriteLine("Press enter when finished with task.") zseconds2=zseconds endif endsub Textwindow.read() Timer.Pause() onetaskdone=1 time3["seconds"]=Clock.Second time3["minutes"]=clock.Minute+Clock.hour*60 transitiontime["minutes"]=time3["minutes"]-time2["minutes"] transitiontime["seconds"]=time3["seconds"]-time2["seconds"] if transitiontime["minutes"]<0 then transitiontime["minutes"]=transitiontime["minutes"]+1440 endif if transitiontime["seconds"]<0 then transitiontime["seconds"]=transitiontime["seconds"]+60 transitiontime["minutes"]=transitiontime["minutes"]-1 endif Textwindow.WriteLine("The task took "+transitiontime["minutes"]+" minutes, "+transitiontime["seconds"]+" seconds to complete.") tasktimehours=transitiontime["minutes"]/60+transitiontime["seconds"]/3600 taskratekills=math.Round(numberassigned/tasktimehours) taskratexp=math.Round(numberassigned*task[i]["xp"]/tasktimehours) textwindow.WriteLine("You did the task at a rate of "+taskratekills+ " kills ("+taskratexp+" slayer xp) per hour.") input6: Textwindow.WriteLine("# of ancient effigies received?") Sub input5 input2=0 For input7=0 to 250 If input7=input Then input2=input2+1 EndIf endfor If input2<>1 then Textwindow.WriteLine("Error: Entry not recognized. Enter # of items received.") input8=1 else input8=0 endif endsub effigyx=Textwindow.Read() input=effigyx input5() If input8=1 then Goto input6 endif aa: If i = 2 then Textwindow.WriteLine("# of abyssal whips received?") specialx=Textwindow.Read() elseif i = 16 then Textwindow.WriteLine("# of staffs of light received?") specialx=Textwindow.Read() elseif i = 9 then Textwindow.WriteLine("# of dark bows received?") specialx=Textwindow.Read() elseif i = 17 or i=25 then Textwindow.WriteLine("# of dragon platelegs received?") specialx=Textwindow.Read() elseif i = 21 then Textwindow.WriteLine("# of dragon full helms received?") specialx=textwindow.Read() elseif i = 11 then Textwindow.WriteLine("# of dragon chainbodies received?") specialx=Textwindow.Read() EndIf input=specialx input5() If input8=1 then Goto input6 endif If i = 5 or i=17 or i=21 or i=23 or i=25 then Textwindow.WriteLine("# of draconic visages received?") visagex=Textwindow.Read() input=visagex input5() If input8=1 then Goto input6 endif EndIf If optimize=1 then goldx=0 k=2 Goto zzzzz endif Textwindow.WriteLine("# of gold charms received? Enter x if all charms not recorded, or y if golds not picked up.") goldx=Textwindow.Read() If goldx="x" then goldx = 0 k=1 Goto c elseif goldx="y" then goldx=0 k=2 endif If k =0 then input=goldx input5() If input8=1 then Goto input6 endif endif zzzzz: Textwindow.WriteLine("# of green charms received?") greenx=Textwindow.Read() input=greenx input5() If input8=1 then Goto input6 endif Textwindow.WriteLine("# of crimson charms received?") crimsonx=Textwindow.Read() input=crimsonx input5() If input8=1 then Goto input6 endif Textwindow.WriteLine("# of blue charms received?") input=bluex bluex=textwindow.read() input5() If input8=1 then Goto input6 endif c: If optimize =1 then Goto zxzx endif Textwindow.Write("Press enter to continue onto next task, or input 1 to go back ") Textwindow.Write(" and enter this task again.") repeat=Textwindow.Read() If repeat = 1 then Goto beginning endif zxzx: task[i]["gold"]=task[i]["gold"]+goldx task[i]["green"]=task[i]["green"]+greenx task[i]["blue"]=task[i]["blue"]+bluex task[i]["crimson"]=task[i]["crimson"]+crimsonx If k = 0 then task[i]["numbercharmslogged"]=task[i]["numbercharmslogged"]+numberassigned elseif k=2 then task[i]["numbercharmsloggedx"]=task[i]["numbercharmsloggedx"]+numberassigned endif task[i]["whip"]=task[i]["whip"]+specialx task[i]["sol"]=task[i]["sol"]+specialx task[i]["bow"]=task[i]["bow"]+specialx task[i]["dfull"]=task[i]["dfull"]+specialx task[i]["dleg"]=task[i]["dleg"]+specialx task[i]["chain"]=task[i]["chain"]+specialx task[i]["visage"]=task[i]["visage"]+visagex task[i]["effigy"]=task[i]["effigy"]+effigyx task[i]["tasks"]=task[i]["tasks"]+1 tasks["total"]=tasks["total"]+1 task[i]["number"]=task[i]["number"]+numberassigned ' The following line could be harmful and has been automatically commented. ' File.writeLine(file2, 10*i, task[i]["tasks"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 10*i+1, task[i]["number"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 10*i+2, task[i]["effigy"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 10*i+3, task[i]["gold"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 10*i+4, task[i]["green"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 10*i+5, task[i]["crimson"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 10*i+6, task[i]["blue"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 10*i+7, task[i]["numbercharmslogged"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 10*i+8, task[i]["numbercharmsloggedx"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 311, task[2]["whip"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 312, task[17]["dleg"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 313, task[11]["chain"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 314, task[16]["sol"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 315, task[9]["bow"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 316, task[5]["visage"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 317, task[17]["visage"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 318, task[21]["visage"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 319, task[23]["visage"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 320, task[25]["visage"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 321, task[21]["dfull"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 322, task[25]["dleg"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file2, 1, tasks["total"]) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file1, 10*tasks["total"]-9, i) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file1, 10*tasks["total"]-8, numberassigned) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file1, 10*tasks["total"]-7, k) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file1, 10*tasks["total"]-6, goldx) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file1, 10*tasks["total"]-5, greenx) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file1, 10*tasks["total"]-4, crimsonx) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file1, 10*tasks["total"]-3, bluex) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file1, 10*tasks["total"]-2, effigyx) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file1, 10*tasks["total"]-1, specialx) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file1, 10*tasks["total"], visagex) logmaker() Goto beginning Sub logmaker timestamp=1 tasklog= "#"+tasks["total"]+". " If skip = "y" or skip="yes" Or skip = "Y" Or skip = "Yes" then tasklog=tasklog+"Cancelled" tasklog=tasklog+" "+monster[i] If timestamp = 1 then tasklog=tasklog+", entered at "+Clock.time+" on "+Clock.month+"/"+Clock.day+"/"+clock.year endif else tasklog=tasklog+numberassigned+" "+monster[i] If goldx<>0 or greenx<>0 or crimsonx<>0 or bluex<>0 or effigyx<>0 or specialx<>0 or visagex<>0 then tasklog=tasklog+": " endif If effigyx = 1 then tasklog=tasklog+effigyx+" effigy, " elseif effigyx>1 Then tasklog=tasklog+effigyx+" effigies, " endif If i = 2 then If specialx = 1 then tasklog=tasklog+specialx+" whip, " elseif specialx>1 Then tasklog=tasklog+specialx+" whips, " endif elseif i = 16 then If specialx = 1 then tasklog=tasklog+specialx+" staff of light, " elseif specialx>1 Then tasklog=tasklog+specialx+" staves of light, " endif elseif i = 9 then If specialx = 1 then tasklog=tasklog+specialx+" dark bow, " elseif specialx>1 Then tasklog=tasklog+specialx+" dark bows, " endif elseif i = 11 then If specialx = 1 then tasklog=tasklog+specialx+" dragon chainbody, " elseif specialx>1 Then tasklog=tasklog+specialx+" dragon chainbodies, " endif elseif i = 17 Or i = 25 then If specialx > 0 then tasklog=tasklog+specialx+" dragon platelegs, " endif elseif i = 21 then If specialx = 1 then tasklog=tasklog+specialx+" dragon full helm, " elseif specialx>1 Then tasklog=tasklog+specialx+" dragon full helms, " endif endif If i = 7 Or i = 17 Or i = 21 Or i = 23 Or i = 25 then If visagex = 1 then tasklog=tasklog+visagex+" draconic visage, " elseif visagex>1 Then tasklog=tasklog+visagex+" draconic visages, " endif endif If k = 0 then tasklog=tasklog+goldx+" gold, " endif If k=0 or k=2 then tasklog=tasklog+greenx+" green, "+crimsonx+" crimson, "+bluex+" blue" endif If timestamp = 1 then tasklog=tasklog+", entered at "+Clock.time+" on "+Clock.month+"/"+Clock.day+"/"+clock.year endif endif ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file3, tasks["total"], tasklog) endsub Sub results Textwindow.clear() file.DeleteFile(file4) Textwindow.WriteLine("Slayer data as of "+clock.Time+" on "+Clock.Month+"/"+Clock.day+"/"+Clock.year+":") file.WriteLine(file4, 999,"Slayer data as of "+clock.Time+" on "+Clock.Month+"/"+Clock.day+"/"+Clock.year+":") Textwindow.WriteLine("# of tasks completed or cancelled: "+tasks["total"]) file.WriteLine(file4, 999,"# of tasks completed or cancelled: "+tasks["total"]) Textwindow.WriteLine(" ") ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file4,999," ") kills[2]["whip"]=math.Round(task[2]["number"]/task[2]["whip"]) kills[9]["bow"]=math.Round(task[9]["number"]/task[9]["bow"]) kills[16]["sol"]=math.Round(task[16]["number"]/task[16]["sol"]) kills[17]["dleg"]=math.Round(task[17]["number"]/task[17]["dleg"]) kills[25]["dleg"]=math.Round(task[25]["number"]/task[25]["dleg"]) kills[21]["dfull"]=math.round(task[21]["number"]/task[21]["dfull"]) kills[11]["chain"]=math.Round(task[11]["number"]/task[11]["chain"]) For i = 1 To 30 If task[i]["number"]=0 Then percent[i]["gold"]="NA" percent[i]["green"]="NA" percent[i]["crimson"]="NA" percent[i]["blue"]="NA" kills[i]["whip"]="NA" kills[i]["bow"]="NA" kills[i]["chain"]="NA" kills[i]["effigy"]="NA" kills[i]["dleg"]="NA" kills[i]["visage"]="NA" kills[i]["chain"]="NA" else percent[i]["gold"]=math.round(100000*task[i]["gold"]/task[i]["numbercharmslogged" ])/1000 percent[i]["green"]=math.round(100000*task[i]["green"]/(task[i]["numbercharmslogged" ]+task[i]["numbercharmsloggedx"]))/1000 percent[i]["crimson"]=math.round(100000*task[i]["crimson"]/(task[i]["numbercharmslogged" ]+task[i]["numbercharmsloggedx"]))/1000 percent[i]["blue"]=math.round(100000*task[i]["blue"]/(task[i]["numbercharmslogged" ]+task[i]["numbercharmsloggedx"]))/1000 kills[i]["effigy"]=math.Round(task[i]["number"]/task[i]["effigy"]) If i = 5 Or i=17 Or i=21 Or i=23 Or i=25 then kills[i]["visage"]=math.Round(task[i]["number"]/task[i]["visage"]) endif task[i]["slayerxprate"]=100*math.Round(task[i]["xp"]*task[i]["rate"]/100) task[i]["sumslay"]=math.round(10*(87*percent[i]["gold"]+154.4*percent[i]["green" ]+435.2*percent[i]["crimson"]+783.2*percent[i]["blue"])/task[i]["xp"])/1000 task[i]["sumslayx"]=math.round(10*(154.4*percent[i]["green"]+435.2*percent[i][" crimson"]+783.2*percent[i]["blue"])/task[i]["xp"])/1000 task[i]["sumslayxx"]=math.round(10*(435.2*percent[i]["crimson"]+783.2*percent[i][" blue"])/task[i]["xp"])/1000 task[i]["charmsperhour"]=(1/100)*(percent[i]["gold"]+percent[i]["green" ]+percent[i]["crimson"]+percent[i]["blue"])*task[i]["rate"] task[i]["timetousecharmsperhour"]=task[i]["charmsperhour"]*(3600/3000) task[i]["timecorrected"]=3600/(3600+task[i]["timetousecharmsperhour"]) task[i]["sumxphour"]=100*math.Round(task[i]["slayerxprate"]*task[i]["sumslay" ]*task[i]["timecorrected"]/100) task[i]["sumxphourx"]=100*math.Round(task[i]["slayerxprate"]*task[i]["sumslayx" ]*task[i]["timecorrected"]/100) endif Textwindow.WriteLine("Task "+i+" ("+monster[i]+")") file.WriteLine(file4, 999,"Task "+i+" ("+monster[i]+")") Textwindow.WriteLine("# of times assigned: "+task[i]["tasks"]) file.WriteLine(file4, 999,"# of times assigned: "+task[i]["tasks"]) Textwindow.WriteLine("# of kills: "+task[i]["number"]) file.WriteLine(file4, 999,"# of kills: "+task[i]["number"]) Textwindow.WriteLine("# of kills with all charms logged: "+task[i]["numbercharmslogged"]) file.WriteLine(file4, 999,"# of kills with logged charms: "+task[i]["numbercharmslogged"]) Textwindow.WriteLine("# of kills with golds not picked up: "+task[i]["numbercharmsloggedx"]) file.WriteLine(file4, 999,"# of kills with golds not picked up: "+task[i]["numbercharmsloggedx"]) Textwindow.writeline("Slayer xp per hour: "+task[i]["slayerxprate"]) file.WriteLine(file4, 999,"Slayer xp per hour: "+task[i]["slayerxprate"]) Textwindow.Write("Gold: "+percent[i]["gold"]+"%") file.WriteLine(file4, 999,"Gold: "+percent[i]["gold"]+"%") Textwindow.Writeline(" Green: "+percent[i]["green"]+"%") file.WriteLine(file4, 999,"Green: "+percent[i]["green"]+"%") Textwindow.Write("Crimson: "+percent[i]["crimson"]+"%") file.WriteLine(file4, 999,"Crimson: "+percent[i]["crimson"]+"%") Textwindow.Writeline(" Blue: "+percent[i]["blue"]+"%") file.WriteLine(file4, 999,"Blue: "+percent[i]["blue"]+"%") Textwindow.WriteLine("Ratio of summoning to slayer xp (all charms used): "+task[i]["sumslay"]) file.WriteLine(file4, 999,"Ratio of summoning to slayer xp (all charms used): "+task[i]["sumslay"]) Textwindow.WriteLine("Ratio of summoning to slayer xp (golds not used): "+task[i]["sumslayx"]) file.WriteLine(file4, 999,"Ratio of summoning to slayer xp (golds not used): "+task[i]["sumslayx"]) Textwindow.WriteLine("Ratio of summoning to slayer xp (golds and greens not used): "+task[i]["sumslayxx"]) file.WriteLine(file4, 999,"Ratio of summoning to slayer xp (golds and greens not used): "+task[i]["sumslayxx"]) Textwindow.writeline("Summoning xp per hour (all charms used): "+task[i]["sumxphour"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file4, 999, "Summoning xp per hour (all charms used): "+task[i]["sumxphour"]) Textwindow.writeline("Summoning xp per hour (golds not used): "+task[i]["sumxphourx"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file4, 999, "Summoning xp per hour (golds not used): "+task[i]["sumxphourx"]) Textwindow.WriteLine("Kills per ancient effigy: "+kills[i]["effigy"]) file.WriteLine(file4, 999,"Kills per ancient effigy: "+kills[i]["effigy"]) if i = 2 then Textwindow.WriteLine("Kills per abyssal whip: "+kills[i]["whip"]) file.WriteLine(file4, 999,"Kills per abyssal whip: "+kills[i]["whip"]) elseif i = 21 then Textwindow.WriteLine("Kills per dragon full helm: "+kills[i]["dfull"]) file.WriteLine(file4, 999,"Kills per dragon full helm: "+kills[i]["dfull"]) elseif i = 9 then Textwindow.WriteLine("Kills per dark bow: "+kills[i]["bow"]) file.WriteLine(file4, 999,"Kills per dark bow: "+kills[i]["bow"]) elseif i = 16 then Textwindow.WriteLine("Kills per staff of light: "+kills[i]["sol"]) file.WriteLine(file4, 999,"Kills per staff of light: "+kills[i]["sol"]) elseif i = 17 Or i=25 then Textwindow.WriteLine("Kills per dragon platelegs: "+kills[i]["dleg"]) file.WriteLine(file4, 999,"Kills per dragon platelegs: "+kills[i]["dleg"]) elseif i = 11 then Textwindow.WriteLine("Kills per dragon chainbody: "+kills[i]["chain"]) file.WriteLine(file4, 999,"Kills per dragon chainbody: "+kills[i]["chain"]) endif If i = 5 Or i=17 Or i=21 Or i=23 Or i=25 then Textwindow.WriteLine("Kills per draconic visage: "+kills[i]["visage"]) file.WriteLine(file4, 999,"Kills per draconic visage: "+kills[i]["visage"]) endif Textwindow.WriteLine(" ") ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file4, 999," ") If i = 15 Then Textwindow.pause() endif endfor Textwindow.pause() effigytotal=0 Textwindow.WriteLine("Effigy Data:") ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file4, 999,"Effigy data:") For i = 1 To 30 If task[i]["number"]=0 Then Goto dd endif Textwindow.WriteLine(monster[i]+": "+task[i]["effigy"]+" in "+task[i]["number"]+" kills (1 per "+kills[i]["effigy"]+" kills)") file.WriteLine(file4, 999, monster[i]+": "+task[i]["effigy"]+" effigy in "+task[i]["number"]+" kills (1 per "+kills[i]["effigy"]+" kills)") effigytotal=effigytotal+task[i]["effigy"] dd: EndFor Textwindow.WriteLine("Total effigies received: "+effigytotal) file.WriteLine(file4, 999, "Total effigies received: "+effigytotal) totalslayxp=0 totalsumxp=0 totalsumxpx=0 realtotalslayxp=0 totaltime=0 realtotalsumxp=0 realtotalsumxpx=0 For o=1 To tasks["total"] ' The following line could be harmful and has been automatically commented. ' i = File.ReadLine(file1, 10*o-9) ' The following line could be harmful and has been automatically commented. ' numberassigned=File.ReadLine(file1, 10*o-8) ' The following line could be harmful and has been automatically commented. ' k=File.ReadLine(file1, 10*o-7) If k <> 1 then ' The following line could be harmful and has been automatically commented. ' gold=File.ReadLine(file1, 10*o-6) ' The following line could be harmful and has been automatically commented. ' green=File.ReadLine(file1, 10*o-5) ' The following line could be harmful and has been automatically commented. ' crimson=File.ReadLine(file1, 10*o-4) ' The following line could be harmful and has been automatically commented. ' blue=File.ReadLine(file1, 10*o-3) totalslayxp=totalslayxp+numberassigned*task[i]["xp"] totalsumxp=totalsumxp+87*gold+154.4*green+435.2*crimson+783.2*blue totalsumxpx=totalsumxpx+154.4*green+435.2*crimson+783.2*blue realtotalsumxp=realtotalsumxp+87*gold+154.4*green+435.2*crimson+783.2*blue realtotalsumxpx=realtotalsumxpx+154.4*green+435.2*crimson+783.2*blue endif If k=1 Then realtotalsumxp=realtotalsumxp+numberassigned*task[i]["xp"]*task[i]["sumslay"] realtotalsumxpx=realtotalsumxpx+numberassigned*task[i]["xp"]*task[i]["sumslayx"] endif realtotalslayxp=realtotalslayxp+ numberassigned*task[i]["xp"] timezz=numberassigned/task[i]["rate"] totaltime=totaltime+timezz If timezz<>0 Then totaltime=totaltime+3/60 endif endfor averageslayxprate=math.Round(realtotalslayxp/(totaltime*100))*100 totalslayxp=Math.Round(totalslayxp/1000) realtotalslayxp=Math.Round(realtotalslayxp/1000) totalsumxp=Math.Round(totalsumxp/1000) totalsumxpx=Math.Round(totalsumxpx/1000) realtotalsumxp=Math.Round(realtotalsumxp/1000) realtotalsumxpx=Math.Round(realtotalsumxpx/1000) Textwindow.WriteLine(" ") ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file4, 999, " ") Textwindow.WriteLine("Hourly slayer xp rates adjusted for effigies: ") ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file4, 999, "Hourly slayer xp rates adjusted for effigies: ") For i=1 To 30 task[i]["adjrate"]=task[i]["rate"]*task[i]["xp"]*60/(60-96*task[i][" rate"]/kills[i]["effigy"]) task[i]["adjrate"]=Math.Round(task[i]["adjrate"]/100)*100 If task[i]["adjrate"]<0 Then task[i]["adjrate"]="Infinity" EndIf Textwindow.WriteLine("Task "+i+" ("+monster[i]+"): "+task[i]["adjrate"]+" ("+task[i]["effigy"]+" effigies logged)") ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file4, 999, "Task "+i+" ("+monster[i]+"): "+task[i]["adjrate"]+" ("+task[i]["effigy"]+" effigies logged)") endfor Textwindow.WriteLine(" ") file.WriteLine(file4, 999, " ") Textwindow.WriteLine("Total slayer xp with logged charms: "+totalslayxp+"k") file.WriteLine(file4, 999, "Total slayer xp with logged charms: "+totalslayxp+"k") Textwindow.WriteLine("Total summoning xp (all charms, logged only): "+totalsumxp+"k") file.WriteLine(file4, 999, "Total summoning xp (all charms, logged only): "+totalsumxp+"k") Textwindow.WriteLine("Total summoning xp (no golds, logged only): "+totalsumxpx+"k") file.WriteLine(file4, 999, "Total summoning xp (no golds, logged only): "+totalsumxpx+"k") Textwindow.WriteLine("Estimated total summoning xp (all charms): "+realtotalsumxp+"k") file.WriteLine(file4, 999, "Estimated total summoning xp (all charms): "+realtotalsumxp+"k") Textwindow.WriteLine("Estimated total summoning xp (no golds): "+realtotalsumxpx+"k") file.WriteLine(file4, 999, "Estimated total summoning xp (no golds): "+realtotalsumxpx+"k") Textwindow.WriteLine("Actual total slayer xp: "+realtotalslayxp+"k") file.WriteLine(file4, 999, "Actual total slayer xp: "+realtotalslayxp+"k") Textwindow.WriteLine("Estimated average slayer xp/hour: "+averageslayxprate) file.WriteLine(file4, 999, "Estimated average slayer xp/hour: "+averageslayxprate) Textwindow.WriteLine(" ") Textwindow.WriteLine("Enter 2 for correction sub or enter to go back to start") a=textwindow.Read() If a=2 then correction() endif Textwindow.Pause() Textwindow.Clear() endsub Sub correction file7=location+"/slayvariables2.txt" For n = 1 To 322 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file7, n, 0) EndFor task[2]["whip"]=0 task[17]["dleg"]=0 task[25]["dleg"]=0 task[11]["chain"]=0 task[16]["sol"]=0 task[9]["bow"]=0 task[21]["dfull"]=0 task[5]["visage"]=0 task[17]["visage"]=0 task[21]["visage"]=0 task[23]["visage"]=0 task[25]["visage"]=0 tasks["total"]=0 For i = 1 To 30 task[i]["tasks"]=0 task[i]["number"]=0 task[i]["effigy"]=0 task[i]["gold"]=0 task[i]["green"]=0 task[i]["crimson"]=0 task[i]["blue"]=0 task[i]["tasks"]=0 task[i]["numbercharmslogged"]=0 task[i]["numbercharmsloggedx"]=0 endfor e=file.ReadLine(file2,1) For x= 1 To e ' The following line could be harmful and has been automatically commented. ' i=File.ReadLine(file1, 10*x-9) ' The following line could be harmful and has been automatically commented. ' numberassigned=File.ReadLine(file1, 10*x-8) ' The following line could be harmful and has been automatically commented. ' k=File.ReadLine(file1, 10*x-7) ' The following line could be harmful and has been automatically commented. ' goldx=File.ReadLine(file1, 10*x-6) ' The following line could be harmful and has been automatically commented. ' greenx=File.ReadLine(file1, 10*x-5) ' The following line could be harmful and has been automatically commented. ' crimsonx=File.ReadLine(file1, 10*x-4) ' The following line could be harmful and has been automatically commented. ' bluex=File.ReadLine(file1, 10*x-3) ' The following line could be harmful and has been automatically commented. ' effigyx=File.ReadLine(file1, 10*x-2) ' The following line could be harmful and has been automatically commented. ' specialx=File.ReadLine(file1, 10*x-1) ' The following line could be harmful and has been automatically commented. ' visagex=File.ReadLine(file1, 10*x-0) task[i]["tasks"]=task[i]["tasks"]+1 If numberassigned=0 Then Goto cc endif task[i]["effigy"]=task[i]["effigy"]+effigyx task[i]["number"]=task[i]["number"]+numberassigned If i = 11 Then task[11]["chain"]=task[11]["chain"]+specialx endif If i = 2 Then task[2]["whip"]=task[2]["whip"]+specialx endif If i = 17 Or i = 25 Then task[i]["dleg"]=task[i]["dleg"]+specialx endif If i = 9 Then task[9]["bow"]=task[9]["bow"]+specialx endif If i = 21 Then task[21]["dfull"]=task[21]["dfull"]+specialx endif If i = 16 Then task[16]["sol"]=task[16]["sol"]+specialx endif If i = 7 Or i = 17 Or i = 23 Or i = 21 Or i = 25 Then task[i]["visage"]=task[i]["visage"]+visagex endif If k = 0 Then task[i]["gold"]=task[i]["gold"]+goldx task[i]["green"]=task[i]["green"]+greenx task[i]["crimson"]=task[i]["crimson"]+crimsonx task[i]["blue"]=task[i]["blue"]+bluex task[i]["numbercharmslogged"]=task[i]["numbercharmslogged"]+numberassigned endif if k=2 then task[i]["gold"]=task[i]["gold"]+goldx task[i]["green"]=task[i]["green"]+greenx task[i]["crimson"]=task[i]["crimson"]+crimsonx task[i]["blue"]=task[i]["blue"]+bluex task[i]["numbercharmsloggedx"]=task[i]["numbercharmsloggedx"]+numberassigned endif cc: endfor For i = 1 to 30 ' The following line could be harmful and has been automatically commented. ' File.writeLine(file7, 10*i, task[i]["tasks"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file7, 10*i+1, task[i]["number"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file7, 10*i+2, task[i]["effigy"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file7, 10*i+3, task[i]["gold"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file7, 10*i+4, task[i]["green"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file7, 10*i+5, task[i]["crimson"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file7, 10*i+6, task[i]["blue"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file7, 10*i+7, task[i]["numbercharmslogged"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file7, 10*i+8, task[i]["numbercharmsloggedx"]) tasks["total"]=task[i]["tasks"]+tasks["total"] endfor ' The following line could be harmful and has been automatically commented. ' File.writeline(file7, 311, task[2]["whip"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file7, 312, task[17]["dleg"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file7, 313, task[11]["chain"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file7, 314, task[16]["sol"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file7, 315, task[9]["bow"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file7, 316, task[5]["visage"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file7, 317, task[17]["visage"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file7, 318, task[21]["visage"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file7, 319, task[23]["visage"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file7, 320, task[25]["visage"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file7, 321, task[21]["dfull"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file7, 322, task[25]["dleg"]) ' The following line could be harmful and has been automatically commented. ' File.writeline(file7, 1, tasks["total"]) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(file7,2,1) j=0 f=file.ReadLine(file2,3) file.WriteLine(file7,3,f) For n=1 to 322 a=file.ReadLine(file2,n) b=file.ReadLine(file7,n) c=a-b If c<>0 Then Textwindow.WriteLine(c+","+n) j=1 EndIf endfor If j=1 then Textwindow.WriteLine("Comp log and variables are inconsistent.") Textwindow.WriteLine("Replace old slayvariables.txt with new one? yes/no") d=textwindow.read() If d = "yes" then ' The following line could be harmful and has been automatically commented. ' File.CopyFile(file7,file2) ' The following line could be harmful and has been automatically commented. ' File.DeleteFile(file7) Textwindow.WriteLine("File copied.") endif else Textwindow.WriteLine("Comp log and variables are consistent.") endif endsub End>GBN684.sb< Start>GBN831.sb< 'Author: Jamie Randle' 'Cookie Clicker in Small Basic' '================================================' 'TO DO LIST' '================================================' 'Add upgrades which change cookies per click and CpS' '================================================' 'NEXT' 'Button where you can sell buildings next to buy buttons OR insert images for the cookie and possibly the buildings' 'Sets up the graphics window' Sub GraphicsWindowSetup GraphicsWindow.Title = "Click the button" GraphicsWindow.CanResize = "True" GraphicsWindow.Height = 780 GraphicsWindow.Width = 1360 EndSub 'Sets up the cookie' Sub CookieSetup Cookie = Controls.AddButton("Click Me", 555, 225) Controls.SetSize(Cookie, 250, 250) EndSub 'Sets up the images' 'Sub ImageSetup ' CookieImage = ImageList.LoadImage("C:\Users\Jammy\Desktop\Small Basic Programs\Cookie Clicker\Images\Cookie.jpg") ' GraphicsWindow.DrawImage(CookieImage, 555, 255) 'EndSub 'Sets up the scoring' Sub ScoreSetup ScoreText = Controls.AddTextBox(10,10) Score = 0 Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetSize(ScoreText, 250, 25) EndSub 'Sets up the CpS' Sub CpSSetup CpSText = Controls.AddTextBox(10,40) CpS = 0 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetSize(CpSText, 250, 25) EndSub 'Sets up the CpS timer Sub CpSTimerSetup Timer.Interval = 1000 'One tick per second' Timer.Tick = CpSTimerTick EndSub 'Makes the timer do something every time it ticks' Sub CpSTimerTick Score = Score + CpS Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) EndSub 'Displays the amount of cursors the player has' Sub CursorNumberSetup CursorNumberText = Controls.AddTextBox(10,70) Controls.SetTextBoxText(CursorNumberText, "Number of cursors = " + CursorNumber) Controls.SetSize(CursorNumberText, 250, 25) EndSub 'Displays the amount of grandmas the player has' Sub GrandmaNumberSetup GrandmaNumberText = Controls.AddTextBox(10,100) Controls.SetTextBoxText(GrandmaNumberText, "Number of grandmas = " + GrandmaNumber) Controls.SetSize(GrandmaNumberText, 250, 25) EndSub 'Displays the amount of farms the player has' Sub FarmNumberSetup FarmNumberText = Controls.AddTextBox(10,130) Controls.SetTextBoxText(FarmNumberText, "Number of farms = " + FarmNumber) Controls.SetSize(FarmNumberText, 250, 25) EndSub 'Displays the amount of factories the player has' Sub FactoryNumberSetup FactoryNumberText = Controls.AddTextBox(10,160) Controls.SetTextBoxText(FactoryNumberText, "Number of factories = " + FactoryNumber) Controls.SetSize(FactoryNumberText, 250, 25) EndSub 'Displays the amount of mines the player has' Sub MineNumberSetup MineNumberText = Controls.AddTextBox(10,190) Controls.SetTextBoxText(MineNumberText, "Number of mines = " + MineNumber) Controls.SetSize(MineNumberText, 250, 25) EndSub 'Displays the amount of shipments the player has' Sub ShipmentNumberSetup ShipmentNumberText = Controls.AddTextBox(10,220) Controls.SetTextBoxText(ShipmentNumberText, "Number of shipments = " + ShipmentNumber) Controls.SetSize(ShipmentNumberText, 250, 25) EndSub 'Displays the amount of alchemy labs the player has' Sub AlchemyLabNumberSetup AlchemyLabNumberText = Controls.AddTextBox(10,250) Controls.SetTextBoxText(AlchemyLabNumberText, "Number of alchemy labs = " + AlchemyLabNumber) Controls.SetSize(AlchemyLabNumberText, 250, 25) EndSub 'Displays the amount of portals the player has' Sub PortalNumberSetup PortalNumberText = Controls.AddTextBox(10,280) Controls.SetTextBoxText(PortalNumberText, "Number of portals = " + PortalNumber) Controls.SetSize(PortalNumberText, 250, 25) EndSub 'Displays the amount of time machines the player has' Sub TimeMachineNumberSetup TimeMachineNumberText = Controls.AddTextBox(10,310) Controls.SetTextBoxText(TimeMachineNumberText, "Number of time machines = " + TimeMachineNumber) Controls.SetSize(TimeMachineNumberText, 250, 25) EndSub 'Displays the amount of antimatter condensers the player has' Sub AntimatterCondenserNumberSetup AntimatterCondenserNumberText = Controls.AddTextBox(10,340) Controls.SetTextBoxText(AntimatterCondenserNumberText, "Number of antimatter condensers = " + AntimatterCondenserNumber) Controls.SetSize(AntimatterCondenserNumberText, 250, 25) EndSub 'Displays the amount of prisms the player has' Sub PrismNumberSetup PrismNumberText = Controls.AddTextBox(10,370) Controls.SetTextBoxText(PrismNumberText, "Number of prisms = " + PrismNumber) Controls.SetSize(PrismNumberText, 250, 25) EndSub 'Sets up the cursors' Sub CursorSetup BuyCursor = Controls.AddButton("Buy a cursor", 1150, 10) Controls.SetSize(BuyCursor, 200, 35) CursorPrice = 15 CursorNumber = 0 EndSub 'Sets up the grandmas' Sub GrandmaSetup BuyGrandma = Controls.AddButton("Buy a grandma", 1150, 50) Controls.SetSize(BuyGrandma, 200, 35) GrandmaPrice = 100 GrandmaNumber = 0 EndSub 'Sets up the farms' Sub FarmSetup BuyFarm = Controls.AddButton("Buy a Farm", 1150, 90) Controls.SetSize(BuyFarm, 200, 35) FarmPrice = 500 FarmNumber = 0 EndSub 'Sets up the factories' Sub FactorySetup BuyFactory = Controls.AddButton("Buy a Factory", 1150, 130) Controls.SetSize(BuyFactory, 200, 35) FactoryPrice = 3000 FactoryNumber = 0 EndSub 'Sets up the mines' Sub MineSetup BuyMine = Controls.AddButton("Buy a Mine", 1150, 170) Controls.SetSize(BuyMine, 200, 35) MinePrice = 10000 MineNumber = 0 EndSub 'Sets up the shipments' Sub ShipmentSetup BuyShipment = Controls.AddButton("Buy a Shipment", 1150, 210) Controls.SetSize(BuyShipment, 200, 35) ShipmentPrice = 40000 ShipmentNumber = 0 EndSub 'Sets up the alchemy labs' Sub AlchemyLabSetup BuyAlchemyLab = Controls.AddButton("Buy an Alchemy Lab", 1150, 250) Controls.SetSize(BuyAlchemyLab, 200, 35) AlchemyLabPrice = 200000 AlchemyLabNumber = 0 EndSub 'Sets up the portals' Sub PortalSetup BuyPortal = Controls.AddButton("Buy a Portal", 1150, 290) Controls.SetSize(BuyPortal, 200, 35) PortalPrice = 1677000 PortalNumber = 0 EndSub 'Sets up the time machines' Sub TimeMachineSetup BuyTimeMachine = Controls.AddButton("Buy a Time Machine", 1150, 330) Controls.SetSize(BuyTimeMachine, 200, 35) TimeMachinePrice = 123456789 TimeMachineNumber = 0 EndSub 'Sets up the antimatter condensers' Sub AntimatterCondenserSetup BuyAntimatterCondenser = Controls.AddButton("Buy an Antimatter Condenser", 1150, 370) Controls.SetSize(BuyAntimatterCondenser, 200, 35) AntimatterCondenserPrice = 4000000000 AntimatterCondenserNumber = 0 EndSub 'Sets up the prisms' Sub PrismSetup BuyPrism = Controls.AddButton("Buy a Prism", 1150, 410) Controls.SetSize(BuyPrism, 200, 35) PrismPrice = 75000000000 PrismNumber = 0 EndSub 'Does effects of the button the user clicked on' Sub ButtonClicked LastButton = Controls.LastClickedButton If LastButton = Cookie Then 'Scores for clicking the cookie' Score = Score + 1 Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) ElseIf LastButton = BuyCursor Then 'Buys a cursor' If Score > CursorPrice Then Score = Score - CursorPrice CpS = CpS + 0.1 CursorPrice = CursorPrice + 5 CursorNumber = CursorNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(CursorNumberText, "Number of cursors = " + CursorNumber) ElseIf Score = CursorPrice Then Score = Score - CursorPrice CpS = CpS + 0.1 CursorPrice = CursorPrice + 5 CursorNumber = CursorNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(CursorNumberText, "Number of cursors = " + CursorNumber) Else GraphicsWindow.ShowMessage("You don't have enough cookies! A cursor costs " + CursorPrice, "Not enough cookies!") EndIf ElseIf LastButton = BuyGrandma Then 'Buys a grandma' If Score > GrandmaPrice Then Score = Score - GrandmaPrice CpS = CpS + 0.5 GrandmaPrice = GrandmaPrice + 15 GrandmaNumber = GrandmaNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(GrandmaNumberText, "Number of grandmas = " + GrandmaNumber) ElseIf Score = GrandmaPrice Then Score = Score - GrandmaPrice CpS = CpS + 0.5 GrandmaPrice = GrandmaPrice + 15 GrandmaNumber = GrandmaNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(GrandmaNumberText, "Number of grandmas = " + GrandmaNumber) Else GraphicsWindow.ShowMessage("You don't have enough cookies! A grandma costs " + GrandmaPrice, "Not enough cookies!") EndIf ElseIf LastButton = BuyFarm Then 'Buys a farm' If Score > FarmPrice Then Score = Score - FarmPrice CpS = CpS + 4 FarmPrice = FarmPrice + 80 FarmNumber = FarmNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(FarmNumberText, "Number of farms = " + FarmNumber) ElseIf Score = FarmPrice Then Score = Score - FarmPrice CpS = CpS + 4 FarmPrice = FarmPrice + 80 FarmNumber = FarmNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(FarmNumberText, "Number of farms = " + FarmNumber) Else GraphicsWindow.ShowMessage("You don't have enough cookies! A farm costs " + FarmPrice, "Not enough cookies!") EndIf ElseIf LastButton = BuyFactory Then 'Buys a factory' If Score > FactoryPrice Then Score = Score - FactoryPrice CpS = CpS + 10 FactoryPrice = FactoryPrice + 450 FactoryNumber = FactoryNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(FactoryNumberText, "Number of factories = " + FactoryNumber) ElseIf Score = FactoryPrice Then Score = Score - FactoryPrice CpS = CpS + 10 FactoryPrice = FactoryPrice + 450 FactoryNumber = FactoryNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(FactoryNumberText, "Number of factories = " + FactoryNumber) Else GraphicsWindow.ShowMessage("You don't have enough cookies! A factory costs " + FactoryPrice, "Not enough cookies!") EndIf ElseIf LastButton = BuyMine Then 'Buys a mine' If Score > MinePrice Then Score = Score - MinePrice CpS = CpS + 40 MinePrice = MinePrice + 1500 MineNumber = MineNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(MineNumberText, "Number of mines = " + MineNumber) ElseIf Score = MinePrice Then Score = Score - MinePrice CpS = CpS + 40 MinePrice = MinePrice + 1500 MineNumber = MineNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(MineNumberText, "Number of mines = " + MineNumber) Else GraphicsWindow.ShowMessage("You don't have enough cookies! A mine costs " + MinePrice, "Not enough cookies!") EndIf ElseIf LastButton = BuyShipment Then 'Buys a shipment' If Score > ShipmentPrice Then Score = Score - ShipmentPrice CpS = CpS + 100 ShipmentPrice = ShipmentPrice + 6000 ShipmentNumber = ShipmentNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(ShipmentNumberText, "Number of shipments = " + ShipmentNumber) ElseIf Score = ShipmentPrice Then Score = Score - ShipmentPrice CpS = CpS + 100 ShipmentPrice = ShipmentPrice + 6000 ShipmentNumber = ShipmentNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(ShipmentNumberText, "Number of shipments = " + ShipmentNumber) Else GraphicsWindow.ShowMessage("You don't have enough cookies! A shipment costs " + ShipmentPrice, "Not enough cookies!") EndIf ElseIf LastButton = BuyAlchemyLab Then 'Buys an alchemy lab' If Score > AlchemyLabPrice Then Score = Score - AlchemyLabPrice CpS = CpS + 400 AlchemyLabPrice = AlchemyLabPrice + 30000 AlchemyLabNumber = AlchemyLabNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(AlchemyLabNumberText, "Number of alchemy labs = " + AlchemyLabNumber) ElseIf Score = AlchemyLabPrice Then Score = Score - AlchemyLabPrice CpS = CpS + 400 AlchemyLabPrice = AlchemyLabPrice + 30000 AlchemyLabNumber = AlchemyLabNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(AlchemyLabNumberText, "Number of alchemy labs = " + AlchemyLabNumber) Else GraphicsWindow.ShowMessage("You don't have enough cookies! An alchemy lab costs " + AlchemyLabPrice, "Not enough cookies!") EndIf ElseIf LastButton = BuyPortal Then 'Buys a portal' If Score > PortalPrice Then Score = Score - PortalPrice CpS = CpS + 6666 PortalPrice = PortalPrice + 250000 PortalNumber = PortalNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(PortalNumberText, "Number of portals = " + PortalNumber) ElseIf Score = PortalPrice Then Score = Score - PortalPrice CpS = CpS + 6666 PortalPrice = PortalPrice + 250000 PortalNumber = PortalNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(PortalNumberText, "Number of portals = " + PortalNumber) Else GraphicsWindow.ShowMessage("You don't have enough cookies! A portal costs " + PortalPrice, "Not enough cookies!") EndIf ElseIf LastButton = BuyTimeMachine Then 'Buys a time machine' If Score > TimeMachinePrice Then Score = Score - TimeMachinePrice CpS = CpS + 98765 TimeMachinePrice = TimeMachinePrice + 18518000 TimeMachineNumber = TimeMachineNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(TimeMachineNumberText, "Number of time machines = " + TimeMachineNumber) ElseIf Score = TimeMachinePrice Then Score = Score - TimeMachinePrice CpS = CpS + 98765 TimeMachinePrice = TimeMachinePrice + 18518000 TimeMachineNumber = TimeMachineNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(TimeMachineNumberText, "Number of time machines = " + TimeMachineNumber) Else GraphicsWindow.ShowMessage("You don't have enough cookies! A time machine costs " + TimeMachinePrice, "Not enough cookies!") EndIf ElseIf LastButton = BuyAntimatterCondenser Then 'Buys an antimatter condenser' If Score > AntimatterCondenserPrice Then Score = Score - AntimatterCondenserPrice CpS = CpS + 999999 AntimatterCondenserPrice = AntimatterCondenserPrice + 600000000 AntimatterCondenserNumber = AntimatterCondenserNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(AntimatterCondenserNumberText, "Number of antimatter condensers = " + AntimatterCondenserNumber) ElseIf Score = AntimatterCondenserPrice Then Score = Score - AntimatterCondenserPrice CpS = CpS + 999999 AntimatterCondenserPrice = AntimatterCondenserPrice + 600000000 AntimatterCondenserNumber = AntimatterCondenserNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(AntimatterCondenserNumberText, "Number of antimatter condensers = " + AntimatterCondenserNumber) Else GraphicsWindow.ShowMessage("You don't have enough cookies! An antimatter condenser costs " + AntimatterCondenserPrice, "Not enough cookies!") EndIf ElseIf LastButton = BuyPrism Then 'Buys a prism' If Score > PrismPrice Then Score = Score - PrismPrice CpS = CpS + 10000000 PrismPrice = PrismPrice + 11250000000 PrismNumber = PrismNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(PrismNumberText, "Number of prisms = " + PrismNumber) ElseIf Score = PrismPrice Then Score = Score - PrismPrice CpS = CpS + 10000000 PrismPrice = PrismPrice + 11250000000 PrismNumber = PrismNumber + 1 Controls.SetTextBoxText(CpSText, "CpS = " + CpS) Controls.SetTextBoxText(ScoreText, "Cookies = " + Score) Controls.SetTextBoxText(PrismNumberText, "Number of prisms = " + PrismNumber) Else GraphicsWindow.ShowMessage("You don't have enough cookies! A prism costs " + PrismPrice, "Not enough cookies!") EndIf EndIf EndSub 'Calls all of the setup subs' GraphicsWindowSetup() CookieSetup() 'ImageSetup() ScoreSetup() CpSSetup() CpSTimerSetup() CursorNumberSetup() GrandmaNumberSetup() FarmNumberSetup() FactoryNumberSetup() MineNumberSetup() ShipmentNumberSetup() AlchemyLabNumberSetup() PortalNumberSetup() TimeMachineNumberSetup() AntimatterCondenserNumberSetup() PrismNumberSetup() CursorSetup() GrandmaSetup() FarmSetup() FactorySetup() MineSetup() ShipmentSetup() AlchemyLabSetup() PortalSetup() TimeMachineSetup() AntimatterCondenserSetup() PrismSetup() End>GBN831.sb< Start>GBN925.sb< 'Developed By Chase Morell 2012 GraphicsWindow.Show() GraphicsWindow.Height = 375 GraphicsWindow.Width = 400 GraphicsWindow.BackgroundColor = "Black" Goto start start: title = Shapes.AddImage ("http://soccercleat.webs.com/Ultimate%20Dodge.jpg") Shapes.Zoom (title,.3,.8) Shapes.Move (title,-320,-50) titleLOOP: TOPAC = TOPAC + 2 Shapes.SetOpacity (title,TOPAC) Program.Delay (100) If TOPAC > 100 then Goto titleloop2 endif Goto titleLOOP titleloop2: OSET = OSET + 1 Shapes.setOpacity (title,100 - OSET) Program.Delay (100) If OSET > 30 then OSET = OSET + 2 endif If OSET > 110 then Shapes.Remove (title) Goto start2ACTUALGAME endif Goto titleloop2 start2ACTUALGAME: GraphicsWindow.BrushColor = "Orange" GraphicsWindow.BrushColor = "Red" GraphicsWindow.ShowMessage ("Use Your mouse to dodge obstacles,If your player (The Circle) wanders off the visible path, you will loose. The 'w' key controls the rocket, wich you can use to destroy oncoming obstacles. Be carefull, though, you only have five rockets. The 'A' and 'D' keys control your small gunns that shoot to the side. Try to get a highscore!","How To Play") GS: GraphicsWindow.BrushColor = "Red" loop3: '****************************************************************************************************************** background = Shapes.AddImage ("http://www.littleboxofideas.com/images/blog/resources/155_bokeh_textures/bokeh_texture01.jpg") ASUFORGAME: GraphicsWindow.BrushColor = "Red" user = Shapes.AddEllipse (50,50) Mouse.HideCursor() loop: '***************************************************************************************************************** x = Mouse.MouseX y = Mouse.MouseY 'initiate powerups If Mouse.IsLeftButtonDown Then pu = pu + 1 If pu < 4 Then speed = 70 EndIf If pu > 4 Then speed = speed EndIf EndIf GraphicsWindow.PenColor = "black" 'set x value of obstacles obstaclex = Math.GetRandomNumber(340) 'make obstacle obstacle = Shapes.AddRectangle (100,10) 'delay it Program.Delay (20) 'move the 'LOOOOOOOOPPP '******************************************************************************************************************** loop2: oY = oY + 1 Shapes.Move (obstacle,obstaclex,oY) If oY = 400 Then Shapes.Remove (obstacle) oY = 0 OV = 0 Goto loop EndIf GraphicsWindow.KeyDown = fire Sub fire If GraphicsWindow.LastKey = "A" Then ammo = Shapes.AddEllipse (5,5) Shapes.Move (ammo,X,270) Shapes.Animate (ammo,x - 500,270 - 500,700) EndIf If GraphicsWindow.LastKey = "D" Then ammo2 = Shapes.AddEllipse (5,5) Shapes.Move (ammo2,X,270) Shapes.Animate (ammo2,x + 500,270 - 500,700) EndIf If GraphicsWindow.LastKey = "P" Then Program.End() EndIf If GraphicsWindow.LastKey = "W" Then rAL = rAL + 1 If rAL < 5 then rocket = Shapes.AddRectangle (5,10) Shapes.Move (rocket,x,270) Shapes.Animate (rocket,x,y - 600,700) If x > obstaclex - 50 And x < obstaclex + 50 And GraphicsWindow.LastKey = "W" Then Shapes.Remove (obstacle) OV = 1 EndIf EndIf EndIf EndSub 'XXXXXXXXXXXXXXXXXXXXX 'Set Speeed by frame rate speed = speed + 1 If speed < 300 Then speedActual = 3 EndIf If speed > 300 And speed < 700 Then speedActual = 2 EndIf If speed > 700 And speed > 1100 Then speedActual = 1 EndIf If speed > 1100 then speedActual = .7 EndIf 'end speed setup '----------------------------------- '------------------------------------ '-------------------------------------- 'XXXXXXXXXXXXXXXXXXXXXx Program.Delay(speedACTUAL) x = Mouse.MouseX y = Mouse.MouseY Shapes.Move (user,x,280) If Mouse.MouseX > 600 Or Mouse.MouseX < -50 And speed > 100 Then Goto lost EndIf If OV = 1 Then Goto removedetour EndIf 'Collision Detection If x > obstaclex - 50 And x < obstaclex + 50 And oY = 280 and OV = 0 Then lost: Mouse.ShowCursor() GraphicsWindow.ShowMessage ("You loose. Your score is : " + speed, "Game Over") speed = 0 GraphicsWindow.Clear() pu = 0 rAL = 0 Goto loop3 EndIf removedetour: Goto loop2 End>GBN925.sb< Start>GBQ812-0.sb< args=0 GraphicsWindow.Title = "Moon Phase Animation" gw = 800 gh = 800 GraphicsWindow.Width = gw GraphicsWindow.Height = gh xo = gw / 2 yo = gh / 2 GraphicsWindow.BackgroundColor = "darkblue GraphicsWindow.BrushColor ="yellow For x=1 To 50 GraphicsWindow.FillEllipse (Math.GetRandomNumber (800) Math.GetRandomNumber (800) 2 2) endfor a = 180 n = 90 GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = LDColours.LightYellow white[0] = Shapes.AddEllipse(2 * a, 2 * a) Shapes.Move(white[0], xo - a, yo - a) GraphicsWindow.BrushColor = "darkblue left = Shapes.AddRectangle(a + 1, 2 * (a + 1)) Shapes.Move(left, xo - (a + 1), yo - (a + 1)) Shapes.HideShape(left) right = Shapes.AddRectangle(a + 1, 2 * (a + 1)) Shapes.Move(right, xo, yo - (a + 1)) Shapes.HideShape(right) For i = 1 To n - 1 θ = (90 * i / n) b = a * ldMath.Cos(θ) GraphicsWindow.BrushColor = "darkblue black[i] = Shapes.AddEllipse(2 * b, 2 * a) Shapes.Move(black[i], xo - b, yo - a) Shapes.HideShape(black[i]) GraphicsWindow.BrushColor = LDColours.LightYellow white[i] = Shapes.AddEllipse(2 * b, 2 * a) Shapes.Move(white[i], xo - b, yo - a) Shapes.HideShape(white[i]) EndFor white[n] = Shapes.AddEllipse(2 * a, 2 * a) Shapes.Move(white[n], xo - a, yo - a) Shapes.SetOpacity(white[n], 15) i = 0 ' lp / 4n While "True" If i = 0 Then Shapes.HideShape(right) Shapes.HideShape(white[2 * n - i + 1]) ElseIf i = 1 Then Shapes.ShowShape(white[i]) Shapes.ShowShape(left) ElseIf 1 < i And i < n Then LDCall.Function2("doshp" white[i] white[i - 1]) ElseIf i = n Then Shapes.HideShape(white[i - 1]) ElseIf i = n + 1 Then Shapes.ShowShape(black[2 * n - i]) ElseIf n + 1 < i And i < 2 * n Then LDCall.Function2("doshp" black[2 * n - i] black[2 * n - i + 1]) ElseIf i = 2 * n Then LDCall.Function2("doshp" right black[2 * n - i + 1]) ElseIf i = 2 * n + 1 Then LDCall.Function2("doshp" black[i - 2 * n] left) ElseIf 2 * n + 1 < i And i < 3 * n Then LDCall.Function2("doshp" black[i - 2 * n] black[i - 2 * n - 1]) ElseIf i = 3 * n Then Shapes.HideShape(black[i - 2 * n - 1]) ElseIf i = 3 * n + 1 Then Shapes.ShowShape(white[4 * n - i]) ElseIf 3 * n + 1 < i And i < 4 * n Then LDCall.Function2("doshp" white[4 * n - i] white[4 * n - i + 1]) EndIf i = i + 1 If 4 * n <= i Then i = 0 EndIf Program.Delay(40) EndWhile Sub doshp Shapes.ShowShape(args[1]) Shapes.hideShape(args[2]) EndSub End>GBQ812-0.sb< Start>GBQ812.sb< ' Moon Phase Animation ' Version 0.1 ' Copyright © 2016 Nonki Takahashi. The MIT License. ' GraphicsWindow.Title = "Moon Phase Animation" gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh xo = gw / 2 yo = gh / 2 GraphicsWindow.BackgroundColor = "Black" a = 180 n = 90 GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "White" white[0] = Shapes.AddEllipse(2 * a, 2 * a) Shapes.Move(white[0], xo - a, yo - a) GraphicsWindow.BrushColor = "Black" left = Shapes.AddRectangle(a + 1, 2 * (a + 1)) Shapes.Move(left, xo - (a + 1), yo - (a + 1)) Shapes.HideShape(left) right = Shapes.AddRectangle(a + 1, 2 * (a + 1)) Shapes.Move(right, xo, yo - (a + 1)) Shapes.HideShape(right) For i = 1 To n - 1 θ = Math.GetRadians(90 * i / n) b = a * Math.Cos(θ) GraphicsWindow.BrushColor = "Black" black[i] = Shapes.AddEllipse(2 * b, 2 * a) Shapes.Move(black[i], xo - b, yo - a) Shapes.HideShape(black[i]) GraphicsWindow.BrushColor = "White" white[i] = Shapes.AddEllipse(2 * b, 2 * a) Shapes.Move(white[i], xo - b, yo - a) Shapes.HideShape(white[i]) EndFor white[n] = Shapes.AddEllipse(2 * a, 2 * a) Shapes.Move(white[n], xo - a, yo - a) Shapes.SetOpacity(white[n], 15) i = 0 ' lp / 4n While "True" If i = 0 Then Shapes.HideShape(right) Shapes.HideShape(white[2 * n - i + 1]) ElseIf i = 1 Then Shapes.ShowShape(white[i]) Shapes.ShowShape(left) ElseIf 1 < i And i < n Then Shapes.ShowShape(white[i]) Shapes.HideShape(white[i - 1]) ElseIf i = n Then Shapes.HideShape(white[i - 1]) ElseIf i = n + 1 Then Shapes.ShowShape(black[2 * n - i]) ElseIf n + 1 < i And i < 2 * n Then Shapes.ShowShape(black[2 * n - i]) Shapes.HideShape(black[2 * n - i + 1]) ElseIf i = 2 * n Then Shapes.ShowShape(right) Shapes.HideShape(black[2 * n - i + 1]) ElseIf i = 2 * n + 1 Then Shapes.ShowShape(black[i - 2 * n]) Shapes.HideShape(left) ElseIf 2 * n + 1 < i And i < 3 * n Then Shapes.ShowShape(black[i - 2 * n]) Shapes.HideShape(black[i - 2 * n - 1]) ElseIf i = 3 * n Then Shapes.HideShape(black[i - 2 * n - 1]) ElseIf i = 3 * n + 1 Then Shapes.ShowShape(white[4 * n - i]) ElseIf 3 * n + 1 < i And i < 4 * n Then Shapes.ShowShape(white[4 * n - i]) Shapes.HideShape(white[4 * n - i + 1]) EndIf i = i + 1 If 4 * n <= i Then i = 0 EndIf Program.Delay(20) EndWhile End>GBQ812.sb< Start>GBS016.sb< GraphicsWindow.Width=640 GraphicsWindow.Height=400 GraphicsWindow.BackgroundColor="Gray" GraphicsWindow.Top=Desktop.Height/2-200 GraphicsWindow.Left=Desktop.Width/2-350 GraphicsWindow.BrushColor="white" GraphicsWindow.FillEllipse(0,150,50,100) GraphicsWindow.FillEllipse(590,150,50,100) GraphicsWindow.DrawEllipse(0,150,50,100) GraphicsWindow.DrawEllipse(590,150,50,100) GraphicsWindow.BrushColor="lightgray" GraphicsWindow.FillRectangle(20,25,600,350) GraphicsWindow.PenColor="gray" For i=1 To 59 For k=1 To 34 GraphicsWindow.DrawEllipse(20+(i*10),25+(k*10),1,1) EndFor EndFor GraphicsWindow.PenColor="black" GraphicsWindow.DrawLine(320,25,320,375) GraphicsWindow.DrawEllipse(270,150,100,100) GraphicsWindow.DrawRectangle(20,25,600,350) GraphicsWindow.PenColor="red" GraphicsWindow.DrawLine(20,152,20,248) GraphicsWindow.DrawLine(620,152,620,248) GraphicsWindow.PenColor="black" For i=1 To 2 If i=1 Then b=50 GraphicsWindow.BrushColor="red" Else GraphicsWindow.BrushColor="Blue" b=GraphicsWindow.Width-86 EndIf player[i]=Shapes.AddEllipse(36,36) Shapes.Move(player[i],b,187) EndFor GraphicsWindow.BrushColor="skyblue" ball=Shapes.AddEllipse(20,20) Shapes.Move(ball,310,190) velocity=0 GraphicsWindow.KeyDown=keydown GraphicsWindow.KeyUp=keyup x1=GraphicsWindow.Width-86 y1=187 x2=50 y2=187 dt=0.07 Sub keyup last=GraphicsWindow.LastKey If last="Right" Then right1="False" EndIf If last="Left" Then left1="False" EndIf If last="Up" Then up1="False" EndIf If last="Down" Then down1="False" EndIf If last="D" Then right2="False" EndIf If last="A" Then left2="False" EndIf If last="W" Then up2="False" EndIf If last="S" Then down2="False" EndIf EndSub Sub keydown last=GraphicsWindow.LastKey If last="Right" Then right1="True" EndIf If last="Left" Then left1="True" EndIf If last="Up" Then up1="True" EndIf If last="Down" Then down1="True" EndIf If last="D" Then right2="True" EndIf If last="A" Then left2="True" EndIf If last="W" Then up2="True" EndIf If last="S" Then down2="True" EndIf EndSub While "True" If right1 Then velocity=5 x1=x1+dc EndIf If left1 Then velocity=5 x1=x1-dc EndIf If up1 Then velocity=5 y1=y1-dc EndIf If down1 Then velocity=5 y1=y1+dc EndIf If right2 Then velocity=5 x2=x2+dc EndIf If left2 Then velocity=5 x2=x2-dc EndIf If up2 Then velocity=5 y2=y2-dc EndIf If down2 Then velocity=5 y2=y2+dc EndIf dc=velocity * dt / 2 For i=0 To velocity Shapes.Move(player[1],x2,y2) Shapes.Move(player[2],x1,y1) velocity=velocity-1 EndFor Program.Delay(dt) EndWhile End>GBS016.sb< Start>GCD897.sb< TimeToWait = 10 ' in seconds QuestionsRound1 = 10 ' questions to ask for round 1 QuestionsRound2 = 10 ' questions to ask for round 2 QuestionsRound3 = 10 ' questions to ask for round 3 MaxQuestionsToAsk = 40 ' total numbr of questions to ask - also defines the number of questions to ask in round 4 Sub Setup GraphicsWindow.BackgroundColor = "#542437" bgColour = GraphicsWindow.BackgroundColor GraphicsWindow.Clear() GraphicsWindow.BrushColor = "#C02942" brushColour = GraphicsWindow.BrushColor GraphicsWindow.PenColor = "#ECD078" penColour = GraphicsWindow.PenColor GraphicsWindow.Title = "Educational Game" GraphicsWindow.Height = "350" GraphicsWindow.Width = "600" GraphicsWindow.FontName = "Calibri" GraphicsWindow.FontSize = 28 GraphicsWindow.DrawText(2, 2, "Score: " + score + "/" + count) 'displays the score GraphicsWindow.BrushColor = "#ECD078" If round = 1 Then GraphicsWindow.DrawText(380, 0, "Round 1 - Addition") 'needs to be done with images ElseIf round = 2 Then GraphicsWindow.DrawText(350, 0, "Round 2 - Subtraction") ElseIf round = 3 Then GraphicsWindow.DrawText(320, 0, "Round 3 - Multiplication") ElseIf round = 4 Then GraphicsWindow.DrawText(380, 0, "Round 4 - Division") EndIf random = 0 max = 25 WaitForAnswer = "True" ClockTimer = 0 TimerExpired = "False" EndSub Sub DrawButtons 'button processes and settings buttonWidth = 160 buttonHeight = 100 '###creating the buttons### buttonOneX = GraphicsWindow.Width - 575 'answer button 1 buttonOneY = GraphicsWindow.Height - 120 'answer button 1 buttonTwoX = GraphicsWindow.Width - 380 'answer button 2 buttonTwoY = GraphicsWindow.Height - 120 'answer button 2 buttonThreeX = GraphicsWindow.Width - 185 'answer button 3 buttonThreeY = GraphicsWindow.Height - 120 'answer button 3 'question positioning creation questionOneX = buttonOneX + 180 'question one x questionOneY = buttonOneY + 30 'question one y questionTwoX = buttonTwoX + 50 'question one x questionTwoY = buttonTwoY + 30 'question one y questionThreeX = buttonThreeX + 50 'question one x questionThreeY = buttonThreeY + 30 'question one y '###drawing the buttons### GraphicsWindow.BrushColor = brushColour 'answer button 1 GraphicsWindow.FillRectangle(buttonOneX, buttonOneY, buttonWidth, buttonHeight) GraphicsWindow.DrawRectangle(buttonOneX, buttonOneY, buttonWidth, buttonHeight) 'answer button 2 GraphicsWindow.FillRectangle(buttonTwoX, buttonTwoY, buttonWidth, buttonHeight) GraphicsWindow.DrawRectangle(buttonTwoX, buttonTwoY, buttonWidth, buttonHeight) 'answer button 3 GraphicsWindow.FillRectangle(buttonThreeX, buttonThreeY, buttonWidth, buttonHeight) GraphicsWindow.DrawRectangle(buttonThreeX, buttonThreeY, buttonWidth, buttonHeight) EndSub Sub DisplayQuestionAndAnswers GraphicsWindow.FontSize = 48 GraphicsWindow.BrushColor = "#D95B43" GraphicsWindow.DrawText(questionCoordsStart, 50, integerOne) 'integerOne printing GraphicsWindow.DrawText(questionSymbolCoords, 50, symbolVerbal) 'symbol printing GraphicsWindow.DrawText(questionSymbolCoords + spaceSize, 50, integerTwo) 'integerTwo printing GraphicsWindow.BrushColor = "#ECD078" 'button 1 GraphicsWindow.DrawText(buttonOneX + answerSpacing, buttonOneY + 20, answerOne) 'answer 1 goes here 'button 2 GraphicsWindow.DrawText(buttonTwoX + answerSpacing, buttonTwoY + 20, answerTwo) 'answer 2 would go here 'button 3 GraphicsWindow.DrawText(buttonThreeX + answerSpacing, buttonThreeY + 20, answerThree)'answer 3 would go here EndSub Sub CalculateQuestionAndAnswers 'questions spaceSize = 40 symbolMax = round symbol = Math.GetRandomNumber(symbolMax) If round = 1 and symbol = 1 then oneMaxObjective = 50 twoMaxObjective = 49 elseif round = 2 and symbol = 1 then oneMaxObjective = 500 twoMaxObjective = 499 elseif round = 3 and symbol = 1 then oneMaxObjective = 10000 twoMaxObjective = 10000 elseif round = 4 and symbol = 1 then oneMaxObjective = 100000 twoMaxObjective = 100000 elseif round = 2 and symbol = 2 then oneMaxObjective = 500 twoMaxObjective = 499 elseif round = 3 and symbol = 2 then oneMaxObjective = 10000 twoMaxObjective = 10000 elseif round = 4 and symbol = 2 then oneMaxObjective = 100000 twoMaxObjective = 100000 elseif round = 3 and symbol = 3 then oneMaxObjective = 25 twoMaxObjective = 25 elseif round = 4 and symbol = 3 then oneMaxObjective = 35 twoMaxObjective = 120 Elseif round = 4 and symbol = 4 then oneMaxObjective = 200 twoMaxObjective = 50 endif oneMax = oneMaxObjective twoMax = twoMaxObjective questionCoordsStart = 250 questionSymbolCoords = questionCoordsStart + spaceSize integerOne = Math.GetRandomNumber(oneMax) If integerOne >= 10 and integerOne <= 99 then questionCoordsStart = 250 - 20 ElseIf integerOne >= 100 and integerOne <= 999 then questionCoordsStart = 250 - 50 elseif integerOne >= 1000 and integerOne <= 9999 then questionCoordsStart = 250 - 80 elseif integerOne >= 10000 and integerOne <= 99999 then questionCoordsStart = 250 - 110 endif correctAnswer = Math.GetRandomNumber(3) randomizationSymbol = Math.GetRandomNumber(2) randomizationSymbolTwo = Math.GetRandomNumber(2) integerTwo = Math.GetRandomNumber(twoMax) symbolVerbal = "debug" If round = 1 and symbol = 1 then randomLevel = 6 ElseIf round = 2 and symbol = 1 then randomLevel = 16 elseif round = 3 and symbol = 1 then randomLevel = 120 elseif round = 4 and symbol = 1 then randomLevel = 1200 elseif round = 2 and symbol = 2 then randomLevel = 12 elseif round = 3 and symbol = 2 then randomLevel = 150 elseif round = 4 and symbol = 2 then randomLevel = 750 elseif round = 3 and symbol = 3 then randomLevel = 400 elseif round = 4 and symbol = 3 then randomLevel = 200 elseif round = 4 and symbol = 4 then randomLevel = 60 endif If symbol = 1 then symbolVerbal = "+" answer = integerOne + integerTwo If correctAnswer = 1 then answerOne = answer answerTwo = answer - Math.GetRandomNumber(randomLevel) answerThree = answer + Math.GetRandomNumber(randomLevel) elseIf correctAnswer = 2 then answerOne = answer + Math.GetRandomNumber(randomLevel) answerTwo = answer answerThree = answer + Math.GetRandomNumber(randomLevel) elseIf correctAnswer = 3 then answerOne = answer + Math.GetRandomNumber(randomLevel) answerTwo = answer - Math.GetRandomNumber(randomLevel) answerThree = answer endif elseIf symbol = 2 then symbolVerbal = "-" answer = integerOne - integerTwo If correctAnswer = 1 then answerOne = answer answerTwo = answer + Math.GetRandomNumber(randomLevel) answerThree = answer - Math.GetRandomNumber(randomLevel) elseIf correctAnswer = 2 then answerOne = answer - Math.GetRandomNumber(randomLevel) answerTwo = answer answerThree = answer - Math.GetRandomNumber(randomLevel) elseIf correctAnswer = 3 then answerOne = answer - Math.GetRandomNumber(randomLevel) answerTwo = answer + Math.GetRandomNumber(randomLevel) answerThree = answer endif elseIf symbol = 3 then symbolVerbal = "x" answer = integerOne * integerTwo If correctAnswer = 1 then answerOne = answer answerTwo = answer + Math.GetRandomNumber(randomLevel) answerThree = answer - Math.GetRandomNumber(randomLevel) elseIf correctAnswer = 2 then answerOne = answer - Math.GetRandomNumber(randomLevel) answerTwo = answer answerThree = answer + Math.GetRandomNumber(randomLevel) elseIf correctAnswer = 3 then answerOne = answer - Math.GetRandomNumber(randomLevel) answerTwo = answer - Math.GetRandomNumber(randomLevel) answerThree = answer endif elseIf symbol = 4 then symbolVerbal = "÷" answer = Math.Round(integerOne / integerTwo) If correctAnswer = 1 then answerOne = answer answerTwo = answer + Math.GetRandomNumber(randomLevel) answerThree = answer - Math.GetRandomNumber(randomLevel) elseIf correctAnswer = 2 then answerOne = answer - Math.GetRandomNumber(randomLevel) answerTwo = answer answerThree = answer + Math.GetRandomNumber(randomLevel) elseIf correctAnswer = 3 then answerOne = answer - Math.GetRandomNumber(randomLevel) answerTwo = answer - Math.GetRandomNumber(randomLevel) answerThree = answer endif endif if answerOne <= 9 and answerOne >= 0 Then answerSpacing = 62 ElseIf answerOne >= 10 and answerOne <= 99 then answerSpacing = 52 elseif answerOne >= 100 and answerOne <= 999 then answerSpacing = 42 elseIf answerOne >= 1000 And answerOne <= 9999 then answerSpacing = 30 elseif answerOne >= 10000 and answerOne <= 99999 then answerSpacing = 18 elseif answerOne >= 100000 then answerSpacing = 6 elseif answerOne <= -1 and answerOne >= -999 then answerSpacing = 50 endif EndSub Sub handleClick xpos = GraphicsWindow.MouseX ypos = GraphicsWindow.MouseY 'checks if you clicked inside the button result = "" Clicked = "False" 'button one check If(xpos > buttonOneX And xpos < (buttonOneX + buttonWidth)) and (ypos > buttonOneY And ypos < (buttonOneY + buttonHeight)) Then result = "Incorrect" If correctAnswer = 1 Then score = score + 1 result = "Correct" endif 'button two check ElseIf(xpos > buttonTwoX And xpos < (buttonTwoX + buttonWidth)) and (ypos > buttonTwoY And ypos < (buttonTwoY + buttonHeight)) Then result = "Incorrect" If correctAnswer = 2 Then score = score + 1 result = "Correct" endif 'button three check ElseIf(xpos > buttonThreeX And xpos < (buttonThreeX + buttonWidth)) and (ypos > buttonThreeY And ypos < (buttonThreeY + buttonHeight)) Then result = "Incorrect" If correctAnswer = 3 Then score = score + 1 result = "Correct" endif EndIf If result <> "" then Clicked = "True" EndIf EndSub Sub WaitForAnswerOrClick GraphicsWindow.MouseDown = handleClick GraphicsWindow.FillRectangle(buttonTwoX - 20, 150, 204, 30) GraphicsWindow.BrushColor = "#F02942" ClockTimer = -1 While (WaitForAnswer = "True") ClockTimer = ClockTimer + 1 Program.Delay(100) GraphicsWindow.FillRectangle((buttonTwoX - 20) + (ClockTimer * 2) , 150, 2, 30) If (ClockTimer > (TimeToWait * 10)) Then WaitForAnswer = "False" TimerExpired = "True" EndIf If Clicked = "True" Then WaitForAnswer = "False" EndIf EndWhile count = count + 1 If count >= LimitRound1 and count < LimitRound2 then round = 2 elseif count >= LimitRound2 and count < LimitRound3 then round = 3 elseif count >= LimitRound3 then round = 4 endif If TimerExpired = "True" Then label = "No answer. Y" Else Clicked = "False" label = result + ", y" EndIf GraphicsWindow.ShowMessage(label + "our score is " + score + "/" + count + ".", "Results") EndSub Sub startupProc GraphicsWindow.Show() GraphicsWindow.ShowMessage("###########- WELCOME TO QUIZ WIZ -##########", "Welcome") GraphicsWindow.BackgroundColor = "black" 'quizSplash = ImageList.LoadImage("G:/Basic/Quiz.jpg") 'GraphicsWindow.DrawImage(quizSplash, 15, 76) LimitRound1 = QuestionsRound1 LimitRound2 = LimitRound1 + QuestionsRound2 LimitRound3 = LimitRound2 + QuestionsRound3 EndSub Sub winScore TextWindow.WriteLine("##############SCORE################") TextWindow.WriteLine("Your final score is " + score + "/" + count + ".") If score >= max - 10 Then TextWindow.WriteLine("Your score was great!") elseif score >= max - 20 and score <= max - 10 then TextWindow.WriteLine("Your score was good!") elseif score >= max - 30 and score <= max - 20 then TextWindow.WriteLine("Your score was average!") Else TextWindow.WriteLine("Your score was below average, good luck next time") endif TextWindow.WriteLine("###################################") Program.Delay(3500) endsub score = 0 count = 0 questionsAsked = 0 round = 1 startupProc() While (questionsAsked < MaxQuestionsToAsk) Setup() DrawButtons() CalculateQuestionAndAnswers() DisplayQuestionAndAnswers() WaitForAnswerOrClick() questionsAsked = questionsAsked + 1 EndWhile winScore() Program.End() End>GCD897.sb< Start>GCF761.sb< 'Program name: FlickrSlideShow2.sb 'Author:Husker41@navix.net ' ========== 'Function: You request a photo subject & this program 'will give you a slide show of Flickr pictures on that subject. ' ========== 'Variables: 'photo = the photo subject you choose 'Pic = randomly chosen Flickr picture of chosen subject 'S = desired display picture size 'w=desired picture width 'h=desired picture height 'w1=original picture height, then becomes scaled picture width 'h1=original picture height, then becomes scaled picture height 'n=random number to vary corny remarks displayed by program ' ========== 'Labels: Mor, Siz, Cycle '========== 'Get photo subject & desired size from user, then hide text window TextWindow.Write("What would you like to see pictures of? ") photo = TextWindow.Read() SIZ: TextWindow.Write("What size pictures? S[mall], M[edium] or L[arge]? ") S=TextWindow.Read() S=S+" " S=Text.GetSubText(S,0,1) S = Text.ConvertToUpperCase(S) If (S<>"S")and(S<>"M")And(S<>"L") Then TextWindow.WriteLine(" ") TextWindow.WriteLine("I don't understand, please try again. ") Goto SIZ EndIf If S ="S" Then h=300 w=400 EndIf If S="M" Then h=709 w=1016 EndIf If S="L" Then h=731 w=1265 EndIf If S="S" Then TextWindow.Write("OK, small pictures it will be! ") ElseIf S="M" Then TextWindow.Write("Medium-sized pictures coming up ... " ) ElseIf S="L" Then TextWindow.Write("Now you'lI get the big picture. ") EndIf n=Math.GetRandomNumber(20) If n=1 Then TextWindow.WriteLine("Want fries with that? ") ElseIf n=2 Then TextWindow.WriteLine("Sure that's what you want? ") ElseIf n=3 Then TextWindow.WriteLine("When shall I start? ") ElseIf n=4 Then TextWindow.WriteLine(" ") TextWindow.WriteLine("How come you never show me YOUR pictures? ") ElseIf n=5 Then TextWindow.WriteLine("Aren't you about ready for a nap? ") ElseIf n=6 Then TextWindow.WriteLine(" ") TextWindow.WriteLine("Confucius say, 'Time is what keeps all the pictures from appearing at once!' ") ElseIf n=7 Then TextWindow.WriteLine(" ") TextWindow.WriteLine("Always remember that you are unique, just like everyone else.") ElseIf n=8 Then TextWindow.WriteLine(" ") TextWindow.WriteLine("All generalizations are necessarily false.") ElseIf n=9 Then TextWindow.WriteLine(" ") TextWindow.WriteLine("Never ask a barber if you need a haircut.") EndIf Program.Delay(4000) If n=10 Then TextWindow.WriteLine(" ") TextWindow.WriteLine("Haha, wait 'til you see that naughty picture I found of you!") Program.Delay(3000) EndIf TextWindow.Hide() 'Set Graphics window color & size, title it, then open it GraphicsWindow.BackgroundColor="SteelBlue" GraphicsWindow.Title="Slide Show - please wait for : " + photo GraphicsWindow.width = w GraphicsWindow.Height = h GraphicsWindow.Show() Mor: 'Get the random picture from Flickr Pic = Flickr.GetRandomPicture(photo) 'Get the picture's size h1=ImageList.GetHeightOfImage(Pic) w1=ImageList.GetWidthOfImage(Pic) 'Fit the picture to the chosen window size, maintaining original aspect ratio If w1 > h1 Then w1 = w1 * h / h1 h1 = h Else h1 = h1 * w /w1 w1 = w EndIf Cycle: If h1>h Or w1>w Then h1=h1*.999 w1=w1*.999 Goto Cycle EndIf 'Draw the resized picture & loop back 'to get another picture. GraphicsWindow.DrawResizedImage(Pic,0,0,w1,h1) 'Adjust window to size of new picture GraphicsWindow.Height=h1 GraphicsWindow.Width=w1 Goto Mor End>GCF761.sb< Start>GCN044.sb< ' Pascal's Triangle ' Copyright © 2018 Nonki Takahashi. The MIT License. GraphicsWindow.Title = "Pascal's Triangle" level = 12 Init() For j = 1 To level _x = x For i = 1 To j GraphicsWindow.DrawEllipse(x - r, y - r, 2 * r, 2 * r) If (i = 1) Or (i = j) Then p[j][i] = 1 Else p[j][i] = p[j - 1][i - 1] + p[j - 1][i] EndIf h = fs * 1.1 w = Text.GetLength(p[j][i]) * fs * 0.6 GraphicsWindow.DrawText(x - w / 2, y - h / 2, p[j][i]) x = x + 2 * dx EndFor x = _x - dx y = y + dy EndFor Sub Init gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh dy = gh / (level + 1) dx = dy / Math.SquareRoot(3) y = dy x = gw / 2 r = dy * 0.5 fs = r * 0.8 GraphicsWindow.PenColor = "Cyan" GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = fs GraphicsWindow.FontName = "Trebuchet MS" EndSub End>GCN044.sb< Start>GCP340.sb< ' new effect 1 ' program y yled, Dec 1th 2016 ' program no: ' npublic domain picture image=ImageList.LoadImage ("https://upload.wikimedia.org/wikipedia/commons/thumb/d/d6/STS120LaunchHiRes-edit1.jpg/153px-STS120LaunchHiRes-edit1.jpg") H=ImageList.GetHeightOfImage(image) 'TextWindow.WriteLine(f1) = 240 W=ImageList.GetWidthOfImage(image) 'TextWindow.WriteLine(f2) = 153 GraphicsWindow.DraWImage(image,0,0) GraphicsWindow.Width=W GraphicsWindow.Height=H GraphicsWindow.top=100 GraphicsWindow.left=200 For y = 0 To H For x= 0 To W hex1=graphicswindow.GetPixel(x,y) R1=Text.GetSubText(hex1, 2, 1) R2=Text.GetSubText(hex1, 3, 1) G1=Text.GetSubText(hex1, 4, 1) G2=Text.GetSubText(hex1, 5, 1) B1=Text.GetSubText(hex1, 6, 1) B2=Text.GetSubText(hex1, 7, 1) B3=B1 If R1 = "F" Or B1= "F" Or G1 = "F" Then R1=0 B1=0 G1=0 ENDIF If R1 = "E" Or B1= "E" Or G1 = "E" Then R1=2 B1=2 G1=2 ENDIF If R1 = 1 Or B1= 1 Or G1 = 1 Then R1="F" B1="F" G1="F" ENDIF If R1 = 3 Or B1= 3 Or G1 = 3 Then R1="C" B1="C" G1="C" ENDIF R1=B1 G1=B1 B1=B3 hex2="#"+R1+R2+G1+G2+B1+B2 GraphicsWindow.SetPixel(x,y,hex2) Endfor EndFor Sound.PlayBellRing() ' ************************** END OF PROGRAMME *************************************************** End>GCP340.sb< Start>GCP679.sb< using System; using System.IO; using System.Diagnostics; using Microsoft.SmallBasic.Library; namespace SBTools { /// Dateisystem Funktionen [SmallBasicType] public static class SBFile { /// Ermittelt ob der angegebene Pfad ein Ordner ist. /// Der volle Pfad des Objektes. /// "True" oder "False". public static Primitive IsDirectory(Primitive directorypath) { ' The following line could be harmful and has been automatically commented. ' return ((System.IO.File.GetAttributes(directorypath) & System.IO.FileAttributes.Directory) == System.IO.FileAttributes.Directory); } /// Ermittelt ob der angegebene Pfad eine Datei ist. /// Der volle Pfad des Objektes. /// "True" oder "False". public static Primitive IsFile(Primitive filepath) { ' The following line could be harmful and has been automatically commented. ' return ((System.IO.File.GetAttributes(filepath) & System.IO.FileAttributes.Directory) != System.IO.FileAttributes.Directory); } /// Ermittelt ob der angegebene Dateipfad existiert. /// Der volle Dateipfad. /// "True" oder "False". public static Primitive FileExists(Primitive filepath) { ' The following line could be harmful and has been automatically commented. ' if(System.IO.File.Exists(filepath)) { return true; } else { return false; } } /// Ermittelt ob der angegebene Ordnerpfad existiert. /// Der volle Ordnerpfad. /// "True" oder "False". public static Primitive DirectoryExists(Primitive directorypath) { if(System.IO.Directory.Exists(directorypath)) { return true; } else { return false; } } /// Ermittelt ob der angegebene Datei- bzw. Ordnerpfad existiert. /// Der volle zu überprüfende Datei- oder Ordnerpfad. /// "True" oder "False". public static Primitive PathExists(Primitive path) { ' The following line could be harmful and has been automatically commented. ' return (System.IO.Directory.Exists(path) || System.IO.File.Exists(path)); } // ToDo: Besser InstallPfad aus Registry lesen /// Gibt den Pfad des SmallBasic Installationsverzeichnisses zurück (W7-32). /// Der Pfad des SmallBasic Installationsordners. public static Primitive SBDirectory { get { return @"C:\Program Files\Microsoft\Small Basic"; } } /// /// Ermittelt den Dateinamen mit Erweiterung aus einem Dateipfadstring (auch für relative Pfade mit ".", "..", keine Existenzprüfung, String-Operation). /// /// Der (volle) Dateipfad zB. Program.Directory + "\..\Dir\Datei.ext". /// Der Dateiname (incl. Erweiterung) aus dem angegebenen Dateipfad (ohne Ordnerpfad). public static Primitive GetFileName(Primitive filepath) { Primitive result; try { result = Path.GetFileName(filepath); } catch { return "FAILED"; } return result; } /// /// Ermittelt den vollen Datei-/Ordnerpfad aus einer Datei-/Ordnerangabe (auch für relative Pfade mit ".", "..", keine Existenzprüfung, String-Operation). /// /// Die Datei-/Ordnerangabe zB. Program.Directory + "\..\Dir\Datei.ext". /// Der volle Datei-/Ordnerpfad des Objektes (dieses muß nicht existieren). public static Primitive GetFullPath(Primitive path) { Primitive result; try { result = Path.GetFullPath(path); } catch { return "FAILED"; } return result; } /// /// Kombiniert zwei Pfadstrings zu einem Gesamtpfad (auch für relative Pfade mit ".", "..", keine Existenzprüfung, String-Operation). /// /// Der erste Pfadteil. /// Der zweite Pfadteil. /// Der kombinierte Gesamtpfad des Ordners bzw. Datei aus beiden Teilen. public static Primitive CombinePaths(Primitive path1, Primitive path2) { Primitive result; try { result = Path.Combine(path1, path2); } catch { result = "FAILED"; } return result; } /// Ermittelt den Erstellungszeitpunkt eines Verzeichnisses in der Form TT.MM.JJ HH:mm:ss (gem. Systemeinst.). /// Der volle Ordnerpfad. /// Erstellungszeitpunkt des Verzeichnisses bei Erfolg, "" bei Mißerfolg zB. Ordner existiert nicht. public static Primitive GetDirCreateTime(Primitive directorypath) { try { return System.IO.Directory.Exists(directorypath) ? System.IO.Directory.GetCreationTime(directorypath).ToString() : ""; } catch { return "FAILED"; } } /// Ermittelt den Zeitpunkt der letzten Änderung eines Verzeichnisses in der Form TT.MM.JJ HH:mm:ss (gem. Systemeinst.). /// Der volle Ordnerpfad. /// Letzter Änderungszeitpunkt des Verzeichnisses bei Erfolg, "" bei Mißerfolg zB. Ordner existiert nicht. public static Primitive GetDirModTime(Primitive directorypath) { try { return System.IO.Directory.Exists(directorypath) ? System.IO.Directory.GetLastWriteTime(directorypath).ToString() : ""; } catch { return "FAILED"; } } /// Ermittelt den letzten Zugriffszeitpunkt auf ein Verzeichnis in der Form TT.MM.JJ HH:mm:ss (gem. Systemeinst.). /// Der volle Ordnerpfad. /// Der letzte Zugriffszeitpunkt auf das Verzeichnis bei Erfolg, "" bei Mißerfolg zB. Ordner existiert nicht. public static Primitive GetDirAccessTime(Primitive directorypath) { try { return System.IO.Directory.Exists(directorypath) ? System.IO.Directory.GetLastAccessTime(directorypath).ToString() : ""; } catch { return "FAILED"; } } /// Ermittelt die Versionsinformation zu einer angegebenen Datei. /// Der volle Dateipfad. /// Die Dateiversion der angegebenen Datei wenn verfügbar, sonst "". public static Primitive GetFileVersion(Primitive filepath) { return FileVersionInfo.GetVersionInfo(filepath).FileVersion; } /// Ermittelt die Kommentarinformation zu einer angegebenen Datei (exe, dll, ocx, tlb, usw.). /// Der volle Dateipfad. /// Die Kommentare zu der angegebenen Datei wenn verfügbar, sonst "". public static Primitive GetFileComment(Primitive filepath) { return FileVersionInfo.GetVersionInfo(filepath).Comments; } /// Ermittelt die Größe einer angegebenen Datei. /// Der volle Dateipfad. /// Die Größe der angegebenen Datei in Bytes wenn erfolgreich, sonst "FAILED". "FAILED" wenn Datei nicht existiert. public static Primitive GetFileSize(Primitive filepath) { ' The following line could be harmful and has been automatically commented. ' if(System.IO.File.Exists(filepath)) { FileInfo fi = new FileInfo(filepath); if(fi != null) { decimal l = fi.Length; return l; } return "FAILED"; } else { return "FAILED"; } } /// Ermittelt alle Dateinamen mit angegebener Spezifikation in einem Ordner (und Unterordnern). /// Der volle Ordnerpfad. /// Die Dateispezifikation, zB. "*test*", "*.exe" (* kein oder mehrere Zeichen, ? kein oder ein Zeichen), Groß-/Kleinschreibung ignoriert, "" gibt keine Auflistung. /// Incl. aller Unterordner durchsuchen? "True" oder "False" bzw. "". /// Ein Array mit den Pfaden aller Dateien mit zutreffender Spezifikation (Reihenfolge unbestimmt). public static Primitive GetSpecFiles(Primitive directorypath, Primitive spec, Primitive subs) { Primitive files = new Primitive(); bool inSubs = subs; if(inSubs) { foreach(string file in Directory.GetFiles(directorypath, spec, SearchOption.AllDirectories)) files[files.GetItemCount() + 1] = file; } else { foreach(string file in Directory.GetFiles(directorypath, spec, SearchOption.TopDirectoryOnly)) files[files.GetItemCount() + 1] = file; } return files; } /// Ermittelt alle Ordnernamen mit angegebener Spezifikation in einem Ordner (und Unterordnern). /// Der volle Ordnerpfad. /// Die Ordnerspezifikation, zB. *test*, ?Files usw. (* kein oder mehrere Zeichen, ? kein oder ein Zeichen), Groß-/Kleinschreibung ignoriert, "" gibt keine Auflistung. /// Incl. aller Unterordner durchsuchen? "True" oder "False" bzw. "". /// Ein Array mit den Pfaden aller Ordner mit zutreffender Spezifikation (Reihenfolge unbestimmt). public static Primitive GetSpecDirectories(Primitive directorypath, Primitive spec, Primitive subs) { Primitive folders = new Primitive(); bool inSubs = subs; if(inSubs) { foreach(string folder in Directory.GetDirectories(directorypath, spec, SearchOption.AllDirectories)) folders[folders.GetItemCount() + 1] = folder; } else { foreach(string folder in Directory.GetDirectories(directorypath, spec, SearchOption.TopDirectoryOnly)) folders[folders.GetItemCount() + 1] = folder; } return folders; } /// Ermittelt einen automatisch umbenannten Dateipfad (Pfad\Name_N.ext für N>=2), wenn die angegebene Datei bereits existiert. /// Der volle beabsichtigte Dateipfad. /// Der neu angepasste freie Dateipfad. "FAILED" wenn Elternordner nicht existiert. public static Primitive AutoFilePath(Primitive filePath) { string pathToCheck = filePath; string folder = Path.GetDirectoryName(pathToCheck); if (!System.IO.Directory.Exists(folder)) { return "FAILED"; } else { string file = Path.GetFileNameWithoutExtension(pathToCheck); string ext = Path.GetExtension(pathToCheck); string tempfileName = ""; ' The following line could be harmful and has been automatically commented. ' if (System.IO.File.Exists(pathToCheck)) { int counter = 2; ' The following line could be harmful and has been automatically commented. ' while (System.IO.File.Exists(pathToCheck)) { tempfileName = file + "_" + counter.ToString() + ext; pathToCheck = Path.Combine(folder, tempfileName); counter ++; } return pathToCheck; } else { return pathToCheck; } } } /// Ermittelt einen automatisch umbenannten Ordnerpfad (Pfad\Ordner_N für N>=2), wenn der angegebene Ordner bereits existiert. /// Der volle beabsichtigte Ordnerpfad ohne abschließenden \. /// Der neu angepasste freie Ordnerpfad. "FAILED" wenn Elternordner nicht existiert. public static Primitive AutoFolderPath(Primitive folderPath) { string pathToCheck = folderPath; string parent = Path.GetDirectoryName(pathToCheck); if (!System.IO.Directory.Exists(parent)) { return "FAILED"; } else { string folder = Path.GetFileNameWithoutExtension(pathToCheck); string tempfolderName = ""; if (System.IO.Directory.Exists(pathToCheck)) { int counter = 2; while (System.IO.Directory.Exists(pathToCheck)) { tempfolderName = folder + "_" + counter.ToString(); pathToCheck = Path.Combine(parent, tempfolderName); counter ++; } return pathToCheck; } else { return pathToCheck; } } } /// Ermittelt die Attribute für eine Datei oder Ordner. /// Der volle Datei- oder Ordnerpfad. /// Die Attribute der Datei oder des Ordners als CSV String (zB. ReadOnly, Hidden, System, Archive). public static Primitive GetAttributes(Primitive path) { string pathToCheck = path; ' The following line could be harmful and has been automatically commented. ' if (System.IO.File.Exists(pathToCheck)) { FileInfo fi = new FileInfo(pathToCheck); return fi.Attributes.ToString(); } else if (System.IO.Directory.Exists(pathToCheck)) { DirectoryInfo di = new DirectoryInfo(pathToCheck); return di.Attributes.ToString(); } else { return "FAILED"; } } /// Löscht alle SmallBasic bezogenen Dateien aus dem %TEMP% Ordner oder zeigt diese an. /// Dies sind alle Dateien beginnend mit tmp und den Erweiterungen tmp.exe, tmp und pdb. (s. LDUtilities.CleanTemp) /// Bereinigen? "True" oder "False" bzw. "" (nur Auflistung als Array). /// Die Anzahl der gelöschten Dateien bei Bereinigung "True", sonst die gefundenen Dateinamen als Array. public static Primitive CleanTemp(Primitive clean) { bool del = clean; int fileCount = 0; var comp = StringComparison.OrdinalIgnoreCase; Primitive tfiles = new Primitive(); string[] files = Directory.GetFiles(Path.GetTempPath(), "tmp*"); foreach (string file in files) { string fileName = Path.GetFileName(file); // if (fileName.EndsWith(".pdb",comp) || (fileName.StartsWith("tmp",comp) && (fileName.EndsWith(".tmp.exe",comp) || fileName.EndsWith(".tmp",comp)))) if (fileName.EndsWith(".pdb",comp) || fileName.EndsWith(".exe",comp) || fileName.EndsWith(".tmp",comp)) { if(del) { try { System.IO.FileInfo f = new System.IO.FileInfo(file); f.Delete(); fileCount++; } catch { continue; } } else { tfiles[tfiles.GetItemCount() + 1] = fileName; } } } if(del) { return fileCount; } else { return tfiles; } } } } End>GCP679.sb< Start>GCR144.sb< GraphicsWindow.Title = "mahreen miangul" GraphicsWindow.top=0 GraphicsWindow.left=0 'GraphicsWindow.Left = 0.5 * (Desktop.Width - GraphicsWindow.Width) 'GraphicsWindow.Top = 0.5 * (Desktop.Height - GraphicsWindow.Height) 'GraphicsWindow.BackgroundColor = GraphicsWindow.GetColorFromRGB(75, 175,125) 'GraphicsWindow.BackgroundColor = GraphicsWindow.getrandomcolor() GraphicsWindow.BackgroundColor = "AntiqueWhite" GraphicsWindow.Width = 1080 GraphicsWindow.height = 420 GraphicsWindow.PenWidth = 4 turtle.speed = 8 Turtle.X = 50 Turtle.Y = 240 sides = 1 length = 88 / sides angle = 360 / sides ' M----------------------1 For i = 1 To sides For j = 1 To 6 GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor() Turtle.Move(length / 12) Turtle.PenUp() Turtle.Move(length / 12) Turtle.PenDown() EndFor Turtle.Turn(angle) EndFor Turtle.Turn(155) ' M----------------------2 For i = 1 To sides For j = 1 To 6 GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor() Turtle.Move(length / 11) Turtle.PenUp() Turtle.Move(length / 11) Turtle.PenDown() EndFor Turtle.Turn(angle) EndFor Turtle.Turn(-130) ' M-----------------------3 For i = 1 To sides For j = 1 To 6 GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor() Turtle.Move(length / 12) Turtle.PenUp() Turtle.Move(length / 12) Turtle.PenDown() EndFor Turtle.Turn(angle) EndFor Turtle.Turn(155) ' M-------------------------4 For i = 1 To sides For j = 1 To 6 GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor() Turtle.Move(length / 12) Turtle.PenUp() Turtle.Move(length / 12) Turtle.PenDown() EndFor Turtle.Turn(angle) EndFor Turtle.X = 150 Turtle.Y = 160 ' I----------------------1 sides = 1 length = 88 / sides angle = 360 / sides For i = 1 To sides For j = 1 To 6 GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor() Turtle.Move(length / 12) Turtle.PenUp() Turtle.Move(length / 12) Turtle.PenDown() EndFor Turtle.Turn(angle) EndFor Turtle.X = 170 Turtle.Y = 240 Turtle.Turn(-155) ' A----------------------1 sides = 1 length = 88 / sides angle = -200 / sides For j = 1 To 6 GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor() Turtle.Move(length / 12) Turtle.PenUp() Turtle.Move(length / 12) Turtle.PenDown() EndFor Turtle.Turn(angle) Turtle.Turn(-20) ' A----------------------2 sides = 1 length = 88 / sides angle = 200 / sides For j = 1 To 6 GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor() Turtle.Move(length / 12) Turtle.PenUp() Turtle.Move(length / 12) Turtle.PenDown() EndFor Turtle.Turn(angle) Turtle.X = 170 Turtle.Y = 200 Turtle.Turn(85) ' A----------------------3 sides = 1 length = 88 / sides angle = 200 / sides For j = 1 To 6 GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor() Turtle.Move(length / 12) Turtle.PenUp() Turtle.Move(length / 12) Turtle.PenDown() EndFor Turtle.Turn(angle) Turtle.X = 170 Turtle.Y = 210 Turtle.Turn(160) ' A----------------------4 sides = 1 length = 88 / sides angle = 200 / sides For j = 1 To 6 GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor() Turtle.Move(length / 12) Turtle.PenUp() Turtle.Move(length / 12) Turtle.PenDown() EndFor Turtle.Turn(angle) Turtle.X = 250 Turtle.Y = 240 Turtle.Turn(88) ' N----------------------1 sides = 1 length = 88 / sides angle = 360 / sides ' M----------------------1 For i = 1 To sides For j = 1 To 6 GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor() Turtle.Move(length / 12) Turtle.PenUp() Turtle.Move(length / 12) Turtle.PenDown() EndFor Turtle.Turn(angle) EndFor Turtle.Turn(155) ' N----------------------2 For i = 1 To sides For j = 1 To 6 GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor() Turtle.Move(length / 11) Turtle.PenUp() Turtle.Move(length / 11) Turtle.PenDown() EndFor Turtle.Turn(angle) EndFor Turtle.Turn(-160) ' N-----------------------3 For i = 1 To sides For j = 1 To 6 GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor() Turtle.Move(length / 12) Turtle.PenUp() Turtle.Move(length / 12) Turtle.PenDown() EndFor Turtle.Turn(angle) EndFor GraphicsWindow.penColor = "green " ' repos for G Turtle.PenUp() Turtle.Angle = 0 Turtle.Move(90) Turtle.Angle = 90 Turtle.Move(80) Turtle.Angle = 315 ' G Turtle.PenDown() angle = Turtle.Angle While angle > 44 angle = angle - 1.3 Turtle.Move(1) Turtle.Angle = angle EndWhile Turtle.Angle = 0 Turtle.Move(20) Turtle.Angle = -90 Turtle.Move(20) Turtle.Angle = 90 Turtle.Move(40) GraphicsWindow.penColor = "blue" '' repos for U turtle.penup() turtle.move(40) Turtle.PenDown() 'U Turtle.Angle = 180 Turtle.Move(60) Turtle.Angle = 90 Turtle.Move(60) Turtle.Angle = 0 Turtle.Move(60) ' L----------------------1 Turtle.X = 550 Turtle.Y = 160 Turtle.Turn(0) sides = 1 length = 88 / sides angle = 360 / sides For i = 1 To sides For j = 1 To 8 GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor() Turtle.Move(length / 12) Turtle.PenUp() Turtle.Move(length / 12) Turtle.PenDown() EndFor Turtle.Turn(angle) EndFor ' L----------------------2 Turtle.X = 550 Turtle.Y = 160 Turtle.Turn(90) sides = 1 length = 88 / sides angle = 360 / sides For i = 1 To sides For j = 1 To 8 GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor() Turtle.Move(length / 12) Turtle.PenUp() Turtle.Move(length / 12) Turtle.PenDown() EndFor Turtle.Turn(angle) EndFor Turtle.PenUp() ''repos to underline Turtle.X = 20 Turtle.Y = 280 Turtle.Angle = 90 GraphicsWindow.penColor = "darkslategray" ' underline Turtle.PenDown() For i = 1 To sides For j = 1 To 66 GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor() Turtle.Move(length / 12) Turtle.PenUp() Turtle.Move(length / 12) Turtle.PenDown() EndFor Turtle.Turn(angle) EndFor End>GCR144.sb< Start>GCS192.sb< ' Igo094.smallbasic - 囲碁 Igo v0.94 - Copyright (c) 2010 NonkiTakahashi ' ' 履歴: ' v0.1 2010/07/21 初版:碁盤の表示 (243行 NBK992) ' v0.2 2010/07/23 手数の表示 (265行 JVR185) ' v0.3 2010/07/24 人による次の手の処理 (378行 HHF931) ' v0.4 2010/07/31 棋譜の再生 (706行 HHF931-0) ' v0.5 2010/08/03 棋譜ファイルの入出力 (1088行 HHF931-1) ' v0.6 2010/08/08 勝敗の表示 、自動的に石を取る (1312行 HHF931-2) ' v0.7 2010/08/19 地の認識、着手禁止の判定、Territory (1801行 HHF931-3) ' v0.8 2010/09/05 bEyes、モンテカルロ法 (1945行 TLW572) ' v0.94 2010/10/08 棋譜��字句解析見直し、自動運転 、高速化 (1600行) ' ' 参考文献: ' [1]清愼一, 山下宏, 佐々木宣介: 『コンピュータ囲碁の入門』, 共立出版, 2005. ' [2]石倉昇, 梅沢由香里, 黒瀧正憲, 兵頭俊夫: 『東大教養囲碁講座』, 光文社新書, 2007. ' [3]Anders Kierulf: File Format FF[1], http://www.red-bean.com/sgf/, 1990. ' [4]Arno Hollosi: SGF File Format FF[4], http://www.red-bean.com/sgf/, 2006. ' [5]Karl Baker: The Way to Go, American Go Association, 1986. ' [6]美添一樹: モンテカルロ木検索, 情報処理, Vol.49 No.6, pp.686-693 (2008). ' [7]山下宏:『強豪囲碁ソフト「彩」について』,http://www32.ocn.ne.jp/~yss/index_j.html, 2009. ' ' メインプログラム: sVersion = "v0.94" ' プログラムバージョン bDebug = "False" ' デバッグ中 bSound = "False" ' 石を置いたときの音を出す bNewRo = "False" ' 路数が変更になった bTime = "True" ' 時間表示 bAuto = "False" ' 自動運転 bDumpWL = "True" ' 勝敗のダンプ InitProgram() ' プログラムの初期化 InitRoDepend() ' 路数に依存する変数の初期化 InitControls() ' コントロール部の初期化 ' プログラム終了が指定されるまで{}内繰り返し While bInProgram '{ ' 新規モード InitBoard() ' 盤の初期化 ResetControls() ' コントロール部の初期化 ClearBoard() ' 盤面のクリア ShowBoard() ' 盤の表示 lRetry: InputGameInfo() ' 対戦者名(または棋譜名)の入力 If bTime Then StartClock() EndIf If bOpen Then ' 対局モード(または棋譜入力) ReadRecord() ' 棋譜の読み込み If bError Then Goto lRetry EndIf If bNewRo Then Shapes.HideShape(oPrisoner[BLACK]) Shapes.HideShape(oPrisoner[WHITE]) GraphicsWindow.BrushColor = "Silver" GraphicsWindow.FillRectangle(0, 0, GraphicsWindow.Width, GraphicsWindow.Height) InitRoDepend() ' 路数に依存する変数の初期化 InitBoard() ' 盤の初期化 ResetControls() ' コントロール部のリセット ClearBoard() ' 盤面のクリア ShowBoard() ' 盤の表示 bNewRo = "False" EndIf ReplayGame() ' 棋譜の再生 Else ' 対局モード Shapes.SetText(oPrisoner[BLACK], 0) ' アゲハマのクリア Shapes.SetText(oPrisoner[WHITE], 0) ' アゲハマのクリア InitRecord() ' 棋譜の初期化 CreateRdmArray() ' 乱空点列の初期化 SaveGameDate() ' 対局日の保存 iMove = 0 ' 手数のクリア ' 対局 - 終局になるまで{}内繰り返し While bInGame '{ EachTurn() ' 黒番 If bInGame Then EachTurn() ' 白番 EndIf ' } EndWhile EndIf If bTime Then TextWindow.Write("iMove=" + iMove + " " + sScore + " ") StopClock() PrintTime() EndIf bInGame = "True" ' 終了モード(再生または棋譜出力) While bInGame InputGameEndInfo() ' 対戦者名(または棋譜名)の入力 If bReplay Then ReplayGame() ' 棋譜の再生 ElseIf bSave Then WriteRecord() ' 棋譜の保存 EndIf EndWhile ' } EndWhile ' Sub EachTurn ' それぞれの手番 iMove = iMove + 1 iColor = Math.Remainder((iMove - 1), 2) + 1 iX = iBLX ' 黒番ランプ表示 iY = iBLY If iColor = BLACK Then bOn = "True" Else bOn = "False" EndIf DrawLamp() iX = iWLX ' 白番ランプ表示 iY = iWLY If iColor = WHITE Then bOn = "True" Else bOn = "False" EndIf DrawLamp() If bReplay Then ' 次の手を打つ Replay() Else If sPlayer[iColor] = "Random" Or sPlayer[iColor] = "CPU" Or sPlayer[iColor] = "Easy" Then bEyes = "True" Else bEyes = "False" EndIf If sPlayer[iColor] = "Random" Then bEasy = "False" Random() ElseIf sPlayer[iColor] = "Easy" Then bEasy = "True" Random() ElseIf sPlayer[iColor] = "CPU" Then Montecarlo() ' モンテカルロ法で次の手を決める Else Human() EndIf EndIf If bResign Then ' 投了なら終局 bInGame = "False" If (Math.Remainder(iMove, 2) = 1) Then sScore = "W+R" ' 黒の投��� GraphicsWindow.Title = "Igo " + sVersion + " - 白の中押し勝ち" Else sScore = "B+R" ' 白の投了 GraphicsWindow.Title = "Igo " + sVersion + " - 黒の中押し勝ち" EndIf Else If bPass Then ' パスならパス回数をカウントアップ iPass = iPass + 1 Else iPass = 0 EndIf If bReplay = "False" Then ' 棋譜の記録 Record() EndIf ' 石の表示と取りの処理 bShow = "True" ' 結果を表示する If bPass = "False" Then DrawStone() If bSound Then Sound.PlayClickAndWait() EndIf RemoveCapturedStones() ' 四方の石が囲まれたら取り除く If iRemoved > 0 Then Shapes.SetText(oPrisoner[iColor], iPrisoner[iColor]) EndIf EndIf Judge() ' 終局の判定 EndIf EndSub ' Sub RemoveCapturedStones ' 四方の石が囲まれたら取り除く iRemoved = 0 bEnclosed = "True" ' 四方を囲われている iCTurn = iColor If iColor = BLACK Then iColor = WHITE ElseIf iColor = WHITE Then iColor = BLACK ElseIf iColor = SPACE Then Goto lSkipRemove EndIf iXTurn = iX iYTurn = iY For iET = 1 To 4 iX = iXTurn + idX4[iET] iY = iYTurn + idY4[iET] If iBoard[iX][iY] = iCTurn Or iBoard[iX][iY] = SPACE Then bEnclosed = "False" EndIf If iX >= 1 And iX <= iRo And iY >= 1 And iY <= iRo Then InitLiberty() CountLiberty() If iLiberty = 0 Then RemoveUnit() iRemoved = iRemoved + iUnit iRX = iX iRY = iY iPrisoner[iCTurn] = iPrisoner[iCTurn] + iUnit EndIf EndIf EndFor iColor = iCTurn iX = iXTurn iY = iYTurn If bEnclosed And iRemoved = 1 Then iKo = iMove iKX = iRX iKY = iRY EndIf lSkipRemove: EndSub ' ' プログラム関連: Sub InitProgram ' プログラムの初期化 SPACE = 0 ' 空点 BLACK = 1 ' 黒 WHITE = 2 ' 白 OB = 3 ' 盤外 BANDW = 4 ' 黒と白(CheckSpaceUnit()等で使用) UPPERA = Text.GetCharacterCode("A") ' Aの文字コード UPPERZ = Text.GetCharacterCode("Z") ' Zの文字コード LOWERA = Text.GetCharacterCode("a") ' aの文字コード LOWERZ = Text.GetCharacterCode("z") ' zの文字コード CR = 13 ' キャリッジリターン(復改)の文字コード LF = 10 ' ラインフィード(行送り)の文字コード TAB = 9 ' タブの文字コード cCR = Text.GetCharacter(CR) cLF = Text.GetCharacter(LF) cTab = Text.GetCharacter(TAB) sNL = cCR + cLF iRo = 5 sPlayer[BLACK] = "Random" ' 黒プレイヤー初期値 sPlayer[WHITE] = "CPU" ' 白プレイヤー初期値 sSGF = "temp.sgf" ' SGFファイル名初期値 rCX = 14 rCY = 22 rKomi = 0.0 GraphicsWindow.FontSize = rCY sBoardColor = "Wheat" iPass = 0 sStone[SPACE] = "SPACE" sStone[BLACK] = "BLACK" sStone[WHITE] = "WHITE" sStone[OB] = "OB" sGame = "対局" sOpen = "開く" sIsNotExist = "は存在しません。" sIsNotGoFormat = "は囲碁の棋譜ではありません。" sSave = "=" ' Windings 保存マーク sSave2 = "保存" sAlreadyExists = "はすでに存在します。" sNew = "新規" sReplay = "4" ' Windings 再生マーク sPause = ";" ' Windings ポーズマーク sPass = "パス" sResign = "投了" GraphicsWindow.Title = "Igo " + sVersion bInProgram = "True" InitEffect() ' 影響範囲座標の初期化 Init4() ' 四方の座標の初期化 iPlayOut = 1 ' モンテカルロ法のプレイアウト回数 EndSub ' Sub InitRoDepend ' 路数に依存する変数の初期化 For i = 0 To iRo sAlpha[i] = Text.GetSubText(" abcdefghijklmnopqrs", i + 1, 1) EndFor sAlpha[iRo + 1] = "t" ' パス EndSub ' Sub InitControls ' コントロール部の初期化 GraphicsWindow.BackgroundColor = "Silver" GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(iBX1 + rCX, iBY0 + idLY, iSR * 2, iSR * 2) iBHX = iBX1 + rCX + iSR * 2.5 iBHY = iBY0 + rCY * 2.5 oPrisoner[BLACK] = Shapes.AddText(0) Shapes.Move(oPrisoner[BLACK], iBHX, iBHY) iBLX = iBHX + rCX * 5 iBLY = iBHY bOn = "True" iX = iBLX iY = iBLY DrawLamp() oBlack = Controls.AddTextBox(iBX1 + rCX, iBY0) Controls.SetTextBoxText(oBlack, sPlayer[BLACK]) oWhite = Controls.AddTextBox(iBX1 + rCX, iBY0 + idLY * iRo / 2) Controls.SetTextBoxText(oWhite, sPlayer[WHITE]) oPass = Controls.AddButton(sPass, iBX1 + rCX, iBY0 + idLY * iRo) oResign = Controls.AddButton(sResign, iBX1 + rCX * 6, iBY0 + idLY * iRo) Controls.HideControl(oPass) Controls.HideControl(oResign) oSGF = Controls.AddTextBox(iBX1 + rCX, iBY0 + idLY * iRo) Controls.SetTextBoxText(oSGF, sSGF) oGame = Controls.AddButton(sGame, iBX1 + rCX, iBY0 + idLY * iRo + rCY * 2) oOpen = Controls.AddButton(sOpen, iBX1 + rCX * 6, iBY0 + idLY * iRo + rCY * 2) oNew = Controls.AddButton(sNew, iBX1 + rCX, iBY0 + idLY * iRo + rCY * 2) Controls.HideControl(oNew) GraphicsWindow.FontName = "Webdings" oReplay = Controls.AddButton(sReplay, iBX1 + rCX * 6, iBY0 + idLY * iRo + rCY * 2) GraphicsWindow.BrushColor = "Red" oSave = Controls.AddButton(sSave, iBX1 + rCX * 9, iBY0 + idLY * iRo + rCY * 2) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontName = "Tahoma" Controls.HideControl(oReplay) Controls.HideControl(oSave) iWHX = iBX1 + rCX + iSR * 2.5 iWHY = iBY0 + idLY * (iRo / 2) + rCY * 2.5 oPrisoner[WHITE] = Shapes.AddText(0) Shapes.Move(oPrisoner[WHITE], iWHX, iWHY) iWLX = iWHX + rCX * 5 iWLY = iWHY bOn = "False" iX = iWLX iY = iWLY DrawLamp() GraphicsWindow.BrushColor = "White" GraphicsWindow.FillEllipse(iBX1 + rCX, iBY0 + idLY * (iRo / 2 + 1), iSR * 2, iSR * 2) Controls.TextTyped = OnTextTyped EndSub ' Sub ResetControls ' コントロール部のリセット GraphicsWindow.BackgroundColor = "Silver" GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(iBX1 + rCX, iBY0 + idLY, iSR * 2, iSR * 2) iBHX = iBX1 + rCX + iSR * 2.5 iBHY = iBY0 + rCY * 2.5 Shapes.Move(oPrisoner[BLACK], iBHX, iBHY) Shapes.ShowShape(oPrisoner[BLACK]) iBLX = iBHX + rCX * 5 iBLY = iBHY bOn = "True" iX = iBLX iY = iBLY DrawLamp() Controls.Move(oBlack, iBX1 + rCX, iBY0) Controls.Move(oWhite, iBX1 + rCX, iBY0 + idLY * iRo / 2) Controls.ShowControl(oBlack) Controls.ShowControl(oWhite) Controls.Move(oPass, iBX1 + rCX, iBY0 + idLY * iRo) Controls.Move(oResign, iBX1 + rCX * 6, iBY0 + idLY * iRo) Controls.HideControl(oPass) Controls.HideControl(oResign) Controls.Move(oSGF, iBX1 + rCX, iBY0 + idLY * iRo) Controls.ShowControl(oSGF) Controls.Move(oGame, iBX1 + rCX, iBY0 + idLY * iRo + rCY * 2) Controls.Move(oOpen, iBX1 + rCX * 6, iBY0 + idLY * iRo + rCY * 2) Controls.Move(oNew, iBX1 + rCX, iBY0 + idLY * iRo + rCY * 2) Controls.ShowControl(oGame) Controls.ShowControl(oOpen) Controls.HideControl(oNew) Controls.Move(oReplay, iBX1 + rCX * 6, iBY0 + idLY * iRo + rCY * 2) Controls.Move(oSave, iBX1 + rCX * 9, iBY0 + idLY * iRo + rCY * 2) Controls.HideControl(oReplay) Controls.HideControl(oSave) iWHX = iBX1 + rCX + iSR * 2.5 iWHY = iBY0 + idLY * (iRo / 2) + rCY * 2.5 Shapes.Move(oPrisoner[WHITE], iWHX, iWHY) Shapes.ShowShape(oPrisoner[WHITE]) iWLX = iWHX + rCX * 5 iWLY = iWHY bOn = "False" iX = iWLX iY = iWLY DrawLamp() GraphicsWindow.BrushColor = "White" GraphicsWindow.FillEllipse(iBX1 + rCX, iBY0 + idLY * (iRo / 2 + 1), iSR * 2, iSR * 2) Controls.TextTyped = OnTextTyped Controls.HideControl(oSGF) Controls.HideControl(oGame) Controls.HideControl(oOpen) Controls.ShowControl(oPass) Controls.ShowControl(oResign) EndSub ' Sub DrawLamp ' ランプの表示 sSavedColor = GraphicsWindow.BrushColor GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle(iX + 1, iY + 1, 21, 7) GraphicsWindow.BrushColor = "DimGray" GraphicsWindow.FillRectangle(iX - 2, iY - 2, 21, 7) If bOn Then GraphicsWindow.BrushColor = "Lime" Else GraphicsWindow.BrushColor = "Black" EndIf GraphicsWindow.FillRectangle(iX, iY, 20, 6) GraphicsWindow.BrushColor = sSavedColor EndSub ' ' 思考ルーチン関連: Sub CreateRdmArray ' 乱空点列の作成 ClearRdmArray() For iY = 1 To iRo For iX = 1 To iRo If iBoard[iX][iY] = SPACE Then iRdmSeq = (iY - 1) * iRo + iX AddNumToRdmArray() EndIf EndFor EndFor EndSub ' Sub AddNumToRdmArray ' 乱空点列への空点の追加 iRdmNum = Math.GetRandomNumber(iRdmSeq) iRdmIdx = 0 For iCnt = 1 To iRdmNum - 1 iRdmIdx = iRdm[iRdmIdx] EndFor iRdm[iRdmSeq] = iRdm[iRdmIdx] iRdm[iRdmIdx] = iRdmSeq EndSub ' Sub ClearRdmArray ' 乱空点列のクリア iRdm[0] = 0 EndSub ' Sub CheckPossiblePut ' 着手可能かどうかのチェック bPossiblePut = "False" If iBoard[iX][iY] <> SPACE Then Goto lNotPossible ' すでに石がある EndIf If iMove > 1 And iKo = iMove - 1 And iKX = iX And iKY = iY Then Goto lNotPossible ' コウダテが必要 EndIf CheckSuiside() ' 自殺手のチェック If bSuiside Then Goto lNotPossible EndIf If bEyes Then ' 眼を守る CheckMyEye() ' 眼かどうか調べる If bMyEye Then ' 眼なら打たない(ただしコウを埋める手を除く) If iMove = 1 Or iKo <> iMove - 2 Or iKX <> iX Or iKY <> iY Then Goto lNotPossible EndIf EndIf EndIf bPossiblePut = "True" lNotPossible: EndSub ' Sub CheckSuiside ' 自殺手のチェック bSuiside = "False" iBoard[iX][iY] = iColor ' 仮に置く iXSave = iX iYSave = iY InitLiberty() CountLiberty() ' 活路を数える If iLiberty = 0 Then ' 自殺手かもしれない iCSave = iColor iColor = 3 - iColor ' 相手の石 For i = 1 To 4 ' 接点の石が取れるか iX = iXSave + idX4[i] iY = iYSave + idY4[i] If iX >= 1 And iX <= iRo And iY >= 1 And iY <= iRo And iBoard[iX][iY] = iColor Then InitLiberty() CountLiberty() ' 活路を数える If iLiberty = 0 Then Goto lNotSuiside EndIf EndIf EndFor bSuiside = "True" lNotSuiside: iColor = iCSave EndIf iX = iXSave iY = iYSave iBoard[iX][iY] = SPACE ' 元に戻す EndSub ' Sub Random ' 次の手を打つ - Random (コンピューター) bPass = "False" bResign = "False" iLast = 0 If iMove > iRo * iRo * 3 Then Goto lPassRandom EndIf While iRdm[iLast] > 0 iXY = iRdm[iLast] iX = Math.Remainder(iXY - 1, iRo) + 1 iY = Math.Floor((iXY - 1) / iRo) + 1 iColor = Math.Remainder((iMove - 1), 2) + 1 CheckPossiblePut() If bPossiblePut Then iBoard[iX][iY] = iColor iRdm[iLast] = iRdm[iXY] ' 乱空点列から空点を削除 Goto lExitRandom EndIf iLast = iXY EndWhile lPassRandom: bPass = "True" lExitRandom: EndSub ' Sub RemoveRdmEntry ' 乱空点列から空点 iXY を削除(前の手 iLast が不明な場合) iCPRRE = 0 While iRdm[iCPRRE] > 0 If iRdm[iCPRRE] = iXY Then iRdm[iCPRRE] = iRdm[iXY] ' 乱空点列から空点を削除 Goto lRRE2Exit EndIf iCPRRE = iRdm[iCPRRE] EndWhile lRRE2Exit: EndSub ' Sub Montecarlo ' モンテカルロ法によりコンピューターが次の手を打つ SaveBoard2() ' 碁盤を保存 rSKomi = rKomi ' コミを保存 iCP = 0 While iRdm[iCP] > 0 iXY = iRdm[iCP] iX = Math.Remainder(iXY - 1, iRo) + 1 iY = Math.Floor((iXY - 1) / iRo) + 1 CheckPossiblePut() ' iColor を参照 If bPossiblePut Then Goto lNextPut EndIf iCP = iXY EndWhile bPass = "True" Goto lPass lNextPut: SaveRdmArray() ' 乱空点列を保存(iCnt ← 空点の数) If iCnt = 0 Then bPass = "True" Goto lPass ElseIf iCnt > 35 Then iPlayOut = 6 ElseIf iCnt > 30 Then iPlayOut = 5 ElseIf iCnt > 20 Then iPlayOut = 4 ElseIf iCnt > 10 Then iPlayOut = 3 ElseIf iCnt > 5 Then iPlayOut = 2 Else iPlayOut = 1 EndIf SaveGameProperties() ' コウ、アゲハマ、パスを保存 iSMove = iMove ' 手数を保存 DumpMove() TextWindow.Write(":") iSColor = iColor ' 石の色を保存 If Math.Floor(rKomi) = 0.0 Then If iColor = BLACK Then rKomi = rKomi - 0.5 ElseIf iColor = WHITE Then rKomi = rKomi + 0.5 EndIf EndIf i = 0 While iSRdm[i] > 0 ' 空点に対し rWin[i] = 0.0 ' 勝ち数をクリア rLose[i] = 0.0 ' 負け数をクリア i = iSRdm[i] EndWhile bEyes = "True" ' 着手可能な手に自分の眼を含めない bShow = "False" ' 終局判定で結果を表示しない ' 盤面のダンプポイント - モンテカルロの手を決める直前 ' すべての乱空点列に対し、 rWMax = 0.0 ' 最大勝ち数 While iSRdm[iCP] > 0 iXY = iSRdm[iCP] iSXY = iXY iX = Math.Remainder(iXY - 1, iRo) + 1 iY = Math.Floor((iXY - 1) / iRo) + 1 CheckPossiblePut() If bPossiblePut = "False" Then DumpPoint() ' PlayOut の1手目 (iX, iY) を表示 TextWindow.Write("X ") Goto lNextPoint EndIf ' 着手可能な手について、 If bDumpWL Then DumpPoint() ' PlayOut の1手目 (iX, iY) を表示 EndIf For iG = 1 To iPlayOut ' 指定された回数、プレイアウトを行う iMove = iSMove - 1 ' 手数を1つ戻す RestoreBoard2() ' 碁盤を元に戻す CreateRdmArray() ' 碁盤を基に乱空点列を作り直す RestoreGameProperties() ' コウ、アゲハマ、パスを元に戻す PlayOut() ' 終局までプレイアウト ' 盤面のダンプポイント - プレイアウトの結果を見たいとき If iScore > 0 And iSColor = BLACK Or iScore < 0 And iSColor = WHITE Then rWin[iCP] = rWin[iCP] + 1.0 If bDumpWL Then TextWindow.Write("W") EndIf ElseIf iScore = 0 then rWin[iCP] = rWin[iCP] + 0.5 rLose[iCP] = rLose[iCP] + 0.5 If bDumpWL Then TextWindow.Write("D") EndIf Else rLose[iCP] = rLose[iCP] + 1.0 If bDumpWL Then TextWindow.Write("L") EndIf EndIf If bDumpWL Then TextWindow.Write(" ") EndIf If rWin[iCP] > rWMax Then rWMax = rWin[iCP] ' 最大勝ち数の更新 EndIf ' プレイアウト後、残り(iPlayOut - iG)すべて勝っても ' 最大勝ち数(rWMax)を超えられない場合は、 ' この初手によるプレイアウトは中止 If rWin[iCP] + iPlayOut - iG < rWMax + 1Then Goto lNextPoint EndIf EndFor lNextPoint: ' 最大勝ち数がプレイアウト回数(全勝)ならその手に打つ If rWin[iCP] = iPlayOut Then Goto lThisPoint EndIf iCP = iSXY iColor = iSColor iMove = iSMove RestoreBoard2() EndWhile lThisPoint: If bDumpWL Then DumpNewLine() EndIf ' rMax = 0.0 i = 0 While iSRdm[i] > 0 rAve[i] = rWin[i] / (rWin[i] + rLose[i]) If rAve[i] > rMax Then rMax = rAve[i] EndIf i = iSRdm[i] EndWhile i = 0 iS = 0 While iSRdm[iS] > 0 If rAve[iS] = rMax Then iRdm[i] = iSRdm[iS] i = iRdm[i] EndIf iS = iSRdm[iS] EndWhile iRdm[i] = 0 RestoreBoard2() ' 碁盤を元に戻す rKomi = rSKomi ' コミを元に戻す RestoreGameProperties() ' コウ、アゲハマ、パスを元に戻す iMove = iSMove ' 手数を元に戻す iColor = iSColor ' 石の色を元に戻す Random() ' 同じ勝率の手からランダムに選ぶ RestoreRdmArray() ' 乱空点列を元に戻す RemoveRdmEntry() ' 乱空点列からiXYを削除 lPass: EndSub ' Sub PlayOut ' 終局までプレイアウト iColor = BLACK If Math.Remainder(iSMove, 2) = 0 Then iColor = WHITE Goto lNextWhite EndIf lNextBlack: ' 黒番 iMove = iMove + 1 iColor = BLACK ' Random(), RemoveCaputuredStones()で参照 If iMove = iSMove Then iXY = iSRdm[iCP] iX = Math.Remainder(iXY - 1, iRo) + 1 iY = Math.Floor((iXY - 1) / iRo) + 1 iBoard[iX][iY] = iColor RemoveRdmEntry() ' 乱空点列からiXYを削除 bPass = "False" Else Random() EndIf If bPass Then iPass = iPass + 1 Else iPass = 0 iColor = BLACK RemoveCapturedStones() ' 取られた石を取り除く EndIf ' デバッグヒント:ここで盤面をダンプするとプレイアウトを観戦できる Judge() If bInGame <> "True" Then Goto lEndGame EndIf lNextWhite: ' 白番 iMove = iMove + 1 iColor = WHITE ' Random(), RemoveCaputuredStones()で参照 If iMove = iSMove Then iXY = iSRdm[iCP] iX = Math.Remainder(iXY - 1, iRo) + 1 ' 最初の手 iY = Math.Floor((iXY - 1) / iRo) + 1 ' 最初の手 iBoard[iX][iY] = iColor RemoveRdmEntry() ' 乱空点列からiXYを削除 bPass = "False" Else Random() EndIf If bPass Then iPass = iPass + 1 Else iPass = 0 RemoveCapturedStones() ' 取られた石を取り除く EndIf ' デバッグヒント:ここで盤面をダンプするとプレイアウトを観戦できる Judge() If bInGame Then Goto lNextBlack EndIf ' lEndGame: EndSub ' Sub SaveRdmArray ' 乱空点列の保存 i = 0 iCnt = 0 While iRdm[i] > 0 iSRdm[i] = iRdm[i] i = iRdm[i] iCnt = iCnt + 1 EndWhile iSRdm[i] = 0 EndSub ' Sub RestoreRdmArray ' 乱空点列の復元 i = 0 While iSRdm[i] > 0 iRdm[i] = iSRdm[i] i = iSRdm[i] EndWhile iRdm[i] = 0 EndSub ' Sub Human ' 人が次の手を打つ bPass = "False" bResign = "False" GraphicsWindow.MouseDown = OnMouseDown Controls.ButtonClicked = OnButtonClicked iColor = Math.Remainder((iMove - 1), 2) + 1 While "True" bOutOfBoard = "True" While bOutOfBoard bNotClicked = "True" While bNotClicked Program.Delay(200) EndWhile If bPass Or bResign Then Goto lPossiblePut EndIf GetPosition() EndWhile CheckPossiblePut() If bPossiblePut Then Goto lPossiblePut EndIf If bSound Then Sound.PlayChimeAndWait() EndIf EndWhile lPossiblePut: GraphicsWindow.MouseDown = DoNothing Controls.ButtonClicked = DoNothing If bPass = "False" And bResign = "False" Then iBoard[iX][iY] = iColor iXY = (iY - 1) * iRo + iX RemoveRdmEntry() ' 乱空点列から空点を削除 EndIf EndSub ' Sub OnMouseDown ' マウスが押されたときの処理 iMX = GraphicsWindow.MouseX iMY = GraphicsWindow.MouseY bNotClicked = "False" EndSub ' Sub OnButtonClicked ' ボタンが押されたときの処理 If Controls.LastClickedButton = oResign Then bResign = "True" bNotClicked = "False" ElseIf Controls.LastClickedButton = oPass Then bPass = "True" bNotClicked = "False" EndIf EndSub ' Sub GetPosition ' マウスをクリックした座標から碁盤の座標を得る iX = Math.Floor((iMX - iLX0 + idLX / 2) / idLX) + 1 iY = Math.Floor((iMY - iLY0 + idLY / 2) / idLY) + 1 If iX < 1 Or iX > iRo Or iY < 1 Or iY > iRo Then bOutOfBoard = "True" Else bOutOfBoard = "False" EndIf EndSub ' Sub DoNothing ' なにもしない(イベント処理用) EndSub ' Sub Replay ' 次の手を打つ - Replay (棋譜の再生) If iMove > iNumRec Then bResign = "True" Else iColor = iRecord[iMove]["turn"] iX = iRecord[iMove]["x"] iY = iRecord[iMove]["y"] If iX = iRo + 1 Then bPass = "True" Else iBoard[iX][iY] = iColor bPass = "False" EndIf EndIf Program.Delay(200) EndSub ' ' ゲーム関連: Sub InputGameInfo ' 新規モード - 対戦者名(または棋譜名)の入力 bShowMove = "False" bInGame = "True" bReplay = "False" bResign = "False" GraphicsWindow.Title = "Igo " + sVersion Controls.ShowControl(oGame) Controls.ShowControl(oOpen) Controls.ShowControl(oSGF) Controls.HideControl(oPass) Controls.HideControl(oResign) Controls.ButtonClicked = OnButtonClicked1 bNotClicked = "True" If bAuto Then bNotClicked = "False" ' 自動運転のため bOpen = "False" ' 自動運転のため EndIf While bNotClicked Program.Delay(200) EndWhile Controls.HideControl(oGame) Controls.HideControl(oOpen) Controls.HideControl(oSGF) Controls.ShowControl(oPass) Controls.ShowControl(oResign) EndSub ' Sub OnTextTyped ' TextBoxイベント処理 If Controls.LastTypedTextBox = oBlack Then sPlayer[BLACK] = Controls.GetTextBoxText(oBlack) ElseIf Controls.LastTypedTextBox = oWhite Then sPlayer[WHITE] = Controls.GetTextBoxText(oWhite) ElseIf Controls.LastTypedTextBox = oSGF Then sSGF = Controls.GetTextBoxText(oSGF) EndIf EndSub ' Sub OnButtonClicked1 ' 新規モードのボタンイベント処理 If Controls.LastClickedButton = oGame Then bNotClicked = "False" bOpen = "False" ElseIf Controls.LastClickedButton = oOpen Then bNotClicked = "False" bOpen = "True" EndIf EndSub ' Sub InputGameEndInfo ' 終了モード - 再生, 保存または新規ボタンの入力 bShowMove = "True" bInGame = "True" bReplay = "False" bSave = "False" bResign = "False" Controls.HideControl(oPass) Controls.HideControl(oResign) Controls.ShowControl(oNew) Controls.ShowControl(oReplay) Controls.ShowControl(oSave) Controls.ShowControl(oSGF) Controls.ButtonClicked = OnButtonClicked2 bNotClicked = "True" If bAuto Then bNotClicked = "False" ' 自動運転のため bOpen = "False" ' 自動運転のため bSave = "False" ' 自動運転のため bReplay = "False" ' 自動運転のため bInGame = "False" ' 自動運転のため EndIf While bNotClicked Program.Delay(200) EndWhile Controls.HideControl(oNew) Controls.HideControl(oReplay) Controls.HideControl(oSave) Controls.HideControl(oSGF) EndSub ' Sub OnButtonClicked2 ' 終了モードのボタンイベント処理 If Controls.LastClickedButton = oNew Then bNotClicked = "False" bSave = "False" bReplay = "False" bInGame = "False" ElseIf Controls.LastClickedButton = oSave Then bNotClicked = "False" bSave = "True" bReplay = "False" bInGame = "True" ElseIf Controls.LastClickedButton = oReplay Then If iNumRec > 0 Then bNotClicked = "False" bReplay = "True" bSave = "False" bInGame = "True" Else If bSound Then Sound.PlayChimeAndWait() EndIf EndIf EndIf EndSub ' Sub RemoveUnit ' 連を取り除く For i = 1 To iUnit iX = iUX[i] iY = iUY[i] iBoard[iX][iY] = SPACE iRdmSeq = (iY - 1) * iRo + iX AddNumToRdmArray() ' 乱空点列に連を追加する If bShow Then EraseStone() EndIf EndFor EndSub ' Sub InitLiberty ' 活路を数える準備 For iXL = 0 To iRo + 1 For iYL = 0 To iRo + 1 bNotChecked[iXL][iYL] = "True" EndFor EndFor iLiberty = 0 iUnit = 0 EndSub ' Sub CountLiberty ' 連の活路を数える Stack.PushValue("liberty", iXSave) Stack.PushValue("liberty", iYSave) Stack.PushValue("liberty", i) iXSave = iX iYSave = iY If bNotChecked[iX][iY] Then bNotChecked[iX][iY] = "False" If iBoard[iX][iY] = SPACE Then iLiberty = iLiberty + 1 ElseIf iBoard[iX][iY] = iColor Then iUnit = iUnit + 1 iUX[iUnit] = iX iUY[iUnit] = iY For i = 1 To 4 iX = iXSave + idX4[i] iY = iYSave + idY4[i] CountLiberty() EndFor EndIf EndIf i = Stack.PopValue("liberty") iYSave = Stack.PopValue("liberty") iXSave = Stack.PopValue("liberty") EndSub ' Sub CheckSpaceUnitInTerritory ' 地の空点の連を調べる Stack.PushValue("space", iXSave) Stack.PushValue("space", iYSave) Stack.PushValue("space", i) iXSave = iX iYSave = iY If bNotChecked[iX][iY] Then bNotChecked[iX][iY] = "False" If iTerritory[iX][iY] = SPACE Then iUnit = iUnit + 1 iUX[iUnit] = iX iUY[iUnit] = iY For i = 1 To 4 iX = iXSave + idX4[i] iY = iYSave + idY4[i] CheckSpaceUnitInTerritory() EndFor ElseIf iTerritory[iX][iY] = BLACK Then If iColor = SPACE Then iColor = BLACK ElseIf iColor = WHITE Then iColor = BANDW EndIf ElseIf iTerritory[iX][iY] = WHITE Then If iColor = SPACE Then iColor = WHITE ElseIf iColor = BLACK Then iColor = BANDW EndIf EndIf EndIf i = Stack.PopValue("space") iYSave = Stack.PopValue("space") iXSave = Stack.PopValue("space") EndSub ' Sub CheckSpaceUnit ' 空点の連を調べる Stack.PushValue("space", iXSave) Stack.PushValue("space", iYSave) Stack.PushValue("space", i) iXSave = iX iYSave = iY If bNotChecked[iX][iY] Then bNotChecked[iX][iY] = "False" If iBoard[iX][iY] = SPACE Then iUnit = iUnit + 1 iUX[iUnit] = iX iUY[iUnit] = iY For i = 1 To 4 iX = iXSave + idX4[i] iY = iYSave + idY4[i] CheckSpaceUnit() EndFor ElseIf iBoard[iX][iY] = BLACK Then If iColor = SPACE Then iColor = BLACK ElseIf iColor = WHITE Then iColor = BANDW EndIf ElseIf iBoard[iX][iY] = WHITE Then If iColor = SPACE Then iColor = WHITE ElseIf iColor = BLACK Then iColor = BANDW EndIf EndIf EndIf i = Stack.PopValue("space") iYSave = Stack.PopValue("space") iXSave = Stack.PopValue("space") EndSub ' Sub CheckMyEye ' (単独の)眼かどうか調べる bMyEye = "False" If iBoard[iX][iY] = SPACE Then For i = 1 To 4 iX1 = iX + idX4[i] iY1 = iY + idY4[i] iC1 = iBoard[iX1][iY1] If iC1 = 3 - iColor Or iC1 = SPACE Then ' 相手の石か空 Goto lNotMyEye EndIf EndFor EndIf bMyEye = "True" lNotMyEye: EndSub ' Sub CheckEye ' (単独の)眼かどうか調べる If iBoard[iX][iY] = SPACE Then iColor = SPACE For i = 1 To 4 iX1 = iX + idX4[i] iY1 = iY + idY4[i] iC1 = iBoard[iX1][iY1] If iC1 = SPACE Then iColor = SPACE Goto lCExit ElseIf iC1 <> OB Then If iColor = 3 - iC1 Then iColor = SPACE Goto lCExit EndIf iColor = iC1 EndIf EndFor EndIf lCExit: EndSub ' Sub Judge ' 終局の判定 bInGame = "True" If iPass >= 2 Then bInGame = "False" CountScore() ' 勝敗の判定 If bEasy = "False" Then AdjustTerritory() ' 地の調整 EndIf iScore = iScore + rKomi ' コミの計算 If bShow Then DrawTerritory() ' 地の描画 XDeadStones() ' 死に石に×を付ける If iScore > 0 Then sScore = "B+" + iScore GraphicsWindow.Title = "Igo " + sVersion + " - 黒の" + iScore + "目勝ち" ElseIf iScore < 0 Then sScore = "W+" + (-iScore) GraphicsWindow.Title = "Igo " + sVersion + " - 白の" + (-iScore) + "目勝ち" Else ' iScore = 0 sScore = "0" GraphicsWindow.Title = "Igo " + sVersion + " - 引き分け(持碁)" EndIf EndIf EndIf EndSub ' Sub CountScore ' 勝敗の判定 EvalBoard() ' 地の認識 iBlackScore = iBlackScore + iPrisoner[BLACK] ' アゲハマを加える iWhiteScore = iWhiteScore + iPrisoner[WHITE] ' アゲハマを加える iBlackScore = iBlackScore + iDead[WHITE] ' 死に石を加える iWhiteScore = iWhiteScore + iDead[BLACK] ' 死に石を加える iScore = iBlackScore - iWhiteScore EndSub ' Sub AdjustTerritory ' 地の調整 ' 一方の石に囲まれている空白は地iTerritory[][]に加える For iY = 1 To iRo For iX = 1 To iRo If iTerritory[iX][iY] = SPACE Then InitLiberty() iColor = SPACE iXSave = iX iYSave = iY CheckSpaceUnitInTerritory() iX = iXSave iY = iYSave If iColor = BLACK Then For i = 1 To iUnit iTerritory[iUX[i]][iUY[i]] = BLACK EndFor iBlackScore = iBlackScore + iUnit ElseIf iColor = WHITE Then For i = 1 To iUnit iTerritory[iUX[i]][iUY[i]] = WHITE EndFor iWhiteScore = iWhiteScore + iUnit EndIf EndIf EndFor ' iX EndFor ' iY iScore = iBlackScore - iWhiteScore EndSub ' Sub EvalBoard ' 盤面の評価 iCSave = iColor If bEasy Then For iY = 1 To iRo For iX = 1 To iRo If iBoard[iX][iY] = SPACE Then ' 単独の眼を地として点数に加える CheckEye() If iColor = BLACK Then iBlackScore = iBlackScore + 1 ElseIf iColor = WHITE Then iWhiteScore = iWhiteScore + 1 EndIf EndIf EndFor ' iX EndFor ' iY Else iDead[BLACK] = 0 iDead[WHITE] = 0 iDeadSum = 0 For iY = 1 To iRo For iX = 1 To iRo iBlackEffect[iX][iY] = 0 iWhiteEffect[iX][iY] = 0 iTerritory[iX][iY] = SPACE EndFor EndFor SaveBoard() ' 活路 iLiberty =1 の連をiBoard[][]から消し、死に石として記憶する For iY = 1 To iRo For iX = 1 To iRo If iBoard[iX][iY] <> SPACE Then iColor = iBoard[iX][iY] iXSave = iX iYSave = iY InitLiberty() CountLiberty() If iLiberty = 1 Then For i = 1 To iUnit iX = iUX[i] iY = iUY[i] iBoard[iX][iY] = SPACE iDeadSum = iDeadSum + 1 iDX[iDeadSum] = iX iDY[iDeadSum] = iY EndFor iDead[iColor] = iDead[iColor] + iUnit EndIf iX = iXSave iY = iYSave EndIf EndFor ' iX EndFor ' iY ' 石の影響範囲を計算する For iY = 1 To iRo For iX = 1 To iRo If iBoard[iX][iY] = BLACK Then SetBlackEffect() ElseIf iBoard[iX][iY] = WHITE Then SetWhiteEffect() EndIf EndFor EndFor iBlackScore = 0 ' 黒の地を数える iWhiteScore = 0 ' 白の地を数える For iY = 1 To iRo For iX = 1 To iRo If iBoard[iX][iY] = BLACK Then iTerritory[iX][iY] = BLACK ElseIf iBoard[iX][iY] = WHITE Then iTerritory[iX][iY] = WHITE Else If iBlackEffect[iX][iY] > iWhiteEffect[iX][iY] Then iTerritory[iX][iY] = BLACK iBlackScore = iBlackScore + 1 ElseIf iBlackEffect[iX][iY] < iWhiteEffect[iX][iY] Then iTerritory[iX][iY] = WHITE iWhiteScore = iWhiteScore + 1 EndIf EndIf EndFor EndFor RestoreBoard() EndIf iColor = iCSave EndSub ' Sub SaveBoard ' 碁盤の保存(盤面の評価用) For iY = 1 To iRo For iX = 1 To iRo iSaved[iX][iY] = iBoard[iX][iY] EndFor EndFor EndSub ' Sub RestoreBoard ' 碁盤の復元(盤面の評価用) For iY = 1 To iRo For iX = 1 To iRo iBoard[iX][iY] = iSaved[iX][iY] EndFor EndFor EndSub ' Sub SaveBoard2 ' 碁盤の保存2(モンテカルロ用) For iY = 1 To iRo For iX = 1 To iRo iSaved2[iX][iY] = iBoard[iX][iY] EndFor EndFor EndSub ' Sub RestoreBoard2 ' 碁盤の復元2(モンテカルロ用) For iY = 1 To iRo For iX = 1 To iRo iBoard[iX][iY] = iSaved2[iX][iY] EndFor EndFor EndSub ' Sub SaveGameProperties ' ゲーム属性の保存 iSKo = iKo iSKX = iKX iSKY = iKY iSPrisoner[BLACK] = iPrisoner[BLACK] iSPrisoner[WHITE] = iPrisoner[WHITE] iSPass = iPass EndSub ' Sub RestoreGameProperties ' ゲーム属性の復元 iKo = iSKo iKX = iSKX iKY = iSKY iPrisoner[BLACK] = iSPrisoner[BLACK] iPrisoner[WHITE] = iSPrisoner[WHITE] iPass = iSPass EndSub ' Sub Init4 ' 四方の座標差分の初期化 ' [1]=右 [2]=上 [3]=左 [4]=下 idX4 = "1=1;2=0;3=-1;4=0;" idY4 = "1=0;2=-1;3=0;4=1;" EndSub ' Sub InitEffect ' 影響範囲(距離2)の座標差分の初期化 ' [1]=一番上 [2]=左上 [3]=上 [4]=右上 [5]=一番左 [6]=左 [7]=中央 [8]=右 [9]=一番右 [10]=左下 [11]=下 [12]=右下 [13]=一番下 idXE = "1=0;2=-1;3=0;4=1;5=-2;6=-1;7=0;8=1;9=2;10=-1;11=0;12=1;13=0;" idYE = "1=-2;2=-1;3=-1;4=-1;5=0;6=0;7=0;8=0;9=0;10=1;11=1;12=1;13=2;" EndSub ' Sub SetBlackEffect For i = 1 To 13 iXE = iX + idXE[i] iYE = iY + idYE[i] If iXE > 0 And iXE <= iRo And iYE > 0 And iYE <= iRo Then iBlackEffect[iXE][iYE] = iBlackEffect[iXE][iYE] + 1 EndIf EndFor EndSub ' Sub SetWhiteEffect For i = 1 To 13 iXE = iX + idXE[i] iYE = iY + idYE[i] If iXE > 0 And iXE <= iRo And iYE > 0 And iYE <= iRo Then iWhiteEffect[iXE][iYE] = iWhiteEffect[iXE][iYE] + 1 EndIf EndFor EndSub ' Sub InitBoard ' 盤の初期化 For i = 0 To iRo + 1 iBoard[0][i] = OB iBoard[iRo + 1][i] = OB iBoard[i][0] = OB iBoard[i][iRo + 1] = OB EndFor idLX = rCX * 3 ' 線の間隔 iSR = idLX / 2 - 2 ' 碁石の半径 idLY = rCY * 2 ' 線の間隔 iLX0 = rCX * 6.5 ' 左端の線 iLY0 = rCY * 4.5 ' 上端の線 iLX1 = iLX0 + idLX * (iRo - 1) ' 右端の線 iLY1 = iLY0 + idLY * (iRo - 1) ' 下端の線 If iRo > 9 Then iBX0 = iLX0 - idLX * 2 ' 盤の左端 Else iBX0 = iLX0 - idLX * 1.5 ' 盤の左端 EndIf iBY0 = iLY0 - idLY * 1.5 ' 盤の上端 iBX1 = iLX1 + idLX ' 盤の右端 iBY1 = iLY1 + idLY ' 盤の下端 EndSub ' Sub ClearBoard ' 盤面のクリア For iX = 1 To iRo For iY = 1 To iRo iBoard[iX][iY] = SPACE EndFor EndFor iPrisoner[BLACK] = 0 iPrisoner[WHITE] = 0 Controls.SetTextBoxText(oPrisoner[BLACK], 0) Controls.SetTextBoxText(oPrisoner[WHITE], 0) EndSub ' ' グラフィックス関連: Sub ShowBoard ' 盤の表示 ' 盤の色を塗る GraphicsWindow.BrushColor = sBoardColor GraphicsWindow.FillRectangle(iBX0, iBY0, iBX1 - iBX0, iBY1 - iBY0) ' 枠を描く iPW = GraphicsWindow.PenWidth GraphicsWindow.PenWidth = 4 GraphicsWindow.DrawRectangle(iLX0, iLY0, idLX * (iRo - 1), idLY * (iRo - 1)) GraphicsWindow.PenWidth = iPW ' 線を描く GraphicsWindow.PenColor = "Black" For iX = iLX0 To iLX1 Step idLX GraphicsWindow.DrawLine(iX, iLY0, iX, iLY1) EndFor For iY = iLY0 To iLY1 Step idLY GraphicsWindow.DrawLine(iLX0, iY, iLX1, iY) EndFor ' 数字を書く GraphicsWindow.BrushColor = "Black" For iX = 1 To iRo If iX < 10 Then GraphicsWindow.DrawText(iLX0 + (iX - 1.2) * idLX, iLY0 - idLY - 3, iX) Else GraphicsWindow.DrawText(iLX0 + (iX - 1.2) * idLX - rCX / 2, iLY0 - idLY - 3, iX) EndIf EndFor For iY = 1 To iRo If iY < 10 Then GraphicsWindow.DrawText(iLX0 - idLX, iLY0 + (iY - 1.25) * idLY - 3, iY) Else GraphicsWindow.DrawText(iLX0 - idLX - rCX, iLY0 + (iY - 1.25) * idLY - 3, iY) EndIf EndFor EndSub ' Sub DrawStone ' 碁石を描く If iColor = WHITE Then iStoneColor = "White" iNumColor = "Black" ElseIf iColor = BLACK Then iStoneColor = "Black" iNumColor = "White" EndIf If iColor = BLACK Or iColor = WHITE Then GraphicsWindow.BrushColor = iStoneColor GraphicsWindow.FillEllipse(iLX0 + (iX - 1) * idLX - iSR, iLY0 + (iY - 1) * idLY - iSR, iSR * 2, iSR * 2) If bShowMove Then rNY = rCY * 0.8 GraphicsWindow.FontSize = rNY If iMove > 99 Then iND = 3 ElseIf iMove > 9 Then iND = 2 Else iND = 1 EndIf iNX = iLX0 + (iX - 1) * idLX - rNY * iND / 3 iNY = iLY0 + (iY - 1) * idLY - rNY / 2 - 2 GraphicsWindow.BrushColor = iNumColor GraphicsWindow.DrawText(iNX, iNY, iMove) GraphicsWindow.FontSize = rCY EndIf EndIf EndSub ' Sub EraseStone ' 碁石を消す ' 碁石を碁盤の色で消す GraphicsWindow.BrushColor = sBoardColor GraphicsWindow.FillRectangle(iLX0 + (iX - 1) * idLX - iSR, iLY0 + (iY - 1) * idLY - iSR, iSR * 2, iSR * 2) GraphicsWindow.PenColor = "Black" ' 横線の引き直し If iX = 1 Then iEX0 = iLX0 Else iEX0 = iLX0 + (iX - 1) * idLX - iSR EndIf If iX = iRo Then iEX1 = iLX0 + (iX - 1) * idLX Else iEX1 = iLX0 + (iX - 1) * idLX + iSR EndIf iEY0 = iLY0 + (iY - 1) * idLY iEY1 = iLY0 + (iY - 1) * idLY iPW = GraphicsWindow.PenWidth If iY = 1 Or iY = iRo Then GraphicsWindow.PenWidth = 4 GraphicsWindow.DrawLine(iEX0 - 2, iEY0, iEX1 + 2, iEY1) Else GraphicsWindow.DrawLine(iEX0, iEY0, iEX1, iEY1) EndIf GraphicsWindow.PenWidth = iPW ' 縦線の引き直し iEX0 = iLX0 + (iX - 1) * idLX iEX1 = iLX0 + (iX - 1) * idLX If iY = 1 Then iEY0 = iLY0 Else iEY0 = iLY0 + (iY - 1) * idLY - iSR EndIf If iY = iRo Then iEY1 = iLY0 + (iY - 1) * idLY Else iEY1 = iLY0 + (iY - 1) * idLY + iSR EndIf If iX = 1 Or iX = iRo Then GraphicsWindow.PenWidth = 4 GraphicsWindow.DrawLine(iEX0, iEY0 - 2, iEX1, iEY1 + 2) Else GraphicsWindow.DrawLine(iEX0, iEY0, iEX1, iEY1) EndIf GraphicsWindow.PenWidth = iPW EndSub ' Sub XDeadStones ' 碁石に×を付ける If iDeadSum > 0 Then sPC = GraphicsWindow.PenColor GraphicsWindow.PenColor = "Red" iPW = GraphicsWindow.PenWidth GraphicsWindow.PenWidth = 4 For i = 1 To iDeadSum iX = iDX[i] iY = iDY[i] GraphicsWindow.DrawLine(iLX0 + (iX - 1) * idLX - iSR / 2, iLY0 + (iY - 1) * idLY - iSR / 2, iLX0 + (iX - 1) * idLX + iSR / 2, iLY0 + (iY - 1) * idLY + iSR / 2) GraphicsWindow.DrawLine(iLX0 + (iX - 1) * idLX + iSR / 2, iLY0 + (iY - 1) * idLY - iSR / 2, iLX0 + (iX - 1) * idLX - iSR / 2, iLY0 + (iY - 1) * idLY + iSR / 2) EndFor GraphicsWindow.PenColor = sPC GraphicsWindow.PenWidth = iPW EndIf EndSub ' Sub DrawTerritory ' 地に四角を描く For iY = 1 To iRo For iX = 1 To iRo If iBoard[iX][iY] = SPACE And iTerritory[iX][iY] = BLACK Then GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(iLX0 + (iX - 1) * idLX - iSR / 2, iLY0 + (iY - 1) * idLY - iSR / 2, iSR, iSR) ElseIf iBoard[iX][iY] = SPACE And iTerritory[iX][iY] = WHITE Then GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle(iLX0 + (iX - 1) * idLX - iSR / 2, iLY0 + (iY - 1) * idLY - iSR / 2, iSR, iSR) EndIf EndFor EndFor EndSub ' ' 棋譜ファイル関連: Sub InitRecord ' 棋譜の初期化 iNumRec = 0 EndSub ' Sub Record ' 棋譜の記録 iNumRec = iNumRec + 1 If bPass Then iX = iRo + 1 iY = iRo + 1 EndIf iRecord[iNumRec]["x"] = iX iRecord[iNumRec]["y"] = iY iRecord[iNumRec]["turn"] = iColor EndSub ' Sub ReplayGame ' 棋譜による対局の再生 bShowMove = "True" ClearBoard() ' 盤面のクリア ShowBoard() ' 盤の表示 Shapes.SetText(oPrisoner[BLACK], 0) ' アゲハマのクリア Shapes.SetText(oPrisoner[WHITE], 0) ' アゲハマのクリア iMove = 0 ' 手数のクリア bInGame = "True" bReplay = "True" While bInGame EachTurn() ' 黒番 If bInGame Then EachTurn() ' 白番 EndIf EndWhile bInGame = "True" EndSub ' ' 以下の3つのサブルーチンはダミーです。棋譜の入出力を行うときは、 ' 実際のプログラムはプログラムID DWG627として発行しましたので、 ' そちらからインポートして組み込んでください。 ' Sub WriteRecord ' 棋譜ファイルの書き出し(保存) EndSub ' Sub ReadRecord ' 棋譜ファイルの読み込み(開く) bError = "False" EndSub ' Sub SaveGameDate ' 棋譜出力用の日付を保存 EndSub ' ' デバッグ関連: Sub DumpPoint TextWindow.Write("(" + iX + "," + iY + ")") EndSub ' Sub DumpNewLine TextWindow.WriteLine("") EndSub ' Sub DumpMove TextWindow.Write(iMove) EndSub ' Sub StartClock ' サブルーチン StartClock - 時��を開始する iBeginTime = Clock.ElapsedMilliseconds iEms = iBeginTime TextWindow.Write("Start: ") PrintClock() TextWindow.Write(" ") EndSub ' Sub StopClock ' サブルーチン StopClock - 時計を終了する iEndTime = Clock.ElapsedMilliseconds iEms = iEndTime TextWindow.Write("Stop: ") PrintClock() TextWindow.Write(" ") EndSub ' Sub PrintTime ' サブルーチン PrintTime - 時間を出力する iEms = iEndtime - iBeginTime TextWindow.Write("Time: ") PrintClock() TextWindow.WriteLine("") EndSub ' Sub PrintClock ' サブルーチン PrintClock - 時刻を出力する ConvertEmsToTime() TextWindow.Write(iTime["Hour"] + ":" + iTime["Munite"] + ":" + iTime["Second"]) EndSub ' Sub ConvertEmsToTime ' サブルーチン ConvertEmsToTime - Emsを時分秒に変換する iHMSMs = Math.Remainder(iEms, 24 * 60 * 60 * 1000) iTime["Hour"] = Math.Floor(iHMSMs / (60 * 60 * 1000)) iMSMs = Math.Remainder(iHMSMs, 60 * 60 * 1000) iTime["Munite"] = Math.Floor(iMSMs / (60 * 1000)) iSMs = Math.Remainder(iMSMs, 60 * 1000) iTime["Second"] = Math.Floor(iSMs / 1000) EndSub End>GCS192.sb< Start>GCS343.sb< 'Open ComPort ComPort.OpenPort("com5",115200) 'Building the screen with layout image cycle = 0 GraphicsWindow.Title = "Bankquay Railway" GraphicsWindow.Height = 700 GraphicsWindow.Width = 900 'Determine filepath ' The following line could be harmful and has been automatically commented. ' Path = File.GetSettingsFilePath() For i = Text.GetLength(Path) To 1 Step -1 If Text.GetSubText(Path,i,1) = "\" Then Goto BuildPath EndIf EndFor BuildPath: For j = 1 to i ModelPath = Text.Append(ModelPath,Text.GetSubText(Path,j,1)) Endfor 'Load track image and write filepath LayoutImage = ImageList.LoadImage (ModelPath + "tracklayout2.bmp") GraphicsWindow.DrawImage (LayoutImage, 0 , 0 ) GraphicsWindow.DrawText (3,681,ModelPath) 'Defining signal control positions on the screen For i = 0 To 63 S[i] = 0 'Danger=0 Safe=1 NS[i] = 1 SK[i] = 0 'Not manual set=0 Manual set=1 'Open block keys are set to 1 as default If (i>0 And i<5) Or i=28 Or i=29 Or i=34 Or i=40 Or i=42 Or i=45 Or i=47 Or (i>54 And i<59) Then SK[i]=1 EndIf SL[i] = 0 'Red=0 Yellow=1 Green=2 WS[i] = 0 DIV[i] = 0 NDIV[i] = 1 RV[i] = 0 NRV[i] = 1 B[i] = 1 SB[i]=1 WB[i]=1 EndFor 'Signal Key Positions on screen read from SignalKey.txt Sn=0 For i = 1 To 64 ' The following line could be harmful and has been automatically commented. ' Read = File.ReadLine(ModelPath+"SignalKey.txt",i) k=0 For n = 1 To Text.GetLength (Read) If Text.GetSubText (Read,n,1) = "," Then k=k+1 Kpos[k] = n EndIf EndFor Sn = Text.GetSubText (Read,1,Kpos[1]-1) XposSK[Sn] = Text.GetSubText (Read,Kpos[1]+1,Kpos[2]-Kpos[1]-1) YposSK[Sn] = Text.GetSubText (Read,Kpos[2]+1,Text.GetLength(Read)-Kpos[2]) EndFor 'Point Key Positions on screen read from PointKey.txt Wn=0 For i = 1 To 43 ' The following line could be harmful and has been automatically commented. ' Read = File.ReadLine(ModelPath+"PointKey.txt",i) k=0 For n = 1 To Text.GetLength (Read) If Text.GetSubText (Read,n,1) = "," Then k=k+1 Kpos[k] = n EndIf EndFor Wn = Text.GetSubText (Read,1,Kpos[1]-1) XposW[Wn] = Text.GetSubText (Read,Kpos[1]+1,Kpos[2]-Kpos[1]-1) YposW[Wn] = Text.GetSubText (Read,Kpos[2]+1,Text.GetLength(Read)-Kpos[2]) EndFor For i = 1 To 43 WK[i]=0 EndFor 'Define block-engaged indicator lines read from BlockLines.txt GraphicsWindow.PenColor = "Red" Bn = 0 For i = 0 To 63 ' The following line could be harmful and has been automatically commented. ' Read = File.ReadLine(ModelPath+"BlockLines.txt",i+1) k=0 For n = 1 To Text.GetLength (Read) If Text.GetSubText (Read,n,1) = "," Then k=k+1 Kpos[k] = n EndIf EndFor Bn = Text.GetSubText (Read,1,Kpos[1]-1) x1 = Text.GetSubText (Read,Kpos[1]+1,Kpos[2]-Kpos[1]-1) y1 = Text.GetSubText (Read,Kpos[2]+1,Kpos[3]-Kpos[2]-1) x2 = Text.GetSubText (Read,Kpos[3]+1,Kpos[4]-Kpos[3]-1) y2 = Text.GetSubText (Read,Kpos[4]+1,Text.GetLength(Read)-Kpos[4]) Bind[Bn] = Shapes.AddLine (x1,y1,x2,y2) Endfor 'Define Point Indicators, positions read from PointLines.txt GraphicsWindow.PenColor = "Yellow" Wn = 0 For i = 1 To 86 Step 2 ' The following line could be harmful and has been automatically commented. ' Read = File.ReadLine(ModelPath+"PointLines.txt",i) k=0 For n = 1 To Text.GetLength (Read) If Text.GetSubText (Read,n,1) = "," Then k=k+1 Kpos[k] = n EndIf EndFor Wn = Text.GetSubText (Read,1,Kpos[1]-1) x1 = Text.GetSubText (Read,Kpos[1]+1,Kpos[2]-Kpos[1]-1) y1 = Text.GetSubText (Read,Kpos[2]+1,Kpos[3]-Kpos[2]-1) x2 = Text.GetSubText (Read,Kpos[3]+1,Kpos[4]-Kpos[3]-1) y2 = Text.GetSubText (Read,Kpos[4]+1,Text.GetLength(Read)-Kpos[4]) Wind0[Wn] = Shapes.AddLine (x1,y1,x2,y2) ' The following line could be harmful and has been automatically commented. ' Read = File.ReadLine(ModelPath+"PointLines.txt",i+1) k=0 For n = 1 To Text.GetLength (Read) If Text.GetSubText (Read,n,1) = "," Then k=k+1 Kpos[k] = n EndIf EndFor Wn = Text.GetSubText (Read,1,Kpos[1]-1) x1 = Text.GetSubText (Read,Kpos[1]+1,Kpos[2]-Kpos[1]-1) y1 = Text.GetSubText (Read,Kpos[2]+1,Kpos[3]-Kpos[2]-1) x2 = Text.GetSubText (Read,Kpos[3]+1,Kpos[4]-Kpos[3]-1) y2 = Text.GetSubText (Read,Kpos[4]+1,Text.GetLength(Read)-Kpos[4]) Wind1[Wn] = Shapes.AddLine (x1,y1,x2,y2) EndFor 'Indicator numbering GraphicsWindow.BrushColor = "White" For i = 0 To 63 Step 5 GraphicsWindow.FillRectangle (22+8*(i-1), 550,2,6) GraphicsWindow.DrawText (20+8*(i-1), 535,i) EndFor 'Order tables for data read from track 8x8 SB, 8x8 B, 8x8 WB xa = 0 For i = 0 To 23 ' The following line could be harmful and has been automatically commented. ' Read = File.ReadLine(ModelPath+"ReadOrder.txt",i+1) k=0 For n = 1 To Text.GetLength (Read) If Text.GetSubText (Read,n,1) = "," Then k=k+1 Kpos[k] = n EndIf EndFor xa = Text.GetSubText (Read,1,Kpos[1]-1) pos[i][7] = Text.GetSubText (Read,Kpos[1]+1,Kpos[2]-Kpos[1]-1) pos[i][6] = Text.GetSubText (Read,Kpos[2]+1,Kpos[3]-Kpos[2]-1) pos[i][5] = Text.GetSubText (Read,Kpos[3]+1,Kpos[4]-Kpos[3]-1) pos[i][4] = Text.GetSubText (Read,Kpos[4]+1,Kpos[5]-Kpos[4]-1) pos[i][3] = Text.GetSubText (Read,Kpos[5]+1,Kpos[6]-Kpos[5]-1) pos[i][2] = Text.GetSubText (Read,Kpos[6]+1,Kpos[7]-Kpos[6]-1) pos[i][1] = Text.GetSubText (Read,Kpos[7]+1,Kpos[8]-Kpos[7]-1) pos[i][0] = Text.GetSubText (Read,Kpos[8]+1,Text.GetLength(Read)-Kpos[8]) Endfor '32 Treinregelaars 'Lok-data Ln = 0 For i = 0 To 63 ' The following line could be harmful and has been automatically commented. ' Read = File.ReadLine(ModelPath+"LokData.txt",i+1) k=0 For n = 1 To Text.GetLength (Read) If Text.GetSubText (Read,n,1) = "," Then k=k+1 Kpos[k] = n EndIf EndFor Ln = Text.GetSubText (Read,1,Kpos[1]-1) Mt[Ln] = Text.GetSubText (Read,Kpos[1]+1,Kpos[2]-Kpos[1]-1) Vmin[Ln] = Text.GetSubText (Read,Kpos[2]+1,Kpos[3]-Kpos[2]-1) Vmed[Ln] = Text.GetSubText (Read,Kpos[3]+1,Kpos[4]-Kpos[3]-1) Vmax[Ln] = Text.GetSubText (Read,Kpos[4]+1,Text.GetLength(Read)-Kpos[4]) Endfor GraphicsWindow.BrushColor="White" For i = 0 To 31 ha[i]=0 fu[i]=0 f1[i]=0 f2[i]=0 f3[i]=0 f4[i]=0 V[i] = 5 GraphicsWindow.BrushColor = "LightGray" GraphicsWindow.FillRectangle(28+20*(i-1), 380,8,128) GraphicsWindow.BrushColor = "Red" GraphicsWindow.FillRectangle(28+20*(i-1), 380+128-8*Vmax[i],8,8*Vmax[i]) GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.FillRectangle(28+20*(i-1), 380+128-8*Vmed[i],8,8*Vmed[i]) GraphicsWindow.BrushColor = "Green" GraphicsWindow.FillRectangle(28+20*(i-1), 380+128-8*Vmin[i],8,8*Vmin[i]) EndFor fu[7]=0 fu[17]=0 'Reverse buttons For i = 0 To 31 GraphicsWindow.BrushColor = "blue" GraphicsWindow.PenColor = "White" GraphicsWindow.FillRectangle(28+20*(i-1), 514,8,8) GraphicsWindow.DrawRectangle(28+20*(i-1), 514,8,8) Endfor 'Train indicator numbering GraphicsWindow.BrushColor = "White" For i = 0 To 31 GraphicsWindow.DrawText (26+20*(i-1),307,i) EndFor 'Start Program Loop =========================================================== While ("True") 'Screen update, Adjust signal colours and point positions. 'Hand / automatic indicators For i = 0 To 31 If ha[i] = 1 Then GraphicsWindow.BrushColor = "Red" Else GraphicsWindow.BrushColor = "Black" EndIf GraphicsWindow.FillRectangle (28+20*(i-1), 320,8,8) EndFor 'Function indicators For i = 0 To 31 If fu[i] = 1 Then GraphicsWindow.BrushColor = "White" Else GraphicsWindow.BrushColor = "Black" EndIf GraphicsWindow.FillRectangle (28+20*(i-1), 330,8,8) EndFor 'Extra function indicators For i = 0 To 31 If f1[i] = 1 Then GraphicsWindow.BrushColor = "White" Else GraphicsWindow.BrushColor = "Black" EndIf If Mt[i] = 1 then GraphicsWindow.FillRectangle (28+20*(i-1), 340,8,8) EndIf EndFor For i = 0 To 31 If f2[i] = 1 Then GraphicsWindow.BrushColor = "White" Else GraphicsWindow.BrushColor = "Black" EndIf If Mt[i] = 1 then GraphicsWindow.FillRectangle (28+20*(i-1), 350,8,8) EndIf EndFor For i = 0 To 31 If f3[i] = 1 Then GraphicsWindow.BrushColor = "White" Else GraphicsWindow.BrushColor = "Black" EndIf If Mt[i] = 1 then GraphicsWindow.FillRectangle (28+20*(i-1), 360,8,8) EndIf EndFor For i = 0 To 31 If f4[i] = 1 Then GraphicsWindow.BrushColor = "White" Else GraphicsWindow.BrushColor = "Black" EndIf If Mt[i] = 1 then GraphicsWindow.FillRectangle (28+20*(i-1), 370,8,8) EndIf EndFor 'Actual speed indicators GraphicsWindow.BrushColor = "White" For i = 0 To 31 GraphicsWindow.FillRectangle (28+20*(i-1),503-8*V[i],8,5) EndFor 'Block indicators B, SB and WB For i = 0 To 63 If B[i] = 1 Then GraphicsWindow.BrushColor = "White" Else GraphicsWindow.BrushColor = "Black" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 560,6,6) EndFor For i = 0 To 63 If SB[i] = 1 Then GraphicsWindow.BrushColor = "White" Else GraphicsWindow.BrushColor = "Black" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 570,6,6) EndFor For i = 0 To 63 If WB[i] = 1 Then GraphicsWindow.BrushColor = "White" Else GraphicsWindow.BrushColor = "Black" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 580,6,6) EndFor 'Signal light indicatots For i = 0 To 63 If SL[i] = 0 Then GraphicsWindow.BrushColor = "Red" EndIf If SL[i] = 1 Then GraphicsWindow.BrushColor = "Yellow" EndIf If SL[i] = 2 Then GraphicsWindow.BrushColor ="LightGreen" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 590,6,6) EndFor 'Signal Status indicators For i = 0 To 63 If S[i] = 1 Then GraphicsWindow.BrushColor = "WHite" Else GraphicsWindow.BrushColor = "Black" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 600,6,6) EndFor 'Signal Key indicators For i = 0 To 63 If SK[i] = 1 Then GraphicsWindow.BrushColor = "WHite" Else GraphicsWindow.BrushColor = "Black" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 610,6,6) EndFor 'Point indicatots For i = 0 To 43 If W[i] = 1 Then GraphicsWindow.BrushColor = "Yellow" Else GraphicsWindow.BrushColor = "blue" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 620,6,6) EndFor 'Point Key indicatots For i = 0 To 43 If WK[i] = 1 Then GraphicsWindow.BrushColor = "Yellow" Else GraphicsWindow.BrushColor = "blue" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 630,6,6) EndFor 'Free Point Key indicatots For i = 0 To 43 If WV[i] = 1 Then GraphicsWindow.BrushColor = "Yellow" Else GraphicsWindow.BrushColor = "blue" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 640,6,6) EndFor 'Route indicatots For i = 0 To 46 If R[i] = 1 Then GraphicsWindow.BrushColor = "Yellow" Else GraphicsWindow.BrushColor = "blue" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 650,6,6) EndFor 'Free-Route indicatots For i = 0 To 46 If RV[i] = 1 Then GraphicsWindow.BrushColor = "Yellow" Else GraphicsWindow.BrushColor = "blue" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 660,6,6) EndFor 'Miscelanouw function indicators For i = 0 To 31 If DIV[i] = 1 Then GraphicsWindow.BrushColor = "WHite" Else GraphicsWindow.BrushColor = "Black" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 670,6,6) EndFor 'Signal lights on screen For i = 0 To 63 If SL[i] = 0 Then GraphicsWindow.BrushColor = "Red" GraphicsWindow.FillRectangle (XposSK[i],YposSK[i],7,7) EndIf If SL[i] = 1 Then GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.FillRectangle (XposSK[i],YposSK[i],7,7) EndIf If SL[i] = 2 Then GraphicsWindow.BrushColor = "MediumSpringGreen" GraphicsWindow.FillRectangle (XposSK[i],YposSK[i],7,7) EndIf EndFor 'Block-engaged lines on screen For i = 0 To 63 If B[i] = 0 Then Shapes.ShowShape(Bind[i]) Else Shapes.HideShape(Bind[i]) EndIf EndFor 'Point positions on screen For i =1 To 43 If W[i] = 0 Then Shapes.HideShape(Wind1[i]) Shapes.ShowShape(Wind0[i]) Else Shapes.HideShape(Wind0[i]) Shapes.ShowShape(Wind1[i]) EndIf EndFor 'Manual Input Sugnal key SK[i], Point key WK[j] 'Sound.PlayClickAndWait() If Mouse.IsLeftButtonDown Then 'Find signal to be set For i = 0 To 63 If GraphicsWindow.MouseX > XposSK[i] And GraphicsWindow.MouseX < XposSK[i] + 8 Then If GraphicsWindow.MouseY > YposSK[i] And GraphicsWindow.MouseY < YposSK[i] + 8 Then 'Signal key will be Toggled. Reset when sinal goes from danger to safe If SK[i] = 0 Then SK[i] = 1 Else SK[i] = 0 EndIf Goto SKHit EndIf EndIf EndFor SKHit: If i < 64 Then GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle (700,650,200,25) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText (702, 652,"Signal "+i) EndIf 'Find points to be set For i = 1 To 43 If GraphicsWindow.MouseX > XposW[i] And GraphicsWindow.MouseX < XposW[i] + 9 Then If GraphicsWindow.MouseY > YposW[i] And GraphicsWindow.MouseY < YposW[i] + 9 Then 'Sound.PlayChimesAndWait() If WK[i] = 0 Then WK[i] = 1 Else WK[i] = 0 EndIf Goto WKHit EndIf EndIf EndFor WKHit: If i < 44 Then GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle (700,650,200,25) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText (702, 652,"Points "+i) EndIf 'Find miscellaneuos functions DIV[i] to be set For i = 0 To 31 If GraphicsWindow.MouseX > 20+(i-1)*8 And GraphicsWindow.MouseX < 28+(i-1)*8 Then If GraphicsWindow.MouseY > 670 And GraphicsWindow.MouseY < 678 Then If DIV[i] = 0 Then DIV[i] = 1 NDIV[i] = 0 Else DIV[i] = 0 NDIV[i] = 1 EndIf Sound.PlayClick() Goto DIVHit EndIf EndIf EndFor DIVHit: 'Find Hand / Automatic to be (re)set For i = 0 To 31 If GraphicsWindow.MouseX > 28+(i-1)*20 And GraphicsWindow.MouseX < 36+(i-1)*20 Then If GraphicsWindow.MouseY > 320 And GraphicsWindow.MouseY < 328 Then If ha[i] = 0 Then ha[i] = 1 Else ha[i] = 0 EndIf Sound.PlayClick() Goto haHit EndIf EndIf EndFor haHit: 'Find Function to be (re)set For i = 0 To 31 If GraphicsWindow.MouseX > 28+(i-1)*20 And GraphicsWindow.MouseX < 36+(i-1)*20 Then If GraphicsWindow.MouseY > 330 And GraphicsWindow.MouseY < 338 Then If fu[i] = 0 Then fu[i] = 1 Else fu[i] = 0 EndIf Sound.PlayClick() Goto fuHit EndIf EndIf EndFor fuHit: 'Find f1 to be (re)set For i = 0 To 31 If Mt[i] = 1 Then If GraphicsWindow.MouseX > 28+(i-1)*20 And GraphicsWindow.MouseX < 36+(i-1)*20 Then If GraphicsWindow.MouseY > 340 And GraphicsWindow.MouseY < 348 Then If f1[i] = 0 Then f1[i] = 1 Else f1[i] = 0 EndIf Sound.PlayClick() Goto f1Hit EndIf EndIf EndIf EndFor f1Hit: 'Find f2 to be (re)set For i = 0 To 31 If Mt[i] = 1 Then If GraphicsWindow.MouseX > 28+(i-1)*20 And GraphicsWindow.MouseX < 36+(i-1)*20 Then If GraphicsWindow.MouseY > 350 And GraphicsWindow.MouseY < 358 Then If f2[i] = 0 Then f2[i] = 1 Else f2[i] = 0 EndIf Sound.PlayClick() Goto f2Hit EndIf EndIf EndIf EndFor f2Hit: 'Find f3 to be (re)set For i = 0 To 31 If Mt[i] = 1 Then If GraphicsWindow.MouseX > 28+(i-1)*20 And GraphicsWindow.MouseX < 36+(i-1)*20 Then If GraphicsWindow.MouseY > 360 And GraphicsWindow.MouseY < 368 Then If f3[i] = 0 Then f3[i] = 1 Else f3[i] = 0 EndIf Sound.PlayClick() Goto f3Hit EndIf EndIf EndIf EndFor f3Hit: 'Find f4 to be (re)set For i = 0 To 31 If Mt[i] = 1 Then If GraphicsWindow.MouseX > 28+(i-1)*20 And GraphicsWindow.MouseX < 36+(i-1)*20 Then If GraphicsWindow.MouseY > 370 And GraphicsWindow.MouseY < 378 Then If f4[i] = 0 Then f4[i] = 1 Else f4[i] = 0 EndIf Sound.PlayClick() Goto f4Hit EndIf EndIf EndIf EndFor f4Hit: 'Find speed to be (re)set For i = 0 To 31 If ha[i] = 0 Then If GraphicsWindow.MouseX > 28+(i-1)*20 And GraphicsWindow.MouseX < 36+(i-1)*20 Then If GraphicsWindow.MouseY > 380 And GraphicsWindow.MouseY < 390 Then Vset[i] = V[i]+1 If Vset[i] > 15 Then Vset[i] = 15 EndIf EndIf Goto SpeedHit EndIf If GraphicsWindow.MouseX > 28+(i-1)*20 And GraphicsWindow.MouseX < 36+(i-1)*20 Then If GraphicsWindow.MouseY > 498 And GraphicsWindow.MouseY < 508 Then Vset[i] = 0 EndIf Goto SpeedHit EndIf If GraphicsWindow.MouseX > 28+(i-1)*20 And GraphicsWindow.MouseX < 36+(i-1)*20 Then If GraphicsWindow.MouseY > 488 And GraphicsWindow.MouseY < 498 Then Vset[i] = V[i]-1 If Vset[i] < 0 Then Vset[i] = 0 EndIf EndIf EndIf EndIf EndFor SpeedHit: 'Find reverse travel direction For i = 0 To 31 If ha[i] = 0 Then If GraphicsWindow.MouseX > 28+(i-1)*20 And GraphicsWindow.MouseX < 36+(i-1)*20 Then If GraphicsWindow.MouseY > 514 And GraphicsWindow.MouseY < 522 Then If Mt[i] = 0 Then If V[i] = 0 Then V[i] = 1 EndIf If V[i] = 1 Then V[i] = 0 EndIf Goto RevHit EndIf If Mt[i] = 1 Then If Dir[i] = 0 Then Dir[i] = 1 Else Dir[i] = 0 EndIf EndIf EndIf Endif EndIf EndFor RevHit: 'Temporary block-status manual toggle for testpurposes 'For i = 0 To 63 ' If GraphicsWindow.MouseX > 20+(i-1)*8 And GraphicsWindow.MouseX < 28+(i-1)*8 Then ' If GraphicsWindow.MouseY > 560 And GraphicsWindow.MouseY < 570 Then ' If B[i] = 0 Then ' B[i] = 1 ' Else ' B[i] = 0 ' EndIf ' Goto BHit ' EndIf ' EndIf 'EndFor 'BHit: WaitForMouseUpAgain: If Mouse.IsLeftButtonDown Then Goto WaitForMouseUpAgain EndIf EndIf 'End of mouse-is left button down 'Sound.PlayClickAndWait() 'Reading Block B[i] ,Stop-Block SB[i] and point-block WB[i] data from the track If cycle = 1 Then ComPort.TXByte(82) 'Vertel Piccolino dat blok-bezet gegevens moeten komen Program.Delay(5) reply = ComPort.RXByte() 'reply = 83 If reply = 83 Then 'Piccolino heeft het begrepen For i = 0 To 23 DR[i] = ComPort.RXByte() 'DR[i] = 255 EndFor EndIf If reply <>83 then 'Sound.PlayClickAndWait() EndIf 'Sound.PlayChimeAndWait() 'Haal block gegevens uit DR[i] DR[5]=255 For i = 0 To 23 bit[i][7] = Math.Floor(DR[i]/128) rest = DR[i] - bit[i][7]*128 bit[i][6] = Math.Floor(rest/64) rest = rest - bit[i][6]*64 bit[i][5] = Math.Floor(rest/32) rest = rest - bit[i][5]*32 bit[i][4] = Math.Floor(rest/16) rest = rest - bit[i][4]*16 bit[i][3] = Math.Floor(rest/8) rest = rest - bit[i][3]*8 bit[i][2] = Math.Floor(rest/4) rest = rest - bit[i][2]*4 bit[i][1] = Math.Floor(rest/2) rest = rest - bit[i][1]*2 bit[i][0] = Math.Floor(rest) EndFor For i = 0 To 7 For j = 0 To 7 SB[pos[i][j]]=bit[i][j] EndFor EndFor For i = 8 To 15 For j = 0 To 7 B[pos[i][j]]=bit[i][j] EndFor EndFor For i = 16 To 23 For j = 0 To 7 WB[pos[i][j]]=bit[i][j] EndFor EndFor EndIf 'Calculate railroad crossings from block status changes OVW[n] 'Traintracking from block status changes TB[t] 'Synchronise Block / Stop Block / Double Direction Blocks For i = 0 To 63 Bprev[i] = B[i] If SB[i]=0 Then B[i]=0 EndIf EndFor B[22]=B[13] B[24]=B[15] B[26]=B[9] B[54]=B[35] B[52]=B[39] B[50]=B[37] B[48]=B[41] B[46]=B[43] B[47]=B[42] B[45]=B[44] B[49]=B[40] B[59]=B[56] B[58]=B[57] B[60]=B[55] B[21]=B[8] B[23]=B[10] B[25]=B[12] B[27]=B[14] B[53]=B[38] B[51]=B[36] 'Calculate new signal and point position values from manual input and track-data '1) Set Points according to manual input and do Route calculations R[j] For i = 1 To 43 If WV[i] = 1 Then W[i] = WK[i] EndIf x=W[i] NOT() NW[i]=x R[i] = 0 EndFor R[0] = NW[16]*NW[17] R[1] = NW[3] R[2] = W[3] * W[4] R[3] = W[3] * NW[4] R[4] = NW[5] R[5] = W[5] R[6] = NW[7]*W[9]*W[38] R[7] = NW[7]*NW[9]*NW[38] R[8] = W[7]*W[8]*NW[38]*NW[39] R[9] = W[7]*NW[8]*w[39]*nw[38] R[10] = NW[12]*NW[14]*W[13]*W[11] R[11] = NW[12]*NW[14]*W[13]*NW[11] R[12] = NW[12]*W[14]*NW[13]*NW[10] R[13] = NW[12]*NW[14]*W[10] R[14] = W[14]*NW[10]*W[13]*W[11] R[15] = W[14]*NW[10]*W[13]*NW[11] R[16] = W[14]*NW[10]*NW[13] R[17] = W[14]*W[10] R[18] = NW[14]*NW[10] R[19] = NW[2]*NW[1] R[20] = NW[2]*W[1]*NW[26]*NW[25]*NDIV[6] R[21] = NW[24]*W[25]*NDIV[6] R[22] = W[24]*NW[28]*NDIV[6] R[23] = NW[23]*NDIV[6] R[24] = W[23]*NDIV[6] R[25] = NW[25]*NW[26]*W[1]*W[2]*NDIV[6] R[26] = NW[25]*NW[26]*W[1]*NW[2]*NDIV[6] R[27] = W[25]*NW[24]*NDIV[6] R[28] = NW[34] R[29] = W[34] R[30] = NW[33] R[31] = W[33] R[32] = NW[3]*NW[4] R[33] = NW[3]*W[4] R[34] = W[10]*NW[14]*W[12] R[35] = NW[10]*NW[14]*W[12] R[36] = NW[11]*NW[13]*NW[12] R[37] = W[11]*NW[13]*NW[12] R[38] = NW[10]*NW[14] R[39] = NW[13]*NW[10]*W[14] R[40] = NW[11]*W[13]*NW[10]*W[14] R[41] = W[11]*W[13]*NW[10]*W[14] R[42] = W[10]*W[14] R[43] = 1 R[44] = NW[42] R[45] = W[42]*NW[43] R[46] = W[42]*W[43] '2) Calculate safety conditions C[i] per signal S[i] c[0] = NRV[20]*NRV[21]*NRV[23]*NRV[24]*NRV[25]*NRV[26]*NRV[27] C[1] = B[3] C[10] = NW[8]*NW[39]*B[16]*NS[12]*NS[14] C[11] = B[17]*NS[13]*NS[15] C[12] = NW[38]*W[9]*B[16]*NS[10]*NS[8] C[13] = B[17]*W[5]*NRV[5] C[14] = W[38]*NW[9]*B[16]*NS[10]*NS[8] C[15] = B[17]*NW[5]*NRV[4] C[16] = NS[33]*B[18]*NW[6] C[17] = NW[6]*B[19]+W[6]*B[2]*NS[16]*WB[44] C[18] = (R[4]*B[22]*NRV[2]*NRV[32]+R[5]*B[24]*NRV[3]*NRV[33])*NS[20] C[19] = R[6]*B[27]*(NRV[10]+NRV[14])+R[7]*B[25]*(NRV[11]+NRV[15])+R[8]*B[23]*(NRV[12]+NRV[16])+R[9]*B[21]*(NRV[13]+NRV[17]) C[2] = B[4] C[20] = (R[4]*B[22]*NRV[2]*NRV[32]+R[5]*B[24]*NRV[3]*NRV[33])*NS[18] C[21] = R[34]*B[29]+(R[38]+R[42])*B[35]*NRV[43] C[22] = B[26]*NW[3]*NW[4] C[23] = R[35]*B[29]+R[39]*B[35]*NRV[43] C[24] = B[26]*NW[3]*W[4] C[25] = R[36]*B[29]+R[40]*B[35]*NRV[43] C[26] = R[19]*B[28]+R[20]*B[36]*NRV[26]*NRV[23] C[27] = R[37]*B[29]+R[41]*B[35]*NRV[43] C[28] = B[30] C[29] = B[31] C[3] = B[5] C[30] = R[44]*B[32]+R[45]*B[62]+R[46]*B[63] C[31] = NW[15]*B[33]+w[15]*B[20] C[32] = NS[62]*NS[63]*B[34] C[33] = NS[16]*B[18] C[34] = B[1] C[35] = R[28]*B[37]*NRV[30]+R[29]*B[39]*NRV[31] C[36] = B[40]*RR1*NW[23] C[37] = NW[33]*B[41]*NS[46]*NS[59] C[38] = B[40]*RR1*W[23] C[39] = W[33]*B[41]*NS[46]*NS[59] C[4] = B[6] C[40] = B[42]*RR1 C[41] = WB[32]*B[56]*RR3+NW[32]*B[43]*NS[44] C[42] = B[44]*RR1 C[43] = NW[31]*B[45]*RR2 C[44] = NW[31]*B[46] C[45] = B[47]*RR2 C[46] = B[48]*NW[32]*NS[37]*NS[39] C[47] = B[47]*RR2 C[48] = R[30]*B[50]*NRV[28]+R[31]*B[52]*NRV[29] C[49] = NDIV[6]*(R[23]*B[51]*NRV[21]+R[24]*B[53]*NRV[22]) C[5] = B[7]*NW[2] C[50] = NW[34]*B[54]*NRV[38]*NRV[39]*NRV[40]*NRV[41]*NRV[42] C[51] = NDIV[6]*(B[55]*R[27]+(B[7]*R[25]+B[9]*R[26])*NRV[20]) C[52] = W[34]*B[54]*NRV[38]*NRV[39]*NRV[40]*NRV[41]*NRV[42] C[53] = NDIV[6]*W[24]*B[55] C[54] = R[14]*B[14]*NRV[6]+R[15]*B[12]*NRV[7]+R[16]*B[10]*NRV[8]+(R[17]+R[18])*B[8]*NRV[9] C[55] = B[57]*RR4 C[56] = B[58]*RR3 C[57] = NW[29]*B[59]*RR4 C[58] = B[60]*RR3 C[59] = B[48]*W[32]*NS[37]*NS[39] C[6] = R[10]*B[14]*NRV[6]+R[11]*B[12]*NRV[7]+R[12]*B[10]*NRV[8]+R[13]*B[8]*NRV[9] C[60] = NDIV[6]*(R[22]*B[38]*NRV[24]+R[21]*B[36]*NRV[23]) C[61] = NW[17]*NW[16] C[62] = NS[32]*NS[63]*B[34] C[63] = NS[62]*NS[32]*B[34] C[7] = R[1]*B[11]+(R[2]*B[13]+R[3]*B[15])*(NRV[4]+NRV[5]) C[8] = W[8]*W[39]*B[16]*NS[12]*NS[14] C[9] = (R[32]*B[13]*NRV[4]+R[33]*B[15]*NRV[5]) VT1 = B[45]*B[47]*B[49] If VT1*NS[36]*NS[38]*NS[43] = 1 Then RR1 = 1 RR2 = 1 EndIf VT2 = B[56]*B[58]*B[60] If VT2*(NS[41]+S[41]*NW[32])*NRV[27]*NS[53] = 1 Then RR3 = 1 RR4 = 1 EndIf '3) Calculate (new) signal status For i = 1 To 63 Snow = S[i] S[i] = C[i] * (SK[i] + S[i]) If S[i] > 1 Then S[i] = 1 EndIf NS[i] = 1-S[i] 'Reset SK[i] when S[i] changed from danger to safe. 'but not for open blocks 0,1,2,3,4,28,29,34,40,42,43,44,45,47 If (i>=0 And i<5) Or i=28 Or i=29 Or i=34 Or i=40 Or i=42 Or i=45 Or i=47 Or (i>54 And i<59) Then Goto SignalEnd EndIf If S[i] > Snow Then SK[i] = 0 EndIf SignalEnd: EndFor S[0]= C[0]*SK[0] DIV[6]=S[0] NDIV[6]=1-DIV[6] 'Block travel directions for singel track lines when given free in opposite direction If S[41]*W[32]=1 Then RR4 = 0 EndIf If S[51]*R[27]=1 Then RR3 = 0 EndIf If S[53] = 1 Then RR3 = 0 EndIf If S[36]+S[38]=1 Then RR2 = 0 EndIf If S[43] = 1 Then RR1 = 0 EndIf 'Determine Free Routes (open for travel) RV[1]=S[7]*R[1] RV[2]=S[7]*R[2] RV[3]=S[7]*R[3] RV[4]=R[4]*(S[18]+S[20]) RV[5]=R[5]*(S[18]+S[20]) RV[6]=R[6]*S[19] RV[7]=R[7]*S[19] RV[8]=R[8]*S[19] RV[9]=R[9]*S[19] RV[10]=R[10]*S[6] RV[11]=R[11]*S[6] RV[12]=R[12]*S[6] RV[13]=R[13]*S[6] RV[14]=R[14]*S[54] RV[15]=R[15]*S[54] RV[16]=R[16]*S[54] RV[17]=R[17]*S[54] RV[18]=R[18]*S[54] RV[19]=R[19]*S[26] RV[20]=R[20]*S[26] RV[21]=R[21]*S[60] RV[22]=R[22]*S[60] RV[23]=R[23]*S[49] RV[24]=R[24]*S[49] RV[25]=R[25]*S[51] RV[26]=R[26]*S[51] RV[27]=R[27]*S[51] RV[28]=R[28]*S[35] RV[29]=R[29]*S[35] RV[30]=R[30]*S[48] RV[31]=R[31]*S[48] RV[32]=R[32]*S[9] RV[33]=R[33]*S[9] RV[34]=R[34]*S[21] RV[35]=R[35]*S[23] RV[36]=R[36]*S[25] RV[37]=R[37]*S[27] RV[38]=R[38]*S[21] RV[39]=R[39]*S[23] RV[40]=R[40]*S[25] RV[41]=R[41]*S[27] RV[42]=R[42]*S[21] RV[43]=S[50]+S[52] RV[44]=R[44]*S[30] RV[45]=R[45]*S[30] RV[46]=R[46]*S[30] For i = 1 To 46 NRV[i] = 1-RV[i] EndFor '4) Calculate Free Points WV[i] 'At first make all points free to be set (WV[i]=1) 'unless a train is on it (WB[i]=0 in that case) For i = 1 To 43 WV[i] = WB[i] EndFor 'Then determine which ones need to be blocked 'Points [1] and [2] If S[26]*R[20] = 1 Then WV[2] = 0 WV[1] = 0 WV[26] = 0 WV[25] = 0 EndIf If S[26] = 1 Then WV[2] = 0 WV[1] = 0 Else If S[51]*(R[25]+R[26]) = 1 Then WV[1] = 0 WV[2] = 0 WV[25] = 0 WV[26] = 0 EndIf EndIf If S[5] = 1 Then WV[2] = 0 EndIf If S[7] = 1 Then WV[3] = 0 If (R[2]+R[3]) = 1 Then WV[4] = 0 EndIf Else If S[22]+S[24] = 1 Then WV[3] = 0 WV[4] = 0 EndIf EndIf If S[9] = 1 Then WV[4] = 0 WV[3] = 0 EndIf If S[30] = 1 Then WV[42] = 0 WV[43] = 0 EndIf '5) Calculate special functions '6) Calculate signal light values For i = 0 To 63 SL[i] = 0 EndFor SL[0]=S[0] SL[1]=S[1]*(S[1]+S[3]) SL[10]=S[10]*(S[10]+S[16]) SL[11]=S[11]*(S[11]+S[17]) SL[18]=S[18]*(S[18]+R[4]*S[22]+R[5]*S[24]) SL[12]=S[12]*(S[12]+S[16]) SL[13]=S[13]*(S[13]+S[17]) SL[14]=S[12]*(S[12]+S[16]) SL[15]=S[15]*(S[15]+S[17]) SL[16]=S[16]*(S[16]+S[18]) SL[17]=S[17]*(S[17]+NW[6]*S[19]+W[6]*S[2]) SL[18]=S[18]*(S[18]+R[4]*S[22]+R[5]*S[24]) SL[19]=S[19]*(S[19]+R[6]*S[27]+R[7]*S[25]+R[8]*S[23]+R[9]*S[21]) SL[2]=S[2]*(S[2]+S[4]) SL[20]=S[20]*(S[20]+R[4]*S[22]+R[5]*S[24]) SL[21]=S[21]*(S[21]+R[34]*S[29]+R[38]*S[35]+R[42]*S[35]) SL[22]=S[22]*(S[22]+S[26]) SL[23]=S[23]*(S[23]+R[35]*S[29]+R[39]*S[35]) SL[24]=S[24]*(S[24]+S[26]) SL[25]=S[25]*(S[25]+R[36]*S[29]+R[40]*S[35]) SL[26]=S[26]*(S[26]+R[19]*S[28]+R[20]*S[36]) SL[27]=S[27]*(S[27]+R[37]*S[29]+R[41]*S[35]) SL[28]=S[28]*(S[28]+S[30]) SL[29]=S[29]*(S[29]+S[31]) SL[3]=S[3]*(S[3]+S[5]) SL[30]=S[30]*(S[30]+R[44]*S[32]+R[45]*S[62]+R[46]*S[63]) SL[31]=S[31]*(S[31]+W[15]*S[20]+NW[15]*S[33]) SL[32]=S[32]*(S[32]+S[34]) SL[33]=S[33]*(S[33]+S[18]) SL[34]=S[34]*(S[34]+S[1]) SL[35]=S[35]*(S[35]+R[28]*S[37]+R[29]*S[39]) SL[36]=S[36]*(S[36]+S[40]) SL[37]=S[37]*(S[37]+S[41]) SL[38]=S[38]*(S[38]+S[40]) SL[39]=S[39]*(S[39]+S[41]) SL[4]=S[4]*(S[4]+S[6]) SL[40]=S[40]*(S[40]+S[42]) SL[41]=S[41]*(S[41]+W[32]*S[56]+NW[32]*S[43]) SL[42]=S[42]*(S[42]+S[44]) SL[43]=S[43]*(S[43]+S[45]) SL[44]=S[44]*(S[44]+S[46]) SL[45]=S[45]*(S[45]+S[47]) SL[46]=S[46]*(S[46]+S[48]) SL[47]=S[47]*(S[47]+S[49]) SL[48]=S[48]*(S[48]+W[33]*S[52]+NW[33]*S[50]) SL[49]=S[49]*(S[49]+R[23]*S[51]+R[24]*S[53]) SL[5]=S[5]*(S[5]+S[7]) SL[50]=S[50]*(S[50]+S[54]) SL[51]=S[51]*(S[51]+R[27]*B[55]+R[26]*S[9]) SL[52]=S[52]*(S[52]+S[54]) SL[53]=S[53]*(S[53]+S[55]) SL[54]=S[54]*(S[54]+R[14]*S[14]+R[15]*S[12]+R[16]*S[10]+R[17]*S[8]+R[18]*S[8]) SL[55]=S[55]*(S[55]+S[57]) SL[56]=S[56]*(S[56]+S[58]) SL[57]=S[57]*(S[57]+S[59]) SL[58]=S[58]*(S[58]+S[60]) SL[59]=S[59]*(S[59]+S[48]) SL[6]=S[6]*(S[6]+R[10]*S[14]+R[11]*S[12]+R[12]*S[10]+R[13]*S[8]) SL[60]=S[60]*(S[60]+R[21]*S[36]+R[22]*S[38]) SL[61]=S[61] SL[62]=S[62]*(S[62]+S[34]) SL[63]=S[63]*(S[63]+S[34]) SL[7]=S[7]*(S[7]+R[1]*S[11]+R[2]*S[13]+R[3]*S[15]) SL[8]=S[8]*(S[8]+S[16]) SL[9]=S[9]*(S[9]+R[32]*S[13]+R[33]*S[15]) For i = 0 To 63 NSL[i] = 3 - SL[i] EndFor 'Calculate train traction (speeds) V[t] 'Write signal lights, point and function data to the track 'Compiled data per adres is DA[TA] '1) Signal lights SL - track addresses TA 0-10 (decimal, 11-15 spare) 'Interface I DA[0] = NSL[20] + 4*NSL[11] + 16*NSL[18] + 64*NSL[13] DA[1] = NSL[17] + 4*NSL[16] + 16*NSL[16] + 64*NSL[48] DA[2] = NSL[37] + 4*NSL[39] + 16*NSL[50] + 64*NSL[32] DA[3] = NSL[2] + 4*NSL[19] + 16*NSL[33] + 64*NSL[56] 'Interface VI DA[4] = NSL[10] + 4*NSL[8] + 16*NSL[12] + 64*NSL[14] DA[5] = NSL[29] + 4*NSL[27] + 16*NSL[23] + 64*NSL[21] DA[6] = NSL[41] + 4*NSL[44] + 16*NSL[31] + 64*NSL[57] DA[7] = NSL[61] + 4*NSL[61] + 16*NSL[59] + 64*NSL[46] 'Interface VII DA[8] = NSL[58] + 4*NSL[55] + 16*NSL[24] + 64*NSL[22] DA[9] = NSL[3] + 4*NSL[28] + 16*NSL[45] + 64*NSL[5] DA[10] = NSL[60] + 4*NSL[45] + 16*NSL[51] + 64*NSL[53] 'Not implemented For j = 11 To 15 DA[j]=0 EndFor '2) Point Selenoids WS - track addresses TA 16-31 (decimal 'Interface II DA[16] = WS[3] + 4*WS[4] + 16*WS[21] + 64*WS[22] DA[17] = WS[24] + 4*WS[5] + 16*WS[2] + 64*WS[1] DA[18] = WS[26] + 4*WS[27] + 16*WS[28] + 64*WS[25] 'Interface IV DA[19] = WS[36] + 4*WS[38] + 16*WS[37] + 64*WS[35] DA[20] = WS[10] + 4*WS[9] + 16*WS[8] + 64*WS[7] DA[21] = WS[12] + 4*WS[14] + 16*WS[33] + 64*WS[41] DA[22] = WS[11] + 4*WS[13] + 16*WS[40] + 64*WS[34] 'Interface V DA[23] = WS[23] + 4*WS[6] + 16*WS[15] + 64*WS[16] DA[24] = WS[17] + 4*WS[18] + 16*WS[19] + 64*WS[20] DA[25] = WS[30] + 4*WS[32] + 16*WS[31] + 64*WS[29] 'Interface VII DA[26] = WS[5] + 4*WS[43] + 16*WS[42] + 64*WS[23] 'Not implemented For j = 27 To 31 DA[j]=0 EndFor '3) Other functions DIV - track addresses 32-39 (decimal) 'Interface II DA[32] = DIV[1] + 2*DIV[2] + 4*DIV[3] + 8*DIV[4] + 16*DIV[5] + 32*DIV[6] + 64*DIV[8] + 128*DIV[7] 'Interface VII DA[33] = DIV[24] + 2*DIV[28] + 4*DIV[27] + 8*DIV[26] + 16*DIV[25] + 32*DIV[31] + 64*DIV[3] + 128*DIV[29] DA[34] = DIV[23] + 2*DIV[22] + 4*DIV[21] + 8*DIV[20] + 16*DIV[19] + 32*DIV[17] + 64*DIV[18] + 128*DIV[16] DA[35] = DIV[14] + 2*DIV[12] + 4*DIV[11] + 8*DIV[10] + 16*DIV[9] + 32*DIV[3] + 64*DIV[2] + 128*DIV[1] 'Not implemented For j = 36 To 39 DA[j]=0 EndFor 'Speed data for 32 trains, 8 bits snelheids data, inclusief rijrichting en f1, f2, f3, f4 For j = 40 To 75 DA[j] = 0 EndFor 'Functiebit F in nog eens 32 bytes voor 32 treinen DA[48] = 255 DA[57] = 255 DA[66] = 255 DA[75] = 255 'Transfer data to track every second cycle If cycle = 0 Then ComPort.TXByte(87) 'Vertel Piccolino dat er baan-data klaar staan reply = ComPort.RXByte() If reply = 88 Then 'Piccolino heeft het begrepen For j = 40 To 48 ComPort.TXByte(DA[j]) EndFor reply = ComPort.RXByte() For j = 49 To 57 ComPort.TXByte(DA[j]) EndFor reply = ComPort.RXByte() For j = 58 To 66 ComPort.TXByte(DA[j]) EndFor reply = ComPort.RXByte() For j = 67 To 75 ComPort.TXByte(DA[j]) EndFor reply = ComPort.RXByte() For j = 0 To 9 ComPort.TXByte(DA[j]) EndFor reply = ComPort.RXByte() For j = 10 To 19 ComPort.TXByte(DA[j]) EndFor reply = ComPort.RXByte() For j = 20 To 29 ComPort.TXByte(DA[j]) EndFor reply = ComPort.RXByte() For j = 30 To 39 ComPort.TXByte(DA[j]) EndFor EndIf EndIf 'Repeat Program Loop and blink in upper corner If cycle = 0 Then cycle = 1 GraphicsWindow.BrushColor ="white" Else cycle =0 GraphicsWindow.BrushColor = "red" EndIf GraphicsWindow.FillRectangle (1,1,10,10) 'Program.Delay(500) EndWhile Sub NOT If x =1 Then x=0 Else x=1 EndIf EndSub End>GCS343.sb< Start>GCT231.sb< Sides = 7 Length = 80 RepeatNumber = 100 GUI() Sub GUI GraphicsWindow.DrawText(0,0,"Sides =") SidesText = Controls.AddTextBox(50,0) Controls.SetTextBoxText(SidesText,Sides) GraphicsWindow.DrawText(220,0,"Length =") LengthText = Controls.AddTextBox(280,0) Controls.SetTextBoxText(LengthText,Length) GraphicsWindow.DrawText(450,0,"Repeat Number =") RepeatNumberText = Controls.AddTextBox(560,0) Controls.SetTextBoxText(RepeatNumberText,RepeatNumber) Controls.AddButton ("Draw it!!",0,25) Controls.ButtonClicked = Draw Turtle.Speed=10 EndSub Sub Draw Sides = Controls.GetTextBoxText(SidesText) Length = Controls.GetTextBoxText(LengthText) RepeatNumber = Controls.GetTextBoxText(RepeatNumberText) If Sides > 2 Or Length > 0 Or RepeatNumber > 0 Then GraphicsWindow.Clear() GUI() Turtle.Show() Turtle.PenUp() Turtle.MoveTo (GraphicsWindow.Width / 2, GraphicsWindow.Height / 2) Turtle.Angle = 0 Turtle.PenDown() red = 0 green = 0 blue = 0 ColorStep = Math.Floor(255 / RepeatNumber / Sides * 3 * 2) For j = 1 to RepeatNumber Polygon () Turtle.Turn (360 / RepeatNumber) endfor EndIf EndSub Sub SetColor GraphicsWindow.PenColor=GraphicsWindow.GetColorFromRGB(red , green , blue) If red + ColorStep < 255 And red + ColorStep > 0 Then red = red + ColorStep ElseIf green + ColorStep < 255 And green + ColorStep > 0 then green = green + ColorStep elseif blue + ColorStep < 255 And blue + ColorStep > 0 then blue = blue + ColorStep Else ColorStep = -ColorStep EndIf EndSub Sub Polygon Turtle.PenDown() For i=1 To Sides SetColor() Turtle.Move (Length) Turtle.Turn (360 / Sides) EndFor EndSub End>GCT231.sb< Start>GCW048.sb< TextWindow.ForegroundColor = "Cyan" Points = 0 Z = 0 NumberGen = 5 Timer.Tick = Wrong TextWindow.WriteLine("Hello this is the beta of my infinte math game.") TextWindow.WriteLine("You will be asked questions until you get one wrong, but thats not all you only have 10 seconds to answer each one.") TextWindow.WriteLine("Press enter to start.") TextWindow.ReadNumber() TextWindow.Clear() TextWindow.ForegroundColor = "White" Sub Wrong Z = 1 TextWindow.Clear() TextWindow.WriteLine("You survived " +Points+ " questions") TextWindow.Read() Program.End() EndSub While (Z = 0) Timer.Interval = 10000 Number1 = Math.GetRandomNumber(NumberGen) Number2 = Math.GetRandomNumber(NumberGen) Answer = Number1 + Number2 TextWindow.WriteLine("What is " +Number1+ " + " +Number2+ " ?") Answer1 = TextWindow.ReadNumber() If Answer1 = Answer Then Points = Points + 1 TextWindow.Clear() Else Z = 1 TextWindow.Clear() EndIf NumberGen = NumberGen + 5 EndWhile TextWindow.WriteLine("You survived " +Points+ " questions") TextWindow.Read() Program.End() End>GCW048.sb< Start>GCW323.sb< Initialise() GraphicsWindow.MouseMove = OnMouseMove GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseUp = OnMouseUp init="true While ("True") If (mww And mouseDown) or init Then mww="false GraphicsWindow.BrushColor = bg GraphicsWindow.FillRectangle(0,0,gw,gh) If init then init="false else theta = -(GraphicsWindow.MouseX-mouseX)/gw*PI phi = -(GraphicsWindow.MouseY-mouseY)/gh*PI/2 GraphicsWindow.Title =theta +":"+phi setRotation() matrix1 = matrix matrix2 = rotationOLD multiply() rotation = matrix endif matrix = rotation For iBall = 1 To numBall X = ballX[iBall] Y = ballY[iBall] Z = ballZ[iBall] getScreen() ballSX[iBall] = SX ballSY[iBall] = SY ballSZ[iBall] = SZ EndFor For iBall = numBall To 18 Step -1 SX = ballSX[iBall] SY = ballSY[iBall] SZ = ballSZ[iBall] pp[1][1]=sx pp[1][2]=sy pp[2][1] = ballSX[iBall-1] pp[2][2] = ballSY[iBall-1] pp[3][1] = ballSX[iBall-19] pp[3][2] = ballSY[iBall-19] pp[4][1] = ballSX[iBall-18] pp[4][2] = ballSY[iBall-18] cc[1]=LDColours.HSLtoRGB (10+iball*2 1 0.6) cc[2]=LDColours.HSLtoRGB (10+iball*2 1 0.2) gr= LDShapes.BrushGradient (cc, "DD") LDShapes.BrushPolygon (gr pp) EndFor endif Program.Delay(15) EndWhile '################################################### Sub Initialise PI = 2.0*Math.ArcCos(0) gw = 1200 gh = 800 bg = "darkblue GraphicsWindow.PenWidth=0 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BackgroundColor = bg GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 centreX = 0 centreY = 0 centreZ = 0 numBall = 200 radBall = 15 scale = 2 theta = .21 phi = .02 ff=2 zf=1 For i = 1 To numBall ballX[i] = LDMath.Cos(i*20)*(210*ff) ballY[i] = LDMath.sin(i*20)*(210*ff) ff=ff/1.1 zf=zf/1.02 ballZ[i] = zf*50 GraphicsWindow.BrushColor = LDColours.HSLtoRGB (i*4 1 .6) pc[i] = GraphicsWindow.BrushColor EndFor GraphicsWindow.PenColor = "#05ff0000" setRotation() rotation = matrix EndSub 'Input : theta, phi 'Output : matrix Sub setRotation matrix[1][1] = Math.Cos(theta)*Math.Cos(phi) matrix[1][2] = Math.Sin(theta) matrix[1][3] = Math.Cos(theta)*Math.Sin(phi) matrix[2][1] = -Math.Sin(theta)*Math.Cos(phi) matrix[2][2] = Math.Cos(theta) matrix[2][3] = -Math.Sin(theta)*Math.Sin(phi) matrix[3][1] = -Math.Sin(phi) matrix[3][2] = 0 matrix[3][3] = Math.Cos(phi) EndSub Sub multiply For i = 1 To 3 For j = 1 To 3 matrix[i][j] = 0 For k = 1 To 3 matrix[i][j] = matrix[i][j] + matrix1[i][k]*matrix2[k][j] EndFor EndFor EndFor EndSub Sub getAngles 'Input : matrix Output theta, phi phi = Math.ArcCos(Math.Min(1.0,Math.Max(-1.0,matrix[3][3]))) theta = Math.ArcCos(Math.Min(1.0,Math.Max(-1.0,matrix[2][2]))) If (matrix[1][2] < 0) Then theta = theta+PI EndIf EndSub Sub getScreen 'Input matrix, scale, centreX, centreY, centreZ, X, Y, Z 'Output SX, SY, SZ(depth) DX = (X-centreX)*scale DY = (Y-centreY)*scale DZ = (Z-centreZ)*scale SX = gw/2 + DX*matrix[2][1] + DY*matrix[2][2] + DZ*matrix[2][3] SY = gh/2 + DX*matrix[3][1] + DY*matrix[3][2] + DZ*matrix[3][3] SZ = (DX*matrix[1][1] + DY*matrix[1][2] + DZ*matrix[1][3])/255/scale EndSub Sub OnMouseMove mww="true EndSub Sub OnMouseDown mww="true mouseX = GraphicsWindow.MouseX mouseY = GraphicsWindow.MouseY rotationOLD = rotation mouseDown = "true EndSub Sub OnMouseUp mouseDown = "false EndSub End>GCW323.sb< Start>GCW421.sb< 'Window GraphicsWindow.Hide() GraphicsWindow.Width = 640 GraphicsWindow.Height = 480 GraphicsWindow.Left = (Desktop.Width - 640) / 2 GraphicsWindow.Top = 100 GraphicsWindow.CanResize = "false" GraphicsWindow.Title = "MSB Sourse Code" 'Text Settings GraphicsWindow.FontName = "..." GraphicsWindow.FontSize = 13 GraphicsWindow.FontBold = "false" GraphicsWindow.BrushColor = "green" 'Comments comment1 = Shapes.AddText("'Window") Shapes.Move(comment1, 3, 0) hl = Shapes.AddText("'Horizontal Lines") Shapes.Move(hl, 3, 200) vl = Shapes.AddText("'Vertical Lines") Shapes.Move(vl, 3, 300) sw = Shapes.AddText("'Show Window") Shapes.Move(sw, 3, 400) 'GraphicsWindow GraphicsWindow.BrushColor = "darkcyan" line[1] = "GraphicsWindow" line[2] = "GraphicsWindow" line[3] = "GraphicsWindow" line[4] = "GraphicsWindow" line[5] = "GraphicsWindow" line[6] = "GraphicsWindow" line[7] = "GraphicsWindow" line[8] = "GraphicsWindow" dstp = Shapes.AddText("Desktop") Shapes.Move(dstp, 150, 80) For count = 1 To Array.GetItemCount(line) lines[count] = Shapes.AddText(line[count]) Shapes.Move(lines[count], 3, 0 + (20 * count)) EndFor 'Dots GraphicsWindow.BrushColor = "brown" dot[1] = "." dot[2] = "." dot[3] = "." dot[4] = "." dot[5] = "." dot[6] = "." dot[7] = "." dot[8] = "." For count = 1 To Array.GetItemCount(dot) dots[count] = Shapes.AddText(dot[count]) Shapes.Move(dots[count], 103, 0 + (20 * count)) EndFor 'Commands command[1] = "Hide()" command[2] = "Width =" command[3] = "Height =" command[4] = "Left = ( .Width - ) /" command[5] = "Top =" command[6] = "CanResize =" command[7] = "Title =" command[8] = "BackgroundColor =" For count = 1 To Array.GetItemCount(command) commands[count] = Shapes.AddText(command[count]) Shapes.Move(commands[count], 108, 0 + (20 * count)) EndFor 'Data GraphicsWindow.BrushColor = "sandybrown" width = Shapes.AddText("640") Shapes.Move(width, 163, 40) width = Shapes.AddText("640 2") Shapes.Move(width, 250, 80) height = Shapes.AddText("480") Shapes.Move(height, 168, 60) top = Shapes.AddText("100") Shapes.Move(top, 158, 100) false = Shapes.AddText("''False''") Shapes.Move(false, 183, 120) title = Shapes.AddText("''MSB Source Code''") Shapes.Move(title, 153, 140) color = shapes.AddText("'navajowhite'") shapes.Move(color, 225, 160) 'Horizontal Lines GraphicsWindow.BrushColor = "dodgerblue" GraphicsWindow.FontBold = "true" for_ = Shapes.AddText("For To") Shapes.Move(for_, 3, 220) GraphicsWindow.FontBold = "false" GraphicsWindow.BrushColor = "black" times = Shapes.AddText("times") Shapes.Move(times, 30, 220) GraphicsWindow.BrushColor = "brown" equals = Shapes.AddText("=") Shapes.Move(equals, 70, 220) GraphicsWindow.BrushColor = "sandybrown" num = Shapes.AddText("1 9") Shapes.Move(num, 85, 220) GraphicsWindow.BrushColor = "black" lines = Shapes.AddText("lines times times") Shapes.Move(lines, 20, 240) GraphicsWindow.BrushColor = "brown" equals_addline = Shapes.AddText("=") Shapes.Move(equals_addline, 55, 240) GraphicsWindow.BrushColor = "darkcyan" shapes_ = Shapes.AddText("Shapes") Shapes.Move(shapes_, 72, 240) GraphicsWindow.BrushColor = "brown" addline = Shapes.AddText(". AddLine( , - + ( * ) , , - + ( * ))") Shapes.Move(addline, 115, 240) GraphicsWindow.BrushColor = "sandybrown" data = Shapes.AddText("0 50 51 612 50 51") Shapes.Move(data, 175, 240) GraphicsWindow.FontBold = "true" GraphicsWindow.BrushColor = "dodgerblue" endfor_ = Shapes.AddText("EndFor") Shapes.Move(endfor_, 3, 260) 'Vertical Lines GraphicsWindow.BrushColor = "dodgerblue" GraphicsWindow.FontBold = "true" for_ = Shapes.AddText("For To") Shapes.Move(for_, 3, 320) GraphicsWindow.FontBold = "false" GraphicsWindow.BrushColor = "black" times = Shapes.AddText("times") Shapes.Move(times, 30, 320) GraphicsWindow.BrushColor = "brown" equals = Shapes.AddText("=") Shapes.Move(equals, 70, 320) GraphicsWindow.BrushColor = "sandybrown" num = Shapes.AddText("1 13") Shapes.Move(num, 85, 320) GraphicsWindow.BrushColor = "black" lines = Shapes.AddText("lines times times") Shapes.Move(lines, 20, 340) GraphicsWindow.BrushColor = "brown" equals_addline = Shapes.AddText("=") Shapes.Move(equals_addline, 55, 340) GraphicsWindow.BrushColor = "darkcyan" shapes = Shapes.AddText("Shapes") Shapes.Move(shapes, 72, 340) GraphicsWindow.BrushColor = "brown" addline = Shapes.AddText(". AddLine( - + ( * ) , , - + ( * ) , )") Shapes.Move(addline, 115, 340) Shapes.Move(endfor_, 3, 360) GraphicsWindow.BrushColor = "sandybrown" data = Shapes.AddText("50 51 0 50 51 410") Shapes.Move(data, 185, 340) GraphicsWindow.FontBold = "true" GraphicsWindow.BrushColor = "dodgerblue" endfor_ = Shapes.AddText("EndFor") shapes.Move(endfor_, 3, 260) 'Show Window Source Code GraphicsWindow.FontBold = "false" GraphicsWindow.BrushColor = "darkcyan" gw = shapes.AddText("GraphicsWindow") shapes.Move(gw, 3, 420) GraphicsWindow.BrushColor = "brown" show = shapes.AddText(" . Show()") shapes.Move(show, 100, 420) 'Show Window GraphicsWindow.Show() End>GCW421.sb< Start>GCZ059-0.sb< Initialise() yy=300 InitHen () GraphicsWindow.Title="3D hen GraphicsWindow.MouseMove = OnMouseMove GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseUp = OnMouseUp init="true" LDEvents.MouseWheel =mwwl ccm=LDText.Split ("lightgray gray darkgray orange darkorange saddlebrown red darkred #660000 #333333 #222222 #111111 " " ") ballSX = LDArray.Create (15) ballSY = LDArray.Create (15) ballSZ = LDArray.Create (15) While "True" If (mww And mouseDown) or init Then mww="false" 'GraphicsWindow.BrushColor = bg 'GraphicsWindow.FillRectangle(0,0,gw,gh) GraphicsWindow.Clear () If init then init="false" else theta = -(GraphicsWindow.MouseX-mouseX)/gw*PI phi = -(GraphicsWindow.MouseY-mouseY)/gh*PI/2 cth=cth+theta cpi=cpi+phi 'GraphicsWindow.Title =theta +":"+phi setRotation() matrix1 = matrix matrix2 = rotationOLD multiply() rotation = matrix endif matrix = rotation For pz=0 to 13 For py= ymax to 0 Step -1 For px=xmax -1 to 0 Step -1 bs=LDArray.GetValue (bll 14-pz) bs1=LDArray.GetValue (bll 13-pz) tt=text.GetSubText(bs py*12+xmax-px 1) tt1=text.GetSubText(bs1 py*12+xmax-px 1) If tt=" " then else For iBall = 1 To dtc X = ballX[iBall]+px Y = ballY[iBall]+py Z = ballZ[iBall]+pz getScreen() LDArray.SetValue(ballSX iBall sx) LDArray.SetValue(ballSY iBall sy) LDArray.SetValue(ballSZ iBall sz) EndFor iq=1+(Text.GetIndexOf ("WORB" tt)-1)*3 cp=1 If tt1=" " then zc=dtc else zc=dtc-4 endif For iBall = 1 To zc Step 4 pp11= ldarray.GetValue (ballSX iBall) pp12= ldarray.GetValue (ballSY iBall)+yy pp21 = ldarray.GetValue (ballSX iBall+1) pp22 = ldarray.GetValue (ballSY iBall+1)+yy pp31 = ldarray.GetValue (ballSX iBall+2) pp32 = ldarray.GetValue (ballSY iBall+2)+yy pp41 = ldarray.GetValue (ballSX iBall+3) pp42 = ldarray.GetValue (ballSY iBall+3)+yy GraphicsWindow.BrushColor=ccm[iq] cc1= GraphicsWindow.BrushColor ' cc[2]=LDColours.HSLtoRGB (10+iball*10 1 0.2) If cp=2 then cc[1]=LDColours.HSLtoRGB (LDColours.GetHue (cc1) 1 LDColours.GetLightness (cc1)*0.7) ElseIf cp=3 then cc[1]=LDColours.HSLtoRGB (LDColours.GetHue (cc1) 1 LDColours.GetLightness (cc1)*1.5) endif cp=cp+1 ' gr= LDShapes.BrushGradient (cc, "DD") GraphicsWindow.BrushColor=cc1 GraphicsWindow.FillTriangle (pp11 pp12 pp21 pp22 pp31 pp32) GraphicsWindow.FillTriangle (pp31 pp32 pp41 pp42 pp11 pp12) GraphicsWindow.PenColor =cc1 GraphicsWindow.PenWidth =1 GraphicsWindow.drawTriangle (pp11 pp12 pp21 pp22 pp31 pp32) GraphicsWindow.drawTriangle (pp31 pp32 pp41 pp42 pp11 pp12) iq=iq+1 EndFor endif endfor endfor endfor endif ' GraphicsWindow.Title =cth+":"+cpi Program.Delay(15) EndWhile '###########################################*SUBS**** Sub mwwl scale =scale +LDEvents.LastMouseWheelDelta *10 init="true EndSub Sub Initialise tx="0 0 1 1 0 0 0 0 0 1 1 0 ty="0 0 0 0 0 1 1 0 0 0 1 1 tz="0 1 1 0 0 0 1 1 1 1 1 1 zr="2 0 1 PI = 2.0*Math.ArcCos(0) gw = 1200 gh = 800 bg = "darkblue" GraphicsWindow.PenWidth=0 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BackgroundColor = bg GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 centreX = 0 centreY = 0 centreZ = 0 radBall = 15 scale = 50 theta = 244 phi = 160 cth=theta cpi=phi ballx=ldtext.Split(tx " ") bally=ldtext.Split(ty " ") ballz=ldtext.Split(tz " ") zor= ldtext.Split(zr " ") dtc=array.GetItemCount (ballx) setRotation() rotation = matrix EndSub Sub setRotation 'Input : theta, phi Output : matrix mct=Math.Cos(theta) mcp=Math.Cos(phi) mst=Math.Sin(theta) msp=Math.Sin(phi) matrix[1][1] = Mct*Mcp matrix[1][2] = mst matrix[1][3] = mct*msp matrix[2][1] = -mst*mcp matrix[2][2] = mct matrix[2][3] = -mst*msp matrix[3][1] = -msp matrix[3][2] = 0 matrix[3][3] = mcp EndSub Sub multiply For i = 1 To 3 For j = 1 To 3 matrix[i][j] = 0 For k = 1 To 3 matrix[i][j] = matrix[i][j] + matrix1[i][k]*matrix2[k][j] EndFor EndFor EndFor EndSub Sub getAngles 'Input : matrix Output theta, phi phi = Math.ArcCos(Math.Min(1.0,Math.Max(-1.0,matrix[3][3]))) theta = Math.ArcCos(Math.Min(1.0,Math.Max(-1.0,matrix[2][2]))) If (matrix[1][2] < 0) Then theta = theta+PI EndIf EndSub Sub getScreen 'Input matrix, scale, centreX, centreY, centreZ, X, Y, Z 'Output SX, SY, SZ(depth) DX = (X-centreX)*scale DY = (Y-centreY)*scale DZ = (Z-centreZ)*scale SX = gw/2 + DX*matrix[2][1] + DY*matrix[2][2] + DZ*matrix[2][3] SY = gh/2 + DX*matrix[3][1] + DY*matrix[3][2] + DZ*matrix[3][3] SZ = (DX*matrix[1][1] + DY*matrix[1][2] + DZ*matrix[1][3])/255/scale EndSub Sub OnMouseMove mww="true" EndSub Sub OnMouseDown mww="true" mouseX = GraphicsWindow.MouseX mouseY = GraphicsWindow.MouseY rotationOLD = rotation mouseDown = "true" EndSub Sub OnMouseUp mouseDown = "false" EndSub Sub inithen bll=LDArray.Create (15) ' > . . . . . . . block[13]= " O OOO O O OOO O " block[12]= " O O " block[11]= " O O " block[10]= " W W " block [9]= " WW WW WWW WWWWWW WWWWWW WWWWWW WW WW WW " block [8]= " WWWW W W W W W W W W W W WWWW " block [7]= " WWWWW W W W W W W W W W W WWWWW " block [6]= " WWWWWW WWWWWwW wWWWWwW WWWWWwW WWWWWW " block [5]= " WWW WW WWWR WWW " block [4]= " WWW W R WWW " block [3]= " WBW W OO WBW " block [2]= " WWW WWRR WWW " block [1]= " RR " block [0]= " " xmax = 11 ymax = 6 zmax = 12 For x=0 To 13 LDArray.SetValue (bll x+1 block[x]) EndFor EndSub End>GCZ059-0.sb< Start>GCZ059.sb< Initialise() yy=300 InitHen () GraphicsWindow.Title="3D hen GraphicsWindow.MouseMove = OnMouseMove GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseUp = OnMouseUp init="true" LDEvents.MouseWheel =mwwl ccm=LDText.Split ("lightgray gray darkgray orange darkorange brown red darkred red gray darkgray black " " ") ballSX = LDArray.Create (15) ballSY = LDArray.Create (15) ballSZ = LDArray.Create (15) While "True" If (mww And mouseDown) or init Then mww="false" 'GraphicsWindow.BrushColor = bg 'GraphicsWindow.FillRectangle(0,0,gw,gh) GraphicsWindow.Clear () If init then init="false" else theta = -(GraphicsWindow.MouseX-mouseX)/gw*PI phi = -(GraphicsWindow.MouseY-mouseY)/gh*PI/2 cth=cth+theta cpi=cpi+phi 'GraphicsWindow.Title =theta +":"+phi setRotation() matrix1 = matrix matrix2 = rotationOLD multiply() rotation = matrix endif matrix = rotation For pz=0 to 13 For py= ymax to 0 Step -1 For px=xmax -1 to 0 Step -1 bs=LDArray.GetValue (bll 14-pz) bs1=LDArray.GetValue (bll 13-pz) tt=text.GetSubText(bs py*12+xmax-px 1) tt1=text.GetSubText(bs1 py*12+xmax-px 1) If tt=" " then else For iBall = 1 To dtc X = ballX[iBall]+px Y = ballY[iBall]+py Z = ballZ[iBall]+pz getScreen() LDArray.SetValue(ballSX iBall sx) LDArray.SetValue(ballSY iBall sy) LDArray.SetValue(ballSZ iBall sz) EndFor iq=1+(Text.GetIndexOf ("WORB" tt)-1)*3 cp=1 If tt1=" " then zc=dtc else zc=dtc-4 endif For iBall = 1 To zc Step 4 pp11= ldarray.GetValue (ballSX iBall) pp12= ldarray.GetValue (ballSY iBall)+yy pp21 = ldarray.GetValue (ballSX iBall+1) pp22 = ldarray.GetValue (ballSY iBall+1)+yy pp31 = ldarray.GetValue (ballSX iBall+2) pp32 = ldarray.GetValue (ballSY iBall+2)+yy pp41 = ldarray.GetValue (ballSX iBall+3) pp42 = ldarray.GetValue (ballSY iBall+3)+yy GraphicsWindow.BrushColor=ccm[iq] cc1= GraphicsWindow.BrushColor ' cc[2]=LDColours.HSLtoRGB (10+iball*10 1 0.2) If cp=2 then cc[1]=LDColours.HSLtoRGB (LDColours.GetHue (cc1) 1 LDColours.GetLightness (cc1)*0.7) ElseIf cp=3 then cc[1]=LDColours.HSLtoRGB (LDColours.GetHue (cc1) 1 LDColours.GetLightness (cc1)*1.5) endif cp=cp+1 ' gr= LDShapes.BrushGradient (cc, "DD") GraphicsWindow.BrushColor=cc1 GraphicsWindow.FillTriangle (pp11 pp12 pp21 pp22 pp31 pp32) GraphicsWindow.FillTriangle (pp31 pp32 pp41 pp42 pp11 pp12) GraphicsWindow.PenColor =cc1 GraphicsWindow.PenWidth =1 GraphicsWindow.drawTriangle (pp11 pp12 pp21 pp22 pp31 pp32) GraphicsWindow.drawTriangle (pp31 pp32 pp41 pp42 pp11 pp12) iq=iq+1 EndFor endif endfor endfor endfor endif ' GraphicsWindow.Title =cth+":"+cpi Program.Delay(15) EndWhile '###########################################*SUBS**** Sub mwwl scale =scale +LDEvents.LastMouseWheelDelta *10 init="true EndSub Sub Initialise tx="0 0 1 1 0 0 0 0 0 1 1 0 ty="0 0 0 0 0 1 1 0 0 0 1 1 tz="0 1 1 0 0 0 1 1 1 1 1 1 zr="2 0 1 PI = 2.0*Math.ArcCos(0) gw = 1200 gh = 800 bg = "darkblue" GraphicsWindow.PenWidth=0 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BackgroundColor = bg GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 centreX = 0 centreY = 0 centreZ = 0 radBall = 15 scale = 50 theta = 244 phi = 160 cth=theta cpi=phi ballx=ldtext.Split(tx " ") bally=ldtext.Split(ty " ") ballz=ldtext.Split(tz " ") zor= ldtext.Split(zr " ") dtc=array.GetItemCount (ballx) setRotation() rotation = matrix EndSub Sub setRotation 'Input : theta, phi Output : matrix mct=Math.Cos(theta) mcp=Math.Cos(phi) mst=Math.Sin(theta) msp=Math.Sin(phi) matrix[1][1] = Mct*Mcp matrix[1][2] = mst matrix[1][3] = mct*msp matrix[2][1] = -mst*mcp matrix[2][2] = mct matrix[2][3] = -mst*msp matrix[3][1] = -msp matrix[3][2] = 0 matrix[3][3] = mcp EndSub Sub multiply For i = 1 To 3 For j = 1 To 3 matrix[i][j] = 0 For k = 1 To 3 matrix[i][j] = matrix[i][j] + matrix1[i][k]*matrix2[k][j] EndFor EndFor EndFor EndSub Sub getAngles 'Input : matrix Output theta, phi phi = Math.ArcCos(Math.Min(1.0,Math.Max(-1.0,matrix[3][3]))) theta = Math.ArcCos(Math.Min(1.0,Math.Max(-1.0,matrix[2][2]))) If (matrix[1][2] < 0) Then theta = theta+PI EndIf EndSub Sub getScreen 'Input matrix, scale, centreX, centreY, centreZ, X, Y, Z 'Output SX, SY, SZ(depth) DX = (X-centreX)*scale DY = (Y-centreY)*scale DZ = (Z-centreZ)*scale SX = gw/2 + DX*matrix[2][1] + DY*matrix[2][2] + DZ*matrix[2][3] SY = gh/2 + DX*matrix[3][1] + DY*matrix[3][2] + DZ*matrix[3][3] SZ = (DX*matrix[1][1] + DY*matrix[1][2] + DZ*matrix[1][3])/255/scale EndSub Sub OnMouseMove mww="true" EndSub Sub OnMouseDown mww="true" mouseX = GraphicsWindow.MouseX mouseY = GraphicsWindow.MouseY rotationOLD = rotation mouseDown = "true" EndSub Sub OnMouseUp mouseDown = "false" EndSub Sub inithen bll=LDArray.Create (15) ' > . . . . . . . block[13]= " O OOO O O OOO O " block[12]= " O O " block[11]= " O O " block[10]= " W W " block [9]= " WW WW WW WWWWWW WWWWWW WWWWWW WW WW WW " block [8]= " WWWW W W W W W W W W W W WWWW " block [7]= " WWWWW W W W W W W W W W W WWWWW " block [6]= " WWWWWW WWWWWww wWWWWww WWWWWww WWWWWW " block [5]= " WWW WW WWWR WWW " block [4]= " WWW WWR WWW " block [3]= " WBW WWWOO WBW " block [2]= " WWW WWRR WWW " block [1]= " RR " block [0]= " " xmax = 11 ymax = 6 zmax = 12 For x=0 To 13 LDArray.SetValue (bll x+1 block[x]) EndFor EndSub End>GCZ059.sb< Start>GCZ975.sb< GraphicsWindow.BackgroundColor="tan GraphicsWindow.BrushColor="darkblue GraphicsWindow.Title="Rule30 Generator m=160 s10=3 GraphicsWindow.Width=(2*m+1)*s10 GraphicsWindow.Height=m*s10 c=m+1 a[c][1]="true For y=2 To m For x=2 To m*2 cc=a[x][y-1] lc=a[x-1][y-1] rc=a[x+1][y-1] a[x][y]=LDLogic.XOr(lc ldlogic.Or_(cc rc)) EndFor EndFor For y=1 To m For x=1 To m*2 if a[x][y] Then GraphicsWindow.FillRectangle(x*s10 y*s10 s10 s10) EndIf EndFor EndFor End>GCZ975.sb< Start>GDC167.sb< ' Aquarium x = 110 y = 60 width = 400 height = 300 depth = 230 ' draw aqarium GraphicsWindow.BackgroundColor = "darkblue GraphicsWindow.PenColor = "White" GraphicsWindow.BrushColor="darkcyan GraphicsWindow.fillRectangle(x+66, y-44, width, height) GraphicsWindow.DrawRectangle(x+66, y-44, width, height) GraphicsWindow.DrawLine (x y x+66 y-44) GraphicsWindow.DrawLine (x+width y+height x+66+width y-44+height ) GraphicsWindow.DrawLine (x+width y x+66+width y-44 ) GraphicsWindow.fillRectangle(x, y, width, height) GraphicsWindow.FillTriangle (x+width y+height x+66+width y-44+height x +width y-55+ height ) GraphicsWindow.FillTriangle(x y x+66 y-44 x+66 y) GraphicsWindow.DrawRectangle(x, y, width, height) GraphicsWindow.BrushColor = "DimGray" GraphicsWindow.Title = "DeepSkyBlue Fish" GraphicsWindow.PenColor =LDColours.HSLtoRGB (170 .7 0.4) GraphicsWindow.DrawLine (x+66 y x+66 y+ height-44 ) GraphicsWindow.DrawLine (x y+height x+66 y+ height-44 ) GraphicsWindow.DrawLine (x+66 y+height-44 x+66+width y+ height-44 ) For z=1 To 5 If z=1 Then ss=20 pp=90+50 else pp=10+50 ss=30 Endif For xx=1 To 4 s[z][xx]=shapes.AddEllipse (6 6) Shapes.Move (s[z][xx] 10*z+ss+pp,330+z*5) ss=ss*1.618 LDPhysics.AddMovingShape (s[z][xx] 0 .3 2) EndFor fs=10*z+ss+pp a1[z]=LDPhysics.AddFixedAnchor (fs 330+z*5) LDPhysics.RopeColour="lime 'GraphicsWindow.DrawEllipse (fs,150 8 8) LDPhysics.AttachShapesWithJoint ( s[z][4] a1[z] "Distance" "" 0 ) LDPhysics.AddRope (a1[z] s[z][4] ) For xx=0 To 2 LDPhysics.AttachShapesWithJoint ( s[z][3-xx] s[z][4-xx] "Distance" "" 0 ) LDPhysics.AddRope (s[z][3-xx] s[z][4-xx]) EndFor If z>1 Then LDPhysics.AttachShapesWithJoint ( s[z][4] s[z-1][4] "Distance" "" 0 ) Endif If z>=1 Then LDPhysics.AttachShapesWithJoint(s[z][1] s[z][1], "Mouse" "" "") endif EndFor LDPhysics.SetGravity (0, -60) 'GraphicsWindow.MouseMove =mww ff=50 AddBall() AddBubbles() AddFish() AddWater() StartTimer() While "true cc=cc+1 If Math.Remainder (cc 150)=0 Then cc=1 ff=-ff LDPhysics.SetGravity (ff, -100) endif LDPhysics.DoTimestep () Program.Delay (15) EndWhile Sub AddFish nFish = 5 hFish = 20 ' height For i = 1 To nFish Stack.PushValue("local", x) Stack.PushValue("local", y) dirFish[i] = 1 ' direction x = x + 10 + Math.GetRandomNumber(width - 10 - hFish * 3) y = y + height - hFish - Math.GetRandomNumber(depth - hFish) GraphicsWindow.PenColor = "DodgerBlue" ' tail color GraphicsWindow.BrushColor = "DeepSkyBlue" ' tail color oFishTail[i] = Shapes.AddRectangle(hFish * 1.5, hFish * 0.5) xFishTail[i] = x yFishTail[i] = y + hFish * 0.25 Shapes.Move(oFishTail[i], xFishTail[i], yFishTail[i]) GraphicsWindow.PenColor = "DodgerBlue" ' fish color GraphicsWindow.BrushColor = "DeepSkyBlue" ' fish color oFishBody[i] = Shapes.AddEllipse(hFish * 2, hFish) xFishBody[i] = x + hFish yFishBody[i] = y Shapes.Move(oFishBody[i], xFishBody[i], yFishBody[i]) GraphicsWindow.PenColor = "White" ' eye color GraphicsWindow.BrushColor = "Black" ' eye color oFishEye[i] = Shapes.AddEllipse(hFish * 0.5, hFish * 0.5) xFishEye[i] = x + hFish * 2.25 yFishEye[i] = y + hFish * 0.25 Shapes.Move(oFishEye[i], xFishEye[i], yFishEye[i]) y = Stack.PopValue("local") x = Stack.PopValue("local") EndFor EndSub Sub MoveFish distance = 2 For i = 1 To nFish xFishEye[i] = xFishEye[i] + distance * dirFish[i] xFishBody[i] = xFishBody[i] + distance * dirFish[i] xFishTail[i] = xFishTail[i] + distance * dirFish[i] If xFishBody[i] < x Then xFishBody[i] = x + 10 + hFish xFishEye[i] = xFishBody[i] + hFish * 1.25 xFishTail[i] = xFishBody[i] - hFish dirFish[i] = 1 ElseIf x + width - 10 < xFishBody[i] + hFish * 3 Then xFishBody[i] = x + width - hFish * 3 - 10 xFishEye[i] = xFishBody[i] + hFish * 0.25 xFishTail[i] = xFishBody[i] + hFish * 1.5 dirFish[i] = -1 EndIf Shapes.Move(oFishEye[i], xFishEye[i], yFishEye[i]) Shapes.Move(oFishBody[i], xFishBody[i], yFishBody[i]) Shapes.Move(oFishTail[i], xFishTail[i], yFishTail[i]) LDShapes.ZIndex (oFishbody[i], -100+i) LDShapes.ZIndex (oFishEye[i], -50+i) LDShapes.ZIndex (oFishtail[i], -150+i) EndFor EndSub Sub AddBubbles nBubbles = 10 GraphicsWindow.PenColor = "White" GraphicsWindow.BrushColor = "White" For i = 1 To nBubbles oBubbles[i] = Shapes.AddEllipse(5, 5) xBubbles[i] = x + 60 + Math.GetRandomNumber(50) yBubbles[i] = y + height - 25 - Math.GetRandomNumber(depth - 25) EndFor EndSub Sub MoveBubbles up = 10 For i = 1 To nBubbles yBubbles[i] = yBubbles[i] - up If yBubbles[i] < y + height - depth Then xBubbles[i] = x + 60 + Math.GetRandomNumber(50) yBubbles[i] = y + height - 25 - Math.GetRandomNumber(up) EndIf Shapes.Move(oBubbles[i], xBubbles[i], yBubbles[i]) EndFor EndSub Sub AddBall Stack.PushValue("local", x) Stack.PushValue("local", y) GraphicsWindow.PenColor = "DarkGray" GraphicsWindow.BrushColor = "DarkGray" oAquarium = Shapes.AddEllipse(50, 50) x = x + 60 y = y + height - 50 Shapes.Move(oAquarium, x, y) Shapes.SetOpacity(oAquarium, 50) y = Stack.PopValue("local") x = Stack.PopValue("local") EndSub Sub AddWater Stack.PushValue("local", y) y = y + height - depth GraphicsWindow.PenColor = "White" GraphicsWindow.BrushColor = "Aqua" oAquarium = Shapes.AddRectangle(width, depth) Shapes.Move(oAquarium, x, y) Shapes.SetOpacity(oAquarium, 10) y = Stack.PopValue("local") EndSub Sub StartTimer Timer.Interval = 50 Timer.Tick = OnTick EndSub Sub OnTick MoveBubbles() MoveFish() EndSub End>GDC167.sb< Start>GDC622.sb< ' mahreen miangul ' FebrUary 2017 GraphicsWindow.Width = 1080 GraphicsWindow.Height = 420 GraphicsWindow.BackgroundColor = "snow" GraphicsWindow.Show() MakeSprite() ddx=-5 ddy=0 ' Sprite Animation shoot="False" '<------------ GraphicsWindow.KeyDown = OnKeyDown While "True" '<------------ TrainMove="True" '<------------ While TrainMove '<------------ For i=1 To 6 Shapes.Move(ell[i],Shapes.GetLeft(ell[i])+ddx,shapes.GetTop(ell[i])+ddy) Shapes.Move(rec[i],Shapes.GetLeft(rec[i])+ddx,shapes.GetTop(rec[i])+ddy) Shapes.Move(Tri[i],Shapes.GetLeft(Tri[i])+ddx,shapes.GetTop(Tri[i])+ddy) Shapes.Move(line[i],Shapes.GetLeft(line[i])+ddx,shapes.GetTop(line[i])+ddy) EndFor If Shapes.GetLeft(ell[1])<-200 Then moveright() EndIf If Shapes.GetLeft(ell[1])>1200 then 'WhT ddx=-ddx 'WhT EndIf 'WhT If shoot Then '<------------ Shapes.Move(ball, 600,Shapes.Gettop(ball)-5)'<------------ bX= Shapes.GetLeft(ball)+50+(110-50)/2 '<------------ bY= Shapes.GetTop(ball) +20'<------------ TX= Shapes.GetLeft(Tri[4])+230 '<------------ TY= Shapes.Gettop(Tri[4])+385 '<------------ GraphicsWindow.Title="bX= "+bx+" TX= "+TX+" : BY= "+BY+" TY= "+TY+" : "+shoot If bY<-100 then '<------------ shoot="False"'<------------ EndIf '<------------ If bX>TX and bXTY and bYGDC622.sb< Start>GDD223.sb< ' Turtle Tartan ' Copyright © 2019 Nonki Takahashi. The MIT License. GraphicsWindow.Title = "Turtle Tartan" Init() ' horizontal pattern Turtle.Angle = -135 GraphicsWindow.PenWidth = 2 For i = 0 To gw + gh Step 4 j = 1 x1 = i y1 = 0 ymax = i GraphicsWindow.PenColor = pattern[j]["color"] y = pattern[j]["width"] If ymax < y Then y = ymax EndIf While y <= ymax y2 = y x2 = x1 - (y2 - y1) DrawLine() If y < ymax Then x1 = x2 y1 = y2 j = j + 1 If Array.GetItemCount(pattern) < j Then j = 1 EndIf y = y + pattern[j]["width"] If ymax < y Then y = ymax EndIf GraphicsWindow.PenColor = pattern[j]["color"] Else y = ymax + 1 EndIf EndWhile EndFor ' vertical pattern Turtle.Angle = 45 GraphicsWindow.PenWidth = 1 For i = 2 To gw + gh Step 4 j = 1 x1 = 0 y1 = i xmax = i GraphicsWindow.PenColor = pattern[j]["color"] x = pattern[j]["width"] If xmax < x Then x = xmax EndIf While x <= xmax x2 = x y2 = y1 - (x2 - x1) DrawLine() If x < xmax Then x1 = x2 y1 = y2 j = j + 1 If Array.GetItemCount(pattern) < j Then j = 1 EndIf x = x + pattern[j]["width"] If xmax < x Then x = xmax EndIf GraphicsWindow.PenColor = pattern[j]["color"] Else x = xmax + 1 EndIf EndWhile EndFor Sub DrawLine Turtle.X = x2 Turtle.Y = y2 GraphicsWindow.DrawLine(x1, y1, x2, y2) Program.Delay(1) EndSub Sub Init gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BackgroundColor = "#222222" Turtle.Show() Turtle.PenUp() pattern[1] = "width=20;color=Black;" pattern[2] = "width=23;color=Teal;" pattern[3] = "width=2;color=Black;" pattern[4] = "width=4;color=DarkRed;" pattern[5] = "width=2;color=Black;" pattern[6] = "width=23;color=Teal;" pattern[7] = "width=20;color=Black;" pattern[8] = "width=25;color=SeaGreen;" pattern[9] = "width=4;color=Gold;" pattern[10] = "width=25;color=SeaGreen;" pattern[11] = "width=20;color=Black;" pattern[12] = "width=4;color=Teal;" pattern[13] = "width=4;color=Black;" pattern[14] = "width=4;color=Teal;" pattern[15] = "width=4;color=Black;" pattern[16] = "width=12;color=Teal;" pattern[17] = "width=4;color=DarkRed;" pattern[18] = "width=12;color=Teal;" pattern[19] = "width=4;color=Black;" pattern[20] = "width=4;color=Teal;" pattern[21] = "width=4;color=Black;" pattern[22] = "width=4;color=Teal;" pattern[23] = "width=20;color=Black;" pattern[24] = "width=25;color=SeaGreen;" pattern[25] = "width=4;color=Gold;" pattern[26] = "width=25;color=SeaGreen;" EndSub End>GDD223.sb< Start>GDD325-1.sb< ' Halloween ' Copyright (c) 2014 Nonki Takahashi. The MIT License. ' 2014-10-27 15:47:30 Shapes generated by Shapes 1.7b. ' Version 0.3 ' Last update 2014-10-28 ' Program ID GDD325-1 ' Not = "True=False;False=True;" SB_Workaround() gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Title = "Halloween" GraphicsWindow.BackgroundColor = "#333333" GraphicsWindow.FontName = "Trebuchet MS" GraphicsWindow.FontSize = 40 GraphicsWindow.BrushColor = "Black" trick = Controls.AddButton("TRICK", 10, 10) GraphicsWindow.BrushColor = "LightGray" orText = Shapes.AddText("OR") Shapes.Move(orText, 280, 16) GraphicsWindow.BrushColor = "Black" treat = Controls.AddButton("TREAT", 455, 10) ' initialize shapes Shapes_Init_Jack() ' add shapes scale = 1 angle = 0 iMin = 1 iMax = 22 Shapes_Add() clicked = "False" Controls.ButtonClicked = OnButtonClicked While Not[clicked] Program.Delay(500) EndWhile Shapes_Remove() Controls.Remove(trick) Shapes.Remove(orText) Controls.Remove(treat) If Controls.LastClickedButton = trick Then GraphicsWindow.BackgroundColor = "Purple" ' draw moon GraphicsWindow.BrushColor = "White" size = 100 x = gw - size - 10 y = 10 GraphicsWindow.FillEllipse(x, y, size, size) ' draw ground GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(0, gh - 110, gw, 110) ' draw tree DrawTree() ' draw Jack-o'-lanterns jx = "1=16;2=116;3=216;4=316;5=416;6=516;" jy = "1=300;2=300;3=300;4=300;5=300;6=300;" url = "http://gallery.technet.microsoft.com/site/view/file/127749/1/LightJack.png" img = ImageList.LoadImage(url) jw = ImageList.GetWidthOfImage(img) jh = ImageList.GetHeightOfImage(img) For i = 1 To 6 jack[i] = Shapes.AddImage(img) s = 1 Shapes.Zoom(jack[i], s, s) Shapes.Move(jack[i], jx[i] + (s - 1) * jw, jy[i] + (s - 1) * jh) EndFor ' draw caption GraphicsWindow.BrushColor = "Orange" halloween = Shapes.AddText("Happy Halloween") x = 10 y = gh - 60 Shapes.Move(halloween, x, y) ' draw bats url = "http://gallery.technet.microsoft.com/site/view/file/127750/1/OpenBat.png" oImg = ImageList.LoadImage(url) ow = ImageList.GetWidthOfImage(oImg) oh = ImageList.GetHeightOfImage(oImg) url = "http://gallery.technet.microsoft.com/site/view/file/127751/1/CloseBat.png" cImg = ImageList.LoadImage(url) cw = ImageList.GetWidthOfImage(cImg) ch = ImageList.GetHeightOfImage(cImg) For i = 1 To 9 bat[i]["open"] = Shapes.AddImage(oImg) bat[i]["close"] = Shapes.AddImage(cImg) bat[i]["cycle"] = Math.GetRandomNumber(4) bat[i]["x"] = Math.GetRandomNumber(gw - ow) bat[i]["y"] = Math.GetRandomNumber(gh - 110 - oh) bat[i]["angle"] = Math.GetRandomNumber(21) - 11 EndFor Program.Delay(500) Timer.Interval = 1000 / 20 Timer.Tick = OnTick Else GraphicsWindow.BackgroundColor = "Orange" url = "http://gallery.technet.microsoft.com/site/view/file/127746/1/Candy1.png" candy1 = Shapes.AddImage(url) x = 10 y = 40 Shapes.Move(candy1, x, y) Shapes.Rotate(candy1, -10) url = "http://gallery.technet.microsoft.com/site/view/file/127747/1/Candy2.png" candy2 = Shapes.AddImage(url) x = 210 Shapes.Move(candy2, x, y) x = 410 url = "http://gallery.technet.microsoft.com/site/view/file/127748/1/Candy3.png" candy3 = Shapes.AddImage(url) Shapes.Move(candy3, x, y) Shapes.Rotate(candy3, 10) GraphicsWindow.BrushColor = "Black" halloween = Shapes.AddText("Happy Halloween") x = 10 y = gh - 60 Shapes.Move(halloween, x, y) EndIf Sub DrawTree pw = 20 ' pen width dl = 10 ' delta length branch[1]["x1"] = 100 branch[1]["y1"] = gh - 110 branch[1]["angle"] = -90 GraphicsWindow.PenColor = "Black" For j = 1 To 20 GraphicsWindow.PenWidth = pw n = Array.GetItemCount(branch) m = 0 For i = 1 To n If Math.GetRandomNumber(100) < 15 Then _a1 = Math.GetRadians(branch[i]["angle"] - 20) branch[i]["x2"] = branch[i]["x1"] + dl * Math.Cos(_a1) branch[i]["y2"] = branch[i]["y1"] + dl * Math.Sin(_a1) branch[i]["angle"] = branch[i]["angle"] - 20 + Math.GetRandomNumber(11) - 6 GraphicsWindow.DrawLine(branch[i]["x1"], branch[i]["y1"], branch[i]["x2"], branch[i]["y2"]) branch[i]["x1"] = branch[i]["x2"] branch[i]["y1"] = branch[i]["y2"] _a2 = Math.GetRadians(branch[i]["angle"] + 20) m = m + 1 branch[n + m]["x2"] = branch[i]["x1"] + dl * Math.Cos(_a2) branch[n + m]["y2"] = branch[i]["y1"] + dl * Math.Sin(_a2) branch[n + m]["angle"] = branch[i]["angle"] + 20 + Math.GetRandomNumber(11) - 6 GraphicsWindow.DrawLine(branch[i]["x1"], branch[i]["y1"], branch[n + m]["x2"], branch[n + m]["y2"]) branch[n + m]["x1"] = branch[n + m]["x2"] branch[n + m]["y1"] = branch[n + m]["y2"] Else _a = Math.GetRadians(branch[i]["angle"]) branch[i]["x2"] = branch[i]["x1"] + dl * Math.Cos(_a) branch[i]["y2"] = branch[i]["y1"] + dl * Math.Sin(_a) branch[i]["angle"] = branch[i]["angle"] + Math.GetRandomNumber(11) - 6 GraphicsWindow.DrawLine(branch[i]["x1"], branch[i]["y1"], branch[i]["x2"], branch[i]["y2"]) branch[i]["x1"] = branch[i]["x2"] branch[i]["y1"] = branch[i]["y2"] EndIf EndFor pw = pw - 1 EndFor EndSub Sub OnButtonClicked clicked = "True" EndSub Sub OnTick For i = 1 To 9 bat[i]["cycle"] = bat[i]["cycle"] + 1 If 8 < bat[i]["cycle"] Then bat[i]["cycle"] = 1 EndIf bat[i]["x"] = bat[i]["x"] + Math.GetRandomNumber(7) - 4 If bat[i]["x"] < 0 Then bat[i]["x"] = 0 ElseIf (gw - ow) < bat[i]["x"] Then bat[i]["x"] = gw - ow EndIf bat[i]["y"] = bat[i]["y"] + Math.GetRandomNumber(17) - 9 If bat[i]["y"] < 0 Then bat[i]["y"] = 0 ElseIf (gh - 110 - oh) < bat[i]["y"] Then bat[i]["y"] = gh - 110 - oh EndIf bat[i]["angle"] = bat[i]["angle"] + Math.GetRandomNumber(7) - 4 If bat[i]["angle"] < -10 Then bat[i]["angle"] = -10 ElseIf 10 < bat[i]["angle"] Then bat[i]["angle"] = 10 EndIf If bat[i]["cycle"] < 4 Then Shapes.HideShape(bat[i]["close"]) Shapes.Move(bat[i]["open"], bat[i]["x"], bat[i]["y"]) Shapes.Rotate(bat[i]["open"], bat[i]["angle"]) Shapes.ShowShape(bat[i]["open"]) Else Shapes.HideShape(bat[i]["open"]) Shapes.Move(bat[i]["close"], bat[i]["x"], bat[i]["y"]) Shapes.Rotate(bat[i]["close"], bat[i]["angle"]) Shapes.ShowShape(bat[i]["close"]) EndIf EndFor EndSub Sub Shapes_Init_Jack ' Shapes | Initialize Jack shapes data ' return shX, shY - current position of shapes ' return shape - array of shapes shX = 146 ' x offset shY = 102 ' y offset shape = "" shape[1] = "func=ell;x=14;y=258;width=287;height=31;bc=#000000;pw=0;" shape[2] = "func=ell;x=0;y=35;width=79;height=224;bc=#D76E18;pw=0;" shape[3] = "func=ell;x=43;y=20;width=99;height=255;bc=#D76E18;pw=0;" shape[4] = "func=ell;x=231;y=37;width=84;height=215;bc=#D76E18;pw=0;" shape[5] = "func=ell;x=181;y=33;width=99;height=239;bc=#D76E18;pw=0;" shape[6] = "func=ell;x=100;y=21;width=127;height=255;bc=#D76E18;pw=0;" shape[7] = "func=rect;x=159;y=0;width=16;height=40;angle=7;bc=#2D5C32;pw=0;" shape[8] = "func=tri;x=142;y=16;x1=9;y1=0;x2=0;y2=36;x3=19;y3=36;angle=271;bc=#2D5C32;pw=0;" shape[9] = "func=tri;x=145;y=30;x1=8;y1=0;x2=0;y2=30;x3=16;y3=30;angle=234;bc=#2D5C32;pw=0;" shape[10] = "func=tri;x=171;y=18;x1=8;y1=0;x2=0;y2=37;x3=16;y3=37;angle=95;bc=#2D5C32;pw=0;" shape[11] = "func=tri;x=174;y=31;x1=6;y1=0;x2=0;y2=31;x3=12;y3=31;angle=116;bc=#2D5C32;pw=0;" shape[12] = "func=ell;x=64;y=102;width=63;height=63;bc=#000000;pw=0;" shape[13] = "func=ell;x=192;y=102;width=60;height=61;bc=#000000;pw=0;" shape[14] = "func=ell;x=230;y=134;width=7;height=0;bc=#000000;pw=0;" shape[15] = "func=tri;x=35;y=165;x1=22;y1=0;x2=0;y2=65;x3=44;y3=65;angle=298;bc=#000000;pw=0;" shape[16] = "func=tri;x=229;y=170;x1=22;y1=0;x2=0;y2=57;x3=44;y3=57;angle=59;bc=#000000;pw=0;" shape[17] = "func=rect;x=74;y=190;width=166;height=46;bc=#000000;pw=0;" shape[18] = "func=rect;x=92;y=185;width=34;height=30;bc=#D76E18;pw=0;" shape[19] = "func=rect;x=182;y=183;width=26;height=31;bc=#D76E18;pw=0;" shape[20] = "func=rect;x=64;y=208;width=18;height=36;bc=#D76E18;pw=0;" shape[21] = "func=rect;x=138;y=215;width=32;height=34;bc=#D76E18;pw=0;" shape[22] = "func=rect;x=216;y=213;width=26;height=27;bc=#D76E18;pw=0;" EndSub Sub Math_CartesianToPolar ' Math | convert cartesian coodinate to polar coordinate ' param x, y - cartesian coordinate ' return r, a - polar coordinate r = Math.SquareRoot(x * x + y * y) If x = 0 And y > 0 Then a = 90 ' [degree] ElseIf x = 0 And y < 0 Then a = -90 Else a = Math.ArcTan(y / x) * 180 / Math.Pi EndIf If x < 0 Then a = a + 180 ElseIf x > 0 And y < 0 Then a = a + 360 EndIf EndSub Sub SB_RotateWorkaround ' Small Basic | Rotate workaround for Silverlight ' param x, y - original coordinate ' param alpha - angle [radian] ' returns x, y - workaround coordinate If shape[i]["func"] = "tri" Then x1 = -Math.Floor(shape[i]["x3"] / 2) y1 = -Math.Floor(shape[i]["y3"] / 2) ElseIf shape[i]["func"] = "line" Then x1 = -Math.Floor(Math.Abs(shape[i]["x1"] - shape[i]["x2"]) / 2) y1 = -Math.Floor(Math.Abs(shape[i]["y1"] - shape[i]["y2"]) / 2) EndIf ox = x - x1 oy = y - y1 x = x1 * Math.Cos(alpha) - y1 * Math.Sin(alpha) + ox y = x1 * Math.Sin(alpha) + y1 * Math.Cos(alpha) + oy EndSub Sub SB_Workaround ' Small Basic | Workaround for Silverlight ' returns silverlight - "True" if in remote color = GraphicsWindow.GetPixel(0, 0) If Text.GetLength(color) > 7 Then silverlight = "True" msWait = 300 Else silverlight = "False" EndIf EndSub Sub Shapes_Add ' Shapes | add shapes as shapes data ' param iMin, iMax - shape indices to add ' param shape - array of shapes ' param scale - 1 if same scale ' return shWidth, shHeight - total size of shapes ' return shAngle - current angle of shapes Stack.PushValue("local", i) Stack.PushValue("local", x) Stack.PushValue("local", y) Shapes_CalcWidthAndHeight() s = scale For i = iMin To iMax GraphicsWindow.PenWidth = shape[i]["pw"] * s If shape[i]["pw"] > 0 Then GraphicsWindow.PenColor = shape[i]["pc"] EndIf If Text.IsSubText("rect|ell|tri|text", shape[i]["func"]) Then GraphicsWindow.BrushColor = shape[i]["bc"] EndIf If shape[i]["func"] = "rect" Then shape[i]["obj"] = Shapes.AddRectangle(shape[i]["width"] * s, shape[i]["height"] * s) ElseIf shape[i]["func"] = "ell" Then shape[i]["obj"] = Shapes.AddEllipse(shape[i]["width"] * s, shape[i]["height"] * s) ElseIf shape[i]["func"] = "tri" Then shape[i]["obj"] = Shapes.AddTriangle(shape[i]["x1"] * s, shape[i]["y1"] * s, shape[i]["x2"] * s, shape[i]["y2"] * s, shape[i]["x3"] * s, shape[i]["y3"] * s) ElseIf shape[i]["func"] = "line" Then shape[i]["obj"] = Shapes.AddLine(shape[i]["x1"] * s, shape[i]["y1"] * s, shape[i]["x2"] * s, shape[i]["y2"] * s) ElseIf shape[i]["func"] = "text" Then If silverlight Then fs = Math.Floor(shape[i]["fs"] * 0.9) Else fs = shape[i]["fs"] EndIf GraphicsWindow.FontSize = fs * s GraphicsWindow.FontName = shape[i]["fn"] shape[i]["obj"] = Shapes.AddText(shape[i]["text"]) EndIf x = shape[i]["x"] y = shape[i]["y"] shape[i]["rx"] = x shape[i]["ry"] = y If silverlight And Text.IsSubText("tri|line", shape[i]["func"]) Then alpha = Math.GetRadians(shape[i]["angle"]) SB_RotateWorkaround() shape[i]["wx"] = x shape[i]["wy"] = y EndIf Shapes.Move(shape[i]["obj"], shX + x * s, shY + y * s) If Text.IsSubText("rect|ell|tri|text", shape[i]["func"]) And shape[i]["angle"] <> 0 Then Shapes.Rotate(shape[i]["obj"], shape[i]["angle"]) EndIf EndFor shAngle = 0 y = Stack.PopValue("local") x = Stack.PopValue("local") i = Stack.PopValue("local") EndSub Sub Shapes_CalcRotatePos ' Shapes | Calculate position for rotated shape ' param["x"], param["y"] - position of a shape ' param["width"], param["height"] - size of a shape ' param ["cx"], param["cy"] - center of rotation ' param ["angle"] - rotate angle ' return x, y - rotated position of a shape _cx = param["x"] + param["width"] / 2 _cy = param["y"] + param["height"] / 2 x = _cx - param["cx"] y = _cy - param["cy"] Math_CartesianToPolar() a = a + param["angle"] x = r * Math.Cos(a * Math.Pi / 180) y = r * Math.Sin(a * Math.Pi / 180) _cx = x + param["cx"] _cy = y + param["cy"] x = _cx - param["width"] / 2 y = _cy - param["height"] / 2 EndSub Sub Shapes_CalcWidthAndHeight ' Shapes | Calculate total width and height of shapes ' param iMin, iMax - shape indices to add ' return shWidth, shHeight - total size of shapes For i = iMin To iMax If shape[i]["func"] = "tri" Or shape[i]["func"] = "line" Then xmin = shape[i]["x1"] xmax = shape[i]["x1"] ymin = shape[i]["y1"] ymax = shape[i]["y1"] If shape[i]["x2"] < xmin Then xmin = shape[i]["x2"] EndIf If xmax < shape[i]["x2"] Then xmax = shape[i]["x2"] EndIf If shape[i]["y2"] < ymin Then ymin = shape[i]["y2"] EndIf If ymax < shape[i]["y2"] Then ymax = shape[i]["y2"] EndIf If shape[i]["func"] = "tri" Then If shape[i]["x3"] < xmin Then xmin = shape[i]["x3"] EndIf If xmax < shape[i]["x3"] Then xmax = shape[i]["x3"] EndIf If shape[i]["y3"] < ymin Then ymin = shape[i]["y3"] EndIf If ymax < shape[i]["y3"] Then ymax = shape[i]["y3"] EndIf EndIf shape[i]["width"] = xmax - xmin shape[i]["height"] = ymax - ymin EndIf If i = 1 Then shWidth = shape[i]["x"] + shape[i]["width"] shHeight = shape[i]["y"] + shape[i]["height"] Else If shWidth < shape[i]["x"] + shape[i]["width"] Then shWidth = shape[i]["x"] + shape[i]["width"] EndIf If shHeight < shape[i]["y"] + shape[i]["height"] Then shHeight = shape[i]["y"] + shape[i]["height"] EndIf EndIf EndFor EndSub Sub Shapes_Move ' Shapes | Move shapes ' param iMin, iMax - shape indices to add ' param shape - array of shapes ' param scale - to zoom ' param x, y - position to move ' return shX, shY - new position of shapes Stack.PushValue("local", i) s = scale shX = x shY = y For i = iMin To iMax If silverlight And Text.IsSubText("tri|line", shape[i]["func"]) Then _x = shape[i]["wx"] _y = shape[i]["wy"] Else _x = shape[i]["rx"] _y = shape[i]["ry"] EndIf Shapes.Move(shape[i]["obj"], shX + _x * s, shY + _y * s) EndFor i = Stack.PopValue("local") EndSub Sub Shapes_Remove ' Shapes | Remove shapes ' param iMin, iMax - shapes indices to remove ' param shape - array of shapes Stack.PushValue("local", i) For i = iMin To iMax Shapes.Remove(shape[i]["obj"]) EndFor i = Stack.PopValue("local") EndSub Sub Shapes_Rotate ' Shapes | Rotate shapes ' param iMin, iMax - shapes indices to rotate ' param shape - array of shapes ' param scale - to zoom ' param angle - to rotate Stack.PushValue("local", i) Stack.PushValue("local", x) Stack.PushValue("local", y) s = scale param["angle"] = angle param["cx"] = shWidth / 2 param["cy"] = shHeight / 2 For i = iMin To iMax param["x"] = shape[i]["x"] param["y"] = shape[i]["y"] param["width"] = shape[i]["width"] param["height"] = shape[i]["height"] Shapes_CalcRotatePos() shape[i]["rx"] = x shape[i]["ry"] = y If silverlight And Text.IsSubText("tri|line", shape[i]["func"]) Then alpha = Math.GetRadians(angle + shape[i]["angle"]) SB_RotateWorkAround() shape[i]["wx"] = x shape[i]["wy"] = y EndIf Shapes.Move(shape[i]["obj"], shX + x * s, shY + y * s) Shapes.Rotate(shape[i]["obj"], angle + shape[i]["angle"]) EndFor y = Stack.PopValue("local") x = Stack.PopValue("local") i = Stack.PopValue("local") EndSub End>GDD325-1.sb< Start>GDH723.sb< GraphicsWindow.Height = 800 GraphicsWindow.Width = 1000 GraphicsWindow.BrushColor = "Red" While "True" Boom = Shapes.AddEllipse(20,20) Shapes.Move(Boom,100+ Math.GetRandomNumber(800),100+ Math.GetRandomNumber(600)) For j =1 To 50 Shapes.Zoom(Boom,j,j) Program.Delay(5) EndFor Program.Delay(500) GraphicsWindow.Clear() EndWhile End>GDH723.sb< Start>GDN455.sb< args=0 shX = 0 shY = 0 shl=360 tt[1]= "Flags sbd = "True" scale = 1 zz=2.5 ox=200 oy=420 GraphicsWindow.Width=Desktop.Width GraphicsWindow.Height=Desktop.Height GraphicsWindow.Left=0 GraphicsWindow.Top=0 GraphicsWindow.BackgroundColor="tan ' ' GraphicsWindow.Title=1 LDEvents.MouseWheel=mww GraphicsWindow.KeyDown=kkd euu=LDText.Split("1 40 54 36 66 69 45 47 57 49 61 63 48 43 41 42 50 51 52 53 56 58 59 60 72" " ") pns="es,Estonia|ag,Algeria|mw,Morocco/W.Sahara|ma,Mauritania|sg,Senegal|ml,Mali|bf,B.Faso|ng,Niger|ts,Tunisia|ly,Libya|eg,Egypt|cd,Chad|sd,Sudan|er,Eritrea|rs,Russia|kh,Kazakhstan|tm,Turmenistan|uz,Uzbekhistan|af,Afganistan|gg,Georgia|ar,Armenia|az,Azerbaijan|ir,Iran|tk,Turkey|ym,Yemen|om,Oman|ue,UAE|qa,Qatar|kw,Kuwait|sa,Saud.Arabia|sy,Syria|iq,Iraq|jo,Jordan|lb,Lebanon|il,Israel|ir,Ireland|nw,Norway|uk,UK|uk,UK/N.Irl|cy,Cyprus|sw,Sweden|fn,Finland|la,Latvia|rs,Russia (Kg)|lt,Lithuania|br,Belarus|pl,Poland|sp,Spain|po,Portugal|fr,France|nl,Holland|bl,Belgium|de,Germany|dm,Denmark|ch,Swiss|cz,Czech Rp.|sk,Slovakia|at,Austria|hu,Hungary|sl,Slovenia|hr,Croatia|bh,B&H|it,Italy|uc,Ucraine|md,Moldova|ro,Romania|sk,M.Negro|sr,Serbia/Kosovo|bu,Bulgaria|sk,Albania|sk,N.Macedonia|gr,Greece|tk,Turkey pn=LDText.Split(pns "|") For x=1 To 73 ss=LDText.Split(pn[x] ",") sttg["Polygon"+x]=ss[1] 'six[ss[1]]="Polygon"+x pnn[x]=ss[2] EndFor 'GraphicsWindow.MouseMove=mmw Sub mmw GraphicsWindow.Title=GraphicsWindow.MouseX+";"+GraphicsWindow.MouseY EndSub For x=0 To 360 Step 2 sx[x]=LDMath.Sin(x)*15 EndFor vst="true nln="false GraphicsWindow.PenWidth=4 fll["it"]="1=drffv3;2=green white red /itly fll["fr"]="1=drffv3;2=blue white red /fran fll["la"]="1=drff2;2=darkred white white /nv/latv fll["at"]="1=drff21;2=red white /aust fll["nw"]="1=drff2;2=red white /nway fll["sw"]="1=drff;2=#02529C gold /swed fll["fn"]="1=drff2;2=white #02529C #02529C /finl fll["pl"]="1=drffh;2=white red white /poln fll["uc"]="1=drffh;2=#02529C gold #02529C/u fll["nl"]="1=drff22;2=red white blue /holl fll["eg"]="1=drff22;2=red white black /egpt fll["hr"]="1=drff22;2=red white blue /croa fll["hu"]="1=drff22;2=red white green /hung fll["rs"]="1=drff22;2=white blue red /russ fll["sl"]="1=drff22;2=white blue red /slov fll["sk"]="1=drff22;2=white blue red /svak fll["sr"]="1=drff22;2=white blue red /serb fll["bl"]="1=drffv3;2=black gold red /belg fll["de"]="1=drff22;2=black red gold /germ fll["ar"]="1=drff22;2=red blue gold /armn fll["ch"]="1=sdrff;2=red white /swis fll["cz"]="1=drchk;2=white /czck fx=Array.GetAllIndices(fll) GraphicsWindow.BackgroundColor="cyan For xx=1 To -Array.GetItemCount(fx)-2 fff=fll[fx[xx]] f2=LDText.Split(fff[2] "/") LDCall.Function5(fff[1] 10,-50 f2[1] pnn[text.GetSubTextToEnd( lss 8)] f2[2]) Program.Delay(5) cp=LDGraphicsWindow.Capture("" "false") LDImage.MakeTransparent(cp "cyan") LDImage.Resize(cp 100 50) ssh[fx[xx]]=(cp) GraphicsWindow.Clear() EndFor GraphicsWindow.BackgroundColor="tan LDGraphicsWindow.Reposition(zz zz ox, oy 0) LDShapes.ShapeEvent=see GraphicsWindow.FontName="Times New Roman GraphicsWindow.FontSize=25 GraphicsWindow.FontBold="true GraphicsWindow.FontItalic="true GraphicsWindow.BrushColor="white ttt=Shapes.AddText("***") Shapes.Move(ttt 680 160) LDEffect.DropShadow(ttt "") htt=LDColours.GetHue("tan") stt=LDColours.GetSaturation("tan") ltt=LDColours.GetLightness("tan") GraphicsWindow.BrushColor="yellow 'mk=Shapes.AddRectangle(80 40) mk=Shapes.AddEllipse(10 5) LDShapes.ZIndex(mk 999) LDShapes.PenWidth(mk 0) LDEffect.DropShadow(mk "shadowdepth=3") Sub drchk LDCall.Function4("drffh" 950,-20 "white red white" "Czech Rp.") GraphicsWindow.BrushColor="#02529C GraphicsWindow.PenWidth=0 w5=2 s1=0 s2=0 GraphicsWindow.FillTriangle(nd[1]-w5+s1 nd[2]-w5+s2 nd[3]-w5+s1 nd[4]-w5+s2 nd[1]+150+s1 s2+nd[2]+88) GraphicsWindow.PenWidth=4 EndSub Sub see lss=LDShapes.LastEventShape GraphicsWindow.Title=Lss If LDShapes.LastEventType="MouseDown" Then lt=sttg[lss] fff=fll[lt] f2=LDText.Split(fff[2] "/") ldShapes.Centre(mk GraphicsWindow.MouseX GraphicsWindow.MouseY) LDShapes.BrushShape(mk LDShapes.BrushImage(ssh[lt])) LDCall.Function5(fff[1] 950,-20 f2[1] pnn[text.GetSubTextToEnd( lss 8)] f2[2]) EndIf EndSub Sub kkd lk=text.ConvertToLowerCase( GraphicsWindow.LastKey) If lk="left" Then ox=ox-20 ElseIf lk="right" Then ox=ox+20 ElseIf lk="up" Then oy=oy-20 ElseIf lk="down" Then oy=oy+20 EndIf LDGraphicsWindow.Reposition(zz zz ox, oy 0) GraphicsWindow.Title=ox+" : "+oy+" | "+zz EndSub Sub mww zz=zz+LDEvents.LastMouseWheelDelta/10 LDGraphicsWindow.Reposition(zz zz ox, oy 0) ' ' GraphicsWindow.Title=zz EndSub Shwrd() angle = 0 name = "All Sprite_Add() Sub Shwrd shX = 0 ' x offset shY = 0 ' y offset shape = "" shape[ 1] = "pt=517.77,143.66 512.17,143.46 508.62,145.63 508.57,147.24 510.87,149.41 518.02,150.62 517.77,143.66 517.77,143.66 517.77,143.66 shape[ 2] = "pt=473.88,227.49 469.8,226.12 452.82,229.31 449.12,232.12 451.38,243.79 444.63,244.06 440.57,250.59 430.9,252.91 430.93,257.66 462.78,282.01 468.21,282.47 486.32,268.32 484.51,266.04 481.11,265.58 479.07,262.16 479.07,248.01 477.71,246.64 477.94,242.99 474.32,239.34 473.87,235.46 475.45,234.32 474.77,230.21 473.88,227.49 473.88,227.49 473.88,227.49 shape[ 3] = "pt=448.29,232.28 436.74,232.28 434.48,237.3 429.27,239.81 424.97,251.45 416.59,256.47 404.82,275.86 416.37,275.63 416.82,269.93 419.76,269.93 419.76,262.17 429.95,262.17 430.18,252.13 439.92,249.85 444,243.23 450.34,243 448.29,232.28 448.29,232.28 448.29,232.28 shape[ 4] = "pt=404.9,276.66 407.08,279.51 406.63,291.83 409.8,289.55 412.06,289.09 415.23,290.23 418.85,295.25 422.25,292.97 438.78,292.74 434.7,265.13 439.08,265.11 430.92,258.86 430.93,262.92 420.6,262.93 420.55,270.68 417.58,270.67 417.2,276.39 404.9,276.66 404.9,276.66 404.9,276.66 shape[ 5] = "pt=410.12,290.32 406.18,293.18 405.28,294.78 405,296.38 406.45,297.42 411.29,297.35 414.4,296.51 414.75,298.04 414.47,300.06 417.44,301.52 418.06,302.22 422,302.36 422.14,300.62 418.54,296.3 414.53,290.87 412.04,289.83 410.12,290.32 410.12,290.32 410.12,290.32 shape[ 6] = "pt=419.46,295.84 422.54,293.73 439.66,293.63 435.7,266.09 440.22,265.96 462.09,282.65 465.03,283.07 463.92,292.35 450.17,293.6 439.56,301.52 437.63,306.94 430.26,307.25 428.38,301.84 422.73,302.24 422.95,300.47 419.46,295.84 419.46,295.84 419.46,295.84 shape[ 7] = "pt=450.59,294.28 454.23,293.99 460.2,302.43 454.66,306.61 450.65,305.58 445.26,305.65 444.39,308.81 439.87,309.03 438.63,307.34 440.23,302.2 450.59,294.28 450.59,294.28 450.59,294.28 shape[ 8] = "pt=460.89,302 463.44,301.94 465.74,298.49 469.6,297.8 473.71,300.31 482.48,300.56 489.26,297.8 491.81,295.61 492,292.73 496.73,287.96 497.98,277.43 494.87,270.91 486.91,268.97 468.49,283.33 465.88,283.08 464.76,293.05 455.36,293.99 460.89,302 460.89,302 460.89,302 shape[ 9] = "pt=474.91,227.33 480.44,225.1 482.26,226.28 482.33,227.72 481.48,228.83 481.61,230.8 482.46,231.26 482.46,234.8 481.48,236.44 481.61,237.49 485.32,238.8 482.33,243.45 481.16,243.38 480.96,247.12 479.66,247.32 478.55,246.34 478.81,242.54 475.17,239 474.71,235.92 476.47,234.54 474.91,227.33 474.91,227.33 474.91,227.33 shape[10] = "pt=480.05,248.03 481.61,247.77 482.07,244.17 482.85,244.17 486.04,238.93 493.91,241.22 496.06,244.56 503.8,248.1 507.83,246.4 507.44,244.7 505.68,243 505.88,241.82 508.74,239.4 514.4,239.4 516.55,242.28 521.1,242.94 521.69,279.83 518.31,279.7 497.89,269.08 495.68,270.33 487.29,268.23 485.01,265.22 481.69,264.76 480,261.75 480.05,248.03 480.05,248.03 480.05,248.03 shape[11] = "pt=521.93,243.06 524.6,243.13 529.8,244.57 532.27,244.64 535.33,242.08 536.76,242.08 539.36,243.52 542.65,243.52 543.24,243.48 545.32,249.46 545.91,251.39 546.46,254.28 545.48,255 543.79,254.15 541.84,247.79 540.08,247.66 539.95,249.82 541.12,253.56 550.49,265.16 550.69,270.14 547.96,273.29 522.32,273 521.93,243.06 521.93,243.06 521.93,243.06 shape[12] = "pt=492.79,296 492.92,293.05 497.66,288.44 498.93,277.12 495.77,271.08 497.98,269.95 519.38,281.1 519.25,292.04 515.48,295.25 515.48,300.89 517.95,305.67 513.59,305.67 506.37,312.81 506.18,314.97 500.85,314.9 500.78,315.88 497.74,315.48 495.66,311.55 494.1,310.78 494.3,309.58 496.26,308.08 496.26,301.06 493.55,300.64 490.28,298.21 492.79,296 492.79,296 492.79,296 492.79,296 shape[13] = "pt=552,270.61 548.31,274.33 522.51,274.1 522.79,280.67 520.33,280.6 520.15,292.43 516.42,295.64 516.27,300.58 518.96,305.89 521.91,307.63 521.87,308.04 525.88,305.99 528.95,308.44 534.59,308.76 537.85,306.03 540.73,307.41 543.98,302.66 544.26,301.08 546.73,300.61 547.12,305.08 549.6,309.24 555.6,296.33 555.6,288.48 559.96,283.34 552,270.61 552,270.61 shape[14] = "pt=556.71,294.7 556.46,288.81 560.42,284.19 561.49,285.01 563.44,291.53 572.8,298.5 571.1,300.59 564.25,294.7 556.71,294.7 556.71,294.7 556.71,294.7 shape[15] = "pt=634.98,46.83 625.97,53.69 618.43,64.07 618.43,68.37 626.47,71.66 622.45,74.7 613.91,71.66 610.39,74.7 605.11,68.62 604.1,70.9 609.88,89.13 611.39,89.64 615.41,87.61 617.42,89.13 617.42,92.42 613.65,90.9 611.39,92.67 612.9,95.96 611.64,104.57 603.85,105.33 603.35,102.54 607.87,99.75 608.88,92.15 603.85,85.57 602.09,74.18 594.05,72.91 593.3,76.96 594.81,78.99 591.54,81.78 592.8,89.38 597.57,91.41 598.58,96.98 593.8,93.94 581.49,91.66 579.98,95.71 570.18,99.25 568.67,96.72 555.85,103.81 555.6,108.62 550.57,109.38 552.08,105.84 552.08,102.3 547.05,100.53 543.78,101.8 546.54,107.12 548.55,110.66 548.55,113.45 544.78,112.69 544.03,111.93 540.26,115.98 542.27,119.52 533.73,119.27 536.49,122.82 535.74,124.34 531.22,124.34 527.95,122.06 527.2,115.73 521.92,113.7 521.92,111.17 532.98,113.45 539.01,113.96 541.52,110.16 539.26,106.11 523.18,99.78 517.63,101.16 515.73,102.79 516.32,106.54 518.68,106.95 518.13,112.85 525.41,129.95 520.15,138.29 519.79,140.17 522.46,142.05 520.05,143.64 518.45,143.67 518.75,151.02 520.96,154.15 520.99,157.19 523.82,157.45 528.15,159.1 532.73,165.4 532.78,167.06 531.29,169.61 534.71,169.42 538.04,170.38 542.54,176.75 553.62,177.76 553.14,185.34 549.32,188.61 550.11,189.89 546.34,193.94 545.34,197.74 547.6,201.03 554.89,203.56 557.91,201.79 577.26,209.13 578.01,207.1 573.99,203.3 573.99,198.49 571.48,197.73 571.98,193.68 576,188.87 568.79,183.47 569.29,175.96 577,170.89 586.05,171.4 587.56,174.19 596.86,174.7 603.65,170.9 600.13,167.1 600.88,160.01 618.47,151.4 632,157.5 634.98,154.83 634.98,46.83 634.98,46.83 shape[16] = "pt=576.69,188.62 580.79,186.87 585.37,186.71 585.69,193.71 583.01,193.71 580.96,197.05 583.64,201.5 587.59,203.73 587.95,206.28 589.4,205.8 590.74,204.21 592.95,204.69 594.06,206.92 596.9,206.92 596.9,204.06 595.16,198.97 594.37,194.84 599.42,192.61 606.21,193.72 610.47,198.01 620.1,197.06 625.47,204.69 631.78,205.01 633.52,202.15 635.73,201.67 636.05,198.49 639.36,198.33 641.1,200.4 642.84,196.27 657.83,198.34 660.35,195 656.09,189.75 661.77,177.35 666.35,177.67 669.51,170.04 663.2,169.4 659.57,165.9 649.57,167.06 636.69,154.61 632.15,158.64 618.38,152.39 601.49,160.66 601.02,166.54 604.97,171.15 597.27,175.5 587.28,175.28 585.19,172.21 577.36,171.78 569.94,176.55 569.78,183.07 576.69,188.62 576.69,188.62 576.69,188.62 shape[17] = "pt=593.85,207.59 593.23,210.22 589.08,210.22 589.08,213.78 593.54,216.72 592.16,220.75 592.16,222.61 594.01,222.92 596.47,219.67 602.01,218.43 613.85,222.92 614,226.17 620.61,226.79 627.99,219.04 627.07,216.56 622.15,215.48 608.31,206.49 607.69,203.24 602.46,203.24 600.15,207.58 597.84,207.58 593.85,207.59 593.85,207.59 593.85,207.59 shape[18] = "pt=628.92,219.06 632,219.22 632,213.95 629.08,212.25 634,206.05 636,206.05 638,208.38 643.23,206.37 636,203.89 635.72,202.39 634,202.81 632.31,205.75 625.02,205.51 619.67,197.94 610.27,198.87 605.79,194.43 599.59,193.38 595.09,195.21 597.7,203.89 597.73,206.81 599.63,206.85 601.96,202.41 608.16,202.49 609.08,205.9 622.37,214.72 627.51,215.9 628.92,219.06 628.92,219.06 628.92,219.06 shape[19] = "pt=614.12,227.05 615.71,239.51 619.67,240.38 620.04,242.62 617.2,244.99 622.49,249.26 632.77,245.56 633.59,241.18 640.06,237.14 642.54,227.78 644.39,225.79 642.47,222.45 648.73,218.58 647.93,217.46 645.04,217.64 644.78,220.3 640.9,220.26 640.83,216.71 639.58,215.22 637.48,217.13 637.54,218.88 634.37,220.08 628.52,219.71 620.92,227.67 614.12,227.05 614.12,227.05 614.12,227.05 shape[20] = "pt=555.46,204.16 558.73,208.43 562.81,210.31 565.32,210.3 569.63,209.13 570.71,207.44 557.96,202.67 555.46,204.16 555.46,204.16 555.46,204.16 shape[21] = "pt=569.72,209.89 574.52,216.15 573.11,217.8 569.71,217.21 565.49,213.43 565.72,210.95 569.72,209.89 569.72,209.89 569.72,209.89 shape[22] = "pt=571.41,207.72 570.4,209.44 575.11,215.62 576.75,215.09 579.45,217.92 580.62,212.96 583.55,213.43 583.43,212.01 578.61,207.79 577.69,210.27 571.41,207.72 571.41,207.72 571.41,207.72 shape[23] = "pt=569.65,217.95 568.43,219.22 568.55,221.23 570.07,223.36 575.46,229.26 574.64,231.62 573.7,231.62 573.23,233.98 576.28,237.88 579.09,238.12 584.72,245.91 587.88,246.15 590.34,247.92 590.46,251.46 600.19,257.13 603.82,257.13 606.05,255.24 608.86,255.12 610.5,258.9 621.01,260.36 621.32,256.5 624.8,255.24 624.96,253.86 622.19,250.08 616.02,245.12 619.26,242.17 619.03,240.87 614.97,240.24 613.25,226.54 613.05,223.39 602.04,219.18 597.16,220.28 594.43,223.63 592.01,223.47 591.31,224.06 585.92,223.71 579.12,218.75 576.59,215.98 575.43,216.26 573.34,218.65 569.65,217.95 569.65,217.95 569.65,217.95 shape[24] = "pt=558.7,209.19 556.47,211.55 548.27,211.31 543.35,208.36 538.55,208.24 533.04,212.14 527.88,212.38 527.41,215.33 521.55,215.33 519.21,217.46 519.21,218.64 520.62,219.82 520.62,221.12 520.03,222.66 520.62,223.96 522.5,223.02 524.38,225.03 523.91,226.45 523.21,227.4 524.26,228.58 529.42,229.64 533.05,228.1 533.05,225.86 534.81,226.21 539.03,228.69 543.6,227.98 545.59,226.09 546.88,226.56 546.88,228.69 548.64,228.69 550.16,225.74 563.52,224.32 569.35,223.61 567.81,221.59 567.78,218.86 568.95,217.46 564.69,214.04 564.92,211.09 562.58,211.09 558.7,209.19 558.7,209.19 558.7,209.19 shape[25] = "pt=571.99,289.23 573.43,293.51 573.43,297.69 576.89,300.83 601.27,290.9 601.5,288.17 597.59,281.15 587.78,284.28 582.15,289.82 575.62,285.96 571.99,289.23 571.99,289.23 571.99,289.23 shape[26] = "pt=598.38,280.84 605.77,276.58 607.08,270.33 605.46,269.4 606.13,262.7 607.54,261.88 609.05,264.25 618.04,268.95 618.04,271.56 607.15,287.59 602.14,287.76 598.38,280.84 598.38,280.84 598.38,280.84 shape[27] = "pt=594.01,264.94 594.88,268.42 604.74,269.29 605.43,262.15 607.33,261.11 607.85,258.5 604.74,259.37 601.28,264.6 594.01,264.94 594.01,264.94 594.01,264.94 shape[28] = "pt=592.63,259.02 592.11,263.03 593.65,264.2 595.05,264.07 595.57,259.02 594.36,258.15 592.63,259.02 592.63,259.02 592.63,259.02 shape[29] = "pt=583.29,247.17 581.04,245.95 579.48,247.52 579.65,250.66 583.28,252.05 583.29,247.17 583.29,247.17 583.29,247.17 shape[30] = "pt=584,253.24 591.01,263.01 593.27,264.81 594.28,269.19 605.07,270.04 606.29,270.68 605.08,276.08 597.99,280.26 587.62,283.4 582.09,288.8 575.52,284.97 571.54,288.45 566,279.4 562.2,277.66 560.82,275.57 560.82,271.04 546.99,254.32 546.47,251.36 550.45,251.36 555.29,247.18 555.46,245.09 554.08,243.7 556.85,241.44 562.73,241.79 572.76,250.15 578.68,249.88 579.06,251.34 584,253.24 584,253.24 584,253.24 shape[31] = "pt=546.67,229.13 546.32,231.67 549.14,232.85 549.02,239.89 551.84,239.83 554.66,237.7 555.72,237.52 562.12,232.43 563.41,225.04 550.62,226.34 549.27,229.3 546.67,229.13 546.67,229.13 546.67,229.13 shape[32] = "pt=564.31,225.03 562.75,232.74 556.29,238.12 556.7,240.66 563.01,241.09 573.06,249.27 578.68,249.11 578.83,247.22 580.89,245.01 583.77,246.64 584.15,246.28 578.58,238.87 575.94,238.71 572.43,234.2 573.13,230.88 574.2,230.74 574.57,229.27 569.79,224.24 564.31,225.03 564.31,225.03 564.31,225.03 shape[33] = "pt=548.9,240.78 546.44,249.36 546.33,250.67 550.2,250.67 554.53,246.85 554.64,245.4 552.87,243.59 556.04,240.96 555.58,238.52 554.71,238.72 552.07,240.61 548.9,240.78 548.9,240.78 548.9,240.78 shape[34] = "pt=546.2,232.44 546.26,234.39 545.44,237.35 548.26,237.59 548.44,233.39 546.2,232.44 546.2,232.44 546.2,232.44 shape[35] = "pt=545.32,238.06 543.74,243.09 545.79,249.12 548.14,240.31 548.14,238.42 545.32,238.06 545.32,238.06 545.32,238.06 shape[36] = "pt=543.21,229.84 544.44,230.73 540.63,234.34 538.81,234.28 537.46,233.33 537.64,231.56 540.4,231.38 543.21,229.84 543.21,229.84 543.21,229.84 shape[37] = "pt=515.46,102.14 517.48,100.66 517.3,99 516.02,98.26 516.2,96.23 517.3,96.23 517.3,95.12 512.53,93.83 505.38,94.57 504.65,97.71 503,97.16 501.9,95.31 498.41,95.49 498.04,99 496.39,99.74 495.47,97.89 488.13,103.8 489.6,105.46 486.85,106.75 480.61,119.13 478.41,120.61 478.59,121.72 480.79,122.83 480.24,125.23 476.57,125.04 475.47,123.75 473.09,126.52 471.62,127.63 471.25,130.22 469.97,130.96 466.67,131.7 465.02,136.88 466.12,145.38 467.4,149.26 468.87,150.74 472.17,150.56 476.94,145.94 478.77,142.8 479.32,147.42 482.44,141.88 482.62,126.35 485.16,124.75 485.92,116.18 493.62,105.09 497.29,103.8 498.94,101.77 504.44,103.06 507.19,104.72 508.11,100.1 512.7,97.33 515.46,102.14 515.46,102.14 515.46,102.14 shape[38] = "pt=446.12,149.08 444.29,151.85 445.02,152.96 449.24,152.96 449.24,154.81 448.14,156.29 448.87,160.17 451.25,164.79 453.08,169.04 456.01,170.15 457.29,172.37 457.11,174.4 455.28,175.51 455.1,176.43 456.38,177.17 455.28,178.65 452.71,179.76 447.76,179.21 440.05,182.72 437.48,181.43 444.82,177.18 443.9,176.63 440.05,176.26 442.43,172.75 442.8,169.79 445.92,169.42 445.37,163.69 441.7,163.51 440.6,162.22 440.78,157.97 438.58,158.15 440.78,150.76 444.82,147.8 446.12,149.08 446.12,149.08 446.12,149.08 shape[39] = "pt=438.42,161.47 435.12,161.84 434.94,164.8 437.14,166.28 439.52,165.73 440.44,164.07 438.42,161.47 438.42,161.47 438.42,161.47 shape[40] = "pt=439.51,166.55 438.6,172.55 430.53,175.51 427.96,175.51 426.13,174.22 426.13,173.11 430.17,170.52 429.07,168.3 429.25,165.16 432.74,165.34 434.34,161.58 434.13,164.92 436.84,167.07 439.51,166.55 439.51,166.55 439.51,166.55 shape[41] = "pt=497.72,104.58 499.68,106.39 503.35,106.39 505.37,110.27 505.92,116.92 500.97,120.43 500.97,123.94 497.48,128.75 495.46,128.93 492.71,133.55 492.89,137.99 497.66,141.5 497.29,143.53 495.46,146.3 492.71,148.7 492.89,156.65 488.67,158.13 487.2,161.27 485.18,161.27 484.08,155.73 479.49,148.69 483.26,142.38 483.52,126.79 486.12,125.36 486.75,116.44 494.16,105.83 497.72,104.58 497.72,104.58 497.72,104.58 shape[42] = "pt=506.79,116.94 508.86,117.85 510.14,120.25 508.86,121.91 502.44,128.93 501.34,132.63 502.81,137.99 507.76,141.69 514.36,138.55 519.68,137.81 524.63,129.86 520.96,121.17 517.47,112.85 518.02,107.49 515.82,107.12 515.25,103.21 512.29,98.38 509.01,100.65 507.72,105.92 504.24,103.83 499.4,102.65 498.32,103.91 500.18,105.59 503.57,105.53 506.3,109.94 506.79,116.94 506.79,116.94 506.79,116.94 shape[43] = "pt=518.07,151.37 511.22,150.26 511.37,154.09 517.72,157.97 520.32,157.21 520.17,154.29 518.07,151.37 518.07,151.37 518.07,151.37 shape[44] = "pt=506.61,151.72 505.11,151.57 502.41,154.8 502.41,156.31 503.31,156.66 505.06,156.71 507.96,154.34 508.36,153.53 506.61,151.72 506.61,151.72 506.61,151.72 shape[45] = "pt=510.81,154.7 508.66,154.65 505.71,157.47 503.21,157.47 503.36,161 501.86,163.77 507.26,163.82 508.81,163.62 510.36,165.49 513.91,165.34 517.31,161.01 517.11,158.44 510.81,154.7 510.81,154.7 510.81,154.7 shape[46] = "pt=510.66,166.29 512.16,168.76 511.56,170.73 511.66,172.29 512.21,174.16 515.31,172.4 519.16,172.5 521.86,173.61 528.71,173.61 530.71,168.82 531.91,167.01 531.91,165.8 527.61,159.75 523.81,158.24 520.71,157.89 518.01,158.75 518.11,161.47 514.36,166.21 510.66,166.29 510.66,166.29 510.66,166.29 shape[47] = "pt=511.46,174.76 512.31,176.32 512.51,177.98 511.81,179.59 510.21,182.67 508.86,183.28 507.11,182.52 506.06,182.57 503.51,183.53 500.61,182.67 495.91,179.34 491.31,176.87 489.46,174.05 489.11,167.4 492.71,164.27 497.41,162.71 499.16,162.51 498.46,163.92 498.91,164.47 506.82,164.62 508.52,164.57 511.32,168.86 510.62,170.62 510.92,172.69 511.46,174.76 511.46,174.76 511.46,174.76 shape[48] = "pt=448.36,205 435.62,205 433.05,203.84 431.81,203.93 430.31,207.05 430.84,210.26 435.71,210.71 436.33,212.76 434.21,224.71 434.3,226.85 437.75,228.72 441.73,228.99 449.69,227.03 453.58,222.13 453.67,217.14 460.57,210.9 460.92,208.14 454.64,208.05 448.36,205 448.36,205 448.36,205 shape[49] = "pt=430.93,211.24 430.31,219.89 428.54,221.49 428.72,222.47 429.96,224.52 429.16,227.02 430.49,227.47 433.59,227.11 433.41,224.61 435.44,213.02 435,211.42 430.93,211.24 430.93,211.24 430.93,211.24 shape[50] = "pt=460.4,178.7 458.19,179.24 453.77,184.05 452.44,184.14 450.67,182.89 449.52,183.16 448.64,185.92 442.18,186.1 442.36,187.53 446.78,190.47 451.91,194.57 451.82,199.47 449.08,204.28 455.01,207.13 461.03,207.31 462.89,205.17 466.69,205.26 467.75,206.24 471.55,205.97 473.5,203.47 471.02,200.53 470.84,198.66 471.37,196.61 470.13,194.83 468.01,195.45 467.74,193.85 472.43,188.68 472.43,185.56 469.33,183.78 467.74,183.51 460.4,178.7 460.4,178.7 460.4,178.7 shape[51] = "pt=470.09,168.27 465.56,170.5 466.52,171.37 466.62,173.6 465.66,173.41 464.6,171.76 462.07,175.77 465.96,176.58 467.41,178.11 468.18,178.13 468.69,174.67 471.14,173.64 470.09,168.27 470.09,168.27 470.09,168.27 shape[52] = "pt=461.61,176.52 460.97,178.12 467.85,182.66 469.83,183.13 469.9,180.98 468.17,179.04 467.11,179.04 465.66,177.39 461.61,176.52 461.61,176.52 461.61,176.52 shape[53] = "pt=471.14,167.88 474.71,167.3 474.71,164.78 477.7,164.29 479.34,165.94 481.07,166.13 483.77,164.96 486.18,165.64 488.3,167.48 488.59,174.37 490.71,177.19 487.92,177.58 483.29,180.49 483.68,181.46 487.82,185.34 487.53,187.28 483.68,189.22 480.11,189.32 479.24,191.16 477.41,191.16 476.54,189.22 473.36,188.44 473.26,185.24 470.56,183.4 470.85,181.07 469.02,178.55 469.5,175.25 472,174.08 471.14,167.88 471.14,167.88 471.14,167.88 shape[54] = "pt=476.77,151.5 472.62,156.09 472.47,159.08 474.36,164.01 477.32,163.45 476.95,159.42 478.99,157.14 478.95,155.35 477.51,151.62 476.77,151.5 476.77,151.5 476.77,151.5 shape[55] = "pt=472.91,189.38 468.55,194.02 468.64,194.49 470.43,193.93 472.04,196.17 474.76,195.21 476.64,196.67 477.41,196.23 479.73,192.59 479.14,192.03 476.85,191.97 475.74,189.7 472.91,189.38 472.91,189.38 472.91,189.38 shape[56] = "pt=488.43,184.87 491.4,184.87 492.86,184.87 495.23,186.56 499.62,182.91 495.36,179.87 491.14,177.83 488.25,178.35 484.33,180.87 488.43,184.87 488.43,184.87 488.43,184.87 shape[57] = "pt=495.84,187.13 496.53,187.74 496.62,188.78 504.25,188.61 509.89,186.18 509.8,183.71 508.72,184.19 507.17,183.36 506.22,183.32 503.72,184.32 500.32,183.5 495.84,187.13 495.84,187.13 495.84,187.13 shape[58] = "pt=480.63,190.12 479.98,191.47 480.54,192.43 482.87,191.95 484.85,191.95 487,193.77 491.57,192.94 494.93,190.94 495.79,189.59 495.66,187.85 492.64,185.59 488.59,185.63 488.25,187.93 483.99,190.01 480.63,190.12 480.63,190.12 480.63,190.12 shape[59] = "pt=496.74,189.6 495.58,191.42 495.67,194.2 497.52,195.15 503.21,195.32 511.14,188.64 511.18,187.16 510.32,186.73 504.59,189.33 496.74,189.6 496.74,189.6 496.74,189.6 shape[60] = "pt=494.8,191.99 492.26,193.51 487.52,194.55 488.47,197.29 491.79,197.33 494.85,194.77 494.8,191.99 494.8,191.99 494.8,191.99 shape[61] = "pt=495.62,195.16 492.09,198.07 488.51,198.07 488.08,200.59 489.72,201.02 490.54,199.8 491.83,200.93 492.86,204.53 499.93,207.83 500.63,207.03 493.46,199.63 494.19,198.28 501,198.02 501.69,195.85 497.25,195.98 495.62,195.16 495.62,195.16 495.62,195.16 shape[62] = "pt=494.8,198.94 494.43,199.55 501.14,206.47 503.6,202.85 503.51,201.42 501.36,198.81 494.8,198.94 494.8,198.94 494.8,198.94 shape[63] = "pt=472.27,196.98 471.65,198.55 471.82,200.26 474.21,203.05 477.97,202.92 486.27,212.56 491.45,214.06 494.51,216.95 495.24,223.54 496.88,222.58 498.3,218.99 497.95,216.41 500.38,216.19 500.73,214.73 493.88,211.45 487.38,205.06 484.79,201.24 484.16,197.61 487.47,196.82 486.62,194.43 484.59,192.72 482.84,192.64 480.4,193.31 478.1,196.53 476.71,197.45 474.56,196.13 472.27,196.98 472.27,196.98 472.27,196.98 shape[64] = "pt=515.57,173.15 512.67,174.78 513.39,177.86 510.71,183.51 510.73,186 511.99,186.8 520.07,187.2 522.33,185.33 524.75,186.14 528.22,190.77 525.68,195.33 528.7,196.21 532.65,191.66 534.91,192.07 537.01,193.53 535.16,195.97 537.66,199.87 540.32,199.87 541.69,197.27 544.51,196.7 544.59,194.59 539.35,193.78 539.51,191.51 544.59,191.51 550.07,187.12 552.49,185.01 552.89,178.35 542.09,177.38 537.66,171.13 534.6,170.08 530.89,170.24 529.22,174.37 521.62,174.47 519.15,173.33 515.57,173.15 515.57,173.15 515.57,173.15 shape[65] = "pt=520.75,187.71 523.85,192.48 523.59,195.18 524.7,195.23 527.33,190.78 524.17,186.86 522.38,186.12 520.75,187.71 520.75,187.71 520.75,187.71 shape[66] = "pt=512.18,187.6 511.92,189.08 506.13,193.9 510.97,201 514.07,203.17 519.65,203.17 521.49,201.63 523.96,201.31 525.8,202.42 529.06,198.71 528.43,196.85 525.12,196 522.86,195.89 522.97,192.71 519.97,187.99 512.18,187.6 512.18,187.6 512.18,187.6 shape[67] = "pt=504.9,207.25 504.86,206.31 503.54,204.46 501.4,207.48 501.82,208.75 503.56,209.07 504.9,207.25 504.9,207.25 shape[68] = "pt=505.55,194.54 503.5,196.08 502.5,196.08 501.82,198.2 504.24,201.01 504.4,203.24 504.06,203.72 505.7,206.02 505.75,207.24 506.93,208.38 510.77,207.21 510.45,201.75 505.55,194.54 505.55,194.54 shape[69] = "pt=511.44,202.39 511.6,207.37 513.28,210.87 519.59,210.98 522.43,208.97 525.22,207.86 524.54,204.68 525.17,202.98 523.75,202.24 521.8,202.4 520.27,203.94 513.85,203.99 511.44,202.39 511.44,202.39 511.44,202.39 shape[70] = "pt=504.02,209.76 504.02,214.37 505.34,216.86 506.29,216.75 507.92,213.78 506.97,212.45 506.6,209.16 505.34,207.99 504.02,209.76 504.02,209.76 504.02,209.76 shape[71] = "pt=510.92,208.01 507.55,209.12 507.71,211.98 508.5,212.99 512.5,211.13 510.92,208.01 510.92,208.01 510.92,208.01 shape[72] = "pt=506.71,217.6 506.6,218.93 511.23,221.26 513.44,222.11 512.28,223.33 509.7,223.59 509.33,224.76 510.22,226.77 513.11,228.31 514.37,228.42 514.53,224.97 516.42,222.69 511.26,216.59 511.94,214.52 513.15,214.47 514.99,215.95 516.15,215.37 516.52,213.3 521.94,213.35 522.15,210.17 519.89,211.76 513.26,211.6 508.95,213.83 506.71,217.6 506.71,217.6 506.71,217.6 shape[73] = "pt=523.02,209.7 522.86,213.25 525.96,212.3 527.38,211.35 526.96,209.81 525.49,208.64 523.02,209.7 523.02,209.7 523.02,209.7 EndSub Sub Sprite_Add ' GraphicsWindow.Title=Array.GetItemCount(shape) nSprite = nSprite + 1 s = scale bbb=LDShapes.BrushGradient("1=red;2=darkred" "DD") bb1=LDShapes.BrushGradient("1=blue;2=darkblue" "DD") For i = 1 To Array.GetItemCount(shape) shp = shape[i] 'TextWindow.WriteLine(shp) GraphicsWindow.BrushColor="darkred GraphicsWindow.PenWidth=0 pts = LDText.Split(shp["pt"], " ") nPts = Array.GetItemCount(pts) Sprite_ScalePoints() shp["obj"] = LDShapes.AddPolygon(points) LDShapes.SetShapeEvent(shp["obj"]) If Array.ContainsValue(euu i) Then LDShapes.BrushShape(shp["obj"] bb1) Else LDShapes.BrushShape(shp["obj"] bbb) EndIf LDDialogs.ToolTip(shp["obj"] pnn[i]) x = shp["x"] y = shp["y"] shp["rx"] = x shp["ry"] = y If sbd And (shp["func"] = "line") Then shp["wx"] = x shp["wy"] = y EndIf Shapes.Move(shp["obj"], shX + x * s, shY + y * s) ' ' GraphicsWindow.Title=i 'Program.Delay(955) shape[i] = shp EndFor GraphicsWindow.PenWidth=4 EndSub Sub Sprite_ScalePoints points = "" For iPts = 1 To nPts _pt = LDText.Split(pts[iPts], ",") points[iPts]="1="+ Math.Round(_pt[1] * s * 100) / 100+";2="+Math.Round(_pt[2] * s * 100) / 100 EndFor EndSub Sub shdrw fc=fc+1 f15=2 For x=0 To shl Step 2 s=sx[x] ccc=LDColours.HSLtoRGB(htt stt 0.02+x/900) GraphicsWindow.PenColor=ccc GraphicsWindow.DrawLine(ox+x*1.4+55+10 oy+100-s+20 ox+x*1.4+5+10 20+oy+300-s) EndFor Shapes.SetText(ttt text.ConvertToUpperCase(Text.GetSubText (args[1] 1 1))+Text.GetSubTextToEnd(args[1] 2)) 'Program.Delay(7) EndSub Sub drff ox=args[1] oy=args[2] cc=LDText.Split(args[3] " ") GraphicsWindow.PenColor="#333355 ldcall.function("shdrw" args[4]) GraphicsWindow.PenColor=cc[1] For x=0 To 360 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+55 oy+100-s ox+x*1.4+5 oy+300-s) EndFor GraphicsWindow.PenColor=cc[2] For x=0 To 360 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+35 oy+185-s ox+x*1.4+27 oy+215-s) EndFor For x=90 To 110 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+55 oy+100-s ox+x*1.4+5 oy+300-s) EndFor EndSub Sub sdrff GraphicsWindow.BrushColor="tan GraphicsWindow.FillRectangle(1000 20 600 300) ox=args[1] oy=args[2] cc=LDText.Split(args[3] " ") GraphicsWindow.PenColor="#333355 shl=240 ldcall.function("shdrw" args[4]) GraphicsWindow.PenColor=cc[1] For x=0 To 240 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+55 oy+100-s ox+x*1.4+5 oy+300-s) EndFor GraphicsWindow.PenColor=cc[2] For x=50 To 190 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+35 oy+185-s ox+x*1.4+27 oy+215-s) EndFor For x=110 To 130 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+45 oy+130-s ox+x*1.4+10 oy+270-s) EndFor EndSub Sub shrff ox=args[1] oy=args[2] cc=LDText.Split(args[3] " ") GraphicsWindow.PenColor="#333355 shl=240 ldcall.function("shdrw" args[4]) shl=360 GraphicsWindow.PenColor=cc[1] For x=0 To 120 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+55 oy+100-s ox+x*1.4+5 oy+300-s) EndFor GraphicsWindow.PenColor=cc[2] For x=120 To 240 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+55 oy+100-s ox+x*1.4+5 oy+300-s) EndFor EndSub Sub drffv3 ox=args[1] oy=args[2] cc=LDText.Split(args[3] " ") nd[1]=ox+55 nd[2]=oy+100 ldcall.function("shdrw" args[4]) For m=0 To 2 GraphicsWindow.PenColor=cc[m+1] For x=m*120 To (m+1)*120 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+55 oy+100-s ox+x*1.4+5 oy+300-s) EndFor EndFor EndSub Sub drff4 ox=args[1] oy=args[2] cc=LDText.Split(args[3] " ") ldcall.function("shdrw" args[4]) GraphicsWindow.PenColor=cc[1] For x=0 To 360 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+55 oy+100-s ox+x*1.4+5 oy+300-s) EndFor nd[1]=ox+55 nd[2]=oy+100 nd[3]=ox+5 nd[4]=oy+300 GraphicsWindow.PenColor=cc[2] For x=0 To 360 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+45 oy+140-s ox+x*1.4+35 oy+180-s) GraphicsWindow.DrawLine(ox+x*1.4+25 oy+220-s ox+x*1.4+15 oy+260-s) EndFor EndSub Sub drffh ox=args[1] oy=args[2] cc=LDText.Split(args[3] " ") GraphicsWindow.PenWidth=4 ldcall.function("shdrw" args[4]) For x=0 To 360 Step 2 GraphicsWindow.PenColor=cc[1] s=sx[x] If vst and x<110 Then GraphicsWindow.PenColor=cc[3] Else GraphicsWindow.PenColor=cc[1] EndIf GraphicsWindow.DrawLine(ox+x*1.4+55 oy+100-s ox+x*1.4+5 oy+300-s) EndFor nd[1]=ox+55 nd[2]=oy+100 nd[3]=ox+5 nd[4]=oy+300 GraphicsWindow.PenColor=cc[2] For x=0 To 360 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+25+5 oy+200-s ox+x*1.4+5 oy+300-s) EndFor EndSub Sub drffh1 ox=args[1] oy=args[2] cc=LDText.Split(args[3] " ") GraphicsWindow.PenWidth=4 ldcall.function("shdrw" args[4]) For x=0 To 360 Step 2 s=sx[x] GraphicsWindow.PenColor=cc[1] GraphicsWindow.DrawLine(ox+x*1.4+55 oy+100-s ox+x*1.4+5 oy+300-s) EndFor nd[1]=ox+55 nd[2]=oy+100 nd[3]=ox+5 nd[4]=oy+300 GraphicsWindow.PenColor=cc[2] For x=0 To 360 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+25+5 oy+200-s ox+x*1.4+5 oy+300-s) EndFor For x=0 To 110 Step 2 s=sx[x] GraphicsWindow.PenColor=cc[3] GraphicsWindow.DrawLine(ox+x*1.4+55 oy+100-s ox+x*1.4+5 oy+300-s) EndFor EndSub Sub drff2 ox=args[1] oy=args[2] a5=args[5] cc=LDText.Split(args[3] " ") ldcall.function("shdrw" args[4]) GraphicsWindow.PenColor=cc[1] For x=0 To 360 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+55 oy+100-s ox+x*1.4+5 oy+300-s) EndFor GraphicsWindow.PenColor=cc[2] If nln or a5="nv" Then Else For x=0 To 360 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+35 oy+180-s ox+x*1.4+24 oy+220-s) EndFor For x=85 To 115 Step 2 s=LDMath.Sin(x)*15 GraphicsWindow.DrawLine(ox+x*1.4+55 oy+100-s ox+x*1.4+5 oy+300-s) EndFor GraphicsWindow.PenColor=cc[3] For x=90 To 110 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+55 oy+100-s ox+x*1.4+5 oy+300-s) EndFor EndIf For x=0 To 360 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+35 oy+185-s ox+x*1.4+27 oy+215-s) EndFor EndSub Sub drff23 ox=args[1] oy=args[2] cc=LDText.Split(args[3] " ") ldcall.function("shdrw" args[4]) GraphicsWindow.PenColor=cc[1] For x=0 To 360 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+55 oy+100-s ox+x*1.4+5 oy+300-s) EndFor GraphicsWindow.PenColor=cc[2] For x=0 To 360 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+35 oy+180-s ox+x*1.4+24 oy+220-s) EndFor GraphicsWindow.PenColor=cc[3] For x=0 To 360 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+35 oy+185-s ox+x*1.4+27 oy+215-s) EndFor LDGraphicsWindow.FloodFill(ox+15 oy+290 cc[4]) EndSub Sub drff21 ox=args[1] oy=args[2] cc=LDText.Split(args[3] " ") ldcall.function("shdrw" args[4]) GraphicsWindow.PenColor=cc[1] For x=0 To 360 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+55 oy+100-s ox+x*1.4+5 oy+300-s) EndFor GraphicsWindow.PenColor=cc[2] For x=0 To 360 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+38 oy+168-s ox+x*1.4+22 oy+227-s) EndFor EndSub Sub drff22 'TextWindow.WriteLine(args) ox=args[1] oy=args[2] nd[1]=ox+55 nd[2]=oy+100 nd[3]=ox+5 nd[4]=oy+300 cc=LDText.Split(args[3] " ") ldcall.function("shdrw" args[4]) GraphicsWindow.PenColor=cc[1] For x=0 To 360 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+55 oy+100-s ox+x*1.4+5 oy+300-s) EndFor GraphicsWindow.PenColor=cc[2] For x=0 To 360 Step 2 s=sx[x] GraphicsWindow.DrawLine(ox+x*1.4+38 oy+168-s ox+x*1.4+22 oy+227-s) EndFor LDGraphicsWindow.FloodFill(ox+15 oy+290 cc[3]) EndSub End>GDN455.sb< Start>GDR304.sb< num1 = Math.GetRandomNumber(9) num2 = Math.GetRandomNumber(9) TextWindow.WriteLine(num1) TextWindow.WriteLine(num2) TextWindow.Write("What do you think the multiplied answer is? ") e = TextWindow.Read() If (e = num1 * num2) Then TextWindow.WriteLine("The answer is correct!") Else TextWindow.WriteLine("The answer is wrong.The correct answer is " + num1 * num2 + " .") EndIf TextWindow.Pause() TextWindow.Clear() num3 = Math.GetRandomNumber(9) num4 = Math.GetRandomNumber(9) TextWindow.WriteLine(num3) TextWindow.WriteLine(num4) TextWindow.Write("What do you think the multiplied answer is? ") f = TextWindow.Read() If (f = num3 * num4) Then TextWindow.WriteLine("The answer is correct!") Else TextWindow.WriteLine("The answer is wrong.The correct answer is " + num3 * num4 + " .") EndIf TextWindow.Pause() TextWindow.Clear() num5 = Math.GetRandomNumber(9) num6 = Math.GetRandomNumber(9) TextWindow.WriteLine(num5) TextWindow.WriteLine(num6) TextWindow.Write("What do you think the multiplied answer is? ") g = TextWindow.Read() If (g = num5 * num6) Then TextWindow.WriteLine("The answer is correct!") Else TextWindow.WriteLine("The answer is wrong.The correct answer is " + num5* num6 + " .") EndIf TextWindow.Pause() TextWindow.Clear() num7 = Math.GetRandomNumber(9) num8 = Math.GetRandomNumber(9) TextWindow.WriteLine(num7) TextWindow.WriteLine(num8) TextWindow.Write("What do you think the multiplied answer is? ") h = TextWindow.Read() If (h = num7 * num8) Then TextWindow.WriteLine("The answer is correct!") Else TextWindow.WriteLine("The answer is wrong.The correct answer is " + num7 * num8 + " .") EndIf TextWindow.Pause() TextWindow.Clear() num9 = Math.GetRandomNumber(9) num0 = Math.GetRandomNumber(9) TextWindow.WriteLine(num9) TextWindow.WriteLine(num0) TextWindow.Write("What do you think the multiplied answer is? ") i = TextWindow.Read() If (i = num9 * num0) Then TextWindow.WriteLine("The answer is correct!") Else TextWindow.WriteLine("The answer is wrong.The correct answer is " + num9 * num0 + " .") EndIf TextWindow.Pause() TextWindow.Clear() num1 = Math.GetRandomNumber(9) num2 = Math.GetRandomNumber(9) TextWindow.WriteLine(num1) TextWindow.WriteLine(num2) TextWindow.Write("What do you think the multiplied answer is? ") e = TextWindow.Read() If (e = num1 * num2) Then TextWindow.WriteLine("The answer is correct!") Else TextWindow.WriteLine("The answer is wrong.The correct answer is " + num1 * num2 + " .") EndIf TextWindow.Pause() TextWindow.Clear() num3 = Math.GetRandomNumber(9) num4 = Math.GetRandomNumber(9) TextWindow.WriteLine(num3) TextWindow.WriteLine(num4) TextWindow.Write("What do you think the multiplied answer is? ") f = TextWindow.Read() If (f = num3 * num4) Then TextWindow.WriteLine("The answer is correct!") Else TextWindow.WriteLine("The answer is wrong.The correct answer is " + num3 * num4 + " .") EndIf TextWindow.Pause() TextWindow.Clear() num5 = Math.GetRandomNumber(9) num6 = Math.GetRandomNumber(9) TextWindow.WriteLine(num5) TextWindow.WriteLine(num6) TextWindow.Write("What do you think the multiplied answer is? ") g = TextWindow.Read() If (g = num5 * num6) Then TextWindow.WriteLine("The answer is correct!") Else TextWindow.WriteLine("The answer is wrong.The correct answer is " + num5* num6 + " .") EndIf TextWindow.Pause() TextWindow.Clear() num7 = Math.GetRandomNumber(9) num8 = Math.GetRandomNumber(9) TextWindow.WriteLine(num7) TextWindow.WriteLine(num8) TextWindow.Write("What do you think the multiplied answer is? ") h = TextWindow.Read() If (h = num7 * num8) Then TextWindow.WriteLine("The answer is correct!") Else TextWindow.WriteLine("The answer is wrong.The correct answer is " + num7 * num8 + " .") EndIf TextWindow.Pause() TextWindow.Clear() num9 = Math.GetRandomNumber(9) num0 = Math.GetRandomNumber(9) TextWindow.WriteLine(num9) TextWindow.WriteLine(num0) TextWindow.Write("What do you think the multiplied answer is? ") i = TextWindow.Read() If (i = num9 * num0) Then TextWindow.WriteLine("The answer is correct!") Else TextWindow.WriteLine("The answer is wrong.The correct answer is " + num9 * num0 + " .") EndIf TextWindow.Pause() TextWindow.Clear() num1 = Math.GetRandomNumber(9) num2 = Math.GetRandomNumber(9) TextWindow.WriteLine(num1) TextWindow.WriteLine(num2) TextWindow.Write("What do you think the multiplied answer is? ") e = TextWindow.Read() If (e = num1 * num2) Then TextWindow.WriteLine("The answer is correct!") Else TextWindow.WriteLine("The answer is wrong.The correct answer is " + num1 * num2 + " .") EndIf TextWindow.Pause() TextWindow.Clear() num3 = Math.GetRandomNumber(9) num4 = Math.GetRandomNumber(9) TextWindow.WriteLine(num3) TextWindow.WriteLine(num4) TextWindow.Write("What do you think the multiplied answer is? ") f = TextWindow.Read() If (f = num3 * num4) Then TextWindow.WriteLine("The answer is correct!") Else TextWindow.WriteLine("The answer is wrong.The correct answer is " + num3 * num4 + " .") EndIf TextWindow.Pause() TextWindow.Clear() num5 = Math.GetRandomNumber(9) num6 = Math.GetRandomNumber(9) TextWindow.WriteLine(num5) TextWindow.WriteLine(num6) TextWindow.Write("What do you think the multiplied answer is? ") g = TextWindow.Read() If (g = num5 * num6) Then TextWindow.WriteLine("The answer is correct!") Else TextWindow.WriteLine("The answer is wrong.The correct answer is " + num5* num6 + " .") EndIf TextWindow.Pause() TextWindow.Clear() num7 = Math.GetRandomNumber(9) num8 = Math.GetRandomNumber(9) TextWindow.WriteLine(num7) TextWindow.WriteLine(num8) TextWindow.Write("What do you think the multiplied answer is? ") h = TextWindow.Read() If (h = num7 * num8) Then TextWindow.WriteLine("The answer is correct!") Else TextWindow.WriteLine("The answer is wrong.The correct answer is " + num7 * num8 + " .") EndIf TextWindow.Pause() TextWindow.Clear() num9 = Math.GetRandomNumber(9) num0 = Math.GetRandomNumber(9) TextWindow.WriteLine(num9) TextWindow.WriteLine(num0) TextWindow.Write("What do you think the multiplied answer is? ") i = TextWindow.Read() If (i = num9 * num0) Then TextWindow.WriteLine("The answer is correct!") Else TextWindow.WriteLine("The answer is wrong.The correct answer is " + num9 * num0 + " .") EndIf TextWindow.Pause() TextWindow.Clear() num1 = Math.GetRandomNumber(9) num2 = Math.GetRandomNumber(9) TextWindow.WriteLine(num1) TextWindow.WriteLine(num2) TextWindow.Write("What do you think the multiplied answer is? ") e = TextWindow.Read() If (e = num1 * num2) Then TextWindow.WriteLine("The answer is correct!") Else TextWindow.WriteLine("The answer is wrong.The correct answer is " + num1 * num2 + " .") EndIf TextWindow.Pause() TextWindow.Clear() num3 = Math.GetRandomNumber(9) num4 = Math.GetRandomNumber(9) TextWindow.WriteLine(num3) TextWindow.WriteLine(num4) TextWindow.Write("What do you think the multiplied answer is? ") f = TextWindow.Read() If (f = num3 * num4) Then TextWindow.WriteLine("The answer is correct!") Else TextWindow.WriteLine("The answer is wrong.The correct answer is " + num3 * num4 + " .") EndIf TextWindow.Pause() TextWindow.Clear() num5 = Math.GetRandomNumber(9) num6 = Math.GetRandomNumber(9) TextWindow.WriteLine(num5) TextWindow.WriteLine(num6) TextWindow.Write("What do you think the multiplied answer is? ") g = TextWindow.Read() If (g = num5 * num6) Then TextWindow.WriteLine("The answer is correct!") Else TextWindow.WriteLine("The answer is wrong.The correct answer is " + num5* num6 + " .") EndIf TextWindow.Pause() TextWindow.Clear() num7 = Math.GetRandomNumber(9) num8 = Math.GetRandomNumber(9) TextWindow.WriteLine(num7) TextWindow.WriteLine(num8) TextWindow.Write("What do you think the multiplied answer is? ") h = TextWindow.Read() If (h = num7 * num8) Then TextWindow.WriteLine("The answer is correct!") Else TextWindow.WriteLine("The answer is wrong.The correct answer is " + num7 * num8 + " .") EndIf TextWindow.Pause() TextWindow.Clear() num9 = Math.GetRandomNumber(9) num0 = Math.GetRandomNumber(9) TextWindow.WriteLine(num9) TextWindow.WriteLine(num0) TextWindow.Write("What do you think the multiplied answer is? ") i = TextWindow.Read() If (i = num9 * num0) Then TextWindow.WriteLine("The answer is correct!") Else TextWindow.WriteLine("The answer is wrong.The correct answer is " + num9 * num0 + " .") EndIf correct = 0 Program.Delay(1000) TextWindow.WriteLine("You made it. You got " + correct +" correct answers out of 100") TextWindow.Pause() Program.End() For i = 0 To 99 num1 = Math.GetRandomNumber(9) num2 = Math.GetRandomNumber(9) TextWindow.WriteLine(num1) TextWindow.WriteLine(num2) TextWindow.Write("What do you think the product is? ") e = TextWindow.Read() If (e = num1 * num2) Then TextWindow.WriteLine("The answer is correct!") correct = correct +1 Else TextWindow.WriteLine("The answer is wrong.The correct answer is " + num1 * num2 + " .") EndIf TextWindow.Pause() TextWindow.Clear() EndFor Sound.PlayBellRing() TextWindow.WriteLine("You made it. You got " + correct +" correct answers out of 100") End>GDR304.sb< Start>GDR971-0.sb< 'Move Your Mouse , After Adding a control, To Place it,Right Click or Left Click at any place. 'Challenge Of The Month - October 2017 'History 'GDR971 - Created 'GDR971-0 = Bugs Fixed (TextBox Can Be Removed) 'Code = GDR971-0 button1 = Controls.AddButton("Add Button",10,10) button2 = Controls.AddButton("Add TextBox",10,50) button3 = Controls.AddButton("Add MLTB",10,90) clear = Controls.AddButton("Clear",10,140) Controls.ButtonClicked = OnButtonClick Controls.TextTyped = OnTT Sub OnTT 'TextWindow.WriteLine(Controls.LastTypedTextBox) Sound.PlayBellRing() GraphicsWindow.ShowMessage("Typed In Textbox","Event") EndSub sub OnButtonClick LCB = Controls.LastClickedButton 'TextWindow.WriteLine(LCB) If button1 = LCB Then addButton = Controls.AddButton(addButton,0,0) GraphicsWindow.MouseMove = Mouseforbutton GraphicsWindow.MouseDown = Mouseforbuttondown active = "true" ElseIf button2 = LCB then addtb = Controls.AddTextBox(0,0) GraphicsWindow.MouseMove = Mousefortb GraphicsWindow.MouseDown = Mousefortbdown active = "true" Elseif button3 = LCB then addmltb = Controls.AddMultiLineTextBox(00,00) GraphicsWindow.MouseMove = Mouseformltb GraphicsWindow.MouseDown = Mouseformltbdown active = "true" Elseif clear = LCB Then active = "" Controls.HideControl(addmltb) Controls.HideControl(addtb) For i = 5 To 10000 Controls.HideControl("Button"+i) EndFor For t = 1 To 10000 Controls.HideControl("Textbox"+t) Controls.HideControl("TextBox"+t) EndFor else Sound.PlayBellRing() GraphicsWindow.ShowMessage("Click","Event") EndIf EndSub Sub Mouseforbutton If active = "true" Then Shapes.Move(addButton,GraphicsWindow.MouseX-50,GraphicsWindow.MouseY-50) EndIf EndSub Sub Mouseforbuttondown active = "" EndSub Sub Mouseformltb If active = "true" Then Shapes.Move(addmltb,GraphicsWindow.MouseX-100,GraphicsWindow.MouseY-100) EndIf EndSub Sub Mouseformltbdown active = "" EndSub Sub Mousefortb If active = "true" Then Shapes.Move(addtb,GraphicsWindow.MouseX-50,GraphicsWindow.MouseY-50) EndIf EndSub Sub Mousefortbdown active = "" EndSub End>GDR971-0.sb< Start>GDR971.sb< 'Move Your Mouse , After Adding a control, To Place it,Right Click or Left Click at any place. 'Challenge Of The Month - October 2017 button1 = Controls.AddButton("Add Button",10,10) button2 = Controls.AddButton("Add TextBox",10,50) button3 = Controls.AddButton("Add MLTB",10,90) clear = Controls.AddButton("Clear",10,140) Controls.ButtonClicked = OnButtonClick Controls.TextTyped = OnTT Sub OnTT Sound.PlayBellRing() GraphicsWindow.ShowMessage("Typed In Textbox","Event") EndSub sub OnButtonClick LCB = Controls.LastClickedButton If button1 = LCB Then addButton = Controls.AddButton(addButton,0,0) GraphicsWindow.MouseMove = Mouseforbutton GraphicsWindow.MouseDown = Mouseforbuttondown active = "true" ElseIf button2 = LCB then addtb = Controls.AddTextBox(0,0) GraphicsWindow.MouseMove = Mousefortb GraphicsWindow.MouseDown = Mousefortbdown active = "true" Elseif button3 = LCB then addmltb = Controls.AddMultiLineTextBox(00,00) GraphicsWindow.MouseMove = Mouseformltb GraphicsWindow.MouseDown = Mouseformltbdown active = "true" Elseif clear = LCB Then active = "" Controls.HideControl(addmltb) Controls.HideControl(addtb) For i = 5 To 10000 Controls.HideControl("Button"+i) EndFor For t = 1 To 10000 Controls.HideControl("Textbox"+t) Controls.HideControl("MultiLineTextbox"+t) EndFor else Sound.PlayBellRing() GraphicsWindow.ShowMessage("Click","Event") EndIf EndSub Sub Mouseforbutton If active = "true" Then Shapes.Move(addButton,GraphicsWindow.MouseX-50,GraphicsWindow.MouseY-50) EndIf EndSub Sub Mouseforbuttondown active = "" EndSub Sub Mouseformltb If active = "true" Then Shapes.Move(addmltb,GraphicsWindow.MouseX-100,GraphicsWindow.MouseY-100) EndIf EndSub Sub Mouseformltbdown active = "" EndSub Sub Mousefortb If active = "true" Then Shapes.Move(addtb,GraphicsWindow.MouseX-50,GraphicsWindow.MouseY-50) EndIf EndSub Sub Mousefortbdown active = "" EndSub End>GDR971.sb< Start>GDS044.sb< ' Challenge of the month October 2013 12 steps by NaochanON For step1=0 To 1 'No=1 For step2=0 To 2 'No=2 If step1=0 Then step2=2 EndIf For step3=0 To 2 'No=3 If step2=0 Then step3=2 EndIf For step4=0 To 2 'No=4 If step3=0 Then step4=2 EndIf For step5=0 To 2 'No=5 If step4=0 Then step5=2 EndIf For step6=0 To 2 'No=6 If step5=0 Then step6=2 EndIf For step7=0 To 2 'No=7 If step6=0 Then step7=2 EndIf For step8=0 To 2 'No=8 If step7=0 Then step8=2 EndIf For step9=0 To 2 'No=9 If step8=0 Then step9=2 EndIf For step10=0 To 2 'No=10 If step9=0 Then step10=2 EndIf For step11=0 To 2 'No=11 If step10=0 Then step11=2 EndIf For step12=1 To 2 'No=12 If step11=0 Then step12=2 EndIf Total=step1+step2+step3+step4+step5+step6+ step7+step8+step9+ step10+step11+step12 If Total=12 Then NN=NN+1 t14=text.Append(text.Append(step1,step2),text.Append(step3,step4)) t58=text.Append(text.Append(step5,step6),text.Append(step7,step8)) t912=text.Append(text.Append(step9,step10),text.Append(step11,step12)) t112= text.Append(Text.Append(t14,t58),t912) TextWindow.WriteLine(NN+ " : "+ t112) EndIf EndFor EndFor EndFor EndFor EndFor EndFor EndFor EndFor EndFor EndFor EndFor EndFor End>GDS044.sb< Start>GDS949.sb< GraphicsWindow.Title = "Circuit Sim Prototype" GraphicsWindow.Width = 420 GraphicsWindow.Height = 320 Resistance= Shapes.AddText("0 Ohm") A_Meter = Shapes.AddText("0 A") Battery_P = Shapes.AddText("6 Volt") Shapes.Move(A_Meter,320,150) Shapes.Move(Resistance,222,32) Shapes.Move(Battery_P,202,250) GraphicsWindow.DrawRectangle(200,245,50,20) GraphicsWindow.DrawLine(250,255,350,255) GraphicsWindow.DrawLine(50,255,200,255) GraphicsWindow.DrawLine(50,255,50,80) GraphicsWindow.DrawLine(50,80,250,80) GraphicsWindow.DrawEllipse(250,70,20,20) GraphicsWindow.BrushColor = "Red" Bulb = Shapes.AddEllipse(20,20) Shapes.Move(Bulb,250,70) Shapes.SetOpacity(Bulb,20) GraphicsWindow.DrawLine(270,80,350,80) GraphicsWindow.DrawLine(350,80,350,150) GraphicsWindow.DrawRectangle(315,150,70,15) GraphicsWindow.DrawLine(350,167,350,255) GraphicsWindow.DrawLine(210,40,210,80) GraphicsWindow.DrawRectangle(220,32,70,15) GraphicsWindow.DrawLine(210,40,220,40) GraphicsWindow.DrawLine(290,40,300,40) GraphicsWindow.DrawLine(300,40,300,80) GraphicsWindow.DrawBoundText(10,270,400,"Use Arrow keys to adjust bulb resistance and battery voltage, Use Up/Down to adjust Battery Volts and Left/Right to adjust Bulb resistance. Hit Spacebar to On circuit and Enter to break.") Bulb_Resistance = 20 'Ohms Battery = 06 'Volts GraphicsWindow.KeyDown = KeyPress Sub KeyPress LastKey = GraphicsWindow.LastKey If LastKey = "Space" Then CircuitOn = "True" Shapes.SetOpacity(Bulb,100) ElseIf LastKey = "Return" Then CircuitOn = "False" Shapes.SetOpacity(Bulb,20) Elseif LastKey = "Up" Then Battery = Battery + 1 '1 volt increase per key stroke Elseif LastKey = "Down" Then Battery = Battery - 1 ' 1 volt decrease ElseIf LastKey = "Right" Then Bulb_Resistance = Bulb_Resistance + 1 ElseIf LastKey = "Left" Then Bulb_Resistance = Bulb_Resistance - 1 EndIf Shapes.SetText(Battery_P,Battery+" Volt") Shapes.SetText(Resistance,Bulb_Resistance+" Ohm") EndSub While "True" If CircuitOn Then Current = Battery/Bulb_Resistance Else Current = 0 EndIf Shapes.SetText(A_Meter,Current+" A") EndWhile End>GDS949.sb< Start>GDT043.sb< '====================================================== ' Program: AceyDucey Version 1.2 ' Author: Midlandman, (after Bill Palmby, Illinois - page 2 of David Ahl's book) ' Purpose: A simulation of the card betting game Date: 17.02.2013 ' -------------------------------------------------------------------------------------------- ' Actions: 1) Set up the deck of cards and display the instructions ' 2) For each round: ' 3) show the two initial cards ' 4) invite a bet (validated to be greater than zero and not greater than the pot) ' 5) show the all-important third card ' 6) if the player has won increase his pot, otherwise decrease it ' 7) if there is any money left in the pot, play another round ' 8) Show a final message if the player quits ' ============== START OF PROGRAM ================= init() Instructions() Prepare() While (again="Y") ShowNextRound() TakeBet() If (pot = 0) Then AskPlayAgain() EndIf Endwhile ' ---------------------------------------------------------------------------------- Sub ShowNextRound A=Math.GetRandomNumber(12)+1 B=Math.GetRandomNumber(14-A)+A ' This ensures that the second card is not lower than the first TextWindow.WriteLine("") TextWindow.ForegroundColor="Yellow" TextWindow.WriteLine("You now have " + pot + " dollars.") TextWindow.ForegroundColor="White" TextWindow.WriteLine("Here are your next two cards: " + card[A] + " ... " + card[B]) EndSub Sub TakeBet GetInput="True" While (GetInput) TextWindow.Write("What is your bet? ") bet=TextWindow.ReadNumber() If (bet > pot) Then TextWindow.WriteLine("Sorry, my friend but you bet too much.") TextWindow.Write("You have only ") TextWindow.ForegroundColor = "Yellow" TextWindow.Write(pot) TextWindow.ForegroundColor = "White" TextWindow.WriteLine(" dollars to bet.") ElseIf (bet = 0) Then GetInput="False" TextWindow.ForegroundColor = "Magenta" TextWindow.WriteLine("Chicken!") TextWindow.ForegroundColor = "White" elseif (bet < 0) then TextWindow.WriteLine("You cannot ask the dealer for a loan!") Else GetInput="False" ThirdCard() EndIf EndWhile EndSub Sub ThirdCard C = Math.GetRandomNumber(13)+1 TextWindow.Write("And the third card is ... ... ... " + card[C]) TextWindow.CursorLeft=40 ' place the result in a fixed place to the right TextWindow.Write("<-- ") If (C > A And C < B) Then TextWindow.ForegroundColor="Green" TextWindow.WriteLine("You Win!") pot=pot+bet Else TextWindow.ForegroundColor="Red" TextWindow.WriteLine("You Lose") pot=pot-bet EndIf TextWindow.ForegroundColor="White" EndSub Sub AskPlayAgain If (pot = 0) Then TextWindow.WriteLine("") TextWindow.WriteLine("Sorry, my friend but you blew your wad!") EndIf again="" While (again <> "Y" And again <> "N") TextWindow.Write("Try again? (Yes/No) ") again=text.ConvertToUpperCase(Text.GetSubText(TextWindow.Read(),1,1)) EndWhile If (again="N") Then TextWindow.WriteLine("OK Hope you had fun.") TextWindow.WriteLine("") Else TextWindow.WriteLine("") Prepare() EndIf EndSub Sub Prepare pot=100 again="Y" EndSub Sub init ' note that card[1] is empty, because "Ace" is high. card[2] = "Two" card[3] = "Three" card[4] = "Four" card[5] = "Five" card[6] = "Six" card[7] = "Seven" card[8] = "Eight" card[9] = "Nine" card[10] = "Ten" card[11] = "Jack" card[12] = "Queen" card[13] = "King" card[14] = "Ace" EndSub Sub Instructions TextWindow.ForegroundColor = "Cyan" TextWindow.WriteLine("Acey-Ducey is played in the following manner:") TextWindow.WriteLine("The dealer, (computer), deals two cards face up") TextWindow.WriteLine("Then the game pauses before a third card is dealt.") TextWindow.WriteLine("You have an option: to bet or not to bet depending") TextWindow.WriteLine("on whether or not you feel that card will have a") TextWindow.WriteLine("value between the other two.") TextWindow.WriteLine("If you do not want to bet, input a 0.") TextWindow.WriteLine("") TextWindow.ForegroundColor = "White" EndSub ' ================ END OF PROGRAM ================= End>GDT043.sb< Start>GDW248.sb< Sound.PlayChimes() boja[1]="Black" GraphicsWindow.BrushColor =boja[13] GraphicsWindow.PenWidth=10 GraphicsWindow.DrawLine(10,240,10,300) GraphicsWindow.FillRectangle(5,500,80,10) GraphicsWindow.FillRectangle(1240,105,110,700) GraphicsWindow.DrawLine(0,5,1360,5) GraphicsWindow.DrawLine(0,0,0,750) Shapes.AddLine(0, 90 ,1360,90) Shapes.AddLine(90 , 90 ,90 ,720 ) GraphicsWindow.FillRectangle(5,100,80,600) dl=3' DEBLJINA LINIJE BUF=20 kont=0' kontrola 1 0 1 0 kop=0 kontrolarot=0 ruka=0 VEL=1 GraphicsWindow.CanResize = "false" GraphicsWindow.Height = 768 GraphicsWindow.Width = 1350 GraphicsWindow.Top = (Desktop.Height - GraphicsWindow.Height) / 2-20 GraphicsWindow.Left = (Desktop.Width - GraphicsWindow.Width) / 2 GraphicsWindow.BackgroundColor ="Gray" GraphicsWindow.PenColor = "White"'**************************** GraphicsWindow.PenWidth=1 GraphicsWindow.FontSize = 13 GraphicsWindow.BrushColor = "Black" '=========== UCITAVANJE SLIKA ================== ' imagepath = "C:\SB\LIN1.jpg" image1=Shapes.AddImage(imagepath) Shapes.Move(image1, 0, 75) '=============================================== Program.Delay(1) Sound.PlayChimes() ' == MIS == TASTATURA MON. TASAT. === UNOS TEXT== BUTTON CONT ===== GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseMove = OnMouseMove GraphicsWindow.MouseUp = OnMouseUp GraphicsWindow.TextInput = OnTextInput '______________D O D A V A Nj E T A S T E R A _______________________ ' textbox = Controls.AddTextBox(360, 75) GraphicsWindow.FontSize = 8 button150 = Controls.AddButton(" NOVI UPIS => ", 270, 75) button100 = Controls.AddButton("UPISI ", 535, 75) GraphicsWindow.BrushColor ="Red" button101 = Controls.AddButton("BRISI ", 585, 75) GraphicsWindow.BrushColor ="Black" GraphicsWindow.FontSize = 13 button9 = Controls.AddButton(" G R E C ", 395, 10) button2 = Controls.AddButton(" F I K S ", 10, 140) button4 = Controls.AddButton("_BR E_", 10, 175) button5 = Controls.AddButton("EK. KOND", 147, 10) button6 = Controls.AddButton("_ BRISI_", 10,210) button60 = Controls.AddButton("OTPORNIK", 61, 10) button50 = Controls.AddButton("O------ O ",10, 690) button7 = Controls.AddButton(" TRIJAK ", 226, 10) button8 = Controls.AddButton("SIJALICA ", 305, 10) button10 = Controls.AddButton(" T R A F O ", 470, 10) '--------------------- L E D ------------------------------------------ GraphicsWindow.BrushColor ="Red" button11 = Controls.AddButton("L", 910,10) Controls.SetSize(button11, 30, 30) GraphicsWindow.BrushColor ="Black" '----------------------------------------- GraphicsWindow.BrushColor ="Yellow" button12 = Controls.AddButton("L", 880,10) Controls.SetSize(button12, 30, 30) GraphicsWindow.BrushColor ="Black" '-------------------------------------------------------- GraphicsWindow.BrushColor ="Green" button13 = Controls.AddButton("L", 850,10) Controls.SetSize(button13, 30, 30) GraphicsWindow.BrushColor ="Black" '----------------------------------------------------------- GraphicsWindow.BrushColor ="Blue" button14 = Controls.AddButton("L", 820,10) Controls.SetSize(button14, 30, 30) GraphicsWindow.BrushColor ="Black" '------------------------------------------------------------ '------------------------ BATTON 2017 ---------------------------------------- button1710 = Controls.AddButton("KVADRAT ",1250,110 ) Controls.SetSize(button1710, 95, 30) button1720 = Controls.AddButton("K R U G ",1250,142 ) Controls.SetSize(button1720, 95, 30) button1730 = Controls.AddButton("TROUGAO ", 1250,174 ) Controls.SetSize(button1730, 95, 30) button1740 = Controls.AddButton("K O P SLI ",1250,206 ) Controls.SetSize(button1740, 95, 30) button1750 = Controls.AddButton("DODAJ BOJE ", 1250,238 ) Controls.SetSize(button1750, 95, 30) button1760 = Controls.AddButton("UKLONI BOJE ", 1250,270 ) Controls.SetSize(button1760, 95, 30) button1770 = Controls.AddButton(" ", 1250,302 ) Controls.SetSize(button1770, 95, 30) button1780 = Controls.AddButton(" ", 1250,334 ) Controls.SetSize(button1780, 95, 30) button1790 = Controls.AddButton(" ", 1250,366 ) Controls.SetSize(button1790, 95, 30) button1800 = Controls.AddButton(" ", 1250,398 ) Controls.SetSize(button1800, 95, 30) button15 = Controls.AddButton(" P K 6 ", 558, 10) button16 = Controls.AddButton(" P K 2 ", 627, 10) button17 = Controls.AddButton(" D I J A K ",697, 10) button18 = Controls.AddButton(" P o ",776, 10) ' LINIJE DEBELE button19 = Controls.AddButton(" 1",10, 370) button20 = Controls.AddButton(" 3",10, 400) button21 = Controls.AddButton(" 5",10, 430) button22 = Controls.AddButton(" 7",10, 460) button23 = Controls.AddButton("10",10, 490) button24 = Controls.AddButton("15",10, 520) button25 = Controls.AddButton("20",10, 550) button45 = Controls.AddButton(" 0",10, 580) 'KONTROLA BOJA GraphicsWindow.BrushColor ="White" button26 = Controls.AddButton("[]",55, 370) GraphicsWindow.BrushColor ="Black" button27 = Controls.AddButton("[]",55, 400) GraphicsWindow.BrushColor ="Yellow" button28 = Controls.AddButton("[]",55, 430) GraphicsWindow.BrushColor ="Lime" button29 = Controls.AddButton("[]",55, 460) GraphicsWindow.BrushColor ="Red" button30 = Controls.AddButton("[]",55, 490) GraphicsWindow.BrushColor ="LightSkyBlue " button31 = Controls.AddButton("[]",55, 520) GraphicsWindow.BrushColor ="goldenrod" button32 = Controls.AddButton("[]",55, 550) GraphicsWindow.BrushColor ="Gray" button3 = Controls.AddButton("[]", 55, 580) GraphicsWindow.BrushColor ="Black" button33 = Controls.AddButton("ROTIRAJ",10, 620) button34 = Controls.AddButton(" - ",10, 655) button35 = Controls.AddButton(" BLOK K ", 943, 10) button36 = Controls.AddButton(" DIODA ", 7, 43) button37 = Controls.AddButton(" TRIMER ", 77, 43) button38 = Controls.AddButton(" + ",53, 655) button39 = Controls.AddButton(" TRANZIS ", 154, 43) button40 = Controls.AddButton(" R A I ", 777, 43) button41 = Controls.AddButton(" U S B ", 835, 43) button42 = Controls.AddButton(" D I N ", 895, 43) button43 = Controls.AddButton(" C I N C", 955, 43) GraphicsWindow.BrushColor ="Red" button44 = Controls.AddButton(" DODAJ EL", 4, 107) GraphicsWindow.BrushColor ="Black" GraphicsWindow.BrushColor ="Red" button70 = Controls.AddButton("LEM T", 7,10) GraphicsWindow.BrushColor ="Black" ' Exit = Controls.AddButton("O", 400, 50) ' Controls.SetSize(Exit, 30, 30) '////////// C R T A M R E Z U /////////////////////////////// GraphicsWindow.PenWidth=1 For vv1= 100 To 750 Step 20 For ly =100 To 1355 Step 20 GraphicsWindow.FillEllipse(ly-2,vv1-2, 5, 5) EndFor EndFor magepath = "C:\SB\LIN3.jpg" image2=Shapes.AddImage(imagepath) Shapes.Move(image2, 0, 723) '--------------------------------------------------------------- 'POTENCIRA KOORDINATE GraphicsWindow.FontSize = 20 GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(10,300,80,50) GraphicsWindow.BrushColor = "Lime"'******************** GraphicsWindow.DrawText(10, 310,"x="+ rcx) GraphicsWindow.DrawText(10, 335,"y="+ rcy) '-[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ GraphicsWindow.BrushColor = "Lime" Ellipse3 =Shapes.AddEllipse( 10, 10) GraphicsWindow.BrushColor = "Red" Ellipse2 =Shapes.AddEllipse( 10, 10) GraphicsWindow.BrushColor = "Orange" Ellipse10 =Shapes.AddEllipse( 10, 10) Shapes.Move(Ellipse3,530,53) Shapes.Move(Ellipse2,510,53) Shapes.Move(Ellipse10,550,53) '************************************************************* ' UCITAVA S O U N D '************************************************************** pesmaA= ("F:\s.mp3") pesma= ("F:\Sound.wav") '********************************************** boja[5]="B E L A" DBL[1]="KLIK MIŠ ==>" OB[1]="<========" BOJA[10]="================" BOJA[10]="White" Controls.ButtonClicked=Etaster '==== KONTROLA = T A S T A R U R A ======================== lop: '================================================== '======================================================== Program.Delay(100) Shapes.ShowShape(Ellipse3) Shapes.ShowShape(Ellipse2) Shapes.ShowShape(Ellipse10) Program.Delay(100) '+++++++++++++++++++++++++++++++++++ GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(240,40,180,35) GraphicsWindow.BrushColor = "Aqua" GraphicsWindow.DrawText(245, 45,DBL[1]) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(420,40,180,35) GraphicsWindow.BrushColor = BOJA[10] GraphicsWindow.DrawText(425, 45,boja[5]) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(600,40,180,35) GraphicsWindow.BrushColor ="Magenta" GraphicsWindow.DrawText(605, 45,OB[1]) '===================== T I M E ===================== GraphicsWindow.FontSize = 35 GraphicsWindow.BrushColor = "white" GraphicsWindow.BrushColor = "White" Program.Delay(100) 'Shapes.Remove(PRIKA) 'PRIKA = Shapes.AddText( (Clock.Time) ) 'Shapes.Move(PRIKA, 1120, 20) GraphicsWindow.FontSize = 20 GraphicsWindow.BrushColor = "Black" '=============== X kursor ================== GraphicsWindow.BrushColor = "Black" Shapes.Remove(PRIK) PRIK = Shapes.AddText("QX= "+(qx)) Shapes.Move(PRIK, 700, 722) '================= Y kursor ===================== GraphicsWindow.BrushColor = "Black" Shapes.Remove(PRI) PRI = Shapes.AddText("QY= "+(Qy)) Shapes.Move(PRI, 800, 722) If GraphicsWindow.MouseY< 120 then GraphicsWindow.BrushColor =boja[gh] EndIf '************************************************************* '************************************************************* pesmaA= ("F:\s.mp3") Sub OnKeyDown GraphicsWindow.FontSize = 20 GraphicsWindow.Title = "'" + GraphicsWindow.LastKey + "' pressed" GraphicsWindow.Title =rcx Sound.PlayClick() z = GraphicsWindow.LastKey ' ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] '------------------------------------------------------------------------------------ If z = "Escape" Then Program.End() '--------------------------------------------------------------------------------------- ElseIf Z = "R" Then rotkop() '------------------------------------------------------------- ElseIf Z = "N" Then nt() '------------------------------------------------------------------- ElseIf Z = "I" Then Sound.Play(pesma) '--------------------------------------------------------------- ElseIf Z = "B" Then PIKSEL() '----------------------------------------------------------------- ElseIf Z = "C" Then rucnoc() '------------------------------------------------------------ ElseIf Z = "S" Then spoji() '--------------------------------------------------------- ElseIf Z = "U" Then sveboje() '-------------------------------------------------------- ElseIf Z= "Q" Then JN() ']]]]]]]]]]]]]]] F I N O P O D E S A V A Nj E ]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] ElseIf Z = "NumPad2" Then psy=psy-1 Shapes.Move(image,x-psx,y-psy) Shapes.Remove(T[BRT]) rcy=rcy+1 '------------------------------------------------------------- ElseIf Z = "NumPad6" Then psx=psx-1 Shapes.Move(image,x-psx,y-psy) Shapes.Remove(T[BRT]) rcx=rcx+1 '------------------------------------------------------------------ ElseIf Z = "NumPad8" Then psy=psy+1 Shapes.Move(image,x-psx,y-psy) Shapes.Remove(T[BRT]) rcy=rcy-1 '---------------------------------------------------------------- ElseIf Z = "NumPad4" Then psx=psx+1 Shapes.Move(image,x-psx,y-psy) Shapes.Remove(T[BRT]) rcx=rcx-1 '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ C R T A L I N I J E 20 [[[[[[[[[[[[[[[[[[[[ ElseIf Z = "Right" Then GraphicsWindow.BrushColor =(PRIKP[1]) GraphicsWindow.BrushColor = "Black" Shapes.Remove(PRIKAZ) PRIKAZ = Shapes.AddText("--- D E S N O") Shapes.Move(PRIKAZ, 400, 722) BRL= BRL+1 rcx=rcx+kont UKLONI[BRL]= Shapes.AddLine(rcx, rcy ,rcx+20,rcy) rcx=rcx+20 rcx=rcx kont=0 Shapes.Move(Ellipse3,rcx-5,rcy-5) OB[1]=("LIN "+ BRL) x=rcx '----------------------------------------------------------------------------- ElseIf Z = "Left"Then GraphicsWindow.BrushColor = "Black" Shapes.Remove(PRIKAZ) PRIKAZ = Shapes.AddText("--- L E V O") Shapes.Move(PRIKAZ, 400, 722) BRL=BRL+1 UKLONI[BRL]= Shapes.AddLine(rcx, rcy ,rcx-20,rcy) rcx=rcx-20 rcx=rcx Shapes.Move(Ellipse3,rcx-5,rcy-5) OB[1]=("LIN "+ BRL) x=rcx '------------------------------------------------------- ElseIf Z = "Down" Then GraphicsWindow.BrushColor = "Black" Shapes.Remove(PRIKAZ) PRIKAZ = Shapes.AddText("--- D O L E") Shapes.Move(PRIKAZ, 400, 722) BRL=BRL+1 UKLONI[BRL]= Shapes.AddLine(rcx, rcy ,rcx,rcy+20) rcy=rcy+20 rcy=rcy Shapes.Move(Ellipse3,rcx-5,rcy-5) OB[1]=("LIN "+ BRL) y=rcy '-------------------------------------------------------- ElseIf Z = "Up" Then GraphicsWindow.BrushColor = "Black" Shapes.Remove(PRIKAZ) PRIKAZ = Shapes.AddText("--- G O R E") Shapes.Move(PRIKAZ, 400, 722) BRL=BRL+1 UKLONI[BRL]= Shapes.AddLine(rcx, rcy ,rcx,rcy-20) rcy=rcy-20 rcy=rcy Shapes.Move(Ellipse3,rcx-5,rcy-5) OB[1]=("LIN "+ BRL) y=rcy '------------------------------------------------------------------------------ ElseIf Z = "NumPad0" Then Sound.PlayMusic("O8 c32 d32e32") Shapes.Move(image, rcx, rcy) ' kfy korekcija Shapes.Remove(T[BRT]) MPX=0 MPY=0 brisi=500 UM=0 'STORNIRA UMANJENJE UV=0 'STRORNIRA UVECANJE '++++++++++++++++++++++++++++++++++++ 'B E L E S L I K E Else ']]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] EndIf '[[[[[[[[[[[[[[ K R A J [[[[[[[[[[[[[ GraphicsWindow.FontSize = 20 GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(10,275,80,90) GraphicsWindow.BrushColor = "Lime" GraphicsWindow.DrawText(10, 310,"x="+ rcx) GraphicsWindow.DrawText(10, 335,"y="+ rcy) GraphicsWindow.BrushColor = "Red" GraphicsWindow.DrawText(10, 285,"Br.s "+ slika[S]) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(10,275,80,30) GraphicsWindow.BrushColor = BOJA[10] GraphicsWindow.DrawText(10, 285,"LIN "+ BRL) EndSub '============================================================== '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ M A U S E [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ '=================================================================== Sub OnKeyUp EndSub '=============== M A U S E =============================================== Sub OnMouseDown If Mouse.IsLeftButtonDown Then GraphicsWindow.Title = "Left button pressed" Sound.PlayClick() QX=Math.Round( GraphicsWindow.MouseX /20)*20 QY=Math.Round( GraphicsWindow.MouseY /20)*20 GraphicsWindow.Title =QX BRT=BRT+1 x=QX y=Qy pom=0 kontx=QX konty=QY rcx=QX rcy=QY Shapes.Move(Ellipse3,rcx-5,rcy-5) GraphicsWindow.BrushColor ="White" T[BRT] =Shapes.AddEllipse( 10, 10) OB[1]="C R T A Nj E" DBL[1]="C R T A Nj E" Sound.PlayChimes() 'Sound.PlayMusic("O8 c32 d32e32") '************** ISPIS KURSA *************************** GraphicsWindow.BrushColor = "Black" Shapes.Remove(PRIKAZ) PRIKAZ = Shapes.AddText("KURS A") Shapes.Move(PRIKAZ, 400, 722) OB[1]="T A C K A A " '========================================================= 'Mouse.IsRight R I G H T '========================================================= ElseIf Mouse.IsRightButtonDown Then GraphicsWindow.BrushColor = "Black" Shapes.Remove(PRIKAZ) PRIKAZ = Shapes.AddText("KURS B") Shapes.Move(PRIKAZ, 400, 722) GraphicsWindow.Title = "Right button pressed" Sound.PlayClick() prevX = Math.Round( GraphicsWindow.MouseX /20)*20 prevY = Math.Round( GraphicsWindow.MouseY /20)*20 Shapes.Move(Ellipse2,prevX-5,prevY-5) Sound.PlayMusic("O8 c32 d32e32") Sound.PlayMusic("O8 c32 d32e32") OB[1]="T A C K A B" DBL[1]="Ctrl SPAJA" EndIf GraphicsWindow.FontSize = 20 GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(10,310,80,50) GraphicsWindow.BrushColor = "Lime" GraphicsWindow.DrawText(10, 310,"x="+ rcx) GraphicsWindow.DrawText(10, 335,"y="+ rcy) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(0,235,88,50) GraphicsWindow.DrawRectangle(8,248,75,25) EndSub '=================================================================== Sub OnMouseMove If (Mouse.IsLeftButtonDown) And FIKS=1 Then Shapes.Move(image, GraphicsWindow.MouseX, GraphicsWindow.MouseY) Shapes.Remove(T[BRT]) QX=Math.Round( GraphicsWindow.MouseX /20)*20 QY=Math.Round( GraphicsWindow.MouseY /20)*20 GraphicsWindow.Title =QX BRT=BRT+1 x=QX y=Qy Shapes.Move(image,QX,Qy) pom=0 kontx=QX konty=QY rcx=QX rcy=QY Shapes.Move(Ellipse3,rcx-5,rcy-5) '********************************************************** '************************************************************ GraphicsWindow.BrushColor ="White" GraphicsWindow.PenWidth = 3 Shapes.Remove(T[BRT]) Shapes.Remove(T[BRT]) brisi=500 GraphicsWindow.BrushColor = "Black" Shapes.Remove(PRIKAZ) PRIKAZ = Shapes.AddText("P O S T A V LJ E N O") Shapes.Move(PRIKAZ, 400, 722) EndIf '************************** UZIMA BOJE SA KOLOR LINIJE **************** If GraphicsWindow.MouseY>100 And GraphicsWindow.MouseY < 120 then GraphicsWindow.BrushColor =boja[gh] PRIKP[1]=GraphicsWindow.GetPixel(GraphicsWindow.MouseX,GraphicsWindow.MouseY) GraphicsWindow.Title =(PRIKP[1]) GraphicsWindow.PenColor =(PRIKP[1]) EndIf '**************************************************************************** EndSub '================================================================= Sub OnMouseUp EndSub '================================================================= Sub OnTextInput ' Code for text inputs goes here. EndSub '[[[[[[[[[[[[[[[[______ E ___T A S T E R I ________[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[==================== Sub Etaster Sound.PlayClick() FIKS=1 '---------------------------------------------------------------------------- 'C R T A L I N I J U If Controls.LastClickedButton = button50 Then GraphicsWindow.BrushColor = "Black" Shapes.Remove(PRIKAZ) PRIKAZ = Shapes.AddText("S P O J E N O") Shapes.Move(PRIKAZ, 400, 722) Sound.PlayMusic("O8 c32 d32e32") Line1= Shapes.AddLine(x, y ,prevx,prevy) kontx=x konty=y OB[1]="NACRTANO" '---------------------------------------------------------------------------------- ' B I R A E L E M E N T E ElseIf Controls.LastClickedButton = button44 Then Program.Delay(10) If S>34 Then 'S MORA BITI ZA 1 MANJI OD BROJA SLIKA S=0 EndIf If brisi <>500 Then Shapes.Remove(image) EndIf S=S+1 slika[S]=S letter[S] = Text.ConvertToUpperCase(S) FIKS=1 GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(10,275,80,30) GraphicsWindow.BrushColor = "OrangeRed" GraphicsWindow.DrawText(10, 285,"Br.s "+ slika[S]) image[1]=("C:\SB\1.jpg" ) image[2]=("C:\SB\2.jpg" ) image[3]=("C:\SB\3.jpg" ) image[4]=("C:\SB\4.jpg" ) image[5]=("C:\SB\5.jpg" ) image[6]=("C:\SB\6.jpg" ) image[7]=("C:\SB\7.jpg" ) image[8]=("C:\SB\8.jpg" ) image[9]=("C:\SB\9.jpg" ) image[10]=("C:\SB\10.jpg" ) image[11]=("C:\SB\11.jpg" ) image[12]=("C:\SB\12.jpg" ) image[13]=("C:\SB\13.jpg" ) image[14]=("C:\SB\14.jpg" ) image[15]=("C:\SB\15.jpg" ) image[16]=("C:\SB\16.jpg" ) image[17]=("C:\SB\17.jpg" ) image[18]=("C:\SB\18.jpg" ) image[19]=("C:\SB\19.jpg" ) image[20]=("C:\SB\20.jpg" ) image[21]=("C:\SB\21.jpg" ) image[22]=("C:\SB\22.jpg" ) image[23]=("C:\SB\23.jpg" ) image[24]=("C:\SB\24.jpg" ) image[25]=("C:\SB\25.jpg" ) image[26]=("C:\SB\26.jpg" ) image[27]=("C:\SB\27.jpg" ) image[28]=("C:\SB\28.jpg" ) image[29]=("C:\SB\29.jpg" ) image[30]=("C:\SB\30.jpg" ) image[31]=("C:\SB\31.jpg" ) image[32]=("C:\SB\32.jpg" ) image[33]=("C:\SB\33.jpg" ) image[34]=("C:\SB\34.jpg" ) image=Shapes.AddImage(image[s]) Shapes.Move(image, 120,120) brisi=1000 Program.Delay(100) OB[1]="EL - IZBOR" '++++++++++++++++++++++++++++++++++++++++++++ 'L E M BRT=BRT+1 ElseIf Controls.LastClickedButton = button70 Then GraphicsWindow.BrushColor ="LightSteelBlue" GraphicsWindow.PenColor ="LightSteelBlue" T[BRT] =Shapes.AddEllipse( 10, 10) x=QX y=Qy pom=0 kontx=QX konty=QY rcx=QX rcy=QY FIKS=0 Shapes.Move(T[BRT],Qx-5,Qy-5) Shapes.Remove(NT[10]) NT[10]="LEMNA TACKA" nt() '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ 'P O S T A V I T E X T ElseIf Controls.LastClickedButton = button100 Then GraphicsWindow.FontSize = 14 GraphicsWindow.BrushColor ="White" text[1] = Controls.GetTextBoxText(POLJE_1) NAMESTI=Shapes.AddText(text[1]) Shapes.Move(NAMESTI, rcx, rcy) Sound.PlayMusic("O8 c32 d32e64") FIKS=0 rcx=0 rcy=0 BRL=0 Controls.Remove(POLJE_1) Sound.PlayMusic("O8 c32 d32e64") '----------------------------------------------------------------- 'N O V I U P I S ElseIf Controls.LastClickedButton = button150 Then GraphicsWindow.FontSize = 20 DBL[1]="UPISI TEXT" Sound.PlayMusic("O8 c32 d32e64") GraphicsWindow.FontSize = 12 GraphicsWindow.BrushColor ="Black" POLJE_1= Controls.AddTextBox(360, 75) Sound.PlayMusic("O8 c32 d32e64") FIKS=0 rcx=0 rcy=0 BRL=0 '---------------------------------------------------------------------- ElseIf Controls.LastClickedButton = button101 Then Shapes.Remove(NAMESTI) '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ ElseIf Controls.LastClickedButton = button1710 Then kvadrat() '------------------------------------------------------------------------------ 'OTPORNIK ElseIf Controls.LastClickedButton = button60 Then Sound.PlayMusic("O8 c32 d32e64") imagepath = "C:\SB\OTPORZ1.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image, 120,120) MPX=0 MPY=0 cslike = Shapes.GetTop(image) GraphicsWindow.Title =cslike imagepath1=imagepath Shapes.Remove(NT[10]) NT[10]="OTPORNIK" nt() '+++++++++++++++++++++++++++++++++++++++++++ 'D I O D A ElseIf Controls.LastClickedButton = button36 Then Sound.PlayMusic("O8 c32 d32e64") imagepath = "C:\SB\D2.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image, 120,120) MPX=0 MPY=0 Shapes.Remove(NT[10]) NT[10]="DIOD " nt() '++++++++++++++++++++++++ ++++++++++++++++ 'TRIMER ElseIf Controls.LastClickedButton = button37 Then Sound.PlayMusic("O8 c32 d32e64") imagepath = "C:\SB\TRIMER2.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image, 120,120) MPX=0 MPY=0 Shapes.Remove(NT[10]) NT[10]="TRIMER " nt() '+++++++++++++++++++++++++++++++++++++++++++++++++++++ ' TRANZISTOR ElseIf Controls.LastClickedButton = button39 Then Sound.PlayMusic("O8 c32 d32e64") imagepath = "C:\SB\TRAN2.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image, 120,120) MPX=0 MPY=0 Shapes.Remove(NT[10]) NT[10]="TRANZISTOR " nt() '+++++++++++++++++++++++++++++++++++++++++++++ 'R AUT IN ElseIf Controls.LastClickedButton = button40 Then Sound.PlayMusic("O8 c32 d32e64") imagepath = "C:\SB\RAUTIN.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image, 120,120) Shapes.Remove(NT[10]) NT[10]="R AUT IN " nt() '++++++++++++++++++++++++++++++++++++++++ 'U S B ElseIf Controls.LastClickedButton = button41 Then Sound.PlayMusic("O8 c32 d32e64") imagepath = "C:\SB\USB1.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image, 120,120) MPX=0 MPY=0 Shapes.Remove(NT[10]) NT[10]="U S B" nt() '+++++++++++++++++++++++++++++++++++++++++ 'D I N ElseIf Controls.LastClickedButton = button42 Then Sound.PlayMusic("O8 c32 d32e64") imagepath = "C:\SB\DIN1.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image, 120,120) MPX=0 MPY=0 Shapes.Remove(NT[10]) NT[10]="D I N " nt() '++++++++++++++++++++++++++++++++++++++++++++++++++ 'C I N C ElseIf Controls.LastClickedButton = button43 Then Sound.PlayMusic("O8 c32 d32e64") imagepath = "C:\SB\CINC2.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image, 120,120) MPX=0 MPY=0 Shapes.Remove(NT[10]) NT[10]="C I N C " nt() '+++++++++++++++++++++++++++++++++++++++++++++++ 'POSTAVI ElseIf Controls.LastClickedButton = button2 Then Sound.PlayMusic("O8 c32 d32e32") FIKS=0 Shapes.Move(image, rcx, rcy) ' kfy korekcija Shapes.Remove(T[BRT]) MPX=0 MPY=0 UM=0 'STORNIRA UMANJENJE UV=0 'STRORNIRA UVECANJE brisi=500 psx=0 psy=0 Shapes.Move(Ellipse3,rcx-8,rcy-8) OB[1]="EL - FIKSIRAN" '+++++++++++++++++++++++++++++++++++++++++++ ' KONDEMZATOR ElseIf Controls.LastClickedButton = button5 Then imagepath = "C:\SB\KD6.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image, 120, 120) MPX=0 MPY=0 Shapes.Remove(NT[10]) NT[10]="KONDENZATOR " nt() '+++++++++++++++++++++++++++++++++++++++++ 'T R I J A K ElseIf Controls.LastClickedButton = button7 Then imagepath = "C:\SB\TRI6.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image,120,120) MPX=0 MPY=0 Shapes.Remove(NT[10]) NT[10]="TRIJAK " nt() '+++++++++++++++++++++++++++++++++++++++++ 'SIJALICA ElseIf Controls.LastClickedButton = button8 Then imagepath = "C:\SB\SI2.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image, 120, 120) MPX=0 MPY=-8 Shapes.Remove(NT[10]) NT[10]="SIJALICA " nt() '+++++++++++++++++++++++++++++++++++++++++ 'G R E C ElseIf Controls.LastClickedButton = button9 Then imagepath = "C:\SB\GREC2.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image, 120, 120) MPX=0 MPY=0 Shapes.Remove(NT[10]) NT[10]="GREC " nt() '++++++++++++++++++++++++++++++++++++++++++++++++ 'T R A F O ElseIf Controls.LastClickedButton = button10 Then imagepath = "C:\SB\TRAFO.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image, 120, 120) MPX=0 MPY=0 Shapes.Remove(NT[10]) NT[10]="TRAFO " nt() '++++++++++++++++++++++++++++++++++++++++++++++++++ 'LED C ElseIf Controls.LastClickedButton = button11 Then imagepath = "C:\SB\LEDCR.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image, 120, 120) MPX=0 MPY=0 Shapes.Remove(NT[10]) NT[10]="LED C " nt() '+++++++++++++++++++++++++++++++++++++++++++++ 'LED ZU ElseIf Controls.LastClickedButton = button12 Then imagepath = "C:\SB\LEDZU.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image, 120, 120) MPX=0 MPY=0 Shapes.Remove(NT[10]) NT[10]="LED ZU " nt() '+++++++++++++++++++++++++++++++++++++++++++ 'LED ZE ElseIf Controls.LastClickedButton = button13 Then imagepath = "C:\SB\LEDZ.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image, 120,120) MPX=0 MPY=0 Shapes.Remove(NT[10]) NT[10]="LED ZE " nt() '++++++++++++++++++++++++++++++++++++++++++++++++ 'LED PLAVA ElseIf Controls.LastClickedButton = button14 Then imagepath = "C:\SB\LEDP.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image,120,120) MPX=0 MPY=0 Shapes.Remove(NT[10]) NT[10]="LED PLAVA " nt() '++++++++++++++++++++++++++++++++++++ 'P K 6 ElseIf Controls.LastClickedButton = button15 Then imagepath = "C:\SB\PK6B.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image,120,120) MPX=0 MPY=0 Shapes.Remove(NT[10]) NT[10]="PK 6 " nt() '++++++++++++++++++++++++++++++++++++ 'P K 2 ElseIf Controls.LastClickedButton = button16 Then imagepath = "C:\SB\PK2C.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image,120,120) MPX=0 MPY=5 Shapes.Remove(NT[10]) NT[10]="PK2 " nt() '+++++++++++++++++++++++++++++++++++ 'D I J A K ElseIf Controls.LastClickedButton = button17 Then imagepath = "C:\SB\DIJAK4.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image,120,120) MPX=0 MPY=2 Shapes.Remove(NT[10]) NT[10]="DIJAK " nt() '++++++++++++++++++++++++++++++++++++++ ' P O T 1 ElseIf Controls.LastClickedButton = button18 Then imagepath = "C:\SB\POT4.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image, 120,120) MPX=0 MPY=0 Shapes.Remove(NT[10]) NT[10]="POT 1 " nt() '++++++++++++++++++++++++++++++++++++++++++ 'BLOK K ElseIf Controls.LastClickedButton = button35 Then imagepath = "C:\SB\BLOKK.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image, 120,120) MPX=0 MPY=10 Shapes.Remove(NT[10]) NT[10]="BLOK K" nt() '================================================================= 'D E B L J I N A L I N I J E ElseIf Controls.LastClickedButton = button19 Then dl=1 GraphicsWindow.PenWidth=dl DBL[1]= "H LINIJE = 1 p" Sound.PlayMusic("O8 c32 d32e32") ElseIf Controls.LastClickedButton = button20 Then dl=3 GraphicsWindow.PenWidth=dl DBL[1]= "H LINIJE = 3 p" Sound.PlayMusic("O8 c32 d32e32") ElseIf Controls.LastClickedButton = button21 Then dl=5 GraphicsWindow.PenWidth=dl DBL[1]= "H LINIJE = 5 p" Sound.PlayMusic("O8 c32 d32e32") ElseIf Controls.LastClickedButton = button22 Then dl=7 GraphicsWindow.PenWidth=dl DBL[1]= "H LINIJE = 7 p" Sound.PlayMusic("O8 c32 d32e32") ElseIf Controls.LastClickedButton = button23 Then dl=10 GraphicsWindow.PenWidth=dl DBL[1]= "H LINIJE = 10 p" Sound.PlayMusic("O8 c32 d32e32") ElseIf Controls.LastClickedButton = button24 Then dl=15 GraphicsWindow.PenWidth=dl DBL[1]= "H LINIJE = 15 p" Sound.PlayMusic("O8 c32 d32e32") ElseIf Controls.LastClickedButton = button25 Then dl=20 GraphicsWindow.PenWidth=dl DBL[1]= "H LINIJE = 20 p" Sound.PlayMusic("O8 c32 d32e32") ElseIf Controls.LastClickedButton = button45 Then dl=0 GraphicsWindow.PenWidth=0 DBL[1]= "<= V O D I =>" Sound.PlayMusic("O8 c32 d32e32") Sound.PlayMusic("O8 c32 d32e32") FIKS=0 '============================================== ' B O J E ElseIf Controls.LastClickedButton = button26 Then GraphicsWindow.PenColor ="White " BOJA[10]="White " boja[5]="B E L A" ElseIf Controls.LastClickedButton = button27 Then GraphicsWindow.PenColor ="Black " boja[5]="C R N A" ElseIf Controls.LastClickedButton = button28 Then GraphicsWindow.PenColor ="Yellow" BOJA[10]="Yellow" boja[5]="Z U T A" ElseIf Controls.LastClickedButton = button29 Then GraphicsWindow.PenColor ="Lime " BOJA[10]="Lime " boja[5]="Z E L E N A" ElseIf Controls.LastClickedButton = button30 Then GraphicsWindow.PenColor ="Red " BOJA[10]="Red " boja[5]="C R V E N A" ElseIf Controls.LastClickedButton = button31 Then GraphicsWindow.PenColor ="LightSkyBlue " BOJA[10]="LightSkyBlue " boja[5]="P L A V A" ElseIf Controls.LastClickedButton = button32 Then GraphicsWindow.PenColor ="goldenrod" BOJA[10]="goldenrod" boja[5]="M E T A L" ElseIf Controls.LastClickedButton = button3 Then GraphicsWindow.PenColor = "Gray" BOJA[10]= "Gray" boja[5]="S I V A" '=============================================================== 'ROTIRA ElseIf Controls.LastClickedButton = button33 Then ROT=ROT+45 Shapes.Rotate(image,ROT) Shapes.Remove(NT[10]) NT[10]="ROTIRANO " nt() '-------------------------------------------------------------------------------------------- 'UMANJI ElseIf Controls.LastClickedButton = button34 Then UM=0.1 Shapes.Remove(T[BRT]) Shapes.Zoom(image,VEL- UM,VEL- UM) VEL=VEL-UM OB[1]="UMANJENO" Shapes.Remove(NT[10]) NT[10]="UMANJENO" nt() '--------------------------------------------------------------------- 'UVECA ElseIf Controls.LastClickedButton = button38 Then UM=0.1 Shapes.Remove(T[BRT]) Shapes.Zoom(image,VEL+ UM,VEL+ UM) VEL=VEL+UM OB[1]="UVECANO" Shapes.Remove(NT[10]) NT[10]="UVECANO " nt() '------------------------------------------------------------------------------------- 'BRISE ElseIf Controls.LastClickedButton = button6 Then Shapes.Remove(Line1) Shapes.Remove(T[BRT]) 'Shapes.Remove(Ellipse2) Shapes.Remove(UKLONI[BRL]) Shapes.Remove(kopija[kop]) Shapes.Remove(T[BRT]) tx=tx-1 Controls.Remove(text[tx]) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(10,275,80,30) GraphicsWindow.BrushColor = "Aqua" GraphicsWindow.DrawText(10, 285,"Br.L "+ BRL) OB[1]=("IZBRISANO "+BRL) BRL=BRL-1 BRT=BRT-1 kop=kop-1 Shapes.Remove(NT[10]) NT[10]="IZBRISANO " nt() '++++++++++++++++++++++++++++++++++++++++++++ ' BRISE SLIKE ElseIf Controls.LastClickedButton = button4 Then Shapes.Remove(image) y=Qy '+++++++++++++++++++++++++++++++++++++++++++ Shapes.Remove(NT[10]) NT[10]="BRISE SLIKU " nt() EndIf GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(0,235,88,50) GraphicsWindow.DrawRectangle(8,248,75,25) EndSub Program.Delay(100) Shapes.HideShape(Ellipse3) Shapes.HideShape(Ellipse2) Shapes.HideShape(Ellipse10) Program.Delay(100) GraphicsWindow.PenWidth=dl kontrolarot =0 GraphicsWindow.BrushColor =(PRIKP[1]) GraphicsWindow.FillRectangle(9,249,70,22) Goto lop '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ Sub PIKSEL PRIKP[1]=GraphicsWindow.GetPixel(GraphicsWindow.MouseX,GraphicsWindow.MouseY) GraphicsWindow.Title =PRIKP[1] Sound.PlayMusic("O8 c32 d32e32") GraphicsWindow.PenColor =(PRIKP[1]) EndSub '///////////////////////////////////////////////// Sub spoji GraphicsWindow.BrushColor = "Black" Shapes.Remove(PRIKAZ) PRIKAZ = Shapes.AddText("S P O J E N O") Shapes.Move(PRIKAZ, 400, 722) Shapes.Remove(NT[10]) NT[10]="SPOJENO " nt() GraphicsWindow.PenWidth=dl Line1= Shapes.AddLine(x, y ,prevx,prevy) kontx=x konty=y OB[1]="NACRTANO" Sound.PlayAndwait(pesmaA) Sound.Stop(pesmaA) EndSub ']]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] ']]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]] Sub rucnoc kop=kop+1 Shapes.Move(Ellipse10,rcx-5,rcy-5) imagepath1=imagepath image1=Shapes.AddImage(imagepath1) Shapes.Move(image1, QX,Qy) If imagepath1 = "C:\SB\LIN1.jpg" Then Shapes.Remove(image1) EndIf kopija[kop]=(image1) '********************* NATPIS ************************* GraphicsWindow.BrushColor = "Black" Shapes.Remove(PRIKAZ) PRIKAZ = Shapes.AddText("R z a r o t a c i j u") Shapes.Move(PRIKAZ, 400, 722) Sound.PlayMusic("O8 c32 d32e64") EndSub '**************** rotkop **************************** Sub rotkop ROT=ROT+90 Shapes.Rotate(image1,ROT) OB[1]="ROTIRA| GraphicsWindow.BrushColor = "Black" Shapes.Remove(PRIKAZ) PRIKAZ = Shapes.AddText("C z a k o p i r a nj e") Shapes.Move(PRIKAZ, 400, 722) Sound.PlayMusic("O8 c32 d32e64") EndSub Sub sveboje Shapes.Remove(NT[10]) NT[10]="LINIJA BOJA " nt() Program.Delay(100) boja[11 ]="IndianRed" boja[12 ]="LightCoral" boja[13 ]="Salmon" boja[14 ]="DarkSalmon" boja[15 ]="LightSalmon" boja[16 ]="Crimson" boja[17 ]="Red" boja[18 ]="FireBrick" boja[19 ]="DarkRed" boja[20 ]="Pink" boja[21 ]="LightPink" boja[22 ]="HotPink" boja[23 ]="DeepPink" boja[24 ]="MediumVioletRed" boja[25 ]="PaleVioletRed" boja[26 ]="LightSalmon" boja[27 ]="Coral" boja[28 ]="Tomato" boja[29 ]="OrangeRed" boja[30 ]="DarkOrange" boja[31 ]="Orange" boja[32 ]=" Gold" boja[33 ]="Yellow" boja[34 ]="LightYellow" boja[35 ]="LemonChiffon" boja[36 ]="LightGoldenrodYellow" boja[37 ]="PapayaWhip" boja[38 ]="Moccasin" boja[39 ]="PeachPuff" boja[40 ]="PaleGoldenrod" boja[41 ]="Khaki" boja[42 ]="DarkKhaki" boja[43 ]="Lavender" boja[44 ]="Thistle" boja[45 ]="Plum" boja[46 ]="Violet" boja[47 ]="Orchid" boja[48 ]="Fuchsia" boja[49 ]="Magenta" boja[50 ]="MediumOrchid" boja[51 ]="MediumPurple" boja[52 ]="BlueViolet" boja[53 ]="DarkViolet" boja[54 ]="DarkOrchid" boja[55 ]="DarkMagenta boja[56 ]="Purple" boja[57 ]="Indigo" boja[58 ]="SlateBlue" boja[59 ]="DarkSlateBlue" boja[60 ]="MediumSlateBlue" boja[61 ]="MediumSpringGreen" boja[62 ]="SpringGreen" boja[63 ]="MediumSeaGreen" boja[64 ]="SeaGreen" boja[65 ]="ForestGreen" boja[66 ]="Green" boja[67 ]="DarkGreen" boja[68 ]="YellowGreen" boja[69 ]="OliveDrab" boja[70 ]="Olive" boja[71 ]="DarkOliveGreen" boja[72 ]="MediumAquamarine" boja[73 ]="DarkSeaGreen" boja[74 ]="LightSeaGreen" boja[75 ]=" DarkCyan" boja[76 ]="Teal" boja[77 ]=" Aqua" boja[78 ]=" Cyan" boja[79 ]=" LightCyan" boja[80 ]="PaleTurquoise" boja[81 ]="Aquamarine" boja[82 ]="Turquoise" boja[83 ]=" MediumTurquoise" boja[84 ]=" DarkTurquoise" boja[85 ]="CadetBlue" boja[86 ]="SteelBlue" boja[87 ]="LightSteelBlue" boja[88 ]="PowderBlue" boja[89 ]="LightBlue" boja[90 ]="SkyBlue" boja[91 ]="GreenYellow" boja[92 ]="Chartreuse" boja[93 ]="LawnGreen" boja[94 ]="Lime" boja[95 ]="LimeGreen" boja[96 ]="PaleGreen" boja[97 ]="LightGreen" boja[98 ]="LightSkyBlue" boja[99 ]=" DeepSkyBlue" boja[100 ]="DodgerBlue" boja[101 ]="CornflowerBlue" boja[102 ]="MediumSlateBlue" boja[103 ]="RoyalBlue" boja[104 ]=" Blue" boja[105 ]="MediumBlue" boja[106 ]=" DarkBlue" boja[107 ]=" Navy" boja[108 ]="MidnightBlue" boja[109 ]=" White" boja[110 ]="Snow" boja[111 ]="Honeydew" boja[112 ]="MintCream" boja[113 ]="Azure" boja[114 ]="AliceBlue" boja[115 ]="GhostWhite" boja[116 ]="WhiteSmoke" boja[117 ]="Seashell" boja[118 ]="Beige" boja[119 ]="OldLace" boja[120 ]="FloralWhite" boja[121 ]="Ivory" boja[122 ]="AntiqueWhite" boja[123 ]="Linen" boja[124 ]="LavenderBlush" boja[125 ]="MistyRose" boja[126 ]="Cornsilk" boja[127 ]="BlanchedAlmond' boja[128 ]="Bisque" boja[129 ]="NavajoWhite" boja[130 ]="Wheat" boja[131 ]="BurlyWood" boja[132 ]="Tan" boja[133 ]="RosyBrown" boja[134 ]="SandyBrown" boja[134 ]="Goldenrod" boja[136 ]="DarkGoldenrod" boja[137 ]="Peru" boja[138 ]="Chocolate" boja[139 ]="SaddleBrown" boja[140 ]="Sienna" boja[141 ]="Brown" boja[142 ]="Maroon" boja[143 ]="Gainsboro" boja[144 ]="LightGray" boja[145 ]="Silver" boja[146 ]="DarkGray" boja[147 ]="Gray" boja[148 ]="DimGray" boja[149 ]="LightSlateGray" boja[150 ]="SlateGray" boja[151 ]="DarkSlateGray" boja[152 ]="Black" po=0 For gh = 11To 152 GraphicsWindow.brushcolor=boja[gh] po=po+8.5 GraphicsWindow.FillRectangle(88+po,100,20,20) 'GraphicsWindow.PenWidth=0 'boja[gh]=Shapes.AddRectangle(20,20) ' Shapes.move( boja[gh],100+po,100,) Endfor EndSub '******************************************************************************** Sub JN ' DA NE kont= kont+1 If kont>1 Then kont=0 EndIf FIKS=kont GraphicsWindow.BrushColor = "Black" Shapes.Remove(PRIKAZ1) PRIKAZ1 = Shapes.AddText( kont) Shapes.Move(PRIKAZ1, 300, 722) EndSub Sub kvadrat GraphicsWindow.FillRectangle(QX,QY, prevX-QX, prevY-Qy) QX=0 QY=0 prevX=0 prevY=0 EndSub Sub nt GraphicsWindow.FontSize = 18 GraphicsWindow.BrushColor ="Red" GraphicsWindow.FillRectangle(1100,25,200,28) GraphicsWindow.BrushColor ="Black" NT[10]= Shapes.AddText(NT[10]) Shapes.Move(NT[10], 1120, 25) EndSub End>GDW248.sb< Start>GDW511.sb< 'Tiro al blanco con arco y flechas 'jalpc November 2014 fps=50 data_() GraphicsWindow.Hide() form_() btns_() objs_() draws_() GraphicsWindow.Show() Controls.ButtonClicked=OnButtonClicked Timer.Tick=OnTick Timer.Interval=100 ' While "True" start = Clock.ElapsedMilliseconds' recoge hora entrada en loop update() delay = 1000/fps - (Clock.ElapsedMilliseconds - start)' retraso If (delay > 0) Then Program.Delay(delay) EndIf Endwhile ' Sub update If btnClick=btnName["End"] Then Program.End() EndIf If btnClick=btnName["Help"] Then showHelp() btnClick="" Goto EXIT_LOOP EndIf If btnClick=btnName["onOff"] And flag["onOff"]="off" Then flag["onOff"]="on" lightOn() Program.Delay(300) pm="opacity=100;" pm["text"]="Click START" msgMidScreen() btnClick="" Goto EXIT_LOOP EndIf If btnClick=btnName["onOff"] And flag["onOff"]="on" Then flag["onOff"]="off" flag["start"]="False" pm="0=hide;1=estate;2=bow;3=arrow;4=datboard;" hideShowObjects() initConstant() updateText() msgOff() Shapes.SetOpacity(object["pgOn"],0) btnClick="" Goto EXIT_LOOP EndIf If btnClick=btnName["start"] And flag["onOff"]="on" Then flag["start"]="True" pm="opacity=0;text=msg;" msgMidScreen() initDif() If datMove["lapDifYY"] < 4 Then datMove["lapDifYY"]=datMove["lapDifYY"]+1 ' Velocidad vertical dianas aumenta cada START Else datMove["lapDifYY"]=1 EndIf valueTimeFire = "time shot: "+0.1*(Math.Round(10*(Clock.ElapsedMilliseconds-contTimePlay)/1000))+" s" valueTimePlay = "time play: "+Math.Floor((Clock.ElapsedMilliseconds-contTimeStart)/1000)+ " s" shot["num"]=1 valResult=0 contTimeStart=Clock.ElapsedMilliseconds contTimePlay=contTimeStart pm="0=show;1=estate;2=bow;3=arrow;4=datboard;" hideShowObjects() updateText() btnClick="" Goto EXIT_LOOP EndIf If btnClick=btnName["up"] And flag["start"] And NOT[flag["fire"]] Then If datMove["lapY"] < 2 Then datMove["lapY"]=datMove["lapY"]+1 updateText() EndIf btnClick="" Goto EXIT_LOOP EndIf If btnClick=btnName["down"] And flag["start"] And NOT[flag["fire"]] Then If datMove["lapY"] > -2 Then datMove["lapY"]=datMove["lapY"]-1 updateText() EndIf btnClick="" Goto EXIT_LOOP EndIf If btnClick=btnName["left"] And flag["start"] And NOT[flag["fire"]] Then If x_LeftRight["posBow"] > x_LeftRight["lapMin"] Then difX_OLD=difX difX= -x_LeftRight[1] moveBow() moveArrow() difX=difX_OLD x_LeftRight["posBow"]=x_LeftRight["posBow"]-1 updateText() EndIf btnClick="" Goto EXIT_LOOP EndIf If btnClick=btnName["right"] And flag["start"] And NOT[flag["fire"]] Then If x_LeftRight["posBow"] < x_LeftRight["lapMax"] Then difX_OLD=difX difX= x_LeftRight[1] moveBow() moveArrow() difX=difX_OLD x_LeftRight["posBow"]=x_LeftRight["posBow"]+1 updateText() EndIf btnClick="" Goto EXIT_LOOP EndIf If btnClick=btnName["fire"] And flag["start"] Then flag["fire"]="True" savePosArrow() fireArrow() If flag["wrongShot"]="True" Then pm="opacity=100;" pm["text"]="Wrong !" msgMidScreen() Program.Delay(delay2) pm="opacity=0;text=msg;" msgMidScreen() contTimePlay=Clock.ElapsedMilliseconds flag["wrongShot"]="False" Program.Delay(delay2) restorePosArrow() increaseNumShot() initDif() datMove["moveUpDown"]="True" datMove["moveUpDown2"]="True" flag["fire"]="False" EndIf If flag["whiteTarget"] Then pm="opacity=100;" pm["text"]=errorSuccess[flag["datboardNum"]] msgMidScreen() Program.Delay(delay2) pm="opacity=0;text=msg;" msgMidScreen() valResult=valResult+(points[flag["datboardNum"]])*factMult[x_LeftRight["posBow"]] contTimePlay=Clock.ElapsedMilliseconds 'poner contador tiempo de tiro a cero updateText() Program.Delay(delay2) restorePosArrow() increaseNumShot() initDif() datMove["moveUpDown"]="True" datMove["moveUpDown2"]="True" flag["fire"]="False" flag["whiteTarget"]="False" EndIf btnClick="" Goto EXIT_LOOP EndIf If flag["start"] Then moveBowArrowUpDown() valueTimeFire = "time shot: "+0.1*(Math.Round(10*(Clock.ElapsedMilliseconds-contTimePlay)/1000))+" s" valueTimePlay = "time play: "+Math.Floor((Clock.ElapsedMilliseconds-contTimeStart)/1000)+ " s" updateText() EndIf If flag["start"] And NOT[flag["fire"]] Then moveDatboardUpDown() EndIf EXIT_LOOP: EndSub Sub OnButtonClicked btnClick=Controls.LastClickedButton EndSub Sub OnTick If dat["HelpMsg"] Then dat["contLapMsg"]=dat["contLapMsg"]+1 If dat["contLapMsg"] >= 80 Then dat["contLapMsg"]=0 hideHelp() EndIf EndIf EndSub Sub form_ GraphicsWindow.BackgroundColor="LightBlue" GraphicsWindow.Width=dim["pgW"] GraphicsWindow.Height=dim["pgH"] GraphicsWindow.Top=dim["pgTop"] GraphicsWindow.Left=dim["pgLeft"] GraphicsWindow.CanResize="False" GraphicsWindow.Title=dat["title"] EndSub Sub btns_ For bt=1 To Array.GetItemCount(btn) pm=btn[bt] pmFormat() n=Array.GetItemCount(numBtn)+1 numBtn[n]=Controls.AddButton(pm["caption"],pm["x"],pm["y"]) Shapes.SetOpacity(numBtn[n],pm["opacity"]) Controls.SetSize(numBtn[n],pm["w"],pm["h"]) If pm["rotate"] = 90 Or pm["rotate"] = -90 Then Shapes.Rotate(numBtn[n],pm["rotate"]) EndIf If pm["hide"]="True" Then Controls.HideControl(numBtn[n]) EndIf btnName[pm["name"]]=numBtn[n] pm="" EndFor EndSub Sub draws_ arrayTemp=draW typeObject="draw" loopIndex() EndSub Sub objs_ arrayTemp=shap typeObject="shap" loopIndex() EndSub Sub loopIndex listIndex1=Array.GetAllIndices(arrayTemp) For index1 = 1 To Array.GetItemCount(listIndex1) listIndex2=Array.GetAllIndices(arrayTemp[listIndex1[index1]]) For index2= 1 To Array.GetItemCount(listIndex2) pm=arrayTemp[listIndex1[index1]][listIndex2[index2]] If typeObject = "draw" Then genDraw() Else genObject() EndIf pm="" EndFor EndFor arrayTemp="" EndSub Sub genObject pmFormat() If pm["type"]="Ellipse" Then object[pm["name"]]= Shapes.AddEllipse(pm["w"],pm["h"]) Shapes.SetOpacity(object[pm["name"]],pm["opacity"]) Shapes.Move(object[pm["name"]],pm["x"],pm["y"]) If pm["hide"]="True" Then Shapes.HideShape(object[pm["name"]]) EndIf EndIf If pm["type"]="Triangle" Then object[pm["name"]]= Shapes.AddTriangle(pm["x1"],pm["y1"],pm["x2"],pm["y2"],pm["x3"],pm["y3"]) Shapes.SetOpacity(object[pm["name"]],pm["opacity"]) If pm["hide"]="True" Then Shapes.HideShape(object[pm["name"]]) EndIf EndIf If pm["type"]="Rectangle" Then object[pm["name"]]= Shapes.AddRectangle(pm["w"],pm["h"]) Shapes.SetOpacity(object[pm["name"]],pm["opacity"]) Shapes.Move(object[pm["name"]],pm["x"],pm["y"]) If pm["hide"]="True" Then Shapes.HideShape(object[pm["name"]]) EndIf EndIf If pm["type"]="Text" Then object[pm["name"]]= Shapes.AddText(pm["text"]) Shapes.SetOpacity(object[pm["name"]],pm["opacity"]) Shapes.Move(object[pm["name"]],pm["x"],pm["y"]) If pm["hide"]="True" Then Shapes.HideShape(object[pm["name"]]) EndIf EndIf EndSub Sub genDraw pmFormat() If pm["type"]="drawRect" Then GraphicsWindow.DrawRectangle(pm["x"],pm["y"],pm["w"],pm["h"]) EndIf If pm["type"]="fillRect" Then GraphicsWindow.FillRectangle(pm["x"],pm["y"],pm["w"],pm["h"]) EndIf If pm["type"]="drawText" Then GraphicsWindow.DrawBoundText(pm["x"],pm["y"],pm["w"],pm["value"]) EndIf EndSub Sub pmFormat If pm["color"] <> "" Then GraphicsWindow.BrushColor=pm["color"] EndIf If pm["penColor"] <> "" Then GraphicsWindow.PenColor=pm["penColor"] EndIf If pm["penSize"] <> "" Then GraphicsWindow.PenWidth=pm["penSize"] EndIf If pm["fontSize"] <> "" Then GraphicsWindow.FontSize=pm["fontSize"] EndIf If pm["fontName"] <> "" Then GraphicsWindow.FontName=pm["fontName"] EndIf EndSub Sub showHelp dat["HelpMsg"]="True" For k =1 to Array.GetItemCount(shap["msg"]) Shapes.ShowShape(object["msg"+k]) Shapes.SetOpacity(object["msg"+k],100) EndFor EndSub Sub hideHelp dat["HelpMsg"]="False" For k =1 to Array.GetItemCount(shap["msg"]) Shapes.HideShape(object["msg"+k]) Shapes.SetOpacity(object["msg"+k],0) EndFor EndSub Sub moveDatboardLR If Math.Remainder(datMove["lapDifYY"],2)=0 Then contXX =contXX +1 If contXX <=20 Then datMove["difXX"]=1 EndIf If contXX > 20 And contXX <=40 Then datMove["difXX"]=-1 EndIf If contXX = 40 Then contXX=0 EndIf EndIf EndSub Sub moveDatboardUpDown moveDatboardLR() If datMove["moveUpDown2"]="True" Then If shap["datboard"][1]["y"]< (datMove["y_Max"]-20) Then difYY=-datMove["lapDifYY"] MoveDatboard() Else datMove["moveUpDown2"]="False" difYY=0 Goto EXIT_DatboardUpDown EndIf EndIf If datMove["moveUpDown2"]="False" Then If shap["datboard"][1]["y"] > (datMove["y_Min"]-20)Then difYY=datMove["lapDifYY"] MoveDatboard() Else datMove["moveUpDown2"]="True" difY=0 Goto EXIT_DatboardUpDown EndIf EndIf EXIT_DatboardUpDown: EndSub Sub moveBowArrowUpDown If datMove["moveUpDown"]="True" Then If shap["bow"][1]["y"]> datMove["y_Min"] Then difY=-2-datMove["lapY"] If NOT[flag["fire"]] Then moveBow() MoveArrow() EndIf Else datMove["moveUpDown"]="False" difY=0 Goto EXIT_MoveBowAndArrow EndIf EndIf If datMove["moveUpDown"]="False" Then If shap["bow"][1]["y"] < datMove["y_Max"] Then difY=2 +datMove["lapY"] If NOT[flag["fire"]] Then moveBow() MoveArrow() EndIf Else datMove["moveUpDown"]="True" difY=0 Goto EXIT_MoveBowAndArrow EndIf EndIf EXIT_MoveBowAndArrow: EndSub Sub fireArrow If shap["arrow"][1]["x"] < datMove["x_Max"] Then While shap["arrow"][1]["x"] < datMove["x_Max"] difX=1 difY=0 MoveArrow() collision() If flag["whiteTarget"] Then Goto EXIT_fireArrow EndIf EndWhile EndIf If shap["arrow"][1]["x"] = datMove["x_Max"] Then flag["wrongShot"]="True" EndIf EXIT_fireArrow: EndSub Sub moveBow For nS=1 To Array.GetItemCount(shap["bow"]) shap["bow"][nS]["x"]=shap["bow"][nS]["x"] + difX shap["bow"][nS]["y"]=shap["bow"][nS]["y"] + difY x=shap["bow"][nS]["x"] y=shap["bow"][nS]["y"] Shapes.Move(object[shap["bow"][nS]["name"]],x,y) EndFor EndSub Sub moveArrow For nS=1 To Array.GetItemCount(shap["arrow"]) shap["arrow"][nS]["x"]=shap["arrow"][nS]["x"] + difX shap["arrow"][nS]["y"]=shap["arrow"][nS]["y"] + difY x=shap["arrow"][nS]["x"] y=shap["arrow"][nS]["y"] Shapes.Move(object[shap["arrow"][nS]["name"]],x,y) EndFor EndSub Sub collision getArrowX=Shapes.GetLeft(object["arrow1"]) getArrowY=Shapes.GetTop(object["arrow1"]) centArrowRightX=getArrowX+shap["arrow"][1]["w"] centArrowRightY=getArrowY For nSDatBoard =1 To Array.GetItemCount(shap["datboard"]) getDatboardX[nSDatBoard]=Shapes.GetLeft(object[shap["datboard"][nSDatBoard]["name"]]) getDatboardY[nSDatBoard]=Shapes.GetTop(object[shap["datboard"][nSDatBoard]["name"]]) xIniDatboard=getDatboardX[nSDatBoard] xFinDatboard=getDatboardX[nSDatBoard]+shap["datboard"][nSDatBoard]["w"] xMedDatboard=xIniDatboard+shap["datboard"][nSDatBoard]["w"]/2 yIniDatboard=getDatboardY[nSDatBoard] yFinDatboard=getDatboardY[nSDatBoard]+shap["datboard"][nSDatBoard]["h"] If centArrowRightX>=xIniDatboard And centArrowRightX <=xFinDatboard Then If centArrowRightY>=yIniDatboard And centArrowRightY <= yFinDatboard Then If centArrowRightX = xMedDatboard Then flag["datboardNum"]=nSDatBoard flag["whiteTarget"]="True" EndIf EndIf EndIf EndFor EndSub Sub MoveDatboard For nS2=1 To Array.GetItemCount(shap["datboard"]) shap["datboard"][nS2]["y"]=shap["datboard"][nS2]["y"]-difYY shap["datboard"][nS2]["x"]=shap["datboard"][nS2]["x"]-datMove["difXX"] x=shap["datboard"][nS2]["x"] y=shap["datboard"][nS2]["y"] Shapes.Move(object[shap["datboard"][nS2]["name"]],x,y) EndFor EndSub Sub lightOn light="True" For light=1 To 10 Shapes.SetOpacity(object["pgOn"],light*10) pm="opacity=100;text=msg;" pm["text"]="WAIT: "+(10-light) msgMidScreen() Program.Delay(100) EndFor light="False" pm="opacity=0;text=;" msgMidScreen() Program.Delay(200) EndSub Sub msgMidScreen If light Then Shapes.SetOpacity(object["rectMsg"],light*10) Else Shapes.SetOpacity(object["rectMsg"],pm["opacity"]) EndIf Shapes.SetOpacity(object["textMsg"],pm["opacity"]) Shapes.SetText(object["textMsg"],pm["text"]) pm="" EndSub Sub hideShowObjects For item = 1 To Array.GetItemCount(pm) For num = 1 To Array.GetItemCount(shap[pm[item]]) If pm[0]="hide" Then Shapes.HideShape(object[shap[pm[item]][num]["name"]]) EndIf If pm[0]="show" Then Shapes.ShowShape(object[shap[pm[item]][num]["name"]]) EndIf EndFor EndFor pm="" EndSub Sub initConstant datMove["lapDifYY"]=0 datMove["lapY"]=0 valueTimeFire = "time shot: "+0.1*(Math.Round(10*(Clock.ElapsedMilliseconds-contTimePlay)/1000))+" s" valueTimePlay = "time play: "+Math.Floor((Clock.ElapsedMilliseconds-contTimeStart)/1000)+ " s" shot["num"]=1 valResult=0 EndSub Sub updateText Shapes.SetText(object["timeFire"],valueTimeFire) Shapes.SetText(object["timePlay"],valueTimePlay) Shapes.SetText(object["numShot"],"num.Shot: "+shot["num"]) Shapes.SetText(object["result"],"result: "+valResult) Shapes.SetText(object["multPoint"], "points X"+factMult[x_LeftRight["posBow"]]) Shapes.SetText(object["speedD"],"speed X"+datMove["lapDifYY"]) Shapes.SetText(object["speedA"],"speed X"+(datMove["lapY"]+2)) EndSub Sub savePOsArrow For num= 1 to Array.GetItemCount(shap["arrow"]) arrowOLD_X[num]=Shapes.GetLeft(object[shap["arrow"][num]["name"]]) arrowOLD_Y[num]=Shapes.GetTop(object[shap["arrow"][num]["name"]]) EndFor EndSub Sub restorePosArrow For num= 1 to Array.GetItemCount(shap["arrow"]) shap["arrow"][num]["x"]=arrowOLD_X[num] shap["arrow"][num]["y"]=arrowOLD_Y[num] Shapes.Move(object[shap["arrow"][num]["name"]],arrowOLD_X[num],arrowOLD_Y[num]) EndFor EndSub Sub initDif difX=0 difY=0 datMove["difXX"]=0 difYY=0 EndSub Sub increaseNumShot If shot["num"] < shot["Max"] Then shot["num"]=shot["num"]+1 updateText() Else pm="opacity=100;" pm["text"]="GAME OVER" msgMidScreen() Program.Delay(delay2*2) pm="opacity=100;" pm["text"]="Click START" msgMidScreen() flag["start"]="False" EndIf EndSub Sub msgOff pm="opacity=0;text=msg;" msgMidScreen() EndSub Sub data_ dim="pgW=450;pgH=450;pgLeft=50;pgTop=30;" delay2=400 dat="title=target shooting;HelpMsg=False;contLapMsg=0;" flag="onOff=off;start=False;fire=False;whiteTarget=False;datboardNum=0;wrongShot=False" shot="num=1;Max=5;" errorSuccess="1=apple !!!!;2=head ?;3=neck ?;4=body ?;5=legs ?;6=feet ?;" points="1=100;2=-50;3=-30;4=-20;5=-10;6=-5;" NOT="True=False;False=True;" datMove="lapY=0;lapX=0;y_Min=70;y_Max=250;x_Min=40;x_Max=363;difXX=0;lapDifYY=0;moveUpDown=True;moveUpDown2=True;" x_LeftRight="1=50;posBow=1;lapMax=5;lapMin=1;" factMult="1=40;2=20;3=10;4=5;5=1;" btn[1]="color=Red;fontSize=12;x=20;y=410;w=50;h=30;caption=Help;opacity=100;name=Help;" btn[2]="color=Black;fontSize=12;x=380;y=410;w=50;h=30;caption=END;opacity=100;name=End;" btn[3]="color=Maroon;fontSize=12;x=42;y=340;w=30;h=30;caption=<;opacity=70;name=left;" btn[4]="color=Maroon;fontSize=12;x=75;y=328;w=30;h=30;caption=+;opacity=70;name=up;" btn[5]="color=Maroon;fontSize=12;x=75;y=362;w=30;h=30;caption=-;opacity=70;name=down;" btn[6]="color=Maroon;fontSize=12;x=110;y=340;w=30;h=30;caption=>;opacity=70;name=right;" btn[7]="color=Red;fontSize=12;x=150;y=340;w=40;h=30;caption=>>;opacity=70;name=fire;" btn[8]="color=Green;fontSize=12;x=290;y=340;w=50;h=30;caption=START;opacity=70;name=start;" btn[9]="color=Red;fontSize=12;x=350;y=340;w=50;h=30;caption=On/Off;opacity=70;name=onOff;" shap["pgOn"][1]="type=Rectangle;color=Aquamarine;penColor=Aquamarine;x=40;y=40;w=360;h=280;opacity=0;name=pgOn" shap["bow"][1]="type=Ellipse;hide=True;color=Aquamarine;penColor=Black;penSize=4;x=65;y=152;w=20;h=50;opacity=100;name=bow1;" shap["bow"][2]="type=Rectangle;hide=True;color=Aquamarine;penColor=Aquamarine;penSize=4;x=53;y=152;w=20;h=50;opacity=100;name=bow2;" shap["bow"][3]="type=Rectangle;hide=True;color=DimGray;penColor=DimGray;penSize=2;x=72;y=152;w=2;h=50;opacity=100;name=bow3;" shap["bow"][4]="type=Ellipse;hide=True;color=Aquamarine;penColor=Black;penSize=3;x=55;y=150;w=16;h=16;opacity=100;name=bow4;" shap["bow"][5]="type=Rectangle;hide=True;color=Aquamarine;penColor=Black;penSize=2;x=60;y=166;w=4;h=20;opacity=100;name=bow5;" shap["bow"][6]="type=Rectangle;hide=True;color=Aquamarine;penColor=Black;penSize=3;x=58;y=170;w=10;h=25;opacity=100;name=bow6;" shap["bow"][7]="type=Rectangle;hide=True;color=Aquamarine;penColor=Black;penSize=2;x=60;y=195;w=4;h=15;opacity=100;name=bow7;" shap["bow"][8]="type=Rectangle;hide=True;color=Aquamarine;penColor=Black;penSize=2;x=60;y=210;w=7;h=4;opacity=100;name=bow8;" shap["bow"][9]="type=Rectangle;hide=True;color=Black;penColor=Black;penSize=3;x=63;y=178;w=20;h=4;opacity=100;name=bow9;" shap["estate"][1]="type=Text;hide=True;color=DarkSlateGray;fontSize=12;x=50;y=45;text=shot;opacity=100;name=timeFire;" shap["estate"][2]="type=Text;hide=True;color=DarkSlateGray;fontSize=12;x=50;y=300;text=play;opacity=100;name=timePlay;" shap["estate"][3]="type=Text;hide=True;color=DarkSlateGray;fontSize=12;x=180;y=300;text=num.Shot;opacity=100;name=numShot;" shap["estate"][4]="type=Text;hide=True;color=DarkSlateGray;fontSize=12;x=300;y=300;text=points X40;opacity=100;name=multPoint;" shap["estate"][5]="type=Text;hide=True;color=DarkSlateGray;fontSize=12;x=175;y=45;text=result:;opacity=100;name=result;" shap["estate"][6]="type=Text;hide=True;color=DarkSlateGray;fontSize=12;x=260;y=45;text=speed;opacity=100;name=speedA;" shap["estate"][7]="type=Text;hide=True;color=DarkSlateGray;fontSize=12;x=330;y=45;text=speed;opacity=100;name=speedD;" shap["datboard"][1]="type=Ellipse;hide=True;color=Black;penColor=Black;penSize=3;x=364;y=137;w=12;h=12;opacity=100;name=dartboard1;" shap["datboard"][2]="type=Ellipse;hide=True;color=Aquamarine;penColor=Black;penSize=3;x=362;y=150;w=16;h=16;opacity=100;name=dartboard2;" shap["datboard"][3]="type=Rectangle;hide=True;color=Aquamarine;penColor=Black;penSize=2;x=368;y=166;w=4;h=20;opacity=100;name=dartboard3;" shap["datboard"][4]="type=Rectangle;hide=True;color=Aquamarine;penColor=Black;penSize=3;x=365;y=170;w=10;h=25;opacity=100;name=dartboard4;" shap["datboard"][5]="type=Rectangle;hide=True;color=Aquamarine;penColor=Black;penSize=2;x=369;y=195;w=4;h=15;opacity=100;name=dartboard5;" shap["datboard"][6]="type=Rectangle;hide=True;color=Aquamarine;penColor=Black;penSize=2;x=366;y=210;w=7;h=4;opacity=100;name=dartboard6;" shap["arrow"][1]="type=Rectangle;hide=True;color=Black;penColor=Black;penSize=3;x=73;y=173;w=30;h=4;opacity=100;name=arrow1;" shap["arrow"][2]="type=Text;hide=True;color=Black;fontSize=25;x=94;y=158;text=>;opacity=100;name=arrow2;" shap["msg"][1]="type=Ellipse;hide=True;color=Gold;penColor=Gold;x=38;y=313;w=290;h=90;opacity=0;name=msg1;" shap["msg"][2]="type=Triangle;hide=True;color=Gold;penColor=Gold;x1=67;y1=417;x2=83;y2=390;x3=142;y3=400;opacity=0;name=msg2;" shap["msg"][3]="type=Triangle;hide=True;color=Yellow;penColor=Yellow;x1=64;y1=414;x2=80;y2=387;x3=139;y3=397;opacity=0;name=msg3;" shap["msg"][4]="type=Ellipse;hide=True;color=Yellow;penColor=Yellow;x=35;y=310;w=290;h=90;opacity=0;name=msg4;" shap["msg"][5]="type=Text;hide=True;color=Red;fontSize=12;x=95;y=327;text=1.Click on/off And Click Start;opacity=0;name=msg5;" shap["msg"][6]="type=Text;hide=True;color=Red;fontSize=12;x=95;y=347;text=2.+/- change speed;opacity=0;name=msg6;" shap["msg"][7]="type=Text;hide=True;color=Red;fontSize=12;x=95;y=367;text=3.Left/Right change distance;opacity=0;name=msg7;" shap["textMsg"][1]="type=Rectangle;color=Aquamarine;penColor=Black;penSize=3;x=130;y=150;w=180;h=50;opacity=0;name=rectMsg;" shap["textMsg"][2]="type=Text;color=Black;fontSize=24;x=150;y=160;text=WAIT:;opacity=0;name=textMsg;" draw["box"][1]="type=fillRect;color=Gray;x=25;y=20;w=400;h=385;" draw["box"][2]="type=fillRect;color=OrangeRed;x=20;y=15;w=400;h=385;" draw["box"][3]="type=drawRect;penColor=Black;penSize=3;x=20;y=15;w=400;h=385;" draw["box"][4]="type=fillRect;color=DarkSlateGray;x=40;y=40;w=360;h=280;"'pg off draw["box"][5]="type=drawRect;penColor=Black;penSize=3;x=40;y=40;w=360;h=280;" If Text.GetLength(GraphicsWindow.GetPixel(0, 0)) = 9 Then shap["arrow"][2]="type=Text;hide=True;color=Black;fontSize=25;x=94;y=155;text=>;opacity=100;name=arrow2;" EndIf EndSub End>GDW511.sb< Start>GDW561.sb< numObject = 5 For i = 1 To numObject objectX[i] = 100 + Math.GetRandomNumber(200) objectY[i] = 100 + Math.GetRandomNumber(200) objectW[i] = 50 objectH[i] = 20 object[i] = Shapes.AddRectangle(objectW[i],objectH[i]) Shapes.Move(object[i],objectX[i],objectY[i]) objectMoving[i] = 0 EndFor GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseUp = OnMouseUp While ("True") For i = 1 To numObject If (objectMoving[i] = 1) Then objectX[i] = GraphicsWindow.MouseX - objectW[i]/2 'Top left point of shape objectY[i] = GraphicsWindow.MouseY - objectH[i]/2 Shapes.Move(object[i],objectX[i],objectY[i]) EndIf EndFor Program.Delay(50) EndWhile Sub OnMouseDown xM = GraphicsWindow.MouseX YM = GraphicsWindow.MouseY For i = 1 To numObject If (xM >= objectX[i] And xM <= objectX[i]+objectW[i] And yM >= objectY[i] And yM <= objectY[i]+objectH[i]) Then objectMoving[i] = 1 EndIf EndFor EndSub Sub OnMouseUp For i = 1 To numObject objectMoving[i] = 0 EndFor EndSub End>GDW561.sb< Start>GFD754.sb< lsl=1 cll=5 LDTextWindow.KeyDown=kkk st[2]="sun rdr="true While 1=1 If rdr Then rdr="false sq=LDDictionary.GetDefinition(st[lsl+1]) ss="" For f=1 To Text.GetLength(sq) cc=Text.GetSubText(sq f 1) dd=Text.GetCharacterCode(cc) If dd>=32 and dd<127 Then ss=ss+cc ElseIf dd=13 or dd=10 Then ss=ss+" " Else ss=ss+"@" EndIf EndFor ss=LDText.Replace(ss "," "_") ss=LDText.Replace(ss ".@" " ") ss=LDText.Replace(ss "@" "") ct=text.GetSubText( ss 1 990) While Text.GetIndexOf(ct "[")>0 p=Text.GetIndexOf(ct "[") If p>0 Then q=Text.GetIndexOf(ct "]") ct=Text.GetSubText(ct 1 p-1)+Text.GetSubTextToEnd(ct q+1) EndIf EndWhile st=LDText.Split(ct " ") ii=1 mk=Array.GetItemCount(st)-1 jj=38 lsl=1 cll=5 TextWindow.Clear() drww() ii=39 jj=76 lsl=-1 cll=35 drww() ii=77 jj=ii+37 lsl=-1 cll=70 drww() ii=1 jj=38 lsl=1 cll=5 EndIf EndWhile Sub kkk lk= LDTextWindow.LastKey If lk="Up" Then lsl=lsl-1 If lsl<1 Then lsl=1 EndIf ElseIf lk="Return" Then rdr="true ElseIf lk="Down" Then lsl=lsl+1 If lsl>mk Then lsl=mk EndIf EndIf drww() EndSub Sub drww TextWindow.CursorLeft=cll TextWindow.CursorTop=3 For f=ii To jj mm=Math.Max(mm Text.GetLength(st[f])) EndFor TextWindow.ForegroundColor="cyan" ln=Text.GetSubText("╔════════════════════════════════════════════════" 1 mm+3) TextWindow.CursorLeft=cll TextWindow.BackgroundColor="blue" TextWindow.WriteLine(ln+"╗") TextWindow.CursorLeft=cll ln=Text.GetSubText(text.ConvertToUpperCase (st[1])+" " 1 mm)+" ║" TextWindow.Write("║ "+ln) TextWindow.BackgroundColor="black" TextWindow.WriteLine("▒") TextWindow.BackgroundColor="blue" ln=Text.GetSubText("��────────────────────────────────────────────────" 1 mm+3) TextWindow.CursorLeft=cll TextWindow.Write(ln+"╢") TextWindow.BackgroundColor="black" TextWindow.WriteLine("▒") For f=ii To jj TextWindow.CursorLeft=cll TextWindow.BackgroundColor="blue" TextWindow.Write("║ ") If f-ii=lsl Then TextWindow.BackgroundColor="yellow" textWindow.ForegroundColor="black" Else TextWindow.ForegroundColor="cyan" EndIf TextWindow.Write(Text.GetSubText(ldtext.Replace( st[f] "_" " ")+" " 1 mm)) TextWindow.BackgroundColor="blue" TextWindow.ForegroundColor="cyan" TextWindow.Write(" ║") TextWindow.BackgroundColor="black" TextWindow.WriteLine("▒") EndFor ln=Text.GetSubText("╚════════════════════════════════════════════════" 1 mm+3) TextWindow.CursorLeft=cll TextWindow.BackgroundColor="blue" TextWindow.Write(ln+"╝") TextWindow.BackgroundColor="black" TextWindow.WriteLine("▒") ln=Text.GetSubText("▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒" 1 mm+3) TextWindow.CursorLeft=cll TextWindow.WriteLine(" "+ln) EndSub End>GFD754.sb< Start>GFF236.sb< M="G2 A8 G4 E1 N="A2 A4 +C2 B8 A4 NN="M M +D2 +D4 B1 +C2 +C4 G1 / N M N M +D2 +D4 +F2 +D8 B4 +C1 +E1 / +C4 G4 E4 G2 F8 D4 C1 NN=ldtext.Replace (NN "M" m) NN=ldtext.Replace (NN "N" n) nt=ldtext.Split (NN " ") graphicsWindow.BackgroundColor ="darkblue For x=1 to 10 GraphicsWindow.Title="Wait... "+(11-x) ig[x]=ImageList.LoadImage (Flickr.GetRandomPicture ("Winter")) LDImage.EffectGamma (ig[x] 2.5) LDImage.EffectSnow (ig[x] 10) endfor drwimg() GraphicsWindow.Title="Silent night... sub drwimg img=ig[Math.GetRandomNumber (10)] ww= GraphicsWindow.Width/ImageList.GetWidthOfImage(img) GraphicsWindow.DrawResizedImage (img 0 0 GraphicsWindow.Width ImageList.GetHeightOfImage (img)*ww) endsub 'Goto tt For x=1 To Array.GetItemCount (nt) xnot() 'extract single note If no="/" Then else ll=Text.GetSubTextToEnd (nt[x] Text.GetLength (nt[x])) 'TextWindow .WriteLine (nt[x]+":"+ll) pp=2500/ll LDMusic.Instrument = LDMusic.Acoustic_Grand_Piano pn=LDMusic.PlayNote (oo no 1) LDMusic.Instrument=53 pn1=LDMusic.PlayNote (oo+1 no 1) LDMusic.Instrument=15 pn11=LDMusic.PlayNote (oo-1 no 1) Program.Delay(pp) LDMusic.EndNote (pn) LDMusic.EndNote (pn1) LDMusic.EndNote (pn11) If Math.Remainder (x 7)=0 then GraphicsWindow.Clear () GraphicsWindow.BackgroundColor ="darkblue drwimg() endif endif EndFor tt: in=ldtext.Split ("20'33'35'44'52'43'55'80'83'95'79'76" "'") While "true LDMusic.Instrument=in[Math.GetRandomNumber (Array.GetItemCount (in))] For x=1 To Array.GetItemCount (nt) xnot() If no="/" Then else ll=Text.GetSubTextToEnd (nt[x] Text.GetLength (nt[x])) 'TextWindow .WriteLine (nt[x]+":"+ll) pp=1250/ll pn=LDMusic.PlayNote (oo no 1) Program.Delay(pp) LDMusic.EndNote (pn) If Math.Remainder (x 7)=0 then GraphicsWindow.Clear () GraphicsWindow.BackgroundColor ="darkblue drwimg() endif endif endfor endwhile Sub xnot oo=4 If Text.StartsWith (nt[x] "+") Then oo=oo+1 no=text.GetSubText (nt[x] 2 1) Else no=text.GetSubText (nt[x] 1 1) endif EndSub End>GFF236.sb< Start>GFG649.sb< '2014.10.1 开始制作 '更新步骤: GraphicsWindow.Width=700 GraphicsWindow.Height=530 GraphicsWindow.Left=(Desktop.Width-GraphicsWindow.Width)/2-50 GraphicsWindow.Top=(Desktop.Height-GraphicsWindow.Height)/2-50 GraphicsWindow.Title="Island Craft" Controls.ButtonClicked=buttonclicked GraphicsWindow.KeyDown=keydown GraphicsWindow.MouseDown=mousedown screen=1 check=1 gameload=0 path="E:\Island Craft1" '默认打开方式 标准:E:\Island Craft1 , E:\编程\LOCK\LOCK2\lock\文件\Island Craft1 baginformation() typerinformation() drawscreen() worldwidth=100 worldlength=worldwidth Sub drawscreen If screen=1 Then GraphicsWindow.Clear() GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=36 GraphicsWindow.DrawText(50,50,"Island Craft岛屿生存") GraphicsWindow.FontSize=25 GraphicsWindow.DrawText(50,165,"输入存档路径:") enterkeypath=Controls.AddTextBox(50,200) Controls.SetSize(enterkeypath,500,40) Controls.SetTextBoxText(enterkeypath,path) startplaygame=Controls.AddButton("PLAY",580,200) Controls.SetSize(startplaygame,80,40) ElseIf screen=2 Then GraphicsWindow.Clear() firstgameload=0 GraphicsWindow.DrawText(200,150,"第一次进入此存档需要加载") GraphicsWindow.DrawText(280,190,"请耐心等候") showfirstgameload=Shapes.AddText("已加载"+firstgameload+"%") Shapes.Move(showfirstgameload,270,230) mex=Math.Floor(worldwidth/2)+1 mey=Math.Floor(worldlength/2)+1 For i=1 To worldlength For j=1 To worldwidth If i=mex And j=mey Then thing[i][j]=120 ElseIf i=mex-1 And j=mey Then thing[i][j]=120 ElseIf i=mex-2 And j=mey Then thing[i][j]=120 Else thing[i][j]=Math.GetRandomNumber(120) EndIf ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,(i-1)*worldwidth+j+1,thing[i][j]) firstgameload=Math.Round((i*100+j)/worldlength-1)/2 Shapes.SetText(showfirstgameload,"已加载"+firstgameload+"%") EndFor EndFor For i=1 To allcheck ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+1+i,0) firstgameload=50+Math.Round(50/allcheck)*i-1 Shapes.SetText(showfirstgameload,"已加载"+firstgameload+"%") EndFor For i=1 To 6 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+1+allcheck+i,0) EndFor ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+8+allcheck,1) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+9+allcheck,mex) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+10+allcheck,mey) For i=1 To 12 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+10+allcheck+i,0) EndFor ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+23+allcheck,10) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+24+allcheck,10) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+25+allcheck,0) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+26+allcheck,0) firstgameload=100 Shapes.SetText(showfirstgameload,"已加载"+firstgameload+"%") screen=4 drawscreen() ElseIf screen=3 Then GraphicsWindow.Clear() willgetthing=0 gameload=0 GraphicsWindow.PenWidth=4 GraphicsWindow.DrawLine(0,451,700,451) GraphicsWindow.DrawLine(451,0,451,451) GraphicsWindow.PenWidth=4 GraphicsWindow.FontSize=14 GraphicsWindow.BrushColor="Black" seesight=Shapes.AddRectangle(450,450) exchangerdaytime=daytime-200 If exchangerdaytime>0 Then exchangerdaytime=Math.Abs(exchangerdaytime-100)/10*9 Else exchangerdaytime=90 EndIf Shapes.SetOpacity(seesight,90-exchangerdaytime) For i=1 To 6 If holdeasybag=i Then GraphicsWindow.PenColor="Red" showholdeasybag1=Shapes.AddRectangle(2,40) showholdeasybag2=Shapes.AddRectangle(2,40) showholdeasybag3=Shapes.AddRectangle(60,2) showholdeasybag4=Shapes.AddRectangle(60,2) Shapes.Move(showholdeasybag1,19+(i-1)*70,486) Shapes.Move(showholdeasybag2,80+(i-1)*70,486) Shapes.Move(showholdeasybag3,20+(i-1)*70,485) Shapes.Move(showholdeasybag4,20+(i-1)*70,526) GraphicsWindow.PenColor="Black" EndIf GraphicsWindow.DrawRectangle(20+(i-1)*70,486,60,40) GraphicsWindow.DrawText(22+(i-1)*70,486,bagthing[easybag[i]]) GraphicsWindow.DrawText(22+(i-1)*70,506,"x"+bagnum[easybag[i]]) EndFor GraphicsWindow.PenWidth=2 GraphicsWindow.FontSize=22 GraphicsWindow.DrawText(10,456,"血量值:"+exchangerblood[blood]) GraphicsWindow.DrawText(300,456,"饥饿值:"+exchangerhung[hunger]) For i=mex-4 To mex+4 For j=mey-4 To mey+4 instead=thing[i][j] If instead<=18 Then '水 GraphicsWindow.BrushColor="CornFlowerBlue" GraphicsWindow.FillRectangle((i-mex+4)*50,(j-mey+4)*50,50,50) Else GraphicsWindow.BrushColor="ForestGreen" GraphicsWindow.FillRectangle((i-mex+4)*50,(j-mey+4)*50,50,50) EndIf If instead>18 And instead<=28 Then '树木 GraphicsWindow.BrushColor="DarkGreen" GraphicsWindow.FillRectangle((i-mex+4)*50+12.5,(j-mey+4)*50,25,50) GraphicsWindow.FillRectangle((i-mex+4)*50,(j-mey+4)*50+12.5,50,25) ElseIf instead>30 And instead<=35 Then '石头 GraphicsWindow.BrushColor="Gray" GraphicsWindow.FillRectangle((i-mex+4)*50+15,(j-mey+4)*50+15,20,20) ElseIf instead=30 Then '蘑菇 GraphicsWindow.BrushColor="Purple" GraphicsWindow.FillEllipse((i-mex+4)*50+19,(j-mey+4)*50+12,12,12) GraphicsWindow.FillRectangle((i-mex+4)*50+21.5,(j-mey+4)*50+22,7,10) ElseIf instead=29 Then '南瓜 GraphicsWindow.BrushColor="Gold" GraphicsWindow.FillRectangle((i-mex+4)*50+20,(j-mey+4)*50+15,10,8) GraphicsWindow.FillEllipse((i-mex+4)*50+15,(j-mey+4)*50+22,20,20) ElseIf instead=46 Then '猪 GraphicsWindow.BrushColor="PeachPuff" GraphicsWindow.FillRectangle((i-mex+4)*50+18,(j-mey+4)*50+10,14,20) GraphicsWindow.FillRectangle((i-mex+4)*50+21,(j-mey+4)*50+30,8,8) ElseIf instead=47 Then '牛 GraphicsWindow.BrushColor="Peru" GraphicsWindow.FillRectangle((i-mex+4)*50+18,(j-mey+4)*50+10,14,20) GraphicsWindow.FillRectangle((i-mex+4)*50+21,(j-mey+4)*50+30,8,8) If hasescaped=0 Then hasescaped=1 do3() Else hasescaped=0 EndIf ElseIf instead=48 Then '羊 GraphicsWindow.BrushColor="White" GraphicsWindow.FillRectangle((i-mex+4)*50+18,(j-mey+4)*50+10,14,20) GraphicsWindow.FillRectangle((i-mex+4)*50+21,(j-mey+4)*50+30,8,8) If hasescaped=0 Then hasescaped=1 do3() Else hasescaped=0 EndIf ElseIf instead=121 Then '毛毯 GraphicsWindow.BrushColor="White" GraphicsWindow.FillRectangle((i-mex+4)*50,(j-mey+4)*50,50,50) ElseIf instead=122 Then '木墩 GraphicsWindow.BrushColor="BurlyWood" GraphicsWindow.FillRectangle((i-mex+4)*50,(j-mey+4)*50,50,50) GraphicsWindow.DrawRectangle((i-mex+4)*50+5,(j-mey+4)*50+5,40,40) GraphicsWindow.DrawRectangle((i-mex+4)*50+10,(j-mey+4)*50+10,30,30) GraphicsWindow.DrawRectangle((i-mex+4)*50+15,(j-mey+4)*50+15,20,20) GraphicsWindow.DrawRectangle((i-mex+4)*50+20,(j-mey+4)*50+20,10,10) ElseIf instead=123 Then '石墩 GraphicsWindow.BrushColor="DarkGray" GraphicsWindow.FillRectangle((i-mex+4)*50,(j-mey+4)*50,50,50) GraphicsWindow.DrawLine((i-mex+4)*50,(j-mey+4)*50+10,(i-mex+4)*50+50,(j-mey+4)*50+10) GraphicsWindow.DrawLine((i-mex+4)*50,(j-mey+4)*50+20,(i-mex+4)*50+50,(j-mey+4)*50+20) GraphicsWindow.DrawLine((i-mex+4)*50,(j-mey+4)*50+30,(i-mex+4)*50+50,(j-mey+4)*50+30) GraphicsWindow.DrawLine((i-mex+4)*50,(j-mey+4)*50+40,(i-mex+4)*50+50,(j-mey+4)*50+40) GraphicsWindow.DrawLine((i-mex+4)*50,(j-mey+4)*50+50,(i-mex+4)*50+50,(j-mey+4)*50+50) ElseIf instead=124 Then '藤帘 GraphicsWindow.BrushColor="OliveDrab" GraphicsWindow.FillRectangle((i-mex+4)*50+1,(j-mey+4)*50,11,45) GraphicsWindow.FillRectangle((i-mex+4)*50+13,(j-mey+4)*50,11,45) GraphicsWindow.FillRectangle((i-mex+4)*50+25,(j-mey+4)*50,11,45) GraphicsWindow.FillRectangle((i-mex+4)*50+37,(j-mey+4)*50,11,45) GraphicsWindow.FillRectangle((i-mex+4)*50+49,(j-mey+4)*50,11,45) ElseIf instead=125 Then '金色毛毯 GraphicsWindow.BrushColor="Yellow" GraphicsWindow.FillRectangle((i-mex+4)*50,(j-mey+4)*50,50,50) ElseIf instead=126 Then '浅蓝��毯 GraphicsWindow.BrushColor="Aqua" GraphicsWindow.FillRectangle((i-mex+4)*50,(j-mey+4)*50,50,50) EndIf If i=mex And j=mey Then '我 GraphicsWindow.BrushColor="SaddleBrown" GraphicsWindow.FillRectangle((i-mex+4)*50+20,(j-mey+4)*50+10,10,10) GraphicsWindow.BrushColor="Blue" GraphicsWindow.FillRectangle((i-mex+4)*50+20,(j-mey+4)*50+20,10,18) EndIf EndFor EndFor For k=1 To 6 If bagnum[easybag[k]]=0 Then ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+1+allcheck+k,0) EndIf Endfor ElseIf screen=4 Then GraphicsWindow.Clear() GraphicsWindow.FontSize=25 GraphicsWindow.DrawText(240,150,"正在载入游戏......") GraphicsWindow.DrawText(280,190,"请耐心等��") showfirstgameload=Shapes.AddText("已加载"+firstgameload+"%") Shapes.Move(showfirstgameload,270,230) ' The following line could be harmful and has been automatically commented. ' mex=File.ReadLine(path,worldlength*worldwidth+9+allcheck) ' The following line could be harmful and has been automatically commented. ' mey=File.ReadLine(path,worldlength*worldwidth+10+allcheck) For i=1 To worldlength For j=1 To worldwidth ' The following line could be harmful and has been automatically commented. ' thing[i][j]=File.ReadLine(path,(i-1)*worldwidth+j+1) If thing[i][j]>=46 And thing[i][j]<=animalplace Then aniblood[i][j]=haveblood[thing[i][j]] EndIf firstgameload=Math.Round((i*100+j)/worldlength-1)/2 Shapes.SetText(showfirstgameload,"已加载"+firstgameload+"%") EndFor EndFor For i=1 To allcheck ' The following line could be harmful and has been automatically commented. ' bagnum[i]=File.ReadLine(path,worldlength*worldwidth+1+i) firstgameload=50+Math.Round(50/allcheck)*i-1 Shapes.SetText(showfirstgameload,"已加载"+firstgameload+"%") EndFor For i=1 To 12 ' The following line could be harmful and has been automatically commented. ' baglong[i+13]=File.ReadLine(path,worldlength*worldwidth+10+allcheck+i) EndFor For i=1 To 6 ' The following line could be harmful and has been automatically commented. ' easybag[i]=File.ReadLine(path,worldlength*worldwidth+1+allcheck+i) EndFor ' The following line could be harmful and has been automatically commented. ' holdeasybag=File.ReadLine(path,worldlength*worldwidth+8+allcheck) ' The following line could be harmful and has been automatically commented. ' blood=File.ReadLine(path,worldlength*worldwidth+23+allcheck) ' The following line could be harmful and has been automatically commented. ' hunger=File.ReadLine(path,worldlength*worldwidth+24+allcheck) ' The following line could be harmful and has been automatically commented. ' nofood=File.ReadLine(path,worldlength*worldwidth+25+allcheck) ' The following line could be harmful and has been automatically commented. ' daytime=File.ReadLine(path,worldlength*worldwidth+26+allcheck) firstgameload=100 Shapes.SetText(showfirstgameload,"已加载"+firstgameload+"%") screen=3 Timer.Tick=timecounter Timer.Interval=1000 drawscreen() ElseIf screen=5 Then GraphicsWindow.Clear() GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 GraphicsWindow.DrawRectangle(20,20,660,490) GraphicsWindow.DrawText(30,30,"背包物品:"+bagthing[check]) GraphicsWindow.DrawText(30,60,"物品编号:"+check) GraphicsWindow.DrawText(30,90,"物品数量:"+bagnum[check]) GraphicsWindow.DrawText(30,130,"放入快捷包:") GraphicsWindow.FontSize=22 For i=1 To 6 putinto[i]=Controls.AddButton(i+"号",30+(i-1)*85,160) Controls.SetSize(putinto[i],80,35) EndFor GraphicsWindow.DrawText(30,220,"制作材料1:"+bagthing[bagmake1[check]]+" X"+bagmake1num[check]+" , 拥有"+bagnum[bagmake1[check]]) GraphicsWindow.DrawText(30,250,"制作材料2:"+bagthing[bagmake2[check]]+" X"+bagmake2num[check]+" , 拥有"+bagnum[bagmake2[check]]) GraphicsWindow.DrawText(30,280,"制作材料3:"+bagthing[bagmake3[check]]+" X"+bagmake3num[check]+" , 拥有"+bagnum[bagmake3[check]]) GraphicsWindow.DrawText(30,320,"制作后可得到:"+bagthing[check]+" X"+bagmakeget[check]) makething=Controls.AddButton("制作1个",30,350) If check>=14 And check<=25 Then GraphicsWindow.DrawText(30,400,"剩余耐久度:"+baglong[check]) EndIf findinbagwri=Controls.AddTextBox(380,28) Controls.SetSize(findinbagwri,180,40) findinbagbut=Controls.AddButton("查找",570,28) Controls.SetSize(findinbagbut,80,40) If bagblood[check]>0 Or baghunger[check]>0 Then bageat=Controls.AddButton("食用1个",30,400) EndIf ElseIf screen=6 Then GraphicsWindow.Clear() GraphicsWindow.BrushColor="Black" GraphicsWindow.FillRectangle(0,0,700,530) GraphicsWindow.BrushColor="White" GraphicsWindow.FontSize=25 showmessage=Shapes.AddText("ZZZ...") Shapes.Move(showmessage,300,200) EndIf EndSub Sub buttonclicked If screen=1 And Controls.LastClickedButton=startplaygame Then path=Controls.GetTextBoxText(enterkeypath) ' The following line could be harmful and has been automatically commented. ' If File.ReadLine(path,1)="" Then ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,1,1) screen=2 drawscreen() Else screen=4 drawscreen() EndIf ElseIf screen=5 Then If bagnum[check]>0 Then For i=1 To 6 If Controls.LastClickedButton=putinto[i] Then For j=1 To 6 If i<>j And easybag[j]=check Then easybag[j]=0 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+1+allcheck+i,check) EndIf EndFor easybag[i]=check ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+1+allcheck+i,check) EndIf EndFor EndIf If Controls.LastClickedButton=makething Then If bagnum[bagmake1[check]]>=bagmake1num[check] And bagnum[bagmake2[check]]>=bagmake2num[check] Then If bagnum[bagmake3[check]]>=bagmake3num[check] Then bagnum[bagmake1[check]]=bagnum[bagmake1[check]]-bagmake1num[check] bagnum[bagmake2[check]]=bagnum[bagmake2[check]]-bagmake2num[check] bagnum[bagmake3[check]]=bagnum[bagmake3[check]]-bagmake3num[check] bagnum[check]=bagnum[check]+bagmakeget[check] If bagnum[bagmake1[check]]=0 Then For i=1 To 6 If easybag[i]=bagmake1[check] Then easybag[i]=0 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+1+allcheck+i,0) EndIf EndFor EndIf If bagnum[bagmake2[check]]=0 Then For i=1 To 6 If easybag[i]=bagmake2[check] Then easybag[i]=0 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+1+allcheck+i,0) EndIf EndFor EndIf If bagnum[bagmake3[check]]=0 Then For i=1 To 6 If easybag[i]=bagmake3[check] Then easybag[i]=0 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+1+allcheck+i,0) EndIf EndFor EndIf ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+1+bagmake1[check],bagnum[bagmake1[check]]) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+1+bagmake2[check],bagnum[bagmake2[check]]) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+1+bagmake3[check],bagnum[bagmake3[check]]) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+1+check,bagnum[check]) If check>=14 And check<=25 And bagnum[check]=1 Then baglong[check]=baghavelong[check] ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+10+allcheck+easybag[holdeasybag],baglong[easybag[holdeasybag]]) EndIf EndIf EndIf drawscreen() ElseIf Controls.LastClickedButton=findinbagbut Then findinbagname=Controls.GetTextBoxText(findinbagwri) For i=1 To allcheck If findinbagname=bagthing[i] Or i=findinbagname Then check=i EndIf EndFor drawscreen() ElseIf Controls.LastClickedButton=bageat Then bagnum[check]=bagnum[check]-1 blood=blood+bagblood[check] hunger=hunger+baghunger[check] If blood>10 Then blood=10 EndIf If hunger>10 Then hunger=10 EndIf ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+24+allcheck,hunger) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+1+check,bagnum[check]) drawscreen() EndIf EndIf EndSub Sub keydown If GraphicsWindow.LastKey="Escape" Then ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+26+allcheck,daytime) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+25+allcheck,nofood) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+23+allcheck,blood) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+9+allcheck,mex) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+10+allcheck,mey) Program.End() EndIf If screen=3 Then If GraphicsWindow.LastKey="W" Or GraphicsWindow.LastKey="Up" Then If mey>1 And thing[mex][mey-1]>29 And thing[mex][mey-1]<=45 Then mey=mey-1 drawscreen() ElseIf mey>1 And thing[mex][mey-1]>animalplace And thing[mex][mey-1]<=121 Then mey=mey-1 drawscreen() ElseIf thing[mex][mey-1]=124 Or thing[mex][mey-1]=125 Or thing[mex][mey-1]=126 Then mey=mey-1 drawscreen() EndIf ElseIf GraphicsWindow.LastKey="A" Or GraphicsWindow.LastKey="Left" Then If mex>1 And thing[mex-1][mey]>29 And thing[mex-1][mey]<=45 Then mex=mex-1 drawscreen() ElseIf mex>1 And thing[mex-1][mey]>animalplace And thing[mex-1][mey]<=121 Then mex=mex-1 drawscreen() ElseIf thing[mex-1][mey]=124 Or thing[mex-1][mey]=125 Or thing[mex-1][mey]=126 Then mex=mex-1 drawscreen() EndIf ElseIf GraphicsWindow.LastKey="S" Or GraphicsWindow.LastKey="Down" Then If mey29 And thing[mex][mey+1]<=45 Then mey=mey+1 drawscreen() ElseIf meyanimalplace And thing[mex][mey+1]<=121 Then mey=mey+1 drawscreen() ElseIf thing[mex][mey+1]=124 Or thing[mex][mey+1]=125 Or thing[mex][mey+1]=126 Then mey=mey+1 drawscreen() EndIf ElseIf GraphicsWindow.LastKey="D" Or GraphicsWindow.LastKey="Right" Then If mex29 And thing[mex+1][mey]<=45 Then mex=mex+1 drawscreen() ElseIf mexanimalplace And thing[mex+1][mey]<=121 Then mex=mex+1 drawscreen() ElseIf thing[mex+1][mey]<=124 Or thing[mex+1][mey]<=125 Or thing[mex+1][mey]<=126 Then mex=mex+1 drawscreen() EndIf ElseIf GraphicsWindow.LastKey="E" Then screen=5 drawscreen() ElseIf GraphicsWindow.LastKey="R" And daytime>=165 And daytime<=599 Then If thing[mx][my]=121 Or thing[mx][my]=125 Or thing[mx][my]=126 Then screen=6 sleeping=1 drawscreen() EndIf EndIf For i=1 To 6 If GraphicsWindow.LastKey="D"+i Then holdeasybag=i Shapes.Move(showholdeasybag1,19+(i-1)*70,486) Shapes.Move(showholdeasybag2,80+(i-1)*70,486) Shapes.Move(showholdeasybag3,20+(i-1)*70,485) Shapes.Move(showholdeasybag4,20+(i-1)*70,526) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+8+allcheck,holdeasybag) EndIf EndFor ElseIf screen=5 Then If GraphicsWindow.LastKey="W" Or GraphicsWindow.LastKey="Up" Then If check>1 Then check=check-1 Else check=allcheck EndIf drawscreen() ElseIf GraphicsWindow.LastKey="S" Or GraphicsWindow.LastKey="Down" Then If check=14 And easybag[holdeasybag]<=19 Then gameload=gameload-bagspeed[easybag[holdeasybag]] If gameload<=0 Then gameload=1 EndIf EndIf GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=7 ElseIf thing[mx][my]>18 And thing[mx][my]<29 Then '树木 gameload=10 If easybag[holdeasybag]>=14 And easybag[holdeasybag]<=19 Then gameload=gameload-bagspeed[easybag[holdeasybag]] If gameload<=0 Then gameload=1 EndIf EndIf GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=1 ElseIf thing[mx][my]>=31 And thing[mx][my]<=35 Then '石头 If easybag[holdeasybag]>=14 And easybag[holdeasybag]<=19 Then gameload=5 gameload=gameload-bagspeed[easybag[holdeasybag]] If gameload<=0 Then gameload=1 EndIf GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=4 Else GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showmessage=Shapes.AddText("太硬了,挖不动") Shapes.Move(showmessage,460,70) EndIf ElseIf thing[mx][my]>=36 And thing[mx][my]<=38 Then '铁 If easybag[holdeasybag]>=15 And easybag[holdeasybag]<=19 Then gameload=6 gameload=gameload-bagspeed[easybag[holdeasybag]] If gameload<=0 Then gameload=1 EndIf GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=10 Else GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showmessage=Shapes.AddText("太硬了,挖不动") Shapes.Move(showmessage,460,70) EndIf ElseIf thing[mx][my]>38 And thing[mx][my]<41 Then '黄金 If easybag[holdeasybag]>=16 And easybag[holdeasybag]<=19 Then gameload=6 gameload=gameload-bagspeed[easybag[holdeasybag]] If gameload<=0 Then gameload=1 EndIf GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=11 Else GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showmessage=Shapes.AddText("太硬了,挖不动") Shapes.Move(showmessage,460,70) EndIf ElseIf thing[mx][my]=41 Then '钻石 If easybag[holdeasybag]>=17 And easybag[holdeasybag]<=19 Then gameload=8 gameload=gameload-bagspeed[easybag[holdeasybag]] If gameload<=0 Then gameload=1 EndIf GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=12 Else GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showmessage=Shapes.AddText("太硬了,挖不动") Shapes.Move(showmessage,460,70) EndIf ElseIf thing[mx][my]=42 Then '黑曜石 If easybag[holdeasybag]>=18 And easybag[holdeasybag]<=19 Then gameload=9 gameload=gameload-bagspeed[easybag[holdeasybag]] If gameload<=0 Then gameload=1 EndIf GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=13 Else GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showmessage=Shapes.AddText("太硬了,挖不动") Shapes.Move(showmessage,460,70) EndIf ElseIf thing[mx][my]>=43 And thing[mx][my]<=45 Then '煤 If easybag[holdeasybag]>=14 And easybag[holdeasybag]<=19 Then gameload=4 gameload=gameload-bagspeed[easybag[holdeasybag]] If gameload<=0 Then gameload=1 EndIf GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=9 Else GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showmessage=Shapes.AddText("太硬了,挖不动") Shapes.Move(showmessage,460,70) EndIf ElseIf thing[mx][my]=29 Then '南瓜 If easybag[holdeasybag]>=14 And easybag[holdeasybag]<=19 Then gameload=6 gameload=gameload-bagspeed[easybag[holdeasybag]] If gameload<=0 Then gameload=1 EndIf GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=8 Else GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showmessage=Shapes.AddText("太硬了,挖不动") Shapes.Move(showmessage,460,70) EndIf ElseIf thing[mx][my]=46 Then '猪 hard=2 do2() Sound.PlayClick() If aniblood[mx][my]<=0 Then bagnum[26]=bagnum[26]+Math.GetRandomNumber(2) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+27,bagnum[26]) GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showgetbagthing=Shapes.AddText("获得物品:生猪肉") ElseIf Math.GetRandomNumber(8)=1 Then blood=blood-1 drawscreen() GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showmessage2=Shapes.AddText("遭到反抗,扣了血") Shapes.Move(showmessage2,460,100) EndIf ElseIf thing[mx][my]=47 Then '牛 hard=3 do2() Sound.PlayClick() If aniblood[mx][my]<=0 Then bagnum[28]=bagnum[28]+Math.GetRandomNumber(2) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+29,bagnum[28]) GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showgetbagthing=Shapes.AddText("获得物品:生牛肉") ElseIf Math.GetRandomNumber(5)=1 Then blood=blood-1 drawscreen() GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showmessage2=Shapes.AddText("遭到反抗,扣了血") Shapes.Move(showmessage2,460,100) EndIf If Math.GetRandomNumber(5)=1 Then blood=blood-1 drawscreen() GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showmessage2=Shapes.AddText("遭到反抗,扣了血") Shapes.Move(showmessage2,460,100) EndIf ElseIf thing[mx][my]=48 Then '羊 hard=2 do2() Sound.PlayClick() If aniblood[mx][my]<=0 Then bagnum[34]=bagnum[34]+1 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+35,bagnum[34]) EndIf drawscreen() If aniblood[mx][my]<=0 Then GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showgetbagthing=Shapes.AddText("获得物品:羊毛") EndIf ElseIf thing[mx][my]=121 Then '毛毯 gameload=2 GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=35 ElseIf thing[mx][my]=122 Then '木桩 gameload=3 GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=36 ElseIf thing[mx][my]=123 Then '石桩 gameload=3 GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=37 ElseIf thing[mx][my]=124 Then '藤帘 gameload=2 GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=39 ElseIf thing[mx][my]=125 Then '金色毛毯 gameload=2 GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=41 ElseIf thing[mx][my]=126 Then '浅蓝毛毯 gameload=2 GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=42 EndIf If thing[mx][my]>=46 And thing[mx][my]<=animalplace Then If broken=1 Then GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showmessage=Shapes.AddText("攻击损坏了工具") Shapes.Move(showmessage,460,70) EndIf broken=0 Shapes.Move(showgetbagthing,460,40) EndIf EndIf EndIf ElseIf Mouse.IsRightButtonDown="True" Then If mx<450 And my<450 Then mx=Math.Floor(mx/50)-4+mex my=Math.Floor(my/50)-4+mey If Math.Abs(mex-mx)<=1 And Math.Abs(mey-my)<=1 Then If (thing[mx][my]>=animalplace And thing[mx][my]<=120) Or (thing[mx][my]>=34 And thing[mx][my]<=45) Then If easybag[holdeasybag]=35 Then '毛毯 bagnum[easybag[holdeasybag]]=bagnum[easybag[holdeasybag]]-1 do4() ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+36,bagnum[easybag[holdeasybag]]) thing[mx][my]=121 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,(mx-1)*worldwidth+my+1,121) drawscreen() ElseIf easybag[holdeasybag]=36 Then '木墩 bagnum[easybag[holdeasybag]]=bagnum[easybag[holdeasybag]]-1 do4() ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+37,bagnum[easybag[holdeasybag]]) thing[mx][my]=122 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,(mx-1)*worldwidth+my+1,122) drawscreen() ElseIf easybag[holdeasybag]=37 Then '石墩 bagnum[easybag[holdeasybag]]=bagnum[easybag[holdeasybag]]-1 do4() ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+38,bagnum[easybag[holdeasybag]]) thing[mx][my]=123 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,(mx-1)*worldwidth+my+1,123) drawscreen() ElseIf easybag[holdeasybag]=39 Then '藤帘 bagnum[easybag[holdeasybag]]=bagnum[easybag[holdeasybag]]-1 do4() ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+40,bagnum[easybag[holdeasybag]]) thing[mx][my]=124 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,(mx-1)*worldwidth+my+1,124) drawscreen() ElseIf easybag[holdeasybag]=42 Then '金色毛毯 bagnum[easybag[holdeasybag]]=bagnum[easybag[holdeasybag]]-1 do4() ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+42,bagnum[easybag[holdeasybag]]) thing[mx][my]=125 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,(mx-1)*worldwidth+my+1,125) drawscreen() ElseIf easybag[holdeasybag]=43 Then '浅蓝毛毯 bagnum[easybag[holdeasybag]]=bagnum[easybag[holdeasybag]]-1 do4() ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+43,bagnum[easybag[holdeasybag]]) thing[mx][my]=126 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,(mx-1)*worldwidth+my+1,126) drawscreen() EndIf EndIf EndIf EndIf EndIf EndSub Sub timecounter nofood=nofood+1 If nofood>=60 Then nofood=0 hunger=hunger-1 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+24+allcheck,hunger) drawscreen() EndIf daytime=daytime+1 If daytime>=400 Then daytime=0 EndIf If Math.Remainder(daytime,60)=0 And screen=3 And gameload=0 Then drawscreen() EndIf If sleeping>=1 Then sleeping=sleeping+1 If sleeping=7 Then sleeping=0 screen=3 daytime=30 blood=blood+5 If blood>=10 Then blood=10 EndIf drawscreen() EndIf EndIf digger() EndSub Sub digger If gameload>0 Then gameload=gameload-1 Shapes.SetText(showpickcomplete,"采集剩余时间:"+gameload+"秒") EndIf If gameload=0 Then If willgetthing=7 Then Shapes.HideShape(showpickcomplete) bagnum[7]=bagnum[7]+1 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+8,bagnum[7]) hard=1 do1() showgetbagthing=Shapes.AddText("获得物品:蘑菇") ElseIf willgetthing=1 Then Shapes.HideShape(showpickcomplete) bagnum[1]=bagnum[1]+Math.GetRandomNumber(2)+2 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+2,bagnum[1]) bagnum[3]=bagnum[3]+Math.GetRandomNumber(3) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+4,bagnum[3]) If Math.GetRandomNumber(6)=1 Then bagnum[38]=bagnum[38]+1 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+39,bagnum[38]) changeshowmessage=1 EndIf hard=10 do1() If changeshowmessage=1 Then GraphicsWindow.FontSize=18 showgetbagthing=Shapes.AddText("获得物品:树叶、木块、藤条") changeshowmessage=0 Else showgetbagthing=Shapes.AddText("获得物品:树叶、木块") EndIf ElseIf willgetthing=4 Then Shapes.HideShape(showpickcomplete) bagnum[4]=bagnum[4]+Math.GetRandomNumber(2) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+5,bagnum[4]) hard=3 do1() showgetbagthing=Shapes.AddText("获得物���:石头") ElseIf willgetthing=10 Then Shapes.HideShape(showpickcomplete) bagnum[10]=bagnum[10]+1 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+11,bagnum[10]) hard=5 do1() showgetbagthing=Shapes.AddText("获得物品:铁") ElseIf willgetthing=11 Then Shapes.HideShape(showpickcomplete) bagnum[11]=bagnum[11]+1 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+12,bagnum[11]) hard=5 do1() showgetbagthing=Shapes.AddText("获得物品:黄金") ElseIf willgetthing=12 Then Shapes.HideShape(showpickcomplete) bagnum[12]=bagnum[12]+1 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+13,bagnum[12]) hard=7 do1() showgetbagthing=Shapes.AddText("获得物品:钻石") ElseIf willgetthing=13 Then Shapes.HideShape(showpickcomplete) bagnum[13]=bagnum[13]+1 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+14,bagnum[13]) hard=8 do1() showgetbagthing=Shapes.AddText("获得物品:黑曜石") ElseIf willgetthing=9 Then Shapes.HideShape(showpickcomplete) bagnum[9]=bagnum[9]+Math.GetRandomNumber(2) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+10,bagnum[9]) hard=3 do1() showgetbagthing=Shapes.AddText("获得物品:煤炭") ElseIf willgetthing=8 Then Shapes.HideShape(showpickcomplete) bagnum[8]=bagnum[8]+1 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+9,bagnum[8]) hard=5 do1() showgetbagthing=Shapes.AddText("获得物品:南瓜") ElseIf willgetthing=35 Then Shapes.HideShape(showpickcomplete) bagnum[35]=bagnum[35]+1 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+36,bagnum[35]) hard=0 do1() showgetbagthing=Shapes.AddText("获得物品:毛毯") ElseIf willgetthing=36 Then Shapes.HideShape(showpickcomplete) bagnum[36]=bagnum[36]+1 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+37,bagnum[36]) hard=0 do1() showgetbagthing=Shapes.AddText("获得物品:木墩") ElseIf willgetthing=37 Then Shapes.HideShape(showpickcomplete) bagnum[37]=bagnum[37]+1 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+38,bagnum[37]) hard=0 do1() showgetbagthing=Shapes.AddText("获得物品:石墩") ElseIf willgetthing=39 Then Shapes.HideShape(showpickcomplete) bagnum[39]=bagnum[39]+1 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+40,bagnum[39]) hard=0 do1() showgetbagthing=Shapes.AddText("获得物品:藤帘") ElseIf willgetthing=41 Then Shapes.HideShape(showpickcomplete) bagnum[41]=bagnum[41]+1 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+42,bagnum[41]) hard=0 do1() showgetbagthing=Shapes.AddText("获得物品:金色毛毯") ElseIf willgetthing=42 Then Shapes.HideShape(showpickcomplete) bagnum[42]=bagnum[42]+1 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldwidth*worldlength+43,bagnum[42]) hard=0 do1() showgetbagthing=Shapes.AddText("获得物品:浅蓝毛毯") EndIf willgetthing=0 If broken=1 Then GraphicsWindow.FontSize=25 showmessage=Shapes.AddText("挖掘损坏了工具") Shapes.Move(showmessage,460,70) EndIf broken=0 Shapes.Move(showgetbagthing,460,40) EndIf EndSub Sub do2 If easybag[holdeasybag]>=20 And easybag[holdeasybag]<=25 Then aniblood[mx][my]=aniblood[mx][my]-baghurt[easybag[holdeasybag]] baglong[easybag[holdeasybag]]=baglong[easybag[holdeasybag]]-hard ElseIf easybag[holdeasybag]>=14 And easybag[holdeasybag]<=19 Then aniblood[mx][my]=aniblood[mx][my]-1 baglong[easybag[holdeasybag]]=baglong[easybag[holdeasybag]]-hard*2 Else aniblood[mx][my]=aniblood[mx][my]-1 EndIf If baglong[easybag[holdeasybag]]<=0 And easybag[holdeasybag]>=14 And easybag[holdeasybag]<=25 Then bagnum[easybag[holdeasybag]]=bagnum[easybag[holdeasybag]]-1 If bagnum[easybag[holdeasybag]]>0 Then baglong[easybag[holdeasybag]]=baghavelong[easybag[holdeasybag]] EndIf broken=1 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+1+easybag[holdeasybag],bagnum[easybag[holdeasybag]]) EndIf redo2: If aniblood[mx][my]<=0 Then drawnewx=Math.GetRandomNumber(worldlength) drawnewy=Math.GetRandomNumber(worldwidth) If thing[drawnewx][drawnewy]>animalplace And thing[drawnewx][drawnewy]<=120 Then thing[drawnewx][drawnewy]=thing[mx][my] aniblood[drawnewx][drawnewy]=haveblood[thing[mx][my]] thing[mx][my]=120 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,(mx-1)*worldwidth+my+1,120) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,(drawnewx-1)*worldwidth+drawnewy+1,thing[drawnewx][drawnewy]) Else Goto redo2 EndIf drawscreen() EndIf EndSub Sub do1 If easybag[holdeasybag]>=14 And easybag[holdeasybag]<=19 Then baglong[easybag[holdeasybag]]=baglong[easybag[holdeasybag]]-hard ElseIf easybag[holdeasybag]>=20 And easybag[holdeasybag]<=25 Then baglong[easybag[holdeasybag]]=baglong[easybag[holdeasybag]]-hard/2 EndIf If baglong[easybag[holdeasybag]]<=0 And easybag[holdeasybag]>=14 And easybag[holdeasybag]<=25 Then bagnum[easybag[holdeasybag]]=bagnum[easybag[holdeasybag]]-1 If bagnum[easybag[holdeasybag]]>0 Then baglong[easybag[holdeasybag]]=baghavelong[easybag[holdeasybag]] EndIf broken=1 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth+1+easybag[holdeasybag],bagnum[easybag[holdeasybag]]) EndIf ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,worldlength*worldwidth-3+allcheck+easybag[holdeasybag],baglong[easybag[holdeasybag]]) redo1: drawnewx=Math.GetRandomNumber(worldlength) drawnewy=Math.GetRandomNumber(worldwidth) If thing[drawnewx][drawnewy]>animalplace And thing[drawnewx][drawnewy]<=120 Then thing[drawnewx][drawnewy]=thing[mx][my] thing[mx][my]=120 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,(mex-1)*worldwidth+mey+1,120) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,(drawnewx-1)*worldwidth+drawnewy+1,thing[drawnewx][drawnewy]) Else Goto redo1 EndIf drawscreen() GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 EndSub Sub do3 If 1=2 Then '比较卡的动物逃跑判断 If instead=47 Then If Math.GetRandomNumber(20)=1 Then If Math.GetRandomNumber(4)=1 And thing[i-1][j]>=animalplace And thing[i-1][j]<=121 Then thing[i-1][j]=instead hasescaped=0 aniblood[i-1][j]=aniblood[i][j] ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,(i-2)*worldwidth+j+1,thing[i-1][j]) ElseIf Math.GetRandomNumber(3)=1 And thing[i+1][j]>=animalplace And thing[i+1][j]<=121 Then thing[i+1][j]=instead hasescaped=0 aniblood[i+1][j]=aniblood[i][j] ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,i*worldwidth+j+1,thing[i+1][j]) ElseIf Math.GetRandomNumber(2)=1 And thing[i][j-1]>=animalplace And thing[i][j-1]<=121 Then thing[i][j-1]=instead hasescaped=0 aniblood[i][j-1]=aniblood[i][j] ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,(i-1)*worldwidth+j,thing[i][j-1]) ElseIf thing[i][j+1]>=animalplace And thing[i][j+1]<=120 Then thing[i][j+1]=instead hasescaped=0 aniblood[i][j+1]=aniblood[i][j] ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,(i-1)*worldwidth+j+2,thing[i][j+1]) EndIf If hasescaped=0 Then thing[i][j]=120 aniblood[i][j]=0 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,(i-1)*worldwidth+j+1,120) drawscreen() EndIf EndIf ElseIf instead=48 Then If Math.GetRandomNumber(4)=1 Then If Math.GetRandomNumber(4)=1 And thing[i-1][j]>=animalplace And thing[i-1][j]<=121 Then thing[i-1][j]=instead hasescaped=0 aniblood[i-1][j]=aniblood[i][j] ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,(i-2)*worldwidth+j+1,thing[i-1][j]) ElseIf Math.GetRandomNumber(3)=1 And thing[i+1][j]>=animalplace And thing[i+1][j]<=121 Then thing[i+1][j]=instead hasescaped=0 aniblood[i+1][j]=aniblood[i][j] ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,i*worldwidth+j+1,thing[i+1][j]) ElseIf Math.GetRandomNumber(2)=1 And thing[i][j-1]>=animalplace And thing[i][j-1]<=121 Then thing[i][j-1]=instead hasescaped=0 aniblood[i][j-1]=aniblood[i][j] ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,(i-1)*worldwidth+j,thing[i][j-1]) ElseIf thing[i][j+1]>=animalplace And thing[i][j+1]<=121 Then thing[i][j+1]=instead hasescaped=0 aniblood[i][j+1]=aniblood[i][j] ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,(i-1)*worldwidth+j+2,thing[i][j+1]) EndIf If hasescaped=0 Then thing[i][j]=120 aniblood[i][j]=0 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,(i-1)*worldwidth+j+1,120) drawscreen() EndIf EndIf EndIf EndIf EndSub Sub do4 If thing[mx][my]>=36 And thing[mx][my]<=45 Then redo3: drawnewx=Math.GetRandomNumber(worldlength) drawnewy=Math.GetRandomNumber(worldwidth) If thing[drawnewx][drawnewy]>animalplace And thing[drawnewx][drawnewy]<=120 Then thing[drawnewx][drawnewy]=thing[mx][my] thing[mx][my]=120 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,(drawnewx-1)*worldwidth+drawnewy+1,thing[drawnewx][drawnewy]) Else Goto redo3 EndIf EndIf EndSub Sub baginformation allcheck=43 bagthing[1]="木块" bagthing[2]="木板" bagthing[3]="树叶" bagthing[4]="石头" bagthing[5]="石块" bagthing[6]="木棍" bagthing[7]="蘑菇" bagthing[8]="南瓜" bagthing[9]="煤炭" bagthing[10]="铁" bagthing[11]="黄金" bagthing[12]="钻石" bagthing[13]="黑曜石" bagthing[14]="木镐" bagthing[15]="石镐" bagthing[16]="铁镐" bagthing[17]="黄金镐" bagthing[18]="钻石镐" bagthing[19]="黑曜石镐" bagthing[20]="木剑" bagthing[21]="石剑" bagthing[22]="铁剑" bagthing[23]="黄金剑" bagthing[24]="钻石剑" bagthing[25]="黑曜石剑" bagthing[26]="生猪肉" bagthing[27]="熟猪肉" bagthing[28]="生牛肉" bagthing[29]="熟牛肉" bagthing[30]="鸡蛋" bagthing[31]="小麦" bagthing[32]="牛奶" bagthing[33]="蛋糕" bagthing[34]="羊毛" bagthing[35]="毛毯" bagthing[36]="木墩" bagthing[37]="石墩" bagthing[38]="藤条" bagthing[39]="藤帘" bagthing[40]="金粉" bagthing[41]="钻石粉" bagthing[42]="金色毛毯" bagthing[43]="浅蓝毛毯" bagmake1[2]=1 bagmake1num[2]=1 bagmakeget[2]=4 bagmake1[5]=4 bagmake1num[5]=2 bagmakeget[5]=1 bagmake1[6]=2 bagmake1num[6]=2 bagmakeget[6]=4 bagmake1[14]=2 bagmake1num[14]=3 bagmake2[14]=6 bagmake2num[14]=2 bagmakeget[14]=1 bagmake1[15]=5 bagmake1num[15]=3 bagmake2[15]=6 bagmake2num[15]=2 bagmakeget[15]=1 bagmake1[16]=10 bagmake1num[16]=3 bagmake2[16]=6 bagmake2num[16]=2 bagmakeget[16]=1 bagmake1[17]=11 bagmake1num[17]=3 bagmake2[17]=6 bagmake2num[17]=2 bagmakeget[17]=1 bagmake1[18]=12 bagmake1num[18]=3 bagmake2[18]=6 bagmake2num[18]=2 bagmakeget[18]=1 bagmake1[19]=13 bagmake1num[19]=3 bagmake2[19]=6 bagmake2num[19]=2 bagmakeget[19]=1 bagmake1[20]=2 bagmake1num[20]=3 bagmake2[20]=6 bagmake2num[20]=2 bagmakeget[20]=1 bagmake1[21]=5 bagmake1num[21]=3 bagmake2[21]=6 bagmake2num[21]=2 bagmakeget[21]=1 bagmake1[22]=10 bagmake1num[22]=3 bagmake2[22]=6 bagmake2num[22]=2 bagmakeget[22]=1 bagmake1[23]=11 bagmake1num[23]=3 bagmake2[23]=6 bagmake2num[23]=2 bagmakeget[23]=1 bagmake1[24]=12 bagmake1num[24]=3 bagmake2[24]=6 bagmake2num[24]=2 bagmakeget[24]=1 bagmake1[25]=13 bagmake1num[25]=3 bagmake2[25]=6 bagmake2num[25]=2 bagmakeget[25]=1 bagmake1[27]=26 bagmake1num[27]=1 bagmake2[27]=9 bagmake2num[27]=2 bagmakeget[27]=1 bagmake1[29]=28 bagmake1num[29]=1 bagmake2[29]=9 bagmake2num[29]=2 bagmakeget[29]=1 bagmake1[33]=30 bagmake1num[33]=3 bagmake2[33]=31 bagmake2num[33]=3 bagmake3[33]=32 bagmake3num[33]=3 bagmakeget[33]=1 bagmake1[35]=34 bagmake1num[35]=4 bagmakeget[35]=1 bagmake1[36]=2 bagmake1num[36]=3 bagmakeget[36]=1 bagmake1[37]=5 bagmake1num[37]=3 bagmakeget[37]=1 bagmake1[39]=38 bagmake1num[39]=5 bagmakeget[39]=1 bagmake1[40]=11 bagmake1num[40]=1 bagmakeget[40]=3 bagmake1[41]=12 bagmake1num[41]=1 bagmakeget[41]=3 bagmake1[42]=40 bagmake1num[42]=4 bagmakeget[42]=1 bagmake1[43]=41 bagmake1num[43]=4 bagmakeget[43]=1 baghavelong[14]=60 baghavelong[15]=80 baghavelong[16]=140 baghavelong[17]=100 baghavelong[18]=160 baghavelong[19]=180 baghavelong[20]=25 baghavelong[21]=35 baghavelong[22]=45 baghavelong[23]=40 baghavelong[24]=60 baghavelong[25]=70 bagspeed[14]=1 bagspeed[15]=2 bagspeed[16]=2 bagspeed[17]=3 bagspeed[18]=4 bagspeed[19]=4 baghurt[20]=2 baghurt[21]=2.5 baghurt[22]=4 baghurt[23]=4.5 baghurt[24]=5 baghurt[25]=6 bagblood[7]=1 baghunger[7]=0 bagblood[8]=3 baghunger[8]=3 bagblood[26]=2 baghunger[26]=3 bagblood[27]=3 baghunger[27]=3 bagblood[28]=3 baghunger[28]=3 bagblood[29]=3 baghunger[29]=4 bagblood[30]=0 baghunger[30]=1 bagblood[33]=4 baghunger[33]=5 EndSub Sub typerinformation exchangerblood[1]= "❤" exchangerblood[2]= "❤❤" exchangerblood[3]= "❤❤❤" exchangerblood[4]= "❤❤❤❤" exchangerblood[5]= "❤❤❤❤❤" exchangerblood[6]= "❤❤❤❤❤❤" exchangerblood[7]= "❤❤❤❤❤❤❤" exchangerblood[8]= "❤❤❤❤❤❤❤❤" exchangerblood[9]= "❤❤❤❤❤❤❤❤❤" exchangerblood[10]="❤❤❤❤❤❤❤❤❤❤" exchangerhung[1]= "★" exchangerhung[2]= "★★" exchangerhung[3]= "★★★" exchangerhung[4]= "★★★★" exchangerhung[5]= "★★★★★" exchangerhung[6]= "★★★★★★" exchangerhung[7]= "★★★★★★★" exchangerhung[8]= "★★★★★★★★" exchangerhung[9]= "★★★★★★★★★" exchangerhung[10]="★★★★★★★★★★" haveblood[46]=6 haveblood[47]=8 haveblood[48]=6 haveblood[49]=8 haveblood[49]=11 '其它变量 animalplace=48 hasescaped=0 sleeping=0 changeshowmessage=0 EndSub '地图分配 '1-18 水 '19-28 树木 '29 南瓜 '30 蘑菇 '31-35 石头 '36-38 铁 '39-40 黄金 '41 钻石 '42 黑曜石 '43-45 煤 '46 猪 '47 牛 '48 羊 End>GFG649.sb< Start>GFM316.sb< re: dflag=0 pflag=0 dflag=0 bet=1 i=i+1 dealerhand=Math.GetRandomNumber(13) If dealerhand>10 Then dealerhand=10 EndIf If dealerhand=1 Then dealerhand=11 dflag=1 EndIf If dealerhand=6 Or dealerhand=5 Or dealerhand=4 then tope=12 ElseIf dealerhand=3then tope=13 elseif dealerhand=2 then tope=14 ElseIf dealerhand=7 or dealerhand=8 then tope=15 elseif dealerhand=9 or dealerhand=10 or dealerhand=11 then tope=16 endif card1=Math.GetRandomNumber(13) If card1>10 Then card1=10 EndIf If card=1 Then card=11 pflag=1 EndIf card2=Math.GetRandomNumber(13) If card2>10 then card2=10 endif If card2=1 Then card2=11 pflag=1 EndIf playerhand=card1+card2 If (playerhand=10 And dealerhand<>11 And dealerhand<>10) or (playerhand=11 And dealerhand<>11) or (playerhand=9 And dealerhand<7 ) Then bet=2 doubleflag=1 else doubleflag=0 endif If card1=6 and card2=6 And dealerhand<7 then playerhand=6 bet=2 endif If card1=7 and card2=7 And dealerhand<7 then playerhand=7 bet=2 endif If card1=8 and card2=8 then playerhand=8 bet=2 endif If card1=10 and card2=1 or card1=1 and card2=10 then bob=bob+1.5 Goto re endif player() dealer() If dealerhand>playerhand Or playerhand=0 then bob=bob-bet endif If playerhand>dealerhand then bob=bob+bet endif TextWindow.WriteLine(bob+"*"+(bob/i)*100+" % * game number: "+i) Goto re Sub player While playerhand10 Then card=10 EndIf If card=1 Then card=11 pflag=1 EndIf playerhand=playerhand+card rep: If doubleflag=1 Then Goto jump endif EndWhile jump: If playerhand>21 Then If pflag=1 Then playerhand=playerhand-10 pflag=0 Goto rep EndIf playerhand=0 EndIf EndSub Sub dealer While dealerhand<17 card=Math.GetRandomNumber(13) If card>10 Then card=10 EndIf If card=1 Then card=11 pflag=1 EndIf dealerhand=dealerhand+card rep2: EndWhile If dealerhand>21 Then If dflag=1 Then dealerhand=dealerhand-10 dflag=0 Goto rep EndIf dealerhand=0 EndIf EndSub End>GFM316.sb< Start>GFP445-0.sb< ' Moving dots ' Version 0.2 ' Program ID GFP445-0 gw = GraphicsWindow.Width gh = GraphicsWindow.Height ox = gw / 2 oy = gh / 2 r = 70 size = 10 GraphicsWindow.BackgroundColor = "Black" GraphicsWindow.PenWidth = 0 k = 1 a = 0 b = 0 c = 0 For i = 1 To 7 GraphicsWindow.BrushColor = "#330099FF" light[i] = Shapes.AddEllipse(2 * size, 2* size) GraphicsWindow.BrushColor = "White" dot[i] = Shapes.AddEllipse(size, size) MoveDot() EndFor While "True" GraphicsWindow.Title = "k=" + k Program.Delay(10) k = k + 0.01 a = a + Math.Pi * 0.001 b = b + Math.Pi * 0.002 c = c + Math.Pi * 0.004 For i = 1 To 7 MoveDot() EndFor EndWhile Sub MoveDot x = r * Math.Cos(k * 2 * Math.Pi * (i - 1) / 7) y = -r * Math.Sin(k * 2 * Math.Pi * (i - 1) / 7) z = 0 Mapping() Shapes.Move(light[i], x - size, y - size) Shapes.Move(dot[i], x - size / 2, y - size / 2) EndSub Sub Mapping ' param x, y, z - point to map ' param a - angle around x axis [rad] ' param b - angle around y axis [rad] ' param c - angle around z axis [rad] _y = y _z = z y = Math.Cos(a) * _y - Math.Sin(a) * _z z = Math.Sin(a) * _y + Math.Cos(a) * _z _z = z _x = x z = Math.Cos(b) * _z - Math.Sin(b) * _x x = Math.Sin(b) * _z + Math.Cos(b) * _x _x = x _y = y x = Math.Cos(c) * _x - Math.Sin(c) * _y y = Math.Sin(c) * _x + Math.Cos(c) * _y x = ox + x y = oy - y EndSub End>GFP445-0.sb< Start>GFP445.sb< ' Moving dots ' Version 0.1 gw = GraphicsWindow.Width gh = GraphicsWindow.Height ox = gw / 2 oy = gh / 2 r = 70 size = 10 GraphicsWindow.BackgroundColor = "Black" GraphicsWindow.PenWidth = 0 k = 1 For i = 1 To 7 GraphicsWindow.BrushColor = "#330099FF" light[i] = Shapes.AddEllipse(2 * size, 2* size) GraphicsWindow.BrushColor = "White" dot[i] = Shapes.AddEllipse(size, size) MoveDot() EndFor While "True" GraphicsWindow.Title = "k=" + k Program.Delay(10) k = k + 0.01 For i = 1 To 7 MoveDot() EndFor EndWhile Sub MoveDot x = ox + r * Math.Cos(k * 2 * Math.Pi * (i - 1) / 7) y = oy + r * Math.Sin(k * 2 * Math.Pi * (i - 1) / 7) Shapes.Move(light[i], x - size, y - size) Shapes.Move(dot[i], x - size / 2, y - size / 2) EndSub End>GFP445.sb< Start>GFP706.sb< args=0 f3=5 GraphicsWindow.Title="SpringTree GraphicsWindow.Height=700 GraphicsWindow.Top=5 GraphicsWindow.BackgroundColor="green GraphicsWindow.penColor="gold Sub tree x=args[1] y=args[2] deg=args[3] n=args[4] If n > 0 Then r=7+n*3 ox=x oy=y x =x+ ldmath.cos (deg) * n * 1.4 * (Math.GetRandomNumber(100)/100 + 0.5) y =y+ ldmath.sin (deg) * n * 1.4 * (Math.GetRandomNumber(100)/100 + 0.5) If n<4 Then GraphicsWindow.BrushColor=LDColours.HSLtoRGB(100 1 1-(n-1)/3) GraphicsWindow.PenWidth=0 cc=Shapes.AddEllipse(r r) Shapes.Move(cc x*f3-r/2 y*f3-r/2 ) EndIf GraphicsWindow.PenWidth= n * 0.7 Shapes.AddLine( ox*f3 oy*f3 x*f3 y*f3) Stack.PushValue("ss" x) Stack.PushValue("ss" y) Stack.PushValue("ss" deg) Stack.PushValue("ss" n) LDCall.Function4( "tree" x y deg - 20 n - 1) n=Stack.PopValue("ss") deg=Stack.PopValue("ss") y=Stack.PopValue("ss") x=Stack.PopValue("ss") LDCall.Function4( "tree" x y deg + 20 n - 1) EndIf EndSub GraphicsWindow.KeyDown=kkk drr="true While 1=1 If drr Then drr="false LDCall.Function4( "tree" 60 100 , -90 10) cc=LDGraphicsWindow.Capture("" "false") LDImage.MakeTransparent(cc "green") LDImage.EffectGray(cc) LDImage.EffectGamma(cc 5.5) LDImage.ReplaceColour(cc "white" "#aa333333" 40) ss=Shapes.AddImage(cc) Shapes.Zoom(ss 1 0.4) Shapes.Rotate(ss 180) LDShapes.Skew(ss, -25 0) Shapes.Move(ss,-50 210) GraphicsWindow.BrushColor="#FF00BFFF" GraphicsWindow.FillRectangle(0 0 700 500) EndIf EndWhile Sub kkk GraphicsWindow.Clear() drr="true EndSub End>GFP706.sb< Start>GFR568.sb< 'Space Invader type game - no instructions - see the code! 'Graphics window dimensions gw = Desktop.Width-16 gh = Desktop.Height-100 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 GraphicsWindow.CanResize = "False" 'Load image and set it as a shape 'eFighter = ImageList.LoadImage("http://mattjessee.webs.com/enemyFighter.gif") 'eFighter = ImageList.LoadImage(Program.Directory+"/enemyFighter.png") eFighter = ImageList.LoadImage("http://7w7sng.bay.livefilestore.com/y1pB7u1Nqv2bS3zHfv5sFxYKxA7dOAmFD9VXIoslKqfW7hk2pKm8_5V9y6TkNe0nMsqVGSNApRigq4VyRex2qTdxNSmfAbYeycC/enemyFighter.png?psid=1") pFighter = ImageList.LoadImage("http://7w7sng.bay.livefilestore.com/y1p3G0f6UjNr07yNwAJ8YufTZVmYT6qPZSynFgqf1Gz0ZXGJe3tW9tS8EVLzisg-3m6x1KaHcjFfH67W8fi0vPovNjDzqgEYK5G/playerFighter.png?psid=1") lFighter = ImageList.LoadImage("http://7w7sng.bay.livefilestore.com/y1pMucrl8Ol3TObfQ6o85K-liyvBJ9eiRbw7D-49VOdv5BdqaJa8zKJ1XDUY10JgQx7lJx2j152nc_jBvWP98XsT0MTQKwmzs51/laserFighter.png?psid=1") fFighter = ImageList.LoadImage("http://7w7sng.bay.livefilestore.com/y1p7fQjTyUDcgJzRg5UQT1HTrGWEMKgwEymMtyTTukATRMIss404aaStlgkkJAkfiFE9r5MUYUinUkVEdOYnENCyv4CMa9iAlDE/freezeFighter.png?psid=1") iFighter = ImageList.LoadImage("http://public.bay.livefilestore.com/y1pRr1fcvyd_i07jyIWlK6cqca8WN9a5ENp2jD6scN5i_AI99u64Colea5_hMiPZKxaGAFfyLhmXYQOB6Lt92btdQ/invincibleFighter.png?psid=1") 'Width and height of image - make these the half width etc because that is what we need later enemiesWidth = ImageList.GetWidthOfImage(eFighter)/2 enemiesHeight = ImageList.GetHeightOfImage(eFighter)/2 'Mouse firing event GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.KeyDown = OnKeyDown 'High score ' The following line could be harmful and has been automatically commented. ' highScore = File.ReadContents(Program.Directory+"\highScore.txt") 'Basic parameters proximity = 20 nbullet = 20 bulletSpeed = 5 Restart: numEnemies = 10 speed = 1 lives = 5 score = 0 level = 0 pause = 0 NewLevel: GraphicsWindow.Clear() 'Deletes all shapes level = level+1 GraphicsWindow.BackgroundColor = GraphicsWindow.GetRandomColor() 'Change level parameters If (level > 1) Then numEnemies = numEnemies+5 speed = speed+0.3 EndIf 'Basic variables fire = 0 enemiesShot = 0 nextBullet = 0 'Create enemies For i = 1 To numEnemies enemies[i] = Shapes.AddImage(eFighter) Shapes.Zoom(enemies[i],1.2,1.2) 'a little bigger 'Initial Position enemiesX[i] = enemiesWidth+Math.GetRandomNumber(gw-2*enemiesWidth) enemiesY[i] = enemiesHeight+Math.GetRandomNumber(gh/2-2*enemiesHeight) 'Initial velocities enemiesU[i] = (Math.GetRandomNumber(201)-101)/50*speed 'The horizontal speed enemiesV[i] = (2+(Math.GetRandomNumber(201)-101)/50)*speed 'The vertical speed enemiesOn[i] = 1 EndFor 'Create bullets GraphicsWindow.PenColor = "Red" GraphicsWindow.BrushColor = "Red" For i = 1 To nbullet bullet[i] = Shapes.AddRectangle(4,10) Shapes.HideShape(bullet[i]) bulletOn[i] = 0 EndFor 'Create invincible halo GraphicsWindow.PenColor = "Yellow" GraphicsWindow.BrushColor = "#00000000" haloRadius = 35 halo = Shapes.AddEllipse(2*haloRadius,2*haloRadius) Shapes.HideShape(halo) 'Create laser GraphicsWindow.PenColor = "Yellow" GraphicsWindow.BrushColor = "Yellow" laser = Shapes.AddRectangle(4,gh) Shapes.HideShape(laser) laserOn = 0 freezeOn = 0 invincibleOn = 0 'Create bubble - was a bubble before changed it to the images - used for extra special targets numBubble = 3 'laser=1 and freeze=2 and 3=invincible bubble[1] = Shapes.AddImage(lFighter) bubble[2] = Shapes.AddImage(fFighter) bubble[3] = Shapes.AddImage(iFighter) For i = 1 To numBubble Shapes.Zoom(bubble[i],1.5,1.5) 'a little bigger bubbleX[i] = Math.GetRandomNumber(gw) bubbleY[i] = Math.GetRandomNumber(gh) bubbleU[i] = (Math.GetRandomNumber(201)-101)/50*speed bubbleV[i] = (Math.GetRandomNumber(201)-101)/50*speed Shapes.Move(bubble[i],bubbleX[i]-enemiesWidth,bubbleY[i]-enemiesHeight) bubbleOn[i] = 1 EndFor 'Create player and hide cursor player = Shapes.AddImage(pFighter) Shapes.Rotate(player,180) Shapes.Zoom(player,2,2) Mouse.HideCursor() While (lives > 0) 'Do nothing if in pause While (pause = 1) Program.Delay(100) EndWhile currentTime = Clock.ElapsedMilliseconds If (freezeOn = 0) Then For i = 1 To numEnemies If (enemiesOn[i] = 1) Then 'Update the shape centre position based on velocity enemiesX[i] = enemiesX[i]+enemiesU[i] enemiesY[i] = enemiesY[i]+enemiesV[i] 'Bounce the shape when it his a side wall If (enemiesX[i] < enemiesWidth) Then enemiesU[i] = -enemiesU[i] enemiesX[i] = enemiesWidth EndIf If (enemiesX[i] > gw-enemiesWidth) Then enemiesU[i] = -enemiesU[i] enemiesX[i] = gw-enemiesWidth EndIf 'Reimerge shape from top when it passes off the bottom or top If (enemiesY[i] < 0) Then enemiesY[i] = gh EndIf If (enemiesY[i] > gh) Then enemiesY[i] = 0 EndIf 'The top left of the shapes are the coordinates requires - so the centre is at (enemiesX[0],enemiesY[0]) Shapes.Move(enemies[i], enemiesX[i]-enemiesWidth, enemiesY[i]-enemiesHeight) EndIf EndFor EndIf 'Move Player with mouse - use mouse coordinates so that it still records position if outside GraphicsWindow xM = Mouse.MouseX yM = Mouse.MouseY If (yM >gh) Then 'Cannot hide off the bottom and keep firing yM = gh EndIf 'xM = GraphicsWindow.MouseX 'yM = GraphicsWindow.MouseY Shapes.Move(player,xM-enemiesWidth,yM-enemiesWidth) 'Create bullets - cycle through maximum of 20 bullets If (fire = 1) Then fire = 0 nextBullet = nextBullet+1 If (nextBullet > nbullet) Then nextBullet = 1 EndIf If (bulletOn[nextBullet] = 0) Then Shapes.ShowShape(bullet[nextBullet]) bulletX[nextBullet] = xM bulletY[nextBullet] = yM bulletOn[nextBullet] = 1 score = score-1 'Loose a point for each shot fired EndIf EndIf 'Update, move and delete bullets as they leave the top For i = 1 To nbullet If (bulletOn[i] = 1) Then bulletY[i] = bulletY[i]-bulletSpeed Shapes.Move(bullet[i],bulletX[i]-2,bulletY[i]-5) If (bulletY[i] < 0) Then bulletOn[i] = 0 Shapes.HideShape(bullet[i]) EndIf EndIf EndFor 'Update bubbles For i = 1 To numBubble If (bubbleOn[i] = 1) Then bubbleX[i] = bubbleX[i]+bubbleU[i] bubbleY[i] = bubbleY[i]+bubbleV[i] If (bubbleX[i] < enemiesWidth) Then bubbleU[i] = -bubbleU[i] bubbleX[i] = enemiesWidth EndIf If (bubbleX[i] > gw-enemiesWidth) Then bubbleU[i] = -bubbleU[i] bubbleX[i] = gw-enemiesWidth EndIf If (bubbleY[i] < enemiesHeight) Then bubbleV[i] = -bubbleV[i] bubbleY[i] = enemiesHeight EndIf If (bubbleY[i] > gh-enemiesHeight) Then bubbleV[i] = -bubbleV[i] bubbleY[i] = gh-enemiesHeight EndIf Shapes.Move(bubble[i],bubbleX[i]-enemiesWidth,bubbleY[i]-enemiesHeight) EndIf EndFor 'Update laser position and check for hits If (laserOn = 1) Then 'Flash and move laser with player ship flashLaser = 1-flashLaser Shapes.SetOpacity(laser,60+40*flashLaser) Shapes.Move(laser,xM-2,yM-gw/2) For j = 1 To numEnemies If (enemiesOn[j] = 1) Then dx = Math.Abs(xM-enemiesX[j]) If (dx < proximity And yM > enemiesY[j]) Then Shapes.HideShape(enemies[j]) enemiesOn[j] = 0 enemiesShot = enemiesShot+1 score = score+10 '10 points for a kill Sound.PlayClick() EndIf EndIf EndFor If (currentTime-laserStart > 2000) Then '2 sec laser laserOn = 0 Shapes.HideShape(laser) EndIf EndIf 'Update Freeze If (freezeOn = 1) Then If (currentTime-freezeStart > 5000) Then '5 sec freeze freezeOn = 0 EndIf EndIf 'Update Invincibility If (invincibleOn = 1) Then '5 sec invincible If (currentTime-invincibleStart < 4500) Then 'Flash player Shapes.Move(halo,xM-haloRadius,yM-haloRadius) Shapes.ShowShape(halo) flashPlayer = 1-flashPlayer Shapes.SetOpacity(player,20+40*flashPlayer) Shapes.SetOpacity(halo,20+40*flashPlayer) ElseIf (currentTime-invincibleStart < 5000) Then '0.5 sec before vulnerable return opacity Sound.PlayChimes() 'Doesn't do anything here? Shapes.SetOpacity(player,100) Shapes.HideShape(halo) Else invincibleOn = 0 EndIf EndIf 'Hit detection For j = 1 To nbullet If (bulletOn[j] = 1) Then For i = 1 To numEnemies If (enemiesOn[i] = 1) Then dx = Math.Abs(bulletX[j]-enemiesX[i]) dy = Math.Abs(bulletY[j]-enemiesY[i]) If (dx < proximity And dy < proximity) Then bulletOn[j] = 0 Shapes.HideShape(bullet[j]) killEnemy() score = score+10 '10 points for a kill Sound.PlayClick() EndIf EndIf EndFor 'Laser bubble If (bubbleOn[1] = 1) Then dx = Math.Abs(bulletX[j]-bubbleX[1]) dy = Math.Abs(bulletY[j]-bubbleY[1]) If (dx < proximity And dy < proximity) Then laserOn = 1 laserStart = currentTime Shapes.ShowShape(laser) Shapes.HideShape(bubble[1]) bubbleOn[1] = 0 score = score+20 Sound.PlayClick() EndIf EndIf 'Freeze bubble If (bubbleOn[2] = 1) Then dx = Math.Abs(bulletX[j]-bubbleX[2]) dy = Math.Abs(bulletY[j]-bubbleY[2]) If (dx < proximity And dy < proximity) Then freezeOn = 1 freezeStart = currentTime Shapes.HideShape(bubble[2]) bubbleOn[2] = 0 score = score+20 Sound.PlayClick() EndIf EndIf 'Invincible bubble If (bubbleOn[3] = 1) Then dx = Math.Abs(bulletX[j]-bubbleX[3]) dy = Math.Abs(bulletY[j]-bubbleY[3]) If (dx < proximity And dy < proximity) Then invincibleOn = 1 invincibleStart = currentTime Shapes.HideShape(bubble[3]) bubbleOn[3] = 0 score = score+20 Sound.PlayClick() EndIf EndIf EndIf EndFor 'Crash detection For i = 1 To numEnemies If (enemiesOn[i] = 1) Then dx = Math.Abs(xM-enemiesX[i]) dy = Math.Abs(yM-enemiesY[i]) If (dx < proximity And dy < proximity) Then killEnemy() If (invincibleOn = 0) Then lives = lives-1 Sound.PlayBellRing() Else Sound.PlayClick() EndIf EndIf EndIf EndFor 'Output score GraphicsWindow.Title = "Level "+level+" Lives "+lives+" Score "+score 'Restart next level If (enemiesShot = numEnemies) Then Goto NewLevel EndIf '10 ms delay corrected for time spend doing the program - smoother this way! delay = 10-(Clock.ElapsedMilliseconds-currentTime) If (delay > 0) Then Program.Delay(delay) 'Small delay in the movement EndIf EndWhile 'End of game and restart after 5 sec If (score > highScore) Then highScore = score ' The following line could be harmful and has been automatically commented. ' File.WriteContents(Program.Directory+"/highScore.txt",highScore) EndIf GraphicsWindow.BrushColor = "Red" GraphicsWindow.FontSize = 50 GraphicsWindow.DrawText(50,50,"You got to level "+level) GraphicsWindow.DrawText(50,100,"Your score is "+score) GraphicsWindow.DrawText(50,150,"The high score is "+highScore) Program.Delay(5000) Goto Restart 'Subroutines Sub OnMouseDown fire = 1 EndSub Sub OnKeyDown key = GraphicsWindow.LastKey If (key = "Space") Then pause = 1-pause 'toggle pause ElseIf (key = "Escape") Then Program.End() EndIF EndSub Sub killEnemy Shapes.HideShape(enemies[i]) enemiesOn[i] = 0 enemiesShot = enemiesShot+1 EndSub End>GFR568.sb< Start>GFR649.sb< ' Adding animation of the character and enemy GraphicsWindow.Hide() version = 1 versionpoint = 5 GraphicsWindow.Height = 400 GraphicsWindow.Width = 600 GraphicsWindow.Top = 300 GraphicsWindow.Left = 800 GraphicsWindow.Title = "FairyTail " + version + "." + versionpoint GraphicsWindow.CanResize = "False" TextWindow.Show() TextWindow.Top= 300 TextWindow.Left = 0 load() 'Loads the popup and the initizializers for display start() ' - loads the saves or makes them and gets the variables in them. options()'- loads the actions for going about the windows '------------------------------------------------------------------------- Sub picsmus Sound.Play("http://media.soundcloud.com/stream/ze3uwIMn5S0x.mp3") magnolia = "http://vignette3.wikia.nocookie.net/fairytail/images/9/9b/Magnolia_Town.jpg/revision/latest?cb=20100810081706" '169 x 298 Fairytailpic = "https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRETJJPULxP_cU9U7lLC5gtQZDiF5Uo-TVwEVXXz8-1w44AGW7b" '168 x 300' GraphicsWindow.DrawResizedImage(magnolia, 0,0, 610, 300) GraphicsWindow.DrawResizedImage("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRQHAgloSvIJBIrvBEQ9V5bcvfdvkcEoKwSx095ff7yZl-JxuIeEg", 0, 300, 600, 400) try = 12 fairytailpic1 = Shapes.AddImage(Fairytailpic) Shapes.Move(fairytailpic1, 150, -168) Shapes.Animate(fairytailpic1, 150, 116, 4000) Program.Delay(4000) For i = 100 To 0 Step -1 Shapes.SetOpacity(fairytailpic1, i ) Program.Delay(50) endfor endsub '------------------------------------------------------------------------- Sub intro GraphicsWindow.BrushColor = "white" backgroundshape = Shapes.AddRectangle(400, 180) Shapes.Move(backgroundshape, 100, 100) introscript[1] = "Welcome To Magnolia, home of wizards and witches." introscript[2] ="You will be enbarking on many quests defeating" introscript[3] = "evil as well as learning about you hidden powers." introscript[4] = "To learn more about your powers, you will level up and do quests." GraphicsWindow.BrushColor= "Red" introscript1 = Shapes.AddText(introscript[1]) Shapes.Move(introscript1, 100, 100) introscript2 = Shapes.AddText(introscript[2]) Shapes.Move(introscript2, 100, 120) introscript3 = Shapes.AddText(introscript[3]) Shapes.Move(introscript3, 100, 140) introscript4 = Shapes.AddText(introscript[4]) Shapes.Move(introscript4, 100, 160) Program.Delay(5000) Shapes.Remove(introscript1) Shapes.Remove(introscript2) Shapes.Remove(introscript3) Shapes.Remove(introscript4) Shapes.Remove(backgroundshape) endsub '------------------------------------------------------------------------- Sub Tries try = 12 tryagain: GraphicsWindow.BrushColor = "Black" TextWindow.WriteLine("you have: " + try + " tries left") magicnumber = Math.GetRandomNumber(4) If magicnumber = 1 Then player_magic_type = "Fire" player_move1 = "Fireball" player_move2 = "Fire Bullets" player_move3 = "Brilliant Flame" ElseIf magicnumber = 2 Then player_magic_type = "Water" player_move1 = "Water Lock" player_move2 = "Water Wall" player_move3 = "Tsunami" Elseif magicnumber = 3 Then player_magic_type = "Wind" player_move1 = "Wind Shurikens" player_move2 = "Wind Blast" player_move3 = "Storm Bringer" Elseif magicnumber = 4 Then player_magic_type = "Lightning" player_move1 = "Lightning Bolt" player_move2 = "Lightning Shockwave" player_move3 = "Lightning Storm" Endif TextWindow.WriteLine("Your magic type is " + player_magic_type) TextWindow.WriteLine("Do you like your magic?") answer = TextWindow.Read() If answer = "no" Then If try <> 0 then try = try - 1 TextWindow.Clear() Goto tryagain Else Goto stay EndIf ElseIf answer = "yes" then stay: TextWindow.WriteLine("your moves are: " + player_move1 + ". As you level up you will gain more moves.") player_level = 0 player_level_health = 100 player_health = 100 player_magic_type = player_magic_type player_strength = 50 player_magic_strength = 100 magic_energy_take = 100 player_magic_energy = 300 player_exp = 0 player_exp_level = 1 player_magic_energy_limit = 300 speed = 2 EndIf endsub '------------------------------------------------------------------------- Sub start TextWindow.WriteLine("Do you have slow internet? 1 = yes/ 2 =no") lag = TextWindow.Readnumber() GraphicsWindow.Show() If lag = 2 Then picsmus() Else field() EndIf nowenergy = 0 o = 0 p= 0 init() TextWindow.WriteLine("Have you ever played before? yes/no") playedbefore = TextWindow.Read() If playedbefore = "yes" Then getsaves() showstats() display() Else intro() Tries() makesaves() getsaves() showstats() display() EndIf EndSub Sub field GraphicsWindow.BrushColor= "SkyBlue" GraphicsWindow.fillRectangle(0,0 610, 300) GraphicsWindow.BrushColor="brown" GraphicsWindow.fillRectangle(0, 300, 610, 400) GraphicsWindow.DrawLine(0, 333, 610,333) GraphicsWindow.DrawLine(0, 366, 610,366) startbrick = 0 startbrickdown = 300 For j = 1 to 10 Step 1 endbrick = startbrick endbrickdown = startbrickdown + 33 brick[j] = Shapes.AddLine(startbrick, startbrickdown, endbrick, endbrickdown) startbrick = endbrick + 60 EndFor startbrick = -30 startbrickdown = 333 For j = 1 to 11 Step 1 endbrick = startbrick endbrickdown = startbrickdown + 33 brick[j] = Shapes.AddLine(startbrick, startbrickdown, endbrick, endbrickdown) startbrick = endbrick + 60 EndFor startbrick = 0 startbrickdown = 366 For j = 1 to 10 Step 1 endbrick = startbrick endbrickdown = startbrickdown + 33 brick[j] = Shapes.AddLine(startbrick, startbrickdown, endbrick, endbrickdown) startbrick = endbrick + 60 EndFor endsub '------------------------------------------------------------------------- Sub load GraphicsWindow.ShowMessage("PLEASE WAIT WHILE ASSETS ARE LOADING!! GAME IS PRETTY FAST, IF YOU EXPEREINCE LAG, ITS YOUR INTERNET", "PLEASE WAIT") GraphicsWindow.ShowMessage("Developed by JetFire3201 and RussianBrain", "Devs") endsub '------------------------------------------------------------------------- Sub grassbattlefield ' changes background TextWindow.WriteLine("PLEASE WAIT WHILE WE GET THE IMAGE!!!") grassbattlefield = "http://stockarch.com/files/12/03/green_field_background.jpg" GraphicsWindow.DrawResizedImage(grassbattlefield, 0,0, 610, 410) endsub '------------------------------------------------------------------- Sub fight If lag = 2 Then grassbattlefield() EndIf character() ' loads the character gui enemy() 'loads enemy gui eaction = 0 While enemyhealth > 0 and player_health > 0 display() enemydisplay() If player_magic_type= "Fire"Then fireanimation() ElseIf player_magic_type= "Water" then wateranimation() elseif player_magic_type = "Wind" then windanimation() elseif player_magic_type = "Lightning" then lightninganimation() EndIf If player_magic_type= "Fire" and magic = 4 Then probabilityofhitting = Math.Abs(speed/(speed+enemyspeed*4) * 100) ElseIf player_magic_type= "Water" and magic = 4 then probabilityofhitting = Math.Abs(speed/(speed+enemyspeed*4) * 100) elseif player_magic_type = "Wind" and magic = 4 then probabilityofhitting = Math.Abs(speed/(speed+enemyspeed*4) * 100) elseif player_magic_type = "Lightning" and magic = 4 then probabilityofhitting = Math.Abs(speed/(speed+enemyspeed) * 100) Elseif player_magic_type = "Lightning" and magic <> 4 then probabilityofhitting = Math.Abs(speed*4/(speed*4+enemyspeed) * 100) Else probabilityofhitting = Math.Abs(speed/(speed+enemyspeed) * 100) EndIf TextWindow.WriteLine("Probability of hitting for player = " + probabilityofhitting) probabilitynum = Math.GetRandomNumber(100) TextWindow.WriteLine("Your number was " + probabilitynum) If eaction=0 then enemyhasnotattackedyet() Else enemyhasattacked() endif TextWindow.WriteLine("Enemy health is " + enemyhealth) display() ' remakes display If enemyhealth < 0 Or enemyhealth = 0 Then 'checks to see if you one ko the enemy Goto skip Else EndIf 'does enemy probablility now If magic = 1 Then probabilityofhitting = Math.Abs(enemyspeed/(speed+enemyspeed) * 100) ElseIf magic = 2 then probabilityofhitting = Math.Abs(enemyspeed/(speed+enemyspeed) * 100) elseif magic = 3 then probabilityofhitting = Math.Abs(enemyspeed/(speed+enemyspeed) * 100) elseif magic = 4 then probabilityofhitting = Math.Abs(enemyspeed*4/(speed+enemyspeed*4) * 100) EndIf TextWindow.WriteLine("Probablility of enemy hitting is = " + probabilityofhitting) ' if the enemy speed is 90 and your speed is 100, enemy has a 2 percent chance of hitting you probabilitynum = Math.GetRandomNumber(100) TextWindow.WriteLine("Enemy probability was " + probabilitynum) If magic = 1 then enemyfire() ' enemy turn TextWindow.WriteLine("enemy action was " +eaction) ElseIf magic = 2 then enemywater() TextWindow.WriteLine("enemy action was " +eaction) elseif magic = 3 then enemywind() TextWindow.WriteLine("enemy action was " +eaction) elseif magic = 4 then enemylightning() TextWindow.WriteLine("enemy action was " +eaction) endif playernowdefends() enemydisplay() ' shows enemy display skip: TextWindow.WriteLine("Player health is " + player_health) If enemyhealth < 0 Then GraphicsWindow.ShowMessage("You won", "Player won") display() expearnfromenemy() ElseIf player_health < 0 then GraphicsWindow.ShowMessage("You lost", "Player lost") EndIf EndWhile player_health = player_level_health Shapes.Remove(ehead) Shapes.Remove(eleg1) Shapes.Remove(eleg2) Shapes.Remove(emarm) Shapes.Remove(elarm) Shapes.Remove(etorso) Shapes.Remove(enemyhealthpic) display() endsub '------------------------------------------- sub playernowdefends ' player is now defending If probabilitynum <= probabilityofhitting Then If magic = 1 then enemyhasfireattack() elseif magic = 2 then enemyhaswaterattack() elseif magic=3 then enemyhaswindattack() elseif magic = 4 then 'enemyhaslightningattack() EndIf endif EndSub Sub enemyhasattacked If magic = 1 Then ' enemy has fire enemyhasfiredefense() elseIf magic = 2 Then enemyhaswaterdefense() elseIf magic = 3 Then enemyhaswinddefense() elseIf magic = 4 Then ' enemyhaslightningdefense() EndIf endsub Sub enemyhasnotattackedyet If player_magic_type = "Fire" Then playerhasfireattack() ElseIf player_magic_type = "Water" then playerhaswaterattack() EndIf EndSub '-------------------------------------------------------------------------- Sub enemyhasfiredefense ' enemy has fire magic and is defending If player_magic_type = "Fire" Or player_magic_type = "Lightning" Then If actionr = 1 then enemyhealth = enemyhealth - player_magic_strength elseIf actionr = 2 then enemyhealth = enemyhealth - player_magic_strength*2 elseIf actionr = 3 then enemyhealth = enemyhealth - player_magic_strength*3 endif ElseIf player_magic_type = "Water" then If actionr = 1 then enemyhealth = enemyhealth - player_magic_strength*2 elseIf actionr = 2 then enemyhealth = enemyhealth - player_magic_strength*3 elseIf actionr = 3 then enemyhealth = enemyhealth - player_magic_strength*4 endif elseif player_magic_type = "Wind" then If actionr = 1 then enemyhealth = enemyhealth elseIf actionr = 2 then enemyhealth = enemyhealth - player_magic_strength elseIf actionr = 3 then enemyhealth = enemyhealth - player_magic_strength*2 endif EndIf EndSub Sub enemyhasfireattack 'enemy has fire and is attacking If player_magic_type = "Fire" Or player_magic_type = "Lightning" then If eaction = 1 then player_health = player_health-enemy_strength elseIf eaction = 2 then player_health = player_health-enemy_strength*2 elseIf eaction = 3 then player_health = player_health-enemy_strength*3 endif ElseIf player_magic_type = "Wind" then If eaction = 1 then player_health = player_health-enemy_strength*2 elseIf eaction = 2 then player_health = player_health-enemy_strength*3 elseIf eaction = 3 then player_health = player_health-enemy_strength*4 endif elseif player_magic_type = "Water" then If eaction = 1 then player_health = player_health elseIf eaction = 2 then player_health = player_health-enemy_strength elseIf eaction = 3 then player_health = player_health-enemy_strength*2 endif EndIf EndSub '----------------------------------------------------------------------------------------- Sub playerhasfireattack ' player has fire magic and is attacking If magic <> 2 Or magic <> 3 then If actionr = 1 then enemyhealth = enemyhealth - player_magic_strength elseIf actionr = 2 then enemyhealth = enemyhealth - player_magic_strength*2 elseIf actionr = 3 then enemyhealth = enemyhealth - player_magic_strength*3 endif ElseIf magic = 2 then If actionr = 1 then enemyhealth = enemyhealth elseIf actionr = 2 then enemyhealth = enemyhealth - player_magic_strength elseIf actionr = 3 then enemyhealth = enemyhealth - player_magic_strength*2 endif ElseIf magic = 3 then If actionr = 1 then enemyhealth = enemyhealth- player_magic_strength*2 elseIf actionr = 2 then enemyhealth = enemyhealth - player_magic_strength*3 elseIf actionr = 3 then enemyhealth = enemyhealth - player_magic_strength*4 endif EndIf EndSub Sub playerhasfiredefense ' player has fire magic and is now defending If magic = 1 Or magic = 4 Then If eaction = 1 Then player_health = player_health -enemy_strength ElseIf eaction = 2 then player_health = player_health - enemy_strength*2 ElseIf eaction = 3 then player_health = player_health - enemy_strength*3 EndIf ElseIf magic = 2 then If eaction = 1 Then player_health = player_health-enemy_strength*2 ElseIf eaction = 2 then player_health = player_health -enemy_strength*3 ElseIf eaction = 3 then player_health = player_health - enemy_strength*4 EndIf elseif magic = 3 then If eaction = 1 Then player_health = player_health ElseIf eaction = 2 then player_health = player_health -enemy_strength ElseIf eaction = 3 then player_health = player_health - enemy_strength*2 EndIf EndIf EndSub '---------------------------------------------------------------------------------- Sub playerhaswaterattack ' player has water and is attacking If magic = 2 Or magic = 3 then If actionr = 1 then enemyhealth = enemyhealth - player_magic_strength elseIf actionr = 2 then enemyhealth = enemyhealth - player_magic_strength*2 elseIf actionr = 3 then enemyhealth = enemyhealth - player_magic_strength*3 endif ElseIf magic = 1 then If actionr = 1 then enemyhealth = enemyhealth elseIf actionr = 2 then enemyhealth = enemyhealth - player_magic_strength elseIf actionr = 3 then enemyhealth = enemyhealth - player_magic_strength*2 endif elseif magic = 4 then If actionr = 1 then enemyhealth = enemyhealth elseIf actionr = 2 then enemyhealth = enemyhealth - player_magic_strength elseIf actionr = 3 then enemyhealth = enemyhealth - player_magic_strength*2 endif EndIf EndSub Sub playerhaswaterdefense ' player has water and is defending If magic =2 Or magic = 3 then If eaction = 1 then player_health = player_health - enemy_strength elseIf eaction = 2 then player_health = player_health - enemy_strength *2 elseIf eaction = 3 then player_health = player_health - enemy_strength*3 endif ElseIf magic = 1 then If eaction = 1 then player_health = player_health elseIf eaction = 2 then player_health = player_health-enemy_strength elseIf eaction = 3 then player_health = player_health - enemy_strength*2 endif elseif magic = 4 then If eaction = 1 then player_health = player_health-enemy_strength*2 elseIf eaction = 2 then player_health = player_health - enemy_strength *3 elseIf eaction = 3 then player_health = player_health - enemy_strength*4 endif EndIf EndSub '-------------------------------------------------------------------------------------- Sub enemyhaswaterattack 'enemy has water and is attacking If player_magic_type = "Water" Or player_magic_type = "Wind" then If eaction = 1 then player_health = player_health-enemy_strength elseIf eaction = 2 then player_health = player_health-enemy_strength*2 elseIf eaction = 3 then player_health = player_health-enemy_strength*3 endif ElseIf player_magic_type = "Fire" then If eaction = 1 then player_health = player_health-enemy_strength*2 elseIf eaction = 2 then player_health = player_health-enemy_strength*3 elseIf eaction = 3 then player_health = player_health-enemy_strength*4 endif elseif player_magic_type = "Lightning" then If eaction = 1 then player_health = player_health elseIf eaction = 2 then player_health = player_health-enemy_strength elseIf eaction = 3 then player_health = player_health-enemy_strength*2 endif EndIf EndSub Sub enemyhaswaterdefense ' player has water and is defending If player_magic_type ="Water" Or player_magic_type = "Wind" then If actionr = 1 then enemy_health = enemy_health - player_magic_strength elseIf actionr = 2 then enemy_health = enemy_health - player_magic_strength *2 elseIf actionr = 3 then enemy_health = enemy_health - player_magic_strength*3 endif ElseIf player_magic_type= "Fire" then If actionr = 1 then enemy_health = enemy_health elseIf actionr = 2 then enemy_health = enemy_health - player_magic_strength elseIf actionr = 3 then enemy_health = enemy_health - player_magic_strength*2 endif elseif magic = "Lightning" then If actionr = 1 then enemy_health = enemy_health - player_magic_strength*2 elseIf actionr = 2 then enemy_health = enemy_health - player_magic_strength*3 elseIf actionr = 3 then enemy_health = enemy_health - player_magic_strength*4 endif EndIf EndSub '-------------------------------------------------------------------------- Sub playerhaswindattack ' player has wind and is attacking If magic = 2 Or magic = 3 then If actionr = 1 then enemyhealth = enemyhealth - player_magic_strength elseIf actionr = 2 then enemyhealth = enemyhealth - player_magic_strength*2 elseIf actionr = 3 then enemyhealth = enemyhealth - player_magic_strength*3 endif ElseIf magic = 1 then If actionr = 1 then enemyhealth = enemyhealth elseIf actionr = 2 then enemyhealth = enemyhealth - player_magic_strength elseIf actionr = 3 then enemyhealth = enemyhealth - player_magic_strength*2 endif elseif magic = 4 then If actionr = 1 then enemyhealth = enemyhealth -player_magic_strength elseIf actionr = 2 then enemyhealth = enemyhealth - player_magic_strength*2 elseIf actionr = 3 then enemyhealth = enemyhealth - player_magic_strength*3 endif EndIf EndSub Sub playerhaswinddefense ' player has wind and is defending If magic =2 Or magic = 3 then If eaction = 1 then player_health = player_health - enemy_strength elseIf eaction = 2 then player_health = player_health - enemy_strength *2 elseIf eaction = 3 then player_health = player_health - enemy_strength*3 endif ElseIf magic = 1 then If eaction = 1 then player_health = player_health-enemy_strength*2 elseIf eaction = 2 then player_health = player_health - enemy_strength *3 elseIf eaction = 3 then player_health = player_health - enemy_strength*4 endif elseif magic = 4 then If eaction = 1 then player_health = player_health elseIf eaction = 2 then player_health = player_health - enemy_strength elseIf eaction = 3 then player_health = player_health - enemy_strength*2 endif EndIf EndSub '-------------------------------------------------------------------------------- Sub enemyhaswindattack 'enemy has wind and is attacking If player_magic_type = "Water" Or player_magic_type = "Wind" then If eaction = 1 then player_health = player_health-enemy_strength elseIf eaction = 2 then player_health = player_health-enemy_strength*2 elseIf eaction = 3 then player_health = player_health-enemy_strength*3 endif ElseIf player_magic_type = "Fire" then If eaction = 1 then player_health = player_health elseIf eaction = 2 then player_health = player_health-enemy_strength elseIf eaction = 3 then player_health = player_health-enemy_strength*2 endif elseif player_magic_type = "Lightning" then If eaction = 1 then player_health = player_health - enemy_strength*2 elseIf eaction = 2 then player_health = player_health-enemy_strength*3 elseIf eaction = 3 then player_health = player_health-enemy_strength*4 endif EndIf EndSub Sub enemyhaswinddefense 'enemy has wind and is defending If player_magic_type ="Water" Or player_magic_type = "Wind" then If actionr = 1 then enemy_health = enemy_health - player_magic_strength elseIf actionr = 2 then enemy_health = enemy_health - player_magic_strength *2 elseIf actionr = 3 then enemy_health = enemy_health - player_magic_strength*3 endif ElseIf player_magic_type= "Fire" then If actionr = 1 then enemy_health = enemy_health - player_magic_strength*2 elseIf actionr = 2 then enemy_health = enemy_health - player_magic_strength*3 elseIf actionr = 3 then enemy_health = enemy_health - player_magic_strength*4 endif elseif magic = "Lightning" then If actionr = 1 then enemy_health = enemy_health elseIf actionr = 2 then enemy_health = enemy_health - player_magic_strength elseIf actionr = 3 then enemy_health = enemy_health - player_magic_strength*2 endif EndIf EndSub '------------------------------------------------------------------------------------------------- Sub playerhaslightningeattack ' player has lightning magic and is attacking If magic <> 2 Or magic <> 3 then If actionr = 1 then enemyhealth = enemyhealth - player_magic_strength elseIf actionr = 2 then enemyhealth = enemyhealth - player_magic_strength*2 elseIf actionr = 3 then enemyhealth = enemyhealth - player_magic_strength*3 endif ElseIf magic = 2 then If actionr = 1 then enemyhealth = enemyhealth- player_magic_strength*2 elseIf actionr = 2 then enemyhealth = enemyhealth - player_magic_strength*3 elseIf actionr = 3 then enemyhealth = enemyhealth - player_magic_strength*4 endif ElseIf magic = 3 then If actionr = 1 then enemyhealth = enemyhealth elseIf actionr = 2 then enemyhealth = enemyhealth - player_magic_strength elseIf actionr = 3 then enemyhealth = enemyhealth - player_magic_strength*2 endif EndIf EndSub Sub playerhaslightningdefense ' player has lightning magic and is now defending If magic = 1 Or magic = 4 Then If eaction = 1 Then player_health = player_health -enemy_strength ElseIf eaction = 2 then player_health = player_health - enemy_strength*2 ElseIf eaction = 3 then player_health = player_health - enemy_strength*3 EndIf ElseIf magic = 2 then If eaction = 1 Then player_health = player_health ElseIf eaction = 2 then player_health = player_health -enemy_strength ElseIf eaction = 3 then player_health = player_health - enemy_strength*2 EndIf elseif magic = 3 then If eaction = 1 Then player_health = player_health - enemy_strength*2 ElseIf eaction = 2 then player_health = player_health -enemy_strength*3 ElseIf eaction = 3 then player_health = player_health - enemy_strength*4 EndIf EndIf EndSub '------------------------------------------------------------------------------------ Sub enemyhaslightningdefense ' enemy haslightning magic and is defending If player_magic_type = "Fire" or player_magic_type = "Lightning" Then If actionr = 1 then enemyhealth = enemyhealth - player_magic_strength elseIf actionr = 2 then enemyhealth = enemyhealth - player_magic_strength*2 elseIf actionr = 3 then enemyhealth = enemyhealth - player_magic_strength*3 endif ElseIf player_magic_type = "Water" then If actionr = 1 then enemyhealth = enemyhealth - player_magic_strength*2 elseIf actionr = 2 then enemyhealth = enemyhealth - player_magic_strength*3 elseIf actionr = 3 then enemyhealth = enemyhealth - player_magic_strength*4 endif elseif player_magic_type = "Wind" then If actionr = 1 then enemyhealth = enemyhealth elseIf actionr = 2 then enemyhealth = enemyhealth- player_magic_strength elseIf actionr = 3 then enemyhealth = enemyhealth - player_magic_strength*4 endif EndIf EndSub Sub enemyhaslightningattack 'enemy has lighting and is attacking If player_magic_type = "Fire" Or player_magic_type = "Lightning" then If eaction = 1 then player_health = player_health-enemy_strength elseIf eaction = 2 then player_health = player_health-enemy_strength*2 elseIf eaction = 3 then player_health = player_health-enemy_strength*3 endif ElseIf player_magic_type = "Wind" then If eaction = 1 then player_health = player_health-enemy_strength*2 elseIf eaction = 2 then player_health = player_health-enemy_strength*3 elseIf eaction = 3 then player_health = player_health-enemy_strength*4 endif elseif player_magic_type = "Water" then If eaction = 1 then player_health = player_health elseIf eaction = 2 then player_health = player_health-enemy_strength elseIf eaction = 3 then player_health = player_health-enemy_strength*2 endif EndIf EndSub '-------------------------------------------------------------------------------- Sub windanimation gain = "true" GraphicsWindow.penColor ="White" GraphicsWindow.BrushColor="White" TextWindow.WriteLine("1. Wind shurikens") TextWindow.WriteLine("2.Wind Blast") TextWindow.WriteLine("3. Storm Bringer") TextWindow.WriteLine("4. Gather Energy") TextWindow.WriteLine("5. Leave") actionr = TextWindow.Read() If actionr = 1 then If player_magic_energy >= 100 then player_magic_energy = player_magic_energy -100 wordline = Shapes.AddLine(110, 220, 90, 190) word = Shapes.AddText("Wind Shurikens") Shapes.Move(word, 90, 180) Program.Delay(1000) Shapes.Remove(marm) marm = Shapes.AddLine(110, 245, 135, 245) firstwind = Shapes.addRectangle(2, 30) secondgust = Shapes.AddRectangle(30, 2) firstwind2 = Shapes.addRectangle(2, 30) secondgust2 = Shapes.AddRectangle(30, 2) Shapes.Move(firstwind, 150, 230) Shapes.Move(secondgust, 135, 245) Shapes.Move(firstwind2, 150, 255) Shapes.Move(secondgust2, 135, 270) Shapes.Animate(firstwind, 475, 230, 1000) Shapes.Animate(secondgust, 460, 245, 1000) Shapes.Animate(firstwind2, 490, 2555, 1000) Shapes.Animate(secondgust2, 475, 270, 1000) For i = 0 To 36000 Step 1 Shapes.Rotate(firstwind, i) Shapes.Rotate(secondgust, i) Shapes.Rotate(firstwind2, i) Shapes.Rotate(secondgust2, i) endfor For i = 100 To 0 step -1 Shapes.SetOpacity(firstwind, i) Shapes.SetOpacity(firstwind2, i) Shapes.SetOpacity(secondgust, i) Shapes.SetOpacity(secondgust2, i) Program.Delay(25) endfor Shapes.Remove(marm) marm = Shapes.AddLine(110, 245, 120, 270) TextWindow.Pause() Else TextWindow.WriteLine("You do not have enough energy (100)") gain = "false" endif ElseIf actionr = 2 then If player_magic_energy >= 200 and player_level >= 11 then wordline = Shapes.AddLine(110, 220, 90, 190) word = Shapes.AddText("Wind Blast") Shapes.Move(word, 90, 180) Program.Delay(1000) player_magic_energy = player_magic_energy -200 GraphicsWindow.PenColor = "Black" GraphicsWindow.BrushColor = "white" windshell = Shapes.AddEllipse(100, 100) Shapes.HideShape(windshell) Shapes.SetOpacity(windshell, 0) Shapes.Move(windshell, 70, 210) Shapes.ShowShape(windshell) For i = 0 to 100 step 1 Shapes.SetOpacity(windshell, i) Program.Delay(45) endfor Shapes.Zoom(windshell,20, 20) For i = 100 to 0 step -1 Shapes.SetOpacity(windshell, i) Program.Delay(40) endfor TextWindow.Pause() Else TextWindow.WriteLine("You do not have enough energy (200) or you are not level 7") gain = "false" endif elseif actionr = 3 then If player_magic_energy >= 300 and player_level >= 30 then wordline = Shapes.AddLine(110, 220, 90, 190) word = Shapes.AddText("Wind Storm") Shapes.Move(word, 90, 180) Program.Delay(1000) player_magic_energy = player_magic_energy - 300 Shapes.Remove(larm) Shapes.Remove(marm) larm = Shapes.AddLine(110, 245,100, 220) marm = Shapes.AddLine(110, 245, 120, 220) GraphicsWindow.PenColor="black" GraphicsWindow.BrushColor="white" For i = 1 To 20 Step 1 goingdown[i] = Shapes.AddEllipse(20+i, 10) Shapes.HideShape(goingdown[i]) Shapes.SetOpacity(goingdown[i], 40) endfor For i = 1 To 20 Step 1 move[i] = 500 - (i/2) Shapes.Move(goingdown[i], move[i], 0) endfor For i = 1 To 20 Step 1 k = k+6 Shapes.Move(goingdown[i], move[i], 190 + k) endfor For i = 1 To 20 Step 1 Shapes.ShowShape(goingdown[i]) Program.Delay(40) EndFor Shapes.Remove(larm) Shapes.Remove(marm) larm = Shapes.AddLine(110, 245, 100, 270) marm = Shapes.AddLine(110, 245, 120, 270) For i = 1 to 20 Step 1 Shapes.Remove(goingdown[i]) endfor TextWindow.Pause() Else TextWindow.WriteLine("You do not have enough energy (300) or you are not level 30") gain = "false" endif elseif actionr = 4 then If player_magic_energy >= player_magic_energy_limit then player_magic_energy = player_magic_energy_limit Else player_magic_energy = player_magic_energy + 200 If player_magic_energy >= player_magic_energy_limit then player_magic_energy = player_magic_energy_limit endif TextWindow.Pause() display() EndIf elseif actionr = 5 then EndIf Shapes.Remove(word) Shapes.Remove(wordline) EndSub Sub enemywind eaction = Math.GetRandomNumber(2) If eaction = 1 then GraphicsWindow.PenColor = "Black" Shapes.Remove(elarm) elarm = Shapes.AddLine(510, 245, 485, 245) GraphicsWindow.PenColor= "black" firstwind = Shapes.addRectangle(2, 30) secondgust = Shapes.AddRectangle(30, 2) firstwind2 = Shapes.addRectangle(2, 30) secondgust2 = Shapes.AddRectangle(30, 2) Shapes.Move(firstwind, 485, 230) Shapes.Move(secondgust, 470, 245) Shapes.Move(firstwind2, 485, 255) Shapes.Move(secondgust2, 470, 270) Shapes.Animate(firstwind, 135, 230, 1000) Shapes.Animate(secondgust, 120, 245, 1000) Shapes.Animate(firstwind2, 120, 255, 1000) Shapes.Animate(secondgust2, 105, 270, 1000) For i = 0 To 36000 Step 1 Shapes.Rotate(firstwind, i) Shapes.Rotate(secondgust, i) Shapes.Rotate(firstwind2, i) Shapes.Rotate(secondgust2, i) endfor Program.Delay(3000) For i = 100 To 0 step -1 Shapes.SetOpacity(firstwind, i) Shapes.SetOpacity(firstwind2, i) Shapes.SetOpacity(secondgust, i) Shapes.SetOpacity(secondgust2, i) Program.Delay(25) endfor Shapes.Remove(elarm) elarm = Shapes.AddLine(510, 245, 500, 270) ElseIf eaction = 2 then GraphicsWindow.PenColor = "White" GraphicsWindow.BrushColor = "Black" windshell = Shapes.AddEllipse(100, 100) Shapes.HideShape(windshell) Shapes.SetOpacity(windshell, 0) Shapes.Move(windshell, 470, 210) Shapes.ShowShape(windshell) For i = 0 to 100 step 1 Shapes.SetOpacity(windshell, i) Program.Delay(45) endfor Shapes.Zoom(windshell,20, 20) For i = 100 to 0 step -1 Shapes.SetOpacity(windshell, i) Program.Delay(40) endfor elseif eaction = 3 then GraphicsWindow.PenColor = "Black" Shapes.Remove(elarm) Shapes.Remove(emarm) elarm = Shapes.AddLine(510, 245, 500, 220) emarm = Shapes.AddLine(510, 245, 520, 220) GraphicsWindow.PenColor="black" GraphicsWindow.BrushColor="white" For i = 1 To 20 Step 1 goingdown[i] = Shapes.AddEllipse(20+i, 10) Shapes.HideShape(goingdown[i]) Shapes.SetOpacity(goingdown[i], 40) endfor For i = 1 To 20 Step 1 move[i] = 100 - (i/2) Shapes.Move(goingdown[i], move[i], 0) endfor For i = 1 To 20 Step 1 k = k+6 Shapes.Move(goingdown[i], move[i], 190 + k) endfor For i = 1 To 20 Step 1 Shapes.ShowShape(goingdown[i]) Program.Delay(40) EndFor Shapes.Remove(elarm) Shapes.Remove(emarm) For i = 1 to 20 Step 1 Shapes.Remove(goingdown[i]) endfor GraphicsWindow.PenColor = "Black" elarm = Shapes.AddLine(510, 245, 500, 270) emarm = Shapes.AddLine(510, 245, 520, 270) EndIf EndSub Sub fireanimation gain = "true" GraphicsWindow.penColor ="Red" GraphicsWindow.BrushColor="Red" TextWindow.WriteLine("1. Fireball") TextWindow.WriteLine("2.Fire Bullets") TextWindow.WriteLine("3. Brilliant Flame") TextWindow.WriteLine("4. Gather Energy") TextWindow.WriteLine("5. Leave") actionr = TextWindow.Read() If actionr = 1 then If player_magic_energy >= 100 then wordline = Shapes.AddLine(110, 220, 90, 190) word = Shapes.AddText("Fire Ball") Shapes.Move(word, 90, 180) Program.Delay(1000) Shapes.Remove(marm) marm = Shapes.AddLine(110, 245, 135, 245) player_magic_energy = player_magic_energy - 100 GraphicsWindow.BrushColor = "Red" fireball = Shapes.AddEllipse(20, 20) Shapes.Move(fireball, 135, 235) Shapes.animate(fireball, 465, 235, 3000) Program.Delay(3000) For i = 100 To 0 Step -2 Shapes.Zoom(fireball,10, 10) Shapes.SetOpacity(fireball, i ) Program.Delay(50) endfor shapes.Remove(marm) marm = Shapes.AddLine(110, 245, 120, 270) TextWindow.Pause() Else TextWindow.WriteLine("you do not have enough energy (100)") gain = "false" endif ElseIf actionr = 2 then If player_magic_energy >= 200 and player_level >= 7 then wordline = Shapes.AddLine(110, 220, 90, 190) word = Shapes.AddText("Fire Bullet") Shapes.Move(word, 90, 180) Program.Delay(1000) Shapes.Remove(marm) marm = Shapes.AddLine(110, 245, 135, 245) player_magic_energy = player_magic_energy - 200 GraphicsWindow.BrushColor = "Red" firebullet1 = Shapes.AddEllipse(10,10) firebullet2 = Shapes.AddEllipse(10,10) firebullet3 =Shapes.AddEllipse(10,10) Shapes.Move(firebullet1,135,130) Shapes.Move(firebullet2,135, 241) Shapes.Move(firebullet3,135,252) Shapes.Animate(firebullet1,465,130,100) Program.Delay(100) For i = 100 To 0 Step -5 Shapes.Zoom(firebullet1,5, 5) Shapes.SetOpacity(firebullet1, i ) Program.Delay(25) endfor Shapes.Animate(firebullet2,465,241,100) Program.Delay(100) For i = 100 To 0 Step -5 Shapes.Zoom(firebullet2,5, 5) Shapes.SetOpacity(firebullet2, i ) Program.Delay(25) endfor Shapes.Animate(firebullet3,465,252,100) Program.Delay(100) For i = 100 To 0 Step -5 Shapes.Zoom(firebullet3,5, 5) Shapes.SetOpacity(firebullet3, i ) Program.Delay(25) endfor shapes.Remove(marm) marm = Shapes.AddLine(110, 245, 120, 270) TextWindow.Pause() Else TextWindow.WriteLine("you do not have enough energy (200) or you need to be level 11 or higher") gain = "false" endif elseif actionr = 3 then If player_magic_energy >= 300 and player_level >= 30 then wordline = Shapes.AddLine(110, 220, 90, 190) word = Shapes.AddText("Brilliant Flame") Shapes.Move(word, 90, 180) Program.Delay(1000) Shapes.Remove(marm) marm = Shapes.AddLine(110, 245, 135, 270) player_magic_energy = player_magic_energy - 300 GraphicsWindow.BrushColor = "Yellow" brilliant_flame = Shapes.AddEllipse(10,10) Shapes.Move(brilliant_flame,135,230) Shapes.Animate(brilliant_flame, 465,230,3000) Program.Delay(3000) For i = 100 to 0 step -4 Shapes.Zoom(brilliant_flame, 30,30) Shapes.SetOpacity(brilliant_flame,i) Program.Delay(50) endfor Shapes.Remove(marm) marm = Shapes.AddLine(110, 245, 120, 245) TextWindow.Pause() Else TextWindow.WriteLine("you do not have enough energy (300) or you need to be level 30 or higher") gain = "false" endif elseif actionr = 4 then If player_magic_energy >= player_magic_energy_limit then player_magic_energy = player_magic_energy_limit Else player_magic_energy = player_magic_energy + 200 If player_magic_energy >= player_magic_energy_limit then player_magic_energy = player_magic_energy_limit endif TextWindow.Pause() display() EndIf elseif actionr = 5 then endif Shapes.Remove(word) Shapes.Remove(wordline) endsub Sub enemyfire ' enemy fire animation eaction = Math.GetRandomNumber(3) If eaction = 1 then GraphicsWindow.penColor ="Red" Shapes.Remove(elarm) elarm = Shapes.AddLine(510, 245, 485, 245) GraphicsWindow.BrushColor = "Red" efireball = Shapes.AddEllipse(20, 20) Shapes.Move(efireball, 465, 235) Shapes.animate(efireball, 135, 235, 3000) Program.Delay(3000) For i = 100 To 0 Step -2 Shapes.Zoom(efireball,10, 10) Shapes.SetOpacity(efireball, i ) Program.Delay(50) endfor Shapes.Remove(elarm) elarm = Shapes.AddLine(510, 245, 500, 270) ElseIf eaction = 2 then GraphicsWindow.penColor ="Red" Shapes.Remove(elarm) elarm = Shapes.AddLine(510, 245, 485, 245) GraphicsWindow.BrushColor = "Red" efirebullet1 = Shapes.AddEllipse(10,10) efirebullet2 = Shapes.AddEllipse(10,10) efirebullet3 =Shapes.AddEllipse(10,10) Shapes.Move(efirebullet1,465,230) Shapes.Move(efirebullet2,465, 241) Shapes.Move(efirebullet3,465,252) Shapes.Animate(efirebullet1,135,230,100) Program.Delay(100) For i = 100 To 0 Step -5 Shapes.Zoom(efirebullet1,5, 5) Shapes.SetOpacity(efirebullet1, i ) Program.Delay(25) endfor Shapes.Animate(efirebullet2,135,241,100) Program.Delay(100) For i = 100 To 0 Step -5 Shapes.Zoom(efirebullet2,5, 5) Shapes.SetOpacity(efirebullet2, i ) Program.Delay(25) endfor Shapes.Animate(efirebullet3,135,252,100) Program.Delay(100) For i = 100 To 0 Step -5 Shapes.Zoom(efirebullet3,5, 5) Shapes.SetOpacity(efirebullet3, i ) Program.Delay(25) endfor Shapes.Remove(elarm) elarm = Shapes.AddLine(510, 245, 500, 270) elseif eaction = 3 then GraphicsWindow.penColor ="Red" Shapes.Remove(elarm) elarm = Shapes.AddLine(510, 245, 485, 245) GraphicsWindow.BrushColor = "Yellow" ebrilliant_flame = Shapes.AddEllipse(10,10) Shapes.Move(ebrilliant_flame,465,230) Shapes.Animate(ebrilliant_flame, 135,230,3000) Program.Delay(3000) For i = 100 to 0 step -4 Shapes.Zoom(ebrilliant_flame, 30,30) Shapes.SetOpacity(ebrilliant_flame,i) Program.Delay(50) endfor Shapes.Remove(elarm) elarm = Shapes.AddLine(510, 245, 500, 270) endif endsub Sub wateranimation gain = "true" GraphicsWindow.penColor ="Blue" GraphicsWindow.BrushColor="Blue" gain = "true" TextWindow.WriteLine("1. Water Lock") TextWindow.WriteLine("2. Water Beam") TextWindow.WriteLine("3. Tsunami") TextWindow.WriteLine("4. Gather Energy") TextWindow.WriteLine("5. Leave") actionr = TextWindow.Read() If actionr = 1 Then If player_magic_energy >= 100 then wordline = Shapes.AddLine(110, 220, 90, 190) word = Shapes.AddText("Water Lock") Shapes.Move(word, 90, 180) Program.Delay(1000) Shapes.Remove(marm) marm = Shapes.AddLine(110, 245, 135, 245) player_magic_energy = player_magic_energy - 100 GraphicsWindow.BrushColor="#6eb7cd" GraphicsWindow.PenColor="#6eb7cd" waterwavetop = Shapes.AddRectangle(80, 80) Shapes.Move(waterwavetop, 137, 220) Shapes.Animate(waterwavetop, 465,220, 3000) Program.Delay(3000) For i = 1 To 1080 Step 1 Shapes.Rotate(waterwavetop,i) Program.Delay(1) endfor For i = 100 To 0 Step -1 Shapes.SetOpacity(waterwavetop, i) Program.Delay(25) endfor Shapes.Remove(marm) GraphicsWindow.penColor ="Blue" marm = Shapes.AddLine(110, 245, 120, 270) TextWindow.Pause() Else TextWindow.WriteLine("you do not have enough energy(100)") gain = "false" endif ElseIf actionr = 2 then If player_magic_energy >= 200 and player_level >= 7 then wordline = Shapes.AddLine(110, 220, 90, 190) word = Shapes.AddText("Water Beam") Shapes.Move(word, 90, 180) Program.Delay(1000) player_magic_energy = player_magic_energy - 200 GraphicsWindow.BrushColor="#6eb7cd" GraphicsWindow.PenColor="#6eb7cd" For i = 135 to 510 step 1 waterwall[i] = Shapes.Addline( i, 235, i, 255) Program.Delay(25) endfor For i = 135 To 510 Step 1 Shapes.Remove(waterwall[i]) Program.Delay(25) endfor TextWindow.Pause() Else TextWindow.WriteLine("you do not have enough energy (200)or you have to be level 11") gain = "false" EndIf Elseif actionr = 3 then If player_magic_energy >= 300 and player_level >= 30 then wordline = Shapes.AddLine(110, 220, 90, 190) word = Shapes.AddText("Water Tsunami") Shapes.Move(word, 90, 180) Program.Delay(1000) player_magic_energy = player_magic_energy - 300 Shapes.Remove(larm) Shapes.Remove(marm) larm = Shapes.AddLine(110, 245, 100, 220) marm = Shapes.AddLine(110, 245, 120, 220) GraphicsWindow.PenColor="#6eb7cd" For i = 400 to 0 step -1 Shapes.SetOpacity(waterline[i], 3) waterline[i] = Shapes.AddLine(0, i, 600, i) Shapes.SetOpacity(waterline[i], 3) Program.Delay(15) endfor For i = 0 to 400 step 1 Shapes.Remove(waterline[i]) endfor Shapes.Remove(larm) Shapes.Remove(marm) larm = Shapes.AddLine(110, 245, 100, 270) marm = Shapes.AddLine(110, 245, 120, 270) TextWindow.Pause() Else TextWindow.WriteLine("you do not have enough energy (300)or you have to be level 30") gain = "false" endif Elseif actionr = 4 then If player_magic_energy >= player_magic_energy_limit then player_magic_energy = player_magic_energy_limit Else player_magic_energy = player_magic_energy + 200 If player_magic_energy >= player_magic_energy_limit then player_magic_energy = player_magic_energy_limit endif EndIf elseif actionr = 5 then EndIf Shapes.Remove(word) Shapes.Remove(wordline) endsub Sub enemywater eaction = Math.GetRandomNumber(3) If eaction = 1 Then Shapes.Remove(elarm) elarm = Shapes.AddLine(510, 245, 485, 245) GraphicsWindow.BrushColor="#6eb7cd" GraphicsWindow.PenColor="#6eb7cd" waterwavetop = Shapes.AddRectangle(80, 80) Shapes.Move(waterwavetop, 425, 220) Shapes.Animate(waterwavetop, 80,220, 3000) Program.Delay(3000) For i = 1 To 1080 Step 1 Shapes.Rotate(waterwavetop,i) Program.Delay(1) endfor For i = 100 To 0 Step -1 Shapes.SetOpacity(waterwavetop, i) Program.Delay(25) endfor Shapes.Remove(elarm) elarm = Shapes.AddLine(510, 245, 500, 270) ElseIf eaction = 2 then GraphicsWindow.BrushColor="#6eb7cd" GraphicsWindow.PenColor="#6eb7cd" For i = 485 to 110 step -1 waterwall[i] = Shapes.Addline( i, 235, i, 255) Program.Delay(25) endfor For i = 485 To 110 Step -1 Shapes.Remove(waterwall[i]) Program.Delay(25) endfor Elseif eaction = 3 then Shapes.Remove(elarm) Shapes.Remove(emarm) GraphicsWindow.PenColor="#6eb7cd" elarm = Shapes.AddLine(510, 245, 500, 220) emarm = Shapes.AddLine(510, 245, 520, 220) GraphicsWindow.PenColor="#6eb7cd" For i = 400 to 0 step -1 waterline[i] = Shapes.AddLine(0, i, 600, i) Program.Delay(15) endfor For i = 0 to 400 step 1 Shapes.Remove(waterline[i]) endfor Shapes.Remove(elarm) Shapes.Remove(emarm) elarm = Shapes.AddLine(510, 245, 500, 270) emarm = Shapes.AddLine(510, 245, 520, 270) EndIf endsub Sub lightninganimation lightningagain: gain = "true" TextWindow.WriteLine("1. Lightning Bolt") TextWindow.WriteLine("2. Lightning Shockwave") TextWindow.WriteLine("3. Lightning Storm") TextWindow.WriteLine("4. Gather Energy") TextWindow.WriteLine("5. Leave") GraphicsWindow.BrushColor="Yellow" GraphicsWindow.PenColor = "Yellow" actionr = TextWindow.Read() If actionr = 1 then If player_magic_energy >= 100 then wordline = Shapes.AddLine(110, 220, 90, 190) word = Shapes.AddText("Lightning Bolt") Shapes.Move(word, 90, 180) Program.Delay(1000) player_magic_energy = player_magic_energy - 100 Shapes.Remove(marm) marm = Shapes.AddLine(110, 245, 135, 245) GraphicsWindow.PenColor = "Yellow" x = 135 x2 = 135 sq = 1 sq2 = 1 start = 245 start2 = 245 While x < 510 GraphicsWindow.PenWidth = 3 randomy = 245 + Math.GetRandomNumber(50) randomy3 = 245 - Math.GetRandomNumber(50) randomdis = Math.GetRandomNumber(60) randomdis2 = Math.GetRandomNumber(60) total = x + randomdis total2 = x2 + randomdis2 random[sq] = Shapes.AddLine(x, start, total, randomy) randomi[sq2] = Shapes.AddLine(x2, start2, total2, randomy3) randomy2 = 245 - Math.GetRandomNumber(50) randomy4 = 245 + Math.GetRandomNumber(50) randomdist = Math.GetRandomNumber(60) randomdist2 = Math.GetRandomNumber(60) finaltotal = total + randomdist finaltotal2 = total2 + randomdist2 random[sq+1] = Shapes.AddLine(total, randomy,finaltotal, randomy2) randomi[sq2+1] = Shapes.AddLine(total2, randomy3, finaltotal2, randomy4) x = total + randomdist x2 = total2+randomdist2 start = randomy2 start2 = randomy4 sq = sq + 2 sq2 = sq2 + 2 Program.Delay(400) EndWhile While sq <> 0 And sq2 <> 0 Shapes.Remove(random[sq]) Shapes.Remove(randomi[sq2]) sq = sq -1 sq2 = sq2 - 1 EndWhile GraphicsWindow.PenWidth=2 Shapes.Remove(marm) Shapes.Remove(marm) marm = Shapes.AddLine(110, 245, 120, 270) Else TextWindow.WriteLine("You do not have enough energy (100)") gain = "false" endif ElseIf actionr = 2 then If player_magic_energy >= 200 and player_level >= 11 then wordline = Shapes.AddLine(110, 220, 90, 190) word = Shapes.AddText("Lightning Shockwave") Shapes.Move(word, 90, 180) Program.Delay(1000) player_magic_energy = player_magic_energy - 200 Shapes.Remove(marm) Shapes.Remove(torso) Shapes.Remove(larm) Shapes.Remove(leg1) Shapes.Remove(leg2) Shapes.Remove(head) GraphicsWindow.PenColor = "Yellow" x = 135 sq = 1 start = 245 While x < 510 GraphicsWindow.PenWidth = 10 randomy = 245 + Math.GetRandomNumber(50) randomdis = Math.GetRandomNumber(60) total = x + randomdis random[sq] = Shapes.AddLine(x, start, total, randomy) randomy2 = 245 - Math.GetRandomNumber(50) randomdist = Math.GetRandomNumber(60) finaltotal = total + randomdist random[sq+1] = Shapes.AddLine(total, randomy,finaltotal, randomy2) x = total + randomdist start = randomy2 sq = sq + 2 Program.Delay(40) EndWhile While sq <> 0 Shapes.Remove(random[sq]) sq = sq -1 EndWhile GraphicsWindow.PenWidth=2 GraphicsWindow.BrushColor = "Yellow" head = Shapes.AddEllipse(20, 20) Shapes.Move(head, 100, 220) torso = Shapes.AddLine(110, 240, 110, 270) leg1 = Shapes.AddLine(110, 270, 100, 300) leg2 = Shapes.AddLine(110,270, 120, 300) larm = Shapes.AddLine(110, 245, 100, 270) marm = Shapes.AddLine(110, 245, 120, 270) TextWindow.Pause() Else TextWindow.WriteLine("You do not have enough energy (200) or you are not level 11") gain = "false" endif elseif actionr = 3 then If player_magic_energy >= 300 and player_level >= 30 then wordline = Shapes.AddLine(110, 220, 90, 190) word = Shapes.AddText("Lightning Storm") Shapes.Move(word, 90, 180) Program.Delay(1000) player_magic_energy = player_magic_energy - 300 Shapes.Remove(larm) Shapes.Remove(marm) larm = Shapes.AddLine(110, 245,100, 220) marm = Shapes.AddLine(110, 245, 120, 220) For i = 1 to 3 step 1 GraphicsWindow.BrushColor="grey" cloud[i] = Shapes.AddEllipse(100, 50) Shapes.Move(cloud[i], i * 60, 0) endfor sq = 1 GraphicsWindow.PenColor = "Yellow" For i = 1 to 5 step 1 x = 135 + Math.GetRandomNumber(120) start = 50 While x < 510 randomy = start + 30 randomdis = 21 total = x + randomdis random[i][sq] = Shapes.AddLine(x, start, total, randomy) randomy2 = randomy - 5 randomdist = 21 finaltotal = total + randomdist random[i][sq+1] = Shapes.AddLine(total, randomy,finaltotal, randomy2) x = total + randomdist start = randomy2 sq = sq + 2 Program.Delay(10) EndWhile TextWindow.WriteLine("Finished while loop") For j = sq to 0 step -1 Shapes.Remove(random[i][j]) endfor endfor Shapes.Remove(larm) Shapes.Remove(marm) larm = Shapes.AddLine(110, 245, 100, 270) marm = Shapes.AddLine(110, 245, 120, 270) Else TextWindow.WriteLine("You do not have enough energy (300) or you are not level 30") gain = "false" endif elseif actionr = 4 then If player_magic_energy >= player_magic_energy_limit then player_magic_energy = player_magic_energy_limit Else player_magic_energy = player_magic_energy + 200 If player_magic_energy >= player_magic_energy_limit then player_magic_energy = player_magic_energy_limit endif EndIf Elseif actionr = 5 then Elseif actionr > 5 then Goto lightningagain EndIf Shapes.Remove(word) Shapes.Remove(wordline) EndSub Sub enemylightning eaction = 3 If eaction= 1 then Shapes.Remove(elarm) elarm = Shapes.AddLine(510, 245, 485, 245) GraphicsWindow.PenColor = "Yellow" x = 485 x2 = 485 sq = 1 sq2 = 1 start = 245 start2 = 245 While x > 135 GraphicsWindow.PenWidth = 3 randomy = 245 + Math.GetRandomNumber(50) randomy3 = 245 - Math.GetRandomNumber(50) randomdis = Math.GetRandomNumber(60) randomdis2 = Math.GetRandomNumber(60) total = x - randomdis total2 = x2 - randomdis2 random[sq] = Shapes.AddLine(x, start, total, randomy) randomi[sq2] = Shapes.AddLine(x2, start2, total2, randomy3) randomy2 = 245 - Math.GetRandomNumber(50) randomy4 = 245 + Math.GetRandomNumber(50) randomdist = Math.GetRandomNumber(60) randomdist2 = Math.GetRandomNumber(60) finaltotal = total - randomdist finaltotal2 = total2 - randomdist2 random[sq+1] = Shapes.AddLine(total, randomy,finaltotal, randomy2) randomi[sq2+1] = Shapes.AddLine(total2, randomy3, finaltotal2, randomy4) x = total - randomdist x2 = total2 -randomdist2 start = randomy2 start2 = randomy4 sq = sq + 2 sq2 = sq2 + 2 Program.Delay(400) EndWhile While sq <> 0 And sq2 <> 0 Shapes.Remove(random[sq]) Shapes.Remove(randomi[sq2]) sq = sq -1 sq2 = sq2 - 1 EndWhile GraphicsWindow.PenWidth=2 GraphicsWindow.PenColor="black" Shapes.Remove(elarm) elarm = Shapes.AddLine(510, 245, 500, 270) ElseIf eaction = 2 then Shapes.Remove(elarm) Shapes.Remove(etorso) Shapes.Remove(emarm) Shapes.Remove(eleg1) Shapes.Remove(eleg2) Shapes.Remove(ehead) GraphicsWindow.PenColor = "Yellow" x = 485 sq = 1 start = 245 While x > 110 GraphicsWindow.PenWidth = 10 randomy = 245 + Math.GetRandomNumber(50) randomdis = Math.GetRandomNumber(60) total = x - randomdis random[sq] = Shapes.AddLine(x, start, total, randomy) randomy2 = 245 - Math.GetRandomNumber(50) randomdist = Math.GetRandomNumber(60) finaltotal = total - randomdist random[sq+1] = Shapes.AddLine(total, randomy,finaltotal, randomy2) x = total - randomdist start = randomy2 sq = sq + 2 Program.Delay(40) EndWhile While sq <> 0 Shapes.Remove(random[sq]) sq = sq -1 EndWhile GraphicsWindow.PenWidth=2 GraphicsWindow.BrushColor = "Yellow" ehead = Shapes.AddEllipse(20, 20) 'head = x= 110, y = 120 Shapes.Move(ehead, 500, 220) GraphicsWindow.PenColor = "Black" etorso = Shapes.AddLine(510, 240, 510, 270) eleg1 = Shapes.AddLine(510, 270, 500, 300) eleg2 = Shapes.AddLine(510,270, 520, 300) elarm = Shapes.AddLine(510, 245, 500, 270) emarm = Shapes.AddLine(510, 245, 520, 270) elseif eaction = 3 then Shapes.Remove(elarm) Shapes.Remove(emarm) elarm = Shapes.AddLine(510, 245,500, 220) emarm = Shapes.AddLine(510, 245, 520, 220) For i = 1 to 3 step 1 GraphicsWindow.BrushColor="black" cloud[i] = Shapes.AddEllipse(100, 50) Shapes.Move(cloud[i], 400 + i*(50),1) endfor sq = 1 GraphicsWindow.PenColor = "Yellow" For i = 1 to 5 step 1 x = 485 + Math.GetRandomNumber(115) start = 50 While x >110 randomy = start + 30 randomdis = 21 total = x - randomdis random[i][sq] = Shapes.AddLine(x, start, total, randomy) randomy2 = randomy - 5 randomdist = 21 finaltotal = total - randomdist random[i][sq+1] = Shapes.AddLine(total, randomy,finaltotal, randomy2) x = total - randomdist start = randomy2 sq = sq + 2 Program.Delay(40) EndWhile For j = sq to 0 step -1 Shapes.Remove(random[i][j]) endfor endfor For i = 1 to 3 step 1 Shapes.reMove(cloud[i]) endfor GraphicsWindow.PenColor="black" Shapes.Remove(elarm) Shapes.Remove(emarm) elarm = Shapes.AddLine(510, 245, 500, 270) emarm = Shapes.AddLine(510, 245, 520, 270) EndIf EndSub '------------------------------------------------------------------------- Sub showstats TextWindow.WriteLine("Health = " + player_level_health) TextWindow.WriteLine("EXP = " +player_exp) TextWindow.WriteLine("Energy = " +player_magic_energy) TextWindow.WriteLine("Strength = " +player_strength) TextWindow.WriteLine("Level = " +player_level) TextWindow.WriteLine("Speed = " +speed) TextWindow.WriteLine("Magic Strength = " + player_magic_strength) TextWindow.WriteLine("Magic = " + player_magic_type) EndSub '------------------------------------------------------------------------- Sub options while 1=1 TextWindow.WriteLine("What do you want to do?") TextWindow.WriteLine("1. practice") TextWindow.WriteLine("2. save") TextWindow.WriteLine("3. rest") TextWindow.WriteLine("4. Stats") TextWindow.WriteLine("5. Fight") answerchoice = TextWindow.ReadNumber() If answerchoice = 1 Then practice() ElseIf answerchoice =2 then makesaves() Elseif answerchoice = 3 then player_health = player_level_health player_magic_energy = player_magic_energy_limit display() elseif answerchoice = 4 then showstats() display() elseif answerchoice = 5 then fight() display() EndIf endwhile EndSub '------------------------------------------------- Sub practice character() While actionr <> 5 display() If player_magic_type="Fire" Then fireanimation() ElseIf player_magic_type = "Water" then wateranimation() elseif player_magic_type = "Wind" then windanimation() Elseif player_magic_type = "Lightning" then lightninganimation() endif If actionr = 4 Or actionr = 5 Then ElseIf gain = "true" then expearn() Else endif display() TextWindow.Clear() endwhile actionr = 0 EndSub '------------------------------------------------------------------------- Sub character If player_magic_type = "Fire" Then GraphicsWindow.BrushColor ="Red" ElseIf player_magic_type = "Water" then GraphicsWindow.BrushColor ="Blue" ElseIf player_magic_type = "Wind" then GraphicsWindow.BrushColor ="White" elseif player_magic_type="Lightning" then GraphicsWindow.BrushColor = "Yellow" endif head = Shapes.AddEllipse(20, 20) 'head = x= 110, y = 120 Shapes.Move(head, 100, 220) If player_magic_type = "Fire" Then GraphicsWindow.penColor ="Red" ElseIf player_magic_type = "Water" then GraphicsWindow.penColor ="Blue" ElseIf player_magic_type = "Wind" then GraphicsWindow.penColor ="White" elseif player_magic_type="Lightning" then GraphicsWindow.penColor = "Yellow" endif torso = Shapes.AddLine(110, 240, 110, 270) leg1 = Shapes.AddLine(110, 270, 100, 300) leg2 = Shapes.AddLine(110,270, 120, 300) larm = Shapes.AddLine(110, 245, 100, 270) marm = Shapes.AddLine(110, 245, 120, 270) EndSub '------------------------------------------------------------------------- Sub enemy enemyhealth = 500 enemy_strength = 100 enemyspeed = 50 magic = Math.GetRandomNumber(2) TextWindow.WriteLine("Enemy magic type is = " + magic) If magic= 1 Then GraphicsWindow.BrushColor ="Red" ElseIf magic= 2 then GraphicsWindow.BrushColor ="Blue" ElseIf magic= 3 then GraphicsWindow.BrushColor ="White" elseif magic= 4 then GraphicsWindow.BrushColor = "Yellow" endif ehead = Shapes.AddEllipse(20, 20) 'head = x= 110, y = 120 Shapes.Move(ehead, 500, 220) GraphicsWindow.PenColor = "Black" etorso = Shapes.AddLine(510, 240, 510, 270) eleg1 = Shapes.AddLine(510, 270, 500, 300) eleg2 = Shapes.AddLine(510,270, 520, 300) elarm = Shapes.AddLine(510, 245, 500, 270) emarm = Shapes.AddLine(510, 245, 520, 270) endsub '-------------------- Sub display j = (player_magic_energy/player_magic_energy_limit)*100 k = (player_health/player_level_health)*100 l = (player_exp/player_exp_level)*100 j = Math.Round(j) k = Math.Round(k) l = Math.Round(l) GraphicsWindow.BrushColor = "Green" Shapes.Remove(health) health = Shapes.AddText("Health = " + player_health + "/" + player_level_health) Shapes.Move(health, 360, 0) GraphicsWindow.BrushColor = "Blue" Shapes.Remove(energy) energy = Shapes.AddText("Magic = " + player_magic_energy + "/" + player_magic_energy_limit) Shapes.Move(energy, 360, 30) Shapes.Remove(expt) expt = Shapes.AddText("exp = " + player_exp + "/" + player_exp_level) Shapes.Move(expt, 360, 60) Shapes.Remove(levelt) levelt = Shapes.AddText("Level = " + player_level ) Shapes.Move(levelt, 360, 90) GraphicsWindow.PenColor = "Green" If o > k then While o > k Shapes.Remove(healthl[o]) Program.Delay(2) o = o - 1 endwhile ElseIf o < k then While o < k o = o +1 healthl[o] = Shapes.AddLine(o+500, 0, o+500, 20) Program.Delay(2) EndWhile elseif o = k then EndIf GraphicsWindow.PenColor = "Blue" 'energy If nowenergy > j then While nowenergy > j Shapes.Remove(energyl[nowenergy]) nowenergy = nowenergy - 1 Program.Delay(2) endwhile ElseIf nowenergy < j then While nowenergy <> j nowenergy =nowenergy +1 energyl[nowenergy] = Shapes.AddLine(nowenergy+500, 30, nowenergy+500, 50) Program.Delay(2) EndWhile Elseif nowenergy = j then endif If player_magic_type = "Fire" Then GraphicsWindow.penColor ="Red" ElseIf player_magic_type = "Water" then GraphicsWindow.penColor ="Blue" ElseIf player_magic_type = "Wind" then GraphicsWindow.penColor ="White" elseIf player_magic_type="Lightning" then GraphicsWindow.penColor="Yellow" endif If p > l then While p > l Shapes.Remove(expl[p]) Shapes.Remove(expl[p]) p = p - 1 endwhile ElseIf p < l then While p < l expl[p] = Shapes.AddLine(p+500,60, p+500, 70) p = p + 1 EndWhile ElseIf p = l then EndIf endsub '------------------------------------------------------------------------- Sub enemydisplay Shapes.Remove(enemyhealthpic) GraphicsWindow.BrushColor = "Red" enemyhealthpic = Shapes.addrectangle((enemyhealth/500)*100, 30) Shapes.Move(enemyhealthpic, 500, 90) EndSub '------------------------------------------------------------------------- Sub expearn player_exp = player_exp + 1 If player_exp = player_exp_level or player_exp > player_exp_level Then player_level = player_level +1 GraphicsWindow.ShowMessage("Your new level is " +player_level, "LEVEL UP") player_exp = 0 player_exp_level = player_level * 3 player_magic_energy_limit =300+ (25 * player_level) player_level_health = 100 + (25 * player_level) speed = 2 * player_level player_magic_strength = 50 * player_level endif endsub Sub expearnfromenemy player_exp = player_exp + 5 If player_exp = player_exp_level or player_exp > player_exp_level Then player_level = player_level +1 GraphicsWindow.ShowMessage("Your new level is " +player_level, "LEVEL UP") player_exp = player_exp - player_exp_level player_exp_level = player_exp_level + 5 player_magic_energy_limit =300+ (25 * player_level) player_level_health = 100 + (25 * player_level) speed = 2 * player_level player_magic_strength = 50 * player_level endif endsub '-------------------------------------------------------------------------- Sub makesaves PATH = Program.Directory + "\Data\" NAME = "Fairytail" EXT = ".txt" LF = Text.GetCharacter(10) TextWindow.WriteLine(PATH + NAME + EXT + LF) filesave["Health"] = player_health filesave[2] = player_level_health filesave["Player exp"] = player_exp filesave[4] = player_exp_level filesave["Player enery"] = player_magic_energy filesave["Player magic strength"] = player_magic_strength filesave["Player strength"] = player_strength filesave["Magic type"] = player_magic_type filesave[9] = magic_energy_take filesave["Player level"] = player_level filesave[11] = player_magic_energy_limit filesave["Speed"] = speed filesave["Tries"] = try ' The following line could be harmful and has been automatically commented. ' File.CreateDirectory(PATH) ' The following line could be harmful and has been automatically commented. ' File.WriteContents(PATH+NAME+EXT, filesave) filesave = "" ' The following line could be harmful and has been automatically commented. ' filesave = File.ReadContents(PATH + NAME + EXT) endsub '---------------------------------------------------- Sub getsaves ' The following line could be harmful and has been automatically commented. ' filesave = File.ReadContents(PATH+NAME+EXT) player_health = filesave["Health"] player_level_health = filesave[2] player_exp = filesave["Player exp"] player_exp_level = filesave[4] player_magic_energy = filesave["Player enery"] player_magic_strength = filesave["Player magic strength"] player_strength = filesave["Player strength"] player_magic_type = filesave["Magic type"] magic_energy_take=filesave[9] player_level= filesave["Player level"] player_magic_energy_limit = filesave[11] speed = filesave["Speed"] try = filesave["Tries"] EndSub '--------------------------------------------------' Sub init PATH = Program.Directory + "\Data\" NAME = "Fairytail" EXT = ".txt" LF = Text.GetCharacter(10) endsub End>GFR649.sb< Start>GFS079.sb< ' Drawn Using Ellipses only ' mahreen miangul Yandee Man ApRil 2017 GraphicsWindow.Width = 1080 GraphicsWindow.Height = 420 GraphicsWindow.BackgroundColor = "darkslategray" 'Data table draw[1] = "func=ell;X=98;Y=44;W=500;H=500;color=darkslategray;tag=big" draw[2] = "func=ell;X=51;Y=247;W=380;H=300;color=darkslategray;tag=small" draw[3] = "func=ell;X=162;Y=120;W=20;H=50;color=springgreen;tag=ear"' left draw[4] = "func=ell;X=318;Y=120;W=20;H=50;color=springgreen;tag=ear"' right draw[5] = "func=ell;X=175;Y=50;W=150;H=200;color=green;tag=face" draw[6] = "func=ell;X=75;Y=50;W=350;H=110;color=darkslategray;tag=head-top-cover" draw[7] = "func=ell;X=175;Y=129;W=150;H=60;color=green;tag=headtop" draw[8] = "func=ell;X=190;Y=145;W=40;H=30;color=darkmagenta;tag=eye"' left draw[9] = "func=ell;X=270;Y=145;W=40;H=30;color=darkmagenta;tag=eye;" ' right draw[10] = "func=ell;X=193;Y=145;W=35;H=30;color=yellow;tag=pupil" ' left draw[11] = "func=ell;X=272;Y=145;W=35;H=30;color=yellow;tag=pupil" ' right 'Draw outline For i = 1 To Array.GetItemCount(draw) GraphicsWindow.PenColor = draw[i]["color"] GraphicsWindow.DrawEllipse(draw[i]["X"], draw[i]["Y"], draw[i]["W"], draw[i]["H"]) Program.Delay(300) EndFor 'Add and Animate shapes for solid color GraphicsWindow.PenWidth = 0 For i = 1 To Array.GetItemCount(draw) GraphicsWindow.BrushColor = draw[i]["color"] shp[i] = Shapes.AddEllipse(draw[i]["W"], draw[i]["H"]) Shapes.Animate(shp[i], draw[i]["X"], draw[i]["Y"], 500) Program.Delay(500) EndFor 'Animate shapes - eyes and mouth dZ = 0.1 zoom = 1 While 0=0 zoom = zoom - dZ For i = 1 To Array.GetItemCount(draw) If Array.ContainsValue(draw[i] "eye") Then Shapes.Zoom(shp[i] 1 zoom) ElseIf Array.ContainsValue(draw[i] "pupil") Then Shapes.Zoom(shp[i] zoom zoom) EndIf EndFor If zoom = 0 Or zoom = 1 Then dZ = -dZ EndIf Program.Delay(100) EndWhile End>GFS079.sb< Start>GFS579.sb< 'Window GraphicsWindow.Left = (Desktop.Width - 624) / 2 GraphicsWindow.Top = 100 GraphicsWindow.Title = "Window" 'Circles GraphicsWindow.PenWidth = 0.5 GraphicsWindow.DrawEllipse(12, 20, 400, 400) GraphicsWindow.DrawEllipse(212, 20, 400, 400) GraphicsWindow.PenColor = "white" GraphicsWindow.BrushColor = "white" cover = Shapes.AddRectangle(624, 444) Shapes.SetOpacity(cover, 50) GraphicsWindow.PenColor = "blue" GraphicsWindow.PenWidth = 2 'Regular Triangle left = Shapes.AddLine(212, 220, 312, 48) right = Shapes.AddLine(412, 220, 312, 48) base = Shapes.AddLine(212, 220, 412, 220) End>GFS579.sb< Start>GFS673.sb< ' PROGRAM NO: ' SCIENCE FICTION MUSIC NOISE ' VIBRATING ROPES AND BUTTONS ' PROGRAM CONCEPTION BY TRYHEST, YLED,BACKTOTHESTART ' SEPT 20TH 2016 ' GraphicsWindow.Width =1366 GraphicsWindow.Height =768 GraphicsWindow.TOP=0 GraphicsWindow.LEFT=0 GraphicsWindow.PenWidth=0 GraphicsWindow.BackgroundColor ="BLACK" LDMusic.Reset() LDPhysics.Reset () random_noise() For r=1 To 25 GraphicsWindow.BrushColor =LDColours.HSLtoRGB (r*32 ,1.2 ,0.75) ee[r]=Shapes.AddEllipse (80 30) LDPhysics.AddMovingShape (ee[r] 0 1 4) rr[r]=Shapes.AddRectangle (1 1400) LDPhysics.AddMovingShape (rr[r] 0 1 0) LDPhysics.SetPosition (ee[r], 30 280 0) LDPhysics.SetPosition (rr[r] 30 140 0) LDPhysics.GroupShapes (rr[r] ee[r]) If r=1 then LDPhysics.SetPosition (rr[1] 10 209 45) aa[1]=LDPhysics.AddFixedAnchor (200 10) Else LDPhysics.SetPosition (rr[r] (r-1)*31+205 285 0) aa[r]=LDPhysics.AddFixedAnchor (205+(r-1)*31 10) endif 'LDPhysics.AttachShapesWithRotation (aa[r] rr[r]) EndFor LDPhysics.SetGravity (0 800) While "true LDPhysics.DoTimestep () pos1 = LDPhysics.GetPosition(ee[2]) pos2 = LDPhysics.GetPosition(ee[3]) t_time = Math.GetRandomNumber(100) i = Math.Floor(Pos2[1]/25)+10 'TextWindow.WriteLine(pos1 + Octave + " I= "+i) BASS_Spheric() EndWhile Sub BASS_Spheric y=math.GetRandomNumber(5) LDMusic.Instrument = noise[y] LDMusic.Velocity = 100 O=math.GetRandomNumber(3) LDMusic.PlayNote(O,"C#",1) LDMusic.PlayNote(O,"Eb",1) LDMusic.PlayNote(O,"F#",1) LDMusic.PlayNote(O,"A#",1) LDMusic.PlayNote(O,"g#",1) LDMusic.PlayNote(O,"Db",1) LDMusic.PlayNote(O,"A",1) LDMusic.PlayNote(O,"B",1) HIGH_SPHERIC() Endsub sub random_noise 'BASS NOISE noise[1]=116 noise[4]=77 noise[5]=35 noise[2]=33 noise[3]=37 ' HIGH NOISE Hnoise[1]=14 Hnoise[2]=113 Hnoise[3]=46 Hnoise[4]=51 Hnoise[5]=73 EndSub Sub HIGH_SPHERIC W=math.GetRandomNumber(5) LDMusic.Instrument = Hnoise[W] LDMusic.Velocity = 70 OO=math.GetRandomNumber(3)+5 LDMusic.PlayNote(OO,"A#",1) LDMusic.PlayNote(OO,"Fb",1) LDMusic.PlayNote(OO,"D#",1) LDMusic.PlayNote(OO,"G#",1) LDMusic.PlayNote(OO,"E#",1) LDMusic.PlayNote(OO,"Eb",1) LDMusic.PlayNote(OO,"C",1) LDMusic.PlayNote(OO,"B#",1) EndSub End>GFS673.sb< Start>GFT498.sb< args=0 GraphicsWindow.Width=700 GraphicsWindow.Height=700 GraphicsWindow.Left=10 GraphicsWindow.Top=10 GraphicsWindow.BackgroundColor="tan GraphicsWindow.PenWidth=0 GraphicsWindow.BrushColor="blue GraphicsWindow.Title="Pacman demo n=1 fr=1 For rr=0.1 To 35 Step 1.6 LDCall.Function("cc" rr) Program.Delay(3) Shapes.HideShape(ss[n-1]) oss=ss EndFor GraphicsWindow.BrushColor="red For t=1 To 7 e[t]=Shapes.AddEllipse(21 21) LDShapes.ZIndex(e[t],-1111) LDShapes.Centre(e[t] t*95 150) EndFor While 1=1 For x=1 To n-1 Shapes.ShowShape(ss[x]) Shapes.Move(ss[x] px 150) Shapes.HideShape(e[Math.Floor(px/95)]) Program.Delay(2) px=px+2 Shapes.hideShape(ss[x]) EndFor For x= n-2 To 2 Step -1 Shapes.ShowShape(ss[x]) Shapes.Move(ss[x] px 150) Program.Delay(2) px=px+2 Shapes.HideShape(e[Math.Floor(px/95)]) Shapes.hideShape(ss[x]) EndFor If px>600 Then px=0 fr=-fr aa=aa-90 'GraphicsWindow.Title=ldmath.cos(aa) If math.abs(LDMath.Cos(aa)*1000)<1 Then dd=450 Else dd=0 EndIf LDGraphicsWindow.Reposition(fr 1 0 dd aa) For t=1 To 7 Shapes.ShowShape(e[t]) EndFor EndIf EndWhile Sub cc p=0 i=2 p[1][1]=0 p[1][2]=0 a=args[1] For r=a To 360-a p[i][1]=LDMath.Cos(r)*80 p[i][2]=LDMath.sin(r)*80 i=i+1 EndFor ss[n]=LDShapes.AddPolygon(p) Shapes.Move(ss[n] 150 150) n=n+1 EndSub End>GFT498.sb< Start>GFW257.sb< ' アクションゲーム No.1 ' ' 岡山科学技術専門学校 情報システム学科 教材 ' 各種定数の定義 ss=0 st: GraphicsWindow.Clear() SCREEN_WIDTH = 24 ' スクリーンの幅(ユニット数) SCREEN_HEIGHT = 18 ' スクリーンの高さ(ユニット数) UNIT_SIZE = 30 ' ユニットサイズ(ピクセル) GOAL_X = 1 GOAL_Y = 1 If ss=16 then GOAL_X = 22 GOAL_Y = 16 Endif ENEMY_NUM = 5 SPEED = 5 ' 一度に移動するピクセル数 ENEMY_SPEED = 10 ' Enemy Speed DELAY = 50 ' ループ毎の待機時間(ミリ秒) WALL_COLOR = "#808080" ' 壁の色 BACK_COLOR = "#000000" ' 背景の色 ROBO_COLOR = "#0000FF" ' ロボットの色 ENEMY_COLOR = "#FF0000" ' Enemy Color ' 壁の配置(マップ)を定義 (1:壁あり, それ以外:壁なし) If ss=0 Or 16 then WALLS [1] = "111111111111111111111111" WALLS [2] = "101010101010111110111111" WALLS [3] = "101010101010111110111111" WALLS [4] = "101010101010110110110111" WALLS [5] = "101010101010110110110111" WALLS [6] = "101010101010110110110111" WALLS [7] = "101010101000110000000111" WALLS [8] = "101000101010111111111111" WALLS [9] = "101010100010000000000001" WALLS [10] = "100010001010111111111001" WALLS [11] = "111010101010100000001001" WALLS [12] = "111010101010101101101001" WALLS [13] = "111010101010101101101001" WALLS [14] = "111010101010100000001001" WALLS [15] = "111010101010101101101001" WALLS [16] = "111010101010101101101001" WALLS [17] = "111010101000100000001001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 3 ey[1] = UNIT_SIZE * 1 exd[1] = 0 eyd[1] = 1 ex[2] = UNIT_SIZE * 5 ey[2] = UNIT_SIZE * 6 exd[2] = 0 eyd[2] = -1 ex[3] = UNIT_SIZE * 7 ey[3] = UNIT_SIZE * 4 exd[3] = 0 eyd[3] = 1 ex[4] = UNIT_SIZE * 9 ey[4] = UNIT_SIZE * 8 exd[4] = 0 eyd[4] = 1 ex[5] = UNIT_SIZE * 11 ey[5] = UNIT_SIZE * 2 exd[5] = 0 eyd[5] = -1 Endif If ss=1 Or 17 then ENEMY_NUM = 11 ENEMY_SPEED = 8 WALLS [1] = "111111111111111111111111" WALLS [2] = "101111101111011111111111" WALLS [3] = "101000000000000011111111" WALLS [4] = "101011011011011001111111" WALLS [5] = "101000000000000011111111" WALLS [6] = "101011011011011011111111" WALLS [7] = "101011011011011011111111" WALLS [8] = "101000000000000011111111" WALLS [9] = "101011011011011000000001" WALLS [10] = "100011011011011011111001" WALLS [11] = "111000000000000011111001" WALLS [12] = "111011011011011011111001" WALLS [13] = "111011011011011011111001" WALLS [14] = "111000000000000011111001" WALLS [15] = "111011011011011001111001" WALLS [16] = "111000000000000011111001" WALLS [17] = "111111011110111111111001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 3 ey[1] = UNIT_SIZE * 15 exd[1] = 0 eyd[1] = 1 ex[2] = UNIT_SIZE * 6 ey[2] = UNIT_SIZE * 9 exd[2] = 0 eyd[2] = 1 ex[3] = UNIT_SIZE * 9 ey[3] = UNIT_SIZE * 5 exd[3] = 0 eyd[3] = 1 ex[4] = UNIT_SIZE * 12 ey[4] = UNIT_SIZE * 12 exd[4] = 0 eyd[4] = 1 ex[5] = UNIT_SIZE * 15 ey[5] = UNIT_SIZE * 2 exd[5] = 0 eyd[5] = 1 ex[6] = UNIT_SIZE * 3 ey[6] = UNIT_SIZE * 2 exd[6] = 1 eyd[6] = 0 ex[7] = UNIT_SIZE * 7 ey[7] = UNIT_SIZE * 4 exd[7] = 1 eyd[7] = 0 ex[8] = UNIT_SIZE * 12 ey[8] = UNIT_SIZE * 7 exd[8] = 1 eyd[8] = 0 ex[9] = UNIT_SIZE * 4 ey[9] = UNIT_SIZE * 10 exd[9] = 1 eyd[9] = 0 ex[10] = UNIT_SIZE * 9 ey[10] = UNIT_SIZE * 13 exd[10] = 1 eyd[10] = 0 ex[11] = UNIT_SIZE * 3 ey[11] = UNIT_SIZE * 15 exd[11] = 1 eyd[11] = 0 Endif If ss=2 Or 18 then ENEMY_NUM = 14 ENEMY_SPEED = 8 WALLS [1] = "111111111111111111111111" WALLS [2] = "100111111111111111110111" WALLS [3] = "100111000000000111010101" WALLS [4] = "100111000000000111010101" WALLS [5] = "100011000000000111000001" WALLS [6] = "100001000000000011111111" WALLS [7] = "100100001000100000011111" WALLS [8] = "111110000000000000011111" WALLS [9] = "111111000000001000011111" WALLS [10] = "111111100000000000011111" WALLS [11] = "111111110000000000011111" WALLS [12] = "111111111000001000011111" WALLS [13] = "100000111100000000011111" WALLS [14] = "101010111110000000011111" WALLS [15] = "100000111111000000010001" WALLS [16] = "101010111111100111110001" WALLS [17] = "100000111111110000000001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 6 ey[1] = UNIT_SIZE * 2 exd[1] = 0 eyd[1] = 1 ex[2] = UNIT_SIZE * 7 ey[2] = UNIT_SIZE * 2 exd[2] = 0 eyd[2] = 1 ex[3] = UNIT_SIZE * 9 ey[3] = UNIT_SIZE * 2 exd[3] = 0 eyd[3] = 1 ex[4] = UNIT_SIZE * 10 ey[4] = UNIT_SIZE * 2 exd[4] = 0 eyd[4] = 1 ex[5] = UNIT_SIZE * 11 ey[5] = UNIT_SIZE * 2 exd[5] = 0 eyd[5] = 1 ex[6] = UNIT_SIZE * 13 ey[6] = UNIT_SIZE * 2 exd[6] = 0 eyd[6] = 1 ex[7] = UNIT_SIZE * 14 ey[7] = UNIT_SIZE * 2 exd[7] = 0 eyd[7] = 1 ex[8] = UNIT_SIZE * 18 ey[8] = UNIT_SIZE * 6 exd[8] = 1 eyd[8] = 0 ex[9] = UNIT_SIZE * 18 ey[9] = UNIT_SIZE * 7 exd[9] = 1 eyd[9] = 0 ex[10] = UNIT_SIZE * 18 ey[10] = UNIT_SIZE * 9 exd[10] = 1 eyd[10] = 0 ex[11] = UNIT_SIZE * 18 ey[11] = UNIT_SIZE * 10 exd[11] = 1 eyd[11] = 0 ex[12] = UNIT_SIZE * 18 ey[12] = UNIT_SIZE * 11 exd[12] = 1 eyd[12] = 0 ex[13] = UNIT_SIZE * 18 ey[13] = UNIT_SIZE * 13 exd[13] = 1 eyd[13] = 0 ex[14] = UNIT_SIZE * 18 ey[14] = UNIT_SIZE * 14 exd[14] = 1 eyd[14] = 0 Endif If ss=3 Or 19 then ENEMY_NUM = 18 ENEMY_SPEED = 7 WALLS [1] = "111111111111111111111111" WALLS [2] = "100011000110001100111001" WALLS [3] = "100011000110001100111001" WALLS [4] = "111011000000001100011001" WALLS [5] = "100011000000101100000001" WALLS [6] = "100111000110001100011001" WALLS [7] = "100011010110001100111001" WALLS [8] = "100011000111001100011001" WALLS [9] = "100011000110001110011001" WALLS [10] = "100011001110001100011001" WALLS [11] = "100011000110001100011001" WALLS [12] = "100011000110001100011001" WALLS [13] = "100011100110001100011001" WALLS [14] = "100000000110000000011001" WALLS [15] = "110000000110000000011001" WALLS [16] = "100011000110001100011001" WALLS [17] = "101111100110011110011001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 1 ey[1] = UNIT_SIZE * 4 exd[1] = 0 eyd[1] = 1 ex[2] = UNIT_SIZE * 2 ey[2] = UNIT_SIZE * 4 exd[2] = 0 eyd[2] = 1 ex[3] = UNIT_SIZE * 2 ey[3] = UNIT_SIZE * 9 exd[3] = 0 eyd[3] = 1 ex[4] = UNIT_SIZE * 3 ey[4] = UNIT_SIZE * 6 exd[4] = 0 eyd[4] = 1 ex[5] = UNIT_SIZE * 18 ey[5] = UNIT_SIZE * 7 exd[5] = 0 eyd[5] = 1 ex[6] = UNIT_SIZE * 6 ey[6] = UNIT_SIZE * 1 exd[6] = 0 eyd[6] = 1 ex[7] = UNIT_SIZE * 7 ey[7] = UNIT_SIZE * 1 exd[7] = 0 eyd[7] = 1 ex[8] = UNIT_SIZE * 7 ey[8] = UNIT_SIZE * 7 exd[8] = 0 eyd[8] = 1 ex[9] = UNIT_SIZE * 8 ey[9] = UNIT_SIZE * 2 exd[9] = 0 eyd[9] = 1 ex[10] = UNIT_SIZE * 8 ey[10] = UNIT_SIZE * 10 exd[10] = 0 eyd[10] = 1 ex[11] = UNIT_SIZE * 11 ey[11] = UNIT_SIZE * 1 exd[11] = 0 eyd[11] = 1 ex[12] = UNIT_SIZE * 11 ey[12] = UNIT_SIZE * 8 exd[12] = 0 eyd[12] = 1 ex[13] = UNIT_SIZE * 12 ey[13] = UNIT_SIZE * 1 exd[13] = 0 eyd[13] = 1 ex[14] = UNIT_SIZE * 12 ey[14] = UNIT_SIZE * 5 exd[14] = 0 eyd[14] = 1 ex[15] = UNIT_SIZE * 13 ey[15] = UNIT_SIZE * 1 exd[15] = 0 eyd[15] = 1 ex[16] = UNIT_SIZE * 16 ey[16] = UNIT_SIZE * 1 exd[16] = 0 eyd[16] = 1 ex[17] = UNIT_SIZE * 16 ey[17] = UNIT_SIZE * 9 exd[17] = 0 eyd[17] = 1 ex[18] = UNIT_SIZE * 17 ey[18] = UNIT_SIZE * 1 exd[18] = 0 eyd[18] = 1 Endif If ss=4 Or 20 then ENEMY_NUM = 14 ENEMY_SPEED = 8 WALLS [1] = "111111111111111111111111" WALLS [2] = "100000000000000000000001" WALLS [3] = "111111111111111111111001" WALLS [4] = "100000011000100001110001" WALLS [5] = "100000000000000000000001" WALLS [6] = "100100100001111000100011" WALLS [7] = "100011111111111111111111" WALLS [8] = "110011111111111111111111" WALLS [9] = "100011111111111111111111" WALLS [10] = "100011111111111111111111" WALLS [11] = "100111111111111111111111" WALLS [12] = "100011111111111111111111" WALLS [13] = "100011000010011100000001" WALLS [14] = "100000000000000000000001" WALLS [15] = "110000001101001000111001" WALLS [16] = "110111111111111111111001" WALLS [17] = "111111111111111111111001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 3 ey[1] = UNIT_SIZE * 13 exd[1] = 1 eyd[1] = 0 ex[2] = UNIT_SIZE * 7 ey[2] = UNIT_SIZE * 13 exd[2] = -1 eyd[2] = 0 ex[3] = UNIT_SIZE * 12 ey[3] = UNIT_SIZE * 13 exd[3] = 1 eyd[3] = 0 ex[4] = UNIT_SIZE * 4 ey[4] = UNIT_SIZE * 13 exd[4] = -1 eyd[4] = 0 ex[5] = UNIT_SIZE * 6 ey[5] = UNIT_SIZE * 13 exd[5] = 1 eyd[5] = 0 ex[6] = UNIT_SIZE * 2 ey[6] = UNIT_SIZE * 5 exd[6] = 0 eyd[6] = 1 ex[7] = UNIT_SIZE * 2 ey[7] = UNIT_SIZE * 8 exd[7] = 0 eyd[7] = 1 ex[8] = UNIT_SIZE * 2 ey[8] = UNIT_SIZE * 6 exd[8] = 0 eyd[8] = -1 ex[9] = UNIT_SIZE * 2 ey[9] = UNIT_SIZE * 13 exd[9] = 0 eyd[9] = 1 ex[10] = UNIT_SIZE * 7 ey[10] = UNIT_SIZE * 4 exd[10] = -1 eyd[10] = 0 ex[11] = UNIT_SIZE * 13 ey[11] = UNIT_SIZE * 4 exd[11] = -1 eyd[11] = 0 ex[12] = UNIT_SIZE * 17 ey[12] = UNIT_SIZE * 4 exd[12] = 1 eyd[12] = 0 ex[13] = UNIT_SIZE * 10 ey[13] = UNIT_SIZE * 4 exd[13] = 1 eyd[13] = 0 ex[14] = UNIT_SIZE * 6 ey[14] = UNIT_SIZE * 4 exd[14] = 1 eyd[14] = 0 Endif If ss=5 Or 21 then ENEMY_NUM = 35 ENEMY_SPEED = 8 WALLS [1] = "111111111111111111111111" WALLS [2] = "100001100001100001100001" WALLS [3] = "111100001100001100001101" WALLS [4] = "111101101101101101101101" WALLS [5] = "100001100001100001100001" WALLS [6] = "101100001100001100001111" WALLS [7] = "101101101101101101101111" WALLS [8] = "100001100001100001100001" WALLS [9] = "111100001100001100001101" WALLS [10] = "111101101101101101101101" WALLS [11] = "100001100001100001100001" WALLS [12] = "101100001100001100001111" WALLS [13] = "101111111111111111111111" WALLS [14] = "100100000000000000010001" WALLS [15] = "100000000000000010000101" WALLS [16] = "100000000100000000000101" WALLS [17] = "100100000000000000000101" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 4 ey[1] = UNIT_SIZE * 3 exd[1] = 0 eyd[1] = 0 ex[2] = UNIT_SIZE * 7 ey[2] = UNIT_SIZE * 3 exd[2] = 0 eyd[2] = 0 ex[3] = UNIT_SIZE * 10 ey[3] = UNIT_SIZE * 3 exd[3] = 0 eyd[3] = 0 ex[4] = UNIT_SIZE * 13 ey[4] = UNIT_SIZE * 3 exd[4] = 0 eyd[4] = 0 ex[5] = UNIT_SIZE * 16 ey[5] = UNIT_SIZE * 3 exd[5] = 0 eyd[5] = 0 ex[6] = UNIT_SIZE * 19 ey[6] = UNIT_SIZE * 3 exd[6] = 0 eyd[6] = 0 ex[7] = UNIT_SIZE * 4 ey[7] = UNIT_SIZE * 6 exd[7] = 0 eyd[7] = 0 ex[8] = UNIT_SIZE * 7 ey[8] = UNIT_SIZE * 6 exd[8] = 0 eyd[8] = 0 ex[9] = UNIT_SIZE * 10 ey[9] = UNIT_SIZE * 6 exd[9] = 0 eyd[9] = 0 ex[10] = UNIT_SIZE * 13 ey[10] = UNIT_SIZE * 6 exd[10] = 0 eyd[10] = 0 ex[11] = UNIT_SIZE * 16 ey[11] = UNIT_SIZE * 6 exd[11] = 0 eyd[11] = 0 ex[12] = UNIT_SIZE * 19 ey[12] = UNIT_SIZE * 6 exd[12] = 0 eyd[12] = 0 ex[13] = UNIT_SIZE * 4 ey[13] = UNIT_SIZE * 9 exd[13] = 0 eyd[13] = 0 ex[14] = UNIT_SIZE * 7 ey[14] = UNIT_SIZE * 9 exd[14] = 0 eyd[14] = 0 ex[15] = UNIT_SIZE * 10 ey[15] = UNIT_SIZE * 9 exd[15] = 0 eyd[15] = 0 ex[16] = UNIT_SIZE * 13 ey[16] = UNIT_SIZE * 9 exd[16] = 0 eyd[16] = 0 ex[17] = UNIT_SIZE * 16 ey[17] = UNIT_SIZE * 9 exd[17] = 0 eyd[17] = 0 ex[18] = UNIT_SIZE * 19 ey[18] = UNIT_SIZE * 9 exd[18] = 0 eyd[18] = 0 ex[19] = UNIT_SIZE * 4 ey[19] = UNIT_SIZE * 7 exd[19] = 0 eyd[19] = 1 ex[20] = UNIT_SIZE * 4 ey[20] = UNIT_SIZE * 3 exd[20] = 0 eyd[20] = -1 ex[21] = UNIT_SIZE * 7 ey[21] = UNIT_SIZE * 2 exd[21] = 0 eyd[21] = 1 ex[22] = UNIT_SIZE * 7 ey[22] = UNIT_SIZE * 8 exd[22] = 0 eyd[22] = 1 ex[23] = UNIT_SIZE * 10 ey[23] = UNIT_SIZE * 9 exd[23] = 0 eyd[23] = -1 ex[24] = UNIT_SIZE * 10 ey[24] = UNIT_SIZE * 4 exd[24] = 0 eyd[24] = 1 ex[25] = UNIT_SIZE * 13 ey[25] = UNIT_SIZE * 11 exd[25] = 0 eyd[25] = -1 ex[26] = UNIT_SIZE * 13 ey[26] = UNIT_SIZE * 4 exd[26] = 0 eyd[26] = 1 ex[27] = UNIT_SIZE * 16 ey[27] = UNIT_SIZE * 2 exd[27] = 0 eyd[27] = -1 ex[28] = UNIT_SIZE * 16 ey[28] = UNIT_SIZE * 7 exd[28] = 0 eyd[28] = 1 ex[29] = UNIT_SIZE * 19 ey[29] = UNIT_SIZE * 10 exd[29] = 0 eyd[29] = -1 ex[30] = UNIT_SIZE * 19 ey[30] = UNIT_SIZE * 5 exd[30] = 0 eyd[30] = 1 ex[31] = UNIT_SIZE * 6 ey[31] = UNIT_SIZE * 13 exd[31] = 1 eyd[31] = 0 ex[32] = UNIT_SIZE * 5 ey[32] = UNIT_SIZE * 14 exd[32] = 1 eyd[32] = 0 ex[33] = UNIT_SIZE * 7 ey[33] = UNIT_SIZE * 15 exd[33] = 1 eyd[33] = 0 ex[34] = UNIT_SIZE * 16 ey[34] = UNIT_SIZE * 15 exd[34] = 1 eyd[34] = 0 ex[35] = UNIT_SIZE * 11 ey[35] = UNIT_SIZE * 16 exd[35] = 1 eyd[35] = 0 Endif If ss=6 Or 22 then ENEMY_NUM = 16 ENEMY_SPEED = 7 WALLS [1] = "111111111111111111111111" WALLS [2] = "100000000000001111110111" WALLS [3] = "100011111100001111110111" WALLS [4] = "111111110000000011010101" WALLS [5] = "111111100000000001000001" WALLS [6] = "111111000000000000111111" WALLS [7] = "111110000000000000011111" WALLS [8] = "111100000000000000001111" WALLS [9] = "111000000000000000000111" WALLS [10] = "111000000000000000000111" WALLS [11] = "111100000000000000001111" WALLS [12] = "111110000000000000011111" WALLS [13] = "111111000000000000111111" WALLS [14] = "100000100000000001111111" WALLS [15] = "101010110000000011111111" WALLS [16] = "100000111110011111110001" WALLS [17] = "101010111100000000000001" WALLS [18] = "100000111111111111111111" ex[1] = UNIT_SIZE * 15 ey[1] = UNIT_SIZE * 3 exd[1] = -1 eyd[1] = 0 ex[2] = UNIT_SIZE * 16 ey[2] = UNIT_SIZE * 4 exd[2] = -1 eyd[2] = 0 ex[3] = UNIT_SIZE * 17 ey[3] = UNIT_SIZE * 5 exd[3] = -1 eyd[3] = 0 ex[4] = UNIT_SIZE * 18 ey[4] = UNIT_SIZE * 6 exd[4] = -1 eyd[4] = 0 ex[5] = UNIT_SIZE * 19 ey[5] = UNIT_SIZE * 7 exd[5] = -1 eyd[5] = 0 ex[6] = UNIT_SIZE * 19 ey[6] = UNIT_SIZE * 10 exd[6] = -1 eyd[6] = 0 ex[7] = UNIT_SIZE * 18 ey[7] = UNIT_SIZE * 11 exd[7] = -1 eyd[7] = 0 ex[8] = UNIT_SIZE * 17 ey[8] = UNIT_SIZE * 12 exd[8] = -1 eyd[8] = 0 ex[9] = UNIT_SIZE * 16 ey[9] = UNIT_SIZE * 13 exd[9] = -1 eyd[9] = 0 ex[10] = UNIT_SIZE * 15 ey[10] = UNIT_SIZE * 14 exd[10] = -1 eyd[10] = 0 ex[11] = UNIT_SIZE * 11 ey[11] = UNIT_SIZE * 8 exd[11] = 0 eyd[11] = 1 ex[12] = UNIT_SIZE * 12 ey[12] = UNIT_SIZE * 8 exd[12] = -1 eyd[12] = 0 ex[13] = UNIT_SIZE * 11 ey[13] = UNIT_SIZE * 9 exd[13] = 1 eyd[13] = 0 ex[14] = UNIT_SIZE * 12 ey[14] = UNIT_SIZE * 9 exd[14] = 0 eyd[14] = -1 ex[15] = UNIT_SIZE * 13 ey[15] = UNIT_SIZE * 2 exd[15] = 0 eyd[15] = 1 ex[16] = UNIT_SIZE * 10 ey[16] = UNIT_SIZE * 14 exd[16] = 0 eyd[16] = -1 Endif If ss=7 Or 23 then ENEMY_NUM = 40 ENEMY_SPEED = 7 WALLS [1] = "111111111111111111111111" WALLS [2] = "100010000000000000000001" WALLS [3] = "100010000000000000000001" WALLS [4] = "100010011111001111110001" WALLS [5] = "100000011111001111111001" WALLS [6] = "111110011111001111111001" WALLS [7] = "100000000000000000000001" WALLS [8] = "100000000000000000000001" WALLS [9] = "100110011111001110011001" WALLS [10] = "100110011111001110011001" WALLS [11] = "100110000000001110011111" WALLS [12] = "100010000000001110011111" WALLS [13] = "100110011011001110011111" WALLS [14] = "100110011111001110000001" WALLS [15] = "100110011111001110010001" WALLS [16] = "100000000000000000010001" WALLS [17] = "100000000000000000010001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 7 ey[1] = UNIT_SIZE * 1 exd[1] = 0 eyd[1] = 0 ex[2] = UNIT_SIZE * 11 ey[2] = UNIT_SIZE * 2 exd[2] = 0 eyd[2] = 0 ex[3] = UNIT_SIZE * 15 ey[3] = UNIT_SIZE * 1 exd[3] = 0 eyd[3] = 0 ex[4] = UNIT_SIZE * 18 ey[4] = UNIT_SIZE * 2 exd[4] = 0 eyd[4] = 0 ex[5] = UNIT_SIZE * 5 ey[5] = UNIT_SIZE * 5 exd[5] = 0 eyd[5] = 0 ex[6] = UNIT_SIZE * 6 ey[6] = UNIT_SIZE * 5 exd[6] = 0 eyd[6] = 0 ex[7] = UNIT_SIZE * 12 ey[7] = UNIT_SIZE * 4 exd[7] = 0 eyd[7] = 0 ex[8] = UNIT_SIZE * 13 ey[8] = UNIT_SIZE * 4 exd[8] = 0 eyd[8] = 0 ex[9] = UNIT_SIZE * 7 ey[9] = UNIT_SIZE * 6 exd[9] = 0 eyd[9] = 0 ex[10] = UNIT_SIZE * 11 ey[10] = UNIT_SIZE * 7 exd[10] = 0 eyd[10] = 0 ex[11] = UNIT_SIZE * 15 ey[11] = UNIT_SIZE * 6 exd[11] = 0 eyd[11] = 0 ex[12] = UNIT_SIZE * 19 ey[12] = UNIT_SIZE * 7 exd[12] = 0 eyd[12] = 0 ex[13] = UNIT_SIZE * 1 ey[13] = UNIT_SIZE * 9 exd[13] = 0 eyd[13] = 0 ex[14] = UNIT_SIZE * 2 ey[14] = UNIT_SIZE * 13 exd[14] = 0 eyd[14] = 0 ex[15] = UNIT_SIZE * 5 ey[15] = UNIT_SIZE * 9 exd[15] = 0 eyd[15] = 0 ex[16] = UNIT_SIZE * 6 ey[16] = UNIT_SIZE * 9 exd[16] = 0 eyd[16] = 0 ex[17] = UNIT_SIZE * 12 ey[17] = UNIT_SIZE * 9 exd[17] = 0 eyd[17] = 0 ex[18] = UNIT_SIZE * 13 ey[18] = UNIT_SIZE * 9 exd[18] = 0 eyd[18] = 0 ex[19] = UNIT_SIZE * 17 ey[19] = UNIT_SIZE * 10 exd[19] = 0 eyd[19] = 0 ex[20] = UNIT_SIZE * 18 ey[20] = UNIT_SIZE * 10 exd[20] = 0 eyd[20] = 0 ex[21] = UNIT_SIZE * 9 ey[21] = UNIT_SIZE * 15 exd[21] = 0 eyd[21] = 0 ex[22] = UNIT_SIZE * 9 ey[22] = UNIT_SIZE * 16 exd[22] = 0 eyd[22] = 0 ex[23] = UNIT_SIZE * 5 ey[23] = UNIT_SIZE * 1 exd[23] = 0 eyd[23] = 1 ex[24] = UNIT_SIZE * 5 ey[24] = UNIT_SIZE * 2 exd[24] = 1 eyd[24] = 0 ex[25] = UNIT_SIZE * 12 ey[25] = UNIT_SIZE * 1 exd[25] = 0 eyd[25] = 1 ex[26] = UNIT_SIZE * 21 ey[26] = UNIT_SIZE * 1 exd[26] = 0 eyd[26] = 1 ex[27] = UNIT_SIZE * 22 ey[27] = UNIT_SIZE * 1 exd[27] = -1 eyd[27] = 0 ex[28] = UNIT_SIZE * 1 ey[28] = UNIT_SIZE * 6 exd[28] = 0 eyd[28] = 1 ex[29] = UNIT_SIZE * 1 ey[29] = UNIT_SIZE * 7 exd[29] = 1 eyd[29] = 0 ex[30] = UNIT_SIZE * 18 ey[30] = UNIT_SIZE * 6 exd[30] = 0 eyd[30] = 1 ex[31] = UNIT_SIZE * 22 ey[31] = UNIT_SIZE * 6 exd[31] = -1 eyd[31] = 0 ex[32] = UNIT_SIZE * 22 ey[32] = UNIT_SIZE * 9 exd[32] = 0 eyd[32] = -1 ex[33] = UNIT_SIZE * 5 ey[33] = UNIT_SIZE * 10 exd[33] = 1 eyd[33] = 0 ex[34] = UNIT_SIZE * 13 ey[34] = UNIT_SIZE * 11 exd[34] = -1 eyd[34] = 0 ex[35] = UNIT_SIZE * 1 ey[35] = UNIT_SIZE * 15 exd[35] = 1 eyd[35] = 0 ex[36] = UNIT_SIZE * 2 ey[36] = UNIT_SIZE * 16 exd[36] = 0 eyd[36] = -1 ex[37] = UNIT_SIZE * 6 ey[37] = UNIT_SIZE * 16 exd[37] = 0 eyd[37] = -1 ex[38] = UNIT_SIZE * 13 ey[38] = UNIT_SIZE * 16 exd[38] = 0 eyd[38] = -1 ex[39] = UNIT_SIZE * 17 ey[39] = UNIT_SIZE * 16 exd[39] = 0 eyd[39] = -1 ex[40] = UNIT_SIZE * 18 ey[40] = UNIT_SIZE * 16 exd[40] = -1 eyd[40] = 0 Endif If ss=8 Or 24 then ENEMY_NUM = 8 ENEMY_SPEED = 7 WALLS [1] = "111111111111111111111111" WALLS [2] = "100000011011111111110111" WALLS [3] = "100111011011111111110111" WALLS [4] = "111111011011011111010101" WALLS [5] = "110000000000011111000001" WALLS [6] = "111111011011011011111111" WALLS [7] = "111111011011011011111111" WALLS [8] = "111100000000000011011111" WALLS [9] = "111111111011011011011111" WALLS [10] = "111111111011011011011111" WALLS [11] = "111111000000000000011111" WALLS [12] = "111111111111011011011111" WALLS [13] = "100000111111011011011111" WALLS [14] = "101010110000000000001111" WALLS [15] = "100000111111111011011111" WALLS [16] = "101010111111111011011001" WALLS [17] = "100000111111111000000001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 2 ey[1] = UNIT_SIZE * 4 exd[1] = 1 eyd[1] = 0 ex[2] = UNIT_SIZE * 4 ey[2] = UNIT_SIZE * 7 exd[2] = 1 eyd[2] = 0 ex[3] = UNIT_SIZE * 6 ey[3] = UNIT_SIZE * 10 exd[3] = 1 eyd[3] = 0 ex[4] = UNIT_SIZE * 8 ey[4] = UNIT_SIZE * 13 exd[4] = 1 eyd[4] = 0 ex[5] = UNIT_SIZE * 9 ey[5] = UNIT_SIZE * 1 exd[5] = 0 eyd[5] = 1 ex[6] = UNIT_SIZE * 12 ey[6] = UNIT_SIZE * 3 exd[6] = 0 eyd[6] = 1 ex[7] = UNIT_SIZE * 15 ey[7] = UNIT_SIZE * 5 exd[7] = 0 eyd[7] = 1 ex[8] = UNIT_SIZE * 18 ey[8] = UNIT_SIZE * 7 exd[8] = 0 eyd[8] = 1 Endif If ss=9 Or 25 then ENEMY_NUM = 8 ENEMY_SPEED = 11 WALLS [1] = "111111111111111111111111" WALLS [2] = "100000000000011111111111" WALLS [3] = "100000000100011111011111" WALLS [4] = "100000011101011111011111" WALLS [5] = "100000011100011101010111" WALLS [6] = "100111111101011101010111" WALLS [7] = "100111111100011100000111" WALLS [8] = "100111111001001111111111" WALLS [9] = "100000000000000000000001" WALLS [10] = "100101010100010101010001" WALLS [11] = "100000000000000000000001" WALLS [12] = "111111111001001111111001" WALLS [13] = "110000011100011111111001" WALLS [14] = "110101011101011111000001" WALLS [15] = "110000011100011111000001" WALLS [16] = "110101011101010000000001" WALLS [17] = "110000011100000000000001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 10 ey[1] = UNIT_SIZE * 8 exd[1] = 1 eyd[1] = 0 ex[2] = UNIT_SIZE * 12 ey[2] = UNIT_SIZE * 10 exd[2] = 1 eyd[2] = 0 ex[3] = UNIT_SIZE * 10 ey[3] = UNIT_SIZE * 10 exd[3] = -1 eyd[3] = 0 ex[4] = UNIT_SIZE * 12 ey[4] = UNIT_SIZE * 8 exd[4] = -1 eyd[4] = 0 ex[5] = UNIT_SIZE * 10 ey[5] = UNIT_SIZE * 8 exd[5] = 0 eyd[5] = 1 ex[6] = UNIT_SIZE * 12 ey[6] = UNIT_SIZE * 10 exd[6] = 0 eyd[6] = 1 ex[7] = UNIT_SIZE * 10 ey[7] = UNIT_SIZE * 8 exd[7] = 0 eyd[7] = -1 ex[8] = UNIT_SIZE * 12 ey[8] = UNIT_SIZE * 10 exd[8] = 0 eyd[8] = -1 Endif If ss=10 Or 26 then ENEMY_NUM = 10 ENEMY_SPEED = 10 WALLS [1] = "111111111111111111111111" WALLS [2] = "100000001000000100000001" WALLS [3] = "100000000011110000000001" WALLS [4] = "110000011100001000000001" WALLS [5] = "100000000000001000000001" WALLS [6] = "110000010100001000000011" WALLS [7] = "100111111101101111001001" WALLS [8] = "101000000000000000000101" WALLS [9] = "101111111100000000000101" WALLS [10] = "101000000000001111111101" WALLS [11] = "101000000000000000000101" WALLS [12] = "100100111101101111111001" WALLS [13] = "110000000100001000000011" WALLS [14] = "100000000100000000000001" WALLS [15] = "100000000100001110000011" WALLS [16] = "100000000011110000000001" WALLS [17] = "100000001000000100000001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 1 ey[1] = UNIT_SIZE * 4 exd[1] = 1 eyd[1] = 0 ex[2] = UNIT_SIZE * 22 ey[2] = UNIT_SIZE * 13 exd[2] = -1 eyd[2] = 0 ex[3] = UNIT_SIZE * 10 ey[3] = UNIT_SIZE * 3 exd[3] = 0 eyd[3] = 1 ex[4] = UNIT_SIZE * 13 ey[4] = UNIT_SIZE * 14 exd[4] = 0 eyd[4] = -1 ex[5] = UNIT_SIZE * 3 ey[5] = UNIT_SIZE * 7 exd[5] = 1 eyd[5] = 0 ex[6] = UNIT_SIZE * 20 ey[6] = UNIT_SIZE * 10 exd[6] = -1 eyd[6] = 0 ex[7] = UNIT_SIZE * 10 ey[7] = UNIT_SIZE * 1 exd[7] = 1 eyd[7] = 0 ex[8] = UNIT_SIZE * 10 ey[8] = UNIT_SIZE * 16 exd[8] = 1 eyd[8] = 0 ex[9] = UNIT_SIZE * 1 ey[9] = UNIT_SIZE * 10 exd[9] = 0 eyd[9] = 1 ex[10] = UNIT_SIZE * 22 ey[10] = UNIT_SIZE * 10 exd[10] = 0 eyd[10] = 1 Endif If ss=11 then ENEMY_NUM = 21 ENEMY_SPEED = 8 WALLS [1] = "111111111111111111111111" WALLS [2] = "101100000000000000000001" WALLS [3] = "101101011011011011011001" WALLS [4] = "101001100100100101101101" WALLS [5] = "100100100000000001101101" WALLS [6] = "101001100000000001101001" WALLS [7] = "100100100000000001101101" WALLS [8] = "101101100000000001101101" WALLS [9] = "100100000000000000001101" WALLS [10] = "101101000000000000001001" WALLS [11] = "100101100000000001100101" WALLS [12] = "101101100000000001001101" WALLS [13] = "100101100000000001100101" WALLS [14] = "101101100000000001001001" WALLS [15] = "100101101001001001101101" WALLS [16] = "101010110110110110100101" WALLS [17] = "100000000000000000001101" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 22 ey[1] = UNIT_SIZE * 1 exd[1] = 0 eyd[1] = 1 ex[2] = UNIT_SIZE * 22 ey[2] = UNIT_SIZE * 1 exd[2] = -1 eyd[2] = 0 ex[3] = UNIT_SIZE * 4 ey[3] = UNIT_SIZE * 1 exd[3] = 0 eyd[3] = 1 ex[4] = UNIT_SIZE * 4 ey[4] = UNIT_SIZE * 14 exd[4] = 0 eyd[4] = -1 ex[5] = UNIT_SIZE * 7 ey[5] = UNIT_SIZE * 14 exd[5] = 0 eyd[5] = -1 ex[6] = UNIT_SIZE * 10 ey[6] = UNIT_SIZE * 3 exd[6] = 0 eyd[6] = 1 ex[7] = UNIT_SIZE * 13 ey[7] = UNIT_SIZE * 14 exd[7] = 0 eyd[7] = -1 ex[8] = UNIT_SIZE * 16 ey[8] = UNIT_SIZE * 3 exd[8] = 0 eyd[8] = 1 ex[9] = UNIT_SIZE * 19 ey[9] = UNIT_SIZE * 3 exd[9] = 0 eyd[9] = 1 ex[10] = UNIT_SIZE * 19 ey[10] = UNIT_SIZE * 16 exd[10] = 0 eyd[10] = -1 ex[11] = UNIT_SIZE * 19 ey[11] = UNIT_SIZE * 16 exd[11] = -1 eyd[11] = 0 ex[12] = UNIT_SIZE * 1 ey[12] = UNIT_SIZE * 16 exd[12] = 1 eyd[12] = 0 ex[13] = UNIT_SIZE * 1 ey[13] = UNIT_SIZE * 16 exd[13] = 0 eyd[13] = -1 ex[14] = UNIT_SIZE * 1 ey[14] = UNIT_SIZE * 1 exd[14] = 0 eyd[14] = 1 ex[15] = UNIT_SIZE * 4 ey[15] = UNIT_SIZE * 1 exd[15] = 1 eyd[15] = 0 ex[16] = UNIT_SIZE * 8 ey[16] = UNIT_SIZE * 4 exd[16] = 0 eyd[16] = 1 ex[17] = UNIT_SIZE * 9 ey[17] = UNIT_SIZE * 14 exd[17] = 0 eyd[17] = -1 ex[18] = UNIT_SIZE * 11 ey[18] = UNIT_SIZE * 13 exd[18] = 0 eyd[18] = -1 ex[19] = UNIT_SIZE * 12 ey[19] = UNIT_SIZE * 4 exd[19] = 0 eyd[19] = 1 ex[20] = UNIT_SIZE * 14 ey[20] = UNIT_SIZE * 4 exd[20] = 0 eyd[20] = 1 ex[21] = UNIT_SIZE * 15 ey[21] = UNIT_SIZE * 14 exd[21] = 0 eyd[21] = -1 Endif If ss=12 Or 27 then ENEMY_NUM = 22 ENEMY_SPEED = 8 WALLS [1] = "111111111111111111111111" WALLS [2] = "100000000000000000000001" WALLS [3] = "111111111111111111111001" WALLS [4] = "110000000000000000000001" WALLS [5] = "111100000000000000001111" WALLS [6] = "111100000000000000001111" WALLS [7] = "111100000000000000001111" WALLS [8] = "111100000000000000001111" WALLS [9] = "111100000000000000001111" WALLS [10] = "111100000000000000001111" WALLS [11] = "111100000000000000001111" WALLS [12] = "111100000000000000001111" WALLS [13] = "111100000000000000001111" WALLS [14] = "100000000000000000000011" WALLS [15] = "100100010010010010001111" WALLS [16] = "100111111111111111111111" WALLS [17] = "100000000000000000000001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 21 ey[1] = UNIT_SIZE * 13 exd[1] = -1 eyd[1] = 0 ex[2] = UNIT_SIZE * 2 ey[2] = UNIT_SIZE * 3 exd[2] = 1 eyd[2] = 0 ex[3] = UNIT_SIZE * 4 ey[3] = UNIT_SIZE * 4 exd[3] = 0 eyd[3] = 1 ex[4] = UNIT_SIZE * 5 ey[4] = UNIT_SIZE * 6 exd[4] = 0 eyd[4] = -1 ex[5] = UNIT_SIZE * 6 ey[5] = UNIT_SIZE * 13 exd[5] = 0 eyd[5] = -1 ex[6] = UNIT_SIZE * 7 ey[6] = UNIT_SIZE * 11 exd[6] = 0 eyd[6] = 1 ex[7] = UNIT_SIZE * 8 ey[7] = UNIT_SIZE * 7 exd[7] = 0 eyd[7] = -1 ex[8] = UNIT_SIZE * 9 ey[8] = UNIT_SIZE * 3 exd[8] = 0 eyd[8] = 1 ex[9] = UNIT_SIZE * 10 ey[9] = UNIT_SIZE * 9 exd[9] = 0 eyd[9] = -1 ex[10] = UNIT_SIZE * 11 ey[10] = UNIT_SIZE * 5 exd[10] = 0 eyd[10] = 1 ex[11] = UNIT_SIZE * 12 ey[11] = UNIT_SIZE * 10 exd[11] = 0 eyd[11] = 1 ex[12] = UNIT_SIZE * 13 ey[12] = UNIT_SIZE * 8 exd[12] = 0 eyd[12] = 1 ex[13] = UNIT_SIZE * 14 ey[13] = UNIT_SIZE * 3 exd[13] = 0 eyd[13] = 1 ex[14] = UNIT_SIZE * 15 ey[14] = UNIT_SIZE * 13 exd[14] = 0 eyd[14] = -1 ex[15] = UNIT_SIZE * 16 ey[15] = UNIT_SIZE * 6 exd[15] = 0 eyd[15] = -1 ex[16] = UNIT_SIZE * 17 ey[16] = UNIT_SIZE * 7 exd[16] = 0 eyd[16] = 1 ex[17] = UNIT_SIZE * 18 ey[17] = UNIT_SIZE * 4 exd[17] = 0 eyd[17] = -1 ex[18] = UNIT_SIZE * 19 ey[18] = UNIT_SIZE * 10 exd[18] = 0 eyd[18] = -1 ex[19] = UNIT_SIZE * 17 ey[19] = UNIT_SIZE * 5 exd[19] = -1 eyd[19] = 0 ex[20] = UNIT_SIZE * 5 ey[20] = UNIT_SIZE * 7 exd[20] = 1 eyd[20] = 0 ex[21] = UNIT_SIZE * 12 ey[21] = UNIT_SIZE * 9 exd[21] = -1 eyd[21] = 0 ex[22] = UNIT_SIZE * 10 ey[22] = UNIT_SIZE * 11 exd[22] = 1 eyd[22] = 0 Endif If ss=13 Or 28 then ENEMY_NUM = 25 ENEMY_SPEED = 8 WALLS [1] = "111111111111111111111111" WALLS [2] = "100001100000000000000001" WALLS [3] = "101101101101101101101101" WALLS [4] = "101101101101101101101101" WALLS [5] = "100000000000000000000001" WALLS [6] = "111101101101101101101101" WALLS [7] = "111101101101101101101101" WALLS [8] = "100000000000000000000001" WALLS [9] = "101101101101101101101101" WALLS [10] = "101101101101101101101101" WALLS [11] = "100000000000000000000001" WALLS [12] = "101101101101101101101111" WALLS [13] = "101101101101101101101111" WALLS [14] = "100000000000000000000001" WALLS [15] = "101101101101101101101101" WALLS [16] = "101101101101101101101101" WALLS [17] = "100000000000000001100001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 7 ey[1] = UNIT_SIZE * 1 exd[1] = 1 eyd[1] = 0 ex[2] = UNIT_SIZE * 1 ey[2] = UNIT_SIZE * 4 exd[2] = 1 eyd[2] = 0 ex[3] = UNIT_SIZE * 22 ey[3] = UNIT_SIZE * 7 exd[3] = -1 eyd[3] = 0 ex[4] = UNIT_SIZE * 1 ey[4] = UNIT_SIZE * 13 exd[4] = 1 eyd[4] = 0 ex[5] = UNIT_SIZE * 1 ey[5] = UNIT_SIZE * 16 exd[5] = 1 eyd[5] = 0 ex[6] = UNIT_SIZE * 1 ey[6] = UNIT_SIZE * 7 exd[6] = 0 eyd[6] = 1 ex[7] = UNIT_SIZE * 4 ey[7] = UNIT_SIZE * 1 exd[7] = 0 eyd[7] = 1 ex[8] = UNIT_SIZE * 7 ey[8] = UNIT_SIZE * 16 exd[8] = 0 eyd[8] = -1 ex[9] = UNIT_SIZE * 10 ey[9] = UNIT_SIZE * 1 exd[9] = 0 eyd[9] = 1 ex[10] = UNIT_SIZE * 13 ey[10] = UNIT_SIZE * 16 exd[10] = 0 eyd[10] = -1 ex[11] = UNIT_SIZE * 16 ey[11] = UNIT_SIZE * 1 exd[11] = 0 eyd[11] = 1 ex[12] = UNIT_SIZE * 19 ey[12] = UNIT_SIZE * 16 exd[12] = 0 eyd[12] = -1 ex[13] = UNIT_SIZE * 22 ey[13] = UNIT_SIZE * 1 exd[13] = 0 eyd[13] = 1 ex[14] = UNIT_SIZE * 22 ey[14] = UNIT_SIZE * 1 exd[14] = 0 eyd[14] = 0 ex[15] = UNIT_SIZE * 13 ey[15] = UNIT_SIZE * 1 exd[15] = 0 eyd[15] = 0 ex[16] = UNIT_SIZE * 7 ey[16] = UNIT_SIZE * 4 exd[16] = 0 eyd[16] = 0 ex[17] = UNIT_SIZE * 19 ey[17] = UNIT_SIZE * 4 exd[17] = 0 eyd[17] = 0 ex[18] = UNIT_SIZE * 7 ey[18] = UNIT_SIZE * 7 exd[18] = 0 eyd[18] = 0 ex[19] = UNIT_SIZE * 13 ey[19] = UNIT_SIZE * 7 exd[19] = 0 eyd[19] = 0 ex[20] = UNIT_SIZE * 4 ey[20] = UNIT_SIZE * 10 exd[20] = 0 eyd[20] = 0 ex[21] = UNIT_SIZE * 16 ey[21] = UNIT_SIZE * 10 exd[21] = 0 eyd[21] = 0 ex[22] = UNIT_SIZE * 10 ey[22] = UNIT_SIZE * 13 exd[22] = 0 eyd[22] = 0 ex[23] = UNIT_SIZE * 13 ey[23] = UNIT_SIZE * 13 exd[23] = 0 eyd[23] = 0 ex[24] = UNIT_SIZE * 7 ey[24] = UNIT_SIZE * 16 exd[24] = 0 eyd[24] = 0 ex[25] = UNIT_SIZE * 10 ey[25] = UNIT_SIZE * 10 exd[25] = 1 eyd[25] = 0 Endif If ss=14 Or 29 then ENEMY_NUM = 19 ENEMY_SPEED = 8 WALLS [1] = "111111111111111111111111" WALLS [2] = "101111011101110111011111" WALLS [3] = "100000000000000000000001" WALLS [4] = "110101010101010101010101" WALLS [5] = "110000000000000000000001" WALLS [6] = "110101010101010101010101" WALLS [7] = "100000000000000000000001" WALLS [8] = "110101010101010101010101" WALLS [9] = "110000000000000000000001" WALLS [10] = "110101010101010101010101" WALLS [11] = "100000000000000000000001" WALLS [12] = "110101010101010101010101" WALLS [13] = "110000000000000000000001" WALLS [14] = "110101010101010101010111" WALLS [15] = "100000000000000000000001" WALLS [16] = "110101010101010101010101" WALLS [17] = "110000000000000000010001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 2 ey[1] = UNIT_SIZE * 2 exd[1] = 0 eyd[1] = 1 ex[2] = UNIT_SIZE * 4 ey[2] = UNIT_SIZE * 16 exd[2] = 0 eyd[2] = -1 ex[3] = UNIT_SIZE * 6 ey[3] = UNIT_SIZE * 1 exd[3] = 0 eyd[3] = 1 ex[4] = UNIT_SIZE * 8 ey[4] = UNIT_SIZE * 11 exd[4] = 0 eyd[4] = -1 ex[5] = UNIT_SIZE * 10 ey[5] = UNIT_SIZE * 4 exd[5] = 0 eyd[5] = 1 ex[6] = UNIT_SIZE * 12 ey[6] = UNIT_SIZE * 3 exd[6] = 0 eyd[6] = -1 ex[7] = UNIT_SIZE * 14 ey[7] = UNIT_SIZE * 9 exd[7] = 0 eyd[7] = 1 ex[8] = UNIT_SIZE * 16 ey[8] = UNIT_SIZE * 10 exd[8] = 0 eyd[8] = -1 ex[9] = UNIT_SIZE * 18 ey[9] = UNIT_SIZE * 16 exd[9] = 0 eyd[9] = 1 ex[10] = UNIT_SIZE * 20 ey[10] = UNIT_SIZE * 7 exd[10] = 0 eyd[10] = -1 ex[11] = UNIT_SIZE * 22 ey[11] = UNIT_SIZE * 2 exd[11] = 0 eyd[11] = 1 ex[12] = UNIT_SIZE * 1 ey[12] = UNIT_SIZE * 2 exd[12] = 1 eyd[12] = 0 ex[13] = UNIT_SIZE * 22 ey[13] = UNIT_SIZE * 4 exd[13] = -1 eyd[13] = 0 ex[14] = UNIT_SIZE * 7 ey[14] = UNIT_SIZE * 6 exd[14] = 1 eyd[14] = 0 ex[15] = UNIT_SIZE * 15 ey[15] = UNIT_SIZE * 8 exd[15] = -1 eyd[15] = 0 ex[16] = UNIT_SIZE * 17 ey[16] = UNIT_SIZE * 10 exd[16] = 1 eyd[16] = 0 ex[17] = UNIT_SIZE * 3 ey[17] = UNIT_SIZE * 12 exd[17] = -1 eyd[17] = 0 ex[18] = UNIT_SIZE * 4 ey[18] = UNIT_SIZE * 14 exd[18] = 1 eyd[18] = 0 ex[19] = UNIT_SIZE * 18 ey[19] = UNIT_SIZE * 16 exd[19] = -1 eyd[19] = 0 Endif If ss=15 then GraphicsWindow.ShowMessage("折り返し地点、後は戻るだけ", "今はここまで") Goto gameend Endif If ss=30 then GraphicsWindow.ShowMessage("全ステージクリア", "おめでとう") Goto gameend Endif ' スクリーンの初期設定 GraphicsWindow.Show() ' 表示 GraphicsWindow.Width = SCREEN_WIDTH * UNIT_SIZE ' 幅を設定 GraphicsWindow.Height = SCREEN_HEIGHT * UNIT_SIZE ' 高さを設定 GraphicsWindow.CanResize = "False" ' サイズを固定 GraphicsWindow.BackgroundColor = BACK_COLOR ' 背景色を設定 ' 壁の描画 GraphicsWindow.BrushColor = WALL_COLOR ' ブラシの色を設定 For iy = 1 To Array.GetItemCount(WALLS) ' 縦方向の繰り返し(WALLS配列の数だけ) For ix = 1 To Text.GetLength(WALLS [iy]) ' 横方向の繰り返し(文字列の長さだけ) If Text.GetSubText(WALLS [iy], ix, 1) = "1" Then ' 文字が"1"だったら GraphicsWindow.FillRectangle(UNIT_SIZE * (ix - 1), UNIT_SIZE * (iy - 1), UNIT_SIZE, UNIT_SIZE) EndIf EndFor EndFor ' GOAL GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.FontSize = 20 GraphicsWindow.FontBold = "True" GraphicsWindow.DrawText(GOAL_X * UNIT_SIZE, GOAL_Y * UNIT_SIZE, "GOAL") ' ロボットのスタート地点 x = UNIT_SIZE * 22 ' 横位置 (左から12ユニット) y = UNIT_SIZE * 16 ' 縦位置 (上から10ユニット) xd = 0 ' 横移動方向 (-1:左, 0:止, 1:右) 移動用 yd = 0 ' 縦移動方向 (-1:上, 0:止, 1:下) 移動用 xk = 0 ' 横移動方向 (-1:左, 0:止, 1:右) キーボード受付用 yk = 0 ' 縦移動方向 (-1:上, 0:止, 1:下) キーボード受付用 If ss=16 then x = UNIT_SIZE * 1 ' 横位置 (左から12ユニット) y = UNIT_SIZE * 1 ' 縦位置 (上から10ユニット) xd = 0 ' 横移動方向 (-1:左, 0:止, 1:右) 移動用 yd = 0 ' 縦移動方向 (-1:上, 0:止, 1:下) 移動用 xk = 0 ' 横移動方向 (-1:左, 0:止, 1:右) キーボード受付用 yk = 0 ' 縦移動方向 (-1:上, 0:止, 1:下) キーボード受付用 Endif ' ロボット初期描画 GraphicsWindow.BrushColor = ROBO_COLOR ' ブラシの色を設定 GraphicsWindow.PenColor = ROBO_COLOR ' ペンの色を設定 robot = Shapes.AddEllipse(UNIT_SIZE, UNIT_SIZE) ' ロボットのシェイプを設定 Shapes.Move(robot, x, y) ' ロボットのシェイプを初期位置に ' 敵の描画 GraphicsWindow.BrushColor = ENEMY_COLOR GraphicsWindow.PenColor = ENEMY_COLOR For ie = 1 To ENEMY_NUM enemy[ie] = Shapes.AddEllipse(UNIT_SIZE, UNIT_SIZE) Shapes.Move(enemy[ie], ex[ie], ey[ie]) EndFor ' ��ーボードイベントの設定 GraphicsWindow.KeyDown = onKeyDown ' キーが押されたらonKeyDownサブルーチンを呼ぶ While xk = 0 And yk = 0 EndWhile starttime = Clock.ElapsedMilliseconds ' メインループ status = "" While status = "" ' 繰り返し(無条件に) ' キーボードからの方向指示を受け付ける ' ロボットの縦位置・横位置ともにユニット単位だったら If Math.Remainder(x, UNIT_SIZE) = 0 And Math.Remainder(y, UNIT_SIZE) = 0 Then ' キーボード受け付け用の方向情報を移動用の方向情報にコピー xd = xk ' 横方向 yd = yk ' 縦方向 EndIf ' このまま一回分進んだ場合のマップ上の位置を求める ' まずピクセル単位で位置を求め、それをユニットのサイズで割ることでマップ上の位置を求める If xd < 0 Then nx = x - 1 ElseIf 0 < xd then nx = x + UNIT_SIZE + 1 Else nx = x EndIf nxi = Math.Floor(nx / UNIT_SIZE) + 1 If yd < 0 Then ny = y - 1 ElseIf 0 < yd then ny = y + UNIT_SIZE + 1 Else ny = y EndIf nyi = Math.Floor(ny / UNIT_SIZE) + 1 ' マップ上の求めた位置に壁があるか If Text.GetSubText(WALLS [nyi], nxi, 1) = "1" Then ' すべての移動方向を0に設定する(つまり、停止させる) xk = 0 yk = 0 xd = 0 yd = 0 EndIf ' ロボットの移動位置を計算 x = x + xd * SPEED y = y + yd * SPEED ' ロボットのシェイプを移動 Shapes.Move(robot, x, y) ' ゴール判定 If x = GOAL_X * UNIT_SIZE And y = GOAL_Y * UNIT_SIZE Then status = "GOAL" gametime = Clock.ElapsedMilliseconds - starttime GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.DrawText(300,200, gametime / 100) EndIf ' 敵の動き For ie = 1 To ENEMY_NUM If exd[ie] < 0 Then enx = ex[ie] - 1 ElseIf 0 < exd[ie] then enx = ex[ie] + UNIT_SIZE + 1 Else enx = ex[ie] EndIf enxi = Math.Floor(enx / UNIT_SIZE) + 1 If eyd[ie] < 0 Then eny = ey[ie] - 1 ElseIf 0 < eyd[ie] then eny = ey[ie] + UNIT_SIZE + 1 Else eny = ey[ie] EndIf enyi = Math.Floor(eny / UNIT_SIZE) + 1 If Text.GetSubText(WALLS [enyi], enxi, 1) = "1" Then ' 敵が壁にぶつかった時、逆方向に動く exd[ie] = -exd[ie] eyd[ie] = -eyd[ie] EndIf ex[ie] = ex[ie] + exd[ie] * ENEMY_SPEED ey[ie] = ey[ie] + eyd[ie] * ENEMY_SPEED Shapes.Move(enemy[ie], ex[ie], ey[ie]) If (x - ex[ie]) * (x - ex[ie]) + (y - ey[ie]) * (y - ey[ie]) < UNIT_SIZE * UNIT_SIZE Then status = "GAME OVER" GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.PenColor = "Yellow" GraphicsWindow.FillEllipse(x - 135, y - 135, 300, 300) Program.Delay(DELAY) GraphicsWindow.BrushColor = BACK_COLOR GraphicsWindow.PenColor = BACK_COLOR GraphicsWindow.FillEllipse(x - 135, y - 135, 300, 300) GraphicsWindow.ShowMessage("ギャーーー!!", "OUT") Goto st EndIf EndFor ' 速度調整のための待機 Program.Delay(DELAY) EndWhile If status = "GOAL" then GraphicsWindow.ShowMessage("次のステージへ", "ゴール") ss=ss+1 GraphicsWindow.Clear() goto st EndIf gameend: Program.End() ' サブルーチン (キーが押されたときに呼ばれる) Sub onKeyDown KeyName = GraphicsWindow.LastKey ' 最後に操作されたキーの名前を取得 If KeyName = "Left" Then ' カーソル(左)キーだったら xk = -1 ' 横移動方向を左(-1)に yk = 0 ' 縦移動方向を止(0)に ElseIf KeyName = "Right" Then ' カーソル(右)キーだったら xk = 1 ' 横移動方向を右(1)に yk = 0 ' 縦移動方向を止(0)に ElseIf KeyName = "Up" Then ' カーソル(上)キーだったら xk = 0 ' 横移動方向を止(0)に yk = -1 ' 縦移動方向を上(-1)に ElseIf KeyName = "Down" Then ' カーソル(下)キーだったら xk = 0 ' 横移動方向を止(0)に yk = 1 ' 縦移動方向を下(1)に EndIf EndSub End>GFW257.sb< Start>GFW453.sb< UserName = "Zock77" Ip = "192.168.1.129" 'Change this to your IP 'Remember to turn on wamp or this won't work While 1 = 1 x = Math.GetRandomNumber(100) y = Math.GetRandomNumber(100) Z = Math.GetRandomNumber(100) url="http://" + Ip + "/server/server.php?program="+Username+"&x="+ X +"&y="+ Y + "&Z=" + Z 'Sends data data = Network.GetWebPageContents(url) 'Gets data TextWindow.Clear() TextWindow.WriteLine("x = " + data[Username + "x"]) 'These can be accseced from any computer around the world TextWindow.WriteLine("y = " + data[Username + "y"]) TextWindow.WriteLine("z = " + data[Username + "Z"]) Program.Delay(1000) EndWhile End>GFW453.sb< Start>GFX519.sb< GraphicsWindow.Title="RectDrw GraphicsWindow.MouseDown=mUp GraphicsWindow.MouseMove=mmm GraphicsWindow.BrushColor="transparent" GraphicsWindow.BackgroundColor="tan ddd="true Sub mmm If num=1 and ddd Then mx1=GraphicsWindow.MouseX my1=GraphicsWindow.MouseY If ox+oy+ox*oy<>mx1+my1+mx1*my1 Then ddd="false For t=1 To 4 Shapes.Remove(ss[t]) EndFor GraphicsWindow.PenColor="red ss[1]=Shapes.AddLine(mx my mx,my1) ss[2]=Shapes.AddLine(mx my mx1 my) ss[3]=Shapes.AddLine(mx1 my mx1 my1) ss[4]=Shapes.AddLine(mx my1 mx1 my1) For t=1 To 4 LDShapes.PenStyle(ss[t] 2 2) EndFor ox=mx1 oy=my1 ddd="true EndIf EndIf EndSub Sub mUp num=Math.Remainder(num+1,2) If num=1 Then mx=GraphicsWindow.MouseX my=GraphicsWindow.MouseY ElseIf Mouse.IsRightButtonDown Then Goto rrr Else GraphicsWindow.PenColor="darkblue mx1=GraphicsWindow.MouseX my1=GraphicsWindow.MouseY If mx1GFX519.sb< Start>GFZ321.sb< korr() ' The following line could be harmful and has been automatically commented. ' 'ff=File.ReadContents("e:\krnna.spl") GraphicsWindow.Title="SVM Renderer bbb=LDShapes.BrushGradient("1=tan;2=tan;3=#FF6B0000" "DD") LDGraphicsWindow.BackgroundBrush(bbb) hlw="true VT = Text.GetCharacter(9) CR = Text.GetCharacter(13) LF = Text.GetCharacter(10) WQ = Text.GetCharacter(34) scale=5 not="true=false;false=true LDEvents.MouseWheel=mww GraphicsWindow.KeyDown=kkd mmr=LDText.Split("OpenSVM OpenPoly SavePoly SaveClrs LoadClrs SaveProps LoadProps" " ") LDDialogs.AddRightClickMenu(mmr "") LDDialogs.RightClickMenu=rcll ccc=LDText.Split("white red red red red red red red red red red " " ") ff=korf ox=2120 oy=-180 zz=1.5 LDGraphicsWindow.Reposition(zz zz ox, oy 0) GraphicsWindow.Width=Desktop.Width GraphicsWindow.Height=Desktop.Height GraphicsWindow.Left=0 GraphicsWindow.Top=0 LDUtilities.ShowNoShapeErrors="false rendd() 'ldpol() 'fi="e:\koronn.spc scl() spp() LDGraphicsWindow.Reposition(zz zz ox, oy 0) While 1=1 If sclr Then sclr="false cc=LDDialogs.Colour() If cc="" Then Else LDShapes.BrushColour(Ls cc) clmt[ls]=cc EndIf EndIf Program.Delay(1) EndWhile '------------------------subs============================= Sub spp ff=korm For r=1 To Array.GetItemCount(ff) Shapes.Move(shp[r] ff[r][1] ff[r][2]) EndFor EndSub Sub rcll rm=LDDialogs.LastRightClickMenuItem If rm=1 Then fi=LDDialogs.OpenFile("svm" "e:\") If fi="" Then Else GraphicsWindow.Clear() ' The following line could be harmful and has been automatically commented. ' ff=File.ReadContents(fi) pi=0 ptm="" rendd() EndIf ElseIf rm=4 Then fi=LDDialogs.SaveFile("spc" "e:\") If fi="" Then Else ' The following line could be harmful and has been automatically commented. ' File.WriteContents(fi clmt) EndIf ElseIf rm=6 Then fi=LDDialogs.SaveFile("spp" "e:\") If fi="" Then Else aaa=LDShapes.GetAllShapes() prpz="" For f=1 To Array.GetItemCount(aaa) prpz[f][1]=Shapes.GetLeft(aaa[f]) prpz[f][2]=Shapes.GetTop(aaa[f]) prpz[f][3]=Shapes.GetOpacity(aaa[f]) prpz[f][4]=f EndFor ' The following line could be harmful and has been automatically commented. ' File.WriteContents(fi prpz) EndIf ElseIf rm=5 Then fi=LDDialogs.OpenFile("spc" "e:\") If fi="" Then Else scl() EndIf ElseIf rm=7 Then fi=LDDialogs.OpenFile("spp" "e:\") If fi="" Then Else spp() EndIf ElseIf rm=2 Then fi=LDDialogs.OpenFile("spl" "e:\") If fi="" Then Else GraphicsWindow.Clear() ' The following line could be harmful and has been automatically commented. ' ff=File.ReadContents(fi) ldpol() EndIf ElseIf rm=3 Then fi=LDDialogs.SaveFile("spl" "e:\") If fi="" Then Else ' The following line could be harmful and has been automatically commented. ' File.WriteContents(fi ptm) EndIf EndIf EndSub Sub scl clmt=korc ci=Array.GetAllIndices(clmt) For f=1 To Array.GetItemCount(clmt) LDShapes.BrushColour(ci[f] clmt[ci[f]]) EndFor EndSub Sub ldpol GraphicsWindow.BrushColor="#33bbbbbb GraphicsWindow.PenWidth=.4 GraphicsWindow.PenColor="black GraphicsWindow.Title=Array.GetItemCount(ff) For f=1 To Array.GetItemCount(ff) po=LDShapes.AddPolygon(ff[f]) LDShapes.SetShapeEvent(po) EndFor LDShapes.ShapeEvent=see zz=1.3 aaa=LDShapes.GetAllShapes() LDGraphicsWindow.Reposition(zz zz ox, oy 0) EndSub Sub see If LDShapes.LastEventType="MouseDown" Then If Mouse.IsLeftButtonDown Then If FCKeyboard.IsControlPressed Then lsh=LDShapes.LastEventShape Else ls=LDShapes.LastEventShape sclr="true EndIf ElseIf Mouse.IsRightButtonDown Then lsh=LDShapes.LastEventShape EndIf EndIf EndSub Sub kkd lk=text.ConvertToLowerCase( GraphicsWindow.LastKey) If lk="left" Then If FCKeyboard.IsControlPressed Then Shapes.Move(lsh Shapes.GetLeft(lsh)-1 Shapes.GetTop(lsh)) Else ox=ox-20 EndIf ElseIf lk="return" Then sclr="true ElseIf lk="f1" Then For f=1 To Array.GetItemCount(aaa) LDShapes.penColour(aaa[f] "black") LDShapes.BrushColour(aaa[f] "transparent") EndFor ElseIf lk="f2" Then For f=1 To Array.GetItemCount(aaa) LDShapes.penColour(aaa[f] "black") bb=clmt[aaa[f]] If bb="" Then bb="transparent EndIf LDShapes.BrushColour(aaa[f] bb) EndFor ElseIf lk="tab" Then LDShapes.penColour(aaa[ti] "black") If FCKeyboard.IsControlPressed Then ti=ti-1 Else ti=ti+1 EndIf If ti>Array.GetItemCount(aaa) Then ti=1 ElseIf ti<1 Then ti=Array.GetItemCount(aaa) EndIf lsh=aaa[ti] ls=lsh GraphicsWindow.Title="#"+ti LDShapes.penColour(aaa[ti] "white") ElseIf lk="right" Then If FCKeyboard.IsControlPressed Then Shapes.Move(lsh Shapes.GetLeft(lsh)+1 Shapes.GetTop(lsh)) Else ox=ox+20 EndIf ElseIf lk="up" Then If FCKeyboard.IsControlPressed Then Shapes.Move(lsh Shapes.GetLeft(lsh) Shapes.GetTop(lsh)-1) Else oy=oy-20 EndIf ElseIf lk="down" Then If FCKeyboard.IsControlPressed Then Shapes.Move(lsh Shapes.GetLeft(lsh) Shapes.GetTop(lsh)+1) Else oy=oy+20 EndIf EndIf LDGraphicsWindow.Reposition(zz zz ox, oy 0) GraphicsWindow.Title=ox+":"+oy EndSub Sub mww zz=zz+LDEvents.LastMouseWheelDelta/10 LDGraphicsWindow.Reposition(zz zz ox, oy 0) GraphicsWindow.Title=zz EndSub Sub SVG_SetAttr If attr["style"] <> "" Then style = LDText.Split(attr["style"], ";") nStyle = Array.GetItemCount(style) For iStyle = 1 To nStyle pair = LDText.Split(style[iStyle], ":") If attr[pair[1]] = "" Then attr[pair[1]] = LDText.Replace(pair[2], "\", "") EndIf EndFor EndIf If (attr["stroke"] = "") Or (attr["stroke"] = "none") Then GraphicsWindow.PenColor = "Transparent" Else GraphicsWindow.PenColor = attr["stroke"] EndIf If attr["stroke-width"] <> "" Then GraphicsWindow.PenWidth = attr["stroke-width"] * scale EndIf If attr["fill"] = "none" Then GraphicsWindow.BrushColor = "Transparent" ElseIf attr["fill"] <> "" Then GraphicsWindow.BrushColor = attr["fill"] Else GraphicsWindow.BrushColor = "Black" EndIf EndSub Sub rendd xl=0 yt=0 For q=1 To Array.GetItemCount(ff) If Array.ContainsIndex(ff[q] "d") Then buf=(ff[q]["d"]) ps_d() ElseIf ff[q]["element"]= "rect" Then attr=(ff[q]) 'TextWindow.WriteLine(buf) 'SVG_SetAttr() width = attr["width"] * scale height = attr["height"] * scale x = attr["x"] * scale y = attr["y"] * scale 'dd=" / " 'TextWindow.WriteLine(x+dd+y+dd+width+dd+height) nShp = nShp + 1 GraphicsWindow.BrushColor="transparent shp[nShp] = Shapes.AddRectangle(width, height) Shapes.Move(shp[nShp], xL + x, yT + y) If width<350*scale Then Shapes.Zoom(shp[nShp] .95 .95) LDShapes.BrushColour(shp[nShp] "gray") LDEffect.DropShadow(shp[nShp] "") EndIf EndIf EndFor EndSub Sub AddArc_Ps ' param large_arc_flag = 1 if angle > 180° param swp_flag = 1 if positive angle _x = (ps["x"] + pe["x"]) / 2 _y = (ps["y"] + pe["y"]) / 2 dx = (ps["x"] - pe["x"]) dy = (ps["y"] - pe["y"]) d = Math.SquareRoot(dx * dx + dy * dy) da = 10 r = d / 2 k = rx / r If k < 1 Then match = "False" Else _d = k * d _r = _d / 2 If large_arc_flag = sweep_flag Then cx = _x - (dy / 2) * (k * r * Math.Sin(Math.ArcCos(1 / k))) / r cy = _y + (dx / 2) * (k * r * Math.Sin(Math.ArcCos(1 / k))) / r Else cx = _x + (dy / 2) * (k * r * Math.Sin(Math.ArcCos(1 / k))) / r cy = _y - (dx / 2) * (k * r * Math.Sin(Math.ArcCos(1 / k))) / r EndIf cc=ldMath.Convert2Radial(cx cy ps["x"] ps["y"]) as = cc[2] cc=ldMath.Convert2Radial(cx cy pe["x"] pe["y"]) ae = cc[2] If sweep_flag = 1 Then If ae < as Then ae = ae + 360 EndIf For a = as To ae Step da x = cx + rx * LDMath.Cos(a) y = cy + ry * LDMath.Sin(a) AddPoint() EndFor If a < ae + da Then x = cx + rx * LDMath.Cos(ae) y = cy + ry * LDMath.Sin(ae) AddPoint() EndIf Else ' sweep_flag = 0 If as < ae Then as = as + 360 EndIf For a = as To ae Step -da x = cx + rx * LDMath.Cos(a) y = cy + ry * LDMath.Sin(a) AddPoint() EndFor If ae - da < a Then x = cx + rx * LDMath.Cos(ae) y = cy + ry * LDMath.Sin(ae) AddPoint() EndIf EndIf xo = x yo = y EndIf EndSub Sub AddCubic_Ps nC = nC + 1 _c[nC] = "x=" + x1 + ";y=" + y1 + ";" nc = nC + 1 _c[nC] = "x=" + x2 + ";y=" + y2 + ";" nc = nC + 1 _c[nC] = "x=" + x + ";y=" + y + ";" For t = 0 To 1 Step 0.05 x1 = (1 - t) * _c[nC - 3]["x"] + t * _c[nC - 2]["x"] y1 = (1 - t) * _c[nC - 3]["y"] + t * _c[nC - 2]["y"] x2 = (1 - t) * _c[nC - 2]["x"] + t * _c[nC - 1]["x"] y2 = (1 - t) * _c[nC - 2]["y"] + t * _c[nC - 1]["y"] x3 = (1 - t) * _c[nC - 1]["x"] + t * _c[nC]["x"] y3 = (1 - t) * _c[nC - 1]["y"] + t * _c[nC]["y"] x12 = (1 - t) * x1 + t * x2 y12 = (1 - t) * y1 + t * y2 x23 = (1 - t) * x2 + t * x3 y23 = (1 - t) * y2 + t * y3 x = (1 - t) * x12 + t * x23 y = (1 - t) * y12 + t * y23 AddPoint() EndFor xo = x yo = y EndSub Sub AddPoint If __Ps <> "" Then __Ps = __Ps + " " EndIf __Ps = __Ps + x + "," + y EndSub Sub AddQuad_Ps nQ = nQ + 1 _q[nQ] = "x=" + x1 + ";y=" + y1 + ";" nQ = nQ + 1 _q[nQ] = "x=" + x + ";y=" + y + ";" For t = 0 To 1 Step 0.05 x1 = (1 - t) * _q[nQ - 2]["x"] + t * _q[nQ - 1]["x"] y1 = (1 - t) * _q[nQ - 2]["y"] + t * _q[nQ - 1]["y"] x2 = (1 - t) * _q[nQ - 1]["x"] + t * _q[nQ]["x"] y2 = (1 - t) * _q[nQ - 1]["y"] + t * _q[nQ]["y"] x = (1 - t) * x1 + t * x2 y = (1 - t) * y1 + t * y2 AddPoint() EndFor xo = x yo = y EndSub Sub ps_Arc _p = p char = "Aa" ps_Char() If match Then cmd = c EndIf matchA = "False" ps = "x=" + xo + ";y=" + yo + ";" ' start point While match ps_Space() ps_Point() ' rx, ry If match Then rx = x ry = y ps_Space() ps_Number() ' x-axis-rotation EndIf If match Then x_axis_rotation = number ps_Space() char = "01" ps_Char() ' large-arc-flag EndIf If match Then large_arc_flag = c ps_Space() char = "01" ps_Char() ' sweep-flag EndIf If match Then sweep_flag = c ps_Space() ps_Point() ' end point EndIf If match Then If cmd = "a" Then x = xo + x y = yo + y EndIf matchA = "True" pe = "x=" + x + ";y=" + y + ";" AddArc_Ps() EndIf EndWhile If Not[matchA] Then p = _p Else _Ps[n_Ps] = _Ps[n_Ps] + " " + __Ps match = "True" EndIf EndSub Sub ps_Char match = "False" c = Text.GetSubText(buf, p, 1) If (p <= len) And Text.IsSubText(char, c) Then match = "True" p = p + 1 EndIf EndSub Sub ps_ClosePath char = "Zz" ps_Char() If match Then closed[n_Ps] = "True" xo = xz yo = yz cmd = c EndIf EndSub Sub ps_Cubic _p = p char = "CcSs" ps_Char() If match Then cmd = c EndIf matchC = "False" If Text.IsSubText("Cc", cmd) Then _c = "" nC = 1 _c[nC]["x"] = xo _c[nC]["y"] = yo While match ps_Space() ps_Point() ' control point 1 If match Then If cmd = "c" Then x = xo + x y = yo + y EndIf x1 = x y1 = y ps_Space() ps_Point() ' control point 2 If cmd = "c" Then x = xo + x y = yo + y EndIf EndIf If match Then x2 = x y2 = y ps_Space() ps_Point() ' end point If cmd = "c" Then x = xo + x y = yo + y EndIf EndIf If match Then matchC = "True" AddCubic_Ps() EndIf EndWhile Else ' S or s ps_Space() ps_Point() ' end point If match Then If cmd = "s" Then x = xo + x y = yo + y EndIf x1 = _c[nC]["x"] + (_c[nC]["x"] - _c[nC - 1]["x"]) y1 = _c[nC]["y"] + (_c[nC]["x"] - _c[nC - 1]["x"]) AddCubic_Ps() EndIf EndIf If Not[matchC] Then p = _p Else _Ps[n_Ps] = _Ps[n_Ps] + " " + __Ps match = "True" EndIf EndSub Sub Render_Polygon For iPts = 1 To nPts _pt = LDText.Split(pts[iPts], ",") pt[iPts][1] = Math.Round(_pt[1] * scale) pt[iPts][2] = Math.Round(_pt[2] * scale) EndFor nShp = nShp + 1 shp[nShp] = LDShapes.AddPolygon(pt) pi=pi+1 ptm[pi]=pt If hlw Then LDShapes.BrushColour(shp[nShp] "transparent") LDShapes.PenWidth(shp[nShp] 0.8) LDShapes.PenColour(shp[nShp] "black") EndIf Shapes.Move(shp[nShp], 50, -50)'xL, yT) EndSub Sub ps_LineTo _p = p char = "LlHhVv" ps_Char() If match Then cmd = c __Ps = "" EndIf matchL = "False" If Text.IsSubText("Ll", cmd) Then While match ps_Space() ps_Point() If match Then matchL = "True" If cmd = "l" Then x = xo + x y = yo + y EndIf AddPoint() xo = x yo = y EndIf EndWhile Else ' cmd is subtext of "HhVv" While match ps_Space() ps_Number() If match Then matchL = "True" If cmd = "H" Then x = number y = yo ElseIf cmd = "h" Then x = xo + number y = yo ElseIf cmd = "V" Then x = xo y = number ElseIf cmd = "v" Then x = xo y = yo + number EndIf AddPoint() xo = x yo = y EndIf EndWhile EndIf If Not[matchL] Then p = _p Else _Ps[n_Ps] = _Ps[n_Ps] + " " + __Ps match = "True" EndIf EndSub Sub ps_MoveTo _p = p char = "Mm" ps_Char() If match Then cmd = c __Ps = "" EndIf matchM = "False" While match ps_Space() ps_Point() If match Then matchM = "True" If cmd = "m" Then x = xo + x y = yo + y EndIf AddPoint() xo = x yo = y xz = x yz = y EndIf EndWhile If Not[matchM] Then p = _p Else match = "True" n_Ps = n_Ps + 1 _Ps[n_Ps] = __Ps closed[n_Ps] = "False" EndIf EndSub Sub ps_Number _p = p matchN = "False" char = "-" ps_Char() If match Then number = "-" Else number = "" EndIf match = "True" char = "0123456789" While match ps_Char() If match Then number = Text.Append(number, c) matchN = "True" EndIf EndWhile char = "." ps_Char() If match Then number = Text.Append(number, c) EndIf char = "0123456789" While match ps_Char() If match Then number = Text.Append(number, c) matchN = "True" EndIf EndWhile If Not[matchN] Then p = _p Else match = "True" EndIf EndSub Sub ps_Point _p = p match = "False" ps_Number() If match Then x = number ps_Space() match = "True" EndIf If match Then ps_Number() EndIf If match Then y = number Else p = _p EndIf EndSub Sub ps_Quadratic _p = p char = "QqTt" ps_Char() If match Then cmd = c EndIf matchQ = "False" If Text.IsSubText("Qq", cmd) Then _q = "" nQ = 1 _q[nQ]["x"] = xo _q[nQ]["y"] = yo While match ps_Space() ps_Point() ' control point If cmd = "q" Then x = xo + x y = yo + y EndIf x1 = x y1 = y If match Then ps_Space() ps_Point() ' end point If cmd = "q" Then x = xo + x y = yo + y EndIf EndIf If match Then matchQ = "True" AddQuad_Ps() EndIf EndWhile Else ' T or t ps_Space() ps_Point() ' end point If match Then If cmd = "t" Then x = xo + x y = yo + y EndIf x1 = _q[nQ]["x"] + (_q[nQ]["x"] - _q[nQ - 1]["x"]) y1 = _q[nQ]["y"] + (_q[nQ]["x"] - _q[nQ - 1]["x"]) AddQuad_Ps() EndIf EndIf If Not[matchQ] Then p = _p Else _Ps[n_Ps] = _Ps[n_Ps] + " " + __Ps match = "True" EndIf EndSub Sub ps_d'--------------paths--------- match = "False" len = Text.GetLength(buf) p = 1 _Ps = "" closed = "" n_Ps = 0 xo = 0 yo = 0 While p <= len ps_Space() ps_MoveTo() If Not[match] Then ps_LineTo() EndIf If Not[match] Then ps_Cubic() EndIf If Not[match] Then ps_Quadratic() EndIf If Not[match] Then ps_Arc() EndIf If Not[match] Then ps_ClosePath() EndIf EndWhile ' SVG_SetAttr() For i_Ps = 1 To n_Ps pt = "" pts = LDText.Split(_Ps[i_Ps], " ") nPts = Array.GetItemCount(pts) Render_Polygon() EndFor EndSub Sub Render_Polyline GraphicsWindow.PenWidth=.5 For iPts = 1 To nPts _pt = LDText.Split(pts[iPts], ",") x2 = Math.Round(_pt[1] * scale) y2 = Math.Round(_pt[2] * scale) If 1 < iPts Then nShp = nShp + 1 shp[nShp] = Shapes.AddLine(x1, y1, x2, y2) Shapes.Move(shp[nShp], xL, yT) EndIf x1 = x2 y1 = y2 EndFor 'Program.Delay(1222) EndSub Sub ps_Space match = "False" While (p <= len) And Text.IsSubText(" ," + VT + CR + LF, Text.GetSubText(buf, p, 1)) match = "True" p = p + 1 EndWhile EndSub Sub korr korf="1=element\=svg\;level\=1\;;2=element\=g\;level\=2\;id\=11\;;3=element\=path\;level\=3\;d\=m -300.59645,69.566961 c -0.87875,0 -1.67535,0.792681 -1.67535,1.670182 0,0.899997 1.32497,2.301056 0.36122,2.895431 -0.61314,0.376876 -1.7982,-0.359151 -2.66289,-0.359151 -0.87781,0 -1.67122,0.717018 -1.67122,1.595768 0,0.878126 0.79341,1.595769 1.67122,1.595769 0.81,0 3.03329,-1.534837 2.98173,-0.364836 l -0.0263,0.602547 -0.20464,2.863392 c -1.87264,0.533459 -3.24425,2.253031 -3.24425,4.296379 0,0.953595 0.30375,1.833141 0.81287,2.558499 -1.04485,0.550987 -1.6924,1.804575 -1.6924,3.449402 -0.0144,2.369999 -2.69286,2.272212 -2.69286,2.272212 0,0 0.20328,1.179952 1.19735,1.699638 0.25573,0.133459 0.52165,0.221091 0.7891,0.270785 -1.34536,1.039911 -2.81125,1.785091 -4.34134,2.324404 -0.34816,-0.839345 -1.17555,-1.431953 -2.13786,-1.431953 -1.27616,0 -2.31614,1.039415 -2.31614,2.315622 0,0.0589 0.003,0.116951 0.008,0.174665 -1.01347,0.150008 -2.02965,0.251835 -3.03547,0.331245 -0.17742,-1.193279 -1.20611,-2.113566 -2.44791,-2.113566 -1.35065,0 -2.45091,1.087893 -2.47582,2.43241 -1.08451,0.07874 -2.12561,0.177162 -3.08715,0.338481 -0.51709,-0.689885 -1.33954,-1.138949 -2.26601,-1.138949 -1.56074,0 -2.83187,1.271678 -2.83187,2.832383 0,0.16487 0.0166,0.32572 0.0444,0.48266 -0.66619,0.56295 -1.18519,1.17663 -1.5782,1.82831 -0.0268,0 -0.0526,-0.005 -0.0796,-0.005 -1.61777,0 -2.93574,1.31649 -2.93574,2.93523 0,1.35866 0.93033,2.50218 2.18643,2.83445 0.15784,0.87578 0.4141,1.75745 0.73381,2.62826 -0.70514,0.41523 -1.18081,1.17994 -1.18081,2.05517 0,1.31558 1.07201,2.38642 2.38745,2.38642 0.30475,0 0.59586,-0.0587 0.86403,-0.16381 0.48884,0.8278 0.9904,1.59585 1.47536,2.2996 -0.0422,0.01 -0.0845,0.0175 -0.1266,0.0279 -0.96469,0.23719 -1.96899,0.6523 -2.5368,1.10949 3.72803,1.31682 5.47927,2.86657 7.18768,5.01778 -0.24163,0.47426 -0.36846,0.96007 -0.36846,1.45417 0,0.68834 0.63561,1.10586 1.40922,1.54306 -0.0468,0.19921 -0.0604,0.40581 -0.0238,0.61289 0.14468,0.82488 1.01448,1.46441 1.69447,1.6061 0.021,0.18905 0.0546,0.40556 0.11627,0.57102 0.11499,0.31137 0.39956,0.65727 0.57723,0.8568 -0.43003,0.55338 -0.65836,1.14133 -0.65836,1.75803 0,3.18187 9.45451,5.72782 21.7842,5.72782 12.33094,0 21.78575,-2.54594 21.78575,-5.72782 0,-0.61333 -0.22614,-1.19795 -0.65164,-1.74873 0.17679,-0.19778 0.46848,-0.55041 0.5855,-0.8661 0.0192,-0.0516 0.0351,-0.10902 0.0496,-0.16846 0.0644,0.0273 0.12979,0.0491 0.19688,0.061 0.67251,0.11719 1.9336,-0.61524 2.11047,-1.62367 0.0889,-0.50264 -0.10442,-1.0052 -0.40359,-1.39682 0.49923,-0.49065 0.81752,-1.0276 0.81752,-1.6154 0,-0.28723 -0.0549,-0.57438 -0.15865,-0.86042 1.82132,-2.26934 3.9783,-3.95238 7.41919,-5.20123 -0.56813,-0.45718 -1.57242,-0.8723 -2.5368,-1.10949 -0.13994,-0.0345 -0.28006,-0.0626 -0.42013,-0.0878 0.47285,-0.68943 0.96063,-1.43713 1.43454,-2.23966 0.26818,0.10511 0.55928,0.16382 0.86403,0.16382 1.31545,0 2.38745,-1.07084 2.38745,-2.38642 0,-0.87523 -0.47567,-1.63994 -1.18081,-2.05517 0.31971,-0.87081 0.57597,-1.75248 0.73381,-2.62827 1.2561,-0.33226 2.18643,-1.47579 2.18643,-2.83445 0,-1.61873 -1.31797,-2.93522 -2.93574,-2.93522 -0.0269,0 -0.0528,0.004 -0.0796,0.005 -0.393,-0.65168 -0.91201,-1.26536 -1.5782,-1.82831 0.0278,-0.15694 0.0444,-0.31779 0.0444,-0.48266 0,-1.560708 -1.27113,-2.832386 -2.83187,-2.832386 -0.92647,0 -1.74892,0.449064 -2.26601,1.138949 -0.96154,-0.161319 -2.00264,-0.259744 -3.08715,-0.338481 -0.0249,-1.344517 -1.12517,-2.43241 -2.47582,-2.43241 -1.2418,0 -2.27049,0.9203 -2.44791,2.113566 -1.00581,-0.0794 -2.022,-0.181237 -3.03547,-0.331245 0.005,-0.05771 0.008,-0.115761 0.008,-0.174665 0,-1.276207 -1.03998,-2.315622 -2.31614,-2.315622 -0.96231,0 -1.7897,0.592608 -2.13786,1.431953 -1.51131,-0.532698 -2.95994,-1.266187 -4.29172,-2.286163 0.36172,-0.03144 0.7271,-0.128487 1.07332,-0.309026 0.99437,-0.519686 1.19734,-1.697572 1.19734,-1.697572 0,0 -2.69234,0.0966 -2.69234,-2.293399 0,-1.632836 -0.64712,-2.881469 -1.69189,-3.430797 0.50852,-0.725537 0.81235,-1.604922 0.81235,-2.557983 0,-2.04388 -1.37328,-3.763394 -3.24631,-4.296379 l -0.20266,-2.840661 -0.0284,-0.625285 c -0.0519,-1.170937 2.10599,0.364836 2.9838,0.364836 0.87782,0 1.67122,-0.717643 1.67122,-1.595769 0,-0.87875 -0.7934,-1.595768 -1.67122,-1.595768 -0.89532,0 -2.08196,0.736027 -2.66133,0.359151 -0.97219,-0.633745 0.35966,-1.995429 0.35966,-2.895431 0,-0.877498 -0.7968,-1.670182 -1.67586,-1.670182 z\;;4=element\=path\;level\=3\;d\=m -300.59645,80.385423 c 2.1975,0 3.97753,1.781279 3.97753,3.977535 0,0.889838 -0.29409,1.709364 -0.78858,2.370915 -0.36618,-0.109342 -0.76685,-0.148362 -1.19838,-0.09715 -0.86718,0.101875 -1.45484,0.539525 -1.99109,1.025776 -0.535,-0.486251 -1.12081,-0.922652 -1.98644,-1.025776 -0.43267,-0.05181 -0.83432,-0.01286 -1.20148,0.09715 -0.49479,-0.661538 -0.7891,-1.481034 -0.7891,-2.370915 0,-2.196251 1.78129,-3.977535 3.97754,-3.977535 z\;;5=element\=path\;level\=3\;d\=m -303.79006,93.850751 c 0,0 -0.12194,0.08228 -0.30592,0.188619 -0.39661,0.685387 -1.11194,2.03001 -1.53117,3.487642 -0.0118,0.04588 -0.0265,0.09095 -0.0398,0.136424 -0.20838,0.7635 -0.32918,1.545254 -0.26562,2.263429 0.17,1.934685 1.45772,3.414455 1.82366,5.321635 0.11991,0.62537 0.16579,1.32745 0.17105,2.02262 0.22666,-0.36362 0.45971,-0.6987 0.69401,-1.00046 0.023,-0.50825 0.027,-1.01321 0.005,-1.50998 -0.0231,-0.52313 -0.21014,-1.33388 -0.43201,-2.14044 -0.21969,-0.80656 -0.4745,-1.60542 -0.632,-2.10323 -0.47032,-1.485001 -0.0955,-3.244903 0.39481,-4.630208 0.32071,-0.90559 0.58416,-1.333736 0.76481,-1.680517 -0.16178,-0.117242 -0.30948,-0.236572 -0.4377,-0.355534 z\;;6=element\=path\;level\=3\;d\=m -325.67451,115.07994 c 0.27241,-1.51129 0.85421,-2.5988 0.85421,-2.5988 0,0 0.40887,-0.0208 1.05937,0.0827 -2.14519,-2.37114 -3.49699,-4.90513 -2.27686,-7.136 2.21477,-4.0516 13.2211,-0.82646 19.57141,-7.143235 -0.44649,-0.159946 -0.88687,-0.372864 -1.26866,-0.662493 v 0 c -7.21973,5.200785 -16.45189,2.290707 -20.07474,5.215705 -4.01414,3.23991 -1.16972,8.30698 2.13527,12.24214\;;7=element\=path\;level\=3\;d\=m -302.53329,94.582961 c -0.66861,1.300994 -1.83126,4.038066 -1.07486,6.202719 0.35812,1.02719 1.05871,3.1739 1.07435,4.2814 0.003,0.22145 -0.005,0.45672 -0.0207,0.70125 1.05683,-1.12772 1.9575,-1.62368 1.9575,-1.62368 0,0 0.90408,0.49751 1.96319,1.62885 -0.0161,-0.24596 -0.0238,-0.48254 -0.0207,-0.70539 0.0144,-1.10844 0.71529,-3.25575 1.07435,-4.28294 0.5175,-1.483442 0.41099,-2.485205 0.046,-3.478342 -0.2978,-0.812731 -0.76659,-1.623869 -1.20716,-2.678906 -0.49703,0.257006 -1.10537,0.485698 -1.85467,0.65164 -0.79288,-0.175443 -1.42575,-0.421468 -1.93735,-0.696601 z\;;8=element\=path\;level\=3\;d\=m -300.59697,104.57154 c 0,0 -3.50708,1.80052 -4.76301,6.83834 -1.88437,-3.47655 -5.18005,-4.49946 -5.18005,-4.49946 0,0 -1.92397,2.07471 -2.51303,5.75003 -2.74438,-2.72812 -5.26066,-3.00808 -5.26066,-3.00808 0,0 -1.12816,1.76558 -1.21284,5.32526 -2.58314,-2.07532 -5.21157,-2.08567 -5.21157,-2.08567 0,0 -1.33451,3.00499 -0.51263,5.94279 -0.87501,-0.41531 -1.90669,-0.58843 -3.14606,-0.50281 -1.05688,0.0738 -2.05446,0.24851 -2.62258,0.70539 2.25402,0.87253 4.43054,2.53466 6.03736,4.79299 0.70571,-1.1512 2.10005,-2.22484 4.02611,-3.1657 -0.16908,-0.34177 -0.3429,-0.69828 -0.48318,-1.00614 -0.4,-0.87594 -1.11621,-2.2779 -1.11621,-2.2779 -0.0109,-0.0266 0.0225,-0.0413 0.0357,-0.0176 0,0 0.89925,1.27065 1.40456,2.06034 0.19667,0.30761 0.43728,0.66426 0.66766,1.00149 1.63091,-0.7417 3.60653,-1.39085 5.84306,-1.91978 -0.10857,-0.27191 -0.51602,-1.39445 -0.85525,-2.21588 -0.38906,-0.94251 -1.06609,-2.38694 -1.06608,-2.38694 -0.0119,-0.0256 0.0204,-0.0445 0.0357,-0.0202 0,0 0.94367,1.42745 1.46554,2.38745 0.38527,0.70825 0.82196,1.67036 1.01545,2.10065 1.70444,-0.37898 3.55704,-0.68491 5.51439,-0.91313 -0.0924,-0.58274 -0.26579,-1.67538 -0.40308,-2.4846 -0.20344,-1.19625 -0.32422,-1.87097 -0.54828,-3.06441 -0.005,-0.0281 0.0307,-0.0376 0.0398,-0.0114 0.3975,1.155 0.60588,1.8119 0.94619,2.98535 0.23054,0.79355 0.5085,1.87604 0.66508,2.4939 2.14488,-0.2255 4.41308,-0.35446 6.76806,-0.36794 0.005,-0.11497 0.0873,-1.91288 0.16485,-3.11453 0.0803,-1.24375 0.24494,-4.00493 0.24494,-4.00493 0.003,-0.0275 0.0387,-0.43823 0.0419,-0.40979 0,0 0.15476,3.16982 0.22945,4.41265 0.0725,1.20359 0.14544,3.00673 0.14986,3.11609 2.37495,0.0142 4.65181,0.14929 6.79442,0.38292 0.15538,-0.6156 0.43673,-1.70936 0.66817,-2.50837 0.34094,-1.17344 0.5489,-1.82933 0.94672,-2.98432 0.009,-0.0272 0.0454,-0.0174 0.0398,0.01 -0.22438,1.19313 -0.34392,1.86785 -0.54829,3.06441 -0.13839,0.81425 -0.31386,1.92025 -0.40515,2.49959 1.96442,0.23732 3.80017,0.56196 5.49269,0.94982 0.18105,-0.40324 0.64259,-1.42132 1.03921,-2.15181 0.52219,-0.96 1.46555,-2.38745 1.46555,-2.38745 0.0153,-0.0241 0.0478,-0.006 0.0356,0.0196 0,0 -0.67682,1.44515 -1.06557,2.38797 -0.35437,0.85783 -0.80053,2.09396 -0.86454,2.27169 2.21342,0.53967 4.14383,1.19638 5.72988,1.92702 0.24211,-0.35378 0.50171,-0.73771 0.71055,-1.06505 0.50532,-0.78969 1.40405,-2.06034 1.40405,-2.06034 0.0144,-0.0238 0.0477,-0.009 0.0377,0.0176 0,0 -0.71777,1.40195 -1.11621,2.27789 -0.15002,0.32874 -0.33858,0.71456 -0.5178,1.07539 2.04505,1.01343 3.43337,2.15689 3.97289,3.33055 1.62058,-2.37869 3.87122,-4.12445 6.20272,-5.02709 -0.56781,-0.45687 -1.56674,-0.63163 -2.62362,-0.70538 -1.23844,-0.0856 -2.26961,0.0875 -3.14399,0.50281 0.82156,-2.93781 -0.18603,-5.36918 -0.18603,-5.36918 0,0 -2.95556,-0.56326 -5.53868,1.51205 -0.085,-3.55969 -1.21285,-5.32526 -1.21285,-5.32526 0,0 -2.51598,0.27997 -5.26066,3.00809 -0.5275,-3.89187 -2.51302,-5.75004 -2.51302,-5.75004 0,0 -3.29599,1.0229 -5.18005,4.49947 -1.25595,-5.03782 -4.76457,-6.83834 -4.76457,-6.83834 z\;;9=element\=path\;level\=3\;d\=m -300.61247,126.00124 c -12.32969,0 -21.05608,2.53786 -21.05608,6.51537 0,1.82186 2.86433,3.38202 7.62434,4.38371 -0.16172,-0.0377 -0.32396,-0.0751 -0.48007,-0.11421 -1.72765,-0.43319 -3.10895,-0.95184 -4.07883,-1.55339 -0.96987,-0.60155 -1.55701,-1.31149 -1.55701,-2.11925 0,-0.80776 0.58717,-1.51851 1.55701,-2.1208 0.96985,-0.60229 2.35117,-1.1218 4.07883,-1.55598 3.45531,-0.86836 8.29503,-1.38596 13.91181,-1.38596 5.61708,0 10.45693,0.5176 13.91233,1.38596 1.7277,0.43418 3.10948,0.95369 4.07934,1.55598 0.96985,0.60229 1.55701,1.31304 1.55701,2.1208 0,0.80776 -0.58713,1.5177 -1.55701,2.11925 -0.96989,0.60155 -2.35166,1.1202 -4.07934,1.55339 -0.15612,0.0391 -0.31836,0.0765 -0.48008,0.11421 4.76017,-1.00169 7.62434,-2.56186 7.62434,-4.38371 0,-3.9775 -8.72566,-6.51643 -21.05659,-6.51537 z\;;10=element\=path\;level\=3\;d\=m -300.61247,128.54476 c -2.53408,0 -4.904,0.10844 -7.059,0.30437 2.20291,0.15552 4.57212,0.23823 7.05952,0.23823 2.48741,0 4.8563,-0.0827 7.059,-0.23823 -2.15521,-0.19596 -4.52513,-0.30437 -7.05952,-0.30437 z m -9.54619,0.58601 c -1.29823,0.17498 -2.50261,0.38168 -3.57187,0.62373 3.61267,0.5968 8.1349,0.92501 13.11858,0.92501 4.98341,0 9.50546,-0.32826 13.11806,-0.92501 -1.0693,-0.24205 -2.27361,-0.44875 -3.57188,-0.62373 -2.8703,0.29354 -6.0973,0.45062 -9.54618,0.45062 -3.44869,0 -6.67625,-0.15706 -9.54671,-0.45062 z m -4.74028,0.91622 c -0.73796,0.20179 -1.40297,0.41995 -1.98334,0.65164 3.93126,1.00206 9.70445,1.57096 16.27033,1.57096 6.56532,0 12.33896,-0.56877 16.27032,-1.57096 -0.5804,-0.23167 -1.24545,-0.44988 -1.98334,-0.65164 -3.81601,0.72682 -8.76955,1.12655 -14.28698,1.12655 -5.51771,0 -10.47094,-0.39967 -14.28699,-1.12655 z m -2.70888,0.96687 c -0.26999,0.12981 -0.51617,0.26263 -0.73484,0.39842 -0.25796,0.1602 -0.47261,0.322 -0.6537,0.48473 3.77055,1.27879 10.50806,1.94303 18.38441,1.94303 7.8757,0 14.61344,-0.66355 18.3844,-1.94252 -0.1811,-0.16283 -0.39557,-0.32493 -0.6537,-0.48524 -0.21855,-0.13572 -0.46446,-0.26867 -0.73433,-0.39842 -4.01066,1.12375 -10.06065,1.75028 -16.99637,1.74976 -6.93601,0 -12.98526,-0.62624 -16.99587,-1.74976 z m -1.7787,1.31309 c -0.18545,0.26277 -0.28009,0.52605 -0.28009,0.78652 0,0.16538 0.0412,0.33201 0.11524,0.49868 3.62759,1.45848 10.65469,2.27581 18.93942,2.27634 8.28574,0 15.31215,-0.81839 18.93941,-2.27738 0.0737,-0.16632 0.11472,-0.3326 0.11472,-0.49764 0,-0.2602 -0.0946,-0.52298 -0.27957,-0.78548 -3.86857,1.37966 -10.71974,2.04742 -18.77456,2.04638 -8.05583,0 -14.90654,-0.6678 -18.77457,-2.04742 z\;;11=element\=path\;level\=3\;d\=m -318.79689,134.49426 c 3.95892,1.30048 10.5225,1.96995 18.18494,1.97042 7.66093,0 14.22466,-0.66876 18.1839,-1.96887 -0.13617,0.10639 -0.28363,0.21212 -0.4532,0.3173 -0.89858,0.55732 -2.24155,1.06892 -3.93878,1.49448 -3.39447,0.85112 -8.20571,1.36684 -13.79244,1.36684 -5.58641,0 -10.39701,-0.51572 -13.79141,-1.36684 -1.6972,-0.42556 -3.04021,-0.93716 -3.93878,-1.49448 -0.17015,-0.10554 -0.31769,-0.2121 -0.45423,-0.31885 z\;;12=element\=path\;level\=3\;d\=m -313.65566,124.87505 -0.31625,-1.89625 -1.27688,-0.64375 c 0,0 -1.37219,0.3725 -2.22719,0.67656 -0.88563,0.31438 -2.22812,0.91625 -2.22812,0.91625 l -0.31876,0.55719 0.39907,2.14469 0.715,0.63625 4.77313,-1.43156 0.48,-0.95938 z\;;13=element\=polygon\;level\=3\;points\=745.034,377.307 744.514,376.793 728.465,382.681 729.687,389.486 730.931,390.882 745.383,386.309 746.283,384.812 \;;14=element\=path\;level\=3\;d\=m -287.56801,124.87505 0.31656,-1.89625 1.27657,-0.64375 c 0,0 1.37219,0.3725 2.22719,0.67656 0.88531,0.31438 2.22812,0.91625 2.22812,0.91625 l 0.31875,0.55719 -0.39875,2.14469 -0.71531,0.63625 -4.77314,-1.43156 -0.48,-0.95938 z\;;15=element\=polygon\;level\=3\;points\=855.689,376.793 871.744,382.681 870.519,389.486 869.274,390.882 854.827,386.309 853.921,384.812 855.175,377.307 \;;16=element\=path\;level\=3\;d\=m -303.98539,93.476096 c 0,0.0054 0.002,0.01159 0.003,0.01706 0,-0.0057 -0.002,-0.0114 -0.003,-0.01706 z\;;17=element\=path\;level\=3\;d\=m -313.13212,95.999456 c 0.74862,0 1.38898,0.448625 1.66915,1.092956 -1.1386,0.368245 -2.30755,0.631645 -3.48558,0.824757 -0.002,-0.03208 -0.006,-0.06358 -0.006,-0.09612 0,-1.009417 0.81265,-1.821595 1.82211,-1.821595 z\;;18=element\=path\;level\=3\;d\=m -288.39461,95.999456 c 1.00946,0 1.82211,0.812178 1.82211,1.821595 0,0.03253 -0.004,0.06404 -0.006,0.09612 -1.17803,-0.193112 -2.34698,-0.456512 -3.48558,-0.824757 0.28017,-0.644331 0.92053,-1.092956 1.66915,-1.092956 z\;;19=element\=path\;level\=3\;d\=m -320.92389,96.706907 c 0.98681,0 1.79846,0.714766 1.95492,1.655712 -1.34901,0.0974 -2.6717,0.16433 -3.93517,0.248047 0.0426,-1.060987 0.90819,-1.903759 1.98025,-1.903759 z\;;20=element\=path\;level\=3\;d\=m -280.60284,96.706907 c 1.07205,0 1.93766,0.842772 1.98024,1.903759 -1.26347,-0.08372 -2.58615,-0.150644 -3.93516,-0.248047 0.15646,-0.940946 0.96811,-1.655712 1.95492,-1.655712 z\;;21=element\=path\;level\=3\;d\=m -328.75288,98.339365 c 0.67708,0 1.28096,0.289554 1.70688,0.747241 -1.10228,0.220641 -2.09819,0.533644 -2.94246,1.006654 -0.39998,0.22407 -0.76291,0.4619 -1.09761,0.70952 -0.002,-0.0415 -0.005,-0.083 -0.005,-0.12506 0,-1.293667 1.04421,-2.338355 2.33784,-2.338355 z\;;22=element\=path\;level\=3\;d\=m -272.77386,98.339365 c 1.29363,0 2.33784,1.044688 2.33784,2.338355 0,0.042 -0.003,0.0836 -0.005,0.12506 -0.3347,-0.24762 -0.69763,-0.48545 -1.09761,-0.70952 -0.84427,-0.47301 -1.84018,-0.786013 -2.94245,-1.006654 0.42592,-0.457687 1.0298,-0.747241 1.70687,-0.747241 z\;;23=element\=path\;level\=3\;d\=m -333.39238,103.48737 c -0.71626,1.45191 -0.86389,3.06767 -0.64234,4.72219 -0.93669,-0.34064 -1.60507,-1.23413 -1.60507,-2.2903 0,-1.28625 0.98794,-2.33305 2.24741,-2.43189 z\;;24=element\=path\;level\=3\;d\=m -268.13435,103.48737 c 1.25946,0.0988 2.24741,1.14564 2.24741,2.43189 0,1.05617 -0.66838,1.94966 -1.60507,2.2903 0.22155,-1.65452 0.0739,-3.27028 -0.64234,-4.72219 z\;;25=element\=path\;level\=3\;d\=m -333.03788,111.85327 c 0.46185,1.16744 1.03459,2.30511 1.64382,3.3724 -0.19228,0.0661 -0.3976,0.10387 -0.61288,0.10387 -1.04893,0 -1.89342,-0.84359 -1.89342,-1.89239 0,-0.66688 0.34411,-1.24684 0.86248,-1.58388 z\;;26=element\=path\;level\=3\;d\=m -268.48885,111.85327 c 0.51836,0.33704 0.86248,0.917 0.86248,1.58388 0,1.0488 -0.8445,1.89239 -1.89343,1.89239 -0.21528,0 -0.4206,-0.0378 -0.61288,-0.10387 0.60923,-1.06729 1.18198,-2.20496 1.64383,-3.3724 z\;;27=element\=path\;level\=3\;d\=m -303.27174,120.26619 -1.28106,1.19269 v 0.0574 2.12132 l 1.28416,1.11001 h 0.078 a 0.2884496,0.2884496 0 0 0 0.22634,0 h 4.69429 a 0.28830958,0.28830958 0 0 0 0.25476,0 h 0.093 l 1.28519,-1.11156 v -2.17713 l -1.28106,-1.19269 z m 0.10439,0.26459 h 5.14387 l 1.12086,1.04334 0.001,1.74977 a 0.28841967,0.28841967 0 0 0 -0.0997,-0.0687 l -0.99946,-0.4098 v -1.77302 a 0.28830958,0.28830958 0 1 0 -0.57619,0 v 1.84589 l -0.1633,0.16174 -3.73724,-0.0264 -0.16175,-0.16174 v -1.84744 a 0.28830958,0.28830958 0 0 0 -0.29249,-0.29197 0.28830958,0.28830958 0 0 0 -0.28422,0.29197 v 1.79783 l -0.98495,0.37879 a 0.28838938,0.28838938 0 0 0 -0.0873,0.0532 v -1.70016 z m 0.18965,2.83755 0.0444,0.0444 -0.39895,0.93018 -0.67076,-0.58033 a 0.28838938,0.28838938 0 0 0 0.009,-0.003 z m 4.75578,0.009 1.00201,0.41134 a 0.28841967,0.28841967 0 0 0 0.001,0 l -0.66405,0.57465 -0.39739,-0.92811 z m -4.17701,0.25321 3.58583,0.0253 0.35399,0.82683 h -4.30517 z\;;28=element\=path\;level\=3\;d\=m -321.32699,127.31953 c -0.15375,-0.8725 -0.75032,-1.49656 -1.33157,-1.39437 -0.5825,0.10219 -1.24937,0.89312 -1.09656,1.76562 0.155,0.87219 1.08782,1.50719 1.66906,1.405 0.58219,-0.10187 0.91313,-0.90406 0.75907,-1.77625 z\;;29=element\=path\;level\=3\;d\=m -324.86235,125.15815 c 0,-3.5147 10.41124,-7.90845 24.25065,-7.90845 13.83969,0 24.25094,4.39375 24.25094,7.90845 0,0.97375 -1.08344,1.07125 -1.18125,0.77157 -1.16313,-3.56344 -9.23002,-6.70343 -23.06971,-6.70343 -13.83938,0 -21.90626,3.13999 -23.06971,6.70343 -0.0978,0.29968 -1.18094,0.20218 -1.18094,-0.77157 z\;;30=element\=path\;level\=3\;d\=m -300.64769,94.723926 c -3.33155,-0.756875 -3.76343,-2.820326 -3.67093,-2.797201 0.21844,0.05375 0.98781,1.55875 3.72218,2.319377 2.735,-0.760624 3.50282,-2.265627 3.72282,-2.319377 0.0922,-0.02313 -0.33969,2.040313 -3.67093,2.797201 h -0.10313 z\;;31=element\=path\;level\=3\;d\=m -279.33515,127.76524 c 0.15375,-0.8725 0.75031,-1.49656 1.33156,-1.39438 0.5825,0.10219 1.24938,0.89313 1.09657,1.76563 -0.155,0.87219 -1.08782,1.50719 -1.66907,1.405 -0.58218,-0.10188 -0.91312,-0.90406 -0.75906,-1.77625 z\;;32=element\=path\;level\=3\;d\=m -297.38987,93.536741 h -0.22094 c -0.59344,0.550312 -1.52625,1.108437 -2.98532,1.431562 -1.46031,-0.323125 -2.39188,-0.88125 -2.985,-1.431562 h -0.20875 c 0,0 -2.24376,1.590939 -3.8172,0.397811 -0.58125,-0.439687 -0.70406,-1.046249 -0.70406,-1.046249 0,0 2.69282,-0.146876 2.69282,-2.536875 0,-2.383126 1.29344,-3.387196 3.03374,-3.387196 0.76031,0 1.45219,0.375627 1.98844,0.8625 0.535,-0.486876 1.22844,-0.8625 1.98875,-0.8625 1.74031,0 3.03345,1.004062 3.03345,3.387196 0,2.390002 2.69187,2.536875 2.69187,2.536875 0,0 -0.12312,0.606562 -0.70313,1.046249 -1.57468,1.193126 -3.80468,-0.397811 -3.80468,-0.397811 z\;;33=element\=path\;level\=3\;d\=m -297.39193,93.850751 c 0,0 0.12195,0.08228 0.30592,0.188619 0.39661,0.685387 1.11194,2.03001 1.53118,3.487642 0.0118,0.04588 0.0265,0.09095 0.0398,0.136424 0.20837,0.7635 0.32917,1.545254 0.26561,2.263429 -0.17,1.934685 -1.45772,3.414455 -1.82366,5.321635 -0.11991,0.62537 -0.16579,1.32745 -0.17105,2.02262 -0.22666,-0.36362 -0.45971,-0.6987 -0.69401,-1.00046 -0.023,-0.50825 -0.027,-1.01321 -0.005,-1.50998 0.0231,-0.52313 0.21014,-1.33388 0.43201,-2.14044 0.21969,-0.80656 0.4745,-1.60542 0.63201,-2.10323 0.47031,-1.485001 0.0955,-3.244903 -0.39481,-4.630208 -0.32071,-0.90559 -0.58417,-1.333736 -0.76481,-1.680517 0.16177,-0.117242 0.30948,-0.236572 0.4377,-0.355534 z\;;34=element\=path\;level\=3\;d\=m -304.93875,95.153407 c -0.40685,0.482 -0.82488,0.92818 -1.25468,1.33365 -0.34963,0.32986 -0.70604,0.63571 -1.06834,0.91976 0.37649,0.22545 0.80294,0.39091 1.22499,0.5089 0.0213,-0.0238 0.0422,-0.0484 0.0635,-0.0723 0.10433,-0.38817 0.22821,-0.77441 0.37011,-1.17042 0.31584,-0.88146 0.50102,-1.22777 0.66445,-1.51962 z\;;35=element\=path\;level\=3\;d\=m -306.05675,98.181537 c -6.16101,6.883433 -17.41247,3.370053 -19.66784,7.442463 -1.21006,2.18403 0.24051,4.62392 2.47505,6.90425 0.95921,0.2097 2.2633,0.67693 3.57871,1.72025 0.0836,-3.48113 1.11749,-5.13397 1.1175,-5.13397 0,0 2.65763,0.12593 5.37652,2.79263 0.5179,-3.60065 2.4858,-5.55494 2.4858,-5.55494 0,0 3.26519,1.00972 5.13183,4.4108 0.33101,-1.31144 0.82713,-2.40296 1.37497,-3.3081 -0.0181,-0.74153 -0.0764,-1.49886 -0.21654,-2.16648 -0.38849,-1.84891 -1.9532,-3.97258 -1.88277,-5.527143 0.025,-0.55384 0.10756,-1.07117 0.22677,-1.57976 z\;;36=element\=path\;level\=3\;d\=m -328.91631,117.61117 c -3.51964,-4.83276 -7.96277,-12.9515 -0.55644,-17.04786 5.21572,-2.885773 15.82296,0.16151 22.98651,-5.638833 0.70723,0.0626 1.4005,-0.12957 1.91299,-0.45533 -7.64734,9.386973 -18.77013,4.52785 -23.60694,8.426403 -3.97682,3.20615 -0.98608,8.61955 2.47863,12.73562 -0.073,0.77465 -0.0431,1.62183 0.19759,2.47172 -0.85701,-0.4431 -2.1125,-0.65435 -3.41234,-0.49172\;;37=element\=path\;level\=3\;d\=m -309.67779,99.064337 c 0.43525,0.3105 1.007,0.51556 1.51902,0.64055 -0.17336,0.1198 -0.34919,0.23348 -0.52688,0.343503 -0.52253,-0.163503 -1.05775,-0.406773 -1.46638,-0.754543 0.15849,-0.0737 0.31668,-0.15035 0.47424,-0.22951 z\;;38=element\=path\;level\=3\;d\=m -312.94322,100.30373 c 0.46929,0.44832 1.06396,0.78051 1.69918,0.99383 -0.22536,0.085 -0.45259,0.16472 -0.68072,0.2402 -0.5857,-0.26434 -1.12186,-0.62985 -1.54657,-1.09559 0.17645,-0.0437 0.35228,-0.0898 0.52811,-0.13844 z\;;39=element\=path\;level\=3\;d\=m -316.18638,100.95525 c 0.35197,0.5342 0.83335,0.98466 1.40726,1.32082 -0.2235,0.044 -0.447,0.0862 -0.66989,0.12561 -0.51294,-0.3759 -0.94045,-0.84286 -1.2562,-1.37859 0.17243,-0.0214 0.34547,-0.0437 0.51883,-0.0678 z\;;40=element\=path\;level\=3\;d\=m -319.81561,101.31128 c 0.19349,0.54123 0.58291,1.01828 1.09647,1.4009 0.0572,0.0422 0.0864,0.095 0.0953,0.14821 l -0.58013,0.0721 c -0.52377,-0.43884 -0.91505,-0.97854 -1.10234,-1.58577 l 0.49065,-0.0354 z\;;41=element\=path\;level\=3\;d\=m -323.53631,101.63187 c 0.12879,0.72825 0.51914,1.34374 1.12465,1.78596 -0.2006,0.0416 -0.39563,0.0859 -0.58507,0.13324 -0.53678,-0.49172 -0.88658,-1.12646 -1.01227,-1.85288 0.15509,-0.0235 0.31266,-0.0455 0.47269,-0.0663 z\;;42=element\=path\;level\=3\;d\=m -325.62441,104.81469 c -0.77699,-0.44709 -1.41779,-1.15304 -1.81217,-1.95189 0.14425,-0.10146 0.29532,-0.19559 0.45444,-0.28238 0.2882,0.60387 0.82993,1.41862 1.77657,1.88527 -0.15169,0.10757 -0.2913,0.22371 -0.41884,0.349 z\;;43=element\=path\;level\=3\;d\=m -326.57109,107.17134 c -1.08687,-0.10268 -2.14155,-0.66407 -2.88048,-1.46323 0.0524,-0.21393 0.12104,-0.4251 0.20586,-0.63169 0.42533,0.52503 1.34722,1.43298 2.71855,1.55095 -0.0288,0.18031 -0.043,0.36153 -0.044,0.54397 z\;;44=element\=path\;level\=3\;d\=m -327.37756,109.66177 c 0.59498,-0.0923 0.83551,-0.15158 1.30666,-0.4141 0.0817,0.17756 0.17243,0.35542 0.27148,0.53328 -0.39748,0.22798 -0.7222,0.36459 -1.2726,0.47583 -0.5535,0.11276 -1.12773,0.0795 -1.63695,-0.004 -0.10897,-0.23042 -0.2102,-0.46084 -0.30151,-0.69097 0.49715,0.0947 1.1398,0.17664 1.63292,0.10024 z\;;45=element\=path\;level\=3\;d\=m -325.9038,112.64846 c 0.6832,-0.19467 1.03177,-0.56842 1.41191,-1.00483 0.15478,0.18489 0.31513,0.36887 0.48105,0.55223 -0.26157,0.34228 -0.56061,0.67813 -1.00917,0.91039 -0.54235,0.28085 -1.1364,0.35237 -1.69268,0.35237 -0.18635,-0.24662 -0.36776,-0.49661 -0.54359,-0.74812 0.45135,0.0446 0.95778,0.0508 1.35248,-0.062 z\;;46=element\=path\;level\=3\;d\=m -304.93875,95.153407 c -0.40685,0.482 -0.82488,0.92818 -1.25468,1.33365 -0.34963,0.32986 -0.70604,0.63571 -1.06834,0.91976 0.37649,0.22545 0.80294,0.39091 1.22499,0.5089 0.0213,-0.0238 0.0422,-0.0484 0.0635,-0.0723 0.10433,-0.38817 0.22821,-0.77441 0.37011,-1.17042 0.31584,-0.88146 0.50102,-1.22777 0.66445,-1.51962 z\;;47=element\=path\;level\=3\;d\=m -306.05675,98.181537 c -6.16101,6.883433 -17.41247,3.370053 -19.66784,7.442463 -1.21006,2.18403 0.24051,4.62392 2.47505,6.90425 0.95921,0.2097 2.2633,0.67693 3.57871,1.72025 0.0836,-3.48113 1.11749,-5.13397 1.1175,-5.13397 0,0 2.65763,0.12593 5.37652,2.79263 0.5179,-3.60065 2.4858,-5.55494 2.4858,-5.55494 0,0 3.26519,1.00972 5.13183,4.4108 0.33101,-1.31144 0.82713,-2.40296 1.37497,-3.3081 -0.0181,-0.74153 -0.0764,-1.49886 -0.21654,-2.16648 -0.38849,-1.84891 -1.9532,-3.97258 -1.88277,-5.527143 0.025,-0.55384 0.10756,-1.07117 0.22677,-1.57976 z\;;48=element\=path\;level\=3\;d\=m -309.67779,99.064337 c 0.43525,0.3105 1.007,0.51556 1.51902,0.64055 -0.17336,0.1198 -0.34919,0.23348 -0.52688,0.343503 -0.52253,-0.163503 -1.05775,-0.406773 -1.46638,-0.754543 0.15849,-0.0737 0.31668,-0.15035 0.47424,-0.22951 z\;;49=element\=path\;level\=3\;d\=m -312.94322,100.30373 c 0.46929,0.44832 1.06396,0.78051 1.69918,0.99383 -0.22536,0.085 -0.45259,0.16472 -0.68072,0.2402 -0.5857,-0.26434 -1.12186,-0.62985 -1.54657,-1.09559 0.17645,-0.0437 0.35228,-0.0898 0.52811,-0.13844 z\;;50=element\=path\;level\=3\;d\=m -316.18638,100.95525 c 0.35197,0.5342 0.83335,0.98466 1.40726,1.32082 -0.2235,0.044 -0.447,0.0862 -0.66989,0.12561 -0.51294,-0.3759 -0.94045,-0.84286 -1.2562,-1.37859 0.17243,-0.0214 0.34547,-0.0437 0.51883,-0.0678 z\;;51=element\=path\;level\=3\;d\=m -319.81561,101.31128 c 0.19349,0.54123 0.58291,1.01828 1.09647,1.4009 0.0572,0.0422 0.0864,0.095 0.0953,0.14821 l -0.58013,0.0721 c -0.52377,-0.43884 -0.91505,-0.97854 -1.10234,-1.58577 l 0.49065,-0.0354 z\;;52=element\=path\;level\=3\;d\=m -323.53631,101.63187 c 0.12879,0.72825 0.51914,1.34374 1.12465,1.78596 -0.2006,0.0416 -0.39563,0.0859 -0.58507,0.13324 -0.53678,-0.49172 -0.88658,-1.12646 -1.01227,-1.85288 0.15509,-0.0235 0.31266,-0.0455 0.47269,-0.0663 z\;;53=element\=path\;level\=3\;d\=m -325.62441,104.81469 c -0.77699,-0.44709 -1.41779,-1.15304 -1.81217,-1.95189 0.14425,-0.10146 0.29532,-0.19559 0.45444,-0.28238 0.2882,0.60387 0.82993,1.41862 1.77657,1.88527 -0.15169,0.10757 -0.2913,0.22371 -0.41884,0.349 z\;;54=element\=path\;level\=3\;d\=m -326.57109,107.17134 c -1.08687,-0.10268 -2.14155,-0.66407 -2.88048,-1.46323 0.0524,-0.21393 0.12104,-0.4251 0.20586,-0.63169 0.42533,0.52503 1.34722,1.43298 2.71855,1.55095 -0.0288,0.18031 -0.043,0.36153 -0.044,0.54397 z\;;55=element\=path\;level\=3\;d\=m -327.37756,109.66177 c 0.59498,-0.0923 0.83551,-0.15158 1.30666,-0.4141 0.0817,0.17756 0.17243,0.35542 0.27148,0.53328 -0.39748,0.22798 -0.7222,0.36459 -1.2726,0.47583 -0.5535,0.11276 -1.12773,0.0795 -1.63695,-0.004 -0.10897,-0.23042 -0.2102,-0.46084 -0.30151,-0.69097 0.49715,0.0947 1.1398,0.17664 1.63292,0.10024 z\;;56=element\=path\;level\=3\;d\=m -325.9038,112.64846 c 0.6832,-0.19467 1.03177,-0.56842 1.41191,-1.00483 0.15478,0.18489 0.31513,0.36887 0.48105,0.55223 -0.26157,0.34228 -0.56061,0.67813 -1.00917,0.91039 -0.54235,0.28085 -1.1364,0.35237 -1.69268,0.35237 -0.18635,-0.24662 -0.36776,-0.49661 -0.54359,-0.74812 0.45135,0.0446 0.95778,0.0508 1.35248,-0.062 z\;; korc="Polygon1=#00005B;Polygon6=#E6AD02;Polygon33=#FF8000;Polygon7=#FF8000;Polygon2=Yellow;Polygon40=Purple;Polygon51=#BD0000;Polygon59=Black;Polygon60=Black;Polygon58=Black;Polygon57=Black;Polygon4=#AA5500;Polygon56=Black;Polygon55=Black;Polygon54=Black;Polygon53=Black;Polygon52=Black;Polygon50=#FF8000;Polygon3=Maroon;Polygon37=Red;Polygon36=#8000FF;Polygon5=#FF8040;Polygon25=Red;Polygon23=#8000FF;Polygon21=Red;Polygon19=Purple;Polygon17=#FF0080;Polygon32=Red;Polygon35=Red;Polygon15=Red;Polygon14=Red;Polygon28=Red;Polygon27=Maroon;Polygon31=Red;Polygon18=Red;Polygon20=Red;Polygon22=Red;Polygon24=Red;Polygon26=Red;Polygon12=Maroon;Polygon11=Maroon;Polygon13=Maroon;Polygon10=Maroon;Polygon9=Maroon;Polygon8=Maroon;Polygon34=Maroon korm="1=1\=0\;2\=0\;3\=100\;4\=1\;;2=1\=0\;2\=0\;3\=100\;4\=2\;;3=1\=0\;2\=0\;3\=100\;4\=3\;;4=1\=0\;2\=0\;3\=100\;4\=4\;;5=1\=0\;2\=0\;3\=100\;4\=5\;;6=1\=0\;2\=0\;3\=100\;4\=6\;;7=1\=0\;2\=0\;3\=100\;4\=7\;;8=1\=0\;2\=0\;3\=100\;4\=8\;;9=1\=0\;2\=0\;3\=100\;4\=9\;;10=1\=0\;2\=0\;3\=100\;4\=10\;;11=1\=0\;2\=0\;3\=100\;4\=11\;;12=1\=0\;2\=0\;3\=100\;4\=12\;;13=1\=0\;2\=0\;3\=100\;4\=13\;;14=1\=0\;2\=0\;3\=100\;4\=14\;;15=1\=0\;2\=0\;3\=100\;4\=15\;;16=1\=0\;2\=0\;3\=100\;4\=16\;;17=1\=0\;2\=0\;3\=100\;4\=17\;;18=1\=0\;2\=0\;3\=100\;4\=18\;;19=1\=0\;2\=0\;3\=100\;4\=19\;;20=1\=0\;2\=0\;3\=100\;4\=20\;;21=1\=0\;2\=0\;3\=100\;4\=21\;;22=1\=0\;2\=0\;3\=100\;4\=22\;;23=1\=0\;2\=0\;3\=100\;4\=23\;;24=1\=0\;2\=0\;3\=100\;4\=24\;;25=1\=0\;2\=0\;3\=100\;4\=25\;;26=1\=0\;2\=0\;3\=100\;4\=26\;;27=1\=0\;2\=0\;3\=100\;4\=27\;;28=1\=6\;2\=-6\;3\=100\;4\=28\;;29=1\=0\;2\=0\;3\=100\;4\=29\;;30=1\=0\;2\=0\;3\=100\;4\=30\;;31=1\=6\;2\=-10\;3\=100\;4\=31\;;32=1\=0\;2\=0\;3\=100\;4\=32\;;33=1\=0\;2\=0\;3\=100\;4\=33\;;34=1\=0\;2\=0\;3\=100\;4\=34\;;35=1\=0\;2\=0\;3\=100\;4\=35\;;36=1\=0\;2\=0\;3\=100\;4\=36\;;37=1\=0\;2\=0\;3\=100\;4\=37\;;38=1\=0\;2\=0\;3\=100\;4\=38\;;39=1\=0\;2\=0\;3\=100\;4\=39\;;40=1\=0\;2\=0\;3\=100\;4\=40\;;41=1\=0\;2\=0\;3\=100\;4\=41\;;42=1\=0\;2\=0\;3\=100\;4\=42\;;43=1\=0\;2\=0\;3\=100\;4\=43\;;44=1\=0\;2\=0\;3\=100\;4\=44\;;45=1\=0\;2\=0\;3\=100\;4\=45\;;46=1\=0\;2\=0\;3\=100\;4\=46\;;47=1\=0\;2\=0\;3\=100\;4\=47\;;48=1\=0\;2\=0\;3\=100\;4\=48\;;49=1\=0\;2\=0\;3\=100\;4\=49\;;50=1\=0\;2\=0\;3\=100\;4\=50\;;51=1\=0\;2\=0\;3\=100\;4\=51\;;52=1\=0\;2\=0\;3\=100\;4\=52\;;53=1\=0\;2\=0\;3\=100\;4\=53\;;54=1\=0\;2\=0\;3\=100\;4\=54\;;55=1\=0\;2\=0\;3\=100\;4\=55\;;56=1\=0\;2\=0\;3\=100\;4\=56\;;57=1\=0\;2\=0\;3\=100\;4\=57\;;58=1\=0\;2\=0\;3\=100\;4\=58\;;59=1\=0\;2\=0\;3\=100\;4\=59\;;60=1\=0\;2\=0\;3\=100\;4\=60\;; EndSub End>GFZ321.sb< Start>GFZ423.sb< GraphicsWindow.BrushColor = "Blue" GraphicsWindow.PenColor = "Blue" GraphicsWindow.FillRectangle(1,5,600,55) GraphicsWindow.FillRectangle(1,248,600,55) GraphicsWindow.BrushColor = "Red" GraphicsWindow.PenColor = "Red" GraphicsWindow.FillRectangle(1,75,600,158) GraphicsWindow.BrushColor = "White" GraphicsWindow.PenColor = "White" GraphicsWindow.FillEllipse(89,93,135,135) GraphicsWindow.BrushColor = "Red" GraphicsWindow.PenColor = "Red" T1 = Shapes.AddTriangle(58,1,20,105,75,65) T2 = Shapes.AddTriangle(58,1,20,105,75,65) T3 = Shapes.AddTriangle(58,1,20,105,75,65) Shapes.Rotate(T2,70) Shapes.Rotate(T3,140) Shapes.Move(T1,100,100) Shapes.Move(T2,115,87) Shapes.Move(T3,138,98) End>GFZ423.sb< Start>GFZ850.sb< TTA = 5 BTA = 15 HTA = 10 ATA = HTA * (TTA + BTA) / 2 BTB = 14 HTB = 8 ATB = BTB * HTB CTA = ATA * 0.20 CTB = ATB * 0.10 MCJTA = CTA * 2500 MCFTA = CTA * 2500 + (2500 / 2) MCJTB = CTB * 3500 MCFTB = CTB * 3500 + (3500 / 2) TMC = MCJTA + MCJTB + MCFTA + MCFTB TextWindow.WriteLine("January Labour cost T-A: $" + MCJTA + 0.00) TextWindow.WriteLine("January Labour cost T-B: $" + MCJTB + 0.00) TextWindow.WriteLine("February Labour cost T-A: $" + MCFTA + 0.00) TextWindow.WriteLine("February Labour cost T-B: $" + MCFTB + 0.00) TextWindow.WriteLine("Cumulative Monthly Labour cost: $" + TMC + 0.00) End>GFZ850.sb< Start>GGD031.sb< ' Challenge of the Month - May 2012 Prime Number by NaochanON ask="False" While ask="False" TextWindow.Clear() textWindow.WriteLine("Input max prime number counts ... <1000 ") TextWindow.WriteLine(" ") textWindow.WriteLine(" counts ... >500 takes time terribly ") TextWindow.WriteLine(" ") textWindow.WriteLine(" counts ... <500 would be better ") TextWindow.WriteLine(" ") MaxNN=TextWindow.Read() If 0GGD031.sb< Start>GGD758.sb< GraphicsWindow.BackgroundColor ="teal GraphicsWindow.BrushColor="gold GraphicsWindow.Width=900 GraphicsWindow.Height=900 GraphicsWindow.Left=5 GraphicsWindow.Top=5 GraphicsWindow.Title="Steel Ropes view3D = LD3DView.AddView(900 900,"true") 'Will not clip to size if window rescaled LD3DView.AddDirectionalLight (view3D,"white",-1 ,-1 ,-1) LD3DView.AddDirectionalLight(view3D,"white",1,1,1) LD3DView.AddAmbientLight(view3D,"#55888888") r35=700 ya=370 aa=45 px= LDMath.Cos(aa) py= LDMath.sin (aa) LD3DView.ResetCamera(view3D, px*r35,ya,py*r35, -px, -.5, -py, "","","") LD3DView.AutoControl ("true" "true", -1 3) r30=16 r15=17 r300=45 args=0 dd=":" For w=0 To 5 For x=0 To 5 ww="" For z=0 To 2980 Step 4 GraphicsWindow.BrushColor= LDColours.HSLtoRGB(30+(w-3)*20 w/200 .2+math.Abs(LDcall.Function2( "fSin" z/16 w))/2+x/20) cy=LDMath.Sin(x*60+z)*r30+LDMath.Sin(w*60)*r300 cx=LDMath.cos(x*60+z)*r30+LDMath.cos(w*60)*r300 ww=ww+cx+dd+cy+dd+z/4+dd EndFor LD3DView.AddTube (view3D ww 12 12 GraphicsWindow.BrushColor "D") EndFor EndFor For aa=45 To 360+45 Step 1 px= LDMath.Cos(aa) py= LDMath.sin (aa) LD3DView.ResetCamera(view3D, px*r35,ya,py*r35, -px, -.5, -py, "","","") Program.Delay (10) EndFor Sub fsin If Math.Remainder (args[2] 2)=0 Then return=ldmath.Sin (args[1]) Else return=ldmath.cos (args[1]) EndIf EndSub End>GGD758.sb< Start>GGF374.sb< GraphicsWindow.Width =1000 GraphicsWindow.Height = 420 graphicswindow.BackgroundColor = GraphicsWindow.GetColorfromRGB(100, 50, 50) GraphicsWindow.BrushColor = "green" GraphicsWindow.FillEllipse(232,140,77,120) GraphicsWindow.filltriangle(240,160,270,100,300,160) GraphicsWindow.Filltriangle(240,240,300,240,270,310) GraphicsWindow.PenColor = "saddlebrown" GraphicsWindow.PenWidth = 2 GraphicsWindow.DrawLine(270,300,270,350) End>GGF374.sb< Start>GGG213.sb< GraphicsWindow.Width = 800 GraphicsWindow.height = 500 GraphicsWindow.backgroundcolor = "black 'Sub pngsave 'MX= GraphicsWindow.MouseX 'MY= GraphicsWindow.MouseY 'GraphicsWindow.brushcolor=GraphicsWindow.GetRandomColor() ' "rosybrown" 'endsub '--------------------------------------------------Rectangle/1------------------------------------------------ GraphicsWindow.penwidth = 0 GraphicsWindow.brushcolor= "teal 'GraphicsWindow.brushcolor=GraphicsWindow.GetRandomColor() haroon = shapes.addRectangle(205, 230) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 297, 153, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '--------------------------------------------------Rectangle/2------------------------------------------------ GraphicsWindow.brushcolor= "cyan haroon = shapes.addRectangle(200, 40) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 300, 150, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addRectangle(40, 70) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 379, 210, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '--------------------------------------------------Rectangle/2------------------------------------------------ haroon = shapes.addRectangle(107, 40) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 345, 342, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) GraphicsWindow.brushcolor= "MediumTurquoise haroon = shapes.addRectangle(107, 7) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 345, 340, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '-------------------------------------------------Triangles/4------------------------------------------------ GraphicsWindow.brushcolor= "cyan haroon = shapes.addTriangle(80, 80, 90, 150, 100,80) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 253, 138.5, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addTriangle(80, 85, 60, 155, 102,80) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 273, 138, 2000) Shapes.Rotate(haroon, -8) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addTriangle(80, 85, 118, 165, 102, 90) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 345, 122, 2000) Shapes.Rotate(haroon, 8) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addTriangle(80, 80, 86, 157, 100,80) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 366, 138, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '--------------------------------------------------------Rectangle/1------------------------------------------------ GraphicsWindow.brushcolor= "black haroon = shapes.addRectangle(43, 18) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 377, 280, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '--------------------------------------------------------Triangles/2------------------------------------------------ GraphicsWindow.brushcolor= "black haroon = shapes.addTriangle(15, 150, 55, 150, 55, 133) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 325, 148, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addTriangle(55, 150, 15, 150, 15, 133) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 405, 148, 2000) 'Shapes.Rotate(haroon, 200) 'Shapes.Zoom(haroon, 0, 0) '--------------------------------------------------------Rectangle/1------------------------------------------------ GraphicsWindow.brushcolor= "black haroon = shapes.addRectangle(43, 7) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 370, 332, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '--------------------------------------------------------Triangle/2------------------------------------------------ haroon = shapes.addTriangle(15, 151, 45, 151, 45, 143) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 325, 189, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addTriangle(45, 151, 6, 151, 6, 143) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 407, 189, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '--------------------------------------------------------Rectangles/5------------------------------------------------ GraphicsWindow.penwidth = 0 GraphicsWindow.brushcolor= "yellow haroon = shapes.addrectangle(11, 5) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 390, 343, 2000) Shapes.Rotate(haroon, 100) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addrectangle(11, 5) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 393, 343, 2000) Shapes.Rotate(haroon, 70) 'Shapes.Zoom(haroon, 0, 0) GraphicsWindow.brushcolor= "blue haroon = shapes.addrectangle(11, 5) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 385, 343, 2000) Shapes.Rotate(haroon, 115) 'Shapes.Zoom(haroon, 0, 0) GraphicsWindow.brushcolor= "red haroon = shapes.addrectangle(11, 5) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 398, 343, 2000) Shapes.Rotate(haroon, -115) 'Shapes.Zoom(haroon, 0, 0) GraphicsWindow.brushcolor= "blue haroon = shapes.addrectangle(40, 15) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 377, 383, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '--------------------------------------------------------Rectangles/1------------------------------------------------ GraphicsWindow.brushcolor= "yellow haroon = shapes.addrectangle(8, 18) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 393, 347, 2000) Shapes.Rotate(haroon, 90) 'Shapes.Zoom(haroon, 0, 0) '---------------------------------------------------------Triangles/2--------------------------------------------------- GraphicsWindow.brushcolor= "yellow haroon = shapes.addTriangle(5, 11, 8, 20, 15,11) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 378, 341, 2000) Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addTriangle(5, 11, 8, 20, 15,11) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 395, 341, 2000) Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '--------------------------------------------------------Rectangles/1------------------------------------------------ GraphicsWindow.brushcolor= "red haroon = shapes.addrectangle(8, 14) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 392, 356, 2000) Shapes.Rotate(haroon, 90) 'Shapes.Zoom(haroon, 0, 0) '------------------------------------------------------------Triangles/2--------------------------------------------------- GraphicsWindow.brushcolor= "red haroon = shapes.addTriangle(5, 11, 8, 20, 15,11) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 380, 347.5, 2000) Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addTriangle(5, 11, 8, 20, 15,11) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 393, 347.5, 2000) Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '--------------------------------------------------------Rectangles/2------------------------------------------------ GraphicsWindow.brushcolor= "yellow haroon = shapes.addrectangle(9, 10) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 391, 367, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) GraphicsWindow.brushcolor= "Gray haroon = shapes.addrectangle(6, 10) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 393, 377, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '--------------------------------------------------------Triangles/2------------------------------------------------ GraphicsWindow.brushcolor= "LightGray haroon = shapes.addTriangle(90, 80, 100, 105, 100,80) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 285, 270.5, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addTriangle(90, 80, 90, 105, 100,80) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 315, 271, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '--------------------------------------------------------Rectangles/2------------------------------------------------ GraphicsWindow.brushcolor= "black haroon = shapes.addrectangle(100, 28) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 246, 330, 2000) Shapes.Rotate(haroon, 70) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addrectangle(100, 28) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 452, 330, 2000) Shapes.Rotate(haroon, -70) 'Shapes.Zoom(haroon, 0, 0) '--------------------------------------------------------Rectangles/2------------------------------------------------ GraphicsWindow.brushcolor= "teal haroon = shapes.addTriangle(15, 18, 15, 55, 43, 55) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 330, 328, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addTriangle(43, 18, 43, 55, 15, 55) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 409, 328, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '--------------------------------------------------------Rectangle/1------------------------------------------------ GraphicsWindow.brushcolor= "black haroon = shapes.addRectangle(43, 7) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 370, 332, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '--------------------------------------------------------Triangle/2------------------------------------------------ haroon = shapes.addTriangle(15, 151, 45, 151, 45, 143) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 325, 189, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addTriangle(45, 151, 6, 151, 6, 143) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 407, 189, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '--------------------------------------------------Rectangle/1------------------------------------------------ GraphicsWindow.brushcolor= "cyan haroon = shapes.addRectangle(110, 20.5) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 343, 298, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '--------------------------------------------------------Triangle/2------------------------------------------------ GraphicsWindow.brushcolor= "teal haroon = shapes.addTriangle(15, 172, 15, 150, 50, 172) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 327.5, 148, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addTriangle(47, 172, 47, 150, 10, 172) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 407, 148, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '-------------------------------------------------------Rectangle/1------------------------------------------------ GraphicsWindow.brushcolor= "cyan haroon = shapes.addRectangle(110, 12) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 343, 320, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '--------------------------------------------------------Triangle/2------------------------------------------------ GraphicsWindow.brushcolor= "teal haroon = shapes.addTriangle(10, 170, 10, 157, 47, 170) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 333, 163, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addTriangle(10, 170, 10, 157, -35, 170) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 443, 163, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '--------------------------------------------------------Triangles/2------------------------------------------------ GraphicsWindow.brushcolor= "CadetBlue haroon = shapes.addTriangle(56, 80, 91, 108, 110, 80) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 243, 110, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addTriangle(50, 80, 66, 108, 110, 80) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 400, 110, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '--------------------------------------------------------Triangles/2------------------------------------------------ GraphicsWindow.brushcolor= "DarkGreen haroon = shapes.addTriangle(142, 109, 107, 103, 107, 80) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 191, 110, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addTriangle(50, 80, 50, 103, 10, 108) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 452, 110, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '-------------------------------------------------Triangles/4------------------------------------------------ GraphicsWindow.brushcolor= "red haroon = shapes.addTriangle(88, 77, 88, 66, 105, 80) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 229, 138, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addTriangle(80, 80, 90, 66, 100, 80) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 255, 137, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addTriangle(80, 80, 93, 66, 100, 80) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 366, 138, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addTriangle(76, 80, 93, 66, 93, 77) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 386, 138, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '--------------------------------------------------------Triangles/2------------------------------------------------ GraphicsWindow.brushcolor= "navy haroon = shapes.addTriangle(77, 80, 92, 93, 103, 80) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 241.5, 124, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addTriangle(77, 80, 90, 91, 103, 80) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 376, 124, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) '-------------------------------------------------------Rectangle/1------------------------------------------------ 'GraphicsWindow.brushcolor= "red 'haroon = shapes.addRectangle(20, 30) 'Shapes.Move(haroon, 0, 0) 'Shapes.Animate(haroon, 600, 150, 2000) 'Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) GraphicsWindow.brushcolor= "firebrick haroon = shapes.addRectangle(25, 25) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 610, 140, 2000) Shapes.Rotate(haroon, 0) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addTriangle(108, 164, 135, 145, 136, 163) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 506, -29, 2000) Shapes.Rotate(haroon, 5) 'Shapes.Zoom(haroon, 0, 0) GraphicsWindow.brushcolor= "red haroon = shapes.addRectangle(20, 140) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 695, 63, 2000) Shapes.Rotate(haroon, 90) 'Shapes.Zoom(haroon, 0, 0) haroon = shapes.addRectangle(20, 140) Shapes.Move(haroon, 0, 0) Shapes.Animate(haroon, 695, 85, 2000) Shapes.Rotate(haroon, 90) 'Shapes.Zoom(haroon, 0, 0) End>GGG213.sb< Start>GGL988.sb< 'Set up the GraphicsWindow and load images GraphicsWindow.BackgroundColor = "Seashell" dir = "http://litdev.co.uk/game_images" 'dir = Program.Directory buttonPngOff = dir+"/PushMeOff.png" buttonPngOn = dir+"/PushMeOn.png" buttonPngOverOff = dir+"/PushMeOverOff.png" buttonPngOverOn = dir+"/PushMeOverOn.png" buttonImgOff = ImageList.LoadImage(buttonPngOff) buttonImgOn = ImageList.LoadImage(buttonPngOn) buttonImgOverOff = ImageList.LoadImage(buttonPngOverOff) buttonImgOverOn = ImageList.LoadImage(buttonPngOverOn) numButton = 5 'Button count delay = 1 'Delay for fade in out for mouseover For i = 1 To numButton 'Create the button images, size and position buttonOff[i] = Shapes.AddImage(buttonImgOff) 'Button Off buttonOn[i] = Shapes.AddImage(buttonImgOn) 'Button On buttonOverOff[i] = Shapes.AddImage(buttonImgOverOff) 'Button selected (highlighted) and will revert to Off if we leave it with no action buttonOverOn[i] = Shapes.AddImage(buttonImgOverOn) 'Button selected (highlighted) and will revert to On if we leave it with no action buttonW[i] = ImageList.GetWidthOfImage(buttonImgOff) buttonH[i] = ImageList.GetHeightOfImage(buttonImgOff) buttonX[i] = buttonW[i]/2 buttonY[i] = (10+buttonW[i])*(i-0.5) Shapes.Move(buttonOff[i],buttonX[i],buttonY[i]) Shapes.Move(buttonOn[i],buttonX[i],buttonY[i]) Shapes.Move(buttonOverOff[i],buttonX[i],buttonY[i]) Shapes.Move(buttonOverOn[i],buttonX[i],buttonY[i]) Shapes.SetOpacity(buttonOn[i],0) Shapes.SetOpacity(buttonOverOff[i],0) Shapes.SetOpacity(buttonOverOn[i],0) buttonState[i] = "Off" 'Current button state buttonEntry[i] = "True" 'Flag for first mouse entry to button 'TextBox for writing in GraphicsWindow.BrushColor = "Black" tb[i] = Controls.AddTextBox(buttonX[i]+buttonW[i]+20,buttonY[i]+22) Controls.SetSize(tb[i],200,22) Controls.HideControl(tb[i]) 'Readonly textbox outline GraphicsWindow.PenWidth = 0.5 GraphicsWindow.PenColor = "Gray" GraphicsWindow.BrushColor = "#100000FF" tbOverlay[i] = Shapes.AddRectangle(200,22) Shapes.Move(tbOverlay[i],buttonX[i]+buttonW[i]+20,buttonY[i]+22) 'Readonly textbox text GraphicsWindow.BrushColor = "Black" tbOverlayText[i] = Shapes.AddText("") Controls.SetSize(tbOverlayText[i],200,22) Shapes.Move(tbOverlayText[i],buttonX[i]+buttonW[i]+20+5,buttonY[i]+22+3) EndFor GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseUp = OnMouseUp While ("True") CheckButton() Program.Delay(10) 'TextWindow.WriteLine(buttonState[1]) EndWhile Sub CheckButton noButton = "True" 'Use to check if we are not over any button - so we can reset mouseDown and mouseUp flags posX = GraphicsWindow.MouseX posY = GraphicsWindow.MouseY For i = 1 To numButton 'Check the current state of each button If (buttonEntry[i]) Then buttonEntryState[i] = buttonState[i] 'This is the state that the button will revert to when we leave (unless it is clicked) EndIf dx = posX-buttonX[i]-buttonW[i]/2 dy = posY-buttonY[i]-buttonH[i]/2 'If (posX > buttonX[i] And posX < buttonX[i]+buttonW[i] And posY > buttonY[i] And posY < buttonY[i]+buttonH[i]) Then 'Rectangular button If (Math.SquareRoot(dx*dx+dy*dy) < buttonW[i]/2) Then 'Circular button noButton = "False" 'We are over a button If (buttonState[i] = "Off") Then If (buttonEntry[i]) Then 'First entry to button For j = 1 To 100 Shapes.SetOpacity(buttonOverOff[i],j) Program.Delay(delay) EndFor buttonState[i] = "OverOff" ElseIf (mouseDown) Then 'Repeat click over button Shapes.SetOpacity(buttonOverOn[i],100) buttonState[i] = "OverOn" mouseDown = "False" EndIf ElseIf (buttonState[i] = "On") Then If (buttonEntry[i]) Then 'First entry to button For j = 1 To 100 Shapes.SetOpacity(buttonOverOn[i],j) Program.Delay(delay) EndFor buttonState[i] = "OverOn" ElseIf (mouseDown) Then 'Repeat click over button Shapes.SetOpacity(buttonOverOff[i],100) buttonState[i] = "OverOff" mouseDown = "False" EndIf ElseIf (buttonState[i] = "OverOff") Then If (mouseDown) Then 'Switch to OverOn (pending on) state when button down in OverOff state Shapes.SetOpacity(buttonOverOn[i],100) Shapes.SetOpacity(buttonOverOff[i],0) buttonState[i] = "OverOn" mouseDown = "False" ElseIf (mouseUp) Then 'Change to Off - Think of OverOff as pending off Shapes.SetOpacity(buttonOff[i],100) Shapes.SetOpacity(buttonOn[i],0) Shapes.SetOpacity(buttonOverOff[i],0) buttonState[i] = "Off" buttonEntryState[i] = buttonState[i] 'The state to revert to when we leave button mouseUp = "False" EndIf ElseIf (buttonState[i] = "OverOn") Then If (mouseDown) Then 'Switch to OverOff (pending off) state when button down in OverOn state Shapes.SetOpacity(buttonOverOff[i],100) Shapes.SetOpacity(buttonOverOn[i],0) buttonState[i] = "OverOff" mouseDown = "False" ElseIf (mouseUp) Then 'Change to On - Think of OverOn as pending on Shapes.SetOpacity(buttonOn[i],100) Shapes.SetOpacity(buttonOff[i],0) Shapes.SetOpacity(buttonOverOn[i],0) buttonState[i] = "On" buttonEntryState[i] = buttonState[i] 'The state to revert to when we leave button mouseUp = "False" EndIf EndIf buttonEntry[i] = "False"' We are inside this button - next call will not be entry Else If (buttonState[i] = "OverOff") Then 'We are leaving button and switch to Off For j = 1 To 100 Shapes.SetOpacity(buttonOverOff[i],100-j) Program.Delay(delay) EndFor buttonState[i] = buttonEntryState[i] ElseIf (buttonState[i] = "OverOn") Then 'We are leaving button and switch to On For j = 1 To 100 Shapes.SetOpacity(buttonOverOn[i],100-j) Program.Delay(delay) EndFor buttonState[i] = buttonEntryState[i] EndIf buttonEntry[i] = "True" 'We are outside button - next call over button will be entry EndIf 'Update the read-write textboxes If (buttonState[i] = "On") Then Shapes.HideShape(tbOverlay[i]) Shapes.HideShape(tbOverlayText[i]) Shapes.SetText(tbOverlayText[i],"") Controls.ShowControl(tb[i]) ElseIf (buttonState[i] = "Off") Then Shapes.ShowShape(tbOverlay[i]) Shapes.ShowShape(tbOverlayText[i]) Shapes.SetText(tbOverlayText[i],Controls.GetTextBoxText(tb[i])) Controls.HideControl(tb[i]) EndIf EndFor If (noButton) Then 'Reset mouse flags if we are outside all buttons mouseDown = "False" mouseUp = "False" EndIf EndSub Sub OnMouseDown mouseDown = "True" EndSub Sub OnMouseUp mouseUp = "True" EndSub End>GGL988.sb< Start>GGN415.sb< gameWidth = 640 gameHeight = 480 fps = 50 bgs = 2 Player_Lives = 10 nbrisland = 5 islandcount = 5 gameTitle = "1942, Score: " GraphicsWindow.Hide() GraphicsWindow.Title = gameTitle + "0" GraphicsWindow.CanResize = "False" GraphicsWindow.Width = gameWidth GraphicsWindow.Height = gameHeight 'Presentation ' todo ' Start game Init() define_paths() TimePlay = 0 pathNBR = 1 'create_enemies1() Play() ' Setup world Sub Init GraphicsWindow.Hide() Mouse.HideCursor() ' addImage in the right order is needed to define the shapes depth island4= ImageList.LoadImage(Path + "island4.png") island1= ImageList.LoadImage(Path + "island1.png") island2= ImageList.LoadImage(Path + "island2.png") island3= ImageList.LoadImage(Path + "island3.png") island5= ImageList.LoadImage(Path + "island5.png") player0 = ImageList.LoadImage(Path + "myplane1.png") background = ImageList.LoadImage(Path + "fond.png") bullet0 = ImageList.LoadImage(Path + "bullet.png") enemy= ImageList.LoadImage(Path + "enemy1.png") enemy2 = ImageList.LoadImage(Path + "enemy2.png") enemy_expl1=ImageList.LoadImage(Path + "explo1.png") enemy_expl2=ImageList.LoadImage(Path + "explo2.png") player_expl=ImageList.LoadImage(Path + "explo2.png") Enemy_bullet=ImageList.LoadImage(Path + "E_bullet.png") end = ImageList.LoadImage(Path + "End.png") enemy_Array = "EnemyArray" 'Array that contain all the enemies ' every enemy in tha array has 5 informations ' TimeLine: each enemy has its own timeline ' PathNBR: the precalculated path defineing the movement ' the movement is decomposed in LineNbr differents lines ' each line is define in the enemy_path table with rotation, deltaY and deltaY ' PositonX, PositonY: position in space ' ' enemy_TimeLine = "EnemyTimeLine" enemy_line = "enemyLineNbr" enemy_PosX = "enemyPositonX" enemy_PosY = "enemyPositonY" enemy_PathNBR="enemy_PathNBR" enemy_Nbr = 6 enemy_Count = 0 enemy_speed = 4 'enemy_NextRemove = 1 enemy_Life = 10 player_size= 65 enemy_size = 32 enemy_ammo_size = 8 player_bullet_size = 32 island_Array = "Island array" IslandsPosition() create_level1() fond= Shapes.AddImage(background) Array.SetValue(island_Array,1,Shapes.AddImage(island1)) Array.SetValue(island_Array,2,Shapes.AddImage(island2)) Array.SetValue(island_Array,3,Shapes.AddImage(island3)) Array.SetValue(island_Array,4,Shapes.AddImage(island4)) Array.SetValue(island_Array,5,Shapes.AddImage(island5)) For i = 6 to islandcount Array.SetValue(island_Array,i,Array.getValue(island_Array,Math.Remainder(i,4))) Endfor player = Shapes.AddImage(player0) GraphicsWindow.FontSize = 20 GraphicsWindow.BackgroundColor = "Grey" GraphicsWindow.PenColor = "Yellow" Player_Ammo = "Player_AmmoArray" Player_AmmoAge = "Player_AmmoAge" Player_AmmoMax = 50 Player_AmmoCount = 0 Player_Ammospeed = bgs +4 Player_AmmoLife = 100 Enemy_Ammo = "Enemy_AmmoArray" Enemy_AmmoAge = "Enemy_AmmoAge" Enemy_Ammo_Angle="Enemy_Ammo_Angle" Enemy_AmmoMax = 30 Enemy_AmmoCount = 0 Enemy_Ammospeed = bgs +4 Enemy_AmmoLife = 50 Enemy_Agresivity = 200 score = 0 EndSub ' Main gane routine Sub Play GraphicsWindow.Show() ' Main loop play = 1 pause = 0 incx =0 ' X-axis increment for background incy = 0 ' Y-axis increment for background incbx = 0 'increment for bullets and all objects on X incby = 0 'increment for bullets and all objects on Y squadron = 1 ' Island initial position j= 0 For i= 1 To islandcount j=Math.Remainder(i,6) posy[i]= islandPos[j][2] posx[i]= islandPos[j][3] incislandx[i] = 0 incislandy[i] = 0 EndFor TimePlay = 0 Shapes.Move(player, gameWidth/2 , gameHeight -80 ) While(play = 1) Program.Delay(1000/fps) TimePlay = TimePlay +1 If (pause = 0) Then If (TimePlay = level1[squadron][1]) then pathNBR = level1[squadron][2] enemyPosX1 = level1[squadron][3] 'X position enemyPosY1 = level1[squadron][4] 'Y position enemy_Nbr = level1[squadron][6] enemy_type = level1[squadron][7] if (level1[squadron][5]=1) then create_enemies_left() Else create_enemies_right() endif squadron = squadron + 1 endif If (TimePlay > 4000) then Shapes.Move(Shapes.addImage(end), 230,200) Program.Delay(5000) Program.End() Endif moveall() GraphicsWindow.MouseMove = OnMouseMove GraphicsWindow.MouseDown = OnMouseDown AgePlayer_Ammo() EndIf EndWhile EndSub Sub OnMouseMove paddleX = GraphicsWindow.MouseX - player_size/2 paddleY = GraphicsWindow.MouseY- player_size If (paddleX < 0) then paddleX = 0 endif Shapes.Move(player, paddleX , paddleY ) EndSub Sub OnMouseDown ShootX = GraphicsWindow.MouseX - 15 ' in order to be from the neck of the plane ShootY = GraphicsWindow.MouseY - 80 Fire() EndSub Sub moveall incbx = 0 incby =0 GraphicsWindow.Title = gameTitle + score +" Lives:"+Player_Lives If (paddleX >(gameWidth-62) ) Then incx = incx - bgs incbx = incbx - bgs For i= 1 To islandcount incislandx[i] = incislandx[i] - bgs EndFor If (incx = -32 ) Then incx =0 Endif Endif If (paddleX < 64 ) Then incx = incx + bgs incbx = incbx + bgs For i= 1 To islandcount incislandx[i] = incislandx[i] + bgs EndFor If (incx = 32 ) Then incx =0 Endif Endif Shapes.Move(fond,incx -32 ,incy - 32) For i= 1 To islandcount islx = posx[i]+incislandx[i] isly = posy[i]+incislandy[i] Shapes.Move(Array.GetValue(island_Array,i),islx,isly) EndFor incy = incy + bgs incby = incby+ bgs For i= 1 To islandcount incislandy[i] = incislandy[i] + bgs EndFor If (incy = 32) Then incy =0 Endif For i= 1 To islandcount If ((posy[i]+incislandy[i]) > (gameHeight+15)) Then 'relaunch island if no more visible R= Math.Round(Math.GetRandomNumber(nbrisland)) AA = Math.Remainder(TimePlay,6) 'give new coordinates posx[i]= islandPos[AA][2] posy[i]= islandPos[AA][3] Shapes.move(Array.GetValue(island_Array,R),posx[i],posy[i]) incislandy[i]=0 incislandx[i]=0 EndIf ENDFOR ' Move playerammo For i = 1 To Player_AmmoCount Player_Ammox = Shapes.GetLeft(Array.GetValue(Player_Ammo, i)) +incbx Player_Ammoy = Shapes.GetTop(Array.GetValue(Player_Ammo, i)) - Player_Ammospeed Shapes.Move(Array.GetValue(Player_Ammo, i), Player_Ammox, Player_Ammoy) Array.SetValue(Player_AmmoAge, i, Array.GetValue(Player_AmmoAge, i) + 1) EndFor ' Move Enemy ammo For iea = 1 To Enemy_AmmoCount dx =(Math.Sin((Array.GetValue(Enemy_Ammo_Angle, iea) )) * Enemy_Ammospeed) dy =(Math.Cos((Array.GetValue(Enemy_Ammo_Angle, iea) ))* Enemy_Ammospeed) Enemy_Ammox = Shapes.GetLeft(Array.GetValue(Enemy_Ammo, iea)) +dx+incbx Enemy_Ammoy = Shapes.GetTop(Array.GetValue(Enemy_Ammo, iea)) +dy+incby*0.1 Shapes.Move(Array.GetValue(Enemy_Ammo, iea), Enemy_Ammox, Enemy_Ammoy) Array.SetValue(Enemy_AmmoAge, iea, Array.GetValue(Enemy_AmmoAge, iea) + 1) EndFor ' move ennemies For i=1 To enemy_Count ' move as TimeLine and Path say eNBR= Array.GetValue(enemy_PathNBR,i) uu =Array.GetValue(enemy_line,i) Time= Array.GetValue(enemy_TimeLine, i) etl=enemyPath[eNBR][1][uu] 'enemy own timeLine IF (Time=etl) Then 'it's time to rotate enemy rr = enemyPath[eNBR][2][uu+1] Shapes.Rotate(Array.GetValue(enemy_Array,i),rr) EndIf IF (Time > etl) Then uu = uu+1 Array.SetValue(enemy_line,i,uu) ' next line for enemy move EndIf xx1=Array.GetValue(enemy_PosX,i) yy1= Array.GetValue(enemy_PosY,i) xx = xx1+enemyPath[eNBR][3][uu]+incbx yy = yy1+enemyPath[eNBR][4][uu]+incby*0.1 ' Randomly fire-enemy If (Math.GetRandomNumber(Enemy_Agresivity)=1) Then Enemy_ShootX = xx1 + 16 Enemy_ShootY = yy1 + 4 If (yy1 > 0 AND xx1 > 0 And yy1< gameHeight And xx1 < gameWidth) then 'this avoid enemy fire from outside the screen fire_Enemy() Endif EndIf Shapes.Move(Array.GetValue(enemy_Array,i),xx,yy) Array.SetValue(enemy_PosX,i,xx) Array.SetValue(enemy_PosY,i,yy) Array.SetValue(enemy_TimeLine, i, Time + 1) If ((uu > enemyPath[eNBR][0][0]) And (Time > etl)) Then ' if last timelife remove the enemy sprite next_enemy_remove = i remove_enemy() endif Collision_pbe() Collision_ep() EndFor EndSub Sub RemovePlayer_Ammo Shapes.Remove(Array.GetValue(Player_Ammo, Player_Ammo_nextRemove)) For iz = Player_Ammo_nextRemove To Player_AmmoCount - 1 Array.SetValue(Player_Ammo, iz, Array.GetValue(Player_Ammo, iz+1)) Array.SetValue(Player_AmmoAge, iz, Array.GetValue(Player_AmmoAge, iz+1)) EndFor Array.RemoveValue(Player_Ammo, Player_AmmoCount) Array.RemoveValue(Player_AmmoAge, Player_AmmoCount) Player_AmmoCount = Player_AmmoCount - 1 EndSub Sub RemoveEnemy_Ammo Shapes.Remove(Array.GetValue(Enemy_Ammo, Enemy_Ammo_nextRemove)) For irea = Enemy_Ammo_nextRemove To Enemy_AmmoCount - 1 Array.SetValue(Enemy_Ammo, irea, Array.GetValue(Enemy_Ammo, irea+1)) Array.SetValue(Enemy_AmmoAge, irea, Array.GetValue(Enemy_AmmoAge, irea+1)) Array.SetValue(Enemy_Ammo_Angle, irea, Array.GetValue(Enemy_Ammo_Angle,irea+1)) EndFor Array.RemoveValue(Enemy_Ammo, Enemy_AmmoCount) Array.RemoveValue(Enemy_AmmoAge, Enemy_AmmoCount) Array.RemoveValue(Enemy_Ammo_Angle,Enemy_AmmoCount) Enemy_AmmoCount = Enemy_AmmoCount - 1 EndSub Sub fire ' Remove additional player Ammo While(Player_AmmoCount > Player_AmmoMax ) Player_Ammo_nextRemove = 1 RemovePlayer_Ammo() EndWhile ' Add the player Ammo Player_AmmoCount = Player_AmmoCount + 1 Array.SetValue(Player_Ammo, Player_AmmoCount, Shapes.AddImage(bullet0)) Shapes.Move(Array.GetValue(Player_Ammo, Player_AmmoCount), ShootX, ShootY) EndSub Sub fire_Enemy ' Remove additional Enemy Ammo While(Enemy_AmmoCount > (Enemy_AmmoMax - 1)) Enemy_Ammo_nextRemove = 1 RemoveEnemy_Ammo() EndWhile ' Add the Enemy Ammo Enemy_AmmoCount = Enemy_AmmoCount + 1 Array.SetValue(Enemy_Ammo, Enemy_AmmoCount, Shapes.AddImage(Enemy_bullet)) Array.SetValue(Enemy_Ammo_Angle, Enemy_AmmoCount,Math.ArcTan((paddleX- Enemy_ShootX+player_size/2)/(paddleY-Enemy_ShootY))) Shapes.Move(Array.GetValue(Enemy_Ammo, Enemy_AmmoCount), Enemy_ShootX, Enemy_ShootY) EndSub 'Check playerammo age Sub AgePlayer_Ammo While (Array.GetValue(Player_AmmoAge, 1) > Player_AmmoLife) Player_Ammo_nextRemove = 1 RemovePlayer_Ammo() EndWhile EndSub 'Check enemy ammo age Sub AgeEnemy_Ammo While (Array.GetValue(Enemy_AmmoAge, 1) > Enemy_AmmoLife) Enemy_Ammo_nextRemove = 1 RemoveEnemy_Ammo() EndWhile EndSub Sub remove_enemy Shapes.remove(Array.GetValue(enemy_Array,next_enemy_remove)) ' Remove all references from the arrays For ii = next_enemy_remove To enemy_Count - 1 Array.SetValue(enemy_Array, ii, Array.GetValue(enemy_Array, ii+1)) Array.SetValue(enemy_line, ii, Array.GetValue(enemy_line, ii+1)) Array.SetValue(enemy_PosX, ii, Array.GetValue(enemy_PosX, ii+1)) Array.SetValue(enemy_PosY, ii, Array.GetValue(enemy_PosY, ii+1)) Array.SetValue(enemy_TimeLine, ii, Array.GetValue(enemy_TimeLine, ii+1)) Array.SetValue(enemy_PathNBR, ii , Array.GetValue(enemy_PathNBR, ii+1)) EndFor Array.RemoveValue(enemy_Array, enemy_Count) Array.RemoveValue(enemy_line, enemy_Count) Array.RemoveValue(enemy_PosX, enemy_Count) Array.RemoveValue(enemy_PosY, enemy_Count) Array.RemoveValue(enemy_TimeLine, enemy_Count) Array.RemoveValue(enemy_PathNBR,enemy_Count) enemy_Count = enemy_Count - 1 EndSub Sub create_enemies_left TimeLine1 =0 For i=1 To enemy_Nbr enemy_Count= enemy_Count + 1 Array.SetValue(enemy_PathNBR,enemy_Count,pathNBR) If (enemy_type = 2) Then Array.SetValue(enemy_Array, enemy_Count,Shapes.AddImage(enemy2)) Else Array.SetValue(enemy_Array, enemy_Count,Shapes.AddImage(enemy)) EndIf Array.SetValue(enemy_line,enemy_Count,1) Array.SetValue(enemy_PosX, enemy_Count,enemyPosX1) Array.SetValue(enemy_PosY, enemy_Count,enemyPosY1) Array.SetValue(enemy_TimeLine, enemy_Count, TimeLine1) enemyPosX1 = enemyPosX1 - 64 'distance between ennemies TimeLine1 = TimeLine1 - 64 / enemy_speed EndFor For i=(enemy_Count-enemy_Nbr+1) To enemy_Count xxx=Array.GetValue(enemy_PosX,i) yyy= Array.GetValue(enemy_PosY,i) Shapes.Move(Array.GetValue(enemy_Array,i),xxx,yyy) EndFor EndSub Sub create_enemies_right TimeLine1 =0 For i=1 To enemy_Nbr enemy_Count= enemy_Count + 1 Array.SetValue(enemy_PathNBR,enemy_Count,pathNBR) Array.SetValue(enemy_Array, enemy_Count,Shapes.AddImage(enemy)) Array.SetValue(enemy_line,enemy_Count,1) Array.SetValue(enemy_PosX, enemy_Count,enemyPosX1) Array.SetValue(enemy_PosY, enemy_Count,enemyPosY1) Array.SetValue(enemy_TimeLine, enemy_Count, TimeLine1) enemyPosX1 = enemyPosX1 + 64 'distance between ennemies TimeLine1 = TimeLine1 - 64 / enemy_speed EndFor For i=(enemy_Count-enemy_Nbr+1) To enemy_Count xxx=Array.GetValue(enemy_PosX,i) yyy= Array.GetValue(enemy_PosY,i) Shapes.Move(Array.GetValue(enemy_Array,i),xxx,yyy) EndFor EndSub Sub Collision_pbe 'for player-bullet and enemies For i1 = 1 To Player_AmmoCount ' player bullet position Player_Ammox = Shapes.GetLeft(Array.GetValue(Player_Ammo, i1)) Player_Ammoy = Shapes.GetTop(Array.GetValue(Player_Ammo, i1)) px1=Player_Ammox+player_bullet_size/3 'in order to have a more precise collison than the bullet image size py1=Player_Ammoy+player_bullet_size/3 px2=px1+2*player_bullet_size/3 py2=py1+2*player_bullet_size/3 For i2 = 1 to enemy_Count ' enemy position ax1=Array.GetValue(enemy_PosX,i2)+enemy_size/4 ay1=Array.GetValue(enemy_PosY,i2)+enemy_size/4 ax2=ax1+3*enemy_size/4 ay2=ay1+3*enemy_size/4 If ( (ax1 < px1 And ax2 > px1) Or (ax1 < px2 And ax2 > px2) ) Then If ( (ay1 < py1 And ay2 > py1) Or (ay1 < py2 And ay2 > py2) ) Then ' collision between enemy nbr i2 and player bullet i ' remove bullet i and animate explosion and remove enemy i2 Player_Ammo_nextRemove = i1 RemovePlayer_Ammo() next_enemy_remove = i2 remove_enemy() ' begin animation for explosion at coordinate ax1, ay1 toto= Shapes.AddImage(enemy_expl1) Shapes.move(toto,ax1,ay1) Program.Delay(30) Shapes.Remove(toto) toto= Shapes.AddImage(enemy_expl2) Shapes.move(toto,ax1,ay1) Program.Delay(30) Shapes.Remove(toto) score = score +100 EndIf EndIf EndFor Endfor EndSub Sub Collision_ep 'for enemies and player px1 = Shapes.GetLeft(player) py1 = Shapes.GetTop(player) px2 = px1 + player_size py2 = py1 + player_size 'Shapes.Move(Shapes.AddRectangle(px2-px1 ,py2-py1), px1, py1) For i2 = 1 to enemy_Count ' enemy position ax1=Array.GetValue(enemy_PosX,i2) ay1=Array.GetValue(enemy_PosY,i2) ax2=ax1+enemy_size ay2=ay1+enemy_size 'Shapes.Move(Shapes.AddRectangle(ax2-ax1 ,ay2-ay1), ax1, ay1) If ( (px1 < ax1 And px2 > ax1) Or (px1 < ax2 And px2 > ax2) ) Then If ( (py1 < ay1 And py2 > ay1) Or (py1 < ay2 And py2 > ay2) ) Then ' collision between enemy nbr i2 and player ' animate explosion and decrease lives next_enemy_remove = i2 remove_enemy() ' begin animation for explosion at coordinate ax1, ay1 toto= Shapes.AddImage(enemy_expl1) Shapes.move(toto,ax1,ay1) Program.Delay(30) Shapes.Remove(toto) toto= Shapes.AddImage(player_expl) Shapes.move(toto,ax1,ay1) Program.Delay(300) Shapes.Remove(toto) Player_Lives = Player_Lives -1 If (Player_Lives = 0) THEN Program.End() EndIf EndIf EndIf EndFor px1 = paddleX py1 = paddleY px2 = px1 + player_size py2 = py1 + player_size 'Shapes.Move(Shapes.AddRectangle(px2-px1 ,py2-py1), px1, py1) For i3 = 1 to Enemy_AmmoCount ' enemy position ax1=Shapes.GetLeft(Array.GetValue(enemy_Ammo,i3)) ay1=Shapes.GetTop(Array.GetValue(enemy_Ammo,i3)) ax2=ax1+enemy_ammo_size ay2=ay1+enemy_ammo_size 'Shapes.Move(Shapes.AddRectangle(ax2-ax1 ,ay2-ay1), ax1, ay1) If ( (px1 < ax1 And px2 > ax1) Or (px1 < ax2 And px2 > ax2) ) Then If ( (py1 < ay1 And py2 > ay1) Or (py1 < ay2 And py2 > ay2) ) Then ' collision between enemy ammo nbr i3 and player ' animate explosion and decrease lives Enemy_Ammo_nextRemove = i3 RemoveEnemy_Ammo() ' begin animation for explosion at coordinate ax1, ay1 toto= Shapes.AddImage(enemy_expl1) Shapes.move(toto,paddleX+ player_size/2,paddleY+ player_size/2) Program.Delay(30) Shapes.Remove(toto) toto= Shapes.AddImage(player_expl) Shapes.move(toto,paddleX+ player_size/2,paddleY+ player_size/2) Program.Delay(300) Shapes.Remove(toto) Player_Lives = Player_Lives -1 If (Player_Lives = 0) THEN Program.End() EndIf EndIf EndIf EndFor EndSub Sub IslandsPosition ' island positions, avoid randomGeneration and islands overlap islandPos[0][1]=1 islandPos[0][2]=0 islandPos[0][3]=-150 islandPos[1][1]=1 islandPos[1][2]=-Math.Round(gameWidth/2) islandPos[1][3]=-150 islandPos[2][1]=2 islandPos[2][2]=-2*Math.Round(gameWidth/3) islandPos[2][3]=-150 islandPos[3][1]=1 islandPos[3][2]=2*Math.Round(gameWidth/3) islandPos[3][3]=-150 islandPos[4][1]=2 islandPos[4][2]=gameWidth islandPos[4][3]=-150 islandPos[5][1]=3 islandPos[5][2]=Math.Round(gameWidth/3) islandPos[5][3]=-150 islandPos[6][1]=3 islandPos[6][2]=-gameWidth islandPos[6][3]=-150 EndSub Sub define_paths enemyPath[0][0][0] = 3 'nbr of strait lines of path enemyPath[0][1][1] = 30 'from 0 to this in timeline enemyPath[0][1][2] = 100 ' from this to next in timeline enemyPath[0][1][3] = 400 'sprite goes up enemyPath[0][2][1] = 0 'first line rotation = 0 enemyPath[0][2][2] = 45 ' second line rotation = 45 enemyPath[0][2][3] = 45 enemyPath[0][3][1] = enemy_speed ' first line x movment enemyPath[0][3][2] = enemy_speed 'second line x movment enemyPath[0][3][3] = enemy_speed ' third line ... enemyPath[0][4][1] = 0 ' first line y movment enemyPath[0][4][2] = enemy_speed enemyPath[0][4][3] = enemy_speed '---------- second path enemyPath[1][0][0] = 4 enemyPath[1][1][1] = 1 enemyPath[1][1][2] = 1 enemyPath[1][1][3] = 100 enemyPath[1][1][4] = 400 enemyPath[1][2][1] = 180 enemyPath[1][2][2] = 135 enemyPath[1][2][3] = 135 enemyPath[1][2][4] = 90 enemyPath[1][3][1] = -enemy_speed enemyPath[1][3][2] = -enemy_speed enemyPath[1][3][3] = -enemy_speed enemyPath[1][3][4] = 0 enemyPath[1][4][1] = 0 enemyPath[1][4][2] = 0 enemyPath[1][4][3] = enemy_speed enemyPath[1][4][4] = enemy_speed 'round r=5 enemyPath[2][0][0]=21 enemyPath[2][1][1]=50 enemyPath[2][1][2]=55 enemyPath[2][1][3]=60 enemyPath[2][1][4]=65 enemyPath[2][1][5]=70 enemyPath[2][1][6]=75 enemyPath[2][1][7]=80 enemyPath[2][1][8]=85 enemyPath[2][1][9]=90 enemyPath[2][1][10]=95 enemyPath[2][1][11]=100 enemyPath[2][1][12]=105 enemyPath[2][1][13]=110 enemyPath[2][1][14]=115 enemyPath[2][1][15]=120 enemyPath[2][1][16]=125 enemyPath[2][1][17]=130 enemyPath[2][1][18]=135 enemyPath[2][1][19]=140 enemyPath[2][1][20]=145 enemyPath[2][1][21]=350 enemyPath[2][2][1]=0 enemyPath[2][2][2]=18 enemyPath[2][2][3]=36 enemyPath[2][2][4]=54 enemyPath[2][2][5]=72 enemyPath[2][2][6]=90 enemyPath[2][2][7]=108 enemyPath[2][2][8]=126 enemyPath[2][2][9]=144 enemyPath[2][2][10]=162 enemyPath[2][2][11]=180 enemyPath[2][2][12]=198 enemyPath[2][2][13]=216 enemyPath[2][2][14]=234 enemyPath[2][2][15]=252 enemyPath[2][2][16]=-90 enemyPath[2][2][17]=-72 enemyPath[2][2][18]=-54 enemyPath[2][2][19]=-36 enemyPath[2][2][20]=-18 enemyPath[2][2][21]=0 enemyPath[2][3][1]=enemy_speed enemyPath[2][3][2]=0.95*enemy_speed enemyPath[2][3][3]=0.81*enemy_speed enemyPath[2][3][4]=0.59*enemy_speed enemyPath[2][3][5]=0.31*enemy_speed enemyPath[2][3][6]=0 enemyPath[2][3][7]=-0.31*enemy_speed enemyPath[2][3][8]=-0.59*enemy_speed enemyPath[2][3][9]=-0.81*enemy_speed enemyPath[2][3][10]=-0.95*enemy_speed enemyPath[2][3][11]=-enemy_speed enemyPath[2][3][12]=-0.95*enemy_speed enemyPath[2][3][13]=-0.81*enemy_speed enemyPath[2][3][14]=-0.59*enemy_speed enemyPath[2][3][15]=-0.31*enemy_speed enemyPath[2][3][16]=0 enemyPath[2][3][17]=0.31*enemy_speed enemyPath[2][3][18]=0.59*enemy_speed enemyPath[2][3][19]=0.81*enemy_speed enemyPath[2][3][20]=0.95*enemy_speed enemyPath[2][3][21]=enemy_speed enemyPath[2][4][1]=0 enemyPath[2][4][2]=0.31*enemy_speed enemyPath[2][4][3]=0.59*enemy_speed enemyPath[2][4][4]=0.81*enemy_speed enemyPath[2][4][5]=0.95*enemy_speed enemyPath[2][4][6]=enemy_speed enemyPath[2][4][7]=0.95*enemy_speed enemyPath[2][4][8]=0.81*enemy_speed enemyPath[2][4][9]=0.59*enemy_speed enemyPath[2][4][10]=0.31*enemy_speed enemyPath[2][4][11]=0 enemyPath[2][4][12]=-0.31*enemy_speed enemyPath[2][4][13]=-0.59*enemy_speed enemyPath[2][4][14]=-0.81*enemy_speed enemyPath[2][4][15]=-0.95*enemy_speed enemyPath[2][4][16]=-enemy_speed enemyPath[2][4][17]=-0.95*enemy_speed enemyPath[2][4][18]=-0.81*enemy_speed enemyPath[2][4][19]=-0.59*enemy_speed enemyPath[2][4][20]=-0.31*enemy_speed enemyPath[2][4][21]=0 'round r=20 enemyPath[3][0][0]=21 enemyPath[3][1][1]=120 enemyPath[3][1][2]=140 enemyPath[3][1][3]=160 enemyPath[3][1][4]=180 enemyPath[3][1][5]=200 enemyPath[3][1][6]=220 enemyPath[3][1][7]=240 enemyPath[3][1][8]=260 enemyPath[3][1][9]=280 enemyPath[3][1][10]=300 enemyPath[3][1][11]=320 enemyPath[3][1][12]=340 enemyPath[3][1][13]=360 enemyPath[3][1][14]=380 enemyPath[3][1][15]=400 enemyPath[3][1][16]=420 enemyPath[3][1][17]=440 enemyPath[3][1][18]=460 enemyPath[3][1][19]=480 enemyPath[3][1][20]=500 enemyPath[3][1][21]=600 enemyPath[3][2][1]=0 enemyPath[3][2][2]=18 enemyPath[3][2][3]=36 enemyPath[3][2][4]=54 enemyPath[3][2][5]=72 enemyPath[3][2][6]=90 enemyPath[3][2][7]=108 enemyPath[3][2][8]=126 enemyPath[3][2][9]=144 enemyPath[3][2][10]=162 enemyPath[3][2][11]=180 enemyPath[3][2][12]=198 enemyPath[3][2][13]=216 enemyPath[3][2][14]=234 enemyPath[3][2][15]=252 enemyPath[3][2][16]=-90 enemyPath[3][2][17]=-72 enemyPath[3][2][18]=-54 enemyPath[3][2][19]=-36 enemyPath[3][2][20]=-18 enemyPath[3][2][21]=0 enemyPath[3][3][1]=enemy_speed enemyPath[3][3][2]=0.95*enemy_speed enemyPath[3][3][3]=0.81*enemy_speed enemyPath[3][3][4]=0.59*enemy_speed enemyPath[3][3][5]=0.31*enemy_speed enemyPath[3][3][6]=0 enemyPath[3][3][7]=-0.31*enemy_speed enemyPath[3][3][8]=-0.59*enemy_speed enemyPath[3][3][9]=-0.81*enemy_speed enemyPath[3][3][10]=-0.95*enemy_speed enemyPath[3][3][11]=-enemy_speed enemyPath[3][3][12]=-0.95*enemy_speed enemyPath[3][3][13]=-0.81*enemy_speed enemyPath[3][3][14]=-0.59*enemy_speed enemyPath[3][3][15]=-0.31*enemy_speed enemyPath[3][3][16]=0 enemyPath[3][3][17]=0.31*enemy_speed enemyPath[3][3][18]=0.59*enemy_speed enemyPath[3][3][19]=0.81*enemy_speed enemyPath[3][3][20]=0.95*enemy_speed enemyPath[3][3][21]=enemy_speed enemyPath[3][4][1]=0 enemyPath[3][4][2]=0.31*enemy_speed enemyPath[3][4][3]=0.59*enemy_speed enemyPath[3][4][4]=0.81*enemy_speed enemyPath[3][4][5]=0.95*enemy_speed enemyPath[3][4][6]=enemy_speed enemyPath[3][4][7]=0.95*enemy_speed enemyPath[3][4][8]=0.81*enemy_speed enemyPath[3][4][9]=0.59*enemy_speed enemyPath[3][4][10]=0.31*enemy_speed enemyPath[3][4][11]=0 enemyPath[3][4][12]=-0.31*enemy_speed enemyPath[3][4][13]=-0.59*enemy_speed enemyPath[3][4][14]=-0.81*enemy_speed enemyPath[3][4][15]=-0.95*enemy_speed enemyPath[3][4][16]=-enemy_speed enemyPath[3][4][17]=-0.95*enemy_speed enemyPath[3][4][18]=-0.81*enemy_speed enemyPath[3][4][19]=-0.59*enemy_speed enemyPath[3][4][20]=-0.31*enemy_speed enemyPath[3][4][21]=0 'round r=10 enemyPath[4][0][0]=21 enemyPath[4][1][1]=110 enemyPath[4][1][2]=120 enemyPath[4][1][3]=130 enemyPath[4][1][4]=140 enemyPath[4][1][5]=150 enemyPath[4][1][6]=160 enemyPath[4][1][7]=170 enemyPath[4][1][8]=180 enemyPath[4][1][9]=190 enemyPath[4][1][10]=200 enemyPath[4][1][11]=210 enemyPath[4][1][12]=220 enemyPath[4][1][13]=230 enemyPath[4][1][14]=240 enemyPath[4][1][15]=250 enemyPath[4][1][16]=260 enemyPath[4][1][17]=270 enemyPath[4][1][18]=280 enemyPath[4][1][19]=290 enemyPath[4][1][20]=300 enemyPath[4][1][21]=500 enemyPath[4][2][1]=0 enemyPath[4][2][2]=18 enemyPath[4][2][3]=36 enemyPath[4][2][4]=54 enemyPath[4][2][5]=72 enemyPath[4][2][6]=90 enemyPath[4][2][7]=108 enemyPath[4][2][8]=126 enemyPath[4][2][9]=144 enemyPath[4][2][10]=162 enemyPath[4][2][11]=180 enemyPath[4][2][12]=198 enemyPath[4][2][13]=216 enemyPath[4][2][14]=234 enemyPath[4][2][15]=252 enemyPath[4][2][16]=-90 enemyPath[4][2][17]=-72 enemyPath[4][2][18]=-54 enemyPath[4][2][19]=-36 enemyPath[4][2][20]=-18 enemyPath[4][2][21]=0 enemyPath[4][3][1]=enemy_speed enemyPath[4][3][2]=0.95*enemy_speed enemyPath[4][3][3]=0.81*enemy_speed enemyPath[4][3][4]=0.59*enemy_speed enemyPath[4][3][5]=0.31*enemy_speed enemyPath[4][3][6]=0 enemyPath[4][3][7]=-0.31*enemy_speed enemyPath[4][3][8]=-0.59*enemy_speed enemyPath[4][3][9]=-0.81*enemy_speed enemyPath[4][3][10]=-0.95*enemy_speed enemyPath[4][3][11]=-enemy_speed enemyPath[4][3][12]=-0.95*enemy_speed enemyPath[4][3][13]=-0.81*enemy_speed enemyPath[4][3][14]=-0.59*enemy_speed enemyPath[4][3][15]=-0.31*enemy_speed enemyPath[4][3][16]=0 enemyPath[4][3][17]=0.31*enemy_speed enemyPath[4][3][18]=0.59*enemy_speed enemyPath[4][3][19]=0.81*enemy_speed enemyPath[4][3][20]=0.95*enemy_speed enemyPath[4][3][21]=enemy_speed enemyPath[4][4][1]=0 enemyPath[4][4][2]=0.31*enemy_speed enemyPath[4][4][3]=0.59*enemy_speed enemyPath[4][4][4]=0.81*enemy_speed enemyPath[4][4][5]=0.95*enemy_speed enemyPath[4][4][6]=enemy_speed enemyPath[4][4][7]=0.95*enemy_speed enemyPath[4][4][8]=0.81*enemy_speed enemyPath[4][4][9]=0.59*enemy_speed enemyPath[4][4][10]=0.31*enemy_speed enemyPath[4][4][11]=0 enemyPath[4][4][12]=-0.31*enemy_speed enemyPath[4][4][13]=-0.59*enemy_speed enemyPath[4][4][14]=-0.81*enemy_speed enemyPath[4][4][15]=-0.95*enemy_speed enemyPath[4][4][16]=-enemy_speed enemyPath[4][4][17]=-0.95*enemy_speed enemyPath[4][4][18]=-0.81*enemy_speed enemyPath[4][4][19]=-0.59*enemy_speed enemyPath[4][4][20]=-0.31*enemy_speed enemyPath[4][4][21]=0 'round r=15 + exit down enemyPath[5][0][0]=27 enemyPath[5][1][1]=120 enemyPath[5][1][2]=125 enemyPath[5][1][3]=150 enemyPath[5][1][4]=165 enemyPath[5][1][5]=180 enemyPath[5][1][6]=195 enemyPath[5][1][7]=210 enemyPath[5][1][8]=225 enemyPath[5][1][9]=240 enemyPath[5][1][10]=255 enemyPath[5][1][11]=270 enemyPath[5][1][12]=285 enemyPath[5][1][13]=300 enemyPath[5][1][14]=315 enemyPath[5][1][15]=330 enemyPath[5][1][16]=345 enemyPath[5][1][17]=360 enemyPath[5][1][18]=375 enemyPath[5][1][19]=390 enemyPath[5][1][20]=405 enemyPath[5][1][21]=600 enemyPath[5][1][22]=615 enemyPath[5][1][23]=630 enemyPath[5][1][24]=645 enemyPath[5][1][254]=660 enemyPath[5][1][26]=675 enemyPath[5][1][27]=800 enemyPath[5][2][1]=0 enemyPath[5][2][2]=18 enemyPath[5][2][3]=36 enemyPath[5][2][4]=54 enemyPath[5][2][5]=72 enemyPath[5][2][6]=90 enemyPath[5][2][7]=108 enemyPath[5][2][8]=126 enemyPath[5][2][9]=144 enemyPath[5][2][10]=162 enemyPath[5][2][11]=180 enemyPath[5][2][12]=198 enemyPath[5][2][13]=216 enemyPath[5][2][14]=234 enemyPath[5][2][15]=252 enemyPath[5][2][16]=-90 enemyPath[5][2][17]=-72 enemyPath[5][2][18]=-54 enemyPath[5][2][19]=-36 enemyPath[5][2][20]=-18 enemyPath[5][2][21]=0 enemyPath[5][2][22]=18 enemyPath[5][2][23]=36 enemyPath[5][2][24]=54 enemyPath[5][2][25]=72 enemyPath[5][2][26]=90 enemyPath[5][2][27]=90 enemyPath[5][3][1]=enemy_speed enemyPath[5][3][2]=0.95*enemy_speed enemyPath[5][3][3]=0.81*enemy_speed enemyPath[5][3][4]=0.59*enemy_speed enemyPath[5][3][5]=0.31*enemy_speed enemyPath[5][3][6]=0 enemyPath[5][3][7]=-0.31*enemy_speed enemyPath[5][3][8]=-0.59*enemy_speed enemyPath[5][3][9]=-0.81*enemy_speed enemyPath[5][3][10]=-0.95*enemy_speed enemyPath[5][3][11]=-enemy_speed enemyPath[5][3][12]=-0.95*enemy_speed enemyPath[5][3][13]=-0.81*enemy_speed enemyPath[5][3][14]=-0.59*enemy_speed enemyPath[5][3][15]=-0.31*enemy_speed enemyPath[5][3][16]=0 enemyPath[5][3][17]=0.31*enemy_speed enemyPath[5][3][18]=0.59*enemy_speed enemyPath[5][3][19]=0.81*enemy_speed enemyPath[5][3][20]=0.95*enemy_speed enemyPath[5][3][21]=enemy_speed enemyPath[5][3][22]=0.95*enemy_speed enemyPath[5][3][23]=0.81*enemy_speed enemyPath[5][3][24]=0.59*enemy_speed enemyPath[5][3][25]=0.31*enemy_speed enemyPath[5][3][26]=0 enemyPath[5][3][27]=0 enemyPath[5][4][1]=0 enemyPath[5][4][2]=0.31*enemy_speed enemyPath[5][4][3]=0.59*enemy_speed enemyPath[5][4][4]=0.81*enemy_speed enemyPath[5][4][5]=0.95*enemy_speed enemyPath[5][4][6]=enemy_speed enemyPath[5][4][7]=0.95*enemy_speed enemyPath[5][4][8]=0.81*enemy_speed enemyPath[5][4][9]=0.59*enemy_speed enemyPath[5][4][10]=0.31*enemy_speed enemyPath[5][4][11]=0 enemyPath[5][4][12]=-0.31*enemy_speed enemyPath[5][4][13]=-0.59*enemy_speed enemyPath[5][4][14]=-0.81*enemy_speed enemyPath[5][4][15]=-0.95*enemy_speed enemyPath[5][4][16]=-enemy_speed enemyPath[5][4][17]=-0.95*enemy_speed enemyPath[5][4][18]=-0.81*enemy_speed enemyPath[5][4][19]=-0.59*enemy_speed enemyPath[5][4][20]=-0.31*enemy_speed enemyPath[5][4][21]=0 enemyPath[5][4][22]=0.31*enemy_speed enemyPath[5][4][23]=0.59*enemy_speed enemyPath[5][4][24]=0.81*enemy_speed enemyPath[5][4][25]=0.95*enemy_speed enemyPath[5][4][26]=enemy_speed enemyPath[5][4][27]=enemy_speed enemyPath[6][0][0]=3 enemyPath[6][1][1]=1 enemyPath[6][1][2]=80 enemyPath[6][1][3]=200 enemyPath[6][2][1]=0 enemyPath[6][2][2]=90 enemyPath[6][2][3]=-90 enemyPath[6][3][1]=0 enemyPath[6][3][2]=0 enemyPath[6][3][3]=0 enemyPath[6][4][1]=0 enemyPath[6][4][2]=enemy_speed enemyPath[6][4][3]=-enemy_speed EndSub Sub create_level1 'this define the behavior of the différent squadron along the time play for level 1 level1[1][1]=20 'when timeplay=level1[1][1] level1[1][2]= 2 ' lauch enemy with Path level1[1][2] level1[1][3]= -10 ' at x coordinate level1[1][3] level1[1][4] = 0 ' at y coordinate level1[1][4] level1[1][5] = 1 ' 1 for create enemy at the left side; 2 for the right side of screen level1[1][6] = 4 'level[1][6] is the number of enemies level1[1][7] = 1 'type of enemy level1[2][1]= 80 level1[2][2]= 6 level1[2][3]= gameWidth/2 level1[2][4] = -500 level1[2][5] = 1 level1[2][6] = 3 level1[2][7] = 1 level1[3][1]= 150 level1[3][2]= 0 level1[3][3]= -10 level1[3][4] = 0 level1[3][5] = 1 level1[3][6] = 6 level1[3][7] = 2 level1[4][1]= 280 level1[4][2]= 4 level1[4][3]= -10 level1[4][4] = 0 level1[4][5] = 1 level1[4][6] = 3 level1[4][7] = 2 level1[5][1]= 410 level1[5][2]= 6 level1[5][3]= gameWidth/3 level1[5][4] = -50 level1[5][5] = 1 level1[5][6] = 3 level1[5][7] = 1 level1[6][1]= 430 level1[6][2]= 6 level1[6][3]= 2*gameWidth/3 level1[6][4] = -50 level1[6][5] = 2 level1[6][6] = 3 level1[6][7] = 1 level1[5][1]= 500 level1[5][2]= 6 level1[5][3]= gameWidth/3 level1[5][4] = -50 level1[5][5] = 1 level1[5][6] = 6 level1[5][7] = 2 level1[6][1]= 590 level1[6][2]= 5 level1[6][3]= 100 level1[6][4] = -80 level1[6][5] = 1 level1[6][6] = 3 level1[6][7] = 3 level1[7][1]= 690 level1[7][2]= 6 level1[7][3]= gameWidth/3 level1[7][4] = -50 level1[7][5] = 2 level1[7][6] = 3 level1[7][7] = 2 For i= 1 To 10 Level1[7+i][1]=700+50*i level1[7+i][2]= 6 level1[7+i][3]= math.GetrandomNumber(gameWidth) level1[7+i][4] = -50 +i level1[7+i][5] = math.GetrandomNumber(2) level1[7+i][6] = math.GetrandomNumber(3) level1[7+i][7] = math.GetrandomNumber(2) EndFor level1[18][1]= 1300 level1[18][2]= 1 level1[18][3]= gameWidth level1[18][4] = -10 level1[18][5] = 2 level1[18][6] = 6 level1[18][7] = 2 For i= 1 To 10 Level1[18+i][1]=1330+50*i level1[18+i][2]= 4+math.GetrandomNumber(2) level1[18+i][3]= math.GetrandomNumber(50) level1[18+i][4] = i level1[18+i][5] = 1 level1[18+i][6] = math.GetrandomNumber(3) level1[18+i][7] = math.GetrandomNumber(2) EndFor For i= 1 To 10 Level1[28+i][1]=1900+50*i level1[28+i][2]= 4+math.GetrandomNumber(2) level1[28+i][3]= -math.GetrandomNumber(50) level1[28+i][4] = i level1[28+i][5] = 1 level1[28+i][6] = math.GetrandomNumber(3) level1[28+i][7] = math.GetrandomNumber(2) EndFor For i= 1 To 10 Level1[38+i][1]=2450+100*i level1[38+i][2]= 6 level1[38+i][3]= math.GetrandomNumber(gameWidth) level1[38+i][4] = -50 +i level1[38+i][5] = math.GetrandomNumber(2) level1[38+i][6] = math.GetrandomNumber(5) level1[38+i][7] = math.GetrandomNumber(2) EndFor EndSub End>GGN415.sb< Start>GGN836.sb< gw = 500 gh = 500 worldScale = 10 GraphicsWindow.Width = gw GraphicsWindow.Width = gh mapRegionImage = ImageList.LoadImage("http://www.ezilon.com/maps/images/world-physical-map.gif") LDImage.Resize(mapRegionImage,worldScale*gw,worldScale*gh) mapRegion = Shapes.AddImage(mapRegionImage) 'GraphicsWindow.BrushColor = "Red" 'mapRegion = Shapes.AddRectangle(worldScale*gw,worldScale*gh) GraphicsWindow.BrushColor = "Blue" 'Shapes.Move(staticObject,100,100) mapObject = Shapes.AddEllipse(50,50) Shapes.Move(mapObject,gw/2-25,gw/2-25)'center Shapes.Move(mapObject,200,200) list[1] = "Option 1" list[2] = "Option 2" list[3] = "Option 3" list[4] = "Option 4" staticObject = LDControls.AddListBox(list,100,gh/2) 'staticObject = Shapes.AddRectangle(100,100) scale = 1 scaleStep = 1.01 LDScrollBars.Add(worldScale*gw,worldScale*gh) LDScrollBars.ScrollBarChanged = OnScrollBarChanged While ("True") start = Clock.ElapsedMilliseconds If (LDUtilities.KeyDown("Q")) Then scale = scale*scaleStep If (scale > 1) Then scale = 1 EndIF ReScale() ElseIf (LDUtilities.KeyDown("A")) Then scale = scale/scaleStep If (scale < 1/worldScale) Then scale = 1/worldScale EndIF ReScale() EndIf delay = 20 - (Clock.ElapsedMilliseconds-start) If (delay > 0) Then Program.Delay(delay) EndIf EndWhile Sub OnScrollBarChanged RepositionStaticShapes() EndSub Sub Rescale LDGraphicsWindow.PauseUpdates() 'TextWindow.WriteLine(LDScrollBars.HorizontalScroll) 'Center of GW in view coordinates pos = LDGraphicsWindow.RepositionPoint(LDScrollBars.HorizontalScroll+gw/2,LDScrollBars.VerticalScroll+gh/2,"False") 'Rescale view LDGraphicsWindow.Reposition(scale,scale,0,0,0) 'New center of view in GW coordinates pos1 = LDGraphicsWindow.RepositionPoint(pos[1],pos[2],"True") 'Scroll to keep the old center at the new scaled view center LDScrollBars.HorizontalScroll = pos1[1]-gw/2'-0.4 LDScrollBars.VerticalScroll = pos1[2]-gh/2'-0.4 'Keep image in view posMin = LDGraphicsWindow.RepositionPoint(0,0,"True") posMax = LDGraphicsWindow.RepositionPoint(worldScale*gw,worldScale*gh,"True") LDScrollBars.HorizontalScroll = Math.Min(posMax[1]-gw,Math.Max(posMin[1],LDScrollBars.HorizontalScroll)) LDScrollBars.VerticalScroll = Math.Min(posMax[2]-gh,Math.Max(posMin[2],LDScrollBars.VerticalScroll)) RepositionStaticShapes() LDGraphicsWindow.ResumeUpdates() EndSub Sub RepositionStaticShapes position = LDGraphicsWindow.RepositionPoint(LDScrollBars.HorizontalScroll+0,LDScrollBars.VerticalScroll+0,"False") Shapes.Move(staticObject,position[1]+100*(1/scale-1)/2,position[2]+gh/2*(1/scale-1)/2) Shapes.Zoom(staticObject,1/scale,1/scale) EndSub End>GGN836.sb< Start>GGP234.sb< name= "Bob" colour= "cyan" GraphicsWindow.Show() GraphicsWindow.Height= 650 GraphicsWindow.Width= 1000 GraphicsWindow.Left= 5 GraphicsWindow.Top= 5 GraphicsWindow.BackgroundColor= "black" GraphicsWindow.BrushColor= colour GraphicsWindow.PenColor= "white" GraphicsWindow.KeyDown= MoveCycle level=1 init() While "true" moving() Program.Delay(50) WinGame() If crashed="true" Then Shapes.Remove(player) Program.Delay(500) init() EndIf endwhile Sub init GraphicsWindow.Clear() delXY="X=1;Y=0" ' X=1 to avoid X=0 crashed player= Shapes.AddEllipse(15,40) Shapes.Rotate(player,90) ' move right direction crashed="false" AddObstacles() t0=clock.ElapsedMilliseconds endsub Sub AddObstacles GraphicsWindow.BrushColor="Yellow" winx= Math.GetRandomNumber(980) winy= Math.GetRandomNumber(630) egg= Shapes.AddEllipse(20,30) Shapes.Move(egg,winx,winy) For i= 1 To level retry: GraphicsWindow.BrushColor=GraphicsWindow.GetRandomColor() locationx= Math.GetRandomNumber(900) locationy= Math.GetRandomNumber(550) recsize= 30+Math.GetRandomNumber(70) If (locationx<40 and locationy<15) Or (math.Abs(locationx-winx)1001 then X=1001 elseif Y<0 then Y=-1 elseif y>650 then Y=651 endif Shapes.Move(player,x,y) GraphicsWindow.Title= "X= "+X+ " : Y= "+Y+ "Ellapsed time= "+Math.Floor((Clock.ElapsedMilliseconds-t0)/100)/10+" Sec" If (GraphicsWindow.GetPixel(x+40/2+delXY["X"],y+40/2+delXY["Y"]) <> "#000000") Then GraphicsWindow.ShowMessage("1 You have crashed, and are banished from Kyragetron!", name+", YOU ARE BANISHED!") crashed="true" ElseIf (x>1000 or x<0) then GraphicsWindow.ShowMessage("2 You have crashed, and are banished from Kyragetron!", name+", YOU ARE BANISHED!") crashed="true" ElseIf (y>650 or y<0) then GraphicsWindow.ShowMessage("3 You have crashed, and are banished from Kyragetron!", name+", YOU ARE BANISHED!") crashed="true" EndIf GraphicsWindow.BrushColor= colour GraphicsWindow.FillRectangle(x +15/4-1, y + 40/3+2, 12, 12) EndSub Sub MoveCycle key= GraphicsWindow.LastKey If (key= "Right") Then delXY="X=12;Y=0;rot=1" ElseIf (key= "Left") Then delXY="X=-12;Y=0;rot=1" ElseIf (key= "Down") Then delXY="X=0;Y=12;rot=0" ElseIf (key= "Up") Then delXY="X=0;Y=-12;rot=0" EndIf Shapes.Rotate(player,delxy["rot"]*90) EndSub Sub WinGame If (math.Abs(x-winx)<20 and math.Abs(y-winy)<30) Then GraphicsWindow.ShowMessage("Congrats! You have completed Level "+level+", and live to see another day. Good luck on the next level!", "Good Job") level= level +1 init() EndIf EndSub End>GGP234.sb< Start>GGQ546.sb< ''reading svg-file 200401 WhTurner '' program to read an SVG-file generated with Inkscape and draw the plot '' the drawing should only contain straight lines grid() C34=Text.GetCharacter(34) FI=Program.Directory+"/drawing.svg" ''<<GGQ546.sb< Start>GGR168.sb< 'This creates the graphicswindow size and position' GraphicsWindow.Left = 0 GraphicsWindow.Top = 0 GraphicsWindow.Width = 1350 GraphicsWindow.Height = 690 'This creates the graphicswindow background color, pencolor and brushcolor' GraphicsWindow.PenColor = "Black" GraphicsWindow.BackgroundColor = "#DEB887" GraphicsWindow.BrushColor = "#D2B48C" 'This creates the large circle and position on the graphicswindow' Clockcircle = Shapes.AddEllipse(680,680) Shapes.Move(Clockcircle,335,5) Shapes.SetOpacity(Clockcircle,100) 'This Calls up the Turtle and positions it in the centre of the screen' Turtle.Speed = 10 Turtle.PenUp() Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Hide() 'I used turtle to create hiden lines at 6 degree angles. End of hiden lines an ellipse was created' 'This Section Creates The SECOND LED' GraphicsWindow.PenColor = "#696969" GraphicsWindow.BackgroundColor = "khaki" GraphicsWindow.BrushColor = "#FF4500" Turtle.Angle = 0 Turtle.Move(325) 'X = 675 Y = 20 X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec0 = Shapes.AddEllipse(24,24) Shapes.Move(sec0,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec30 = Shapes.AddEllipse(24,24) Shapes.Move(sec30,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 6 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec1 = Shapes.AddEllipse(20,20) Shapes.Move(sec1,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec31 = Shapes.AddEllipse(20,20) Shapes.Move(sec31,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 12 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec2 = Shapes.AddEllipse(20,20) Shapes.Move(sec2,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec32 = Shapes.AddEllipse(20,20) Shapes.Move(sec32,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 18 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec3 = Shapes.AddEllipse(20,20) Shapes.Move(sec3,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec33 = Shapes.AddEllipse(20,20) Shapes.Move(sec33,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 24 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec4 = Shapes.AddEllipse(20,20) Shapes.Move(sec4,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec34 = Shapes.AddEllipse(20,20) Shapes.Move(sec34,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 30 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec5 = Shapes.AddEllipse(24,24) Shapes.Move(sec5,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec35 = Shapes.AddEllipse(24,24) Shapes.Move(sec35,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 36 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec6 = Shapes.AddEllipse(20,20) Shapes.Move(sec6,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec36 = Shapes.AddEllipse(20,20) Shapes.Move(sec36,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 42 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec7 = Shapes.AddEllipse(20,20) Shapes.Move(sec7,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec37 = Shapes.AddEllipse(20,20) Shapes.Move(sec37,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 48 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec8 = Shapes.AddEllipse(20,20) Shapes.Move(sec8,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec38 = Shapes.AddEllipse(20,20) Shapes.Move(sec38,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 54 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec9 = Shapes.AddEllipse(20,20) Shapes.Move(sec9,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec39 = Shapes.AddEllipse(20,20) Shapes.Move(sec39,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 60 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec10 = Shapes.AddEllipse(24,24) Shapes.Move(sec10,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec40 = Shapes.AddEllipse(24,24) Shapes.Move(sec40,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 66 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec11 = Shapes.AddEllipse(20,20) Shapes.Move(sec11,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec41 = Shapes.AddEllipse(20,20) Shapes.Move(sec41,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 72 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec12 = Shapes.AddEllipse(20,20) Shapes.Move(sec12,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec42 = Shapes.AddEllipse(20,20) Shapes.Move(sec42,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 78 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec13 = Shapes.AddEllipse(20,20) Shapes.Move(sec13,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec43 = Shapes.AddEllipse(20,20) Shapes.Move(sec43,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 84 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec14 = Shapes.AddEllipse(20,20) Shapes.Move(sec14,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec44 = Shapes.AddEllipse(20,20) Shapes.Move(sec44,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 90 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec15 = Shapes.AddEllipse(24,24) Shapes.Move(sec15,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec45 = Shapes.AddEllipse(24,24) Shapes.Move(sec45,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 96 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec16 = Shapes.AddEllipse(20,20) Shapes.Move(sec16,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec46 = Shapes.AddEllipse(20,20) Shapes.Move(sec46,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 102 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec17 = Shapes.AddEllipse(20,20) Shapes.Move(sec17,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec47 = Shapes.AddEllipse(20,20) Shapes.Move(sec47,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 108 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec18 = Shapes.AddEllipse(20,20) Shapes.Move(sec18,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec48 = Shapes.AddEllipse(20,20) Shapes.Move(sec48,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 114 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec19 = Shapes.AddEllipse(20,20) Shapes.Move(sec19,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec49 = Shapes.AddEllipse(20,20) Shapes.Move(sec49,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 120 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec20 = Shapes.AddEllipse(24,24) Shapes.Move(sec20,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec50 = Shapes.AddEllipse(24,24) Shapes.Move(sec50,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 126 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec21 = Shapes.AddEllipse(20,20) Shapes.Move(sec21,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec51 = Shapes.AddEllipse(20,20) Shapes.Move(sec51,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 132 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec22 = Shapes.AddEllipse(20,20) Shapes.Move(sec22,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec52 = Shapes.AddEllipse(20,20) Shapes.Move(sec52,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 138 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec23 = Shapes.AddEllipse(20,20) Shapes.Move(sec23,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec53 = Shapes.AddEllipse(20,20) Shapes.Move(sec53,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 144 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec24 = Shapes.AddEllipse(20,20) Shapes.Move(sec24,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec54 = Shapes.AddEllipse(20,20) Shapes.Move(sec54,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 150 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec25 = Shapes.AddEllipse(24,24) Shapes.Move(sec25,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec55 = Shapes.AddEllipse(24,24) Shapes.Move(sec55,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 156 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec26 = Shapes.AddEllipse(20,20) Shapes.Move(sec26,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec56= Shapes.AddEllipse(20,20) Shapes.Move(sec56,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.angle = 162 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec27 = Shapes.AddEllipse(20,20) Shapes.Move(sec27,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec57 = Shapes.AddEllipse(20,20) Shapes.Move(sec57,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 168 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec28 = Shapes.AddEllipse(20,20) Shapes.Move(sec28,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec58 = Shapes.AddEllipse(20,20) Shapes.Move(sec58,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 174 Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec29 = Shapes.AddEllipse(20,20) Shapes.Move(sec29,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(325) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then sec59 = Shapes.AddEllipse(20,20) Shapes.Move(sec59,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Hide() 'This section creates the MINUTE LED' Turtle.Angle = 0 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min0 = Shapes.AddEllipse(24,24) Shapes.Move(min0,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min30 = Shapes.AddEllipse(24,24) Shapes.Move(min30,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 6 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min1 = Shapes.AddEllipse(20,20) Shapes.Move(min1,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min31 = Shapes.AddEllipse(20,20) Shapes.Move(min31,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 12 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min2 = Shapes.AddEllipse(20,20) Shapes.Move(min2,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min32 = Shapes.AddEllipse(20,20) Shapes.Move(min32,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 18 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min3 = Shapes.AddEllipse(20,20) Shapes.Move(min3,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min33 = Shapes.AddEllipse(20,20) Shapes.Move(min33,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 24 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min4 = Shapes.AddEllipse(20,20) Shapes.Move(min4,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min34 = Shapes.AddEllipse(20,20) Shapes.Move(min34,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 30 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min5 = Shapes.AddEllipse(24,24) Shapes.Move(min5,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min35 = Shapes.AddEllipse(24,24) Shapes.Move(min35,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 36 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min6 = Shapes.AddEllipse(20,20) Shapes.Move(min6,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min36 = Shapes.AddEllipse(20,20) Shapes.Move(min36,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 42 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min7 = Shapes.AddEllipse(20,20) Shapes.Move(min7,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min37 = Shapes.AddEllipse(20,20) Shapes.Move(min37,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 48 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min8 = Shapes.AddEllipse(20,20) Shapes.Move(min8,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min38 = Shapes.AddEllipse(20,20) Shapes.Move(min38,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 54 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min9 = Shapes.AddEllipse(20,20) Shapes.Move(min9,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min39 = Shapes.AddEllipse(20,20) Shapes.Move(min39,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 60 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min10 = Shapes.AddEllipse(24,24) Shapes.Move(min10,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min40 = Shapes.AddEllipse(24,24) Shapes.Move(min40,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 66 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min11 = Shapes.AddEllipse(20,20) Shapes.Move(min11,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min41 = Shapes.AddEllipse(20,20) Shapes.Move(min41,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 72 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min12 = Shapes.AddEllipse(20,20) Shapes.Move(min12,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min42 = Shapes.AddEllipse(20,20) Shapes.Move(min42,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 78 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min13 = Shapes.AddEllipse(20,20) Shapes.Move(min13,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min43 = Shapes.AddEllipse(20,20) Shapes.Move(min43,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 84 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min14 = Shapes.AddEllipse(20,20) Shapes.Move(min14,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min44 = Shapes.AddEllipse(20,20) Shapes.Move(min44,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 90 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min15 = Shapes.AddEllipse(24,24) Shapes.Move(min15,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min45 = Shapes.AddEllipse(24,24) Shapes.Move(min45,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 96 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min16 = Shapes.AddEllipse(20,20) Shapes.Move(min16,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min46 = Shapes.AddEllipse(20,20) Shapes.Move(min46,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 102 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min17 = Shapes.AddEllipse(20,20) Shapes.Move(min17,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min47 = Shapes.AddEllipse(20,20) Shapes.Move(min47,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 108 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min18 = Shapes.AddEllipse(20,20) Shapes.Move(min18,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min48 = Shapes.AddEllipse(20,20) Shapes.Move(min48,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 114 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min19 = Shapes.AddEllipse(20,20) Shapes.Move(min19,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min49 = Shapes.AddEllipse(20,20) Shapes.Move(min49,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 120 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min20 = Shapes.AddEllipse(24,24) Shapes.Move(min20,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min50 = Shapes.AddEllipse(24,24) Shapes.Move(min50,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 126 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min21 = Shapes.AddEllipse(20,20) Shapes.Move(min21,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min51 = Shapes.AddEllipse(20,20) Shapes.Move(min51,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 132 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min22 = Shapes.AddEllipse(20,20) Shapes.Move(min22,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min52 = Shapes.AddEllipse(20,20) Shapes.Move(min52,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 138 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min23 = Shapes.AddEllipse(20,20) Shapes.Move(min23,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min53 = Shapes.AddEllipse(20,20) Shapes.Move(min53,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 144 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min24 = Shapes.AddEllipse(20,20) Shapes.Move(min24,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min54 = Shapes.AddEllipse(20,20) Shapes.Move(min54,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 150 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min25 = Shapes.AddEllipse(24,24) Shapes.Move(min25,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min55 = Shapes.AddEllipse(24,24) Shapes.Move(min55,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 156 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min26 = Shapes.AddEllipse(20,20) Shapes.Move(min26,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min56 = Shapes.AddEllipse(20,20) Shapes.Move(min56,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.angle = 162 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min27 = Shapes.AddEllipse(20,20) Shapes.Move(min27,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min57 = Shapes.AddEllipse(20,20) Shapes.Move(min57,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 168 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min28 = Shapes.AddEllipse(20,20) Shapes.Move(min28,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min58 = Shapes.AddEllipse(20,20) Shapes.Move(min58,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 174 Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min29 = Shapes.AddEllipse(20,20) Shapes.Move(min29,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Move(280) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then min59 = Shapes.AddEllipse(20,20) Shapes.Move(min59,X-10,Y-10) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Hide() 'This Section Creates The HOUR LED' Turtle.Angle = 0 Turtle.Move(235) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then hour12 = Shapes.AddEllipse(24,24) Shapes.Move(hour12,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Move(235) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then hour6 = Shapes.AddEllipse(24,24) Shapes.Move(hour6,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 30 Turtle.Move(235) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then hour1 = Shapes.AddEllipse(24,24) Shapes.Move(hour1,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Move(235) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then hour7 = Shapes.AddEllipse(24,24) Shapes.Move(hour7,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 60 Turtle.Move(235) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then hour2 = Shapes.AddEllipse(24,24) Shapes.Move(hour2,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Move(235) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then hour8 = Shapes.AddEllipse(24,24) Shapes.Move(hour8,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 90 Turtle.Move(235) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then hour3 = Shapes.AddEllipse(24,24) Shapes.Move(hour3,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Move(235) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then hour9 = Shapes.AddEllipse(24,24) Shapes.Move(hour9,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 120 Turtle.Move(235) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then hour4 = Shapes.AddEllipse(24,24) Shapes.Move(hour4,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Move(235) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then hour10 = Shapes.AddEllipse(24,24) Shapes.Move(hour10,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Angle = 150 Turtle.Move(235) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then hour5 = Shapes.AddEllipse(24,24) Shapes.Move(hour5,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Move(235) X = Turtle.X Y = Turtle.Y If X = Turtle.X And Y = Turtle.Y Then hour11 = Shapes.AddEllipse(24,24) Shapes.Move(hour11,X-12,Y-12) EndIf Turtle.MoveTo(675,345) Turtle.Angle = 0 Turtle.Hide() 'This next set of command lines starts the Clock Time according to the Computers Seconds' Start: If (Clock.second = 0) Then Shapes.SetOpacity(sec0,100) Else Shapes.SetOpacity(sec0,20) EndIf If (Clock.second = 1) Then Shapes.SetOpacity(sec1,100) Else Shapes.SetOpacity(sec1,20) EndIf If (Clock.second = 2) Then Shapes.SetOpacity(sec2,100) Else Shapes.SetOpacity(sec2,20) EndIf If (Clock.second = 3) Then Shapes.SetOpacity(sec3,100) Else Shapes.SetOpacity(sec3,20) EndIf If (Clock.second = 4) Then Shapes.SetOpacity(sec4,100) Else Shapes.SetOpacity(sec4,20) EndIf If (Clock.second = 5) Then Shapes.SetOpacity(sec5,100) Else Shapes.SetOpacity(sec5,20) EndIf If (Clock.second = 6) Then Shapes.SetOpacity(sec6,100) Else Shapes.SetOpacity(sec6,20) EndIf If (Clock.second = 7) Then Shapes.SetOpacity(sec7,100) Else Shapes.SetOpacity(sec7,20) EndIf If (Clock.second = 8) Then Shapes.SetOpacity(sec8,100) Else Shapes.SetOpacity(sec8,20) EndIf If (Clock.second = 9) Then Shapes.SetOpacity(sec9,100) Else Shapes.SetOpacity(sec9,20) EndIf If (Clock.second = 10) Then Shapes.SetOpacity(sec10,100) Else Shapes.SetOpacity(sec10,20) EndIf If (Clock.Second = 11) Then Shapes.SetOpacity(sec11,100) Else Shapes.SetOpacity(sec11,20) EndIf If (Clock.Second = 12) Then Shapes.SetOpacity(sec12,100) Else Shapes.SetOpacity(sec12,20) EndIf If (Clock.Second = 13) Then Shapes.SetOpacity(sec13,100) Else Shapes.SetOpacity(sec13,20) EndIf If (Clock.Second = 14) Then Shapes.SetOpacity(sec14,100) Else Shapes.SetOpacity(sec14,20) EndIf If (Clock.Second = 15) Then Shapes.SetOpacity(sec15,100) Else Shapes.SetOpacity(sec15,20) EndIf If (Clock.Second = 16) Then Shapes.SetOpacity(sec16,100) Else Shapes.SetOpacity(sec16,20) EndIf If (Clock.Second = 17) Then Shapes.SetOpacity(sec17,100) Else Shapes.SetOpacity(sec17,20) EndIf If (Clock.Second = 18) Then Shapes.SetOpacity(sec18,100) Else Shapes.SetOpacity(sec18,20) EndIf If (Clock.Second = 19) Then Shapes.SetOpacity(sec19,100) Else Shapes.SetOpacity(sec19,20) EndIf If (Clock.Second = 20) Then Shapes.SetOpacity(sec20,100) Else Shapes.SetOpacity(sec20,20) EndIf If (Clock.Second = 21) Then Shapes.SetOpacity(sec21,100) Else Shapes.SetOpacity(sec21,20) EndIf If (Clock.Second = 22) Then Shapes.SetOpacity(sec22,100) Else Shapes.SetOpacity(sec22,20) EndIf If (Clock.Second = 23) Then Shapes.SetOpacity(sec23,100) Else Shapes.SetOpacity(sec23,20) EndIf If (Clock.Second = 24) Then Shapes.SetOpacity(sec24,100) Else Shapes.SetOpacity(sec24,20) EndIf If (Clock.Second = 25) Then Shapes.SetOpacity(sec25,100) Else Shapes.SetOpacity(sec25,20) EndIf If (Clock.Second = 26) Then Shapes.SetOpacity(sec26,100) Else Shapes.SetOpacity(sec26,20) EndIf If (Clock.Second = 27) Then Shapes.SetOpacity(sec27,100) Else Shapes.SetOpacity(sec27,20) EndIf If (Clock.Second = 28) Then Shapes.SetOpacity(sec28,100) Else Shapes.SetOpacity(sec28,20) EndIf If (Clock.Second = 29) Then Shapes.SetOpacity(sec29,100) Else Shapes.SetOpacity(sec29,20) EndIf If (Clock.Second = 30) Then Shapes.SetOpacity(sec30,100) Else Shapes.SetOpacity(sec30,20) EndIf If (Clock.Second = 31) Then Shapes.SetOpacity(sec31,100) Else Shapes.SetOpacity(sec31,20) EndIf If (Clock.Second = 32) Then Shapes.SetOpacity(sec32,100) Else Shapes.SetOpacity(sec32,20) EndIf If (Clock.Second = 33) Then Shapes.SetOpacity(sec33,100) Else Shapes.SetOpacity(sec33,20) EndIf If (Clock.Second = 34) Then Shapes.SetOpacity(sec34,100) Else Shapes.SetOpacity(sec34,20) EndIf If (Clock.Second = 35) Then Shapes.SetOpacity(sec35,100) Else Shapes.SetOpacity(sec35,20) EndIf If (Clock.Second = 36) Then Shapes.SetOpacity(sec36,100) Else Shapes.SetOpacity(sec36,20) EndIf If (Clock.Second = 37) Then Shapes.SetOpacity(sec37,100) Else Shapes.SetOpacity(sec37,20) EndIf If (Clock.Second = 38) Then Shapes.SetOpacity(sec38,100) Else Shapes.SetOpacity(sec38,20) EndIf If (Clock.Second = 39) Then Shapes.SetOpacity(sec39,100) Else Shapes.SetOpacity(sec39,20) EndIf If (Clock.Second = 40) Then Shapes.SetOpacity(sec40,100) Else Shapes.SetOpacity(sec40,20) EndIf If (Clock.Second = 41) Then Shapes.SetOpacity(sec41,100) Else Shapes.SetOpacity(sec41,20) EndIf If (Clock.Second = 42) Then Shapes.SetOpacity(sec42,100) Else Shapes.SetOpacity(sec42,20) EndIf If (Clock.Second = 43) Then Shapes.SetOpacity(sec43,100) Else Shapes.SetOpacity(sec43,20) EndIf If (Clock.Second = 44) Then Shapes.SetOpacity(sec44,100) Else Shapes.SetOpacity(sec44,20) EndIf If (Clock.Second = 45) Then Shapes.SetOpacity(sec45,100) Else Shapes.SetOpacity(sec45,20) EndIf If (Clock.Second = 46) Then Shapes.SetOpacity(sec46,100) Else Shapes.SetOpacity(sec46,20) EndIf If (Clock.Second = 47) Then Shapes.SetOpacity(sec47,100) Else Shapes.SetOpacity(sec47,20) EndIf If (Clock.Second = 48) Then Shapes.SetOpacity(sec48,100) Else Shapes.SetOpacity(sec48,20) EndIf If (Clock.Second = 49) Then Shapes.SetOpacity(sec49,100) Else Shapes.SetOpacity(sec49,20) EndIf If (Clock.Second = 50) Then Shapes.SetOpacity(sec50,100) Else Shapes.SetOpacity(sec50,20) EndIf If (Clock.Second = 51) Then Shapes.SetOpacity(sec51,100) Else Shapes.SetOpacity(sec51,20) EndIf If (Clock.Second = 52) Then Shapes.SetOpacity(sec52,100) Else Shapes.SetOpacity(sec52,20) EndIf If (Clock.Second = 53) Then Shapes.SetOpacity(sec53,100) Else Shapes.SetOpacity(sec53,20) EndIf If (Clock.Second = 54) Then Shapes.SetOpacity(sec54,100) Else Shapes.SetOpacity(sec54,20) EndIf If (Clock.Second = 55) Then Shapes.SetOpacity(sec55,100) Else Shapes.SetOpacity(sec55,20) EndIf If (Clock.Second = 56) Then Shapes.SetOpacity(sec56,100) Else Shapes.SetOpacity(sec56,20) EndIf If (Clock.Second = 57) Then Shapes.SetOpacity(sec57,100) Else Shapes.SetOpacity(sec57,20) EndIf If (Clock.Second = 58) Then Shapes.SetOpacity(sec58,100) Else Shapes.SetOpacity(sec58,20) EndIf If (Clock.Second = 59) Then Shapes.SetOpacity(sec59,100) Else Shapes.SetOpacity(sec59,20) EndIf 'This next set of command lines starts the Clock Time according to the Computers Minutes' If (Clock.Minute = 0) Then Shapes.SetOpacity(min0,100) Else Shapes.SetOpacity(min0,20) EndIf If (Clock.Minute = 1) Then Shapes.SetOpacity(min1,100) Else Shapes.SetOpacity(min1,20) EndIf If (Clock.Minute = 2) Then Shapes.SetOpacity(min2,100) Else Shapes.SetOpacity(min2 ,20) EndIf If (Clock.Minute = 3) Then Shapes.SetOpacity(min3,100) Else Shapes.SetOpacity(min3,20) EndIf If (Clock.Minute = 4) Then Shapes.SetOpacity(min4,100) Else Shapes.SetOpacity(min4,20) EndIf If (Clock.minute = 5) Then Shapes.SetOpacity(min5,100) Else Shapes.SetOpacity(min5,20) EndIf If (Clock.Minute = 6) Then Shapes.SetOpacity(min6,100) Else Shapes.SetOpacity(min6,20) EndIf If (Clock.Minute = 7) Then Shapes.SetOpacity(min7,100) Else Shapes.SetOpacity(min7,20) EndIf If (Clock.Minute = 8) Then Shapes.SetOpacity(min8,100) Else Shapes.SetOpacity(min8,20) EndIf If (Clock.Minute = 9) Then Shapes.SetOpacity(min9,100) Else Shapes.SetOpacity(min9,20) EndIf If (Clock.Minute = 10) Then Shapes.SetOpacity(min10,100) Else Shapes.SetOpacity(min10,20) EndIf If (Clock.Minute = 11) Then Shapes.SetOpacity(min11,100) Else Shapes.SetOpacity(min11,20) EndIf If (Clock.Minute = 12) Then Shapes.SetOpacity(min12,100) Else Shapes.SetOpacity(min12,20) EndIf If (Clock.Minute = 13) Then Shapes.SetOpacity(min13,100) Else Shapes.SetOpacity(min13,20) EndIf If (Clock.Minute = 14) Then Shapes.SetOpacity(min14,100) Else Shapes.SetOpacity(min14,20) EndIf If (Clock.Minute = 15) Then Shapes.SetOpacity(min15,100) Else Shapes.SetOpacity(min15,20) EndIf If (Clock.Minute = 16) Then Shapes.SetOpacity(min16,100) Else Shapes.SetOpacity(min16,20) EndIf If (Clock.Minute = 17) Then Shapes.SetOpacity(min17,100) Else Shapes.SetOpacity(min17,20) EndIf If (Clock.Minute = 18) Then Shapes.SetOpacity(min18,100) Else Shapes.SetOpacity(min18,20) EndIf If (Clock.Minute = 19) Then Shapes.SetOpacity(min19,100) Else Shapes.SetOpacity(min19,20) EndIf If (Clock.Minute = 20) Then Shapes.SetOpacity(min20,100) Else Shapes.SetOpacity(min20,20) EndIf If (Clock.Minute = 21) Then Shapes.SetOpacity(min21,100) Else Shapes.SetOpacity(min21,20) EndIf If (Clock.Minute = 22) Then Shapes.SetOpacity(min22,100) Else Shapes.SetOpacity(min22,20) EndIf If (Clock.Minute = 23) Then Shapes.SetOpacity(min23,100) Else Shapes.SetOpacity(min23,20) EndIf If (Clock.Minute = 24) Then Shapes.SetOpacity(min24,100) Else Shapes.SetOpacity(min24,20) EndIf If (Clock.Minute = 25) Then Shapes.SetOpacity(min25,100) Else Shapes.SetOpacity(min25,20) EndIf If (Clock.Minute = 26) Then Shapes.SetOpacity(min26,100) Else Shapes.SetOpacity(min26,20) EndIf If (Clock.Minute = 27) Then Shapes.SetOpacity(min27,100) Else Shapes.SetOpacity(min27,20) EndIf If (Clock.Minute = 28) Then Shapes.SetOpacity(min28,100) Else Shapes.SetOpacity(min28,20) EndIf If (Clock.Minute = 29) Then Shapes.SetOpacity(min29,100) Else Shapes.SetOpacity(min29,20) EndIf If (Clock.Minute = 30) Then Shapes.SetOpacity(min30,100) Else Shapes.SetOpacity(min30,20) EndIf If (Clock.Minute = 31) Then Shapes.SetOpacity(min31,100) Else Shapes.SetOpacity(min31,20) EndIf If (Clock.Minute = 32) Then Shapes.SetOpacity(min32,100) Else Shapes.SetOpacity(min32,20) EndIf If (Clock.Minute = 33) Then Shapes.SetOpacity(min33,100) Else Shapes.SetOpacity(min33,20) EndIf If (Clock.Minute = 34) Then Shapes.SetOpacity(min34,100) Else Shapes.SetOpacity(min34,20) EndIf If (Clock.Minute = 35) Then Shapes.SetOpacity(min35,100) Else Shapes.SetOpacity(min35,20) EndIf If (Clock.Minute = 36) Then Shapes.SetOpacity(min36,100) Else Shapes.SetOpacity(min36,20) EndIf If (Clock.Minute = 37) Then Shapes.SetOpacity(min37,100) Else Shapes.SetOpacity(min37,20) EndIf If (Clock.Minute = 38) Then Shapes.SetOpacity(min38,100) Else Shapes.SetOpacity(min38,20) EndIf If (Clock.Minute = 39) Then Shapes.SetOpacity(min39,100) Else Shapes.SetOpacity(min39,20) EndIf If (Clock.Minute = 40) Then Shapes.SetOpacity(min40,100) Else Shapes.SetOpacity(min40,20) EndIf If (Clock.Minute = 41) Then Shapes.SetOpacity(min41,100) Else Shapes.SetOpacity(min41,20) EndIf If (Clock.Minute = 42) Then Shapes.SetOpacity(min42,100) Else Shapes.SetOpacity(min42,20) EndIf If (Clock.Minute = 43) Then Shapes.SetOpacity(min43,100) Else Shapes.SetOpacity(min43,20) EndIf If (Clock.Minute = 44) Then Shapes.SetOpacity(min44,100) Else Shapes.SetOpacity(min44,20) EndIf If (Clock.Minute = 45) Then Shapes.SetOpacity(min45,100) Else Shapes.SetOpacity(min45,20) EndIf If (Clock.Minute = 46) Then Shapes.SetOpacity(min46,100) Else Shapes.SetOpacity(min46,20) EndIf If (Clock.Minute = 47) Then Shapes.SetOpacity(min47,100) Else Shapes.SetOpacity(min47,20) EndIf If (Clock.Minute = 48) Then Shapes.SetOpacity(min48,100) Else Shapes.SetOpacity(min48,20) EndIf If (Clock.Minute = 49) Then Shapes.SetOpacity(min49,100) Else Shapes.SetOpacity(min49,20) EndIf If (Clock.Minute = 50) Then Shapes.SetOpacity(min50,100) Else Shapes.SetOpacity(min50,20) EndIf If (Clock.Minute = 51) Then Shapes.SetOpacity(min51,100) Else Shapes.SetOpacity(min51,20) EndIf If (Clock.Minute = 52) Then Shapes.SetOpacity(min52,100) Else Shapes.SetOpacity(min52,20) EndIf If (Clock.Minute = 53) Then Shapes.SetOpacity(min53,100) Else Shapes.SetOpacity(min53,20) EndIf If (Clock.Minute = 54) Then Shapes.SetOpacity(min54,100) Else Shapes.SetOpacity(min54,20) EndIf If (Clock.Minute = 55) Then Shapes.SetOpacity(min55,100) Else Shapes.SetOpacity(min55,20) EndIf If (Clock.Minute = 56) Then Shapes.SetOpacity(min56,100) Else Shapes.SetOpacity(min56,20) EndIf If (Clock.Minute = 57) Then Shapes.SetOpacity(min57,100) Else Shapes.SetOpacity(min57,20) EndIf If (Clock.Minute = 58) Then Shapes.SetOpacity(min58,100) Else Shapes.SetOpacity(min58,20) EndIf If (Clock.Minute = 59) Then Shapes.SetOpacity(min59,100) Else Shapes.SetOpacity(min59,20) EndIf 'This next set of command lines starts the Clock Time according to the Computers Hours' If (Clock.Hour = 1) Or (Clock.Hour = 13) Then Shapes.SetOpacity(hour1,100) Else Shapes.SetOpacity(hour1,20) EndIf If (Clock.Hour = 2) Or (Clock.Hour = 14) Then Shapes.SetOpacity(hour2,100) Else Shapes.SetOpacity(hour2 ,20) EndIf If (Clock.Hour = 3) Or (Clock.Hour = 15) Then Shapes.SetOpacity(hour3,100) Else Shapes.SetOpacity(hour3,20) EndIf If (Clock.Hour = 4) Or (Clock.Hour = 16) Then Shapes.SetOpacity(hour4,100) Else Shapes.SetOpacity(hour4,20) EndIf If (Clock.Hour = 5) Or (Clock.Hour = 17) Then Shapes.SetOpacity(hour5,100) Else Shapes.SetOpacity(hour5,20) EndIf If (Clock.Hour = 6) Or (Clock.Hour = 18) Then Shapes.SetOpacity(hour6,100) Else Shapes.SetOpacity(hour6,20) EndIf If (Clock.Hour = 7) Or (Clock.Hour = 19) Then Shapes.SetOpacity(hour7,100) Else Shapes.SetOpacity(hour7,20) EndIf If (Clock.Hour = 8) Or (Clock.Hour = 20) Then Shapes.SetOpacity(hour8,100) Else Shapes.SetOpacity(hour8,20) EndIf If (Clock.Hour = 9) Or (Clock.Hour = 21) Then Shapes.SetOpacity(hour9,100) Else Shapes.SetOpacity(hour9,20) EndIf If (Clock.Hour = 10) Or (Clock.Hour = 22) Then Shapes.SetOpacity(hour10,100) Else Shapes.SetOpacity(hour10,20) EndIf If (Clock.Hour = 11) Or (Clock.Hour = 23) Then Shapes.SetOpacity(hour11,100) Else Shapes.SetOpacity(hour11,20) EndIf If (Clock.Hour = 12) Or (Clock.Hour = 24) Or (Clock.Hour = 0) Then Shapes.SetOpacity(hour12,100) Else Shapes.SetOpacity(hour12,20) EndIf Goto Start End>GGR168.sb< Start>GGV858.sb< GraphicsWindow.MouseMove = OnMouseMove GraphicsWindow.MouseDown = OnMouseClick Controls.ButtonClicked = OnButtonClick TT = 200 Timer.Tick = OnTimerTick Init() Main() Program.End() Sub Main While Again = true While Play = true ShowTelescopicSight() ShowClayPigeon() Collision() Program.Delay(4) EndWhile 'Play Program.Delay(300) Retry() Program.Delay(300) EndWhile 'Again EndSub '*************************************************************************************************************************** Sub Init GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 FSH = 768 'max Height FSW = 1366 'max Width gh = FSH - 75 gw = FSW - 173 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Title = "Clay-pigeon shooting (Tontaubenschießen) GraphicsWindow.Show() Mouse.HideCursor() GraphicsWindow.BrushColor = "Black" blmWid = 500 blmHei = 250 steps = 8 gap = 10 centerX = GraphicsWindow.Width / 2 centerY = GraphicsWindow.Height / 2 bgColor = "lightblue" msg = "Clay-pigeon shooting" textoffset = 175 offset = 75 DrawZeppelin() false = 0 true = 1 R = 100 RR = R*0.75 O = 10 OO = 70 Timer.Interval = TT ' See if our files are stored locally, otherwise assume supplied by Microsoft server temp = false files = "" ' The following line could be harmful and has been automatically commented. ' files = File.GetFiles(Program.Directory) For i = 1 to Array.GetItemCount(files) If text.ConvertToUpperCase(files[i]) = text.ConvertToUpperCase(Program.Directory + "\stargates_berzerk.mp3") Then ' Found local file, use local path for all files temp = true ' Break out of loop i = 100000 EndIf endfor if temp = true then resourcePath = Program.Directory + "\" else resourcePath = "http://smallbasic.com/drop/stargates/" endif Sound.PlayAndWait(resourcePath + "stargates_laser.mp3") Sound.PlayAndWait(resourcePath + "stargates_berzerk.mp3") playerVx = 0 playerVy = 0 GraphicsWindow.BrushColor = "White" GraphicsWindow.PenColor = "Black" GraphicsWindow.PenWidth = RR x0 = 0 y0 = 0 xx0 = R+RR yy0 = R+RR L0 = Shapes.AddEllipse(xx0,yy0) Shapes.Move(L0, 0, -50) Shapes.SetOpacity(L0, OO) Shapes.HideShape(L0) GraphicsWindow.PenColor = "White" GraphicsWindow.PenWidth = 1 x1 = 0 y1 = 0 xx1 = R yy1 = 0 L1 = Shapes.AddLine(x1,y1,xx1,yy1) Shapes.Move(L1, 0, -50) Shapes.SetOpacity(L1, O) Shapes.HideShape(L1) x2 = 0 y2 = 0 xx2 = 0 yy2 = R L2 = Shapes.AddLine(x2,y2,xx2 ,yy2) Shapes.Move(L2, 0, -50) Shapes.SetOpacity(L2, O) Shapes.HideShape(L2) x3 = 0 y3 = 0 xx3 = R yy3 = R L3 = Shapes.AddEllipse(xx3 ,yy3) Shapes.Move(L3, 0, -50) Shapes.SetOpacity(L3, O) Shapes.HideShape(L3) GraphicsWindow.BrushColor = "SaddleBrown" GraphicsWindow.PenColor = "SaddleBrown" xx4 = R*0.75 yy4 = R*0.5 L4 = Shapes.AddEllipse(xx4 ,yy4) Shapes.Move(L4, 0, -50) Shapes.HideShape(L4) CP = 0 ZX = 0 ZY = gh 'InitExplosion For i = 1 to 4 temp = Shapes.AddEllipse(5, 7) Shapes.Move(temp, 0, -50) Explosion[i] = temp endfor 'Button GraphicsWindow.BrushColor = "SteelBlue" GraphicsWindow.PenColor = "SteelBlue" GraphicsWindow.FontSize = 36 QRetry = Controls.AddButton("Start",gw/2-150, gh-150) Controls.HideControl(QRetry) QEnd = Controls.AddButton("Ende",gw/2+150, gh-150) Controls.HideControl(QEnd) QHelp = Controls.AddButton("Help",gw/2+300, gh-150) Controls.HideControl(QHelp) GraphicsWindow.BrushColor = "Black" GraphicsWindow.PenColor = "Black" GraphicsWindow.FontSize = 14 Timer.Pause() Program.Delay(1000) GraphicsWindow.BrushColor = "LightBlue" GraphicsWindow.FillRectangle(0,0,gw,gh) Retry() EndSub 'Init Sub ShowTelescopicSight Shapes.Move(L0,x1,y1) Shapes.Move(L1,x1+RR/2,y1+(R/2)+RR/2) Shapes.Move(L2,x1+(R/2)+RR/2,y1+RR/2) Shapes.Move(L3,x1+RR/2,y1+RR/2) EndSub 'ShowTelescopicSight Sub ShowClayPigeon If (CP = 1) Then DoIt() Else RD1 = Math.GetRandomNumber(300) If RD1 < 280 Then CP = 0 Else RD = Math.GetRandomNumber(50)+50 CounterCP = CounterCP + 1 If CounterCP = 11 Then CP = false Play = false Else ShowResults() CP = 1 SShot = 0 SS = 1 ZX = 0 ZY = gh ZXX = Math.GetRandomNumber(10)+4 ZS = ((Math.GetRandomNumber(10)+RD*4)/10000) Shapes.ShowShape(L4) DoIt() EndIf EndIf EndIf EndSub 'ShowClayPigeon Sub DoIt ZX = ZX + ZXX If (ZX > gw) or (ZY > gh) Then CP = 0 Shapes.HideShape(L4) EndIf ZY = ZY - (RD/10) If (ZY < (RD * 2)) Then RD = (RD * -1) EndIf Program.Delay(10) Shapes.Move(L4,ZX,ZY) SS = SS - ZS ZS = ZS/1.15 Shapes.Zoom(L4, SS, SS) EndSub ' DoIt Sub Collision If MouseClick = true Then MouseClick = false If SShot < 3 Then Sound.Stop(resourcePath + "stargates_berzerk.mp3") Sound.Play(resourcePath + "stargates_berzerk.mp3") If X1+R >= ZX And X1 <= ZX+yy4 And Y1+R >= ZY And Y1 <= ZY+yy4 Then CP = 0 Shapes.HideShape(L4) Hit = Hit + 1 ShowResults() exploding = true explosionX = ZX explosionY = ZY Sound.Stop(resourcePath + "stargates_berzerk.mp3") Sound.Play(resourcePath + "stargates_berzerk.mp3") While exploding = true XExplosion() EndWhile EndIf Shot = Shot + 1 SShot = SShot + 1 ShowResults() Sound.Stop(resourcePath + "stargates_berzerk.mp3") Sound.Play(resourcePath + "stargates_berzerk.mp3") EndIf Else If X1+R >= ZX And X1 <= ZX+yy4 And Y1+R >= ZY And Y1 <= ZY+yy4 Then Shapes.Zoom(L4, SS*1.5, SS*1.5) EndIf EndIf EndSub 'Collision Sub XExplosion If exploding = true then ' Move along with ground explosionSize = explosionSize + 2 If explosionSize > 70 then exploding = false explosionSize = 0 ' Move parts off screen Shapes.HideShape(Array.GetValue("explosion", 1)) Shapes.HideShape(Array.GetValue("explosion", 2)) Shapes.HideShape(Array.GetValue("explosion", 3)) Shapes.HideShape(Array.GetValue("explosion", 4)) else ' Move all pieces of explosion in four directions Shapes.ShowShape(Array.GetValue("explosion", 1)) Shapes.ShowShape(Array.GetValue("explosion", 2)) Shapes.ShowShape(Array.GetValue("explosion", 3)) Shapes.ShowShape(Array.GetValue("explosion", 4)) temp = Array.GetValue("explosion", 1) Shapes.Move(temp, explosionX + explosionSize, explosionY + explosionSize) temp = Array.GetValue("explosion", 2) Shapes.Move(temp, explosionX + explosionSize, explosionY - explosionSize) temp = Array.GetValue("explosion", 3) Shapes.Move(temp, explosionX - explosionSize, explosionY + explosionSize) temp = Array.GetValue("explosion", 4) Shapes.Move(temp, explosionX - explosionSize, explosionY - explosionSize) endif endif EndSub 'Explosion Sub Retry Points = Hit * 10 If Shot < CounterCP Then If Hit > 0 Then Points = Points + CounterCP - Shot EndIf EndIf GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 50 GraphicsWindow.DrawText(200,gh/2,"Points: "+Points) GraphicsWindow.FontSize = 14 Shapes.HideShape(L0) Shapes.HideShape(L1) Shapes.HideShape(L2) Shapes.HideShape(L3) Mouse.ShowCursor() Controls.ShowControl(QRetry) Controls.ShowControl(QEnd) Controls.ShowControl(QHelp) Wait: ButtonClick = false While ButtonClick = false EndWhile If Controls.LastClickedButton = QRetry Then Again = true Play = true CB = 0 Hit = 0 Shot = 0 SShot = 0 CounterCP = 0 ShowResults() GraphicsWindow.PenColor = "LightGreen" GraphicsWindow.BrushColor = "LightGreen" GraphicsWindow.FillRectangle(0,(gh/2),gw,gh) GraphicsWindow.BrushColor = "SaddleBrown" GraphicsWindow.PenColor = "Black" GraphicsWindow.FillRectangle(0,gh-100,150,100) GraphicsWindow.FillTriangle(0,gh-100,150,gh-100,0,gh-200) Shapes.ShowShape(L0) Shapes.ShowShape(L1) Shapes.ShowShape(L2) Shapes.ShowShape(L3) Mouse.HideCursor() ElseIf Controls.LastClickedButton = QHelp Then ' notice = "Clay-pigeon shooting"+Text.GetCharacter(13)+Text.GetCharacter(13) notice = notice + "- Click Start for begining the play."+Text.GetCharacter(13) notice = notice + "- Click End for this Notice"+Text.GetCharacter(13) notice = notice + "- Click Help for this Notice"+Text.GetCharacter(13)+Text.GetCharacter(13) notice = notice + "You can aim at the pigeon with the sighting telescope. Move the sighting telescope with the mouse."+Text.GetCharacter(13) notice = notice + "If the clay-pigeon in the sighting telescope it grews up."+Text.GetCharacter(13) notice = notice + "If you shoot in this time, you hit the pigeon. "+Text.GetCharacter(13) notice = notice + "Press the mouse button for shooting. You have two shoots per pigeon. "+Text.GetCharacter(13) notice = notice + "On the left top you see the number of pigeon, shoots and hits."+Text.GetCharacter(13)+Text.GetCharacter(13) notice = notice + "Per lap it automatical catapults 10 pigeons."+Text.GetCharacter(13) notice = notice + "Per hit you get 10 points. You get points for minimum of shoting."+Text.GetCharacter(13)+Text.GetCharacter(13)+Text.GetCharacter(13) notice = notice + "Good luck"+Text.GetCharacter(13) GraphicsWindow.ShowMessage(notice, "Help") Goto Wait Else Again = false EndIf Controls.HideControl(QRetry) Controls.HideControl(QEnd) Controls.HideControl(QHelp) EndSub 'Retry Sub ShowResults GraphicsWindow.BrushColor = "SteelBlue" GraphicsWindow.FontSize = 14 GraphicsWindow.FillRectangle(1,2,120,60) GraphicsWindow.BrushColor = "White" GraphicsWindow.DrawText(1,3,"Clay pigeon: "+CounterCP) GraphicsWindow.DrawText(1,23,"Hits: "+Hit) GraphicsWindow.DrawText(1,40,"Shots: "+Shot) GraphicsWindow.BrushColor = "Black" EndSub 'ShowResults Sub OnMouseMove x1 = Mouse.MouseX - R y1 = Mouse.MouseY - R If x1 < 150 Then x1 = 150 Endif If y1 > gh -100 Then y1 = gh - 100 EndIf EndSub 'OnMouseMove Sub OnMouseClick MouseClick = true EndSub 'OnMouseClick Sub OnButtonClick ButtonClick = true EndSub 'OnButtonClick Sub DrawZeppelin 'Draw the blimp '************************************************************************************ GraphicsWindow.BackgroundColor = bgColor GraphicsWindow.BrushColor = "black" GraphicsWindow.PenColor = "black" ewid = blmWid ehei = blmHei For i = 1 To steps GraphicsWindow.FillEllipse(centerX - (ewid/2),centerY - (ehei/2) - offset,ewid,ehei) GraphicsWindow.DrawEllipse(centerX - (ewid/2),centerY - (ehei/2) - offset,ewid,ehei) hg = ehei ehei = ehei - gap gap = gap + (gap * 0.35) If Math.Remainder(i,2) = 0 Then GraphicsWindow.BrushColor = "black" GraphicsWindow.PenColor = "black" Else GraphicsWindow.BrushColor = "yellow" GraphicsWindow.PenColor = "black" EndIf EndFor 'Draw the gandola '************************************************************************************ GraphicsWindow.BrushColor = "brown" GraphicsWindow.FillRectangle(centerX - 75,centerY + (blmHei/2) - offset - 5,150,20) GraphicsWindow.DrawRectangle(centerX - 75,centerY + (blmHei/2) - offset - 5,150,20) GraphicsWindow.DrawLine(centerX + 75, centerY + (blmHei/2) - offset + 5,centerX + 85, centerY + (blmHei/2) - offset + 5) GraphicsWindow.BrushColor = "lightblue" GraphicsWindow.FillRectangle(centerX - 73,centerY + (blmHei/2) - offset - 0,15,10) GraphicsWindow.DrawRectangle(centerX - 73,centerY + (blmHei/2) - offset - 0,15,10) GraphicsWindow.FillRectangle(centerX - 47,centerY + (blmHei/2) - offset - 0,30,10) GraphicsWindow.DrawRectangle(centerX - 47,centerY + (blmHei/2) - offset - 0,30,10) GraphicsWindow.FillRectangle(centerX - 4,centerY + (blmHei/2) - offset - 0,30,10) GraphicsWindow.DrawRectangle(centerX - 4,centerY + (blmHei/2) - offset - 0,30,10) GraphicsWindow.FillRectangle(centerX + 38,centerY + (blmHei/2) - offset - 0,30,10) GraphicsWindow.DrawRectangle(centerX + 38,centerY + (blmHei/2) - offset - 0,30,10) 'Final Setup '************************************************************************************ GraphicsWindow.FontName = "Courier New" GraphicsWindow.FontSize = 36 sep = ".............." disp = sep + msg + sep i = 1 EndSub 'DrawZeppelin Sub OnTimerTick bc = GraphicsWindow.BackgroundColor brc = GraphicsWindow.BrushColor pc = GraphicsWindow.PenColor i = i + 1 If i >= Text.GetLength(disp) - Text.GetLength(sep) Then i = 1 EndIf prt = Text.GetSubText(disp,i,text.GetLength(sep)) textcolor = "green" DispText() Program.Delay(150) textcolor = "yellow" DispText() Spin() GraphicsWindow.BackgroundColor = bc GraphicsWindow.BrushColor = brc GraphicsWindow.PenColor = pc GraphicsWindow.FontName = "Arrial" GraphicsWindow.FontSize = 14 GraphicsWindow.FontBold = true EndSub 'OnTimerTick Sub DispText GraphicsWindow.BrushColor = textcolor letpos = 24 For j=0 To 6 chr = Text.GetSubText(prt,j,1) fntSiz = 21 + (j * 3) GraphicsWindow.FontSize = fntSiz GraphicsWindow.DrawText(centerX - textoffset+(letpos),centerY - offset - ((24 + (j * 3))/2),chr) letpos = letpos + (fntsiz * 0.75) EndFor For j=7 To 1 Step -1 chr = Text.GetSubText(prt,(Text.GetLength(prt)-j),1) fntSiz = 21 + ((j - 1) * 3) GraphicsWindow.FontSize = fntsiz GraphicsWindow.DrawText(centerX - textoffset+(letpos),centerY - offset - ((24 + ((j - 1) * 3))/2),chr) letpos = letpos + (fntsiz * 0.75) EndFor EndSub Sub Spin GraphicsWindow.PenWidth = 0.5 If spinSwitch = 0 Then spinSwitch = 1 GraphicsWindow.BrushColor = bgColor GraphicsWindow.PenColor = bgColor '(centerX + 85), (centerY + (blmHei/2) - offset + 5) GraphicsWindow.FillTriangle((centerX + 85),(centerY + (blmHei/2) - offset + 5),(centerX + 85)-4,(centerY + (blmHei/2) - offset + 5)-9,(centerX + 85)+2,(centerY + (blmHei/2) - offset + 5)-9) GraphicsWindow.DrawTriangle((centerX + 85),(centerY + (blmHei/2) - offset + 5),(centerX + 85)-4,(centerY + (blmHei/2) - offset + 5)-9,(centerX + 85)+2,(centerY + (blmHei/2) - offset + 5)-9) GraphicsWindow.FillTriangle((centerX + 85),(centerY + (blmHei/2) - offset + 5),(centerX + 85)-2,(centerY + (blmHei/2) - offset + 5)+9,(centerX + 85)+4,(centerY + (blmHei/2) - offset + 5)+9) GraphicsWindow.DrawTriangle((centerX + 85),(centerY + (blmHei/2) - offset + 5),(centerX + 85)-2,(centerY + (blmHei/2) - offset + 5)+9,(centerX + 85)+4,(centerY + (blmHei/2) - offset + 5)+9) GraphicsWindow.BrushColor = "darkgray" GraphicsWindow.PenColor = "black" GraphicsWindow.FillTriangle((centerX + 85),(centerY + (blmHei/2) - offset + 5),(centerX + 85)-2,(centerY + (blmHei/2) - offset + 5)-9,(centerX + 85)+4,(centerY + (blmHei/2) - offset + 5)-9) GraphicsWindow.DrawTriangle((centerX + 85),(centerY + (blmHei/2) - offset + 5),(centerX + 85)-2,(centerY + (blmHei/2) - offset + 5)-9,(centerX + 85)+4,(centerY + (blmHei/2) - offset + 5)-9) GraphicsWindow.FillTriangle((centerX + 85),(centerY + (blmHei/2) - offset + 5),(centerX + 85)-4,(centerY + (blmHei/2) - offset + 5)+9,(centerX + 85)+2,(centerY + (blmHei/2) - offset + 5)+9) GraphicsWindow.DrawTriangle((centerX + 85),(centerY + (blmHei/2) - offset + 5),(centerX + 85)-4,(centerY + (blmHei/2) - offset + 5)+9,(centerX + 85)+2,(centerY + (blmHei/2) - offset + 5)+9) Else spinSwitch = 0 GraphicsWindow.BrushColor = bgColor GraphicsWindow.PenColor = bgColor GraphicsWindow.FillTriangle((centerX + 85),(centerY + (blmHei/2) - offset + 5),(centerX + 85)-2,(centerY + (blmHei/2) - offset + 5)-9,(centerX + 85)+4,(centerY + (blmHei/2) - offset + 5)-9) GraphicsWindow.DrawTriangle((centerX + 85),(centerY + (blmHei/2) - offset + 5),(centerX + 85)-2,(centerY + (blmHei/2) - offset + 5)-9,(centerX + 85)+4,(centerY + (blmHei/2) - offset + 5)-9) GraphicsWindow.FillTriangle((centerX + 85),(centerY + (blmHei/2) - offset + 5),(centerX + 85)-4,(centerY + (blmHei/2) - offset + 5)+9,(centerX + 85)+2,(centerY + (blmHei/2) - offset + 5)+9) GraphicsWindow.DrawTriangle((centerX + 85),(centerY + (blmHei/2) - offset + 5),(centerX + 85)-4,(centerY + (blmHei/2) - offset + 5)+9,(centerX + 85)+2,(centerY + (blmHei/2) - offset + 5)+9) GraphicsWindow.BrushColor = "darkgray" GraphicsWindow.PenColor = "black" GraphicsWindow.FillTriangle((centerX + 85),(centerY + (blmHei/2) - offset + 5),(centerX + 85)-4,(centerY + (blmHei/2) - offset + 5)-9,(centerX + 85)+2,(centerY + (blmHei/2) - offset + 5)-9) GraphicsWindow.DrawTriangle((centerX + 85),(centerY + (blmHei/2) - offset + 5),(centerX + 85)-4,(centerY + (blmHei/2) - offset + 5)-9,(centerX + 85)+2,(centerY + (blmHei/2) - offset + 5)-9) GraphicsWindow.FillTriangle((centerX + 85),(centerY + (blmHei/2) - offset + 5),(centerX + 85)-2,(centerY + (blmHei/2) - offset + 5)+9,(centerX + 85)+4,(centerY + (blmHei/2) - offset + 5)+9) GraphicsWindow.DrawTriangle((centerX + 85),(centerY + (blmHei/2) - offset + 5),(centerX + 85)-2,(centerY + (blmHei/2) - offset + 5)+9,(centerX + 85)+4,(centerY + (blmHei/2) - offset + 5)+9) EndIf EndSub 'Spin End>GGV858.sb< Start>GGW510.sb< '************************************************************************** ' MUSICPLAYER: Play all MP3- and WMA-Files in MusicPath ' Microsoft Small Basic v0.8 ' Tested with Win XP, Vista and Win 7 ' ************************************************************************** ' Before use, copy the DLL-File from the ZIP-File ' http://cid-92f7df0e57232aba.skydrive.live.com/self.aspx/.Public/SmallBasic/MusicPlayTime/MusicPlayTime%20v0.8.zip ' in the Small Basic DLL-Directory '************************************************************************** ' Martin Menze ' Mail to martmen@gmx.de '************************************************************************** Event() 'Set Events Mouse and Timer SetData() 'Set Variables ShowPlayer() 'Show the player graphic SearchAllMusic() 'Search all music in MusicPath (defination in SetData) DoLoop() 'Loop to playing music Program.End() '************************************************************************** Sub Event ' Mouse Events GraphicsWindow.MouseDown = OnMouseDownEvent MouseDownEvent = 0 GraphicsWindow.MouseUp = OnMouseUpEvent MouseUpEvent = 0 GraphicsWindow.MouseMove = OnMouseMoveEvent MouseMoveEvent = 0 ' Timer Event Timer.Tick = OnTimerInput EndSub 'Event Sub OnMouseDownEvent MouseDownEvent = 1 EndSub 'OnMouseDownEvent Sub OnMouseUpEvent MouseUpEvent = 1 EndSub 'OnMouseUpEvent Sub OnMouseMoveEvent MouseMoveEvent = 1 EndSub 'OnMouseMoveEvent Sub SetData ' Play all MP3-Files in MusicPath and all subdirectories MusicPath = "C:\Users\Public\Music" RandomStatus = 0 'Status Random is off PauseStatus = 0 'Status Pause is off StatusPushButtonRandom = 0 'Push Button Random is not pressing StatusPushButtonPause = 0 'Push Button Pause is not pressing StatusPushButtonPrevious = 0 'Push Button Previous File is not pressing StatusPushButtonNext= 0 'Button 4 (next File) is not pressing LenghthMusicPath = Text.GetLength(MusicPath) CounterCharacterDraw = 0 MusicplayerHeight = 232 MusicplayerWidth = 905 EndSub 'SetData Sub ShowPlayer GraphicsWindow.Clear() GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 GraphicsWindow.CanResize = "True" GraphicsWindow.Height = MusicplayerHeight GraphicsWindow.Width = MusicplayerWidth GraphicsWindow.FontName = "Courier" GraphicsWindow.FontSize = 14 GraphicsWindow.FontBold = "True" GraphicsWindow.Title = "MUSICPLAYER " GraphicsWindow.BackgroundColor = "Black" GraphicsWindow.BrushColor = "Gainsboro" GraphicsWindow.FillRectangle (120, 22, 683, 98) GraphicsWindow.BrushColor = "DimGray" GraphicsWindow.FillRectangle (22, 122, 865, 90) GraphicsWindow.BrushColor = "WhiteSmoke" GraphicsWindow.FillRectangle (194, 137, 37, 24) GraphicsWindow.FillRectangle (359, 137, 37, 24) GraphicsWindow.FontName = "Courier" GraphicsWindow.FontSize = 20 GraphicsWindow.FontBold = "True" GraphicsWindow.DrawText(120, 132, "Zufall") GraphicsWindow.DrawText(285, 132, "Pause") GraphicsWindow.DrawText(435, 132, "Vorheriger") GraphicsWindow.DrawText(600, 132, "Nächster") ShowPushButtonRandom() ShowPushButtonPause() ShowPushButtonPrevious() ShowPushButtonNext() ShowRandomStatus() ShowPauseStatus() EndSub 'ShowPlayer Sub ShowPushButtonRandom GraphicsWindow.BrushColor = "DarkGray" GraphicsWindow.FillRectangle (126, 159, 48, 40) GraphicsWindow.BrushColor = "LightGray" GraphicsWindow.FillRectangle (130, 163, 40, 32) GraphicsWindow.BrushColor = "WhiteSmoke" GraphicsWindow.FillRectangle (136, 169, 28, 21) EndSub 'ShowPushButtonRandom Sub ShowPushButtonRandomPressing GraphicsWindow.BrushColor = "Gray" GraphicsWindow.FillRectangle (128, 161, 44, 36) EndSub 'ShowPushButtonRandomPressing Sub ShowPushButtonPause GraphicsWindow.BrushColor = "DarkGray" GraphicsWindow.FillRectangle (290, 159, 48, 40) GraphicsWindow.BrushColor = "LightGray" GraphicsWindow.FillRectangle (294, 162, 40, 32) GraphicsWindow.BrushColor = "WhiteSmoke" GraphicsWindow.FillRectangle (300, 169, 28, 21) EndSub 'ShowPushButtonPause Sub ShowPushButtonPausePressing GraphicsWindow.BrushColor = "Gray" GraphicsWindow.FillRectangle (292, 161, 44, 36) EndSub 'ShowPushButtonPausePressing Sub ShowPushButtonPrevious GraphicsWindow.BrushColor = "DarkGray" GraphicsWindow.FillRectangle (460, 159, 48, 40) GraphicsWindow.BrushColor = "LightGray" GraphicsWindow.FillRectangle (464, 163, 40, 32) GraphicsWindow.BrushColor = "WhiteSmoke" GraphicsWindow.FillRectangle (470, 169, 28, 21) EndSub 'ShowPushButtonPrevious Sub ShowPushButtonPreviousPressing GraphicsWindow.BrushColor = "Gray" GraphicsWindow.FillRectangle (462, 161, 44, 36) EndSub 'ShowPushButtonPreviousPressing Sub ShowPushButtonNext GraphicsWindow.BrushColor = "DarkGray" GraphicsWindow.FillRectangle (622, 159, 48, 40) GraphicsWindow.BrushColor = "LightGray" GraphicsWindow.FillRectangle (626, 163, 40, 32) GraphicsWindow.BrushColor = "WhiteSmoke" GraphicsWindow.FillRectangle (632, 169, 28, 21) EndSub 'ShowPushButtonNext Sub ShowPushButtonNextPressing GraphicsWindow.BrushColor = "Gray" GraphicsWindow.FillRectangle (624, 161, 44, 36) EndSub 'ShowPushButtonNextPressing Sub ShowRow1 GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(130, 30, 665, 22) GraphicsWindow.BrushColor = "WhiteSmoke" GraphicsWindow.DrawBoundText(130, 30, MusicplayerWidth-40, Row1) EndSub 'ShowRow1 Sub ShowRow2 GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(130, 60, 665, 22) GraphicsWindow.BrushColor = "WhiteSmoke" GraphicsWindow.DrawBoundText(130, 60, MusicplayerWidth-40, Row2) EndSub 'ShowRow2 Sub ShowRow3 GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(130, 90, 665, 22) GraphicsWindow.BrushColor = "WhiteSmoke" GraphicsWindow.DrawBoundText(130, 90, MusicplayerWidth-40, Row3) EndSub 'ShowRow3 Sub SearchAllMusic Row1 = "Suche Musikstücke" ShowRow1() Row2 = "" ShowRow2() Row3 = "" ShowRow3() Timer.Interval = 6000 DN = "" C3 = Clock.Time GraphicsWindow.DrawText(1, 1, Clock.Date) GraphicsWindow.DrawText(15, 20, C3) Stack.PushValue("DirStack", MusicPath) While (Stack.GetCount("DirStack") > 0) dir = Stack.PopValue("DirStack") ' The following line could be harmful and has been automatically commented. ' files = File.GetFiles(dir) For i = 1 To Array.GetItemCount(files) If (Text.EndsWith(files[i],".mp3") Or Text.EndsWith(files[i],".wma")) Then DN[Array.GetItemCount(DN)+1] = files[i] EndIf EndFor ' The following line could be harmful and has been automatically commented. ' subDir = File.GetDirectories(dir) For i = 1 To Array.GetItemCount(subDir) Stack.PushValue("DirStack",subDir[i]) EndFor EndWhile GraphicsWindow.DrawText(15,40,Clock.Time) Timer.Interval = 4800 Index = 0 IC = Array.GetItemCount(DN) playing = 1 EndSub 'SearchAllMusic Sub DoLoop While IC >= Index If (playing = 0) Then PlaySong() EndIf If (PauseStatus = 1) Then start = Clock.ElapsedMilliseconds-timePlayed EndIf ShowMusicTime() If (playTime >= playLength) Then playing = 0 EndIf If (MouseDownEvent = 1) Then OnMouseDown() MouseDownEvent = 0 EndIf If (MouseUpEvent = 1) Then OnMouseUp() MouseUpEvent = 0 EndIf If (MouseMoveEvent = 1) Then OnMouseMove() MouseMoveEvent = 0 EndIf EndWhile EndSub 'DoLoop Sub PlaySong Sound.Stop(LPath) If S3 = 0 Then If RandomStatus = 1 then Index = Math.GetRandomNumber(IC) Else Index = Index + 1 If Index > IC then Index = 1 Endif EndIf Else S3 = 0 Index = Index - 1 If Index < 1 Then Index = 1 Endif EndIf LPath = DN[Index] LE = Text.GetLength(LPath) Stelle = LE von = 0 While Stelle > von S = Text.GetSubText(LPath, Stelle, 1) If S = "\" then von = Stelle + 1 EndIf Stelle = Stelle - 1 EndWhile L = LE - von Titel = Text.GetSubText(LPath, von, L) Row1 = Text.GetSubText(Titel, 1, Text.GetIndexOf(Titel, " - ")) ShowRow1() Row2 = Text.GetSubText(Titel, 3+Text.GetIndexOf(Titel, " - "), LE) ShowRow2() ' The following line could be harmful and has been automatically commented. ' playLength = MusicFile.PlayTime(LPath) Sound.Play(LPath) playing = 1 start = Clock.ElapsedMilliseconds EndSub 'PlaySong Sub ShowMusicTime playTime = (Clock.ElapsedMilliseconds-start)/1000 min = Math.Floor(playTime/60) timeDisplay = min+":" sec = Math.Floor(Math.Remainder(playTime,60)) If (sec < 10) Then timeDisplay = timeDisplay+"0" EndIf timeDisplay = timeDisplay+sec lmin = Math.Floor(playLength/60) LengthTime = lmin+":" lsec = Math.Floor(Math.Remainder(playLength,60)) If (lsec < 10) Then LengthTime = LengthTime+"0" EndIf LengthTime = LengthTime+lsec Row3 = timeDisplay Row3= Text.Append(Row3, " / ") Row3 = Text.Append(Row3, LengthTime) ShowRow3() ShowClock() EndSub 'ShowMusicTime Sub OnMouseUp If RandomStatus = 1 Then RandomStatus = 0 ShowPushButtonRandom() ChangeRandomStatus() EndIF If PauseStatus = 1 Then PauseStatus = 0 ShowPushButtonPause() ChangePauseStatus() EndIf If S3 = 1 Then ShowPushButtonPrevious() Sound.Stop(LPath) PlaySong() EndIf If S4 = 1 Then S4 = 0 ShowPushButtonNext() Sound.Stop(LPath) PlaySong() EndIf EndSub 'OnMouseUp Sub OnMouseDown If Mouse.IsLeftButtonDown = "True" Then IF MPY < 201 Then IF MPY > 159 Then CheckButton() EndIf EndIf EndIf If Mouse.IsRightButtonDown = "True" Then ' do nothing Endif EndSub 'OnMouseDown Sub OnMouseMove MPX = GraphicsWindow.MouseX MPY = GraphicsWindow.MouseY EndSub 'OnMouseMove Sub OnTimerInput ShowClock() ShowWorkprogress() EndSub 'OnTimerInput Sub ShowClock GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(810,20,90,20) GraphicsWindow.BrushColor = "WhiteSmoke" GraphicsWindow.DrawText(810,20,Clock.Time) Program.Delay(60) 'do not flickering EndSub 'ShowClock Sub ShowWorkProgress Char1 = Char1 + "­­·" Row3 = Char1 ShowRow3() CounterCharacterDraw1 = CounterCharacterDraw1 + 1 If (CounterCharacterDraw1 > 120) Then Char1 = "" CounterCharacterDraw1 = 0 CounterCharacterDraw2 = CounterCharacterDraw2 + 1 Char2 = Char2 + "■" Row2 = Char2 ShowRow2() EndIf If (CounterCharacterDraw2 > 37) Then Char2 = "" CounterCharacterDraw2 = 0 EndIf EndSub 'ShowWorkProgress Sub CheckButton If MPX < 171 Then If MPX > 129 Then ShowPushButtonRandomPressing() StatusPushButtonRandom = 1 EndIf EndIf If MPX < 334 Then If MPX > 292 Then ShowPushButtonPausePressing() StatusPushButtonPause = 1 EndIf EndIf If MPX < 504 Then If MPX > 462 Then ShowPushButtonPreviousPressing() StatusPushButtonPrevious = 1 EndIf EndIf If MPX < 667 Then If MPX > 625 Then ShowPushButtonNextPressing() StatusPushButtonNext = 1 EndIf EndIf EndSub 'CheckButton Sub ChangeRandomStatus If RandomStatus = 1 Then RandomStatus = 0 ShowRandomStatus() Else RandomStatus = 1 ShowRandomStatus() EndIf EndSub 'ChangeRandomStatus Sub ChangePauseStatus If PauseStatus = 0 Then PauseStatus = 1 Sound.Pause(LPath) ShowPauseStatus() timePlayed = Clock.ElapsedMilliseconds-start Else PauseStatus = 0 Sound.Play(LPath) ShowPauseStatus() EndIf EndSub 'ChangePauseStatus Sub ShowRandomStatus If RandomStatus = 1 Then GraphicsWindow.BrushColor = "WhiteSmoke" GraphicsWindow.FillRectangle(195, 138, 35, 22) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawBoundText(195, 137, MusicplayerWidth-40, "An") GraphicsWindow.BrushColor = "WhiteSmoke" Else GraphicsWindow.BrushColor = "WhiteSmoke" GraphicsWindow.FillRectangle(195, 138, 35, 22) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawBoundText(195, 137, MusicplayerWidth-40, "Aus") GraphicsWindow.BrushColor = "WhiteSmoke" EndIf EndSub 'ShowRandomStatus Sub ShowPauseStatus If PauseStatus = 1 Then GraphicsWindow.BrushColor = "WhiteSmoke" GraphicsWindow.FillRectangle(360, 138, 35, 22) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawBoundText(360, 137, MusicplayerWidth-40, "An") GraphicsWindow.BrushColor = "WhiteSmoke" Else GraphicsWindow.BrushColor = "WhiteSmoke" GraphicsWindow.FillRectangle(360, 138, 35, 22) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawBoundText(360, 137, MusicplayerWidth-40, "Aus") GraphicsWindow.BrushColor = "WhiteSmoke" Endif EndSub 'ShowPauseStatus End>GGW510.sb< Start>GGW720.sb< GraphicsWindow.BackgroundColor="darkblue dw=desktop.Width dh=desktop.Height GraphicsWindow.width=dw GraphicsWindow.Height=dh GraphicsWindow.Top=0 GraphicsWindow.Left=0 view3D = LD3DView.AddView(dw,dh,"True") LD3DView.AddSpotLight (view3D,"white",1 1 1, -1,-1,1 30, 10) LD3DView.AddDirectionalLight (view3D,"white" ,-1,-1,-1) LD3DView.AutoControl2 (1 1) ii=ImageList.LoadImage("e:\fbbl.png") For z=0 To 2 For ff=0 To 2 For f=0 To 2 cc[f][ff][z]=LD3DView.AddSphere (view3D 1 20 "red" "d") LD3DView.AddImage(view3D cc[f][ff][z] "" ii "D") LD3DView.TranslateGeometry (view3D cc[f][ff][z] ff*2.5 z*2.5 f*2.5) EndFor EndFor EndFor GraphicsWindow.Title="3D football balls While "true For y=1 To 360 Step 3 For z=0 to 2 For ff=0 To 2 For f=0 To 2 ss= LDMath.Sin(y+f*30+ff*60+z*90)/3+1.2 LD3DView.ScaleGeometry (view3D cc[f][ff][z] ss ss ss) EndFor EndFor EndFor Program.Delay (33) EndFor Endwhile End>GGW720.sb< Start>GGX419.sb< cc[1]="..##.. ### . ###. ### .####. #### . # . ## .# # ### # # # ### ## #### ##### # ## # ## ## # #. ###...###.. # # .# #.# #.# # cc[2]=".# #. # # .# . # # .### . ### . # . # # .# # # #### # ### # # # # . # # ## # # # ## . # #..# #. # # .# # ### ##### cc[3]=".####. # # .# . # # .# . # . # . # # .# # # # # # # # # # ## # # . # # # # # # # . ### ..### . # # .# # # # # # cc[4]=".# #. ### . ###. ### .####. # . # . ## . ## ### # # ## ### # # #### # . #### # # # # # #. # ..# #. # . # # # # # cc[5]=".....^.....^.....^.....^.....^.....^.....^.....^.....^.....^.....^.....^.....^.....^.....^.....^.....^.....^.....^.....^.....^.....^.....^.....^.....^.....^ GraphicsWindow.PenWidth=0 GraphicsWindow.BackgroundColor="tan GraphicsWindow.BrushColor="darkblue GraphicsWindow.Width=1500 GraphicsWindow.Title="ZX Screen Hommage ix="ABCDEFIOUGHJSQZTLNMKPRVWXY " For yy=50 To 840 Step 28 TXTm=LDText.Split("THE QUICK BROWN FOX JUMPS OVER LAZY DOGS" " ") txt="" For w=1 To 70 m=Math.GetRandomNumber(8) If txtm[m]="" Then Else txt=txt+txtm[m]+" " txtm[m]="" EndIf EndFor tu= Text.ConvertToUpperCase(txt) For f=1 To 40 y=0 GraphicsWindow.BrushColor=LDColours.HSLtoRGB(240 .8 math.GetRandomNumber(5)/10) r=Shapes.AddRectangle(24 28) Shapes.Move(r (f*6)*4+20 yy ) GraphicsWindow.BrushColor="orange ldShapes.AnimateOpacity(r 750 5) LDShapes.SetShapeEvent(r) Program.Delay(5) For x=0 To 5 For y=0 To 4 n=x+6*(Text.GetIndexOf(ix text.GetSubText(tu f 1))-1)+1 If Text.GetSubText(cc[y] n 1)="#" Then e=shapes.AddRectangle(4 4) shapes.move(e (x+f*6)*4+20 y*4+yy ) EndIf EndFor EndFor EndFor EndFor zz=1 LDEvents.MouseWheel=mwww LDShapes.ShapeEvent=see Sub see ls=LDShapes.LastEventShape If LDShapes.LastEventType="MouseEnter" Then ldShapes.AnimateOpacity(ls 750 5) EndIf EndSub Sub mwww zz=zz+LDEvents.LastMouseWheelDelta/15 LDGraphicsWindow.Reposition(zz zz 0 zz*100 0) EndSub End>GGX419.sb< Start>GHB050.sb< GraphicsWindow.Width=1200 GraphicsWindow.Height=900 GraphicsWindow.BackgroundColor="tan GraphicsWindow.BrushColor="darkblue ll=LDList.CreateFromValues("0=0") GraphicsWindow.Title="Abacus prmm="2;3;5;7;11;13;17;19;23;29;31;37;41;43;47;53;59;61;67;71;73;79;83;89;97;101;103;107;109;113;127;131;137;139;149;151;157;163;167;173;179;181;191;193;197;199;211;223;227;229;233;239;241;251;257;263;269;271;277;281;283;293;307;311;313;317;331;337;347;349;353;359;367;373;379;383;389;397;401;409;419;421;431;433;439;443;449;457;461;463;467;479;487;491;499;503;509;521;523;541;547;557;563;569;571;577;587;593;599;601;607;613;617;619;631;641;643;647;653;659;661;673;677;683;691;701;709;719;727;733;739;743;751;757;761;769;773;787;797;809;811;821;823;827;829;839;853;857;859;863;877;881;883;887;907;911;919;929;937;941;947;953;967;971;977;983;991;997;1009;1013;1019;1021" pr= LDText.Split(prmm ";") oo= LDText.Split("7 11 13 17 19 21 23 29 30 31 32" " ") For y=1 To 32 For x=0 To 32 If x=0 Then GraphicsWindow.BrushColor="darkblue if Array.ContainsValue(oo y) Then GraphicsWindow.BrushColor="white endif GraphicsWindow.DrawText(x*33 y*23+5 y) Else GraphicsWindow.BrushColor="darkblue If x*y=y*y Then GraphicsWindow.BrushColor="red EndIf If x*y>=y*y Then ln=Text.GetLength(x*y)*2 if ln>6 Then ln=6 EndIf GraphicsWindow.DrawText(x*33 y*23+5 Text.GetSubTextToEnd(" "+x*y ln)) LDList.Add(ll x*y) Else nn=LDMath.FixDecimal( math.SquareRoot( x*y) 1) GraphicsWindow.BrushColor=LDColours.HSLtoRGB(nn*10 1 .5) GraphicsWindow.FillRectangle(x*33 y*23 33 23) If math.SquareRoot( x*y)-Math.Floor(math.SquareRoot( x*y))<0.001 Then nn1=Math.Floor(nn) GraphicsWindow.BrushColor="black" GraphicsWindow.DrawText(x*33+10 5+y*23 NN1) EndIf EndIf EndIf EndFor EndFor For x=1 To 1000 If LDList.Contains(ll x) Then Else If Array.ContainsValue(pr x) Then TextWindow.ForegroundColor="red" Else TextWindow.ForegroundColor="white" EndIf TextWindow.Write(x+"; ") c=c+1 EndIf EndFor TextWindow.Title=c End>GHB050.sb< Start>GHC861.sb< TextWindow.Title = "Produktmenge pro Zeit" TextWindow.BackgroundColor = "Gray" TextWindow.ForegroundColor = "Black" TextWindow.Clear() TextWindow.Cursortop = 3 TextWindow.CursorLeft = 5 TextWindow.Write(" Wieviele Produktionsstätten gibt es :") Prozahl = TextWindow.ReadNumber() TextWindow.ForegroundColor = "Blue" TextWindow.CursorTop = 8 TextWindow.CursorLeft =15 TextWindow.Write("Anzahl Minuten Sekunden ") TextWindow.ForegroundColor = "Black" ii = 0 While ii < Prozahl TextWindow.Cursortop = (ii + 10) i = ii+1 If ii < 9 Then TextWindow.CursorLeft = 5 TextWindow.Write("Haus"+ i +" :") Else TextWindow.CursorLeft = 4 TextWindow.Write("Haus"+ i +" :") EndIf ii = ii+1 EndWhile ' hier muß ein while mit Zähler hin für Zeile auch ein Zähler ' ii = 0 While ii < Prozahl TextWindow.ForegroundColor = "Yellow" TextWindow.CursorTop = 10 + ii TextWindow.CursorLeft =15 Anzahl[ii+1] = TextWindow.Read() TextWindow.CursorTop = 10 + ii TextWindow.CursorLeft =29 Minute[ii+1] = TextWindow.Read() TextWindow.CursorTop = 10 + ii TextWindow.CursorLeft =43 Sekunde[ii+1] = TextWindow.Read() ii = ii +1 EndWhile Ende = TextWindow.readkey() End>GHC861.sb< Start>GHH146.sb< 'TRIANGELdemo '[1] 452 - pause after first triangle draw '[A1] 788 - pause after Aim1 '[A2] 801 - pause after Aim2 '[A3] 814 - pause after Aim3 '[2] 885 - pause after drawing aim points just prior to drawing aim triangel '[3] 900 - pause after drawing Aim Triangle '[4] 955 - pause adter moving aim points '[5] 980 - pause after drawing new triangle FirstAlter=2 SecondAlter=3 ThirdAlter=1 InSizerFirst=3 InSizerSecond=1 InsizerThird=2 EndSizerFirst=1 EndSizerSecond=0 EndSizerThird=0 'OBTUSE 'SelectTriangle="LOS12>23" 'SelectTriangle="LOS12<23" 'SelectTriangle="ROS13>23" 'SelectTriangle="ROS13<23" 'SelectTriangle="CH" 'SelectTriangle="CL" 'SelectTriangle="CL12>23" 'SelectTriangle="CL12<23"'ACUTE 'SelectTriangle="LAS13>23" 'SelectTriangle="LAS13<23" 'SelectTriangle="RAS12>13" 'SelectTriangle="RAS12<13" 'SelectTriangle="CAL12>23" 'SelectTriangle="CAL12<23" 'RAS -- Right Acute 'CAL -- Centered Acute 'SelectTriangle="E" Swiftness=10 EndAlter=0 AlterRate=10 'DON'T RESET AlterRate=AlterRate*(.01) AlterRateOne=0 AlterRateOne=AlterRateOne*(.01) AlterRateTwo=0 AlterRateTwo=AlterRateTwo*(.01) e=15 e=e*(.01) 'DON'T RESET eOne=0 eOne=eOne*(.01) eTwo=0 eTwo=eTwo*(.01) ColorOne="Cyan" ColorTwo="Yellow" ColorThree="Green" Loops=1000 StopLoop=2 PausePoint=0 'Select Sequence of Point Alteration 'FirstAlter 'Second Alter 'ThirdAlter 'Select Sequence of Inside Resizing 'InsizerFirst 'InsizerSecond 'Insizer'Third 'Select Sequence of Endcycle Resizing 'EndSizerFirst 'EndSizerSecond 'EndSizerThird 'Select Percentage of Alteration 'AlterRate 'Select Precision of Equilibirum Percentege 'e 'Don't Change the Following! 'StopLoop 'PausePoint' 'END CALIBRATION '================================================= 'TRIANGEL Aimer 'All Rights Reserved 'Copywrite 2015 'Roger Jacques 'LINE NUMBERS 'Open Textbox @ 118 'ManualTriangle @ 186 'Random @ 206 'Preset Definitions @ 219 'Presets @ 297 'First Calculations @ 477 'Start Program @ 524 'Open Graphics Window @ 555 'Draw Triangle @ 576 'MidEdge Definitions @ 624 'Obtuse Selectors @ 658(removed) 'Acute Selectors @ 792(removed) 'Aim Point Definitions @ 916 'Aim Edge Definitions @ 986 'Aim Midpoints @ 1005 'Line/Length Definitions @ 1039 'Draw Aim Triangle @ 1078 'AlterPoints @ 1129 'Redefine Points @ 1184 'Redraw Triangle @ 1193 'Internal Resizing @ 1244 'CATCH @ 1326 'Final Resize @ 1360 'End Program @1450 '==Subs=============== 'Alter Subs @ 1473 'EndSizer One @ 1523 'EndSizer Two @ 1614 'EndSizer Three @ 1713 'FirstHeader @ 1808 'MidHeader @ 1887 'LasHeader @ 2080 'TextOne @ 2204 'TextTwo @ 2222 'TextThree @ 2246 'TextFour @ 2265 'TextFive @ 2284 'TextSix @ 2302 '====START!==================================== 'OPEN TEXTBOX LineOne: TextWindow.Title = "TRIANGELS" TextWindow.Left = 10 TextWindow.Top = 10 TextWindow.BackgroundColor = "Black" TextWindow.ForegroundColor = "White" TextWindow.WriteLine(" TRIANGELS") TextWindow.WriteLine("") TextWindow.WriteLine("NOTE: Some irregular triangles take 100 ") TextWindow.WriteLine("(or more) iterations to achieve equilibrium.") TextWindow.WriteLine("") TextWindow.WriteLine("Close this program at any time by tapping") TextWindow.WriteLine("the 'x' in this window's upper right corner.") TextWindow.WriteLine("") TextWindow.WriteLine("Start with [1]") TextWindow.WriteLine("") TextWindow.WriteLine("[1] Demo [2] New Triangle [3] Random Runs [4] Preset [5] End ") TextWindow.WriteLine("") TextWindow.Write("Select by [#]: ") SelectMode=TextWindow.Read() If SelectMode = 1 Then TextWindow.Clear() Runs=2 Turtle.Speed=10 SelectTriangle="LAS13<23" EndIf If SelectMode = 2 Then TextWindow.Clear() Runs=2 Turtle.Speed=10 SelectTriangle=2 EndIf If SelectMode = 3 Then TextWindow.Clear() TextWindow.WriteLine("A given triangle might take many iterations to normalize.") TextWindow.WriteLine("") TextWindow.WriteLine("Tap 'x' in upper right corner to exit.") TextWindow.WriteLine("") TextWindow.Write("Number of triangles to run: ") Runs=TextWindow.Read() SelectTriangle = 3 Turtle.Speed=10 EndIf TextWindow.WriteLine("") If SelectMode = 4 Then TextWindow.Clear() Runs=2 Turtle.Speed=10 SelectTriangle=4 EndIf If SelectMode = 5 Then Program.End() EndIf 'START TRIANGLE SELECTION For Run = 1 to Runs R=0 If Run = Runs Then TextWindow.Clear() Goto LineOne EndIf 'MANUAL If SelectTriangle=(2) Then TextWindow.WriteLine("Graphics screen is 800 pixels wide, 600 high.") TextWindow.WriteLine("") TextWindow.WriteLine("'X' = # of Pixels from Left Edge.") TextWindow.WriteLine("'Y' = # of Pixels from Top.") TextWindow.WriteLine(" ") TextWindow.Write("Point1X? ") Point1X = TextWindow.Read() TextWindow.Write("Point1Y? ") Point1Y = TextWindow.Read() TextWindow.Write("Point2X? ") Point2X = TextWindow.Read() TextWindow.Write("Point2Y? ") Point2Y= TextWindow.Read() TextWindow.Write("Point3X? ") Point3X = TextWindow.Read() TextWindow.Write("Point3Y? ") Point3Y= TextWindow.Read() EndIf 'RANDOM If SelectTriangle=(3) Then Point1X=(Math.GetRandomNumber(400)+200) Point1Y=(Math.GetRandomNumber(400)+100) Point2X=(Math.GetRandomNumber(400)+200) Point2Y=(Math.GetRandomNumber(400)+100) Point3X=(Math.GetRandomNumber(400)+200) Point3Y=(Math.GetRandomNumber(400)+100) EndIf If SelectTriangle=(4) Then 't------------- 'TextWindow.WriteLine("Select a Preset Triangle by [#]") 'TextWindow.WriteLine(" ") TextWindow.WriteLine(" PRESET TRIANGLES") TextWindow.WriteLine("") TextWindow.WriteLine("NOTE: EP*P* means the edge between those two points.") TextWindow.WriteLine("") TextWindow.WriteLine("OBTUSE") TextWindow.WriteLine(" [1] LOS12>23 Left Obtuse EP1P2 > EP2P3") TextWindow.WriteLine(" [2] LOS12<23 Left Obtuse EP1P2 < EP2P3") TextWindow.WriteLine(" [3] ROS13>23 Right Obtuse EP1P3 > EP2P3") TextWindow.WriteLine(" [4] ROS13<23 Right Obtuse EP1P3 < EP2P3") TextWindow.WriteLine(" [5] CH Raised Centered Apex Equal Sides") TextWindow.WriteLine(" [6] CL Lowered Centered Apex Equal Sides") TextWindow.WriteLine(" [7] CL12>23 Centered/Lowered EP1P2 > EP2P3") TextWindow.WriteLine(" [8] CL12<23 Centered/Lowered EP1P@ < EP2P3") TextWindow.WriteLine("ACUTE") TextWindow.WriteLine(" [9] LAS13>23 Left Acute EP1P3 > EP2P3") TextWindow.WriteLine(" [10] LAS13<23 Left Acute EP1P3 < EP2P3") TextWindow.WriteLine(" [11] RAS12>13 Right Acute EP1P2 > EP1P3") TextWindow.WriteLine(" [12] RAS12<13 Right Acute EP1P2 < EP1P3") TextWindow.WriteLine(" [13] CAL12>23 Centered Acute EP1P2 > EP2P3") TextWindow.WriteLine(" [14] CAL12<23 Centered Acute EP1P2 < EP2P3") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") TextWindow.Write("Select a Preset Triangle by [#] ") Preset = TextWindow.Read() If Preset=1 Then SelectTriangle="LOS12>23" EndIf If Preset=2 Then SelectTriangle="LOS12<23" Endif If Preset=3 Then SelectTriangle="ROS13>23" Endif If Preset=4 Then SelectTriangle="ROS13<23" Endif If Preset=5 Then SelectTriangle="CH" EndIf If Preset=6 Then SelectTriangle="CL" EndIf If Preset=7 Then SelectTriangle="CL12>23" Endif If Preset=8 Then SelectTriangle="CL12<23"' Endif If Preset=9 Then SelectTriangle="LAS13>23" Endif If Preset=10 Then SelectTriangle="LAS13<23" EndIf If Preset=11 Then SelectTriangle="RAS12>13" Endif If Preset=12 Then SelectTriangle="RAS12<13" Endif If Preset=13 Then SelectTriangle="CAL12>23" Endif If Preset=14 Then SelectTriangle="CAL12<23" EndIf EndIf 't------------- 'PRESET If SelectTriangle="E" Then 'Regular Point1X=150 Point1Y=500 Point2X=400 Point2Y=100 Point3X=650 Point3Y=500 'LEFT OBTUSE ElseIf SelectTriangle="LOS12>23" Then 'Left Obtuse E12 > E23 Point1X=250 Point1Y=500 Point2X=150 Point2Y=100 Point3X=650 Point3Y=500 ElseIf SelectTriangle="LOS12<23" Then 'Left Obtuse 12 < E23 Point1X=250 Point1Y=500 Point2X=200 Point2Y=300 Point3X=550 Point3Y=500 'RIGHT OBTUSE ElseIf SelectTriangle="ROS13<23" Then 'Right Obtuse E12 < E23 Point1X=250 Point1Y=500 Point2X=550 Point2Y=200 Point3X=450 Point3Y=500 ElseIf SelectTriangle="ROS13>23" Then 'Right Obtuse E13 > E23 Point1X=250 Point1Y=500 Point2X=550 Point2Y=400 Point3X=450 Point3Y=500 'CENTERED OBTUSE ElseIf SelectTriangle="CH" Then 'Centered High Point1X=300 Point1Y=500 Point2X=400 Point2Y=50 Point3X=550 Point3Y=500 ElseIf SelectTriangle="CL" Then 'Centered Low Point1X=150 Point1Y=500 Point2X=400 Point2Y=450 Point3X=650 Point3Y=500 ElseIf SelectTriangle="CL12>23" Then 'Centered Low E12 > E23 Point1X=150 Point1Y=500 Point2X=500 Point2Y=450 Point3X=650 Point3Y=500 ElseIf SelectTriangle="CL12<23" Then 'Centered Low E12 < E23 Point1X=150 Point1Y=500 Point2X=300 Point2Y=450 Point3X=650 Point3Y=500 '========End OBTUSE TRIANGLES================== '========Start ACUTE TRIANGLES================== ElseIf SelectTriangle="E" Then 'Regular Point1X=150 Point1Y=500 Point2X=400 Point2Y=100 Point3X=650 Point3Y=500 ElseIf SelectTriangle="LAS13>23" Then 'Left Acute 13>23 Point1X=150 Point1Y=500 Point2X=400 Point2Y=100 Point3X=600 Point3Y=400 ElseIf SelectTriangle="LAS13<23" Then 'Left Acute 13<23 Point1X=150 Point1Y=500 Point2X=400 Point2Y=100 Point3X=450 Point3Y=450 ElseIf SelectTriangle="RAS12>13" Then 'Right Acute 12>23 Point1X=300 Point1Y=450 Point2X=400 Point2Y=100 Point3X=650 Point3Y=500 ElseIf SelectTriangle="RAS12<13" Then 'Right Acute 12<13 Point1X=200 Point1Y=400 Point2X=400 Point2Y=100 Point3X=650 Point3Y=500 ElseIf SelectTriangle="CAL12>23" Then 'Right Acute 12>23 Point1X=150 Point1Y=500 Point2X=450 Point2Y=150 Point3X=650 Point3Y=500 ElseIf SelectTriangle="CAL12<23" Then 'Right Acute 12<23 Point1X=150 Point1Y=500 Point2X=350 Point2Y=200 Point3X=650 Point3Y=500 EndIf 'END TRIANGLE SELECTION 'CALIBRATE ORIGINAL Points, Edges & Centroid EP1P2=((Point2X-Point1X)*(Point2X-Point1X))+((Point2Y-Point1Y)*(Point2Y-Point1Y)) EdgeP1P2=Math.SquareRoot(EP1P2) EdgeP1P2int=(Math.Floor(EdgeP1P2)) EP1P3=((Point3X-Point1X)*(Point3X-Point1X))+((Point3Y-Point1Y)*(Point3Y-Point1Y)) EdgeP1P3=Math.SquareRoot(EP1P3) EdgeP1P3int=(Math.Floor(EdgeP1P3)) EP2P3=((Point3X-Point2X)*(Point3X-Point2X))+((Point3Y-Point2Y)*(Point3Y-Point2Y)) EdgeP2P3=Math.SquareRoot(EP2P3) EdgeP2P3int=(Math.Floor(EdgeP1P3)) 'Start Perimeter PerimeterBase = EdgeP1P2 + EdgeP1P3 + EdgeP2P3 PerimeterBaseint = (Math.Floor(PerimeterBase)) 'Start Edges StartEdgeP1P2 = EdgeP1P2 StartEdgeP1P2Int=Math.Floor(StartEdgeP1P2) StartEdgeP1P3 = EdgeP1P3 StartEdgeP1P3Int=Math.Floor(StartEdgeP1P3) StartEdgeP2P3 = EdgeP2P3 StartEdgeP2P3Int=Math.Floor(StartEdgeP2P3) 'Start Points StartPoint1X=Point1X StartPoint1Xint=Math.Floor(Point1X) StartPoint1Y=Point1Y StartPoint1Yint=Math.Floor(Point1Y) StartPoint2X=Point2X StartPoint2Xint=Math.Floor(Point2X) StartPoint2Y=Point2Y StartPoint2Yint=Math.Floor(Point2Y) StartPoint3X=Point3X StartPoint3Xint=Math.Floor(Point3X) StartPoint3Y=Point3Y StartPoint3Yint=Math.Floor(Point3Y) 'Start Centroid StartCentroidPX = ((Point1X+Point2X+Point3X)/3) StartCentroidPXint = (Math.Floor(StartCentroidPX)) StartCentroidPY = ((Point1Y+Point2Y+Point3Y)/3) StartCentroidPYint = (Math.Floor(StartCentroidPY)) 'END CALIBRATE ORIGINAL Points, Edges & Centroid '==========START PROGRAM============ LoopMarker=1 ReLoop: For Loop = LoopMarker To Loops LoopShapeNumber=LoopShapeNumber+1 If Loop=1 Then StartTime = (Clock.ElapsedMilliseconds) StartLoopTime = StartTime EndIf StartLoopTime = (Clock.ElapsedMilliseconds) ElapsedTime = EndLoopTime-StartTime ElapsedTimeint = (Math.Floor(ElapsedTime)) ElapsedLoopTime = EndLoopTime-StartLoopTime ElapsedLoopTimeint = (Math.Floor(ElapsedLoopTime)) 'CALIBRATE START-LOOP EDGES EP1P2=((Point2X-Point1X)*(Point2X-Point1X))+((Point2Y-Point1Y)*(Point2Y-Point1Y)) EdgeP1P2=Math.SquareRoot(EP1P2) EdgeP1P2int=(Math.Floor(EdgeP1P2)) EP1P3=((Point3X-Point1X)*(Point3X-Point1X))+((Point3Y-Point1Y)*(Point3Y-Point1Y)) EdgeP1P3=Math.SquareRoot(EP1P3) EdgeP1P3int=(Math.Floor(EdgeP1P3)) EP2P3=((Point3X-Point2X)*(Point3X-Point2X))+((Point3Y-Point2Y)*(Point3Y-Point2Y)) EdgeP2P3=Math.SquareRoot(EP2P3) EdgeP2P3int=(Math.Floor(EdgeP1P3)) Perimeter = EdgeP1P2 + EdgeP1P3 + EdgeP2P3 Perimeterint = (Math.Floor(PerimeterBase)) 'DEFINE GRAPHICS WINDOW GraphicsWindow.Show() GraphicsWindow.Clear() GraphicsWindow.Width = 800 GraphicsWindow.Height = 600 GraphicsWindow.Top = 60 GraphicsWindow.Left = 500 GraphicsWindow.Title = "TRIANGEL Demo" GraphicsWindow.FontSize=3 Turtle.Speed = 10 If Loop=1 Then Speed=9 TextOne() Else Speed=10 EndIF GraphicsWindow.BrushColor="Cyan" Shapes.AddTriangle(Point1X, Point1Y, Point2X, Point2Y, Point3X, Point3Y) GraphicsWindow.PenColor="Black" GraphicsWindow.PenWidth=8 If Loop=1 And Run=1 Then Turtle.Speed=9 Else Turtle.Speed=10 Endif FirstHeader() Turtle.PenDown() Turtle.X=(Point1X) Turtle.Y=(Point1y) Turtle.MoveTo(Point2X, Point2Y) Turtle.MoveTo(Point3X, Point3Y) Turtle.MoveTo(Point1X, Point1Y) GraphicsWindow.PenColor="Black" GraphicsWindow.PenWidth=3 '[1] Pause after First Triangle Draw If Loop=1 And Run=1 Then TextWindow.Pause() TextWindow.Clear() Endif Turtle.PenUp() Turtle.Speed=10 'GraphicsWindow.Clear() Shapes.HideShape(ShapeTRIANGELOne) If Loop=1 And Run=1 Then Speed=10 TextTwo() Else Speed=10 EndIF '====FIRST HEADER===== FirstHeader() '==================== 'Start MidEdge Definitions Turtle.X=(Point1X) Turtle.Y=(Point1Y) Turtle.PenUp() Turtle.MoveTo(Point2X, Point2Y) Turtle.Turn(180) Turtle.Move((EdgeP1P2/2)) MidEP1P2X=(Turtle.X) MidEP1P2Y=(Turtle.Y) MidEP1P2Xint=Math.Floor(MidEP1P2X) MidEP1P2Yint=Math.Floor(MidEP1P2Y) Turtle.X=(Point1X) Turtle.Y=(Point1Y) Turtle.MoveTo(Point3X, Point3Y) Turtle.Turn(180) Turtle.Move((EdgeP1P3/2)) MidEP1P3X=(Turtle.X) MidEP1P3Y=(Turtle.Y) MidEP1P3Xint=Math.Floor(MidEP1P3X) MidEP1P3Yint=Math.Floor(MidEP1P3Y) Turtle.X=(Point2X) Turtle.Y=(Point2Y) Turtle.MoveTo(Point3X, Point3Y) Turtle.Turn(180) Turtle.Move((EdgeP2P3/2)) MidEP2P3X=(Turtle.X) MidEP2P3Y=(Turtle.Y) MidEP2P3Xint=Math.Floor(MidEP2P3X) MidEP1P2Yint=Math.Floor(MidEP2P3Y) Turtle.PenDown() 'Change speed after midpoints' Turtle.Speed=10 'End MidEdge Definitions 'Start Aim Point Definitions Turtle.PenUp() Turtle.X=(Point1X) Turtle.Y=(Point1Y) Turtle.MoveTo(Point2X, Point2Y) Turtle.MoveTo(Point3X, Point3Y) Turtle.MoveTo(Point1X, Point1Y) Turtle.PenDown() If Loop=1 And Run=1 Then Turtle.Speed=9 GraphicsWindow.Clear() GraphicsWindow.BrushColor="Cyan" Shapes.AddTriangle(Point1X, Point1Y, Point2X, Point2Y, Point3X, Point3Y) Else Turtle.Speed=10 EndIf ' (1)23 Turtle.X=(Point2X) Turtle.Y=(Point2y) Turtle.MoveTo(Point3X, Point3Y) Turtle.Turn(-120) Turtle.Move(EdgeP2P3) AimPointLeft1X=Turtle.X AimPointLeft1Y=Turtle.Y Turtle.MoveTo(Point2X, Point2Y) Turtle.MoveTo(Point3X, Point3Y) Turtle.Turn(120) Turtle.Move(EdgeP2P3) AimPointRight1X=Turtle.X AimPointRight1Y=Turtle.Y Turtle.MoveTo(Point2X, Point2Y) '[A1] Stop at P1 Aim 'TextWindow.Pause() '1(2)3 Turtle.X=(Point1X) Turtle.Y=(Point1Y) Turtle.MoveTo(Point3X, Point3Y) Turtle.Turn(-120) Turtle.Move(EdgeP1P3) AimPointLeft2X=Turtle.X AimPointLeft2Y=Turtle.Y Turtle.MoveTo(Point1X, Point1Y) Turtle.MoveTo(Point3X, Point3Y) Turtle.Turn(120) Turtle.Move(EdgeP1P3) AimPointRight2X=Turtle.X AimPointRight2Y=Turtle.Y Turtle.MoveTo(Point1X, Point1Y) '[A2] Stop at P2 Aim 'TextWindow.Pause() '12(3) Turtle.X=(Point1X) Turtle.Y=(Point1Y) Turtle.MoveTo(Point2X, Point2Y) Turtle.Turn(-120) Turtle.Move(EdgeP1P2) AimPointLeft3X=Turtle.X AimPointLeft3Y=Turtle.Y Turtle.MoveTo(Point1X, Point1Y) Turtle.MoveTo(Point2X, Point2Y) Turtle.Turn(120) Turtle.Move(EdgeP1P2) AimPointRight3X=Turtle.X AimPointRight3Y=Turtle.Y Turtle.MoveTo(Point1X, Point1Y) AimHeader() 'Start TargetPoint Edge Definitions If Loop=1 And Run=1 Then Turtle.MoveTo(Point1X, Point1Y) 't-------- TextWindow.Pause() TextWindow.Clear() Shapes.HideShape(ShapeTriangelTwo1) Shapes.HideShape(ShapeTriangelTwo2) Shapes.HideShape(ShapeTriangelTwo3) TextThreeX() Endif Turtle.Speed=9 GraphicsWindow.PenColor="Yellow" 'Turtle.MoveTo(AimPoint1X, AimPoint1Y) Turtle.X=AimPointLeft1X Turtle.Y=AimPointLeft1Y Turtle.MoveTo(Point1X, Point1Y) Turtle.Turn(180) GraphicsWindow.PenWidth="15" GraphicsWindow.PenColor="Purple" Turtle.Move((EdgeP2P3*AlterRate)*((EdgeP1P2+EdgeP1P3)/Perimeter)) TargetLeft1X=Turtle.X TargetLeft1Y=Turtle.Y GraphicsWindow.PenWidth="3" GraphicsWindow.PenColor="Yellow" Turtle.X=AimPointRight1X Turtle.Y=AimPointRight1Y Turtle.MoveTo(Point1X, Point1Y) Turtle.Turn(180) GraphicsWindow.PenWidth="15" GraphicsWindow.PenColor="Purple" Turtle.Move((EdgeP2P3*AlterRate)*((EdgeP1P2+EdgeP1P3)/Perimeter)) TargetRight1X=Turtle.X TargetRight1Y=Turtle.Y Turtle.X=(Point1X) Turtle.Y=(Point1Y) GraphicsWindow.PenWidth="3" GraphicsWindow.PenColor="Yellow" 'Turtle.X=AimPointLeft2X 'Turtle.Y=AimPointLeft2Y Turtle.MoveTo(Point2X, Point2Y) Turtle.Turn(180) GraphicsWindow.PenWidth="15" GraphicsWindow.PenColor="Purple" Turtle.Move((EdgeP1P3*AlterRate)*((EdgeP1P2+EdgeP2P3)/Perimeter)) TargetLeft2X=Turtle.X TargetLeft2Y=Turtle.Y GraphicsWindow.PenWidth="3" GraphicsWindow.PenColor="Yellow" Turtle.X=AimPointRight2X Turtle.Y=AimPointRight2Y Turtle.MoveTo(Point2X, Point2Y) Turtle.Turn(180) GraphicsWindow.PenWidth="15" GraphicsWindow.PenColor="Purple" Turtle.Move((EdgeP1P3*AlterRate)*((EdgeP1P2+EdgeP2P3)/Perimeter)) TargetRight2X=Turtle.X TargetRight2Y=Turtle.Y GraphicsWindow.PenWidth="3" GraphicsWindow.PenColor="Yellow" Turtle.X=AimPointLeft3X Turtle.Y=AimPointLeft3Y Turtle.MoveTo(Point3X, Point3Y) Turtle.Turn(180) GraphicsWindow.PenWidth="15" GraphicsWindow.PenColor="Purple" Turtle.Move((EdgeP1P2*AlterRate)*((EdgeP1P3+EdgeP2P3)/Perimeter)) TargetLeft3X=Turtle.X TargetLeft3Y=Turtle.Y GraphicsWindow.PenWidth="3" GraphicsWindow.PenColor="Yellow"" Turtle.X=AimPointRight3X Turtle.Y=AimPointRight3Y Turtle.MoveTo(Point3X, Point3Y) Turtle.Turn(180) GraphicsWindow.PenWidth="15" GraphicsWindow.PenColor="Purple" Turtle.Move((EdgeP1P2*AlterRate)*((EdgeP1P3+EdgeP2P3)/Perimeter)) TargetRight3X=Turtle.X TargetRight3Y=Turtle.Y 'Start Target Edge Definitions TLeftEP1P2=((TargetLeft1X-Point1X)*(TargetLeft1X-Point1X))+((TargetLeft2Y-Point2Y)*(TargetLeft2Y-Point2Y)) TargetLeftEP1P2=Math.SquareRoot(TLeftEP1P2) TRightEP1P2=((TargetRight1X-Point1X)*(TargetRight1X-Point1X))+((TargetRight2Y-Point2Y)*(TargetRight2Y-Point2Y)) TargetRightEP1P2=Math.SquareRoot(TRightEP1P2) LeftEP1P3=((AimPointLeft1X-StartCentroidPX)*(AimPointLeft1X-StartCentroidPX))+((AimPointLeft3Y-StartCentroidPY)*(AimPointLeft3Y-StartCentroidPY)) AimLeftEP1P3=Math.SquareRoot(LeftEP1P3) RightEP1P3=((AimPointRight1X-StartCentroidPX)*(AimPointRight1X-StartCentroidPX))+((AimPointRight3Y-StartCentroidPY)*(AimPointRight3Y-StartCentroidPY)) AimRightEP1P3=Math.SquareRoot(RightEP1P3) TLeftEP1P3=((TargetLeft1X-Point1X)*(TargetLeft1X-Point1X))+((TargetLeft3Y-Point3Y)*(TargetLeft3Y-Point3Y)) TargetLeftEP1P3=Math.SquareRoot(TLeftEP1P3) TRightEP1P3=((TargetRight1X-Point1X)*(TargetRight1X-Point1X))+((TargetRight3Y-Point3Y)*(TargetRight3Y-Point3Y)) TargetRightEP1P3=Math.SquareRoot(TRightEP1P3) LeftEP2P3=((AimPointLeft2X-StartCentroidPX)*(AimPointLeft2X-StartCentroidPX))+((AimPointLeft3Y-StartCentroidPY)*(AimPointLeft3Y-StartCentroidPY)) AimLeftEP2P3=Math.SquareRoot(LeftEP2P3) RightEP2P3=((AimPointRight2X-StartCentroidPX)*(AimPointRight2X-StartCentroidPX))+((AimPointRight3Y-StartCentroidPY)*(AimPointRight3Y-StartCentroidPY)) AimRightEP2P3=Math.SquareRoot(RightEP2P3) TLeftEP2P3=((TargetLeft2X-Point2X)*(TargetLeft2X-Point2X))+((TargetLeft3Y-Point3Y)*(TargetLeft3Y-Point3Y)) TargetLeftEP2P3=Math.SquareRoot(TLeftEP2P3) TRightEP2P3=((TargetRight2X-Point2X)*(TargetRight2X-Point2X))+((TargetRight3Y-Point3Y)*(TargetRight3Y-Point3Y)) TargetLeftEP2P3=Math.SquareRoot(TLeftEP2P3) If (((TLeftEP1P2)+(TLeftEP2P3))/3) > (EdgeP1P3) then AimPoint2X=TargetLeft2X AimPoint2Y=TargetLeft2Y else AimPoint2X=TargetRight2X AimPoint2Y=TargetRight2Y EndIf If (((TLeftEP1P2)+(TLeftEP1P3))/3) > (EdgeP2P3) then AimPoint1X=TargetLeft1X AimPoint1Y=TargetLeft1Y else AimPoint1X=TargetRight1X AimPoint1Y=TargetRight1Y EndIf If (((TLeftEP1P3)+(TLeftEP2P3))/3) > (EdgeP1P2) then AimPoint3X=TargetLeft3X AimPoint3Y=TargetLeft3Y else AimPoint3X=TargetRight3X AimPoint3Y=TargetRight3Y EndIf 'End Aim Point Definitions ''Start Aim Edge Definitions Turtle.PenUp() AimEP1P2=((AimPoint2X-AimPoint1X)*(AimPoint2X-AimPoint1X))+((AimPoint2Y-AimPoint1Y)*(AimPoint2Y-AimPoint1Y)) AimEdgeP1P2=Math.SquareRoot(AimEP1P2) AimEdgeP1P2int=(Math.Floor(AimEdgeP1P2)) AimEP1P3=((AimPoint3X-AimPoint1X)*(AimPoint3X-AimPoint1X))+((AimPoint3Y-AimPoint1Y)*(AimPoint3Y-AimPoint1Y)) AimEdgeP1P3=Math.SquareRoot(AimEP1P3) AimEdgeP1P3int=(Math.Floor(AimEdgeP1P3)) AimEP2P3=((AimPoint3X-AimPoint2X)*(AimPoint3X-AimPoint2X))+((AimPoint3Y-AimPoint2Y)*(AimPoint3Y-AimPoint2Y)) AimEdgeP2P3=Math.SquareRoot(AimEP2P3) AimEdgeP2P3int=(Math.Floor(AimEdgeP1P3)) AimPerimeter = AimEdgeP1P2 + AimEdgeP1P3 + AimEdgeP2P3 AimPerimeterint = (Math.Floor(AimPerimeter)) 'End Aim Edge Definitions 'Start Aim Edge Midpoint Definitions Turtle.Speed=10 Turtle.X=(AimPoint1X) Turtle.Y=(AimPoint1Y) Turtle.MoveTo(AimPoint2X, AimPoint2Y) Turtle.Turn(180) Turtle.Move((AimEdgeP1P2/2)) MidAimEP1P2X=(Turtle.X) MidAimEP1P2Y=(Turtle.Y) MidAimEP1P2Xint=Math.Floor(MidAimEP1P2X) MidAimEP1P2Yint=Math.Floor(MidAimEP1P2Y) Turtle.X=(AimPoint1X) Turtle.Y=(AimPoint1Y) Turtle.MoveTo(AimPoint3X, AimPoint3Y) Turtle.Turn(180) Turtle.Move((AimEdgeP1P3/2)) MidAimEP1P2X=(Turtle.X) MidAimEP1P2Y=(Turtle.Y) MidAimEP1P2Xint=Math.Floor(MidAimEP1P2X) MidAimEP1P2Yint=Math.Floor(MidAimEP1P2Y) Turtle.X=(AimPoint2X) Turtle.Y=(AimPoint2Y) Turtle.MoveTo(AimPoint3X, AimPoint3Y) Turtle.Turn(180) Turtle.Move((AimEdgeP2P3/2)) MidAimEP2P3X=(Turtle.X) MidAimEP2P3Y=(Turtle.Y) MidAimEP2P3Xint=Math.Floor(MidAimEP2P3X) MidAimEP1P2Yint=Math.Floor(MidAimEP2P3Y) Turtle.PenDown() 'End Aim Edge MidPoint Definitions 'Start Line/Length Definitions LineEdgeP1P2=((Point2X-AimPoint1X)*(Point2X-AimPoint1X))+((Point2Y-AimPoint1Y)*(Point2Y-AimPoint1Y)) LineP1P2=Math.SquareRoot(LineedgeP1P2) LineP1P2int=(Math.Floor(LineP1P2)) LineEdgeP1P3=((Point3X-AimPoint1X)*(Point3X-AimPoint1X))+((Point3Y-AimPoint1Y)*(Point3Y-AimPoint1Y)) LineP1P3=Math.SquareRoot(LineEdgeP1P3) LineP1P3int=(Math.Floor(LineP1P3)) LineEdgeP2P3=((Point3X-AimPoint2X)*(Point3X-AimPoint2X))+((Point3Y-AimPoint2Y)*(Point3Y-AimPoint2Y)) LineP2P3=Math.SquareRoot(LineEdgeP2P3) LineP2P3int=(Math.Floor(LineP1P3)) Length = LineP1P2 + LineP1P3 + LineP2P3 Lengthint = (Math.Floor(Length)) 'End Line/Length Definitions '[2] Pause after Defining Aim Points and Defining Midlonts/Lengths If Loop=1 And Run=1 Then TextWindow.Pause() TextWindow.Clear() EndIf Turtle.Speed=10 Shapes.HideShape(ShapeTRIANGELTwo1) Shapes.HideShape(ShapeTRIANGELTwo2) If Loop=1 And Run=1Then Speed=10 Shapes.HideShape(ShapeTRIANGELThreeX1) Shapes.HideShape(ShapeTRIANGELThreeX2) GraphicsWindow.Clear() TargetHeader() TextThree() Else Speed=10 EndIf '====DRAW AIM TRIANGLE========== GraphicsWindow.PenColor="Purple" GraphicsWindow.PenWidth=8 Turtle.Speed=10 Turtle.X=(AimPoint1X) Turtle.Y=(AimPoint1y) Turtle.MoveTo(AimPoint2X, AimPoint2Y) Turtle.MoveTo(AimPoint3X, AimPoint3Y) Turtle.MoveTo(AimPoint1X, AimPoint1Y) Program.Delay(2000) GraphicsWindow.PenWidth=3 '[3] Pause After Drawing Aim Triangle If Loop=1 And Run=1 Then TextWindow.Pause() TextWindow.Clear() EndIf 'GraphicsWindow.Clear() Shapes.HideShape(ShapeTRIANGELThree) If Loop=1 And Run=1 Then TextFour() EndIF 'MidHeader GraphicsWindow.Clear() 'MidHeader() GraphicsWindow.PenColor=ColorOne GraphicsWindow.PenWidth=8 Turtle.Speed=10 Turtle.X=(Point1X) Turtle.Y=(Point1y) Turtle.MoveTo(Point2X, Point2Y) Turtle.MoveTo(Point3X, Point3Y) Turtle.MoveTo(Point1X, Point1Y) GraphicsWindow.PenColor="Black" GraphicsWindow.PenWidth=3 '======================== '==ALTERPOINT SEQUENCE=== Turtle.Speed=9 If FirstAlter=1 Then GraphicsWindow.PenColor=ColorTwo AlterOne() EndIf If FirstAlter=2 Then GraphicsWindow.PenColor=ColorTwo AlterTwo() EndIf If FirstAlter=3 Then GraphicsWindow.PenColor=ColorTwo AlterThree() EndIf If SecondAlter=1 Then GraphicsWindow.PenColor=ColorTwo AlterOne() EndIf If SecondAlter=2 Then GraphicsWindow.PenColor=ColorTwo AlterTwo() EndIf If SecondAlter=3 Then GraphicsWindow.PenColor=ColorTwo AlterThree() EndIf If ThirdAlter=1 Then GraphicsWindow.PenColor=ColorTwo AlterOne() EndIf If ThirdAlter=2 Then GraphicsWindow.PenColor=ColorTwo AlterTwo() EndIf If ThirdAlter=3 Then GraphicsWindow.PenColor=ColorTwo AlterThree() EndIf '[4] Pause after Aim Triangle Draw 'END ALTERPOINT SEQUENCES If Loop=1 And Run=1 Then TextWindow.Pause() TextWindow.Clear() 'EndIF 'REDEFINE POINTS Point1X=NEWPoint1X Point1Y=NEWPoint1Y Point2X=NEWPoint2X Point2Y=NEWPoint2Y Point3X=NEWPoint3X Point3Y=NEWPoint3Y 'REDRAW TRIANGLE GraphicsWindow.Clear() GraphicsWindow.PenColor="Blue" GraphicsWindow.PenWidth=8 Turtle.X=(Point1X) Turtle.Y=(Point1Y) Turtle.MoveTo(Point2X, Point2Y) Turtle.MoveTo(Point3X, Point3Y) Turtle.MoveTo(Point1X, Point1Y) InterimHeader() TextFive() TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("Elapsed Seconds After Loop " + Loop + " " + ElapsedLoopTime) Else 'LoopTime[Loop]=ElapsedLoopTime ElapsedLoopTime=StartTime-EndLoopTime ElapsedLoopTime=(Math.Abs(ElapsedLoopTime/1000)) ElapsedLoopTimeint = (Math.Floor(ElapsedLoopTime)) TextWindow.WriteLine("Elapsed Seconds After Loop " + Loop + " " + ElapsedLoopTime) 'TextWindow.Pause() ArcP1X[Loop]=Point1X ArcP1Y[Loop]=Point1Y ArcP2X[Loop]=Point2X ArcP2Y[Loop]=Point2Y ArcP3X[Loop]=Point3X ArcP3Y[Loop]=Point3Y LastHeader() GraphicsWindow.PenColor="Blue" Turtle.X=(Point1X) Turtle.Y=(Point1Y) Turtle.MoveTo(Point2X, Point2Y) Turtle.MoveTo(Point3X, Point3Y) Turtle.MoveTo(Point1X, Point1Y) EndIF Turtle.PenUp() '=========START RESIZER ZONE========= NEP1P2=((Point2X-Point1X)*(Point2X-Point1X))+((Point2Y-Point1Y)*(Point2Y-Point1Y)) NewEdgeP1P2=Math.SquareRoot(NEP1P2) NewEdgeP1P2int=(Math.Floor(NewEdgeP1P2)) NEP1P3=((Point3X-Point1X)*(Point3X-Point1X))+((Point3Y-Point1Y)*(Point3Y-Point1Y)) NewEdgeP1P3=Math.SquareRoot(NEP1P3) NewEdgeP1P3int=(Math.Floor(NewEdgeP1P3)) NEP2P3=((Point3X-Point2X)*(Point3X-Point2X))+((Point3Y-Point2Y)*(Point3Y-Point2Y)) NewEdgeP2P3=Math.SquareRoot(NEP2P3) NewEdgeP2P3int=(Math.Floor(NewEdgeP1P3)) NewPerimeter = NewEdgeP1P2+NewEdgeP1P3+NewEdgeP2P3 '=======START INTERNAL RESIZING============ IF InSizerFirst=1 Then R=0 EndSizerOne() MidHeader() EndIf IF InSizerFirst=2 Then R=0 EndSizerTwo() LastHeader() EndIf IF InSizerFirst=3 Then R=0 EndSizerThree() LastHeader() EndIf If InSizerSecond=1 Then R=0 EndSizerOne() LastHeader() EndIf If InSizerSecond=2 Then R=0 EndSizerTwo() LastHeader() EndIf If InSizerSecond=3 Then EndSizerThree() LastHeader() EndIf If InsizerThird=1 Then R=0 EndSizerOne() LastHeader() EndIf If InsizerThird=2 Then R=0 EndSizerTwo() LastHeader() EndIf If InsizerThird=3 Then R=0 EndSizerThree() LastHeader() EndIf '=======END RESIZING======= '===START RE-CENTROID====== NextCentroidPX = ((Point1X+Point2X+Point3X)/3) NextCentroidPXint = (Math.Floor(NextCentroidPX)) NextCentroidPY = ((Point1Y+Point2Y+Point3Y)/3) NextCentroidPYint = (Math.Floor(NextCentroidPY)) AlignPX = StartCentroidPX - NextCentroidPX AlignPY = StartCentroidPY - NextCentroidPY Turtle.MoveTo((Point1X+AlignPX), (Point1Y+AlignPY)) Point1X = Turtle.X Point1Y = Turtle.Y Turtle.MoveTo((Point2X+AlignPX), (Point2Y+AlignPY)) Point2X = Turtle.X Point2Y = Turtle.Y Turtle.MoveTo((Point3X+AlignPX), (Point3Y+AlignPY)) Point3X = Turtle.X Point3Y = Turtle.Y NextCentroidPX = ((Point1X+Point2X+Point3X)/3) NextCentroidPXint = (Math.Floor(NextCentroidPX)) NextCentroidPY = ((Point1Y+Point2Y+Point3Y)/3) NextCentroidPYint = (Math.Floor(NextCentroidPY)) '===END RECENTROID====== '========================= 'Temp -- DON'T CHANGE!! IF StopLoop=2 THEN 'Temp '==CATCH EQUAL EDGES======= AA=EdgeP1P2 BB=EdgeP2P3 CC=EdgeP1P3 IF ((AA+(AA*e))>=BB and (AA-(AA*e)) <=BB) And ((BB+(BB*e))>=AA and (BB-(BB*e)) <=AA) AND ((AA+(AA*e))>=CC and (AA-(AA*e)) <=CC) And ((CC+(CC*e))>=AA and (CC-(CC*e)) <=AA) AND ((CC+(CC*e))>=BB and (CC-(CC*e)) <=BB) And ((CC+(CC*e))>=BB and (CC-(CC*e)) <=BB) THEN If R=1 Then GraphicsWindow.Clear() GraphicsWindow.PenColor=ColorOne Turtle.PenDown() Turtle.X=(StartPoint1X) Turtle.Y=(StartPoint1Y) Turtle.MoveTo(StartPoint2X, StartPoint2Y) Turtle.MoveTo(StartPoint3X, StartPoint3Y) Turtle.MoveTo(StartPoint1X, StartPoint1Y) 't=============== 'The Arc GraphicsWindow.PenColor="White" Turtle.MoveTo(StartPoint1X, StartPoint1Y) For Arc = 2 to Loop GraphicsWindow.PenColor="Black" Turtle.MoveTo(ArcP1X[Arc], ArcP1Y[Arc]) EndFor Turtle.MoveTo(Point1X, Point1Y) GraphicsWindow.PenColor="White" Turtle.MoveTo(StartPoint2X, StartPoint2Y) For Arc = 2 to Loop GraphicsWindow.PenColor="Black" Turtle.MoveTo(ArcP2X[Arc], ArcP2Y[Arc]) EndFor Turtle.MoveTo(Point2X, Point2Y) GraphicsWindow.PenColor="White" Turtle.MoveTo(StartPoint3X, StartPoint3Y) For Arc = 2 to Loop GraphicsWindow.PenColor="Black" Turtle.MoveTo(ArcP3X[Arc], ArcP3Y[Arc]) EndFor Turtle.MoveTo(Point3X, Point3Y) 't=============== GraphicsWindow.PenColor="Black" Turtle.PenDown() Turtle.X=(Point1X) Turtle.Y=(Point1y) Turtle.MoveTo(Point2X, Point2Y) Turtle.MoveTo(Point3X, Point3Y) Turtle.MoveTo(Point1X, Point1Y) LastHeader() Shapes.HideShape(TriangelFive1) Shapes.HideShape(TriangelFive2) TextSix() TextWindow.WriteLine("!!!!!") 't================== If AlterRateOne > 0 And EndAlter = 0 Then EndAlter=1 AlterRate=AlterRateOne e=eOne TextWindow.WriteLine(AlterRate + " " + e) TextWindow.Pause() goto ReLoop ElseIf AlterRateTwo > 0 And EndAlter <> 2Then EndAlter=2 AlterRate=AlterRateTwo e=eTwo TextWindow.WriteLine(AlterRate + " " + e) Goto ReLoop EndIF 't================== TextWindow.Pause() Goto LineRun EndIf '======FINAL RESIZE======== If EndSizerFirst=1 Then EndSizerOne() LastHeader() If EndSizerSecond = 0 Then 'TextWindow.Pause() Goto LineRun EndIf EndIF If EndSizerFirst=2 Then EndsizerTwo() LastHeader() If EndSizerSecond = 0 Then 'TextWindow.Pause() Goto LineRun EndIf EndIf If EndSizerFirst=3 Then EndSizerThree() LastHeader() If EndSizerSecond = 0 Then 'TextWindow.Pause() Goto LineRun EndIf EndIf If EndSizerSecond=1 Then EndSizerOne() LastHeader() If EndSizerThird = 0 Then 'TextWindow.Pause() Goto LineRun EndIf EndIf If EndSizerSecond=2 Then EndSizerTwo() LastHeader() If EndSizerThird = 0 Then 'TextWindow.Pause() Goto LineRun EndIf EndIf If EndSizerSecond=3 Then EndSizerThree() LastHeader() If EndSizerThird = 0 Then 'TextWindow.Pause() Goto LineRun EndIf EndIf If EndSizerThird=1 Then EndsizerOne() LastHeader() 'TextWindow.Pause() Goto LineRun EndIf If EndSizerThird=2 Then EndSizerTwo() LastHeader() ' 'TextWindow.Pause() Goto LineRun EndIf If EndSizerThird=3 Then EndSizerThree() LastHeader() 'TextWindow.Pause() Goto LineRun EndIf '======END RESIZER ZONE======== 't--- TextSix() 't--- ENDIF ENDIF 'RECORD END LOOP MOMENT EndLoopTime = (Clock.ElapsedMilliseconds) ENDFOR 'TERMINATE LOOPS and START NEXT RUN LineRun: ENDFOR '==========END PROGRAM============ '================================== '==========SUBROUTINES============= 'START ALTERPOINTS SUBROUTINE Sub AlterOne Turtle.MoveTo(Point1X, Point1Y) Turtle.Turn(180) GraphicsWindow.PenColor=ColorThree GraphicsWindow.PenWidth="15" Turtle.Move((AimEdgeP2P3*AlterRate)*((EdgeP1P2+EdgeP1P3)/Perimeter)) NEWPoint1X=Turtle.X Point1Xint=(Math.Floor(NEWPoint1X)) NEWPoint1Y=Turtle.Y NEWPoint1Yint=(Math.Floor(NEWPoint1Y)) GraphicsWindow.PenColor=ColorTwo GraphicsWindow.PenWidth="3" EndSub Sub AlterTwo Turtle.MoveTo(AimPoint2X, AimPoint2Y) Turtle.MoveTo(Point2X, Point2Y) Turtle.Turn(180) GraphicsWindow.PenColor=ColorThree GraphicsWindow.PenWidth="15" Turtle.Move((AimEdgeP2P3*AlterRate)*((EdgeP1P2+EdgeP1P3)/Perimeter)) NEWPoint2X=Turtle.X Point2Xint=(Math.Floor(NEWPoint2X)) NEWPoint2Y=Turtle.Y NEWPoint2Yint=(Math.Floor(NEWPoint2Y)) GraphicsWindow.PenColor=ColorTwo GraphicsWindow.PenWidth="3" EndSub Sub AlterThree Turtle.MoveTo(AimPoint3X, AimPoint3Y) Turtle.MoveTo(Point3X, Point3Y) Turtle.Turn(180) GraphicsWindow.PenColor=ColorThree GraphicsWindow.PenWidth="15" Turtle.Move((AimEdgeP2P3*AlterRate)*((EdgeP1P2+EdgeP1P3)/Perimeter)) NEWPoint3X=Turtle.X Point3Xint=(Math.Floor(NEWPoint3X)) NEWPoint3Y=Turtle.Y NEWPoint3Yint=(Math.Floor(NEWPoint1Y)) GraphicsWindow.PenColor=ColorTwo GraphicsWindow.PenWidth="3" EndSub 'END ALTER POINTS SUBROUTINE 'START ENDSIZER- ONE SUBROUTINE Sub EndSizerOne If R=0 Then Point1X = NewPoint1X Point1Y = NewPoint1Y Point2X = NewPoint2X Point2Y = NewPoint2Y Point3X = NewPoint3X Point3Y = NewPoint3Y EdgeP1P2 = NewEdgeP1P2 EdgeP1P3 = NewEdgeP1P3 EdgeP2P3 = NewEdgeP2P3 NewPerimeter = EdgeP1P2 + EdgeP1P3 + EdgeP2P3 EndIf If R = 1 Then Point1X = LastPoint1X Point1Y = LastPoint1Y Point2X = LastPoint2X Point2Y = LastPoint2Y Point3X = LastPoint3X Point3Y = LastPoint3Y EdgeP1P2 = LastEdgeP1P2 EdgeP1P3 = LastEdgeP1P3 EdgeP2P3 = LastEdgeP2P3 NewPerimeter = LastPerimeter EndIF '====Redefine Resizer============== Resizer = PerimeterBase - Perimeter '============================= Turtle.MoveTo(Point1X, Point1Y) Turtle.MoveTo(Point2X, Point2Y) Turtle.Move(Resizer*(NEWEdgeP1P2/Perimeter)) Point2X=Turtle.X Point2Y=Turtle.Y Turtle.MoveTo(Point1X, Point1Y) Turtle.MoveTo(Point3X, Point3Y) Turtle.Move(Resizer*(NEWEdgeP1P3/Perimeter)) Point3X=Turtle.X Point3Y=Turtle.Y LastPoint1X=Point1X LastPoint1Xint=Math.Floor(LastPoint1X) LastPoint1Y=Point1Y LastPoint1Yint=Math.Floor(LastPoint1Y) LastPoint2X=Point2X LastPoint2Xint=Math.Floor(LastPoint2X) LastPoint2Y=Point2Y LastPoint2Yint=Math.Floor(LastPoint2Y) LastPoint3X=Point3X LastPoint3Xint=Math.Floor(LastPoint3X) LastPoint3Y=Point3Y LastPoint3Yint=Math.Floor(LastPoint3Y) GraphicsWindow.Clear() Turtle.MoveTo(Point1X, Point1Y) Turtle.MoveTo(Point2X, Point2Y) Turtle.MoveTo(Point3X, Point3Y) LastEP1P2=((Point2X-Point1X)*(Point2X-Point1X))+((Point2Y-Point1Y)*(Point2Y-Point1Y)) LastEdgeP1P2=Math.SquareRoot(LastEP1P2) LastEdgeP1P2int=(Math.Floor(LastEdgeP1P2)) LastEP1P3=((Point3X-Point1X)*(Point3X-Point1X))+((Point3Y-Point1Y)*(Point3Y-Point1Y)) LastEdgeP1P3=Math.SquareRoot(LastEP1P3) LastEdgeP1P3int=(Math.Floor(LastEdgeP1P3)) LastEP2P3=((Point3X-Point2X)*(Point3X-Point2X))+((Point3Y-Point2Y)*(Point3Y-Point2Y)) LastEdgeP2P3=Math.SquareRoot(LastEP2P3) LastEdgeP2P3int=(Math.Floor(LastEdgeP1P3)) LastPerimeter = LastEdgeP1P2+LastEdgeP1P3+LastEdgeP2P3 LastPerimeterInt = (Math.Floor(LastPerimeter)) Turtle.MoveTo(Point1X, Point1Y) Turtle.MoveTo(Point2X, Point2Y) Turtle.MoveTo(Point3X, Point3Y) R=1 EndSub 'END SIZER-ONE SUBROUTINE 'START SIZER- TWO SUBROUTINE Sub EndSizerTwo If R=0 Then Point1X = NewPoint1X Point1Y = NewPoint1Y Point2X = NewPoint2X Point2Y = NewPoint2Y Point3X = NewPoint3X Point3Y = NewPoint3Y EdgeP1P2 = NewEdgeP1P2 EdgeP1P3 = NewEdgeP1P3 EdgeP2P3 = NewEdgeP2P3 NewPerimeter = EdgeP1P2 + EdgeP1P3 + EdgeP2P3 EndIf If R = 1 Then Point1X = LastPoint1X Point1Y = LastPoint1Y Point2X = LastPoint2X Point2Y = LastPoint2Y Point3X = LastPoint3X Point3Y = LastPoint3Y EdgeP1P2 = LastEdgeP1P2 EdgeP1P3 = LastEdgeP1P3 EdgeP2P3 = LastEdgeP2P3 NewPerimeter = EdgeP1P2 + EdgeP1P3 + EdgeP2P3 EndIF '====Redefine Resizer================= Resizer = PerimeterBase - NewPerimeter '================================ Turtle.MoveTo(Point2X, Point2Y) Turtle.MoveTo(Point1X, Point1Y) Turtle.Move(Resizer*(NEWEdgeP1P2/Perimeter)) Point1X=Turtle.X Point1Y=Turtle.Y Turtle.MoveTo(Point2X, Point2Y) Turtle.MoveTo(Point3X, Point3Y) Turtle.Move(Resizer*(NEWEdgeP1P3/Perimeter)) Point3X=Turtle.X Point3Y=Turtle.Y LastPoint1X=Point1X LastPoint1Xint=Math.Floor(LastPoint1X) LastPoint1Y=Point1Y LastPoint1Yint=Math.Floor(LastPoint1Y) LastPoint2X=Point2X LastPoint2Xint=Math.Floor(LastPoint2X) LastPoint2Y=Point2Y LastPoint2Yint=Math.Floor(LastPoint2Y) LastPoint3X=Point3X LastPoint3Xint=Math.Floor(LastPoint3X) LastPoint3Y=Point3Y LastPoint3Yint=Math.Floor(LastPoint3Y) GraphicsWindow.Clear() Turtle.MoveTo(Point1X, Point1Y) Turtle.MoveTo(Point2X, Point2Y) Turtle.MoveTo(Point3X, Point3Y) LastEP1P2=((Point2X-Point1X)*(Point2X-Point1X))+((Point2Y-Point1Y)*(Point2Y-Point1Y)) LastEdgeP1P2=Math.SquareRoot(LastEP1P2) LastEdgeP1P2int=(Math.Floor(LastEdgeP1P2)) LastEP1P3=((Point3X-Point1X)*(Point3X-Point1X))+((Point3Y-Point1Y)*(Point3Y-Point1Y)) LastEdgeP1P3=Math.SquareRoot(LastEP1P3) LastEdgeP1P3int=(Math.Floor(LastEdgeP1P3)) LastEP2P3=((Point3X-Point2X)*(Point3X-Point2X))+((Point3Y-Point2Y)*(Point3Y-Point2Y)) LastEdgeP2P3=Math.SquareRoot(LastEP2P3) LastEdgeP2P3int=(Math.Floor(LastEdgeP1P3)) LastPerimeter = LastEdgeP1P2+LastEdgeP1P3+LastEdgeP2P3 LastPerimeterInt = (Math.Floor(LastPerimeter)) Turtle.MoveTo(Point1X, Point1Y) Turtle.MoveTo(Point2X, Point2Y) Turtle.MoveTo(Point3X, Point3Y) R=1 EndSub 'END SIZER-TWO SUBROUTINE 'START SIZER- THREE SUBROUTINE Sub EndSizerThree If R=0 Then Point1X = NewPoint1X Point1Y = NewPoint1Y Point2X = NewPoint2X Point2Y = NewPoint2Y Point3X = NewPoint3X Point3Y = NewPoint3Y EdgeP1P2 = NewEdgeP1P2 EdgeP1P3 = NewEdgeP1P3 EdgeP2P3 = NewEdgeP2P3 NewPerimeter = EdgeP1P2 + EdgeP1P3 + EdgeP2P3 '=====Redefine Resizer================ Resizer = PerimeterBase - NewPerimeter '================================ EndIf If R = 1 Then Point1X = LastPoint1X Point1Y = LastPoint1Y Point2X = LastPoint2X Point2Y = LastPoint2Y Point3X = LastPoint3X Point3Y = LastPoint3Y EdgeP1P2 = LastEdgeP1P2 EdgeP1P3 = LastEdgeP1P3 EdgeP2P3 = LastEdgeP2P3 NewPerimeter = EdgeP1P2 + EdgeP1P3 + EdgeP2P3 EndIf Turtle.MoveTo(Point1X, Point1Y) Turtle.MoveTo(Point2X, Point2Y) Turtle.Move(Resizer*(NEWEdgeP1P2/Perimeter)) Point2X=Turtle.X Point2Y=Turtle.Y Turtle.MoveTo(Point1X, Point1Y) Turtle.MoveTo(Point3X, Point3Y) Turtle.Move(Resizer*(NEWEdgeP1P3/Perimeter)) Point3X=Turtle.X Point3Y=Turtle.Y LastPoint1X=Point1X LastPoint1Xint=Math.Floor(LastPoint1X) LastPoint1Y=Point1Y LastPoint1Yint=Math.Floor(LastPoint1Y) LastPoint2X=Point2X LastPoint2Xint=Math.Floor(LastPoint2X) LastPoint2Y=Point2Y LastPoint2Yint=Math.Floor(LastPoint2Y) LastPoint3X=Point3X LastPoint3Xint=Math.Floor(LastPoint3X) LastPoint3Y=Point3Y LastPoint3Yint=Math.Floor(LastPoint3Y) GraphicsWindow.Clear() Turtle.MoveTo(Point1X, Point1Y) Turtle.MoveTo(Point2X, Point2Y) Turtle.MoveTo(Point3X, Point3Y) LastEP1P2=((Point2X-Point1X)*(Point2X-Point1X))+((Point2Y-Point1Y)*(Point2Y-Point1Y)) LastEdgeP1P2=Math.SquareRoot(LastEP1P2) LastEdgeP1P2int=(Math.Floor(LastEdgeP1P2)) LastEP1P3=((Point3X-Point1X)*(Point3X-Point1X))+((Point3Y-Point1Y)*(Point3Y-Point1Y)) LastEdgeP1P3=Math.SquareRoot(LastEP1P3) LastEdgeP1P3int=(Math.Floor(LastEdgeP1P3)) LastEP2P3=((Point3X-Point2X)*(Point3X-Point2X))+((Point3Y-Point2Y)*(Point3Y-Point2Y)) LastEdgeP2P3=Math.SquareRoot(LastEP2P3) LastEdgeP2P3int=(Math.Floor(LastEdgeP1P3)) LastPerimeter = LastEdgeP1P2+LastEdgeP1P3+LastEdgeP2P3 LastPerimeterInt = (Math.Floor(LastPerimeter)) Turtle.MoveTo(Point1X, Point1Y) Turtle.MoveTo(Point2X, Point2Y) Turtle.MoveTo(Point3X, Point3Y) R=1 EndSub 'END SIZER-THREE SUBROUTINE '=======HEADER SUBROUTINES===== 'START FIRSTHEADER SUBROUTINE Sub FirstHeader GraphicsWindow.Show() GraphicsWindow.Width = 800 GraphicsWindow.Height = 600 GraphicsWindow.Top = 60 GraphicsWindow.Left = 500 GraphicsWindow.Title = "TRIANGELS" GraphicsWindow.FontSize=15 GraphicsWindow.BrushColor="Black" Turtle.Speed = Swiftness If ClearHeader <> 1 Then 'Row One ShapeLoop=Shapes.AddText(LoopShapeNumber) Shapes.Move(ShapeLoop, 1, 1) Shapes.SetText(ShapeLoop, LoopShapeNumber) FirstLabel="Initial Variables" ShapeFirstLabel=Shapes.AddText(FirstLabel) Shapes.Move(ShapeFirstLabel, 30, 1) Shapes.SetText(ShapeFirstLabel, FirstLabel) 't===================================== 'Row TWO E12="E12" ShapeE12=Shapes.AddText(E12) Shapes.Move(ShapeE12, 10, 20) Shapes.SetText(ShapeE12, E12) E13="E13" ShapeE13=Shapes.AddText(E13) Shapes.Move(ShapeE13, 50, 20) Shapes.SetText(ShapeP1P3, E13) E23="E23" ShapeE23=Shapes.AddText(E23) Shapes.Move(ShapeE23, 100, 20) Shapes.SetText(ShapeE23, E23) PER="PERIM" ShapePER=Shapes.AddText(PER) Shapes.Move(ShapePER, 150, 20) Shapes.SetText(ShapePER, PER) P1X="P1X" ShapeP1X=Shapes.AddText(P1X) Shapes.Move(ShapeP1X, 225, 20) Shapes.SetText(ShapeP1X, P1X) P1Y="P1Y" ShapeP1Y=Shapes.AddText(P1Y) Shapes.Move(ShapeP1Y, 260, 20) Shapes.SetText(ShapeP1Y, P1Y) P2X="P2X" ShapeP2X=Shapes.AddText(P2X) Shapes.Move(ShapeP2X, 325, 20) Shapes.SetText(ShapeP2X, P2X) P2Y="P2Y" ShapeP2Y=Shapes.AddText(P2Y) Shapes.Move(ShapeP2Y, 360, 20) Shapes.SetText(ShapeP2Y, P2Y) P3X="P3X" ShapeP3X=Shapes.AddText(P3X) Shapes.Move(ShapeP3X, 425, 20) Shapes.SetText(ShapeP3X, P3X) P3Y="P3Y" ShapeP3Y=Shapes.AddText(P3Y) Shapes.Move(ShapeP3Y, 460, 20) Shapes.SetText(ShapeP3Y, P3Y) 'Row Three GraphicsWindow.BrushColor="Cyan" ShapeP1P2=Shapes.AddText(EdgeP1P2int) Shapes.Move(ShapeP1P2, 10, 40) Shapes.SetText(ShapeP1P2, EdgeP1P2int) ShapeP1P3=Shapes.AddText(EdgeP1P3int) Shapes.Move(ShapeP1P3, 50, 40) Shapes.SetText(ShapeP1P3, EdgeP1P3int) ShapeP2P3=Shapes.AddText(EdgeP2P3int) Shapes.Move(ShapeP2P3, 100, 40) Shapes.SetText(ShapeP2P3, EdgeP2P3int) Equals=" =" ShapeEquals=Shapes.AddText(Equals) Shapes.Move(ShapeEquals, 130, 40) Shapes.SetText(ShapeEquals, Equals) Perimeter=EdgeP1P2+EdgeP1P3+EdgeP2P3 Perimeterint=(Math.Floor(Perimeter)) ShapePerimeter=Shapes.AddText(Perimeterint) Shapes.Move(ShapePerimeter, 150, 40) Shapes.SetText(ShapePerimeter, Perimeterint) ShapeStartP1X=Shapes.AddText(StartPoint1Xint) Shapes.Move(ShapeStartP1X, 225, 40) Shapes.SetText(ShapeStartP1X, StartPoint1Xint) ShapeStartP1Y=Shapes.AddText(StartPoint1Yint) Shapes.Move(ShapeStartP1Y, 260, 40) Shapes.SetText(ShapeStartP1Y, StartPoint1Yint) ShapeStartP2X=Shapes.AddText(StartPoint2Xint) Shapes.Move(ShapeStartP2X, 325, 40) Shapes.SetText(ShapeStartP2X, StartPoint2Xint) ShapeStartP2Y=Shapes.AddText(StartPoint2Yint) Shapes.Move(ShapeStartP2Y, 360, 40) Shapes.SetText(ShapeStartP2Y, StartPoint2Yint) ShapeStartP3X=Shapes.AddText(StartPoint3Xint) Shapes.Move(ShapeStartP3X, 425, 40) Shapes.SetText(ShapeStartP3X, StartPoint3Xint) ShapeStartP3Y=Shapes.AddText(StartPoint3Yint) Shapes.Move(ShapeStartP3Y, 460, 40) Shapes.SetText(ShapeStartP3Y, StartPoint3Yint) EndIf EndSub 'END FIRSTHEADER SUBROUTINE '========================== 'START AIMHEADER SUBROUTINE Sub AimHeader ClearHeader=1 GraphicsWindow.BrushColor="Black" ShapeLoop=Shapes.AddText(LoopShapeNumber) Shapes.Move(ShapeLoop, 1, 1) Shapes.SetText(ShapeLoop, LoopShapeNumber) AimLabel="IDEAL Apex Points" ShapeAimLabel=Shapes.AddText(AimLabel) Shapes.Move(ShapeAimLabel, 30, 1) Shapes.SetText(ShapeAimLabel, AimLabel) If Loop>1 Then ShapeTime=Shapes.AddText(ElapsedTimeint) Shapes.Move(ShapeTime, 200, 1) Shapes.SetText(ShapeTime, ElapsedTimeint) EndIf 'ROW TWO========== P1X="P1X" ShapeP1X=Shapes.AddText(P1X) Shapes.Move(ShapeP1X, 225, 20) Shapes.SetText(ShapeP1X, P1X) P1Y="P1Y" ShapeP1Y=Shapes.AddText(P1Y) Shapes.Move(ShapeP1Y, 260, 20) Shapes.SetText(ShapeP1Y, P1Y) P2X="P2X" ShapeP2X=Shapes.AddText(P2X) Shapes.Move(ShapeP2X, 325, 20) Shapes.SetText(ShapeP2X, P2X) P2Y="P2Y" ShapeP2Y=Shapes.AddText(P2Y) Shapes.Move(ShapeP2Y, 360, 20) Shapes.SetText(ShapeP2Y, P2Y) P3X="P3X" ShapeP3X=Shapes.AddText(P3X) Shapes.Move(ShapeP3X, 425, 20) Shapes.SetText(ShapeP3X, P3X) P3Y="P3Y" ShapeP3Y=Shapes.AddText(P3Y) Shapes.Move(ShapeP3Y, 460, 20) Shapes.SetText(ShapeP3Y, P3Y) 'ROW THREE======== '225 40 1X AimPointLeft1Xint=Math.Floor(AimPointLeft1X) ShapeAimL1X=Shapes.AddText(AimPointLeft1Xint) Shapes.Move(ShapeAimL1X, 225, 40) Shapes.SetText(ShapeAimL1X, AimPointLeft1Xint) '260 40 1Y AimPointLeft1Yint=Math.Floor(AimPointLeft1Y) ShapeAimL1Y=Shapes.AddText(AimPointLeft1Yint) Shapes.Move(ShapeAimL1Y, 260, 40) Shapes.SetText(ShapeAimL1Y, AimPointLeft1Yint) '325 40 2X AimPointLeft2Xint=Math.Floor(AimPointLeft2X) ShapeAimL2X=Shapes.AddText(AimPointLeft2Xint) Shapes.Move(ShapeAimL2X, 325, 40) Shapes.SetText(ShapeAimL2X, AimPointLeft2Xint) '360 40 2Y AimPointLeft2Yint=Math.Floor(AimPointLeft2Y) ShapeAimL2Y=Shapes.AddText(AimPointLeft2Yint) Shapes.Move(ShapeAimL2Y, 360, 40) Shapes.SetText(ShapeAimL2Y, AimPointLeft2Yint) '425 40 3X AimPointLeft3Xint=Math.Floor(AimPointLeft3X) ShapeAimL3X=Shapes.AddText(AimPointLeft3Xint) Shapes.Move(ShapeAimL3X, 425, 40) Shapes.SetText(ShapeAimL3X, AimPointLeft3Xint) '460 40 3Y AimPointLeft3Yint=Math.Floor(AimPointLeft3Y) ShapeAimL3Y=Shapes.AddText(AimPointLeft3Yint) Shapes.Move(ShapeAimL3Y, 460, 40) Shapes.SetText(ShapeAimL3Y, AimPointLeft3Yint) '===================== AimPointRight1Xint=Math.Floor(AimPointRight1X) ShapeAimR1X=Shapes.AddText(AimPointRight1Xint) Shapes.Move(ShapeAimR1X, 225, 60) Shapes.SetText(ShapeAimR1X, AimPointRight1Xint) AimPointRight1Yint=Math.Floor(AimPointRight1Y) ShapeAimR1Y=Shapes.AddText(AimPointRight1Yint) Shapes.Move(ShapeAimR1Y, 260, 60) Shapes.SetText(ShapeAimR1Y, AimPointRight1Yint) AimPointRight2Xint=Math.Floor(AimPointRight2X) ShapeAimR2X=Shapes.AddText(AimPointRight2Xint) Shapes.Move(ShapeAimR2X, 325, 60) Shapes.SetText(ShapeAimR2X, AimPointRight2Xint) AimPointRight2Yint=Math.Floor(AimPointRight2Y) ShapeAimR2Y=Shapes.AddText(AimPointRight2Yint) Shapes.Move(ShapeAimR2Y, 360, 60) Shapes.SetText(ShapeAimR2Y, AimPointRight2Yint) AimPointRight3Xint=Math.Floor(AimPointRight3X) ShapeAimR3X=Shapes.AddText(AimPointRight3Xint) Shapes.Move(ShapeAimR3X, 425, 60) Shapes.SetText(ShapeAimR3X, AimPointRight3Xint) '460 40 3Y AimPointRight3Yint=Math.Floor(AimPointRight3Y) ShapeAimR3Y=Shapes.AddText(AimPointRight3Yint) Shapes.Move(ShapeAimR3Y, 460, 60) Shapes.SetText(ShapeAimR3Y, AimPointRight3Yint) ENDSUB 'END AIMHEADER SUBROUTINE '======================== 'START TARGETHEADER SUBROUTINE Sub TargetHeader ClearHeader=1 GraphicsWindow.BrushColor="Black" ShapeLoop=Shapes.AddText(LoopShapeNumber) Shapes.Move(ShapeLoop, 1, 1) Shapes.SetText(ShapeLoop, LoopShapeNumber) TargetLabel="TARGET Points" ShapeTargetLabel=Shapes.AddText(TargetLabel) Shapes.Move(ShapeTargetLabel, 30, 1) Shapes.SetText(ShapeTargetLabel, TargetLabel) If Loop>1 Then ShapeTime=Shapes.AddText(ElapsedTimeint) Shapes.Move(ShapeTime, 200, 1) Shapes.SetText(ShapeTime, ElapsedTimeint) EndIf 'ROW TWO========== P1X="P1X" ShapeP1X=Shapes.AddText(P1X) Shapes.Move(ShapeP1X, 220, 20) Shapes.SetText(ShapeP1X, P1X) P1Y="P1Y" ShapeP1Y=Shapes.AddText(P1Y) Shapes.Move(ShapeP1Y, 265, 20) Shapes.SetText(ShapeP1Y, P1Y) P2X="P2X" ShapeP2X=Shapes.AddText(P2X) Shapes.Move(ShapeP2X, 320, 20) Shapes.SetText(ShapeP2X, P2X) P2Y="P2Y" ShapeP2Y=Shapes.AddText(P2Y) Shapes.Move(ShapeP2Y, 365, 20) Shapes.SetText(ShapeP2Y, P2Y) P3X="P3X" ShapeP3X=Shapes.AddText(P3X) Shapes.Move(ShapeP3X, 420, 20) Shapes.SetText(ShapeP3X, P3X) P3Y="P3Y" ShapeP3Y=Shapes.AddText(P3Y) Shapes.Move(ShapeP3Y, 465, 20) Shapes.SetText(ShapeP3Y, P3Y) 'ROW THREE======== '225 40 1X TargetLeftP1Xint=Math.Floor(TargetLeft1X) ShapeTargetL1X=Shapes.AddText(TargetLeftP1Xint) Shapes.Move(ShapeTargetL1X, 220, 40) Shapes.SetText(ShapeTargetL1X, TargetLeftP1Xint) '260 40 1Y TargetLeftP1Yint=Math.Floor(TargetLeft1Y) ShapeTargetL1Y=Shapes.AddText(TargetLeftP1Yint) Shapes.Move(ShapeTargetL1Y, 265, 40) Shapes.SetText(ShapeTargetL1Y, TargetLeftP1Yint) '325 40 2X TargetLeftP2Xint=Math.Floor(TargetLeft2X) ShapeTargetL2X=Shapes.AddText(TargetLeftP2Xint) Shapes.Move(ShapeTargetL2X, 320, 40) Shapes.SetText(ShapeTargetL2X, TargetLeftP2Xint) '360 40 2Y TargetLeftP2Yint=Math.Floor(TargetLeft2Y) ShapeTargetL2Y=Shapes.AddText(TargetLeftP2Yint) Shapes.Move(ShapeTargetL2Y, 365, 40) Shapes.SetText(ShapeTargetL2Y, TargetLeftP2Yint) '425 40 3X TargetLeftP3Xint=Math.Floor(TargetLeft3X) ShapeTargetL3X=Shapes.AddText(TargetLeftP3Xint) Shapes.Move(ShapeTargetL3X, 420, 40) Shapes.SetText(ShapeTargetL3X, TargetLeftP3Xint) '460 40 3Y TargetLeftP3Yint=Math.Floor(TargetLeft3Y) ShapeTargetL3Y=Shapes.AddText(TargetLeftP3Yint) Shapes.Move(ShapeTargetL3Y, 465, 40) Shapes.SetText(ShapeTargetL3Y, TargetLeftP3Yint) '===================== '225 40 1X TargetRightP1Xint=Math.Floor(TargetRight1X) ShapeTargetR1X=Shapes.AddText(TargetRightP1Xint) Shapes.Move(ShapeTargetR1X, 220, 60) Shapes.SetText(ShapeTargetR1X, TargetRightP1Xint) '260 40 1Y TargetRightP1Yint=Math.Floor(TargetRight1Y) ShapeTargetR1Y=Shapes.AddText(TargetRightP1Yint) Shapes.Move(ShapeTargetR1Y, 265, 60) Shapes.SetText(ShapeTargetR1Y, TargetRightP1Yint) '325 40 2X TargetRightP2Xint=Math.Floor(TargetRight2X) ShapeTargetR2X=Shapes.AddText(TargetRightP2Xint) Shapes.Move(ShapeTargetR2X, 320, 60) Shapes.SetText(ShapeTargetR2X, TargetRightP2Xint) '360 40 2Y TargetRightP2Yint=Math.Floor(TargetRight2Y) ShapeTargetR2Y=Shapes.AddText(TargetrightP2Yint) Shapes.Move(ShapeTargetR2Y, 365, 60) Shapes.SetText(ShapeTargetR2Y, TargetRightP2Yint) '425 40 3X TargetRightP3Xint=Math.Floor(TargetRight3X) ShapeTargetR3X=Shapes.AddText(TargetRightP3Xint) Shapes.Move(ShapeTargetR3X, 420, 60) Shapes.SetText(ShapeTargetR3X, TargetRightP3Xint) '460 40 3Y TargetRightP3Yint=Math.Floor(TargetRight3Y) ShapeTargetR3Y=Shapes.AddText(TargetRightP3Yint) Shapes.Move(ShapeTargetR3Y, 465, 60) Shapes.SetText(ShapeTargetR3Y, TargetRightP3Yint) ENDSUB 'END TARGETHEADER SUBROUTINE '============================ '============================ Sub InterimHeader GraphicsWindow.Show() GraphicsWindow.Width = 800 GraphicsWindow.Height = 600 GraphicsWindow.Top = 60 GraphicsWindow.Left = 500 GraphicsWindow.Title = "INTERIM" GraphicsWindow.FontSize=15 GraphicsWindow.BrushColor="Black" Turtle.Speed = Swiftness 'Row One ShapeLoop=Shapes.AddText(LoopShapeNumber) Shapes.Move(ShapeLoop, 1, 1) Shapes.SetText(ShapeLoop, LoopShapeNumber) InterimLabel="INTERIM Triangle" ShapeInterimLabel=Shapes.AddText(InterimLabel) Shapes.Move(ShapeInterimLabel, 30, 1) Shapes.SetText(ShapeInterimLabel, InterimLabel) EndLooptime=Clock.ElapsedMilliseconds ElapsedLoopTime=StartTime-EndLoopTime ElapsedLoopTime=(Math.Abs(ElapsedLoopTime/1000)) ElapsedLoopTimeint = (Math.Floor(ElapsedLoopTime)) ShapeLoopTime=Shapes.AddText(ElapsedLoopTimeInt) Shapes.Move(ShapeLoopTime, 250, 1) Shapes.SetText(ShapeLoopTime, ElapsedLoopTime) InterimTimeLabel="Elapsed Time (seconds)" ShapeInterimTimeLabel=Shapes.AddText(InterimTimeLabel) Shapes.Move(ShapeInterimTimeLabel, 400, 1) Shapes.SetText(ShapeInterimTimeLabel, InterimTimeLabel) 'TextWindow.WriteLine("LoopTime" + ElapsedLoopTime) 't===================================== 'Row TWO E12="E12" ShapeE12=Shapes.AddText(E12) Shapes.Move(ShapeE12, 10, 20) Shapes.SetText(ShapeE12, E12) E13="E13" ShapeE13=Shapes.AddText(E13) Shapes.Move(ShapeE13, 50, 20) Shapes.SetText(ShapeP1P3, E13) E23="E23" ShapeE23=Shapes.AddText(E23) Shapes.Move(ShapeE23, 100, 20) Shapes.SetText(ShapeE23, E23) PER="PERIM" ShapePER=Shapes.AddText(PER) Shapes.Move(ShapePER, 150, 20) Shapes.SetText(ShapePER, PER) P1X="P1X" ShapeP1X=Shapes.AddText(P1X) Shapes.Move(ShapeP1X, 225, 20) Shapes.SetText(ShapeP1X, P1X) P1Y="P1Y" ShapeP1Y=Shapes.AddText(P1Y) Shapes.Move(ShapeP1Y, 260, 20) Shapes.SetText(ShapeP1Y, P1Y) P2X="P2X" ShapeP2X=Shapes.AddText(P2X) Shapes.Move(ShapeP2X, 325, 20) Shapes.SetText(ShapeP2X, P2X) P2Y="P2Y" ShapeP2Y=Shapes.AddText(P2Y) Shapes.Move(ShapeP2Y, 360, 20) Shapes.SetText(ShapeP2Y, P2Y) P3X="P3X" ShapeP3X=Shapes.AddText(P3X) Shapes.Move(ShapeP3X, 425, 20) Shapes.SetText(ShapeP3X, P3X) P3Y="P3Y" ShapeP3Y=Shapes.AddText(P3Y) Shapes.Move(ShapeP3Y, 460, 20) Shapes.SetText(ShapeP3Y, P3Y) '======================= 'Row Three IEP1P2=((Point2X-Point1X)*(Point2X-Point1X))+((Point2Y-Point1Y)*(Point2Y-Point1Y)) IEdgeP1P2=Math.SquareRoot(IEP1P2) IEdgeP1P2int=(Math.Floor(IEdgeP1P2)) IEP1P3=((Point3X-Point1X)*(Point3X-Point1X))+((Point3Y-Point1Y)*(Point3Y-Point1Y)) IEdgeP1P3=Math.SquareRoot(IEP1P3) IEdgeP1P3int=(Math.Floor(IEdgeP1P3)) IEP2P3=((Point3X-Point2X)*(Point3X-Point2X))+((Point3Y-Point2Y)*(Point3Y-Point2Y)) IEdgeP2P3=Math.SquareRoot(IEP2P3) IEdgeP2P3int=(Math.Floor(IEdgeP1P3)) IPerimeter = IEdgeP1P2+IEdgeP1P3+IEdgeP2P3 GraphicsWindow.BrushColor="Purple" ShapeIP1P2=Shapes.AddText(IEdgeP1P2int) Shapes.Move(ShapeIP1P2, 10, 40) Shapes.SetText(ShapeIP1P2, IEdgeP1P2int) ShapeIP1P3=Shapes.AddText(IEdgeP1P3int) Shapes.Move(ShapeIP1P3, 50, 40) Shapes.SetText(ShapeIP1P3, IEdgeP1P3int) ShapeIP2P3=Shapes.AddText(IEdgeP2P3int) Shapes.Move(ShapeIP2P3, 100, 40) Shapes.SetText(ShapeIP2P3, IEdgeP2P3int) Equals=" =" ShapeEquals=Shapes.AddText(Equals) Shapes.Move(ShapeEquals, 130, 40) Shapes.SetText(ShapeEquals, Equals) IPerimeter=IEdgeP1P2+IEdgeP1P3+IEdgeP2P3 IPerimeterint=(Math.Floor(IPerimeter)) ShapeIPerimeter=Shapes.AddText(IPerimeterint) Shapes.Move(ShapeIPerimeter, 150, 40) Shapes.SetText(ShapeIPerimeter, IPerimeterint) '============== IPoint1Xint=math.Floor(Point1X) ShapeIP1X=Shapes.AddText(IPoint1Xint) Shapes.Move(ShapeIP1X, 225, 40) Shapes.SetText(ShapeIP1X, IPoint1Xint) IPoint1Yint=Math.Floor(Point1Y) ShapeIP1Y=Shapes.AddText(IPoint1Yint) Shapes.Move(ShapeIP1Y, 260, 40) Shapes.SetText(ShapeIP1Y, IPoint1Yint) IPoint2Xint=Math.Floor(Point2X) ShapeIP2X=Shapes.AddText(IPoint2Xint) Shapes.Move(ShapeIP2X, 325, 40) Shapes.SetText(ShapeIP2X, IPoint2Xint) IPoint2Yint=Math.Floor(Point2Y) ShapeIP2Y=Shapes.AddText(IPoint2Yint) Shapes.Move(ShapeIP2Y, 360, 40) Shapes.SetText(ShapeIP2Y, IPoint2Yint) IPoint3Xint=Math.Floor(Point3X) ShapeIP3X=Shapes.AddText(IPoint3Xint) Shapes.Move(ShapeIP3X, 425, 40) Shapes.SetText(ShapeIP3X, IPoint3Xint) IPoint3Yint=Math.Floor(Point3Y) ShapeIP3Y=Shapes.AddText(IPoint3Yint) Shapes.Move(ShapeIP3Y, 460, 40) Shapes.SetText(ShapeIP3Y, IPoint3Yint) EndSub '============================ '============================ 'START MIDHEADER SUBROUTINE Sub MidHeader ClearHeader=1 'GraphicsWindow.Clear() ShapeLoop=Shapes.AddText(LoopShapeNumber) Shapes.Move(ShapeLoop, 1, 1) Shapes.SetText(ShapeLoop, LoopShapeNumber) SecondLabel="Interim Variables" ShapeSecondLabel=Shapes.AddText(SecondLabel) Shapes.Move(ShapeSecondLabel, 30, 1) Shapes.SetText(ShapeSecondLabel, SecondLabel) If Loop>1 Then ShapeTime=Shapes.AddText(ElapsedTimeint) Shapes.Move(ShapeTime, 200, 1) Shapes.SetText(ShapeTime, ElapsedTimeint) EndIf 'ROW TWO========== E12="E12" ShapeE12=Shapes.AddText(E12) Shapes.Move(ShapeE12, 10, 20) Shapes.SetText(ShapeE12, E12) E13="E13" ShapeE13=Shapes.AddText(E13) Shapes.Move(ShapeE13, 50, 20) Shapes.SetText(ShapeP1P3, E13) E23="E23" ShapeE23=Shapes.AddText(E23) Shapes.Move(ShapeE23, 100, 20) Shapes.SetText(ShapeE23, E23) PER="PERIM" ShapePER=Shapes.AddText(PER) Shapes.Move(ShapePER, 150, 20) Shapes.SetText(ShapePER, PER) P1X="P1X" ShapeP1X=Shapes.AddText(P1X) Shapes.Move(ShapeP1X, 225, 20) Shapes.SetText(ShapeP1X, P1X) P1Y="P1Y" ShapeP1Y=Shapes.AddText(P1Y) Shapes.Move(ShapeP1Y, 260, 20) Shapes.SetText(ShapeP1Y, P1Y) P2X="P2X" ShapeP2X=Shapes.AddText(P2X) Shapes.Move(ShapeP2X, 325, 20) Shapes.SetText(ShapeP2X, P2X) P2Y="P2Y" ShapeP2Y=Shapes.AddText(P2Y) Shapes.Move(ShapeP2Y, 360, 20) Shapes.SetText(ShapeP2Y, P2Y) P3X="P3X" ShapeP3X=Shapes.AddText(P3X) Shapes.Move(ShapeP3X, 425, 20) Shapes.SetText(ShapeP3X, P3X) P3Y="P3Y" ShapeP3Y=Shapes.AddText(P3Y) Shapes.Move(ShapeP3Y, 460, 20) Shapes.SetText(ShapeP3Y, P3Y) 'ROW THREE======== ShapeStartP1P2=Shapes.AddText(StartEdgeP1P2int) Shapes.Move(ShapeStartP1P2, 10, 40) Shapes.SetText(ShapeStartP1P2, StartEdgeP1P2int) ShapeStartP1P3=Shapes.AddText(StartEdgeP1P3int) Shapes.Move(ShapeStartP1P3, 50, 40) Shapes.SetText(ShapeStartP1P3, StartEdgeP1P3int) ShapeStartP2P3=Shapes.AddText(StartEdgeP2P3int) Shapes.Move(ShapeStartP2P3, 100, 40) Shapes.SetText(ShapeStartP2P3, StartEdgeP2P3int) Equals="=" ShapeEquals=Shapes.AddText(Equals) Shapes.Move(ShapeEquals, 130, 40) Shapes.SetText(ShapeEquals, Equals) ShapePerimeterBase=Shapes.AddText(PerimeterBaseint) Shapes.Move(ShapePerimeterBase, 150, 40) Shapes.SetText(ShapePerimeterBase, PerimeterBaseint) StartPoint1Xint=Math.Floor(StartPoint1X) ShapeStartP1X=Shapes.AddText(StartPoint1Xint) Shapes.Move(ShapeStartP1X, 225, 40) Shapes.SetText(ShapeStartP1X, StartPoint1Xint) StartPoint1Yint=Math.Floor(StartPoint1Y) ShapeStartP1Y=Shapes.AddText(StartPoint1Yint) Shapes.Move(ShapeStartP1Y, 260, 40) Shapes.SetText(ShapeStartP1Y, StartPoint1Yint) StartPoint2Xint=Math.Floor(StartPoint2X) ShapeStartP2X=Shapes.AddText(StartPoint2Xint) Shapes.Move(ShapeStartP2X, 325, 40) Shapes.SetText(ShapeStartP2X, StartPoint2Xint) StartPoint2Yint=Math.Floor(StartPoint2Y) ShapeStartP2Y=Shapes.AddText(StartPoint2Yint) Shapes.Move(ShapeStartP2Y, 360, 40) Shapes.SetText(ShapeStartP1X, StartPoint2Yint) StartPoint3Xint=Math.Floor(StartPoint3X) ShapeStartP3X=Shapes.AddText(StartPoint3Xint) Shapes.Move(ShapeStartP3X, 425, 40) Shapes.SetText(ShapeStartP3X, StartPoint3Xint) StartPoint3Yint=Math.Floor(StartPoint3Y) ShapeStartP3Y=Shapes.AddText(StartPoint3Yint) Shapes.Move(ShapeStartP3Y, 460, 40) Shapes.SetText(ShapeStartP3Y, StartPoint3Yint) 'Include Aimer Shape Definitions AimShapeP1P2=Shapes.AddText(AimEdgeP1P2int) Shapes.Move(AimShapeP1P2, 10, 60) Shapes.SetText(AimShapeP1P2, AimEdgeP1P2int) AimShapeP1P3=Shapes.AddText(AimEdgeP1P3int) Shapes.Move(AimShapeP1P3, 50, 60) Shapes.SetText(AimShapeP1P3, AimEdgeP1P3int) AimShapeP2P3=Shapes.AddText(AimEdgeP2P3int) Shapes.Move(AimShapeP2P3, 100, 60) Shapes.SetText(AimShapeP2P3, AimEdgeP2P3int) Equals="=" ShapeEquals=Shapes.AddText(Equals) Shapes.Move(ShapeEquals, 130, 60) Shapes.SetText(ShapeEquals, Equals) AimShapePerimeter=Shapes.AddText(AimPerimeterint) Shapes.Move(AimShapePerimeter, 150, 60) Shapes.SetText(AimShapePerimeter, AimPerimeterint) AimPoint1Xint=Math.Floor(AimPoint1X) AimShapeP1X=Shapes.AddText(AimPoint1Xint) Shapes.Move(AimShapeP1X, 225, 60) Shapes.SetText(AimShapeP1X, AimPoint1Xint) AimPoint1Yint=Math.Floor(AimPoint1Y) AimShapeP1Y=Shapes.AddText(AimPoint1Yint) Shapes.Move(AimShapeP1Y, 260, 60) Shapes.SetText(AimShapeP1Y, AimPoint1Yint) AimPoint2Xint=Math.Floor(AimPoint2X) AimShapeP2X=Shapes.AddText(AimPoint2Xint) Shapes.Move(AimShapeP2X, 325, 60) Shapes.SetText(AimShapeP2X, AimPoint2Xint) AimPoint2Yint=Math.Floor(AimPoint2Y) AimShapeP2Y=Shapes.AddText(AimPoint2Yint) Shapes.Move(AimShapeP2Y, 360, 60) Shapes.SetText(AimShapeP1X, AimPoint2Yint) AimPoint3Xint=Math.Floor(AimPoint3X) AimShapeP3X=Shapes.AddText(AimPoint3Xint) Shapes.Move(AimShapeP3X, 425, 60) Shapes.SetText(AimShapeP3X, AimPoint3Xint) AimPoint3Yint=Math.Floor(AimPoint3Y) AimShapeP3Y=Shapes.AddText(AimPoint3Yint) Shapes.Move(AimShapeP3Y, 460, 60) Shapes.SetText(AimShapeP3Y, AimPoint3Yint) 'End Include Aimer Definitions 'Start Include Line/Length Definitions ShapeLineP1P2=Shapes.AddText(LineP1P2int) Shapes.Move(ShapeLineP1P2, 10, 80) Shapes.SetText(ShapeLineP1P2, LineP1P2int) ShapeLineP1P3=Shapes.AddText(LineP1P3int) Shapes.Move(ShapeLineP1P3, 50, 80) Shapes.SetText(ShapeLineP1P3, LineP1P3int) ShapeLineP2P3=Shapes.AddText(LineP2P3int) Shapes.Move(ShapeLineP2P3, 100, 80) Shapes.SetText(ShapeLineP2P3, LineP2P3int) Equals="=" ShapeEquals=Shapes.AddText(Equals) Shapes.Move(ShapeEquals, 130, 80) Shapes.SetText(ShapeEquals, Equals) ShapeLength=Shapes.AddText(Length) Shapes.Move(ShapeLength, 150, 80) Shapes.SetText(ShapeLength, Lengthint) 'End Include Line/Length Definitions '=====CONTINUE SHAPE POINTS============== Point1Xint=Math.Floor(Point1X) ShapeP1X=Shapes.AddText(Point1Xint) Shapes.Move(ShapeP1X, 225, 80) Shapes.SetText(ShapeP1X, Point1Xint) Point1Yint=Math.Floor(Point1Y) ShapeP1Y=Shapes.AddText(Point1Yint) Shapes.Move(ShapeP1Y, 260, 80) Shapes.SetText(ShapeP1Y, Point1Yint) Point2Xint=Math.Floor(Point2X) ShapeP2X=Shapes.AddText(Point2Xint) Shapes.Move(ShapeP2X, 325, 80) Shapes.SetText(ShapeP2X, Point2Xint) Point2Yint=Math.Floor(Point2Y) ShapeP2Y=Shapes.AddText(Point2Yint) Shapes.Move(ShapeP2Y, 360, 80) Shapes.SetText(ShapeP1X, Point2Yint) Point3Xint=Math.Floor(Point3X) ShapeP3X=Shapes.AddText(Point3Xint) Shapes.Move(ShapeP3X, 425, 80) Shapes.SetText(ShapeP3X, Point3Xint) Point3Yint=Math.Floor(Point3Y) ShapeP3Y=Shapes.AddText(Point3Yint) Shapes.Move(ShapeP3Y, 460, 80) Shapes.SetText(ShapeP3Y, Point3Yint) ENDSUB '======END SUB MIDHEADER============= '======START LASTHEADER============== Sub LastHeader ClearHeader=1 GraphicsWindow.Show() GraphicsWindow.Width = 800 GraphicsWindow.Height = 600 GraphicsWindow.Top = 60 GraphicsWindow.Left = 500 GraphicsWindow.Title = "TRIANGELS" GraphicsWindow.FontSize=15 Turtle.Speed = Swiftness 'Row One ShapeLoop=Shapes.AddText(LoopShapeNumber) Shapes.Move(ShapeLoop, 1, 1) Shapes.SetText(ShapeLoop, LoopShapeNumber) LastLabel="RESOLVED Point Variables" ShapeLastLabel=Shapes.AddText(LastLabel) Shapes.Move(ShapeLastLabel, 30, 1) Shapes.SetText(ShapeLastLabel, LastLabel) ShapeTime=Shapes.AddText(ElapsedTimeint) Shapes.Move(ShapeTime, 300, 1) Shapes.SetText(ShapeTime, ElapsedTimeint/1000) TimeLabel="Elapsed Time (seconds)" ShapeTimeLabel=Shapes.AddText(TimeLabel) Shapes.Move(ShapeTimeLabel,400, 1) Shapes.SetText(ShapeTimeLabel, TimeLabel) 'Row Two ShapeStartP1P2=Shapes.AddText(StartEdgeP1P2int) Shapes.Move(ShapeStartP1P2, 10, 20) Shapes.SetText(ShapeStartP1P2, StartEdgeP1P2int) ShapeStartP1P3=Shapes.AddText(StartEdgeP1P3int) Shapes.Move(ShapeStartP1P3, 50, 20) Shapes.SetText(ShapeStartP1P3, StartEdgeP1P3int) ShapeStartP2P3=Shapes.AddText(StartEdgeP2P3int) Shapes.Move(ShapeStartP2P3, 100, 20) Shapes.SetText(ShapeStartP2P3, StartEdgeP2P3int) Equals=" =" ShapeEquals=Shapes.AddText(Equals) Shapes.Move(ShapeEquals, 130, 20) Shapes.SetText(ShapeEquals, Equals) ShapePerimeterBase=Shapes.AddText(PerimeterBaseint) Shapes.Move(ShapePerimeterBase, 150, 20) Shapes.SetText(ShapePerimeterBase, PerimeterBaseint) ShapeStartP1X=Shapes.AddText(StartPoint1Xint) Shapes.Move(ShapeStartP1X, 225, 20) Shapes.SetText(ShapeStartP1X, StartPoint1Xint) ShapeStartP1Y=Shapes.AddText(StartPoint1Yint) Shapes.Move(ShapeStartP1Y, 260, 20) Shapes.SetText(ShapeStartP1Y, StartPoint1Yint) ShapeStartP2X=Shapes.AddText(StartPoint2Xint) Shapes.Move(ShapeStartP2X, 325, 20) Shapes.SetText(ShapeStartP2X, StartPoint2Xint) ShapeStartP2Y=Shapes.AddText(StartPoint2Yint) Shapes.Move(ShapeStartP2Y, 360, 20) Shapes.SetText(ShapeStartP2Y, StartPoint2Yint) ShapeStartP3X=Shapes.AddText(StartPoint3Xint) Shapes.Move(ShapeStartP3X, 425, 20) Shapes.SetText(ShapeStartP3X, StartPoint3Xint) ShapeStartP3Y=Shapes.AddText(StartPoint3Yint) Shapes.Move(ShapeStartP3Y, 460, 20) Shapes.SetText(ShapeStartP3Y, StartPoint3Yint) 'Row Three ShapeLastP1P2=Shapes.AddText(LastEdgeP1P2int) Shapes.Move(ShapeLastP1P2, 10, 40) Shapes.SetText(ShapeLastP1P2, LastEdgeP1P2int) ShapeLastP1P3=Shapes.AddText(LastEdgeP1P3int) Shapes.Move(ShapeLastP1P3, 50, 40) Shapes.SetText(ShapeLastP1P3, LastEdgeP1P3int) ShapeP2P3=Shapes.AddText(LastEdgeP2P3int) Shapes.Move(ShapeP2P3, 100, 40) Shapes.SetText(ShapeP2P3, EdgeP2P3int) Equals=" =" ShapeEquals=Shapes.AddText(Equals) Shapes.Move(ShapeEquals, 130, 40) Shapes.SetText(ShapeEquals, Equals) ShapeLastPerimeter=Shapes.AddText(LastPerimeterint) Shapes.Move(ShapeLastPerimeter, 150, 40) Shapes.SetText(ShapeLastPerimeter, LastPerimeterint) ShapeLastP1X=Shapes.AddText(LastPoint1Xint) Shapes.Move(ShapeLastP1X, 225, 40) Shapes.SetText(ShapeLastP1X, LastPoint1Xint) ShapeLastP1Y=Shapes.AddText(LastPoint1Yint) Shapes.Move(ShapeLastP1Y, 260, 40) Shapes.SetText(ShapeLastP1Y, LastPoint1Yint) ShapeLastP2X=Shapes.AddText(LastPoint2Xint) Shapes.Move(ShapeLastP2X, 325, 40) Shapes.SetText(ShapeLastP2X, LastPoint2Xint) ShapeLastP2Y=Shapes.AddText(LastPoint2Yint) Shapes.Move(ShapeLastP2Y, 360, 40) Shapes.SetText(ShapeLastP2Y, LastPoint2Yint) ShapeLastP3X=Shapes.AddText(LastPoint3Xint) Shapes.Move(ShapeLastP3X, 425, 40) Shapes.SetText(ShapeLastP3X, LastPoint3Xint) ShapeLastP3Y=Shapes.AddText(LastPoint3Yint) Shapes.Move(ShapeLastP3Y, 460, 40) Shapes.SetText(ShapeLastP3Y, LastPoint3Yint) EndSub Sub TextOne GraphicsWindow.Show() GraphicsWindow.Width = 800 GraphicsWindow.Height = 600 GraphicsWindow.Top = 60 GraphicsWindow.Left = 500 GraphicsWindow.Title = "TextOne" GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=20 Turtle.Speed = Swiftness TRIANGELOne="Start with any irregular triangle. [Tap a key whenever the program halts.]" ShapeTRIANGELOne=Shapes.AddText(TRIANGELOne) Shapes.Move(ShapeTRIANGELOne, 20, 540) Shapes.SetText(ShapeTRIANGELOne, TRIANGELOne) EndSub Sub TextTwo GraphicsWindow.Show() GraphicsWindow.Width = 800 GraphicsWindow.Height = 600 GraphicsWindow.Top = 60 GraphicsWindow.Left = 500 GraphicsWindow.Title = "TextTwo" GraphicsWindow.FontSize=20 GraphicsWindow.BrushColor="Black" Turtle.Speed = Swiftness TRIANGELTwo1="Calculate the position each point would assume if it were the apex of an" ShapeTRIANGELTwo1=Shapes.AddText(TRIANGELTwo1) Shapes.Move(ShapeTRIANGELTwo1, 20, 500) Shapes.SetText(ShapeTRIANGELTwo1, TRIANGELTwo1) TRIANGELTwo2="Equilateral Triangle erected from the base of the other two points. [Tap]" ShapeTRIANGELTwo2=Shapes.AddText(TRIANGELTwo2) Shapes.Move(ShapeTRIANGELTwo2, 20, 520) Shapes.SetText(ShapeTRIANGELTwo2, TRIANGELTwo2) TextWindow.Pause() TRIANGELTwo3="(Note that each base projects two apexes in opposite directions. [Tap])" ShapeTRIANGELTwo3=Shapes.AddText(TRIANGELTwo3) Shapes.Move(ShapeTRIANGELTwo3, 20, 540) Shapes.SetText(ShapeTRIANGELTwo3, TRIANGELTwo3) TextWindow.Pause() EndSub Sub TextThreeX GraphicsWindow.Show() GraphicsWindow.Width = 800 GraphicsWindow.Height = 600 GraphicsWindow.Top = 60 GraphicsWindow.Left = 500 GraphicsWindow.Title = "TextThreeX" GraphicsWindow.FontSize=20 GraphicsWindow.PenColor="Black" Turtle.Speed = Swiftness TRIANGELThreeX1="Now compute shifts of the actual points some percentage of" ShapeTRIANGELThreeX1=Shapes.AddText(TRIANGELThreeX1) Shapes.Move(ShapeTRIANGELThreeX1, 20, 520) Shapes.SetText(ShapeTRIANGELThreeX1, TRIANGELThreeX1) TRIANGELThreeX2="the distance from their current positions to these hypothetical apexes." ShapeTRIANGELThreeX2=Shapes.AddText(TRIANGELThreeX2) Shapes.Move(ShapeTRIANGELThreeX2, 20, 540) Shapes.SetText(ShapeTRIANGELThreeX2, TRIANGELThreeX2) 'TextWindow.Pause() EndSub Sub TextThree GraphicsWindow.Show() GraphicsWindow.Width = 800 GraphicsWindow.Height = 600 GraphicsWindow.Top = 60 GraphicsWindow.Left = 500 GraphicsWindow.Title = "TextThree" GraphicsWindow.FontSize=20 GraphicsWindow.PenColor="Black" Turtle.Speed = Swiftness TRIANGELThree="This projects an imaginary triangle that can target point/edge equilibirum." ShapeTRIANGELThree=Shapes.AddText(TRIANGELThree) Shapes.Move(ShapeTRIANGELThree, 20, 540) Shapes.SetText(ShapeTRIANGELThree, TRIANGELThree) 'TextWindow.Pause() EndSub Sub TextFour GraphicsWindow.Show() GraphicsWindow.Width = 800 GraphicsWindow.Height = 600 GraphicsWindow.Top = 60 GraphicsWindow.Left = 500 GraphicsWindow.Title = "TextFour" GraphicsWindow.FontSize=20 GraphicsWindow.PenColor="Black" Turtle.Speed = Swiftness TRIANGELFour1="Next step the three points toward this potential equilibrium..." ShapeTRIANGELFour1=Shapes.AddText(TRIANGELFour1) Shapes.Move(ShapeTRIANGELFour1, 20, 520) Shapes.SetText(ShapeTRIANGELFour1, TRIANGELFour1) TextWindow.Pause() TRIANGELFour2="(Each point subjectively slides alone without central oversight.)" ShapeTRIANGELFour2=Shapes.AddText(TRIANGELFour2) Shapes.Move(ShapeTRIANGELFour2, 20, 540) Shapes.SetText(ShapeTRIANGELFour2, TRIANGELFour2) TextWindow.Pause() EndSub Sub TextFive GraphicsWindow.Show() GraphicsWindow.Width = 800 GraphicsWindow.Height = 600 GraphicsWindow.Top = 60 GraphicsWindow.Left = 500 GraphicsWindow.Title = "TextFive" GraphicsWindow.FontSize=20 GraphicsWindow.PenColor="Black" Turtle.Speed = Swiftness TRIANGELFive1="This creates an interim triangle one step nearer to objective perfection." ShapeTRIANGELFive1=Shapes.AddText(TRIANGELFive1) Shapes.Move(ShapeTRIANGELFive1, 20, 520) Shapes.SetText(ShapeTRIANGELFive1, TRIANGELFive1) 'TextWindow.Pause() TRIANGELFive2="Repeat the process..." ShapeTRIANGELFive2=Shapes.AddText(TRIANGELFive2) Shapes.Move(ShapeTRIANGELFive2, 20, 540) Shapes.SetText(ShapeTRIANGELFive2, TRIANGELFive2) 'TextWindow.Pause() EndSub Sub TextSix GraphicsWindow.Show() GraphicsWindow.Width = 800 GraphicsWindow.Height = 600 GraphicsWindow.Top = 60 GraphicsWindow.Left = 500 GraphicsWindow.Title = "TextSix" GraphicsWindow.FontSize=20 GraphicsWindow.PenColor="Black" Turtle.Speed = Swiftness TRIANGELSix1="...until the triangle is nearly equilateral. Calibrating the approximation " ShapeTRIANGELSix1=Shapes.AddText(TRIANGELSix1) Shapes.Move(ShapeTRIANGELSix1, 20, 520) Shapes.SetText(ShapeTRIANGELSix1, TRIANGELSix1) If SelectMode=3 Then TRIANGELSix3="is the subject of a subsequent program. [Tap a key for next random triangle.]" ShapeTRIANGELSix3=Shapes.AddText(TRIANGELSix3) Shapes.Move(ShapeTRIANGELSix3, 20, 540) Shapes.SetText(ShapeTRIANGELSix3, TRIANGELSix3) Else TRIANGELSix2="is the subject of a subsequent program. [Tap a key to return to Start Menu.]" ShapeTRIANGELSix2=Shapes.AddText(TRIANGELSix2) Shapes.Move(ShapeTRIANGELSix2, 20, 540) Shapes.SetText(ShapeTRIANGELSix2, TRIANGELSix2) Endif EndSub '======END LASTHEADER================= '===================================== '========END SUBROUTINES============== End>GHH146.sb< Start>GHH744.sb< GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp GraphicsWindow.MouseDown = OnMousepDown OnMousepDown() '==============WINDOW SETTINGS=========================================== GraphicsWindow.Show() GraphicsWindow.Width = 800 GraphicsWindow.Height = 600 GraphicsWindow.Left = 50 GraphicsWindow.Top = 100 TextWindow.Left = GraphicsWindow.Left TextWindow.Top = GraphicsWindow.Top + 640 '==============SHAPES&OJECTS==================================================== Background = ImageList.LoadImage(Program.directory + "\Pictures\Background.png") Shapes.AddImage(Background) GraphicsWindow.BrushColor = "Green" GraphicsWindow.PenColor = "Green" Ground = Shapes.AddRectangle(800,10) GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.PenColor = "Yellow" Bullet = Shapes.AddRectangle(20,5) Shapes.Move(ground,0,520) GraphicsWindow.BrushColor = "Yellow" PlrAnims[1] = Shapes.AddRectangle(60,100) GraphicsWindow.BrushColor = "Blue PlrAnims[2] = Shapes.AddRectangle(60,100) GraphicsWindow.BrushColor = "Green PlrAnims[3] = Shapes.AddRectangle(60,100) GraphicsWindow.BrushColor = "Red" GraphicsWindow.PenColor = "Red" Blood[i] = Shapes.AddEllipse(30,30) Shapes.Move(Blood,300,200) GraphicsWindow.BrushColor = "Green" GraphicsWindow.PenColor = "Black" Grenade = Shapes.AddEllipse(20,20) '==============VARIABLES================================================= Left = 0 Right = 0 Jump = 0 Shoot = 0 BloodEmmit = 0 Grenadekey = 0 Escape = 0 mode = 0 '==============WUCHT VARIABLES=============== PlayerWX = 0 PlayerWY = 0 BulletX = 0 BloodWX = 0 BloodWY = 0 GrenadeWX = 0 GrenadeWY = 0 '====================================LOOP START================================================== '=============================================================================================== While "True" '===============SUB LINKS======================== PlayerTouchingGround() BloodTouchingGround() VariableDisplay() Variables() GroundTouching() PlayerBoundaries() '===============MOVEMENT======================== Shapes.Move(Player,PlayerLeft+PlayerWX,PlayerTop+PlayerWY) Shapes.Move(blood[i],shapes.GetLeft(Blood[i])+BloodWX,shapes.GetTop(Blood[i])+BloodWY) Shapes.Move(Grenade,Shapes.GetLeft(grenade)+GrenadeWX,Shapes.GetTop(grenade)+GrenadeWY) If (BulletXPos < 800) then BulletX = BulletX + 10 Shapes.Move(Bullet,playerCX + BulletX,PlayerOldCY) endif GrenadeWX = GrenadeWX +1 '===============LOOP CODE======================================================================= If (Escape = 1) Then Program.End() endif If (Right = 1) And (PlayerWX < 3) Then PlayerWX = PlayerWX + 0.5 endif if (Left = 1) And (PlayerWX > -3) then PlayerWX = PlayerWX - 0.5 endif if (Jump = 1) And (PlayerTouchingGround = "true") then PlayerWY = -5 endif if (Shoot = 1) then BulletShot() endif if (BloodEmmit = 1) And (BloodTouchingGround = "True")then EmmitBlood() EndIf if (Grenade = 1) then GrenadeThrow() endif Endwhile '=======================SUBS============================================================================== '========================================================================================================= '=============PLAYER TOUCHING GROUND=========== Sub PlayerTouchingGround '====FALLS WIRD BODEN NICHT BERÜHRT==== if (PlayerTouchingGround = "False") Then If PlayerWY < 5 Then PlayerWY = PlayerWY + 0.1 EndIf PlayerWX = PlayerWX * 0.99 Else '====FALLS WIRD BODEN BERÜHRT==== If Jump = 0 Then PlayerWY = 0 endif PlayerWX = PlayerWX * 0.9 endif endsub '============BLOOD TOUCHING GROUND====== Sub BloodTouchingGround '====FALLS WIRD BODEN NICHT BERÜHRT==== if (BloodTouchingGround = "False") Then If BloodWY < 5 Then BloodWY = BloodWY + 0.1 EndIf BloodWX = BloodWX * 0.999 Else '====FALLS WIRD BODEN BERÜHRT==== If BloodWY < 0 Then BloodWY = -5 else BloodWY = 0 endif BloodWX = BloodWX * 0.95 endif endsub '=======================ON KEY DOWN============================= Sub OnKeyDown Key = GraphicsWindow.LastKey If (Key = "Escape") Then Escape = 1 ElseIf (Key = "Left") Then left = 1 ElseIf (Key = "Right") Then right = 1 ElseIf (Key = "Up") Then Jump = 1 ElseIf (Key = "Space") Then Shoot = 1 ElseIf (Key = "LeftCtrl") Then Grenadekey = 1 ElseIf (Key = "Down") Then BloodEmmit = 1 EndIf EndSub '=======================ON KEY UP================================ Sub OnKeyUp Key = GraphicsWindow.LastKey If (Key = "Escape") Then Escape = 0 ElseIf (Key = "Left") Then left = 0 ElseIf (Key = "Right") Then right = 0 ElseIf (Key = "Up") Then Jump = 0 ElseIf (Key = "Space") Then Shoot = 0 ElseIf (Key = "LeftCtrl") Then Grenadekey = 0 ElseIf (Key = "Down") Then BloodEmmit = 0 EndIf EndSub '=======================ON BULLET SHOT============================ Sub BulletShot PlayerOldCY = PlayerCY BulletX = 0 Shapes.Move(Bullet,playerCX + BulletX,PlayerCY) EndSub '=======================EMMIT BLOOD============================ Sub EmmitBlood Shapes.Move(Blood[i],Playerleft,PlayerTop) BloodWX = (Math.GetRandomNumber(5)-3) BloodWY = (Math.GetRandomNumber(8)-7) endsub '=======================GRENADE THROW============================ Sub GrenadeThrow GrenadeWX = 5 GrenadeWY = -5 endsub '=======================VARIABLE DISPLAY============================ Sub VariableDisplay Textwindow.writeline ("PlayerWX: " + PlayerWX) Textwindow.writeline ("PlayerWY: " + PlayerWY) Textwindow.writeline ("BloodWX: " + BloodWX) Textwindow.writeline ("BloodWY: " + BloodWY) Textwindow.writeline ("Player Bottom: " + PlayerBottom) Textwindow.writeline ("playerright; " + PlayerRight) Textwindow.writeline ("Player Touching Ground? " + PlayerTouchingGround) Textwindow.writeline ("Blood Touching Ground? " + BloodTouchingGround) Textwindow.writeline ("BulletX: " + BulletX) Textwindow.writeline ("Mode: " + Mode) Program.Delay(5) TextWindow.Clear() endsub '=======================GROUND TOUCHING============================ Sub GroundTouching if PlayerBottom > GroundTop Then PlayerTouchingGround = "True" Else PlayerTouchingGround = "False" endif if BloodBottom > GroundTop Then BloodTouchingGround = "True" Else BloodTouchingGround = "False" endif endsub '=======================VARIABLES============================ Sub Variables PlayerBottom = Shapes.GetTop(player)+100 PlayerRight = Shapes.GetLeft(player)+60 PlayerLeft = Shapes.GetLeft(player) PlayerTop = Shapes.GetTop(player) PlayerCX = Shapes.GetLeft(player)+30 PlayerCY = Shapes.GetTop(player)+50 GroundTop = Shapes.GetTop(Ground) BloodBottom = Shapes.GetTop(Blood[i])+30 BloodCX = Shapes.GetLeft(Blood[i])+15 BloodCY = Shapes.GetTop(Blood[i])+15 BulletXPos = Shapes.GetLeft(Bullet) endsub '=======================BOUNDARIES========================== Sub PlayerBoundaries If playerleft < 1 then PlayerWY = 0.5 elseif playerRight > 799 then PlayerWY = -0.5 endif endsub '======================USEFUL STUFF======================================== Sub OnMousepDown mode = mode+1 ' change mode If (mode > 3) Then mode = 1 EndIf 'Hide all balls For i = 1 To Array.GetItemCount(PlrAnims) Shapes.Move(PlrAnims[i],100,100) EndFor 'Set current ball as current Player = PlrAnims[mode] EndSub End>GHH744.sb< Start>GHJ783.sb< ' Chiko-chan in the Small Basic World ' Program by Nonki Takahashi ' 2018-08-31 22:41:29 Shapes generated by Shapes 2.3b. GraphicsWindow.Title = "Chiko" SB_Workaround() gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BackgroundColor = "#FFFF33" ' initialize shapes Shapes_Init() ' add shapes scale = 1 angle = 0 iMin = 1 iMax = Array.GetItemCount(shape) Shapes_Add() Sub Shapes_Init ' Shapes | Initialize shapes data ' return shX, shY - current position of shapes ' return shape - array of shapes shX = 168 ' x offset shY = 70 ' y offset shape = "" shape[1] = "func=ell;x=48;y=151;width=73;height=73;bc=Transparent;pc=#FFEBDB;pw=16;rem=arm;" shape[2] = "func=ell;x=145;y=152;width=73;height=73;bc=Transparent;pc=#FFEBDB;pw=16;rem=arm;" shape[3] = "func=rect;x=103;y=254;width=18;height=41;bc=#FFEBDB;pw=0;rem=leg;" shape[4] = "func=rect;x=149;y=254;width=18;height=41;bc=#FFEBDB;pw=0;rem=leg;" shape[5] = "func=rect;x=103;y=290;width=18;height=30;bc=#FFFFFF;pw=0;rem=sock;" shape[6] = "func=rect;x=149;y=290;width=18;height=30;bc=#FFFFFF;pw=0;rem=sock;" shape[7] = "func=rect;x=91;y=137;width=86;height=129;bc=#FF5794;pw=0;rem=onepiece;" shape[8] = "func=tri;x=75;y=138;x1=16;y1=0;x2=0;y2=128;x3=33;y3=128;bc=#FF5794;pw=0;rem=onepiece;" shape[9] = "func=tri;x=156;y=140;x1=20;y1=0;x2=0;y2=126;x3=40;y3=126;bc=#FF5794;pw=0;rem=onepiece;" shape[10] = "func=rect;x=75;y=308;width=46;height=13;bc=#AF5B31;pw=0;rem=shoe;" shape[11] = "func=ell;x=75;y=299;width=33;height=21;bc=#AF5B31;pw=0;rem=shoe;" shape[12] = "func=ell;x=159;y=298;width=33;height=21;bc=#AF5B31;pw=0;rem=shoe;" shape[13] = "func=rect;x=146;y=308;width=46;height=13;bc=#AF5B31;pw=0;rem=shoe;" shape[14] = "func=rect;x=65;y=139;width=25;height=35;angle=43;bc=#FF5794;pw=0;" shape[15] = "func=rect;x=172;y=139;width=25;height=35;angle=312;bc=#FF5794;pw=0;" shape[16] = "func=ell;x=103;y=133;width=26;height=27;bc=#FFFFFF;pw=0;" shape[17] = "func=ell;x=136;y=132;width=26;height=27;bc=#FFFFFF;pw=0;" shape[18] = "func=rect;x=128;y=139;width=9;height=33;bc=#FFFFFF;pw=0;" shape[19] = "func=ell;x=43;y=0;width=183;height=58;bc=#000000;pw=0;" shape[20] = "func=ell;x=193;y=10;width=53;height=91;angle=332;bc=#000000;pw=0;rem=hair;" shape[21] = "func=ell;x=19;y=10;width=64;height=96;angle=32;bc=#000000;pw=0;rem=hair;" shape[22] = "func=ell;x=40;y=90;width=25;height=30;bc=#F6CFB1;pw=0;rem=ear;" shape[23] = "func=ell;x=201;y=90;width=25;height=30;bc=#F6CFB1;pw=0;rem=ear;" shape[24] = "func=ell;x=75;y=110;width=100;height=50;bc=#33000000;pw=0;rem=shadow;" shape[25] = "func=ell;x=55;y=76;width=155;height=75;bc=#FFEBDB;pw=0;rem=face;" shape[26] = "func=ell;x=54;y=47;width=46;height=89;angle=6;bc=#FFEBDB;pw=0;rem=face;" shape[27] = "func=ell;x=164;y=46;width=46;height=89;angle=350;bc=#FFEBDB;pw=0;rem=face;" shape[28] = "func=rect;x=80;y=47;width=106;height=51;bc=#FFEBDB;pw=0;rem=face;" shape[29] = "func=ell;x=118;y=121;width=32;height=15;bc=#D10000;pw=0;rem=mouth;" shape[30] = "func=tri;x=132;y=120;x1=6;y1=0;x2=0;y2=14;x3=13;y3=14;angle=178;bc=#FFFFFF;pw=0;rem=tooth;" shape[31] = "func=rect;x=112;y=116;width=43;height=12;bc=#FFEBDB;pw=0;rem=mouth;" shape[32] = "func=tri;x=5;y=70;x1=15;y1=0;x2=0;y2=31;x3=31;y3=31;angle=338;bc=#000000;pw=0;" shape[33] = "func=tri;x=230;y=64;x1=15;y1=0;x2=0;y2=31;x3=31;y3=31;angle=20;bc=#000000;pw=0;" shape[34] = "func=tri;x=17;y=90;x1=15;y1=0;x2=0;y2=22;x3=31;y3=22;angle=182;bc=#000000;pw=0;" shape[35] = "func=tri;x=219;y=89;x1=15;y1=0;x2=0;y2=22;x3=31;y3=22;angle=168;bc=#000000;pw=0;" shape[36] = "func=tri;x=35;y=79;x1=12;y1=0;x2=0;y2=32;x3=25;y3=32;angle=166;bc=#000000;pw=0;" shape[37] = "func=tri;x=204;y=77;x1=12;y1=0;x2=0;y2=32;x3=25;y3=32;angle=189;bc=#000000;pw=0;" shape[38] = "func=ell;x=82;y=72;width=28;height=55;bc=#FFFFFF;pc=#FCB045;pw=1;rem=eye;" shape[39] = "func=ell;x=153;y=72;width=28;height=55;bc=#FFFFFF;pc=#FCB045;pw=1;rem=eye;" shape[40] = "func=ell;x=92;y=79;width=16;height=35;bc=#000000;pw=0;rem=eye;" shape[41] = "func=ell;x=163;y=76;width=17;height=37;bc=#000000;pw=0;rem=eye;" shape[42] = "func=rect;x=81;y=71;width=35;height=12;angle=9;bc=#FFEBDB;pw=0;rem=eye;" shape[43] = "func=rect;x=148;y=69;width=35;height=12;angle=346;bc=#FFEBDB;pw=0;rem=eye;" shape[44] = "func=line;x=84;y=81;x1=0;y1=0;x2=25;y2=4;pc=#000000;pw=2;rem=lashes;" shape[45] = "func=line;x=155;y=77;x1=0;y1=5;x2=24;y2=0;pc=#000000;pw=2;rem=lashes;" shape[46] = "func=line;x=87;y=50;x1=0;y1=0;x2=27;y2=11;pc=#000000;pw=2;rem=eyebrow;" shape[47] = "func=line;x=150;y=50;x1=0;y1=10;x2=25;y2=0;pc=#000000;pw=2;rem=eyebrow;" EndSub Sub Math_CartesianToPolar ' Math | convert cartesian coodinate to polar coordinate ' param x, y - cartesian coordinate ' return r, a - polar coordinate r = Math.SquareRoot(x * x + y * y) If x = 0 And y > 0 Then a = 90 ' [degree] ElseIf x = 0 And y < 0 Then a = -90 ElseIf x = 0 Then a = 0 Else a = Math.ArcTan(y / x) * 180 / Math.Pi EndIf If x < 0 Then a = a + 180 ElseIf x > 0 And y < 0 Then a = a + 360 EndIf EndSub Sub SB_RotateWorkaround ' Small Basic | Rotate workaround for Silverlight ' param shp - current shape ' param x, y - original coordinate ' param alpha - angle [radian] ' returns x, y - workaround coordinate If shp["func"] = "tri" Then x1 = -Math.Floor(shp["x3"] / 2) y1 = -Math.Floor(shp["y3"] / 2) ElseIf shp["func"] = "line" Then x1 = -Math.Floor(Math.Abs(shp["x1"] - shp["x2"]) / 2) y1 = -Math.Floor(Math.Abs(shp["y1"] - shp["y2"]) / 2) EndIf ox = x - x1 oy = y - y1 x = x1 * Math.Cos(alpha) - y1 * Math.Sin(alpha) + ox y = x1 * Math.Sin(alpha) + y1 * Math.Cos(alpha) + oy EndSub Sub SB_Workaround ' Small Basic | Workaround for Silverlight ' returns silverlight - "True" if in remote color = GraphicsWindow.GetPixel(0, 0) If Text.GetLength(color) > 7 Then silverlight = "True" msWait = 300 Else silverlight = "False" EndIf EndSub Sub Shapes_Add ' Shapes | add shapes as shapes data ' param iMin, iMax - shape indices to add ' param shape - array of shapes ' param scale - 1 if same scale ' return shWidth, shHeight - total size of shapes ' return shAngle - current angle of shapes Stack.PushValue("local", i) Stack.PushValue("local", x) Stack.PushValue("local", y) Shapes_CalcWidthAndHeight() s = scale For i = iMin To iMax shp = shape[i] GraphicsWindow.PenWidth = shp["pw"] * s If shp["pw"] > 0 Then GraphicsWindow.PenColor = shp["pc"] EndIf If Text.IsSubText("rect|ell|tri|text", shp["func"]) Then GraphicsWindow.BrushColor = shp["bc"] EndIf If shp["func"] = "rect" Then shp["obj"] = Shapes.AddRectangle(shp["width"] * s, shp["height"] * s) ElseIf shp["func"] = "ell" Then shp["obj"] = Shapes.AddEllipse(shp["width"] * s, shp["height"] * s) ElseIf shp["func"] = "tri" Then shp["obj"] = Shapes.AddTriangle(shp["x1"] * s, shp["y1"] * s, shp["x2"] * s, shp["y2"] * s, shp["x3"] * s, shp["y3"] * s) ElseIf shp["func"] = "line" Then shp["obj"] = Shapes.AddLine(shp["x1"] * s, shp["y1"] * s, shp["x2"] * s, shp["y2"] * s) ElseIf shp["func"] = "text" Then If silverlight Then fs = Math.Floor(shp["fs"] * 0.9) Else fs = shp["fs"] EndIf GraphicsWindow.FontSize = fs * s GraphicsWindow.FontName = shp["fn"] shp["obj"] = Shapes.AddText(shp["text"]) EndIf x = shp["x"] y = shp["y"] shp["rx"] = x shp["ry"] = y If silverlight And Text.IsSubText("tri|line", shp["func"]) Then alpha = Math.GetRadians(shp["angle"]) SB_RotateWorkaround() shp["wx"] = x shp["wy"] = y EndIf Shapes.Move(shp["obj"], shX + x * s, shY + y * s) If Text.IsSubText("rect|ell|tri|text", shp["func"]) And (shp["angle"] <> 0) And (shp["angle"] <> "") Then Shapes.Rotate(shp["obj"], shp["angle"]) EndIf shape[i] = shp EndFor shAngle = 0 y = Stack.PopValue("local") x = Stack.PopValue("local") i = Stack.PopValue("local") EndSub Sub Shapes_CalcRotatePos ' Shapes | Calculate position for rotated shape ' param["x"], param["y"] - position of a shape ' param["width"], param["height"] - size of a shape ' param ["cx"], param["cy"] - center of rotation ' param ["angle"] - rotate angle ' return x, y - rotated position of a shape _cx = param["x"] + param["width"] / 2 _cy = param["y"] + param["height"] / 2 x = _cx - param["cx"] y = _cy - param["cy"] Math_CartesianToPolar() a = a + param["angle"] x = r * Math.Cos(a * Math.Pi / 180) y = r * Math.Sin(a * Math.Pi / 180) _cx = x + param["cx"] _cy = y + param["cy"] x = _cx - param["width"] / 2 y = _cy - param["height"] / 2 EndSub Sub Shapes_CalcWidthAndHeight ' Shapes | Calculate total width and height of shapes ' param iMin, iMax - shape indices to add ' return shWidth, shHeight - total size of shapes For i = iMin To iMax shp = shape[i] If shp["func"] = "tri" Or shp["func"] = "line" Then xmin = shp["x1"] xmax = shp["x1"] ymin = shp["y1"] ymax = shp["y1"] If shp["x2"] < xmin Then xmin = shp["x2"] EndIf If xmax < shp["x2"] Then xmax = shp["x2"] EndIf If shp["y2"] < ymin Then ymin = shp["y2"] EndIf If ymax < shp["y2"] Then ymax = shp["y2"] EndIf If shp["func"] = "tri" Then If shp["x3"] < xmin Then xmin = shp["x3"] EndIf If xmax < shp["x3"] Then xmax = shp["x3"] EndIf If shp["y3"] < ymin Then ymin = shp["y3"] EndIf If ymax < shp["y3"] Then ymax = shp["y3"] EndIf EndIf shp["width"] = xmax - xmin shp["height"] = ymax - ymin EndIf If i = 1 Then shWidth = shp["x"] + shp["width"] shHeight = shp["y"] + shp["height"] Else If shWidth < shp["x"] + shp["width"] Then shWidth = shp["x"] + shp["width"] EndIf If shHeight < shp["y"] + shp["height"] Then shHeight = shp["y"] + shp["height"] EndIf EndIf shape[i] = shp EndFor EndSub Sub Shapes_Move ' Shapes | Move shapes ' param iMin, iMax - shape indices to add ' param shape - array of shapes ' param scale - to zoom ' param x, y - position to move ' return shX, shY - new position of shapes Stack.PushValue("local", i) s = scale shX = x shY = y For i = iMin To iMax shp = shape[i] If silverlight And Text.IsSubText("tri|line", shp["func"]) Then _x = shp["wx"] _y = shp["wy"] Else _x = shp["rx"] _y = shp["ry"] EndIf Shapes.Move(shp["obj"], shX + _x * s, shY + _y * s) EndFor i = Stack.PopValue("local") EndSub Sub Shapes_Remove ' Shapes | Remove shapes ' param iMin, iMax - shapes indices to remove ' param shape - array of shapes Stack.PushValue("local", i) For i = iMin To iMax shp = shape[i] Shapes.Remove(shp["obj"]) EndFor i = Stack.PopValue("local") EndSub Sub Shapes_Rotate ' Shapes | Rotate shapes ' param iMin, iMax - shapes indices to rotate ' param shape - array of shapes ' param cx, cy - rotation center ' param scale - to zoom ' param angle - to rotate Stack.PushValue("local", i) Stack.PushValue("local", x) Stack.PushValue("local", y) s = scale param["angle"] = angle If cx <> "" Then param["cx"] = cx Else cx = "" ' to avoid syntax error param["cx"] = shWidth / 2 EndIf If cy <> "" Then param["cy"] = cy Else cy = "" ' to avoid syntax error param["cy"] = shHeight / 2 EndIf For i = iMin To iMax shp = shape[i] param["x"] = shp["x"] param["y"] = shp["y"] param["width"] = shp["width"] param["height"] = shp["height"] Shapes_CalcRotatePos() shp["rx"] = x shp["ry"] = y If silverlight And Text.IsSubText("tri|line", shp["func"]) Then alpha = Math.GetRadians(angle + shp["angle"]) SB_RotateWorkAround() shp["wx"] = x shp["wy"] = y EndIf Shapes.Move(shp["obj"], shX + x * s, shY + y * s) Shapes.Rotate(shp["obj"], angle + shp["angle"]) shape[i] = shp EndFor y = Stack.PopValue("local") x = Stack.PopValue("local") i = Stack.PopValue("local") EndSub End>GHJ783.sb< Start>GHK700-0.sb< ' Ants walking around elephant ' 1st step ; make an elephant and 3 ants // GHK700 ' 2nd step ; Ant approaches the elephant // GHK700-0 GraphicsWindow.Width = 1000 GraphicsWindow.Height = 420 GraphicsWindow.BackgroundColor = "rosybrown" add_Elephant() Shapes_Init() Shapes_Add() other_ant() CenterPosition() ' No31 = mouth While "True" TM=TM+1 ant_walking_around_elephant() '<--------- Program.Delay(50) If Math.Remainder(TM,10)=0 Then Shapes.HideShape(ele["oEye1"]) Shapes.HideShape(ele["oEye2"]) Program.Delay(100) Shapes.ShowShape(ele["oEye1"]) Shapes.ShowShape(ele["oEye2"]) EndIf endwhile Sub ant_walking_around_elephant SearchElephant() ' search angle to elephant MovL= 50+Math.GetRandomNumber(30) ' random moving length moveant() ' ant moves XYC[j]="X="+(Shapes.GetLeft(shape[j][31]["obj"])-25)+";Y="+ (Shapes.Gettop(shape[j][31]["obj"])+25) antdistance() ' distance from ant to sugar endsub Sub antdistance For j=1 To 2 x[j][31]=Shapes.GetLeft(shape[j][31]["obj"])+shape[j][31]["width"]*s/2 y[j][31]=Shapes.Gettop( shape[j][31]["obj"])+shape[j][31]["height"]*s/2 distance[j]=Math.SquareRoot(Math.Power((x[j][31]-X0),2)+Math.Power((y[j][31]-y0),2)) ' current distance EndFor EndSub Sub moveant For k=1 To 10 For j=1 To 2 ddx[j]=-MovL*Math.Cos(Math.GetRadians(targetangle[j]))/50 ddy[j]=-MovL*Math.Sin(Math.GetRadians(targetangle[j]))/25 For i=1 To 31 Shapes.Move(shape[j][i]["obj"],Shapes.GetLeft(shape[j][i]["obj"])+ddx[j],shapes.GetTop(shape[j][i]["obj"])+ddy[j]) EndFor Program.Delay(10) EndFor EndFor EndSub Sub SearchElephant dd0=0.00000001 ' to avoid devide zero error For j=1 To 2 deg[j]=deg0[j]+(30- Math.GetRandomNumber(60)) ' random direction if distance[j]GHL987.sb< Start>GHN102.sb< GraphicsWindow.PenColor = "#8B4513" GraphicsWindow.Width = 1500 GraphicsWindow.Height = 800 For i = 1 To 20 Step 6 GraphicsWindow.DrawEllipse(375 - i, 450 - i, i * 2, i * 2 ) EndFor For i = 1 To 20 Step 6 GraphicsWindow.DrawEllipse(375 - i, 410 - i, i * 2, i * 2) EndFor For i = 1 To 20 Step 6 GraphicsWindow.DrawEllipse(375 - i, 370 - i, i * 2, i * 2) EndFor For i = 1 To 20 Step 6 GraphicsWindow.DrawEllipse(375 - i, 330 - i, i * 2, i * 2) EndFor For i = 1 To 20 Step 6 GraphicsWindow.DrawEllipse(375 - i, 290 - i, i * 2, i * 2) EndFor For i = 1 To 20 Step 6 GraphicsWindow.DrawEllipse(375 - i, 250 - i, i * 2, i * 2) EndFor For i = 1 To 20 Step 6 GraphicsWindow.DrawEllipse(375 - i, 210 - i, i * 2, i * 2) EndFor For i = 1 To 20 Step 6 GraphicsWindow.DrawEllipse(375 - i, 170 - i, i * 2, i * 2) EndFor For i = 1 To 20 Step 6 GraphicsWindow.DrawEllipse(975 - i, 450 - i, i * 2, i * 2 ) EndFor For i = 1 To 20 Step 6 GraphicsWindow.DrawEllipse(975 - i, 410 - i, i * 2, i * 2) EndFor For i = 1 To 20 Step 6 GraphicsWindow.DrawEllipse(975 - i, 370 - i, i * 2, i * 2) EndFor For i = 1 To 20 Step 6 GraphicsWindow.DrawEllipse(975 - i, 330 - i, i * 2, i * 2) EndFor For i = 1 To 20 Step 6 GraphicsWindow.DrawEllipse(975 - i, 290 - i, i * 2, i * 2) EndFor For i = 1 To 20 Step 6 GraphicsWindow.DrawEllipse(975 - i, 250 - i, i * 2, i * 2) EndFor For i = 1 To 20 Step 6 GraphicsWindow.DrawEllipse(975 - i, 210 - i, i * 2, i * 2) EndFor For i = 1 To 20 Step 6 GraphicsWindow.DrawEllipse(975 - i, 170 - i, i * 2, i * 2) EndFor Turtle.PenUp() Turtle.Speed=10 GraphicsWindow.PenWidth = 2 Turtle.MoveTo(375,350) Turtle.PenDown() Turtle.MoveTo(975,346) Turtle.PenUp() turtle.MoveTo(975,310) Turtle.PenDown() Turtle.MoveTo(375,310) Turtle.PenUp() Turtle.MoveTo(375,270) Turtle.PenDown() Turtle.MoveTo(975,280) Turtle.PenUp() Turtle.MoveTo(975,230) Turtle.PenDown() Turtle.MoveTo(375,239) Turtle.PenUp() Turtle.MoveTo(375,190) Turtle.PenDown() Turtle.MoveTo(975,200) Turtle.PenUp() Turtle.MoveTo(375,470) Turtle.PenDown() Turtle.MoveTo(975,468) Turtle.PenUp() Turtle.MoveTo(975,430) Turtle.PenDown() Turtle.MoveTo(375,440) Turtle.PenUp() Turtle.MoveTo(375,390) Turtle.PenDown() Turtle.MoveTo(975,400) GraphicsWindow.BrushColor = "#D2691E" GraphicsWindow.fillTriangle(995,150,355,150,680,15) Turtle.PenUp() Turtle.MoveTo(550,310) Turtle.PenDown() Turtle.MoveTo(550,220) Turtle.MoveTo(725,220) Turtle.MoveTo(550,221) Turtle.MoveTo(725,221) Turtle.MoveTo(550,222) Turtle.MoveTo(725,222) Turtle.MoveTo(550,223) Turtle.MoveTo(725,223) Turtle.MoveTo(550,224) Turtle.MoveTo(725,224) Turtle.MoveTo(550,225) Turtle.MoveTo(725,225) Turtle.MoveTo(550,226) Turtle.MoveTo(725,226) Turtle.MoveTo(550,227) Turtle.MoveTo(725,227) Turtle.MoveTo(550,226) Turtle.MoveTo(725,226) Turtle.MoveTo(550,225) Turtle.MoveTo(725,225) Turtle.MoveTo(724,300) Turtle.MoveTo(724,217) Turtle.MoveTo(725,300) Turtle.MoveTo(725,217) Turtle.MoveTo(726,300) Turtle.MoveTo(726,217) Turtle.MoveTo(727,300) Turtle.MoveTo(727,217) Turtle.MoveTo(728,300) Turtle.MoveTo(728,217) Turtle.MoveTo(729,300) Turtle.MoveTo(729,217) Turtle.MoveTo(730,300) Turtle.MoveTo(730,217) Turtle.MoveTo(731,301) Turtle.MoveTo(550,301) Turtle.MoveTo(731,301) Turtle.MoveTo(550,301) Turtle.MoveTo(731,302) Turtle.MoveTo(550,302) Turtle.MoveTo(731,302) Turtle.MoveTo(550,303) Turtle.MoveTo(731,303) Turtle.MoveTo(550,303) Turtle.MoveTo(731,304) Turtle.MoveTo(550,304) Turtle.MoveTo(731,304) Turtle.MoveTo(550,305) Turtle.MoveTo(731,305) Turtle.MoveTo(550,305) Turtle.MoveTo(731,306) Turtle.MoveTo(550,306) Turtle.MoveTo(731,306) Turtle.MoveTo(550,306) Turtle.MoveTo(731,306) Turtle.MoveTo(550,306) Turtle.MoveTo(731,306) Turtle.MoveTo(550,307) Turtle.MoveTo(731,307) Turtle.MoveTo(550,307) Turtle.MoveTo(731,306) Turtle.MoveTo(550,306) Turtle.MoveTo(731,306) Turtle.MoveTo(550,308) Turtle.MoveTo(731,308) Turtle.MoveTo(550,309) Turtle.MoveTo(731,309) Turtle.MoveTo(550,309) Turtle.MoveTo(550,220) Turtle.MoveTo(550,309) Turtle.MoveTo(551,220) Turtle.MoveTo(551,309) Turtle.MoveTo(551,220) Turtle.MoveTo(552,309) Turtle.MoveTo(552,220) Turtle.MoveTo(552,309) Turtle.MoveTo(553,220) Turtle.MoveTo(553,309) Turtle.MoveTo(553,220) Turtle.MoveTo(554,309) Turtle.MoveTo(554,220) Turtle.MoveTo(554,309) Turtle.MoveTo(555,220) Turtle.MoveTo(555,309) Turtle.MoveTo(556,220) Turtle.MoveTo(556,309) Turtle.MoveTo(556,220) Turtle.MoveTo(557,309) Turtle.MoveTo(557,220) Turtle.MoveTo(557,309) Turtle.MoveTo(558,220) Turtle.MoveTo(558,267) Turtle.MoveTo(731,267) Turtle.MoveTo(558,267) Turtle.MoveTo(731,267) Turtle.MoveTo(558,268) Turtle.MoveTo(731,268) Turtle.MoveTo(558,268) Turtle.MoveTo(731,269) Turtle.MoveTo(558,269) Turtle.MoveTo(731,269) Turtle.MoveTo(558,266) Turtle.MoveTo(731,266) Turtle.MoveTo(558,266) Turtle.MoveTo(731,265) Turtle.MoveTo(558,265) Turtle.MoveTo(731,265) Turtle.MoveTo(558,264) Turtle.MoveTo(731,264) Turtle.MoveTo(558,264) Turtle.MoveTo(731,263) Turtle.PenUp() Turtle.MoveTo(637,220) Turtle.PenDown() Turtle.MoveTo(637,220) Turtle.MoveTo(637,309) Turtle.MoveTo(637,220) Turtle.MoveTo(636,309) Turtle.MoveTo(636,220) Turtle.MoveTo(636,309) Turtle.MoveTo(635,220) Turtle.MoveTo(635,309) Turtle.MoveTo(635,220) Turtle.MoveTo(638,309) Turtle.MoveTo(638,220) Turtle.MoveTo(638,309) Turtle.MoveTo(638,220) Turtle.MoveTo(639,309) Turtle.MoveTo(639,220) Turtle.MoveTo(639,309) Turtle.MoveTo(634,220) Turtle.MoveTo(634,309) Turtle.MoveTo(634,220) Turtle.MoveTo(634,309) Turtle.MoveTo(637,220) Turtle.MoveTo(637,309) Turtle.MoveTo(637,220) Turtle.MoveTo(637,309) Turtle.MoveTo(637,220) Turtle.MoveTo(637,309) Turtle.MoveTo(637,220) Turtle.MoveTo(637,309) Turtle.MoveTo(637,220) Turtle.MoveTo(637,309) Turtle.MoveTo(637,220) Turtle.MoveTo(637,309) Turtle.PenUp() GraphicsWindow.BrushColor = "#778899 " Turtle.MoveTo(870,465) Turtle.PenDown() GraphicsWindow.PenWidth = 130 Turtle.MoveTo(865,238) GraphicsWindow.PenWidth = 2 GraphicsWindow.PenColor="#228B22" Turtle.X=0 Turtle.y=500 Turtle.Turn(7) Turtle.Speed=10 Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(180) Turtle.Move(82) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.Turn(-166) Turtle.Move(40) Turtle.Turn(166) Turtle.Move(40) Turtle.X=500 Turtle.y=500 angle = 30 delta = 10 distance = 60 Turtle.Speed = 10 GraphicsWindow.PenColor = "#9ACD32" DrawTree() Sub DrawTree If (distance > 0) Then Turtle.Move(distance) Turtle.Turn(angle) Stack.PushValue("distance", distance) distance = distance - delta DrawTree() Turtle.Turn(-angle * 2) DrawTree() Turtle.Turn(angle) distance = Stack.PopValue("distance") Turtle.Move(-distance) EndIf EndSub Turtle.X=600 Turtle.y=500 angle = 30 delta = 10 distance = 60 Turtle.Speed = 10 GraphicsWindow.PenColor = "#556B2F" DrawTree() Sub d If (distance > 0) Then Turtle.Move(distance) Turtle.Turn(angle) Stack.PushValue("distance", distance) distance = distance - delta DrawTree() Turtle.Turn(-angle * 2) DrawTree() Turtle.Turn(angle) distance = Stack.PopValue("distance") Turtle.Move(-distance) EndIf EndSub Turtle.X=700 Turtle.y=500 angle = 30 delta = 10 distance = 60 Turtle.Speed = 10 GraphicsWindow.PenColor = "#006400" DrawTree() Sub s If (distance > 0) Then Turtle.Move(distance) Turtle.Turn(angle) Stack.PushValue("distance", distance) distance = distance - delta DrawTree() Turtle.Turn(-angle * 2) DrawTree() Turtle.Turn(angle) distance = Stack.PopValue("distance") Turtle.Move(-distance) EndIf EndSub Turtle.X=1200 Turtle.y=200 GraphicsWindow.PenColor="#FFFF00" Turtle.Speed=10 For i = 1 To 130 Turtle.Move(230) Turtle.Turn(122) EndFor End>GHN102.sb< Start>GHN424.sb< GraphicsWindow.Title = "LetterDraw" GraphicsWindow.BackgroundColor = "SteelBlue" GraphicsWindow.BrushColor = "White" GraphicsWindow.FontSize = "25" GraphicsWindow.DrawText(100,20,"LetterDraw Basic 13") GraphicsWindow.FontSize = "15" GraphicsWindow.DrawText(100,50,"Loading Application. Please Wait.") GraphicsWindow.Width = "650" GraphicsWindow.Height = "300" GraphicsWindow.PenColor = "Yellow" GraphicsWindow.DrawLine(0,60,650,300) GraphicsWindow.PenColor = "Red" GraphicsWindow.DrawLine(0,70,650,300) GraphicsWindow.PenColor = "Black" GraphicsWindow.DrawLine(0,80,650,300) Turtle.X = "0" Turtle.Y = "900" Turtle.PenDown() Turtle.Speed = 4 Turtle.Move(100) GraphicsWindow.Hide() GraphicsWindow.Clear() Application() Sub Application GraphicsWindow.Title = "LetterDraw" GraphicsWindow.Show() GraphicsWindow.Height = 500 GraphicsWindow.Width = 1000 buttonclicked = 0 inputdone = 0 m = 200 n = 0 doingreset = 0 firstinput = 1 'Start Page' GraphicsWindow.BrushColor = "black" textbox2 = Controls.AddTextBox(265, 50) GraphicsWindow.DrawBoundText(300, 20, 100, "Pen Colour:") textbox = Controls.AddTextBox(465, 50) GraphicsWindow.DrawBoundText(500, 20, 100, "Enter Text:") textbox3 = Controls.AddTextBox(665, 50) GraphicsWindow.DrawBoundText(680, 20, 150, "Background Colour:") button = Controls.AddButton("Go", 510, 75) GraphicsWindow.BrushColor = "black" GraphicsWindow.DrawRectangle(10, 10, 35, 21) GraphicsWindow.DrawRectangle(940, 10, 50, 21) GraphicsWindow.DrawBoundText(12, 12, 46, "Help") GraphicsWindow.DrawBoundText(942, 12, 50, "Colours") GraphicsWindow.KeyDown = Key GraphicsWindow.MouseDown = Help Controls.ButtonClicked = Click EndSub Sub Click If Controls.LastClickedButton = button Then If firstinput = 1 then colour = Controls.GetTextBoxText(textbox2) Text.ConvertToLowerCase(colour) bgcolour = Controls.GetTextBoxText(textbox3) Text.ConvertToLowerCase(bgcolour) EndIf input = Controls.GetTextBoxText(textbox) buttonclicked = 1 EndIf EndSub buttonloop: If buttonclicked = 0 Then If firstinput = 0 then GraphicsWindow.BrushColor = bgcolour GraphicsWindow.PenColor = bgcolour GraphicsWindow.FillRectangle(290, 10, 120, 30) GraphicsWindow.FillRectangle(670, 10, 130, 30) Endif Goto buttonloop Else buttonclicked = 0 EndIf 'End Start Page' 'Drawing' Turtle.Speed = 10 Default() If colour = "random" then GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor() Else GraphicsWindow.PenColor = colour Endif If bgcolour = "random" then GraphicsWindow.BackgroundColor = GraphicsWindow.GetRandomColor() Elseif bgcolour = "" then GraphicsWindow.BackgroundColor = "white" bgcolour = "white" Else GraphicsWindow.BackgroundColor = bgcolour Endif For k = 1 To Text.GetLength(input) letter[k] = Text.GetSubText(input, k, 1) letter[k] = Text.ConvertToUpperCase(letter[k]) 'Letters' n = n + 1 If letter[k] = "A" Then Turtle.Turn(20) Turtle.Move(43) Turtle.Turn(140) Turtle.Move(43) Turtle.Turn(180) Turtle.Move(20) Turtle.Turn(-70) Turtle.Move(15) Default() ElseIf letter[k] = "B" Then Turtle.Move(40) Turtle.Turn(90) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(5) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(180) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(5) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Default() ElseIf letter[k] = "C" Then Turtle.PenUp() Turtle.Turn(90) Turtle.Move(20) Turtle.Turn(180) Turtle.PenDown() Turtle.Move(15) Turtle.Turn(45) Turtle.Move(15) Turtle.Turn(45) Turtle.Move(20) Turtle.Turn(45) Turtle.Move(15) Turtle.Turn(45) Turtle.Move(15) Default() ElseIf letter[k] = "D" Then Turtle.Move(40) Turtle.Turn(90) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(15) Turtle.Turn(45) Turtle.Move(20) Turtle.Turn(45) Turtle.Move(15) Turtle.Turn(45) Turtle.Move(10) Default() ElseIf letter[k] = "E" Then Turtle.Move(40) Turtle.Turn(90) Turtle.Move(25) Turtle.Turn(180) Turtle.Move(25) Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(180) Turtle.Move(20) Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(-90) Turtle.Move(25) Default() ElseIf letter[k] = "F" Then Turtle.Move(40) Turtle.Turn(90) Turtle.Move(25) Turtle.Turn(180) Turtle.Move(25) Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(180) Turtle.Move(20) Turtle.Turn(-90) Turtle.Move(20) Default() ElseIf letter[k] = "G" Then Turtle.Move(40) Turtle.Turn(90) Turtle.Move(25) Turtle.Turn(180) Turtle.Move(25) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(25) Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(-90) Turtle.Move(10) Default() ElseIf letter[k] = "H" Then Turtle.Move(40) Turtle.Turn(180) Turtle.Move(20) Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(90) Turtle.Move(20) Turtle.Turn(180) Turtle.Move(40) Default() ElseIf letter[k] = "I" Then Turtle.Turn(90) Turtle.Move(26) Turtle.Turn(180) Turtle.Move(13) Turtle.Turn(90) Turtle.Move(40) Turtle.Turn(90) Turtle.Move(13) Turtle.Turn(180) Turtle.Move(26) Default() ElseIf letter[k] = "J" Then Turtle.Move(10) Turtle.Turn(180) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(-90) Turtle.Move(40) Default() ElseIf letter[k] = "K" Then Turtle.Move(40) Turtle.Turn(180) Turtle.Move(20) Turtle.Turn(-140) Turtle.Move(23) Turtle.Turn(180) Turtle.Move(23) Turtle.Angle = 140 Turtle.Move(25) Default() ElseIf letter[k] = "L" Then Turtle.Move(40) Turtle.Turn(180) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(25) Default() ElseIf letter[k] = "M" Then Turtle.Move(40) Turtle.Turn(150) Turtle.Move(20) Turtle.Turn(-120) Turtle.Move(20) Turtle.Angle = 180 Turtle.Move(40) Default() ElseIf letter[k] = "N" Then Turtle.Move(40) Turtle.Turn(150) Turtle.Move(46) Turtle.Angle = 0 Turtle.Move(40) Default() ElseIf letter[k] = "O" Then Turtle.PenUp() Turtle.Turn(90) Turtle.Move(20) Turtle.Turn(180) Turtle.PenDown() Turtle.Move(10) Turtle.Turn(45) Turtle.Move(15) Turtle.Turn(45) Turtle.Move(20) Turtle.Turn(45) Turtle.Move(15) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(15) Turtle.Turn(45) Turtle.Move(20) Turtle.Turn(45) Turtle.Move(15) Default() ElseIf letter[k] = "P" Then Turtle.Move(40) Turtle.Turn(90) Turtle.Move(25) Turtle.Turn(90) Turtle.Move(20) Turtle.Turn(90) Turtle.Move(25) Default() ElseIf letter[k] = "Q" Then Turtle.PenUp() Turtle.Turn(90) Turtle.Move(20) Turtle.Turn(180) Turtle.PenDown() Turtle.Move(10) Turtle.Turn(45) Turtle.Move(15) Turtle.Turn(45) Turtle.Move(20) Turtle.Turn(45) Turtle.Move(15) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(15) Turtle.Turn(45) Turtle.Move(20) Turtle.Turn(45) Turtle.Move(15) Turtle.Turn(180) Turtle.Move(7.5) Turtle.Turn(90) Turtle.Move(5) Turtle.Turn(180) Turtle.Move(10) Default() ElseIf letter[k] = "R" Then Turtle.Move(40) Turtle.Turn(90) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(5) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(225) Turtle.Move(28) Default() ElseIf letter[k] = "S" Then Turtle.PenUp() Turtle.Move(10) Turtle.PenDown() Turtle.Turn(135) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(5) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Default() ElseIf letter[k] = "T" Then Turtle.PenUp() Turtle.Turn(90) Turtle.Move(10) Turtle.Turn(-90) Turtle.PenDown() Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(10) Turtle.Turn(180) Turtle.Move(20) Default() ElseIf letter[k] = "U" Then Turtle.PenUp() Turtle.Move(40) Turtle.Turn(180) Turtle.PenDown() Turtle.Move(30) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(30) Default() ElseIf letter[k] = "V" Then Turtle.PenUp() Turtle.Turn(90) Turtle.Move(15) Turtle.Angle = -20 Turtle.PenDown() Turtle.Move(43) Turtle.Turn(180) Turtle.Move(43) Turtle.Angle = 20 Turtle.Move(43) Default() ElseIf letter[k] = "W" Then Turtle.PenUp() Turtle.Move(40) Turtle.PenDown() Turtle.Angle = 170 Turtle.Move(43) Turtle.Angle = 10 Turtle.Move(43) Turtle.Angle = 170 Turtle.Move(43) Turtle.Angle = 10 Turtle.Move(43) Default() ElseIf letter[k] = "X" Then Turtle.Angle = 30 Turtle.Move(44) Turtle.Turn(180) Turtle.Move(22) Turtle.Angle = -30 Turtle.Move(22) Turtle.Turn(180) Turtle.Move(44) Default() ElseIf letter[k] = "Y" Then Turtle.PenUp() Turtle.Move(40) Turtle.PenDown() Turtle.Angle = 150 Turtle.Move(22) Turtle.Angle = 30 Turtle.Move(22) Turtle.Turn(180) Turtle.Move(22) Turtle.Angle = 180 Turtle.Move(20) Default() ElseIf letter[k] = "Z" Then Turtle.PenUp() Turtle.Move(40) Turtle.Turn(90) Turtle.PenDown() Turtle.Move(20) Turtle.Angle = 210 Turtle.Move(45) Turtle.Angle = 90 Turtle.Move(20) Default() ElseIf letter[k] = " " Then Default() ElseIf letter[k] = "1" Then Turtle.Turn(90) Turtle.PenUp() Turtle.Move(5) Turtle.PenDown() Turtle.Move(20) Turtle.Turn(180) Turtle.Move(10) Turtle.Turn(90) Turtle.Move(40) Turtle.Turn(225) Turtle.Move(10) Default() ElseIf letter[k] = "2" Then Turtle.PenUp() Turtle.Move(35) Turtle.PenDown() Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(35) Turtle.Turn(-135) Turtle.Move(25) Default() ElseIf letter[k] = "3" Then Turtle.PenUp() Turtle.Move(35) Turtle.PenDown() Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(7.5) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(180) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(7.5) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Default() Elseif letter[k] = "4" Then Turtle.Turn(90) Turtle.PenUp() Turtle.Move(15) Turtle.Turn(-90) Turtle.PenDown() Turtle.Move(45) Turtle.Angle = 210 Turtle.Move(30) Turtle.Angle = 90 Turtle.Move(25) Default() Elseif letter[k] = "5" Then Turtle.Turn(90) Turtle.Move(15) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(15) Turtle.Turn(90) Turtle.Move(20) Turtle.Turn(90) Turtle.Move(20) Default() Elseif letter[k] = "6" Then Turtle.PenUp() Turtle.Turn(90) Turtle.Move(15) Turtle.Turn(-90) Turtle.Move(45) Turtle.Turn(90) Turtle.PenDown() Turtle.Move(5) Turtle.Turn(180) Turtle.Move(15) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(30) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(10) Default() Elseif letter[k] = 7 then Turtle.Turn(90) Turtle.PenUp() Turtle.Move(5) Turtle.PenDown() Turtle.Angle = 30 Turtle.Move(50) Turtle.Angle = 270 Turtle.Move(25) Default() Elseif letter[k] = 8 Then Turtle.PenUp() Turtle.Turn(90) Turtle.Move(7.5) Turtle.PenDown() Turtle.Move(9) Turtle.Turn(-45) Turtle.Move(9) Turtle.Turn(-45) Turtle.Move(9) Turtle.Turn(-45) Turtle.Move(9) Turtle.Turn(-45) Turtle.Move(9) Turtle.Turn(45) Turtle.Move(9) Turtle.Turn(45) Turtle.Move(9) Turtle.Turn(45) Turtle.Move(9) Turtle.Turn(45) Turtle.Move(9) Turtle.Turn(45) Turtle.Move(9) Turtle.Turn(45) Turtle.Move(9) Turtle.Turn(45) Turtle.Move(9) Turtle.Turn(45) Turtle.Move(9) Turtle.Turn(-45) Turtle.Move(9) Turtle.Turn(-45) Turtle.Move(9) Turtle.Turn(-45) Turtle.Move(9) Default() Elseif letter[k] = 9 Then Turtle.PenUp() Turtle.Move(27.5) Turtle.PenDown() Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(180) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(10) Turtle.Angle = 180 Turtle.Move(20) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Default() ElseIf letter[k] = "0" Then Turtle.PenUp() Turtle.Turn(90) Turtle.Move(20) Turtle.Turn(180) Turtle.PenDown() Turtle.Move(10) Turtle.Turn(45) Turtle.Move(15) turtlex1 = Turtle.x turtley1 = Turtle.y Turtle.Turn(45) Turtle.Move(25) Turtle.Turn(45) Turtle.Move(15) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(15) turtlex2 = Turtle.x turtley2 = Turtle.y Turtle.Turn(45) Turtle.Move(25) Turtle.Turn(45) Turtle.Move(15) Turtle.PenUp() Turtle.MoveTo(turtlex1, turtley1) Turtle.PenDown() Turtle.MoveTo(turtlex2, turtley2) Default() Elseif letter[k] = "." Then Turtle.Move(2) Turtle.Turn(90) Turtle.Move(2) Turtle.Turn(90) Turtle.Move(2) Turtle.Turn(90) Turtle.Move(2) Turtle.Turn(90) Default() Elseif letter[k] = "," Then Turtle.Angle = 195 Turtle.Move(10) Default() Elseif letter[k] = "?" Then Turtle.PenUp() Turtle.Turn(90) Turtle.Move(10) Turtle.Angle = 0 Turtle.PenDown() Turtle.Move(2) Turtle.Turn(90) Turtle.Move(2) Turtle.Turn(90) Turtle.Move(2) Turtle.Turn(90) Turtle.Move(2) Turtle.Turn(90) Turtle.PenUp() Turtle.Move(10) Turtle.PenDown() Turtle.Move(10) Turtle.Turn(90) Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(7.5) Turtle.Turn(-45) Turtle.Move(5) Default() Elseif letter[k] = "*" Then Turtle.PenUp() Turtle.Move(30) Turtle.Turn(90) Turtle.PenDown() Turtle.Move(20) Turtle.Turn(180) Turtle.Move(10) Turtle.Turn(90) Turtle.Move(10) Turtle.Turn(180) Turtle.Move(20) Turtle.Turn(180) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(180) Turtle.Move(20) Turtle.Turn(180) Turtle.Move(10) Turtle.Turn(90) Turtle.Move(10) Turtle.Turn(180) Turtle.Move(20) Default() Elseif letter[k] = "!" Then Turtle.PenUp() Turtle.Turn(90) Turtle.Move(10) Turtle.Angle = 0 Turtle.PenDown() Turtle.Move(2) Turtle.Turn(90) Turtle.Move(2) Turtle.Turn(90) Turtle.Move(2) Turtle.Turn(90) Turtle.Move(2) Turtle.Turn(90) Turtle.PenUp() Turtle.Move(10) Turtle.PenDown() Turtle.Move(30) Default() Elseif letter[k] = "(" Then Turtle.PenUp() Turtle.Turn(90) Turtle.Move(30) Turtle.PenDown() Turtle.Angle = 320 Turtle.Turn(180) Turtle.Move(5) Turtle.Turn(180) Turtle.Move(15) Turtle.Angle = 0 Turtle.Move(30) Turtle.Angle = 40 Turtle.Move(15) Default() Elseif letter[k] = ")" Then Turtle.PenUp() Turtle.Turn(-90) Turtle.Move(5) Turtle.PenDown() Turtle.Angle = 40 Turtle.Turn(180) Turtle.Move(5) Turtle.Turn(180) Turtle.Move(15) Turtle.Angle = 0 Turtle.Move(30) Turtle.Angle = 320 Turtle.Move(15) Default() Elseif letter[k] = "&" Then Turtle.PenUp() Turtle.Turn(90) Turtle.Move(7.5) Turtle.PenDown() Turtle.Move(9) Turtle.Turn(-45) Turtle.Move(15) Turtle.Turn(180) Turtle.Move(6) Turtle.Turn(180) Turtle.Turn(-45) Turtle.PenUp() Turtle.Move(9) Turtle.Turn(-45) Turtle.Move(9) Turtle.Turn(-45) Turtle.Move(9) Turtle.PenDown() Turtle.Turn(45) Turtle.Turn(180) Turtle.Move(30) Turtle.Turn(180) Turtle.Move(30) turtlex3 = Turtle.x turtley3 = Turtle.y Turtle.Move(9) Turtle.Turn(45) Turtle.Move(9) Turtle.Turn(45) Turtle.Move(9) Turtle.Turn(45) Turtle.Move(9) Turtle.Turn(45) Turtle.Move(9) Turtle.Turn(45) Turtle.Move(9) turtlex4 = Turtle.X turtley4 = Turtle.y Turtle.PenUp() Turtle.Turn(45) Turtle.Move(9) Turtle.Turn(45) Turtle.Move(9) Turtle.Turn(-45) Turtle.PenDown() Turtle.Move(9) Turtle.Turn(-45) Turtle.Move(9) Turtle.Turn(-45) Turtle.Move(9) Turtle.PenUp() Turtle.MoveTo(turtlex3, turtley3) Turtle.PenDown() Turtle.MoveTo(turtlex4, turtley4) Default() Elseif letter[k] = "%" then turtlex5 = Turtle.x turtley5 = Turtle.y Turtle.Turn(90) Turtle.PenUp() Turtle.Move(15) Turtle.PenDown() Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(5) Turtle.PenUp() Turtle.MoveTo(turtlex5, turtley5) Turtle.PenDown() Turtle.Angle = 30 Turtle.Move(45) Turtle.Angle = 270 Turtle.PenUp() Turtle.Move(15) Turtle.PenDown() Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(5) Default() Elseif letter[k] = "/" then Turtle.Angle = 30 Turtle.Move(45) Default() Elseif letter[k] = "\" then Turtle.Turn(90) Turtle.PenUp() Turtle.Move(20) Turtle.PenDown() Turtle.Angle = 330 Turtle.Move(45) Default() Elseif letter[k] = "$" Then turtlex6 = Turtle.X turtley6 = Turtle.y Turtle.PenUp() Turtle.Turn(90) Turtle.Move(12.5) Turtle.PenDown() Turtle.Turn(90) Turtle.Move(5) Turtle.Turn(180) Turtle.Move(55) turtle.PenUp() Turtle.MoveTo(turtlex6, turtley6-10) Turtle.Angle = 0 Turtle.PenDown() Turtle.Turn(135) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(-45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(5) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Default() Elseif letter[k] = "^" then Turtle.PenUp() Turtle.Move(35) Turtle.Turn(90) Turtle.Move(5) Turtle.PenDown() Turtle.Angle = 60 Turtle.Move(10) Turtle.Angle = 120 Turtle.Move(10) Default() Elseif letter[k] = "#" Then Turtle.PenUp() Turtle.Move(15) Turtle.PenDown() Turtle.Turn(90) Turtle.Move(30) Turtle.Turn(180) Turtle.Move(30) Turtle.Turn(90) Turtle.PenUp() Turtle.Move(10) Turtle.Turn(90) Turtle.Move(5) Turtle.PenDown() Turtle.Move(30) Turtle.Turn(180) Turtle.PenUp() Turtle.Move(35) Turtle.Angle = 180 Turtle.Move(25) Turtle.Turn(-90) Turtle.Move(5) Turtle.PenDown() Turtle.Angle = 15 Turtle.Move(40) Turtle.PenUp() Turtle.Angle = 90 Turtle.Move(15) Turtle.PenDown() Turtle.Angle = 195 Turtle.Move(40) Default() Elseif letter[k] = "@" Then Turtle.PenUp() Turtle.Turn(90) Turtle.Move(20) Turtle.Turn(180) Turtle.PenDown() Turtle.Move(15) Turtle.Turn(45) Turtle.Move(15) Turtle.Turn(45) Turtle.Move(20) Turtle.Turn(45) Turtle.Move(15) Turtle.Turn(45) Turtle.Move(15) Turtle.Turn(45) Turtle.Move(15) Turtle.Turn(45) Turtle.Move(20) Turtle.Turn(45) Turtle.Move(5) Turtle.Turn(45) Turtle.Move(2.5) Turtle.Turn(45) Turtle.Move(5) Turtle.Turn(45) Turtle.Move(15) Turtle.Turn(-45) Turtle.Move(7) Turtle.Turn(-45) Turtle.Move(7) Turtle.Turn(-45) Turtle.Move(7) Turtle.Turn(-45) Turtle.Move(7) Turtle.Turn(-45) Turtle.Move(7) Turtle.Turn(-45) Turtle.Move(7) Turtle.Turn(-45) Turtle.Move(7) Default() Elseif letter[k] = "-" Then Turtle.PenUp() Turtle.Move(20) Turtle.PenDown() Turtle.Turn(90) Turtle.Move(20) Default() Elseif letter[k] = "_" Then Turtle.Turn(90) Turtle.Move(20) Default() Elseif letter[k] = "+" Then Turtle.PenUp() Turtle.Move(20) Turtle.PenDown() Turtle.Turn(90) Turtle.Move(20) Turtle.Turn(180) Turtle.Move(10) Turtle.Turn(90) Turtle.Move(10) Turtle.Turn(180) Turtle.Move(20) Default() Elseif letter[k] = "=" Then Turtle.PenUp() Turtle.Move(15) Turtle.PenDown() Turtle.Turn(90) Turtle.Move(20) Turtle.PenUp() Turtle.Turn(-90) Turtle.Move(10) Turtle.Turn(-90) Turtle.PenDown() Turtle.Move(20) Default() Elseif letter[k] = "|" Then Turtle.PenUp() Turtle.Turn(90) Turtle.Move(15) Turtle.Turn(-90) Turtle.PenDown() Turtle.Move(20) Turtle.PenUp() Turtle.Move(5) Turtle.PenDown() Turtle.Move(20) Default() Elseif letter[k] = "[" Then Turtle.PenUp() Turtle.Turn(90) Turtle.Move(30) Turtle.PenDown() Turtle.Angle = -90 Turtle.Move(10) Turtle.Turn(90) Turtle.Move(45) Turtle.Turn(90) Turtle.Move(10) Default() Elseif letter[k] = "]" Then Turtle.Turn(90) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(45) Turtle.Turn(-90) Turtle.Move(10) Default() Elseif letter[k] = "{" Then Turtle.PenUp() Turtle.Turn(90) Turtle.Move(30) Turtle.PenDown() Turtle.Angle = -90 Turtle.Move(5) Turtle.Turn(45) Turtle.Move(5) Turtle.Turn(45) Turtle.Move(5) Turtle.Turn(5) Turtle.Move(10) Turtle.Angle = 315 Turtle.Move(5) Turtle.Angle = 45 Turtle.Move(5) Turtle.Angle = 355 Turtle.Move(10) Turtle.Angle = 0 Turtle.Move(5) Turtle.Turn(45) Turtle.Move(5) Turtle.Turn(45) Turtle.Move(5) Default() Elseif letter[k] = "}" Then Turtle.Angle = 90 Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(5) Turtle.Turn(-5) Turtle.Move(10) Turtle.Angle = 45 Turtle.Move(5) Turtle.Angle = 315 Turtle.Move(5) Turtle.Angle = 5 Turtle.Move(10) Turtle.Angle = 5 Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(5) Default() Elseif letter[k] = ":" Then Turtle.Move(2) Turtle.Turn(90) Turtle.Move(2) Turtle.Turn(90) Turtle.Move(2) Turtle.Turn(90) Turtle.Move(2) Turtle.Turn(90) Turtle.PenUp() Turtle.Move(25) Turtle.PenDown() Turtle.Move(2) Turtle.Turn(90) Turtle.Move(2) Turtle.Turn(90) Turtle.Move(2) Turtle.Turn(90) Turtle.Move(2) Default() Elseif letter[k] = ";" Then Turtle.Angle = 195 Turtle.Move(10) Turtle.Turn(180) Turtle.Move(10) Turtle.Angle = 0 Turtle.PenUp() Turtle.Move(25) Turtle.PenDown() Turtle.Move(2) Turtle.Turn(90) Turtle.Move(2) Turtle.Turn(90) Turtle.Move(2) Turtle.Turn(90) Turtle.Move(2) Default() Elseif letter[k] = "'" Then Turtle.PenUp() Turtle.Turn(90) Turtle.Move(15) Turtle.Turn(-90) Turtle.Move(35) Turtle.PenDown() Turtle.Move(10) Default() Elseif letter[k] = "<" Then Turtle.PenUp() Turtle.Move(15) Turtle.Turn(90) Turtle.Move(30) Turtle.PenDown() Turtle.Angle = 315 Turtle.Move(10) Turtle.Angle = 45 Turtle.Move(10) Default() Elseif letter[k] = ">" Then Turtle.PenUp() Turtle.Move(15) Turtle.PenDown() Turtle.Angle = 45 Turtle.Move(10) Turtle.Angle = 315 Turtle.Move(10) Default() Elseif letter[k] = "~" Then Turtle.PenUp() Turtle.Move(15) Turtle.PenDown() Turtle.Move(5) Turtle.Turn(45) Turtle.Move(5) Turtle.Turn(45) Turtle.Move(5) Turtle.Turn(35) Turtle.Move(10) Turtle.Turn(-15) Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(5) Turtle.Turn(-45) Turtle.Move(5) Default() Elseif letter[k] = "`" Then Turtle.PenUp() Turtle.Turn(90) Turtle.Move(15) Turtle.Turn(-90) Turtle.Move(35) Turtle.PenDown() Turtle.Angle = 320 Turtle.Move(10) Default() Elseif letter[k] = Text.GetCharacter(34) Then Turtle.PenUp() Turtle.Turn(90) Turtle.Move(15) Turtle.Turn(-90) Turtle.Move(35) Turtle.PenDown() Turtle.Move(10) Turtle.Turn(90) Turtle.PenUp() Turtle.Move(10) Turtle.Turn(90) Turtle.PenDown() Turtle.Move(10) Default() Else Turtle.PenUp() Turtle.Move(30) Turtle.Turn(90) Turtle.PenDown() Turtle.Move(20) Turtle.Turn(180) Turtle.Move(10) Turtle.Turn(90) Turtle.Move(10) Turtle.Turn(180) Turtle.Move(20) Turtle.Turn(180) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(10) Turtle.Turn(180) Turtle.Move(20) Turtle.Turn(180) Turtle.Move(10) Turtle.Turn(90) Turtle.Move(10) Turtle.Turn(180) Turtle.Move(20) Default() EndIf 'End Letters' EndFor 'End Drawing' 'Reset' Turtle.PenUp() Turtle.MoveTo(901, 1) doingreset = 1 Default() Controls.Remove(textbox2) Controls.Remove(textbox3) firstinput = 0 Goto buttonloop 'End Reset' 'Default' Sub Default If Turtle.X > 900 Then Turtle.PenUp() Turtle.MoveTo(40*n + 25, m) Turtle.Angle = 0 Turtle.Move(20) If doingreset = 0 then Turtle.PenDown() ElseIf doingreset = 1 then doingreset = 0 EndIf Turtle.Turn(90) Turtle.Move(20) m = m + 50 n = 0 EndIf Turtle.PenUp() Turtle.MoveTo(40*n + 25, m) Turtle.Angle = 0 Turtle.PenDown() EndSub 'End Default' 'Help' Sub Help If GraphicsWindow.MouseX > 10 And GraphicsWindow.MouseX < 45 And GraphicsWindow.MouseY > 10 And GraphicsWindow.MouseY < 31 Then GraphicsWindow.ShowMessage("Enter a pen colour, background colour, and some words. Click 'Go' and watch the turtle write it. unknown characters will bedrawn as an asterisk", "Help") ElseIf GraphicsWindow.MouseX > 940 And GraphicsWindow.MouseX < 990 And GraphicsWindow.MouseY > 10 and GraphicsWindow.MouseY < 31 Then GraphicsWindow.ShowMessage("Colours: LightCoral, Salmon, DarkSalmon, LightSalmon, Crimson, Red, FireBrick, DarkRed, Pink, LightPink, HotPink, DeepPink, MediumVioletRed, PaleVioletRed, LightSalmon, Coral, Tomato, OrangeRed, DarkOrange, Orange, Gold, Yellow, LightYellow, LemonChiffon, LightGoldenrodYellow, PapayaWhip, Moccasin, PeachPuff, PaleGoldenrod, Khaki, DarkKhaki, Lavender, Thistle, Plum, Violet, Orchid, Fuchsia, Magenta, MediumOrchid, MeduimPurple, BlueViolet, DarkViolet, DarkOrchid, DarkMagenta, Purple, Indigo, SlateBlue, DarkSlateBlue, MediumSlateBlue, SpringGreen, MediumSpringGreen, SeaGreen, MediumSeaGreen, Green, ForestGreen, DarkGreen, YellowGreen, OliveDrab, Olive, DarkOliveGreen, MediumAquaMarine, DarkSeaGreen, LightSeaGreen, DarkCyan, Teal, Aqua, Cyan, LightCyan, PaleTurquoise, Aquamarine, Turquoise, MediumTurquoise, DarkTurquoise, CadetBlue, SteelBlue, LightSteelBlue, PowderBlue, LightBlue, SkyBlue, LightSkyBlue, DeepSkyBlue, DodgerBlue, CornflowerBlue, MediumSlateBlue, RoyalBlue, Blue, MediumBlue, DarkBlue, Navy, MidnightBlue, White, Snow, Honeydew, MintCream, Azure, AliceBlue, GhostWhite, WhiteSmoke, Seashell, Beige, OldLace, FloralWhite, Ivory, AntiqueWhite, Linen, LavenderBlush, MistyRose, CornSilk, BlanchedAlmond, Bisque, NavjoWhite, Wheat, BurlyWood, Tan, RosyBrown, SandyBrown, Goldenrod, DarkGoldenrod, Peru, Chocolate, SaddleBrown, Sienna, Brown, Maroon, Gainsboro, LightGray, Silver, Darkgray, Gray, DimGray, LightSlateGray, SlateGray, DarkSlateGray, Black", "Colour List") EndIf EndSub 'End Help' Sub Key If GraphicsWindow.LastKey = "Return" Then If firstinput = 1 then colour = Controls.GetTextBoxText(textbox2) Text.ConvertToLowerCase(colour) bgcolour = Controls.GetTextBoxText(textbox3) Text.ConvertToLowerCase(bgcolour) EndIf input = Controls.GetTextBoxText(textbox) buttonclicked = 1 EndIf EndSub End>GHN424.sb< Start>GHP076.sb< GraphicsWindow.Width=1200 GraphicsWindow.Height=600 LDScrollBars.Add(9000 600) gravity = 0.1 'Gravity down (0.1 To 0.3) flapPower = 2 'How much uplift from a flap (~1) (~3 If holdKey is "False") holdKey = "False" 'If "True" uplift repeats While key down, If "False" a new tap For each flap (more flapPower needed) maxSpeed = 10 'Max uplift or falling speed minGap = 2.5 'Minimum gap (*bird radius) Intro() Initialise() While "true"'------------------------------------------------------===================================================== start = Clock.ElapsedMilliseconds speedup = speedup+1/(50*60) 'Working at 50 fps (delay 20ms) so every 60 sec tubeSpeed increases by factor of 1 'Impulse up For bird If (keyDown) Then keyDown = holdKey birdV = birdV-flapPower*speedup 'Also speedup flapping so we can negotiate different heights at faster speeds EndIf birdV = Math.Min(maxSpeed,birdV) ' Max speed down birdV = Math.Max(-maxSpeed,birdV) ' Max speed up 'accelerate down birdV = birdV+gravity*speedup 'Also speedup gravity so we can negotiate different heights at faster speeds birdY = birdY+birdV GraphicsWindow.BrushColor="darkblu ee=Shapes.AddEllipse(8 8) Shapes.Move(ee hss+600,birdY-4) Shapes.Move(bird,hss+600,birdY-birdRadius) LDScrollBars.HorizontalScroll=hss hss=hss+5 delay = 20 - (Clock.ElapsedMilliseconds-start) If (delay > 0) Then Program.Delay(delay) EndIf EndWhile Sub Intro gw = 1200 gh = 600 GraphicsWindow.Left = (Desktop.Width-gw)/2 GraphicsWindow.Top = (Desktop.Height-gh)/2 GraphicsWindow.Title = "Flappy Sine" Mouse.HideCursor() EndSub Sub Initialise'============================================================================== GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "lightBlue" GraphicsWindow.PenWidth = 0 score = 0 speedup = 1 birdRadius = 24 GraphicsWindow.BrushColor = "White" numCloud = 70 cloudRadius = 80 For i = 1 To numCloud cloud[i] = Shapes.AddEllipse(2*cloudRadius,cloudRadius) cloudX[i] = i*(gw+2*cloudRadius)/numCloud+Math.GetRandomNumber(9000) SetCloudY() Shapes.Move(cloud[i],cloudX[i]-cloudRadius,cloudY[i]-cloudRadius/2) EndFor 'Bird GraphicsWindow.BrushColor = "Brown" birdX = gw/3 birdY = gh /2 bird = Shapes.AddEllipse(2*birdRadius,2*birdRadius) Shapes.Move(bird,birdX-birdRadius,birdY-birdRadius) birdV = 0 'Start interaction (use same routines For key or mouse) playing = "True" keyDown = "False" keyUp = "True" GraphicsWindow.MouseDown = OnKeyDown GraphicsWindow.MouseUp = OnKeyUp EndSub Sub SetCloudY 'Create cloud Y position For cloud i - a subroutine so we don't repeat code we may change cloudY[i] = cloudRadius/2+Math.GetRandomNumber(gh-cloudRadius) EndSub Sub OnKeyDown If (keyUp Or holdKey) Then 'Only register If holdKey or we have done a keyUp keyDown = "True" keyUp = "False" EndIf If (GraphicsWindow.LastKey = "Escape") Then Program.End() EndIf EndSub Sub OnKeyUp keyDown = "False" keyUp = "True" EndSub End>GHP076.sb< Start>GHP746-0.sb< ' Soldier -- By Krueg -- June 2012 ' Credit goes to: GotoLoop for helping with development. ' ARROWS to move ' ESCAPE to quit gw = 640 'Window width gh = 480 'Window Height md = 1 ms = 1 debug = "on?" SetupWindow() SetupImages() Main: GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp While ("true") If directionx = "Left" Then x = x + 2 md = 1 ms = ms + .1 EndIf If directionx = "Right" Then x = x - 2 md = 2 ms = ms + .1 EndIf If ms > 4.9 Then ms = 1 EndIf y = y + directiony If x < -32 Then x = x + 32 ElseIf x > 0 Then x = x -32 EndIf If y < -32 Then y = y + 32 ElseIf y > 0 Then y = y -32 EndIf mf = Math.Floor(ms) 'If mf <> mflast Then Shapes.Move(background,x,y) Shapes.Move(brickline,x,gh-32) Shapes.ShowShape(man[md][mf]) Shapes.HideShape(man[mdlast][mflast]) mdlast = md mflast = mf 'EndIf If debug = "on" Then DebugData() EndIf Program.Delay(10) EndWhile Sub OnKeyDown key = GraphicsWindow.LastKey If key = "Left" Then directionx = "Left" ElseIf key = "Right" Then directionx = "Right" ElseIf key = "Up" Then directiony = 1 ElseIf key = "Down" Then directiony = -1 ElseIf key = "Escape" Then Program.End() EndIf EndSub Sub OnKeyUp key = GraphicsWindow.LastKey If key = "Right" Or key = "Left" Then directionx = "" ElseIf key = "Up" Or key = "Down" Then directiony = "" EndIf EndSub Sub SetupWindow If debug = "on" Then TextWindow.Left = gw + 20 TextWindow.Top = 10 TextWindow.Title = "Soldier Dude Debug." EndIf GraphicsWindow.Hide() GraphicsWindow.Height = gh GraphicsWindow.Width = gw GraphicsWindow.Top = 5 GraphicsWindow.Left = 5 GraphicsWindow.Title = "RUN little soldier dude, RUN!" GraphicsWindow.BackgroundColor = "Black" EndSub Sub SetupImages 'path = Program.Directory + "/" path = "http://krueg.com/sb/samples/" manl2 = ImageList.LoadImage(path + "man_l2.png") manr2 = ImageList.LoadImage(path + "man_r2.png") background = Shapes.AddImage(ImageList.LoadImage(path + "background.png")) brickline = Shapes.AddImage(ImageList.LoadImage(path + "brickline.png")) man[1][1] = Shapes.AddImage(ImageList.LoadImage(path + "man_l1.png")) man[1][2] = Shapes.AddImage(manl2) man[1][3] = Shapes.AddImage(ImageList.LoadImage(path + "man_l3.png")) man[1][4] = Shapes.AddImage(manl2) man[2][1] = Shapes.AddImage(ImageList.LoadImage(path + "man_r1.png")) man[2][2] = Shapes.AddImage(manr2) man[2][3] = Shapes.AddImage(ImageList.LoadImage(path + "man_r3.png")) man[2][4] = Shapes.AddImage(manr2) Shapes.Move(brickline,-32,gh-32) For i = 1 To 4 Shapes.Move(man[1][i],gw/2,gh-96) Shapes.Zoom(man[1][i],2,2) Shapes.HideShape(man[1][i]) Shapes.Move(man[2][i],gw/2,gh-96) Shapes.Zoom(man[2][i],2,2) Shapes.HideShape(man[2][i]) EndFor GraphicsWindow.Show() EndSub Sub DebugData TextWindow.Clear() TextWindow.WriteLine("X = " + x + " Y = " + y) TextWindow.WriteLine("Key = " + key) TextWindow.WriteLine("DirectionX = " + directionx) TextWindow.WriteLine("DirectionY = " + directiony) TextWindow.WriteLine("MD = " + md + " MS = " + ms) EndSub End>GHP746-0.sb< Start>GHP746-1.sb< ' Soldier -- By Krueg -- June 2012 ' Credit goes to: GotoLoop for helping with development. ' ARROWS to move ' ESCAPE to quit gw = 640 'Window width gh = 480 'Window Height md = 1 ms = 1 debug = "on" SetupWindow() SetupImages() Main: GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp While ("true") If directionx = "Left" Then x = x + 2 md = 1 ms = ms + .1 EndIf If directionx = "Right" Then x = x - 2 md = 2 ms = ms + .1 EndIf If ms > 4.9 Then ms = 1 EndIf y = y + directiony If x < -32 Then x = x + 32 ElseIf x > 0 Then x = x -32 EndIf If y < -32 Then y = y + 32 ElseIf y > 0 Then y = y -32 EndIf mf = Math.Floor(ms) 'If mf <> mflast Then Shapes.Move(background,x,y) Shapes.Move(brickline,x,gh-32) Shapes.HideShape(man[mdlast][mflast]) Shapes.ShowShape(man[md][mf]) mdlast = md mflast = mf 'EndIf If debug = "on" Then DebugData() EndIf Program.Delay(10) EndWhile Sub OnKeyDown key = GraphicsWindow.LastKey If key = "Left" Then directionx = "Left" ElseIf key = "Right" Then directionx = "Right" ElseIf key = "Up" Then directiony = 1 ElseIf key = "Down" Then directiony = -1 ElseIf key = "Escape" Then Program.End() EndIf EndSub Sub OnKeyUp key = GraphicsWindow.LastKey If key = "Right" Or key = "Left" Then directionx = "" ElseIf key = "Up" Or key = "Down" Then directiony = "" EndIf EndSub Sub SetupWindow If debug = "on" Then TextWindow.Left = gw + 20 TextWindow.Top = 10 TextWindow.Title = "Soldier Dude Debug." EndIf GraphicsWindow.Hide() GraphicsWindow.Height = gh GraphicsWindow.Width = gw GraphicsWindow.Top = 5 GraphicsWindow.Left = 5 GraphicsWindow.Title = "RUN little soldier dude, RUN!" GraphicsWindow.BackgroundColor = "Black" EndSub Sub SetupImages 'path = Program.Directory + "/" path = "http://krueg.com/sb/samples/" manl2 = ImageList.LoadImage(path + "man_l2.png") manr2 = ImageList.LoadImage(path + "man_r2.png") background = Shapes.AddImage(ImageList.LoadImage(path + "background.png")) brickline = Shapes.AddImage(ImageList.LoadImage(path + "brickline.png")) man[1][1] = Shapes.AddImage(ImageList.LoadImage(path + "man_l1.png")) man[1][2] = Shapes.AddImage(manl2) man[1][3] = Shapes.AddImage(ImageList.LoadImage(path + "man_l3.png")) man[1][4] = Shapes.AddImage(manl2) man[2][1] = Shapes.AddImage(ImageList.LoadImage(path + "man_r1.png")) man[2][2] = Shapes.AddImage(manr2) man[2][3] = Shapes.AddImage(ImageList.LoadImage(path + "man_r3.png")) man[2][4] = Shapes.AddImage(manr2) Shapes.Move(brickline,-32,gh-32) For i = 1 To 4 Shapes.Move(man[1][i],gw/2,gh-96) Shapes.Zoom(man[1][i],2,2) Shapes.HideShape(man[1][i]) Shapes.Move(man[2][i],gw/2,gh-96) Shapes.Zoom(man[2][i],2,2) Shapes.HideShape(man[2][i]) EndFor GraphicsWindow.Show() EndSub Sub DebugData TextWindow.Clear() TextWindow.WriteLine("X = " + x + " Y = " + y) TextWindow.WriteLine("Key = " + key) TextWindow.WriteLine("DirectionX = " + directionx) TextWindow.WriteLine("DirectionY = " + directiony) TextWindow.WriteLine("MD = " + md + " MS = " + ms) EndSub End>GHP746-1.sb< Start>GHP746-2.sb< ' Soldier -- By Krueg -- June 2012 ' ARROWS to move ' ESCAPE to quit gw = 640 'Window width gh = 480 'Window Height md = 1 ms = 1 play = "true" debug = "on?" SetupWindow() SetupImages() Main: GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp While play = "true" If directionx = "Left" Then x = x + 2 md = 1 ms = ms + .1 EndIf If directionx = "Right" Then x = x - 2 md = 2 ms = ms + .1 EndIf If ms > 4.9 Then ms = 1 EndIf y = y + directiony If x < -32 Then x = x + 32 ElseIf x > 0 Then x = x -32 EndIf If y < -32 Then y = y + 32 ElseIf y > 0 Then y = y -32 EndIf Shapes.Move(background,x,y) Shapes.Move(brickline,x,gh-32) msFloor = Math.Floor(ms) If (mdlast <> md Or mslast <> msFloor) Then Shapes.ShowShape(man[md][msFloor]) Shapes.HideShape(man[mdlast][mslast]) EndIf mdlast = md mslast = Math.Floor(ms) If debug = "on" Then DebugData() EndIf Program.Delay(10) EndWhile Sub OnKeyDown key = GraphicsWindow.LastKey If key = "Left" Then directionx = "Left" ElseIf key = "Right" Then directionx = "Right" ElseIf key = "Up" Then directiony = 1 ElseIf key = "Down" Then directiony = -1 ElseIf key = "Escape" Then Program.End() EndIf EndSub Sub OnKeyUp key = GraphicsWindow.LastKey If key = "Right" Or key = "Left" Then directionx = "" ElseIf key = "Up" Or key = "Down" Then directiony = "" EndIf EndSub Sub SetupWindow If debug = "on" Then TextWindow.Left = gw + 20 TextWindow.Top = 10 EndIf GraphicsWindow.Height = gh GraphicsWindow.Width = gw GraphicsWindow.Top = 5 GraphicsWindow.Left = 5 GraphicsWindow.BackgroundColor = "Black" GraphicsWindow.Show() EndSub Sub SetupImages 'path = Program.Directory + "/" path = "http://krueg.com/sb/samples/" manl2 = ImageList.LoadImage(path + "man_l2.png") manr2 = ImageList.LoadImage(path + "man_r2.png") background = Shapes.AddImage(ImageList.LoadImage(path + "background.png")) brickline = Shapes.AddImage(ImageList.LoadImage(path + "brickline.png")) man[1][1] = Shapes.AddImage(ImageList.LoadImage(path + "man_l1.png")) man[1][2] = Shapes.AddImage(manl2) man[1][3] = Shapes.AddImage(ImageList.LoadImage(path + "man_l3.png")) man[1][4] = Shapes.AddImage(manl2) man[2][1] = Shapes.AddImage(ImageList.LoadImage(path + "man_r1.png")) man[2][2] = Shapes.AddImage(manr2) man[2][3] = Shapes.AddImage(ImageList.LoadImage(path + "man_r3.png")) man[2][4] = Shapes.AddImage(manr2) Shapes.Move(brickline,-32,gh-32) For i = 1 To 4 Shapes.Move(man[1][i],gw/2,gh-80) Shapes.Zoom(man[1][i],2,2) Shapes.HideShape(man[1][i]) Shapes.Move(man[2][i],gw/2,gh-80) Shapes.Zoom(man[2][i],2,2) Shapes.HideShape(man[2][i]) EndFor EndSub Sub DebugData TextWindow.Clear() TextWindow.WriteLine("X = " + x + " Y = " + y) TextWindow.WriteLine("DirectionX = " + directionx) TextWindow.WriteLine("DirectionY = " + directiony) TextWindow.WriteLine("MD = " + md + "MS = " + ms) EndSub End>GHP746-2.sb< Start>GHP746-3.sb< ' Soldier -- By Krueg -- June 2012 ' ARROWS to move ' ESCAPE to quit ' GHP746-3 ' http://social.msdn.microsoft.com/Forums/en-US/smallbasic/ ' thread/e07d592b-af60-426d-898f-d67d205be757 gw = 640 'Window width gh = 480 'Window Height gh32 = gh - 32 md = 1 z = 1 IncX = 2 IncY = 1 IncZ = .1 Delay = 10 play = "True" debug = "False" SetupWindow() SetupImages() Main: GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp While play x = x + dx y = y + dy z = z + dz If z > 4.9 Then z = 1 EndIf If x < -32 Then x = x + 32 ElseIf x > 0 Then x = x -32 EndIf If y < -32 Then y = y + 32 ElseIf y > 0 Then y = y -32 EndIf Shapes.Move(background x,y) Shapes.Move(brickline x,gh32) zInt = Math.Floor(z) If mdlast <> md Or mslast <> zInt Then Shapes.ShowShape(man[md][zInt]) Shapes.HideShape(man[mdlast][mslast]) EndIf mdlast = md mslast = zInt If debug Then DebugData() EndIf Program.Delay(Delay) EndWhile Sub OnKeyDown key = GraphicsWindow.LastKey If key = "Left" Then dx = IncX dz = IncZ md = 1 ElseIf key = "Right" Then dx = -IncX dz = IncZ md = 2 ElseIf key = "Up" Then dy = IncY ElseIf key = "Down" Then dy = -IncY ElseIf key = "Escape" Then Program.End() EndIf EndSub Sub OnKeyUp key = GraphicsWindow.LastKey If key = "Right" Or key = "Left" Then dx = "" dz = "" ElseIf key = "Up" Or key = "Down" Then dy = "" EndIf EndSub Sub SetupWindow If debug Then TextWindow.Left = gw + 20 TextWindow.Top = 10 EndIf GraphicsWindow.Height = gh GraphicsWindow.Width = gw GraphicsWindow.Top = 5 GraphicsWindow.Left = 5 GraphicsWindow.BackgroundColor = "Black" EndSub Sub SetupImages 'path = Program.Directory + "\" path = "http://krueg.com/sb/samples/" manl2 = ImageList.LoadImage(path + "man_l2.png") manr2 = ImageList.LoadImage(path + "man_r2.png") background = Shapes.AddImage(ImageList.LoadImage(path + "background.png")) brickline = Shapes.AddImage(ImageList.LoadImage(path + "brickline.png")) man[1][1] = Shapes.AddImage(ImageList.LoadImage(path + "man_l1.png")) man[1][2] = Shapes.AddImage(manl2) man[1][3] = Shapes.AddImage(ImageList.LoadImage(path + "man_l3.png")) man[1][4] = Shapes.AddImage(manl2) man[2][1] = Shapes.AddImage(ImageList.LoadImage(path + "man_r1.png")) man[2][2] = Shapes.AddImage(manr2) man[2][3] = Shapes.AddImage(ImageList.LoadImage(path + "man_r3.png")) man[2][4] = Shapes.AddImage(manr2) Shapes.Move(brickline, -32,gh-32) For i = 1 To 4 Shapes.Move(man[1][i],gw/2,gh-80) Shapes.Zoom(man[1][i],2,2) Shapes.HideShape(man[1][i]) Shapes.Move(man[2][i],gw/2,gh-80) Shapes.Zoom(man[2][i],2,2) Shapes.HideShape(man[2][i]) EndFor EndSub Sub DebugData TextWindow.Clear() TextWindow.WriteLine("X = " + x + " Y = " + y) TextWindow.WriteLine("DirectionX = " + dx) TextWindow.WriteLine("DirectionY = " + dy) TextWindow.WriteLine("MD = " + md + "Z = " + z) EndSub End>GHP746-3.sb< Start>GHP746.sb< ' Soldier -- By Krueg -- June 2012 ' ARROWS to move ' ESCAPE to quit gw = 640 'Window width gh = 480 'Window Height md = 1 ms = 1 play = "true" debug = "on?" SetupWindow() SetupImages() Main: GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp While play = "true" If directionx = "Left" Then x = x + 2 md = 1 ms = ms + .1 EndIf If directionx = "Right" Then x = x - 2 md = 2 ms = ms + .1 EndIf If ms > 4.9 Then ms = 1 EndIf y = y + directiony If x < -32 Then x = x + 32 ElseIf x > 0 Then x = x -32 EndIf If y < -32 Then y = y + 32 ElseIf y > 0 Then y = y -32 EndIf Shapes.Move(background,x,y) Shapes.Move(brickline,x,gh-32) Shapes.HideShape(man[mdlast][mslast]) Shapes.ShowShape(man[md][Math.Floor(ms)]) mdlast = md mslast = Math.Floor(ms) If debug = "on" Then DebugData() EndIf Program.Delay(10) EndWhile Sub OnKeyDown key = GraphicsWindow.LastKey If key = "Left" Then directionx = "Left" ElseIf key = "Right" Then directionx = "Right" ElseIf key = "Up" Then directiony = 1 ElseIf key = "Down" Then directiony = -1 ElseIf key = "Escape" Then Program.End() EndIf EndSub Sub OnKeyUp key = GraphicsWindow.LastKey If key = "Right" Or key = "Left" Then directionx = "" ElseIf key = "Up" Or key = "Down" Then directiony = "" EndIf EndSub Sub SetupWindow If debug = "on" Then TextWindow.Left = gw + 20 TextWindow.Top = 10 EndIf GraphicsWindow.Height = gh GraphicsWindow.Width = gw GraphicsWindow.Top = 5 GraphicsWindow.Left = 5 GraphicsWindow.BackgroundColor = "Black" GraphicsWindow.Show() EndSub Sub SetupImages 'path = Program.Directory + "/" path = "http://krueg.com/sb/samples/" manl2 = ImageList.LoadImage(path + "man_l2.png") manr2 = ImageList.LoadImage(path + "man_r2.png") background = Shapes.AddImage(ImageList.LoadImage(path + "background.png")) brickline = Shapes.AddImage(ImageList.LoadImage(path + "brickline.png")) man[1][1] = Shapes.AddImage(ImageList.LoadImage(path + "man_l1.png")) man[1][2] = Shapes.AddImage(manl2) man[1][3] = Shapes.AddImage(ImageList.LoadImage(path + "man_l3.png")) man[1][4] = Shapes.AddImage(manl2) man[2][1] = Shapes.AddImage(ImageList.LoadImage(path + "man_r1.png")) man[2][2] = Shapes.AddImage(manr2) man[2][3] = Shapes.AddImage(ImageList.LoadImage(path + "man_r3.png")) man[2][4] = Shapes.AddImage(manr2) Shapes.Move(brickline,-32,gh-32) For i = 1 To 4 Shapes.Move(man[1][i],gw/2,gh-80) Shapes.Zoom(man[1][i],2,2) Shapes.HideShape(man[1][i]) Shapes.Move(man[2][i],gw/2,gh-80) Shapes.Zoom(man[2][i],2,2) Shapes.HideShape(man[2][i]) EndFor EndSub Sub DebugData TextWindow.Clear() TextWindow.WriteLine("X = " + x + " Y = " + y) TextWindow.WriteLine("DirectionX = " + directionx) TextWindow.WriteLine("DirectionY = " + directiony) TextWindow.WriteLine("MD = " + md + "MS = " + ms) EndSub End>GHP746.sb< Start>GHR094-0.sb< ' mahreen miangul ' Blinking Eyes Drawing ' AugUst 2019 ' Modified by Nonki Takahashi for eyes moving Not["True"] = "False" Not["False"] = "True" GraphicsWindow.backgroundcolor= "OliveDrab" GraphicsWindow.Width = "1080" GraphicsWindow.Height = "420" ox[1] = 529 oy[1] = 195 ox[5] = 681 oy[5] = 195 bc[1] = "crimson" bc[2] = "mediumseagreen" bc[3] = "dodgerblue" bc[4] = "yellow" sz[1] = 150 sz[2] = 110 sz[3] = 80 sz[4] = 50 For i = 5 To 8 sz[i] = sz[i - 4] bc[i] = bc[i - 4] EndFor mx = (ox[1] + ox[5]) / 2 my = (oy[1] + oy[5]) / 2 GraphicsWindow.BrushColor = bc[1] ell[1] = Shapes.AddEllipse(sz[1], sz[1]) Shapes.Move(ell[1],ox[1] - sz[1] / 2, oy[1] - sz[1] / 2) ell[5] = Shapes.AddEllipse(sz[5], sz[5]) Shapes.Move(ell[5],ox[5] - sz[5] / 2, oy[5] - sz[5] / 2) For i = 2 To 4 GraphicsWindow.BrushColor = bc[i] x = mx - ox[1] y = my - oy[1] Math_CartesianToPolar() d = Math.SquareRoot(x * x + y * y) If ((d < (sz[1] / 2)) And (d < (sz[1] - sz[i]))) Then r = d / 2 Else r = (sz[1] - sz[i]) / 2 EndIf _a = Math.GetRadians(a) ox[i] = ox[1] + r * Math.Cos(_a) oy[i] = oy[1] - r * Math.Sin(_a) ell[i] = Shapes.AddEllipse(sz[i], sz[i]) Shapes.Move(ell[i], ox[i] - sz[i] / 2, oy[i] - sz[i] / 2) GraphicsWindow.BrushColor = bc[i + 4] x = mx - ox[5] y = my - oy[5] Math_CartesianToPolar() d = Math.SquareRoot(x * x + y * y) If ((d < (sz[5] / 2)) And (d < (sz[5] - sz[i + 4]))) Then r = d / 2 Else r = (sz[5] - sz[i + 4]) / 2 EndIf _a = Math.GetRadians(a) ox[i + 4] = ox[5] + r * Math.Cos(_a) oy[i + 4] = oy[5] - r * Math.Sin(_a) ell[i + 4] = Shapes.AddEllipse(sz[i + 4], sz[i + 4]) Shapes.Move(ell[i + 4], ox[i + 4] - sz[i + 4] / 2, oy[i + 4] - sz[i + 4] / 2) EndFor GraphicsWindow.BrushColor = "darkslategray" rectangle[1] = Shapes.Addrectangle(30, 10) Shapes.Move(rectangle[1], ox[4] - 30 / 2, oy[4] - 10 / 2) rectangle[2] = Shapes.Addrectangle(30, 10) Shapes.Move(rectangle[2], ox[8] - 30 / 2, oy[8] - 10 / 2) ' add eyelids 'GraphicsWindow.PenColor = "transparent 'GraphicsWindow.PenColor = "snow GraphicsWindow.BrushColor = "OliveDrab" For i = 1 To 2 eyelids[i] = Shapes.AddEllipse(50, 50) Shapes.move(eyelids[i], 0, 0) j = 4 + (i - 1) * 4 Shapes.animate(eyelids[i], ox[j] - sz[j] / 2, oy[j] - sz[j] / 2, 2000) EndFor Program.Delay(2000) Timer.Tick = OnTick Timer.Interval = 500 moving = "False" GraphicsWindow.MouseMove = OnMouseMove Sub OnTick t = t + 1 If Math.Remainder(t, 8) = 1 Then For i = 1 To 2 Shapes.HideShape(eyelids[i]) EndFor ElseIf Math.Remainder(t, 8) = 0 Then For i = 1 To 2 Shapes.ShowShape(eyelids[i]) EndFor EndIf EndSub Sub OnMouseMove mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY If Not[moving] Then moving = "True" For i = 2 To 4 x = mx - ox[1] y = my - oy[1] Math_CartesianToPolar() d = Math.SquareRoot(x * x + y * y) If (d < sz[1] / 2) And (d < (sz[1] - sz[i])) Then r = d / 2 Else r = (sz[1] - sz[i]) / 2 EndIf _a = Math.GetRadians(a) ox[i] = ox[1] + r * Math.Cos(_a) oy[i] = oy[1] + r * Math.Sin(_a) Shapes.Move(ell[i], ox[i] - sz[i] / 2, oy[i] - sz[i] / 2) x = mx - ox[5] y = my - oy[5] Math_CartesianToPolar() d = Math.SquareRoot(x * x + y * y) If (d < sz[5] / 2) And (d < (sz[5] - sz[i + 4])) Then r = d / 2 Else r = (sz[5] - sz[i + 4]) / 2 EndIf _a = Math.GetRadians(a) ox[i + 4] = ox[5] + r * Math.Cos(_a) oy[i + 4] = oy[5] + r * Math.Sin(_a) Shapes.Move(ell[i + 4], ox[i + 4] - sz[i + 4] / 2, oy[i + 4] - sz[i + 4] / 2) EndFor For i = 1 To 2 j = 4 + (i - 1) * 4 Shapes.Move(rectangle[i], ox[j] - 30 / 2, oy[j] - 10 / 2) Shapes.Move(eyelids[i], ox[j] - sz[j] / 2, oy[j] - sz[j] / 2) EndFor moving = "False" EndIf EndSub Sub Math_CartesianToPolar ' Math | convert Cartesian coodinate to polar coordinate ' param x, y - Cartesian coordinate ' return r, a - polar Coordinate (0<=a<360) r = Math.SquareRoot(x * x + y * y) If x = 0 And y > 0 Then a = 90 ' [degree] ElseIf x = 0 And y < 0 Then a = -90 ElseIf x = 0 And y = 0 Then a = 0 Else a = Math.ArcTan(y / x) * 180 / Math.Pi EndIf ' at this point -90<=a<=90 If x < 0 Then a = a + 180 ElseIf x >= 0 And y < 0 Then a = a + 360 EndIf ' at this point 0<=a<360 EndSub End>GHR094-0.sb< Start>GHR094.sb< ' mahreen miangul ' Blinking Eyes Drawing ' AugUesT 2017 GraphicsWindow.backgroundcolor= "OliveDrab GraphicsWindow.Width = "1080" GraphicsWindow.Height = "420" GraphicsWindow.BrushColor = "crimson" ell[1] = Shapes.AddEllipse(152,152) Shapes.Move(ell[1],452,120) ell[2] = Shapes.AddEllipse(150,150) Shapes.Move(ell[2],605, 120) GraphicsWindow.BrushColor = "mediumseagreen" ell[1] = Shapes.AddEllipse(110,110) Shapes.Move(ell[1],494, 140) ell[2 ] = Shapes.Addellipse(110,110) Shapes.Move(ell[2],605, 140) GraphicsWindow.BrushColor = "dodgerblue" ell[1] = Shapes.AddEllipse(80,80) Shapes.Move(ell[1],526, 160) ell[2] = Shapes.AddEllipse(80,80) Shapes.Move(ell[2],605, 160) GraphicsWindow.BrushColor = "yellow" ell[1] = Shapes.AddEllipse(50,50) Shapes.Move(ell[1],552, 179) ell[2] = Shapes.AddEllipse(50,50) Shapes.Move(ell[2],608, 179) GraphicsWindow.BrushColor = "darkslategray rectangle[1] = Shapes.Addrectangle(30,10) Shapes.Move(rectangle[1],565, 200) rectangle[2] = Shapes.Addrectangle(30,10) Shapes.Move(rectangle[2],615, 200) ' add eyelids 'GraphicsWindow.PenColor = "transparent GraphicsWindow.PenColor = "snow GraphicsWindow.BrushColor = "OliveDrab For i = 1 To 2 eyelids[i] = Shapes.AddEllipse(50, 50) Shapes.move(eyelids[i], 0, 0) Shapes.animate(eyelids[i], 552 + (i - 1) * 57, 175, 2000) EndFor Timer.Tick = Blink Timer.Interval = 500 Sub Blink t = t + 1 If Math.Remainder(t, 6) = 1 Then For i = 1 To 2 Shapes.HideShape(eyelids[i]) EndFor ElseIf Math.Remainder(t, 6) = 0 Then For i = 1 To 2 Shapes.ShowShape(eyelids[i]) EndFor EndIf EndSub End>GHR094.sb< Start>GHR152.sb< 'Initialisation Window gw = 800 gh = 600 GraphicsWindow.Width = gw GraphicsWindow.Height = gh 'Initialise Key events GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp keyLeft = 0 keyRight = 0 keyUp = 0 keyDown = 0 'Initialise ball ball = Shapes.AddEllipse(50,50) ballX = 100 ballY = 100 speed = 3 Shapes.Move(ball,ballX-25,ballY-25) 'Main loop - just move the ball While ("True") processKey() Shapes.Move(ball,ballX-25,ballY-25) Program.Delay(10) EndWhile 'Key press event subroutines 'A separate Down and Up is checked for each key, this tells us the state for any key 'And isn't affected by auto-repeat delays for keys Sub OnKeyDown lastKey = GraphicsWindow.LastKey If (lastKey = "Left") Then keyLeft = 1 ElseIf(lastKey = "Right") Then keyRight = 1 ElseIf(lastKey = "Up") Then keyUp = 1 ElseIf(lastKey = "Down") Then keyDown = 1 EndIf EndSub Sub OnKeyUp lastKey = GraphicsWindow.LastKey If (lastKey = "Left") Then keyLeft = 0 ElseIf(lastKey = "Right") Then keyRight = 0 ElseIf(lastKey = "Up") Then keyUp = 0 ElseIf(lastKey = "Down") Then keyDown = 0 EndIf EndSub Sub processKey 'Move object - note it can move diagonally if 2 keys are pressed If (keyLeft = 1) Then ballX = ballX-speed EndIf If(keyRight = 1) Then ballX = ballX+speed EndIf If(keyUp = 1) Then ballY = ballY-speed EndIf If(keyDown = 1) Then ballY = ballY+speed EndIf 'Check for hitting edges If (ballX < 0) Then ballX = ballX+gw EndIf If (ballX > gw) Then ballX = ballX-gw EndIf If (ballY < 0) Then ballY = ballY+gh EndIf If (ballY > gh) Then ballY = ballY-gh EndIf EndSub End>GHR152.sb< Start>GHS939-0.sb< ' mahreen miangul ApRil 2017 ' Sprite S-W-A-T-F SpaceBar ' Cannon Move XZ Fire F GraphicsWindow.top=0 GraphicsWindow.left=0 GraphicsWindow.Title = "mahreen miangul" GraphicsWindow.Width = "1288" GraphicsWindow.Height = "666" GraphicsWindow.BackgroundColor="skyblue" GraphicsWindow.KeyDown = onkeyDown cannon1_x = 644 cannon1_y = 566 cannon = Shapes.AddRectangle(50,100) Shapes.Move(cannon, cannon1_x, cannon1_y) '--------------------Font Animation ----------------------------------------------------------------------------------------- GraphicsWindow.FontName = "Times New Roman" GraphicsWindow.FontSize = 77 GraphicsWindow.FontItalic = "True" GraphicsWindow.BrushColor = "lightyellow" ' Text shadow color GraphicsWindow.DrawText(25, 555, "mahreen miangul!") ' Shadow position/text gold= GraphicsWindow.getcolorfromrgb(121,94,40) GraphicsWindow.BrushColor=gold GraphicsWindow.BrushColor = gold ' Text color GraphicsWindow.DrawText(20, 550, "mahreen miangul!") ' Position and text sprite_init() ' <--------- all shape data is input here!! add_shapes() ' <--------- all shapes are added here!! GraphicsWindow.BrushColor="darkslategray" Ball=Shapes.AddEllipse(40,40) Shapes.Move(Ball,cannon1_x+5,cannon1_y+30) Shapes.HideShape(Ball) 'Animate Cycle dZ = 0.1 zoom = 1 ddx=4 ' initial cycle moving speed-X ddy=0 ' initial cycle moving speed-Y bdx=0 ' initial ball moving speed-X bdy=10 ' initial ball moving speed-Y NMB="1:1" ' Cycle shapes number=5 repeat =1 shoot="False" While 0=0 ' Blinking   zoom = zoom - dZ   For i = 1 To Array.GetItemCount(shape[1]) ' Cycle shapes number=5     If Array.ContainsValue(shape[1][i], "eye") Then       Shapes.Zoom(shp[NMB][i], 1, zoom)     ElseIf Array.ContainsValue(shape[1][i], "mouth") Then       Shapes.Zoom(shp[NMB][i], zoom, zoom)     EndIf shapes.Move(shp[NMB][i],shapes.GetLeft(shp[NMB][i])+ddx,shapes.Gettop(shp[NMB][i])+ddy) EndFor   If zoom = 0.1 Or zoom = 1 Then     dZ = -dZ   EndIf ' cycle reverse moving X,Y direction ''MahMia''cycleX= shapes.GetLeft(shp[NMB][3]) ' = face cycleX= shapes.GetLeft(shp[NMB][5]) ' = face ''WhT ''MahMia'' cycleY= shapes.GetTop(shp[NMB][3]) cycleY= shapes.GetTop(shp[NMB][5]) ''WhT ''MahMia''If cycleX<0 Or cycleX>GraphicsWindow.Width-shape[5][3]["width"] Then If cycleX<0 Or cycleX>GraphicsWindow.Width-shape[1][5]["width"] Then ''WhT ddx=-ddx EndIf ''MahMia''If cycleY<0 Or cycleY>cannon1_y-shape[5][3]["height"] Then If cycleY<0 Or cycleY>cannon1_y-shape[1][5]["height"] Then ''WhT ddy=-ddy EndIf ' ball moving and collision check If shoot Then shapes.Move(Ball ,shapes.GetLeft(ball)+angle/4,shapes.Gettop(ball)-bdy) If shapes.Gettop(ball)<-100 then shoot="False" Shapes.Move(Ball,cannon1_x+1,cannon1_y+30) Shapes.HideShape(Ball) EndIf ' collision check here ballX=shapes.GetLeft(ball) bally=shapes.GetTop(ball) ''MahMia''If cycleXcycleX-40 And ballXcycley-40 and ballyGHS939-0.sb< Start>GHT300.sb< ' Fire Engine 0.1 ' Copyright (c) Nonki Takahashi. All rights reserved. ' ' History: ' 0.1 03/04/2013 23:19:24 Shapes generated by Shapes 1.5 () ' GraphicsWindow.Title = "Fire Engine 0.1" ' initialize shapes SB_Workaround() Shapes_Init() ' add shapes scale = 1.5 angle = 0 iMin = 1 iMax = 43 Shapes_Add() Timer.Interval = 1000 Timer.Tick = OnTick Sub OnTick For op = 0 To 100 Step 10 Shapes.SetOpacity(shape[42]["obj"], op) Program.Delay(50) EndFor EndSub Sub Shapes_Init ' Shapes | Initialize shapes data ' return shX, shY - current position of shapes ' return shape - array of shapes shX = 80 ' x offset shY = 150 ' y offset shape = "" shape[1] = "func=rect;x=41;y=39;width=276;height=74;bc=#A30000;pw=0;" shape[2] = "func=tri;x=28;y=40;x1=13;y1=0;x2=0;y2=35;x3=26;y3=35;bc=#A30000;pw=0;" shape[3] = "func=rect;x=16;y=99;width=25;height=14;bc=#939393;pw=0;" shape[4] = "func=rect;x=28;y=74;width=14;height=25;bc=#A30000;pw=0;" shape[5] = "func=tri;x=29;y=44;x1=11;y1=0;x2=0;y2=27;x3=23;y3=27;bc=#000000;pw=0;" shape[6] = "func=rect;x=39;y=44;width=13;height=27;bc=#000000;pw=0;" shape[7] = "func=ell;x=63;y=94;width=32;height=34;bc=#939393;pc=#000000;pw=8;" shape[8] = "func=ell;x=218;y=94;width=32;height=34;bc=#939393;pc=#000000;pw=8;" shape[9] = "func=ell;x=253;y=95;width=32;height=34;bc=#939393;pc=#000000;pw=8;" shape[10] = "func=rect;x=64;y=44;width=17;height=27;bc=#000000;pw=0;" shape[11] = "func=rect;x=88;y=44;width=17;height=27;bc=#000000;pw=0;" shape[12] = "func=rect;x=0;y=0;width=40;height=36;bc=#939393;pw=0;" shape[13] = "func=rect;x=257;y=3;width=40;height=36;bc=#939393;pw=0;" shape[14] = "func=line;x=39;y=10;x1=0;y1=0;x2=220;y2=0;pc=#939393;pw=4;" shape[15] = "func=line;x=38;y=28;x1=0;y1=0;x2=221;y2=0;pc=#939393;pw=4;" shape[16] = "func=line;x=58;y=10;x1=0;y1=0;x2=0;y2=17;pc=#939393;pw=4;" shape[17] = "func=line;x=40;y=11;x1=17;y1=0;x2=0;y2=15;pc=#939393;pw=4;" shape[18] = "func=line;x=77;y=12;x1=0;y1=0;x2=0;y2=16;pc=#939393;pw=4;" shape[19] = "func=line;x=60;y=11;x1=16;y1=0;x2=0;y2=15;pc=#939393;pw=4;" shape[20] = "func=line;x=97;y=12;x1=0;y1=0;x2=0;y2=14;pc=#939393;pw=4;" shape[21] = "func=line;x=77;y=12;x1=19;y1=0;x2=0;y2=14;pc=#939393;pw=4;" shape[22] = "func=line;x=117;y=11;x1=0;y1=0;x2=0;y2=18;pc=#939393;pw=4;" shape[23] = "func=line;x=98;y=11;x1=18;y1=0;x2=0;y2=14;pc=#939393;pw=4;" shape[24] = "func=line;x=136;y=11;x1=0;y1=0;x2=0;y2=15;pc=#939393;pw=4;" shape[25] = "func=line;x=117;y=10;x1=17;y1=0;x2=0;y2=16;pc=#939393;pw=4;" shape[26] = "func=line;x=154;y=10;x1=0;y1=0;x2=0;y2=16;pc=#939393;pw=4;" shape[27] = "func=line;x=136;y=12;x1=18;y1=0;x2=0;y2=14;pc=#939393;pw=4;" shape[28] = "func=line;x=172;y=10;x1=0;y1=0;x2=0;y2=16;pc=#939393;pw=4;" shape[29] = "func=line;x=155;y=12;x1=17;y1=0;x2=0;y2=14;pc=#939393;pw=4;" shape[30] = "func=line;x=190;y=11;x1=0;y1=0;x2=0;y2=16;pc=#939393;pw=4;" shape[31] = "func=line;x=172;y=13;x1=18;y1=0;x2=0;y2=14;pc=#939393;pw=4;" shape[32] = "func=line;x=208;y=11;x1=0;y1=0;x2=0;y2=17;pc=#939393;pw=4;" shape[33] = "func=line;x=191;y=11;x1=15;y1=0;x2=0;y2=14;pc=#939393;pw=4;" shape[34] = "func=line;x=225;y=11;x1=0;y1=0;x2=0;y2=16;pc=#939393;pw=4;" shape[35] = "func=line;x=207;y=10;x1=19;y1=0;x2=0;y2=16;pc=#939393;pw=4;" shape[36] = "func=line;x=241;y=10;x1=0;y1=0;x2=0;y2=16;pc=#939393;pw=4;" shape[37] = "func=line;x=225;y=10;x1=16;y1=0;x2=0;y2=17;pc=#939393;pw=4;" shape[38] = "func=line;x=242;y=11;x1=15;y1=0;x2=0;y2=14;pc=#939393;pw=4;" shape[39] = "func=rect;x=122;y=63;width=33;height=43;bc=#939393;pw=0;" shape[40] = "func=rect;x=164;y=63;width=33;height=43;bc=#939393;pw=0;" shape[41] = "func=rect;x=56;y=30;width=26;height=9;bc=#110000;pw=0;" shape[42] = "func=rect;x=56;y=30;width=26;height=9;op=50;bc=#FF0000;pw=0;" shape[43] = "func=text;x=222;y=50;text=FIRE ENGINE;fs=9;fn=Arial;bc=#939393;" EndSub Sub Math_CartesianToPolar ' Math | convert cartesian coodinate to polar coordinate ' param x, y - cartesian coordinate ' return r, a - polar coordinate r = Math.SquareRoot(x * x + y * y) If x = 0 And y > 0 Then a = 90 ' [degree] ElseIf x = 0 And y < 0 Then a = -90 Else a = Math.ArcTan(y / x) * 180 / Math.Pi EndIf If x < 0 Then a = a + 180 ElseIf x > 0 And y < 0 Then a = a + 360 EndIf EndSub Sub SB_RotateWorkaround ' Small Basic | Rotate workaround for Silverlight ' param x, y - original coordinate ' param alpha - angle [radian] ' returns x, y - workaround coordinate If shape[i]["func"] = "tri" Then x1 = -Math.Floor(shape[i]["x3"] / 2) y1 = -Math.Floor(shape[i]["y3"] / 2) ElseIf shape[i]["func"] = "line" Then x1 = -Math.Floor(Math.Abs(shape[i]["x1"] - shape[i]["x2"]) / 2) y1 = -Math.Floor(Math.Abs(shape[i]["y1"] - shape[i]["y2"]) / 2) EndIf ox = x - x1 oy = y - y1 x = x1 * Math.Cos(alpha) - y1 * Math.Sin(alpha) + ox y = x1 * Math.Sin(alpha) + y1 * Math.Cos(alpha) + oy EndSub Sub SB_Workaround ' Small Basic | Workaround for Silverlight ' returns silverlight - "True" if in remote color = GraphicsWindow.GetPixel(0, 0) If Text.GetLength(color) > 7 Then silverlight = "True" msWait = 300 Else silverlight = "False" EndIf EndSub Sub Shapes_Add ' Shapes | add shapes as shapes data ' param iMin, iMax - shape indices to add ' param shape - array of shapes ' param scale - 1 if same scale ' return shWidth, shHeight - total size of shapes ' return shAngle - current angle of shapes Stack.PushValue("local", i) Shapes_CalcWidthAndHeight() s = scale For i = iMin To iMax GraphicsWindow.PenWidth = shape[i]["pw"] * s If shape[i]["pw"] > 0 Then GraphicsWindow.PenColor = shape[i]["pc"] EndIf If Text.IsSubText("rect|ell|tri|text", shape[i]["func"]) Then GraphicsWindow.BrushColor = shape[i]["bc"] EndIf If shape[i]["func"] = "rect" Then shape[i]["obj"] = Shapes.AddRectangle(shape[i]["width"]* s, shape[i]["height"] * s) ElseIf shape[i]["func"] = "ell" Then shape[i]["obj"] = Shapes.AddEllipse(shape[i]["width"]* s, shape[i]["height"] * s) ElseIf shape[i]["func"] = "tri" Then shape[i]["obj"] = Shapes.AddTriangle(shape[i]["x1"] * s, shape[i]["y1"] * s, shape[i]["x2"] * s, shape[i]["y2"] * s, shape[i]["x3"] * s, shape[i]["y3"] * s) ElseIf shape[i]["func"] = "line" Then shape[i]["obj"] = Shapes.AddLine(shape[i]["x1"] * s, shape[i]["y1"] * s, shape[i]["x2"] * s, shape[i]["y2"] * s) ElseIf shape[i]["func"] = "text" Then If silverlight Then fs = Math.Floor(shape[i]["fs"] * 0.9) Else fs = shape[i]["fs"] EndIf GraphicsWindow.FontSize = fs * s GraphicsWindow.FontName = shape[i]["fn"] shape[i]["obj"] = Shapes.AddText(shape[i]["text"]) EndIf If silverlight And shape[i]["func"] = "tri" Then alpha = Math.GetRadians(shape[i]["angle"]) x1 = -Math.Floor(shape[i]["x3"] / 2) y1 = -Math.Floor(shape[i]["y3"] / 2) ox = shape[i]["x"] - x1 oy = shape[i]["y"] - y1 r = Math.SquareRoot(x1 * x1 + y1 * y1) x = x1 * Math.Cos(alpha) - y1 * Math.Sin(alpha) + ox y = x1 * Math.Sin(alpha) + y1 * Math.Cos(alpha) + oy Shapes.Move(shape[i]["obj"], shX + x * s, shY + y * s) Else Shapes.Move(shape[i]["obj"], shX + shape[i]["x"] * s, shY + shape[i]["y"] * s) EndIf If Text.IsSubText("rect|ell|tri|text", shape[i]["func"]) And shape[i]["angle"] <> 0 Then Shapes.Rotate(shape[i]["obj"], shape[i]["angle"]) EndIf If shape[i]["op"] <> "" Then Shapes.SetOpacity(shape[i]["obj"], shape[i]["op"]) EndIf shape[i]["rx"] = shape[i]["x"] shape[i]["ry"] = shape[i]["y"] EndFor shAngle = 0 i = Stack.PopValue("local") EndSub Sub Shapes_CalcRotatePos ' Shapes | Calculate position for rotated shape ' param["x"], param["y"] - position of a shape ' param["width"], param["height"] - size of a shape ' param ["cx"], param["cy"] - center of rotation ' param ["angle"] - rotate angle ' return x, y - rotated position of a shape _cx = param["x"] + param["width"] / 2 _cy = param["y"] + param["height"] / 2 x = _cx - param["cx"] y = _cy - param["cy"] Math_CartesianToPolar() a = a + param["angle"] x = r * Math.Cos(a * Math.Pi / 180) y = r * Math.Sin(a * Math.Pi / 180) _cx = x + param["cx"] _cy = y + param["cy"] x = _cx - param["width"] / 2 y = _cy - param["height"] / 2 EndSub Sub Shapes_CalcWidthAndHeight ' Shapes | Calculate total width and height of shapes ' param iMin, iMax - shape indices to add ' return shWidth, shHeight - total size of shapes For i = iMin To iMax If shape[i]["func"] = "tri" Or shape[i]["func"] = "line" Then xmin = shape[i]["x1"] xmax = shape[i]["x1"] ymin = shape[i]["y1"] ymax = shape[i]["y1"] If shape[i]["x2"] < xmin Then xmin = shape[i]["x2"] EndIf If xmax < shape[i]["x2"] Then xmax = shape[i]["x2"] EndIf If shape[i]["y2"] < ymin Then ymin = shape[i]["y2"] EndIf If ymax < shape[i]["y2"] Then ymax = shape[i]["y2"] EndIf If shape[i]["func"] = "tri" Then If shape[i]["x3"] < xmin Then xmin = shape[i]["x3"] EndIf If xmax < shape[i]["x3"] Then xmax = shape[i]["x3"] EndIf If shape[i]["y3"] < ymin Then ymin = shape[i]["y3"] EndIf If ymax < shape[i]["y3"] Then ymax = shape[i]["y3"] EndIf EndIf shape[i]["width"] = xmax - xmin shape[i]["height"] = ymax - ymin EndIf If i = 1 Then shWidth = shape[i]["x"] + shape[i]["width"] shHeight = shape[i]["y"] + shape[i]["height"] Else If shWidth < shape[i]["x"] + shape[i]["width"] Then shWidth = shape[i]["x"] + shape[i]["width"] EndIf If shHeight < shape[i]["y"] + shape[i]["height"] Then shHeight = shape[i]["y"] + shape[i]["height"] EndIf EndIf EndFor EndSub Sub Shapes_Move ' Shapes | Move shapes ' param iMin, iMax - shape indices to add ' param shape - array of shapes ' param scale - to zoom ' param x, y - position to move ' return shX, shY - new position of shapes Stack.PushValue("local", i) s = scale shX = x shY = y For i = iMin To iMax _x = shape[i]["rx"] _y = shape[i]["ry"] Shapes.Move(shape[i]["obj"], shX + _x * s, shY + _y * s) EndFor i = Stack.PopValue("local") EndSub Sub Shapes_Remove ' Shapes | Remove shapes ' param iMin, iMax - shapes indices to remove ' param shape - array of shapes Stack.PushValue("local", i) For i = iMin To iMax Shapes.Remove(shape[i]["obj"]) EndFor i = Stack.PopValue("local") EndSub Sub Shapes_Rotate ' Shapes | Rotate shapes ' param iMin, iMax - shapes indices to rotate ' param shape - array of shapes ' param scale - to zoom ' param angle - to rotate Stack.PushValue("local", i) Stack.PushValue("local", x) Stack.PushValue("local", y) s = scale param["angle"] = angle param["cx"] = shWidth / 2 param["cy"] = shHeight / 2 For i = iMin To iMax param["x"] = shape[i]["x"] param["y"] = shape[i]["y"] param["width"] = shape[i]["width"] param["height"] = shape[i]["height"] Shapes_CalcRotatePos() If silverlight And Text.IsSubText("tri|line", shape[i]["func"]) Then alpha = Math.GetRadians(angle + shape[i]["angle"]) SB_RotateWorkAround() EndIf shape[i]["rx"] = x shape[i]["ry"] = y Shapes.Move(shape[i]["obj"], shX + x * s, shY + y * s) Shapes.Rotate(shape[i]["obj"], angle + shape[i]["angle"]) EndFor y = Stack.PopValue("local") x = Stack.PopValue("local") i = Stack.PopValue("local") EndSub End>GHT300.sb< Start>GHW437.sb< MAG = 15 OFSX = 15 OFSY = 55 GraphicsWindow.Width = 500 GraphicsWindow.Height = 500 initControl() Sub initControl GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(19, 7, "vertical size") textboxNY = Controls.AddTextBox(95, 5) Controls.SetSize(textboxNY, 30, 20) Controls.SetTextBoxText(textboxNY, 10) GraphicsWindow.DrawText(3, 28, "horizontal size") textboxNX = Controls.AddTextBox(95, 27) Controls.SetSize(textboxNX, 30, 20) Controls.SetTextBoxText(textboxNX, 10) buttonMake = Controls.AddButton("create", 128, 14) buttonSolve1 = Controls.AddButton("smart turtle", 190, 1) buttonSolve2 = Controls.AddButton("ordinary turtle", 190, 30) Controls.ButtonClicked = buttonProcedure Controls.HideControl(buttonSolve1) Controls.HideControl(buttonSolve2) EndSub Sub buttonProcedure button = Controls.LastClickedButton Controls.HideControl(buttonMake) Controls.HideControl(buttonSolve1) Controls.HideControl(buttonSolve2) If button = buttonMake Then solved = 0 If Controls.GetTextBoxText(textboxNX) <= 0 Then Controls.SetTextBoxText(textboxNX, 1) EndIf NX = Math.Floor(Controls.GetTextBoxText(textboxNX)) + 1 If Controls.GetTextBoxText(textboxNY) <= 0 Then Controls.SetTextBoxText(textboxNY, 1) EndIf NY = Math.Floor(Controls.GetTextBoxText(textboxNY)) + 1 makeMaze() turtleStandby() Controls.ShowControl(buttonMake) Controls.ShowControl(buttonSolve1) Controls.ShowControl(buttonSolve2) ElseIf button = buttonSolve1 Then If solved = 0 Then solveMaze() solved = 1 turtleWalk1() Else Turtle.Turn(360) EndIf Controls.ShowControl(buttonMake) Controls.ShowControl(buttonSolve1) Controls.ShowControl(buttonSolve2) ElseIf button = buttonSolve2 Then turtleWalk2() Controls.ShowControl(buttonMake) Controls.ShowControl(buttonSolve1) Controls.ShowControl(buttonSolve2) EndIf EndSub Sub clearWindow GraphicsWindow.BrushColor = GraphicsWindow.BackgroundColor GraphicsWindow.FillRectangle(OFSX, OFSY, GraphicsWindow.Width - OFSX, GraphicsWindow.Height - OFSY) EndSub Sub initMaze clearWindow() For x = 0 To NX For y = 0 To NY Node[x][y][0] = 0 Node[x][y][1] = 0 Node[x][y][2] = 0 EndFor EndFor For x = 1 To NX - 1 setWall_x = x setWall_y = 1 setWall_direction = "E" setWall() EndFor For y = 1 To NY - 2 setWall_x = NX setWall_y = y setWall_direction = "S" setWall() EndFor For x = NX To 2 Step -1 setWall_x = x setWall_y = NY setWall_direction = "W" setWall() EndFor For y = NY To 3 Step -1 setWall_x = 1 setWall_y = y setWall_direction = "N" setWall() EndFor EndSub Sub makeMaze initMaze() continue1 = 1 While continue1 = 1 selectAvailableNode() makeMaze_x = selectAvailableNode_x makeMaze_y = selectAvailableNode_y If RET_selectAvailableNode = 0 Then continue1 = 0 Else continue2 = 1 While continue2 = 1 addALine_x = makeMaze_x addALine_y = makeMaze_y addALine() makeMaze_x = addALine_x makeMaze_y = addALine_y If RET_addALine = 0 Then continue2 = 0 EndIf EndWhile EndIf EndWhile EndSub Sub setOrCheckWall If setOrCheckWall_direction = "N" Then xp = setOrCheckWall_x yp = setOrCheckWall_y - 1 valp = 1 ElseIf setOrCheckWall_direction = "E" Then xp = setOrCheckWall_x yp = setOrCheckWall_y valp = 0 ElseIf setOrCheckWall_direction = "S" Then xp = setOrCheckWall_x yp = setOrCheckWall_y valp = 1 ElseIf setOrCheckWall_direction = "W" Then xp = setOrCheckWall_x - 1 yp = setOrCheckWall_y valp = 0 Else RET_setOrCheckWall = 0 Goto ExitSub EndIf If Node[xp][yp][valp] = 0 Then If setOrCheckWall_mode = 1 Then Node[xp][yp][valp] = 1 drawWall_x = xp drawWall_y = yp drawWall_d = valp drawWall() EndIf RET_setOrCheckWall = 1 Else RET_setOrCheckWall = 0 EndIf ExitSub: EndSub Sub checkWall setOrCheckWall_x = checkWall_x setOrCheckWall_y = checkWall_y setOrCheckWall_direction = checkWall_direction setOrCheckWall_mode = 0 setOrCheckWall() RET_checkWall = RET_setOrCheckWall EndSub Sub setWall setOrCheckWall_x = setWall_x setOrCheckWall_y = setWall_y setOrCheckWall_direction = setWall_direction setOrCheckWall_mode = 1 setOrCheckWall() EndSub Sub drawWall GraphicsWindow.PenWidth = 1 GraphicsWindow.PenColor = "Black" If drawWall_d = 0 Then GraphicsWindow.DrawLine(drawWall_x * MAG + OFSX, drawWall_y * MAG + OFSY, (drawWall_x + 1) * MAG + OFSX, drawWall_y * MAG + OFSY) ElseIf drawWall_d = 1 Then GraphicsWindow.DrawLine(drawWall_x * MAG + OFSX, drawWall_y * MAG + OFSY, drawWall_x * MAG + OFSX, (drawWall_y + 1) * MAG + OFSY) EndIf EndSub Sub selectAvailableNode numAvailableNode() nAvailable = RET_numAvailableNode If nAvailable = 0 Then RET_selectAvailableNode = 0 Else iAvailable = Math.Floor((Math.GetRandomNumber(10000) - 1) / 10000 * nAvailable) For selectAvailableNode_x = 1 To NX For selectAvailableNode_y = 1 To NY isAvailableNode_x = selectAvailableNode_x isAvailableNode_y = selectAvailableNode_y isAvailableNode() If RET_isAvailableNode = 1 Then If iAvailable = 0 Then GoTo ExitLoop EndIf iAvailable = iAvailable - 1 EndIf EndFor EndFor ExitLoop: RET_selectAvailableNode = 1 EndIf EndSub Sub numAvailableNode RET_numAvailableNode = 0 For x = 1 To NX For y = 1 To NY isAvailableNode_x = x isAvailableNode_y = y isAvailableNode() If RET_isAvailableNode = 1 Then RET_numAvailableNode = RET_numAvailableNode + 1 EndIf EndFor EndFor EndSub Sub isAvailableNode If isAvailableNode_x >= 1 And isAvailableNode_x <= NX And isAvailableNode_y >= 1 And isAvailableNode_y <= NY Then isFreeNode_x = isAvailableNode_x isFreeNode_y = isAvailableNode_y isFreeNode() If RET_isFreeNode = 1 Then RET_isAvailableNode = 0 Else RET_isAvailableNode = 1 isFreeNode_x = isAvailableNode_x + 1 isFreeNode_y = isAvailableNode_y isFreeNode() If RET_isFreeNode = 0 Then isFreeNode_x = isAvailableNode_x isFreeNode_y = isAvailableNode_y + 1 isFreeNode() If RET_isFreeNode = 0 Then isFreeNode_x = isAvailableNode_x - 1 isFreeNode_y = isAvailableNode_y isFreeNode() If RET_isFreeNode = 0 Then isFreeNode_x = isAvailableNode_x isFreeNode_y = isAvailableNode_y - 1 isFreeNode() If RET_isFreeNode = 0 Then RET_isAvailableNode = 0 EndIf EndIf EndIf EndIf EndIf Else RET_isAvailableNode = 0 EndIf EndSub Sub isFreeNode If isFreeNode_x > 1 And isFreeNode_x < NX And isFreeNode_y > 1 And isFreeNode_y < NY Then If Node[isFreeNode_x][isFreeNode_y][0] = 0 And Node[isFreeNode_x][isFreeNode_y][1] = 0 And Node[isFreeNode_x - 1][isFreeNode_y][0] = 0 And Node[isFreeNode_x][isFreeNode_y - 1][1] = 0 Then RET_isFreeNode = 1 Else RET_isFreeNode = 0 EndIf Else RET_isFreeNode = 0 EndIf EndSub Sub addALine direct[0] = "N" direct[1] = "E" direct[2] = "S" direct[3] = "W" maxD = 0 For i = 0 To 3 checkWall_x = addALine_x checkWall_y = addALine_y checkWall_direction = direct[i] checkWall() If RET_checkWall = 1 Then maxD = maxD + 1 EndIf EndFor iD = Math.Floor((Math.GetRandomNumber(10000) - 1) / 10000 * maxD) For i = 0 To 3 checkWall_x = addALine_x checkWall_y = addALine_y checkWall_direction = direct[i] checkWall() If RET_checkWall = 1 Then If iD = 0 Then nD = i Goto ExitFor EndIf iD = iD - 1 EndIf EndFor ExitFor: If direct[nD] = "N" Then xn = addALine_x yn = addALine_y - 1 ElseIf direct[nD] = "E" Then xn = addALine_x + 1 yn = addALine_y ElseIf direct[nD] = "S" Then xn = addALine_x yn = addALine_y + 1 ElseIf direct[nD] = "W" Then xn = addALine_x - 1 yn = addALine_y EndIf isFreeNode_x = xn isFreeNode_y = yn isFreeNode() If RET_isFreeNode = 1 Then setWall_x = addALine_x setWall_y = addALine_y setWall_direction = direct[nD] setWall() addALine_x = xn addALine_y = yn RET_addALine = 1 Else RET_addALine = 0 EndIf EndSub Sub solveMaze changed = 1 While changed = 1 changed = 0 For x = 1 To NX - 1 For y = 1 To NY - 1 numWalls_x = x numWalls_y = y numWalls() If RET_numWalls = 3 Then If Node[x][y][0] = 0 Then Node[x][y][0] = 1 changed = 1 EndIf If Node[x][y][1] = 0 Then Node[x][y][1] = 1 changed = 1 EndIf If Node[x][y + 1][0] = 0 Then Node[x][y + 1][0] = 1 changed = 1 EndIf If Node[x + 1][y][1] = 0 Then Node[x + 1][y][1] = 1 changed = 1 EndIf EndIf EndFor EndFor EndWhile GraphicsWindow.PenWidth = 1 GraphicsWindow.PenColor = "Green" For x = 0 To NX For y = 0 To NY wallsInfo_x = x wallsInfo_y = y wallsInfo() Goto SkipDrawRoute gx = (x + 0.5) * MAG + OFSX gy = (y + 0.5) * MAG + OFSY len = MAG / 2 If Math.Remainder(Node[x][y][2], 2) = 0 Then ' "N" GraphicsWindow.DrawLine(gx, gy, gx, gy - len) EndIf If Math.Remainder(Math.Floor(Node[x][y][2] / 2), 2) = 0 Then ' "W" GraphicsWindow.DrawLine(gx, gy, gx - len, gy) EndIf If Math.Remainder(Math.Floor(Node[x][y][2] / 4), 2) = 0 Then ' "S" GraphicsWindow.DrawLine(gx, gy, gx, gy + len) EndIf If Math.Remainder(Math.Floor(Node[x][y][2] / 8), 2) = 0 Then ' "E" GraphicsWindow.DrawLine(gx, gy, gx + len, gy) EndIf SkipDrawRoute: EndFor EndFor EndSub Sub numWalls If numWalls_x > 0 And numWalls_x < NX And numWalls_y > 0 And numWalls_y < NY Then RET_numWalls = 0 If Node[numWalls_x][numWalls_y][0] > 0 Then ' "N" RET_numWalls = RET_numWalls + 1 EndIf If Node[numWalls_x][numWalls_y][1] > 0 Then ' "W" RET_numWalls = RET_numWalls + 1 EndIf If Node[numWalls_x][numWalls_y + 1][0] > 0 Then ' "S" RET_numWalls = RET_numWalls + 1 EndIf If Node[numWalls_x + 1][numWalls_y][1] > 0 Then ' "E" RET_numWalls = RET_numWalls + 1 EndIf Else RET_numWalls = 4 EndIf EndSub Sub wallsInfo If wallsInfo_x > 0 And wallsInfo_x < NX And wallsInfo_y > 0 And wallsInfo_y < NY Then If Node[wallsInfo_x][wallsInfo_y][0] > 0 Then ' "N" Node[wallsInfo_x][wallsInfo_y][2] = Node[wallsInfo_x][wallsInfo_y][2] + 1 EndIf If Node[wallsInfo_x][wallsInfo_y][1] > 0 Then ' "W" Node[wallsInfo_x][wallsInfo_y][2] = Node[wallsInfo_x][wallsInfo_y][2] + 2 EndIf If Node[wallsInfo_x][wallsInfo_y + 1][0] > 0 Then ' "S" Node[wallsInfo_x][wallsInfo_y][2] = Node[wallsInfo_x][wallsInfo_y][2] + 4 EndIf If Node[wallsInfo_x + 1][wallsInfo_y][1] > 0 Then ' "E" Node[wallsInfo_x][wallsInfo_y][2] = Node[wallsInfo_x][wallsInfo_y][2] + 8 EndIf Else Node[wallsInfo_x][wallsInfo_y][2] = Node[wallsInfo_x][wallsInfo_y][2] + 15 EndIf EndSub Sub turtleStandby Turtle.PenUp() Turtle.X = (0 + 0.5) * MAG + OFSX Turtle.Y = (1 + 0.5) * MAG + OFSY Turtle.Angle = 0 Turtle.Speed = 8 Turtle.Turn(90) EndSub Sub turtleWalk1 GraphicsWindow.PenWidth = 1 GraphicsWindow.PenColor = "Green" gx0 = Turtle.X gy0 = Turtle.Y x = 1 y = 1 gx1 = (x + 0.5) * MAG + OFSX gy1 = (y + 0.5) * MAG + OFSY Turtle.MoveTo(gx1, gy1) GraphicsWindow.DrawLine(gx0, gy0, gx1, gy1) gx0 = Turtle.X gy0 = Turtle.Y from = "W" While x <> NX - 1 Or y <> NY - 1 If from <> "S" And Math.Remainder(Node[x][y + 1][2], 2) = 0 Then ' "N" y = y + 1 from = "N" ElseIf from <> "E" And Math.Remainder(Math.Floor(Node[x + 1][y][2] / 2), 2) = 0 Then ' "W" x = x + 1 from = "W" ElseIf from <> "N" And Math.Remainder(Math.Floor(Node[x][y - 1][2] / 4), 2) = 0 Then ' "S" y = y - 1 from = "S" ElseIf from <> "W" And Math.Remainder(Math.Floor(Node[x - 1][y][2] / 8), 2) = 0 Then ' "E" x = x - 1 from = "E" EndIf gx1 = (x + 0.5) * MAG + OFSX gy1 = (y + 0.5) * MAG + OFSY Turtle.MoveTo(gx1, gy1) GraphicsWindow.DrawLine(gx0, gy0, gx1, gy1) gx0 = Turtle.X gy0 = Turtle.Y EndWhile x = x + 1 gx1 = (x + 0.5) * MAG + OFSX gy1 = (y + 0.5) * MAG + OFSY Turtle.MoveTo(gx1, gy1) GraphicsWindow.DrawLine(gx0, gy0, gx1, gy1) gy1 = (0 + 0.5) * MAG + OFSY Turtle.MoveTo(gx1, gy1) gx1 = (0 + 0.5) * MAG + OFSX Turtle.MoveTo(gx1, gy1) gy1 = (1 + 0.5) * MAG + OFSY Turtle.MoveTo(gx1, gy1) Turtle.Turn(-90) EndSub Sub turtleWalk2 x = 1 y = 1 gx1 = (x + 0.5) * MAG + OFSX gy1 = (y + 0.5) * MAG + OFSY Turtle.MoveTo(gx1, gy1) gx0 = Turtle.X gy0 = Turtle.Y from = "W" While x <> NX - 1 Or y <> NY - 1 If from = "S" Then If Node[x + 1][y][1] = 0 Then ' "E" x = x + 1 from = "W" ElseIf Node[x][y][0] = 0 Then ' "N" y = y - 1 from = "S" ElseIf Node[x][y][1] = 0 Then ' "W" x = x - 1 from = "E" ElseIf Node[x][y + 1][0] = 0 Then ' "S" y = y + 1 from = "N" EndIf ElseIf from = "E" Then If Node[x][y][0] = 0 Then ' "N" y = y - 1 from = "S" ElseIf Node[x][y][1] = 0 Then ' "W" x = x - 1 from = "E" ElseIf Node[x][y + 1][0] = 0 Then ' "S" y = y + 1 from = "N" ElseIf Node[x + 1][y][1] = 0 Then ' "E" x = x + 1 from = "W" EndIf ElseIf from = "N" Then If Node[x][y][1] = 0 Then ' "W" x = x - 1 from = "E" ElseIf Node[x][y + 1][0] = 0 Then ' "S" y = y + 1 from = "N" ElseIf Node[x + 1][y][1] = 0 Then ' "E" x = x + 1 from = "W" ElseIf Node[x][y][0] = 0 Then ' "N" y = y - 1 from = "S" EndIf ElseIf from = "W" Then If Node[x][y + 1][0] = 0 Then ' "S" y = y + 1 from = "N" ElseIf Node[x + 1][y][1] = 0 Then ' "E" x = x + 1 from = "W" ElseIf Node[x][y][0] = 0 Then ' "N" y = y - 1 from = "S" ElseIf Node[x][y][1] = 0 Then ' "W" x = x - 1 from = "E" EndIf EndIf gx1 = (x + 0.5) * MAG + OFSX gy1 = (y + 0.5) * MAG + OFSY Turtle.MoveTo(gx1, gy1) gx0 = Turtle.X gy0 = Turtle.Y EndWhile x = x + 1 gx1 = (x + 0.5) * MAG + OFSX gy1 = (y + 0.5) * MAG + OFSY Turtle.MoveTo(gx1, gy1) gy1 = (0 + 0.5) * MAG + OFSY Turtle.MoveTo(gx1, gy1) gx1 = (0 + 0.5) * MAG + OFSX Turtle.MoveTo(gx1, gy1) gy1 = (1 + 0.5) * MAG + OFSY Turtle.MoveTo(gx1, gy1) Turtle.Turn(-90) EndSub End>GHW437.sb< Start>GHX075.sb< ' Weigh Scale 0.1 ' Copyright (c) 2012 Nonki Takahashi ' ' History : ' 0.1 2012/07/14 Created ' MAG = 5 GraphicsWindow.Title = "Weigh Scale 0.1" wtApple = 300 ' [g] wtOrange = 200 ' [g] wtLimit = 3200 ' [g] wtMax = 5000 ' [g] nLine = 0 DrawScale() nApple = Math.Floor(wtMax / wtApple) GraphicsWindow.PenColor = "DarkRed" j = 0 ' to calculate nABase (base number for apples) GraphicsWindow.FontSize = MAG * 2.5 GraphicsWindow.FontName = "Consolas" For i = 1 To nApple j = j + i If j < nApple + (i + 1) Then nABase = i EndIf GraphicsWindow.BrushColor = "Red" oApple[i] = Shapes.AddEllipse(MAG * 14, MAG * 15) GraphicsWindow.BrushColor = "DarkRed" oAHull[i] = Shapes.AddText("l") EndFor nABase = nABase + 1 h = 0 w = 0 x0 = 0 y0 = GraphicsWindow.Height - MAG * 2 For i = 1 To nApple w = w + 1 x1 = x0 + w * MAG * 4 + h * MAG * 2 y1 = y0 - MAG * (15 + h * 13) + 1 Shapes.Move(oApple[i], x1, y1) Shapes.Move(oAHull[i], x1 + MAG * 6.5, y1 - MAG) uApple[i]["x"] = x1 ' unload position uApple[i]["y"] = y1 If w >= nABase - h Then h = h + 1 w = 0 EndIf EndFor h = 0 w = 0 x0 = x - MAG * 7.5 * nABase / 2 y0 = y - MAG * 20 For i = 1 To nApple w = w + 1 x1 = x0 + w * MAG * 4 + h * MAG * 2 y1 = y0 - MAG * (15 + h * 13) + 1 lApple[nApple - i + 1]["x"] = x1 ' load position lApple[nApple - i + 1]["y"] = y1 If w >= nABase - h Then h = h + 1 w = 0 EndIf EndFor nOrange = Math.Floor(wtMax / wtOrange) GraphicsWindow.PenColor = "DarkOrange" GraphicsWindow.FontSize = MAG * 2.5 GraphicsWindow.FontName = "Consolas" j = 0 ' to calculate nOBase (base number for oranges) For i = 1 To nOrange j = j + i If j < nOrange + (i + 1) Then nOBase = i EndIf GraphicsWindow.BrushColor = "Orange" oOrange[i] = Shapes.AddEllipse(MAG * 13, MAG * 11) GraphicsWindow.BrushColor = "Green" oOHull[i] = Shapes.AddText("*") EndFor nOBase = nOBase + 1 h = 0 w = 0 x0 = MAG * 4 y0 = GraphicsWindow.Height - MAG * 2 For i = 1 To nOrange w = w + 1 x1 = x0 + w * MAG * 4 + h * MAG * 2 y1 = y0 - MAG * (11 + h * 9) + 1 Shapes.Move(oOrange[i], x1, y1) Shapes.Move(oOHull[i], x1 + MAG * 6, y1) uOrange[i]["x"] = x1 ' unload position uOrange[i]["y"] = y1 If w >= nOBase - h Then h = h + 1 w = 0 EndIf EndFor h = 0 w = 0 x0 = x - MAG * 5.5 * nOBase / 2 y0 = y - MAG * 20 For i = 1 To nOrange w = w + 1 x1 = x0 + w * MAG * 4 + h * MAG * 2 y1 = y0 - MAG * (11 + h * 9) + 1 lOrange[nOrange - i + 1]["x"] = x1 ' load position lOrange[nOrange - i + 1]["y"] = y1 If w >= nOBase - h Then h = h + 1 w = 0 EndIf EndFor DrawLimit() For wt = 0 To 5000 Step 100 DrawArm() EndFor For wt = 5000 To 0 Step -100 EndFor wt = 0 For iApple = 0 To nApple For iOrange = 1 To nOrange wt = wt + wtOrange DrawArm() LoadOrange() If wt = wtLimit Then ShowAnswer() UnloadOranges() Goto break ElseIf wt > wtLimit Then UnloadOranges() Goto break EndIf EndFor break: wt = wt + wtApple DrawArm() LoadApple() If wt = wtLimit Then ShowAnswer() Goto exit ElseIf wt > wtLimit Then Goto exit EndIf EndFor exit: Sub ShowAnswer ' param iApple - number of apple loaded ' param iOrange - number of orange loaded GraphicsWindow.FontSize = 14 GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(10, 10 + nLine * 16, "Apple=" + iApple + ", Orange=" + iOrange) nLine = nLine + 1 Program.Delay(500) EndSub Sub LoadApple ' param iApple - index to load x1 = lApple[nApple - iApple + 1]["x"] ' load position y1 = lApple[nApple - iApple + 1]["y"] Shapes.Animate(oApple[nApple - iApple + 1], x1, y1, 400) Shapes.Animate(oAHull[nApple - iApple + 1], x1 + MAG * 6.5, y1 - MAG, 400) Program.Delay(400) RedrawApplesAndOranges() EndSub Sub LoadOrange ' param iOrange - index to load x1 = lOrange[nOrange - iOrange + 1]["x"] ' load position y1 = lOrange[nOrange - iOrange + 1]["y"] Shapes.Animate(oOrange[nOrange - iOrange + 1], x1, y1, 400) Shapes.Animate(oOHull[nOrange - iOrange + 1], x1 + MAG * 6, y1, 400) Program.Delay(400) RedrawApplesAndOranges() EndSub Sub RedrawApplesAndOranges For i = 1 To iApple x1 = lApple[nApple - i + 1]["x"] ' load position y1 = lApple[nApple - i + 1]["y"] Shapes.Move(oApple[nApple - i + 1], x1, y1 + MAG * dy) Shapes.Move(oAHull[nApple - i + 1], x1 + MAG * 6.5, y1 + MAG * (dy - 1)) EndFor For i = 1 To iOrange x1 = lOrange[nOrange - i + 1]["x"] ' load position y1 = lOrange[nOrange - i + 1]["y"] Shapes.Move(oOrange[nOrange - i + 1], x1, y1 + MAG * dy) Shapes.Move(oOHull[nOrange - i + 1], x1 + MAG * 6, y1 + MAG * dy) EndFor EndSub Sub UnloadOranges For iOrange = iOrange To 1 Step -1 wt = wt - wtOrange DrawArm() UnloadOrange() EndFor RedrawApplesAndOranges() EndSub Sub UnloadOrange ' param iOrange - index to unload x1 = uOrange[nOrange - iOrange + 1]["x"] ' unload position y1 = uOrange[nOrange - iOrange + 1]["y"] Shapes.Animate(oOrange[nOrange - iOrange + 1], x1, y1, 100) Shapes.Animate(oOHull[nOrange - iOrange + 1], x1 + MAG * 6, y1, 100) Program.Delay(100) EndSub Sub DrawScale ' return x, y - center of scale x = GraphicsWindow.Width * 0.7 y = GraphicsWindow.Height * 0.8 ' Draw cylinders and tray GraphicsWindow.PenColor = "Gray" GraphicsWindow.BrushColor = "Gray" oLCylinder = Shapes.AddRectangle(MAG, MAG * 5) oRCylinder = Shapes.AddRectangle(MAG, MAG * 5) Shapes.Move(oLCylinder, x - MAG * 4, y - MAG * 19) Shapes.Move(oRCylinder, x + MAG * 3, y - MAG * 19) oTray = Shapes.AddRectangle(MAG * 50, MAG) Shapes.Move(oTray, x - MAG * 25, y - MAG * 20 + 1) ' Draw body and foot GraphicsWindow.PenColor = "DarkCyan" GraphicsWindow.BrushColor = "DarkCyan" oBody = Shapes.AddRectangle(MAG * 14, MAG * 28) Shapes.Move(oBody, x - MAG * 7, y - MAG * 14) oFoot = Shapes.AddRectangle(MAG * 20, MAG * 2) Shapes.Move(oFoot, x - MAG * 10, y + MAG * 14 - 1) ' Draw disk and scale GraphicsWindow.PenColor = "Gray" GraphicsWindow.BrushColor = "White" oDisk = Shapes.AddEllipse(MAG * 24, MAG * 24) Shapes.Move(oDisk, x - MAG * 12, y - MAG * 12) GraphicsWindow.PenColor = "LightGray" For wt = 100 To wtMax Step 100 l = MAG If Math.Remainder(wt, 500) = 0 Then l = MAG * 2 EndIf oScale = Shapes.AddLine(0, 0, 0, l) a = wt / wtMax * 360 ' angle [degree] x1 = x + MAG * 10 * Math.Sin(a / 180 * Math.Pi) y1 = y - MAG * 10 * Math.Cos(a / 180 * Math.Pi) - l / 2 Shapes.Move(oScale, x1, y1) Shapes.Rotate(oScale, a) EndFor GraphicsWindow.BrushColor = "DimGray" GraphicsWindow.FontSize = MAG * 2 For wt = 1000 To wtMax Step 1000 oDigits = Shapes.AddText(wt) a = wt / wtMax * 360 ' angle [degree] x1 = x + MAG * 7 * Math.Sin(a / 180 * Math.Pi) - MAG * 1.4 * 2 y1 = y - MAG * 7 * Math.Cos(a / 180 * Math.Pi) - MAG Shapes.Move(oDigits, x1, y1) EndFor ' Draw arms GraphicsWindow.PenColor = "Red" oLimit = Shapes.AddLine(0, 0, 0, MAG * 10) Shapes.Move(oLimit, x, y - MAG * 10) GraphicsWindow.PenColor = "Black" oArm = Shapes.AddLine(0, 0, 0, MAG * 10) Shapes.Move(oArm, x, y - MAG * 10) GraphicsWindow.PenColor = "DarkCyan" GraphicsWindow.BrushColor = "DarkCyan" oSticker = Shapes.AddEllipse(MAG * 6, MAG * 6) Shapes.Move(oSticker, x - MAG * 3, y - MAG * 3) EndSub Sub DrawArm ' param x, y - center of scale ' param wt - weight [g] ' return dy - offset by weight a = wt / wtMax * 360 ' angle [degree] dy = 5 * wt / wtMax Shapes.Move(oLCylinder, x - MAG * 4, y - MAG * (19 - dy)) Shapes.Move(oRCylinder, x + MAG * 3, y - MAG * (19 - dy)) Shapes.Move(oTray, x - MAG * 25, y - MAG * (20 - dy) + 1) x1 = x + MAG * 5 * Math.Sin(a / 180 * Math.Pi) y1 = y - MAG * 5 * (Math.Cos(a / 180 * Math.Pi) + 1) Shapes.Move(oArm, x1, y1) Shapes.Rotate(oArm, a) EndSub Sub DrawLimit ' param x, y - center of scale ' param wtLimit - limit weight [g] a = wtLimit / wtMax * 360 ' angle [degree] x1 = x + MAG * 5 * Math.Sin(a / 180 * Math.Pi) y1 = y - MAG * 5 * (Math.Cos(a / 180 * Math.Pi) + 1) Shapes.Move(oLimit, x1, y1) Shapes.Rotate(oLimit, a) EndSub End>GHX075.sb< Start>GHZ805.sb< TextWindow.ForegroundColor = "yellow" TextWindow.Title = "Guess The Number" TextWindow.Write("Welcome, ") Start: i = 0 RandomNum = Math.GetRandomNumber(100) TextWindow.WriteLine("I am thinking of a new number from 1 - 100, what is your first guess?") Guess1 = TextWindow.Read() If Guess1 < RandomNum Then TextWindow.Write("Too low, ") i = i + 1 Goto Start2 EndIf If Guess1 > RandomNum Then TextWindow.Write("Too high, ") i = i + 1 Goto Start2 EndIf If Guess1 = RandomNum Then i = i + 1 TextWindow.WriteLine("Correct! You found my number in only" + i + " Guess") TextWindow.WriteLine("Do you want to play again?") Replaygame1 = TextWindow.Read() EndIf If Replaygame1 = "Yes" Or Replaygame1 = "yes" Or Replaygame1 = "Y" Or Replaygame1 = "y" Then Goto Start EndIf If Replaygame1 = "No" Or Replaygame1 = "no" Or Replaygame1 = "N" Or Replaygame1 = "n" Then TextWindow.Write("Thanks for playing!") Program.End() EndIf Start2: TextWindow.WriteLine("What is your next guess?") Guess = TextWindow.Read() If Guess < RandomNum Then TextWindow.Write("Too low, ") i = i + 1 Goto Start2 EndIf If Guess > RandomNum Then TextWindow.Write("Too high, ") i = i + 1 Goto Start2 EndIf If Guess = RandomNum Then i = i + 1 TextWindow.WriteLine("Correct! You found my number in " + i + " Guesses") TextWindow.WriteLine("Do you want to play again?") Replaygame = TextWindow.Read() EndIf If Replaygame = "Yes" Or Replaygame = "yes" Or Replaygame = "Y" Or Replaygame = "y" Then Goto Start EndIf If Replaygame = "No" Or Replaygame = "no" Or Replaygame = "N" Or Replaygame = "n" Then TextWindow.Write("Thanks for playing!") Program.Delay(2000) Program.End() EndIf End>GHZ805.sb< Start>GJC622-0.sb< 'Written by Thaelmann-Pioniere GraphicsWindow.Title="Pictionary" GraphicsWindow.Width=598 GraphicsWindow.Height=428 GraphicsWindow.DrawRectangle(50,100,498,300) GraphicsWindow.BrushColor="Red" GraphicsWindow.FillRectangle(49,20,500,80) GraphicsWindow.FontName="Franklin Gothic" GraphicsWindow.FontSize=28 For day = 1 To 7 For week = 1 To 5 GraphicsWindow.DrawText(day*498/7,week*300/4-20,(week-2)*7+day) EndFor EndFor GraphicsWindow.BrushColor="Gold" GraphicsWindow.DrawText(240,45,"Calendar") GraphicsWindow.PenColor="Red" GraphicsWindow.DrawEllipse(55,110,490,75) GraphicsWindow.FontName="Trebchet MS" GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=50 GraphicsWindow.DrawText(450,358,"Week") End>GJC622-0.sb< Start>GJC622-1.sb< 'Written by Thaelmann-Pioniere GraphicsWindow.Width=598 GraphicsWindow.Height=428 GraphicsWindow.Title="Pictionary" GraphicsWindow.BrushColor="Black" GraphicsWindow.FontName="Times New Roman" GraphicsWindow.FontBold="false" GraphicsWindow.FontSize=48 GraphicsWindow.DrawText(50,100,"Normal") GraphicsWindow.DrawText(50,200,"12345ABC") GraphicsWindow.FontBold="true" GraphicsWindow.DrawText(300,100,"Bold") GraphicsWindow.DrawText(300,200,"12345ABC") GraphicsWindow.DrawLine(280,50,280,300) GraphicsWindow.FontName="Trebchet MS" GraphicsWindow.FontBold="false" GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=50 GraphicsWindow.DrawText(450,358,"Bold") End>GJC622-1.sb< Start>GJC622-2.sb< 'Written by Thaelmann-Pioniere GraphicsWindow.Width=598 GraphicsWindow.Height=428 GraphicsWindow.Title="Pictionary" GraphicsWindow.BrushColor="Black" GraphicsWindow.FontName="Times New Roman" GraphicsWindow.FontBold="false" GraphicsWindow.FontSize=48 GraphicsWindow.DrawText(50,100,"Normal") GraphicsWindow.DrawText(50,200,"12345ABC") GraphicsWindow.FontItalic="true" GraphicsWindow.DrawText(300,100,"Italic") GraphicsWindow.DrawText(300,200,"12345ABC") GraphicsWindow.DrawLine(280,50,280,300) GraphicsWindow.FontName="Trebchet MS" GraphicsWindow.FontItalic="false" GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=50 GraphicsWindow.DrawText(450,358,"Italic") End>GJC622-2.sb< Start>GJC622-3.sb< 'Written by Thaelmann-Pioniere GraphicsWindow.Title="Pictionary" GraphicsWindow.Width=598 GraphicsWindow.Height=428'init GraphicsWindow.BrushColor="DodgerBlue" a=100 For x = 1 To 2 For y = 1 To 2 GraphicsWindow.FillRectangle(x*a+99,y*a+14,a,a) GraphicsWindow.DrawRectangle(x*a+99,y*a+14,a,a) EndFor EndFor'Draw the rectangle GraphicsWindow.FontName="Times New Roman" GraphicsWindow.FontSize=48 GraphicsWindow.BrushColor="White" GraphicsWindow.FontBold="false" GraphicsWindow.DrawText(250,180,"4cm") GraphicsWindow.FontSize=22 GraphicsWindow.DrawText(330,180,"2") GraphicsWindow.FontSize=48'Draw "4cm2" GraphicsWindow.BrushColor="Red" GraphicsWindow.PenColor="Red" GraphicsWindow.DrawText(400,200,"√4cm") GraphicsWindow.DrawLine(425,200,450,200) GraphicsWindow.DrawText(250,60,"√4cm") GraphicsWindow.DrawLine(275,60,300,60) GraphicsWindow.DrawEllipse(400,190,120,70) GraphicsWindow.DrawEllipse(250,55,120,60)'Draw two "√4cm" GraphicsWindow.FontName="Trebchet MS" GraphicsWindow.FontBold="false" GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=50 GraphicsWindow.DrawText(450,358,"Root") End>GJC622-3.sb< Start>GJC622.sb< 'Written by Thaelmann-Pioniere GraphicsWindow.Title="Pictionary" GraphicsWindow.Width=598 GraphicsWindow.Height=428 GraphicsWindow.DrawRectangle(50,100,498,300) GraphicsWindow.BrushColor="Red" GraphicsWindow.FillRectangle(49,20,500,80) GraphicsWindow.FontName="Franklin Gothic" GraphicsWindow.FontSize=28 For day = 1 To 7 For week = 1 To 5 GraphicsWindow.DrawText(day*498/7,week*300/4-20,(week-2)*7+day) EndFor EndFor GraphicsWindow.BrushColor="Gold" GraphicsWindow.DrawText(240,45,"Calendar") GraphicsWindow.PenColor="Red" GraphicsWindow.DrawEllipse(55,110,490,75) GraphicsWindow.FontName="Consolas" GraphicsWindow.BrushColor="Black" GraphicsWindow.DrawText(500,400,"Week") End>GJC622.sb< Start>GJC847.sb< 'Leap Frog Program InitializeProgram() ''removes homes as level increased 'after level 5 makes all road level Sub initializeprogram 'graphics window GraphicsWindow.Width = 640 GraphicsWindow.Height = 510 level = 1 homes=5 GraphicsWindow.Title = "Leap Frog - Level 1" GraphicsWindow.BackgroundColor = "DarkGreen" gamestatus = "Stopped" 'define buttons GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontBold = "false" GraphicsWindow.FontSize = 16 startpausebutton = Controls.AddButton("Start Game", 120,475) Controls.SetSize(startpausebutton, 120,31) exitstopbutton = Controls.AddButton("Exit", 260,475) Controls.SetSize(exitstopbutton, 120,31) highscoresbutton = Controls.AddButton("High Scores", 400,475) Controls.SetSize(highscoresbutton, 120,31) Controls.ButtonClicked = buttonclickedsub 'vehicles on road roadtop = 290 roadheight = 140 drawroad() numberofvehicles = 12 GraphicsWindow.BrushColor = "DarkGray" vehicle[1] = Shapes.AddRectangle(120,40) vehicle[2] = Shapes.AddRectangle(80,40) vehicle[3] = Shapes.AddRectangle(40,40) vehicle[4] = Shapes.AddRectangle(40,40) vehicle[5] = Shapes.AddRectangle(80,40) vehicle[6] = Shapes.AddRectangle(40,40) vehicle[7] = Shapes.AddRectangle(80,40) vehicle[8] = Shapes.AddRectangle(80,40) vehicle[9] = Shapes.AddRectangle(40,40) vehicle[10] = Shapes.AddRectangle(120,40) vehicle[11] = Shapes.AddRectangle(40,40) vehicle[12] = Shapes.AddRectangle(80,40) For i = 1 To 12 Shapes.HideShape(vehicle[i]) vehicleisvisible[i] = "false" EndFor 'logs in river rivertop = 130 riverheight = 120 GraphicsWindow.BrushColor = GraphicsWindow.GetColorFromRGB(128,128,225) GraphicsWindow.FillRectangle(0,rivertop, GraphicsWindow.Width, riverheight) numberoflogs = 12 GraphicsWindow.BrushColor = "Brown" log[1] = Shapes.AddRectangle(80,40) log[2] = Shapes.AddRectangle(120,40) log[3] = Shapes.AddRectangle(40,40) log[4] = Shapes.AddRectangle(80,40) log[5] = Shapes.AddRectangle(80,40) log[6] = Shapes.AddRectangle(40,40) log[7] = Shapes.AddRectangle(120,40) log[8] = Shapes.AddRectangle(80,40) log[9] = Shapes.AddRectangle(120,40) log[10] = Shapes.AddRectangle(120,40) log[12] = Shapes.AddRectangle(80,40) log[12] = Shapes.AddRectangle(120,40) For i = 1 To 12 Shapes.HideShape(log[i]) logisvisible[i] = "false" EndFor 'snake grasstop = 250 grassheight = 40 GraphicsWindow.BrushColor = "Black" snake1 = Shapes.AddRectangle(111,24) snake2 = Shapes.AddRectangle(111,24) snake = snake1 snakespeed = 5 snakex = 0 snakey = grasstop +7 snakew = 111 snakeh = 24 Shapes.HideShape(snake1) Shapes.HideShape(snake2) snakeisvisible = "false" 'frogs GraphicsWindow.BrushColor = "LightGreen" frogup = Shapes.AddRectangle(40,40) frogdown = Shapes.AddRectangle(40,40) frogleft = Shapes.AddRectangle(40,40) frogright = Shapes.AddRectangle(40,40) froghome = Shapes.AddRectangle(40,40) Shapes.HideShape(frogup) Shapes.HideShape(frogdown) Shapes.HideShape(frogleft) Shapes.HideShape(frogright) Shapes.HideShape(froghome) frogw = 40 frogh = 40 starttop = 430 startheight = 40 hometop = 50 homeheight = 80 drawhome() 'scoring score = 0 highscore = 0 GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.FontSize = 20 GraphicsWindow.FontBold = "false" GraphicsWindow.DrawText(5,5,"Score") GraphicsWindow.DrawText(175,5,"High Score") GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle(65,5,90,25) GraphicsWindow.FillRectangle(280,5,90,25) 'second line has lowest score ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' highscore = File.ReadLine(Program.Directory + "\highscores.txt",2) 'last line has lowest score ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' lowscore = File.ReadLine(Program.Directory + "\highscores.txt", 20) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 20 GraphicsWindow.FontBold = "false" displayscore = Shapes.AddText(score) Shapes.Move(displayscore, 80,5) displayhighscore = Shapes.AddText(highscore) Shapes.Move(displayhighscore,295,5) updatescore() For i = 1 To 10 playername[i] = "" playerscore[i] = 0 EndFor Timer.Interval = 100 Timer.Tick = timerticksub Timer.Pause() GraphicsWindow.KeyDown = keydownsub EndSub Sub initializeprogram2 frogsremaining=frogsremaining+1 nomorefrog() numberofvehicles = 24 drawroad() GraphicsWindow.BrushColor = "DarkGray" vehicle[1] = Shapes.AddRectangle(120,40) vehicle[2] = Shapes.AddRectangle(80,40) vehicle[3] = Shapes.AddRectangle(40,40) vehicle[4] = Shapes.AddRectangle(40,40) vehicle[5] = Shapes.AddRectangle(80,40) vehicle[6] = Shapes.AddRectangle(40,40) vehicle[7] = Shapes.AddRectangle(80,40) vehicle[8] = Shapes.AddRectangle(80,40) vehicle[9] = Shapes.AddRectangle(40,40) vehicle[10] = Shapes.AddRectangle(120,40) vehicle[11] = Shapes.AddRectangle(40,40) vehicle[12] = Shapes.AddRectangle(80,40) vehicle[13] = Shapes.AddRectangle(120,40) vehicle[14] = Shapes.AddRectangle(80,40) vehicle[15] = Shapes.AddRectangle(40,40) vehicle[16] = Shapes.AddRectangle(40,40) vehicle[17] = Shapes.AddRectangle(80,40) vehicle[18] = Shapes.AddRectangle(40,40) vehicle[19] = Shapes.AddRectangle(80,40) vehicle[20] = Shapes.AddRectangle(80,40) vehicle[21] = Shapes.AddRectangle(40,40) vehicle[22] = Shapes.AddRectangle(120,40) vehicle[23] = Shapes.AddRectangle(40,40) vehicle[24] = Shapes.AddRectangle(80,40) For i = 1 To 24 Shapes.HideShape(vehicle[i]) vehicleisvisible[i] = "false" EndFor positionvehicles() Timer.Interval = 100 Timer.Tick = timerticksub2 Timer.Pause() GraphicsWindow.KeyDown = keydownsub EndSub Sub buttonclickedsub b= controls.LastClickedButton If b = startpausebutton Then startpausebuttonclick() ElseIf b = exitstopbutton then exitstopbuttonclick() elseif b = highscoresbutton then highscoresbuttonclick() endif EndSub Sub startpausebuttonclick if gamestatus = "Stopped" Then gamestatus = "Playing" Controls.SetButtonCaption(startpausebutton, "Pause Game") Controls.SetButtonCaption(exitstopbutton, "Stop Game") Controls.HideControl(highscoresbutton) score = 0 updatescore() level = 1 GraphicsWindow.Title = "Leap Frog - Level 1" frogsremaining = 4 'drawing the remaining frogs For i = 1 To frogsremaining GraphicsWindow.DrawImage(frogup, GraphicsWindow.Width - i * frogw - 10,5) EndFor positionvehicles() For i = 1 To numberofvehicles Shapes.ShowShape(vehicle[i]) vehicleisvisible[i] = "true" EndFor 'clear vehicles for level 1 Shapes.HideShape(vehicle[1]) vehicleisvisible[1] = "false" Shapes.HideShape(vehicle[4]) vehicleisvisible[4] = "false" Shapes.HideShape(vehicle[5]) vehicleisvisible[5] = "false" Shapes.HideShape(vehicle[7]) vehicleisvisible[7] = "false" Shapes.HideShape(vehicle[11]) vehicleisvisible[11] = "false" positionlogs() For i = 1 To numberoflogs Shapes.ShowShape(log[i]) logisvisible[i] = "true" EndFor getnewfrog() drawhome() Timer.Resume() ElseIf gamestatus = "Playing" then Timer.Pause() gamestatus = "Paused" Controls.SetButtonCaption(startpausebutton, "Restart Game") Controls.HideControl(exitstopbutton) Else 'game restarted gamestatus = "Playing" Controls.SetButtonCaption(startpausebutton, "Pause Game") Controls.ShowControl(exitstopbutton) Timer.Resume() EndIf EndSub Sub exitstopbuttonclick If gamestatus = "Playing" Then stopgame() Else Program.End() EndIf EndSub Sub stopgame Timer.Pause() gamestatus = "Stopped" Controls.SetButtonCaption(startpausebutton, "Start Game") Controls.SetButtonCaption(exitstopbutton, "Exit") Controls.ShowControl(highscoresbutton) Shapes.HideShape(snake) snakeisvisible = "false" Shapes.HideShape(frog) updatescore() 'check if in top 10 scores If score > lowscore Then newscore = "true" highscoresbuttonclick() EndIf EndSub Sub highscoresbuttonclick GraphicsWindow.Hide() TextWindow.Show() TextWindow.BackgroundColor = "White" TextWindow.ForegroundColor = "Black" TextWindow.Title = "Leap Frog High Scores" TextWindow.Clear() 'read scores from file For i = 1 To 10 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' playername[i] = File.ReadLine(Program.Directory + "\highscores.txt", 2*i-1) ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' playerscore[i] = File.ReadLine(Program.Directory + "\highscores.txt", 2*i) EndFor TextWindow.CursorTop = 1 TextWindow.WriteLine(" Name Score") TextWindow.WriteLine(" ---- -----") For i = 1 To 10 TextWindow.CursorTop = i +2 TextWindow.CursorLeft = 4 - Text.GetLength(i) TextWindow.Write(I) TextWindow.CursorLeft = 5 TextWindow.Write(playername[i]) TextWindow.CursorLeft = 30 - Text.GetLength(playerscore[i]) TextWindow.WriteLine(playerscore[i]) EndFor TextWindow.WriteLine("") TextWindow.WriteLine("") If newscore Then TextWindow.WriteLine(" Congratulations - your score puts you in the top 10 High Scores!") TextWindow.WriteLine(" Type your name and press Enter to be recored in history!") 'find where current score fits in list For i = 1 To 10 If score > playerscore[i] Then Goto gotposition EndIf EndFor gotposition: newscoreposition = i 'move all below newscoreposition down on position If newscoreposition <>10 Then For i = 10 To newscoreposition +1 Step -1 playername[i] = playername[i-1] playerscore[i] = playerscore[i-1] 'blank out name and score before rewriting TextWindow.CursorTop = i +2 TextWindow.CursorLeft = 5 TextWindow.Write(" ") TextWindow.CursorLeft = 5 TextWindow.Write(playername[i]) TextWindow.CursorLeft = 25 TextWindow.Write(" ") TextWindow.CursorLeft = 30 - Text.GetLength(playerscore[i]) TextWindow.WriteLine(playerscore[i]) EndFor EndIf 'add new score - get input at newscore position 'blank out line before rewriting playerscore[newscoreposition] = score TextWindow.CursorTop = newscoreposition +2 TextWindow.CursorLeft = 25 TextWindow.Write(" ") TextWindow.CursorLeft = 30 - Text.GetLength(playerscore[newscoreposition]) TextWindow.Write(playerscore[i]) TextWindow.CursorLeft = 5 TextWindow.Write(" ") TextWindow.CursorLeft = 5 playername[i] = TextWindow.Read() 'reset lowscore variable lowscore = playerscore[10] newscore = "false" EndIf TextWindow.CursorTop = 22 TextWindow.CursorLeft = 3 TextWindow.Pause() 'write scores to file For i =1 To 10 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(Program.Directory + "\highscores.txt.", 2*i - 1, playername[i]) ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(Program.Directory + "\highscores.txt", 2 *i, playerscore[i]) EndFor TextWindow.Hide() GraphicsWindow.Show() EndSub Sub positionvehicles drawroad() 'top row of vehicles and their x, y, width, and height values vehiclex[1] = 20 vehicley[1] = roadtop + 5 vehiclew[1] = 120 vehicleh[1] = 40 vehiclex[2] = 200 vehicley[2] = roadtop + 5 vehiclew[2] = 80 vehicleh[2] = 40 vehiclex[3] = 380 vehicley[3] = roadtop + 5 vehiclew[3] = 40 vehicleh[3] = 40 vehiclex[4] = 540 vehicley[4] = roadtop + 5 vehiclew[4] = 40 vehicleh[4] = 40 If numberofvehicles=24 Then vehiclex[13] = 20 vehicley[13] = roadtop - 50 vehiclew[13] = 120 vehicleh[13] = 40 vehiclex[14] = 200 vehicley[14] = roadtop - 50 vehiclew[14] = 80 vehicleh[14] = 40 vehiclex[15] = 380 vehicley[15] = roadtop - 50 vehiclew[15] = 40 vehicleh[15] = 40 vehiclex[16] = 540 vehicley[16] = roadtop - 50 vehiclew[16] = 40 vehicleh[16] = 40 EndIf 'middle row of vehicle values vehiclex[5] = 40 vehicley[5] = roadtop + 50 vehiclew[5] = 80 vehicleh[5] = 40 vehiclex[6] = 220 vehicley[6] = roadtop + 50 vehiclew[6] = 40 vehicleh[6] = 40 vehiclex[7] = 360 vehicley[7] = roadtop + 50 vehiclew[7] = 80 vehicleh[7] = 40 vehiclex[8] = 520 vehicley[8] = roadtop + 50 vehiclew[8] = 80 vehicleh[8] = 40 'bottom row of vehicle values vehiclex[9] = 60 vehicley[9] = roadtop + 95 vehiclew[9] = 40 vehicleh[9] = 40 vehiclex[10] = 180 vehicley[10] = roadtop + 95 vehiclew[10] = 120 vehicleh[10] = 40 vehiclex[11] = 380 vehicley[11] = roadtop + 95 vehiclew[11] = 40 vehicleh[11] = 40 vehiclex[12] = 520 vehicley[12] = roadtop + 95 vehiclew[12] = 80 vehicleh[12] = 40 'speeds If level = 1 Then vehiclespeed[1] = 3 vehiclespeed[2] = 3 vehiclespeed[3] = 3 vehiclespeed[4] = 3 vehiclespeed[5] = -3 vehiclespeed[6] = -3 vehiclespeed[7] = -3 vehiclespeed[8] = -3 vehiclespeed[9] = -2 vehiclespeed[10] = -2 vehiclespeed[11] = -2 vehiclespeed[12] = -2 endif For i = 1 To numberofvehicles Shapes.Move(vehicle[i], vehiclex[i], vehicley[i]) EndFor EndSub Sub drawroad If numberofvehicles=24 Then GraphicsWindow.BrushColor = "DimGray" GraphicsWindow.FillRectangle(0, 125, GraphicsWindow.Width, 300) Else GraphicsWindow.BrushColor = "DimGray" GraphicsWindow.FillRectangle(0, roadtop, GraphicsWindow.Width, roadheight) 'draw road lines GraphicsWindow.PenColor = "White" GraphicsWindow.PenWidth = 1 GraphicsWindow.DrawLine(0, roadtop + 2, GraphicsWindow.Width, roadtop + 2) GraphicsWindow.DrawLine(0, roadtop + roadheight - 2, GraphicsWindow.Width, roadtop + roadheight - 2) GraphicsWindow.DrawLine(0, roadtop +92, GraphicsWindow.Width, roadtop + 92) GraphicsWindow.PenColor = "Yellow" GraphicsWindow.DrawLine(0, roadtop + 47, GraphicsWindow.Width, roadtop + 47) GraphicsWindow.DrawLine(0, roadtop + 49, GraphicsWindow.Width, roadtop + 49) EndIf EndSub Sub timerticksub updatescore() 'road update if level > 5 Then level=1 initializeprogram2() EndIf For i = 1 To numberofvehicles if vehicleisvisible[i] Then 'moving each vehicle that is visible vehiclex[i] = vehiclex[i] + vehiclespeed[i] Shapes.Move(vehicle[i], vehiclex[i], vehicley[i]) If vehiclex[i] > GraphicsWindow.Width And vehiclespeed[i] > 0 Then 'moving vehicle back to the start vehiclex[i] = -120 EndIf If vehiclex[i] < -vehiclew[i] And vehiclespeed[i] < 0 Then vehiclex[i] = GraphicsWindow.Width + (120 - vehiclew[i]) EndIf EndIf EndFor 'river update For i = 1 To numberoflogs If logisvisible[i] Then 'moving logs logx[i] = logx[i] + logspeed[i] Shapes.Move(log[i], logx[i], logy[i]) If onlog = i Then frogx = frogx + logspeed[i] If frogx < 0 Or frogx > GraphicsWindow.Width - frogw Then nomorefrog() Goto exitticksub EndIf Shapes.Move(frog, frogx, frogy) EndIf If logx[i] > GraphicsWindow.Width And logspeed[i] > 0 Then logx[i] = -120 EndIf If logx[i] < -logw[i] And logspeed[i] < 0 Then logx[i] = GraphicsWindow.Width + (120 - logw[i]) EndIf EndIf EndFor 'snake update If snakeisvisible = "false" Then If (Math.GetRandomNumber(50)) = 1 Then snakex = -snakew snake = snake1 Shapes.Move(snake, snakex, snakey) Shapes.ShowShape(snake) snakeisvisible = "true" EndIf Else Shapes.HideShape(snake) If snake = snake1 Then snake = snake2 Else snake = snake1 EndIf snakex = snakex + snakespeed Shapes.Move(snake, snakex, snakey) Shapes.ShowShape(snake) If snakex > GraphicsWindow.Width Then Shapes.HideShape(snake) snakeisvisible = "false" EndIf EndIf 'general status 'check for collisions If froglocation = 1 Or froglocation = 2 Or froglocation = 3 Then 'vehicles in froglocation row ifrog = 9 - 4 *(froglocation - 1) For i = ifrog To ifrog + 3 If vehicleisvisible[i] Then shapex = vehiclex[i] shapew = vehiclew[i] findoverlap() If overlap>10 Then nomorefrog() Goto exitticksub EndIf EndIf EndFor ElseIf froglocation = 4 then 'snake If snakeisvisible then shapex = snakex shapew = snakew findoverlap() If overlap > 1 then nomorefrog() Goto exitticksub EndIf EndIf elseif froglocation = 5 or froglocation = 6 or froglocation = 7 then 'check if moved to log or already on a log If onlog = 0 then if froglocation = 5 then ilog1 = 10 ilog2 = 12 elseif froglocation = 6 then ilog1 = 6 ilog2 = 9 elseif froglocation = 7 then ilog1 = 1 ilog2 = 5 EndIf For i = ilog1 to ilog2 If logisvisible[i] then shapex = logx[i] shapew = logw[i] findoverlap() If overlap > 80 then onlog = i Goto gotlog EndIf EndIf endfor gotlog: If onlog = 0 then nomorefrog() Goto exitticksub EndIf EndIf elseif froglocation = 8 then 'moved to home level - see if home For i = 1 to (6-level) shapex = padx[i] shapew = padw findoverlap() If frogishome[i] = "false" and overlap > 95 then score = score + 200 frogishome[i] = "true" GraphicsWindow.DrawImage(froghome, padx[i] +10, pady + 10) getnewfrog() 'check if all found For j = 3 to 3 If frogishome[j] = "false" then EndIf endfor drawhome() score = score + 1000 changelevel=changelevel+1 gotonextlevel() Goto exitticksub EndIf endfor nomorefrog() EndIf exitticksub: EndSub Sub timerticksub2 GraphicsWindow.Title="level2" updatescore() 'road update For i = 1 To numberofvehicles if vehicleisvisible[i] Then 'moving each vehicle that is visible vehiclex[i] = vehiclex[i] + vehiclespeed[i] Shapes.Move(vehicle[i], vehiclex[i], vehicley[i]) If vehiclex[i] > GraphicsWindow.Width And vehiclespeed[i] > 0 Then 'moving vehicle back to the start vehiclex[i] = -120 EndIf If vehiclex[i] < -vehiclew[i] And vehiclespeed[i] < 0 Then vehiclex[i] = GraphicsWindow.Width + (120 - vehiclew[i]) EndIf EndIf EndFor 'general status 'check for collisions If froglocation <>8 Then 'vehicles in froglocation row ifrog = 9 - 4 *(froglocation - 1) For i = ifrog To ifrog + 3 If vehicleisvisible[i] Then shapex = vehiclex[i] shapew = vehiclew[i] findoverlap() If overlap>10 Then nomorefrog() Goto exitticksub EndIf EndIf EndFor elseif froglocation = 8 then 'moved to home level - see if home For i = 1 to (6-level) shapex = padx[i] shapew = padw findoverlap() If frogishome[i] = "false" and overlap > 95 then score = score + 200 frogishome[i] = "true" GraphicsWindow.DrawImage(froghome, padx[i] +10, pady + 10) getnewfrog() 'check if all found For j = 3 to 3 If frogishome[j] = "false" then Goto exitticksub2 EndIf endfor drawhome() score = score + 1000 changelevel=changelevel+1 gotonextlevel() Goto exitticksub2 EndIf endfor nomorefrog() EndIf exitticksub2: EndSub Sub positionlogs GraphicsWindow.BrushColor = GraphicsWindow.GetColorFromRGB(128, 128,255) GraphicsWindow.FillRectangle(0, rivertop, GraphicsWindow.Width, riverheight) 'top row logx[1] = 20 logy[1] = rivertop logw[1] = 80 logh[1] = 40 logx[2] = 140 logy[2] = rivertop logw[2] = 120 logh[2] = 40 logx[3] = 300 logy[3] = rivertop logw[3] = 40 logh[3] = 40 logx[4] = 400 logy[4] = rivertop logw[4] = 80 logh[4] = 40 logx[5] = 540 logy[5] = rivertop logw[5] = 80 logh[5] = 40 'middle row logx[6] = 60 logy[6] = rivertop +40 logw[6] = 40 logh[6] = 40 logx[7] = 180 logy[7] = rivertop +40 logw[7] = 120 logh[7] = 40 logx[8] = 360 logy[8] = rivertop +40 logw[8] = 80 logh[8] = 40 logx[9] = 500 logy[9] = rivertop +40 logw[9] = 120 logh[9] = 40 'bottom row logx[10] = 40 logy[10] = rivertop +80 logw[10] = 120 logh[10] = 40 logx[11] = 280 logy[11] = rivertop +80 logw[11] = 80 logh[11] = 40 logx[12] = 480 logy[12] = rivertop +80 logw[12] = 120 logh[12] = 40 'speeds If level = 1 Then logspeed[1] = 5 logspeed[2] = 5 logspeed[3] = 5 logspeed[4] = 5 logspeed[5] = 5 logspeed[6] = -3 logspeed[7] = -3 logspeed[8] = -3 logspeed[9] = -3 logspeed[10] = 2 logspeed[11] = 2 logspeed[12] = 2 EndIf For i = 1 To numberoflogs Shapes.Move(log[i], logx[i], logy[i]) EndFor EndSub Sub getnewfrog onlog = 0 froglocation = 0 frogx = 320 frogy = starttop frog = frogup Shapes.Move(frog, frogx, frogy) Shapes.ShowShape(frog) EndSub Sub keydownsub kd = GraphicsWindow.LastKey If gamestatus = "Playing" Then 'clear from current location If kd="Tab" Then level=5 EndIf Shapes.HideShape(frog) If kd = "Up" Then score = score +100 onlog = 0 frog = frogup froglocation = froglocation + 1 If froglocation > 8 Then froglocation = 8 EndIf ElseIf kd = "Left" then score = score + 1 onlog = 0 frog = frogleft If frogx > 0 then frogx = frogx - frogw EndIf ElseIf kd = "Down" then score = score + 50 onlog = 0 frog = frogdown froglocation = froglocation - 1 If froglocation < 0 then froglocation = 0 EndIf ElseIf kd = "Right" then score = score + 10 onlog = 0 frog = frogright If frogx < GraphicsWindow.Width - frogw then frogx = frogx + frogw EndIf EndIf 'put in new location drawfrog() EndIf EndSub Sub drawfrog If froglocation = 0 Then frogy = starttop ElseIf froglocation = 1 or froglocation = 2 or froglocation = 3 then frogy = roadtop + 140 -45 * froglocation elseif froglocation = 4 then frogy = grasstop elseif froglocation = 5 or froglocation = 6 or froglocation = 7 then frogy = rivertop + 120 -40 * (froglocation - 4) elseif froglocation = 8 then frogy = hometop + 40 EndIf If froglocation <> 8 Then Shapes.Move(frog, frogx, frogy) Shapes.ShowShape(frog) EndIf EndSub Sub findoverlap overlap = 0 'check to see if frog overlaps with shape defined by shapex, shapew If frogx + frogw > shapex And frogx + frogw < shapex +shapew Then overlap = 100 *(frogx + frogw -shapex)/frogw ElseIf frogx > shapex and frogx < shapex + shapew then overlap = 100 *(shapex + shapew - frogx) / frogw EndIf EndSub Sub nomorefrog Shapes.HideShape(frog) GraphicsWindow.BrushColor = GraphicsWindow.BackgroundColor GraphicsWindow.FillRectangle(GraphicsWindow.Width - frogsremaining * frogw - 10, 5, frogw, frogh) frogsremaining = frogsremaining - 1 If frogsremaining >= 0 Then getnewfrog() Else exitstopbuttonclick() EndIf EndSub Sub drawhome GraphicsWindow.BrushColor="DarkGreen" GraphicsWindow.FillRectangle(2,50,700,80) padx[1] = 70 padx[2] = 180 padx[3] = 290 padx[4] = 400 padx[5] = 510 pady = hometop +15 padw = 60 padh = 60 GraphicsWindow.PenColor = "Yellow" GraphicsWindow.PenWidth = 3 For i = 1 To (6-level) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(padx[i], pady, padw, padh) GraphicsWindow.PenColor = "Yellow" GraphicsWindow.PenWidth = 3 GraphicsWindow.DrawRectangle(padx[i], pady, padw, padh) frogishome[i] = "false" EndFor EndSub Sub gotonextlevel level = level +1 GraphicsWindow.Title = "Leap Frog - Level " + level 'speed things up For i = 1 To numberofvehicles If vehiclespeed[i] > 0 Then vehiclespeed[i] = vehiclespeed[i] + 1 Else vehiclespeed[i] = vehiclespeed[i] -1 EndIf EndFor For i = 1 To numberoflogs If logspeed[i] > 0 Then logspeed[i] = logspeed[i] +1 Else logspeed[i] = logspeed[i] - 1 EndIf EndFor 'add frog every 2nd level (maximm of 5) If level - 2 * Math.Floor(level/2) = 1 Then If frogsremaining < 5 Then frogsremaining = frogsremaining + 1 GraphicsWindow.DrawImage(frogup, GraphicsWindow.Width - frogsremaining * frogw - 10,5) EndIf EndIf 'repostion logs, vehicles positionlogs() positionvehicles() 'delete logs, add vehicles If level = 2 Then drawhome() Shapes.HideShape(log[1]) logisvisible[1] = "false" ElseIf level = 3 then drawhome() homes=3 Shapes.HideShape(log[7]) logisvisible[7] = "false" Shapes.ShowShape(vehicle[1]) Shapes.ShowShape(vehicle[5]) vehicleisvisible[1] = "true" vehicleisvisible[5] = "true" elseif level = 4 then drawhome() homes=2 Shapes.HideShape(log[12]) logisvisible[12] = "false" Shapes.ShowShape(vehicle[7]) Shapes.ShowShape(vehicle[11]) vehicleisvisible[7] = "true" vehicleisvisible[11] = "true" elseif level = 5 then homes=1 Shapes.ShowShape(vehicle[4]) vehicleisvisible[4] = "true" EndIf EndSub Sub updatescore Shapes.SetText(displayscore, score) If score > highscore Then highscore = score Shapes.SetText(displayhighscore, highscore) endif EndSub End>GJC847.sb< Start>GJL218.sb< ' アクションゲーム 1作目 ' ' 岡山科学技術専門学校 情報システム学科 教材 ' 各種定数の定義 cls: GraphicsWindow.Width = 700 GraphicsWindow.Height = 400 GraphicsWindow.BackgroundColor = "#B0F0E6" GraphicsWindow.FontSize = 60 GraphicsWindow.BrushColor = "#C050B0" GraphicsWindow.DrawText(170,8, "ロールボール2") GraphicsWindow.FontSize = 30 GraphicsWindow.BrushColor = "Red" GraphicsWindow.DrawText(1,90, "操作方法は前回と変わらない") GraphicsWindow.BrushColor = "Green" GraphicsWindow.DrawText(1,130, "難易度は前回より上がってるんじゃないかな") GraphicsWindow.BrushColor = "Red" GraphicsWindow.DrawText(1,170, "白ブロックがゴールになりました") GraphicsWindow.BrushColor = "Green" GraphicsWindow.DrawText(1,220, "その他にも特殊なブロックがあります") GraphicsWindow.BrushColor = "Blue" GraphicsWindow.DrawText(1,270, "[1~9]または[A~F]を押すと始まります") GraphicsWindow.BrushColor = "Red" GraphicsWindow.DrawText(1,320, "ステージナンバー") GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(1,350, "1 2 3 4 5 6 7 8 9 A B C D E F") KeyName = GraphicsWindow.LastKey If KeyName = "D1" Then Goto rt ElseIf KeyName = "D2" Then ss=2 Goto st ElseIf KeyName = "D3" Then ss=3 Goto st ElseIf KeyName = "D4" Then ss=4 Goto st ElseIf KeyName = "D5" Then ss=5 Goto st ElseIf KeyName = "D6" Then ss=6 Goto st ElseIf KeyName = "D7" Then ss=7 Goto st ElseIf KeyName = "D8" Then ss=8 Goto st ElseIf KeyName = "D9" Then ss=9 Goto st ElseIf KeyName = "A" then ss=10 Goto st ElseIf KeyName = "B" Then ss=11 Goto st ElseIf KeyName = "C" Then ss=12 Goto st ElseIf KeyName = "D" Then ss=13 Goto st ElseIf KeyName = "E" Then ss=14 Goto st ElseIf KeyName = "F" Then ss=15 Goto st EndIf Goto cls rt: ss=1 stage = 1 DEATH = 0 click=0 st: GraphicsWindow.Clear() SCREEN_WIDTH = 24 ' スクリーンの幅(ユニット数) SCREEN_HEIGHT = 18 ' スクリーンの高さ(ユニット数) UNIT_SIZE = 30 ' ユニットサイズ(ピクセル) ENEMY_NUM = 5 SPEED = 5 ' 一度に移動するピクセル数 ENEMY_SPEED = 8 ' 敵の速度 DELAY = 50 ' ループ毎の待機時間(ミリ秒) WALL_COLOR = "#808080" ' 壁の色 BACK_COLOR = "#B0F0E6" ' 背景の色 ROBO_COLOR = "#0000FF" ' ロボットの色 ENEMY_COLOR = "#FF0000" ' Enemy Color ' 壁の配置(マップ)を定義 (1:壁あり, それ以外:壁なし) If ss=1 then ENEMY_NUM = 7 WALLS [1] = "111111111111111111111111" WALLS [2] = "150111111100011111111111" WALLS [3] = "100111111100011111111111" WALLS [4] = "100111111100011111111111" WALLS [5] = "100111111100011111111111" WALLS [6] = "100111111100011111111111" WALLS [7] = "100111111100011111111111" WALLS [8] = "100111111100000000000001" WALLS [9] = "100000000000000000000001" WALLS [10] = "100000000000000000000001" WALLS [11] = "100000000000011111111001" WALLS [12] = "111111111100011111111001" WALLS [13] = "111111111100011111111001" WALLS [14] = "111111111100011111111001" WALLS [15] = "111111111100011111111001" WALLS [16] = "111111111100011111111001" WALLS [17] = "111111111100011111111001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 10 ey[1] = UNIT_SIZE * 1 exd[1] = 0 eyd[1] = 1 ex[2] = UNIT_SIZE * 11 ey[2] = UNIT_SIZE * 16 exd[2] = 0 eyd[2] = -1 ex[3] = UNIT_SIZE * 12 ey[3] = UNIT_SIZE * 1 exd[3] = 0 eyd[3] = 1 ex[4] = UNIT_SIZE * 22 ey[4] = UNIT_SIZE * 7 exd[4] = -1 eyd[4] = 0 ex[5] = UNIT_SIZE * 1 ey[5] = UNIT_SIZE * 8 exd[5] = 1 eyd[5] = 0 ex[6] = UNIT_SIZE * 22 ey[6] = UNIT_SIZE * 9 exd[6] = -1 eyd[6] = 0 ex[7] = UNIT_SIZE * 1 ey[7] = UNIT_SIZE * 10 exd[7] = 1 eyd[7] = 0 Endif If ss=2 then ENEMY_NUM = 18 WALLS [1] = "111111111111111111111111" WALLS [2] = "150111111000001111111111" WALLS [3] = "100111110000000111111111" WALLS [4] = "110111100000000011111111" WALLS [5] = "110111000000000001111111" WALLS [6] = "110110000000000000111111" WALLS [7] = "110100000000000000011111" WALLS [8] = "110100000011100000011111" WALLS [9] = "110000000111110000001111" WALLS [10] = "111000000111110000000111" WALLS [11] = "111100000011100000010111" WALLS [12] = "111100000000000000010111" WALLS [13] = "111110000000000000110111" WALLS [14] = "111111000000000001110111" WALLS [15] = "111111100000000011110111" WALLS [16] = "111111110000000111110001" WALLS [17] = "111111111000001111111001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 5 ey[1] = UNIT_SIZE * 9 exd[1] = 0 eyd[1] = -1 ex[2] = UNIT_SIZE * 6 ey[2] = UNIT_SIZE * 8 exd[2] = 0 eyd[2] = 1 ex[3] = UNIT_SIZE * 7 ey[3] = UNIT_SIZE * 9 exd[3] = 0 eyd[3] = -1 ex[4] = UNIT_SIZE * 8 ey[4] = UNIT_SIZE * 8 exd[4] = 0 eyd[4] = 1 ex[5] = UNIT_SIZE * 11 ey[5] = UNIT_SIZE * 2 exd[5] = 1 eyd[5] = 0 ex[6] = UNIT_SIZE * 10 ey[6] = UNIT_SIZE * 3 exd[6] = -1 eyd[6] = 0 ex[7] = UNIT_SIZE * 11 ey[7] = UNIT_SIZE * 4 exd[7] = 1 eyd[7] = 0 ex[8] = UNIT_SIZE * 10 ey[8] = UNIT_SIZE * 5 exd[8] = -1 eyd[8] = 0 ex[9] = UNIT_SIZE * 11 ey[9] = UNIT_SIZE * 6 exd[9] = 1 eyd[9] = 0 ex[10] = UNIT_SIZE * 14 ey[10] = UNIT_SIZE * 9 exd[10] = 0 eyd[10] = 1 ex[11] = UNIT_SIZE * 15 ey[11] = UNIT_SIZE * 8 exd[11] = 0 eyd[11] = -1 ex[12] = UNIT_SIZE * 16 ey[12] = UNIT_SIZE * 9 exd[12] = 0 eyd[12] = 1 ex[13] = UNIT_SIZE * 17 ey[13] = UNIT_SIZE * 8 exd[13] = 0 eyd[13] = -1 ex[14] = UNIT_SIZE * 11 ey[14] = UNIT_SIZE * 11 exd[14] = -1 eyd[14] = 0 ex[15] = UNIT_SIZE * 12 ey[15] = UNIT_SIZE * 12 exd[15] = 1 eyd[15] = 0 ex[16] = UNIT_SIZE * 11 ey[16] = UNIT_SIZE * 13 exd[16] = -1 eyd[16] = 0 ex[17] = UNIT_SIZE * 12 ey[17] = UNIT_SIZE * 14 exd[17] = 1 eyd[17] = 0 ex[18] = UNIT_SIZE * 11 ey[18] = UNIT_SIZE * 15 exd[18] = -1 eyd[18] = 0 Endif If ss=3 then ENEMY_NUM = 12 WALLS [1] = "111111111111111111111111" WALLS [2] = "150000000000011111111111" WALLS [3] = "111111111100011111111111" WALLS [4] = "111111111100011111111111" WALLS [5] = "111111111100000000000011" WALLS [6] = "110000000000011111111111" WALLS [7] = "111111111100000000000011" WALLS [8] = "110000000000011111111111" WALLS [9] = "111111111100011111111111" WALLS [10] = "111111000000000001111111" WALLS [11] = "111111111100011111111111" WALLS [12] = "111111111100000000000011" WALLS [13] = "110000000000011111111111" WALLS [14] = "111111111100000000000011" WALLS [15] = "110000000000011111111111" WALLS [16] = "111111111100011111111111" WALLS [17] = "111111111100000000000001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 10 ey[1] = UNIT_SIZE * 1 exd[1] = 0 eyd[1] = 1 ex[2] = UNIT_SIZE * 11 ey[2] = UNIT_SIZE * 16 exd[2] = 0 eyd[2] = -1 ex[3] = UNIT_SIZE * 12 ey[3] = UNIT_SIZE * 1 exd[3] = 0 eyd[3] = 1 ex[4] = UNIT_SIZE * 10 ey[4] = UNIT_SIZE * 4 exd[4] = 1 eyd[4] = 0 ex[5] = UNIT_SIZE * 2 ey[5] = UNIT_SIZE * 5 exd[5] = 1 eyd[5] = 0 ex[6] = UNIT_SIZE * 10 ey[6] = UNIT_SIZE * 6 exd[6] = 1 eyd[6] = 0 ex[7] = UNIT_SIZE * 2 ey[7] = UNIT_SIZE * 7 exd[7] = 1 eyd[7] = 0 ex[8] = UNIT_SIZE * 6 ey[8] = UNIT_SIZE * 9 exd[8] = 1 eyd[8] = 0 ex[9] = UNIT_SIZE * 10 ey[9] = UNIT_SIZE * 11 exd[9] = 1 eyd[9] = 0 ex[10] = UNIT_SIZE * 2 ey[10] = UNIT_SIZE * 12 exd[10] = 1 eyd[10] = 0 ex[11] = UNIT_SIZE * 10 ey[11] = UNIT_SIZE * 13 exd[11] = 1 eyd[11] = 0 ex[12] = UNIT_SIZE * 2 ey[12] = UNIT_SIZE * 14 exd[12] = 1 eyd[12] = 0 Endif If ss=4 then ENEMY_NUM = 24 WALLS [1] = "111111111111111111111111" WALLS [2] = "151000000000000000000001" WALLS [3] = "101000000000000000000101" WALLS [4] = "101000000000000000000101" WALLS [5] = "100000011111111110000001" WALLS [6] = "111111100000000001011111" WALLS [7] = "100000000000000000000001" WALLS [8] = "100000000000000001000001" WALLS [9] = "100000000001100000000001" WALLS [10] = "100000000001100000000001" WALLS [11] = "100000100000000000000001" WALLS [12] = "100000000000000000000001" WALLS [13] = "111110100000000001111111" WALLS [14] = "100000011111111110000001" WALLS [15] = "101000000000000000000101" WALLS [16] = "101000000000000000000101" WALLS [17] = "100000000000000000000101" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 22 ey[1] = UNIT_SIZE * 1 exd[1] = -1 eyd[1] = 0 ex[2] = UNIT_SIZE * 3 ey[2] = UNIT_SIZE * 2 exd[2] = 1 eyd[2] = 0 ex[3] = UNIT_SIZE * 20 ey[3] = UNIT_SIZE * 3 exd[3] = -1 eyd[3] = 0 ex[4] = UNIT_SIZE * 1 ey[4] = UNIT_SIZE * 6 exd[4] = 1 eyd[4] = 0 ex[5] = UNIT_SIZE * 16 ey[5] = UNIT_SIZE * 7 exd[5] = -1 eyd[5] = 0 ex[6] = UNIT_SIZE * 1 ey[6] = UNIT_SIZE * 8 exd[6] = 1 eyd[6] = 0 ex[7] = UNIT_SIZE * 10 ey[7] = UNIT_SIZE * 9 exd[7] = -1 eyd[7] = 0 ex[8] = UNIT_SIZE * 7 ey[8] = UNIT_SIZE * 10 exd[8] = 1 eyd[8] = 0 ex[9] = UNIT_SIZE * 22 ey[9] = UNIT_SIZE * 11 exd[9] = -1 eyd[9] = 0 ex[10] = UNIT_SIZE * 20 ey[10] = UNIT_SIZE * 14 exd[10] = -1 eyd[10] = 0 ex[11] = UNIT_SIZE * 3 ey[11] = UNIT_SIZE * 15 exd[11] = 1 eyd[11] = 0 ex[12] = UNIT_SIZE * 20 ey[12] = UNIT_SIZE * 16 exd[12] = -1 eyd[12] = 0 ex[13] = UNIT_SIZE * 7 ey[13] = UNIT_SIZE * 6 exd[13] = 0 eyd[13] = 1 ex[14] = UNIT_SIZE * 8 ey[14] = UNIT_SIZE * 11 exd[14] = 0 eyd[14] = -1 ex[15] = UNIT_SIZE * 9 ey[15] = UNIT_SIZE * 6 exd[15] = 0 eyd[15] = 1 ex[16] = UNIT_SIZE * 10 ey[16] = UNIT_SIZE * 11 exd[16] = 0 eyd[16] = -1 ex[17] = UNIT_SIZE * 13 ey[17] = UNIT_SIZE * 6 exd[17] = 0 eyd[17] = 1 ex[18] = UNIT_SIZE * 14 ey[18] = UNIT_SIZE * 11 exd[18] = 0 eyd[18] = -1 ex[19] = UNIT_SIZE * 15 ey[19] = UNIT_SIZE * 6 exd[19] = 0 eyd[19] = 1 ex[20] = UNIT_SIZE * 16 ey[20] = UNIT_SIZE * 11 exd[20] = 0 eyd[20] = -1 ex[21] = UNIT_SIZE * 17 ey[21] = UNIT_SIZE * 6 exd[21] = 0 eyd[21] = 0 ex[22] = UNIT_SIZE * 6 ey[22] = UNIT_SIZE * 11 exd[22] = 0 eyd[22] = 0 ex[23] = UNIT_SIZE * 13 ey[23] = UNIT_SIZE * 8 exd[23] = 1 eyd[23] = 0 ex[24] = UNIT_SIZE * 22 ey[24] = UNIT_SIZE * 9 exd[24] = -1 eyd[24] = 0 Endif If ss=5 then ENEMY_NUM = 18 ENEMY_SPEED = 9 WALLS [1] = "111111111111111111111111" WALLS [2] = "151011011011011011011111" WALLS [3] = "101001001001001001001111" WALLS [4] = "101001001001001001001111" WALLS [5] = "101001001001007001001111" WALLS [6] = "101001001001000001001111" WALLS [7] = "101007001001007001001111" WALLS [8] = "107000001007001001001101" WALLS [9] = "100007001000001001000001" WALLS [10] = "107001001007001007001001" WALLS [11] = "111001001001001000001101" WALLS [12] = "111001007001001007001101" WALLS [13] = "111001000001001001001101" WALLS [14] = "111001007001001001001101" WALLS [15] = "111001001001001001001101" WALLS [16] = "111001001001001001001001" WALLS [17] = "111011011011011011011001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 3 ey[1] = UNIT_SIZE * 2 exd[1] = 0 eyd[1] = 1 ex[2] = UNIT_SIZE * 3 ey[2] = UNIT_SIZE * 16 exd[2] = 0 eyd[2] = -1 ex[3] = UNIT_SIZE * 4 ey[3] = UNIT_SIZE * 8 exd[3] = 0 eyd[3] = 1 ex[4] = UNIT_SIZE * 6 ey[4] = UNIT_SIZE * 5 exd[4] = 0 eyd[4] = -1 ex[5] = UNIT_SIZE * 6 ey[5] = UNIT_SIZE * 15 exd[5] = 0 eyd[5] = -1 ex[6] = UNIT_SIZE * 7 ey[6] = UNIT_SIZE * 11 exd[6] = 0 eyd[6] = -1 ex[7] = UNIT_SIZE * 9 ey[7] = UNIT_SIZE * 1 exd[7] = 0 eyd[7] = -1 ex[8] = UNIT_SIZE * 9 ey[8] = UNIT_SIZE * 10 exd[8] = 0 eyd[8] = 1 ex[9] = UNIT_SIZE * 10 ey[9] = UNIT_SIZE * 7 exd[9] = 0 eyd[9] = 1 ex[10] = UNIT_SIZE * 12 ey[10] = UNIT_SIZE * 6 exd[10] = 0 eyd[10] = -1 ex[11] = UNIT_SIZE * 12 ey[11] = UNIT_SIZE * 15 exd[11] = 0 eyd[11] = 1 ex[12] = UNIT_SIZE * 13 ey[12] = UNIT_SIZE * 12 exd[12] = 0 eyd[12] = -1 ex[13] = UNIT_SIZE * 15 ey[13] = UNIT_SIZE * 2 exd[13] = 0 eyd[13] = -1 ex[14] = UNIT_SIZE * 15 ey[14] = UNIT_SIZE * 11 exd[14] = 0 eyd[14] = 1 ex[15] = UNIT_SIZE * 16 ey[15] = UNIT_SIZE * 6 exd[15] = 0 eyd[15] = 1 ex[16] = UNIT_SIZE * 18 ey[16] = UNIT_SIZE * 6 exd[16] = 0 eyd[16] = -1 ex[17] = UNIT_SIZE * 18 ey[17] = UNIT_SIZE * 16 exd[17] = 0 eyd[17] = 1 ex[18] = UNIT_SIZE * 19 ey[18] = UNIT_SIZE * 9 exd[18] = 0 eyd[18] = -1 Endif If ss=6 then ENEMY_NUM = 10 ENEMY_SPEED = 8 WALLS [1] = "111111111111111111111111" WALLS [2] = "105111111110211111101111" WALLS [3] = "100111100002011111101111" WALLS [4] = "100000000010011110101011" WALLS [5] = "111111111110011110101011" WALLS [6] = "111111111110011110000011" WALLS [7] = "111111111110011111111111" WALLS [8] = "111111111100011111111111" WALLS [9] = "102000000000200000000021" WALLS [10] = "120000000002000000000201" WALLS [11] = "110111111110001111111011" WALLS [12] = "110000000010011111100011" WALLS [13] = "111111111010011111101111" WALLS [14] = "100000111010011111100001" WALLS [15] = "101010111010011111111001" WALLS [16] = "100000111000211111111001" WALLS [17] = "101010111112011111111001" WALLS [18] = "100000111111111111111111" ex[1] = UNIT_SIZE * 1 ey[1] = UNIT_SIZE * 8 exd[1] = 1 eyd[1] = 0 ex[2] = UNIT_SIZE * 14 ey[2] = UNIT_SIZE * 8 exd[2] = 1 eyd[2] = 0 ex[3] = UNIT_SIZE * 9 ey[3] = UNIT_SIZE * 9 exd[3] = -1 eyd[3] = 0 ex[4] = UNIT_SIZE * 22 ey[4] = UNIT_SIZE * 9 exd[4] = -1 eyd[4] = 0 ex[5] = UNIT_SIZE * 11 ey[5] = UNIT_SIZE * 7 exd[5] = 0 eyd[5] = -1 ex[6] = UNIT_SIZE * 11 ey[6] = UNIT_SIZE * 16 exd[6] = 0 eyd[6] = -1 ex[7] = UNIT_SIZE * 12 ey[7] = UNIT_SIZE * 1 exd[7] = 0 eyd[7] = 1 ex[8] = UNIT_SIZE * 12 ey[8] = UNIT_SIZE * 10 exd[8] = 0 eyd[8] = 1 ex[9] = UNIT_SIZE * 12 ey[9] = UNIT_SIZE * 8 exd[9] = 0 eyd[9] = 0 ex[10] = UNIT_SIZE * 11 ey[10] = UNIT_SIZE * 9 exd[10] = 0 eyd[10] = 0 Endif If ss=7 then ENEMY_NUM = 16 WALLS [1] = "111111111111111111111111" WALLS [2] = "111111111111111111111111" WALLS [3] = "111111111111111111111111" WALLS [4] = "111111111111111111111111" WALLS [5] = "117777777777777777777711" WALLS [6] = "110000000003300000000001" WALLS [7] = "100000000003300000000001" WALLS [8] = "100000000003300000000011" WALLS [9] = "110000300003300003000001" WALLS [10] = "100000300003300003000001" WALLS [11] = "100000300003300003000011" WALLS [12] = "110000300004400003000001" WALLS [13] = "100000300004400003000001" WALLS [14] = "111011111111111111110111" WALLS [15] = "110011111111111111110111" WALLS [16] = "110111111111111111110111" WALLS [17] = "150111111111111111110001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 3 ey[1] = UNIT_SIZE * 5 exd[1] = 1 eyd[1] = 0 ex[2] = UNIT_SIZE * 12 ey[2] = UNIT_SIZE * 5 exd[2] = 1 eyd[2] = 0 ex[3] = UNIT_SIZE * 11 ey[3] = UNIT_SIZE * 6 exd[3] = 1 eyd[3] = 0 ex[4] = UNIT_SIZE * 20 ey[4] = UNIT_SIZE * 6 exd[4] = -1 eyd[4] = 0 ex[5] = UNIT_SIZE * 7 ey[5] = UNIT_SIZE * 7 exd[5] = 1 eyd[5] = 0 ex[6] = UNIT_SIZE * 16 ey[6] = UNIT_SIZE * 7 exd[6] = -1 eyd[6] = 0 ex[7] = UNIT_SIZE * 5 ey[7] = UNIT_SIZE * 8 exd[7] = 1 eyd[7] = 0 ex[8] = UNIT_SIZE * 22 ey[8] = UNIT_SIZE * 8 exd[8] = -1 eyd[8] = 0 ex[9] = UNIT_SIZE * 2 ey[9] = UNIT_SIZE * 9 exd[9] = 1 eyd[9] = 0 ex[10] = UNIT_SIZE * 14 ey[10] = UNIT_SIZE * 9 exd[10] = 1 eyd[10] = 0 ex[11] = UNIT_SIZE * 9 ey[11] = UNIT_SIZE * 10 exd[11] = 1 eyd[11] = 0 ex[12] = UNIT_SIZE * 17 ey[12] = UNIT_SIZE * 10 exd[12] = -1 eyd[12] = 0 ex[13] = UNIT_SIZE * 8 ey[13] = UNIT_SIZE * 11 exd[13] = 1 eyd[13] = 0 ex[14] = UNIT_SIZE * 21 ey[14] = UNIT_SIZE * 11 exd[14] = -1 eyd[14] = 0 ex[15] = UNIT_SIZE * 4 ey[15] = UNIT_SIZE * 12 exd[15] = 1 eyd[15] = 0 ex[16] = UNIT_SIZE * 15 ey[16] = UNIT_SIZE * 12 exd[16] = -1 eyd[16] = 0 Endif If ss=8 then ENEMY_NUM = 6 ENEMY_SPEED = 9 WALLS [1] = "111111111111111111111111" WALLS [2] = "150111100111111111110111" WALLS [3] = "100111100111111111110111" WALLS [4] = "100000000111111111010101" WALLS [5] = "111111100111111111010101" WALLS [6] = "111111100111111001000001" WALLS [7] = "111111100111111001111111" WALLS [8] = "111111100111111001111111" WALLS [9] = "111100000000000000001111" WALLS [10] = "111100000000000000001111" WALLS [11] = "111111100111111001111111" WALLS [12] = "111111100111111001111111" WALLS [13] = "100000100111111001111111" WALLS [14] = "101010111111111001111111" WALLS [15] = "100000111111111000000001" WALLS [16] = "101010111111111001111001" WALLS [17] = "100000111111111001111001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 7 ey[1] = UNIT_SIZE * 1 exd[1] = 0 eyd[1] = 1 ex[2] = UNIT_SIZE * 8 ey[2] = UNIT_SIZE * 12 exd[2] = 0 eyd[2] = -1 ex[3] = UNIT_SIZE * 15 ey[3] = UNIT_SIZE * 5 exd[3] = 0 eyd[3] = 1 ex[4] = UNIT_SIZE * 16 ey[4] = UNIT_SIZE * 16 exd[4] = 0 eyd[4] = -1 ex[5] = UNIT_SIZE * 4 ey[5] = UNIT_SIZE * 8 exd[5] = 1 eyd[5] = 0 ex[6] = UNIT_SIZE * 19 ey[6] = UNIT_SIZE * 9 exd[6] = -1 eyd[6] = 0 Endif If ss=9 then ENEMY_NUM = 16 ENEMY_SPEED = 10 WALLS [1] = "111111111111111111111111" WALLS [2] = "151002100210021002100211" WALLS [3] = "101010101010101010101011" WALLS [4] = "101010101010101010101011" WALLS [5] = "141200000000000000000011" WALLS [6] = "121060606060606060606011" WALLS [7] = "100000000000000000000211" WALLS [8] = "106060606060606060606011" WALLS [9] = "100000000002000000000011" WALLS [10] = "106060606060606060606011" WALLS [11] = "120000000000000000000011" WALLS [12] = "106060606060606060601011" WALLS [13] = "100000000000000000021011" WALLS [14] = "101010101010101010101411" WALLS [15] = "101010101010101010101001" WALLS [16] = "101010101010101010101001" WALLS [17] = "100210021002100210021001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 1 ey[1] = UNIT_SIZE * 5 exd[1] = 0 eyd[1] = 1 ex[2] = UNIT_SIZE * 3 ey[2] = UNIT_SIZE * 16 exd[2] = 0 eyd[2] = -1 ex[3] = UNIT_SIZE * 5 ey[3] = UNIT_SIZE * 1 exd[3] = 0 eyd[3] = 1 ex[4] = UNIT_SIZE * 7 ey[4] = UNIT_SIZE * 16 exd[4] = 0 eyd[4] = -1 ex[5] = UNIT_SIZE * 9 ey[5] = UNIT_SIZE * 1 exd[5] = 0 eyd[5] = 1 ex[6] = UNIT_SIZE * 11 ey[6] = UNIT_SIZE * 16 exd[6] = 0 eyd[6] = -1 ex[7] = UNIT_SIZE * 13 ey[7] = UNIT_SIZE * 1 exd[7] = 0 eyd[7] = 1 ex[8] = UNIT_SIZE * 15 ey[8] = UNIT_SIZE * 16 exd[8] = 0 eyd[8] = -1 ex[9] = UNIT_SIZE * 17 ey[9] = UNIT_SIZE * 1 exd[9] = 0 eyd[9] = 1 ex[10] = UNIT_SIZE * 19 ey[10] = UNIT_SIZE * 16 exd[10] = 0 eyd[10] = -1 ex[11] = UNIT_SIZE * 3 ey[11] = UNIT_SIZE * 4 exd[11] = 1 eyd[11] = 0 ex[12] = UNIT_SIZE * 21 ey[12] = UNIT_SIZE * 6 exd[12] = -1 eyd[12] = 0 ex[13] = UNIT_SIZE * 11 ey[13] = UNIT_SIZE * 8 exd[13] = -1 eyd[13] = 0 ex[14] = UNIT_SIZE * 1 ey[14] = UNIT_SIZE * 10 exd[14] = 1 eyd[14] = 0 ex[15] = UNIT_SIZE * 19 ey[15] = UNIT_SIZE * 12 exd[15] = -1 eyd[15] = 0 ex[16] = UNIT_SIZE * 21 ey[16] = UNIT_SIZE * 1 exd[16] = 0 eyd[16] = 1 Endif If ss=10 then ENEMY_NUM = 11 WALLS [1] = "111111111111111111111111" WALLS [2] = "100040000000000111117111" WALLS [3] = "150110110110110111717171" WALLS [4] = "111110110110110111717171" WALLS [5] = "111110000000000111717171" WALLS [6] = "111110110110110111777771" WALLS [7] = "111110110110110111111111" WALLS [8] = "111110770770770111111111" WALLS [9] = "111110000000000000111111" WALLS [10] = "111110000000000000111111" WALLS [11] = "111111110770770770111111" WALLS [12] = "111111110110110110111111" WALLS [13] = "177777110110110110111111" WALLS [14] = "171717110000000000111111" WALLS [15] = "177777110110110110111111" WALLS [16] = "171717110110110110111001" WALLS [17] = "177777110000000000400001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 5 ey[1] = UNIT_SIZE * 9 exd[1] = 0 eyd[1] = -1 ex[2] = UNIT_SIZE * 8 ey[2] = UNIT_SIZE * 1 exd[2] = 0 eyd[2] = 1 ex[3] = UNIT_SIZE * 11 ey[3] = UNIT_SIZE * 16 exd[3] = 0 eyd[3] = -1 ex[4] = UNIT_SIZE * 14 ey[4] = UNIT_SIZE * 1 exd[4] = 0 eyd[4] = 1 ex[5] = UNIT_SIZE * 17 ey[5] = UNIT_SIZE * 8 exd[5] = 0 eyd[5] = -1 ex[6] = UNIT_SIZE * 5 ey[6] = UNIT_SIZE * 1 exd[6] = 1 eyd[6] = 0 ex[7] = UNIT_SIZE * 14 ey[7] = UNIT_SIZE * 4 exd[7] = -1 eyd[7] = 0 ex[8] = UNIT_SIZE * 5 ey[8] = UNIT_SIZE * 8 exd[8] = 1 eyd[8] = 0 ex[9] = UNIT_SIZE * 17 ey[9] = UNIT_SIZE * 9 exd[9] = -1 eyd[9] = 0 ex[10] = UNIT_SIZE * 8 ey[10] = UNIT_SIZE * 13 exd[10] = 1 eyd[10] = 0 ex[11] = UNIT_SIZE * 17 ey[11] = UNIT_SIZE * 16 exd[11] = -1 eyd[11] = 0 Endif If ss=11 then ENEMY_NUM = 18 ENEMY_SPEED = 9 WALLS [1] = "111111111111111111111111" WALLS [2] = "151666666666666666661111" WALLS [3] = "100400000200300000006111" WALLS [4] = "100400300000002003000611" WALLS [5] = "100400020300000300200061" WALLS [6] = "166666666666666666664461" WALLS [7] = "160020000000200003000061" WALLS [8] = "116000203000030200000611" WALLS [9] = "111600000000203000006111" WALLS [10] = "111166666664466666661111" WALLS [11] = "111600003020000300006111" WALLS [12] = "116000200003002000000611" WALLS [13] = "160003002000000032000061" WALLS [14] = "164466666666666666666611" WALLS [15] = "160000030200020000004001" WALLS [16] = "116000000003000020004001" WALLS [17] = "111600000020000300004001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 9 ey[1] = UNIT_SIZE * 3 exd[1] = 1 eyd[1] = 0 ex[2] = UNIT_SIZE * 14 ey[2] = UNIT_SIZE * 3 exd[2] = -1 eyd[2] = 0 ex[3] = UNIT_SIZE * 7 ey[3] = UNIT_SIZE * 4 exd[3] = 1 eyd[3] = 0 ex[4] = UNIT_SIZE * 18 ey[4] = UNIT_SIZE * 4 exd[4] = -1 eyd[4] = 0 ex[5] = UNIT_SIZE * 4 ey[5] = UNIT_SIZE * 6 exd[5] = 1 eyd[5] = 0 ex[6] = UNIT_SIZE * 12 ey[6] = UNIT_SIZE * 6 exd[6] = -1 eyd[6] = 0 ex[7] = UNIT_SIZE * 6 ey[7] = UNIT_SIZE * 7 exd[7] = -1 eyd[7] = 0 ex[8] = UNIT_SIZE * 15 ey[8] = UNIT_SIZE * 7 exd[8] = 1 eyd[8] = 0 ex[9] = UNIT_SIZE * 12 ey[9] = UNIT_SIZE * 8 exd[9] = -1 eyd[9] = 0 ex[10] = UNIT_SIZE * 10 ey[10] = UNIT_SIZE * 10 exd[10] = 1 eyd[10] = 0 ex[11] = UNIT_SIZE * 6 ey[11] = UNIT_SIZE * 11 exd[11] = 1 eyd[11] = 0 ex[12] = UNIT_SIZE * 14 ey[12] = UNIT_SIZE * 11 exd[12] = -1 eyd[12] = 0 ex[13] = UNIT_SIZE * 8 ey[13] = UNIT_SIZE * 12 exd[13] = 1 eyd[13] = 0 ex[14] = UNIT_SIZE * 17 ey[14] = UNIT_SIZE * 12 exd[14] = -1 eyd[14] = 0 ex[15] = UNIT_SIZE * 9 ey[15] = UNIT_SIZE * 14 exd[15] = 1 eyd[15] = 0 ex[16] = UNIT_SIZE * 13 ey[16] = UNIT_SIZE * 14 exd[16] = -1 eyd[16] = 0 ex[17] = UNIT_SIZE * 16 ey[17] = UNIT_SIZE * 15 exd[17] = -1 eyd[17] = 0 ex[18] = UNIT_SIZE * 10 ey[18] = UNIT_SIZE * 16 exd[18] = 1 eyd[18] = 0 Endif If ss=12 then ENEMY_NUM = 12 WALLS [1] = "111111111111111111111111" WALLS [2] = "100040000000000000111111" WALLS [3] = "150110110110110110111111" WALLS [4] = "111110110110110110111111" WALLS [5] = "110003003000000003111111" WALLS [6] = "110110110110110110111111" WALLS [7] = "110110110110110110111111" WALLS [8] = "110000000000003000000111" WALLS [9] = "111110110110110110110111" WALLS [10] = "111110110110110110110111" WALLS [11] = "110000000003000000000111" WALLS [12] = "110110110110110110110111" WALLS [13] = "110110110110110110110111" WALLS [14] = "110000003000000003000111" WALLS [15] = "111110110110110110110111" WALLS [16] = "111110110110110110110111" WALLS [17] = "111110000000003000000401" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 5 ey[1] = UNIT_SIZE * 1 exd[1] = 1 eyd[1] = 0 ex[2] = UNIT_SIZE * 17 ey[2] = UNIT_SIZE * 4 exd[2] = -1 eyd[2] = 0 ex[3] = UNIT_SIZE * 2 ey[3] = UNIT_SIZE * 7 exd[3] = 1 eyd[3] = 0 ex[4] = UNIT_SIZE * 20 ey[4] = UNIT_SIZE * 10 exd[4] = -1 eyd[4] = 0 ex[5] = UNIT_SIZE * 5 ey[5] = UNIT_SIZE * 13 exd[5] = 1 eyd[5] = 0 ex[6] = UNIT_SIZE * 20 ey[6] = UNIT_SIZE * 16 exd[6] = -1 eyd[6] = 0 ex[7] = UNIT_SIZE * 5 ey[7] = UNIT_SIZE * 13 exd[7] = 0 eyd[7] = -1 ex[8] = UNIT_SIZE * 8 ey[8] = UNIT_SIZE * 1 exd[8] = 0 eyd[8] = 1 ex[9] = UNIT_SIZE * 11 ey[9] = UNIT_SIZE * 16 exd[9] = 0 eyd[9] = -1 ex[10] = UNIT_SIZE * 14 ey[10] = UNIT_SIZE * 1 exd[10] = 0 eyd[10] = 1 ex[11] = UNIT_SIZE * 17 ey[11] = UNIT_SIZE * 16 exd[11] = 0 eyd[11] = -1 ex[12] = UNIT_SIZE * 20 ey[12] = UNIT_SIZE * 7 exd[12] = 0 eyd[12] = 1 Endif If ss=13 then ENEMY_NUM = 25 ENEMY_SPEED = 9 WALLS [1] = "111111111111111111111111" WALLS [2] = "111113313313313311111111" WALLS [3] = "111330000030000003331111" WALLS [4] = "113330300000003003331111" WALLS [5] = "111130003333300003311111" WALLS [6] = "111330033050330003331111" WALLS [7] = "113330003000030003111111" WALLS [8] = "113330000330030003311111" WALLS [9] = "111330000000030003331111" WALLS [10] = "113330030000030303331111" WALLS [11] = "111130033333330003311111" WALLS [12] = "111330000030000003331111" WALLS [13] = "113330300000000003111111" WALLS [14] = "113330000000003003311111" WALLS [15] = "111330003000000004000001" WALLS [16] = "111113333333333331111101" WALLS [17] = "111111331331331331111101" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 6 ey[1] = UNIT_SIZE * 2 exd[1] = 1 eyd[1] = 0 ex[2] = UNIT_SIZE * 9 ey[2] = UNIT_SIZE * 3 exd[2] = 1 eyd[2] = 0 ex[3] = UNIT_SIZE * 12 ey[3] = UNIT_SIZE * 4 exd[3] = -1 eyd[3] = 0 ex[4] = UNIT_SIZE * 7 ey[4] = UNIT_SIZE * 5 exd[4] = 1 eyd[4] = 0 ex[5] = UNIT_SIZE * 15 ey[5] = UNIT_SIZE * 6 exd[5] = -1 eyd[5] = 0 ex[6] = UNIT_SIZE * 9 ey[6] = UNIT_SIZE * 7 exd[6] = 1 eyd[6] = 0 ex[7] = UNIT_SIZE * 10 ey[7] = UNIT_SIZE * 8 exd[7] = -1 eyd[7] = 0 ex[8] = UNIT_SIZE * 6 ey[8] = UNIT_SIZE * 9 exd[8] = 1 eyd[8] = 0 ex[9] = UNIT_SIZE * 15 ey[9] = UNIT_SIZE * 10 exd[9] = -1 eyd[9] = 0 ex[10] = UNIT_SIZE * 9 ey[10] = UNIT_SIZE * 11 exd[10] = 1 eyd[10] = 0 ex[11] = UNIT_SIZE * 12 ey[11] = UNIT_SIZE * 12 exd[11] = -1 eyd[11] = 0 ex[12] = UNIT_SIZE * 7 ey[12] = UNIT_SIZE * 13 exd[12] = -1 eyd[12] = 0 ex[13] = UNIT_SIZE * 5 ey[13] = UNIT_SIZE * 4 exd[13] = 0 eyd[13] = 1 ex[14] = UNIT_SIZE * 6 ey[14] = UNIT_SIZE * 9 exd[14] = 0 eyd[14] = -1 ex[15] = UNIT_SIZE * 7 ey[15] = UNIT_SIZE * 7 exd[15] = 0 eyd[15] = 1 ex[16] = UNIT_SIZE * 8 ey[16] = UNIT_SIZE * 11 exd[16] = 0 eyd[16] = -1 ex[17] = UNIT_SIZE * 9 ey[17] = UNIT_SIZE * 8 exd[17] = 0 eyd[17] = -1 ex[18] = UNIT_SIZE * 10 ey[18] = UNIT_SIZE * 10 exd[18] = 0 eyd[18] = 1 ex[19] = UNIT_SIZE * 11 ey[19] = UNIT_SIZE * 6 exd[19] = 0 eyd[19] = 1 ex[20] = UNIT_SIZE * 12 ey[20] = UNIT_SIZE * 14 exd[20] = 0 eyd[20] = -1 ex[21] = UNIT_SIZE * 13 ey[21] = UNIT_SIZE * 3 exd[21] = 0 eyd[21] = 1 ex[22] = UNIT_SIZE * 14 ey[22] = UNIT_SIZE * 8 exd[22] = 0 eyd[22] = 1 ex[23] = UNIT_SIZE * 15 ey[23] = UNIT_SIZE * 12 exd[23] = 0 eyd[23] = -1 ex[24] = UNIT_SIZE * 16 ey[24] = UNIT_SIZE * 5 exd[24] = 0 eyd[24] = 1 ex[25] = UNIT_SIZE * 7 ey[25] = UNIT_SIZE * 14 exd[25] = 1 eyd[25] = 0 Endif If ss=14 then ENEMY_NUM = 13 ENEMY_SPEED = 10 WALLS [1] = "111111111111111111111111" WALLS [2] = "100511111110000000000011" WALLS [3] = "100011111110111011111011" WALLS [4] = "101111100000000000000011" WALLS [5] = "101111101110111011111011" WALLS [6] = "100000001110111011111011" WALLS [7] = "111111100000000000000011" WALLS [8] = "100000000000111011111011" WALLS [9] = "101111101113111011111011" WALLS [10] = "101111101110111011111011" WALLS [11] = "101111101110000000000011" WALLS [12] = "100000000000000011111111" WALLS [13] = "101111101110111000000001" WALLS [14] = "101111101110111011111101" WALLS [15] = "100000000000000011111101" WALLS [16] = "101111101110111111110001" WALLS [17] = "100000000000111111110001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 11 ey[1] = UNIT_SIZE * 1 exd[1] = 1 eyd[1] = 0 ex[2] = UNIT_SIZE * 7 ey[2] = UNIT_SIZE * 3 exd[2] = 1 eyd[2] = 0 ex[3] = UNIT_SIZE * 21 ey[3] = UNIT_SIZE * 6 exd[3] = 1 eyd[3] = 0 ex[4] = UNIT_SIZE * 1 ey[4] = UNIT_SIZE * 7 exd[4] = 1 eyd[4] = 0 ex[5] = UNIT_SIZE * 11 ey[5] = UNIT_SIZE * 10 exd[5] = 1 eyd[5] = 0 ex[6] = UNIT_SIZE * 15 ey[6] = UNIT_SIZE * 11 exd[6] = 1 eyd[6] = 0 ex[7] = UNIT_SIZE * 1 ey[7] = UNIT_SIZE * 14 exd[7] = 1 eyd[7] = 0 ex[8] = UNIT_SIZE * 1 ey[8] = UNIT_SIZE * 16 exd[8] = -1 eyd[8] = 0 ex[9] = UNIT_SIZE * 1 ey[9] = UNIT_SIZE * 7 exd[9] = 0 eyd[9] = 1 ex[10] = UNIT_SIZE * 7 ey[10] = UNIT_SIZE * 3 exd[10] = 0 eyd[10] = 1 ex[11] = UNIT_SIZE * 11 ey[11] = UNIT_SIZE * 1 exd[11] = 0 eyd[11] = 1 ex[12] = UNIT_SIZE * 15 ey[12] = UNIT_SIZE * 1 exd[12] = 0 eyd[12] = 1 ex[13] = UNIT_SIZE * 21 ey[13] = UNIT_SIZE * 1 exd[13] = 0 eyd[13] = 1 EndIf If ss=15 then ENEMY_NUM = 20 WALLS [1] = "111111111111111111111111" WALLS [2] = "100100001111111111111111" WALLS [3] = "100001100000000000111111" WALLS [4] = "150111011011011011011111" WALLS [5] = "111111000000000000011111" WALLS [6] = "111111011011011011011111" WALLS [7] = "111111000000000000011111" WALLS [8] = "111111111011011011011111" WALLS [9] = "111111000000000000011111" WALLS [10] = "111111011011011011011111" WALLS [11] = "111111000000000000011111" WALLS [12] = "111111011011011011011111" WALLS [13] = "111111000000000000011111" WALLS [14] = "111111011011011011111111" WALLS [15] = "111111000000000000011001" WALLS [16] = "111111011011011011000001" WALLS [17] = "111111000000000000011001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 7 ey[1] = UNIT_SIZE * 2 exd[1] = 1 eyd[1] = 0 ex[2] = UNIT_SIZE * 18 ey[2] = UNIT_SIZE * 4 exd[2] = -1 eyd[2] = 0 ex[3] = UNIT_SIZE * 6 ey[3] = UNIT_SIZE * 6 exd[3] = 1 eyd[3] = 0 ex[4] = UNIT_SIZE * 18 ey[4] = UNIT_SIZE * 8 exd[4] = -1 eyd[4] = 0 ex[5] = UNIT_SIZE * 6 ey[5] = UNIT_SIZE * 10 exd[5] = 1 eyd[5] = 0 ex[6] = UNIT_SIZE * 18 ey[6] = UNIT_SIZE * 12 exd[6] = -1 eyd[6] = 0 ex[7] = UNIT_SIZE * 6 ey[7] = UNIT_SIZE * 14 exd[7] = 1 eyd[7] = 0 ex[8] = UNIT_SIZE * 18 ey[8] = UNIT_SIZE * 16 exd[8] = -1 eyd[8] = 0 ex[9] = UNIT_SIZE * 6 ey[9] = UNIT_SIZE * 8 exd[9] = 0 eyd[9] = 1 ex[10] = UNIT_SIZE * 9 ey[10] = UNIT_SIZE * 4 exd[10] = 0 eyd[10] = 1 ex[11] = UNIT_SIZE * 12 ey[11] = UNIT_SIZE * 11 exd[11] = 0 eyd[11] = 1 ex[12] = UNIT_SIZE * 15 ey[12] = UNIT_SIZE * 7 exd[12] = 0 eyd[12] = -1 ex[13] = UNIT_SIZE * 18 ey[13] = UNIT_SIZE * 3 exd[13] = 0 eyd[13] = 1 ex[14] = UNIT_SIZE * 12 ey[14] = UNIT_SIZE * 2 exd[14] = 0 eyd[14] = 0 ex[15] = UNIT_SIZE * 12 ey[15] = UNIT_SIZE * 6 exd[15] = 0 eyd[15] = 0 ex[16] = UNIT_SIZE * 9 ey[16] = UNIT_SIZE * 8 exd[16] = 0 eyd[16] = 0 ex[17] = UNIT_SIZE * 15 ey[17] = UNIT_SIZE * 8 exd[17] = 0 eyd[17] = 0 ex[18] = UNIT_SIZE * 12 ey[18] = UNIT_SIZE * 12 exd[18] = 0 eyd[18] = 0 ex[19] = UNIT_SIZE * 15 ey[19] = UNIT_SIZE * 14 exd[19] = 0 eyd[19] = 0 ex[20] = UNIT_SIZE * 9 ey[20] = UNIT_SIZE * 16 exd[20] = 0 eyd[20] = 0 EndIf If ss=16 then Goto End Endif ' スクリーンの初期設定 GraphicsWindow.Show() ' 表示 GraphicsWindow.Width = SCREEN_WIDTH * UNIT_SIZE ' 幅を設定 GraphicsWindow.Height = SCREEN_HEIGHT * UNIT_SIZE ' 高さを設定 GraphicsWindow.CanResize = "False" ' サイズを固定 GraphicsWindow.BackgroundColor = BACK_COLOR ' 背景色を設定 ' 壁の描画 GraphicsWindow.BrushColor = WALL_COLOR ' ブラシの色を設定 For iy = 1 To Array.GetItemCount(WALLS) ' 縦方向の繰り返し(WALLS配列の数だけ) For ix = 1 To Text.GetLength(WALLS [iy]) ' 横方向の繰り返し(文字列の長さだけ) If Text.GetSubText(WALLS [iy], ix, 1) = "1" Then ' 文字が"1"だったら GraphicsWindow.FillRectangle(UNIT_SIZE * (ix - 1), UNIT_SIZE * (iy - 1), UNIT_SIZE, UNIT_SIZE) EndIf EndFor EndFor ' 壁2の描画 GraphicsWindow.BrushColor = "Green" ' ブラシの色を設定 For iy = 1 To Array.GetItemCount(WALLS) ' 縦方向の繰り返し(WALLS配列の数だけ) For ix = 1 To Text.GetLength(WALLS [iy]) ' 横方向の繰り返し(文字列の長さだけ) If Text.GetSubText(WALLS [iy], ix, 1) = "3" Then ' 文字が"3"だったら GraphicsWindow.FillRectangle(UNIT_SIZE * (ix - 1), UNIT_SIZE * (iy - 1), UNIT_SIZE, UNIT_SIZE) EndIf EndFor EndFor ' 壁3の描画 GraphicsWindow.BrushColor = "Yellow" ' ブラシの色を設定 For iy = 1 To Array.GetItemCount(WALLS) ' 縦方向の繰り返し(WALLS配列の数だけ) For ix = 1 To Text.GetLength(WALLS [iy]) ' 横方向の繰り返し(文字列の長さだけ) If Text.GetSubText(WALLS [iy], ix, 1) = "4" Then ' 文字が"3"だったら GraphicsWindow.FillRectangle(UNIT_SIZE * (ix - 1), UNIT_SIZE * (iy - 1), UNIT_SIZE, UNIT_SIZE) EndIf EndFor EndFor ' 壁4の描画 GraphicsWindow.BrushColor = "#AA0022" ' ブラシの色を設定 For iy = 1 To Array.GetItemCount(WALLS) ' 縦方向の繰り返し(WALLS配列の数だけ) For ix = 1 To Text.GetLength(WALLS [iy]) ' 横方向の繰り返し(文字列の長さだけ) If Text.GetSubText(WALLS [iy], ix, 1) = "6" Then ' 文字が"3"だったら GraphicsWindow.FillRectangle(UNIT_SIZE * (ix - 1), UNIT_SIZE * (iy - 1), UNIT_SIZE, UNIT_SIZE) EndIf EndFor EndFor ' 壁5の描画 GraphicsWindow.BrushColor = "#FF00FF" ' ブラシの色を設定 For iy = 1 To Array.GetItemCount(WALLS) ' 縦方向の繰り返し(WALLS配列の数だけ) For ix = 1 To Text.GetLength(WALLS [iy]) ' 横方向の繰り返し(文字列の長さだけ) If Text.GetSubText(WALLS [iy], ix, 1) = "7" Then ' 文字が"3"だったら GraphicsWindow.FillRectangle(UNIT_SIZE * (ix - 1), UNIT_SIZE * (iy - 1), UNIT_SIZE, UNIT_SIZE) EndIf EndFor EndFor '' GOAL GraphicsWindow.BrushColor = "#FFFFFF" ' ブラシの色を設定 For iy = 1 To Array.GetItemCount(WALLS) ' 縦方向の繰り返し(WALLS配列の数だけ) For ix = 1 To Text.GetLength(WALLS [iy]) ' 横方向の繰���返し(文字列の長さだけ) If Text.GetSubText(WALLS [iy], ix, 1) = "5" Then ' 文字が"3"だったら GraphicsWindow.FillRectangle(UNIT_SIZE * (ix - 1), UNIT_SIZE * (iy - 1), UNIT_SIZE, UNIT_SIZE) EndIf EndFor EndFor ' ロボットのスタート地点 x = UNIT_SIZE * 22 ' 横位置 (左から12ユニット) y = UNIT_SIZE * 16 ' 縦位置 (上から10ユニット) xd = 0 ' 横移動方向 (-1:左, 0:止, 1:右) 移動用 yd = 0 ' 縦移動方向 (-1:上, 0:止, 1:下) 移動用 xk = 0 ' 横移動方向 (-1:左, 0:止, 1:右) キーボード受付用 yk = 0 ' 縦移動方向 (-1:上, 0:止, 1:下) キーボード受付用 ' ロボット初期描画 GraphicsWindow.BrushColor = ROBO_COLOR ' ブラシの色を設定 GraphicsWindow.PenColor = ROBO_COLOR ' ペンの色を設定 robot = Shapes.AddEllipse(UNIT_SIZE, UNIT_SIZE) ' ロボットのシェイプを設定 Shapes.Move(robot, x, y) ' ロボットのシェイプを初期位置に ' 敵の描画 GraphicsWindow.BrushColor = ENEMY_COLOR GraphicsWindow.PenColor = ENEMY_COLOR For ie = 1 To ENEMY_NUM enemy[ie] = Shapes.AddEllipse(UNIT_SIZE, UNIT_SIZE) Shapes.Move(enemy[ie], ex[ie], ey[ie]) EndFor Controls.AddButton("終了",660,5) Controls.ButtonClicked = onbutton1 ' キーボードイベントの設定 GraphicsWindow.KeyDown = onKeyDown ' キーが押されたらonKeyDownサブルーチンを呼ぶ While xk = 0 And yk = 0 EndWhile starttime = Clock.ElapsedMilliseconds ' メインループ status = "" While status = "" ' 繰り返し(無条件に) ' キーボードからの方向指示を受け付ける ' ロボットの縦位置・横位置ともにユ���ット単位だったら If Math.Remainder(x, UNIT_SIZE) = 0 And Math.Remainder(y, UNIT_SIZE) = 0 Then ' キーボード受け付け用の方向情報を移動用の方向情報にコピー xd = xk ' 横方向 yd = yk ' 縦方向 EndIf ' このまま一回分進んだ場合のマップ上の位置を求める ' まずピクセル単位で位置を求め、それをユニットのサイズで割ることでマップ上の位置を求める If xd < 0 Then nx = x - 1 ElseIf 0 < xd then nx = x + UNIT_SIZE + 1 Else nx = x EndIf nxi = Math.Floor(nx / UNIT_SIZE) + 1 If yd < 0 Then ny = y - 1 ElseIf 0 < yd then ny = y + UNIT_SIZE + 1 Else ny = y EndIf nyi = Math.Floor(ny / UNIT_SIZE) + 1 ' マップ上の求めた位置に壁があるか If Text.GetSubText(WALLS [nyi], nxi, 1) = "1" Then ' すべての移動方向を0に設定する(つまり、停止させる) xk = 0 yk = 0 xd = 0 yd = 0 ElseIf Text.GetSubText(WALLS [nyi], nxi, 1) = "3" Then ' すべての移動方向を0に設定する(つまり、停止させる) xk = 0 yk = 0 xd = 0 yd = 0 ElseIf Text.GetSubText(WALLS [nyi], nxi, 1) = "6" Then Goto over ElseIf Text.GetSubText(WALLS [nyi], nxi, 1) = "7" Then ' すべての移動方向を0に設定する(つまり、停止させる) xk = -xk yk = -yk xd = -xd yd = -yd EndIf ' ロボットの移動位置を計算 x = x + xd * SPEED y = y + yd * SPEED ' ロボットのシェイプを移動 Shapes.Move(robot, x, y) ' ゴール判定 If Text.GetSubText(WALLS [nyi], nxi, 1) = "5" Then status = "GOAL" EndIf ' 敵の動き For ie = 1 To ENEMY_NUM If exd[ie] < 0 Then enx = ex[ie] - 1 ElseIf 0 < exd[ie] then enx = ex[ie] + UNIT_SIZE + 1 Else enx = ex[ie] EndIf enxi = Math.Floor(enx / UNIT_SIZE) + 1 If eyd[ie] < 0 Then eny = ey[ie] - 1 ElseIf 0 < eyd[ie] then eny = ey[ie] + UNIT_SIZE + 1 Else eny = ey[ie] EndIf enyi = Math.Floor(eny / UNIT_SIZE) + 1 If Text.GetSubText(WALLS [enyi], enxi, 1) = "1" Then ' 敵が壁にぶつかった時、逆方向に動く exd[ie] = -exd[ie] eyd[ie] = -eyd[ie] ElseIf Text.GetSubText(WALLS [enyi], enxi, 1) = "4" Then exd[ie] = -exd[ie] eyd[ie] = -eyd[ie] ElseIf Text.GetSubText(WALLS [enyi], enxi, 1) = "6" Then exd[ie] = -exd[ie] eyd[ie] = -eyd[ie] ElseIf Text.GetSubText(WALLS [enyi], enxi, 1) = "7" Then exd[ie] = -exd[ie] eyd[ie] = -eyd[ie] EndIf ex[ie] = ex[ie] + exd[ie] * ENEMY_SPEED ey[ie] = ey[ie] + eyd[ie] * ENEMY_SPEED Shapes.Move(enemy[ie], ex[ie], ey[ie]) If (x - ex[ie]) * (x - ex[ie]) + (y - ey[ie]) * (y - ey[ie]) < UNIT_SIZE * UNIT_SIZE Then over: status = "GAME OVER" GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.PenColor = "Yellow" GraphicsWindow.FillEllipse(x - 135, y - 135, 300, 300) Program.Delay(DELAY) GraphicsWindow.BrushColor = "Black" GraphicsWindow.PenColor = "Black" GraphicsWindow.FillEllipse(x - 135, y - 135, 300, 300) GraphicsWindow.ShowMessage("ギャーーー!!", "OUT") DEATH=DEATH+1 GraphicsWindow.ShowMessage("あなたの死亡回数は"+DEATH+"です", "OUT") If DEATH = 50 then GraphicsWindow.ShowMessage("つらくなってきたかな?", "がんばれ") Endif If DEATH = 100 then GraphicsWindow.ShowMessage("もうだめぽ", "OUT") GraphicsWindow.Clear() Goto gameend Endif Goto st EndIf If click = 1 then GraphicsWindow.ShowMessage("お疲れさまでした", "ゲームを終了します") GraphicsWindow.Clear() click = 0 Goto cls EndIf GraphicsWindow.BrushColor = "Red" GraphicsWindow.DrawText(3,3, ""+ss+"") EndFor ' 速度調整のための待機 Program.Delay(DELAY) EndWhile If status = "GOAL" then If ss=6 then GraphicsWindow.ShowMessage ("残機が15機増えた","命を手に入れた") DEATH = DEATH - 15 If DEATH < 0 then DEATH = 0 EndIf EndIf GraphicsWindow.ShowMessage("次のステージへ", "ゴール") ss=ss+1 GraphicsWindow.BrushColor = "Red" GraphicsWindow.DrawText(3,3, ""+ss+"") goto st EndIf gameend: Goto cls Sub onbutton1 click = click + 1 EndSub End: GraphicsWindow.Show() GraphicsWindow.Width = 700 GraphicsWindow.Height = 200 GraphicsWindow.CanResize = "False" GraphicsWindow.BackgroundColor = "#B0F0E6" GraphicsWindow.FontSize = 90 GraphicsWindow.BrushColor = "#C050B0" GraphicsWindow.DrawText(5,8, "congratulation") GraphicsWindow.FontSize = 20 GraphicsWindow.BrushColor = "#Red" GraphicsWindow.DrawText(5,120, "全ステージクリアおめでとう") GraphicsWindow.BrushColor = "#Blue" GraphicsWindow.DrawText(5,160, "画面をクリックしてください") GraphicsWindow.MouseDown = onMouseDown ' サブルーチン (キーが押されたときに呼ばれる) Sub onKeyDown KeyName = GraphicsWindow.LastKey ' 最後に操作されたキーの名前を取得 If KeyName = "Left" Then ' カーソル(左)キーだったら xk = -1 ' 横移動方向を左(-1)に yk = 0 ' 縦移動方向を止(0)に ElseIf KeyName = "Right" Then ' カーソル(右)キーだったら xk = 1 ' 横移動方向を右(1)に yk = 0 ' 縦移動方向を止(0)に ElseIf KeyName = "Up" Then ' カーソル(上)キーだったら xk = 0 ' 横移動方向を止(0)に yk = -1 ' 縦移動方向を上(-1)に ElseIf KeyName = "Down" Then ' カーソル(下)キーだったら xk = 0 ' 横移動方向を止(0)�� yk = 1 ' 縦移動方向を下(1)に ElseIf KeyName = "Space" Then xk = 0 yk = 0 EndIf EndSub Sub onMouseDown Program.End() EndSub End>GJL218.sb< Start>GJM514.sb< ' Program by Yvan Leduc , April 24th 2016 ' Moonlight Sonata de Beethoven adapté pour le piano sur Small Basic ' 1er preview program no : PHW283 GraphicsWindow.Top =0 GraphicsWindow.left =0 GraphicsWindow.Height=768 GraphicsWindow.Width=1366 GraphicsWindow.fontname="AR Decode" GraphicsWindow.BackgroundColor="black" image1=imagelist.LoadImage( "https://upload.wikimedia.org/wikipedia/commons/thumb/a/aa/Beethoven_bust_statue_by_Hagen.jpg/403px-Beethoven_bust_statue_by_Hagen.jpg") GraphicsWindow.DrawImage(image1,75,0) GraphicsWindow.FontSize=80 GraphicsWindow.BrushColor="#E7D3AD" GraphicsWindow.DrawboundText(500,100,500,"Moonlight Sonata") GraphicsWindow.FontSize=45 GraphicsWindow.BrushColor="#E7A3AA" GraphicsWindow.DrawboundText(500,300,800,"Piano Sonata No14, Op. 27- No2, 1° mvt") GraphicsWindow.FontSize=45 GraphicsWindow.BrushColor="#E7B3AB" GraphicsWindow.DrawboundText(550,500,800,"Ludwig van Beethoven") GraphicsWindow.FontSize=20 GraphicsWindow.brushcolor="gray" GraphicsWindow.DrawText(900,650,"Program and Music Arangement by Yvan Leduc @ 2016") ' In musical notation, a bar (or measure) ... For M= 1 To 15 IF M=1 THEN MEASURE_1() ElseIf M=2 THEN MEASURE_2() ElseIf M=3 THEN MEASURE_3() ElseIf M=4 THEN MEASURE_4() ElseIf M=5 THEN MEASURE_5() ElseIf M=6 THEN MEASURE_6() ElseIf M=7 THEN MEASURE_7() ElseIf M=8 THEN MEASURE_8() ElseIf M=9 THEN MEASURE_9() ElseIf M=10 THEN MEASURE_10() ElseIf M=11 THEN MEASURE_11() ElseIf M=12 THEN MEASURE_12() ElseIf M=13 THEN MEASURE_13() ElseIf M=14 THEN MEASURE_14() ElseIf M=15 THEN MEASURE_15() Else EndIf For T=1 TO 12 sound.PlayMusic (a[t]+n[t]) a[t]="" n[t]="" endfor ENDFOR ' 1er portée - first stave SUB MEASURE_1 a[1]="O2L64 C#" +"O3L64 C#" n[1]="O4L4 G#" n[2]="O5L4 C#" n[3]="O5L4 E" n[4]="O4L4 G#" n[5]="O5L4 C#" n[6]="O5L4 E" n[7]="O4L4 G#" n[8]="O5L4 C#" n[9]="O5L4 E" n[10]="O4L4 G#" n[11]="O5L4 C#" n[12]="O5L4 E" EndSub SUB MEASURE_2 a[1]="O2L64 B" +"O3L64 B" n[1]="O4L4 G#" n[2]="O5L4 C#" n[3]="O5L4 E" n[4]="O4L4 G#" n[5]="O5L4 C#" n[6]="O5L4 E" n[7]="O4L4 G#" n[8]="O5L4 C#" n[9]="O5L4 E" n[10]="O4L4 G#" n[11]="O5L4 C#" n[12]="O5L4 E" ENDSUB SUB MEASURE_3 a[1]="O2L64 A" +"O3L64 A" n[1]="O4L4 A" n[2]="O5L4 C#" n[3]="O5L4 E" n[4]="O4L4 A" n[5]="O5L4 C#" n[6]="O5L4 E" a[7]="O2L64 F#" +"O3L64 F#" n[7]="O4L4 A" n[8]="O5L4 D" n[9]="O5L4 F#" n[10]="O4L4 A" n[11]="O5L4 D#" n[12]="O5L4 F#" ENDSUB ' 2e portée second stave SUB MEASURE_4 a[1]="O2L64 G#" +"O3L64 G#" n[1]="O4L4 G#" n[2]="O5L4 B#" ' dans le mesure 5 les Si sont # ( rare ) jusqu à ce q ont rencontre un bécarre n[3]="O5L4 F#" n[4]="O4L4 G#" n[5]="O5L4 C#" n[6]="O5L4 E" a[7]="O2L64 G#" +"O3L64 G#" n[7]="O4L4 G#" n[8]="O5L4 C#" n[9]="O5L4 E" n[10]="O4L4 G#" n[11]="O5L4 B#" ' SI dièse ( ou Dob) n[12]="O5L4 D#" ENDSUB SUB MEASURE_5 a[1]="O3L64 C#" +"O4L64 G#" n[1]="O4L4 E" n[2]="O4L4 G#" n[3]="O4L4 C#" n[4]="O4L4 G#" n[5]="O5L4 C#" n[6]="O5L4 E" n[7]="O4L4 G#" n[8]="O5L4 C#" n[9]="O5L4 E" a[10]="O4L64 G#" +"O6L64 G#" n[10]="O6L4 G#" ' mp n[11]="O5L4 C#" a[12]="O5L64 E" +"O6L64 G#" n[12]="O5L4 E" ENDSUB Sub MEASURE_6 a[1]="O3L64 F#" +"O4L64 B#" n[1]="O6L4 G#" n[2]="O5L4 D#" n[3]="O5L4 F#" n[4]="O4L4 G#" n[5]="O5L4 D#" n[6]="O5L4 F#" n[7]="O4L4 G#" n[8]="O5L4 D#" n[9]="O5L4 F#" a[10]="O4L64 G#" +"O6L64 G#" n[10]="O6L4 G#" n[11]="O4L4 D#" a[12]="O5L64 F#" +"O6L64 G#" n[12]="O5L4 F#" EndSub Sub MEASURE_7 a[1]="O3L64 C#" +"O4L64 G#" n[1]="O6L4 G#" n[2]="O5L4 C#" n[3]="O5L4 E" n[4]="O4L4 G#" n[5]="O5L4 C#" n[6]="O5L4 E" a[7]="O3L64 F#" +"O4L64 A" n[7]="O6L4 A" n[8]="O4L4 C#" n[9]="O5L4 F#" n[10]="O4L4 A" n[11]="O5L4 C#" n[12]="O5L4 F#" EndSub Sub MEASURE_8 a[1]="O3L64 B" +"O4L64 G#" n[1]="O6L4 G#" n[2]="O4L4 B" ' SI normal n[3]="O5L4 E" n[4]="O4L4 G#" n[5]="O4L4 B" ' SI normal mais o4 pas o5 ici ets la limite du do n[6]="O5L4 E" a[7]="O3L64 B" +"O4L64 G#" n[7]="O6L4 F#" n[8]="O4L4 B" n[9]="O4L4 D#" a[10]="O4L64 A"+"O6L64 B" n[10]="O6L4 B" n[11]="O4L4 B" n[12]="O5L4 D#" EndSub Sub MEASURE_9 a[1]="O3L64 E" +"O4L64 G#" n[1]="O6L4 E" n[2]="O4L4 B" n[3]="O5L4 E" n[4]="O4L4 G#" n[5]="O4L4 B" n[6]="O5L4 E" n[7]="O4L4 G#" n[8]="O4L4 B" n[9]="O5L4 E" n[10]="O4L4 G#" n[11]="O4L4 B" n[12]="O5L4 E" EndSub Sub MEASURE_10 a[1]="O3L64 E" +"O4L64 E" n[1]="O4L4 G" n[2]="O4L4 B" n[3]="O5L4 E" n[4]="O4L4 G" n[5]="O4L4 B" n[6]="O5L4 E n[7]="O4L4 G" n[8]="O4L4 B" n[9]="O5L4 E" a[10]="O3L64 G" +"O6L64 G" n[10]="O6L4 G" n[11]="O4L4 B" a[12]="O5L64 E" +"O6L64 G" n[12]="O5L4 E" EndSub Sub MEASURE_11 a[1]="O3L64 D" +"O6L64 G" n[1]="O6L4 G" n[2]="O4L4 B" n[3]="O5L4 F" n[4]="O4L4 G" n[5]="O4L4 B" n[6]="O5L4 F" n[7]="O4L4 G" n[8]="O4L4 B" n[9]="O5L4 F" a[10]="O3L64 G" +"O6L64 G" n[10]="O6L4 G" n[11]="O4L4 F" a[12]="O5L64 E" +"O6L64 G" n[12]="O6L4 G" EndSub Sub MEASURE_12 a[1]="O3L64 G" +"O6L64 G" n[1]="O6L4 G" n[2]="O4L4 C" n[3]="O5L4 E" a[4]="O2L64 B" +"O3L64 B" n[4]="O5L4 G" n[5]="O4L4 C" n[6]="O5L4 E" a[7]="O2L64 A#" +"O3L64 A#" n[7]="O5L4 G" n[8]="O5L4 C#" n[9]="O5L4 E" a[10]="O4L64 F#" +"O6L64 F#" n[10]="O6L4 F#" n[11]="O4L4 A#" n[12]="O5L4 C" EndSub Sub MEASURE_13 ' TOUTES EN CLÉ DE FA CETTE MESURE a[1]="O2L64 B" +"O6L64 F#" n[1]="O6L4 F#" n[2]="O4L4 B" n[3]="O5L4 D" ' becarre n[4]="O4L4 F#" n[5]="O4L4 B" n[6]="O5L4 D" ' becarre a[7]="O3L64 E" +"O6L64 G" n[7]="O6L4 G" ' becarre n[8]="O4L4 B" n[9]="O5L4 C#" a[10]="O3L64 G" +"O6L64 E" n[10]="O6L4 E" n[11]="O4L4 B" n[12]="O5L4 C#" EndSub Sub MEASURE_14 ' TOUTES EN CLÉ DE FA CETTE MESURE a[1]="O3L64 F#" +"O6L64 F#" n[1]="O6L4 F#" n[2]="O4L4 B" n[3]="O5L4 D" ' becarre n[4]="O4L4 F#" n[5]="O4L4 B" n[6]="O5L4 D" ' becarre a[7]="O2L64 F#" +"O6L64 F#" n[7]="O6L4 F#" ' becarre n[8]="O4L4 A#" n[9]="O5L4 C#" n[10]="O4L4 F#" ' becarre n[11]="O4L4 A#" n[12]="O5L4 C#" EndSub Sub MEASURE_15 ' LA 2E PORTÉE TOMBE EN CLÉ DE SOL a[1]="O3L64 B" +"O5L64 B" n[1]="O5L4 B" n[2]="O4L4 D" n[3]="O4L4 F#" n[4]="O4L4 B" n[5]="O5L4 D" n[6]="O5L4 F#" n[7]="O4L4 D" n[8]="O5L4 D#" n[9]="O5L4 F#" a[10]="O4L64 B" +"O6L64 B" n[10]="O6L4 B" n[11]="O5L4 D#" n[12]="O5L4 F#" ENDSUB End>GJM514.sb< Start>GJM689.sb< GraphicsWindow.Width=1400 GraphicsWindow.Height=900 GraphicsWindow.Left=10 GraphicsWindow.Top=1 GraphicsWindow.BackgroundColor="teal GraphicsWindow.Title="head 3D GraphicsWindow.PenColor ="white GraphicsWindow.PenWidth =1 GraphicsWindow.BrushColor ="#7700ccee hx="18:19:1a:18:1a:17:1c:1d:1e:1c:1e:1b:20:21:22:20:22:1f:24:1f:22:24:22:23:24:23:19:24:19:18:26:27:28:26:28:25:2a:17:1a:2a:1a:29:28:2a:29:28:29:25:26:2b:2c:26:2c:27:20:2d:2e:20:2e:21:1c:2c:30:1c:30:2f:32:33:34:32:34:31:36:37:38:36:38:35:3a:3b:3c:3a:3c:39:3e:3f:40:3e:40:3d:42:43:44:42:44:41:46:47:48:46:48:45:43:42:4a:43:4a:49:42:33:32:42:32:4a:4c:4d:4e:4c:4e:4b:50:51:52:50:52:4f:54:55:56:54:56:53:57:58:50:57:50:4f:5a:5b:5c:5a:5c:59:5d:5e:4e:5d:4e:4d:57:5f:60:57:60:58:62:63:64:62:64:61:64:65:66:64:66:61:62:67:68:62:68:63:6a:6b:6c:6a:6c:69:6d:6e:69:6d:69:6c:65:6f:70:65:70:66:72:73:74:72:74:71:76:77:78:76:78:75:7a:7b:7c:7a:7c:79:7e:7f:80:7e:80:7d:82:83:84:82:84:81:7d:80:86:7d:86:85:38:37:88:38:88:87:25:89:8a:25:8a:26:8b:2b:26:8b:26:8a:8c:8d:8e:8c:8e:82:90:81:84:90:84:8f:92:93:94:92:94:91:96:97:36:96:36:95:36:35:98:36:98:95:9a:9b:9c:9a:9c:99:9e:9f:a0:9e:a0:9d:a2:a3:a4:a2:a4:a1:81:90:9d:81:9d:a0:9c:9b:a6:9c:a6:a5:a8:a9:aa:a8:aa:a7:ab:ac:ad:ab:ad:a9:af:b0:ab:af:ab:ae:3b:b1:b2:3b:b2:3c:b4:b5:31:b4:31:b3:7f:34:b6:7f:b6:80:86:b7:b8:86:b8:7c:b9:79:7c:b9:7c:b8:bb:bc:bd:bb:bd:ba:bf:c0:c1:bf:c1:be:4c:c2:c1:4c:c1:4d:64:63:c4:64:c4:c3:b0:af:c6:b0:c6:c5:c7:c8:ad:c7:ad:ac:c4:ca:cb:c4:cb:c9:cd:ce:cf:cd:cf:cc:d0:cd:cc:d0:cc:c9:d2:61:66:d2:66:d1:4f:d2:d1:4f:d1:57:d4:d5:d6:d4:d6:d3:d8:d9:da:d8:da:d7:dc:d8:d7:dc:d7:db:de:df:da:de:da:dd:e1:e2:e3:e1:e3:e0:de:dd:e5:de:e5:e4:e6:e7:dc:e6:dc:db:e3:e2:e7:e3:e7:e6:e9:ea:eb:e9:eb:e8:ba:cb:ca:ba:ca:bb:ec:ed:ee:ec:ee:bc:f0:f1:f2:f0:f2:ef:f1:f3:f4:f1:f4:ee:f5:65:64:f5:64:c3:c3:cc:cf:c3:cf:f5:6f:f6:f7:6f:f7:73:8d:8c:f9:8d:f9:f8:fb:fc:fd:fb:fd:fa:fe:76:ff:fe:ff:d9:101:102:103:101:103:100:100:103:105:100:105:104:104:105:1e:104:1e:1d:da:d9:106:da:106:dd:103:102:108:103:108:107:10a:1e:105:10a:105:109:fd:fc:10c:fd:10c:10b:10e:c8:10f:10e:10f:10d:c7:110:10f:c7:10f:c8:c7:111:112:c7:112:110:114:10b:10c:114:10c:113:113:10c:10d:113:10d:115:5d:4d:c1:5d:c1:c0:117:118:119:117:119:116:116:58:60:116:60:117:11a:11b:3e:11a:3e:5e:119:11c:11d:119:11d:116:11f:120:121:11f:121:11e:3f:3e:11b:3f:11b:122:11b:123:124:11b:124:122:125:126:44:125:44:43:128:129:12a:128:12a:127:12c:12d:12e:12c:12e:12b:130:131:132:130:132:12f:8a:89:134:8a:134:133:a5:136:137:a5:137:135:138:37:36:138:36:97:13a:97:96:13a:96:139:13b:13c:e3:13b:e3:e6:88:13d:9e:88:9e:9d:13f:94:93:13f:93:13e:140:141:93:140:93:92:143:144:145:143:145:142:50:58:116:50:116:11d:147:91:94:147:94:146:117:11e:121:117:121:118:149:14a:14b:149:14b:148:bb:ca:68:bb:68:14c:ec:14c:bf:ec:bf:be:a5:a6:14d:a5:14d:136:8b:14e:30:8b:30:2b:150:151:152:150:152:14f:33:144:b6:33:b6:34:153:7e:35:153:35:38:154:155:95:154:95:98:f3:157:158:f3:158:156:15a:157:f0:15a:f0:159:15c:15d:15e:15c:15e:15b:15f:160:d5:15f:d5:d4:80:b6:b7:80:b7:86:67:62:162:67:162:161:72:71:164:72:164:163:166:c5:c6:166:c6:165:6b:167:168:6b:168:6c:15c:169:16a:15c:16a:15d:15b:16b:ea:15b:ea:15c:dc:e7:a7:dc:a7:16c:99:16e:12c:99:12c:16d:127:48:47:127:47:128:b3:153:16f:b3:16f:b4:170:171:9e:170:9e:13d:13d:88:37:13d:37:138:173:174:175:173:175:172:29:1a:132:29:132:131:131:89:25:131:25:29:f8:176:177:f8:177:8d:42:145:144:42:144:33:b7:143:178:b7:178:b8:17a:fd:10b:17a:10b:179:10d:10f:17b:10d:17b:115:17d:17e:17f:17d:17f:17c:180:181:69:180:69:6e:69:181:182:69:182:6a:168:183:6d:168:6d:6c:b5:b4:a4:b5:a4:a3:16d:184:9a:16d:9a:99:a8:a7:e7:a8:e7:e2:51:123:11b:51:11b:11a:110:185:17b:110:17b:10f:112:186:185:112:185:110:8b:177:176:8b:176:14e:187:16e:99:187:99:9c:188:189:16e:188:16e:187:ad:c8:10e:ad:10e:18a:12d:12c:16e:12d:16e:189:18c:18d:18e:18c:18e:18b:18f:16c:a7:18f:a7:aa:18a:fb:18f:18a:18f:aa:10e:fc:fb:10e:fb:18a:66:70:190:66:190:d1:83:191:174:83:174:173:187:9c:a5:187:a5:135:193:194:195:193:195:192:192:188:187:192:187:135:23:136:14d:23:14d:19:23:22:137:23:137:136:22:21:193:22:193:137:196:106:d9:196:d9:ff:179:197:198:179:198:196:75:17a:ff:75:ff:76:10e:10d:10c:10e:10c:fc:130:12f:175:130:175:174:16a:199:19a:16a:19a:15d:19b:19c:59:19b:59:5c:19e:19b:19f:19e:19f:19d:1a1:150:1a2:1a1:1a2:1a0:151:1a3:45:151:45:48:1a5:1a6:1a7:1a5:1a7:1a4:1a5:1a8:1a9:1a5:1a9:1a6:1a7:1a6:1ab:1a7:1ab:1aa:ef:f2:1ac:ef:1ac:1a9:1ae:49:4a:1ae:4a:1ad:46:45:1a3:46:1a3:1ad:f7:1af:74:f7:74:73:15a:159:1b1:15a:1b1:1b0:1b1:1a5:1a4:1b1:1a4:1b2:1b4:1b5:1b6:1b4:1b6:1b3:1b5:17d:17c:1b5:17c:1b6:b2:b1:1b8:b2:1b8:1b7:1b8:1b9:1ba:1b8:1ba:1b7:1bc:1bd:1be:1bc:1be:1bb:144:143:b7:144:b7:b6:d5:160:165:d5:165:c6:d6:af:ae:d6:ae:e1:1c0:1c1:1c2:1c0:1c2:1bf:1a7:1aa:1c3:1a7:1c3:1bf:4b:1c3:1aa:4b:1aa:4c:4e:5e:3e:4e:3e:3d:11e:56:55:11e:55:11f:5f:57:d1:5f:d1:190:ed:1c4:1ac:ed:1ac:f2:be:c1:c2:be:c2:1c4:ed:ec:be:ed:be:1c4:4f:52:162:4f:162:d2:11e:117:60:11e:60:56:1ae:1a1:1a0:1ae:1a0:1c5:152:127:12a:152:12a:12b:39:3c:1c7:39:1c7:1c6:d4:1c8:1c9:d4:1c9:15f:53:163:164:53:164:54:8e:8d:177:8e:177:133:191:8e:133:191:133:134:1cb:101:100:1cb:100:1ca:e4:108:102:e4:102:de:100:104:1cc:100:1cc:1ca:1cc:104:1d:1cc:1d:2f:107:109:105:107:105:103:1cd:1ce:bd:1cd:bd:f4:e3:13c:1cf:e3:1cf:e0:1d1:1d2:19a:1d1:19a:1d0:5a:182:181:5a:181:5b:e9:169:15c:e9:15c:ea:eb:ea:16b:eb:16b:1d3:152:151:48:152:48:127:152:12b:12e:152:12e:14f:1d4:1d5:1d6:1d4:1d6:19f:15b:1d7:1d8:15b:1d8:16b:1d7:15b:15e:1d7:15e:1d9:1d1:1db:1dc:1d1:1dc:1da:180:6e:1de:180:1de:1dd:19e:1df:19c:19e:19c:19b:120:11f:19c:120:19c:1df:55:54:5a:55:5a:59:182:164:71:182:71:6a:e8:166:165:e8:165:e9:129:128:b5:129:b5:a3:1a3:151:150:1a3:150:1a1:31:34:7f:31:7f:b3:1a:19:14d:1a:14d:132:173:172:a2:173:a2:a1:102:101:df:102:df:de:101:1cb:1e0:101:1e0:df:d3:d6:e1:d3:e1:e0:13c:1e1:13a:13c:13a:1cf:ab:a9:a8:ab:a8:ae:111:c7:ac:111:ac:1e2:a8:e2:e1:a8:e1:ae:f5:f6:6f:f5:6f:65:72:70:6f:72:6f:73:d2:162:62:d2:62:61:1af:166:e8:1af:e8:167:eb:168:167:eb:167:e8:168:eb:1d3:168:1d3:183:51:11a:1e3:51:1e3:52:1e5:1e6:1e7:1e5:1e7:1e4:1e9:44:126:1e9:126:1e8:1eb:1c6:1c7:1eb:1c7:1ea:9a:172:175:9a:175:9b:1eb:142:145:1eb:145:1ec:1eb:1ea:1ed:1eb:1ed:142:1b4:1b3:1be:1b4:1be:1ee:1ef:1f0:1b6:1ef:1b6:17c:1f0:1f1:1b3:1f0:1b3:1b6:14b:14a:1f2:14b:1f2:1b0:1f3:15a:1b0:1f3:1b0:1f2:17c:17f:1f4:17c:1f4:1ef:1f5:148:14b:1f5:14b:1b2:1f3:158:157:1f3:157:15a:1ec:1f6:1c6:1ec:1c6:1eb:1c6:1f6:1e7:1c6:1e7:39:1e6:3a:39:1e6:39:1e7:3a:1e6:1f7:3a:1f7:17e:17f:1f8:1f9:17f:1f9:1f4:1bf:1c2:1a4:1bf:1a4:1a7:149:148:1bd:149:1bd:1bc:1c2:1c1:1fa:1c2:1fa:1f5:1fb:1fc:1c3:1fb:1c3:4b:63:68:ca:63:ca:c4:1fd:d0:c9:1fd:c9:cb:c9:cc:c3:c9:c3:c4:1ce:1fe:ba:1ce:ba:bd:cb:ba:1fe:cb:1fe:1fd:94:13f:155:94:155:146:146:155:154:146:154:1ff:7b:1ff:154:7b:154:85:47:31:b5:47:b5:128:9a:184:a2:9a:a2:172:9b:175:12f:9b:12f:a6:a6:12f:132:a6:132:14d:200:140:121:200:121:120:1df:19e:202:1df:202:201:19e:19d:1db:19e:1db:202:201:200:120:201:120:1df:bf:67:161:bf:161:c0:14c:68:67:14c:67:bf:52:1e3:161:52:161:162:53:56:60:53:60:5f:53:5f:190:53:190:163:163:190:70:163:70:72:90:87:88:90:88:9d:12a:16d:12c:12a:12c:12b:12a:129:184:12a:184:16d:16f:8f:a4:16f:a4:b4:203:204:db:203:db:d7:fe:d9:d8:fe:d8:205:18e:16c:18f:18e:18f:18b:18e:18d:205:18e:205:d8:206:207:f6:206:f6:f5:13f:96:95:13f:95:155:1ad:1a3:1a1:1ad:1a1:1ae:21:2e:194:21:194:193:193:192:135:193:135:137:189:208:209:189:209:12d:20a:208:189:20a:189:188:12e:12d:209:12e:209:20b:12e:20b:20c:12e:20c:14f:141:1c8:13e:141:13e:93:1c8:141:20d:1c8:20d:1c9:19a:199:20e:19a:20e:1d0:19a:1d2:15e:19a:15e:15d:1c8:d4:d3:1c8:d3:20f:d3:e0:1cf:d3:1cf:20f:197:179:10b:197:10b:114:17a:179:196:17a:196:ff:af:d6:d5:af:d5:c6:182:5a:54:182:54:164:199:16a:15f:199:15f:1c9:55:59:19c:55:19c:11f:169:e9:165:169:165:160:74:1af:167:74:167:6b:74:6b:6a:74:6a:71:160:15f:16a:160:16a:169:201:202:1d0:201:1d0:20e:20e:199:1c9:20e:1c9:20d:202:1db:1d1:202:1d1:1d0:166:1af:f7:166:f7:c5:b0:1e2:ac:b0:ac:ab:18c:18b:fa:18c:fa:77:18b:18f:fb:18b:fb:fa:123:51:50:123:50:11d:11c:124:123:11c:123:11d:210:147:146:210:146:1ff:7e:7d:98:7e:98:35:98:7d:85:98:85:154:7f:7e:153:7f:153:b3:38:87:16f:38:16f:153:7c:7b:85:7c:85:86:8f:16f:87:8f:87:90:a4:8f:84:a4:84:a1:191:83:82:191:82:8e:124:210:7a:124:7a:122:3d:1fb:4b:3d:4b:4e:140:200:20d:140:20d:141:200:201:20e:200:20e:20d:7b:7a:210:7b:210:1ff:106:211:e5:106:e5:dd:13c:13b:170:13c:170:1e1:204:13b:e6:204:e6:db:203:212:171:203:171:204:212:203:df:212:df:1e0:d7:da:df:d7:df:203:1cb:1ca:176:1cb:176:f8:1ca:1cc:14e:1ca:14e:176:14e:1cc:2f:14e:2f:30:1cb:f8:f9:1cb:f9:1e0:fd:78:77:fd:77:fa:18a:aa:a9:18a:a9:ad:207:1e2:b0:207:b0:c5:206:111:1e2:206:1e2:207:213:112:111:213:111:206:214:186:112:214:112:213:157:f3:f1:157:f1:f0:bc:ee:f4:bc:f4:bd:bb:14c:ec:bb:ec:bc:1bf:1c3:1fc:1bf:1fc:1c0:a2:184:129:a2:129:a3:188:192:195:188:195:20a:215:19d:19f:215:19f:1d6:216:41:44:216:44:1e9:1f6:217:1e4:1f6:1e4:1e7:1f7:218:219:1f7:219:1f8:1ec:21a:217:1ec:217:1f6:1ec:145:42:1ec:42:41:1f8:219:21b:1f8:21b:1f9:ef:1a8:159:ef:159:f0:3b:3a:17e:3b:17e:17d:1b0:1b1:1b2:1b0:1b2:14b:1b5:1b4:1b8:1b5:1b8:b1:17d:1b5:b1:17d:b1:3b:1c1:1b9:1ee:1c1:1ee:1fa:1c2:1f5:1b2:1c2:1b2:1a4:17e:1f7:1f8:17e:1f8:17f:1f5:1fa:1bd:1f5:1bd:148:218:1f7:1e6:218:1e6:1e5:139:96:13f:139:13f:13e:147:11c:119:147:119:91:1e3:5d:c0:1e3:c0:161:1e3:11a:5e:1e3:5e:5d:1a6:1a9:1ac:1a6:1ac:1ab:1a5:1b1:159:1a5:159:1a8:1cf:13a:139:1cf:139:20f:13b:204:171:13b:171:170:13a:1e1:138:13a:138:97:170:13d:138:170:138:1e1:171:212:9f:171:9f:9e:1e0:f9:9f:1e0:9f:212:106:196:198:106:198:211:18e:d8:dc:18e:dc:16c:21d:21e:21f:21d:21f:21c:221:21f:21e:221:21e:220:223:221:220:223:220:222:225:223:222:225:222:224:227:225:224:227:224:226:229:227:226:229:226:228:22b:229:228:22b:228:22a:22d:22e:22f:22d:22f:22c:231:22d:22c:231:22c:230:233:222:220:233:220:232:234:224:222:234:222:233:235:226:224:235:224:234:236:228:226:236:226:235:228:236:237:228:237:22a:22f:238:239:22f:239:22c:23a:230:22c:23a:22c:239:23b:23c:230:23b:230:23a:23e:21c:23f:23e:23f:23d:241:21f:221:241:221:240:221:223:242:221:242:240:243:242:223:243:223:225:244:243:227:244:227:229:244:229:22b:244:22b:245:22e:22d:247:22e:247:246:231:248:247:231:247:22d:231:23c:249:231:249:248:23b:24a:249:23b:249:23c:220:21e:21d:220:21d:232:23e:24c:24d:23e:24d:24b:23e:23d:24e:23e:24e:24c:24e:23d:23f:24e:23f:24f:23f:21c:21f:23f:21f:24f:234:250:236:234:236:235:250:251:237:250:237:236:238:22f:22a:238:22a:237:22a:22f:22e:22a:22e:22b:246:245:22b:246:22b:22e:250:234:233:250:233:232:24d:238:237:24d:237:251:21c:23e:24b:21c:24b:21d:23b:23a:24e:23b:24e:24f:24d:24c:239:24d:239:238:21f:241:252:21f:252:24f:252:24a:23b:252:23b:24f:254:245:246:254:246:253:254:255:244:254:244:245:247:1ea:1c7:247:1c7:253:247:248:1ed:247:1ed:1ea:255:1fc:243:255:243:244:1ba:1c0:1fc:1ba:1fc:255:3c:b2:253:3c:253:1c7:b2:1b7:254:b2:254:253:241:40:b9:241:b9:252:24a:b8:178:24a:178:249:24e:23a:239:24e:239:24c:3d:240:242:3d:242:1fb:249:178:1ed:249:1ed:248:1c5:256:49:1c5:49:1ae:207:c5:f7:207:f7:f6:119:118:92:119:92:91:40:3f:79:40:79:b9:11c:147:210:11c:210:124:122:7a:79:122:79:3f:118:121:140:118:140:92:b8:24a:252:b8:252:b9:fd:17a:75:fd:75:78:f9:8c:a0:f9:a0:9f:81:a0:8c:81:8c:82:a1:84:83:a1:83:173:139:13e:1c8:139:1c8:20f:1ec:41:216:1ec:216:21a:1b9:1c1:1c0:1b9:1c0:1ba:1bb:1be:1b3:1bb:1b3:1f1:1be:1bd:1fa:1be:1fa:1ee:1b9:1b8:1b4:1b9:1b4:1ee:254:1b7:1ba:254:1ba:255:241:240:3d:241:3d:40:ee:ed:f2:ee:f2:f1:c2:4c:1aa:c2:1aa:1ab:1c4:c2:1ab:1c4:1ab:1ac:1cd:f4:f3:1cd:f3:156:1fc:1fb:242:1fc:242:243:f5:cf:213:f5:213:206:ce:214:213:ce:213:cf:20:1f:258:20:258:257:259:258:24:259:24:18:25a:259:18:25a:18:17:28:25a:17:28:17:2a:2c:25c:25d:2c:25d:25b:27:25b:25a:27:25a:28:259:25e:25f:259:25f:258:1d4:260:261:1d4:261:1d5:1dd:261:260:1dd:260:180:262:263:264:262:264:1d8:262:1d8:1d7:262:1d7:265:1dc:266:267:1dc:267:1da:1de:6e:6d:1de:6d:268:1d2:1d1:1da:1d2:1da:269:1d2:269:1d9:1d2:1d9:15e:266:215:1d6:266:1d6:26a:1db:19d:215:1db:215:1dc:26a:1d5:261:26a:261:26b:26b:261:1dd:26b:1dd:26c:183:26d:268:183:268:6d:268:26e:26c:268:26c:1de:1d9:269:267:1d9:267:265:26d:26f:26e:26d:26e:268:270:264:263:270:263:26f:31:47:46:31:46:32:150:14f:20c:150:20c:1a2:256:125:43:256:43:49:32:46:1ad:32:1ad:4a:142:1ed:178:142:178:143:24d:251:250:24d:250:24b:18c:77:76:18c:76:fe:205:18d:18c:205:18c:fe:1c:1b:271:1c:271:25c:258:25f:272:258:272:257:25f:273:274:25f:274:272:25c:271:274:25c:274:273:276:277:278:276:278:275:27a:27b:27c:27a:27c:279:27e:27f:280:27e:280:27d:281:282:27d:281:27d:280:284:285:286:284:286:283:277:282:288:277:288:287:28a:28b:28c:28a:28c:289:283:286:28e:283:28e:28d:28e:28b:28a:28e:28a:28d:28f:290:291:28f:291:278:291:293:294:291:294:292:295:293:291:295:291:290:277:287:28f:277:28f:278:27d:282:277:27d:277:276:280:28a:289:280:289:281:28c:296:281:28c:281:289:288:282:281:288:281:296:297:298:219:297:219:218:29a:280:27f:29a:27f:299:29a:299:27c:29a:27c:27b:29b:21b:219:29b:219:298:27a:284:283:27a:283:27b:28d:28a:280:28d:280:29a:29a:27b:283:29a:283:28d:29d:284:27a:29d:27a:29c:27e:27d:276:27e:276:29e:285:284:29d:285:29d:29f:27e:29e:1e5:27e:1e5:1e4:2a0:279:1e9:2a0:1e9:1e8:278:291:292:278:292:275:29e:297:218:29e:218:1e5:279:27c:216:279:216:1e9:1e4:217:27f:1e4:27f:27e:275:292:298:275:298:297:299:27f:217:299:217:21a:27c:299:21a:27c:21a:216:294:29b:298:294:298:292:29c:27a:279:29c:279:2a0:276:275:297:276:297:29e:1:295:290:1:290:16:14:287:288:14:288:12:287:14:15:287:15:28f:f:286:285:f:285:d:13:28b:28e:13:28e:e:288:296:10:288:10:12:11:28c:28b:11:28b:13:15:16:290:15:290:28f:d:285:29f:d:29f:2:286:f:e:286:e:28e:11:10:296:11:296:28c:260:5b:181:260:181:180:130:174:191:130:191:134:1d4:19f:19b:1d4:19b:5c:25a:25b:25e:25a:25e:259:260:1d4:5c:260:5c:5b:131:130:134:131:134:89:8b:8a:133:8b:133:177:2a2:2a3:2a4:2a2:2a4:2a1:2a6:1b:2a7:2a6:2a7:2a5:2a9:2aa:2ab:2a9:2ab:2a8:2ac:2ad:2ab:2ac:2ab:2aa:2ac:2a2:2a1:2ac:2a1:2ad:2af:2b0:2b1:2af:2b1:2ae:2b2:2b3:2a4:2b2:2a4:2a3:2b1:2b0:2b3:2b1:2b3:2b2:2af:2ae:2b5:2af:2b5:2b4:2a9:2a8:2e:2a9:2e:2d:2a6:2b6:2b7:2a6:2b7:2b5:2b9:2ba:2bb:2b9:2bb:2b8:2bd:2be:2bf:2bd:2bf:2bc:2c1:2c2:2c3:2c1:2c3:2c0:2c5:2c6:2c7:2c5:2c7:2c4:2c9:2ca:2cb:2c9:2cb:2c8:2cd:2ce:2cf:2cd:2cf:2cc:2c8:2d0:2d1:2c8:2d1:2c9:2c9:2d1:2b9:2c9:2b9:2b8:2d3:2d4:2d5:2d3:2d5:2d2:2d7:2d8:2d9:2d7:2d9:2d6:2db:2dc:2dd:2db:2dd:2da:2df:2d8:2d7:2df:2d7:2de:2e1:2e2:2e3:2e1:2e3:2e0:2e5:2d2:2d5:2e5:2d5:2e4:2df:2de:2e7:2df:2e7:2e6:2e9:2ea:2eb:2e9:2eb:2e8:2eb:2ea:2ed:2eb:2ed:2ec:2e9:2e8:2ef:2e9:2ef:2ee:2f1:2f2:2f3:2f1:2f3:2f0:2f5:2f3:2f2:2f5:2f2:2f4:2ec:2ed:2f7:2ec:2f7:2f6:2f9:2fa:2fb:2f9:2fb:2f8:2fd:2fe:2ff:2fd:2ff:2fc:301:302:303:301:303:300:305:306:307:305:307:304:309:30a:30b:309:30b:308:306:30c:30d:306:30d:307:2bf:30e:30f:2bf:30f:2bc:2b0:2af:311:2b0:311:310:312:311:2af:312:2af:2b4:314:309:315:314:315:313:316:317:30b:316:30b:30a:319:31a:31b:319:31b:318:31d:31e:2bd:31d:2bd:31c:2bd:31e:31f:2bd:31f:2be:321:322:323:321:323:320:325:326:327:325:327:324:329:32a:32b:329:32b:328:30a:327:326:30a:326:316:323:32c:32d:323:32d:320:32f:330:331:32f:331:32e:333:32e:334:333:334:332:336:337:333:336:333:335:2c0:2c3:339:2c0:339:338:33b:33c:2ba:33b:2ba:33a:304:307:33d:304:33d:2bb:30d:303:33f:30d:33f:33e:340:33f:303:340:303:302:342:343:344:342:344:341:346:347:348:346:348:345:2d3:2d2:348:2d3:348:349:2eb:34a:34b:2eb:34b:2e8:335:34c:34d:335:34d:336:34f:332:334:34f:334:34e:34b:351:352:34b:352:350:cd:353:354:cd:354:ce:d0:351:353:d0:353:cd:355:356:2ed:355:2ed:2ea:2d8:2df:356:2d8:356:355:358:359:35a:358:35a:357:35c:35d:35e:35c:35e:35b:35f:360:35d:35f:35d:35c:362:363:35e:362:35e:361:365:366:367:365:367:364:362:e4:e5:362:e5:363:369:360:35f:369:35f:368:367:369:368:367:368:364:36b:36c:36d:36b:36d:36a:343:342:350:343:350:352:36f:341:370:36f:370:36e:372:373:374:372:374:371:371:370:376:371:376:375:377:34a:2eb:377:2eb:2ec:34a:377:354:34a:354:353:2f6:2f8:379:2f6:379:378:313:37a:37b:313:37b:314:37d:37e:37f:37d:37f:37c:380:35b:381:380:381:2fd:383:384:385:383:385:382:384:386:387:384:387:385:386:2a5:2a7:386:2a7:387:35e:363:388:35e:388:35b:385:107:108:385:108:382:10a:109:387:10a:387:2a7:37f:389:38a:37f:38a:37c:38b:38c:38d:38b:38d:34e:34f:34e:38d:34f:38d:38e:34f:38e:390:34f:390:38f:114:113:38a:114:38a:389:113:115:38c:113:38c:38a:2e5:345:348:2e5:348:2d2:392:393:394:392:394:391:393:392:2e7:393:2e7:2de:396:2e4:2c5:396:2c5:395:394:393:398:394:398:397:39a:39b:39c:39a:39c:399:2c4:39d:395:2c4:395:2c5:395:39d:39f:395:39f:39e:125:2c8:2cb:125:2cb:126:3a1:3a2:3a3:3a1:3a3:3a0:3a5:3a6:3a7:3a5:3a7:3a4:3a9:3aa:3ab:3a9:3ab:3a8:311:3ac:3ad:311:3ad:310:32c:3af:3b0:32c:3b0:3ae:3b1:31c:2bd:3b1:2bd:2bc:3b2:3b3:31d:3b2:31d:31c:3b5:369:367:3b5:367:3b4:30f:326:325:30f:325:3b6:3b7:3b8:318:3b7:318:31b:3ba:319:318:3ba:318:3b9:3bc:3bd:3be:3bc:3be:3bb:2d7:398:393:2d7:393:2de:3bf:3c0:31b:3bf:31b:31a:392:391:39c:392:39c:39b:149:3c1:3c2:149:3c2:14a:342:3c3:2ef:342:2ef:350:36f:347:346:36f:346:3c3:32c:3ae:3c4:32c:3c4:32d:312:2b4:2b7:312:2b7:3c5:3c7:3c8:3c9:3c7:3c9:3c6:2b8:2bb:33d:2b8:33d:3bb:3ca:2bf:2be:3ca:2be:305:3cc:31f:31e:3cc:31e:3cb:375:156:158:375:158:3cd:3ce:3cf:372:3ce:372:3cd:3d1:3d2:3d3:3d1:3d3:3d0:3d5:358:357:3d5:357:3d4:307:30d:33e:307:33e:33d:2ee:3d6:3d7:2ee:3d7:2e9:2f9:3d8:3d9:2f9:3d9:2fa:3da:3db:34d:3da:34d:34c:2f0:2f3:3dd:2f0:3dd:3dc:3d1:3d0:3df:3d1:3df:3de:3d2:3d1:36a:3d2:36a:3e0:35f:3e1:330:35f:330:368:322:3e3:3a5:322:3a5:3e2:3a2:3a1:2cc:3a2:2cc:2cf:33c:33b:3e4:33c:3e4:3ca:3e6:3b6:325:3e6:325:3e5:3b6:3b1:2bc:3b6:2bc:30f:3e8:3e9:3ea:3e8:3ea:3e7:2b3:3a8:3ab:2b3:3ab:2a4:3a8:2b3:2b0:3a8:2b0:310:37a:313:3ec:37a:3ec:3eb:2c9:2b8:3bb:2c9:3bb:3be:33e:33f:3ed:33e:3ed:3bc:3ee:3ef:389:3ee:389:37f:38c:115:17b:38c:17b:38d:3f1:3f2:3f3:3f1:3f3:3f0:3f5:2f4:2f2:3f5:2f2:3f4:2f2:2f1:3f6:2f2:3f6:3f4:3dd:2f3:2f5:3dd:2f5:3f7:33a:328:32b:33a:32b:33b:3e3:322:321:3e3:321:3f8:32f:364:368:32f:368:330:2d6:396:395:2d6:395:39e:38e:38d:17b:38e:17b:185:390:38e:185:390:185:186:312:3c5:3eb:312:3eb:3ec:3f9:323:322:3f9:322:3e2:3fb:3f9:3e2:3fb:3e2:3fa:334:3fc:38b:334:38b:34e:3a4:3fa:3e2:3a4:3e2:3a5:3fe:3ff:400:3fe:400:3fd:401:331:330:401:330:3e1:3fc:331:401:3fc:401:37d:38b:3fc:37d:38b:37d:37c:2ed:356:402:2ed:402:2f7:308:3e8:3e7:308:3e7:403:3f9:3af:32c:3f9:32c:323:404:405:195:404:195:194:405:3af:3f9:405:3f9:3fb:2ad:2a1:3c4:2ad:3c4:3ae:2ad:3ae:3b0:2ad:3b0:2ab:2ab:3b0:404:2ab:404:2a8:406:381:35b:406:35b:388:3ef:406:198:3ef:198:197:2fe:2fd:381:2fe:381:3ee:38b:37c:38a:38b:38a:38c:3a9:3e7:3ea:3a9:3ea:3aa:3df:3d0:408:3df:408:407:40a:2e3:2e2:40a:2e2:409:40b:40c:40d:40b:40d:40a:40e:1a0:1a2:40e:1a2:3c7:3c6:2cf:2ce:3c6:2ce:40f:411:412:413:411:413:410:411:410:415:411:415:414:413:416:417:413:417:410:373:415:418:373:418:374:419:41a:2d1:419:2d1:2d0:2cd:41a:40f:2cd:40f:2ce:379:2f8:2fb:379:2fb:41b:3ce:41c:41d:3ce:41d:3cf:41d:41e:412:41d:412:411:420:421:422:420:422:41f:41f:422:3f2:41f:3f2:3f1:339:423:424:339:424:338:424:423:426:424:426:425:1bc:1bb:428:1bc:428:427:3bb:33d:33e:3bb:33e:3bc:357:34d:3db:357:3db:3d4:35a:365:337:35a:337:336:42a:42b:42c:42a:42c:429:413:42b:42d:413:42d:416:2d4:2d3:416:2d4:416:42d:2d5:2c6:2c5:2d5:2c5:2e4:39b:39a:2da:39b:2da:2dd:2e6:402:356:2e6:356:2df:36e:374:418:36e:418:42e:347:42e:349:347:349:348:36e:42e:347:36e:347:36f:2d8:355:3d7:2d8:3d7:2d9:39b:2dd:2e7:39b:2e7:392:419:1c5:1a0:419:1a0:40e:3c9:3a6:3a3:3c9:3a3:3a2:2c2:42f:430:2c2:430:2c3:358:3d5:432:358:432:431:2dc:2db:3d9:2dc:3d9:3d8:315:3ac:3ec:315:3ec:313:403:3ad:3ac:403:3ac:315:433:434:384:433:384:383:e4:362:382:e4:382:108:384:434:435:384:435:386:435:2b6:2a5:435:2a5:386:107:385:387:107:387:109:1cd:376:344:1cd:344:1ce:367:366:436:367:436:3b4:438:439:408:438:408:437:2e1:2e0:3f4:2e1:3f4:3f6:36b:36a:3d1:36b:3d1:3de:36d:43a:3e0:36d:3e0:36a:3c9:3a2:2cf:3c9:2cf:3c6:3c9:3c8:3a7:3c9:3a7:3a6:43c:40d:43d:43c:43d:43b:3d2:3e0:43f:3d2:43f:43e:43e:440:3d3:43e:3d3:3d2:438:442:443:438:443:441:3f5:444:445:3f5:445:2f4:40b:40a:409:40b:409:446:399:446:409:399:409:39a:2da:2e2:2e1:2da:2e1:2db:3f6:2f1:2fa:3f6:2fa:3d9:36c:36b:3db:36c:3db:3da:3a0:328:33a:3a0:33a:3a1:40f:40e:3c7:40f:3c7:3c6:2ba:33c:304:2ba:304:2bb:2a4:3ab:3c4:2a4:3c4:2a1:3e8:32a:329:3e8:329:3e9:382:362:361:382:361:383:383:361:447:383:447:433:359:366:365:359:365:35a:3b4:436:3b2:3b4:3b2:448:333:337:32f:333:32f:32e:38f:449:332:38f:332:34f:32f:337:365:32f:365:364:377:2ec:2f6:377:2f6:378:2f9:2f8:2f6:2f9:2f6:2f7:355:2ea:2e9:355:2e9:3d7:41b:3dc:36c:41b:36c:3da:36d:36c:3dc:36d:3dc:3dd:3dd:3f7:43a:3dd:43a:36d:2d6:2d9:44a:2d6:44a:396:44c:44d:44e:44c:44e:44b:44f:1e8:126:44f:126:2cb:450:451:430:450:430:42f:321:320:3ea:321:3ea:3e9:450:452:3be:450:3be:3bd:450:3bd:453:450:453:451:420:454:428:420:428:421:1ef:3f2:422:1ef:422:1f0:1f0:422:421:1f0:421:1f1:3c2:41c:1f2:3c2:1f2:14a:1f3:1f2:41c:1f3:41c:3ce:3f2:1ef:1f4:3f2:1f4:3f3:455:41e:3c2:455:3c2:3c1:1f3:3ce:3cd:1f3:3cd:158:452:450:42f:452:42f:456:42f:2c2:44e:42f:44e:456:44b:44e:2c2:44b:2c2:2c1:2c1:3f0:457:2c1:457:44b:3f3:1f4:1f9:3f3:1f9:458:42b:413:412:42b:412:42c:149:1bc:427:149:427:3c1:42c:455:459:42c:459:429:45b:2d4:42d:45b:42d:45a:2e8:34b:350:2e8:350:2ef:1fd:352:351:1fd:351:d0:351:34b:34a:351:34a:353:1ce:344:343:1ce:343:1fe:352:1fd:1fe:352:1fe:343:31b:3c0:3cb:31b:3cb:3b7:3c0:45c:3cc:3c0:3cc:3cb:300:30c:3cc:300:3cc:45c:2cc:3a1:33a:2cc:33a:2ba:321:3e9:329:321:329:3f8:320:32d:3aa:320:3aa:3ea:32d:3c4:3ab:32d:3ab:3aa:45d:399:39c:45d:39c:3ba:446:45e:45f:446:45f:40b:40b:45f:441:40b:441:40c:45e:446:399:45e:399:45d:346:345:3d6:346:3d6:2ee:3c3:346:2ee:3c3:2ee:2ef:2d9:3d7:3d6:2d9:3d6:44a:2dc:2e6:2e7:2dc:2e7:2dd:2dc:3d8:402:2dc:402:2e6:3d8:2f9:2f7:3d8:2f7:402:316:326:30f:316:30f:30e:3a3:3a6:3a5:3a3:3a5:3e3:3a3:3e3:3f8:3a3:3f8:3a0:3e4:33b:32b:3e4:32b:317:461:35d:360:461:360:460:380:462:35c:380:35c:35b:400:3ff:401:400:401:3e1:400:35c:462:400:462:3fd:464:377:378:464:378:463:3b7:3cb:31e:3b7:31e:31d:41a:419:40e:41a:40e:40f:2a8:404:194:2a8:194:2e:404:3b0:3af:404:3af:405:3fa:3a4:209:3fa:209:208:20a:3fb:3fa:20a:3fa:208:3a7:20b:209:3a7:209:3a4:3a7:3c8:20c:3a7:20c:20b:3b9:318:3b8:3b9:3b8:431:431:432:465:431:465:3b9:408:439:466:408:466:407:408:3d0:3d3:408:3d3:437:431:467:359:431:359:358:359:467:436:359:436:366:197:114:389:197:389:3ef:3ee:381:406:3ee:406:3ef:336:34d:357:336:357:35a:3f6:3d9:2db:3f6:2db:2e1:407:432:3d5:407:3d5:3df:2da:39a:409:2da:409:2e2:3de:3d4:3db:3de:3db:36b:2fb:2f0:3dc:2fb:3dc:41b:2fb:2fa:2f1:2fb:2f1:2f0:3d4:3de:3df:3d4:3df:3d5:45e:466:439:45e:439:45f:466:465:432:466:432:407:45f:439:438:45f:438:441:3da:34c:379:3da:379:41b:335:333:332:335:332:449:3fe:2fc:37e:3fe:37e:3ff:3ff:37e:37d:3ff:37d:401:39e:398:2d7:39e:2d7:2d6:397:398:39e:397:39e:39f:468:45c:3c0:468:3c0:3bf:305:2be:31f:305:31f:306:31f:3cc:30c:31f:30c:306:304:33c:3ca:304:3ca:305:2bf:3ca:3e4:2bf:3e4:30e:303:30d:30c:303:30c:300:317:316:30e:317:30e:3e4:32b:32a:30b:32b:30b:317:403:315:309:403:309:308:39f:39d:301:39f:301:468:2c6:2d5:2d4:2c6:2d4:45b:3ba:3b9:465:3ba:465:45d:45d:465:466:45d:466:45e:300:45c:468:300:468:301:388:363:e5:388:e5:211:3b4:448:3e6:3b4:3e6:3b5:460:360:369:460:369:3b5:461:460:3e5:461:3e5:469:469:447:361:469:361:461:35d:461:361:35d:361:35e:433:37a:3eb:433:3eb:434:434:3eb:3c5:434:3c5:435:3c5:2b7:2b6:3c5:2b6:435:433:447:37b:433:37b:37a:37f:37e:2fc:37f:2fc:2ff:3fc:334:32e:3fc:32e:331:463:34c:335:463:335:449:464:463:449:464:449:38f:46a:464:38f:46a:38f:390:214:46a:390:214:390:186:3cd:372:371:3cd:371:375:341:344:376:341:376:370:342:341:36f:342:36f:3c3:42b:42a:45a:42b:45a:42d:329:328:3a0:329:3a0:3f8:3fb:20a:195:3fb:195:405:46b:43d:40d:46b:40d:40c:46c:44f:2cb:46c:2cb:2ca:456:44e:44d:456:44d:46d:457:458:46f:457:46f:46e:452:456:46d:452:46d:470:452:2ca:2c9:452:2c9:3be:458:1f9:21b:458:21b:46f:373:372:3cf:373:3cf:414:2c0:3f1:3f0:2c0:3f0:2c1:41c:3c2:41e:41c:41e:41d:41f:338:424:41f:424:420:3f1:2c0:338:3f1:338:41f:429:459:454:429:454:425:42c:412:41e:42c:41e:455:3f0:3f3:458:3f0:458:457:455:3c1:427:455:427:459:46e:44c:44b:46e:44b:457:3b3:3b8:3b7:3b3:3b7:31d:3bf:31a:394:3bf:394:397:44a:3d6:345:44a:345:2e5:44a:2e5:2e4:44a:2e4:396:410:417:418:410:418:415:411:414:3cf:411:3cf:41d:436:467:3b3:436:3b3:3b2:3b5:3e6:3e5:3b5:3e5:460:3b2:31c:3b1:3b2:3b1:448:3e6:448:3b1:3e6:3b1:3b6:3e5:325:324:3e5:324:469:447:469:324:447:324:37b:388:211:198:388:198:406:400:3e1:35f:400:35f:35c:472:473:474:472:474:471:475:476:471:475:471:474:477:478:476:477:476:475:479:47a:478:479:478:477:47b:47c:47a:47b:47a:479:47d:47e:47c:47d:47c:47b:47f:480:47e:47f:47e:47d:482:483:484:482:484:481:485:486:483:485:483:482:487:488:476:487:476:478:489:487:478:489:478:47a:48a:489:47a:48a:47a:47c:48b:48a:47c:48b:47c:47e:47e:480:48c:47e:48c:48b:484:483:48e:484:48e:48d:48f:48e:483:48f:483:486:491:48f:486:491:486:490:492:493:494:492:494:473:495:496:475:495:475:474:475:496:497:475:497:477:498:479:477:498:477:497:499:47d:47b:499:47b:498:499:49a:47f:499:47f:47d:481:49b:49c:481:49c:482:485:482:49c:485:49c:49d:485:49d:49e:485:49e:490:491:490:49e:491:49e:49f:476:488:472:476:472:471:492:4a1:4a2:492:4a2:4a0:492:4a0:4a3:492:4a3:493:4a3:4a4:494:4a3:494:493:494:4a4:474:494:474:473:489:48a:48b:489:48b:4a5:4a5:48b:48c:4a5:48c:4a6:48d:48c:480:48d:480:484:480:47f:481:480:481:484:49b:481:47f:49b:47f:49a:4a5:488:487:4a5:487:489:4a2:4a6:48c:4a2:48c:48d:473:472:4a1:473:4a1:492:491:4a4:4a3:491:4a3:48f:4a2:48d:48e:4a2:48e:4a0:474:4a4:4a7:474:4a7:495:4a7:4a4:491:4a7:491:49f:4a8:4a9:49b:4a8:49b:49a:4a8:49a:499:4a8:499:4aa:49c:4a9:430:49c:430:451:49c:451:453:49c:453:49d:4aa:499:498:4aa:498:45a:426:4aa:45a:426:45a:42a:2c3:430:4a9:2c3:4a9:339:339:4a9:4a8:339:4a8:423:495:4a7:340:495:340:2c7:49f:49e:3ed:49f:3ed:33f:4a3:4a0:48e:4a3:48e:48f:2c6:45b:497:2c6:497:496:49e:49d:453:49e:453:3ed:1c5:419:2d0:1c5:2d0:256:463:378:379:463:379:34c:394:31a:319:394:319:391:2c7:340:302:2c7:302:2c4:397:39f:468:397:468:3bf:39d:2c4:302:39d:302:301:391:319:3ba:391:3ba:39c:33f:340:4a7:33f:4a7:49f:37f:2ff:2fe:37f:2fe:3ee:37b:324:327:37b:327:314:30a:309:314:30a:314:327:32a:3e8:308:32a:308:30b:3b3:467:431:3b3:431:3b8:452:470:46c:452:46c:2ca:425:426:42a:425:42a:429:1bb:1f1:421:1bb:421:428:428:454:459:428:459:427:425:454:420:425:420:424:4a8:4aa:426:4a8:426:423:495:2c7:2c6:495:2c6:496:370:371:374:370:374:36e:349:417:416:349:416:2d3:42e:418:417:42e:417:349:1cd:156:375:1cd:375:376:45a:498:497:45a:497:45b:377:464:46a:377:46a:354:ce:354:46a:ce:46a:214:2a9:257:4ab:2a9:4ab:2aa:4ac:2a2:2ac:4ac:2ac:4ab:4ad:2a3:2a2:4ad:2a2:4ac:2b1:2b2:2a3:2b1:2a3:4ad:2b5:4af:4b0:2b5:4b0:4ae:2ae:2b1:4ad:2ae:4ad:4af:4ac:4ab:4b2:4ac:4b2:4b1:43c:43b:4b4:43c:4b4:4b3:444:3f5:4b3:444:4b3:4b4:4b6:43f:4b7:4b6:4b7:4b5:4b6:4b8:43e:4b6:43e:43f:443:442:4ba:443:4ba:4b9:445:4bb:2f5:445:2f5:2f4:437:4bc:442:437:442:438:437:3d3:440:437:440:4bc:4b9:4bd:43d:4b9:43d:46b:441:443:46b:441:46b:40c:4bd:4be:4b4:4bd:4b4:43b:4be:4bf:444:4be:444:4b4:3f7:2f5:4bb:3f7:4bb:4c0:4bb:445:4bf:4bb:4bf:4c1:440:4b8:4ba:440:4ba:4bc:4c0:4bb:4c1:4c0:4c1:4c2:4c3:4c2:4b5:4c3:4b5:4b7:2ba:2b9:2cd:2ba:2cd:2cc:3c7:1a2:20c:3c7:20c:3c8:256:2d0:2c8:256:2c8:125:2b9:2d1:41a:2b9:41a:2cd:3bd:3bc:3ed:3bd:3ed:453:4a2:4a1:4a5:4a2:4a5:4a6:3fe:380:2fd:3fe:2fd:2fc:462:380:3fe:462:3fe:3fd:2a6:4ae:271:2a6:271:1b:4ab:257:272:4ab:272:4b2:4b2:272:274:4b2:274:4c4:4ae:4c4:274:4ae:274:271:4c6:4c7:4c8:4c6:4c8:4c5:4ca:4cb:4cc:4ca:4cc:4c9:4ce:4cf:4d0:4ce:4d0:4cd:4d2:4d0:4cf:4d2:4cf:4d1:4d4:4d5:4d6:4d4:4d6:4d3:4c5:4d7:4d8:4c5:4d8:4d1:4da:4db:4dc:4da:4dc:4d9:4d5:4dd:4de:4d5:4de:4d6:4de:4dd:4da:4de:4da:4d9:4e0:4c8:4e1:4e0:4e1:4df:4e1:4e2:294:4e1:294:293:295:4df:4e1:295:4e1:293:4c5:4c8:4e0:4c5:4e0:4d7:4cf:4c6:4c5:4cf:4c5:4d1:4d0:4d2:4db:4d0:4db:4da:4dc:4db:4d2:4dc:4d2:4e3:4d8:4e3:4d2:4d8:4d2:4d1:4e5:46e:46f:4e5:46f:4e4:4e6:4e7:4cd:4e6:4cd:4d0:4e6:4c9:4cc:4e6:4cc:4e7:29b:4e4:46f:29b:46f:21b:4ca:4c9:4d5:4ca:4d5:4d4:4dd:4e6:4d0:4dd:4d0:4da:4e6:4dd:4d5:4e6:4d5:4c9:29d:29c:4ca:29d:4ca:4d4:4ce:4e8:4c6:4ce:4c6:4cf:4d3:29f:29d:4d3:29d:4d4:4ce:44d:44c:4ce:44c:4e8:2a0:1e8:44f:2a0:44f:4cb:4c8:4c7:4e2:4c8:4e2:4e1:4e8:44c:46e:4e8:46e:4e5:4cb:44f:46c:4cb:46c:4cc:44d:4ce:4cd:44d:4cd:46d:4c7:4e5:4e4:4c7:4e4:4e2:4e7:470:46d:4e7:46d:4cd:4cc:46c:470:4cc:470:4e7:294:4e2:4e4:294:4e4:29b:29c:2a0:4cb:29c:4cb:4ca:4c6:4e8:4e5:4c6:4e5:4c7:1:c:4df:1:4df:295:a:8:4d8:a:4d8:4d7:4d7:4e0:b:4d7:b:a:5:3:4d3:5:4d3:4d6:9:4:4de:9:4de:4d9:4d8:8:6:4d8:6:4e3:7:9:4d9:7:4d9:4dc:b:4e0:4df:b:4df:c:3:2:29f:3:29f:4d3:4d6:4de:4:4d6:4:5:7:4dc:4e3:7:4e3:6:4b3:3f5:3f4:4b3:3f4:2e0:3a9:3ad:403:3a9:403:3e7:43c:2e3:40a:43c:40a:40d:4ad:4ac:4b1:4ad:4b1:4af:4b3:2e0:2e3:4b3:2e3:43c:3a8:310:3ad:3a8:3ad:3a9:312:3ec:3ac:312:3ac:311:1d3:264:183:264:270:183:26d:183:270:25c:2c:1c:1d8:264:1d3:1d:1c:2f:2b:30:2c:1e:10a:1b:1a8:ef:1a9:1d3:16b:1d8:231:230:23c:225:227:243:247:253:246:1f:24:258:27:2c:25b:20:257:2d:1d9:265:1d7:1dd:1de:26c:1da:267:269:4e9:266:26a:4e9:26c:26e:4e9:26a:26b:4e9:265:267:266:4e9:267:26e:26f:4e9:4e9:26f:263:270:26f:26d:1d5:26a:1d6:266:1dc:215:262:4e9:263:265:4e9:262:26c:4e9:26b:21d:250:232:21d:24b:250:273:25f:25d:273:25d:25c:25d:25e:25b:25f:25e:25d:4b7:43a:3f7:4c3:4b7:3f7:3f7:4c0:4c3:2b5:4ae:2a6:4b7:43f:43a:2a6:2a5:2b6:2b7:2b4:2b5:10a:2a7:1b:373:414:415:3e0:43a:43f:486:485:490:47b:479:498:4a9:49c:49b:2ac:2aa:4ab:2b5:2ae:4af:257:2a9:2d:4b8:440:43e:445:444:4bf:4ba:442:4bc:4b9:4ea:4bd:4bf:4ea:4c1:4bd:4ea:4be:4b8:4ea:4ba:4ea:4b9:4ba:4c2:4c1:4ea:4c2:4ea:4b5:4c2:4c3:4c0:4bd:43b:43d:443:4b9:46b:4ea:4b6:4b5:4ea:4b8:4b6:4ea:4bf:4be:4a5:472:488:4a1:472:4a5:4b2:4c4:4b0:4b0:4c4:4ae:4b1:4b0:4af:4b1:4b2:4b0 cx="0.999:0.265:0.377:;1.000:0.000:1.287:;0.883:0.026:1.307:;0.618:0.109:1.221:;0.753:0.057:1.276:;0.344:0.281:0.891:;0.390:0.213:1.020:;0.338:0.368:0.756:;0.488:0.155:1.128:;0.391:0.430:0.584:;0.573:0.350:0.433:;0.799:0.279:0.367:;1.117:0.026:1.307:;1.382:0.109:1.221:;1.248:0.057:1.276:;1.656:0.281:0.891:;1.610:0.213:1.020:;1.662:0.369:0.756:;1.512:0.155:1.128:;1.609:0.431:0.584:;1.425:0.350:0.433:;1.199:0.279:0.367:;1.153:0.859:1.477:;1.135:0.853:1.488:;1.131:0.868:1.499:;1.147:0.865:1.490:;1.001:0.947:1.506:;1.075:0.953:1.500:;1.070:0.900:1.550:;1.030:0.903:1.554:;1.075:0.864:1.523:;1.035:0.872:1.535:;1.039:0.890:1.551:;1.073:0.885:1.538:;1.106:0.874:1.515:;1.107:0.856:1.505:;1.160:0.869:1.485:;1.156:0.876:1.487:;1.158:0.892:1.468:;1.164:0.873:1.470:;1.155:0.865:1.486:;1.161:0.864:1.476:;1.143:0.881:1.500:;1.132:0.927:1.476:;1.000:0.875:1.539:;0.999:0.889:1.554:;1.100:0.894:1.538:;1.126:0.884:1.516:;1.251:0.724:1.380:;1.222:0.664:1.330:;1.275:0.699:1.248:;1.308:0.760:1.292:;1.332:0.958:1.413:;1.319:1.007:1.451:;1.287:0.974:1.482:;1.297:0.924:1.454:;1.358:0.840:0.777:;1.304:0.855:0.656:;1.296:0.945:0.642:;1.357:0.937:0.757:;1.451:1.331:1.048:;1.439:1.336:1.131:;1.447:1.226:1.139:;1.456:1.205:1.083:;1.197:0.589:1.138:;1.205:0.647:1.208:;1.102:0.581:1.250:;1.100:0.524:1.208:;1.150:0.628:1.431:;1.176:0.638:1.392:;1.196:0.674:1.427:;1.155:0.651:1.463:;1.089:0.608:1.304:;1.159:0.636:1.305:;1.456:1.509:0.936:;1.432:1.648:0.958:;1.417:1.612:1.082:;1.442:1.483:1.048:;1.345:1.433:1.399:;1.372:1.383:1.354:;1.388:1.404:1.307:;1.355:1.467:1.357:;1.305:1.339:1.458:;1.299:1.320:1.457:;1.313:1.305:1.428:;1.324:1.316:1.429:;1.332:1.398:1.430:;1.354:1.360:1.390:;1.304:1.292:1.432:;1.293:1.310:1.453:;1.283:1.292:1.456:;1.292:1.282:1.435:;1.397:1.565:1.193:;1.423:1.456:1.145:;1.318:1.365:1.449:;1.341:1.338:1.418:;1.243:1.479:1.494:;1.250:1.546:1.466:;1.179:1.560:1.512:;1.170:1.478:1.536:;1.162:1.410:1.547:;1.235:1.427:1.517:;1.272:1.634:1.422:;1.197:1.657:1.473:;1.187:1.313:1.511:;1.190:1.325:1.514:;1.146:1.313:1.509:;1.145:1.300:1.502:;1.144:1.300:1.494:;1.187:1.311:1.506:;1.158:1.365:1.529:;1.217:1.383:1.516:;1.194:1.332:1.516:;1.204:1.350:1.517:;1.156:1.334:1.520:;1.152:1.320:1.514:;1.043:1.072:1.618:;1.048:1.087:1.593:;1.078:1.082:1.603:;1.057:1.075:1.621:;1.448:1.131:1.150:;1.432:1.159:1.216:;1.423:1.077:1.237:;1.429:1.035:1.167:;1.365:0.947:1.316:;1.327:0.895:1.373:;1.313:0.827:1.334:;1.368:0.873:1.269:;1.204:0.868:1.524:;1.180:0.864:1.525:;1.183:0.851:1.517:;1.204:0.847:1.515:;1.394:1.006:1.269:;1.402:0.941:1.209:;1.261:0.900:1.484:;1.250:0.945:1.503:;1.159:0.864:1.498:;1.155:0.865:1.503:;1.145:0.866:1.515:;1.171:0.880:1.538:;1.159:0.872:1.535:;1.168:0.862:1.524:;1.232:0.849:1.497:;1.231:0.883:1.507:;1.366:1.222:1.363:;1.343:1.236:1.392:;1.326:1.203:1.415:;1.359:1.179:1.383:;1.352:1.049:1.417:;1.322:1.091:1.450:;1.295:1.049:1.483:;1.367:1.003:1.370:;1.139:0.812:1.556:;1.162:0.822:1.536:;1.154:0.845:1.536:;1.136:0.844:1.558:;1.220:0.918:1.519:;1.202:0.951:1.528:;1.176:0.919:1.546:;1.193:0.894:1.534:;1.199:0.830:1.510:;1.190:0.812:1.515:;1.207:0.787:1.493:;1.222:0.817:1.490:;1.125:0.867:1.551:;1.144:0.861:1.530:;1.135:1.119:1.545:;1.120:1.150:1.554:;1.097:1.171:1.569:;1.113:1.137:1.570:;1.088:1.218:1.556:;1.065:1.232:1.569:;1.073:1.185:1.585:;1.116:1.191:1.549:;1.111:1.229:1.525:;1.086:1.255:1.530:;1.301:1.037:0.612:;1.367:1.038:0.730:;1.272:0.800:1.400:;1.246:0.804:1.453:;1.223:0.757:1.451:;1.364:0.803:1.213:;1.411:0.875:1.141:;1.432:0.997:1.091:;1.449:1.111:1.089:;1.065:1.777:1.433:;1.133:1.771:1.419:;1.143:1.869:1.301:;1.069:1.877:1.315:;1.305:1.809:1.220:;1.289:1.724:1.336:;1.355:1.661:1.265:;1.372:1.728:1.149:;1.382:1.777:1.012:;1.097:1.471:1.558:;1.111:1.565:1.534:;1.100:1.278:1.511:;1.110:1.249:1.504:;1.044:1.241:1.586:;1.052:1.194:1.604:;1.053:1.565:1.542:;1.124:1.668:1.499:;1.060:1.671:1.509:;1.047:1.466:1.561:;1.000:1.463:1.559:;1.000:1.388:1.563:;1.035:1.389:1.561:;1.001:1.564:1.544:;1.296:1.427:1.471:;1.302:1.465:1.451:;1.190:1.181:1.501:;1.186:1.209:1.492:;1.142:1.223:1.501:;1.147:1.195:1.518:;1.112:1.012:1.563:;1.111:1.040:1.566:;1.058:1.042:1.578:;1.066:0.992:1.597:;1.148:1.044:1.537:;1.145:1.063:1.538:;1.027:0.986:1.602:;1.027:0.963:1.622:;1.088:0.954:1.601:;1.183:1.147:1.519:;1.149:1.165:1.537:;1.147:1.131:1.543:;1.177:1.112:1.532:;1.000:0.956:1.618:;1.000:0.981:1.601:;1.165:1.077:1.531:;1.149:1.098:1.536:;1.116:1.273:1.495:;1.119:1.263:1.494:;1.121:1.269:1.481:;1.118:1.273:1.484:;1.225:1.848:1.271:;1.231:1.918:1.121:;1.146:1.944:1.150:;1.242:1.946:0.814:;1.156:1.976:0.817:;1.147:1.981:0.982:;1.232:1.948:0.960:;1.068:1.995:0.990:;1.068:1.955:1.163:;1.089:1.384:1.555:;1.111:1.336:1.529:;1.123:1.311:1.513:;1.147:0.888:1.556:;1.159:0.901:1.558:;1.094:1.087:1.616:;1.101:1.119:1.616:;1.067:1.122:1.646:;1.056:1.083:1.641:;1.080:1.082:1.568:;1.034:1.056:1.595:;1.085:0.896:1.607:;1.083:0.933:1.613:;1.028:0.944:1.638:;1.032:0.903:1.628:;1.079:0.878:1.580:;1.033:0.883:1.594:;1.022:1.017:1.586:;0.999:0.904:1.626:;0.999:0.940:1.637:;0.998:0.884:1.594:;1.000:0.901:1.554:;1.029:1.085:1.665:;1.035:1.125:1.666:;1.037:1.159:1.648:;1.065:1.154:1.629:;1.028:1.200:1.621:;1.022:1.246:1.598:;1.043:1.281:1.557:;1.022:1.287:1.567:;1.000:1.126:1.674:;0.999:1.082:1.675:;1.000:1.161:1.656:;1.367:1.315:1.364:;1.347:1.303:1.394:;1.344:1.267:1.384:;1.372:1.267:1.353:;1.402:1.429:1.234:;1.422:1.336:1.207:;1.393:1.264:1.314:;1.387:1.326:1.325:;1.327:1.296:1.409:;1.316:1.291:1.419:;1.308:1.275:1.423:;1.324:1.272:1.407:;1.429:1.244:1.204:;1.407:1.332:1.277:;1.411:1.258:1.266:;0.999:0.543:1.290:;0.999:0.479:1.266:;1.154:0.696:1.500:;1.193:0.717:1.473:;1.186:0.758:1.510:;1.149:0.736:1.525:;1.110:0.725:1.546:;1.099:0.767:1.560:;1.056:0.772:1.570:;1.066:0.730:1.564:;1.155:0.857:1.518:;1.159:0.857:1.513:;1.155:0.862:1.502:;1.149:0.862:1.506:;1.160:0.862:1.517:;1.162:0.858:1.512:;1.094:0.871:1.582:;1.109:0.874:1.532:;1.078:0.882:1.557:;1.265:1.015:1.502:;1.280:1.127:1.471:;1.263:1.089:1.494:;1.188:1.051:1.529:;1.208:1.087:1.523:;1.232:0.983:1.518:;1.304:1.165:1.443:;1.343:1.133:1.418:;1.314:1.251:1.418:;1.291:1.225:1.444:;1.355:0.806:1.028:;1.389:0.820:1.075:;1.337:0.749:1.156:;1.294:0.720:1.105:;1.389:1.153:1.345:;1.392:1.206:1.320:;1.127:1.567:0.350:;1.001:1.563:0.339:;1.001:1.724:0.394:;1.119:1.726:0.404:;1.211:1.755:1.388:;1.134:0.867:1.515:;1.131:0.866:1.530:;1.067:0.674:1.552:;1.066:0.625:1.505:;1.117:0.635:1.490:;1.117:0.681:1.529:;1.288:0.865:1.425:;1.394:1.054:1.332:;1.375:1.097:1.380:;1.001:2.000:0.993:;1.073:1.994:0.817:;1.001:1.999:0.818:;1.179:1.936:0.669:;1.084:1.953:0.662:;1.142:1.271:1.486:;1.140:1.267:1.491:;1.176:1.259:1.501:;1.175:1.263:1.496:;1.182:1.230:1.496:;1.140:1.241:1.495:;1.337:1.588:1.357:;1.312:1.518:1.416:;1.260:1.350:1.495:;1.251:1.331:1.496:;1.114:1.256:1.496:;1.111:1.277:1.499:;1.125:1.293:1.500:;1.125:1.282:1.490:;1.139:1.255:1.497:;1.177:1.246:1.501:;1.122:1.272:1.477:;1.150:1.085:1.549:;1.143:0.774:1.545:;1.106:0.803:1.577:;1.258:0.853:1.465:;1.210:1.019:1.526:;1.181:0.984:1.532:;1.173:0.831:1.522:;1.180:0.841:1.515:;1.169:0.850:1.517:;1.163:0.846:1.523:;1.139:0.871:1.545:;1.152:0.866:1.527:;1.416:0.929:1.034:;1.022:1.052:1.640:;1.036:1.062:1.628:;1.000:1.202:1.628:;1.087:0.951:0.510:;1.192:0.947:0.553:;1.192:0.865:0.571:;1.085:0.870:0.536:;1.236:1.310:1.496:;1.238:1.312:1.498:;1.245:1.325:1.496:;1.121:1.282:1.477:;1.173:0.793:1.528:;1.000:1.248:1.604:;1.000:1.288:1.572:;1.108:0.839:1.588:;1.061:0.834:1.620:;1.063:0.800:1.595:;1.089:1.151:1.600:;1.122:1.073:1.596:;1.099:1.072:1.585:;1.108:1.060:1.584:;1.134:1.055:1.576:;1.133:1.108:1.580:;1.275:1.384:1.486:;1.171:0.855:1.517:;1.046:0.870:1.612:;1.039:0.887:1.575:;0.998:0.888:1.580:;0.996:0.868:1.618:;1.019:1.035:1.602:;0.999:1.048:1.644:;1.000:1.035:1.599:;1.222:1.247:1.497:;1.218:1.258:1.498:;1.293:1.279:1.430:;1.303:1.282:1.427:;1.285:1.277:1.435:;1.289:1.276:1.437:;1.290:1.280:1.428:;1.000:0.616:1.444:;1.065:0.616:1.441:;0.999:0.636:1.502:;1.117:0.618:1.436:;1.364:1.713:0.532:;1.322:1.833:0.607:;1.377:1.821:0.735:;1.427:1.698:0.680:;1.272:1.910:0.704:;1.310:1.901:0.789:;1.442:1.677:0.825:;1.389:1.807:0.872:;1.313:1.895:0.921:;1.128:0.624:1.378:;1.072:0.609:1.377:;1.126:1.302:1.506:;1.102:1.861:0.513:;1.214:1.850:0.537:;1.247:1.723:0.441:;1.105:1.117:0.400:;1.222:1.118:0.445:;1.201:1.027:0.511:;1.094:1.027:0.461:;1.391:1.144:0.696:;1.331:1.130:0.555:;1.361:1.250:0.509:;1.424:1.258:0.667:;1.001:1.239:0.345:;1.001:1.394:0.325:;1.126:1.398:0.335:;1.115:1.240:0.354:;1.452:1.548:0.652:;1.450:1.396:0.649:;1.383:1.402:0.488:;1.385:1.562:0.494:;1.464:1.529:0.804:;1.312:1.866:1.072:;1.000:0.593:1.377:;1.374:0.817:0.885:;1.389:0.921:0.858:;1.247:1.198:1.476:;1.229:1.231:1.490:;1.121:0.883:1.574:;1.126:0.910:1.583:;1.111:0.872:1.555:;1.001:1.960:1.167:;1.001:1.881:1.321:;1.224:1.124:1.505:;1.255:1.261:1.481:;1.252:1.264:1.478:;1.215:1.261:1.494:;1.116:1.274:1.475:;1.291:1.284:1.433:;1.296:1.300:1.423:;1.294:1.288:1.418:;1.143:1.263:1.482:;1.122:1.268:1.470:;1.172:1.257:1.490:;1.247:1.257:1.474:;1.274:1.272:1.453:;1.275:1.269:1.447:;1.234:1.331:1.491:;1.188:1.327:1.497:;1.297:1.274:1.433:;1.134:0.926:1.577:;1.237:1.053:1.515:;1.064:1.271:1.543:;1.375:1.514:1.287:;1.354:0.667:0.809:;1.349:0.724:0.666:;1.323:0.785:0.662:;1.357:0.752:0.794:;1.000:0.419:1.237:;1.093:0.452:1.185:;1.395:0.912:0.934:;1.358:0.802:0.970:;1.293:0.679:1.038:;1.395:0.910:0.986:;1.243:1.243:0.397:;1.001:0.955:0.502:;1.001:1.031:0.448:;1.001:1.119:0.389:;1.001:1.863:0.509:;1.001:1.959:0.661:;1.000:0.872:0.531:;1.264:1.570:0.392:;1.351:0.717:0.914:;1.196:0.790:0.581:;1.087:0.794:0.552:;1.000:0.794:0.550:;1.263:1.403:0.379:;1.457:1.385:0.941:;1.458:1.372:0.809:;1.001:1.671:1.512:;1.001:1.779:1.438:;1.409:1.116:1.299:;1.296:1.260:1.439:;1.285:1.265:1.450:;1.279:1.270:1.455:;1.129:0.977:1.565:;1.162:1.017:1.535:;1.099:1.058:1.581:;1.054:1.323:1.544:;1.079:1.302:1.528:;0.997:0.802:1.601:;0.999:0.774:1.573:;0.995:0.836:1.628:;1.000:0.736:1.574:;0.999:0.674:1.557:;1.270:1.242:1.465:;1.261:1.253:1.476:;1.235:1.160:1.493:;1.411:1.186:1.274:;1.000:1.013:1.585:;1.153:0.945:1.558:;1.026:1.332:1.554:;1.000:1.333:1.558:;1.286:1.278:1.428:;1.185:0.500:1.122:;1.333:0.614:0.930:;1.207:0.726:0.584:;1.093:0.726:0.563:;1.278:0.561:1.048:;1.001:0.723:0.562:;1.438:1.125:0.963:;1.460:1.163:0.945:;1.485:1.177:0.972:;1.472:1.162:0.996:;1.496:1.233:0.983:;1.477:1.247:1.004:;1.517:1.299:0.948:;1.492:1.318:0.956:;1.534:1.316:0.876:;1.511:1.333:0.871:;1.536:1.290:0.829:;1.511:1.304:0.813:;1.539:1.229:0.807:;1.511:1.231:0.781:;1.520:1.129:0.809:;1.490:1.122:0.791:;1.488:1.010:0.918:;1.472:0.993:0.907:;1.471:1.040:0.846:;1.496:1.047:0.863:;1.485:0.975:0.976:;1.461:0.957:0.967:;1.475:1.239:0.958:;1.495:1.289:0.937:;1.508:1.300:0.882:;1.513:1.283:0.842:;1.515:1.235:0.823:;1.502:1.136:0.818:;1.486:1.053:0.881:;1.486:1.027:0.933:;1.483:1.014:0.988:;1.464:1.028:1.025:;1.458:0.981:1.020:;1.443:1.058:0.971:;1.456:1.085:0.940:;1.442:1.084:0.979:;1.460:1.268:1.021:;1.459:1.183:1.041:;1.463:1.318:0.955:;1.470:1.312:0.857:;1.455:1.233:0.805:;1.438:1.132:0.809:;1.425:1.047:0.852:;1.423:0.995:0.910:;1.425:0.971:0.974:;1.431:0.990:1.030:;1.446:1.035:1.046:;1.476:1.129:0.914:;1.483:1.060:0.947:;1.482:1.083:0.899:;1.471:1.044:0.987:;1.479:1.078:1.005:;1.505:1.224:0.898:;1.504:1.132:0.853:;1.455:1.100:1.045:;1.404:1.025:0.831:;1.415:1.139:0.781:;1.435:1.250:0.770:;1.000:0.592:1.311:;1.000:0.828:1.506:;1.088:0.813:1.484:;1.141:0.826:1.466:;1.160:0.858:1.459:;1.152:0.884:1.431:;1.071:1.012:1.376:;1.128:0.884:1.361:;1.144:0.833:1.412:;1.075:0.782:1.372:;1.281:1.293:1.455:;1.281:1.320:1.451:;1.127:1.269:1.455:;1.117:1.285:1.448:;1.120:1.275:1.469:;1.157:1.255:1.466:;1.266:1.274:1.421:;1.215:1.254:1.455:;1.141:1.313:1.482:;1.211:1.256:1.487:;1.277:1.303:1.411:;1.253:1.334:1.434:;1.202:1.342:1.465:;1.120:1.296:1.471:;1.147:1.323:1.456:;1.126:1.302:1.455:;1.120:1.285:1.469:;1.001:1.019:1.375:;1.001:0.794:1.380:;1.054:0.899:1.272:;1.001:0.901:1.271:;1.255:0.601:0.554:;1.413:0.627:0.667:;1.453:0.584:0.646:;1.293:0.535:0.524:;1.082:0.363:1.176:;1.073:0.261:1.180:;1.175:0.285:1.156:;1.172:0.398:1.130:;1.381:0.496:0.816:;1.357:0.581:0.820:;1.338:0.505:0.945:;1.373:0.381:0.963:;1.454:0.347:0.906:;1.452:0.454:0.803:;1.174:0.186:1.196:;1.074:0.154:1.207:;1.096:0.095:1.254:;1.198:0.135:1.243:;1.520:0.513:0.615:;1.555:0.416:0.781:;1.451:0.268:0.978:;1.383:0.252:1.044:;1.440:0.201:1.098:;1.519:0.232:0.992:;1.275:0.194:1.116:;1.321:0.162:1.184:;1.355:0.456:0.475:;1.163:0.396:0.441:;1.131:0.503:0.501:;1.115:0.590:0.542:;1.000:0.507:0.496:;1.000:0.593:0.535:;1.000:0.399:0.445:;1.546:0.303:0.883:;1.227:0.668:0.576:;1.102:0.661:0.563:;1.280:0.446:1.066:;1.275:0.315:1.078:;1.000:0.658:0.562:;1.001:0.254:1.177:;1.000:0.125:1.179:;1.379:0.677:0.673:;1.000:0.060:1.234:;1.001:0.350:1.207:;0.869:0.868:1.499:;0.866:0.853:1.488:;0.848:0.859:1.477:;0.853:0.865:1.490:;0.930:0.900:1.550:;0.926:0.953:1.500:;0.969:0.903:1.554:;0.960:0.890:1.550:;0.964:0.872:1.535:;0.926:0.864:1.523:;0.927:0.884:1.538:;0.893:0.856:1.505:;0.894:0.874:1.516:;0.843:0.892:1.468:;0.844:0.876:1.487:;0.841:0.869:1.485:;0.837:0.873:1.470:;0.840:0.864:1.476:;0.846:0.865:1.487:;0.857:0.881:1.500:;0.870:0.927:1.476:;0.899:0.894:1.538:;0.874:0.884:1.516:;0.725:0.699:1.248:;0.779:0.664:1.330:;0.750:0.724:1.380:;0.693:0.760:1.292:;0.716:0.974:1.480:;0.681:1.008:1.450:;0.668:0.959:1.412:;0.706:0.925:1.452:;0.705:0.945:0.642:;0.698:0.856:0.657:;0.644:0.840:0.777:;0.645:0.937:0.757:;0.553:1.226:1.139:;0.562:1.336:1.131:;0.551:1.331:1.048:;0.545:1.205:1.083:;0.897:0.581:1.250:;0.796:0.647:1.208:;0.803:0.588:1.139:;0.898:0.524:1.209:;0.804:0.673:1.427:;0.824:0.638:1.392:;0.850:0.627:1.431:;0.844:0.651:1.464:;0.911:0.608:1.304:;0.842:0.636:1.305:;0.584:1.612:1.082:;0.569:1.648:0.958:;0.546:1.509:0.936:;0.560:1.483:1.048:;0.610:1.405:1.307:;0.624:1.383:1.354:;0.654:1.433:1.398:;0.645:1.467:1.357:;0.683:1.304:1.429:;0.698:1.320:1.457:;0.691:1.339:1.458:;0.672:1.316:1.430:;0.642:1.360:1.389:;0.664:1.398:1.428:;0.715:1.293:1.457:;0.706:1.311:1.452:;0.692:1.294:1.431:;0.705:1.282:1.436:;0.579:1.456:1.145:;0.605:1.565:1.193:;0.678:1.364:1.449:;0.655:1.337:1.417:;0.822:1.561:1.512:;0.751:1.546:1.467:;0.757:1.480:1.495:;0.830:1.478:1.537:;0.836:1.411:1.547:;0.763:1.427:1.516:;0.729:1.635:1.422:;0.804:1.658:1.473:;0.854:1.313:1.508:;0.811:1.325:1.513:;0.813:1.313:1.512:;0.855:1.300:1.502:;0.813:1.311:1.507:;0.857:1.300:1.494:;0.840:1.365:1.528:;0.781:1.383:1.516:;0.842:1.335:1.520:;0.794:1.350:1.517:;0.805:1.332:1.516:;0.848:1.321:1.513:;0.919:1.083:1.603:;0.951:1.089:1.594:;0.955:1.073:1.618:;0.941:1.076:1.621:;0.577:1.077:1.237:;0.568:1.159:1.216:;0.552:1.131:1.150:;0.572:1.035:1.167:;0.688:0.827:1.334:;0.675:0.896:1.372:;0.635:0.947:1.316:;0.633:0.873:1.269:;0.816:0.851:1.518:;0.818:0.862:1.528:;0.795:0.869:1.524:;0.794:0.848:1.515:;0.606:1.006:1.269:;0.599:0.941:1.209:;0.739:0.901:1.484:;0.749:0.945:1.503:;0.841:0.864:1.499:;0.845:0.865:1.503:;0.855:0.866:1.515:;0.839:0.872:1.537:;0.827:0.879:1.541:;0.831:0.862:1.525:;0.768:0.883:1.508:;0.767:0.849:1.497:;0.674:1.203:1.416:;0.659:1.236:1.392:;0.632:1.221:1.359:;0.641:1.178:1.384:;0.704:1.050:1.479:;0.678:1.090:1.450:;0.648:1.049:1.417:;0.633:1.003:1.370:;0.844:0.845:1.537:;0.835:0.823:1.538:;0.855:0.813:1.559:;0.859:0.844:1.559:;0.822:0.920:1.548:;0.798:0.952:1.527:;0.780:0.918:1.518:;0.804:0.894:1.536:;0.792:0.787:1.493:;0.808:0.812:1.516:;0.799:0.830:1.511:;0.777:0.817:1.490:;0.871:0.867:1.551:;0.854:0.860:1.531:;0.903:1.172:1.570:;0.880:1.150:1.555:;0.864:1.119:1.545:;0.887:1.137:1.569:;0.935:1.232:1.570:;0.913:1.218:1.556:;0.926:1.185:1.585:;0.914:1.256:1.531:;0.889:1.229:1.526:;0.884:1.191:1.550:;0.700:1.037:0.612:;0.635:1.038:0.731:;0.777:0.757:1.451:;0.754:0.804:1.453:;0.729:0.800:1.399:;0.637:0.803:1.213:;0.590:0.875:1.141:;0.570:0.997:1.091:;0.551:1.111:1.089:;0.858:1.870:1.302:;0.868:1.771:1.419:;0.937:1.777:1.433:;0.932:1.877:1.316:;0.647:1.661:1.265:;0.712:1.724:1.335:;0.696:1.809:1.220:;0.629:1.728:1.149:;0.619:1.777:1.012:;0.900:1.473:1.557:;0.890:1.565:1.535:;0.900:1.278:1.511:;0.891:1.248:1.503:;0.947:1.194:1.605:;0.955:1.241:1.587:;0.877:1.669:1.501:;0.949:1.565:1.543:;0.942:1.672:1.510:;0.956:1.466:1.561:;0.964:1.389:1.562:;0.698:1.466:1.449:;0.704:1.425:1.472:;0.859:1.223:1.500:;0.814:1.209:1.492:;0.814:1.179:1.503:;0.854:1.195:1.519:;0.940:1.044:1.578:;0.887:1.041:1.565:;0.886:1.012:1.564:;0.931:0.993:1.598:;0.856:1.064:1.538:;0.852:1.044:1.535:;0.909:0.954:1.601:;0.970:0.965:1.624:;0.972:0.986:1.603:;0.852:1.132:1.544:;0.851:1.165:1.537:;0.817:1.147:1.520:;0.823:1.112:1.533:;0.852:1.098:1.536:;0.835:1.077:1.533:;0.880:1.269:1.481:;0.881:1.262:1.493:;0.884:1.273:1.494:;0.884:1.273:1.484:;0.771:1.917:1.120:;0.777:1.849:1.271:;0.855:1.945:1.151:;0.855:1.981:0.982:;0.846:1.976:0.817:;0.760:1.946:0.814:;0.769:1.949:0.960:;0.933:1.995:0.990:;0.933:1.956:1.163:;0.911:1.383:1.555:;0.888:1.337:1.527:;0.877:1.311:1.513:;0.851:0.888:1.559:;0.840:0.901:1.559:;0.930:1.123:1.647:;0.896:1.120:1.617:;0.903:1.087:1.618:;0.942:1.085:1.641:;0.919:1.082:1.568:;0.965:1.058:1.595:;0.968:0.948:1.636:;0.912:0.934:1.613:;0.909:0.898:1.608:;0.962:0.906:1.629:;0.916:0.877:1.580:;0.961:0.883:1.595:;0.978:1.018:1.587:;0.969:1.086:1.666:;0.963:1.125:1.667:;0.934:1.155:1.629:;0.962:1.159:1.648:;0.971:1.200:1.621:;0.977:1.246:1.598:;0.956:1.282:1.559:;0.977:1.287:1.570:;0.651:1.268:1.385:;0.648:1.303:1.394:;0.629:1.315:1.363:;0.625:1.266:1.353:;0.578:1.336:1.207:;0.598:1.429:1.234:;0.605:1.264:1.314:;0.609:1.326:1.326:;0.687:1.276:1.422:;0.680:1.292:1.417:;0.668:1.295:1.409:;0.672:1.272:1.407:;0.570:1.244:1.204:;0.591:1.332:1.277:;0.588:1.258:1.266:;0.813:0.758:1.510:;0.806:0.717:1.474:;0.845:0.695:1.502:;0.850:0.736:1.527:;0.943:0.773:1.570:;0.899:0.766:1.561:;0.890:0.725:1.546:;0.934:0.730:1.565:;0.846:0.862:1.502:;0.840:0.857:1.513:;0.845:0.858:1.519:;0.851:0.863:1.506:;0.840:0.862:1.518:;0.838:0.858:1.512:;0.889:0.874:1.533:;0.899:0.870:1.584:;0.919:0.882:1.558:;0.736:1.015:1.501:;0.739:1.089:1.495:;0.720:1.127:1.471:;0.792:1.087:1.524:;0.812:1.051:1.530:;0.768:0.983:1.518:;0.656:1.133:1.417:;0.698:1.166:1.445:;0.707:1.225:1.444:;0.684:1.250:1.418:;0.665:0.749:1.156:;0.613:0.820:1.075:;0.646:0.806:1.028:;0.708:0.720:1.105:;0.608:1.206:1.320:;0.613:1.150:1.345:;0.874:1.567:0.348:;0.883:1.726:0.404:;0.791:1.754:1.387:;0.866:0.867:1.515:;0.868:0.866:1.531:;0.882:0.634:1.491:;0.933:0.625:1.505:;0.931:0.673:1.553:;0.882:0.681:1.530:;0.712:0.865:1.425:;0.625:1.097:1.380:;0.606:1.054:1.332:;0.929:1.994:0.817:;0.917:1.954:0.662:;0.823:1.936:0.670:;0.823:1.259:1.502:;0.860:1.267:1.491:;0.859:1.272:1.486:;0.824:1.263:1.496:;0.860:1.240:1.495:;0.818:1.230:1.495:;0.665:1.588:1.357:;0.689:1.518:1.416:;0.737:1.350:1.496:;0.748:1.331:1.497:;0.889:1.276:1.501:;0.886:1.256:1.496:;0.875:1.294:1.500:;0.876:1.283:1.490:;0.861:1.255:1.497:;0.821:1.246:1.501:;0.879:1.272:1.477:;0.849:1.084:1.549:;0.889:0.803:1.579:;0.854:0.773:1.547:;0.742:0.854:1.465:;0.818:0.985:1.534:;0.789:1.019:1.526:;0.831:0.850:1.517:;0.818:0.841:1.516:;0.825:0.831:1.523:;0.836:0.847:1.523:;0.860:0.872:1.546:;0.847:0.866:1.528:;0.585:0.929:1.034:;0.962:1.063:1.629:;0.977:1.053:1.640:;0.810:0.865:0.571:;0.810:0.947:0.554:;0.914:0.951:0.510:;0.916:0.870:0.536:;0.761:1.313:1.499:;0.763:1.311:1.496:;0.755:1.326:1.495:;0.880:1.282:1.477:;0.824:0.793:1.531:;0.885:0.840:1.589:;0.930:0.801:1.595:;0.926:0.835:1.619:;0.910:1.152:1.600:;0.889:1.057:1.586:;0.898:1.072:1.586:;0.873:1.073:1.598:;0.863:1.054:1.574:;0.864:1.107:1.581:;0.722:1.384:1.486:;0.829:0.855:1.518:;0.957:0.886:1.575:;0.942:0.869:1.611:;0.980:1.034:1.603:;0.776:1.247:1.497:;0.780:1.258:1.498:;0.692:1.285:1.426:;0.704:1.279:1.431:;0.708:1.276:1.437:;0.713:1.277:1.435:;0.708:1.280:1.428:;0.934:0.615:1.441:;0.883:0.618:1.437:;0.625:1.821:0.735:;0.680:1.832:0.608:;0.638:1.713:0.532:;0.574:1.698:0.680:;0.730:1.909:0.704:;0.692:1.901:0.789:;0.560:1.677:0.825:;0.613:1.807:0.872:;0.688:1.895:0.921:;0.928:0.608:1.377:;0.872:0.623:1.378:;0.875:1.303:1.505:;0.900:1.861:0.514:;0.787:1.850:0.536:;0.755:1.723:0.441:;0.801:1.027:0.512:;0.780:1.118:0.445:;0.897:1.117:0.400:;0.907:1.027:0.461:;0.611:1.144:0.697:;0.671:1.131:0.556:;0.641:1.250:0.509:;0.578:1.258:0.667:;0.876:1.398:0.335:;0.886:1.241:0.355:;0.618:1.402:0.488:;0.551:1.396:0.649:;0.549:1.548:0.652:;0.616:1.563:0.493:;0.537:1.529:0.804:;0.689:1.867:1.072:;0.628:0.817:0.885:;0.612:0.921:0.858:;0.752:1.198:1.475:;0.770:1.232:1.488:;0.871:0.911:1.585:;0.876:0.884:1.575:;0.885:0.871:1.557:;0.778:1.123:1.506:;0.784:1.261:1.494:;0.747:1.263:1.478:;0.743:1.261:1.480:;0.885:1.274:1.475:;0.701:1.300:1.423:;0.708:1.284:1.433:;0.704:1.288:1.418:;0.858:1.263:1.482:;0.880:1.268:1.470:;0.828:1.257:1.490:;0.725:1.272:1.453:;0.751:1.257:1.474:;0.725:1.269:1.446:;0.766:1.331:1.491:;0.812:1.327:1.497:;0.700:1.275:1.433:;0.864:0.926:1.577:;0.763:1.053:1.515:;0.935:1.271:1.545:;0.626:1.514:1.287:;0.678:0.785:0.662:;0.652:0.724:0.667:;0.648:0.667:0.809:;0.645:0.752:0.794:;0.906:0.451:1.187:;0.643:0.802:0.970:;0.607:0.912:0.934:;0.708:0.679:1.038:;0.606:0.910:0.986:;0.758:1.243:0.397:;0.737:1.570:0.391:;0.651:0.717:0.914:;0.805:0.790:0.581:;0.914:0.794:0.552:;0.738:1.403:0.379:;0.544:1.372:0.809:;0.545:1.385:0.941:;0.592:1.117:1.297:;0.701:1.260:1.439:;0.712:1.266:1.450:;0.720:1.270:1.454:;0.837:1.017:1.537:;0.869:0.978:1.566:;0.899:1.057:1.581:;0.919:1.301:1.528:;0.944:1.323:1.545:;0.728:1.243:1.465:;0.737:1.253:1.476:;0.767:1.159:1.488:;0.588:1.186:1.274:;0.845:0.947:1.558:;0.972:1.332:1.556:;0.714:1.278:1.428:;0.816:0.500:1.122:;0.669:0.614:0.930:;0.794:0.726:0.584:;0.908:0.726:0.563:;0.723:0.561:1.048:;0.516:1.177:0.972:;0.541:1.163:0.945:;0.563:1.125:0.963:;0.528:1.162:0.996:;0.524:1.247:1.004:;0.505:1.233:0.983:;0.509:1.318:0.956:;0.484:1.299:0.948:;0.490:1.333:0.871:;0.467:1.317:0.876:;0.490:1.304:0.813:;0.465:1.290:0.829:;0.490:1.231:0.781:;0.463:1.229:0.807:;0.511:1.122:0.791:;0.481:1.129:0.809:;0.530:1.040:0.846:;0.529:0.993:0.907:;0.514:1.009:0.918:;0.505:1.047:0.863:;0.540:0.957:0.967:;0.516:0.975:0.976:;0.506:1.289:0.937:;0.526:1.239:0.958:;0.493:1.300:0.882:;0.488:1.283:0.841:;0.486:1.235:0.823:;0.499:1.136:0.818:;0.515:1.053:0.881:;0.515:1.027:0.933:;0.519:1.014:0.988:;0.544:0.981:1.020:;0.537:1.028:1.025:;0.545:1.085:0.940:;0.559:1.058:0.971:;0.559:1.084:0.979:;0.542:1.183:1.041:;0.542:1.268:1.021:;0.538:1.319:0.955:;0.531:1.312:0.857:;0.546:1.233:0.805:;0.563:1.132:0.809:;0.577:1.047:0.852:;0.578:0.995:0.910:;0.576:0.971:0.974:;0.571:0.990:1.030:;0.555:1.035:1.046:;0.518:1.060:0.948:;0.526:1.129:0.913:;0.520:1.082:0.899:;0.531:1.045:0.987:;0.522:1.078:1.005:;0.496:1.224:0.898:;0.497:1.132:0.853:;0.546:1.100:1.045:;0.587:1.139:0.781:;0.598:1.025:0.831:;0.566:1.250:0.770:;0.913:0.813:1.484:;0.860:0.826:1.466:;0.842:0.858:1.459:;0.931:1.012:1.376:;0.849:0.884:1.431:;0.874:0.884:1.361:;0.858:0.833:1.412:;0.927:0.782:1.372:;0.718:1.294:1.455:;0.716:1.320:1.451:;0.876:1.285:1.453:;0.873:1.269:1.456:;0.881:1.275:1.470:;0.844:1.255:1.466:;0.735:1.274:1.421:;0.785:1.254:1.455:;0.858:1.313:1.484:;0.787:1.256:1.487:;0.723:1.303:1.411:;0.748:1.334:1.433:;0.799:1.342:1.464:;0.879:1.296:1.473:;0.855:1.323:1.456:;0.874:1.302:1.456:;0.880:1.285:1.471:;0.948:0.899:1.272:;0.546:0.584:0.647:;0.587:0.628:0.668:;0.744:0.602:0.553:;0.705:0.536:0.523:;0.826:0.285:1.157:;0.928:0.262:1.180:;0.920:0.363:1.178:;0.828:0.398:1.131:;0.663:0.505:0.945:;0.645:0.581:0.820:;0.620:0.495:0.815:;0.627:0.381:0.963:;0.547:0.454:0.803:;0.546:0.347:0.906:;0.903:0.095:1.255:;0.926:0.154:1.208:;0.827:0.186:1.196:;0.803:0.136:1.244:;0.479:0.512:0.616:;0.444:0.415:0.781:;0.561:0.201:1.098:;0.618:0.252:1.044:;0.549:0.268:0.978:;0.481:0.232:0.992:;0.726:0.194:1.115:;0.681:0.162:1.184:;0.837:0.396:0.441:;0.643:0.456:0.475:;0.869:0.503:0.501:;0.885:0.590:0.542:;0.453:0.303:0.882:;0.899:0.661:0.563:;0.773:0.668:0.575:;0.725:0.315:1.079:;0.720:0.446:1.067:;0.622:0.678:0.674:;1.173:1.300:1.416:;0.829:1.300:1.416 ffc=ldtext.Split (hx ":") ff=LDText.Split (cx ";") For x=0 to Array.GetItemCount (ffc)/3-3 Step 2 For j=0 To 2 c1= (ffc[j+1+x*3]) c2= (ffc[math.Remainder (j+1 3)+1+x*3]) h1=ldtext.Split (ff[ldmath.Base2Decimal (c1 16)] ":") pp[j+1][1]=(h1[3])*300 pp[j+1][2]=900-(h1[2])*300 endfor GraphicsWindow.BrushColor =LDColours.HSLtoRGB (pp[1][2]/2 1 .5) GraphicsWindow.FillTriangle (pp[1][1] pp[1][2] pp[2][1] pp[2][2] pp[3][1] pp[3][2]) EndFor For x=0 to Array.GetItemCount (ffc)/3-3 For j=0 To 2 c1= (ffc[j+1+x*3]) c2= (ffc[math.Remainder (j+1 3)+1+x*3]) h1=ldtext.Split (ff[ldmath.Base2Decimal (c1 16)] ":") pp[j+1][1]=800+(h1[1]-1)*300 pp[j+1][2]=900-(h1[2])*300 pp[j+1][3]=h1[3]-1 endfor GraphicsWindow.BrushColor =LDColours.HSLtoRGB (pp[1][3]*30+30 1 .5) GraphicsWindow.PenColor =GraphicsWindow.BrushColor If pp[1][3]>-.3 then GraphicsWindow.FillTriangle (pp[1][1] pp[1][2] pp[2][1] pp[2][2] pp[3][1] pp[3][2]) GraphicsWindow.drawTriangle (pp[1][1] pp[1][2] pp[2][1] pp[2][2] pp[3][1] pp[3][2]) endif EndFor End>GJM689.sb< Start>GJR357.sb< ' Mirror Paint 0.1 ' Copyright (c) 2013 Nonki Takahashi. All rights reserved. ' ' History: ' 0.1 2013-12-17 Created. ' GraphicsWindow.Title = "Mirror Paint 0.1" gw = 588 gw2 = gw / 2 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh penDown = "False" mx = 0 my = 0 mxLast = 0 myLast = 0 GraphicsWindow.PenWidth = 1 GraphicsWindow.PenColor = "Black" GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseUp = OnMouseUp GraphicsWindow.MouseMove = OnMouseMove Sub OnMouseDown penDown = "True" EndSub Sub OnMouseUp penDown = "False" EndSub Sub OnMouseMove mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY If penDown And gw2 < mx And (mx <> mxLast Or my <> myLast )Then GraphicsWindow.DrawLine(mxLast, myLast, mx, my) GraphicsWindow.DrawLine(gw - mxLast, myLast, gw - mx, my) EndIf mxLast = mx myLast = my EndSub End>GJR357.sb< Start>GJT790.sb< DataExtension.Init() Textwindow.WriteLine("Setting up server: "+NetworkServer.Enable(999)) TextWindow.WriteLine("IP: 127.0.0.1") TextWindow.WriteLine("port: 999") NetworkServer.SomeoneTryConnect = connection NetworkServer.MessageRecieved = message Sub connection NetworkServer.AllowLatestUserToConnect() NetworkServer.SendMessage(NetworkServer.LastRecievedUsername,"Welcome: "+NetworkServer.LastRecievedUsername) TextWindow.WriteLine(NetworkServer.Clients) EndSub Sub message TextWindow.WriteLine(NetworkServer.LastRecievedUsername+": "+NetworkServer.LastRecievedMessage) If(NetworkServer.LastRecievedMessage = "Ping") Then NetworkServer.SendMessageToAll("Pong") EndIf EndSub End>GJT790.sb< Start>GJV177.sb< GraphicsWindow.BackgroundColor="darkblue dw=math.Round(desktop.Width) dh=math.Round(desktop.Height) GraphicsWindow.Title ="Coils GraphicsWindow.Width = dw GraphicsWindow.Height = dh GraphicsWindow.Top=0 GraphicsWindow.Left=0 view3D = LD3DView.AddView(dw,dh,"True") 'Some different light types spot = LD3DView.AddSpotLight(view3D,"Green",0.75,0.75,2,0,0,-1,360,100) LD3DView.AddDirectionalLight(view3D,"Pink",-1,-1,-1) LD3DView.AddDirectionalLight(view3D,"DarkBlue",1,1,1) LD3DView.AddAmbientLight(view3D,"#50111111") 'Initial camera position and direction and view angle LD3DView.ResetCamera(view3D,0,0,50,0,0,-1,"","","") s="" z=-20 For n=0 To 360*4 Step 6 z=z+0.2 x=ldmath.Sin(n)*5 y=ldmath.cos(n)*5 s=s+": "+x+" "+z+" "+y+" " EndFor LD3DView.AutoControl ("true" "true" ,-1 3) ff=1.6 coil=LD3DView.AddTube(view3D,s,3,20,"red","D") LD3DView.TranslateGeometry(view3D,coil,-8*ff,0,0) coil2=LD3DView.AddTube(view3D,s,3,20,"green","D") coil3=LD3DView.AddTube(view3D,s,3,20,"blue","D") LD3DView.TranslateGeometry(view3D,coil3,8*ff,0,0) coil4=LD3DView.AddTube(view3D,s,3,20,"yellow","D") LD3DView.TranslateGeometry(view3D,coil4,16*ff,0,0) coil5=LD3DView.AddTube(view3D,s,3,20,"Orange","D") LD3DView.TranslateGeometry(view3D,coil5,-16*ff,0,0) LD3DView.AnimateRotation(view3D,coil5,0,1,0,0,-360,1,-1) LD3DView.AnimateRotation(view3D,coil4,0,1,0,0,-360,1,-1) LD3DView.AnimateRotation(view3D,coil3,0,1,0,0,360,1,-1) LD3DView.AnimateRotation(view3D,coil2,0,1,0,0,-360,1,-1) LD3DView.AnimateRotation(view3D,coil,0,1,0,0,360,1,-1) End>GJV177.sb< Start>GJV352.sb< Image = Shapes.AddImage("http://litdev.web.officelive.com/images/bee_icon3.png") Shapes.Move(Image,100,100) Terron = Shapes.AddImage("http://ingenieriasimple.com/smallbasic/TerronG.gif") Shapes.Move(Terron,200,100) End>GJV352.sb< Start>GJV656.sb< '======================================== 'Simple structured example using a grid of textboxes for a simple database '======================================== Initialise() '======================================== 'Register Events '======================================== Controls.TextTyped = OnTextTyped Controls.ButtonClicked = OnButtonClicked '======================================== 'Main program event handling loop '======================================== While ("True") If (lastTB <> "") Then GetText() lastTB = "" 'Event handled EndIf If (lastButton <> "") Then ButtonPressed() lastButton = "" 'Event handled EndIf Program.Delay(20) 'Don't mash CPU but update faster than you can type EndWhile '======================================== 'SUBROUTINES '======================================== Sub Initialise 'Basic data for columns and grid sizing header = "1=First Name;2=Surname;3=Telephone;4=Mobile;5=Email;" nCol = Array.GetItemCount(header) nRow = 10 tbWidth = 150 tbHeight = 26 space = 6 'Setup GrapicsWindow GraphicsWindow.BackgroundColor = "PowderBlue" GraphicsWindow.Width = space+(space+tbWidth)*Math.Max(5,nCol) 'We need at leaset 5 columns width Window to fit all the buttons at the bottom GraphicsWindow.Height = space+(space+tbHeight)*(nRow+2) GraphicsWindow.FontName = "Consolas" 'Fixed width font GraphicsWindow.FontSize = 14 'Create grid of textboxes for data For j = 1 To nCol nChar = Text.GetLength(header[j]) 'Try to center title (using fixed width font) GraphicsWindow.BrushColor = "MidnightBlue" 'Title Colour GraphicsWindow.DrawText(space-nChar*4.5+(space+tbWidth)*(j-0.5),space+tbHeight/4,header[j]) GraphicsWindow.BrushColor = "SteelBlue" 'TextBox Colour For i = 1 To nRow tb[i][j] = Controls.AddTextBox(space+(space+tbWidth)*(j-1),space+(space+tbHeight)*(i)) Controls.SetSize(tb[i][j],tbWidth,tbHeight) 'Make it easy to get row,col [i][j] from textbox name tbRow[tb[i][j]] = i tbCol[tb[i][j]] = j EndFor EndFor 'Create buttons at the bottom GraphicsWindow.BrushColor = "MidnightBlue" 'Button Colour buttons = "1=Clear;2=Load;3=Save;4=First;5=Last;6=Previous;7=Next;8=About;10=Exit;" numButton = Array.GetItemCount(buttons) indices = Array.GetAllIndices(buttons) For i = 1 To numButton index = indices[i] 'used to set position btn = Controls.AddButton(buttons[index],space+(space+tbWidth)/2*(index-1),space+(space+tbHeight)*(nRow+1)) Controls.SetSize(btn,(tbWidth-space)/2,tbHeight) 'Add index with button name to identify button easily buttons[btn] = index EndFor 'Create sort (ascending and descending) at the top of each colum downArrow = Text.GetCharacter(8595) upArrow = Text.GetCharacter(8593) For i = 1 To nCol btn = Controls.AddButton(downArrow,space+(space+tbWidth)*(i-1),space+tbHeight-24) Controls.SetSize(btn,20,24) buttons[btn] = -i 'Use negative index to specify sort buttons for each column descend[btn] = "True" btn = Controls.AddButton(upArrow,space+tbWidth-20+(space+tbWidth)*(i-1),space+tbHeight-24) Controls.SetSize(btn,20,24) buttons[btn] = -i descend[btn] = "False" EndFor 'Read the data and populate grid with initial data ' The following line could be harmful and has been automatically commented. ' data = File.ReadContents(File.GetSettingsFilePath()) page = 0 'First page Update() EndSub Sub Update 'Put data in cboxes for current page For i = 1 To nRow For j = 1 To nCol Controls.SetTextBoxText(tb[i][j],data[page*nRow+i][j]) EndFor EndFor 'Set title indices = Array.GetAllIndices(data) numPage = Math.Floor((indices[Array.GetItemCount(data)]-1)/nRow) GraphicsWindow.Title = "Page "+(page+1)+" of "+Math.Max(1,numPage+1) EndSub Sub GetText 'Get data from current changing textbox i = tbRow[lastTB] j = tbCol[lastTB] data[page*nRow+i][j] = Controls.GetTextBoxText(lastTB) EndSub Sub ButtonPressed 'Handle all button events If (buttons[lastButton] = 1) Then 'Clear data = "" page = 0 Update() ElseIf (buttons[lastButton] = 2) Then 'Load ' The following line could be harmful and has been automatically commented. ' data = File.ReadContents(File.GetSettingsFilePath()) page = 0 Update() ElseIf (buttons[lastButton] = 3) Then 'Save ' The following line could be harmful and has been automatically commented. ' File.WriteContents(File.GetSettingsFilePath(),data) ElseIf (buttons[lastButton] = 4) Then 'First page = 0 Update() ElseIf (buttons[lastButton] = 5) Then 'Last indices = Array.GetAllIndices(data) page = Math.Floor((indices[Array.GetItemCount(data)]-1)/nRow) Update() ElseIf (buttons[lastButton] = 6) Then 'Previous page = Math.Max(0,page-1) Update() ElseIf (buttons[lastButton] = 7) Then 'Next page = page+1 Update() ElseIf (buttons[lastButton] = 8) Then 'About GraphicsWindow.ShowMessage("This is a demonstration of writing a simple database with sorting in Small Basic without using any extensions. Modify the code and enjoy!","Small Basic Database") ElseIf (buttons[lastButton] = 10) Then 'Exit Program.End() ElseIf (buttons[lastButton] < 0) Then 'Sort col = Math.Abs(buttons[lastButton]) descending = descend[lastButton] If (descending) Then 'Opposite of descending for use with ensuring blank lines are always at the end of a sort ascending = "False" Else ascending = "True" EndIf Sort() page = 0 Update() EndIf EndSub 'ShellSort is fast (faster than BubbleSort) and easy to implement (easier than QuickSort), but not so easy to see how or why it works so Google for it to understand what it does Sub Unify 'Remove blank rows and order data so it is in row order, first shellsort data into row order indices = Array.GetAllIndices(data) count = Array.GetItemCount(indices) inc = Math.Round(count/2) While (inc > 0) For i = inc To count temp = indices[i] j = i while (j > inc And indices[j-inc] > temp) indices[j] = indices[j-inc] j = j - inc EndWhile indices[j] = temp EndFor inc = Math.Round(inc/2.2) EndWhile tempData = "" For i = 1 To count tempData[i] = data[indices[i]] EndFor data = tempData tempData = "" EndSub Sub Sort 'Shell sort by column (this is the trickiest bit since we sort on column values by re-ordering an array (order) that we use to index the data rows Unify() count = Array.GetItemCount(data) values = "" order = "" For i = 1 To count values[i] = data[i][col]+" " ' Variable can't be blank in Small Basic so we add a space order[i] = i EndFor inc = Math.Round(count/2) While (inc > 0) For i = inc To count temp = order[i] j = i value1 = Text.ConvertToLowerCase(values[temp]) value2 = Text.ConvertToLowerCase(values[order[j-inc]]) Compare() While (j > inc And compareResult <> descending) order[j] = order[j-inc] j = j - inc value2 = Text.ConvertToLowerCase(values[order[j-inc]]) Compare() EndWhile order[j] = temp EndFor inc = Math.Round(inc/2.2) EndWhile tempData = "" For i = 1 To count tempData[i] = data[order[i]] EndFor data = tempData tempData = "" EndSub Sub Compare 'Number or lexical compare compareResult = value2 < value1 If (value1 = " ") Then 'Special case (a blank value1 is not less than an existing value2) compareResult = descending ElseIf (value2 = " ") Then 'Special case (a blank value2 is not less than an existing value1) compareResult = ascending ElseIf (value1*1 = value1 And value2*1 = value2) Then 'Both numbers - this works even with the added " " If (value2 < value1) Then compareResult = "True" Else compareResult = "False" EndIf Else 'Lexical comparison nChar1 = Text.GetLength(value1) nChar2 = Text.GetLength(value2) If (nChar2 < nChar1) Then 'If equal (up to shortest word) then shorter will be considered less compareResult = "True" Else compareResult = "False" EndIf nChar = Math.Min(nChar1,nChar2) 'Numer of characters to check (up to shortest word) 'Compare character by character until we find a difference - if none then the initial result above will be used For iChar = 1 To Math.Min(nChar1,nChar2) ' Note - we can't use variable i since it is being used in Sort which calls this subroutine char1 = Text.GetSubText(value1,iChar,1) char2 = Text.GetSubText(value2,iChar,1) val1 = Text.GetCharacterCode(char1) val2 = Text.GetCharacterCode(char2) If (val2 < val1) Then compareResult = "True" iChar = nChar ' End check ElseIf (val2 > val1) Then compareResult = "False" iChar = nChar ' End check EndIF EndFor EndIf EndSub '======================================== 'EVENT SUBROUTINES '======================================== Sub OnTextTyped lastTB = Controls.LastTypedTextBox EndSub Sub OnButtonClicked lastButton = Controls.LastClickedButton EndSub End>GJV656.sb< Start>GJV687.sb< For i = 1 To 6 anfstr = Text.GetCharacter(i) TextWindow.Write(i) TextWindow.Write(" = ") TextWindow.Write(anfstr) TextWindow.Write(" ") EndFor For i = 11 To 12 anfstr = Text.GetCharacter(i) TextWindow.Write(i) TextWindow.Write(" = ") TextWindow.Write(anfstr) TextWindow.Write(" ") EndFor For i = 14 To 255 anfstr = Text.GetCharacter(i) TextWindow.Write(i) TextWindow.Write(" = ") TextWindow.Write(anfstr) TextWindow.Write(" ") EndFor End>GJV687.sb< Start>GJX689.sb< GraphicsWindow.BackgroundColor="tan GraphicsWindow.DrawEllipse(0 0 1 1) For f=100 To 200 Step 10 i=1 For z=0 To 180 Step 4 x=LDMath.Cos(z)*f'+400 y=LDMath.Sin(z)*f'+400 p[i][1]=x p[i][2]=y i=i+1 EndFor GraphicsWindow.PenWidth=0 pp[f]=LDShapes.AddPolygon(p) If f>100 Then LDShapes.BrushColour(pp[f] "midnightblue") Else LDShapes.BrushColour(pp[f] "tan") EndIf LDShapes.ZIndex(pp[f], -f) LDShapes.move(pp[f] 200-(f-100) 200) i=1 For z=180 To 360 Step 4 x=LDMath.Cos(z)*f'+400 y=LDMath.Sin(z)*f'+400 p[i][1]=x p[i][2]=y i=i+1 EndFor GraphicsWindow.PenWidth=0 pp1[f]=LDShapes.AddPolygon(p) LDShapes.BrushColour(pp1[f] "tan") LDShapes.ZIndex(pp1[f], -f) LDShapes.move(pp1[f] 200-(f-100) 100-(f-100)) EndFor ff[1]=3 for r=2 to 10 ff[r]=ff[r-1]*1.02 EndFor GraphicsWindow.Title="SpinDraw Program.Delay(999) For a=0 To 10000 For f=100 To 200 Step 10 ldShapes.RotateAbout(pp[f] 300 200 a*ff[11-(f-100)/10]) ldShapes.RotateAbout(pp1[f] 300 200 a*ff[11-(f-100)/10]) EndFor Program.Delay(25) EndFor End>GJX689.sb< Start>GJZ341.sb< path="D:\Leigh Dunn\Summative\" item1=0 item2=0 item3=0 item4=0 item5=0 item6=0 item7=0 battle1=0 battle2=0 battle3=0 battle4=0 battle5=0 battle6=0 battle7=0 haveEgg=0 'call up non-interactive images egg=ImageList.LoadImage(path+"egg.png") bookshelf=ImageList.LoadImage(path+"bookshelves.png") pokeballmachine=ImageList.LoadImage(path+"pokeballm.gif") tree=ImageList.LoadImage(path+"tree.gif") grass=ImageList.LoadImage(path+"grassSquare.gif") water=ImageList.LoadImage(path+"waterblock.png") labbuilding=ImageList.LoadImage(path+"lab.gif") housebuilding=Imagelist.LoadImage(path+"house.gif") pokecenterbuilding=ImageList.LoadImage(path+"pokecenter.gif") sign=ImageList.LoadImage(path+"sign.gif") ridge=ImageList.LoadImage(path+"boulder.gif") stairs=ImageList.LoadImage(path+"stairs.gif") table=ImageList.LoadImage(path+"table.gif") kitchen=ImageList.LoadImage(path+"kitchen.gif") cave=ImageList.LoadImage(path+"cave.gif") 'call up interactive images itemsprite=ImageLIst.LoadImage(path+"pokeball.gif") starsprite=ImageList.LoadImage(path+"star.gif") 'call up characters playersprite=ImageList.LoadImage(path+"player.gif") professorsprite=ImageList.LoadImage(path+"professor_juniper.gif") aidsprite=ImageList.LoadImage(path+"aid.gif") girlsprite=ImageList.LoadImage(path+"girl.gif") lady1sprite=ImageLIst.LoadImage(path+"lady1.gif") lady2sprite=ImageList.LoadImage(path+"lady2.gif") mothersprite=ImageList.LoadImage(path+"mother.gif") boyspriteb=ImageLIst.LoadImage(path+"boy-back.gif") boysprites=ImageList.LoadImage(path+"boy-side.gif") boysprites2=ImageList.LoadImage(path+"boyspriteside2.gif") guysprite=ImageList.LoadImage(path+"guy.gif") teamrocket=ImageList.LoadImage(path+"teamrockets.gif") nursesprite=ImageList.LoadImage(path+"nursejoy.gif") 'call up pokemon ponytasprite=ImageList.LoadImage(path+"ponytasprite.gif") pidgeyf=ImageList.LoadImage(path+"Pidgey - Front View.gif") pidgeyb=ImageList.LoadImage(path+"Pidgey - Back View.gif") rattataf=ImageList.LoadImage(path+"Rattata - Front View.gif") rattatab=ImageList.LoadImage(path+"Rattata - Back View.gif") caterpief=ImageList.LoadImage(path+"Caterpie - Front View.gif") caterpieb=ImageList.LoadImage(path+"Caterpie - Back View.gif") rarepokemon=ImageList.LoadImage(path+"rarepokemon.gif") ponytaf=ImageList.LoadImage(path+"ponyta-front.gif") 'obvious... GraphicsWindow.Width=500 GraphicsWindow.Height=500 'display the instruction and check if the images are working GraphicsWindow.DrawImage(egg,0,0) GraphicsWindow.DrawText(250,20,"Controls:") GraphicsWindow.DrawText(250,40,"WASD; Move") GraphicsWindow.DrawText(250,60,"Enter: Select/Continue/Examine/Talk") GraphicsWindow.DrawText(250,80,"Space: Open menu") GraphicsWindow.DrawText(250,100,"U: Teleport to home") GraphicsWindow.DrawBoundText(250,160,240,"When in normal conversation, any movement button will exit it. To talk to someone, you must be standing on the space in front of them and press Enter.") GraphicsWindow.DrawBoundText(250,240,240,"You only get one pokemon in this game. You choose out of the three starer ones. Note: Please do not hold down the move keys when in lone grass!!!") GraphicsWindow.DrawBoundText(10,360,480,"Please check for an image above. If there is no image, please go check line one of the coding and change the filepath to be the same as the path on top of the coding.") GraphicsWindow.DrawBoundText(10,420,480,"If the image is present, please wait for the game to start.") GraphicsWindow.DrawBoundText(10,460,480,"Please note: I did not make any of these images apart from the bookshelves, caterpie, pidgey, and rattata. I did not make any of these pokemon.") 'Delay the program so the user can read the instructions 'Program.Delay(20000) GraphicsWindow.Clear() 'The first scene is in the lab. Pull the lab screen up. lab() 'put the player in the scene and move to the mat player=Shapes.AddImage(playersprite) x=120 y=480 Shapes.Move(player,x,y) 'move up 6 spaces For i=1 to 6 y=y-20 Shapes.Move(player,x,y) Program.Delay(250) EndFor 'move right 3 spaces For i=1 to 3 x=x+20 Shapes.Move(player,x,y) Program.Delay(250) EndFor 'move up 11 spaces For i=1 to 11 y=y-20 Shapes.Move(player,x,y) Program.Delay(250) EndFor 'this sets the dialogue point dialogue="go" pause=0 txt=1 'while you're talking to her... While dialogue="go" 'checks the txt level and if you've advanced it If txt=1 And pause=0 Then GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" writetxt=Shapes.AddText("I don't think you know why I called you here.") Shapes.Move(writetxt,10,10) 'pauses the dialogue pause=1 ElseIf txt=2 and pause=0 then Shapes.Remove(writetxt) writetxt=Shapes.AddText("I have just received reports that all the legendary and rare pokemon have") writetxt2=Shapes.AddText("disappeared and the lesser rare pokemon are starting to disappear too.") Shapes.Move(writetxt,10,10) Shapes.Move(writetxt2,10,30) pause=1 ElseIf txt=3 and pause=0 then Shapes.Remove(writetxt) Shapes.Remove(writetxt2) writetxt=Shapes.AddText("I need you to take one of these pokemon and try to find all the others.") writetxt2=Shapes.AddText("They're over there, in the case.") Shapes.Move(writetxt,10,10) Shapes.Move(writetxt2,10,30) pause=1 ElseIf txt>=4 then Shapes.Remove(writetxt) Shapes.Remove(writetxt2) Shapes.Remove(box) dialogue="end" EndIf 'check for the return key GraphicsWindow.Keydown=nextText EndWhile 'moves over to the machine once the dialogue is finished For i=1 to 10 x=x+20 Shapes.Move(player,x,y) Program.Delay(250) EndFor 'makes the menu box appear behind box=Shapes.AddRectangle(400,400) Shapes.Move(box,50,50) 'Initializes the variables for choosing poke=1 pause=0 choose=1 'while you're still choosing While choose=1 If poke=1 And pause=0 Then 'remove the previous pictures Shapes.Remove(pokesprite) Shapes.Remove(talk) pokemon="Pidgey" 'add the new pictures pokesprite=Shapes.AddImage(pidgeyf) GraphicsWindow.BrushColor="Green" talk=Shapes.AddText("Pidgey - Flying/Normal Type") Shapes.Move(talk,160,400) 'pause the selection pause=1 ElseIf poke=2 and pause=0 then Shapes.Remove(pokesprite) Shapes.Remove(talk) pokemon="Rattata" pokesprite=Shapes.AddImage(rattataf) GraphicsWindow.BrushColor="Green" talk=Shapes.AddText("Rattata - Normal Type") Shapes.Move(talk,180,400) pause=1 ElseIf poke=3 and pause=0 then Shapes.Remove(pokesprite) Shapes.Remove(talk) pokemon="Caterpie" pokesprite=Shapes.AddImage(caterpief) GraphicsWindow.BrushColor="Green" talk=Shapes.AddText("Caterpie - Bug Type") Shapes.Move(talk,180,400) pause=1 EndIf Shapes.Move(pokesprite,150,125) 'check for key presses GraphicsWindow.KeyDown=switch EndWhile Shapes.Remove(pokesprite) Shapes.Remove(talk) Shapes.Remove(box) For i=1 to 10 x=x-20 Shapes.Move(player,x,y) Program.Delay(250) EndFor 'dialogue again. Just as before dialogue="go" pause=0 txt=1 While dialogue="go" If txt=1 And pause=0 Then GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" writetxt=Shapes.AddText("Hmmm... "+pokemon[1]+"... That's a good choice. From what we have now at least...") Shapes.Move(writetxt,10,10) pause=1 ElseIf txt=2 and pause=0 then Shapes.Remove(writetxt) writetxt=Shapes.AddText("Anyway... Here's 5 potions to heal it.") Shapes.Move(writetxt,10,10) potion=potion+5 pause=1 ElseIf txt>=3 then Shapes.Remove(writetxt) Shapes.Remove(box) dialogue="end" EndIf GraphicsWindow.KeyDown=nextText EndWhile 'this is what the scene will show place="lab" 'your starting position depends on where you came in from lastplace="nothing" 'just for the while loop movement="go" 'this is where you can move around moveScenes() haveEgg=1 GraphicsWindow.Clear() village2() guy=Shapes.AddImage(guysprite) guyx=320 Shapes.Move(guy,guyx,0) x=400 y=100 player=Shapes.AddImage(playersprite) Shapes.Move(player,x,y) dialogue="go" pause=0 txt=1 While dialogue="go" If txt=1 And pause=0 Then GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" writetxt=Shapes.AddText("Psst... Over here! I have something for you.") Shapes.Move(writetxt,10,10) pause=1 ElseIf txt>=2 then Shapes.Remove(writetxt) Shapes.Remove(box) dialogue="end" EndIf GraphicsWindow.KeyDown=nextText EndWhile Program.Delay(250) For i=1 to 4 x=x-20 Shapes.Move(player,x,y) Program.Delay(250) EndFor For i=1 to 4 y=y-20 Shapes.Move(player,x,y) Program.Delay(250) EndFor dialogue="go" pause=0 txt=1 While dialogue="go" If txt=1 And pause=0 Then GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" writetxt=Shapes.AddText("You're trying to save the pokemon right?") Shapes.Move(writetxt,10,10) pause=1 ElseIf txt=2 and pause=0 then Shapes.Remove(writetxt) writetxt=Shapes.AddText("I have a rare pokemon here. A bulbasaur.") Shapes.Move(writetxt,10,10) pause=1 ElseIf txt=3 and pause=0 then Shapes.Remove(writetxt) writetxt=Shapes.AddText("Will you look after it?") Shapes.Move(writetxt,10,10) pause=1 ElseIf txt>=4 then Shapes.Remove(writetxt) Shapes.Remove(box) dialogue="end" EndIf GraphicsWindow.KeyDown=nextText EndWhile GraphicsWindow.FontSize=20 box=Shapes.AddRectangle(200,100) Shapes.Move(box,150,200) GraphicsWindow.BrushColor="yellow" button1=Shapes.AddRectangle(80,40) Shapes.Move(button1,160,230) button2=Shapes.AddRectangle(80,40) Shapes.Move(button2,260,230) instruction=Shapes.AddText("Use the mouse") Shapes.Move(instruction,160,200) GraphicsWindow.BrushColor="blue" choice1=Shapes.Addtext("Yes") Shapes.Move(choice1,170,240) choice2=Shapes.AddText("No") Shapes.Move(choice2,270,240) choose=0 While choose=0 GraphicsWindow.MouseDown=chooseYesNo EndWhile Shapes.Remove(box) Shapes.Remove(button1) Shapes.Remove(button2) Shapes.Remove(instruction) Shapes.Remove(choice1) Shapes.Remove(choice2) GraphicsWindow.FontSize=12 If answer="yes" then dialogue="go" pause=0 txt=1 While dialogue="go" If txt=1 And pause=0 Then GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" writetxt=Shapes.AddText("Great! Fork over the cash!") Shapes.Move(writetxt,10,10) pause=1 ElseIf txt=2 and pause=0 then Shapes.Remove(writetxt) writetxt=Shapes.AddText("What?! You don't have any? What a waste of my time.") Shapes.Move(writetxt,10,10) pause=1 ElseIf txt>=3 then Shapes.Remove(writetxt) Shapes.Remove(box) dialogue="end" EndIf GraphicsWindow.KeyDown=nextText EndWhile ElseIf answer="no" then dialogue="go" pause=0 txt=1 While dialogue="go" If txt=1 And pause=0 Then GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" writetxt=Shapes.AddText("No!? You're condemning this poor pokemon!") Shapes.Move(writetxt,10,10) pause=1 ElseIf txt=2 and pause=0 then Shapes.Remove(writetxt) writetxt=Shapes.AddText("...I have to go find someone else then...") Shapes.Move(writetxt,10,10) pause=1 ElseIf txt>=3 then Shapes.Remove(writetxt) Shapes.Remove(box) dialogue="end" EndIf GraphicsWindow.KeyDown=nextText EndWhile EndIf For i=1 to 6 guyx=guyx-20 Shapes.Move(guy,guyx,0) Program.Delay(100) EndFor Shapes.Remove(guy) Program.Delay(500) aid=Shapes.AddImage(aidsprite) aidx=480 aidy=360 Shapes.Move(aid,aidx,aidy) For i=1 to 4 aidx=aidx-20 Shapes.Move(aid,aidx,aidy) Program.Delay(100) EndFor For i=1 to 6 aidy=aidy-20 Shapes.Move(aid,aidx,aidy) Program.Delay(100) EndFor For i=1 to 4 y=y+20 Shapes.Move(player,x,y) aidy=aidy-20 Shapes.Move(aid,aidx,aidy) Program.Delay(100) EndFor For i=1 to 2 x=x+20 Shapes.Move(player,x,y) aidy=aidy-20 Shapes.Move(aid,aidx,aidy) Program.Delay(100) EndFor For i=1 to 2 aidx=aidx-20 Shapes.Move(aid,aidx,aidy) Program.Delay(100) EndFor dialogue="go" pause=0 txt=1 While dialogue="go" If txt=1 And pause=0 Then GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" writetxt=Shapes.AddText("There you are! There's been a new developement.") Shapes.Move(writetxt,10,10) pause=1 ElseIf txt=2 and pause=0 then Shapes.Remove(writetxt) writetxt=Shapes.AddText("Professor Willow wants you back at the lab.") Shapes.Move(writetxt,10,10) pause=1 ElseIf txt>=3 then Shapes.Remove(writetxt) Shapes.Remove(box) dialogue="end" EndIf GraphicsWindow.KeyDown=nextText EndWhile For i=1 to 2 aidx=aidx+20 Shapes.Move(aid,aidx,aidy) Program.Delay(100) EndFor For i=1 to 12 aidy=aidy+20 Shapes.Move(aid,aidx,aidy) Program.Delay(100) EndFor For i=1 to 4 aidx=aidx+20 Shapes.Move(aid,aidx,aidy) Program.Delay(100) EndFor Shapes.Remove(aid) place="village2" lastplace="nothing" movement="go" moveScenes() haveEgg=2 GraphicsWindow.Clear() GraphicsWindow.KeyDown=nextText lab() x=120 y=480 player=Shapes.AddImage(playersprite) Shapes.Move(player,x,y) For i=1 to 6 y=y-20 Shapes.Move(player,x,y) Program.Delay(250) EndFor 'move right 3 spaces For i=1 to 3 x=x+20 Shapes.Move(player,x,y) Program.Delay(250) EndFor 'move up 11 spaces For i=1 to 11 y=y-20 Shapes.Move(player,x,y) Program.Delay(250) EndFor dialogue="go" pause=0 txt=1 While dialogue="go" If txt=1 And pause=0 Then GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" writetxt=Shapes.AddText("Finally! I have just gotten word of a sighting of some pokemon out by Hanisc town.") Shapes.Move(writetxt,10,10) pause=1 ElseIf txt=2 and pause=0 then Shapes.Remove(writetxt) writetxt=Shapes.AddText("I want you to go investigate. The road should be clear.") Shapes.Move(writetxt,10,10) pause=1 ElseIf txt=3 and pause=0 then Shapes.Remove(writetxt) writetxt=Shapes.AddText("It's off to the right just in case you don't know.") Shapes.Move(writetxt,10,10) pause=1 ElseIf txt>=4 then Shapes.Remove(writetxt) Shapes.Remove(box) dialogue="end" EndIf GraphicsWindow.KeyDown=nextText EndWhile place="lab" lastplace="nothing" movement="go" revive: moveScenes() GraphicsWindow.Clear() GraphicsWindow.Width=500 GraphicsWindow.KeyDown=nextText village3() player=Shapes.AddImage(playersprite) x=0 Shapes.Move(player,x,y) Shapes.Move(ponyta,80,80) Program.Delay(100) Shapes.Move(ponyta,60,80) Program.Delay(100) Shapes.Move(ponyta,60,60) Program.Delay(100) Shapes.Move(ponyta,60,40) Program.Delay(100) Shapes.Move(ponyta,60,20) Program.Delay(100) Shapes.Move(ponyta,40,20) Program.Delay(100) Shapes.Move(ponyta,20,20) Program.Delay(100) Shapes.Move(ponyta,20,0) Program.Delay(100) For i=1 to 2 x=x+20 Shapes.Move(player,x,y) Program.Delay(100) EndFor For i=1 to 2 y=y-20 Shapes.Move(player,x,y) Program.Delay(100) EndFor x=120 y=40 y=y-20 Shapes.Move(person1,x,y) Program.Delay(100) For i=1 to 3 x=x-20 Shapes.Move(person1,x,y) Program.Delay(100) EndFor enemy="gastly" eattack=15 edefence=15 ehealth=15 battle() Shapes.Remove(person1) x=240 y=160 For i=1 to 7 y=y-20 Shapes.Move(person2,x,y) Program.Delay(100) EndFor For i=1 to 9 x=x-20 Shapes.Move(person2,x,y) Program.Delay(100) EndFor enemy="sneasel" ehealth=27 eattack=20 edefence=20 battle() Shapes.Remove(person2) x=80 y=180 For i=1 to 8 y=y-20 Shapes.Move(person3,x,y) Program.Delay(100) EndFor x=x-20 Shapes.Move(person3,x,y) Program.Delay(100) enemy="houndour" ehealth=23 eattack=25 edefence=25 battle() Shapes.Remove(person3) Shapes.Move(ponyta,40,20) Program.Delay(100) Shapes.Move(ponyta,60,20) Program.Delay(100) Shapes.Move(ponyta,60,40) Program.Delay(250) x=60 y=40 Shapes.Move(player,x,y) y=y+20 Shapes.Move(ponyta,x,y) Program.Delay(100) For i=1 to 3 Shapes.Move(ponyta,x,y) x=x-20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor GraphicsWindow.Clear() route2() x=980 y=60 ponyta=Shapes.AddImage(ponytasprite) Shapes.Move(ponyta,x,y) player=Shapes.AddImage(playersprite) Shapes.Move(player,1000,60) For i=1 to 3 Shapes.Move(player,x,y) y=y+20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor For i=1 to 6 Shapes.Move(player,x,y) x=x-20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor For i=1 to 6 Shapes.Move(player,x,y) y=y-20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor For i=1 to 21 Shapes.Move(player,x,y) x=x-20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor For i=1 to 13 Shapes.Move(player,x,y) y=y+20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor For i=1 to 17 Shapes.Move(player,x,y) x=x-20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor For i=1 To 4 Shapes.Move(player,x,y) y=y+20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor For i=1 to 7 Shapes.Move(player,x,y) x=x+20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor For i=1 to 3 Shapes.Move(player,x,y) y=y+20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor For i=1 to 12 Shapes.Move(player,x,y) x=x-20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor GraphicsWindow.Clear() GraphicsWindow.Width=500 village1() x=480 ponyta=Shapes.AddImage(ponytasprite) Shapes.Move(ponyta,x,y) player=Shapes.AddImage(playersprite) Shapes.Move(player,500,y) For i=1 to 8 Shapes.Move(player,x,y) x=x-20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor For i=1 to 4 Shapes.Move(player,x,y) y=y-20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor For i=1 to 5 Shapes.Move(player,x,y) x=x-20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor For i=1 to 5 Shapes.Move(player,x,y) y=y-20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor For i=1 to 11 Shapes.Move(player,x,y) x=x-20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor GraphicsWindow.Clear() GraphicsWindow.Width=1000 route1() x=980 ponyta=Shapes.AddImage(ponytasprite) Shapes.Move(ponyta,x,y) player=Shapes.AddImage(playersprite) Shapes.Move(player,x+20,y) For i=1 to 11 Shapes.Move(player,x,y) x=x-20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor For i=1 to 7 Shapes.Move(player,x,y) y=y+20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor For i=1 to 9 Shapes.Move(player,x,y) x=x-20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor For i=1 to 9 Shapes.Move(player,x,y) y=y-20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor For i=1 to 9 Shapes.Move(player,x,y) x=x-20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor For i=1 to 7 Shapes.Move(player,x,y) y=y+20 Shapes.Move(ponyta,x,y) Program.Delay(100) EndFor Shapes.Move(player,x,y) x=x+20 Shapes.Move(ponyta,x,y) Program.Delay(250) For i=420 To 440 Step 20 For j=340 To 360 Step 20 Shapes.Remove(rock[i]) EndFor EndFor GraphicsWindow.DrawResizedImage(stairs,420,340,40,40) Program.Delay(2000) GraphicsWindow.Clear() GraphicsWindow.Width=500 cave() Program.Delay(5000) GraphicsWindow.Clear() GraphicsWindow.BackGroundColor="white" GraphicsWindow.FontSize=20 GraphicsWindow.DrawBoundText(10,10,480,"You've completed the Game!") GraphicsWindow.DrawBoundText(10,50,480,"The ponyta has led you to a few other missing pokemon after you defeated team rocket. There are just a few here, so where are the rest?") GraphicsWindow.FontSize=14 GraphicsWindow.DrawBoundText(320,200,170,"I know the menu and the battle weren't very good, but the Program wasn't co-operating with me. I did my best with them. Sorry, if anyone expected more from this, but that's all that I managed. Please note again, that I didn't make any of those images apart from the caterpie, pidgey, rattata, and bookshelves.") GraphicsWindow.DrawResizedImage(ponytaf,10,200,300,300) Sub moveScenes While movement="go" If place="lab" Then If lastplace="village1" Then x=120 y=480 EndIf GraphicsWindow.Clear() canMove="go" player=Shapes.AddImage(playersprite) Shapes.Move(player,x,y) lab() While canMove="go" GraphicsWindow.KeyDown=moveLab EndWhile 'this is your house ElseIf place="house" then GraphicsWindow.Clear() canMove="go" x=120 y=480 player=Shapes.AddImage(playersprite) Shapes.Move(player,x,y) house() While canMove="go" GraphicsWindow.KeyDown=moveHouse EndWhile 'this is the village you start in ElseIf place="village1" then If lastplace="lab" then x=180 y=100 ElseIf lastplace="house" then x=380 y=80 ElseIf lastplace="route1" then x=0 Elseif lastplace="route2" then x=480 EndIf GraphicsWindow.Clear() canMove="go" player=Shapes.AddImage(playersprite) Shapes.Move(player,x,y) village1() While canMove="go" GraphicsWindow.KeyDown=moveVillage1 EndWhile ElseIf place="route1" then If lastplace="village1" then x=980 ElseIf lastplace="village2" then x=0 EndIf GraphicsWindow.Clear() canMove="go" player=Shapes.AddImage(playersprite) Shapes.Move(player,x,y) route1() While canMove="go" GraphicsWindow.KeyDown=moveRoute1 EndWhile ElseIf place="village2" then If lastplace="route1" then x=480 ElseIf lastplace="pokecenter" then x=400 y=100 EndIf GraphicsWindow.Clear() canMove="go" player=Shapes.AddImage(playersprite) Shapes.Move(player,x,y) village2() While canMove="go" GraphicsWindow.KeyDown=moveVillage2 EndWhile ElseIf place="pokecenter" then x=240 y=480 GraphicsWindow.Clear() canMove="go" player=Shapes.AddImage(playersprite) Shapes.Move(player,x,y) pokecenter() While canMove="go" GraphicsWindow.KeyDown=movePokecenter EndWhile ElseIf place="route2" then x=0 y=400 GraphicsWindow.Clear() canMove="go" player=Shapes.AddImage(playersprite) Shapes.Move(player,x,y) route2() While canMove="go" GraphicsWindow.KeyDown=moveRoute2 EndWhile EndIf EndWhile EndSub Sub lab 'make all space empty For i=0 to 480 step 20 For j=0 To 480 Step 20 space[i][j]="empty" 'draw the floor tiles GraphicsWindow.DrawRectangle(i,j,20,20) EndFor EndFor GraphicsWindow.BackgroundColor="white" GraphicsWindow.BrushColor="lightblue" 'make the wall and label it as 'fill'. This means the character can't walk on it. For i=0 To 480 Step 20 For j=0 To 60 Step 20 space[i][j]="fill" 'draw the wall GraphicsWindow.FillRectangle(i,j,20,20) EndFor EndFor 'make the bookshelf For i=0 To 140 Step 20 For j=200 To 260 Step 20 space[i][j]="fill" EndFor EndFor 'use the bookshelf image GraphicsWindow.DrawResizedImage(bookshelf,0,200,160,80) For i=340 To 480 Step 20 For j=200 To 260 Step 20 space[i][j]="fill" EndFor EndFor GraphicsWindow.DrawResizedImage(bookshelf,340,200,160,80) 'this mat will show you where to exit GraphicsWindow.BrushColor="lightgreen" For i=100 To 140 Step 20 For j=460 To 480 Step 20 space[i][j]="mat" GraphicsWindow.FillRectangle(i,j,20,20) EndFor EndFor 'make the pokeball machine (not sure what it's actually called) For i=360 To 400 Step 20 For j=40 To 120 Step 20 space[i][j]="fill" GraphicsWindow.DrawResizedImage(pokeballmachine,360,40,60,100) EndFor EndFor 'add people here. Make the space filled GraphicsWindow.DrawImage(professorsprite,180,120) space[180][120]="fill" GraphicsWindow.DrawImage(aidsprite,40,380) space[40][380]="fill" GraphicsWindow.DrawImage(aidsprite,400,340) space[400][340]="fill" EndSub Sub moveLab mainMove() 'talk to the professor If GraphicsWindow.LastKey="Return" and x=180 and y=140 then Shapes.Remove(talk) Shapes.Remove(box) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("You'd better get going.") Shapes.Move(talk,10,10) 'talk to the aid ElseIf GraphicsWindow.LastKey="Return" and x=40 and y=400 then Shapes.Remove(talk) Shapes.Remove(box) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("The future of all pokemon rests in your hands. Take good care of it.") Shapes.Move(talk,10,10) 'talk to the second aid ElseIf GraphicsWindow.Lastkey="Return" and x=400 and y=360 then Shapes.Remove(talk) Shapes.Remove(box) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("You should head off to Kitehow town now. It's just to the West of here.") Shapes.Move(talk,10,10) 'enter the menu EndIf 'move the player if needed Shapes.Move(player,x,y) 'exit to the village if in the right spot If x>=100 and x<=140 and y=480 then place="village1" lastplace="lab" canMove="no" EndIf EndSub Sub village1 'make every space empty For i=0 to 480 step 20 For j=0 To 480 Step 20 space[i][j]="empty" EndFor EndFor GraphicsWindow.BackgroundColor="limegreen" 'make both parts of the fence For j=0 To 180 Step 20 space[20][j]="fill" GraphicsWindow.FillRectangle(20,j,5,20) EndFor For j=240 To 480 Step 20 space[20][j]="fill" GraphicsWindow.FillRectangle(20,j,5,20) EndFor For j=0 To 360 Step 20 space[480][j]="fill" GraphicsWindow.FillRectangle(480,j,5,20) EndFor For j=440 To 480 Step 20 space[480][j]="fill" GraphicsWindow.FillRectangle(480,j,5,20) EndFor 'make the lab GraphicsWindow.FillRectangle(180,80,20,25) For i=100 To 240 Step 20 For j=0 To 80 Step 20 space[i][j]="fill" GraphicsWindow.DrawResizedImage(labbuilding,100,0,160,100) EndFor EndFor 'make your house GraphicsWindow.FillRectangle(380,60,20,25) For i=360 To 460 Step 20 For j=0 To 60 Step 20 space[i][j]="fill" GraphicsWindow.DrawResizedImage(housebuilding,360,0,120,80) EndFor EndFor 'make two other houses For i=320 To 420 Step 20 For j=240 To 300 Step 20 space[i][j]="fill" GraphicsWindow.DrawResizedImage(housebuilding,320,240,120,80) EndFor EndFor For i=100 To 200 Step 20 For j=320 To 380 Step 20 space[i][j]="fill" GraphicsWindow.DrawResizedImage(housebuilding,100,320,120,80) EndFor EndFor 'add a sign If haveEgg<2 Then GraphicsWindow.DrawResizedImage(sign,460,400,20,20) space[460][400]="fill" EndIf GraphicsWindow.DrawImage(girlsprite,60,140) space[60][140]="fill" GraphicsWindow.DrawImage(girlsprite,320,100) space[320][100]="fill" GraphicsWindow.DrawImage(girlsprite,120,260) space[120][260]="fill" GraphicsWindow.DrawImage(girlsprite,300,400) space[300][400]="fill" EndSub Sub moveVillage1 mainMove() If GraphicsWindow.LastKey="Return" and x=60 and y=160 then Shapes.Remove(talk) Shapes.Remove(box) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("I hear that you're going to find all the pokemon. Good luck!") Shapes.Move(talk,10,10) ElseIf GraphicsWindow.LastKey="Return" and x=320 and y=120 then Shapes.Remove(talk) Shapes.Remove(box) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("My Jigglypuff's Gone! Please get her back...") Shapes.Move(talk,10,10) ElseIf GraphicsWindow.LastKey="Return" and x=120 and y=280 then Shapes.Remove(talk) Shapes.Remove(box) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("Good luck on your journey.") Shapes.Move(talk,10,10) ElseIf GraphicsWindow.LastKey="Return" and x=300 and y=420 then Shapes.Remove(talk) Shapes.Remove(box) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("I don't know what i'll do without my farfetch'd.") Shapes.Move(talk,10,10) ElseIf GraphicsWindow.LastKey="Return" and x=460 and y=420 and haveEgg<2 then Shapes.Remove(talk) Shapes.Remove(box) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("Road is blocked for construction.") Shapes.Move(talk,10,10) 'enter the menu EndIf Shapes.Move(player,x,y) If x=180 And y=100 Then canMove="no" If haveEgg=1 Then movement="no" ElseIf haveEgg<>1 then place="lab" lastplace="village1" EndIf ElseIf x=380 and y=80 then canMove="no" place="house" lastplace="village1" ElseIf x=0 and y<=220 and y>=200 then canMove="no" place="route1" lastplace="village1" Elseif x=480 and y>=380 and y<=420 and haveEgg=2 then canMove="no" place="route2" lastplace="village1" EndIf EndSub Sub house 'reset all spaces For i=0 to 480 step 20 For j=0 To 480 Step 20 space[i][j]="empty" EndFor EndFor GraphicsWindow.BackGroundColor="darkkhaki" 'make a wall For i=0 To 480 Step 20 For j=0 To 80 Step 20 space[i][j]="fill" GraphicsWindow.FillRectangle(i,j,20,20) EndFor EndFor 'Make a second wall GraphicsWindow.DrawRectangle(280,0,20,280) For j=0 To 260 Step 20 space[280][j]="fill" GraphicsWindow.FillRectangle(280,j,20,20) EndFor 'make a table GraphicsWindow.DrawResizedImage(table,240,340,80,80) For i=240 To 300 Step 20 For j=340 To 400 Step 20 space[i][j]="fill" EndFor EndFor 'make the mat For i=100 To 140 Step 20 For j=460 To 480 Step 20 space[i][j]="mat" GraphicsWindow.FillRectangle(i,j,20,20) EndFor EndFor 'make some stairs GraphicsWindow.DrawResizedImage(stairs,0,80,120,80) For i=0 To 100 Step 20 For j=80 To 140 Step 20 space[i][j]="fill" EndFor EndFor 'make a kitchen GraphicsWindow.DrawResizedImage(kitchen,301,60,200,80) For i=300 To 480 Step 20 For j=80 To 120 Step 20 space[i][j]="fill" EndFor EndFor 'put in the mother GraphicsWindow.DrawImage(mothersprite,200,340) space[200][340]="fill" EndSub Sub moveHouse mainMove() If GraphicsWindow.LastKey="Return" and x=200 and y=360 then Shapes.Remove(talk) Shapes.Remove(star) Shapes.Remove(box) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("Stay here for a bit. I'll heal your pokemon.") Shapes.Move(talk,10,10) star=Shapes.AddImage(starsprite) Shapes.Move(star,200,360) pokemonhealth=pokemonmaxhealth EndIf Shapes.Move(player,x,y) If x=120 And y=480 Then canMove="no" place="village1 lastplace="house" EndIf EndSub Sub route1 GraphicsWindow.Width=1000 For i=0 to 980 step 20 For j=0 To 480 Step 20 space[i][j]="empty" EndFor EndFor 'add trees GraphicsWindow.BackgroundColor="lawngreen" For i=0 To 980 Step 20 For j=0 To 60 Step 20 space[i][j]="fill" space[i][j+20]="fill" GraphicsWindow.DrawImage(tree,i,j) EndFor EndFor 'add more trees For i=0 To 980 Step 20 For j=380 To 480 Step 20 space[i][j]="fill" space[i][j+20]="fill" GraphicsWindow.DrawImage(tree,i,j) EndFor EndFor 'show the entrance For j=200 To 220 Step 20 GraphicsWindow.FillRectangle(980,j,20,20) EndFor 'add grass For i=80 To 900 Step 20 For j=100 To 360 Step 20 space[i][j]="grass" GraphicsWindow.DrawImage(grass,i,j) EndFor EndFor 'these are all ridges that you can't go over For j=200 To 360 Step 20 space[360][j]="fill" GraphicsWindow.DrawImage(ridge,360,j) EndFor For j=200 To 360 Step 20 space[320][j]="fill" GraphicsWindow.DrawImage(ridge,320,j) EndFor space[340][100]="fill" GraphicsWindow.DrawImage(ridge,340,100) For i=100 To 320 Step 20 space[i][120]="fill" GraphicsWindow.DrawImage(ridge,i,120) EndFor For j=120 To 260 Step 20 space[180][j]="fill" GraphicsWindow.DrawImage(ridge,180,j) EndFor For i=420 To 540 Step 20 space[i][200]="fill" GraphicsWindow.DrawImage(ridge,i,200) EndFor For j=200 To 360 Step 20 space[560][j]="fill" GraphicsWindow.DrawImage(ridge,560,j) EndFor For j=100 To 320 Step 20 space[680][j]="fill" GraphicsWindow.DrawImage(ridge,680,j) EndFor For i=680 To 720 Step 20 space[i][140]="fill" GraphicsWindow.DrawImage(ridge,i,140) EndFor For j=140 To 300 Step 20 space[740][j]="fill" GraphicsWindow.DrawImage(ridge,740,j) EndFor 'make the other exit GraphicsWindow.FillRectangle(0,360,20,20) 'make a pile of rocks For i=420 To 440 Step 20 For j=340 To 360 Step 20 space[i][j]="fill" rock[i]=Shapes.AddImage(ridge) Shapes.Move(rock[i],i,j) EndFor EndFor 'add items If item1=0 Then item1sprite=Shapes.AddImage(itemsprite) Shapes.Move(item1sprite,320,100) space[320][100]="fill" EndIf If item2=0 Then item2sprite=Shapes.AddImage(itemsprite) Shapes.Move(item2sprite,340,360) space[340][360]="fill" EndIf If item3=0 then item3sprite=Shapes.AddImage(itemsprite) Shapes.Move(item3sprite,700,160) space[700][160]="fill" EndIf 'add a couple people that you will be able to battle person1=Shapes.AddImage(boysprites) Shapes.Move(person1,160,200) space[160][200]="fill" person2=Shapes.AddImage(boyspriteb) Shapes.Move(person2,220,360) space[220][360]="fill" person3=Shapes.AddImage(boysprites) Shapes.Move(person3,540,220) space[540][220]="fill" EndSub Sub moveRoute1 mainMove() 'these next three Ifs will be picking up items If GraphicsWindow.LastKey="Return" And x=300 And y=100 And item1=0 Then Shapes.Remove(box) Shapes.Remove(talk) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(1000,80) GraphicsWindow.BrushColor="blue" talk=SHapes.AddText("You have found a potion.") Shapes.Move(talk,10,10) potion=potion+1 item1=1 Shapes.Remove(item1sprite) ElseIf GraphicsWindow.LastKey="Return" and x=340 and y=340 and item2=0 then Shapes.Remove(box) Shapes.Remove(talk) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(1000,80) GraphicsWindow.BrushColor="blue" talk=SHapes.AddText("You have found a potion.") Shapes.Move(talk,10,10) potion=potion+1 item2=1 Shapes.Remove(item2sprite) ElseIf GraphicsWindow.LastKey="Return" and x=700 and y=180 and item3=0 then Shapes.Remove(box) Shapes.Remove(talk) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(1000,80) GraphicsWindow.BrushColor="blue" talk=SHapes.AddText("You have found a potion.") Shapes.Move(talk,10,10) potion=potion+1 item3=1 Shapes.Remove(item3sprite) ElseIf GraphicsWindow.LastKey="Return" and x=140 and y=200 then If battle1=0 then enemy="caterpie" ehealth=20 edefence=6 eattack=12 battle() battle1=1 ElseIf battle1=1 then Shapes.Remove(box) Shapes.Remove(talk) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(1000,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("I can't believe you beat me...") Shapes.Move(talk,10,10) EndIf ElseIf GraphicsWindow.LastKey="Return" and x=220 and y=340 then If battle2=0 then enemy="hoothoot" ehealth=20 edefence=6 eattack=12 battle() battle2=1 ElseIf battle2=1 then Shapes.Remove(box) Shapes.Remove(talk) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(1000,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("I need to get stronger, but there's nobody to battle me...") Shapes.Move(talk,10,10) EndIf ElseIf GraphicsWindow.LastKey="Return" and x=520 and y=220 then If battle3=0 then enemy="rattata" ehealth=20 edefence=4 eattack=8 battle() battle3=1 Elseif battle3=1 then Shapes.Remove(box) Shapes.Remove(talk) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(1000,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("I wonder why my pokemon aren't gone.") Shapes.Move(talk,10,10) EndIf EndIf Shapes.Move(player,x,y) If x=980 And y<=220 And y>=200 Then canMove="no" place="village1" lastplace="route1" GraphicsWindow.Width=500 ElseIf x=0 and y=360 then canMove="no" place="village2" lastplace="route1" GraphicsWindow.Width=500 EndIf If space[x][y]="grass" and justmove=1 Then battlechance=Math.GetRandomNumber(1000) If battlechance>950 Then battlechance=Math.GetRandomNumber(4) If battlechance=1 Then enemy="pidgey" ElseIf battlechance=2 then enemy="rattata" ElseIf battlechance=3 then enemy="sentret" ElseIf battlechance=4 then enemy="hoothoot" EndIf level=Math.GetRandomNumber(4) ehealth=Math.GetRandomNumber(2)*level+5 eattack=Math.GetRandomNumber(3)*level+3 edefence=1*level battle() EndIf EndIf EndSub Sub village2 For i=0 To 480 Step 20 For j=0 To 480 Step 20 space[i][j]="empty" EndFor EndFor GraphicsWindow.BackgroundColor="limegreen" For j=0 To 340 Step 20 space[480][j]="fill" GraphicsWindow.FillRectangle(480,j,5,20) EndFor For j=380 To 480 Step 20 space[480][j]="fill" GraphicsWindow.FillRectangle(480,j,5,20) EndFor 'add a block of water For i=0 To 220 Step 20 For j=300 To 480 Step 20 space[i][j]="fill" GraphicsWindow.DrawResizedImage(water,i,j,22,22) EndFor EndFor 'put in the pokecenter GraphicsWindow.DrawResizedImage(pokecenterbuilding,340,0,120,100) GraphicsWindow.FillRectangle(380,100,40,20) For i=340 To 440 Step 20 For j=0 To 80 Step 20 space[i][j]="fill" EndFor EndFor 'put a couple houses GraphicsWindow.DrawResizedImage(housebuilding,0,0,120,80) For i=0 To 100 Step 20 For j=0 To 60 Step 20 space[i][j]="fill" EndFor EndFor GraphicsWindow.DrawResizedImage(housebuilding,40,120,120,80) For i=40 To 140 Step 20 For j=120 To 180 Step 20 space[i][j]="fill" EndFor EndFor GraphicsWindow.DrawResizedImage(housebuilding,240,360,120,80) For i=240 To 340 Step 20 For j=360 To 420 Step 20 space[i][j]="fill" EndFor EndFor 'add people GraphicsWindow.DrawImage(lady1sprite,300,300) space[300][300]="fill" GraphicsWindow.DrawImage(lady2sprite,300,160) space[300][160]="fill" GraphicsWindow.DrawImage(girlsprite,320,160) space[320][160]="fill" GraphicsWindow.DrawImage(lady1sprite,380,260) space[380][260]="fill" EndSub Sub moveVillage2 mainMove() If GraphicsWindow.LastKey="Return" And x=300 And y=320 Then Shapes.Remove(box) Shapes.Remove(talk) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("It feels so empty now.") Shapes.Move(talk,10,10) ElseIf GraphicsWindow.LastKey="Return" and x=300 and y=180 then Shapes.Remove(box) Shapes.Remove(talk) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("My little sister really misses her Pikachu. Can you get it back?") Shapes.Move(talk,10,10) ElseIf GraphicsWindow.LastKey="Return" and x=320 and y=180 then Shapes.Remove(box) Shapes.Remove(talk) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("My daddy's gone to find our pokemon. Have you seen him?") Shapes.Move(talk,10,10) ElseIf GraphicsWindow.LastKey="Return" and x=380 and y=280 then Shapes.Remove(box) Shapes.Remove(talk) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("You're going to find them all?") Shapes.Move(talk,10,10) EndIf Shapes.Move(player,x,y) If x=480 And y=360 Then canMove="no" place="route1" lastplace="village2" ElseIf x>=380 and x<=400 and y=100 then canMove="no" place="pokecenter" lastplace="village2" EndIf EndSub Sub pokecenter For i=0 To 480 Step 20 For j=0 To 480 Step 20 space[i][j]="empty" EndFor EndFor GraphicsWindow.BackgroundColor="#E5DFAF" 'make the counter GraphicsWindow.BrushColor="white" GraphicsWindow.FillRectangle(120,180,260,20) GraphicsWindow.BrushColor="#F68170" GraphicsWindow.FillRectangle(120,0,40,180) GraphicsWindow.FillRectangle(340,0,40,180) GraphicsWindow.FillRectangle(160,160,180,20) For i= 120 To 360 Step 20 For j=0 To 180 Step 20 space[i][j]="fill" EndFor EndFor 'add mat GraphicsWindow.FillRectangle(240,480,20,20) 'add the nurse GraphicsWindow.DrawImage(nursesprite,240,140) 'add people GraphicsWindow.DrawImage(lady1sprite,40,180) space[40][180]="fill" GraphicsWindow.DrawImage(boysprites,360,260) space[360][260]="fill" GraphicsWindow.DrawImage(girlsprite,100,340) space[100][340]="fill" EndSub Sub movePokecenter mainMove() If GraphicsWindow.LastKey="Return" And x=240 And y=200 Then Shapes.Remove(talk) Shapes.Remove(star) Shapes.Remove(box) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("If you wait a moment, I'll heal your pokemon.") Shapes.Move(talk,10,10) star=Shapes.AddImage(starsprite) Shapes.Move(star,240,200) pokemonhealth=pokemonmaxhealth EndIf Shapes.Move(player,x,y) If x=240 And y=480 Then canMove="no" If haveEgg=0 Then movement="no" ElseIf haveEgg<>0 then place="village2" lastplace="pokecenter" EndIf ElseIf GraphicsWindow.LastKey="Return" and x=40 and y=200 then Shapes.Remove(box) Shapes.Remove(talk) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("This is terrible service! They won't give my pokemon back!") Shapes.Move(talk,10,10) Elseif GraphicsWindow.LastKey="Return" and x=340 and y=260 then Shapes.Remove(box) Shapes.Remove(talk) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("How where they stolen from here?") Shapes.Move(talk,10,10) ElseIf GraphicsWindow.LastKey="Return" and x=100 and y=360 then Shapes.Remove(box) Shapes.Remove(talk) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("My pokemon was my life.") Shapes.Move(talk,10,10) EndIf EndSub Sub route2 GraphicsWindow.Width=1000 GraphicsWindow.BackgroundColor="lawngreen" For i=0 To 980 Step 20 For j=0 to 480 step 20 space[i][j]="empty" EndFor EndFor 'exit places GraphicsWindow.FillRectangle(0,400,20,20) GraphicsWindow.FillRectangle(980,60,20,20) 'add forest For i=0 To 140 Step 20 For j=420 To 480 step 20 space[i][j]="fill" space[i][j+20]="fill" GraphicsWindow.DrawImage(tree,i,j) EndFor EndFor For i=0 To 360 Step 20 For j=0 To 80 Step 20 space[i][j]="fill" space[i][j+20]="fill" GraphicsWindow.DrawImage(tree,i,j) EndFor EndFor For i=640 to 980 Step 20 For j=300 To 480 Step 20 space[i][j]="fill" space[i][j+20]="fill" GraphicsWindow.DrawImage(tree,i,j) EndFor EndFor 'add grass For i=120 To 620 Step 20 For j=300 To 340 Step 20 space[i][j]="grass" GraphicsWindow.DrawImage(grass,i,j) EndFor EndFor For i=0 To 100 Step 20 For j=220 To 340 Step 20 space[i][j]="grass" GraphicsWindow.DrawImage(grass,i,j) EndFor EndFor For i=120 To 240 Step 20 For j=220 To 260 Step 20 space[i][j]="grass" GraphicsWindow.DrawImage(grass,i,j) EndFor EndFor For i=0 To 220 Step 20 For j=120 To 180 Step 20 space[i][j]="grass" GraphicsWindow.DrawImage(grass,i,j) EndFor EndFor space[i][j]="grass" GraphicsWindow.DrawImage(grass,240,120) For i=380 To 800 Step 20 For j=0 To 40 Step 20 space[i][j]="grass" GraphicsWindow.DrawImage(grass,i,j) EndFor EndFor For i=820 To 980 Step 20 space[i][0]="grass" GraphicsWindow.DrawImage(grass,i,0) EndFor For i=840 To 860 Step 20 For j=20 To 140 Step 20 space[i][j]="grass" GraphicsWindow.DrawImage(grass,i,j) EndFor EndFor For i=880 To 980 Step 20 For j=120 To 140 Step 20 space[i][j]="grass" GraphicsWindow.DrawImage(grass,i,j) EndFor EndFor For i=900 To 940 Step 20 For j=40 To 80 Step 20 space[i][j]="grass" GraphicsWindow.DrawImage(grass,i,j) EndFor EndFor 'add ridges For i=0 To 220 Step 20 space[i][360]="fill" GraphicsWindow.DrawImage(ridge,i,360) EndFor For i=120 To 980 Step 20 space[i][280]="fill" GraphicsWindow.DrawImage(ridge,i,280) EndFor For i=0 To 220 Step 20 space[i][200]="fill" GraphicsWindow.DrawImage(ridge,i,200) EndFor For j=140 to 200 step 20 space[240][j]="fill" GraphicsWindow.DrawImage(ridge,240,j) EndFor For i=460 To 800 Step 20 space[i][60]="fill" GraphicsWindow.DrawImage(ridge,i,60) EndFor For j=20 To 160 Step 20 space[820][j]="fill" GraphicsWindow.DrawImage(ridge,820,j) EndFor For i=840 To 980 Step 20 space[i][160]="fill" GraphicsWindow.DrawImage(ridge,i,160) EndFor For i=880 To 940 Step 20 space[i][100]="fill" GraphicsWindow.DrawImage(ridge,i,100) EndFor For j=20 To 80 Step 20 space[880][j]="fill" GraphicsWindow.DrawImage(ridge,880,j) EndFor For i=900 To 980 Step 20 space[i][20]="fill" GraphicsWindow.DrawImage(ridge,i,20) EndFor 'add items If item4=0 Then item4sprite=Shapes.AddImage(itemsprite) Shapes.Move(item4sprite,620,480) space[620][480]="fill" EndIf If item5=0 Then item5sprite=Shapes.AddImage(itemsprite) Shapes.Move(item5sprite,620,300) space[620][300]="fill" EndIf If item6=0 Then item6sprite=Shapes.AddImage(itemsprite) Shapes.Move(item6sprite,0,140) space[0][140]="fill" EndIf If item7=0 Then item7sprite=Shapes.AddImage(itemsprite) Shapes.Move(item7sprite,900,40) space[900][40]="fill" EndIf 'add people person1=Shapes.AddImage(boyspriteb) Shapes.Move(person1,160,480) space[160][480]="fill" person2=Shapes.AddImage(boysprites2) Shapes.Move(person2,20,240) space[20][240]="fill" person3=Shapes.AddImage(boysprites) Shapes.Move(person3,660,160) space[660][160]="fill" person4=Shapes.AddImage(boyspriteb) Shapes.Move(person4,840,140) space[840][140]="fill" EndSub Sub moveRoute2 mainMove() 'get items If GraphicsWindow.LastKey="Return" And x=620 And y=460 And item4=0 Then Shapes.Remove(box) Shapes.Remove(talk) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(1000,80) GraphicsWindow.BrushColor="blue" talk=SHapes.AddText("You have found a potion.") Shapes.Move(talk,10,10) potion=potion+1 item4=1 Shapes.Remove(item4sprite) ElseIf GraphicsWindow.LastKey="Return" and x=620 and y=320 and item5=0 then Shapes.Remove(box) Shapes.Remove(talk) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(1000,80) GraphicsWindow.BrushColor="blue" talk=SHapes.AddText("You have found a potion.") Shapes.Move(talk,10,10) potion=potion+1 item5=1 Shapes.Remove(item5sprite) ElseIf GraphicsWindow.LastKey="Return" and x=20 and y=140 and item6=0 then Shapes.Remove(box) Shapes.Remove(talk) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(1000,80) GraphicsWindow.BrushColor="blue" talk=SHapes.AddText("You have found a potion.") Shapes.Move(talk,10,10) potion=potion+1 item6=1 Shapes.Remove(item6sprite) ElseIf GraphicsWindow.LastKey="Return" and x=900 and y=60 and item7=0 then Shapes.Remove(box) Shapes.Remove(talk) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(1000,80) GraphicsWindow.BrushColor="blue" talk=SHapes.AddText("You have found a potion.") Shapes.Move(talk,10,10) potion=potion+1 item7=1 Shapes.Remove(item7sprite) Elseif GraphicsWindow.LastKey="Return" and x=160 and y=460 then If battle4=0 then enemy="weedle" ehealth=18 eattack=9 edefence=12 battle() battle4=1 Elseif battle4=1 then Shapes.Remove(box) Shapes.Remove(talk) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("At least my pokemon are still here.") Shapes.Move(talk,10,10) EndIf Elseif GraphicsWindow.LastKey="Return" and x=40 and y=240 then If battle5=0 then enemy="bellsprout" ehealth=18 eattack=9 edefence=12 battle() battle5=1 Elseif battle5=1 then Shapes.Remove(box) Shapes.Remove(talk) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("I never even saw anyone taking them.") Shapes.Move(talk,10,10) EndIf Elseif GraphicsWindow.LastKey="Return" and x=640 and y=160 then If battle6=0 then enemy="pidgey" ehealth=18 eattack=9 edefence=12 battle() battle6=1 Elseif battle6=1 then Shapes.Remove(box) Shapes.Remove(talk) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("Why are all the stronger wild pokemon gone?") Shapes.Move(talk,10,10) EndIf Elseif GraphicsWindow.LastKey="Return" and x=840 and y=120 then If battle7=0 then enemy="ledyba" ehealth=18 eattack=9 edefence=12 battle() battle7=1 ElseIf battle7=1 then Shapes.Remove(box) Shapes.Remove(talk) GraphicsWindow.BrushColor="yellow" box=Shapes.AddRectangle(500,80) GraphicsWindow.BrushColor="blue" talk=Shapes.AddText("Everybody's left the town. Team rocket has taken over.") Shapes.Move(talk,10,10) EndIf EndIf Shapes.Move(player,x,y) If x=0 And y=400 Then place="village1" lastplace="route2" canMove="no" GraphicsWindow.Width=500 ElseIf x=980 and y=60 then canMove="no" movement="no" EndIf If space[x][y]="grass" and justmove=1 Then battlechance=Math.GetRandomNumber(1000) If battlechance>950 Then battlechance=Math.GetRandomNumber(3) If battlechance=1 Then enemy="ledyba" ElseIf battlechance=2 then enemy="weedle" ElseIf battlechance=3 then enemy="bellsprout" EndIf level=Math.GetRandomNumber(6) ehealth=Math.GetRandomNumber(2)*level+5 eattack=Math.GetRandomNumber(3)*level+3 edefence=1*level battle() EndIf EndIf EndSub Sub village3'I don't need to add the space[i][j] here because you won't be moving here. This is just the background for a scene. GraphicsWindow.BackGroundColor="lawngreen" 'make the fence For j=0 To 40 Step 20 GraphicsWindow.FillRectangle(20,j,5,20) EndFor For j=80 To 480 step 20 GraphicsWindow.FillRectangle(20,j,5,20) EndFor 'make the houses GraphicsWindow.DrawResizedImage(housebuilding,260,40,120,100) GraphicsWindow.DrawResizedImage(housebuilding,40,260,120,100) GraphicsWindow.DrawResizedImage(housebuilding,220,380,120,100) 'make the pokecenter GraphicsWindow.DrawResizedImage(pokecenterbuilding,240,220,120,100) 'add the pokemon ponyta=Shapes.AddImage(ponytasprite) Shapes.Move(pokemon,100,80) 'add team rocket person1=Shapes.AddImage(teamrocket) Shapes.Move(person1,120,40) person2=Shapes.AddImage(teamrocket) Shapes.Move(person2,240,160) person3=Shapes.AddImage(teamrocket) Shapes.Move(person3,80,180) EndSub Sub cave GraphicsWindow.DrawResizedImage(cave,0,0,500,500) GraphicsWindow.DrawImage(rarepokemon,210,200) EndSub Sub nextText If GraphicsWindow.LastKey="Return" Then 'advances the txt and plays txt=txt+1 pause=0 EndIf EndSub Sub switch If GraphicsWindow.LastKey="A" Then 'cycle to the left poke=poke-1 If poke=0 Then poke=3 EndIf pause=0 ElseIf GraphicsWindow.LastKey="D" then 'cycle to the right poke=poke+1 If poke=4 then poke=1 EndIf pause=0 ElseIf GraphicsWindow.LastKey="Return" then 'select and set stats pokemonmaxhealth=Math.GetRandomNumber(2)+18 pokemonhealth=pokemonmaxhealth pokemonattack=Math.GetRandomNumber(3)+5 pokemondefence=5 pokemonlevel=5 pokemonexp=0 'end the while loop choose=0 EndIf EndSub Sub chooseYesNo If GraphicsWindow.MouseY>=230 And GraphicsWindow.MouseY<=270 And GraphicsWindow.MouseX>=160 And GraphicsWindow.MouseX<=240 Then answer="yes" choose=1 ElseIf GraphicsWindow.MouseY>=230 And GraphicsWindow.MouseY<=270 And GraphicsWindow.MouseX>=260 And GraphicsWindow.MouseX<=340 Then answer="no" choose=1 EndIf EndSub Sub menu GraphicsWindow.Hide() TextWindow.Show() While menugo>0 TextWindow.Clear() TextWindow.WriteLine("Pokemon: ") TextWindow.WriteLine(pokemon) TextWindow.WriteLine("Health: "+pokemonhealth+"/"+pokemonmaxhealth) TextWindow.WriteLine("Level: "+pokemonlevel) TextWindow.WriteLine("Exp: "+pokemonexp) TextWindow.WriteLine("") TextWindow.WriteLine("(1)Potions: "+potion) TextWindow.WriteLine("") TextWindow.WriteLine("(2)Exit") choice=TextWindow.ReadNumber() If choice=1 and potion>0 then pokemonhealth=pokemonhealth+20 If pokemonhealth>pokemonmaxhealth then pokemonhealth=pokemonmaxhealth EndIf potion=potion-1 menugo=menugo-1 Elseif choice=2 then menugo=0 EndIf EndWhile TextWindow.Hide() GraphicsWindow.Show() EndSub Sub battle battlego=1 GraphicsWindow.Hide() TextWindow.Show() While pokemonhealth>0 And ehealth>0 And battlego=1 TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(pokemon) TextWindow.WriteLine("Health: "+pokemonhealth+"/"+pokemonmaxhealth) TextWindow.WriteLine("") TextWindow.WriteLine(enemy) TextWindow.WriteLine("Enemy Health: "+ehealth) TextWindow.WriteLine("") TextWindow.WriteLine("(1)Tackle") If pokemon="Pidgey" Then TextWindow.WriteLine("(2)Gust") ElseIf pokemon="Rattata" then TextWindow.WriteLine("(2)Quick Attack") ElseIf pokemon="Caterpie" then TextWindow.WriteLine("(2)Bugbite") EndIf TextWindow.WriteLine("(3)Potion: "+potion) TextWindow.WriteLine("(4)Escape") choice=TextWindow.ReadNumber() If choice=1 Then damage=pokemonattack*1-edefence ElseIf choice=2 and pokemon="Pidgey" then damage=pokemonattack*0.8-edefence ElseIf choice=2 and pokemon="Rattata" then damage=pokemonattack*0.8-edefence ElseIf choice=2 and pokemon="Caterpie" then damage=pokemonattack*1.2-edefence EndIf If damage>0 Then ehealth=ehealth-damage TextWindow.WriteLine("You have done "+damage+" damage.") EndIf damage=0 If choice=3 And potion>0 Then pokemonhealth=pokemonhealth+20 If pokemonhealth>pokemonmaxhealth then pokemonhealth=pokemonmaxhealth EndIf potion=potion-1 TextWindow.WriteLine("You have used a potion.") elseIf choice=4 Then battlego=0 EndIf 'enemy turn If ehealth>0 then If enemy="hoothoot" Then move=Math.GetRandomNumber(2) If move=1 then damage=eattack*1-pokemondefence ElseIf move=2 then damage=eattack*0.7-pokemondefence EndIf ElseIf enemy="pidgey" then move=Math.GetRandomNumber(2) If move=1 then damage=eattack*1-pokemondefence ElseIf move=2 then damage=eattack*0.8-pokemondefence EndIf Elseif enemy="rattata" then move=Math.GetRandomNumber(2) If move=1 then damage=eattack*1-pokemondefence ElseIf move=2 then damage=eattack*0.8-pokemondefence EndIf ElseIf enemy="sentret" then move=Math.GetRandomNumber(2) If move=1 then damage=eattack*0.8-pokemondefence ElseIf move=2 then damage=eattack*0.8-pokemondefence EndIf Elseif enemy="caterpie" then move=Math.GetRandomNumber(2) If move=1 then damage=eattack*1-pokemondefence ElseIf move=2 then damage=eattack*1.2-pokemondefence EndIf Elseif enemy="ledyba" then move=Math.GetRandomNumber(2) If move=1 then damage=eattack*1-pokemondefence ElseIf move=2 then damage=eattack*0.36-pokemondefence EndIf Elseif enemy="weedle" then move=Math.GetRandomNumber(2) If move=1 then damage=eattack*0.3-pokemondefence ElseIf move=2 then damage=eattack*1.2-pokemondefence EndIf Elseif enemy="bellsprout" then move=Math.GetRandomNumber(2) If move=1 then damage=eattack*0.7-pokemondefence ElseIf move=2 then damage=eattack*0.3-pokemondefence EndIf ElseIf enemy="gastly" then move=Math.GetRandomNumber(2) If move=1 then damage=eattack*0.4-pokemondefence ElseIf move=2 then damage=eattack*1.6-pokemondefence EndIf Elseif enemy="houndour" then move=Math.GetRandomNumber(2) If move=1 then damage=eattack*0.8-pokemondefence ElseIf move=2 then damage=eattack*0.4-pokemondefence EndIf Elseif enemy="sneasel" then move=Math.GetRandomNumber(2) If move=1 then damage=eattack*0.8-pokemondefence ElseIf move=2 then damage=eattack*1.2-pokemondefence EndIf EndIf If damage>0 then pokemonhealth=pokemonhealth-damage TextWindow.WriteLine("The enemy has done "+damage+" damage.") EndIf EndIf damage=0 TextWindow.Pause() EndWhile If pokemonhealth<=0 Then place="village1" lastplace="house" pokemonhealth=pokemonmaxhealth canMove="no" GraphicsWindow.Width=500 If haveEgg=2 Then Goto revive EndIf ElseIf pokemonhealth>0 and battlego=1 then expgain=250/pokemonlevel expgain=Math.Round(expgain) pokemonexp=pokemonexp+expgain TextWindow.WriteLine("You have gained "+expgain+" exp.") If pokemonexp>=100 then pokemonexp=pokemonexp-100 pokemonlevel=pokemonlevel+1 pokemonmaxhealth=pokemonmaxhealth+Math.GetRandomNumber(2) pokemonattack=pokemonattack+1 pokemondefence=pokemondefence+1 TextWindow.WriteLine("You have gone up a level.") EndIf TextWindow.Pause() EndIf TextWindow.Hide() GraphicsWindow.Show() EndSub Sub mainMove justmove=0 Shapes.Remove(box) Shapes.Remove(talk) Shapes.Remove(star) 'if the last key is a and you can move right, then move right. This also gets rid of any text boxes If GraphicsWindow.LastKey="A" And Shapes.GetLeft(player)>0 And space[x-20][y]<>"fill" Then x=x-20 justmove=1 'moving down ElseIf GraphicsWindow.LastKey="S" and Shapes.GetTop(player)<480 and space[x][y+20]<>"fill" then y=y+20 justmove=1 'move left ElseIf GraphicsWindow.LastKey="D" and Shapes.GetLeft(player)<(GraphicsWindow.Width-20) and space[x+20][y]<>"fill" then x=x+20 justmove=1 'move up ElseIf GraphicsWindow.LastKey="W" and Shapes.GetTop(player)>0 and space[x][y-20]<>"fill" then y=y-20 justmove=1 'enters menu ElseIf GraphicsWindow.LastKey="Space" then menugo=100 menu() 'teleports to home (if you get stuck somewhere like my brother manages in route 1) ElseIf GraphicsWindow.LastKey="U" then canMove="no" place="village1" lastplace="house" GraphicsWindow.Width=500 EndIf EndSub End>GJZ341.sb< Start>GKC522.sb< args=0 GraphicsWindow.BackgroundColor ="teal GraphicsWindow .PenWidth =1 GraphicsWindow .PenColor ="lime GraphicsWindow.Width=800 GraphicsWindow.Height =800 GraphicsWindow.Left =5 GraphicsWindow .Top=0 L3000=1900 LDEvents.MouseWheel =mww For f=0 to 3 LDGraphicsWindow .PauseUpdates () T_x=376 T_y=370 t_Angle =f*45 For i = 1 To L3000 GraphicsWindow.penColor = LDColours.HSLtoRGB(120 1 .8-i/5000) GraphicsWindow.PenWidth =4-i/1000 ldcall.Function("t_Move", -(5-i/1000)) t_Angle=t_Angle+(i*16.18) GraphicsWindow .Title=i EndFor T_X =376 T_Y=372 T_Angle =f*45 For i = 1 To L3000 GraphicsWindow.penColor = LDColours.HSLtoRGB(120+i/5 1 .8-i/5000) GraphicsWindow.PenWidth =4-i/1000 ldcall.Function("t_Move" (5-i/1000)) t_Angle=t_Angle+(i*16.18) GraphicsWindow .Title=i EndFor LDGraphicsWindow.ResumeUpdates () EndFor Sub mww scc=scc+ LDEvents.LastMouseWheelDelta/10 LDGraphicsWindow.Reposition (scc scc 0 0 0) EndSub sub t_Move ds=args[1] mm=LDMath.Convert2Cartesian (t_x,t_y,ds, t_Angle-90 ) shapes.AddLine (T_x T_y mm[1] mm[2]) t_x= (mm[1]) t_y= (mm[2]) EndSub End>GKC522.sb< Start>GKC975.sb< ' Turtle 5 Pointed Star ' Copyright © 2018 Nonki Takahashi. The MIT License. ' Last update 2018-02-05 GraphicsWindow.Title = "Turtle 5 Pointed Star" Turtle.Speed = 8 Turtle.TurnRight() e = 100 For i = 1 To 5 Turtle.Turn(-2 * 36) Turtle.Move(e) Turtle.Turn(4 * 36) Turtle.Move(e) EndFor a18 = Math.GetRadians(18) a36 = Math.GetRadians(36) a54 = Math.GetRadians(54) h = e * Math.Cos(a36) / Math.Cos(a54) w = h * Math.Tan(a18) * 2 h2 = e * Math.Cos(a18) w2 = e * Math.Sin(a18) * 2 ox = Turtle.X + w2 / 2 oy = Turtle.Y + (h - h2) a = 0 GraphicsWindow.BrushColor = "Gold" For i = 1 To 5 x1 = ox + h * Math.Sin(a) y1 = oy - h * Math.Cos(a) x2 = ox - w / 2 * Math.Cos(a) y2 = oy - w / 2 * Math.Sin(a) x3 = ox + w / 2 * Math.Cos(a) y3 = oy + w / 2 * Math.Sin(a) GraphicsWindow.FillTriangle(x1, y1, x2, y2, x3, y3) a = a + 2 * a36 EndFor End>GKC975.sb< Start>GKD178.sb< Max = 99 'Change this value if you want more or less bottles V = "beer" 'You can also cange this value if you want For Number = Max To 0 Step -1 If Number > 2 Then TextWindow.WriteLine(Number+" bottles of "+V+" on the wall, "+Number+" bottles of "+V+".") TextWindow.WriteLine("Take one down and pass it around, "+(Number - 1)+" bottles of "+V+" on the wall.") ElseIf Number = 2 Then TextWindow.WriteLine("2 bottles of "+V+" on the wall, 2 bottles of "+V+".") TextWindow.WriteLine("Take one down and pass it around, 1 bottle of "+V+" on the wall.") ElseIf Number = 1 Then TextWindow.WriteLine("1 bottle of "+V+" on the wall, 1 bottle of "+V+".") TextWindow.WriteLine("Take one down and pass it around, no more bottles of "+V+" on the wall.") ElseIf Number = 0 Then TextWindow.WriteLine("No more bottles of "+V+" on the wall, no more bottles of "+V+".") TextWindow.WriteLine("Go to the store and buy some more, "+Max+" bottles of "+V+" on the wall.") EndIf EndFor End>GKD178.sb< Start>GKD817.sb< GraphicsWindow.Hide() GraphicsWindow.CanResize = "false" GraphicsWindow.Width = 900 GraphicsWindow.Height = 700 GraphicsWindow.Title = "kubomali GraphicsWindow.Left = (Desktop.Width - 2569) / 10 GraphicsWindow.Top = (Desktop.Height - 768) / 10 '----------------------------------------------------------------------------------------- 'preload some gfx '----------------------------------------------------------------------------------------- Path = "http://smallbasic.com/drop/sokoser" background = ImageList.LoadImage( Path + "/sokocuteff.png") image["A"] = ImageList.LoadImage( Path + "/sokocute0a.png") image["B"] = ImageList.LoadImage( Path + "/sokocute0b.png") image["7"] = ImageList.LoadImage( Path + "/sokocute07.png") image["6"] = ImageList.LoadImage( Path + "/sokocute06.png") image["5"] = ImageList.LoadImage( Path + "/sokocute05.png") image["4"] = ImageList.LoadImage( Path + "/sokocute04.png") image["3"] = ImageList.LoadImage( Path + "/sokocute03.png") image["2"] = ImageList.LoadImage( Path + "/sokocutegg.png") image["1"] = ImageList.LoadImage( Path + "/sokocutess.png") image["0"] = ImageList.LoadImage( Path + "/sokocute00.png") star = ImageList.LoadImage( Path + "/sokocutels.png") heart = ImageList.LoadImage( Path + "/sokocutelh.png") 'GraphicsWindow.DrawText(100,100, Program.Directory) GraphicsWindow.DrawImage(background, 0, 0) '----------------------------------------------------------------------------------------- 'init the keys '----------------------------------------------------------------------------------------- leftKey = "left" rightKey = "right" forwardKey = "forward" backKey = "back" fireKey = "Space" returnKey = "Return" escapeKey = "Escape" pauseKey = "P" resetKey = "R" pluskey = "F1" minusKey = "F2" 'important var for moving the crystals korrx = 36 'init any other var animtime = 2000 status = "start game flee" game="gamearray" block = "blockArray" true = 3 false = 0 stage = 10 'init level data InitLevels() 'init stars and hearts InitStars() ResetStars() ' animate title at first titleshape = Shapes.AddImage(Path + "/sokocute.png") Shapes.Move(titleshape, 2222,-500) Shapes.Animate(titleshape, 1400,370, 2500) txtstart = Shapes.AddImage(Path + "/sokocutetx.png") Shapes.Move(txtstart, 305,1800) Shapes.Animate(txtstart, 305,420, 5000) 'calculate delay (higher number means more precision) timestart = Clock.ElapsedMilliseconds i = 0 while (i < 600000) i = i + 1 Endwhile timeloop = Clock.ElapsedMilliseconds - timestart mssec = timeloop / 600000 loopmssec = 1 / mssec KeyUp() Main() Sub Main GraphicsWindow.Show() GraphicsWindow.KeyDown = KeyDown GraphicsWindow.KeyUp = KeyUp endtime = Clock.ElapsedMilliseconds starttime = Clock.ElapsedMilliseconds blinktime = Clock.ElapsedMilliseconds gamestarttime = Clock.ElapsedMilliseconds gemfall = false freecells = 1 blink = 0 fps = 0 looptime = 0 play = 1 pause = 0 rot = 0 While(play = 1) fps = fps + 1 Input() if status = "game" then 'try fixed fps - 60 might be enough loopdelay = (2000/60) * loopmssec num = 0 While(num < loopdelay) num = num + 1 endwhile If gemfall = false and gemwater <> 99 and Clock.ElapsedMilliseconds - watertime > 550 then Shapes.Animate(crystalimg[gemwater],Shapes.GetLeft(crystalimg[gemwater]), Shapes.GetTop(crystalimg[gemwater]) + 35, 650) gemfall = true EndIf If gemfall = true and gemwater <> 99 and Clock.ElapsedMilliseconds - watertime > 550 and Clock.ElapsedMilliseconds - watertime < 1400 then gemzoom = gemzoom - gemmove gemmove = gemmove + 0.001 Sound.Stop(Path + "/sokocute02.wav") Sound.Play(Path + "/sokocute02.wav") Shapes.Zoom(crystalimg[gemwater], gemzoom, gemzoom) EndIf If gemwater <> 99 and Clock.ElapsedMilliseconds - watertime > 1400 then Shapes.move(crystalimg[gemwater], 1000, 1000) Shapes.move(crystalbnk[gemwater], 1000, 1000) gemwater = 99 gemmove = 0 gemfall = false EndIf If (gemchng <> 99) And (Clock.ElapsedMilliseconds - gemtime > 400) Then if ground[gemy][gemx] = 1 then Shapes.Move(crystalbnk[gemchng], Shapes.GetLeft(crystalimg[gemchng]), Shapes.GetTop(crystalimg[gemchng])) Shapes.Move(crystalimg[gemchng], gemchng * 52, -100) freecells = 0 For y = 0 To 15 For x = 0 To 19 if level[y][x] = 1 then freecells = freecells + 1 EndIF EndFor EndFor If freecells = 0 then Sound.Stop(Path + "/sokocute03.wav") Sound.Play(Path + "/sokocute03.wav") EndIf else Shapes.Move(crystalimg[gemchng], Shapes.GetLeft(crystalbnk[gemchng]), Shapes.GetTop(crystalbnk[gemchng])) Shapes.Move(crystalbnk[gemchng], gemchng * 52, -100) endif gemchng = 99 EndIf 'move the player If newmove < 25 Then newmove = newmove + 1 xplayer = xplayer + movex yplayer = yplayer + movey Shapes.Move(player1, xplayer, yplayer) Shapes.Move(player2, xplayer, yplayer) EndIf 'blinking crystals when level is done If freecells = 0 And Clock.ElapsedMilliseconds - blinktime > 350 then For i = 0 to (cryst - 1) x1 = Shapes.GetLeft(crystalimg[i]) y1 = Shapes.GetTop(crystalimg[i]) x2 = Shapes.GetLeft(crystalbnk[i]) y2 = Shapes.GetTop(crystalbnk[i]) Shapes.Move(crystalimg[i], x2, y2) Shapes.Move(crystalbnk[i], x1, y1) EndFor blink = blink + 1 blinktime = Clock.ElapsedMilliseconds EndIf ' end level if crystals changed color 10 times If blink = 10 then LevelExplosion() stage = stage + 1 if stage <> 10 then status = "reset" resettime = Clock.ElapsedMilliseconds GraphicsWindow.BrushColor = "#5986e5" GraphicsWindow.FillRectangle(70,198,170,80) GraphicsWindow.FillRectangle(800,690,224,85) endif 'load title sceen when finished level 10 If stage = 10 then LevelExplosion() stage = 0 Shapes.Animate(titleshape, 140,170, 2500) Shapes.Animate(txtstart, 305,420, 3000) GraphicsWindow.BrushColor = "#3975e5" GraphicsWindow.FillRectangle(70,690,170,80) GraphicsWindow.FillRectangle(800,690,224,85) status = "start" ResetStars() resettime = Clock.ElapsedMilliseconds endif EndIf ' show time and fps If Clock.ElapsedMilliseconds - endtime > 1000 And status = "game" Then gametime = Clock.ElapsedMilliseconds - starttime GraphicsWindow.BrushColor = "#3975e5" GraphicsWindow.FontName = "COMIC SANS MS" GraphicsWindow.FontSize = 25 GraphicsWindow.FillRectangle(800,690,224,85) GraphicsWindow.BrushColor = "white" tsecgesamt = Math.Round(gametime/ 1000) tsec = Math.Remainder(tsecgesamt , 60) tmingesamt = Math.Floor(tsecgesamt/ 60) tmin = Math.Remainder(tmingesamt , 60) thour = Math.Floor(tmingesamt / 60) If tsec < 10 then strSec = Text.Append( ":0", tsec) Else strSec = Text.Append( ":", tsec) EndIf If tmin < 10 then strMin = Text.Append( "0", tmin) Else strMin = Text.Append( "", tmin) EndIf GraphicsWindow.DrawText(800, 690, " time "+ thour + ":" + Text.Append( strMin, strSec)) GraphicsWindow.DrawText(800, 725, " fps "+ fps ) GraphicsWindow.FontSize = 10 endtime = Clock.ElapsedMilliseconds fps = 0 EndIf EndIf 'of Status = game 'reset level after a short delay If status ="reset" And (Clock.ElapsedMilliseconds - resettime > 2500) Then GraphicsWindow.BrushColor = "#3975e5" GraphicsWindow.FillRectangle(70,690,170,80) GraphicsWindow.FillRectangle(800,690,224,80) freecells = 1 blink = 0 LevelRelease() LevelLoad() wait1 = Clock.ElapsedMilliseconds While Clock.ElapsedMilliseconds - wait1 < 3000 EndWhile starttime = Clock.ElapsedMilliseconds status = "game" GraphicsWindow.BrushColor = "#3975e5" GraphicsWindow.FontName = "COMIC SANS MS" GraphicsWindow.FontSize = 25 GraphicsWindow.FillRectangle(70,690,170,80) GraphicsWindow.BrushColor = "white" GraphicsWindow.DrawText(70, 690, "moves "+ moves) GraphicsWindow.DrawText(70, 725, " level "+ (stage + 1) ) EndIf If status = "start" then MoveStars() endif EndWhile EndSub Sub KeyDown bleftKey = false brightKey = false bforwardKey = false bbackKey = false bescapeKey = false If GraphicsWindow.LastKey = leftKey then bleftKey = true elseif GraphicsWindow.LastKey = rightKey then brightKey = true elseif GraphicsWindow.LastKey = forwardKey then bforwardKey = true elseif GraphicsWindow.LastKey = backKey then bbackKey = true elseif GraphicsWindow.LastKey = returnKey then breturnKey = true elseif GraphicsWindow.LastKey = escapeKey then bescapeKey = true endif endSub Sub KeyUp ' reset every key first bleftKey = false brightKey = false bforwardKey = false bbackKey = false breturnKey = false If GraphicsWindow.LastKey = pauseKey then LevelExplosion() EndIf If GraphicsWindow.LastKey = escapeKey and status = "start" then Program.End() EndIf If GraphicsWindow.LastKey = escapeKey And status = "game" then LevelExplosion() stage = 0 Shapes.Animate(titleshape, 140,170, 2500) Shapes.Animate(txtstart, 305,420, 3000) GraphicsWindow.BrushColor = "#3975e5" GraphicsWindow.FillRectangle(70,690,170,80) GraphicsWindow.FillRectangle(800,690,224,85) status = "start" ResetStars() resettime = Clock.ElapsedMilliseconds EndIf If GraphicsWindow.LastKey = resetKey then LevelExplosion() status = "reset" resettime = Clock.ElapsedMilliseconds EndIf If GraphicsWindow.LastKey = pluskey then LevelExplosion() 'stage = stage + 1 'uncomment this line to cheat with F1 status = "reset" resettime = Clock.ElapsedMilliseconds EndIf If GraphicsWindow.LastKey = minuskey then 'KeyUp() LevelExplosion() 'stage = stage - 1 'uncomment this line to cheat with F2 status = "reset" resettime = Clock.ElapsedMilliseconds EndIf 'reload title after If GraphicsWindow.LastKey = returnKey and status = "start" then Shapes.Animate(titleshape, 156,-450, 3000) Shapes.Animate(txtstart, 305, 1220, 8900) status = "reset" resettime = Clock.ElapsedMilliseconds EndIf EndSub Sub Input If newmove >= 25 and blink = 0 then 'move right If(brightKey = true) and (level[posy][posx+1] <= 2) Then 'move crystal if level[posy][posx+1] = 2 and ground[posy][posx+1] <= 1 And (level[posy][posx+2] <= 1 or ground[posy][posx+2] = 3) Then chestarray[posy][posx+2] = chestarray[posy][posx+1] chestarray[posy][posx+1] = 99 level[posy][posx+1] = ground[posy][posx+1] level[posy][posx+2] = 2 Sound.Stop(Path + "/sokocute01.wav") Sound.Play(Path + "/sokocute01.wav") 'move crystal into water If ground[posy][posx+2] = 3 then watertime = Clock.ElapsedMilliseconds gemwater = chestarray[posy][posx+2] gemzoom = 1 EndIf If (ground[posy][posx+2] = 1 and ground[posy][posx+1] <= 0) Or (ground[posy][posx+2] <= 0 and ground[posy][posx+1] = 1) then gemtime = Clock.ElapsedMilliseconds gemchng = chestarray[posy][posx+2] gemy = posy gemx = posx+2 EndIf 'animate crystal if ground[posy][posx+1] = 1 then Shapes.Animate(crystalbnk[chestarray[posy][posx+2]] , (posx+2) * 50 + korrx, (posy) * 40 - 0, 400) elseif ground[posy][posx+2] = 3 then Shapes.Animate(crystalimg[chestarray[posy][posx+2]] , (posx+2) * 50 + korrx, (posy) * 40 - 0, 400) else Shapes.Animate(crystalimg[chestarray[posy][posx+2]] , (posx+2) * 50 + korrx, (posy) * 40 - 0, 400) endif EndIf 'move player right If level[posy][posx+1] <= 1 then moves = moves + 1 newmove = 0 movex = 2 movey = 0 posx = posx + 1 gametime = Clock.ElapsedMilliseconds GraphicsWindow.BrushColor = "#3975e5" GraphicsWindow.FontName = "COMIC SANS MS" GraphicsWindow.FontSize = 25 GraphicsWindow.FillRectangle(70,690,170,40) GraphicsWindow.BrushColor = "white" GraphicsWindow.DrawText(70, 690, "moves "+ moves) Endif 'move left ElseIf( bleftKey = true) and (level[posy][posx-1]<= 2) Then 'move crystal if level[posy][posx-1] = 2 And ground[posy][posx-1] <= 1 and (level[posy][posx-2] <= 1 or ground[posy][posx-2] = 3) Then chestarray[posy][posx-2] = chestarray[posy][posx-1] chestarray[posy][posx-1] = 99 level[posy][posx-1] = ground[posy][posx-1] level[posy][posx-2] = 2 Sound.Stop(Path + "/sokocute01.wav") Sound.Play(Path + "/sokocute01.wav") 'move crystal into water If ground[posy][posx-2] = 3 then watertime = Clock.ElapsedMilliseconds gemwater = chestarray[posy][posx-2] gemzoom = 1 EndIf If (ground[posy][posx-2] = 1 and ground[posy][posx-1] <= 0) Or (ground[posy][posx-2] <= 0 and ground[posy][posx-1] = 1) then gemtime = Clock.ElapsedMilliseconds gemchng = chestarray[posy][posx-2] gemy = posy gemx = posx-2 EndIf 'animate crystal If ground[posy][posx-1] = 1 then Shapes.Animate(crystalbnk[chestarray[posy][posx-2]] , (posx-2) * 50 + korrx, (posy) * 40 - 0, 400) elseif ground[posy][posx-2] = 3 then Shapes.Animate(crystalimg[chestarray[posy][posx-2]] , (posx-2) * 50 + korrx, (posy) * 40 + 0, 400) else Shapes.Animate(crystalimg[chestarray[posy][posx-2]] , (posx-2) * 50 + korrx, (posy) * 40 - 0, 400) endif EndIf 'move player left If level[posy][posx-1] <= 1 then moves = moves + 1 newmove = 0 movex =-2 movey = 0 posx = posx - 1 gametime = Clock.ElapsedMilliseconds GraphicsWindow.BrushColor = "#3975e5" GraphicsWindow.FontName = "COMIC SANS MS" GraphicsWindow.FontSize = 25 GraphicsWindow.FillRectangle(70,690,170,40) GraphicsWindow.BrushColor = "white" GraphicsWindow.DrawText(70, 690, "moves "+ moves) Endif 'move down ElseIf(bbackKey = true) and (level[posy+1][posx]<= 2) Then 'move crystal if level[posy+1][posx] = 2 And ground[posy+1][posx] <= 1 and (level[posy+2][posx] <= 1 or ground[posy+2][posx] = 3) Then chestarray[posy+2][posx] = chestarray[posy+1][posx] chestarray[posy+1][posx] = 99 level[posy+1][posx] = ground[posy+1][posx] level[posy+2][posx] = 2 Sound.Stop(Path + "/sokocute01.wav") Sound.Play(Path + "/sokocute01.wav") 'move crystal into water If ground[posy+2][posx] = 3 then watertime = Clock.ElapsedMilliseconds gemwater = chestarray[posy+2][posx] gemzoom = 1 EndIf If (ground[posy+2][posx] = 1 and ground[posy+1][posx] <= 0) Or (ground[posy+2][posx] <= 0 and ground[posy+1][posx] = 1) then gemtime = Clock.ElapsedMilliseconds gemchng = chestarray[posy+2][posx] gemy = posy+2 gemx = posx EndIf 'animate crystal if ground[posy+1][posx] = 1 then Shapes.Animate(crystalbnk[chestarray[posy+2][posx]] , (posx) * 50 + korrx, (posy+2) * 40 - 0, 400) elseif ground[posy+2][posx] = 3 then Shapes.Animate(crystalimg[chestarray[posy+2][posx]] , (posx) * 50 + korrx, (posy+2) * 40 + 0, 400) else Shapes.Animate(crystalimg[chestarray[posy+2][posx]] , (posx) * 50 + korrx, (posy+2) * 40 - 0, 400) endif EndIf 'move player down If level[posy+1][posx] <= 1 then moves = moves + 1 newmove = 0 movex = 0 movey = 1.6 posy = posy + 1 gametime = Clock.ElapsedMilliseconds GraphicsWindow.BrushColor = "#3975e5" GraphicsWindow.FontName = "COMIC SANS MS" GraphicsWindow.FontSize = 25 GraphicsWindow.FillRectangle(70,690,170,40) GraphicsWindow.BrushColor = "white" GraphicsWindow.DrawText(70, 690, "moves "+ moves) Endif 'move up ElseIf(bforwardKey = true) and (level[posy-1][posx]<= 2) Then 'move crystal if level[posy-1][posx] = 2 And ground[posy-1][posx] <= 1 And (level[posy-2][posx] <= 1 or ground[posy-2][posx] = 3) Then chestarray[posy-2][posx] = chestarray[posy-1][posx] chestarray[posy-1][posx] = 99 level[posy-1][posx] = ground[posy-1][posx] level[posy-2][posx] = 2 Sound.Stop(Path + "/sokocute01.wav") Sound.Play(Path + "/sokocute01.wav") 'move crystal into water If ground[posy-2][posx] = 3 then watertime = Clock.ElapsedMilliseconds gemwater = chestarray[posy-2][posx] gemzoom = 1 EndIf If (ground[posy-2][posx] = 1 and ground[posy-1][posx] <= 0) Or (ground[posy-2][posx] <= 0 and ground[posy-1][posx] = 1) then gemtime = Clock.ElapsedMilliseconds gemchng = chestarray[posy-2][posx] gemy = posy-2 gemx = posx EndIf 'animate crystal if ground[posy-1][posx] = 1 then Shapes.Animate(crystalbnk[chestarray[posy-2][posx]] , (posx) * 50 + korrx, (posy-2) * 40 - 0, 400) elseif ground[posy-2][posx] = 3 then Shapes.Animate(crystalimg[chestarray[posy-2][posx]] , (posx) * 50 + korrx, (posy-2) * 40 + 0, 400) else Shapes.Animate(crystalimg[chestarray[posy-2][posx]] , (posx) * 50 + korrx, (posy-2) * 40 - 0, 400) endif EndIf 'move player up if level[posy-1][posx] <= 1 then moves = moves + 1 newmove = 0 movex = 0 movey =-1.6 posy = posy - 1 gametime = Clock.ElapsedMilliseconds GraphicsWindow.BrushColor = "#3975e5" GraphicsWindow.FontName = "COMIC SANS MS" GraphicsWindow.FontSize = 25 GraphicsWindow.FillRectangle(70,690,170,40) GraphicsWindow.BrushColor = "white" GraphicsWindow.DrawText(70, 690, "moves "+ moves) EndIf EndIf EndIf EndSub Sub Sort For y = 0 To 15 For x = 0 To 15 If level[y][x] = 3 Then Shapes.Remove(levelshapes[y][x]) levelshapes[y][x] = Shapes.AddImage(image["3"]) Shapes.Move(levelshapes[y][x], (x) * 50 + korrx, (y) * 40 - 0) endif 'GraphicsWindow.DrawText(11*i+520,11*p+30,level[p][i]) EndFor EndFor EndSub Sub LevelExplosion Shapes.Animate(player1, Shapes.GetLeft(player1), 1500, 4000) Shapes.Animate(player2, Shapes.GetLeft(player2), 1500, 4000) For i = 0 To shade angle = Math.GetRandomNumber(360) xv = Math.Cos(angle * 0.0174) * 1200 yv = Math.Sin(angle * 0.0174) * 600 Shapes.Animate(Shadow[i], xv + 512, yv + 350, 1500) EndFor For i = 0 To cryst angle = Math.GetRandomNumber(360) xv = Math.Cos(angle * 0.0174) * 1200 yv = Math.Sin(angle * 0.0174) * 600 If Shapes.GetTop(crystalimg[i]) > 0 then Shapes.Animate(crystalimg[i], xv + 512, yv + 350, 1500) EndIf If Shapes.GetTop(crystalbnk[i]) > 0 then Shapes.Animate(crystalbnk[i], xv + 512, yv + 350, 1500) EndIf EndFor For y = 0 To 15 For x = 0 To 19 angle = Math.GetRandomNumber(360) xv = Math.Cos(angle * 0.0174) * 1200 yv = Math.Sin(angle * 0.0174) * 600 Shapes.Animate(levelshapes[y][x], xv + 512, yv + 350, 1500) EndFor EndFor EndSub Sub LevelRelease For y = 0 To 15 For x = 0 To 19 Shapes.Remove(levelshapes[y][x]) EndFor EndFor For i = 0 To shade Shapes.Remove(Shadow[i]) EndFor For i = 0 To cryst Shapes.Remove(crystalimg[i]) Shapes.Remove(crystalbnk[i]) EndFor For i = 0 To 20 Shapes.Remove(star) endFor EndSub Sub LevelLoad cryst = 0 posx = 4 posy = 4 moves = 0 For i = 0 To 15 For p = 1 To Text.GetLength(block[stage][i]) blockcode = Text.GetSubText(block[stage][i], p, 1) If blockcode = "X" then posy = i posx = p-1 blockcode = 0 EndIf if blockcode = 2 then ground[i][p-1] = 0 elseif blockcode = "C" then 'crystal on gras ground[i][p-1] = "A" elseif blockcode = "D" then 'crystal on wood ground[i][p-1] = "B" else ground[i][p-1] = blockcode endif EndFor EndFor 'load the water first For i = 0 To 15 For p = 1 To Text.GetLength(block[stage][i]) blockcode = Text.GetSubText(block[stage][i], p, 1) If blockcode = 3 Then levelshapes[i][p-1] = Shapes.AddImage(image[blockcode]) angle = Math.GetRandomNumber(360) xv = Math.Cos(angle * 0.0174) * 1000 yv = Math.Sin(angle * 0.0174) * 550 Shapes.Move(levelshapes[i][p-1], xv + 512, yv + 350) Shapes.animate(levelshapes[i][p-1], (p-1) * 50 + korrx, (i) * 40 - 0, animtime) Endif EndFor EndFor 'shadows for the water LoadShadowWater() For i = 0 To 15 For p = 1 To Text.GetLength(block[stage][i]) blockcode = Text.GetSubText(block[stage][i], p, 1) If blockcode = "X" then posy = i posx = p-1 blockcode = 0 elseIf blockcode = "Y" then posy = i posx = p-1 blockcode = "A" elseIf blockcode = "Z" then posy = i posx = p-1 blockcode = "B" EndIf if blockcode = 2 then ground[i][p-1] = 0 elseif blockcode = "C" then ground[i][p-1] = "A" elseif blockcode = "D" then ground[i][p-1] = "B" else ground[i][p-1] = blockcode endif if blockcode = "C" then level[i][p-1] = 2 elseif blockcode = "D" then level[i][p-1] = 2 else level[i][p-1] = blockcode endif If blockcode = "C" Then 'crystal on gras levelshapes[i][p-1] = Shapes.AddImage(image["A"]) angle = Math.GetRandomNumber(360) xv = Math.Cos(angle * 0.0174) * 1300 yv = Math.Sin(angle * 0.0174) * 800 Shapes.Move(levelshapes[i][p-1], xv + 512, yv + 350) Shapes.animate(levelshapes[i][p-1], (p-1) * 50 + korrx, (i) * 40 - 0, animtime) elseIf blockcode = "D" Then 'crystal on wood levelshapes[i][p-1] = Shapes.AddImage(image["B"]) angle = Math.GetRandomNumber(360) xv = Math.Cos(angle * 0.0174) * 1300 yv = Math.Sin(angle * 0.0174) * 800 Shapes.Move(levelshapes[i][p-1], xv + 512, yv + 350) Shapes.animate(levelshapes[i][p-1], (p-1) * 50 + korrx, (i) * 40 - 0, animtime) elseIf blockcode < 2 Then levelshapes[i][p-1] = Shapes.AddImage(image[blockcode]) angle = Math.GetRandomNumber(360) xv = Math.Cos(angle * 0.0174) * 1200 yv = Math.Sin(angle * 0.0174) * 600 Shapes.Move(levelshapes[i][p-1], xv + 512, yv + 350) Shapes.Animate(levelshapes[i][p-1], (p-1) * 50 + korrx, (i) * 40 - 0, animtime) ElseIf blockcode = 2 Then levelshapes[i][p-1] = Shapes.AddImage(image["0"]) angle = Math.GetRandomNumber(360) xv = Math.Cos(angle * 0.0174) * 1200 yv = Math.Sin(angle * 0.0174) * 600 Shapes.Move(levelshapes[i][p-1], xv + 512, yv + 350) Shapes.animate(levelshapes[i][p-1], (p-1) * 50 + korrx, (i) * 40 - 0, animtime) endif EndFor EndFor 'tried to fix strange shapes.animate behaviors if there are too many shapes flying around - no real success... loopdelay = (1600) * loopmssec num = 0 While(num < loopdelay) num = num + 1 endwhile 'load blocks f = 0 For i = 0 To 15 For p = 1 To Text.GetLength(block[stage][i]) blockcode = Text.GetSubText(block[stage][i], p, 1) If blockcode = 2 or blockcode = "C" or blockcode = "D" Then crystalimg[cryst] = Shapes.AddImage(image[2]) crystalbnk[cryst] = Shapes.AddImage(Path + "/sokocuteg2.png") chestarray[i][p-1] = cryst angle = Math.GetRandomNumber(360) xv = Math.Cos(angle * 0.0174) * 1200 yv = Math.Sin(angle * 0.0174) * 600 Shapes.Move(crystalimg[cryst], xv + 512, yv + 350) Shapes.animate(crystalimg[cryst] , (p-1) * 50 + korrx, (i) * 40 - 0, animtime*1.5) 'Shapes.Move(crystalimg[cryst] , (p-1) * 50 + korrx, (i) * 40 - 0) Shapes.Move(crystalbnk[cryst] , cryst * 52 , -100) cryst = cryst + 1 Endif EndFor EndFor player1 = Shapes.AddImage(Path + "/sokocutep2.png") 'load lower player shape first. it has to be behind the walls Shapes.Move(player1, (posx) * 50 + korrx, (posy) * 40 - 0) LoadShadow() '------------------------------------------------------------ 'load the walls For i = 0 To 15 For p = 1 To Text.GetLength(block[stage][i]) blockcode = Text.GetSubText(block[stage][i], p, 1) If blockcode >= 4 Then levelshapes[i][p-1] = Shapes.AddImage(image[blockcode]) angle = Math.GetRandomNumber(360) xv = Math.Cos(angle * 0.0174) * 1000 yv = Math.Sin(angle * 0.0174) * 550 Shapes.Move(levelshapes[i][p-1], xv + 512, yv + 350) Shapes.animate(levelshapes[i][p-1], (p-1) * 50 + korrx, (i) * 40 - 0, animtime) Endif EndFor EndFor 'load players face at last. It has always to be in front of the walls player2 = Shapes.AddImage(Path + "/sokocutep1.png") Shapes.Move(player2, (posx) * 50 + korrx, (posy) * 40 - 0) xplayer = Shapes.GetLeft(player1) yplayer = Shapes.GetTop(player1) EndSub sub LoadShadow For y = 0 To 15 For x = 0 To 19 If level[y][x] <= 2 and level[y][x] <> " " Then angle = Math.GetRandomNumber(360) xv = Math.Cos(angle * 0.0174) * 1200 yv = Math.Sin(angle * 0.0174) * 600 If level[y][x-1] >= 6 then Shadow[shade] = Shapes.AddImage(Path + "/SW.png") Shapes.Move(Shadow[shade], xv + 512, yv + 350) Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 - 0, animtime*1.2) shade = shade + 1 EndIf If level[y][x+1] >= 6 then Shadow[shade] = Shapes.AddImage(Path + "/SE.png") Shapes.Move(Shadow[shade], xv + 512, yv + 350) Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 - 0, animtime*1.2) shade = shade + 1 EndIf If level[y-1][x] >= 6 then Shadow[shade] = Shapes.AddImage(Path + "/SN.png") Shapes.Move(Shadow[shade], xv + 512, yv + 350) Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 - 0, animtime*1.2) shade = shade + 1 EndIf If level[y][x-1] <=2 and level[y-1][x] <= 2 and level[y-1][x-1] >= 6 then Shadow[shade] = Shapes.AddImage(Path + "/SNW.png") Shapes.Move(Shadow[shade], xv + 512, yv + 350) Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 - 0, animtime*1.2) shade = shade + 1 EndIf If level[y][x+1] <=2 and level[y-1][x] <= 2 and level[y-1][x+1] >= 6 then Shadow[shade] = Shapes.AddImage(Path + "/SNE.png") Shapes.Move(Shadow[shade], xv + 512, yv + 350) Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 - 0, animtime*1.2) shade = shade + 1 EndIf If level[y][x-1] <=2 and level[y+1][x] <= 2 and level[y+1][x-1] >= 6 then Shadow[shade] = Shapes.AddImage(Path + "/SSW.png") Shapes.Move(Shadow[shade], xv + 512, yv + 350) Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 - 0, animtime*1.2) shade = shade + 1 EndIf If level[y][x+1] <=2 and level[y+1][x] <= 2 and level[y+1][x+1] >= 6 then Shadow[shade] = Shapes.AddImage(Path + "/SSE.png") Shapes.Move(Shadow[shade], xv + 512, yv + 350) Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 - 0, animtime*1.2) shade = shade + 1 EndIf endif EndFor EndFor EndSub sub LoadShadowWater shade = 0 ky = 22 For y = 0 To 15 For x = 0 To 19 If ground[y][x] = 3 Then angle = Math.GetRandomNumber(360) xv = Math.Cos(angle * 0.0174) * 1200 yv = Math.Sin(angle * 0.0174) * 600 If ground[y][x-1] <> 3 and ground[y][x-1] >= 0 and ground[y][x-1] <> " " then Shadow[shade] = Shapes.AddImage(Path + "/SW.png") Shapes.Move(Shadow[shade], xv + 512, yv + 350) Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 + ky, animtime*1.2) shade = shade + 1 EndIf If ground[y][x+1] <> 3 and ground[y+1][x] >= 0 and ground[y][x+1] <> " " then Shadow[shade] = Shapes.AddImage(Path + "/SE.png") Shapes.Move(Shadow[shade], xv + 512, yv + 350) Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 + ky, animtime*1.2) shade = shade + 1 EndIf If ground[y-1][x] <> 3 and ground[y-1][x] >= 0 and ground[y-1][x] <> " " then Shadow[shade] = Shapes.AddImage(Path + "/SN.png") Shapes.Move(Shadow[shade], xv + 512, yv + 350) Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 + ky, animtime*1.2) shade = shade + 1 EndIf If ground[y][x-1] = 3 and ground[y-1][x] = 3 and ground[y-1][x-1] <> 3 and ground[y-1][x-1] >= 0 then Shadow[shade] = Shapes.AddImage(Path + "/SNW.png") Shapes.Move(Shadow[shade], xv + 512, yv + 350) Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 + ky, animtime*1.2) shade = shade + 1 EndIf If ground[y][x+1] = 3 and ground[y-1][x] = 3 and ground[y-1][x+1] <> 3 and ground[y-1][x+1] >= 0 then Shadow[shade] = Shapes.AddImage(Path + "/SNE.png") Shapes.Move(Shadow[shade], xv + 512, yv + 350) Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 + ky, animtime*1.2) shade = shade + 1 EndIf If ground[y][x-1] = 3 and ground[y+1][x] = 3 and ground[y+1][x-1] <> 3 and ground[y+1][x-1] >= 0 then Shadow[shade] = Shapes.AddImage(Path + "/SSW.png") Shapes.Move(Shadow[shade], xv + 512, yv + 350) Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 + ky, animtime*1.2) shade = shade + 1 EndIf If ground[y][x+1] = 3 and ground[y+1][x] = 3 and ground[y+1][x+1] <> 3 and ground[y+1][x+1] >= 0 then Shadow[shade] = Shapes.AddImage(Path + "/SSE.png") Shapes.Move(Shadow[shade], xv + 512, yv + 350) Shapes.animate(Shadow[shade], (x) * 50 + korrx, (y) * 40 + ky, animtime*1.2) shade = shade + 1 EndIf endif EndFor EndFor EndSub Sub InitStars For i = 0 To 12 star[i] = Shapes.AddImage(Path + "/sokocutels.png") heart[i] = Shapes.AddImage(Path + "/sokocutelh.png") endFor EndSub Sub ResetStars For i = 0 To 12 angle = Math.GetRandomNumber(360) starxv[i] = Math.Cos(angle * 0.0174) * 0.50 staryv[i] = Math.Sin(angle * 0.0174) * 0.50 starx[i] = 1000 stary[i] = 1000 startime[i] = Math.GetRandomNumber(100) Shapes.Move(star[i], starx[i], stary[i]) endFor For i = 0 To 12 angle = Math.GetRandomNumber(360) heartxv[i] = Math.Cos(angle * 0.0174) * 0.50 heartyv[i] = Math.Sin(angle * 0.0174) * 0.50 heartx[i] = 1000 hearty[i] = 1000 hearttime[i] = Math.GetRandomNumber(100) Shapes.Move(heart[i], heartx[i], hearty[i]) endFor EndSub ' move stars and hearts Sub MoveStars For i = 0 to 12 If startime[i] > 100 then angle = Math.GetRandomNumber(360) starxv[i] = Math.Cos(angle * 0.0174) staryv[i] = Math.Sin(angle * 0.0174) starx[i] = 500 + 20 stary[i] = 150 Shapes.Move(star[i], starx[i] , stary[i]) startime[i] = 0 EndIf startime[i] = startime[i] + 0.20 staryv[i] = staryv[i] + 0.005 starx[i] = starx[i] + starxv[i] stary[i] = stary[i] + staryv[i] Shapes.Rotate(star[i], startime[i] * 15) Shapes.Zoom(star[i], math.sin(startime[i] / 32) , math.sin(startime[i] / 32) ) Shapes.Move(star[i], starx[i], stary[i]) EndFor For i = 0 to 12 If hearttime[i] > 100 then angle = Math.GetRandomNumber(360) heartxv[i] = Math.Cos(angle * 0.0174) heartyv[i] = Math.Sin(angle * 0.0174) heartx[i] = 500 + 20 hearty[i] = 150 Shapes.Move(heart[i], heartx[i] , hearty[i]) hearttime[i] = 0 EndIf hearttime[i] = hearttime[i] + 0.20 heartyv[i] = heartyv[i] + 0.005 heartx[i] = heartx[i] + heartxv[i] hearty[i] = hearty[i] + heartyv[i] Shapes.Rotate(heart[i], hearttime[i] * -10) Shapes.Zoom(heart[i], math.sin(hearttime[i] / 32) , math.sin(hearttime[i] / 32) ) Shapes.Move(heart[i], heartx[i], hearty[i]) EndFor EndSub Sub InitLevels block[0][0] = " " block[0][1] = " " block[0][2] = " " block[0][3] = " 66666 " block[0][4] = " 60006 " block[0][5] = " 62006 " block[0][6] = " 66600266 " block[0][7] = " 60020206 " block[0][8] = " 6660606606AA555555 " block[0][9] = " 600060660666700115 " block[0][10]= " 60200200000X000115 " block[0][11]= " 666660666066700115 " block[0][12]= " 60000066555555 " block[0][13]= " 6666666 " block[0][14]= " " block[0][15]= " " block[1][0] = " " block[1][1] = " " block[1][2] = " " block[1][3] = " 6666666 " block[1][4] = " 76666600000667 " block[1][5] = " 61111602002006 " block[1][6] = " 61100626666006 " block[1][7] = " 6110000X066006 " block[1][8] = " 61100606002076 " block[1][9] = " 76666606620206 " block[1][10]= " 602002020206 " block[1][11]= " 600007000006 " block[1][12]= " 766666666667 " block[1][13]= " " block[1][14]= " " block[1][15]= " " block[2][0] = " " block[2][1] = " " block[2][2] = " " block[2][3] = " 76666667 " block[2][4] = " 600000X6 " block[2][5] = " 60262066 " block[2][6] = " 6020026 " block[2][7] = " 6720206 " block[2][8] = " 7666666 602060667 " block[2][9] = " 61111066602002006 " block[2][10]= " 61110000020020006 " block[2][11]= " 61111066666666667 " block[2][12]= " 7666666 " block[2][13]= " " block[2][14]= " " block[2][15]= " " block[3][0] = " " block[3][1] = " " block[3][2] = "6666663 " block[3][3] = "611166366666 66666 " block[3][4] = "611116360006 60006 " block[3][5] = "6111163607066660706 " block[3][6] = "600X063600200000006 " block[3][7] = "6606663700602260666 " block[3][8] = "5AAAA73A220060006 " block[3][9] = "5ACAABBB002666206 " block[3][10]= "5AA5AA3A700060006 " block[3][11]= "5555553A666060726 " block[3][12]= "AAAAAA3AAA6022006 " block[3][13]= "33333333336000006 " block[3][14]= " 6666666 " block[3][15]= " " block[4][0] = " " block[4][1] = " " block[4][2] = " 66666 " block[4][3] = " 666666600067 " block[4][4] = " 66070X6602206 " block[4][5] = " 6000020000006 " block[4][6] = " 6002006660006 " block[4][7] = " 6660666662666 " block[4][8] = " 602006660116 " block[4][9] = " 602020201116 " block[4][10]= " 600006661116 " block[4][11]= " 602206 61116 " block[4][12]= " 600666 76667 " block[4][13]= " 7667 " block[4][14]= " " block[4][15]= " " block[5][0] = " " block[5][1] = " 4444444 " block[5][2] = " 4AA1114 " block[5][3] = " 66667AA1114 " block[5][4] = " 60000AA1A14 " block[5][5] = " 60067AA1114 " block[5][6] = " 66066AA1114 " block[5][7] = " 666066444444 " block[5][8] = " 60222066AAAA " block[5][9] = " 6666600202066666 " block[5][10]= " 66000720200070006 " block[5][11]= " 6X020020000200206 " block[5][12]= " 66666602202066666 " block[5][13]= " 60000006 " block[5][14]= " 66666666 " block[5][15]= " " block[6][0] = " " block[6][1] = " 7777777777 " block[6][2] = " 7110070007 " block[6][3] = " 7110000007 " block[6][4] = " 711007007777 " block[6][5] = " 77777770070077 " block[6][6] = " 70000000000007 " block[6][7] = " 70070077007007 " block[6][8] = " 7777077007777077 " block[6][9] = " 7002007777707007 " block[6][10]= " 7070200200702007 " block[6][11]= " 70X2002000700077 " block[6][12]= " 777707707777777 " block[6][13]= " 700007 " block[6][14]= " 777777 " block[6][15]= " " block[7][0] = " " block[7][1] = " " block[7][2] = " " block[7][3] = " 4444 " block[7][4] = " 4444444AY4 " block[7][5] = " 4AAAAACAA4 " block[7][6] = " 4AAAC77AC4 " block[7][7] = " 44C71117A4 " block[7][8] = " 4AC111AA4 " block[7][9] = " 4A71A17A44 " block[7][10]= " 4AAA7A7CA4 " block[7][11]= " 4CAACAAAA4 " block[7][12]= " 4AA4444444 " block[7][13]= " 4444 " block[7][14]= " " block[7][15]= " " block[8][0] = " " block[8][1] = " " block[8][2] = " 4444 " block[8][3] = " 444444444AA77 " block[8][4] = " 74AACAAAAAACA75557 " block[8][5] = " 4ABB77B77BBA771115 " block[8][6] = " 4A7DDBDBDD7C771115 " block[8][7] = " 4A7BBBBZBB7AAA1115 " block[8][8] = " 4ABD7B777DDAAA1115 " block[8][9] = " 4ACAACCAACA7711115 " block[8][10]= " 744CAAAAAAA7755557 " block[8][11]= " 4AA4444444 " block[8][12]= " 4444 " block[8][13]= " " block[8][14]= " " block[8][15]= " " block[9][0] = " AAAAA A A AAAA " block[9][1] = " A A A A " block[9][2] = " A AAAAA AAA " block[9][3] = " A A A A " block[9][4] = " A A A AAAA " block[9][5] = " " block[9][6] = " AAAA A A AAA " block[9][7] = " A AA A A A " block[9][8] = " AAA A A A A A " block[9][9]= " A A AA A A " block[9][10]= " AAAA A A AAA " block[9][11]= " " block[9][12]= " " block[9][13]= " 4444444444444444 " block[9][14]= " 40X0020000000104 " block[9][15]= " 4444444444444444 " EndSub GraphicsWindow.Clear() GraphicsWindow.Hide() GraphicsWindow.GetRandomColor() End>GKD817.sb< Start>GKG293.sb< ' very simple TEXTWINDOW Calculator ' program by YLed ' February 11th 2017 ' Small Basic February Challenge of the Month proposed by LitDev ' program no: start: TextWindow.Clear() TextWindow.ForegroundColor="cyan" TextWindow.WriteLine("Addition Type (+) " + "Substraction (-) "+"Multiplication (*) "+"Division (/)") type = TextWindow.Read() If type = "+" Then addition() Elseif type = "-" then substraction() Elseif type = "/" then division() Elseif type = "*" then multiplication() EndIf Sub addition TextWindow.ForegroundColor="yellow" TextWindow.WriteLine(" The individual numbers being combined are called addends, and the total is called the sum") TextWindow.WriteLine("") TextWindow.ForegroundColor="magenta" TextWindow.WriteLine(" Enter the addend ") a1= TextWindow.ReadNumber() TextWindow.WriteLine(" Enter the addend ") a2= TextWindow.ReadNumber() Sum=(a1+a2) TextWindow.ForegroundColor="white" TextWindow.WriteLine("Sum is : "+sum) EndSub Sub substraction TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("Subtraction is the operation of taking the difference (d=x-y) of two numbers x and y") TextWindow.WriteLine(" Here, x is called the minuend, y is called the subtrahend") TextWindow.WriteLine("") TextWindow.ForegroundColor="magenta" TextWindow.WriteLine(" Enter the minuend ") mn= TextWindow.ReadNumber() TextWindow.WriteLine(" Enter the subtrahend ") sb= TextWindow.ReadNumber() difference=(mn-sb) TextWindow.ForegroundColor="white" TextWindow.WriteLine("Difference is : "+difference) EndSub Sub division TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("Taking the ratio of x/y two numbers x and y, also written x ÷ y") textwindow.writeline("Here, x is called the dividend, y is called the divisor and x/y is called a quotient") TextWindow.WriteLine("") TextWindow.ForegroundColor="magenta" TextWindow.WriteLine(" Enter the dividend") dvd= TextWindow.ReadNumber() retry: TextWindow.WriteLine(" Enter the divisor") dvr= TextWindow.ReadNumber() if dvr=0 then textwindow.writeline (" division y zero not allowed, try again !") For t = 1 To 4 Sound.PlayClickandwait() Program.Delay(20) endfor Goto retry endif Quotient=(dvd/dvr) TextWindow.ForegroundColor="white" TextWindow.WriteLine("Quotient is : "+quotient) EndSub Sub multiplication TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("Multiplication is the process of calculating the result when a number A is taken B times") TextWindow.WriteLine(" A and B is called a factor The result of a multiplication is called the product ") TextWindow.WriteLine("") TextWindow.ForegroundColor="magenta" TextWindow.WriteLine(" Enter Factor 1 ") f1= TextWindow.ReadNumber() TextWindow.WriteLine(" Enter Factor 2 ") f2= TextWindow.ReadNumber() product=(f1*f2) TextWindow.ForegroundColor="white" TextWindow.WriteLine("Product is : "+product) EndSub Program.Delay(3000) Goto start End>GKG293.sb< Start>GKH637.sb< GraphicsWindow.Width=500 GraphicsWindow.Height =500 GraphicsWindow.Left =50 GraphicsWindow.Top =30 LDEvents.MouseWheel=mwwl GraphicsWindow.MouseDown=mdd GraphicsWindow.MouseUp=muu GraphicsWindow.MouseMove=mmw s5000=35000 ss=50 LDScrollBars.Rasterize="True LDScrollBars.Add(500,s5000) LDScrollBars.Visibility="True LDScrollBars.HorizontalScroll=0 Bgg=LDText.Split ("Red Yellow Green Cyan Blue Black"," ") brr=LDShapes.BrushGradient(bgg,"V") LDShapes.BrushGradientRectangle (brr,0,0,500,s5000) Timer.Interval=50 Timer.Tick=mwwt Timer.Pause () GraphicsWindow.FontSize=20 GraphicsWindow.FontName="Calibri GraphicsWindow.BrushColor="White LDUtilities.FixFlickr () For x=1 To 175 ' GraphicsWindow .DrawEllipse(Math.GetRandomNumber(250)+8,x*400,30,40) ' GraphicsWindow.BrushColor=LDColours.HSLtoRGB (x*12,0.8,0.9) ' GraphicsWindow .fillEllipse(Math.GetRandomNumber(250)+8,200+x*400,20,20) GraphicsWindow.DrawText (20,x*250,x*250) If Math.Remainder(pp,3)=0 then pp= Flickr.GetRandomPicture ("water") GraphicsWindow.DrawResizedImage(pp,20,x*500-400,400,300) endif endfor GraphicsWindow.FontSize=50 GraphicsWindow.FontName="Calibri GraphicsWindow.DrawBoundText (5,95,495,"Lorem ipsum dolor magna quick brown fox jumps over very lazy and biiig goooooooogledogs and just keep on echting gold zync blablahhh....") Sub mdd sx =GraphicsWindow.MouseX ssc= LDScrollBars.HorizontalScroll prr=1 EndSub Sub muu prr=0 EndSub Sub mmw If Mouse.IsLeftButtonDown then LDScrollBars.HorizontalScroll=sx-GraphicsWindow.MouseX +ssc ldd=LDScrollBars.HorizontalScroll-os os=LDScrollBars.HorizontalScroll Timer.Resume () endif EndSub Sub mwwl LDScrollBars.HorizontalScroll=LDScrollBars.HorizontalScroll+LDEvents.LastMouseWheelDelta*50 endsub Sub mwwt If ldd<0 Then LDScrollBars.HorizontalScroll=LDScrollBars.HorizontalScroll-ss Else LDScrollBars.HorizontalScroll=LDScrollBars.HorizontalScroll+ss endif ss=ss/1.2 tc=tc+1 If tc>10 Then Timer.Pause () tc=0 ss=50 endif EndSub End>GKH637.sb< Start>GKL236.sb< Sub deff l[01]="the quick brown fox jumps over lazy dog l[02]="la veloce marone volpe salta sul pigro cane l[03]="jedna brza smeđa lisica skače preko lijenog psa l[04]="der schnelle braune Fuchs springt über faulen Hund l[05]="de snelle bruine vos springt over_de luie hond l[06]="jedna rychlá hnědá liška přeskočí přes líný psa l[07]="ena hitro rjava lisica skoči čez leni psa l[08]="unu rapida bruna vulpo saltas super_la pigra hundo l[09]="en hurtig brun ræv hopper over_den dovne hund l[10]="jeden szybki brązowy lis skacze nad leniwym psem l[11]="edna brza kafeava lisica skoka nad mrzlivoto kuče l[12]="viena greita ruda lapė šokinėja per tingą šunį l[13]="ee séier brong Fuchs sprécht iwwer_den faulen Hund l[14]="unum ieiunium brunneis vulpes salit super piger canis l[15]="un renard brun rapide saute par-dessus_le paresseux chien l[16]="egy gyors barna róka átugorja a lusta kutya l[17]="uma rápida marrom raposa salta sobre_o preguiçoso cão l[18]="un rápido marrón zorro salta sobre_el perezoso perro lnm=LDText.Split("en it hr de nl cz si es no pl mk lt lx ln fr hu pt sp" " ") For f=1 To 18 lng[lnm[f]]=LDText.Split(l[f] " ") EndFor EndSub deff() nl=Text.GetCharacter(13) GraphicsWindow.Width=620 GraphicsWindow.Height=600 GraphicsWindow.BackgroundColor="teal GraphicsWindow.BrushColor="white GraphicsWindow.Title="SB translator While 1=1 ff=FCDialogs.AskForTextLine("phr; lngF; lng2; lng3;... : ") tx=LDText.Split(ff ";") st=LDText.Split(tx[1] " ") 'sta=LDArray.CreateFromValues(st) dtx="" For qw=3 To Array.GetItemCount(tx) dtx=dtx+nl+tx[qw]+": " For f=1 To Array.GetItemCount(st) ii=LDArray.GetIndex(lng[tx[2]] st[f]) dtx=dtx+(ldtext.replace(lng[tx[qw]][ii] "_" " ")+" ") EndFor EndFor GraphicsWindow.Clear() GraphicsWindow.DrawBoundText(5 5 600 dtx) EndWhile End>GKL236.sb< Start>GKM721.sb< ' Parts of a Robot - Copyright (c) 2014 Nonki Takahashi. ' path = "http://www.nonkit.com/smallbasic.files/" scale = 0.5 x = 10 y = 10 part = "Rbody.png" ShowPart() part = "Rarm.png" ShowPart() part = "Rhand.png" ShowPart() part = "Rfoot.png" ShowPart() Sub ShowPart img = ImageList.LoadImage(path + part) h = ImageList.GetHeightOfImage(img) w = ImageList.GetWidthOfImage(img) obj[part] = Shapes.AddImage(img) Shapes.Zoom(obj[part], scale, scale) Shapes.Move(obj[part], (x + 140) - (1 - scale) * w / 2, y - (1 - scale) * h / 2) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(x, y, part) y = y + 20 GraphicsWindow.DrawText(x, y, "width=" + w + " (" + (w * scale) + ")") y = y + 20 GraphicsWindow.DrawText(x, y, "height=" + h + " (" + (h * scale) + ")") y = y + 80 EndSub End>GKM721.sb< Start>GKN568.sb< ' Palindrome checking program Palindrome_Sample() Show_Sample() Input_your_sample() Check_Palindrome() Ok_or_Not() Sub Show_Sample GraphicsWindow.BackgroundColor="Lightcyan" GraphicsWindow.left=0 GraphicsWindow.top=0 GraphicsWindow.Height=700 GraphicsWindow.Width=1200 GraphicsWindow.Show() GraphicsWindow.FontSize=18 For i = 1 To 15 GraphicsWindow.DrawText(10,5+35*(i-1),i) GraphicsWindow.DrawText(70,5+35*(i-1),sample[i]) endfor textbox[1] = Controls.AddTextBox(10,550) Controls.SetSize(textbox[1] ,800,30) GraphicsWindow.BrushColor="Green" GraphicsWindow.FillRectangle(820,550,200,30) GraphicsWindow.BrushColor="Yellow" GraphicsWindow.DrawText(822,552," Check Start! ") i=17 GraphicsWindow.BrushColor="Red" GraphicsWindow.FontSize=30 GraphicsWindow.DrawText(70,5+40*(i-1),sample[i]) GraphicsWindow.DrawText(500,5+40*3,"Please refer these samples!") GraphicsWindow.FontSize=18 Endsub Sub Input_your_sample Loop: OnX=mouse.IsLeftButtonDown GMX=GraphicsWindow.MouseX GMY=GraphicsWindow.MouseY If Onx="true" Then If (820GKN568.sb< Start>GKP920.sb< GraphicsWindow.Left = 0.3 * (Desktop.Width - GraphicsWindow.Width) GraphicsWindow.Top = 0.1 * (Desktop.Height - GraphicsWindow.Height) GraphicsWindow.Width = 1080 GraphicsWindow.height = 500 GraphicsWindow.BackgroundColor = "olivedrab" shape_init() For N=1 to 24 ss=s[N] for i=1 To 47 ' <------ max shape number is 47 GraphicsWindow.PenWidth = shape[N][i]["pw"] GraphicsWindow.BrushColor = shape[N][i]["bc"] GraphicsWindow.penColor = shape[N][i]["pc"] If shape[N][i]["func"]="ell" Then shp[N][i] = Shapes.AddEllipse(shape[N][i]["width"]*ss, shape[N][i]["height"]*ss) ElseIf shape[N][i]["func"]="rect" Then shp[N][i] = Shapes.AddRectangle(shape[N][i]["width"]*ss, shape[N][i]["height"]*ss) ElseIf shape[N][i]["func"]="tri" Then shp[N][i] = Shapes.Addtriangle(shape[N][i]["x1"]*ss, shape[N][i]["y1"]*ss,shape[N][i]["x2"]*ss, shape[N][i]["y2"]*ss, shape[N][i]["x3"]*ss, shape[N][i]["y3"]*ss) ElseIf shape[N][i]["func"]="line" Then shp[N][i] = Shapes.Addline(shape[N][i]["x1"]*ss, shape[N][i]["y1"]*ss,shape[N][i]["x2"]*ss, shape[N][i]["y2"]*ss) EndIf Shapes.Animate(shp[N][i], shape[N][i]["x"]*ss+shX[N], shape[N][i]["y"]*ss+shY[N], 500) Shapes.Rotate(shp[N][i], Shape[N][i]["angle"]) EndFor endfor ' Kiwi Bird Sub shape_init '1 s[1] = 0.5 shX[1] = 420 shY [1]= 250 shape[1][1]="func=line;X=24;Y=364;x1=10;y1=0;x2=14;y2=10;angle=0;pc=orange;pw=8" ' F 1 shape[1][2]="func=line;X=30;Y=370;x1=5;y1=0;x2=14;y2=15;angle=0;pc=orange;pw=8" ' F 2 shape[1][3]="func=line;X=30;Y=380;x1=-10;y1=-0;x2=14;y2=20;angle=0;pc=orange;pw=8" ' F 3 shape[1][4]="func=ell;X=14;Y=360;width=10;height=40;angle=50;pc=orange;pw=4" ' F 1 shape[1][5]="func=ell;X=20;Y=370;width=10;height=44;angle=30;pc=orange;pw=4" ' F 2 shape[1][6]="func=ell;X=36;Y=373;width=10;height=44;angle=15;pc=orange;pw=4" ' F 3 shape[1][7]="func=line;X=90;Y=364;x1=10;y1=0;x2=14;y2=10;angle=0;pc=orange;pw=8" ' F 1 shape[1][8]="func=line;X=90;Y=385;x1=8;y1=-15;x2=15;y2=8;angle=0;pc=orange;pw=8" ' F 2 shape[1][9]="func=line;X=90;Y=385;x1=16;y1=-15;x2=25;y2=8;angle=0;pc=orange;pw=8" ' F 3 shape[1][10]="func=ell;X=110;Y=380;width=10;height=40;angle=-30;bc=orange" ' F 1 shape[1][11]="func=ell;X=98;Y=380;width=10;height=40;angle=-10;bc=orange" ' F 2 shape[1][12]="func=ell;X=115;Y=370;width=10;height=40;angle=-30;bc=orange" ' F 3 shape[1][13]="func=ell;X=-10;Y=190;width=35;height=110;angle=40;bc=darkslategray;pc=darkslategray;;pw=0"' Arm 1 shape[1][14]="func=ell;X=140;Y=190;width=35;height=110;angle=-40;bc=darkslategray;pc=darkslategray;pw=0"' Arm 2 shape[1][15]="func=ell;X=0;Y=200;width=170;height=180;angle=0;bc=snow;pc=darkslategray;pw=4"' body shape[1][16]="func=ell;X=30;Y=110;width=120;height=120;bc=darkslategray;pc=darkslategray;;pw=0"' Face shape[1][17]="func=ell;X=40;Y=130;width=50;height=70;angle=20;bc=snow;pc=darkslategray;pw=0"' Face 1 shape[1][18]="func=ell;X=90;Y=130;width=50;height=70;angle=-10;bc=snow;pc=darkslategray;pw=0"' Face 2 shape[1][19]="func=ell;X=46;Y=145;width=88;height=80;angle=0;bc=snow;pc=darkslategray;pw=0"' Face 3 shape[1][20]="func=ell;X=60;Y=150;width=25;height=25;bc=snow;pc=darkslategray;pw=2"' eye 1 shape[1][21]="func=ell;X=65;Y=161;width=10;height=10;bc=darkslategray;pc=darkslategray;pw=2"' eye 1 shape[1][22]="func=ell;X=100;Y=150;width=25;height=25;bc=snow;pc=darkslategray;pw=2"' eye 2 shape[1][23]="func=ell;X=105;Y=161;width=10;height=10;bc=darkslategray;pc=darkslategray;pw=2"' eye 2 shape[1][24]="func=tri;X=-40;Y=20;x1=120;y1=170;x2=130;y2=180;x3=140;y3=170;bc=orange" ' nosy endsub End>GKP920.sb< Start>GKQ375.sb< GraphicsWindow.Show() GraphicsWindow.Title = "Click in the Window to move the sun" GraphicsWindow.BrushColor = "Orange" Sun = Controls.AddEllipse(20,20) Controls.Move(Sun, 250, 250) SunPos["x"] = 260 SunPos["y"] = 260 GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.BrushColor = "#4477ff" Objects[0] = Controls.AddRectangle(170, 200) Objects[1] = Controls.AddEllipse(200, 75) Controls.Move(Objects[0], 35, 80) Controls.Move(Objects[1], 200, 300) While "True" 'TextWindow.WriteLine("--New try--") W = GraphicsWindow.Width H = GraphicsWindow.Height GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle(0,0,W,H) GraphicsWindow.BrushColor = "Gray" GraphicsWindow.PenColor = "Gray" GraphicsWindow.PenWidth = 8 For Angle = 0 To 360 Step 0.75 'TextWindow.WriteLine(Angle) ' Reset the position to the sun Pos = SunPos CheckPos() ' Check the direction to walk If (Angle < 90) Or (Angle > 270) Then XStep = 1 YStep = Math.Tan(Math.GetRadians(Angle)) ElseIf Angle = 90 Then XStep = 0 YStep = 1 ElseIf Angle = 270 Then XStep = 0 YStep = -1 Else XStep = -1 YStep = -Math.Tan(Math.GetRadians(Angle)) EndIf ' Walk until the position is invalid While IsOK Pos["x"] = Pos["x"] + XStep Pos["y"] = Pos["y"] + YStep CheckPos() Ctrl = Controls.ElementFromPoint(Pos["x"], Pos["y"]) If (Ctrl <> "") And (Ctrl <> Sun) Then Pos["x"] = Pos["x"] + XStep Pos["y"] = Pos["y"] + YStep GraphicsWindow.DrawLine(Pos["x"], Pos["y"], Pos["x"] + W * XStep, Pos["y"] + W * YStep) IsOK = "False" Else Pos["x"] = Pos["x"] + XStep Pos["y"] = Pos["y"] + YStep CheckPos() EndIf EndWhile EndFor Program.Delay(5000) EndWhile IsOK = "False" Sub CheckPos If (Pos["x"] < 0) Or (Pos["x"] > W) Then IsOK = "False" ElseIf (Pos["y"] < 0) Or (Pos["y"] > H) Then IsOK = "False" Else IsOK = "True" EndIf EndSub Sub OnMouseDown SunPos["x"] = GraphicsWindow.MouseX SunPos["y"] = GraphicsWindow.MouseY Controls.Move(Sun, SunPos["x"] - 10, SunPos["y"] - 10) Angle = 0 EndSub End>GKQ375.sb< Start>GKR726.sb< ' IsNumber ' Version 0.2 ' Copyright © 2017 Nonki Takahashi. The MIT License. LF = Text.GetCharacter(10) WQ = Text.GetCharacter(34) Parse_Init() Test() While "True" TextWindow.Write("Number? ") n = TextWindow.Read() Text_IsNumber() If match Then TextWindow.ForegroundColor = "Green" TextWindow.WriteLine(WQ + n + WQ + " = " + value) Else TextWindow.ForegroundColor = "Red" TextWindow.WriteLine(WQ + n + WQ + " is not number.") EndIf TextWindow.ForegroundColor = "Gray" EndWhile Sub Test testcase[1] = "n=123;match=True;" testcase[2] = "n=4.5;match=True;" testcase[3] = "n=-6;match=True;" testcase[4] = "n=.7;match=True;" testcase[5] = "n=8.;match=True;" testcase[6] = "n=3-D;match=False;" testcase[7] = "match=False;" ' n="" testcase[8] = "n= ;match=False;" testcase[9] = "n= -19;match=True;" testcase[10] = "n=02E-3 ;match=True;" testcase[11] = "n= -5.4E+6 ;match=True;" testcase[12] = "n=8E28;match=False;" testcase[13] = "n=3.1415926535897932384626433832795;match=True;" testcase[14] = "n=-79228162514264337593543950335;match=True;" testcase[15] = "n=-79228162514264337593543950336;match=False;" testcase[16] = "n=-1E-28;match=True;" testcase[17] = "n=-1E-29;match=False;" testcase[18] = "n=1E-28;match=True;" testcase[19] = "n=1E-29;match=False;" testcase[20] = "n=79228162514264337593543950335;match=True;" testcase[21] = "n=79228162514264337593543950336;match=False;" nTest = Array.GetItemCount(testcase) TextWindow.WriteLine("Test started") nPass = 0 For i = 1 To nTest If i < 10 Then TextWindow.Write(" ") EndIf TextWindow.Write(i + " ") case = testcase[i] index = Array.GetAllIndices(case) n = case["n"] Text_IsNumber() If match = case["match"] Then TextWindow.ForegroundColor = "Green" TextWindow.Write("Pass") nPass = nPass + 1 Else TextWindow.ForegroundColor = "Red" TextWindow.Write("Fail") EndIf TextWindow.ForegroundColor = "Gray" TextWindow.Write(" " + WQ + n + WQ + " ") If match Then TextWindow.WriteLine("= " + value) Else TextWindow.WriteLine("is not number.") EndIf EndFor TextWindow.Write("Test ended") TextWindow.WriteLine(" (Pass: " + nPass + "/" + nTest + ")" + LF) EndSub Sub Text_IsNumber ' Text | Check if the text is number ' param n - text to check ' return match - "True" if match ' return value - number buf = n len = Text.GetLength(buf) p = 1 Parse_Number() If match And (p <= len) Then match = "False" EndIf EndSub Sub Parse_Init ' Parse | Initialization Not = "False=True;True=False;" EndSub Sub Parse_Char ' Parse | Parse character ' param chr - character set ' param buf - text buffer to T ' param p - pointer to buf ' return match - "True" if match ' return value - char ' return p - updated pointer to buf Stack.PushValue("local", _c) _c = Text.GetSubText(buf, p, 1) If Text.IsSubText(chr, _c) Then value = _c match = "True" p = p + 1 Else match = "False" EndIf _c = Stack.PopValue("local") EndSub Sub Parse_Digit ' Parse | Parse digit ' EBNF: digit = '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'. ' param buf - text buffer to parse ' param p - pointer to buf ' return match - "True" if match ' return value - digit ' return p - updated pointer to buf Stack.PushValue("local", chr) chr = "0123456789" Parse_Char() chr = Stack.PopValue("local") EndSub Sub Parse_Integer ' Parse | Parse integer ' EBNF: integer = ['-'],digit,{digit}. ' param buf - text buffer to parse ' param p - pointer to buf ' return match - "True" if match ' return value - integer ' return p - updated pointer to buf Stack.PushValue("local", _p) Stack.PushValue("local", chr) Stack.PushValue("local", _sgn) Stack.PushValue("local", _nz) Stack.PushValue("local", _value) Stack.PushValue("local", _match) _p = p chr = "-" Parse_Char() If match Then _sgn = "-" Else _sgn = "" EndIf Parse_Digit() _nz = "False" If match Then If 0 < value Then _nz = "True" EndIf _value = value While match Parse_Digit() If match then If 0 < value Then _nz = "True" EndIf _value = Text.Append(_value, value) Else value = (_sgn + _value) * 1 If _nz And (value = 0) Then _match = "False" p = _p Else _match = "True" EndIf EndIf EndWhile match = _match Else p = _p EndIF _match = Stack.PopValue("local") _value = Stack.PopValue("local") _nz = Stack.PopValue("local") _sgn = Stack.PopValue("local") chr = Stack.PopValue("local") _p = Stack.PopValue("local") EndSub Sub Parse_Real ' Parse | Parse real ' EBNF: real = ((integer,'.')|('.',digit)),{digit}. ' param buf - text buffer to parse ' param p - pointer to buf ' return match - "True" if match ' return value - real ' return p - updated pointer to buf Stack.PushValue("local", _p) Stack.PushValue("local", _int) Stack.PushValue("local", _frac) Stack.PushValue("local", chr) Stack.PushValue("local", _nz) _p = p Parse_Integer() _frac = "" If match Then _int = value chr = "." Parse_Char() Else _int = "" chr = "." Parse_Char() If match Then Parse_Digit() _nz = "False" If match Then If 0 < value Then _nz = "True" EndIf _frac = value EndIf EndIf EndIf If match Then Parse_Digit() If match Then If 0 < value Then _nz = "True" EndIf _frac = Text.Append(_frac, value) While match Parse_Digit() If match Then If 0 < value Then _nz = "True" EndIf _frac = Text.Append(_frac, value) EndIf EndWhile EndIf value = Text.Append(_int + ".", _frac) * 1 If _nz And (value = 0) Then match = "False" p = _p Else match = "True" EndIf Else p = _p EndIf _nz = Stack.PopValue("local") chr = Stack.PopValue("local") _frac = Stack.PopValue("local") _int = Stack.PopValue("local") _p = Stack.PopValue("local") EndSub Sub Parse_Sci ' Parse | Parse scientific notation number ' EBNF: sci = (real|integer),('E'|'e'),['-'|'+'],integer. ' param buf - text buffer to parse ' param p - pointer to buf ' return match - "True" if match ' return value - scientific notation number ' return p - updated pointer to buf Stack.PushValue("local", _p) Stack.PushValue("local", _base) Stack.PushValue("local", chr) Stack.PushValue("local", _sgn) Stack.PushValue("local", _pwr) _p = p Parse_Real() If Not[match] Then Parse_Integer() EndIf If match Then _base = value chr = "Ee" Parse_Char() If match Then _sgn = "" chr = "-+" Parse_Char() If match Then _sgn = value EndIf Parse_Integer() If match Then _pwr = value value = (_base + "E" + _sgn + _pwr) * 1 If ((_base < 0) Or (0 < _base)) And (value = 0) Then p = _p match = "False" EndIf Else p = _p EndIf Else p = _p EndIf EndIf _pwr = Stack.PopValue("local") _sgn = Stack.PopValue("local") chr = Stack.PopValue("local") _base = Stack.PopValue("local") _p = Stack.PopValue("local") EndSub Sub Parse_Number ' Parse | Parse number ' EBNF: number = {' '}(sci|real|integer){' '}. ' param buf - text buffer to parse ' param p - pointer to buf ' return match - "True" if match ' return value - number ' return p - updated pointer to buf Stack.PushValue("local", _p) Stack.PushValue("local", chr) Stack.PushValue("local", _match) Stack.PushValue("local", _value) _p = p chr = " " Parse_Char() While match Parse_Char() EndWhile Parse_Sci() If Not[match] Then Parse_Real() EndIf If Not[match] Then Parse_Integer() EndIf _match = match _value = value If match Then chr = " " Parse_Char() While match Parse_Char() EndWhile Else p = _p EndIF value = _value match = _match _value = Stack.PopValue("local") _match = Stack.PopValue("local") chr = Stack.PopValue("local") _p = Stack.PopValue("local") EndSub End>GKR726.sb< Start>GKR871.sb< GraphicsWindow.Width=1600 GraphicsWindow.Height=900 GraphicsWindow.BackgroundColor="midnightblue GraphicsWindow.PenWidth=0 GraphicsWindow.BrushColor="blue shapes.move(Shapes.AddEllipse (500 500) 200, -450) GraphicsWindow.Title ="Orbital Lattice er=6367444.7 ep=er*2*math.Pi d=math.pi*1000 e=2*er/1000 'f=e*d/2 ff=1000*Math.pi/(er*2) g=9.80665 sine_a=ldmath.Sin(45) v=22000 t=1 LDEvents.MouseWheel=mww zz=1 GraphicsWindow.KeyDown=kkk Sub mww zz=zz+ LDEvents.LastMouseWheelDelta/100 LDGraphicsWindow.Reposition (zz zz xx yy 0) EndSub Sub kkk ls=text.ConvertToLowerCase (GraphicsWindow.LastKey) If ls="left" then xx=xx-50 ElseIf ls="right" then xx=xx+50 ElseIf ls="up" then yy=yy-50 ElseIf ls="down" then yy=yy+50 EndIf LDGraphicsWindow.Reposition (zz zz xx yy 0) EndSub For r=0 to 5 t=0 h=0 GraphicsWindow.BrushColor=LDColours.HSLtoRGB (r*70-30 1 .7) While h>=0 h = v*sine_a*t-g*t*t/2 dx=v*sine_a*t s=ldMath.ArcSin(dx/ep) px=ldMath.cos(s+dd)*(250+h*ff)+450 py=ldmath.Sin(s+dd)*(250+h*ff)-200 Shapes.move (shapes.AddEllipse (25 25) px py) 'Program.Delay (4) ' Shapes.move (shapes.AddEllipse (3 3) dx*ff 300-h*ff) t=t+2 dd=dd+0.99 ' GraphicsWindow.Title=t EndWhile endfor End>GKR871.sb< Start>GKT777.sb< GraphicsWindow.Title="Biblioteca" GraphicsWindow.Height= 350 GraphicsWindow.Width=500 'fondo de la pantalla fondo= "C:\Users\admin\Pictures\bibliotecaaa.png" GraphicsWindow.DrawImage(fondo,0,0) Inicio: 'titulo GraphicsWindow.FontSize = 20 GraphicsWindow.BrushColor = "orange" GraphicsWindow.DrawText(120,20, "Bienvenido a la biblioteca ") GraphicsWindow.DrawText(150,50," Ricardo Lindo") GraphicsWindow.BrushColor= "white" GraphicsWindow.DrawText(20,100," Selecione la opción que desea realizar:") 'opciones GraphicsWindow.FontSize=14 GraphicsWindow.BrushColor = "black" ldl= Controls.AddButton("Menú historial de libros.", 20, 150) b= Controls.AddButton("Busqueda.", 20, 200) D= Controls.AddButton("Devolución de libro.", 20, 250) GraphicsWindow.BrushColor="red" salir=Controls.AddButton("Salir", 440, 300) 'Control de lo botones Controls.ButtonClicked = botonPresionado Sub botonPresionado ultimoBoton = Controls.LastClickedButton If ultimoBoton = ldl Then GraphicsWindow.Clear() menuldl() Elseif ultimoBoton = b then GraphicsWindow.Clear() menub() elseif ultimoBoton = D then GraphicsWindow.Clear() menuD() elseif ultimoBoton = salir then Program.End() EndIf EndSub sub menuldl Listado_Libros: TextWindow.Clear() TextWindow.ForegroundColor="yellow" TextWindow.BackgroundColor="black" TextWindow.Clear() TextWindow.WriteLine(" ╔═══════════════════════════════════════════════════╗") TextWindow.WriteLine(" ║ LISTADO GENERAL DE LIBROS ║") TextWindow.WriteLine(" ╚═══════════════════════════════════════════════════╝ ") TextWindow.ForegroundColor="white" Libro1["Nombre"] = " HAMLET " Libro1["Autor"]= "Shakespeare" Libro1["Editorial"]= "SIRUELA" Libro1["Tema general"]= "Linguística y retórica - 800 / 820 - Teatro" Libro1["Total de ejemplares"]= 4 Libro1["Ejemplares prestados"]= 1 For b=1 To Array.GetItemCount(Reserva_Libro) If Reserva_Libro[b]= "A" Then Libro1["Ejemplares prestados"]= Libro1["Ejemplares prestados"] + 1 EndIf EndFor Libro1["Ejemplares disponibles"]= Libro1["Total de ejemplares"] - Libro1["Ejemplares prestados"] If Libro1["Ejemplares disponibles"]= 0 Then TextWindow.ForegroundColor="red" TextWindow.WriteLine("----------------------------------------------------") TextWindow.WriteLine("* Por el momento no contamos con ningún ejemplar *") TextWindow.WriteLine("----------------------------------------------------") EndIf Libro1["Ubicación"]= "Estante 3, fila 4" TextWindow.WriteLine(" ") Emplist= Array.GetAllIndices(Libro1) For i=1 To Array.GetItemCount(Libro1) TextWindow.WriteLine(" ") TextWindow.WriteLine(Emplist[i] + ": " + Libro1[Emplist[i]]) EndFor TextWindow.WriteLine(" ") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="white" Libro2["Nombre"]= "ENSAYOS" Libro2["Autor"]= "Alberto Masferrer" Libro2["Editorial"]= "Colección pensamiento" Libro2["Tema general"]= "Lingüística y retórica - 800 / 870 - Ensayos" Libro2["Total de ejemplares"]= 10 Libro2["Ejemplares prestados"]= 2 For b=1 To Array.GetItemCount(Reserva_Libro) If Reserva_Libro[b]= "B" Then Libro2["Ejemplares prestados"]= Libro2["Ejemplares prestados"] + 1 EndIf EndFor Libro2["Ejemplares disponibles"]= Libro2["Total de ejemplares"] - Libro2["Ejemplares prestados"] If Libro2["Ejemplares disponibles"]= 0 Then TextWindow.ForegroundColor="red" TextWindow.WriteLine("----------------------------------------------------") TextWindow.WriteLine("* Por el momento no contamos con ningún ejemplar *") TextWindow.WriteLine("----------------------------------------------------") EndIf Libro2["Ubicación"]= "Estante 5, fila 16" Emplist= Array.GetAllIndices(Libro2) For i=1 To Array.GetItemCount(Libro2) TextWindow.WriteLine(" ") TextWindow.WriteLine(Emplist[i] + ": " + Libro2[Emplist[i]]) EndFor TextWindow.WriteLine(" ") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="white" Libro3["Nombre"]= "EL CONTRATO SOCIAL" Libro3["Autor"]= "Jean-Jaques Rousseau" Libro3["Editorial"]= "Catedra" Libro3["Tema general"]= "Filosofía - 100 - Ensayo social" Libro3["Total de ejemplares"]= 8 Libro3["Ejemplares prestados"]= 1 For b=1 To Array.GetItemCount(Reserva_Libro) If Reserva_Libro[b]= "C" Then Libro3["Ejemplares prestados"]= Libro3["Ejemplares prestados"] + 1 EndIf EndFor Libro3["Ejemplares disponibles"]= Libro3["Total de ejemplares"] - Libro3["Ejemplares prestados"] If Libro3["Ejemplares disponibles"]= 0 Then TextWindow.ForegroundColor="red" TextWindow.WriteLine("----------------------------------------------------") TextWindow.WriteLine("* Por el momento no contamos con ningún ejemplar *") TextWindow.WriteLine("----------------------------------------------------") EndIf Libro3["Ubicación"]= "Estante 5, fila 16" Emplist= Array.GetAllIndices(Libro3) For i=1 To Array.GetItemCount(Libro3) TextWindow.WriteLine(" ") TextWindow.WriteLine(Emplist[i] + ": " + Libro3[Emplist[i]]) EndFor TextWindow.WriteLine(" ") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="white" Libro4["Nombre"]= "PADRE RICO, PADRE POBRE" Libro4["Autor"]= "Robert T. Kiyosaki" Libro4["Editorial"]= "Punto lectura" Libro4["Tema general"]= "Ciencias Sociales/Economía - 300 / 330" Libro4["Total de ejemplares"]= 5 Libro4["Ejemplares prestados"]= 3 For b=1 To Array.GetItemCount(Reserva_Libro) If Reserva_Libro[b]= "D" Then Libro4["Ejemplares prestados"]= Libro4["Ejemplares prestados"] + 1 EndIf EndFor Libro4["Ejemplares disponibles"]= Libro4["Total de ejemplares"] - Libro4["Ejemplares prestados"] If Libro4["Ejemplares disponibles"]= 0 Then TextWindow.ForegroundColor="red" TextWindow.WriteLine("----------------------------------------------------") TextWindow.WriteLine("* Por el momento no contamos con ningún ejemplar *") TextWindow.WriteLine("----------------------------------------------------") EndIf Libro4["Ubicación"]= "Estante 2, fila 20" Emplist= Array.GetAllIndices(Libro4) For i=1 To Array.GetItemCount(Libro4) TextWindow.WriteLine(" ") TextWindow.WriteLine(Emplist[i] + ": " + Libro4[Emplist[i]]) EndFor TextWindow.WriteLine(" ") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="white" Libro5["Nombre"]= "LA VERDAD SOBRE EL CASO HARRY QUEBERT" Libro5["Autor"]= "Joël Dicker" Libro5["Editorial"]= "Alfaguara" Libro5["Tema general"]= "Literatura y retórica/Literatura francesa - 800 / 850" Libro5["Total de ejemplares"]= 3 Libro5["Ejemplares prestados"]= 1 For b=1 To Array.GetItemCount(Reserva_Libro) If Reserva_Libro[b]= "E" Then Libro5["Ejemplares prestados"]= Libro5["Ejemplares prestados"] + 1 EndIf EndFor Libro5["Ejemplares disponibles"]= Libro5["Total de ejemplares"] - Libro5["Ejemplares prestados"] If Libro5["Ejemplares disponibles"]= 0 Then TextWindow.ForegroundColor="red" TextWindow.WriteLine("----------------------------------------------------") TextWindow.WriteLine("* Por el momento no contamos con ningún ejemplar *") TextWindow.WriteLine("----------------------------------------------------") EndIf Libro5["Ubicación"]= "Estante 1, fila 22" Emplist= Array.GetAllIndices(Libro5) For i=1 To Array.GetItemCount(Libro5) TextWindow.WriteLine(" ") TextWindow.WriteLine(Emplist[i] + ": " + Libro5[Emplist[i]]) EndFor TextWindow.WriteLine(" ") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="white" Libro6["Nombre"]= "ORGULLO Y PREJUICIO" Libro6["Autor"]= "Jane Austen" Libro6["Editorial"]= "Punto lectura" Libro6["Tema general"]= "Literatura y retórica/Literatura inglesa - 800 / 820" Libro6["Total de ejemplares"]= 9 Libro6["Ejemplares prestados"]= 0 For b=1 To Array.GetItemCount(Reserva_Libro) If Reserva_Libro[b]= "F" Then Libro6["Ejemplares prestados"]= Libro6["Ejemplares prestados"] + 1 EndIf EndFor Libro6["Ejemplares disponibles"]= Libro6["Total de ejemplares"] - Libro6["Ejemplares prestados"] If Libro6["Ejemplares disponibles"]= 0 Then TextWindow.ForegroundColor="red" TextWindow.WriteLine("----------------------------------------------------") TextWindow.WriteLine("* Por el momento no contamos con ningún ejemplar *") TextWindow.WriteLine("----------------------------------------------------") EndIf Libro6["Ubicación"]= "Estante 3, fila 1" Emplist= Array.GetAllIndices(Libro6) For i=1 To Array.GetItemCount(Libro6) TextWindow.WriteLine(" ") TextWindow.WriteLine(Emplist[i] + ": " + Libro6[Emplist[i]]) EndFor TextWindow.WriteLine(" ") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="white" Libro7["Nombre"]= "IT" Libro7["Autor"]= "Stephen King" Libro7["Editorial"]= "Debolsillo" Libro7["Tema general"]= "Literatura y retórica/Literatura norteamericana - 800 / 810" Libro7["Total de ejemplares"]= 3 Libro7["Ejemplares prestados"]= 3 For b=1 To Array.GetItemCount(Reserva_Libro) If Reserva_Libro[b]= "G" Then Libro7["Ejemplares prestados"]= Libro7["Ejemplares prestados"] + 1 If Libro7["Ejemplares disponibles"] = 0 Then TextWindow.ForegroundColor="red" TextWindow.WriteLine("----------------------------------------------------") TextWindow.WriteLine("* Por el momento no contamos con ningún ejemplar *") TextWindow.WriteLine("----------------------------------------------------") EndIf EndIf EndFor Libro7["Ejemplares disponibles"]= Libro7["Total de ejemplares"] - Libro7["Ejemplares prestados"] If Libro7["Ejemplares disponibles"]= 0 Then TextWindow.ForegroundColor="red" TextWindow.WriteLine("----------------------------------------------------") TextWindow.WriteLine("* Por el momento no contamos con ningún ejemplar *") TextWindow.WriteLine("----------------------------------------------------") EndIf Libro7["Ubicación"]= "Estante 3, fila 4" Emplist= Array.GetAllIndices(Libro7) For i=1 To Array.GetItemCount(Libro7) TextWindow.WriteLine(" ") TextWindow.WriteLine(Emplist[i] + ": " + Libro7[Emplist[i]]) EndFor TextWindow.WriteLine(" ") TextWindow.ForegroundColor="white" TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") Libro8["Nombre"]= "HACIA RUTAS SALVAJES" Libro8["Autor"]= "Jon Krakaur" Libro8["Editorial"]= "Zeta ediciones" Libro8["Tema general"]= "Geografía e historia/Biografía - 900 / 920" Libro8["Total de ejemplares"]= 7 Libro8["Ejemplares prestados"]= 1 For b=1 To Array.GetItemCount(Reserva_Libro) If Reserva_Libro[b]= "H" Then Libro8["Ejemplares prestados"]= Libro8["Ejemplares prestados"] + 1 EndIf EndFor Libro8["Ejemplares disponibles"]= Libro8["Total de ejemplares"] - Libro8["Ejemplares prestados"] If Libro8["Ejemplares disponibles"]= 0 Then TextWindow.ForegroundColor="red" TextWindow.WriteLine("----------------------------------------------------") TextWindow.WriteLine("* Por el momento no contamos con ningún ejemplar *") TextWindow.WriteLine("----------------------------------------------------") EndIf Libro8["Ubicación"]= "Estante 7, fila 15" Emplist= Array.GetAllIndices(Libro8) For i=1 To Array.GetItemCount(Libro8) TextWindow.WriteLine(" ") TextWindow.WriteLine(Emplist[i] + ": " + Libro8[Emplist[i]]) EndFor TextWindow.WriteLine(" ") TextWindow.ForegroundColor="white" TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") Libro9["Nombre"]= "EXPRESIÓN ORAL Y ESCRITA" Libro9["Autor"]= "Ernesto Serrano" Libro9["Editorial"]= "Zamora" Libro9["Tema general"]= "Lengua/Lingüística - 400 / 410" Libro9["Total de ejemplares"]= 10 Libro9["Ejemplares prestados"]= 2 For b=1 To Array.GetItemCount(Reserva_Libro) If Reserva_Libro[b]= "I" Then Libro9["Ejemplares prestados"]= Libro9["Ejemplares prestados"] + 1 EndIf EndFor Libro9["Ejemplares disponibles"]= Libro9["Total de ejemplares"] - Libro9["Ejemplares prestados"] If Libro8["Ejemplares disponibles"]= 0 Then TextWindow.ForegroundColor="red" TextWindow.WriteLine("----------------------------------------------------") TextWindow.WriteLine("* Por el momento no contamos con ningún ejemplar *") TextWindow.WriteLine("----------------------------------------------------") EndIf Libro9["Ubicación"]= "Estante 1, fila 5" Emplist= Array.GetAllIndices(Libro9) For i=1 To Array.GetItemCount(Libro9) TextWindow.WriteLine(" ") TextWindow.WriteLine(Emplist[i] + ": " + Libro9[Emplist[i]]) EndFor TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="green" TextWindow.WriteLine("------------------------------------- M E N Ú ---------------------------------- ") TextWindow.ForegroundColor="white" TextWindow.WriteLine(" ") TextWindow.WriteLine("Ingrese el literal de la opción que desea realizar: ") TextWindow.WriteLine(" a. Reservar un libro") TextWindow.WriteLine(" b. Ver historial de prestamos") TextWindow.WriteLine(" C. Regresar a menú principal") TextWindow.WriteLine(" ") TextWindow.WriteLine("---------------------------------------------------") Reserva= Text.ConvertToLowerCase(TextWindow.Read()) If Reserva= "a" Then TextWindow.Clear() Goto Menu_Reserva ElseIf Reserva= "b" Then TextWindow.Clear() Goto Menu_HistorialPrestamos Elseif Reserva= "c" Then Goto Inicio Else TextWindow.WriteLine("Opción inválida") TextWindow.WriteLine("¿Desea intentar de nuevo?") Respuesta= text.ConvertToUpperCase(TextWindow.Read()) If Respuesta= "SI" Then Goto Listado_Libros ElseIf Respuesta= "NO" then Goto Inicio Else TextWindow.Clear() Program.End() EndIf EndIf Menu_HistorialPrestamos: TextWindow.ForegroundColor="green" TextWindow.BackgroundColor="black" TextWindow.Clear() TextWindow.WriteLine(" ╔═══════════════════════════════════════════════════╗") TextWindow.WriteLine(" ║ HISTORIAL DE PRESTAMOS DE LIBROS ║") TextWindow.WriteLine(" ╚═══════════════════════════════════════════════════╝ ") TextWindow.ForegroundColor="white" TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") TextWindow.WriteLine(" HAMLET") TextWindow.WriteLine(" William Shakespeare") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Nombre: Edwin Geovany Rodríguez Álvarez") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMOS") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: 25/05/2017") TextWindow.WriteLine("Periodo de préstamo: 15 días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") For y= (Numero_Reservas_Libros + 1) To Cantidad_final_Libros If Reserva_Libro[y]= "A" Then TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" For a=1 To Array.GetItemCount(Reserva_UsuarioN) TextWindow.WriteLine("Nombre: " + Reserva_UsuarioN[a] ) TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMO") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: " + Today) TextWindow.WriteLine("Tú fecha límite de devolución es: " + Day + "/" +Mesdev+ "/" + Year) TextWindow.WriteLine("Período de préstamo: " + Reserva_FechaD[a] + " días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") EndFor EndIf EndFor TextWindow.WriteLine(" ENSAYOS") TextWindow.WriteLine(" Alberto Masferrer") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") textWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Nombre: Lucas Mateo Juárez Solorsano") textWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMO") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: 05/06/2017") TextWindow.WriteLine("Periodo de préstamo: 7 días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Nombre: Erick Alejandro Barkovicht") textWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMO") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: 06/06/2017") TextWindow.WriteLine("Periodo de préstamo: 20 días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") For y= (Numero_Reservas_Libros + 1) To Cantidad_final_Libros If Reserva_Libro[y]= "B" Then TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" For a=1 To Array.GetItemCount(Reserva_UsuarioN) TextWindow.WriteLine("Nombre: " + Reserva_UsuarioN[a] ) TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMO") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: " + Today) TextWindow.WriteLine("Tú fecha límite de devolución es: " + Day + "/" +Mesdev+ "/" + Year) TextWindow.WriteLine("Período de préstamo: " + Reserva_FechaD[a] + " días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") EndFor EndIf EndFor TextWindow.WriteLine(" EL CONTRARO SOCIAL") TextWindow.WriteLine(" Jean-Jacques Rousseau") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") textWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Nombre: Cindy Gisella Contreras Reyes") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMOS") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: 30/05/2017") TextWindow.WriteLine("Periodo de préstamo: 30 días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") For y= (Numero_Reservas_Libros + 1) To Cantidad_final_Libros If Reserva_Libro[y]= "C" Then TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" For a=1 To Array.GetItemCount(Reserva_UsuarioN) TextWindow.WriteLine("Nombre: " + Reserva_UsuarioN[a] ) TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMO") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: " + Today) TextWindow.WriteLine("Tú fecha límite de devolución es: " + Day + "/" +Mesdev+ "/" + Year) TextWindow.WriteLine("Período de préstamo: " + Reserva_FechaD[a] + " días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") EndFor EndIf EndFor TextWindow.WriteLine(" PADRE RICO, PADRE POBRE") TextWindow.WriteLine(" Robert T. Kiyosaki") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") textWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Usuario: William Alejandro Deras Sosa") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMOS") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: 03/06/2017") TextWindow.WriteLine("Periodo de préstamo: 5 días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") textWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Nombre: Raymundo Alexander Garraty") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMOS") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: 29/05/2017") TextWindow.WriteLine("Periodo de préstamo: 18 días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") textWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Nombre: Mauricio Ernesto Stebbins Mata") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMOS") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: 31/05/2017") TextWindow.WriteLine("Periodo de préstamo: 10 días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") For y= (Numero_Reservas_Libros + 1) To Cantidad_final_Libros If Reserva_Libro[y]= "D" Then TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" For a=1 To Array.GetItemCount(Reserva_UsuarioN) TextWindow.WriteLine("Nombre: " + Reserva_UsuarioN[a] ) TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMO") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: " + Today) TextWindow.WriteLine("Tú fecha límite de devolución es: " + Day + "/" +Mesdev+ "/" + Year) TextWindow.WriteLine("Período de préstamo: " + Reserva_FechaD[a] + " días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") EndFor EndIf EndFor TextWindow.WriteLine(" LA VERDAD SOBRE EL CASO HARRY QUEBERT") TextWindow.WriteLine(" Joël Dicker") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") textWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Nombre: Andrea Vanessa Aguirre Montana") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMOS") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: 04/06/2017") TextWindow.WriteLine("Periodo de préstamo: 30 días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") For y= (Numero_Reservas_Libros + 1) To Cantidad_final_Libros If Reserva_Libro[y]= "E" Then TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" For a=1 To Array.GetItemCount(Reserva_UsuarioN) TextWindow.WriteLine("Nombre: " + Reserva_UsuarioN[a] ) TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMO") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: " + Today) TextWindow.WriteLine("Tú fecha límite de devolución es: " + Day + "/" +Mesdev+ "/" + Year) TextWindow.WriteLine("Período de préstamo: " + Reserva_FechaD[a] + " días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") EndFor EndIf EndFor TextWindow.WriteLine(" ORGULLO Y PREJUICIO") TextWindow.WriteLine(" Jane Austen") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") For y= (Numero_Reservas_Libros + 1) To Cantidad_final_Libros If Reserva_Libro[y]= "F" Then TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" For a=1 To Array.GetItemCount(Reserva_UsuarioN) TextWindow.WriteLine("Nombre: " + Reserva_UsuarioN[a] ) TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMO") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: " + Today) TextWindow.WriteLine("Tú fecha límite de devolución es: " + Day + "/" +Mesdev+ "/" + Year) TextWindow.WriteLine("Período de préstamo: " + Reserva_FechaD[a] + " días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") EndFor EndIf EndFor TextWindow.WriteLine(" IT") TextWindow.WriteLine(" Stephen King") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") textWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Nombre: Liliana Stephanie Ángel Guardado") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMOS") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: 31/05/2017") TextWindow.WriteLine("Periodo de préstamo: 9 días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") textWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Nombre: Tess Alexandra Moghanan") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMOS") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: 05/06/2017") TextWindow.WriteLine("Periodo de préstamo: 25 días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") textWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Nombre: Louisa Tamara Jímenez Gonzalez") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMOS") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: 06/06/2017") TextWindow.WriteLine("Periodo de préstamo: 10 días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") For y= (Numero_Reservas_Libros + 1) To Cantidad_final_Libros If Reserva_Libro[y]= "G" Then TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" For a=1 To Array.GetItemCount(Reserva_UsuarioN) TextWindow.WriteLine("Nombre: " + Reserva_UsuarioN[a] ) TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMO") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: " + Today) TextWindow.WriteLine("Tú fecha límite de devolución es: " + Day + "/" +Mesdev+ "/" + Year) TextWindow.WriteLine("Período de préstamo: " + Reserva_FechaD[a] + " días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") EndFor EndIf EndFor TextWindow.WriteLine(" HACIA RUTAS SALVAJES") TextWindow.WriteLine(" Jon Krakaur") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") textWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Usuario: Mara Samantha Guerra Martínez") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMOS") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: 15/05/2017") TextWindow.WriteLine("Periodo de préstamo: 28 días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") For y= (Numero_Reservas_Libros + 1) To Cantidad_final_Libros If Reserva_Libro[y]= "H" Then TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" For a=1 To Array.GetItemCount(Reserva_UsuarioN) TextWindow.WriteLine("Nombre: " + Reserva_UsuarioN[a] ) TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMO") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: " + Today) TextWindow.WriteLine("Tú fecha límite de devolución es: " + Day + "/" +Mesdev+ "/" + Year) TextWindow.WriteLine("Período de préstamo: " + Reserva_FechaD[a] + " días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") EndFor EndIf EndFor TextWindow.WriteLine(" EXPRESIÓN ORAL Y ESCRITA") TextWindow.WriteLine(" Ernesto Serrano") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") textWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Nombre: Samuel Enrique Huezo Castro") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMOS") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: 24/05/2017") TextWindow.WriteLine("Periodo de préstamo: 24 días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") textWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Usuario: Myriam Marina Martínez") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMOS") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: 30/05/2017") TextWindow.WriteLine("Periodo de préstamo: 13 días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") For y= (Numero_Reservas_Libros + 1) To Cantidad_final_Libros If Reserva_Libro[y]= "I" Then TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" For a=1 To Array.GetItemCount(Reserva_UsuarioN) TextWindow.WriteLine("Nombre: " + Reserva_UsuarioN[a] ) TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS DE PRESTAMO") TextWindow.ForegroundColor="white" TextWindow.WriteLine("Fecha de préstamo: " + Today) TextWindow.WriteLine("Tú fecha límite de devolución es: " + Day + "/" +Mesdev+ "/" + Year) TextWindow.WriteLine("Período de préstamo: " + Reserva_FechaD[a] + " días") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") EndFor EndIf EndFor TextWindow.WriteLine(" ") TextWindow.WriteLine("--------------------------------") TextWindow.WriteLine("¿Desea volver al menú principal?") TextWindow.WriteLine("--------------------------------") Salida= Text.ConvertToUpperCase(TextWindow.Read()) If Salida= "SI" Then Goto Inicio Else Program.End() EndIf Menu_Reserva: TextWindow.ForegroundColor="green" TextWindow.WriteLine(" RESERVA DE LIBRO") TextWindow.WriteLine("________________________________________________________________________________") TextWindow.ForegroundColor="white" TextWindow.WriteLine("A. HAMLET") TextWindow.WriteLine("B. ENSAYOS") TextWindow.WriteLine("C. EL CONTRARIO SOCIAL") TextWindow.WriteLine("D. PADRE RICO, PADRE POBRE") TextWindow.WriteLine("E. LA VERDAD SOBRE EL CASO HARRY QUEBERT") TextWindow.WriteLine("F. ORGULLO Y PREJUICIO") TextWindow.WriteLine("G. IT") TextWindow.WriteLine("H. HACIA RUTAS SALVAJES") TextWindow.WriteLine("I. EXPRESIÓN ORAL Y ESCRITA") A= "HAMLET" B= "ENSAYOS" C= "EL CONTRATO SOCIAL" D= "PADRE RICO, PADRE POBRE" E= "LA VERDAD SOBRE EL CASO HARRY QUEBERT" F= "ORGULLO Y PREJUICIO" G= "IT" H= "HACIA RUTAS SALVAJES" I= "EXPRESIÓN ORAL Y ESCRITA" TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") TextWindow.WriteLine("Ingresa el literal del libro que deseas: ") Numero_Reservas_Libros= Array.GetItemCount(Reserva_Libro) Cantidad_final_Libros= Numero_Reservas_Libros + 1 For y= (Numero_Reservas_Libros + 1) To Cantidad_final_Libros Reserva_Libro[y]= Text.ConvertToUpperCase(TextWindow.Read()) If Reserva_Libro[y]= "A" Then Text.ConvertToUpperCase(TextWindow.Read()) ElseIf Reserva_Libro[y]= "B" Then Text.ConvertToUpperCase(TextWindow.Read()) ElseIf Reserva_Libro[y]= "C" Then Text.ConvertToUpperCase(TextWindow.Read()) ElseIf Reserva_Libro[y]= "D" Then Text.ConvertToUpperCase(TextWindow.Read()) ElseIf Reserva_Libro[y]= "E" Then Text.ConvertToUpperCase(TextWindow.Read()) ElseIf Reserva_Libro[y]= "F" Then Text.ConvertToUpperCase(TextWindow.Read()) ElseIf Reserva_Libro[y]= "G" Then Text.ConvertToUpperCase(TextWindow.Read()) ElseIf Reserva_Libro[y]= "H" Then Text.ConvertToUpperCase(TextWindow.Read()) ElseIf Reserva_Libro[y]= "I" Then Text.ConvertToUpperCase(TextWindow.Read()) Else TextWindow.ForegroundColor="red" TextWindow.WriteLine("No contamos con el libro que solicitas") TextWindow.ForegroundColor="White" TextWindow.WriteLine("¿Desea intentar de nuevo?") Respuesta= text.ConvertToUpperCase(TextWindow.Read()) If Respuesta= "SI" Then TextWindow.Clear() Goto Menu_Reserva ElseIf Respuesta= "NO" then Goto Inicio Else Program.End() EndIf EndIf EndFor TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("DATOS PERSONALES") TextWindow.ForegroundColor="white" Numero_Reservas= Array.GetItemCount(Reserva_UsuarioN) Cantidad_final= Numero_Reservas + 1 For x= (Numero_Reservas + 1) To Cantidad_final TextWindow.WriteLine("Nombre") Reserva_UsuarioN[x]= Text.ConvertToUpperCase(TextWindow.Read()) TextWindow.WriteLine("Correo electrónico: ") Reserva_UsuarioC[x]= Text.ConvertToLowerCase(TextWindow.Read()) TextWindow.WriteLine("Teléfono: ") Reserva_UsuarioT[x]= Text.ConvertToUpperCase(TextWindow.Read()) TextWindow.WriteLine("Dirección: ") Reserva_UsuarioD[x]= Text.ConvertToUpperCase(TextWindow.Read()) TextWindow.WriteLine("Tipo de documento") Reserva_UsuarioDoc[x]= Text.ConvertToUpperCase(TextWindow.Read()) TextWindow.WriteLine("Ingrese el número o código del documento") Reserva_UsuarioND[x]= Text.ConvertToUpperCase(TextWindow.Read()) TextWindow.WriteLine("Periodo de prestamo: ") Reserva_FechaD[x]= Text.ConvertToUpperCase(TextWindow.Read()) EndFor If Reserva_FechaD <= 30 Then Text.ConvertToUpperCase(TextWindow.Read()) Else TextWindow.ForegroundColor="red" TextWindow.WriteLine("El periodo máximo para préstar un libro es de 30 días") TextWindow.ForegroundColor="white" TextWindow.WriteLine("¿Desea intentar de nuevo?") Answer= Text.ConvertToUpperCase(TextWindow.Read()) If Answer= "SI" Then TextWindow.Clear() Goto Menu_Reserva ElseIf Answer= "NO" then Goto Inicio Else TextWindow.Pause() Program.End() EndIf EndIf Carta_Reserva: Today= Clock.Date Day= Clock.Day Month= Clock.Month Year= Clock.Year Mesdev= Month + 1 TextWindow.BackgroundColor="black" TextWindow.ForegroundColor="orange" TextWindow.Clear() TextWindow.WriteLine(" ╔═══════════════════════════════════════════════════╗") TextWindow.WriteLine(" ║ CARTA DE RESERVA ║") TextWindow.WriteLine(" ╚═══════════════════════════════════════════════════╝ ") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="white" For y= (Numero_Reservas_Libros + 1) To Cantidad_final_Libros If Reserva_Libro[y] = "A" Then TextWindow.WriteLine("Libro: " + A) ElseIf Reserva_Libro[y] = "B" Then TextWindow.WriteLine("Libro: " + B) ElseIf Reserva_Libro[y] = "C" Then TextWindow.WriteLine("Libro: " + C) ElseIf Reserva_Libro[y] = "D" Then TextWindow.WriteLine("Libro: " + D) ElseIf Reserva_Libro[y] = "E" Then TextWindow.WriteLine("Libro: " + E) ElseIf Reserva_Libro[y] = "F" Then TextWindow.WriteLine("Libro: " + F) ElseIf Reserva_Libro[y] = "G" Then TextWindow.WriteLine("Libro: " + G) ElseIf Reserva_Libro[y] = "H" Then TextWindow.WriteLine("Libro: " + H) ElseIf Reserva_Libro[y] = "I" Then TextWindow.WriteLine("Libro: " + I) EndIf EndFor TextWindow.WriteLine(" ") TextWindow.WriteLine("Fecha de préstamo: " + Today) TextWindow.WriteLine(" ") TextWindow.WriteLine("Tú fecha límite de devolución es: " + Day + "/" +Mesdev+ "/" + Year) TextWindow.WriteLine(" ") For x= (Numero_Reservas + 1) To Cantidad_final TextWindow.WriteLine("Período de préstamo: " + Reserva_FechaD[x] + " días") TextWindow.WriteLine(" ") TextWindow.WriteLine("Nombre: " + Reserva_UsuarioN[x] ) TextWindow.WriteLine(" ") TextWindow.WriteLine("Correo: " + Reserva_UsuarioC[x]) TextWindow.WriteLine(" ") TextWindow.WriteLine("Código de documento: " + Reserva_UsuarioND[x]) TextWindow.WriteLine(" ") TextWindow.WriteLine("Tipo de documento: " + Reserva_UsuarioDoc[x]) EndFor TextWindow.WriteLine("_______________________________________________________________________________") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine(" ") TextWindow.WriteLine(" Condiciones de préstamo") TextWindow.ForegroundColor="white" TextWindow.WriteLine(" * No dañar los libros. Si usted encuentra el libro en malas condiciones por favor notificarlo al encargarlo antes de salir de la Biblioteca") TextWindow.WriteLine(" * Si el libro no es devuelto en el periodo estimado, se hará cobro de una penalización por entrega tardía, la cual equivale a $1.00 USD por cada día de retraso") TextWindow.WriteLine(" * Si usted entrega el libro antes del período límite, por favor registrarlo en 'ENTREGA DE LIBRO' dentro de este mismo programa") TextWindow.WriteLine(" * En caso que extravíe, dañe o tache cualquier libro, deberá reintegrar a la Biblioteca un nuevo ejemplar en buenas condiciones") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="green" TextWindow.WriteLine(" GRACIAS POR SU PREFERENCIA ") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="white" TextWindow.WriteLine(" ") TextWindow.WriteLine(" Ingrese 1 para confirmar su préstamo o cualquier otra tecla para cancelar") Answer2= Text.ConvertToUpperCase(TextWindow.Read()) If Answer2= "1" Then Goto Menu_HistorialPrestamos Else Program.End() EndIf EndSub Sub menub busqueda: TextWindow.Clear() TextWindow.BackgroundColor="black" TextWindow.Clear() TextWindow.ForegroundColor="white" TextWindow.WriteLine("Ingrese el nombre del libro que busca") TextWindow.ForegroundColor= "yellow" Libro= Text.ConvertToUpperCase(TextWindow.Read()) If Libro="HAMLET" Then TextWindow.Clear() TextWindow.ForegroundColor="White" TextWindow.BackgroundColor="Black" TextWindow.Clear() TextWindow.WriteLine(" ") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="white" Libro1["Nombre"] = " HAMLET " Libro1["Autor"]= "Shakespeare" Libro1["Editorial"]= "SIRUELA" Libro1["Tema general"]= "Linguística y retórica - 800 / 820 - Teatro" Libro1["Total de ejemplares"]= 4 Libro1["Ejemplares prestados"]= 2 Libro1["Ejemplares disponibles"]= Libro1["Total de ejemplares"] - Libro1["Ejemplares prestados"] If Libro1["Ejemplares disponibles"]= 0 Then TextWindow.ForegroundColor="red" TextWindow.WriteLine("----------------------------------------------------") TextWindow.WriteLine("* Por el momento no contamos con ningún ejemplar *") TextWindow.WriteLine("----------------------------------------------------") EndIf Libro1["Ubicación"]= "Estante 3, fila 4" TextWindow.WriteLine(" ") Emplist= Array.GetAllIndices(Libro1) For i=1 To Array.GetItemCount(Libro1) TextWindow.WriteLine(" ") TextWindow.WriteLine(Emplist[i] + ": " + Libro1[Emplist[i]] ) EndFor TextWindow.WriteLine("") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("¿Desea ir al menu reserva?") TextWindow.ForegroundColor="white" R=text.ConvertToUpperCase(TextWindow.Read()) If R= "SI" Then TextWindow.Clear() Goto Menu_Reserva ElseIf R= "NO" then Goto Inicio Else Program.End() EndIf ElseIf Libro="ENSAYOS" then TextWindow.Clear() TextWindow.ForegroundColor="White" TextWindow.BackgroundColor="Black" TextWindow.Clear() TextWindow.WriteLine(" ") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="white" Libro2["Nombre"]= "Ensayos" Libro2["Autor"]= "Alberto Masferrer" Libro2["Editorial"]= "Colección pensamiento" Libro2["Tema general"]= "Lingüística y retórica - 800 / 870 - Ensayos" Libro2["Total de ejemplares"]= 10 Libro2["Ejemplares prestados"]= 2 Libro2["Ejemplares disponibles"]= Libro2["Total de ejemplares"] - Libro2["Ejemplares prestados"] If Libro2["Ejemplares disponibles"]= 0 Then TextWindow.ForegroundColor="red" TextWindow.WriteLine("----------------------------------------------------") TextWindow.WriteLine("* Por el momento no contamos con ningún ejemplar *") TextWindow.WriteLine("----------------------------------------------------") EndIf Libro2["Ubicación"]= "Estante 5, fila 16" Emplist= Array.GetAllIndices(Libro2) For i=1 To Array.GetItemCount(Libro2) TextWindow.WriteLine(" ") TextWindow.WriteLine(Emplist[i] + ": " + Libro2[Emplist[i]]) EndFor TextWindow.WriteLine("") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("¿Desea ir al menu reserva?") TextWindow.ForegroundColor="white" R=text.ConvertToUpperCase(TextWindow.Read()) If R= "SI" Then TextWindow.Clear() Goto Menu_Reserva ElseIf R= "NO" then Goto Inicio Else Program.End() EndIf Elseif Libro="EL CONTRATO SOCIAL" Then TextWindow.Clear() TextWindow.ForegroundColor="White" TextWindow.BackgroundColor="Black" TextWindow.Clear() TextWindow.WriteLine(" ") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="white" Libro3["Nombre"]= "EL CONTRATO SOCIAL" Libro3["Autor"]= "Jean-Jaques Rousseau" Libro3["Editorial"]= "Catedra" Libro3["Tema general"]= "Filosofía - 100 - Ensayo social" Libro3["Total de ejemplares"]= 8 Libro3["Ejemplares prestados"]= 7 Libro3["Ejemplares disponibles"]= Libro3["Total de ejemplares"] - Libro3["Ejemplares prestados"] If Libro3["Ejemplares disponibles"]= 0 Then TextWindow.ForegroundColor="red" TextWindow.WriteLine("----------------------------------------------------") TextWindow.WriteLine("* Por el momento no contamos con ningún ejemplar *") TextWindow.WriteLine("----------------------------------------------------") EndIf Libro3["Ubicación"]= "Estante 5, fila 16" TextWindow.Pause() Emplist= Array.GetAllIndices(Libro3) For i=1 To Array.GetItemCount(Libro3) TextWindow.WriteLine(" ") TextWindow.WriteLine(Emplist[i] + ": " + Libro3[Emplist[i]]) EndFor TextWindow.WriteLine("") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("¿Desea ir al menu reserva?") TextWindow.ForegroundColor="white" R=text.ConvertToUpperCase(TextWindow.Read()) If R= "SI" Then TextWindow.Clear() Goto Menu_Reserva ElseIf R= "NO" then Goto Inicio Else Program.End() EndIf Elseif Libro="PADRE RICO, PADRE POBRE" Then TextWindow.Clear() TextWindow.ForegroundColor="White" TextWindow.BackgroundColor="Black" TextWindow.Clear() TextWindow.WriteLine(" ") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="white" Libro4["Nombre"]= "PADRE RICO, PADRE POBRE" Libro4["Autor"]= "Robert T. Kiyosaki" Libro4["Editorial"]= "Punto lectura" Libro4["Tema general"]= "Ciencias Sociales/Economía - 300 / 330" Libro4["Total de ejemplares"]= 5 Libro4["Ejemplares prestados"]= 2 Libro4["Ejemplares disponibles"]= Libro4["Total de ejemplares"] - Libro4["Ejemplares prestados"] If Libro4["Ejemplares disponibles"]= 0 Then TextWindow.ForegroundColor="red" TextWindow.WriteLine("----------------------------------------------------") TextWindow.WriteLine("* Por el momento no contamos con ningún ejemplar *") TextWindow.WriteLine("----------------------------------------------------") EndIf Libro4["Ubicación"]= "Estante 2, fila 20" Emplist= Array.GetAllIndices(Libro4) For i=1 To Array.GetItemCount(Libro4) TextWindow.WriteLine(" ") TextWindow.WriteLine(Emplist[i] + ": " + Libro4[Emplist[i]]) EndFor TextWindow.WriteLine("") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("¿Desea ir al menu reserva?") TextWindow.ForegroundColor="white" R=text.ConvertToUpperCase(TextWindow.Read()) If R= "SI" Then TextWindow.Clear() Goto Menu_Reserva ElseIf R= "NO" then Goto Inicio Else Program.End() EndIf Elseif Libro="LA VERDAD SOBRE EL CASO HARRY QUEBERT" Then TextWindow.Clear() TextWindow.ForegroundColor="White" TextWindow.BackgroundColor="Black" TextWindow.Clear() TextWindow.WriteLine(" ") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="white" Libro5["Nombre"]= "LA VERDAD SOBRE EL CASO HARRY QUEBERT" Libro5["Autor"]= "Joël Dicker" Libro5["Editorial"]= "Alfaguara" Libro5["Tema general"]= "Literatura y retórica/Literatura francesa - 800 / 850" Libro5["Total de ejemplares"]= 3 Libro5["Ejemplares prestados"]= 1 Libro5["Ejemplares disponibles"]= Libro5["Total de ejemplares"] - Libro5["Ejemplares prestados"] If Libro5["Ejemplares disponibles"]= 0 Then TextWindow.ForegroundColor="red" TextWindow.WriteLine("----------------------------------------------------") TextWindow.WriteLine("* Por el momento no contamos con ningún ejemplar *") TextWindow.WriteLine("----------------------------------------------------") EndIf Libro5["Ubicación"]= "Estante 1, fila 22" Emplist= Array.GetAllIndices(Libro5) For i=1 To Array.GetItemCount(Libro5) TextWindow.WriteLine(" ") TextWindow.WriteLine(Emplist[i] + ": " + Libro5[Emplist[i]]) EndFor TextWindow.WriteLine("") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("¿Desea ir al menu reserva?") TextWindow.ForegroundColor="white" R=text.ConvertToUpperCase(TextWindow.Read()) If R= "SI" Then TextWindow.Clear() Goto Menu_Reserva ElseIf R= "NO" then Goto Inicio Else Program.End() EndIf Elseif Libro="ORGULLO Y PREJUICIO" Then TextWindow.Clear() TextWindow.ForegroundColor="White" TextWindow.BackgroundColor="Black" TextWindow.Clear() TextWindow.WriteLine(" ") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="white" Libro6["Nombre"]= "ORGULLO Y PREJUICIO" Libro6["Autor"]= "jJane Austen" Libro6["Editorial"]= "Punto lectura" Libro6["Tema general"]= "Literatura y retórica/Literatura inglese - 800 / 820" Libro6["Total de ejemplares"]= 9 Libro6["Ejemplares prestados"]= 0 Libro6["Ejemplares disponibles"]= Libro6["Total de ejemplares"] - Libro6["Ejemplares prestados"] If Libro6["Ejemplares disponibles"]= 0 Then TextWindow.ForegroundColor="red" TextWindow.WriteLine("----------------------------------------------------") TextWindow.WriteLine("* Por el momento no contamos con ningún ejemplar *") TextWindow.WriteLine("----------------------------------------------------") EndIf Libro6["Ubicación"]= "Estante 3, fila 1" Emplist= Array.GetAllIndices(Libro6) For i=1 To Array.GetItemCount(Libro6) TextWindow.WriteLine(" ") TextWindow.WriteLine(Emplist[i] + ": " + Libro6[Emplist[i]]) EndFor TextWindow.WriteLine("") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("¿Desea ir al menu reserva?") TextWindow.ForegroundColor="white" R=text.ConvertToUpperCase(TextWindow.Read()) If R= "SI" Then TextWindow.Clear() Goto Menu_Reserva ElseIf R= "NO" then Goto Inicio Else Program.End() EndIf Elseif Libro="IT" Then TextWindow.Clear() TextWindow.ForegroundColor="White" TextWindow.BackgroundColor="Black" TextWindow.Clear() TextWindow.WriteLine(" ") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="white" Libro7["Nombre"]= "IT" Libro7["Autor"]= "Stephen King" Libro7["Editorial"]= "Debolsillo" Libro7["Tema general"]= "Literatura y retórica/Literatura norteamericana - 800 / 810" Libro7["Total de ejemplares"]= 3 Libro7["Ejemplares prestados"]= 3 Libro7["Ejemplares disponibles"]= Libro7["Total de ejemplares"] - Libro7["Ejemplares prestados"] If Libro7["Ejemplares disponibles"]= 0 Then TextWindow.ForegroundColor="red" TextWindow.WriteLine("----------------------------------------------------") TextWindow.WriteLine("* Por el momento no contamos con ningún ejemplar *") TextWindow.WriteLine("----------------------------------------------------") EndIf Libro7["Ubicación"]= "Estante 3, fila 4" Emplist= Array.GetAllIndices(Libro7) For i=1 To Array.GetItemCount(Libro7) TextWindow.WriteLine(" ") TextWindow.WriteLine(Emplist[i] + ": " + Libro7[Emplist[i]]) EndFor TextWindow.WriteLine("") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("¿Desea ir al menu reserva?") TextWindow.ForegroundColor="white" R=text.ConvertToUpperCase(TextWindow.Read()) If R= "SI" Then TextWindow.Clear() Goto Menu_Reserva ElseIf R= "NO" then Goto Inicio Else Program.End() EndIf Elseif Libro="HACIA RUTAS SALVAJES" Then TextWindow.Clear() TextWindow.ForegroundColor="White" TextWindow.BackgroundColor="Black" TextWindow.Clear() TextWindow.WriteLine(" ") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="white" Libro8["Nombre"]= "HACIA RUTAS SALVAJES" Libro8["Autor"]= "Jon Krakaur" Libro8["Editorial"]= "Zeta ediciones" Libro8["Tema general"]= "Geografía e historia/Biografía - 900 / 920" Libro8["Total de ejemplares"]= 7 Libro8["Ejemplares prestados"]= 1 Libro8["Ejemplares disponibles"]= Libro8["Total de ejemplares"] - Libro8["Ejemplares prestados"] If Libro8["Ejemplares disponibles"]= 0 Then TextWindow.ForegroundColor="red" TextWindow.WriteLine("----------------------------------------------------") TextWindow.WriteLine("* Por el momento no contamos con ningún ejemplar *") TextWindow.WriteLine("----------------------------------------------------") EndIf Libro8["Ubicación"]= "Estante 7, fila 15" Emplist= Array.GetAllIndices(Libro8) For i=1 To Array.GetItemCount(Libro8) TextWindow.WriteLine(" ") TextWindow.WriteLine(Emplist[i] + ": " + Libro8[Emplist[i]]) EndFor TextWindow.WriteLine("") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("¿Desea ir al menu reserva?") TextWindow.ForegroundColor="white" R=text.ConvertToUpperCase(TextWindow.Read()) If R= "SI" Then TextWindow.Clear() Goto Menu_Reserva ElseIf R= "NO" then Goto Inicio Else Program.End() EndIf Elseif Libro="EXPRESIÓN ORAL Y ESCRITA" Then TextWindow.Clear() TextWindow.ForegroundColor="White" TextWindow.BackgroundColor="Black" TextWindow.Clear() TextWindow.WriteLine(" ") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" ") TextWindow.ForegroundColor="white" Libro9["Nombre"]= "EXPRESIÓN ORAL Y ESCRITA" Libro9["Autor"]= "Ernesto Serrano" Libro9["Editorial"]= "Zamora" Libro9["Tema general"]= "Lengua/Lingüística - 400 / 410" Libro9["Total de ejemplares"]= 10 Libro9["Ejemplares prestados"]= 3 Libro9["Ejemplares disponibles"]= Libro9["Total de ejemplares"] - Libro9["Ejemplares prestados"] If Libro9["Ejemplares disponibles"]= 0 Then TextWindow.ForegroundColor="red" TextWindow.WriteLine("----------------------------------------------------") TextWindow.WriteLine("* Por el momento no contamos con ningún ejemplar *") TextWindow.WriteLine("----------------------------------------------------") EndIf Libro9["Ubicación"]= "Estante 1, fila 5" Libro9["Reservar"]= "¿Desea reservar algún ejemplar?" Emplist= Array.GetAllIndices(Libro9) For i=1 To Array.GetItemCount(Libro9) TextWindow.WriteLine(" ") TextWindow.WriteLine(Emplist[i] + ": " + Libro9[Emplist[i]]) EndFor TextWindow.WriteLine("") TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine("¿Desea ir al menu reserva?") TextWindow.ForegroundColor="white" R=text.ConvertToUpperCase(TextWindow.Read()) If R= "SI" Then TextWindow.Clear() Goto Menu_Reserva ElseIf R= "NO" then Goto Inicio Else Program.End() EndIf Else TextWindow.ForegroundColor="White" TextWindow.WriteLine("Lo sentimos no contamos con ese libro, ¿desea intentar escribir de nuevo?") TextWindow.ForegroundColor="yellow" R2=text.ConvertToUpperCase(TextWindow.Read()) If R2= "SI"Then Goto Busqueda ElseIf R2= "NO"then Goto Inicio EndIf EndIf EndSub Sub menuD 'Devolución_Libros: Devolución_Libros: TextWindow.Clear() TextWindow.ForegroundColor="white" TextWindow.BackgroundColor="black" TextWindow.Clear() TextWindow.WriteLine(" ") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine(" ╔═══════════════════════════════════════════════════╗") TextWindow.WriteLine(" ║ DEVOLUCIÓN DE LIBROS ║") TextWindow.WriteLine(" ╚═════════════════════════════════════════════���═════╝ ") TextWindow.ForegroundColor="white" TextWindow.BackgroundColor="black" TextWindow.WriteLine("Nombre: ") Name= TextWindow.Read() TextWindow.WriteLine(" ") TextWindow.WriteLine("Nombre de libro prestado: ") Name_b= TextWindow.Read() TextWindow.WriteLine(" ") TextWindow.WriteLine("Fecha de prestamo: ") TextWindow.Write("Año: ") Año= TextWindow.Read()*365 TextWindow.Write("Mes: ") Mes= TextWindow.Read()*30 TextWindow.Write("Día: ") Dia= TextWindow.Read() TextWindow.WriteLine(" ") TextWindow.WriteLine("Fecha de devolución: ") Año_D= Clock.Year T_año_D= Año_D*365 TextWindow.WriteLine("Año: "+Año_D) Mes_D= Clock.Month T_mes_D= Mes_D*30 TextWindow.WriteLine("Mes: "+Mes_D) Dia_D= Clock.Day TextWindow.WriteLine("Día: "+Dia_D) 'Suma del prestamo Pres= Año+Mes+Dia 'Suma de la devolución Dev= T_año_D+T_mes_D+Dia_D 'Resta de las cantidades Total_D= Dev-Pres 'CONDICIONAL If Total_D>30 Then TextWindow.ForegroundColor="RED" TextWindow.WriteLine("+------------------------------------------------------------------------------+") TextWindow.WriteLine("¦ Se pasó de la fecha de devolución ¦") TextWindow.WriteLine(" ") pago= Total_D-30 Total_pago= pago*0.25 TextWindow.WriteLine(" Debes un total de: $"+Total_pago) TextWindow.WriteLine("¦ ¦") TextWindow.WriteLine("+------------------------------------------------------------------------------+") Else TextWindow.ForegroundColor="Green" TextWindow.WriteLine("--------------------------------------------------------------------------------") TextWindow.WriteLine(" Gracias por devolver el libro a tiempo ") TextWindow.WriteLine("--------------------------------------------------------------------------------") EndIf TextWindow.ForegroundColor="white" TextWindow.WriteLine("¿Desea reservar otro libro?") Ans1=text.ConvertToUpperCase(TextWindow.Read()) If Ans1 = "SI" Then Goto Menu_Reserva ElseIf Ans1 = "NO" then Else Program.End() EndIf For b2=1 To Array.GetItemCount(Reserva_Libro) If Name_b= Libro1 Then Libro1["Ejemplares prestados"]= Libro1["Ejemplares prestados"] - 1 EndIf EndFor For b2=1 To Array.GetItemCount(Reserva_Libro) If Name_b= Libro2 Then Libro2["Ejemplares prestados"]= Libro2["Ejemplares prestados"] - 1 EndIf EndFor For b2=1 To Array.GetItemCount(Reserva_Libro) If Name_b= Libro3 Then Libro3["Ejemplares prestados"]= Libro3["Ejemplares prestados"] - 1 EndIf EndFor For b2=1 To Array.GetItemCount(Reserva_Libro) If Name_b= Libro4 Then Libro4["Ejemplares prestados"]= Libro4["Ejemplares prestados"] - 1 EndIf EndFor For b2=1 To Array.GetItemCount(Reserva_Libro) If Name_b= Libro5 Then Libro5["Ejemplares prestados"]= Libro5["Ejemplares prestados"] - 1 EndIf EndFor For b2=1 To Array.GetItemCount(Reserva_Libro) If Name_b= Libro6 Then Libro6["Ejemplares prestados"]= Libro6["Ejemplares prestados"] - 1 EndIf EndFor For b2=1 To Array.GetItemCount(Reserva_Libro) If Name_b= Libro7 Then Libro7["Ejemplares prestados"]= Libro7["Ejemplares prestados"] - 1 EndIf EndFor For b2=1 To Array.GetItemCount(Reserva_Libro) If Name_b= Libro8 Then Libro8["Ejemplares prestados"]= Libro8["Ejemplares prestados"] - 1 EndIf EndFor For b2=1 To Array.GetItemCount(Reserva_Libro) If Name_b= Libro9 Then Libro9["Ejemplares prestados"]= Libro9["Ejemplares prestados"] - 1 EndIf EndFor EndSub End>GKT777.sb< Start>GKT789-0.sb< Start() '______________________________________________________________' ' START '______________________________________________________________' Sub Start TextWindow.Title = "NAME" TextWindow.WriteLine("Select your language: Deutsch (DE) or English (EN)") TextWindow.WriteLine("") Sprache[1] = TextWindow.Read() Steuerung[1] = "ST1" Sounds[1] = "Ja" Musik[1] = Program.Directory + "\Musik\Musik1.mp3" Musik[2] = Program.Directory + "\Musik\Musik2.mp3"'und immer so weiter.... Texte() TextWindow.BackgroundColor = "Black" TextWindow.Clear() Menu() EndSub '______________________________________________________________' ' MENU '______________________________________________________________' Sub Menu If (Sounds[1] = "Ja") Then Sound.Play(Musik[1]) EndIf TextWindow.ForegroundColor = "DarkGreen" TextWindow.WriteLine(Header) TextWindow.ForegroundColor = "DarkRed" TextWindow.WriteLine("________________________________________________________________________________") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") TextWindow.WriteLine(MenuText) TextWindow.Write(" ") TextWindow.ForegroundColor = "DarkBlue" Eingabe = TextWindow.Read() TextWindow.ForegroundColor = "DarkRed" If (Sprache[1] = "English") Then If (Eingabe = "Singleplayer") Then SinglePlayer() ElseIf (Eingabe = "Multiplayer") Then Multiplayer() ElseIf (Eingabe = "Optionen") Then Optionen() ElseIf (Eingabe = "End") Then Program.End() ElseIf (Eingabe = "SP") Then SinglePlayer() ElseIf (Eingabe = "MP") Then Multiplayer() ElseIf (Eingabe = "OP") Then Optionen() ElseIf (Eingabe = "ED") Then Program.End() Else FehlkommandoME() EndIf ElseIf (Sprache[1] = "EN") Then If (Eingabe = "Singelplayer") Then SinglePlayer() ElseIf (Eingabe = "Multiplayer") Then Multiplayer() ElseIf (Eingabe = "Optionen") Then Optionen() ElseIf (Eingabe = "End") Then Program.End() ElseIf (Eingabe = "SP") Then SinglePlayer() ElseIf (Eingabe = "MP") Then Multiplayer() ElseIf (Eingabe = "OP") Then Optionen() ElseIf (Eingabe = "ED") Then Program.End() Else FehlkommandoME() EndIf ElseIf (Sprache[1] = "Deutsch") Then If (Eingabe = "Einzelspieler") Then SinglePlayer() ElseIf (Eingabe = "Mehrspieler") Then Multiplayer() ElseIf (Eingabe = "Optionen") Then Optionen() ElseIf (Eingabe = "BE") Then Program.End() ElseIf (Eingabe = "ES") Then SinglePlayer() ElseIf (Eingabe = "MS") Then Multiplayer() ElseIf (Eingabe = "OP") Then Optionen() ElseIf (Eingabe = "Beenden") Then Program.End() Else FehlkommandoME() EndIf ElseIf (Sprache[1] = "DE") Then If (Eingabe = "Einzelspieler") Then SinglePlayer() ElseIf (Eingabe = "Mehrspieler") Then Multiplayer() ElseIf (Eingabe = "Optionen") Then Optionen() ElseIf (Eingabe = "Beenden") Then Program.End() ElseIf (Eingabe = "ES") Then SinglePlayer() ElseIf (Eingabe = "MS") Then Multiplayer() ElseIf (Eingabe = "OP") Then Optionen() ElseIf (Eingabe = "BE") Then Program.End() Else FehlkommandoME() EndIf EndIf EndSub '______________________________________________________________' ' SINGLEPLAYER '______________________________________________________________' Sub SinglePlayer GraphicsWindow.Hide() GraphicsWindow.ShowMessage("This is still in work!", "NAME")' Name ist NAME TextWindow.Clear() Menu() EndSub '______________________________________________________________' ' MULTIPLAYER '______________________________________________________________' Sub MultiPlayer GraphicsWindow.Hide() GraphicsWindow.ShowMessage("This is still in work!", "NAME")' Name ist NAME TextWindow.Clear() Menu() EndSub '______________________________________________________________' ' STEUERUNGSFENSTER '______________________________________________________________' Sub Steuerungsfenster1 If (Sprache[1] = "English") Then Button = "Back" ElseIf (Sprache[1] = "EN") Then Button = "Back" ElseIf (Sprache[1] = "Deutsch") Then Button = "Zurück" ElseIf (Sprache[1] = "DE") Then Button = "Zurück" EndIf GraphicsWindow.Height = Hoehe1 GraphicsWindow.Width = Breite1 GraphicsWindow.Title = "NAME" 'Name ist NAME GraphicsWindow.Top = Desktop.Height * "0,5" GraphicsWindow.Left = Desktop.Width * "0,75"' Hier muss noch eine Wahlfunktion eingefügt werden!!! GraphicsWindow.Show() GraphicsWindow.FontName = "Arial" GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawImage(SteuerungBild1, 1, 1) ZurueckButton = Controls.AddButton(Button, Breite1-100, Hoehe1-30) Controls.SetSize(ZurueckButton, 100, 30) Controls.ButtonClicked = OnButton TextWindow.Clear() Optionen() EndSub Sub Steuerungsfenster2 If (Sprache[1] = "English") Then Button = "Back" ElseIf (Sprache[1] = "EN") Then Button = "Back" ElseIf (Sprache[1] = "Deutsch") Then Button = "Zurück" ElseIf (Sprache[1] = "DE") Then Button = "Zurück" EndIf GraphicsWindow.Height = Hoehe2 GraphicsWindow.Width = Breite2 GraphicsWindow.Title = "NAME" 'Name ist NAME GraphicsWindow.Top = Desktop.Height * "0,5" GraphicsWindow.Left = Desktop.Width * "0,75"' Hier muss noch eine Wahlfunktion eingefügt werden!!! GraphicsWindow.Show() GraphicsWindow.FontName = "Arial" GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawImage(SteuerungBild2, 1, 1) ZurueckButton = Controls.AddButton(Button, Breite2-100, Hoehe2-30) Controls.SetSize(ZurueckButton, 100, 30) Controls.ButtonClicked = OnButton TextWindow.Clear() Optionen() EndSub Sub OnButton button = Controls.LastClickedButton If (button = ZurueckButton) Then GraphicsWindow.Hide() EndIf EndSub '______________________________________________________________' ' OPTIONEN '______________________________________________________________' Sub Optionen If (Sounds[1] = "Ja") Then Sound.Play(Musik[1]) ElseIf (Sounds[1] = "Nein") Then Sound.Stop(Musik[1]) 'Sound.Stop(Musik[2]) Das ist hier nicht nötig. nochnicht..... EndIf TextWindow.Clear() TextWindow.ForegroundColor = "DarkGreen" TextWindow.WriteLine(Header) TextWindow.ForegroundColor = "DarkRed" TextWindow.WriteLine("________________________________________________________________________________") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") TextWindow.WriteLine(OptionenText) TextWindow.Write(" ") TextWindow.ForegroundColor = "DarkBlue" EingabeOP = TextWindow.Read() TextWindow.ForegroundColor = "DarkRed" If (Sprache[1] = "English") Then If (EingabeOP = "Show Controls1") Then Steuerungsfenster1() ElseIf (EingabeOP = "SC1") Then Steuerungsfenster1() ElseIf (EingabeOP = "Show Controls2") Then Steuerungsfenster2() ElseIf (EingabeOP = "SC2") Then Steuerungsfenster2() ElseIf (EingabeOP = "Choose Controls") Then TextWindow.Clear() SteuerungW() ElseIf (EingabeOP = "CC") Then TextWindow.Clear() SteuerungW() ElseIf (EingabeOP = "Enable Sounds") Then Sounds[1] = "Ja" 'Muss in jeder Soundpassage abgefragt werden TextWindow.Clear() Optionen() ElseIf (EingabeOP = "ES") Then Sounds[1] = "Ja" 'Muss in jeder Soundpassage abgefragt werden TextWindow.Clear() Optionen() ElseIf (EingabeOP = "Disable Sounds") Then Sounds[1] = "Nein" 'Muss in jeder Soundpassage abgefragt werden TextWindow.Clear() Optionen() ElseIf (EingabeOP = "DS") Then Sounds[1] = "Nein" 'Muss in jeder Soundpassage abgefragt werden TextWindow.Clear() Optionen() ElseIf (EingabeOP = "Change Language") Then TextWindow.Clear() Start() ElseIf (EingabeOP = "CL") Then TextWindow.Clear() Start() ElseIf (EingabeOP = "Back") Then TextWindow.Clear() Menu() ElseIf (EingabeOP = "BA") Then TextWindow.Clear() Menu() Else FehlkommandoOP() EndIf ElseIf (Sprache[1] = "Deutsch") Then If (EingabeOP = "Zeige Steuerung1") Then Steuerungsfenster1() ElseIf (EingabeOP = "ZS1") Then Steuerungsfenster1() ElseIf (EingabeOP = "Zeige Steuerung2") Then Steuerungsfenster2() ElseIf (EingabeOP = "ZS2") Then Steuerungsfenster2() ElseIf (EingabeOP = "Steuerung waehlen") Then TextWindow.Clear() SteuerungW() ElseIf (EingabeOP = "SW") Then TextWindow.Clear() SteuerungW() ElseIf (EingabeOP = "Sounds aktivieren") Then Sounds[1] = "Ja" 'Muss in jeder Soundpassage abgefragt werden TextWindow.Clear() Optionen() ElseIf (EingabeOP = "SA") Then Sounds[1] = "Ja" 'Muss in jeder Soundpassage abgefragt werden TextWindow.Clear() Optionen() ElseIf (EingabeOP = "Sounds deaktivieren") Then Sounds[1] = "Nein" 'Muss in jeder Soundpassage abgefragt werden TextWindow.Clear() Optionen() ElseIf (EingabeOP = "SD") Then Sounds[1] = "Nein" 'Muss in jeder Soundpassage abgefragt werden TextWindow.Clear() Optionen() ElseIf (EingabeOP = "Sprache veraendern") Then TextWindow.Clear() Start() ElseIf (EingabeOP = "SV") Then TextWindow.Clear() Start() ElseIf (EingabeOP = "Zurueck") Then TextWindow.Clear() Menu() ElseIf (EingabeOP = "ZU") Then TextWindow.Clear() Menu() Else FehlkommandoOP() EndIf ElseIf (Sprache[1] = "EN") Then If (EingabeOP = "Show Controls1") Then Steuerungsfenster1() ElseIf (EingabeOP = "SC1") Then Steuerungsfenster1() ElseIf (EingabeOP = "Show Controls2") Then Steuerungsfenster2() ElseIf (EingabeOP = "SC2") Then Steuerungsfenster2() ElseIf (EingabeOP = "Choose Controls") Then TextWindow.Clear() SteuerungW() ElseIf (EingabeOP = "CC") Then TextWindow.Clear() SteuerungW() ElseIf (EingabeOP = "Enable Sounds") Then Sounds[1] = "Ja" 'Muss in jeder Soundpassage abgefragt werden TextWindow.Clear() Optionen() ElseIf (EingabeOP = "ES") Then Sounds[1] = "Ja" 'Muss in jeder Soundpassage abgefragt werden TextWindow.Clear() Optionen() ElseIf (EingabeOP = "Disable Sounds") Then Sounds[1] = "Nein" 'Muss in jeder Soundpassage abgefragt werden TextWindow.Clear() Optionen() ElseIf (EingabeOP = "DS") Then Sounds[1] = "Nein" 'Muss in jeder Soundpassage abgefragt werden TextWindow.Clear() Optionen() ElseIf (EingabeOP = "Change Language") Then TextWindow.Clear() Start() ElseIf (EingabeOP = "CL") Then TextWindow.Clear() Start() ElseIf (EingabeOP = "Back") Then TextWindow.Clear() Menu() ElseIf (EingabeOP = "BA") Then TextWindow.Clear() Menu() Else FehlkommandoOP() EndIf ElseIf (Sprache[1] = "DE") Then If (EingabeOP = "Zeige Steuerung1") Then Steuerungsfenster1() ElseIf (EingabeOP = "ZS1") Then Steuerungsfenster1() ElseIf (EingabeOP = "Zeige Steuerung2") Then Steuerungsfenster2() ElseIf (EingabeOP = "ZS2") Then Steuerungsfenster2() ElseIf (EingabeOP = "Steuerung waehlen") Then TextWindow.Clear() SteuerungW() ElseIf (EingabeOP = "SW") Then TextWindow.Clear() SteuerungW() ElseIf (EingabeOP = "Sounds aktivieren") Then Sounds[1] = "Ja" 'Muss in jeder Soundpassage abgefragt werden TextWindow.Clear() Optionen() ElseIf (EingabeOP = "SA") Then Sounds[1] = "Ja" 'Muss in jeder Soundpassage abgefragt werden TextWindow.Clear() Optionen() ElseIf (EingabeOP = "Sounds deaktivieren") Then Sounds[1] = "Nein" 'Muss in jeder Soundpassage abgefragt werden TextWindow.Clear() Optionen() ElseIf (EingabeOP = "SD") Then Sounds[1] = "Nein" 'Muss in jeder Soundpassage abgefragt werden TextWindow.Clear() Optionen() ElseIf (EingabeOP = "Sprache veraendern") Then TextWindow.Clear() Start() ElseIf (EingabeOP = "SV") Then TextWindow.Clear() Start() ElseIf (EingabeOP = "Zurueck") Then TextWindow.Clear() Menu() ElseIf (EingabeOP = "ZU") Then TextWindow.Clear() Menu() Else FehlkommandoOP() EndIf EndIf EndSub '______________________________________________________________' ' STEUERUNG WAEHLEN '______________________________________________________________' Sub SteuerungW TextWindow.ForegroundColor = "DarkGreen" TextWindow.WriteLine(Header) TextWindow.ForegroundColor = "DarkRed" TextWindow.WriteLine("________________________________________________________________________________") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") TextWindow.WriteLine(SteuerungWText) EingabeSTW = TextWindow.Read() If (EingabeSTW = "ST1") Then Steuerung[1] = "ST1" 'Muss in jeder Steuerungspassage abgefragt werden Optionen() ElseIf (EingabeSTW = "ST2") Then Steuerung[1] = "ST2" 'Muss in jeder Steuerungspassage abgefragt werden Optionen() Else FehlkommandoW() EndIf EndSub '______________________________________________________________' ' FEHLKOMMANDO '______________________________________________________________' Sub FehlkommandoME If (Sprache[1] = "English") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("The entered command is wrong!", "NAME")'Name ist NAME TextWindow.Clear() Menu() ElseIf (Sprache[1] = "Deutsch") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("Der eingegebene Befehl ist falsch!", "NAME")'Name ist NAME TextWindow.Clear() Menu() ElseIf (Sprache[1] = "EN") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("The entered command is wrong!", "NAME")'Name ist NAME TextWindow.Clear() Menu() ElseIf (Sprache[1] = "DE") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("Der eingegebene Befehl ist falsch!", "NAME")'Name ist NAME TextWindow.Clear() Menu() EndIf EndSub Sub FehlkommandoSP If (Sprache[1] = "English") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("The entered command is wrong!", "NAME")'Name ist NAME TextWindow.Clear() SinglePlayer() ElseIf (Sprache[1] = "Deutsch") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("Der eingegebene Befehl ist falsch!", "NAME")'Name ist NAME TextWindow.Clear() SinglePlayer() ElseIf (Sprache[1] = "EN") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("The entered command is wrong!", "NAME")'Name ist NAME TextWindow.Clear() SinglePlayer() ElseIf (Sprache[1] = "DE") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("Der eingegebene Befehl ist falsch!", "NAME")'Name ist NAME TextWindow.Clear() SinglePlayer() EndIf EndSub Sub FehlkommandoMP If (Sprache[1] = "English") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("The entered command is wrong!", "NAME")'Name ist NAME TextWindow.Clear() MultiPlayer() ElseIf (Sprache[1] = "Deutsch") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("Der eingegebene Befehl ist falsch!", "NAME")'Name ist NAME TextWindow.Clear() MultiPlayer() ElseIf (Sprache[1] = "EN") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("The entered command is wrong!", "NAME")'Name ist NAME TextWindow.Clear() MultiPlayer() ElseIf (Sprache[1] = "DE") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("Der eingegebene Befehl ist falsch!", "NAME")'Name ist NAME TextWindow.Clear() MultiPlayer() EndIf EndSub Sub FehlkommandoOP If (Sprache[1] = "English") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("The entered command is wrong!", "NAME")'Name ist NAME TextWindow.Clear() Optionen() ElseIf (Sprache[1] = "Deutsch") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("Der eingegebene Befehl ist falsch!", "NAME")'Name ist NAME TextWindow.Clear() Optionen() ElseIf (Sprache[1] = "EN") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("The entered command is wrong!", "NAME")'Name ist NAME TextWindow.Clear() Optionen() ElseIf (Sprache[1] = "DE") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("Der eingegebene Befehl ist falsch!", "NAME")'Name ist NAME TextWindow.Clear() Optionen() EndIf EndSub Sub FehlkommandoW If (Sprache[1] = "English") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("The entered command is wrong!", "NAME")'Name ist NAME TextWindow.Clear() SteuerungW() ElseIf (Sprache[1] = "Deutsch") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("Der eingegebene Befehl ist falsch!", "NAME")'Name ist NAME TextWindow.Clear() SteuerungW() ElseIf (Sprache[1] = "EN") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("The entered command is wrong!", "NAME")'Name ist NAME TextWindow.Clear() SteuerungW() ElseIf (Sprache[1] = "DE") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("Der eingegebene Befehl ist falsch!", "NAME")'Name ist NAME TextWindow.Clear() SteuerungW() EndIf EndSub '______________________________________________________________' ' TEXTE (SPRACHEN) '______________________________________________________________' Sub Texte ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' Header = File.ReadContents(Program.Directory + "\Texte\Header.txt") If (Sprache[1] = "English") Then ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' MenuText = File.ReadContents(Program.Directory + "\Texte\MenuTextEN.txt") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' OptionenText = File.ReadContents(Program.Directory + "\Texte\OptionenTextEN.txt") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' _SPText = File.ReadContents(Program.Directory + "\Texte\SPTextEN.txt") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' MPText = File.ReadContents(Program.Directory + "\Texte\MPTextEN.txt") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' StoryText = File.ReadContents(Program.Directory + "\Texte\StoryTextEN.txt") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' SteuerungWText = File.ReadContents(Program.Directory + "\Texte\SteuerungWTextEN.txt") SteuerungBild1 = ImageList.LoadImage(Program.Directory + "\Bilder\Steuerung1 EN.jpg") Hoehe1 = ImageList.GetHeightOfImage(SteuerungBild1) Breite1 = ImageList.GetWidthOfImage(SteuerungBild1) SteuerungBild2 = ImageList.LoadImage(Program.Directory + "\Bilder\Steuerung2 EN.jpg") Hoehe2 = ImageList.GetHeightOfImage(SteuerungBild2) Breite2 = ImageList.GetWidthOfImage(SteuerungBild2) Button = "Back" ElseIf (Sprache[1] = "Deutsch") Then ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' MenuText = File.ReadContents(Program.Directory + "\Texte\MenuTextDE.txt") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' OptionenText = File.ReadContents(Program.Directory + "\Texte\OptionenTextDE.txt") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' _SPText = File.ReadContents(Program.Directory + "\Texte\SPTextDE.txt") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' MPText = File.ReadContents(Program.Directory + "\Texte\MPTextDE.txt") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' StoryText = File.ReadContents(Program.Directory + "\Texte\StoryTextDE.txt") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' SteuerungWText = File.ReadContents(Program.Directory + "\Texte\SteuerungWTextDE.txt") SteuerungBild1 = ImageList.LoadImage(Program.Directory + "\Bilder\Steuerung1 DE.jpg") Hoehe1 = ImageList.GetHeightOfImage(SteuerungBild1) Breite1 = ImageList.GetWidthOfImage(SteuerungBild1) SteuerungBild2 = ImageList.LoadImage(Program.Directory + "\Bilder\Steuerung2 DE.jpg") Hoehe2 = ImageList.GetHeightOfImage(SteuerungBild2) Breite2 = ImageList.GetWidthOfImage(SteuerungBild2) Button = "Zurück" ElseIf (Sprache[1] = "EN") Then ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' MenuText = File.ReadContents(Program.Directory + "\Texte\MenuTextEN.txt") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' OptionenText = File.ReadContents(Program.Directory + "\Texte\OptionenTextEN.txt") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' _SPText = File.ReadContents(Program.Directory + "\Texte\SPTextEN.txt") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' MPText = File.ReadContents(Program.Directory + "\Texte\MPTextEN.txt") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' StoryText = File.ReadContents(Program.Directory + "\Texte\StoryTextEN.txt") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' SteuerungWText = File.ReadContents(Program.Directory + "\Texte\SteuerungWTextEN.txt") SteuerungBild1 = ImageList.LoadImage(Program.Directory + "\Bilder\Steuerung1 EN.jpg") Hoehe1 = ImageList.GetHeightOfImage(SteuerungBild1) Breite1 = ImageList.GetWidthOfImage(SteuerungBild1) SteuerungBild2 = ImageList.LoadImage(Program.Directory + "\Bilder\Steuerung2 EN.jpg") Hoehe2 = ImageList.GetHeightOfImage(SteuerungBild2) Breite2 = ImageList.GetWidthOfImage(SteuerungBild2) Button = "Back" ElseIf (Sprache[1] = "DE") Then ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' MenuText = File.ReadContents(Program.Directory + "\Texte\MenuTextDE.txt") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' OptionenText = File.ReadContents(Program.Directory + "\Texte\OptionenTextDE.txt") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' _SPText = File.ReadContents(Program.Directory + "\Texte\SPTextDE.txt") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' MPText = File.ReadContents(Program.Directory + "\Texte\MPTextDE.txt") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' StoryText = File.ReadContents(Program.Directory + "\Texte\StoryTextDE.txt") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' SteuerungWText = File.ReadContents(Program.Directory + "\Texte\SteuerungWTextDE.txt") SteuerungBild1 = ImageList.LoadImage(Program.Directory + "\Bilder\Steuerung1 DE.jpg") Hoehe1 = ImageList.GetHeightOfImage(SteuerungBild1) Breite1 = ImageList.GetWidthOfImage(SteuerungBild1) SteuerungBild2 = ImageList.LoadImage(Program.Directory + "\Bilder\Steuerung2 DE.jpg") Hoehe2 = ImageList.GetHeightOfImage(SteuerungBild2) Breite2 = ImageList.GetWidthOfImage(SteuerungBild2) Button = "Zurück" Else TextWindow.Clear() TextWindow.WriteLine("This language is not supported! Please select another one!") TextWindow.WriteLine("") Start() EndIf EndSub End>GKT789-0.sb< Start>GKT789.sb< Start() '______________________________________________________________' ' START '______________________________________________________________' Sub Start TextWindowPlus.Title = "NAME" TextWindowPlus.WriteLine("Select your language: Deutsch (DE) or English (EN)") TextWindowPlus.WriteLine("") Sprache[1] = TextWindowPlus.Read() Steuerung[1] = "ST1" Sounds[1] = "Ja" Musik[1] = Program.Directory + "\Musik\Musik1.mp3" Musik[2] = Program.Directory + "\Musik\Musik2.mp3"'und immer so weiter.... Texte() TextWindowPlus.BackgroundColor = "Black" TextWindowPlus.Clear() Menu() EndSub '______________________________________________________________' ' MENU '______________________________________________________________' Sub Menu If (Sounds[1] = "Ja") Then Sound.Play(Musik[1]) EndIf TextWindowPlus.ForegroundColor = "DarkGreen" TextWindowPlus.WriteLine(Header) TextWindowPlus.ForegroundColor = "DarkRed" TextWindowPlus.WriteLine("________________________________________________________________________________") TextWindowPlus.WriteLine(" ") TextWindowPlus.WriteLine(" ") TextWindowPlus.WriteLine(MenuText) TextWindowPlus.Write(" ") TextWindowPlus.ForegroundColor = "DarkBlue" Eingabe = TextWindowPlus.Read() TextWindowPlus.ForegroundColor = "DarkRed" If (Sprache[1] = "English") Then If (Eingabe = "Singelplayer") Then SinglePlayer() ElseIf (Eingabe = "Multiplayer") Then Multiplayer() ElseIf (Eingabe = "Optionen") Then Optionen() ElseIf (Eingabe = "End") Then Program.End() ElseIf (Eingabe = "SP") Then SinglePlayer() ElseIf (Eingabe = "MP") Then Multiplayer() ElseIf (Eingabe = "OP") Then Optionen() ElseIf (Eingabe = "ED") Then Program.End() Else FehlkommandoME() EndIf ElseIf (Sprache[1] = "EN") Then If (Eingabe = "Singelplayer") Then SinglePlayer() ElseIf (Eingabe = "Multiplayer") Then Multiplayer() ElseIf (Eingabe = "Optionen") Then Optionen() ElseIf (Eingabe = "End") Then Program.End() ElseIf (Eingabe = "SP") Then SinglePlayer() ElseIf (Eingabe = "MP") Then Multiplayer() ElseIf (Eingabe = "OP") Then Optionen() ElseIf (Eingabe = "ED") Then Program.End() Else FehlkommandoME() EndIf ElseIf (Sprache[1] = "Deutsch") Then If (Eingabe = "Einzelspieler") Then SinglePlayer() ElseIf (Eingabe = "Mehrspieler") Then Multiplayer() ElseIf (Eingabe = "Optionen") Then Optionen() ElseIf (Eingabe = "BE") Then Program.End() ElseIf (Eingabe = "ES") Then SinglePlayer() ElseIf (Eingabe = "MS") Then Multiplayer() ElseIf (Eingabe = "OP") Then Optionen() ElseIf (Eingabe = "Beenden") Then Program.End() Else FehlkommandoME() EndIf ElseIf (Sprache[1] = "DE") Then If (Eingabe = "Einzelspieler") Then SinglePlayer() ElseIf (Eingabe = "Mehrspieler") Then Multiplayer() ElseIf (Eingabe = "Optionen") Then Optionen() ElseIf (Eingabe = "Beenden") Then Program.End() ElseIf (Eingabe = "ES") Then SinglePlayer() ElseIf (Eingabe = "MS") Then Multiplayer() ElseIf (Eingabe = "OP") Then Optionen() ElseIf (Eingabe = "BE") Then Program.End() Else FehlkommandoME() EndIf EndIf EndSub '______________________________________________________________' ' SINGLEPLAYER '______________________________________________________________' Sub SinglePlayer GraphicsWindow.Hide() GraphicsWindow.ShowMessage("This is still in work!", "NAME")' Name ist NAME TextWindowPlus.Clear() Menu() EndSub '______________________________________________________________' ' MULTIPLAYER '______________________________________________________________' Sub MultiPlayer GraphicsWindow.Hide() GraphicsWindow.ShowMessage("This is still in work!", "NAME")' Name ist NAME TextWindowPlus.Clear() Menu() EndSub '______________________________________________________________' ' STEUERUNGSFENSTER '______________________________________________________________' Sub Steuerungsfenster1 If (Sprache[1] = "English") Then Button = "Back" ElseIf (Sprache[1] = "EN") Then Button = "Back" ElseIf (Sprache[1] = "Deutsch") Then Button = "Zurück" ElseIf (Sprache[1] = "DE") Then Button = "Zurück" EndIf GraphicsWindow.Height = Hoehe1 GraphicsWindow.Width = Breite1 GraphicsWindow.Title = "NAME" 'Name ist NAME GraphicsWindow.Top = Desktop.Height * "0,5" GraphicsWindow.Left = Desktop.Width * "0,75"' Hier muss noch eine Wahlfunktion eingefügt werden!!! GraphicsWindow.Show() GraphicsWindow.FontName = "Arial" GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawImage(SteuerungBild1, 1, 1) ZurueckButton = Controls.AddButton(Button, Breite1-100, Hoehe1-30) Controls.SetSize(ZurueckButton, 100, 30) Controls.ButtonClicked = OnButton TextWindowPlus.Clear() Optionen() EndSub Sub Steuerungsfenster2 If (Sprache[1] = "English") Then Button = "Back" ElseIf (Sprache[1] = "EN") Then Button = "Back" ElseIf (Sprache[1] = "Deutsch") Then Button = "Zurück" ElseIf (Sprache[1] = "DE") Then Button = "Zurück" EndIf GraphicsWindow.Height = Hoehe2 GraphicsWindow.Width = Breite2 GraphicsWindow.Title = "NAME" 'Name ist NAME GraphicsWindow.Top = Desktop.Height * "0,5" GraphicsWindow.Left = Desktop.Width * "0,75"' Hier muss noch eine Wahlfunktion eingefügt werden!!! GraphicsWindow.Show() GraphicsWindow.FontName = "Arial" GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawImage(SteuerungBild2, 1, 1) ZurueckButton = Controls.AddButton(Button, Breite2-100, Hoehe2-30) Controls.SetSize(ZurueckButton, 100, 30) Controls.ButtonClicked = OnButton TextWindowPlus.Clear() Optionen() EndSub Sub OnButton button = Controls.LastClickedButton If (button = ZurueckButton) Then GraphicsWindow.Hide() EndIf EndSub '______________________________________________________________' ' OPTIONEN '______________________________________________________________' Sub Optionen If (Sounds[1] = "Ja") Then Sound.Play(Musik[1]) ElseIf (Sounds[1] = "Nein") Then Sound.Stop(Musik[1]) 'Sound.Stop(Musik[2]) Das ist hier nicht nötig. nochnicht..... EndIf TextWindowPlus.Clear() TextWindowPlus.ForegroundColor = "DarkGreen" TextWindowPlus.WriteLine(Header) TextWindowPlus.ForegroundColor = "DarkRed" TextWindowPlus.WriteLine("________________________________________________________________________________") TextWindowPlus.WriteLine(" ") TextWindowPlus.WriteLine(" ") TextWindowPlus.WriteLine(OptionenText) TextWindowPlus.Write(" ") TextWindowPlus.ForegroundColor = "DarkBlue" EingabeOP = TextWindowPlus.Read() TextWindowPlus.ForegroundColor = "DarkRed" If (Sprache[1] = "English") Then If (EingabeOP = "Show Controls1") Then Steuerungsfenster1() ElseIf (EingabeOP = "SC1") Then Steuerungsfenster1() ElseIf (EingabeOP = "Show Controls2") Then Steuerungsfenster2() ElseIf (EingabeOP = "SC2") Then Steuerungsfenster2() ElseIf (EingabeOP = "Choose Controls") Then TextWindowPlus.Clear() SteuerungW() ElseIf (EingabeOP = "CC") Then TextWindowPlus.Clear() SteuerungW() ElseIf (EingabeOP = "Enable Sounds") Then Sounds[1] = "Ja" 'Muss in jeder Soundpassage abgefragt werden TextWindowPlus.Clear() Optionen() ElseIf (EingabeOP = "ES") Then Sounds[1] = "Ja" 'Muss in jeder Soundpassage abgefragt werden TextWindowPlus.Clear() Optionen() ElseIf (EingabeOP = "Disable Sounds") Then Sounds[1] = "Nein" 'Muss in jeder Soundpassage abgefragt werden TextWindowPlus.Clear() Optionen() ElseIf (EingabeOP = "DS") Then Sounds[1] = "Nein" 'Muss in jeder Soundpassage abgefragt werden TextWindowPlus.Clear() Optionen() ElseIf (EingabeOP = "Change Language") Then TextWindowPlus.Clear() Start() ElseIf (EingabeOP = "CL") Then TextWindowPlus.Clear() Start() ElseIf (EingabeOP = "Back") Then TextWindowPlus.Clear() Menu() ElseIf (EingabeOP = "BA") Then TextWindowPlus.Clear() Menu() Else FehlkommandoOP() EndIf ElseIf (Sprache[1] = "Deutsch") Then If (EingabeOP = "Zeige Steuerung1") Then Steuerungsfenster1() ElseIf (EingabeOP = "ZS1") Then Steuerungsfenster1() ElseIf (EingabeOP = "Zeige Steuerung2") Then Steuerungsfenster2() ElseIf (EingabeOP = "ZS2") Then Steuerungsfenster2() ElseIf (EingabeOP = "Steuerung waehlen") Then TextWindowPlus.Clear() SteuerungW() ElseIf (EingabeOP = "SW") Then TextWindowPlus.Clear() SteuerungW() ElseIf (EingabeOP = "Sounds aktivieren") Then Sounds[1] = "Ja" 'Muss in jeder Soundpassage abgefragt werden TextWindowPlus.Clear() Optionen() ElseIf (EingabeOP = "SA") Then Sounds[1] = "Ja" 'Muss in jeder Soundpassage abgefragt werden TextWindowPlus.Clear() Optionen() ElseIf (EingabeOP = "Sounds deaktivieren") Then Sounds[1] = "Nein" 'Muss in jeder Soundpassage abgefragt werden TextWindowPlus.Clear() Optionen() ElseIf (EingabeOP = "SD") Then Sounds[1] = "Nein" 'Muss in jeder Soundpassage abgefragt werden TextWindowPlus.Clear() Optionen() ElseIf (EingabeOP = "Sprache veraendern") Then TextWindowPlus.Clear() Start() ElseIf (EingabeOP = "SV") Then TextWindowPlus.Clear() Start() ElseIf (EingabeOP = "Zurueck") Then TextWindowPlus.Clear() Menu() ElseIf (EingabeOP = "ZU") Then TextWindowPlus.Clear() Menu() Else FehlkommandoOP() EndIf ElseIf (Sprache[1] = "EN") Then If (EingabeOP = "Show Controls1") Then Steuerungsfenster1() ElseIf (EingabeOP = "SC1") Then Steuerungsfenster1() ElseIf (EingabeOP = "Show Controls2") Then Steuerungsfenster2() ElseIf (EingabeOP = "SC2") Then Steuerungsfenster2() ElseIf (EingabeOP = "Choose Controls") Then TextWindowPlus.Clear() SteuerungW() ElseIf (EingabeOP = "CC") Then TextWindowPlus.Clear() SteuerungW() ElseIf (EingabeOP = "Enable Sounds") Then Sounds[1] = "Ja" 'Muss in jeder Soundpassage abgefragt werden TextWindowPlus.Clear() Optionen() ElseIf (EingabeOP = "ES") Then Sounds[1] = "Ja" 'Muss in jeder Soundpassage abgefragt werden TextWindowPlus.Clear() Optionen() ElseIf (EingabeOP = "Disable Sounds") Then Sounds[1] = "Nein" 'Muss in jeder Soundpassage abgefragt werden TextWindowPlus.Clear() Optionen() ElseIf (EingabeOP = "DS") Then Sounds[1] = "Nein" 'Muss in jeder Soundpassage abgefragt werden TextWindowPlus.Clear() Optionen() ElseIf (EingabeOP = "Change Language") Then TextWindowPlus.Clear() Start() ElseIf (EingabeOP = "CL") Then TextWindowPlus.Clear() Start() ElseIf (EingabeOP = "Back") Then TextWindowPlus.Clear() Menu() ElseIf (EingabeOP = "BA") Then TextWindowPlus.Clear() Menu() Else FehlkommandoOP() EndIf ElseIf (Sprache[1] = "DE") Then If (EingabeOP = "Zeige Steuerung1") Then Steuerungsfenster1() ElseIf (EingabeOP = "ZS1") Then Steuerungsfenster1() ElseIf (EingabeOP = "Zeige Steuerung2") Then Steuerungsfenster2() ElseIf (EingabeOP = "ZS2") Then Steuerungsfenster2() ElseIf (EingabeOP = "Steuerung waehlen") Then TextWindowPlus.Clear() SteuerungW() ElseIf (EingabeOP = "SW") Then TextWindowPlus.Clear() SteuerungW() ElseIf (EingabeOP = "Sounds aktivieren") Then Sounds[1] = "Ja" 'Muss in jeder Soundpassage abgefragt werden TextWindowPlus.Clear() Optionen() ElseIf (EingabeOP = "SA") Then Sounds[1] = "Ja" 'Muss in jeder Soundpassage abgefragt werden TextWindowPlus.Clear() Optionen() ElseIf (EingabeOP = "Sounds deaktivieren") Then Sounds[1] = "Nein" 'Muss in jeder Soundpassage abgefragt werden TextWindowPlus.Clear() Optionen() ElseIf (EingabeOP = "SD") Then Sounds[1] = "Nein" 'Muss in jeder Soundpassage abgefragt werden TextWindowPlus.Clear() Optionen() ElseIf (EingabeOP = "Sprache veraendern") Then TextWindowPlus.Clear() Start() ElseIf (EingabeOP = "SV") Then TextWindowPlus.Clear() Start() ElseIf (EingabeOP = "Zurueck") Then TextWindowPlus.Clear() Menu() ElseIf (EingabeOP = "ZU") Then TextWindowPlus.Clear() Menu() Else FehlkommandoOP() EndIf EndIf EndSub '______________________________________________________________' ' STEUERUNG WAEHLEN '______________________________________________________________' Sub SteuerungW TextWindowPlus.ForegroundColor = "DarkGreen" TextWindowPlus.WriteLine(Header) TextWindowPlus.ForegroundColor = "DarkRed" TextWindowPlus.WriteLine("________________________________________________________________________________") TextWindowPlus.WriteLine(" ") TextWindowPlus.WriteLine(" ") TextWindowPlus.WriteLine(" ") TextWindowPlus.WriteLine(SteuerungWText) EingabeSTW = TextWindowPlus.Read() If (EingabeSTW = "ST1") Then Steuerung[1] = "ST1" 'Muss in jeder Steuerungspassage abgefragt werden Optionen() ElseIf (EingabeSTW = "ST2") Then Steuerung[1] = "ST2" 'Muss in jeder Steuerungspassage abgefragt werden Optionen() Else FehlkommandoW() EndIf EndSub '______________________________________________________________' ' FEHLKOMMANDO '______________________________________________________________' Sub FehlkommandoME If (Sprache[1] = "English") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("The entered command is wrong!", "NAME")'Name ist NAME TextWindowPlus.Clear() Menu() ElseIf (Sprache[1] = "Deutsch") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("Der eingegebene Befehl ist falsch!", "NAME")'Name ist NAME TextWindowPlus.Clear() Menu() ElseIf (Sprache[1] = "EN") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("The entered command is wrong!", "NAME")'Name ist NAME TextWindowPlus.Clear() Menu() ElseIf (Sprache[1] = "DE") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("Der eingegebene Befehl ist falsch!", "NAME")'Name ist NAME TextWindowPlus.Clear() Menu() EndIf EndSub Sub FehlkommandoSP If (Sprache[1] = "English") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("The entered command is wrong!", "NAME")'Name ist NAME TextWindowPlus.Clear() SinglePlayer() ElseIf (Sprache[1] = "Deutsch") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("Der eingegebene Befehl ist falsch!", "NAME")'Name ist NAME TextWindowPlus.Clear() SinglePlayer() ElseIf (Sprache[1] = "EN") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("The entered command is wrong!", "NAME")'Name ist NAME TextWindowPlus.Clear() SinglePlayer() ElseIf (Sprache[1] = "DE") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("Der eingegebene Befehl ist falsch!", "NAME")'Name ist NAME TextWindowPlus.Clear() SinglePlayer() EndIf EndSub Sub FehlkommandoMP If (Sprache[1] = "English") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("The entered command is wrong!", "NAME")'Name ist NAME TextWindowPlus.Clear() MultiPlayer() ElseIf (Sprache[1] = "Deutsch") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("Der eingegebene Befehl ist falsch!", "NAME")'Name ist NAME TextWindowPlus.Clear() MultiPlayer() ElseIf (Sprache[1] = "EN") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("The entered command is wrong!", "NAME")'Name ist NAME TextWindowPlus.Clear() MultiPlayer() ElseIf (Sprache[1] = "DE") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("Der eingegebene Befehl ist falsch!", "NAME")'Name ist NAME TextWindowPlus.Clear() MultiPlayer() EndIf EndSub Sub FehlkommandoOP If (Sprache[1] = "English") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("The entered command is wrong!", "NAME")'Name ist NAME TextWindowPlus.Clear() Optionen() ElseIf (Sprache[1] = "Deutsch") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("Der eingegebene Befehl ist falsch!", "NAME")'Name ist NAME TextWindowPlus.Clear() Optionen() ElseIf (Sprache[1] = "EN") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("The entered command is wrong!", "NAME")'Name ist NAME TextWindowPlus.Clear() Optionen() ElseIf (Sprache[1] = "DE") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("Der eingegebene Befehl ist falsch!", "NAME")'Name ist NAME TextWindowPlus.Clear() Optionen() EndIf EndSub Sub FehlkommandoW If (Sprache[1] = "English") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("The entered command is wrong!", "NAME")'Name ist NAME TextWindowPlus.Clear() SteuerungW() ElseIf (Sprache[1] = "Deutsch") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("Der eingegebene Befehl ist falsch!", "NAME")'Name ist NAME TextWindowPlus.Clear() SteuerungW() ElseIf (Sprache[1] = "EN") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("The entered command is wrong!", "NAME")'Name ist NAME TextWindowPlus.Clear() SteuerungW() ElseIf (Sprache[1] = "DE") Then GraphicsWindow.Hide() GraphicsWindow.ShowMessage("Der eingegebene Befehl ist falsch!", "NAME")'Name ist NAME TextWindowPlus.Clear() SteuerungW() EndIf EndSub '______________________________________________________________' ' TEXTE (SPRACHEN) '______________________________________________________________' Sub Texte ' The following line could be harmful and has been automatically commented. ' Header = File.ReadContents(Program.Directory + "\Texte\Header.txt") If (Sprache[1] = "English") Then ' The following line could be harmful and has been automatically commented. ' MenuText = File.ReadContents(Program.Directory + "\Texte\MenuTextEN.txt") ' The following line could be harmful and has been automatically commented. ' OptionenText = File.ReadContents(Program.Directory + "\Texte\OptionenTextEN.txt") ' The following line could be harmful and has been automatically commented. ' _SPText = File.ReadContents(Program.Directory + "\Texte\SPTextEN.txt") ' The following line could be harmful and has been automatically commented. ' MPText = File.ReadContents(Program.Directory + "\Texte\MPTextEN.txt") ' The following line could be harmful and has been automatically commented. ' StoryText = File.ReadContents(Program.Directory + "\Texte\StoryTextEN.txt") ' The following line could be harmful and has been automatically commented. ' SteuerungWText = File.ReadContents(Program.Directory + "\Texte\SteuerungWTextEN.txt") SteuerungBild1 = ImageList.LoadImage(Program.Directory + "\Bilder\Steuerung1 EN.jpg") Hoehe1 = ImageList.GetHeightOfImage(SteuerungBild1) Breite1 = ImageList.GetWidthOfImage(SteuerungBild1) SteuerungBild2 = ImageList.LoadImage(Program.Directory + "\Bilder\Steuerung2 EN.jpg") Hoehe2 = ImageList.GetHeightOfImage(SteuerungBild2) Breite2 = ImageList.GetWidthOfImage(SteuerungBild2) Button = "Back" ElseIf (Sprache[1] = "Deutsch") Then ' The following line could be harmful and has been automatically commented. ' MenuText = File.ReadContents(Program.Directory + "\Texte\MenuTextDE.txt") ' The following line could be harmful and has been automatically commented. ' OptionenText = File.ReadContents(Program.Directory + "\Texte\OptionenTextDE.txt") ' The following line could be harmful and has been automatically commented. ' _SPText = File.ReadContents(Program.Directory + "\Texte\SPTextDE.txt") ' The following line could be harmful and has been automatically commented. ' MPText = File.ReadContents(Program.Directory + "\Texte\MPTextDE.txt") ' The following line could be harmful and has been automatically commented. ' StoryText = File.ReadContents(Program.Directory + "\Texte\StoryTextDE.txt") ' The following line could be harmful and has been automatically commented. ' SteuerungWText = File.ReadContents(Program.Directory + "\Texte\SteuerungWTextDE.txt") SteuerungBild1 = ImageList.LoadImage(Program.Directory + "\Bilder\Steuerung1 DE.jpg") Hoehe1 = ImageList.GetHeightOfImage(SteuerungBild1) Breite1 = ImageList.GetWidthOfImage(SteuerungBild1) SteuerungBild2 = ImageList.LoadImage(Program.Directory + "\Bilder\Steuerung2 DE.jpg") Hoehe2 = ImageList.GetHeightOfImage(SteuerungBild2) Breite2 = ImageList.GetWidthOfImage(SteuerungBild2) Button = "Zurück" ElseIf (Sprache[1] = "EN") Then ' The following line could be harmful and has been automatically commented. ' MenuText = File.ReadContents(Program.Directory + "\Texte\MenuTextEN.txt") ' The following line could be harmful and has been automatically commented. ' OptionenText = File.ReadContents(Program.Directory + "\Texte\OptionenTextEN.txt") ' The following line could be harmful and has been automatically commented. ' _SPText = File.ReadContents(Program.Directory + "\Texte\SPTextEN.txt") ' The following line could be harmful and has been automatically commented. ' MPText = File.ReadContents(Program.Directory + "\Texte\MPTextEN.txt") ' The following line could be harmful and has been automatically commented. ' StoryText = File.ReadContents(Program.Directory + "\Texte\StoryTextEN.txt") ' The following line could be harmful and has been automatically commented. ' SteuerungWText = File.ReadContents(Program.Directory + "\Texte\SteuerungWTextEN.txt") SteuerungBild1 = ImageList.LoadImage(Program.Directory + "\Bilder\Steuerung1 EN.jpg") Hoehe1 = ImageList.GetHeightOfImage(SteuerungBild1) Breite1 = ImageList.GetWidthOfImage(SteuerungBild1) SteuerungBild2 = ImageList.LoadImage(Program.Directory + "\Bilder\Steuerung2 EN.jpg") Hoehe2 = ImageList.GetHeightOfImage(SteuerungBild2) Breite2 = ImageList.GetWidthOfImage(SteuerungBild2) Button = "Back" ElseIf (Sprache[1] = "DE") Then ' The following line could be harmful and has been automatically commented. ' MenuText = File.ReadContents(Program.Directory + "\Texte\MenuTextDE.txt") ' The following line could be harmful and has been automatically commented. ' OptionenText = File.ReadContents(Program.Directory + "\Texte\OptionenTextDE.txt") ' The following line could be harmful and has been automatically commented. ' _SPText = File.ReadContents(Program.Directory + "\Texte\SPTextDE.txt") ' The following line could be harmful and has been automatically commented. ' MPText = File.ReadContents(Program.Directory + "\Texte\MPTextDE.txt") ' The following line could be harmful and has been automatically commented. ' StoryText = File.ReadContents(Program.Directory + "\Texte\StoryTextDE.txt") ' The following line could be harmful and has been automatically commented. ' SteuerungWText = File.ReadContents(Program.Directory + "\Texte\SteuerungWTextDE.txt") SteuerungBild1 = ImageList.LoadImage(Program.Directory + "\Bilder\Steuerung1 DE.jpg") Hoehe1 = ImageList.GetHeightOfImage(SteuerungBild1) Breite1 = ImageList.GetWidthOfImage(SteuerungBild1) SteuerungBild2 = ImageList.LoadImage(Program.Directory + "\Bilder\Steuerung2 DE.jpg") Hoehe2 = ImageList.GetHeightOfImage(SteuerungBild2) Breite2 = ImageList.GetWidthOfImage(SteuerungBild2) Button = "Zurück" Else TextWindowPlus.Clear() TextWindowPlus.WriteLine("This language is not supported! Please select another one!") TextWindowPlus.WriteLine("") Start() EndIf EndSub End>GKT789.sb< Start>GKV447.sb< GraphicsWindow.Show() br = GraphicsWindow.BrushColor ba = GraphicsWindow.BackgroundColor WakeUpTime = Clock.Time WT = Text.GetSubText(WakeUpTime,1,2) WT = WT + 1 WakeUpTime = WT + Text.GetSubText(WakeUpTime,3,6) GraphicsWindow.DrawText(10,120,"Wake up Time") WTBT = Controls.AddTextBox(10,140) Controls.SetTextBoxText(WTBT, WakeUpTime) BtClk = 0 While BtClk = 0 BtClk1 = 0 ATime = Clock.Time GraphicsWindow.BrushColor = ba GraphicsWindow.FillRectangle(9,9,100,100) GraphicsWindow.BrushColor = br GraphicsWindow.DrawText(10,10, ATime) GraphicsWindow.DrawText(10,30, WakeUpTime) A = Text.GetSubText(WakeUpTime,1,2) B = Text.GetSubText(WakeUpTime,4,2) C = Text.GetSubText(WakeUpTime,7,2) AA = Text.Append(A, B) AA = Text.Append(AA, C) WAA = AA A = Text.GetSubText(ATime,1,2) B = Text.GetSubText(ATime,4,2) C = Text.GetSubText(ATime,7,2) AA = Text.Append(A, B) AA = Text.Append(AA, C) If AA > WAA Then While BtClk1 = 0 Sound.PlayBellRingAndWait() Program.Delay(300) ATime = Clock.Time GraphicsWindow.BrushColor = ba GraphicsWindow.FillRectangle(9,9,100,100) GraphicsWindow.BrushColor = br GraphicsWindow.DrawText(10,10, ATime) GraphicsWindow.DrawText(10,30, WakeUpTime) A = Text.GetSubText(WakeUpTime,1,2) B = Text.GetSubText(WakeUpTime,4,2) C = Text.GetSubText(WakeUpTime,7,2) AA = Text.Append(A, B) AA = Text.Append(AA, C) WAA = AA A = Text.GetSubText(ATime,1,2) B = Text.GetSubText(ATime,4,2) C = Text.GetSubText(ATime,7,2) AA = Text.Append(A, B) AA = Text.Append(AA, C) If AA > WAA Then BtClk1 = 1 EndIf EndWhile EndIf Program.Delay(55) WakeUpTime = Controls.GetTextBoxText(WTBT) EndWhile Sub OnBtClk BtClk = 1 EndSub End>GKV447.sb< Start>GKV904.sb< 'Written by Thaelmann-Pioniere init() writename() color1="Black" color2="Black" For i = 1 To 6 Turtle.PenDown() Turtle.Turn(60) drawbond() x[i]=Turtle.X y[i]=Turtle.Y drawatom() EndFor color2="White" For i = 1 To 6 Turtle.PenUp() Turtle.MoveTo(x[i],y[i]) Turtle.Angle=(i-1)*60 Turtle.PenDown() If i = 1 Then color2="Black" x[i]=Turtle.X y[i]=Turtle.Y ElseIf i = 2 Then color2="Red" x[i]=Turtle.X y[i]=Turtle.Y Else color2="White" EndIf drawbond() drawatom() EndFor For i = 1 To 2 Turtle.PenUp() Turtle.MoveTo(x[i],y[i]) If i=1 Then Turtle.Angle=0 Turtle.Move(r+40+r) x[3]=Turtle.X y[3]=Turtle.Y Turtle.Angle=60 color2="Red" Turtle.PenDown() drawbond() drawatom() Turtle.Turn(-60) color1=color2 color2="White" drawbond() drawatom() For i = 1 To 3 Turtle.PenUp() Turtle.MoveTo(x[3],y[3]-20+i*10) Turtle.Angle=-60 color1="Black" color2="Red" If i=1 Or i=3 Then GraphicsWindow.PenWidth=7.5 Turtle.PenDown() drawbond() ElseIf i=2 Then Turtle.PenUp() drawbond() drawatom() EndIf EndFor EndIf EndFor Turtle.PenUp() Turtle.MoveTo(x[2],y[2]) Turtle.Angle=60 drawbond() color1="Red" color2="Black" GraphicsWindow.PenWidth=15 Turtle.PenDown() Turtle.Turn(-30) drawbond() drawatom() GraphicsWindow.PenWidth=7.5 x[4]=Turtle.X y[4]=Turtle.Y GraphicsWindow.PenWidth=7.5 For i = 1 To 3 Turtle.PenUp() Turtle.MoveTo(x[4],y[4]-20+i*10) Turtle.Angle=-60 color1="Black" color2="Red" If i=1 Or i=3 Then Turtle.PenDown() drawbond() ElseIf i=2 Then Turtle.PenUp() drawbond() drawatom() EndIf EndFor GraphicsWindow.PenWidth=15 Turtle.PenUp() Turtle.MoveTo(x[4],y[4]) Turtle.Turn(-30) color1="Black" color2="Black" Turtle.PenDown() drawbond() drawatom() x[5]=Turtle.X y[5]=Turtle.Y Turtle.Turn(-60) direction=Turtle.Angle For i = 1 To 2 Turtle.PenDown() Turtle.Angle=direction color2="White" drawbond() drawatom() direction=direction-60 Turtle.PenUp() Turtle.MoveTo(x[5],y[5]) EndFor Turtle.PenDown() Turtle.Turn(30) drawbond() drawatom() Turtle.Hide() Sub init r=20 d=r*2 GraphicsWindow.Title="Molecular Challenge-Aspirin(C9H8O4)" GraphicsWindow.Width=Desktop.Width GraphicsWindow.Height=Desktop.Height GraphicsWindow.BackgroundColor="#dabc72" GraphicsWindow.PenWidth=15 Turtle.Speed=10 Turtle.PenUp() Turtle.MoveTo(300,350) Turtle.Angle=0 EndSub Sub writename GraphicsWindow.FontBold="false" GraphicsWindow.FontName="Times New Roman" GraphicsWindow.BrushColor="White" GraphicsWindow.FontSize=48 GraphicsWindow.DrawText(800,20,"C") GraphicsWindow.FontSize=24 GraphicsWindow.DrawText(840,50,"9") GraphicsWindow.FontSize=48 GraphicsWindow.DrawText(860,20,"H") GraphicsWindow.FontSize=24 GraphicsWindow.DrawText(900,50,"8") GraphicsWindow.FontSize=48 GraphicsWindow.DrawText(920,20,"O") GraphicsWindow.FontSize=24 GraphicsWindow.DrawText(960,50,"4") EndSub Sub drawatom GraphicsWindow.BrushColor=GraphicsWindow.PenColor GraphicsWindow.FillEllipse(Turtle.X-r,Turtle.Y-r,d,d) EndSub Sub drawbond GraphicsWindow.PenColor=color1 Turtle.Move(r+20) GraphicsWindow.PenColor=color2 Turtle.Move(20+r) EndSub End>GKV904.sb< Start>GKX488.sb< GraphicsWindow.Width = 800 GraphicsWindow.height = 600 gbb="tan args=0 w4=8 GraphicsWindow.BackgroundColor=gbb bx=0 by=0 Sub drww '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>< graphicswindow.brushcolor = gbb graphicswindow.penwidth = w4 graphicswindow.pencolor = blkk cc = shapes.addEllipse(80, 80) ldcall.function3("smw" cc, 280, 50) graphicswindow.pencolor = gbb rectangle = Shapes.Addrectangle(50, 95) nsh="true ldcall.function3("smw" rectangle, 310, 50) graphicswindow.brushcolor = gbb graphicswindow.penwidth = w4 graphicswindow.pencolor = blkk cc = shapes.addEllipse(80, 80) ldcall.function3("smw" cc, 310, 50) graphicswindow.brushcolor = gbb graphicswindow.pencolor = gbb nsh="true rectangle = Shapes.Addrectangle(50, 95) ldcall.function3("smw" rectangle, 310, 50) graphicswindow.brushcolor = gbb graphicswindow.penwidth = w4 graphicswindow.pencolor = blkk cc = shapes.addEllipse(80, 80) ldcall.function3("smw" cc, 450, 50) graphicswindow.pencolor = gbb nsh="true rectangle = Shapes.Addrectangle(50, 95) ldcall.function3("smw" rectangle, 480, 50) graphicswindow.brushcolor = gbb graphicswindow.penwidth = w4 graphicswindow.pencolor = blkk cc = shapes.addEllipse(80, 80) ldcall.function3("smw" cc, 480, 50) graphicswindow.brushcolor = gbb graphicswindow.pencolor = gbb nsh="true rectangle = Shapes.Addrectangle(50, 95) ldcall.function3("smw" rectangle, 480, 50) graphicswindow.brushcolor = blkk graphicswindow.pencolor = blkk cc = shapes.addEllipse(15, 15) ldcall.function3("smw" cc, 330, 100) graphicswindow.pencolor = blkk cc = shapes.addEllipse(15, 15) ldcall.function3("smw" cc, 500, 100) graphicswindow.penwidth = w4 ln = shapes.addline(5, 15, 30, 15) ldcall.function3("smw" ln, 270, 0) ln = shapes.addline(5, 15, 30, 15) ldcall.function3("smw" ln, 320, 0) ln = shapes.addline(5, 15, 30, 15) ldcall.function3("smw" ln, 370, 0) ln = shapes.addline(5, 15, 30, 15) ldcall.function3("smw" ln, 420, 0) ln = shapes.addline(5, 15, 30, 15) ldcall.function3("smw" ln, 470, 0) ln = shapes.addline(5, 15, 30, 15) ldcall.function3("smw" ln, 520, 0) graphicswindow.penwidth = w4 ln = shapes.addline(10, 5, 10, 85) ldcall.function3("smw" ln, 250, 50) ln = shapes.addline(10, 5, 10, 85) ldcall.function3("smw" ln, 250, 150) ln = shapes.addline(10, 5, 10, 85) ldcall.function3("smw" ln, 250, 250) ln = shapes.addline(10, 5, 10, 85) ldcall.function3("smw" ln, 570, 50) ln = shapes.addline(10, 5, 10, 85) ldcall.function3("smw" ln, 570, 150) ln = shapes.addline(10, 5, 10, 85) ldcall.function3("smw" ln, 570, 250) ln = shapes.addline(10, 0, -30, 70) ldcall.function3("smw" ln, 405, 140) ln = shapes.addline(10, 0, 50, 70) ldcall.function3("smw" ln, 415, 140) ln = shapes.addline(10, 0, -30, 70) ldcall.function3("smw" ln, 405, 460) ln = shapes.addline(10, 0, 50, 70) ldcall.function3("smw" ln, 415, 460) ln = shapes.addline(-50, 160, 80, 160) ldcall.function3("smw" ln, 400, 180) ln = shapes.addline(-10, 30, 10, 110) ldcall.function3("smw" ln, 340, 210) ln = shapes.addline(10, 110, 30, 30) ldcall.function3("smw" ln, 470, 210) ln = shapes.addline(0, 30, 0, 120) ldcall.function3("smw" ln, 400, 330) ln = shapes.addline(0, 30, 0, 120) ldcall.function3("smw" ln, 440, 330) ln = shapes.addline(0, 0, 80, 0) ldcall.function3("smw" ln, 470, 540) ln = shapes.addline(0, 0, 80, 0) ldcall.function3("smw" ln, 290, 540) ln = shapes.addline(5, 15, 30, 15) ldcall.function3("smw" ln, 300, 390) ln = shapes.addline(5, 15, 30, 15) ldcall.function3("smw" ln, 350, 390) ln = shapes.addline(5, 15, 30, 15) ldcall.function3("smw" ln, 460, 390) ln = shapes.addline(5, 15, 30, 15) ldcall.function3("smw" ln, 510, 390) ln = shapes.addline(5, 15, 40, 15) ldcall.function3("smw" ln, 200, 130) ln = shapes.addline(0, 15, 15, 65) ldcall.function3("smw" ln, 210, 145) ln = shapes.addline(0, 15, 40, 15) ldcall.function3("smw" ln, 600, 130) ln = shapes.addline(0, 15, -15, 65) ldcall.function3("smw" ln, 635, 140) ln = shapes.addline(250, -30, 250, 30) ldcall.function3("smw" ln, 0, 0) ln = shapes.addline(250, 40, 280, 20) ldcall.function3("smw" ln, -15, -15) ln = shapes.addline(250, 20, 280, 40) ldcall.function3("smw" ln, -15, -15) ln = shapes.addline(250, -30, 250, 30) ldcall.function3("smw" ln, 330, 0) ln = shapes.addline(250, 40, 280, 20) ldcall.function3("smw" ln, 315, -15) ln = shapes.addline(250, 20, 280, 40) ldcall.function3("smw" ln, 315, -15) ln = shapes.addline(250, -18, 250, 18) ldcall.function3("smw" ln, 10, 380) ln = shapes.addline(250, 40, 280, 20) ldcall.function3("smw" ln, -5, 350) ln = shapes.addline(250, 20, 280, 40) ldcall.function3("smw" ln, -5, 350) ln = shapes.addline(250, -18, 250, 18) ldcall.function3("smw" ln, 330, 380) ln = shapes.addline(250, 40, 280, 20) ldcall.function3("smw" ln, 315, 350) ln = shapes.addline(250, 20, 280, 40) ldcall.function3("smw" ln, 315, 350) EndSub Sub smw Shapes.Move(args[1] bx+args[2] by+args[3]) LDShapes.AnimateOpacity(args[1] 750 3) If nsh Then nsh="false Else LDEffect.DropShadow(args[1] "") EndIf EndSub zz=1 LDEvents.MouseWheel=mww GraphicsWindow.MouseDown=mdd Sub mdd bx=GraphicsWindow.MouseX-150 by=GraphicsWindow.MouseY blkk=GraphicsWindow.GetRandomColor() drww() EndSub Sub mww zz=zz+LDEvents.LastMouseWheelDelta/10 ldGraphicsWindow.Reposition(zz zz 0 0 0) EndSub End>GKX488.sb< Start>GKX860.sb< ' Challenge of the Month - December 2015 Community Suggestion (By JetFire3201) ' runnning stickman by NaochanON GraphicsWindow.KeyDown=Onkeydown Shapes_Init() Shapes_Add() Sub onkeydown key= GraphicsWindow.LastKey If Text.IsSubText("Right:Left",key) Then ds="X="+KLST[key]+";y=0" If lastkey<>key Then counts=0 Lastangles=initangles EndIf Shapes_Move() ElseIf Text.IsSubText("Up:Down",key) Then ds="X=0;y="+KLST[key] Shapes_Move() EndIf lastkey=Key EndSub Sub Shapes_Move Multi=1.8 counts=counts+1 For i=1 To posnmb x[i]=shapes.GetLeft(shp[i][1]) ' each position -X y[i]=shapes.Gettop(shp[i][1]) ' each position -Y If text.IsSubText(inmbs,":"+i+":") Then x[i]=shapes.GetLeft(shp[i-1][pos[i-1]["NN"]]) ' upper arm/leg last number -X y[i]=shapes.Gettop(shp[i-1][pos[i-1]["NN"]]) ' upper arm/leg last number -Y EndIf MM= Math.Ceiling(2*counts/div) GraphicsWindow.Title=MM+" : "+counts Dangle=PM[MM]*angles[Key][NMB[MM]][i]/div ' dθ/div thisangle=Lastangles[i]+ Multi*Dangle ' current each angle dx=pos[i]["wd"]*math.sin(math.GetRadians(thisangle)) dy=pos[i]["wd"]*math.cos(math.GetRadians(thisangle)) for j=1 To pos[i]["NN"] Shapes.Move(shp[i][j],x[i]+ds["X"]+(j-1)*dx,y[i]+ds["Y"]+(j-1)*dy) ' arms / legs EndFor Lastangles[i]=thisangle EndFor if counts>div*2-1 Then counts=0 EndIf endsub Sub Shapes_Init X0 = 350 Y0 = 120 pos[1] = "x=0;y=0;wd=50;NN=1;angle=0;bc=#AABBFF;pc=#000000;pw=2;" ' Head pos[2] = "x=19;y=50;wd=10;NN=10;angle=0;bc=#AABBFF;pc=#000000;pw=2;" ' body 50,12 pos[3] = "x=13;y=55;wd=10;NN=6;angle=0;bc=#AABBFF;pc=#000000;pw=2;" ' left arm upper 55,6 pos[4] = "x=13;y=115;wd=10;NN=5;angle=0;bc=#AABBFF;pc=#000000;pw=2;" ' left arm lower 55+10*6,6 pos[5] = "x=16;y=150;wd=10;NN=6;angle=0;bc=#AABBFF;pc=#000000;pw=2;" ' Left leg upper 50+10*12,6 pos[6] = "x=16;y=210;wd=10;NN=6;angle=0;bc=#AABBFF;pc=#000000;pw=2;" ' Left leg lower 50+10*12+10*6,5 pos[7] = "x=25;y=55;wd=10;NN=6;angle=0;bc=#AABBFF;pc=#000000;pw=2;" ' Right arm upper 55,6 pos[8] = "x=25;y=115;wd=10;NN=5;angle=0;bc=#AABBFF;pc=#000000;pw=2;" ' Right arm lower 55+10*6,5 pos[9] = "x=20;y=150;wd=10;NN=6;angle=0;bc=#AABBFF;pc=#000000;pw=2;" ' right leg upper 50+10*12,6 pos[10] = "x=20;y=210;wd=10;NN=6;angle=0;bc=#AABBFF;pc=#000000;pw=2;" ' right leg lower 50+10*12+10*6,5 '---------------------------------------------------------------------------------------------------------------- posnmb= Array.GetItemCount(pos) KLST="Right=3;Left=-3;Up=-2;Down=2" '------------------------------------ Left to Right direction ------------------------------------------------------- angles["Right"][1]="1=0;2=0;3=-90;4=-40;5=-80;6=-150;7=90;8=180;9=120;10=20" ' Right direction pause *** angles["Right"][2]="1=0;2=0;3=90;4=180;5=120;6=20;7=-85;8=-40;9=-80;10=-150" ' Left direction pause *** '------------------------------------ Right to Left direction ------------------------------------------------------- angles["Left"][1]="1=0;2=0;3=-60;4=-120;5=-80;6=-35;7=90;8=20;9=85;10=120" ' Right direction pause angles["Left"][2]="1=0;2=0;3=90;4=20;5=85;6=120;7=-60;8=-120;9=-80;10=-35" ' Left direction pause '---------------------------------------------------------------------------------------------------------------- div=20 Gravity=9.8 inmbs="2:4:6:8:10:" PM="1=1;2=-1;3=1;4=-1" NMB="1=1;2=1;3=2;4=2" Lastangles="1=0;2=0;3=0;4=0;5=0;6=0;7=0;8=0;9=0;10=0" ' Standing pause initangles=lastangles EndSub Sub Shapes_Add GraphicsWindow.Width=1200 GraphicsWindow.Height=600 For i = 1 To Array.GetItemCount(pos) GraphicsWindow.Penwidth = pos[i]["pw"] GraphicsWindow.PenColor = pos[i]["pc"] GraphicsWindow.BrushColor = pos[i]["bc"] For j=1 To pos[i]["NN"] shp[i][j]=Shapes.AddEllipse(pos[i]["wd"],pos[i]["wd"]) dx= pos[i]["wd"]*math.sin(math.GetRadians(pos[i]["angle"])) dy= pos[i]["wd"]*math.cos(math.GetRadians(pos[i]["angle"])) sx[i][j]= X0+pos[i]["x"]+(j-1)*dx sy[i][j]= y0+pos[i]["y"]+(j-1)*dy Shapes.Move(shp[i][j],sx[i][j] ,sy[i][j]) EndFor EndFor Shapes.Zoom( shp[1][1],0.5,1) EndSub End>GKX860.sb< Start>GLG637.sb< TextWindow.WriteLine("Please Enter Character Name... ") CharacterName = TextWindow.Read() TextWindow.WriteLine("Attributes are determined randomly using") TextWindow.WriteLine("a Dungeons and Dragons style Roll Method.") TextWindow.WriteLine("The base maximum is 18, the base minimum is 3.") TextWindow.WriteLine("") Strength = (Math.GetRandomNumber(6)) + (Math.GetRandomNumber(6)) + (Math.GetRandomNumber(6)) Dexterity = (Math.GetRandomNumber(6)) + (Math.GetRandomNumber(6)) + (Math.GetRandomNumber(6)) Constitution = (Math.GetRandomNumber(6)) + (Math.GetRandomNumber(6)) + (Math.GetRandomNumber(6)) Intelligence = (Math.GetRandomNumber(6)) + (Math.GetRandomNumber(6)) + (Math.GetRandomNumber(6)) Wisdom = (Math.GetRandomNumber(6)) + (Math.GetRandomNumber(6)) + (Math.GetRandomNumber(6)) Charisma = (Math.GetRandomNumber(6)) + (Math.GetRandomNumber(6)) + (Math.GetRandomNumber(6)) TextWindow.WriteLine("You have Strength: " + Strength) TextWindow.WriteLine("You have Dexterity: " + Dexterity) TextWindow.WriteLine("You have Constitution: " + Constitution) TextWindow.WriteLine("You have Intelligence: " + Intelligence) TextWindow.WriteLine("You have Wisdom: " + Wisdom) TextWindow.WriteLine("You have Charisma: " + Charisma) TextWindow.WriteLine("") TextWindow.WriteLine("Choose a Race to Play as.") TextWindow.WriteLine("1. Human (Standard)") TextWindow.WriteLine("2. Elf (+2 Dexterity, -2 Constitution") TextWindow.WriteLine("3. Dwarf (+2 Constitution, -2 Charisma") TextWindow.WriteLine("4. Gnome (+2 Constitution, -2 Strength") TextWindow.WriteLine("5. Halfling (+2 Dexterity, -2 Strength") TextWindow.WriteLine("6. Half-Elf (Standard)") TextWindow.WriteLine("7. Half-Orc (+2 Strength, -2 Intelligence, -2 Wisdom)") RaceChoice = TextWindow.ReadNumber() Race[1] = "Human" Race[2] = "Elf" Race[3] = "Dwarf" Race[4] = "Gnome" Race[5] = "Halfling" Race[6] = "Half-Elf" Race[7] = "Half-Orc" If RaceChoice = 1 Then PlayerRace = Race[1] ElseIf RaceChoice = 2 Then PlayerRace = Race[2] Dexterity = Dexterity + 2 Constitution = Constitution - 2 ElseIf RaceChoice = 3 Then PlayerRace = Race[3] Constitution = Constitution + 2 Charisma = Charisma - 2 ElseIf RaceChoice = 4 Then PlayerRace = Race[4] Constitution = Constitution + 2 Strength = Strength - 2 ElseIf RaceChoice = 5 Then PlayerRace = Race[5] Dexterity = Dexterity + 2 Strength = Strength - 2 ElseIf RaceChoice = 6 Then PlayerRace = Race[6] ElseIf RaceChoice = 7 Then PlayerRace = Race[7] Strength = Strength + 2 Intelligence = Intelligence - 2 Wisdom = Wisdom - 2 EndIf StrengthBonus = 0 DexterityBonus = 0 ConstitutionBonus = 0 IntelligenceBonus = 0 WisdomBonus = 0 CharismaBonus = 0 If Strength = 3 Then StrengthBonus = -4 ElseIf Strength = 4 OR Strength = 5 Then StrengthBonus = -3 ElseIf Strength = 6 OR Strength = 7 Then StrengthBonus = -2 ElseIf Strength = 8 OR Strength = 9 Then StrengthBonus = -1 ElseIf Strength = 10 OR Strength = 11 Then StrengthBonus = 0 ElseIf Strength = 12 OR Strength = 13 Then StrengthBonus = 1 ElseIf Strength = 14 OR Strength = 15 Then StrengthBonus = 2 ElseIf Strength = 16 OR Strength = 17 Then StrengthBonus = 3 ElseIf Strength = 18 Then StrengthBonus = 4 EndIf If Dexterity = 3 Then DexterityBonus = -4 ElseIf Dexterity = 4 OR Dexterity = 5 Then DexterityBonus = -3 ElseIf Dexterity = 6 OR Dexterity = 7 Then DexterityBonus = -2 ElseIf Dexterity = 8 OR Dexterity = 9 Then DexterityBonus = -1 ElseIf Dexterity = 10 OR Dexterity = 11 Then DexterityBonus = 0 ElseIf Dexterity = 12 OR Dexterity = 13 Then DexterityBonus = 1 ElseIf Dexterity = 14 OR Dexterity = 15 Then DexterityBonus = 2 ElseIf Dexterity = 16 OR Dexterity = 17 Then DexterityBonus = 3 ElseIf Dexterity = 18 Then DexterityBonus = 4 EndIf If Constitution = 3 Then ConstitutionBonus = -4 ElseIf Constitution = 4 OR Constitution = 5 Then ConstitutionBonus = -3 ElseIf Constitution = 6 OR Constitution = 7 Then ConstitutionBonus = -2 ElseIf Constitution = 8 OR Constitution = 9 Then ConstitutionBonus = -1 ElseIf Constitution = 10 OR Constitution = 11 Then ConstitutionBonus = 0 ElseIf Constitution = 12 OR Constitution = 13 Then ConstitutionBonus = 1 ElseIf Constitution = 14 OR Constitution = 15 Then ConstitutionBonus = 2 ElseIf Constitution = 16 OR Constitution = 17 Then ConstitutionBonus = 3 ElseIf Constitution = 18 Then ConstitutionBonus = 4 EndIf If Intelligence = 3 Then IntelligenceBonus = -4 ElseIf Intelligence = 4 OR Intelligence = 5 Then IntelligenceBonus = -3 ElseIf Intelligence = 6 OR Intelligence = 7 Then IntelligenceBonus = -2 ElseIf Intelligence = 8 OR Intelligence = 9 Then IntelligenceBonus = -1 ElseIf Intelligence = 10 OR Intelligence = 11 Then IntelligenceBonus = 0 ElseIf Intelligence = 12 OR Intelligence = 13 Then IntelligenceBonus = 1 ElseIf Intelligence = 14 OR Intelligence = 15 Then IntelligenceBonus = 2 ElseIf Intelligence = 16 OR Intelligence = 17 Then IntelligenceBonus = 3 ElseIf Intelligence = 18 Then IntelligenceBonus = 4 EndIf If Wisdom = 3 Then WisdomBonus = -4 ElseIf Wisdom = 4 OR Wisdom = 5 Then WisdomBonus = -3 ElseIf Wisdom = 6 OR Wisdom = 7 Then WisdomBonus = -2 ElseIf Wisdom = 8 OR Wisdom = 9 Then WisdomBonus = -1 ElseIf Wisdom = 10 OR Wisdom = 11 Then WisdomBonus = 0 ElseIf Wisdom = 12 OR Wisdom = 13 Then WisdomBonus = 1 ElseIf Wisdom = 14 OR Wisdom = 15 Then WisdomBonus = 2 ElseIf Wisdom = 16 OR Wisdom = 17 Then WisdomBonus = 3 ElseIf Wisdom = 18 Then WisdomBonus = 4 EndIf If Charisma = 3 Then CharismaBonus = -4 ElseIf Charisma = 4 OR Charisma = 5 Then CharismaBonus = -3 ElseIf Charisma = 6 OR Charisma = 7 Then CharismaBonus = -2 ElseIf Charisma = 8 OR Charisma = 9 Then CharismaBonus = -1 ElseIf Charisma = 10 OR Charisma = 11 Then CharismaBonus = 0 ElseIf Charisma = 12 OR Charisma = 13 Then CharismaBonus = 1 ElseIf Charisma = 14 OR Charisma = 15 Then CharismaBonus = 2 ElseIf Charisma = 16 OR Charisma = 17 Then CharismaBonus = 3 ElseIf Charisma = 18 Then CharismaBonus = 4 EndIf TextWindow.WriteLine("") TextWindow.WriteLine("You have Strength: " + Strength) TextWindow.WriteLine("You have Desterity: " + Dexterity) TextWindow.WriteLine("You have Constitution: " + Constitution) TextWindow.WriteLine("You have Intelligence: " + Intelligence) TextWindow.WriteLine("You have Wisdom: " + Wisdom) TextWindow.WriteLine("You have Charisma: " + Charisma) TextWindow.WriteLine("") Class[1] = "Fighter" Class[2] = "Thief" Class[3] = "Wizard" Class[4] = "Cleric" PlayerClass = 0 While PlayerClass = 0 TextWindow.WriteLine("Select a Character Class... ") TextWindow.WriteLine("") TextWindow.WriteLine("1. " + Class[1]) TextWindow.WriteLine("2. " + Class[2]) TextWindow.WriteLine("3. " + Class[3]) TextWindow.WriteLine("4. " + Class[4]) ClassChoice = TextWindow.ReadNumber() If ClassChoice = 1 Then PlayerClass = Class[1] ElseIf ClassChoice = 2 Then PlayerClass = Class[2] ElseIf ClassChoice = 3 Then PlayerClass = Class[3] ElseIf ClassChoice = 4 Then PlayerClass = Class[4] Else TextWindow.WriteLine("Choose again, try harder!") EndIf EndWhile FeatPoints = 1 If PlayerRace = Race[1] Then FeatPoints = FeatPoints + 1 EndIf If PlayerClass = Class[1] Then FeatPoints = FeatPoints + 1 EndIf Feat[1] = "Acrobatic" Feat[2] = "Agile" Feat[3] = "Alertness" Feat[4] = "Animal Affinity" Feat[5] = "Athletic" Feat[6] = "Combat Expertise" Feat[7] = "Deceitful" Feat[8] = "Deft Hands" Feat[9] = "Diligent" Feat[10] = "Dodge" Feat[11] = "Great Fortitude" Feat[12] = "Improved Initiative" Feat[13] = "Investigator" Feat[14] = "Iron Will" Feat[15] = "Lightning Reflexes" Feat[16] = "Magical Aptitude" Feat[17] = "Negotiator" Feat[18] = "Nimble Fingers" Feat[19] = "Persuasive" Feat[20] = "Power Attack" Feat[21] = "Self Sufficient" Feat[22] = "Stealthy" Feat[23] = "Toughness" While FeatPoints > 0 TextWindow.WriteLine("Select Feats:") TextWindow.WriteLine("Feats Remaining: " + FeatPoints) TextWindow.WriteLine("1. Acrobatic: +2 to Jump and Tumble Checks") If JumpSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf TextWindow.WriteLine("2. Agile: +2 to Balance and Escape Artist Checks") If BalanceSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf TextWindow.WriteLine("3. Alertness: +2 to Listen and Spot Checks") If ListenSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf TextWindow.WriteLine("4. Animal Affinity: +2 to Handle Animal and Ride Checks") If RideSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf TextWindow.WriteLine("5. Athletic: +2 to Climb and Swim Checks") If SwimSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf If Intelligence > 12 Then TextWindow.WriteLine("6. Combat Expertise: May select to trade Attack Bonus for equal AC Bonus (Max +5)") If CombatExpertiseFeat = 1 Then TextWindow.WriteLine("Taken") EndIf EndIf If Intelligence < 13 Then TextWindow.WriteLine("6. Deceitful: +2 to Disguise and Forgery Checks") If DisguiseSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf Else TextWindow.WriteLine("7. Deceitful: +2 to Disguise and Forgery Checks") If DisguiseSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf EndIf If Intelligence < 13 Then TextWindow.WriteLine("7. Deft Hands: +2 to Sleight of Hand and Use Rope Checks") If UseRopeSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf Else TextWindow.WriteLine("8. Deft Hands: +2 to Sleight of Hand and Use Rope Checks") If UseRopeSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf EndIf If Intelligence < 13 Then TextWindow.WriteLine("8. Diligent: +2 to Appraise and Decipher Script Checks") If AppraiseSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf Else TextWindow.WriteLine("9. Diligent: +2 to Appraise and Decipher Script Checks") If AppraiseSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf EndIf If Dexterity > 12 Then If Intelligence < 13 Then TextWindow.WriteLine("9. Dodge: +1 to AC") If DodgeFeat = 1 Then TextWindow.WriteLine("Taken") EndIf Else TextWindow.WriteLine("10. Dodge: +1 to AC") If DodgeFeat = 1 Then TextWindow.WriteLine("Taken") EndIf EndIf EndIf If Dexterity < 13 And Intelligence < 13 Then TextWindow.WriteLine("9. Great Fortitude: +2 to Fortitude Saving Rolls") If FortitudeFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf (Dexterity > 12 And Intelligence < 13) OR (Dexterity < 13 And Intelligence > 12) Then TextWindow.WriteLine("10. Great Fortitude: +2 to Fortitude Saving Rolls") If FortitudeFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf Dexterity < 12 And Intelligence > 12 Then TextWindow.WriteLine("11. Great Fortitude: +2 to Fortitude Saving Rolls") If FortitudeFeat = 2 Then TextWindow.WriteLine("Taken") EndIf EndIf If Dexterity < 13 And Intelligence < 13 Then TextWindow.WriteLine("10. Improved Initiative: +4 to Initiative Rolls") If InitiativeFeat = 4 Then TextWindow.WriteLine("Taken") EndIf ElseIf (Dexterity > 12 And Intelligence < 13) OR (Dexterity < 13 And Intelligence > 12) Then TextWindow.WriteLine("11. Improved Initiative: +4 to Initiative Rolls") If InitiativeFeat = 4 Then TextWindow.WriteLine("Taken") EndIf ElseIf Dexterity < 12 And Intelligence > 12 Then TextWindow.WriteLine("12. Improved Initiative: +4 to Initiative Rolls") If InitiativeFeat = 4 Then TextWindow.WriteLine("Taken") EndIf EndIf If Dexterity < 13 And Intelligence < 13 Then TextWindow.WriteLine("11. Investigator: +2 to Gather Information and Search Checks") If GatherInformationSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf (Dexterity > 12 And Intelligence < 13) OR (Dexterity < 13 And Intelligence > 12) Then TextWindow.WriteLine("12. Investigator: +2 to Gather Information and Search Checks") If GatherInformationSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf Dexterity < 12 And Intelligence > 12 Then TextWindow.WriteLine("13. Investigator: +2 to Gather Information and Search Checks") If GatherInformationSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf EndIf If Dexterity < 13 And Intelligence < 13 Then TextWindow.WriteLine("12. Iron Will: +2 to Will Saving Roll") If WillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf (Dexterity > 12 And Intelligence < 13) OR (Dexterity < 13 And Intelligence > 12) Then TextWindow.WriteLine("13. Iron Will: +2 to Will Saving Roll") If WillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf Dexterity < 12 And Intelligence > 12 Then TextWindow.WriteLine("14. Iron Will: +2 to Will Saving Roll") If WillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf EndIf If Dexterity < 13 And Intelligence < 13 Then TextWindow.WriteLine("13. Lightning Reflexes: +2 to Reflex Saving Roll") If ReflexFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf (Dexterity > 12 And Intelligence < 13) OR (Dexterity < 13 And Intelligence > 12) Then TextWindow.WriteLine("14. Lightning Reflexes: +2 to Reflex Saving Roll") If ReflexFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf Dexterity < 12 And Intelligence > 12 Then TextWindow.WriteLine("15. Lightning Reflexes: +2 to Reflex Saving Roll") If ReflexFeat = 2 Then TextWindow.WriteLine("Taken") EndIf EndIf If Dexterity < 13 And Intelligence < 13 Then TextWindow.WriteLine("14. Magical Aptitude: +2 to Spellcraft and Use Magical Item Checks") If SpellcraftSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf (Dexterity > 12 And Intelligence < 13) OR (Dexterity < 13 And Intelligence > 12) Then TextWindow.WriteLine("15. Magical Aptitude: +2 to Spellcraft and Use Magical Item Checks") If SpellcraftSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf Dexterity < 12 And Intelligence > 12 Then TextWindow.WriteLine("16. Magical Aptitude: +2 to Spellcraft and Use Magical Item Checks") If SpellcraftSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf EndIf If Dexterity < 13 And Intelligence < 13 Then TextWindow.WriteLine("15. Negotiator: +2 to Diplomacy and Sense Motive Checks") If DiplomacySkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf (Dexterity > 12 And Intelligence < 13) OR (Dexterity < 13 And Intelligence > 12) Then TextWindow.WriteLine("16. Negotiator: +2 to Diplomacy and Sense Motive Checks") If DiplomacySkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf Dexterity < 12 And Intelligence > 12 Then TextWindow.WriteLine("17. Negotiator: +2 to Diplomacy and Sense Motive Checks") If DiplomacySkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf EndIf If Dexterity < 13 And Intelligence < 13 Then TextWindow.WriteLine("16. Nimble Fingers: +2 to Disable Device and Open Lock Checks") If DisableDeviceSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf (Dexterity > 12 And Intelligence < 13) OR (Dexterity < 13 And Intelligence > 12) Then TextWindow.WriteLine("17. Nimble Fingers: +2 to Disable Device and Open Lock Checks") If DisableDeviceSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf Dexterity < 12 And Intelligence > 12 Then TextWindow.WriteLine("18. Nimble Fingers: +2 to Disable Device and Open Lock Checks") If DisableDeviceSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf EndIf If Dexterity < 13 And Intelligence < 13 Then TextWindow.WriteLine("17. Persuasive: +2 to Bluff and Intimidate Checks") If PersuadeSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf (Dexterity > 12 And Intelligence < 13) OR (Dexterity < 13 And Intelligence > 12) Then TextWindow.WriteLine("18. Persuasive: +2 to Bluff and Intimidate Checks") If PersuadeSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf Dexterity < 12 And Intelligence > 12 Then TextWindow.WriteLine("19. Persuasive: +2 to Bluff and Intimidate Checks") If PersuadeSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf EndIf If Strength > 12 Then If Dexterity < 13 And Intelligence < 13 Then TextWindow.WriteLine("18. Power Attack: May select to Trade Attack Bonus for Equal Damage Bonus") If PowerAttackFeat = 1 Then TextWindow.WriteLine("Taken") EndIf ElseIf (Dexterity > 12 And Intelligence < 13) OR (Dexterity < 13 And Intelligence > 12) Then TextWindow.WriteLine("19. Power Attack: May select to Trade Attack Bonus for Equal Damage Bonus") If PowerAttackFeat = 1 Then TextWindow.WriteLine("Taken") EndIf ElseIf Dexterity < 12 And Intelligence > 12 Then TextWindow.WriteLine("20. Power Attack: May select to Trade Attack Bonus for Equal Damage Bonus") If PowerAttackFeat = 1 Then TextWindow.WriteLine("Taken") EndIf EndIf EndIf If Strength < 13 And Dexterity < 13 And Intelligence < 13 Then TextWindow.WriteLine("18. Self Sufficient: +2 to Heal and Survival Checks") If HealSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf (Strength > 12 And Dexterity < 13 And Intelligence < 13) OR (Strength < 13 And Dexterity > 12 And Intelligence < 13) OR ( Strength < 13 And Dexterity < 13 And Intelligence > 12) Then TextWindow.WriteLine("19. Self Sufficient: +2 to Heal and Survival Checks") If HealSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf (Strength > 12 And Dexterity < 12 And Intelligence < 13) OR (Strength < 13 And Dexterity > 12 And Intelligence > 12) OR ( Strength > 12 And Dexterity < 13 And Intelligence > 12) Then TextWindow.WriteLine("20. Self Sufficient: +2 to Heal and Survival Checks") If HealSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf (Strength > 12 And Dexterity > 12 And Intelligence > 12) Then TextWindow.WriteLine("21. Self Sufficient: +2 to Heal and Survival Checks") If HealSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf EndIf If Strength < 13 And Dexterity < 13 And Intelligence < 13 Then TextWindow.WriteLine("19. Stealthy: +2 to Hide and Move Silently Checks") If HideSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf (Strength > 12 And Dexterity < 13 And Intelligence < 13) OR (Strength < 13 And Dexterity > 12 And Intelligence < 13) OR ( Strength < 13 And Dexterity < 13 And Intelligence > 12) Then TextWindow.WriteLine("20. Stealthy: +2 to Hide and Move Silently Checks") If HideSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf (Strength > 12 And Dexterity < 12 And Intelligence < 13) OR (Strength < 13 And Dexterity > 12 And Intelligence > 12) OR ( Strength > 12 And Dexterity < 13 And Intelligence > 12) Then TextWindow.WriteLine("21. Stealthy: +2 to Hide and Move Silently Checks") If HideSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf ElseIf (Strength > 12 And Dexterity > 12 And Intelligence > 12) Then TextWindow.WriteLine("22. Stealthy: +2 to Hide and Move Silently Checks") If HideSkillFeat = 2 Then TextWindow.WriteLine("Taken") EndIf EndIf If Strength < 13 And Dexterity < 13 And Intelligence < 13 Then TextWindow.WriteLine("20. Toughness: +3 to HP") If ToughnessFeat = 3 Then TextWindow.WriteLine("Taken") EndIf ElseIf (Strength > 12 And Dexterity < 13 And Intelligence < 13) OR (Strength < 13 And Dexterity > 12 And Intelligence < 13) OR ( Strength < 13 And Dexterity < 13 And Intelligence > 12) Then TextWindow.WriteLine("21. Toughness: +3 to HP") If ToughnessFeat = 3 Then TextWindow.WriteLine("Taken") EndIf ElseIf (Strength > 12 And Dexterity < 12 And Intelligence < 13) OR (Strength < 13 And Dexterity > 12 And Intelligence > 12) OR ( Strength > 12 And Dexterity < 13 And Intelligence > 12) Then TextWindow.WriteLine("22. Toughness: +3 to HP") If ToughnessFeat = 3 Then TextWindow.WriteLine("Taken") EndIf ElseIf (Strength > 12 And Dexterity > 12 And Intelligence > 12) Then TextWindow.WriteLine("23. Toughness: +3 to HP") If ToughnessFeat = 3 Then TextWindow.WriteLine("Taken") EndIf EndIf FeatChoice = TextWindow.ReadNumber() If Strength < 13 And Dexterity < 13 And Intelligence < 13 Then If FeatChoice = 1 Then JumpSkillFeat = 2 TumbleSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[1]) ElseIf FeatChoice = 2 Then BalanceSkillFeat = 2 EscapeArtistSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[2]) ElseIf FeatChoice = 3 Then ListenSkillFeat = 2 SpotSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[3]) ElseIf FeatChoice = 4 Then HandleAnimalSkillFeat = 2 RideSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[4]) ElseIf FeatChoice = 5 Then ClimbSkillFeat = 2 SwimSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[5]) ElseIf FeatChoice = 6 Then DisguiseSkillFeat = 2 ForgerySkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[7]) ElseIf FeatChoice = 7 Then SleightOfHandSkillFeat = 2 UseRopeSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[8]) ElseIf FeatChoice = 8 Then AppraiseSkillFeat = 2 DecipherScriptSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[9]) ElseIf FeatChoice = 9 Then FortitudeFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[11]) ElseIf FeatChoice = 10 Then InitiativeFeat = 4 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[12]) ElseIf FeatChoice = 11 Then GatherInformationSkillFeat = 2 SearchSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[13]) ElseIf FeatChoice = 12 Then WillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[14]) ElseIf FeatChoice = 13 Then ReflexFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[15]) ElseIf FeatChoice = 14 Then SpellcraftSkillFeat = 2 UseMagicalItemSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[16]) ElseIf FeatChoice = 15 Then DiplomacySkillFeat = 2 SenseMotiveSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[17]) ElseIf FeatChoice = 16 Then DisableDeviceSkillFeat = 2 OpenLockSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[18]) ElseIf FeatChoice = 17 Then PersuadeSkillFeat = 2 IntimidateSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[19]) ElseIf FeatChoice = 18 Then HealSkillFeat = 2 SurvivalSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[21]) ElseIf FeatChoice = 19 Then HideSkillFeat = 2 MoveSilentlySkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[22]) ElseIf FeatChoice = 20 Then ToughnessFeat = 3 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[23]) EndIf ElseIf Strength > 12 And Dexterity < 13 And Intelligence < 13 Then If FeatChoice = 1 Then JumpSkillFeat = 2 TumbleSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[1]) ElseIf FeatChoice = 2 Then BalanceSkillFeat = 2 EscapeArtistSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[2]) ElseIf FeatChoice = 3 Then ListenSkillFeat = 2 SpotSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[3]) ElseIf FeatChoice = 4 Then HandleAnimalSkillFeat = 2 RideSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[4]) ElseIf FeatChoice = 5 Then ClimbSkillFeat = 2 SwimSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[5]) ElseIf FeatChoice = 6 Then DisguiseSkillFeat = 2 ForgerySkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[7]) ElseIf FeatChoice = 7 Then SleightOfHandSkillFeat = 2 UseRopeSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[8]) ElseIf FeatChoice = 8 Then AppraiseSkillFeat = 2 DecipherScriptSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[9]) ElseIf FeatChoice = 9 Then FortitudeFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[11]) ElseIf FeatChoice = 10 Then InitiativeFeat = 4 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[12]) ElseIf FeatChoice = 11 Then GatherInformationSkillFeat = 2 SearchSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[13]) ElseIf FeatChoice = 12 Then WillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[14]) ElseIf FeatChoice = 13 Then ReflexFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[15]) ElseIf FeatChoice = 14 Then SpellcraftSkillFeat = 2 UseMagicalItemSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[16]) ElseIf FeatChoice = 15 Then DiplomacySkillFeat = 2 SenseMotiveSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[17]) ElseIf FeatChoice = 16 Then DisableDeviceSkillFeat = 2 OpenLockSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[18]) ElseIf FeatChoice = 17 Then PersuadeSkillFeat = 2 IntimidateSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[19]) ElseIf FeatChoice = 18 Then PowerAttackFeat = 1 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[20]) ElseIf FeatChoice = 19 Then HealSkillFeat = 2 SurvivalSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[21]) ElseIf FeatChoice = 20 Then HideSkillFeat = 2 MoveSilentlySkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[22]) ElseIf FeatChoice = 21 Then ToughnessFeat = 3 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[23]) EndIf ElseIf Strength < 13 And Dexterity > 12 And Intelligence < 13 Then If FeatChoice = 1 Then JumpSkillFeat = 2 TumbleSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[1]) ElseIf FeatChoice = 2 Then BalanceSkillFeat = 2 EscapeArtistSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[2]) ElseIf FeatChoice = 3 Then ListenSkillFeat = 2 SpotSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[3]) ElseIf FeatChoice = 4 Then HandleAnimalSkillFeat = 2 RideSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[4]) ElseIf FeatChoice = 5 Then ClimbSkillFeat = 2 SwimSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[5]) ElseIf FeatChoice = 6 Then DisguiseSkillFeat = 2 ForgerySkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[7]) ElseIf FeatChoice = 7 Then SleightOfHandSkillFeat = 2 UseRopeSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[8]) ElseIf FeatChoice = 8 Then AppraiseSkillFeat = 2 DecipherScriptSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[9]) ElseIf FeatChoice = 9 Then DodgeFeat = 1 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[10]) ElseIf FeatChoice = 10 Then FortitudeFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[11]) ElseIf FeatChoice = 11 Then InitiativeFeat = 4 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[12]) ElseIf FeatChoice = 12 Then GatherInformationSkillFeat = 2 SearchSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[13]) ElseIf FeatChoice = 13 Then WillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[14]) ElseIf FeatChoice = 14 Then ReflexFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[15]) ElseIf FeatChoice = 15 Then SpellcraftSkillFeat = 2 UseMagicalItemSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[16]) ElseIf FeatChoice = 16 Then DiplomacySkillFeat = 2 SenseMotiveSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[17]) ElseIf FeatChoice = 17 Then DisableDeviceSkillFeat = 2 OpenLockSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[18]) ElseIf FeatChoice = 18 Then PersuadeSkillFeat = 2 IntimidateSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[19]) ElseIf FeatChoice = 19 Then HealSkillFeat = 2 SurvivalSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[21]) ElseIf FeatChoice = 20 Then HideSkillFeat = 2 MoveSilentlySkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[22]) ElseIf FeatChoice = 21 Then ToughnessFeat = 3 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[23]) EndIf ElseIf Strength < 13 And Dexterity < 13 And Intelligence > 12 Then If FeatChoice = 1 Then JumpSkillFeat = 2 TumbleSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[1]) ElseIf FeatChoice = 2 Then BalanceSkillFeat = 2 EscapeArtistSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[2]) ElseIf FeatChoice = 3 Then ListenSkillFeat = 2 SpotSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[3]) ElseIf FeatChoice = 4 Then HandleAnimalSkillFeat = 2 RideSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[4]) ElseIf FeatChoice = 5 Then ClimbSkillFeat = 2 SwimSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[5]) ElseIf FeatChoice = 6 Then CombatExpertiseFeat = 1 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[6]) ElseIf FeatChoice = 7 Then DisguiseSkillFeat = 2 ForgerySkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[7]) ElseIf FeatChoice = 8 Then SleightOfHandSkillFeat = 2 UseRopeSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[8]) ElseIf FeatChoice = 9 Then AppraiseSkillFeat = 2 DecipherScriptSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[9]) ElseIf FeatChoice = 10 Then FortitudeFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[11]) ElseIf FeatChoice = 11 Then InitiativeFeat = 4 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[12]) ElseIf FeatChoice = 12 Then GatherInformationSkillFeat = 2 SearchSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[13]) ElseIf FeatChoice = 13 Then WillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[14]) ElseIf FeatChoice = 14 Then ReflexFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[15]) ElseIf FeatChoice = 15 Then SpellcraftSkillFeat = 2 UseMagicalItemSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[16]) ElseIf FeatChoice = 16 Then DiplomacySkillFeat = 2 SenseMotiveSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[17]) ElseIf FeatChoice = 17 Then DisableDeviceSkillFeat = 2 OpenLockSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[18]) ElseIf FeatChoice = 18 Then PersuadeSkillFeat = 2 IntimidateSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[19]) ElseIf FeatChoice = 19 Then HealSkillFeat = 2 SurvivalSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[21]) ElseIf FeatChoice = 20 Then HideSkillFeat = 2 MoveSilentlySkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[22]) ElseIf FeatChoice = 21 Then ToughnessFeat = 3 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[23]) EndIf ElseIf Strength > 12 And Dexterity > 12 And Intelligence < 13 Then If FeatChoice = 1 Then JumpSkillFeat = 2 TumbleSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[1]) ElseIf FeatChoice = 2 Then BalanceSkillFeat = 2 EscapeArtistSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[2]) ElseIf FeatChoice = 3 Then ListenSkillFeat = 2 SpotSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[3]) ElseIf FeatChoice = 4 Then HandleAnimalSkillFeat = 2 RideSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[4]) ElseIf FeatChoice = 5 Then ClimbSkillFeat = 2 SwimSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[5]) ElseIf FeatChoice = 6 Then DisguiseSkillFeat = 2 ForgerySkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[7]) ElseIf FeatChoice = 7 Then SleightOfHandSkillFeat = 2 UseRopeSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[8]) ElseIf FeatChoice = 8 Then AppraiseSkillFeat = 2 DecipherScriptSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[9]) ElseIf FeatChoice = 9 Then DodgeFeat = 1 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[10]) ElseIf FeatChoice = 10 Then FortitudeFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[11]) ElseIf FeatChoice = 11 Then InitiativeFeat = 4 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[12]) ElseIf FeatChoice = 12 Then GatherInformationSkillFeat = 2 SearchSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[13]) ElseIf FeatChoice = 13 Then WillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[14]) ElseIf FeatChoice = 14 Then ReflexFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[15]) ElseIf FeatChoice = 15 Then SpellcraftSkillFeat = 2 UseMagicalItemSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[16]) ElseIf FeatChoice = 16 Then DiplomacySkillFeat = 2 SenseMotiveSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[17]) ElseIf FeatChoice = 17 Then DisableDeviceSkillFeat = 2 OpenLockSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[18]) ElseIf FeatChoice = 18 Then PersuadeSkillFeat = 2 IntimidateSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[19]) ElseIf FeatChoice = 19 Then PowerAttackFeat = 1 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[20]) ElseIf FeatChoice = 20 Then HealSkillFeat = 2 SurvivalSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[21]) ElseIf FeatChoice = 21 Then HideSkillFeat = 2 MoveSilentlySkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[22]) ElseIf FeatChoice = 22 Then ToughnessFeat = 3 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[23]) EndIf ElseIf Strength < 13 And Dexterity > 12 And Intelligence > 12 Then If FeatChoice = 1 Then JumpSkillFeat = 2 TumbleSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[1]) ElseIf FeatChoice = 2 Then BalanceSkillFeat = 2 EscapeArtistSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[2]) ElseIf FeatChoice = 3 Then ListenSkillFeat = 2 SpotSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[3]) ElseIf FeatChoice = 4 Then HandleAnimalSkillFeat = 2 RideSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[4]) ElseIf FeatChoice = 5 Then ClimbSkillFeat = 2 SwimSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[5]) ElseIf FeatChoice = 6 Then CombatExpertiseFeat = 1 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[6]) ElseIf FeatChoice = 7 Then DisguiseSkillFeat = 2 ForgerySkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[7]) ElseIf FeatChoice = 8 Then SleightOfHandSkillFeat = 2 UseRopeSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[8]) ElseIf FeatChoice = 9 Then AppraiseSkillFeat = 2 DecipherScriptSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[9]) ElseIf FeatChoice = 10 Then DodgeFeat = 1 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[10]) ElseIf FeatChoice = 11 Then FortitudeFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[11]) ElseIf FeatChoice = 12 Then InitiativeFeat = 4 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[12]) ElseIf FeatChoice = 13 Then GatherInformationSkillFeat = 2 SearchSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[13]) ElseIf FeatChoice = 14 Then WillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[14]) ElseIf FeatChoice = 15 Then ReflexFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[15]) ElseIf FeatChoice = 16 Then SpellcraftSkillFeat = 2 UseMagicalItemSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[16]) ElseIf FeatChoice = 17 Then DiplomacySkillFeat = 2 SenseMotiveSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[17]) ElseIf FeatChoice = 18 Then DisableDeviceSkillFeat = 2 OpenLockSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[18]) ElseIf FeatChoice = 19 Then PersuadeSkillFeat = 2 IntimidateSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[19]) ElseIf FeatChoice = 20 Then HealSkillFeat = 2 SurvivalSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[21]) ElseIf FeatChoice = 21 Then HideSkillFeat = 2 MoveSilentlySkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[22]) ElseIf FeatChoice = 22 Then ToughnessFeat = 3 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[23]) EndIf ElseIf Strength > 12 And Dexterity < 13 And Intelligence > 12 Then If FeatChoice = 1 Then JumpSkillFeat = 2 TumbleSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[1]) ElseIf FeatChoice = 2 Then BalanceSkillFeat = 2 EscapeArtistSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[2]) ElseIf FeatChoice = 3 Then ListenSkillFeat = 2 SpotSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[3]) ElseIf FeatChoice = 4 Then HandleAnimalSkillFeat = 2 RideSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[4]) ElseIf FeatChoice = 5 Then ClimbSkillFeat = 2 SwimSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[5]) ElseIf FeatChoice = 6 Then CombatExpertiseFeat = 1 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[6]) ElseIf FeatChoice = 7 Then DisguiseSkillFeat = 2 ForgerySkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[7]) ElseIf FeatChoice = 8 Then SleightOfHandSkillFeat = 2 UseRopeSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[8]) ElseIf FeatChoice = 9 Then AppraiseSkillFeat = 2 DecipherScriptSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[9]) ElseIf FeatChoice = 10 Then FortitudeFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[11]) ElseIf FeatChoice = 11 Then InitiativeFeat = 4 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[12]) ElseIf FeatChoice = 12 Then GatherInformationSkillFeat = 2 SearchSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[13]) ElseIf FeatChoice = 13 Then WillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[14]) ElseIf FeatChoice = 14 Then ReflexFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[15]) ElseIf FeatChoice = 15 Then SpellcraftSkillFeat = 2 UseMagicalItemSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[16]) ElseIf FeatChoice = 16 Then DiplomacySkillFeat = 2 SenseMotiveSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[17]) ElseIf FeatChoice = 17 Then DisableDeviceSkillFeat = 2 OpenLockSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[18]) ElseIf FeatChoice = 18 Then PersuadeSkillFeat = 2 IntimidateSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[19]) ElseIf FeatChoice = 19 Then PowerAttackFeat = 1 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[20]) ElseIf FeatChoice = 20 Then HealSkillFeat = 2 SurvivalSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[21]) ElseIf FeatChoice = 21 Then HideSkillFeat = 2 MoveSilentlySkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[22]) ElseIf FeatChoice = 22 Then ToughnessFeat = 3 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[23]) EndIf ElseIf Strength > 12 And Dexterity > 12 And Intelligence > 12 Then If FeatChoice = 1 Then JumpSkillFeat = 2 TumbleSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[1]) ElseIf FeatChoice = 2 Then BalanceSkillFeat = 2 EscapeArtistSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[2]) ElseIf FeatChoice = 3 Then ListenSkillFeat = 2 SpotSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[3]) ElseIf FeatChoice = 4 Then HandleAnimalSkillFeat = 2 RideSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[4]) ElseIf FeatChoice = 5 Then ClimbSkillFeat = 2 SwimSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[5]) ElseIf FeatChoice = 6 Then CombatExpertiseFeat = 1 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[6]) ElseIf FeatChoice = 7 Then DisguiseSkillFeat = 2 ForgerySkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[7]) ElseIf FeatChoice = 8 Then SleightOfHandSkillFeat = 2 UseRopeSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[8]) ElseIf FeatChoice = 9 Then AppraiseSkillFeat = 2 DecipherScriptSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[9]) ElseIf FeatChoice = 10 Then DodgeFeat = 1 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[10]) ElseIf FeatChoice = 11 Then FortitudeFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[11]) ElseIf FeatChoice = 12 Then InitiativeFeat = 4 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[12]) ElseIf FeatChoice = 13 Then GatherInformationSkillFeat = 2 SearchSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[13]) ElseIf FeatChoice = 14 Then WillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[14]) ElseIf FeatChoice = 15 Then ReflexFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[15]) ElseIf FeatChoice = 16 Then SpellcraftSkillFeat = 2 UseMagicalItemSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[16]) ElseIf FeatChoice = 17 Then DiplomacySkillFeat = 2 SenseMotiveSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[17]) ElseIf FeatChoice = 18 Then DisableDeviceSkillFeat = 2 OpenLockSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[18]) ElseIf FeatChoice = 19 Then PersuadeSkillFeat = 2 IntimidateSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[19]) ElseIf FeatChoice = 20 Then PowerAttackFeat = 1 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[20]) ElseIf FeatChoice = 21 Then HealSkillFeat = 2 SurvivalSkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[21]) ElseIf FeatChoice = 22 Then HideSkillFeat = 2 MoveSilentlySkillFeat = 2 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[22]) ElseIf FeatChoice = 23 Then ToughnessFeat = 3 FeatPoints = FeatPoints - 1 Feats = (Feats + " " + Feat[23]) EndIf EndIf EndWhile WarriorWeapon = 0 ThiefWeapon = 0 WizardWeapon = 0 ClericWeapon = 0 TextWindow.WriteLine("") MaxDamage = 0 While MaxDamage = 0 If PlayerClass = Class[1] Then PlayerHP = 10 + ConstitutionBonus + ToughnessFeat PlayerBAB = 1 + StrengthBonus TextWindow.WriteLine("Choose Equipment Kit.") TextWindow.WriteLine("1. Sword (d8), Shield and Chainmail (AC +6).") TextWindow.WriteLine("2. Greataxe (2d6), Hide (AC +4).") TextWindow.WriteLine("3. Sword (d8), Longbow (d8), Leather (AC +2).") WarriorWeapon = TextWindow.ReadNumber() ElseIf PlayerClass = Class[2] Then PlayerHP = 6 + ConstitutionBonus + ToughnessFeat PlayerBAB = 0 + StrengthBonus TextWindow.WriteLine("Choose Equipment Kit.") TextWindow.WriteLine("1. Sword (d8), Studded Leather (AC +3).") TextWindow.WriteLine("2. Shortsword (d6), Leather (AC +2).") ThiefWeapon = TextWindow.ReadNumber() ElseIf PlayerClass = Class[3] Then PlayerHP = 4 + ConstitutionBonus + ToughnessFeat PlayerBAB = 0 + StrengthBonus TextWindow.WriteLine("Choose Equipment Kit.") TextWindow.WriteLine("1. Staff (d4), Cloth Robes (AC 0).") TextWindow.WriteLine("2. Dagger (d4), Cloth Robes (AC 0).") WizardWeapon = TextWindow.ReadNumber() ElseIf PlayerClass = Class[4] Then PlayerHP = 8 + ConstitutionBonus + ToughnessFeat PlayerBAB = 0 + StrengthBonus TextWindow.WriteLine("Choose Equipment Kit.") TextWindow.WriteLine("1. Mace (d8), Shield and Chainmail (AC +6).") TextWindow.WriteLine("2. Flail (d6), Shield and Platemail (AC +7).") TextWindow.WriteLine("3. Warhammer (d10), Chainmail (AC +5).") ClericWeapon = TextWindow.ReadNumber() EndIf PlayerAC = 10 PlayerDamage = 0 If WarriorWeapon = 1 Then PlayerAC = PlayerAC + DexterityBonus + DodgeFeat + 6 PlayerDamage = StrengthBonus + Math.GetRandomNumber(8) MaxDamage = StrengthBonus + 8 ElseIf WarriorWeapon = 2 Then PlayerAC = PlayerAC + DexterityBonus + DodgeFeat + 5 PlayerDamage = StrengthBonus + Math.GetRandomNumber(6) + Math.GetRandomNumber(6) MaxDamage = StrengthBonus + 12 ElseIf WarriorWeapon = 3 Then PlayerAC = PlayerAC + DexterityBonus + DodgeFeat + 2 PlayerDamage = StrengthBonus + Math.GetRandomNumber(8) MaxDamage = StrengthBonus + 8 EndIf If ThiefWeapon = 1 Then PlayerAC = PlayerAC + DexterityBonus + DodgeFeat + 3 PlayerDamage = StrengthBonus + Math.GetRandomNumber(8) MaxDamage = StrengthBonus + 8 ElseIf ThiefWeapon = 2 Then PlayerAC = PlayerAC + DexterityBonus + DodgeFeat + 2 PlayerDamage = StrengthBonus + Math.GetRandomNumber(6) MaxDamage = StrengthBonus + 6 EndIf If WizardWeapon = 1 Then PlayerAC = PlayerAC + DexterityBonus + DodgeFeat + 0 PlayerDamage = StrengthBonus + Math.GetRandomNumber(4) MaxDamage = StrengthBonus + 4 ElseIf WizardWeapon = 2 Then PlayerAC = PlayerAC + DexterityBonus + DodgeFeat + 0 PlayerDamage = StrengthBonus + Math.GetRandomNumber(4) MaxDamage = StrengthBonus + 4 EndIf If ClericWeapon = 1 Then PlayerAC = PlayerAC + DexterityBonus + DodgeFeat + 6 PlayerDamage = StrengthBonus + Math.GetRandomNumber(8) MaxDamage = StrengthBonus + 8 ElseIf ClericWeapon = 2 Then PlayerAC = PlayerAC + DexterityBonus + DodgeFeat + 7 PlayerDamage = StrengthBonus + Math.GetRandomNumber(6) MaxDamage = StrengthBonus + 6 ElseIf ClericWeapon = 3 Then PlayerAC = PlayerAC + DexterityBonus + DodgeFeat + 5 PlayerDamage = StrengthBonus + Math.GetRandomNumber(10) MaxDamage = StrengthBonus + 10 EndIf EndWhile If PlayerClass = Class[3] Then WizardSpells = 1 EndIf If PlayerClass = Class[4] Then ClericSpells = 1 EndIf PlayerLevel = 1 PlayerEXP = 0 If PlayerEXP = 190000 OR PlayerEXP > 190000 Then PlayerLevel = 20 ElseIf PlayerEXP = 171000 OR PlayerEXP > 171000 Then PlayerLevel = 19 ElseIf PlayerEXP = 153000 OR PlayerEXP > 153000 Then PlayerLevel = 18 ElseIf PlayerEXP = 136000 OR PlayerEXP > 136000 Then PlayerLevel = 17 ElseIf PlayerEXP = 120000 OR PlayerEXP > 120000 Then PlayerLevel = 16 ElseIf PlayerEXP = 105000 OR PlayerEXP > 105000 Then PlayerLevel = 15 ElseIf PlayerEXP = 91000 OR PlayerEXP > 91000 Then PlayerLevel = 14 ElseIf PlayerEXP = 78000 OR PlayerEXP > 78000 Then PlayerLevel = 13 ElseIf PlayerEXP = 66000 OR PlayerEXP > 66000 Then PlayerLevel = 12 ElseIf PlayerEXP = 55000 OR PlayerEXP > 55000 Then PlayerLevel = 11 ElseIf PlayerEXP = 45000 OR PlayerEXP > 45000 Then PlayerLevel = 10 ElseIf PlayerEXP = 36000 OR PlayerEXP > 36000 Then PlayerLevel = 9 ElseIf PlayerEXP = 28000 OR PlayerEXP > 28000 Then PlayerLevel = 8 ElseIf PlayerEXP = 21000 OR PlayerEXP > 21000 Then PlayerLevel = 7 ElseIf PlayerEXP = 15000 OR PlayerEXP > 15000 Then PlayerLevel = 6 ElseIf PlayerEXP = 10000 OR PlayerEXP > 10000 Then PlayerLevel = 5 ElseIf PlayerEXP = 6000 OR PlayerEXP > 6000 Then PlayerLevel = 4 ElseIf PlayerEXP = 3000 OR PlayerEXP > 3000 Then PlayerLevel = 3 ElseIf PlayerEXP = 1000 OR PlayerEXP > 1000 Then PlayerLevel = 2 EndIf TextWindow.WriteLine("") TextWindow.WriteLine("Name: " + CharacterName) TextWindow.WriteLine("Race: " + PlayerRace) TextWindow.WriteLine("Class: " + PlayerClass) TextWindow.WriteLine("Level: " + PlayerLevel) TextWindow.WriteLine("Health: " + PlayerHP) TextWindow.WriteLine("") TextWindow.WriteLine("Feats: " + Feats) TextWindow.WriteLine("") TextWindow.WriteLine("Strength: " + Strength + " Bonus: " + StrengthBonus) TextWindow.WriteLine("Dexterity: " + Dexterity + " Bonus: " + DexterityBonus) TextWindow.WriteLine("Constitution: " + Constitution + " Bonus: " + ConstitutionBonus) TextWindow.WriteLine("Intelligence: " + Intelligence + " Bonus: " + IntelligenceBonus) TextWindow.WriteLine("Wisdom: " + Wisdom + " Bonus: " + WisdomBonus) TextWindow.WriteLine("Charisma: " + Charisma + " Bonus: " + CharismaBonus) TextWindow.WriteLine("") TextWindow.WriteLine("Armour Class: " + PlayerAC) TextWindow.WriteLine("Attack Bonus: " + PlayerBAB) TextWindow.WriteLine("Damage Potential: " + MaxDamage) TextWindow.WriteLine("Continue?: *Press Enter*") TextWindow.Read() TextWindow.WriteLine("") TextWindow.WriteLine("...The Adventure Begins...") TextWindow.WriteLine("") End>GLG637.sb< Start>GLH563.sb< dw=1400 dh=900 td=0 GraphicsWindow.BackgroundColor ="Darkblue GraphicsWindow.Width = dw GraphicsWindow.Height = dh GraphicsWindow.Top=0 GraphicsWindow.Left=0 GraphicsWindow.Title ="3D Chars args=0 T_x=0 T_y=-40 T_Angle=180 deg=44/7/360 view3D = LD3DView.AddView(dw,dh,"True") 'Some different light types LD3DView.AddDirectionalLight(view3D,"red",-1,-1,-1) LD3DView.AddDirectionalLight(view3D,"pink",1,1,1) LD3DView.AddAmbientLight(view3D,"#50111111") LD3DView.SpecularExponent=8 'Initial camera position and direction and view angle LD3DView.ResetCamera(view3D,0,0,170, 0,0,-1,"","","") 'spyrr() Sub aa pp=bx+":0:0:"+(bx+5)+":10:0:"+(bx+10)+":0:0 LDCall.Function("tset" pp) pp=(1.4+bx)+":3:0:"+(8.6+bx)+":3:0 LDCall.Function("tset" pp) endsub Sub av pp=bx+":10:0:"+(bx+5)+":0:0:"+(bx+10)+":10:0 LDCall.Function("tset" pp) endsub Sub ay pp=bx+":10:0:"+(bx+4)+":4:0:"+(bx+8)+":10:0 LDCall.Function("tset" pp) pp=(bx+4)+":0:0:"+(bx+4)+":4:0:" LDCall.Function("tset" pp) endsub Sub ax pp=bx+":10:0:"+(bx+4)+":5:0:"+(bx+8)+":10:0 LDCall.Function("tset" pp) pp=bx+":0:0:"+(bx+4)+":5:0:"+(bx+8)+":0:0 LDCall.Function("tset" pp) endsub Sub ak pp=(bx+7)+":0:0:"+(bx)+":5:0:"+(bx)+":0:0: pp=pp+bx+":10:0:"+(bx)+":5:0:"+(bx+6)+":10:0 LDCall.Function("tset" pp) endsub Sub az pp=bx+":10:0:"+(bx+8)+":10:0:"+bx+":0:0:"+(bx+8)+":0:0 LDCall.Function("tset" pp) endsub Sub an pp=bx+":0:0:"+bx+":10:0:"+(bx+8)+":0:0:"+(bx+8)+":10:0 LDCall.Function("tset" pp) endsub Sub am pp=bx+":0:0:"+bx+":10:0:"+(bx+6)+":0:0:"+(bx+6)+":10:0:"+(bx+12)+":0:0 LDCall.Function("tset" pp) endsub Sub aw pp=bx+":10:0:"+bx+":0:0:"+(bx+6)+":10:0:"+(bx+6)+":0:0:"+(bx+12)+":10:0 LDCall.Function("tset" pp) endsub Sub ai pp=bx+":0:0:"+bx+":10:0:" LDCall.Function("tset" pp) endsub Sub at pp=(bx+4)+":0:0:"+(bx+4)+":9.8:0:" LDCall.Function("tset" pp) pp=(bx)+":9.8:0:"+(bx+8)+":9.8:0:" LDCall.Function("tset" pp) EndSub Sub ae pp=(bx+6)+":0:0:"+bx+":0:0:"+bx+":9.8:0:"+(bx+6)+":9.8:0:" LDCall.Function("tset" pp) pp=(bx)+":4.9:0:"+(bx+5)+":4.9:0:" LDCall.Function("tset" pp) endsub Sub al pp=(bx+6)+":0:0:"+bx+":0:0:"+bx+":9.8:0:" LDCall.Function("tset" pp) endsub Sub af pp=bx+":0:0:"+bx+":9.8:0:"+(bx+6)+":9.8:0:" LDCall.Function("tset" pp) pp=(bx)+":4.9:0:"+(bx+5)+":4.9:0:" LDCall.Function("tset" pp) endsub Sub ah pp=bx+":0:0:"+bx+":9.8:0:" 'LDCall.Function("tset" pp) pp=pp+(bx)+":4.9:0:"+(bx+6)+":4.9:0:" pp=pp+(bx+6)+":9.8:0:"+(bx+6)+":0:0:" 'LDCall.Function("tset" pp) LDCall.Function("tset" pp) endsub Sub ar pp=(bx+7)+":0:0:"+(bx)+":5:0:"+(bx)+":0:0: pp=pp+bx+":10:0:"+(bx+2)+":10:0" T_Angle=90 T_x=bx+2 t_y=10 For f=0 To 18 LDCall.Function ("t_move" .4) T_Angle=T_Angle-9 EndFor LDCall.Function ("t_move" 2) LDCall.Function("tset" pp) endsub Sub ap pp=(bx)+":0:0:"+bx+":10:0:"+(bx+2)+":10:0" T_Angle=90 T_x=bx+2 t_y=10 For f=0 To 18 LDCall.Function ("t_move" .4) T_Angle=T_Angle-9 EndFor LDCall.Function ("t_move" 2) LDCall.Function("tset" pp) endsub Sub ad pp=(bx)+":0:0:"+bx+":10:0:"+(bx+2)+":10:0" T_Angle=90 T_x=bx+2 t_y=10 For f=0 To 19 LDCall.Function ("t_move" .755) T_Angle=T_Angle-9 EndFor LDCall.Function ("t_move" 3) LDCall.Function("tset" pp) endsub Sub cc pp="" For q=rs To rf Step 5 pp=pp+(r5+bx+LDMath.Cos(q)*r5)+":"+(r5+LDMath.sin(q)*r5)+":0:" EndFor LDCall.Function("tset" pp) endsub sub t_Move mm=LDMath.Convert2Cartesian (t_x,t_y,args[1] t_Angle-90 ) t_x= (mm[1]) t_y= (mm[2]) pp=pp+":"+t_x+":"+T_y+":"+0 EndSub ddd=20 bx=-7-ddd ax() bx=0-ddd av() bx=7-ddd aa() bx=18-ddd an() bx=27-ddd at() bx=36-ddd ai() bx=39-ddd am() bx=52-ddd ae() bx=62-ddd ak() bx=72-ddd ad() bx=82-ddd ar() bx=92-ddd ap() ty=12 bx=-7-ddd aa() bx=4-ddd an() bx=13-ddd ay() bx=22-ddd aw() bx=35-ddd af() bx=45-ddd al() bx=55-ddd ah() rs=0 rf=360 bx=65-ddd r5=5 cc() rs=30 rf=330 bx=75-ddd cc() rf=450 rs=270 bx=85-ddd cc() bx=95-ddd az() 'QG PRB UJS 'AVTMNEYILFHXODCZK 'camera orbit r170=100 LDEvents.MouseWheel =mww LD3DView.AutoControl ("true" "true", -1 1) p100=50 GraphicsWindow.KeyDown =kdd While 1=1 If pa Then else n=n+2 deg=deg-1 x=ldMath.Sin(n)*r170 z=ldmath.Cos(n)*r170 LD3DView.ResetCamera(view3D,x,za,z,-x*5,0,-z*5,"","","") Program.Delay(p100) endif EndWhile Sub tset For ww=0 To 3 Step .3 oo=LD3DView.addtube(view3d,args[1],.6,20,"cyan","S") LD3DView.TranslateGeometry (view3d oo 0 ty+LDMath.Sin(ww*60) td+ww) endfor ' LD3DView.AnimateRotation (view3D oo 0 1 0 0, 360 9.1,1) EndSub Sub mww za=za+ LDEvents.LastMouseWheelDelta*2 EndSub Sub kdd If GraphicsWindow.LastKey="Escape" Then pa="true GraphicsWindow.Title ="Pause" Else pa="false GraphicsWindow.Title ="Orbiting... EndIf EndSub End>GLH563.sb< Start>GLK004-0.sb< 'this is to demonstrate the major malfunctions of the "global scope" ' variables, that have just been checked for a certain condition (if) ' change value inside closed condition ' run this and click a few times into the GraphicsWindow 'no field has to be drawn outside that pattern and pointer has just to 'point at those lightblue squares - nowhere else is told to point than on 'current Field (FD). But how comes it points to Fields that do not exist? ' create simple sudoku-square (9*9) Fieldsize = 32 Fieldspace = 8 Left = 0 Top = 1 BorderWidth = 40 ' extra big border to see what happens gwSize = 2 * BorderWidth + 9 * Fieldsize + 8 * Fieldspace GraphicsWindow.Width = gwSize GraphicsWindow.Height = gwSize ' add some shape as a pointer GraphicsWindow.PenWidth = Fieldspace / 2 GraphicsWindow.PenColor ="Red" GraphicsWindow.BrushColor ="gray" Pointer = Shapes.AddRectangle(Fieldsize+Fieldspace, Fieldsize+Fieldspace) Shapes.SetOpacity(Pointer, 50) For iRow = 1 To 9 For iColumn = 1 To 9 FD[iColumn + 10 * iRow][Left] = BorderWidth + (Fieldsize + Fieldspace) * (iColumn-1) FD[iColumn + 10 * iRow][Top] = BorderWidth + (Fieldsize + Fieldspace) * (iRow -1) EndFor EndFor GraphicsWindow.Show() Timer.Interval = 500 Timer.Tick = Draw GraphicsWindow.MouseDown = Click currentField = 11 'initial drawing GraphicsWindow.BrushColor = "lightBlue" Draw() Sub Click For i = 11 To 99 If i/10 <> Math.Floor(i/10) Then ' during this loop i gets changed by Draw() ! If GraphicsWindow.MouseX >= FD[i][Left] And GraphicsWindow.MouseX <= FD[i][Left] + Fieldsize then If GraphicsWindow.MouseY >= FD[i][Top] and GraphicsWindow.MouseY <= FD[i][Top] + Fieldsize then currentField = i Goto exitClick EndIf EndIf EndIf EndFor exitClick: EndSub Sub Draw For i = 11 To 99 If i/10 <> Math.Floor(i/10) Then ' inside this condition i gets changed by Click()! GraphicsWindow.FillRectangle(FD[i][Left], FD[i][Top], Fieldsize, Fieldsize) EndIf EndFor Shapes.Move(Pointer, FD[currentField][Left] - Fieldspace/2, FD[currentField][Top] - Fieldspace/2) EndSub End>GLK004-0.sb< Start>GLK004.sb< 'this is to demonstrate the major malfunctions of the "global scope" ' variables, that have just been checked for a certain condition (if) ' change value inside closed condition ' run this and click a few times into the GraphicsWindow 'no field has to be drawn outside that pattern and pointer has just to 'point at those lightblue squares - nowhere else is told to point than on 'current Field (FD). But how comes it points to Fields that do not exist? ' create simple sudoku-square (9*9) Fieldsize = 32 Fieldspace = 8 Left = 0 Top = 1 BorderWidth = 40 ' extra big border to see what happens gwSize = 2 * BorderWidth + 9 * Fieldsize + 8 * Fieldspace GraphicsWindow.Width = gwSize GraphicsWindow.Height = gwSize ' add some shape as a pointer GraphicsWindow.PenWidth = Fieldspace / 2 GraphicsWindow.PenColor ="Red" GraphicsWindow.BrushColor ="gray" Pointer = Shapes.AddRectangle(Fieldsize+Fieldspace, Fieldsize+Fieldspace) Shapes.SetOpacity(Pointer, 50) For iRow = 1 To 9 For iColumn = 1 To 9 FD[iColumn + 10 * iRow][Left] = BorderWidth + (Fieldsize + Fieldspace) * (iColumn-1) FD[iColumn + 10 * iRow][Top] = BorderWidth + (Fieldsize + Fieldspace) * (iRow -1) EndFor EndFor GraphicsWindow.Show() Timer.Interval = 20 Timer.Tick = Draw GraphicsWindow.MouseDown = Click currentField = 11 'initial drawing GraphicsWindow.BrushColor = "lightBlue" Draw() Sub Click For i = 11 To 99 If i/10 <> Math.Floor(i/10) Then ' during this loop i gets changed by Draw() ! If GraphicsWindow.MouseX >= FD[i][Left] And GraphicsWindow.MouseX <= FD[i][Left] + Fieldsize then If GraphicsWindow.MouseY >= FD[i][Top] and GraphicsWindow.MouseY <= FD[i][Top] + Fieldsize then currentField = i Goto exitClick EndIf EndIf EndIf EndFor exitClick: EndSub Sub Draw For i = 11 To 99 If i/10 <> Math.Floor(i/10) Then ' inside this condition i gets changed by Click()! GraphicsWindow.FillRectangle(FD[i][Left], FD[i][Top], Fieldsize, Fieldsize) EndIf EndFor Shapes.Move(Pointer, FD[currentField][Left] - Fieldspace/2, FD[currentField][Top] - Fieldspace/2) EndSub End>GLK004.sb< Start>GLL508.sb< ' Challenge of the month August 2012 Animal shapes naochanON ' Whale sharks sharkdata() makeshape() For i=1 to 3 reposition() endfor While "true" For i=1 To 3 If Shapes.GetLeft(stri[i][14])+200*i<-50 Then reposition() EndIf EndFor move() Program.Delay(80) endwhile Sub reposition x0=1000+300*i y1=shapes.GetTop(stri[i][2]) y0=math.GetRandomNumber(325)*(325-y1)/math.abs(325-y1) '-------------------------- body -------------------------- For j=1 To 16 Shapes.Move(stri[i][j],shapes.GetLeft(stri[i][j])+x0,shapes.GetTop(stri[i][j])+y0) endfor '-------------------------- mouse Eyes -------------------------- For k=1 To 5 Shapes.Move(sEl[i][k],shapes.GetLeft(sEl[i][k])+x0,shapes.GetTop(sEl[i][k])+y0) endfor For L=1 To 35 Shapes.Move(sdEl[i][L],shapes.GetLeft(sdEl[i][L])+x0,shapes.GetTop(sdEl[i][L])+y0) endfor GraphicsWindow.Show() EndSub Sub move For i=1 To 3 dx=math.GetRandomNumber(8)-2 dy=(math.GetRandomNumber(8)-4) Op=(3+math.GetRandomNumber(2))/6 dy=dy/10 '-------------------------- body -------------------------- For j=1 To 16 Shapes.Move(stri[i][j],Shapes.GetLeft(stri[i][j])-dx,Shapes.Gettop(stri[i][j])+dy) endfor For j=10 To 14 Shapes.rotate(stri[i][j],-op*6) ' moving tail EndFor '-------------------------- mouse Eyes -------------------------- For k=1 To 5 Shapes.Move(sEl[i][k],Shapes.GetLeft(sEl[i][k])-dx,Shapes.Gettop(sEl[i][k])+dy) endfor Shapes.Zoom(sEl[i][3],1,op) ' moving mouth For L=1 To 35 Shapes.Move(sdEl[i][L],Shapes.GetLeft(sdEl[i][L])-dx,Shapes.Gettop(sdEl[i][L])+dy) endfor EndFor EndSub Sub sharkdata trx[1]="1=6;2=24.5;3=5.3" ' gray try[1]="1=4;2=6;3=4.8" trx[2]="1=0.8;2=6;3=0.2" ' Navy try[2]="1=0;2=4;3=2" trx[3]="1=0.8;2=8.5;3=6" try[3]="1=0;2=0.8;3=4" trx[4]="1=0.9;2=6;3=5.3" ' try[4]="1=2;2=4;3=4.8" trx[5]="1=8.5;2=30.6;3=6" ' try[5]="1=0.8;2=6.5;3=4" trx[6]="1=15.3;2=21.3;3=20" try[6]="1=2.4;2=0.3;3=3.6" trx[7]="1=17;2=20;3=20.2" try[7]="1=5;2=5.3;3=7.2" trx[8]="1=23.5;2=25;3=25.6" try[8]="1=4.4;2=3.8;3=5" trx[9]="1=22.2;2=24.2;3=24.5" try[9]="1=5.6;2=5.8;3=6.8" trx[10]="1=24.2;2=31.4;3=31.2" try[10]="1=5.8;2=6.5;3=8" trx[11]="1=27.6;2=31.8;3=31.2" try[11]="1=5.9;2=3;3=6.5" trx[12]="1=31.8;2=36;3=31.2" try[12]="1=3;2=1.5;3=6.5" trx[13]="1=28.2;2=31.2;3=30.2" try[13]="1=7;2=8;3=10.2" trx[14]="1=31.2;2=32.3;3=30.2" try[14]="1=8;2=10.8;3=10.2" trx[15]="1=9;2=12.5;3=11.8" try[15]="1=3.5;2=3.6;3=5.3" trx[16]="1=12.5;2=17;3=11.8" try[16]="1=3.6;2=6.8;3=5.3" W="1=0.8;2=0.8;3=5;4=0.5;5=0.8" H="1=2;2=2;3=0.8;4=0.5;5=0.8" ELx="1=0;2=5;3=0.5;4=0.6;5=5.3" ELy="1=0;2=2.3;3=0.5;4=0;5=3" dotx= "1=3.5;2=5.3;3=5.5;4=6.8;5=8;6=8;7=8.8;8=9.5;9=10;10=10.2;11=10.8;12=11.5;13=12.5;14=13.2;15=14.2;16=14.6;17=15.6;18=15.8;19=16.5;20=16.8;" dotx=dotx+"21=17.5;22=18.2;23=18.5;24=19.2;25=19.6;26=20.3;27=20.7;28=21.5;29=22.6;30=23.1;31=24.6;32=25.6;33=26.5;34=28.5;35=30.2" doty= "1=0.8;2=1;3=2;4=1.5;5=1.2;6=3;7=1.8;8=2.8;9=1.2;10=1.6;11=3.5;12=2.4;13=3.6;14=2.6;15=3.2;16=4.5;17=2.4;18=4;19=4.8;20=3.4;" doty=doty+"21=4;22=4.8;23=3.2;24=5;25=4.1;26=4;27=4.5;28=5;29=4.5;30=5;31=5.4;32=5.6;33=5.4;34=6.3;35=6.3" endsub Sub makeshape GraphicsWindow.Title=" Moving whale sharks ..... " GraphicsWindow.Width=1200 GraphicsWindow.Height=650 GraphicsWindow.Top=20 GraphicsWindow.Left=50 GraphicsWindow.BackgroundColor="lightcyan" GraphicsWindow.Hide() For i=3 To 1 Step -1 '-------------------------- body -------------------------- GraphicsWindow.BrushColor="gray" GraphicsWindow.penColor="gray" ZM=5*i stri[i][1]=Shapes.AddTriangle(trx[1][1]*ZM,try[1][1]*ZM,trx[1][2]*ZM,try[1][2]*ZM,trx[1][3]*ZM,try[1][3]*ZM) GraphicsWindow.BrushColor="Navy" GraphicsWindow.penColor="Navy" For j=2 To 16 stri[i][j]=Shapes.AddTriangle(trx[j][1]*ZM,try[j][1]*ZM,trx[j][2]*ZM,try[j][2]*ZM,trx[j][3]*ZM,try[j][3]*ZM) endfor For k=1 To 2 sEl[i][k]=Shapes.AddEllipse(W[k]*ZM,H[k]*ZM) Shapes.Move(sEl[i][k],ELx[k]*ZM,ELy[k]*ZM) endfor '-------------------------- mouse -------------------------- GraphicsWindow.BrushColor="White" GraphicsWindow.penColor="white" sEl[i][3]=Shapes.AddEllipse(W[3]*ZM,H[3]*ZM) shapes.Move(sEl[i][3],ELx[3]*ZM,ELy[3]*ZM+H[3]*ZM) Shapes.Rotate(sEl[i][3],30) '-------------------------- Eyes -------------------------- GraphicsWindow.BrushColor="Yellow" GraphicsWindow.penColor="Yellow" For K=4 To 5 sEl[i][k]=Shapes.AddEllipse(W[k]*ZM,H[k]*ZM) Shapes.Move(sEl[i][k],ELx[k]*ZM,ELy[k]*ZM) endfor '-------------------------- dot mark -------------------------- GraphicsWindow.BrushColor="White" GraphicsWindow.penColor="white" For L=1 To 35 sdEl[i][L]=Shapes.AddEllipse(5,5) Shapes.Move(sdEl[i][L],dotx[L]*ZM,doty[L]*ZM) endfor EndFor EndSub End>GLL508.sb< Start>GLR347.sb< mc="HappySoftProduction Paintball Trainer" dtw=Desktop.Width dth=Desktop.Height If dtw<>1920 or dth<>1080 then 'GraphicsWindow.ShowMessage("Требуется разрешение экрана 1920х1080",dtw+" на "+dth) endif GraphicsWindow.Width=dtw-10 GraphicsWindow.Height=dth-40 GraphicsWindow.top=0 GraphicsWindow.left=0 gww=GraphicsWindow.Width gwh=GraphicsWindow.Height GraphicsWindow.FontName="Lucida Console" GraphicsWindow.FontSize=48 INI() GraphicsWindow.TextInput=onTI tix=gww*.5 ti="" sub onTI 'GraphicsWindow.DrawText(tix,gwh*.5,GraphicsWindow.LastText) tix=tix+GraphicsWindow.FontSize*.7 EndSub While 0=1 endwhile gsx=Math.Round(gww*.11) gsy=Math.Round(gwh*.33) dpath=Program.Directory tagI=ImageList.LoadImage("http://4.bp.blogspot.com/-qrYmGoV_PdI/UOArBtCb39I/AAAAAAAAAD4/sabtAZnmb8E/s1600/PBtag.png") 'GraphicsWindow.DrawResizedImage(tagI,gsx,0,600,700) GraphicsWindow.DrawResizedImage(tagI,gsx,0,math.Round(gww-gsx*2),gwh) 'GraphicsWindow.ShowMessage(gww+" на "+gwh,"") 'GraphicsWindow.ShowMessage(gsx+" на "+gsy,"") For i=0 to 5 If i<3 then x=0 y=i*gsy else x= gww-gsx y=(i-3)*gsy endif gx[i]=x gy[i]=y gi[i]=ImageList.LoadImage(giu[i]) GraphicsWindow.DrawResizedImage(gi[i],x,y,gsx,gsy) maxpt[i]=0 zx=gsx/ImageList.GetWidthOfImage(gi[i]) zy=gsy/imagelist.GetHeightOfImage(gi[i]) x=x-ImageList.GetWidthOfImage(gi[i])/2+gsx/2 y=y-imagelist.GetHeightOfImage(gi[i])/2+gsy/2 ga[i]=Shapes.AddImage(gi[i]) Shapes.Zoom(ga[i], zx, zy) Shapes.Animate(ga[i], x, y, 200) Program.Delay(200) Shapes.Remove(ga[i]) endfor greet=Controls.AddTextBox(gww*.4,gwh*.3) Controls.TextTyped=onTT guest=-1 While guest=-1 EndWhile gameshots=20 TBpt=Controls.AddTextBox(gww*.25, 0) Controls.SetSize(TBpt, GraphicsWindow.FontSize*1.8, GraphicsWindow.FontSize*1.2) TBsh=Controls.AddTextBox(gww*.75, 0) Controls.SetSize(TBsh, GraphicsWindow.FontSize*2.7, GraphicsWindow.FontSize*1.2) Controls.SetTextBoxText(TBsh, gameshots) gunI=ImageList.LoadImage("http://4.bp.blogspot.com/-fBis_BzHeAk/UOArD2bRl9I/AAAAAAAAAEA/fwhjjh77ay8/s1600/PBgun.png") gunIW=ImageList.GetWidthOfImage(guni) gun=Shapes.AddImage(gunI) Shapes.Zoom(gun,gwW/gunIW*.20,gwh/gunIW*.6) Shapes.Zoom(gun,.5,.6) sx=0 sy=0 sda=.2 sdx=gww*sda sdy=gwh*sda sa=200 'миллисекунд, одно движение smx=0 smy=0 GraphicsWindow.KeyDown=onkeydown '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' GAME: points=0 shots=0 while shotsmaxpt[guest] then maxpt[guest]=points if points=gameshots*10 then GraphicsWindow.ShowMessage("Вау! Ты набрал максимум: "+points+", сходи в макдоналдс получи приз!", mc) else GraphicsWindow.ShowMessage(ch[Math.GetRandomNumber(Array.GetItemCount(ch))-1]+", "+fm[guest]+"! "+ch[Math.GetRandomNumber(Array.GetItemCount(ch))-1]+"! Результат: "+points+", это твой новый рекорд!", mc) endif Else GraphicsWindow.ShowMessage("Результат: "+points+", твой рекорд: "+maxpt[guest]+" ", mc) endif goto GAME '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Sub onKeyDown lk=GraphicsWindow.LastKey if lk="Space" Or lk="Return" then shots=shots+1 GraphicsWindow.PenColor="yellow" GraphicsWindow.BrushColor="yellow" Sound.PlayClick() bd=gww*0.05 'BALL bx=sx+bd*1.5 by=sy-bd+10 GraphicsWindow.FillEllipse(bx, by, bd, bd) Shapes.move(gun,sx,sy-sdy*1.2) 'Отдача bx=bx+bd/2 by=by+bd/2 er=Math.SquareRoot((bx-GraphicsWindow.Width/2)*(bx-GraphicsWindow.Width/2)/GraphicsWindow.Width/GraphicsWindow.Width*4+(by-GraphicsWindow.Height/2)*(by-GraphicsWindow.Height/2)/GraphicsWindow.Height/GraphicsWindow.Height*4) er=Math.Round(er*10) er=Math.Max(er-1,0) pt=Math.Max(10-er,0) Controls.SetTextBoxText(TBpt, " ") Program.Delay(200) Controls.SetTextBoxText(TBpt, pt) Controls.SetTextBoxText(TBsh, gameshots-shots) 'GraphicsWindow.ShowMessage("pt="+pt+" bx="+bx+" by="+by,"") points=points+pt GraphicsWindow.BrushColor="black" rw=GraphicsWindow.FontSize*2 rh=GraphicsWindow.FontSize*1.1 rx=gx[guest]+gsx-rw ry=gy[guest]+gsy-rh GraphicsWindow.FillRectangle(rx,ry,rw,rh) GraphicsWindow.BrushColor="yellow" GraphicsWindow.DrawText(rx, ry, points) endif smd=.1 smx=0 smy=0 if GraphicsWindow.LastKey="Right" then smx=gww*smd elseif GraphicsWindow.LastKey="Left" then smx=-gww*smd elseif GraphicsWindow.LastKey="Down" then smy=gwh*smd elseif GraphicsWindow.LastKey="Up" then smy=-gwh*smd endif Shapes.Animate(gun,Shapes.GetLeft(gun)+smx,Shapes.GetTop(gun)+smy,sa) endsub Sub onTT tx=Controls.GetTextBoxText(greet) Makeguest() EndSub sub Makeguest If tx="Стас" Or tx="стас" then guest=0 GraphicsWindow.ShowMessage("Привет, "+fm[0]+"! ",mc) Controls.Remove(greet) ElseIf tx="Паша" Or tx="паша" Or tx="Павел" Or tx="павел" then guest=1 GraphicsWindow.ShowMessage("Привет, "+fm[1]+"! ",mc) Controls.Remove(greet) ElseIf tx="Артем" Or tx="артем" Or tx="Артём" Or tx="артём" then guest=2 GraphicsWindow.ShowMessage("Привет, "+fm[2]+"! ",mc) Controls.Remove(greet) ElseIf tx="Валя" Or tx="валя" Or tx="Валентин" Or tx="валентин" then guest=3 GraphicsWindow.ShowMessage("Привет, "+fm[3]+"! ",mc) Controls.Remove(greet) ElseIf tx="Олег" Or tx="олег" then guest=4 GraphicsWindow.ShowMessage("Привет, "+fm[4]+"! ",mc) Controls.Remove(greet) ElseIf tx="Иван" Or tx="��ван" Or tx="Ваня" Or tx="ваня" Or tx=" " then guest=5 GraphicsWindow.ShowMessage("Привет, "+fm[5]+"! ",mc) Controls.Remove(greet) EndIf EndSub Sub INI ch[0]="Молодец" ch[1]="Здорово" ch[2]="Давай ещё" ch[3]="Браво" ch[4]="Давай" ch[5]="Пайнтбол рулит" fm[0]="Стасик" fm[1]="Павлик" fm[2]="Темчик" fm[3]="Валек" fm[4]="Олежка" fm[5]="это опять ты" giu[0]="http://1.bp.blogspot.com/-SvoIg6djPx4/UOA25j-cNXI/AAAAAAAAAEQ/JLX6wFxrDaI/s1600/P1.jpg" giu[1]="http://4.bp.blogspot.com/-XAGhId75ZBM/UOA28DfmuxI/AAAAAAAAAEY/lggVVBHWiSY/s1600/P2.jpg" giu[2]="http://1.bp.blogspot.com/-XeL8PDZmqxk/UOA298GOf4I/AAAAAAAAAEg/kbFFxzXoZz0/s1600/P3.jpg" giu[3]="http://4.bp.blogspot.com/-yKKnRuE4lIE/UOA3AM-_pzI/AAAAAAAAAEo/YsRALOp8www/s1600/P4.jpg" giu[4]="http://3.bp.blogspot.com/-SIqZrfEA8zM/UOA3Cr3uRwI/AAAAAAAAAEw/ZEwHppCxXkU/s1600/P5.jpg" giu[5]="http://4.bp.blogspot.com/-xPk-XrzGJ7Y/UOA3Hk7V6BI/AAAAAAAAAE4/Xk5bMKQZ5f0/s1600/P6.jpg" EndSub End>GLR347.sb< Start>GLR743.sb< numBox = 5 For i = 1 To numBox GraphicsWindow.DrawText(10,30*i, "Textbox "+i) textBox[i] = Controls.AddTextBox(100,30*i) EndFor GraphicsWindow.DrawText(10,30*i, "Comments") comments = Controls.AddTextBox(100,30*i) return = 0 lastBox = 0 GraphicsWindow.KeyUp = OnKeyUp While ("True") getBox() If (currentBox > 0) Then If (return = 1) Then Controls.SetTextBoxText(comments,"Validating textbox "+currentBox) Program.Delay(1000) ElseIf (currentBox <> lastBox And lastBox > 0) Then Controls.SetTextBoxText(comments,"Validating textbox "+lastBox) Program.Delay(1000) Else Controls.SetTextBoxText(comments,"Focus is textbox "+currentBox) EndIf EndIf lastBox = currentBox return = 0 Program.Delay(20) EndWhile Sub OnKeyUp If (GraphicsWindow.LastKey = "Return") Then return = 1 EndIf EndSub Sub getBox 'box = Controls.LastTypedTextBox currentBox = 0 For i = 1 To numBox If (FCControls.IsFocused(textBox[i])) Then 'If (box = textBox[i]) Then currentBox = i EndIf EndFor EndSub End>GLR743.sb< Start>GLW067-0.sb< 'Challenge of the Month - August 2017 -- fireworks -- by NaochanON 20190819 GraphicsWindow.Title ="Turbo Firework GraphicsWindow.Width=1200 GraphicsWindow.Height=700 GraphicsWindow.BackgroundColor="#0E2350" GraphicsWindow.BrushColor="#171846" GraphicsWindow.FillRectangle(0,400,1200,300) GraphicsWindow.BrushColor="#17184B" GraphicsWindow.FillRectangle(500,250,100,150) GraphicsWindow.FillTriangle(500,250,500,400,300,400) GraphicsWindow.FillTriangle(600,250,600,400,800,400) GraphicsWindow.PenWidth=0 Ring=10 stars=40 While "True" make_hanabi() launch() spread() fadeout() erase() Program.Delay(1500) endwhile Sub make_hanabi X0=150+Math.GetRandomNumber(800) Y0=690 color="#FFEA05" GraphicsWindow.BrushColor=color For k=1 To Ring For i=1 To stars star[K][i]=shapes.AddText("★") Shapes.Move(star[k][i],X0,Y0) EndFor EndFor EndSub Sub launch _Y=0 _dy=Math.GetRandomNumber(150) For L=1 To 10 For k=1 To Ring For i=1 To stars _Y=_Y+(10-L)*(10-L) Shapes.Move(star[k][i],X0,y0-0.005*_Y-_dY) EndFor endfor Program.Delay(50) EndFor EndSub Sub spread DR= 100+_dY For k=1 To Ring _DR=DR*(K+0.15*k*k)/Ring For i=1 To stars _rad=math.GetRadians(i*360/stars) Shapes.Move(star[k][i],Shapes.GetLeft(star[k][i])+_DR*math.Cos(_rad),Shapes.Gettop(star[k][i])+_DR*math.sin(_rad)) EndFor Program.Delay(10) EndFor EndSub Sub fadeout For L=1 To 1 For k=Ring To 1 Step -1 For i=1 To stars ldShapes.AnimateZoom (star[k][i],1200 0 2 2) ldShapes.AnimateOpacity (star[k][i] 600 0) Program.Delay (5) Shapes.Move(star[k][i],Shapes.GetLeft(star[k][i]),Shapes.Gettop(star[k][i])+L*0.5) EndFor EndFor EndFor Program.Delay(500) EndSub Sub erase For k=1 To Ring For i=1 To stars Shapes.reMove(star[k][i]) EndFor EndFor EndSub End>GLW067-0.sb< Start>GLW067.sb< 'Challenge of the Month - August 2017 -- fireworks -- by NaochanON 20190819 GraphicsWindow.Width=1200 GraphicsWindow.Height=700 GraphicsWindow.BackgroundColor="#0E2350" GraphicsWindow.BrushColor="#171846" GraphicsWindow.FillRectangle(0,400,1200,300) GraphicsWindow.BrushColor="#17184B" GraphicsWindow.FillRectangle(500,250,100,150) GraphicsWindow.FillTriangle(500,250,500,400,300,400) GraphicsWindow.FillTriangle(600,250,600,400,800,400) GraphicsWindow.PenWidth=0 Ring=10 stars=40 While "True" make_hanabi() launch() spread() fadeout() erase() Program.Delay(1500) endwhile Sub make_hanabi X0=150+Math.GetRandomNumber(800) Y0=690 color="#FFEA05" GraphicsWindow.BrushColor=color For k=1 To Ring For i=1 To stars star[K][i]=shapes.AddText("★") Shapes.Move(star[k][i],X0,Y0) EndFor EndFor EndSub Sub launch _Y=0 _dy=Math.GetRandomNumber(150) For L=1 To 10 For k=1 To Ring For i=1 To stars _Y=_Y+(10-L)*(10-L) Shapes.Move(star[k][i],X0,y0-0.005*_Y-_dY) EndFor endfor Program.Delay(50) EndFor EndSub Sub spread DR= 100+_dY For k=1 To Ring _DR=DR*(K+0.15*k*k)/Ring For i=1 To stars _rad=math.GetRadians(i*360/stars) Shapes.Move(star[k][i],Shapes.GetLeft(star[k][i])+_DR*math.Cos(_rad),Shapes.Gettop(star[k][i])+_DR*math.sin(_rad)) EndFor Program.Delay(10) EndFor EndSub Sub fadeout For L=1 To 20 For k=Ring To 1 Step -1 For i=1 To stars Shapes.Zoom(star[k][i],1-L/20,1-L/20) Shapes.Move(star[k][i],Shapes.GetLeft(star[k][i]),Shapes.Gettop(star[k][i])+L*0.5) EndFor EndFor Program.Delay(50) EndFor EndSub Sub erase For k=1 To Ring For i=1 To stars Shapes.reMove(star[k][i]) EndFor EndFor EndSub End>GLW067.sb< Start>GLZ638.sb< GraphicsWindow.BackgroundColor="Black LDUtilities.ShowErrors="False LDUtilities.ShowNoShapeErrors="False bcc=LDText.Split ("Cyan White"," ") brr=LDShapes.BrushGradient(bcc,"DD") GraphicsWindow.MouseDown=mdd LDShapes.BrushGradientEllipse (brr,100,100,200,200) ww=Shapes.AddText ("ûûû") LDShapes.Font (ww,"Webdings",270,"True","True") ldShapes.PenColour (ww,"Black") ffc="#90000000 For x=0 To 2 ee[x]=shapes.AddEllipse(350-x*70,350-x*70) ee[x+3]=shapes.AddEllipse(350-x*70,350-x*70) For y=0 to 3 step 3 LDShapes.BrushColour(ee[x+y],"Transparent") LDShapes.PenColour (ee[x+y],ffc) endfor endfor ee[6]=shapes.AddEllipse(650,650) ee[7]=shapes.AddEllipse(650,650) LDShapes.Move(ee[0],160,22) LDShapes.Move(ee[1],138,61) LDShapes.Move(ee[2],115,94) LDShapes.Move(ee[3],-110,22) LDShapes.Move(ee[4],-15,61) LDShapes.Move(ee[5],78,94) For x=6 to 7 LDShapes.BrushColour(ee[x],"Transparent") LDShapes.PenColour (ee[x],ffc) endfor LDShapes.Move(ee[7],-435,70-200) LDShapes.Move(ee[6],184,70-200) ss=LDText.Split ("5 4 3 7 6 0 1 2"," ") p=1 For f=0 To 7 Shapes.HideShape (ee[f]) endfor Shapes.Zoom(ww,1.2,1.2) While 1=1 Shapes.Move (ww,300,100) Shapes.Animate(ww,-250*4,100,4800*4) For f=1 To 16*4 Shapes.showShape (ee[ss[p-2]]) Shapes.showShape (ee[ss[p-4]]) Shapes.showShape (ee[ss[p-6]]) Shapes.showShape (ee[ss[p]]) ldShapes.PenColour (ee[ss[p]],"#22000000") Shapes.showShape (ee[ss[p+2]]) Shapes.showShape (ee[ss[p+4]]) Shapes.showShape (ee[ss[p+6]]) Program.Delay(300) ldShapes.PenColour (ee[ss[p]],ffc) For ff=0 To 7 Shapes.HideShape (ee[ff]) endfor p=p+1 If p>8 Then p=1 endif endfor EndWhile Sub mdd mx= GraphicsWindow.MouseX my= GraphicsWindow.MouseY Shapes.Move(ee[6],mx,my-200) GraphicsWindow.Title=mx+";"+my EndSub End>GLZ638.sb< Start>GMC157-0.sb< ' SmallBasic Version 1.2 ' Program: LudwigVan2 (CwO) ' Changelog: ' Author: Pappa Lapub ' Website: https://social.msdn.microsoft.com/Forums/en-US/fdd47786-c5c6-4d47-aa76-457d96502493/ludwig-van-beethoven-moonlight-sonata-in-small-basic ' ImportURL: http://smallbasic.com/program/?GMC157-0 ' Extension: LitDev ' Comment: ESC ... Exit; MouseWheel ... Zoom In/Out ' ' Variables: ' ToDo: ' ================================================================================ 'pic = "https://41.media.tumblr.com/tumblr_lu7ub1Cpr11qav3uso1_1280.png" pic = Program.Directory +"\img\LudwigVan.png" tbh = 60 '' Taskbar Height h = 600 '' init Height for image = gh '---------------------------------------------------------------------------------- maxR = 200 maxG = 150 maxB = 100 fact = 1 dZoom = 1.05 maxGH = Desktop.Height-22 - tbh + 20 '' +20 ... tolerance beyond taskbarH imgOrig = ImageList.LoadImage(pic) imgW = ImageList.GetWidthOfImage(imgOrig) imgH = ImageList.GetHeightOfImage(imgOrig) w = Math.Round(imgW * h / imgH) ' The following line could be harmful and has been automatically commented. ' title = LDFile.GetFile(pic) +"."+ LDFile.GetExtension(pic) +" [Orig: "+ imgW +"x"+ imgH +"] "+ w +"x"+ h +" x" img = LDImage.Copy(imgOrig) LDImage.Resize(img, w,h) img2 = LDImage.Copy(img) LDImage.Add(img2, 0,-90, -255) ProcessImagePxl() LDImage.EffectEdge(img) GraphicsWindow.Top = 0 GraphicsWindow.Width = w GraphicsWindow.Height = h GraphicsWindow.Title = title + fact LDGraphicsWindow.TopMost = "True" LDGraphicsWindow.BackgroundImage(img) shp = Shapes.AddImage(img2) LDShapes.AnimateOpacity(shp, 12000, 0) GraphicsWindow.KeyDown = OnKeyDown LDEvents.MouseWheel = OnMouseWheel ' ////////// SUB \\\\\\\\\\ Sub ProcessImagePxl LDImage.OpenWorkingImage(img) For x = 1 To w For y = 1 To h argb = LDImage.GetWorkingImagePixelARGB(img, x,y) cR = argb["R"] cG = argb["G"] cB = argb["B"] If cR < maxR Then cR = 255 * cR/maxR EndIf If cG < maxG Then cG = 255 * cG/maxG EndIf If cB < maxB Then cB = 255 * cB/maxB EndIf LDImage.SetWorkingImagePixel(img, x,y, GraphicsWindow.GetColorFromRGB(cR, cG, cB)) EndFor EndFor LDImage.CloseWorkingImage(img) EndSub ' ////////// EVENTs \\\\\\\\\\ Sub OnKeyDown If GraphicsWindow.LastKey = "Escape" Then Program.End() EndIf EndSub Sub OnMouseWheel wDir = LDEvents.LastMouseWheelDelta If GraphicsWindow.Height * dZoom <= maxGH Or wDir < 0 Then fact = fact * Math.Power(dZoom, wDir) GraphicsWindow.Width = w * fact GraphicsWindow.Height = h * fact LDShapes.SetSize(shp, w * fact ,h * fact) GraphicsWindow.Title = title + Math.Round(100*fact)/100 EndIf EndSub End>GMC157-0.sb< Start>GMC454.sb< ' use UVC type microscope or web camera init() Controls.ButtonClicked = OnButtonClicked Sub OnButtonClicked If (Controls.LastClickedButton = picture) Then Controls.HideControl(picture) ct=text.Append(text.Append(Clock.hour,Clock.Minute),Clock.Second) Shapes.SetText(smsg,dt+"_"+ct) LDUtilities.PauseUpdates() PGF=program.Directory+"\" +dt+"_"+ct+".jpg" LDUtilities.GWCapture(PGF,"False") LDUtilities.ResumeUpdates() Controls.showControl(picture) EndIf EndSUb Sub init GW=640 GH=480 GraphicsWindow.Top=20 GraphicsWindow.Left=50 GraphicsWindow.Width = GW GraphicsWindow.Height = GH GraphicsWindow.BackgroundColor = LDColours.AntiqueWhite webcam = LDWebCam.Start(GW,GH) Shapes.Move(webcam,0,0) GraphicsWindow.BrushColor="Red" picture = Controls.AddButton("Photo",GW-60,GH-40) Controls.SetSize(picture,50,28) smsg= Shapes.AddText(" ") Shapes.Move(smsg,GW-190,GH-30) dt=text.Append(text.Append(Clock.Year,Clock.month),Clock.Day) Shapes.SetText(smsg,dt+"_XXYYZZ") EndSub End>GMC454.sb< Start>GMG940.sb< maxindex = 140 f[1] = 0 f[2] = 1 TextWindow.WriteLine(1+" f(0) = "+f[1]) TextWindow.WriteLine(2+" f(1) = "+f[2]) For i = 3 To maxindex f[i] = f[i-1] + f[i-2] output = Text.Append(i," f(") output = Text.Append(output, i-1) output = Text.Append(output, ") = ") output = Text.Append(output, f[i]) TextWindow.WriteLine(output) EndFor End>GMG940.sb< Start>GMH674.sb< ' array of valid characters For i = 0 To 9 digits[i] = i EndFor is_number = "False" While is_number = "False" ' read input TextWindow.Write("enter a number: ") input = TextWindow.Read() is_number = "True" ' nothing entered ? If Text.GetLength(input) = 0 Then is_number = "False" EndIf ' is it really a number ? For i = 1 To Text.GetLength(input) If Array.ContainsValue(digits, Text.GetSubText(input, i, 1)) = "False" Then is_number = "False" EndIf EndFor ' remind user to enter only a number If is_number = "False" Then TextWindow.WriteLine("please enter a valid number.") EndIf EndWhile ' --- output ------------------------------------------------------------------------------- TextWindow.ForegroundColor = "red" TextWindow.WriteLine(input) ' small basic automatically converts a text to a number if needed & possible TextWindow.WriteLine(input + 5) End>GMH674.sb< Start>GMH995.sb< Init() Click() Sub Init GraphicsWindow.Clear() GraphicsWindow.Title = "Connect 4" GraphicsWindow.Height = 300 GraphicsWindow.Width = 350 GraphicsWindow.Show() GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.FillRectangle (0, 0, 350, 300) GraphicsWindow.MouseDown = Click Circles() EndSub Sub Circles Values() GraphicsWindow.BrushColor = "White" GraphicsWindow.FillEllipse (col1, row1, circlesize, circlesize) GraphicsWindow.FillEllipse (col2, row1, circlesize, circlesize) GraphicsWindow.FillEllipse (col3, row1, circlesize, circlesize) GraphicsWindow.FillEllipse (col4, row1, circlesize, circlesize) GraphicsWindow.FillEllipse (col5, row1, circlesize, circlesize) GraphicsWindow.FillEllipse (col6, row1, circlesize, circlesize) GraphicsWindow.FillEllipse (col7, row1, circlesize, circlesize) GraphicsWindow.FillEllipse (col1, row2, circlesize, circlesize) GraphicsWindow.FillEllipse (col2, row2, circlesize, circlesize) GraphicsWindow.FillEllipse (col3, row2, circlesize, circlesize) GraphicsWindow.FillEllipse (col4, row2, circlesize, circlesize) GraphicsWindow.FillEllipse (col5, row2, circlesize, circlesize) GraphicsWindow.FillEllipse (col6, row2, circlesize, circlesize) GraphicsWindow.FillEllipse (col7, row2, circlesize, circlesize) GraphicsWindow.FillEllipse (col1, row3, circlesize, circlesize) GraphicsWindow.FillEllipse (col2, row3, circlesize, circlesize) GraphicsWindow.FillEllipse (col3, row3, circlesize, circlesize) GraphicsWindow.FillEllipse (col4, row3, circlesize, circlesize) GraphicsWindow.FillEllipse (col5, row3, circlesize, circlesize) GraphicsWindow.FillEllipse (col6, row3, circlesize, circlesize) GraphicsWindow.FillEllipse (col7, row3, circlesize, circlesize) GraphicsWindow.FillEllipse (col1, row4, circlesize, circlesize) GraphicsWindow.FillEllipse (col2, row4, circlesize, circlesize) GraphicsWindow.FillEllipse (col3, row4, circlesize, circlesize) GraphicsWindow.FillEllipse (col4, row4, circlesize, circlesize) GraphicsWindow.FillEllipse (col5, row4, circlesize, circlesize) GraphicsWindow.FillEllipse (col6, row4, circlesize, circlesize) GraphicsWindow.FillEllipse (col7, row4, circlesize, circlesize) GraphicsWindow.FillEllipse (col1, row5, circlesize, circlesize) GraphicsWindow.FillEllipse (col2, row5, circlesize, circlesize) GraphicsWindow.FillEllipse (col3, row5, circlesize, circlesize) GraphicsWindow.FillEllipse (col4, row5, circlesize, circlesize) GraphicsWindow.FillEllipse (col5, row5, circlesize, circlesize) GraphicsWindow.FillEllipse (col6, row5, circlesize, circlesize) GraphicsWindow.FillEllipse (col7, row5, circlesize, circlesize) GraphicsWindow.FillEllipse (col1, row6, circlesize, circlesize) GraphicsWindow.FillEllipse (col2, row6, circlesize, circlesize) GraphicsWindow.FillEllipse (col3, row6, circlesize, circlesize) GraphicsWindow.FillEllipse (col4, row6, circlesize, circlesize) GraphicsWindow.FillEllipse (col5, row6, circlesize, circlesize) GraphicsWindow.FillEllipse (col6, row6, circlesize, circlesize) GraphicsWindow.FillEllipse (col7, row6, circlesize, circlesize) EndSub col1row1 = 0 col2row1 = 0 col3row1 = 0 col4row1 = 0 col5row1 = 0 col6row1 = 0 col7row1 = 0 col1row2 = 0 col2row2 = 0 col3row2 = 0 col4row2 = 0 col5row2 = 0 col6row2 = 0 col7row2 = 0 col1row3 = 0 col2row3 = 0 col3row3 = 0 col4row3 = 0 col5row3 = 0 col6row3 = 0 col7row3 = 0 col1row4 = 0 col2row4 = 0 col3row4 = 0 col4row4 = 0 col5row4 = 0 col6row4 = 0 col7row4 = 0 col1row5 = 0 col2row5 = 0 col3row5 = 0 col4row5 = 0 col5row5 = 0 col6row5 = 0 col7row5 = 0 col1row6 = 0 col2row6 = 0 col3row6 = 0 col4row6 = 0 col5row6 = 0 col6row6 = 0 col7row6 = 0 brushcolor = "b" GraphicsWindow.BrushColor = "Blue" Sub Values row1 = 10 row2 = row1 + (50 * 1) row3 = row1 + (50 * 2) row4 = row1 + (50 * 3) row5 = row1 + (50 * 4) row6 = row1 + (50 * 5) row7 = row1 + (50 * 6) row8 = row1 + (50 * 7) row9 = row1 + (50 * 8) row10 = row1 + (50 * 9) col1 = 10 col2 = col1 + (50 * 1) col3 = col1 + (50 * 2) col4 = col1 + (50 * 3) col5 = col1 + (50 * 4) col6 = col1 + (50 * 5) col7 = col1 + (50 * 6) col8 = col1 + (50 * 7) col9 = col1 + (50 * 8) col10 = col1 + (50 * 9) circlesize = 30 gamestatus = 0 EndSub Sub Click Values() x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY If (x > 5 And x < 45 And y > 0 And y < 300) Then If col1row6 = "0" Then GraphicsWindow.FillEllipse (col1, row6, circlesize, circlesize) col1row6 = brushcolor ElseIf col1row5= "0" Then GraphicsWindow.FillEllipse (col1, row5, circlesize, circlesize) col1row5 = brushcolor ElseIf col1row4= "0" Then GraphicsWindow.FillEllipse (col1, row4, circlesize, circlesize) col1row4 = brushcolor ElseIf col1row3= "0" Then GraphicsWindow.FillEllipse (col1, row3, circlesize, circlesize) col1row3 = brushcolor ElseIf col1row2= "0" Then GraphicsWindow.FillEllipse (col1, row2, circlesize, circlesize) col1row2 = brushcolor ElseIf col1row1= "0" Then GraphicsWindow.FillEllipse (col1, row1, circlesize, circlesize) col1row1 = brushcolor ElseIf col1row1= "r" Or "b" Then Goto End EndIf EndIf If (x > 55 And x < 95 And y > 0 And y < 300) Then If col2row6 = "0" Then GraphicsWindow.FillEllipse (col2, row6, circlesize, circlesize) col2row6 = brushcolor ElseIf col2row5= "0" Then GraphicsWindow.FillEllipse (col2, row5, circlesize, circlesize) col2row5 = brushcolor ElseIf col2row4= "0" Then GraphicsWindow.FillEllipse (col2, row4, circlesize, circlesize) col2row4 = brushcolor ElseIf col2row3= "0" Then GraphicsWindow.FillEllipse (col2, row3, circlesize, circlesize) col2row3 = brushcolor ElseIf col2row2= "0" Then GraphicsWindow.FillEllipse (col2, row2, circlesize, circlesize) col2row2 = brushcolor ElseIf col2row1= "0" Then GraphicsWindow.FillEllipse (col2, row1, circlesize, circlesize) col2row1 = brushcolor ElseIf col2row1= "r" Or "b" Then Goto End EndIf EndIf If (x > 105 And x < 145 And y > 0 And y < 300) Then If col3row6 = "0" Then GraphicsWindow.FillEllipse (col3, row6, circlesize, circlesize) col3row6 = brushcolor ElseIf col3row5= "0" Then GraphicsWindow.FillEllipse (col3, row5, circlesize, circlesize) col3row5 = brushcolor ElseIf col3row4= "0" Then GraphicsWindow.FillEllipse (col3, row4, circlesize, circlesize) col3row4 = brushcolor ElseIf col3row3= "0" Then GraphicsWindow.FillEllipse (col3, row3, circlesize, circlesize) col3row3 = brushcolor ElseIf col3row2= "0" Then GraphicsWindow.FillEllipse (col3, row2, circlesize, circlesize) col3row2 = brushcolor ElseIf col3row1= "0" Then GraphicsWindow.FillEllipse (col3, row1, circlesize, circlesize) col3row1 = brushcolor ElseIf col3row1= "r" Or "b" Then Goto End EndIf EndIf If (x > 155 And x < 195 And y > 0 And y < 300) Then If col4row6 = "0" Then GraphicsWindow.FillEllipse (col4, row6, circlesize, circlesize) col4row6 = brushcolor ElseIf col4row5= "0" Then GraphicsWindow.FillEllipse (col4, row5, circlesize, circlesize) col4row5 = brushcolor ElseIf col4row4= "0" Then GraphicsWindow.FillEllipse (col4, row4, circlesize, circlesize) col4row4 = brushcolor ElseIf col4row3= "0" Then GraphicsWindow.FillEllipse (col4, row3, circlesize, circlesize) col4row3 = brushcolor ElseIf col4row2= "0" Then GraphicsWindow.FillEllipse (col4, row2, circlesize, circlesize) col4row2 = brushcolor ElseIf col4row1= "0" Then GraphicsWindow.FillEllipse (col4, row1, circlesize, circlesize) col4row1 = brushcolor ElseIf col4row1= "r" Or "b" Then Goto End EndIf EndIf If (x > 205 And x < 245 And y > 0 And y < 300) Then If col5row6 = "0" Then GraphicsWindow.FillEllipse (col5, row6, circlesize, circlesize) col5row6 = brushcolor ElseIf col5row5= "0" Then GraphicsWindow.FillEllipse (col5, row5, circlesize, circlesize) col5row5 = brushcolor ElseIf col5row4= "0" Then GraphicsWindow.FillEllipse (col5, row4, circlesize, circlesize) col5row4 = brushcolor ElseIf col5row3= "0" Then GraphicsWindow.FillEllipse (col5, row3, circlesize, circlesize) col5row3 = brushcolor ElseIf col5row2= "0" Then GraphicsWindow.FillEllipse (col5, row2, circlesize, circlesize) col5row2 = brushcolor ElseIf col5row1= "0" Then GraphicsWindow.FillEllipse (col5, row1, circlesize, circlesize) col5row1 = brushcolor ElseIf col5row1= "r" Or "b" Then Goto End EndIf EndIf If (x > 255 And x < 295 And y > 0 And y < 300) Then If col6row6 = "0" Then GraphicsWindow.FillEllipse (col6, row6, circlesize, circlesize) col6row6 = brushcolor ElseIf col6row5= "0" Then GraphicsWindow.FillEllipse (col6, row5, circlesize, circlesize) col6row5 = brushcolor ElseIf col6row4= "0" Then GraphicsWindow.FillEllipse (col6, row4, circlesize, circlesize) col6row4 = brushcolor ElseIf col6row3= "0" Then GraphicsWindow.FillEllipse (col6, row3, circlesize, circlesize) col6row3 = brushcolor ElseIf col6row2= "0" Then GraphicsWindow.FillEllipse (col6, row2, circlesize, circlesize) col6row2 = brushcolor ElseIf col6row1= "0" Then GraphicsWindow.FillEllipse (col6, row1, circlesize, circlesize) col6row1 = brushcolor ElseIf col6row1= "r" Or "b" Then Goto End EndIf EndIf If (x > 305 And x < 345 And y > 0 And y < 300) Then If col7row6 = "0" Then GraphicsWindow.FillEllipse (col7, row6, circlesize, circlesize) col7row6 = brushcolor ElseIf col7row5= "0" Then GraphicsWindow.FillEllipse (col7, row5, circlesize, circlesize) col7row5 = brushcolor ElseIf col7row4= "0" Then GraphicsWindow.FillEllipse (col7, row4, circlesize, circlesize) col7row4 = brushcolor ElseIf col7row3= "0" Then GraphicsWindow.FillEllipse (col7, row3, circlesize, circlesize) col7row3 = brushcolor ElseIf col7row2= "0" Then GraphicsWindow.FillEllipse (col7, row2, circlesize, circlesize) col7row2 = brushcolor ElseIf col7row1= "0" Then GraphicsWindow.FillEllipse (col7, row1, circlesize, circlesize) col7row1 = brushcolor ElseIf col7row1= "r" Or "b" Then Goto End EndIf EndIf If (x > 5 And x < 45 Or x > 55 And x < 95 Or x > 105 And x < 145 Or x > 155 And x < 195 Or x > 205 And x < 245 Or x > 255 And x < 295 Or x > 305 And x < 345) Then Brush() EndIf Check() End: EndSub Sub Brush If brushcolor = "b" Then GraphicsWindow.BrushColor = "Red" brushcolor = "r" ElseIf brushcolor = "r" Then GraphicsWindow.BrushColor = "Blue" brushcolor = "b" EndIf EndSub Sub Check If col1row6 = "b" And col2row6 = "b" And col3row6 = "b" And col4row6 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col1row6 = "r" And col2row6 = "r" And col3row6 = "r" And col4row6 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col2row6 = "b" And col3row6 = "b" And col4row6 = "b" And col5row6 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col2row6 = "r" And col3row6 = "r" And col4row6 = "r" And col5row6 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col3row6 = "b" And col4row6 = "b" And col5row6 = "b" And col6row6 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col3row6 = "r" And col4row6 = "r" And col5row6 = "r" And col6row6 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col4row6 = "b" And col5row6 = "b" And col6row6 = "b" And col7row6 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col4row6 = "r" And col5row6 = "r" And col6row6 = "r" And col7row6 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col1row5 = "b" And col2row5 = "b" And col3row5 = "b" And col4row5 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col1row5 = "r" And col2row5 = "r" And col3row5 = "r" And col4row5 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col2row5 = "b" And col3row5 = "b" And col4row5 = "b" And col5row5 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col2row5 = "r" And col3row5 = "r" And col4row5 = "r" And col5row5 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col3row5 = "b" And col4row5 = "b" And col5row5 = "b" And col6row5 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col3row5 = "r" And col4row5 = "r" And col5row5 = "r" And col6row5 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") EndIf If col4row5 = "b" And col5row5 = "b" And col6row5 = "b" And col7row5 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col4row5 = "r" And col5row5 = "r" And col6row5 = "r" And col7row5 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col1row4 = "b" And col2row4 = "b" And col3row4 = "b" And col4row4 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col1row4 = "r" And col2row4 = "r" And col3row4 = "r" And col4row4 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col2row4 = "b" And col3row4 = "b" And col4row4 = "b" And col5row4 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col2row4 = "r" And col3row4 = "r" And col4row4 = "r" And col5row4 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col3row4 = "b" And col4row4 = "b" And col5row4 = "b" And col6row4 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col3row4 = "r" And col4row4 = "r" And col5row4 = "r" And col6row4 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col4row4 = "b" And col5row4 = "b" And col6row4 = "b" And col7row4 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col4row4 = "r" And col5row4 = "r" And col6row4 = "r" And col7row4 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col1row3 = "b" And col2row3 = "b" And col3row3 = "b" And col4row3 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col1row3 = "r" And col2row3 = "r" And col3row3 = "r" And col4row3 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col2row3 = "b" And col3row3 = "b" And col4row3 = "b" And col5row3 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col2row3 = "r" And col3row3 = "r" And col4row3 = "r" And col5row3 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col3row3 = "b" And col4row3 = "b" And col5row3 = "b" And col6row3 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col3row3 = "r" And col4row3 = "r" And col5row3 = "r" And col6row3 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col4row3 = "b" And col5row3 = "b" And col6row3 = "b" And col7row3 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col4row3 = "r" And col5row3 = "r" And col6row3 = "r" And col7row3 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col1row2 = "b" And col2row2 = "b" And col3row2 = "b" And col4row2 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col1row2 = "r" And col2row2 = "r" And col3row2 = "r" And col4row2 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col2row2 = "b" And col3row2 = "b" And col4row2 = "b" And col5row2 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col2row2 = "r" And col3row2 = "r" And col4row2 = "r" And col5row2 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col3row2 = "b" And col4row2 = "b" And col5row2 = "b" And col6row2 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col3row2 = "r" And col4row2 = "r" And col5row2 = "r" And col6row2 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col4row2 = "b" And col5row2 = "b" And col6row2 = "b" And col7row2 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col4row2 = "r" And col5row2 = "r" And col6row2 = "r" And col7row2 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col1row1 = "b" And col2row1 = "b" And col3row1 = "b" And col4row1 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col1row1 = "r" And col2row1 = "r" And col3row1 = "r" And col4row1 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col2row1 = "b" And col3row1 = "b" And col4row1 = "b" And col5row1 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col2row1 = "r" And col3row1 = "r" And col4row1 = "r" And col5row1 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col3row1 = "b" And col4row1 = "b" And col5row1 = "b" And col6row1 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col3row1 = "r" And col4row1 = "r" And col5row1 = "r" And col6row1 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col4row1 = "b" And col5row1 = "b" And col6row1 = "b" And col7row1 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col4row1 = "r" And col5row1 = "r" And col6row1 = "r" And col7row1 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col1row6 = "b" And col2row5 = "b" And col3row4 = "b" And col4row3 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col1row6 = "r" And col2row5 = "r" And col3row4 = "r" And col4row3 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col2row6 = "b" And col3row5 = "b" And col4row4 = "b" And col5row3 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col2row6 = "r" And col3row5 = "r" And col4row4 = "r" And col5row3 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col3row6 = "b" And col4row5 = "b" And col5row4 = "b" And col6row3 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col3row6 = "r" And col4row5 = "r" And col5row4 = "r" And col6row3 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col4row6 = "b" And col5row5 = "b" And col6row4 = "b" And col7row3 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col4row6 = "r" And col5row5 = "r" And col6row4 = "r" And col7row3 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col1row5 = "b" And col2row4 = "b" And col3row3 = "b" And col4row2 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col1row5 = "r" And col2row4 = "r" And col3row3 = "r" And col4row2 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col2row5 = "b" And col3row4 = "b" And col4row3 = "b" And col5row2 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col2row5 = "r" And col3row4 = "r" And col4row3 = "r" And col5row2 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col3row5 = "b" And col4row4 = "b" And col5row3 = "b" And col6row2 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col3row5 = "r" And col4row4 = "r" And col5row3 = "r" And col6row2 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col4row5 = "b" And col5row4 = "b" And col6row3 = "b" And col7row2 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col4row5 = "r" And col5row4 = "r" And col6row3 = "r" And col7row2 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col1row4 = "b" And col2row3 = "b" And col3row2 = "b" And col4row1 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col1row4 = "r" And col2row3 = "r" And col3row2 = "r" And col4row1 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col2row4 = "b" And col3row3 = "b" And col4row2 = "b" And col5row1 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col2row4 = "r" And col3row3 = "r" And col4row2 = "r" And col5row1 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col3row4 = "b" And col4row3 = "b" And col5row2 = "b" And col6row1 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col3row4 = "r" And col4row3 = "r" And col5row2 = "r" And col6row1 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col4row4 = "b" And col5row3 = "b" And col6row2 = "b" And col7row1 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col4row4 = "r" And col5row3 = "r" And col6row2 = "r" And col7row1 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col1row3 = "b" And col2row4 = "b" And col3row5 = "b" And col4row6 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col1row3 = "r" And col2row4 = "r" And col3row5 = "r" And col4row6 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col2row3 = "b" And col3row4 = "b" And col4row5 = "b" And col5row6 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col2row3 = "r" And col3row4 = "r" And col4row5 = "r" And col5row6 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") EndIf If col3row3 = "b" And col4row4 = "b" And col5row5 = "b" And col6row6 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col3row3 = "r" And col4row4 = "r" And col5row5 = "r" And col6row6 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col4row3 = "b" And col5row4 = "b" And col6row5 = "b" And col7row6 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col4row3 = "r" And col5row4 = "r" And col6row5 = "r" And col7row6 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col1row2 = "b" And col2row3 = "b" And col3row4 = "b" And col4row5 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col1row2 = "r" And col2row3 = "r" And col3row4 = "r" And col4row5 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col2row2 = "b" And col3row3 = "b" And col4row4 = "b" And col5row5 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col2row2 = "r" And col3row3 = "r" And col4row4 = "r" And col5row5 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col3row2 = "b" And col4row3 = "b" And col5row4 = "b" And col6row5 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col3row2 = "r" And col4row3 = "r" And col5row4 = "r" And col6row5 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col4row2 = "b" And col5row3 = "b" And col6row4 = "b" And col7row5 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col4row2 = "r" And col5row3 = "r" And col6row4 = "r" And col7row5 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col1row1 = "b" And col2row2 = "b" And col3row3 = "b" And col4row4 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col1row1 = "r" And col2row2 = "r" And col3row3 = "r" And col4row4 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col2row1 = "b" And col3row2 = "b" And col4row3 = "b" And col5row4 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col2row1 = "r" And col3row2 = "r" And col4row3 = "r" And col5row4 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col3row1 = "b" And col4row2 = "b" And col5row3 = "b" And col6row4 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col3row1 = "r" And col4row2 = "r" And col5row3 = "r" And col6row4 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col4row1 = "b" And col5row2 = "b" And col6row3 = "b" And col7row4 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col4row1 = "r" And col5row2 = "r" And col6row3 = "r" And col7row4 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col1row1 = "b" And col1row2 = "b" And col1row3 = "b" And col1row4 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col1row1 = "r" And col1row2 = "r" And col1row3 = "r" And col1row4 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col1row2 = "b" And col1row3 = "b" And col1row4 = "b" And col1row5 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col1row2 = "r" And col1row3 = "r" And col1row4 = "r" And col1row5 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col1row3 = "b" And col1row4 = "b" And col1row5 = "b" And col1row6 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col1row3 = "r" And col1row4 = "r" And col1row5 = "r" And col1row6 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col2row1 = "b" And col2row2 = "b" And col2row3 = "b" And col2row4 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col2row1 = "r" And col2row2 = "r" And col2row3 = "r" And col2row4 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col2row2 = "b" And col2row3 = "b" And col2row4 = "b" And col2row5 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col2row2 = "r" And col2row3 = "r" And col2row4 = "r" And col2row5 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col2row3 = "b" And col2row4 = "b" And col2row5 = "b" And col2row6 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col2row3 = "r" And col2row4 = "r" And col2row5 = "r" And col2row6 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col3row1 = "b" And col3row2 = "b" And col3row3 = "b" And col3row4 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col3row1 = "r" And col3row2 = "r" And col3row3 = "r" And col3row4 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col3row2 = "b" And col3row3 = "b" And col3row4 = "b" And col3row5 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col3row2 = "r" And col3row3 = "r" And col3row4 = "r" And col3row5 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col3row3 = "b" And col3row4 = "b" And col3row5 = "b" And col3row6 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col3row3 = "r" And col3row4 = "r" And col3row5 = "r" And col3row6 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col4row1 = "b" And col4row2 = "b" And col4row3 = "b" And col4row4 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col4row1 = "r" And col4row2 = "r" And col4row3 = "r" And col4row4 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col4row2 = "b" And col4row3 = "b" And col4row4 = "b" And col4row5 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col4row2 = "r" And col4row3 = "r" And col4row4 = "r" And col4row5 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col4row3 = "b" And col4row4 = "b" And col4row5 = "b" And col4row6 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col4row3 = "r" And col4row4 = "r" And col4row5 = "r" And col4row6 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col5row1 = "b" And col5row2 = "b" And col5row3 = "b" And col5row4 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col5row1 = "r" And col5row2 = "r" And col5row3 = "r" And col5row4 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col5row2 = "b" And col5row3 = "b" And col5row4 = "b" And col5row5 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col5row2 = "r" And col5row3 = "r" And col5row4 = "r" And col5row5 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col5row3 = "b" And col5row4 = "b" And col5row5 = "b" And col5row6 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col5row3 = "r" And col5row4 = "r" And col5row5 = "r" And col5row6 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col6row1 = "b" And col6row2 = "b" And col6row3 = "b" And col6row4 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col6row1 = "r" And col6row2 = "r" And col6row3 = "r" And col6row4 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col6row2 = "b" And col6row3 = "b" And col6row4 = "b" And col6row5 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col6row2 = "r" And col6row3 = "r" And col6row4 = "r" And col6row5 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col6row3 = "b" And col6row4 = "b" And col6row5 = "b" And col6row6 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col6row3 = "r" And col6row4 = "r" And col6row5 = "r" And col6row6 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col7row1 = "b" And col7row2 = "b" And col7row3 = "b" And col7row4 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col7row1 = "r" And col7row2 = "r" And col7row3 = "r" And col7row4 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col7row2 = "b" And col7row3 = "b" And col7row4 = "b" And col7row5 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col7row2 = "r" And col7row3 = "r" And col7row4 = "r" And col7row5 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf If col7row3 = "b" And col7row4 = "b" And col7row5 = "b" And col7row6 = "b" Then GraphicsWindow.ShowMessage ("Blue Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver ElseIf col7row3 = "r" And col7row4 = "r" And col7row5 = "r" And col7row6 = "r" Then GraphicsWindow.ShowMessage ("Red Player Wins!" "Congratulations!") gamestatus = 1 Goto GameOver EndIf GameOver: If gamestatus = 1 Then Init() Circles() col1row1 = 0 col2row1 = 0 col3row1 = 0 col4row1 = 0 col5row1 = 0 col6row1 = 0 col7row1 = 0 col1row2 = 0 col2row2 = 0 col3row2 = 0 col4row2 = 0 col5row2 = 0 col6row2 = 0 col7row2 = 0 col1row3 = 0 col2row3 = 0 col3row3 = 0 col4row3 = 0 col5row3 = 0 col6row3 = 0 col7row3 = 0 col1row4 = 0 col2row4 = 0 col3row4 = 0 col4row4 = 0 col5row4 = 0 col6row4 = 0 col7row4 = 0 col1row5 = 0 col2row5 = 0 col3row5 = 0 col4row5 = 0 col5row5 = 0 col6row5 = 0 col7row5 = 0 col1row6 = 0 col2row6 = 0 col3row6 = 0 col4row6 = 0 col5row6 = 0 col6row6 = 0 col7row6 = 0 brushcolor = "b" GraphicsWindow.BrushColor = "Blue" gamestatus = 0 EndIf EndSub End>GMH995.sb< Start>GMK276.sb< dnr[1]["co"] = "CHARLOTTE - DUKE ENERGY" dnr[2]["co"] = "CHARLOTTE - LOWE’S" dnr[3]["co"] = "CHARLOTTE - TIAA-CREF" dnr[4]["co"] = "CHARLOTTE - TRAVELPORT" dnr[5]["co"] = "DALLAS - LEXMARK" dnr[6]["co"] = "DENVER - CATHOLIC HEALTH INITIATIVES" dnr[7]["co"] = "DENVER - GOGO OR AIRCELL" dnr[8]["co"] = "DENVER - JANUS" dnr[9]["co"] = "DENVER - OTTERBOX" dnr[10]["co"] = "DENVER - TRI-STATE" dnr[11]["co"] = "DENVER - TW TELECOM" dnr[12]["co"] = "DETROIT - BCBS-MI" dnr[13]["co"] = "DETROIT - CARHARTT" dnr[14]["co"] = "DETROIT - CHRYSLER" dnr[15]["co"] = "DETROIT - COMERICA" dnr[16]["co"] = "DETROIT - DTE" dnr[17]["co"] = "DETROIT - FORDDIRECT" dnr[18]["co"] = "DETROIT - VOLKSWAGON" dnr[19]["co"] = "HEALTHCARE - ATLANTICARE HEALTH SYSTEM, ATLANTICARE " dnr[20]["co"] = "HEALTHCARE - BLUE CROSS BLUE SHIELD OF KC,BCBSKC " dnr[21]["co"] = "HEALTHCARE - BLUE CROSS BLUE SHIELD OF MASSACHUSETTS, BCBSMA " dnr[22]["co"] = "HEALTHCARE - CAROLINAS HEALTHCARE SYSTEMS, CAROLINAS " dnr[23]["co"] = "HEALTHCARE - GROUP HEALTH COOPERATIVE OF SOUTH CENTRAL WISCONSIN (GHC),GHC " dnr[24]["co"] = "HEALTHCARE - IOWA HEALTH SYSTEM, IHS " dnr[25]["co"] = "HEALTHCARE - MISSION HEALTH SYSTEM, MISSION HEALTH " dnr[26]["co"] = "HEALTHCARE - NASCO, ATLANTA" dnr[27]["co"] = "HEALTHCARE - NORTH SHORE LONG ISLAND JEWISH, NSLIJ " dnr[28]["co"] = "HEALTHCARE - NYU HOSPITALS CENTER, NYU " dnr[29]["co"] = "HEALTHCARE - PREMIER, PREMIER – CHARLOTTE, NC" dnr[30]["co"] = "HEALTHCARE - TEXAS HEALTH RESOURCES" dnr[31]["co"] = "HOUSTON/NOLA - HALIBURTON" dnr[32]["co"] = "HOUSTON/NOLA - SHELL" dnr[33]["co"] = "HOUSTON/NOLA - WASTE MANAGEMENT" dnr[34]["co"] = "IBM ATS - AAA NORTHERN CALIFORNIA" dnr[35]["co"] = "IBM ATS - ACCOMMODATIONS PLUS INTL" dnr[36]["co"] = "IBM ATS - ADESA CORPORATION" dnr[37]["co"] = "IBM ATS - ADVANCE AUTO BUSINESS SUPPORT, LLC" dnr[38]["co"] = "IBM ATS - AFFINIA" dnr[39]["co"] = "IBM ATS - AFNI" dnr[40]["co"] = "IBM ATS - ALLSTATE INSURANCE COMPANY" dnr[41]["co"] = "IBM ATS - AMERICAN AIRLINES" dnr[42]["co"] = "IBM ATS - ANDERSEN CORPORATION" dnr[43]["co"] = "IBM ATS - AVIVA USA CORPORATION" dnr[44]["co"] = "IBM ATS - BARE ESCENTUALS INC" dnr[45]["co"] = "IBM ATS - BEST BUY" dnr[46]["co"] = "IBM ATS - BLUE CROSS BLUE SHIELD OF FL" dnr[47]["co"] = "IBM ATS - BLUE CROSS BLUE SHIELD OF MASSACHUSETTS" dnr[48]["co"] = "IBM ATS - BLUE CROSS BLUE SHIELD OF MICHIGAN" dnr[49]["co"] = "IBM ATS - BLUE CROSS BLUE SHIELD OF SC" dnr[50]["co"] = "IBM ATS - BLUE SHIELD OF CA" dnr[51]["co"] = "IBM ATS - BOB EVANS FARMS INC." dnr[52]["co"] = "IBM ATS - BORDER STATES INDUSTRIES INC." dnr[53]["co"] = "IBM ATS - BUNGE LIMITED" dnr[54]["co"] = "IBM ATS - BUSINESS TECHNOLOGY CAREER OPPORTUNITIES INC" dnr[55]["co"] = "IBM ATS - CARDINAL HEALTH" dnr[56]["co"] = "IBM ATS - CAREFX CORPORATION" dnr[57]["co"] = "IBM ATS - CARHARTT, INC." dnr[58]["co"] = "IBM ATS - CAROLINAS HEALTHCARE SYSTEMS" dnr[59]["co"] = "IBM ATS - CATERPILLAR, INC." dnr[60]["co"] = "IBM ATS - CITENT, INC." dnr[61]["co"] = "IBM ATS - CLASS TRAINERS, LLC" dnr[62]["co"] = "IBM ATS - CLASSIFIED VENTURES, LLC" dnr[63]["co"] = "IBM ATS - CLEAR CHANNEL COMMUNICATIONS, INC." dnr[64]["co"] = "IBM ATS - CVS CAREMARK" dnr[65]["co"] = "IBM ATS - DIGI-KEY CORPORATION" dnr[66]["co"] = "IBM ATS - DTE ENERGY COMPANY" dnr[67]["co"] = "IBM ATS - ECOLAB INC." dnr[68]["co"] = "IBM ATS - EXPRESS SCRIPTS INC" dnr[69]["co"] = "IBM ATS - FIRST DATA CORPORATION" dnr[70]["co"] = "IBM ATS - FIRST SOLAR, INC." dnr[71]["co"] = "IBM ATS - FLUOR CORPORATION" dnr[72]["co"] = "IBM ATS - FORDDIRECT" dnr[73]["co"] = "IBM ATS - FOSSIL INC." dnr[74]["co"] = "IBM ATS - FOUR INC." dnr[75]["co"] = "IBM ATS - FRANKLIN TEMPLETON INVESTMENTS" dnr[76]["co"] = "IBM ATS - GREAT WEST CASUALTY COMPANY" dnr[77]["co"] = "IBM ATS - GUTHY-RENKER CORP." dnr[78]["co"] = "IBM ATS - HEALTH CARE SERVICE CORPORATION (HCSC)" dnr[79]["co"] = "IBM ATS - HEALTHNOW, INC." dnr[80]["co"] = "IBM ATS - HUMANA INC." dnr[81]["co"] = "IBM ATS - IBM CORPORATION" dnr[82]["co"] = "IBM ATS - IBM GLOBAL SERVICES" dnr[83]["co"] = "IBM ATS - IBM ISSD" dnr[84]["co"] = "IBM ATS - IBM ISSL" dnr[85]["co"] = "IBM ATS - IBM ISSW" dnr[86]["co"] = "IBM ATS - ITES-IBM" dnr[87]["co"] = "IBM ATS - ITS, INC." dnr[88]["co"] = "IBM ATS - JACK MORTON WORLDWIDE INC." dnr[89]["co"] = "IBM ATS - KAISER PERMANENTE" dnr[90]["co"] = "IBM ATS - KIRKLANDS INC." dnr[91]["co"] = "IBM ATS - LEGAL SHIELD" dnr[92]["co"] = "IBM ATS - LEXMARK INTERNATIONAL" dnr[93]["co"] = "IBM ATS - LOWES" dnr[94]["co"] = "IBM ATS - LUCILE PACKARD CHILDRENS HOSPITAL" dnr[95]["co"] = "IBM ATS - M.Y.PILGRIMS" dnr[96]["co"] = "IBM ATS - MERIDIAN IT" dnr[97]["co"] = "IBM ATS - MISSION HEALTH SYSTEM" dnr[98]["co"] = "IBM ATS - MONSANTO COMPANY" dnr[99]["co"] = "IBM ATS - MTD PRODUCTS" dnr[100]["co"] = "IBM ATS - MUTUAL OF OMAHA INSURANCE CO." dnr[101]["co"] = "IBM ATS - NEIMAN MARCUS, INC." dnr[102]["co"] = "IBM ATS - NETJETS INC." dnr[103]["co"] = "IBM ATS - NVIDIA CORPORATION" dnr[104]["co"] = "IBM ATS - OPEN DEALER EXCHANGE, LLC" dnr[105]["co"] = "IBM ATS - PHYSICIANS MUTUAL INSURANCE COMPANY" dnr[106]["co"] = "IBM ATS - PREMIER" dnr[107]["co"] = "IBM ATS - PRINCIPAL LIFE INSURANCE COMPANY" dnr[108]["co"] = "IBM ATS - SIGMA-ALDRICH CORPORATION" dnr[109]["co"] = "IBM ATS - SPLUNK INC." dnr[110]["co"] = "IBM ATS - STATE OF LOUISIANA DEPT. OF SOCIAL SERVICES" dnr[111]["co"] = "IBM ATS - STIFEL FINANCIAL" dnr[112]["co"] = "IBM ATS - TARGET CORPORATION" dnr[113]["co"] = "IBM ATS - TECHNOTRAINING, INC." dnr[114]["co"] = "IBM ATS - THE MENS WEARHOUSE" dnr[115]["co"] = "IBM ATS - TRIHEALTH INC." dnr[116]["co"] = "IBM ATS - TRUSTMARK NATIONAL BANK" dnr[117]["co"] = "IBM ATS - UNION BANK" dnr[118]["co"] = "IBM ATS - UNITED GUARANTY CORPORATION" dnr[119]["co"] = "IBM ATS - VERMEER MANUFACTURING COMPANY" dnr[120]["co"] = "IBM ATS - VERMONT STUDENT ASSISTANCE CORP." dnr[121]["co"] = "IBM ATS - VRATSINAS CONSTRUCTION COMPANY" dnr[122]["co"] = "IBM ATS - WALMART.COM USA, LLC" dnr[123]["co"] = "IBM ATS - WEST CORPORATION" dnr[124]["co"] = "IBM ATS - WESTERN UNION" dnr[125]["co"] = "IBM ATS - WESTFIELD LLC" dnr[126]["co"] = "IBM ATS - WHEATON VAN LINES, INC." dnr[127]["co"] = "IBM BA - CHICKASAW NATION" dnr[128]["co"] = "IBM BA - COVIDIEN" dnr[129]["co"] = "IBM BA - DEL MONTE" dnr[130]["co"] = "IBM BA - GENENTECH" dnr[131]["co"] = "IBM BA - MDC HOLDING" dnr[132]["co"] = "IBM BA - NORTHWESTERN MEDICAL FACULTY FOUNDATION" dnr[133]["co"] = "IBM BA - NORTHWESTERN MEMORIAL HEALTHCARE" dnr[134]["co"] = "IBM BA - SDGE/SEMPRA" dnr[135]["co"] = "IBM BA - STRYKER" dnr[136]["co"] = "IBM BA - THE ENTERPRISE ACCOUNT/STRATEGIC ACCOUNT LIST PLUS THE FOLLOWING:" dnr[137]["co"] = "IBM BPMS - BCBS-MA" dnr[138]["co"] = "IBM BPMS - CARTERS" dnr[139]["co"] = "IBM BPMS - IBM OR IBM LAB SERVICES ALSO KNOWN AS IBM SOFTWARE SERVICES FOR WEBSPHERE (ISSW)" dnr[140]["co"] = "IBM BPMS - MEDIMPACT" dnr[141]["co"] = "IBM BPMS - PREMIER" dnr[142]["co"] = "IBM BPMS - TARGET" dnr[143]["co"] = "IBM BPMS - TBC" dnr[144]["co"] = "IBM BPMS - TEXAS HEALTH RESOURCES " dnr[145]["co"] = "IBM COMMERCE - CARDINAL" dnr[146]["co"] = "IBM COMMERCE - CARHARTT" dnr[147]["co"] = "IBM COMMERCE - CATERPILLAR" dnr[148]["co"] = "IBM COMMERCE - ECOLAB" dnr[149]["co"] = "IBM COMMERCE - FOSSIL" dnr[150]["co"] = "IBM COMMERCE - GRAYBAR ELECTRIC" dnr[151]["co"] = "IBM COMMERCE - IBM (INCLUDING LAB SERVICES)" dnr[152]["co"] = "IBM COMMERCE - MTD" dnr[153]["co"] = "IBM COMMERCE - PREMIER" dnr[154]["co"] = "IBM COMMERCE - ROCHE" dnr[155]["co"] = "IBM COMMERCE - SCHEELS" dnr[156]["co"] = "IBM COMMERCE - THE MENS WEARHOUSE" dnr[157]["co"] = "IBM INDUSTRY SOLUTIONS - CARTERS" dnr[158]["co"] = "IBM INDUSTRY SOLUTIONS - EMPTORIS" dnr[159]["co"] = "IBM INDUSTRY SOLUTIONS - FOLLETT" dnr[160]["co"] = "IBM INDUSTRY SOLUTIONS - IBM" dnr[161]["co"] = "IBM INDUSTRY SOLUTIONS - STERLING COMMERCE" dnr[162]["co"] = "IBM INDUSTRY SOLUTIONS - URBAN OUTFITTERS" dnr[163]["co"] = "INDIANAPOLIS - ADESA / AFC / KAR" dnr[164]["co"] = "INDIANAPOLIS - HEALTH AND HOSPITAL CORPORATION OF MARION COUNTY / WISHARD HEALTH SERVICES" dnr[165]["co"] = "INDIANAPOLIS - HUMANA" dnr[166]["co"] = "INDIANAPOLIS - ROCHE" dnr[167]["co"] = "INDIANAPOLIS - WHEATON WORLD WIDE MOVING / WHEATON VAN LINES" dnr[168]["co"] = "MINNEAPOLIS - BEST BUY " dnr[169]["co"] = "MINNEAPOLIS - ECOLAB" dnr[170]["co"] = "MINNEAPOLIS - EXPRESS SCRIPTS" dnr[171]["co"] = "MINNEAPOLIS - LIFE TIME FITNESS" dnr[172]["co"] = "MINNEAPOLIS - MEDTRONIC" dnr[173]["co"] = "MINNEAPOLIS - ST. JUDE" dnr[174]["co"] = "MINNEAPOLIS - TARGET" dnr[175]["co"] = "MINNEAPOLIS - THOMSON REUTERS" dnr[176]["co"] = "MINNEAPOLIS - WELLS FARGO" dnr[177]["co"] = "OHIO - ABERCROMBIE & FITCH" dnr[178]["co"] = "OHIO - AMERITAS" dnr[179]["co"] = "OHIO - BOB EVANS" dnr[180]["co"] = "OHIO - CARDINAL HEALTH" dnr[181]["co"] = "OHIO - CATERPILLAR" dnr[182]["co"] = "OHIO - ETHICON / JOHNSON & JOHNSON" dnr[183]["co"] = "OHIO - HIGHMARK" dnr[184]["co"] = "OHIO - JPMORGAN CHASE" dnr[185]["co"] = "OHIO - KNOWLEDGE WORKS" dnr[186]["co"] = "OHIO - LUXOTTICA" dnr[187]["co"] = "OHIO - MTD PRODUCTS" dnr[188]["co"] = "OHIO - NETJETS" dnr[189]["co"] = "OHIO - NEWPAGE" dnr[190]["co"] = "OHIO - STATE AUTO INSURANCE COMPANIES" dnr[191]["co"] = "OHIO - TRIHEALTH" dnr[192]["co"] = "OHIO - VANTIV" dnr[193]["co"] = "OHIO - YUM! BRANDS" dnr[194]["co"] = "ORACLE CRM - 20TH CENTURY FOX" dnr[195]["co"] = "ORACLE CRM - ADVANCED MICRO DEVICES (AMD)" dnr[196]["co"] = "ORACLE CRM - AEM ELECTRONICS" dnr[197]["co"] = "ORACLE CRM - AEROCOMPUTERS" dnr[198]["co"] = "ORACLE CRM - AGILENT TECHNOLOGIES, INC." dnr[199]["co"] = "ORACLE CRM - ALTERA CORPORATION" dnr[200]["co"] = "ORACLE CRM - AMERICAN ACADEMY OF DERMATOLOGY" dnr[201]["co"] = "ORACLE CRM - AMERICAN TIRE DISTRIBUTORS" dnr[202]["co"] = "ORACLE CRM - ANNA'S LINENS" dnr[203]["co"] = "ORACLE CRM - ANSYS" dnr[204]["co"] = "ORACLE CRM - ARIBA" dnr[205]["co"] = "ORACLE CRM - BAYER CONSUMER CARE" dnr[206]["co"] = "ORACLE CRM - BEACHBODY" dnr[207]["co"] = "ORACLE CRM - BIOGEN IDEC" dnr[208]["co"] = "ORACLE CRM - BLUE SKIES LLC" dnr[209]["co"] = "ORACLE CRM - BROADCOM CORPORATION" dnr[210]["co"] = "ORACLE CRM - BUFFALO WILD WINGS" dnr[211]["co"] = "ORACLE CRM - CAMPING WORLD INC" dnr[212]["co"] = "ORACLE CRM - CHURCH & DWIGHT" dnr[213]["co"] = "ORACLE CRM - CISCO SYSTEMS" dnr[214]["co"] = "ORACLE CRM - CITY OF NEWPORT NEWS" dnr[215]["co"] = "ORACLE CRM - CITY OF OTTAWA, CANADA" dnr[216]["co"] = "ORACLE CRM - CITY OF RIVERSIDE" dnr[217]["co"] = "ORACLE CRM - CLEAREDGE POWER" dnr[218]["co"] = "ORACLE CRM - CUMMINS, INC." dnr[219]["co"] = "ORACLE CRM - CYDCOR" dnr[220]["co"] = "ORACLE CRM - CYPRESS SEMICONDUCTOR" dnr[221]["co"] = "ORACLE CRM - DISNEY (WALT)" dnr[222]["co"] = "ORACLE CRM - DROP IN INC" dnr[223]["co"] = "ORACLE CRM - ELAVON" dnr[224]["co"] = "ORACLE CRM - ELEKTA" dnr[225]["co"] = "ORACLE CRM - EMERSON POWER" dnr[226]["co"] = "ORACLE CRM - ETHERTRONICS" dnr[227]["co"] = "ORACLE CRM - EXAR CORPORATION" dnr[228]["co"] = "ORACLE CRM - EXECUTIVE INFORMATION SYSTEMS" dnr[229]["co"] = "ORACLE CRM - EXELIXIS" dnr[230]["co"] = "ORACLE CRM - F5 NETWORKS" dnr[231]["co"] = "ORACLE CRM - FLAT IRON CONSTRUCTION" dnr[232]["co"] = "ORACLE CRM - FOSTERS" dnr[233]["co"] = "ORACLE CRM - GEMILOGICAL INSTITUE OF AMERICA" dnr[234]["co"] = "ORACLE CRM - GENENTECH" dnr[235]["co"] = "ORACLE CRM - GENERAL ATOMICS - ASI" dnr[236]["co"] = "ORACLE CRM - GENZYME CORPORATION" dnr[237]["co"] = "ORACLE CRM - GEOMETRIC" dnr[238]["co"] = "ORACLE CRM - GILEAD SCIENCE, INC." dnr[239]["co"] = "ORACLE CRM - HERSHEY" dnr[240]["co"] = "ORACLE CRM - HITACHI DATA SYSTEMS" dnr[241]["co"] = "ORACLE CRM - IBASIS" dnr[242]["co"] = "ORACLE CRM - IEEE" dnr[243]["co"] = "ORACLE CRM - IHS INC." dnr[244]["co"] = "ORACLE CRM - INDUSTRIAL SCIENCE" dnr[245]["co"] = "ORACLE CRM - INVENSYS" dnr[246]["co"] = "ORACLE CRM - IVERA MEDICAL CORPORATION" dnr[247]["co"] = "ORACLE CRM - JUPITER CONSOLIDATED GROUP" dnr[248]["co"] = "ORACLE CRM - KANSAS DEPARTMENT OF LABOR" dnr[249]["co"] = "ORACLE CRM - KENDLE" dnr[250]["co"] = "ORACLE CRM - KOMORI" dnr[251]["co"] = "ORACLE CRM - LEAPFROG" dnr[252]["co"] = "ORACLE CRM - LEDCOR INDUSTRIES" dnr[253]["co"] = "ORACLE CRM - LIFE TECHNOLOGIES CORPORATION" dnr[254]["co"] = "ORACLE CRM - LSI CORPORATION" dnr[255]["co"] = "ORACLE CRM - MAZDA USA NORTH AMERICAN OPERATIONS" dnr[256]["co"] = "ORACLE CRM - MDC HOLDINGS" dnr[257]["co"] = "ORACLE CRM - MONTANA DEPARTMENT OF COMMERCE" dnr[258]["co"] = "ORACLE CRM - MOVE.COM" dnr[259]["co"] = "ORACLE CRM - NAU COUNTRY INSURANCE COMPANY" dnr[260]["co"] = "ORACLE CRM - NESTLE USA" dnr[261]["co"] = "ORACLE CRM - NTC TEXAS" dnr[262]["co"] = "ORACLE CRM - ON SEMICONDUCTOR" dnr[263]["co"] = "ORACLE CRM - OUTCOME SCIENCES - QUINTILES" dnr[264]["co"] = "ORACLE CRM - PARKER HANNIFIN" dnr[265]["co"] = "ORACLE CRM - PERSONA INC" dnr[266]["co"] = "ORACLE CRM - PHARMAVITE" dnr[267]["co"] = "ORACLE CRM - POLYCOM" dnr[268]["co"] = "ORACLE CRM - PORTEOUS FASTENER" dnr[269]["co"] = "ORACLE CRM - PRINTRONIX" dnr[270]["co"] = "ORACLE CRM - SAGE PUBLICATIONS" dnr[271]["co"] = "ORACLE CRM - SARAH CANNON RESEARCH INSTITUTE" dnr[272]["co"] = "ORACLE CRM - SCHNITZER STEEL" dnr[273]["co"] = "ORACLE CRM - SDI MEDIA" dnr[274]["co"] = "ORACLE CRM - SELECTIVA" dnr[275]["co"] = "ORACLE CRM - SEPHORA" dnr[276]["co"] = "ORACLE CRM - SM ENERGY COMPANY" dnr[277]["co"] = "ORACLE CRM - SMUCKERS (JM)" dnr[278]["co"] = "ORACLE CRM - SOLIDWORKS" dnr[279]["co"] = "ORACLE CRM - SPACELABS MEDICAL" dnr[280]["co"] = "ORACLE CRM - SPARTECH CORPORATION" dnr[281]["co"] = "ORACLE CRM - SPRINT COMMUNICATIONS" dnr[282]["co"] = "ORACLE CRM - STANDARD AERO" dnr[283]["co"] = "ORACLE CRM - STATE OF FLORIDA" dnr[284]["co"] = "ORACLE CRM - STATE OF KANSAS SRS" dnr[285]["co"] = "ORACLE CRM - STATE OF MISSOURI" dnr[286]["co"] = "ORACLE CRM - STATE OF MONTANA" dnr[287]["co"] = "ORACLE CRM - STRYKER - INSTRUMENTS" dnr[288]["co"] = "ORACLE CRM - STRYKER CORPORATION" dnr[289]["co"] = "ORACLE CRM - STRYKER SOUTH PACIFIC" dnr[290]["co"] = "ORACLE CRM - STUBHUB" dnr[291]["co"] = "ORACLE CRM - STULLER, INC." dnr[292]["co"] = "ORACLE CRM - SYMMETRY MEDICAL" dnr[293]["co"] = "ORACLE CRM - SYNTHES" dnr[294]["co"] = "ORACLE CRM - TINDLEY CHARTER SCHOOL" dnr[295]["co"] = "ORACLE CRM - TOWN & COUNTRY BANK - PEVELY, MO" dnr[296]["co"] = "ORACLE CRM - TOWN SPORTS INTERNATIONAL" dnr[297]["co"] = "ORACLE CRM - TOYOTA FINANCIAL SERVICES" dnr[298]["co"] = "ORACLE CRM - TRAK MICROWAVE CORPORATION" dnr[299]["co"] = "ORACLE CRM - TREND MICRO INC." dnr[300]["co"] = "ORACLE CRM - TRIPWIRE" dnr[301]["co"] = "ORACLE CRM - TRU VUE" dnr[302]["co"] = "ORACLE CRM - VIRGINIA HOUSING DEVELOPMENT AUTHORITY" dnr[303]["co"] = "ORACLE CRM - VOLVO IT, NA" dnr[304]["co"] = "ORACLE CRM - WIND RIVER" dnr[305]["co"] = "ORACLE CRM - WONDERWARE" dnr[306]["co"] = "ORACLE CRM - WOW- WIDE OPEN WEST" dnr[307]["co"] = "ORACLE CRM - WRIGHT EXPRESS LLC" dnr[308]["co"] = "ORACLE CRM - XILINX" dnr[309]["co"] = "ORACLE ERP - ALLIANCE COAL" dnr[310]["co"] = "ORACLE ERP - ALPHA NATURAL RESOURCES" dnr[311]["co"] = "ORACLE ERP - ARAMARK UNIFORM SERVICES" dnr[312]["co"] = "ORACLE ERP - BRAND ENERGY" dnr[313]["co"] = "ORACLE ERP - GALDERMA LABORATORIES" dnr[314]["co"] = "ORACLE ERP - MASON COMPANIES" dnr[315]["co"] = "ORACLE ERP - NCH DANCO" dnr[316]["co"] = "ORACLE ERP - S&B ENGINEERS" dnr[317]["co"] = "ORACLE ERP - SOCIETY OF PETROLEUM ENGINEERS" dnr[318]["co"] = "ORACLE ERP - STULLER" dnr[319]["co"] = "ORACLE ERP - TELETECH HOLDINGS" dnr[320]["co"] = "ORACLE ERP - TOMKINS BUILDING" dnr[321]["co"] = "ORACLE ERP - TRANSPLACE" dnr[322]["co"] = "ORACLE ERP - TRANSPLACE" dnr[323]["co"] = "ST. LOUIS - BUNGE" dnr[324]["co"] = "ST. LOUIS - CASSIDY-TURLEY" dnr[325]["co"] = "ST. LOUIS - ENTERPRISE" dnr[326]["co"] = "ST. LOUIS - EXPRESS SCRIPTS" dnr[327]["co"] = "ST. LOUIS - MASTERCARD" dnr[328]["co"] = "ST. LOUIS - MONSANTO" dnr[329]["co"] = "ST. LOUIS - PEABODY" dnr[330]["co"] = "ST. LOUIS - STIFEL NICHOLAS" dnr[331]["co"] = "ST. LOUIS - WASHINGTON UNIVERSITY" dnr[332]["co"] = "TIBCO - FANNIEMAE" dnr[333]["co"] = "TIBCO - GE CAPITAL" dnr[334]["co"] = "TIBCO - PETSMAR" dnr[335]["co"] = "TIBCO - TENNESSEE VALLEY AUTHORITY" dnr[336]["co"] = "TIBCO - TUFTS" dnr[337]["co"] = "TIBCO - CRICKET" dnr[338]["co"] = "ORACLE ERP(OERP) - ESSILOR" dnr[1]["company"] = "x CHARLOTTE (CLT) - DUKE ENERGY" dnr[2]["company"] = "x CHARLOTTE (CLT) - LOWE’S" dnr[3]["company"] = "x CHARLOTTE (CLT) - TIAA-CREF" dnr[4]["company"] = "x CHARLOTTE (CLT) - TRAVELPORT" dnr[5]["company"] = "x DALLAS(DAL) - LEXMARK" dnr[6]["company"] = "x DENVER(DEN) - CATHOLIC HEALTH INITIATIVES" dnr[7]["company"] = "x DENVER(DEN) - GOGO OR AIRCELL" dnr[8]["company"] = "x DENVER(DEN) - JANUS" dnr[9]["company"] = "x DENVER(DEN) - OTTERBOX" dnr[10]["company"] = "x DENVER(DEN) - TRI-STATE" dnr[11]["company"] = "x DENVER(DEN) - TW TELECOM" dnr[12]["company"] = "x DETROIT(DET) - BCBS-MI" dnr[13]["company"] = "x DETROIT(DET) - CARHARTT" dnr[14]["company"] = "x DETROIT(DET) - CHRYSLER" dnr[15]["company"] = "x DETROIT(DET) - COMERICA" dnr[16]["company"] = "x DETROIT(DET) - DTE" dnr[17]["company"] = "x DETROIT(DET) - FORDDIRECT" dnr[18]["company"] = "x DETROIT(DET) - VOLKSWAGON" dnr[19]["company"] = "x HEALTHCARE(HC) - ATLANTICARE HEALTH SYSTEM, ATLANTICARE " dnr[20]["company"] = "x HEALTHCARE(HC) - BLUE CROSS BLUE SHIELD OF KC,BCBSKC " dnr[21]["company"] = "x HEALTHCARE(HC) - BLUE CROSS BLUE SHIELD OF MASSACHUSETTS, BCBSMA " dnr[22]["company"] = "x HEALTHCARE(HC) - CAROLINAS HEALTHCARE SYSTEMS, CAROLINAS " dnr[23]["company"] = "x HEALTHCARE(HC) - GROUP HEALTH COOPERATIVE OF SOUTH CENTRAL WISCONSIN (GHC),GHC " dnr[24]["company"] = "x HEALTHCARE(HC) - IOWA HEALTH SYSTEM, IHS " dnr[25]["company"] = "x HEALTHCARE(HC) - MISSION HEALTH SYSTEM, MISSION HEALTH " dnr[26]["company"] = "x HEALTHCARE(HC) - NASCO, ATLANTA" dnr[27]["company"] = "x HEALTHCARE(HC) - NORTH SHORE LONG ISLAND JEWISH, NSLIJ " dnr[28]["company"] = "x HEALTHCARE(HC) - NYU HOSPITALS CENTER, NYU " dnr[29]["company"] = "x HEALTHCARE(HC) - PREMIER, PREMIER – CHARLOTTE, NC" dnr[30]["company"] = "x HEALTHCARE(HC) - TEXAS HEALTH RESOURCES" dnr[31]["company"] = "x HOUSTON(HOU) - HALIBURTON" dnr[32]["company"] = "x HOUSTON(HOU) - SHELL" dnr[33]["company"] = "x HOUSTON(HOU) - WASTE MANAGEMENT" dnr[34]["company"] = "x IBM ATS - AAA NORTHERN CALIFORNIA" dnr[35]["company"] = "x IBM ATS - ACCOMMODATIONS PLUS INTL" dnr[36]["company"] = "x IBM ATS - ADESA CORPORATION" dnr[37]["company"] = "x IBM ATS - ADVANCE AUTO BUSINESS SUPPORT, LLC" dnr[38]["company"] = "x IBM ATS - AFFINIA" dnr[39]["company"] = "x IBM ATS - AFNI" dnr[40]["company"] = "x IBM ATS - ALLSTATE INSURANCE COMPANY" dnr[41]["company"] = "x IBM ATS - AMERICAN AIRLINES" dnr[42]["company"] = "x IBM ATS - ANDERSEN CORPORATION" dnr[43]["company"] = "x IBM ATS - AVIVA USA CORPORATION" dnr[44]["company"] = "x IBM ATS - BARE ESCENTUALS INC" dnr[45]["company"] = "x IBM ATS - BEST BUY" dnr[46]["company"] = "x IBM ATS - BLUE CROSS BLUE SHIELD OF FL" dnr[47]["company"] = "x IBM ATS - BLUE CROSS BLUE SHIELD OF MASSACHUSETTS" dnr[48]["company"] = "x IBM ATS - BLUE CROSS BLUE SHIELD OF MICHIGAN" dnr[49]["company"] = "x IBM ATS - BLUE CROSS BLUE SHIELD OF SC" dnr[50]["company"] = "x IBM ATS - BLUE SHIELD OF CA" dnr[51]["company"] = "x IBM ATS - BOB EVANS FARMS INC." dnr[52]["company"] = "x IBM ATS - BORDER STATES INDUSTRIES INC." dnr[53]["company"] = "x IBM ATS - BUNGE LIMITED" dnr[54]["company"] = "x IBM ATS - BUSINESS TECHNOLOGY CAREER OPPORTUNITIES INC" dnr[55]["company"] = "x IBM ATS - CARDINAL HEALTH" dnr[56]["company"] = "x IBM ATS - CAREFX CORPORATION" dnr[57]["company"] = "x IBM ATS - CARHARTT, INC." dnr[58]["company"] = "x IBM ATS - CAROLINAS HEALTHCARE SYSTEMS" dnr[59]["company"] = "x IBM ATS - CATERPILLAR, INC." dnr[60]["company"] = "x IBM ATS - CITENT, INC." dnr[61]["company"] = "x IBM ATS - CLASS TRAINERS, LLC" dnr[62]["company"] = "x IBM ATS - CLASSIFIED VENTURES, LLC" dnr[63]["company"] = "x IBM ATS - CLEAR CHANNEL COMMUNICATIONS, INC." dnr[64]["company"] = "x IBM ATS - CVS CAREMARK" dnr[65]["company"] = "x IBM ATS - DIGI-KEY CORPORATION" dnr[66]["company"] = "x IBM ATS - DTE ENERGY COMPANY" dnr[67]["company"] = "x IBM ATS - ECOLAB INC." dnr[68]["company"] = "x IBM ATS - EXPRESS SCRIPTS INC" dnr[69]["company"] = "x IBM ATS - FIRST DATA CORPORATION" dnr[70]["company"] = "x IBM ATS - FIRST SOLAR, INC." dnr[71]["company"] = "x IBM ATS - FLUOR CORPORATION" dnr[72]["company"] = "x IBM ATS - FORDDIRECT" dnr[73]["company"] = "x IBM ATS - FOSSIL INC." dnr[74]["company"] = "x IBM ATS - FOUR INC." dnr[75]["company"] = "x IBM ATS - FRANKLIN TEMPLETON INVESTMENTS" dnr[76]["company"] = "x IBM ATS - GREAT WEST CASUALTY COMPANY" dnr[77]["company"] = "x IBM ATS - GUTHY-RENKER CORP." dnr[78]["company"] = "x IBM ATS - HEALTH CARE SERVICE CORPORATION (HCSC)" dnr[79]["company"] = "x IBM ATS - HEALTHNOW, INC." dnr[80]["company"] = "x IBM ATS - HUMANA INC." dnr[81]["company"] = "x IBM ATS - IBM CORPORATION" dnr[82]["company"] = "x IBM ATS - IBM GLOBAL SERVICES" dnr[83]["company"] = "x IBM ATS - IBM ISSD" dnr[84]["company"] = "x IBM ATS - IBM ISSL" dnr[85]["company"] = "x IBM ATS - IBM ISSW" dnr[86]["company"] = "x IBM ATS - ITES-IBM" dnr[87]["company"] = "x IBM ATS - ITS, INC." dnr[88]["company"] = "x IBM ATS - JACK MORTON WORLDWIDE INC." dnr[89]["company"] = "x IBM ATS - KAISER PERMANENTE" dnr[90]["company"] = "x IBM ATS - KIRKLANDS INC." dnr[91]["company"] = "x IBM ATS - LEGAL SHIELD" dnr[92]["company"] = "x IBM ATS - LEXMARK INTERNATIONAL" dnr[93]["company"] = "x IBM ATS - LOWES" dnr[94]["company"] = "x IBM ATS - LUCILE PACKARD CHILDRENS HOSPITAL" dnr[95]["company"] = "x IBM ATS - M.Y.PILGRIMS" dnr[96]["company"] = "x IBM ATS - MERIDIAN IT" dnr[97]["company"] = "x IBM ATS - MISSION HEALTH SYSTEM" dnr[98]["company"] = "x IBM ATS - MONSANTO COMPANY" dnr[99]["company"] = "x IBM ATS - MTD PRODUCTS" dnr[100]["company"] = "x IBM ATS - MUTUAL OF OMAHA INSURANCE CO." dnr[101]["company"] = "x IBM ATS - NEIMAN MARCUS, INC." dnr[102]["company"] = "x IBM ATS - NETJETS INC." dnr[103]["company"] = "x IBM ATS - NVIDIA CORPORATION" dnr[104]["company"] = "x IBM ATS - OPEN DEALER EXCHANGE, LLC" dnr[105]["company"] = "x IBM ATS - PHYSICIANS MUTUAL INSURANCE COMPANY" dnr[106]["company"] = "x IBM ATS - PREMIER" dnr[107]["company"] = "x IBM ATS - PRINCIPAL LIFE INSURANCE COMPANY" dnr[108]["company"] = "x IBM ATS - SIGMA-ALDRICH CORPORATION" dnr[109]["company"] = "x IBM ATS - SPLUNK INC." dnr[110]["company"] = "x IBM ATS - STATE OF LOUISIANA DEPT. OF SOCIAL SERVICES" dnr[111]["company"] = "x IBM ATS - STIFEL FINANCIAL" dnr[112]["company"] = "x IBM ATS - TARGET CORPORATION" dnr[113]["company"] = "x IBM ATS - TECHNOTRAINING, INC." dnr[114]["company"] = "x IBM ATS - THE MENS WEARHOUSE" dnr[115]["company"] = "x IBM ATS - TRIHEALTH INC." dnr[116]["company"] = "x IBM ATS - TRUSTMARK NATIONAL BANK" dnr[117]["company"] = "x IBM ATS - UNION BANK" dnr[118]["company"] = "x IBM ATS - UNITED GUARANTY CORPORATION" dnr[119]["company"] = "x IBM ATS - VERMEER MANUFACTURING COMPANY" dnr[120]["company"] = "x IBM ATS - VERMONT STUDENT ASSISTANCE CORP." dnr[121]["company"] = "x IBM ATS - VRATSINAS CONSTRUCTION COMPANY" dnr[122]["company"] = "x IBM ATS - WALMART.COM USA, LLC" dnr[123]["company"] = "x IBM ATS - WEST CORPORATION" dnr[124]["company"] = "x IBM ATS - WESTERN UNION" dnr[125]["company"] = "x IBM ATS - WESTFIELD LLC" dnr[126]["company"] = "x IBM ATS - WHEATON VAN LINES, INC." dnr[127]["company"] = "x IBM BA - CHICKASAW NATION" dnr[128]["company"] = "x IBM BA - COVIDIEN" dnr[129]["company"] = "x IBM BA - DEL MONTE" dnr[130]["company"] = "x IBM BA - GENENTECH" dnr[131]["company"] = "x IBM BA - MDC HOLDING" dnr[132]["company"] = "x IBM BA - NORTHWESTERN MEDICAL FACULTY FOUNDATION" dnr[133]["company"] = "x IBM BA - NORTHWESTERN MEMORIAL HEALTHCARE" dnr[134]["company"] = "x IBM BA - SDGE/SEMPRA" dnr[135]["company"] = "x IBM BA - STRYKER" dnr[136]["company"] = "x IBM BA - THE ENTERPRISE ACCOUNT/STRATEGIC ACCOUNT LIST PLUS THE FOLLOWING:" dnr[137]["company"] = "x IBM BPMS - BCBS-MA" dnr[138]["company"] = "x IBM BPMS - CARTERS" dnr[139]["company"] = "x IBM BPMS - IBM OR IBM LAB SERVICES ALSO KNOWN AS IBM SOFTWARE SERVICES FOR WEBSPHERE (ISSW)" dnr[140]["company"] = "x IBM BPMS - MEDIMPACT" dnr[141]["company"] = "x IBM BPMS - PREMIER" dnr[142]["company"] = "x IBM BPMS - TARGET" dnr[143]["company"] = "x IBM BPMS - TBC" dnr[144]["company"] = "x IBM BPMS - TEXAS HEALTH RESOURCES " dnr[145]["company"] = "x IBM COMMERCE - CARDINAL" dnr[146]["company"] = "x IBM COMMERCE - CARHARTT" dnr[147]["company"] = "x IBM COMMERCE - CATERPILLAR" dnr[148]["company"] = "x IBM COMMERCE - ECOLAB" dnr[149]["company"] = "x IBM COMMERCE - FOSSIL" dnr[150]["company"] = "x IBM COMMERCE - GRAYBAR ELECTRIC" dnr[151]["company"] = "x IBM COMMERCE - IBM (INCLUDING LAB SERVICES)" dnr[152]["company"] = "x IBM COMMERCE - MTD" dnr[153]["company"] = "x IBM COMMERCE - PREMIER" dnr[154]["company"] = "x IBM COMMERCE - ROCHE" dnr[155]["company"] = "x IBM COMMERCE - SCHEELS" dnr[156]["company"] = "x IBM COMMERCE - THE MENS WEARHOUSE" dnr[157]["company"] = "x IBM INDUSTRY SOLUTIONS(IBM IND SOL) - CARTERS" dnr[158]["company"] = "x IBM INDUSTRY SOLUTIONS(IBM IND SOL) - EMPTORIS" dnr[159]["company"] = "x IBM INDUSTRY SOLUTIONS(IBM IND SOL) - FOLLETT" dnr[160]["company"] = "x IBM INDUSTRY SOLUTIONS(IBM IND SOL) - IBM" dnr[161]["company"] = "x IBM INDUSTRY SOLUTIONS(IBM IND SOL) - STERLING COMMERCE" dnr[162]["company"] = "x IBM INDUSTRY SOLUTIONS(IBM IND SOL) - URBAN OUTFITTERS" dnr[163]["company"] = "x INDIANAPOLIS(INDY) - ADESA / AFC / KAR" dnr[164]["company"] = "x INDIANAPOLIS(INDY) - HEALTH AND HOSPITAL CORPORATION OF MARION COUNTY / WISHARD HEALTH SERVICES" dnr[165]["company"] = "x INDIANAPOLIS(INDY) - HUMANA" dnr[166]["company"] = "x INDIANAPOLIS(INDY) - ROCHE" dnr[167]["company"] = "x INDIANAPOLIS(INDY) - WHEATON WORLD WIDE MOVING / WHEATON VAN LINES" dnr[168]["company"] = "x MINNEAPOLIS(MPS) - BEST BUY " dnr[169]["company"] = "x MINNEAPOLIS(MPS) - ECOLAB" dnr[170]["company"] = "x MINNEAPOLIS(MPS) - EXPRESS SCRIPTS" dnr[171]["company"] = "x MINNEAPOLIS(MPS) - LIFE TIME FITNESS" dnr[172]["company"] = "x MINNEAPOLIS(MPS) - MEDTRONIC" dnr[173]["company"] = "x MINNEAPOLIS(MPS) - ST. JUDE" dnr[174]["company"] = "x MINNEAPOLIS(MPS) - TARGET" dnr[175]["company"] = "x MINNEAPOLIS(MPS) - THOMSON REUTERS" dnr[176]["company"] = "x MINNEAPOLIS(MPS) - WELLS FARGO" dnr[177]["company"] = "x OHIO(OH) - ABERCROMBIE & FITCH" dnr[178]["company"] = "x OHIO(OH) - AMERITAS" dnr[179]["company"] = "x OHIO(OH) - BOB EVANS" dnr[180]["company"] = "x OHIO(OH) - CARDINAL HEALTH" dnr[181]["company"] = "x OHIO(OH) - CATERPILLAR" dnr[182]["company"] = "x OHIO(OH) - ETHICON / JOHNSON & JOHNSON" dnr[183]["company"] = "x OHIO(OH) - HIGHMARK" dnr[184]["company"] = "x OHIO(OH) - JPMORGAN CHASE" dnr[185]["company"] = "x OHIO(OH) - KNOWLEDGE WORKS" dnr[186]["company"] = "x OHIO(OH) - LUXOTTICA" dnr[187]["company"] = "x OHIO(OH) - MTD PRODUCTS" dnr[188]["company"] = "x OHIO(OH) - NETJETS" dnr[189]["company"] = "x OHIO(OH) - NEWPAGE" dnr[190]["company"] = "x OHIO(OH) - STATE AUTO INSURANCE COMPANIES" dnr[191]["company"] = "x OHIO(OH) - TRIHEALTH" dnr[192]["company"] = "x OHIO(OH) - VANTIV" dnr[193]["company"] = "x OHIO(OH) - YUM! BRANDS" dnr[194]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - 20TH CENTURY FOX" dnr[195]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - ADVANCED MICRO DEVICES (AMD)" dnr[196]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - AEM ELECTRONICS" dnr[197]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - AEROCOMPUTERS" dnr[198]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - AGILENT TECHNOLOGIES, INC." dnr[199]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - ALTERA CORPORATION" dnr[200]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - AMERICAN ACADEMY OF DERMATOLOGY" dnr[201]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - AMERICAN TIRE DISTRIBUTORS" dnr[202]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - ANNA'S LINENS" dnr[203]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - ANSYS" dnr[204]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - ARIBA" dnr[205]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - BAYER CONSUMER CARE" dnr[206]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - BEACHBODY" dnr[207]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - BIOGEN IDEC" dnr[208]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - BLUE SKIES LLC" dnr[209]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - BROADCOM CORPORATION" dnr[210]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - BUFFALO WILD WINGS" dnr[211]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - CAMPING WORLD INC" dnr[212]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - CHURCH & DWIGHT" dnr[213]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - CISCO SYSTEMS" dnr[214]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - CITY OF NEWPORT NEWS" dnr[215]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - CITY OF OTTAWA, CANADA" dnr[216]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - CITY OF RIVERSIDE" dnr[217]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - CLEAREDGE POWER" dnr[218]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - CUMMINS, INC." dnr[219]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - CYDCOR" dnr[220]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - CYPRESS SEMICONDUCTOR" dnr[221]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - DISNEY (WALT)" dnr[222]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - DROP IN INC" dnr[223]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - ELAVON" dnr[224]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - ELEKTA" dnr[225]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - EMERSON POWER" dnr[226]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - ETHERTRONICS" dnr[227]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - EXAR CORPORATION" dnr[228]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - EXECUTIVE INFORMATION SYSTEMS" dnr[229]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - EXELIXIS" dnr[230]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - F5 NETWORKS" dnr[231]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - FLAT IRON CONSTRUCTION" dnr[232]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - FOSTERS" dnr[233]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - GEMILOGICAL INSTITUE OF AMERICA" dnr[234]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - GENENTECH" dnr[235]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - GENERAL ATOMICS - ASI" dnr[236]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - GENZYME CORPORATION" dnr[237]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - GEOMETRIC" dnr[238]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - GILEAD SCIENCE, INC." dnr[239]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - HERSHEY" dnr[240]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - HITACHI DATA SYSTEMS" dnr[241]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - IBASIS" dnr[242]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - IEEE" dnr[243]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - IHS INC." dnr[244]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - INDUSTRIAL SCIENCE" dnr[245]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - INVENSYS" dnr[246]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - IVERA MEDICAL CORPORATION" dnr[247]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - JUPITER CONSOLIDATED GROUP" dnr[248]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - KANSAS DEPARTMENT OF LABOR" dnr[249]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - KENDLE" dnr[250]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - KOMORI" dnr[251]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - LEAPFROG" dnr[252]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - LEDCOR INDUSTRIES" dnr[253]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - LIFE TECHNOLOGIES CORPORATION" dnr[254]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - LSI CORPORATION" dnr[255]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - MAZDA USA NORTH AMERICAN OPERATIONS" dnr[256]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - MDC HOLDINGS" dnr[257]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - MONTANA DEPARTMENT OF COMMERCE" dnr[258]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - MOVE.COM" dnr[259]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - NAU COUNTRY INSURANCE COMPANY" dnr[260]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - NESTLE USA" dnr[261]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - NTC TEXAS" dnr[262]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - ON SEMICONDUCTOR" dnr[263]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - OUTCOME SCIENCES - QUINTILES" dnr[264]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - PARKER HANNIFIN" dnr[265]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - PERSONA INC" dnr[266]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - PHARMAVITE" dnr[267]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - POLYCOM" dnr[268]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - PORTEOUS FASTENER" dnr[269]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - PRINTRONIX" dnr[270]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - SAGE PUBLICATIONS" dnr[271]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - SARAH CANNON RESEARCH INSTITUTE" dnr[272]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - SCHNITZER STEEL" dnr[273]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - SDI MEDIA" dnr[274]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - SELECTIVA" dnr[275]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - SEPHORA" dnr[276]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - SM ENERGY COMPANY" dnr[277]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - SMUCKERS (JM)" dnr[278]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - SOLIDWORKS" dnr[279]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - SPACELABS MEDICAL" dnr[280]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - SPARTECH CORPORATION" dnr[281]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - SPRINT COMMUNICATIONS" dnr[282]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - STANDARD AERO" dnr[283]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - STATE OF FLORIDA" dnr[284]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - STATE OF KANSAS SRS" dnr[285]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - STATE OF MISSOURI" dnr[286]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - STATE OF MONTANA" dnr[287]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - STRYKER - INSTRUMENTS" dnr[288]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - STRYKER CORPORATION" dnr[289]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - STRYKER SOUTH PACIFIC" dnr[290]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - STUBHUB" dnr[291]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - STULLER, INC." dnr[292]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - SYMMETRY MEDICAL" dnr[293]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - SYNTHES" dnr[294]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - TINDLEY CHARTER SCHOOL" dnr[295]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - TOWN & COUNTRY BANK - PEVELY, MO" dnr[296]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - TOWN SPORTS INTERNATIONAL" dnr[297]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - TOYOTA FINANCIAL SERVICES" dnr[298]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - TRAK MICROWAVE CORPORATION" dnr[299]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - TREND MICRO INC." dnr[300]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - TRIPWIRE" dnr[301]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - TRU VUE" dnr[302]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - VIRGINIA HOUSING DEVELOPMENT AUTHORITY" dnr[303]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - VOLVO IT, NA" dnr[304]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - WIND RIVER" dnr[305]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - WONDERWARE" dnr[306]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - WOW- WIDE OPEN WEST" dnr[307]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - WRIGHT EXPRESS LLC" dnr[308]["company"] = "x ORACLE CX - ORACLE CRM (OCRM OCX) - XILINX" dnr[309]["company"] = "x ORACLE ERP(OERP) - ALLIANCE COAL" dnr[310]["company"] = "x ORACLE ERP(OERP) - ALPHA NATURAL RESOURCES" dnr[311]["company"] = "x ORACLE ERP(OERP) - ARAMARK UNIFORM SERVICES" dnr[312]["company"] = "x ORACLE ERP(OERP) - BRAND ENERGY" dnr[313]["company"] = "x ORACLE ERP(OERP) - GALDERMA LABORATORIES" dnr[314]["company"] = "x ORACLE ERP(OERP) - MASON COMPANIES" dnr[315]["company"] = "x ORACLE ERP(OERP) - NCH DANCO" dnr[316]["company"] = "x ORACLE ERP(OERP) - S&B ENGINEERS" dnr[317]["company"] = "x ORACLE ERP(OERP) - SOCIETY OF PETROLEUM ENGINEERS" dnr[318]["company"] = "x ORACLE ERP(OERP) - STULLER" dnr[319]["company"] = "x ORACLE ERP(OERP) - TELETECH HOLDINGS" dnr[320]["company"] = "x ORACLE ERP(OERP) - TOMKINS BUILDING" dnr[321]["company"] = "x ORACLE ERP(OERP) - TRANSPLACE" dnr[322]["company"] = "x ORACLE ERP(OERP) - TRANSPLACE" dnr[323]["company"] = "x ST. LOUIS(STL) - BUNGE" dnr[324]["company"] = "x ST. LOUIS(STL) - CASSIDY-TURLEY" dnr[325]["company"] = "x ST. LOUIS(STL) - ENTERPRISE" dnr[326]["company"] = "x ST. LOUIS(STL) - EXPRESS SCRIPTS" dnr[327]["company"] = "x ST. LOUIS(STL) - MASTERCARD" dnr[328]["company"] = "x ST. LOUIS(STL) - MONSANTO" dnr[329]["company"] = "x ST. LOUIS(STL) - PEABODY" dnr[330]["company"] = "x ST. LOUIS(STL) - STIFEL NICHOLAS" dnr[331]["company"] = "x ST. LOUIS(STL) - WASHINGTON UNIVERSITY" dnr[332]["company"] = "x TIBCO(EIS TIB) - FANNIEMAE" dnr[333]["company"] = "x TIBCO(EIS TIB) - GE CAPITAL" dnr[334]["company"] = "x TIBCO(EIS TIB) - PETSMAR" dnr[335]["company"] = "x TIBCO(EIS TIB) - TENNESSEE VALLEY AUTHORITY" dnr[336]["company"] = "x TIBCO(EIS TIB) - TUFTS" dnr[337]["company"] = "x TIBCO(EIS TIB) - CRICKET" dnr[338]["company"] = "x ORACLE ERP(OERP) - ESSILOR" dnr[1]["manager"] = "Jon Nance" dnr[2]["manager"] = "Jon Nance" dnr[3]["manager"] = "Jon Nance" dnr[4]["manager"] = "Jon Nance" dnr[5]["manager"] = "Kevin Kelly" dnr[6]["manager"] = "MaryBeth Ostasz" dnr[7]["manager"] = "MaryBeth Ostasz" dnr[8]["manager"] = "MaryBeth Ostasz" dnr[9]["manager"] = "MaryBeth Ostasz" dnr[10]["manager"] = "MaryBeth Ostasz" dnr[11]["manager"] = "MaryBeth Ostasz" dnr[12]["manager"] = "Joel Stanesa" dnr[13]["manager"] = "Joel Stanesa" dnr[14]["manager"] = "Joel Stanesa" dnr[15]["manager"] = "Joel Stanesa" dnr[16]["manager"] = "Joel Stanesa" dnr[17]["manager"] = "Joel Stanesa" dnr[18]["manager"] = "Joel Stanesa" dnr[19]["manager"] = "David Hastoglis" dnr[20]["manager"] = "David Hastoglis" dnr[21]["manager"] = "David Hastoglis" dnr[22]["manager"] = "David Hastoglis" dnr[23]["manager"] = "David Hastoglis" dnr[24]["manager"] = "David Hastoglis" dnr[25]["manager"] = "David Hastoglis" dnr[26]["manager"] = "David Hastoglis" dnr[27]["manager"] = "David Hastoglis" dnr[28]["manager"] = "David Hastoglis" dnr[29]["manager"] = "David Hastoglis" dnr[30]["manager"] = "David Hastoglis" dnr[31]["manager"] = "Jim Roberts" dnr[32]["manager"] = "Jim Roberts" dnr[33]["manager"] = "Jim Roberts" dnr[34]["manager"] = "Joe Klewicki" dnr[35]["manager"] = "Joe Klewicki" dnr[36]["manager"] = "Joe Klewicki" dnr[37]["manager"] = "Joe Klewicki" dnr[38]["manager"] = "Joe Klewicki" dnr[39]["manager"] = "Joe Klewicki" dnr[40]["manager"] = "Joe Klewicki" dnr[41]["manager"] = "Joe Klewicki" dnr[42]["manager"] = "Joe Klewicki" dnr[43]["manager"] = "Joe Klewicki" dnr[44]["manager"] = "Joe Klewicki" dnr[45]["manager"] = "Joe Klewicki" dnr[46]["manager"] = "Joe Klewicki" dnr[47]["manager"] = "Joe Klewicki" dnr[48]["manager"] = "Joe Klewicki" dnr[49]["manager"] = "Joe Klewicki" dnr[50]["manager"] = "Joe Klewicki" dnr[51]["manager"] = "Joe Klewicki" dnr[52]["manager"] = "Joe Klewicki" dnr[53]["manager"] = "Joe Klewicki" dnr[54]["manager"] = "Joe Klewicki" dnr[55]["manager"] = "Joe Klewicki" dnr[56]["manager"] = "Joe Klewicki" dnr[57]["manager"] = "Joe Klewicki" dnr[58]["manager"] = "Joe Klewicki" dnr[59]["manager"] = "Joe Klewicki" dnr[60]["manager"] = "Joe Klewicki" dnr[61]["manager"] = "Joe Klewicki" dnr[62]["manager"] = "Joe Klewicki" dnr[63]["manager"] = "Joe Klewicki" dnr[64]["manager"] = "Joe Klewicki" dnr[65]["manager"] = "Joe Klewicki" dnr[66]["manager"] = "Joe Klewicki" dnr[67]["manager"] = "Joe Klewicki" dnr[68]["manager"] = "Joe Klewicki" dnr[69]["manager"] = "Joe Klewicki" dnr[70]["manager"] = "Joe Klewicki" dnr[71]["manager"] = "Joe Klewicki" dnr[72]["manager"] = "Joe Klewicki" dnr[73]["manager"] = "Joe Klewicki" dnr[74]["manager"] = "Joe Klewicki" dnr[75]["manager"] = "Joe Klewicki" dnr[76]["manager"] = "Joe Klewicki" dnr[77]["manager"] = "Joe Klewicki" dnr[78]["manager"] = "Joe Klewicki" dnr[79]["manager"] = "Joe Klewicki" dnr[80]["manager"] = "Joe Klewicki" dnr[81]["manager"] = "Joe Klewicki" dnr[82]["manager"] = "Joe Klewicki" dnr[83]["manager"] = "Joe Klewicki" dnr[84]["manager"] = "Joe Klewicki" dnr[85]["manager"] = "Joe Klewicki" dnr[86]["manager"] = "Joe Klewicki" dnr[87]["manager"] = "Joe Klewicki" dnr[88]["manager"] = "Joe Klewicki" dnr[89]["manager"] = "Joe Klewicki" dnr[90]["manager"] = "Joe Klewicki" dnr[91]["manager"] = "Joe Klewicki" dnr[92]["manager"] = "Joe Klewicki" dnr[93]["manager"] = "Joe Klewicki" dnr[94]["manager"] = "Joe Klewicki" dnr[95]["manager"] = "Joe Klewicki" dnr[96]["manager"] = "Joe Klewicki" dnr[97]["manager"] = "Joe Klewicki" dnr[98]["manager"] = "Joe Klewicki" dnr[99]["manager"] = "Joe Klewicki" dnr[100]["manager"] = "Joe Klewicki" dnr[101]["manager"] = "Joe Klewicki" dnr[102]["manager"] = "Joe Klewicki" dnr[103]["manager"] = "Joe Klewicki" dnr[104]["manager"] = "Joe Klewicki" dnr[105]["manager"] = "Joe Klewicki" dnr[106]["manager"] = "Joe Klewicki" dnr[107]["manager"] = "Joe Klewicki" dnr[108]["manager"] = "Joe Klewicki" dnr[109]["manager"] = "Joe Klewicki" dnr[110]["manager"] = "Joe Klewicki" dnr[111]["manager"] = "Joe Klewicki" dnr[112]["manager"] = "Joe Klewicki" dnr[113]["manager"] = "Joe Klewicki" dnr[114]["manager"] = "Joe Klewicki" dnr[115]["manager"] = "Joe Klewicki" dnr[116]["manager"] = "Joe Klewicki" dnr[117]["manager"] = "Joe Klewicki" dnr[118]["manager"] = "Joe Klewicki" dnr[119]["manager"] = "Joe Klewicki" dnr[120]["manager"] = "Joe Klewicki" dnr[121]["manager"] = "Joe Klewicki" dnr[122]["manager"] = "Joe Klewicki" dnr[123]["manager"] = "Joe Klewicki" dnr[124]["manager"] = "Joe Klewicki" dnr[125]["manager"] = "Joe Klewicki" dnr[126]["manager"] = "Joe Klewicki" dnr[127]["manager"] = "JP Contreras" dnr[128]["manager"] = "JP Contreras" dnr[129]["manager"] = "JP Contreras" dnr[130]["manager"] = "JP Contreras" dnr[131]["manager"] = "JP Contreras" dnr[132]["manager"] = "JP Contreras" dnr[133]["manager"] = "JP Contreras" dnr[134]["manager"] = "JP Contreras" dnr[135]["manager"] = "JP Contreras" dnr[136]["manager"] = "JP Contreras" dnr[137]["manager"] = "Vishal Rajpal" dnr[138]["manager"] = "Vishal Rajpal" dnr[139]["manager"] = "Vishal Rajpal" dnr[140]["manager"] = "Vishal Rajpal" dnr[141]["manager"] = "Vishal Rajpal" dnr[142]["manager"] = "Vishal Rajpal" dnr[143]["manager"] = "Vishal Rajpal" dnr[144]["manager"] = "Vishal Rajpal" dnr[145]["manager"] = "Hari Madamalla" dnr[146]["manager"] = "Hari Madamalla" dnr[147]["manager"] = "Hari Madamalla" dnr[148]["manager"] = "Hari Madamalla" dnr[149]["manager"] = "Hari Madamalla" dnr[150]["manager"] = "Hari Madamalla" dnr[151]["manager"] = "Hari Madamalla" dnr[152]["manager"] = "Hari Madamalla" dnr[153]["manager"] = "Hari Madamalla" dnr[154]["manager"] = "Hari Madamalla" dnr[155]["manager"] = "Hari Madamalla" dnr[156]["manager"] = "Hari Madamalla" dnr[157]["manager"] = "Ruth Minj" dnr[158]["manager"] = "Ruth Minj" dnr[159]["manager"] = "Ruth Minj" dnr[160]["manager"] = "Ruth Minj" dnr[161]["manager"] = "Ruth Minj" dnr[162]["manager"] = "Ruth Minj" dnr[163]["manager"] = "John Griffin" dnr[164]["manager"] = "John Griffin" dnr[165]["manager"] = "John Griffin" dnr[166]["manager"] = "John Griffin" dnr[167]["manager"] = "John Griffin" dnr[168]["manager"] = "Derek Tanahill" dnr[169]["manager"] = "Derek Tanahill" dnr[170]["manager"] = "Derek Tanahill" dnr[171]["manager"] = "Derek Tanahill" dnr[172]["manager"] = "Derek Tanahill" dnr[173]["manager"] = "Derek Tanahill" dnr[174]["manager"] = "Derek Tanahill" dnr[175]["manager"] = "Derek Tanahill" dnr[176]["manager"] = "Derek Tanahill" dnr[177]["manager"] = "John Griffin" dnr[178]["manager"] = "John Griffin" dnr[179]["manager"] = "John Griffin" dnr[180]["manager"] = "John Griffin" dnr[181]["manager"] = "John Griffin" dnr[182]["manager"] = "John Griffin" dnr[183]["manager"] = "John Griffin" dnr[184]["manager"] = "John Griffin" dnr[185]["manager"] = "John Griffin" dnr[186]["manager"] = "John Griffin" dnr[187]["manager"] = "John Griffin" dnr[188]["manager"] = "John Griffin" dnr[189]["manager"] = "John Griffin" dnr[190]["manager"] = "John Griffin" dnr[191]["manager"] = "John Griffin" dnr[192]["manager"] = "John Griffin" dnr[193]["manager"] = "John Griffin" dnr[194]["manager"] = "Alfred Arnaud" dnr[195]["manager"] = "Alfred Arnaud" dnr[196]["manager"] = "Alfred Arnaud" dnr[197]["manager"] = "Alfred Arnaud" dnr[198]["manager"] = "Alfred Arnaud" dnr[199]["manager"] = "Alfred Arnaud" dnr[200]["manager"] = "Alfred Arnaud" dnr[201]["manager"] = "Alfred Arnaud" dnr[202]["manager"] = "Alfred Arnaud" dnr[203]["manager"] = "Alfred Arnaud" dnr[204]["manager"] = "Alfred Arnaud" dnr[205]["manager"] = "Alfred Arnaud" dnr[206]["manager"] = "Alfred Arnaud" dnr[207]["manager"] = "Alfred Arnaud" dnr[208]["manager"] = "Alfred Arnaud" dnr[209]["manager"] = "Alfred Arnaud" dnr[210]["manager"] = "Alfred Arnaud" dnr[211]["manager"] = "Alfred Arnaud" dnr[212]["manager"] = "Alfred Arnaud" dnr[213]["manager"] = "Alfred Arnaud" dnr[214]["manager"] = "Alfred Arnaud" dnr[215]["manager"] = "Alfred Arnaud" dnr[216]["manager"] = "Alfred Arnaud" dnr[217]["manager"] = "Alfred Arnaud" dnr[218]["manager"] = "Alfred Arnaud" dnr[219]["manager"] = "Alfred Arnaud" dnr[220]["manager"] = "Alfred Arnaud" dnr[221]["manager"] = "Alfred Arnaud" dnr[222]["manager"] = "Alfred Arnaud" dnr[223]["manager"] = "Alfred Arnaud" dnr[224]["manager"] = "Alfred Arnaud" dnr[225]["manager"] = "Alfred Arnaud" dnr[226]["manager"] = "Alfred Arnaud" dnr[227]["manager"] = "Alfred Arnaud" dnr[228]["manager"] = "Alfred Arnaud" dnr[229]["manager"] = "Alfred Arnaud" dnr[230]["manager"] = "Alfred Arnaud" dnr[231]["manager"] = "Alfred Arnaud" dnr[232]["manager"] = "Alfred Arnaud" dnr[233]["manager"] = "Alfred Arnaud" dnr[234]["manager"] = "Alfred Arnaud" dnr[235]["manager"] = "Alfred Arnaud" dnr[236]["manager"] = "Alfred Arnaud" dnr[237]["manager"] = "Alfred Arnaud" dnr[238]["manager"] = "Alfred Arnaud" dnr[239]["manager"] = "Alfred Arnaud" dnr[240]["manager"] = "Alfred Arnaud" dnr[241]["manager"] = "Alfred Arnaud" dnr[242]["manager"] = "Alfred Arnaud" dnr[243]["manager"] = "Alfred Arnaud" dnr[244]["manager"] = "Alfred Arnaud" dnr[245]["manager"] = "Alfred Arnaud" dnr[246]["manager"] = "Alfred Arnaud" dnr[247]["manager"] = "Alfred Arnaud" dnr[248]["manager"] = "Alfred Arnaud" dnr[249]["manager"] = "Alfred Arnaud" dnr[250]["manager"] = "Alfred Arnaud" dnr[251]["manager"] = "Alfred Arnaud" dnr[252]["manager"] = "Alfred Arnaud" dnr[253]["manager"] = "Alfred Arnaud" dnr[254]["manager"] = "Alfred Arnaud" dnr[255]["manager"] = "Alfred Arnaud" dnr[256]["manager"] = "Alfred Arnaud" dnr[257]["manager"] = "Alfred Arnaud" dnr[258]["manager"] = "Alfred Arnaud" dnr[259]["manager"] = "Alfred Arnaud" dnr[260]["manager"] = "Alfred Arnaud" dnr[261]["manager"] = "Alfred Arnaud" dnr[262]["manager"] = "Alfred Arnaud" dnr[263]["manager"] = "Alfred Arnaud" dnr[264]["manager"] = "Alfred Arnaud" dnr[265]["manager"] = "Alfred Arnaud" dnr[266]["manager"] = "Alfred Arnaud" dnr[267]["manager"] = "Alfred Arnaud" dnr[268]["manager"] = "Alfred Arnaud" dnr[269]["manager"] = "Alfred Arnaud" dnr[270]["manager"] = "Alfred Arnaud" dnr[271]["manager"] = "Alfred Arnaud" dnr[272]["manager"] = "Alfred Arnaud" dnr[273]["manager"] = "Alfred Arnaud" dnr[274]["manager"] = "Alfred Arnaud" dnr[275]["manager"] = "Alfred Arnaud" dnr[276]["manager"] = "Alfred Arnaud" dnr[277]["manager"] = "Alfred Arnaud" dnr[278]["manager"] = "Alfred Arnaud" dnr[279]["manager"] = "Alfred Arnaud" dnr[280]["manager"] = "Alfred Arnaud" dnr[281]["manager"] = "Alfred Arnaud" dnr[282]["manager"] = "Alfred Arnaud" dnr[283]["manager"] = "Alfred Arnaud" dnr[284]["manager"] = "Alfred Arnaud" dnr[285]["manager"] = "Alfred Arnaud" dnr[286]["manager"] = "Alfred Arnaud" dnr[287]["manager"] = "Alfred Arnaud" dnr[288]["manager"] = "Alfred Arnaud" dnr[289]["manager"] = "Alfred Arnaud" dnr[290]["manager"] = "Alfred Arnaud" dnr[291]["manager"] = "Alfred Arnaud" dnr[292]["manager"] = "Alfred Arnaud" dnr[293]["manager"] = "Alfred Arnaud" dnr[294]["manager"] = "Alfred Arnaud" dnr[295]["manager"] = "Alfred Arnaud" dnr[296]["manager"] = "Alfred Arnaud" dnr[297]["manager"] = "Alfred Arnaud" dnr[298]["manager"] = "Alfred Arnaud" dnr[299]["manager"] = "Alfred Arnaud" dnr[300]["manager"] = "Alfred Arnaud" dnr[301]["manager"] = "Alfred Arnaud" dnr[302]["manager"] = "Alfred Arnaud" dnr[303]["manager"] = "Alfred Arnaud" dnr[304]["manager"] = "Alfred Arnaud" dnr[305]["manager"] = "Alfred Arnaud" dnr[306]["manager"] = "Alfred Arnaud" dnr[307]["manager"] = "Alfred Arnaud" dnr[308]["manager"] = "Alfred Arnaud" dnr[309]["manager"] = "Chris Wilson" dnr[310]["manager"] = "Chris Wilson" dnr[311]["manager"] = "Chris Wilson" dnr[312]["manager"] = "Chris Wilson" dnr[313]["manager"] = "Chris Wilson" dnr[314]["manager"] = "Chris Wilson" dnr[315]["manager"] = "Chris Wilson" dnr[316]["manager"] = "Chris Wilson" dnr[317]["manager"] = "Chris Wilson" dnr[318]["manager"] = "Chris Wilson" dnr[319]["manager"] = "Chris Wilson" dnr[320]["manager"] = "Chris Wilson" dnr[321]["manager"] = "Chris Wilson" dnr[322]["manager"] = "Chris Wilson" dnr[323]["manager"] = "John Spyers" dnr[324]["manager"] = "John Spyers" dnr[325]["manager"] = "John Spyers" dnr[326]["manager"] = "John Spyers" dnr[327]["manager"] = "John Spyers" dnr[328]["manager"] = "John Spyers" dnr[329]["manager"] = "John Spyers" dnr[330]["manager"] = "John Spyers" dnr[331]["manager"] = "John Spyers" dnr[332]["manager"] = "Paul Patterson" dnr[333]["manager"] = "Paul Patterson" dnr[334]["manager"] = "Paul Patterson" dnr[335]["manager"] = "Paul Patterson" dnr[336]["manager"] = "Paul Patterson" dnr[337]["manager"] = "Paul Patterson" dnr[338]["manager"] = "Chris Wilson" TextWindow.title = "Check Caution List" begin: TextWindow.ForegroundColor = "red" TextWindow.Writeline("Please enter the first few letters of the company name or SBU: ") name = TextWindow.Read() recruit = "True" If Text.ConvertToUpperCase(name) = "" Then Goto stop EndIf TextWindow.ForegroundColor = "yellow" For count = 1 To Array.GetItemCount(dnr) If Text.IsSubText(dnr[count]["company"],text.ConvertToUpperCase(name)) Then recruit = "False" TextWindow.WriteLine("DO NOT RECRUIT FROM: " + dnr[count]["co"] + " (" + dnr[count]["manager"] + ")") EndIf EndFor If recruit = "True" Then TextWindow.WriteLine("GO GET 'EM") EndIf TextWindow.WriteLine(" ") Goto begin stop: End>GMK276.sb< Start>GML529.sb< 'Initial Prototype 2 -- by Matthew L. Parets aka codingCat 'High score initial entery system. This version 'breaks down the inital entry loop making the routine 're-enterant. This allows other systems to remain active. 'To show the Effect I am spinning a dash in one corner. GraphicsWindow.Show() GraphicsWindow.FontSize = 20 dash = Shapes.AddText("-") angle = 0 GraphicsWindow.BackgroundColor = "black" exiting = "False" GraphicsWindow.KeyDown = OnKeyDown InitialsEntryBuild() Program.Delay(1000) initialEntryShow() While InitEntry = "True" EnterInitials() SpinDash() Program.Delay(50) endwhile InitialEntryHide() Sub SpinDash angle = (Math.Remainder(angle+10,360)) Shapes.Rotate(dash,angle) EndSub Sub InitialsEntryBuild initials = "" curWid = 50 curHei = 65 promptx = (GraphicsWindow.Width / 2) - (((curWid + 5) * 1) / 2) prompty = (GraphicsWindow.Height / 2) - 0 GraphicsWindow.BackgroundColor = "black" GraphicsWindow.FontName = "Tahoma" GraphicsWindow.BrushColor = "white" GraphicsWindow.FontSize = 20 titleinitials1 = Shapes.AddText("Enter initials for the") GraphicsWindow.FontSize = 30 titleinitials2 = Shapes.AddText("Leader Board") Shapes.Move(titleinitials1, 25, prompty - 25) Shapes.HideShape(titleinitials1) Shapes.Move(titleinitials2, 25, prompty - 0) Shapes.HideShape(titleinitials2) cclrnam[1] = "cyan" cclrnam[2] = "magenta" cclrnam[3] = "yellow" For cci = 1 To Array.GetItemCount(cclrnam) GraphicsWindow.PenColor = cclrnam[cci] GraphicsWindow.BrushColor = cclrnam[cci] cursor[cci] = Shapes.AddRectangle(curWid,curHei) Shapes.HideShape(cursor[cci]) EndFor EndSub Sub initialEntryShow curcnt = Array.GetItemCount(cursor) Shapes.ShowShape(titleinitials1) Shapes.ShowShape(titleinitials2) GraphicsWindow.FontName = "Courier New" GraphicsWindow.FontBold = "True" GraphicsWindow.FontSize = 70 cur = 1 pressed = "False" pos = 0 InitEntry = "true" EndSub sub InitialEntryHide GraphicsWindow.BrushColor = "black" For ii = 1 To Text.GetLength(initials) GraphicsWindow.FillRectangle(promptx + ((curWid + 5) * (pos-ii)),prompty+5,curWid,curHei) EndFor For ii = 1 To curcnt Shapes.HideShape(cursor[ii]) EndFor Shapes.HideShape(titleinitials1) Shapes.HideShape(titleinitials2) endsub Sub EnterInitials 'Prompt for initials when a high score has been earned Shapes.HideShape(cursor[cur]) cur = cur + 1 If cur > curcnt Then cur = 1 EndIf If pressed = "True" Then key = GraphicsWindow.LastKey If key = "Return" then InitEntry = "False" EndIf If key = "Space" then key = " " endif If Text.GetLength(key) = 2 and Text.GetSubText(key,1,1) = "D" then key = Text.GetSubTextToEnd(key,2) endif If (key = "Back" Or key = "Left") and pos > 0 then GraphicsWindow.BrushColor = "black" GraphicsWindow.FillRectangle(promptx + ((curWid + 5) * (pos-1)),prompty+5,curWid,curHei) initials = Text.GetSubText(initials,1,Text.GetLength(initials)-1) pos = pos - 1 ElseIf pos < 3 then If Text.GetLength(key) = 1 then keycode = Text.GetCharacterCode(key) If keycode >= 97 And keycode <= 122 then keycode = keycode - 32 EndIf If keycode = 32 or (keycode >= 65 and keycode <= 90) or (keycode >= 48 and keycode < 57) then key = Text.GetCharacter(keycode) initials = initials + key GraphicsWindow.BrushColor = "darkgray" GraphicsWindow.DrawText(promptx + (((curWid + 5) * pos+1)) + 2 + 2,prompty + 2,key) GraphicsWindow.BrushColor = "white" GraphicsWindow.DrawText(promptx + (((curWid + 5) * pos+1)) + 2,prompty,key) pos = pos + 1 endif EndIf endif pressed = "False" EndIf Shapes.Move(cursor[cur],promptx + ((curWid + 5) * pos),prompty+5) Shapes.ShowShape(cursor[cur]) endsub Sub OnKeyDown 'Take note of the fact that a key has been pressed pressed = "True" EndSub End>GML529.sb< Start>GMN529-0.sb< args=0 dd=":" GraphicsWindow.BackgroundColor="darkblue" GraphicsWindow.Width=900 GraphicsWindow.Height=900 GraphicsWindow.Title="3D Atomic Dome view3D = LD3DView.AddView(900,900,"True") LD3DView.AddAmbientLight(view3D "#77777777") LD3DView.AddSpotLight (view3D,"white",1 1 1, -1,-1,1 30, 10) LD3DView.AddDirectionalLight (view3D,"#bbaaaaaa" ,30,-7,-1) LD3DView.AutoControl2 ( 1 1) pth="" For x=0 To 6 t_x=LDMath.Cos(x*60) t_y=LDMath.sin(x*60) pth=pth+ldmath.FixDecimal (t_x*2 3)+dd+0+dd+ldmath.FixDecimal (t_y*2 3)+dd a[x+1][1]=t_x a[x+1][2]=t_y s=LD3DView.AddSphere(view3D .3 16 "red" "D") LD3DView.TranslateGeometry(view3D s t_x*2 0 t_y*2) EndFor LD3DView.AddTube(view3D pth .15 8 "lime" "D") For x=0 To 5 pth=a[x+1][1]*2+dd+0+dd+a[x+1][2]*2+dd+a[x+1][1]*3+dd+2+dd+a[x+1][2]*3 LD3DView.AddTube(view3D pth .15 8 "lime" "D") s=LD3DView.AddSphere(view3D .3 16 "red" "D") LD3DView.TranslateGeometry(view3D s a[x+1][1]*3 2 a[x+1][2]*3) EndFor For x=0 To 6 p1=p1+a[x+1][1]*3+dd+(2)+dd+a[x+1][2]*3+dd p12=p12+a[x+1][1]*2+dd+(6)+dd+a[x+1][2]*2+dd p11=p11+a[x+1][1]*3+dd+(4)+dd+a[x+1][2]*3+dd If x<6 Then pth=a[x+1][1]*2+dd+0+dd+a[x+1][2]*2+dd+a[x+1][1]*3+dd+(-2)+dd+a[x+1][2]*3 p2=a[x+1][1]*3+dd+(2)+dd+a[x+1][2]*3+dd+a[x+1][1]*3+dd+(4)+dd+a[x+1][2]*3 p3=a[x+1][1]*2+dd+(6)+dd+a[x+1][2]*2+dd+a[x+1][1]*3+dd+(4)+dd+a[x+1][2]*3 LD3DView.AddTube(view3D p2 .15 8 "lime" "D") LD3DView.AddTube(view3D p3 .15 8 "lime" "D") LD3DView.AddTube(view3D pth .15 8 "lime" "D") s=LD3DView.AddSphere(view3D .3 16 "red" "D") LD3DView.TranslateGeometry(view3D s a[x+1][1]*3, -2 a[x+1][2]*3) s=LD3DView.AddSphere(view3D .3 16 "red" "D") LD3DView.TranslateGeometry(view3D s a[x+1][1]*3, 4 a[x+1][2]*3) s=LD3DView.AddSphere(view3D .3 16 "red" "D") LD3DView.TranslateGeometry(view3D s a[x+1][1]*2, 6 a[x+1][2]*2) EndIf EndFor LD3DView.AddTube(view3D p1 .15 8 "lime" "D") LD3DView.AddTube(view3D p11 .15 8 "lime" "D") LD3DView.AddTube(view3D p12 .15 8 "lime" "D") End>GMN529-0.sb< Start>GMN529-2.sb< args=0 dd=":" w5=120 GraphicsWindow.BackgroundColor="darkblue" GraphicsWindow.Width=900 GraphicsWindow.Height=900 GraphicsWindow.Title="3D Vase view3D = LD3DView.AddView(900,900,"True") LD3DView.AddAmbientLight(view3D "#77777777") LD3DView.AddSpotLight (view3D,"white",1 1 1, -1,-1,1 30, 10) LD3DView.AddDirectionalLight (view3D,"#bbaaaaaa" ,30,-7,-1) LD3DView.AutoControl2 ( 1 1) pth="" For x=0 To w5 t_x=LDMath.Cos(x*360/w5) t_y=LDMath.sin(x*360/w5) pth=pth+ldmath.FixDecimal (t_x*2 3)+dd+0+dd+ldmath.FixDecimal (t_y*2 3)+dd a[x+1][1]=t_x a[x+1][2]=t_y EndFor LD3DView.AddTube(view3D pth .15 8 "gold" "D") For x=0 To w5-1 pth=a[x+1][1]*2+dd+0+dd+a[x+1][2]*2+dd+a[x+1][1]*3+dd+2+dd+a[x+1][2]*3 LD3DView.AddTube(view3D pth .15 8 "gold" "D") EndFor For x=0 To w5 p1=p1+a[x+1][1]*3+dd+(2)+dd+a[x+1][2]*3+dd p12=p12+a[x+1][1]*2+dd+(6)+dd+a[x+1][2]*2+dd p11=p11+a[x+1][1]*3+dd+(4)+dd+a[x+1][2]*3+dd If xGMN529-2.sb< Start>GMN529.sb< args=0 dd=":" sub tmov3d '[tx;ty;tz] r th fi t_r=args[1] t_th=t_th+args[2] t_fi=t_fi+args[3] t_x=t_x +t_r*LDMath.Sin(t_th)*LDMath.Cos(t_fi) t_y=t_y +t_r*LDMath.Sin(t_th)*LDMath.sin(t_fi) t_z=t_z +t_r*LDMath.Cos(t_th) EndSub GraphicsWindow.BackgroundColor="darkblue" GraphicsWindow.Width=900 GraphicsWindow.Height=900 GraphicsWindow.Title="3D Turtle" view3D = LD3DView.AddView(900,900,"True") LD3DView.AddAmbientLight(view3D "#77777777") LD3DView.AddSpotLight (view3D,"white",1 1 1, -1,-1,1 30, 10) LD3DView.AddDirectionalLight (view3D,"#bbaaaaaa" ,30,-7,-1) LD3DView.AutoControl2 ( 1 1) pth="0:0:0:" for x=5 to 8 step .003 LDCall.Function3("tmov3d" 10/x x*x/3 x/6) pth=pth+ldmath.FixDecimal (t_x 3)+dd+ldmath.FixDecimal (t_y 3)+dd+ldmath.FixDecimal (t_z 3)+dd EndFor 'TextWindow.WriteLine(pth) LD3DView.AddTube(view3D pth .15 8 "lime" "D") End>GMN529.sb< Start>GMP163.sb< ' mahreen miangul GraphicsWindow.Width = 1080 GraphicsWindow.Height = 420 GraphicsWindow.BackgroundColor = "skyblue" shape_init() For N=1 to 14 ss=s[N] for i=1 To 47 ' <------ max shape number is 47 GraphicsWindow.PenWidth = shape[N][i]["pw"] GraphicsWindow.BrushColor = shape[N][i]["bc"] GraphicsWindow.penColor = shape[N][i]["pc"] If shape[N][i]["func"]="ell" Then shp[N][i] = Shapes.AddEllipse(shape[N][i]["width"]*ss, shape[N][i]["height"]*ss) ElseIf shape[N][i]["func"]="rect" Then shp[N][i] = Shapes.AddRectangle(shape[N][i]["width"]*ss, shape[N][i]["height"]*ss) ElseIf shape[N][i]["func"]="tri" Then shp[N][i] = Shapes.Addtriangle(shape[N][i]["x1"]*ss, shape[N][i]["y1"]*ss,shape[N][i]["x2"]*ss, shape[N][i]["y2"]*ss, shape[N][i]["x3"]*ss, shape[N][i]["y3"]*ss) ElseIf shape[N][i]["func"]="line" Then shp[N][i] = Shapes.Addline(shape[N][i]["x1"]*ss, shape[N][i]["y1"]*ss,shape[N][i]["x2"]*ss, shape[N][i]["y2"]*ss) EndIf Shapes.Animate(shp[N][i], shape[N][i]["x"]*ss+shX[N], shape[N][i]["y"]*ss+shY[N], 500) Shapes.Rotate(shp[N][i], Shape[N][i]["angle"]) EndFor endfor Sub shape_init 'shX[0] = 0 ' x offset 'shY[0] = 0 ' y offset s[1]=.8 ' Tree shX[1] = 444 shY[1] = 11 shape[1][1]="func=ell;X=0;Y=188;width=200;height=140;bc=Green;pc=Green;pw=2" shape[1][2]="func=ell;X=10;Y=277;width=80;height=60;bc=Green;pc=Green;pw=2 shape[1][3]="func=ell;X=4;Y=255;width=80;height=70;bc=Green;pc=Green;pw=2 shape[1][4]="func=ell;X=0;Y=191;width=80;height=80;bc=Green;pc=Green;pw=2 shape[1][5]="func=ell;X=40;Y=177;width=80;height=80;bc=Green;pc=Green;pw=2 shape[1][6]="func=ell;X=100;Y=177;width=120;height=80;bc=Green;pc=Green;pw=2 shape[1][7]="func=ell;X=130;Y=240;width=100;height=80;bc=Green;pc=Green;pw=2 shape[1][8]="func=ell;X=130;Y=260;width=100;height=80;bc=Green;pc=Green;pw=2 shape[1][9]="func=rect;X=80;Y=322;width=60;height=100;bc=saddlebrown;pc=darkslatgray;pw=2 shape[1][10]="func=tri;X1=140;Y1=262;X2=110;Y2=322;X3=140;Y3=322;bc=saddlebrown;pc=darkslatgray;pw=0 shape[1][11]="func=tri;X1=140;Y1=262;X2=170;Y2=262;X3=140;Y3=322;bc=saddlebrown;pc=darkslatgray;pw=0 shape[1][12]="func=tri;X1=50;Y1=262;X2=96;Y2=262;X3=80;Y3=322;bc=saddlebrown;pc=darkslatgray;pw=0 shape[1][13]="func=tri;X1=96;Y1=262;X2=80;Y2=322;X3=126;Y3=322;bc=saddlebrown;pc=darkslatgray;pw=0 EndSub GraphicsWindow.KeyDown=onkeydown init() dX=0 dY=0 While "True" For i=1 To Array.GetItemCount(shape) Shapes.Rotate(SHP[i],Shape[i]["angle"]) ' <-------------- rotating angle EndFor Program.Delay(1500) For i=1 To Array.GetItemCount(shape) Shapes.Rotate(SHP[i], 0) ' <-------------- rotating angle EndFor Program.Delay(500) endwhile Sub onkeydown PMXY= text.GetCharacterCode(GraphicsWindow.LastKey) If PMXY=76 Or PMXY=82 Then ' Left Arrow : 76 Right Arrow : 82 dX= (PMXY-79)/3*5 ' <-- (82-76)/2=3 ,82-3=79 , dX=+5 or -5 dY=0 Move_index() elseIf PMXY=68 Or PMXY=85 Then ' Up Arrow : 85 Down Arrow : 68 dY= (76.5-PMXY)/8.5*5 ' <-- (85-68)/2=8.5, 85-8.5=76.5, dY=+5 or -5 dx=0 Move_index() EndIf EndSub Sub move_index For i=1 To 47 ' <--- shp[] array number is 47 Shapes.Move(shp[i],Shapes.GetLeft(shp[i])+dX,Shapes.Gettop(shp[i])+dY) ' current position +dX ,+dY EndFor EndSub Sub init ' DONKEY KONG Shapes_Init() s = 0.5 '<---- scale 'Draw outline For i = 1 To Array.GetItemCount(shape) GraphicsWindow.PenColor = shape[i]["pc"] '<-------------- pen color If shape[i]["func"]="ell" Then GraphicsWindow.DrawEllipse(shape[i]["x"]*s, shape[i]["y"]*s, shape[i]["Width"]*s, shape[i]["height"]*s) elseIf shape[i]["func"]="rect" Then GraphicsWindow.DrawRectangle(shape[i]["x"]*s, shape[i]["y"]*s, shape[i]["Width"]*s, shape[i]["height"]*s) ElseIf shape[i]["func"]="tri" then GraphicsWindow.DrawTriangle(shape[i]["x"]*s+shape[i]["x1"]*s, shape[i]["y"]*s+shape[i]["y1"]*s,shape[i]["x"]*s+shape[i]["x2"]*s, shape[i]["y"]*s+shape[i]["y2"]*s,shape[i]["x"]*s+shape[i]["x3"]*s, shape[i]["y"]*s+shape[i]["y3"]*s ) elseif shape[i]["func"]="line" then GraphicsWindow.Drawline(shape[i]["x"]*s+shape[i]["x1"]*s, shape[i]["y"]*s+shape[i]["y1"]*s,shape[i]["x"]*s+shape[i]["x2"]*s, shape[i]["y"]*s+shape[i]["y2"]*s ) EndIf Program.Delay(30) EndFor ' Add shapes for solid color GraphicsWindow.PenWidth = 2 For i = 1 To Array.GetItemCount(shape) GraphicsWindow.BrushColor = shape[i]["bc"] ' <-------------- brush color If shape[i]["func"]="ell" Then shp[i] = Shapes.AddEllipse(shape[i]["width"]*s, shape[i]["height"]*s) ElseIf shape[i]["func"]="rect" Then shp[i] = Shapes.AddRectangle(shape[i]["width"]*s, shape[i]["height"]*s) ElseIf shape[i]["func"]="tri" Then shp[i] = Shapes.Addtriangle(shape[i]["x1"]*s, shape[i]["y1"]*s,shape[i]["x2"]*s, shape[i]["y2"]*s, shape[i]["x3"]*s, shape[i]["y3"]*s) ElseIf shape[i]["func"]="line" Then shp[i] = Shapes.Addline(shape[i]["x1"]*s, shape[i]["y1"]*s,shape[i]["x2"]*s, shape[i]["y2"]*s) EndIf ' Animate and Rotate Shapes.Animate(shp[i], shape[i]["x"]*s, shape[i]["y"]*s, 500) If Shape[i]["angle"]>0 Then Shapes.Rotate(SHP[i], Shape[i]["angle"]) ' <-------------- rotating angle EndIf Program.Delay(50) EndFor endsub ' Shapes Data Gorilla Kong Sub Shapes_Init shape[1] = "func=ell;x=98;y=44;width=110;height=71;bc=#834216;pw=0;" shape[2] = "func=ell;x=51;y=247;width=75;height=23;angle=348;bc=#FDBC90;pc=#834216;pw=2;" shape[3] = "func=ell;x=197;y=250;width=74;height=22;angle=11;bc=#FDBC90;pc=#834216;pw=2;" shape[4] = "func=ell;x=113;y=253;width=20;height=22;bc=#FDBC90;pc=#834216;pw=2;" shape[5] = "func=ell;x=191;y=255;width=18;height=20;bc=#FDBC90;pc=#834216;pw=2;" shape[6] = "func=ell;x=40;y=260;width=13;height=16;bc=#FDBC90;pc=#834216;pw=2;" shape[7] = "func=ell;x=47;y=264;width=16;height=18;bc=#FDBC90;pc=#834216;pw=2;" shape[8] = "func=ell;x=261;y=267;width=13;height=13;bc=#FDBC90;pc=#834216;pw=2;" shape[9] = "func=ell;x=252;y=269;width=13;height=15;bc=#FDBC90;pc=#834216;pw=2;" shape[10] = "func=ell;x=81;y=190;width=36;height=67;angle=332;bc=#834216;pw=0;" shape[11] = "func=ell;x=200;y=188;width=35;height=67;angle=20;bc=#834216;pw=0;" shape[12] = "func=ell;x=76;y=175;width=62;height=43;bc=#834216;pw=0;" shape[13] = "func=ell;x=171;y=178;width=60;height=40;bc=#834216;pw=0;" shape[14] = "func=ell;x=112;y=139;width=82;height=76;bc=#834216;pw=0;" shape[15] = "func=ell;x=75;y=99;width=81;height=72;bc=#834216;pw=0;" shape[16] = "func=ell;x=149;y=96;width=82;height=74;bc=#834216;pw=0;" shape[17] = "func=ell;x=5;y=87;width=107;height=55;angle=340;bc=#834216;pw=0;" shape[18] = "func=ell;x=195;y=82;width=109;height=59;angle=25;bc=#834216;pw=0;" shape[19] = "func=ell;x=0;y=126;width=43;height=76;angle=341;bc=#834216;pw=0;" shape[20] = "func=ell;x=263;y=126;width=45;height=72;angle=17;bc=#834216;pw=0;" shape[21] = "func=ell;x=33;y=176;width=39;height=35;bc=#FDBC90;pc=#834216;pw=2;" shape[22] = "func=ell;x=239;y=176;width=41;height=37;bc=#FDBC90;pc=#834216;pw=2;" shape[23] = "func=tri;x=113;y=0;x1=37;y1=0;x2=0;y2=76;x3=75;y3=76;bc=#834216;pw=0;" shape[24] = "func=tri;x=148;y=5;x1=15;y1=0;x2=0;y2=43;x3=31;y3=43;bc=#834216;pw=0;" shape[25] = "func=ell;x=110;y=46;width=58;height=41;angle=33;bc=#FDBC90;pw=0;" shape[26] = "func=ell;x=138;y=47;width=61;height=41;angle=318;bc=#FDBC90;pw=0;" shape[27] = "func=tri;x=119;y=60;x1=33;y1=0;x2=0;y2=41;x3=67;y3=41;angle=180;bc=#000000;pc=#000000;pw=2;" shape[28] = "func=ell;x=127;y=61;width=28;height=19;angle=349;bc=#FFFFFF;pc=#000000;pw=2;" shape[29] = "func=ell;x=152;y=62;width=30;height=20;angle=16;bc=#FFFFFF;pc=#000000;pw=2;" shape[30] = "func=ell;x=135;y=66;width=14;height=15;bc=#000000;pc=#000000;pw=2;" shape[31] = "func=ell;x=158;y=67;width=14;height=15;bc=#000000;pc=#000000;pw=2;" shape[32] = "func=ell;x=123;y=140;width=59;height=60;bc=#FCA76E;pc=#834216;pw=2;" shape[33] = "func=ell;x=150;y=107;width=62;height=55;bc=#FCA76E;pw=0;" shape[34] = "func=ell;x=94;y=107;width=64;height=53;bc=#FCA76E;pw=0;" shape[35] = "func=ell;x=96;y=79;width=118;height=69;bc=#FDBC90;pc=#834216;pw=2;" shape[36] = "func=ell;x=77;y=65;width=35;height=23;angle=38;bc=#FDBC90;pc=#834216;pw=2;" shape[37] = "func=ell;x=194;y=63;width=36;height=23;angle=317;bc=#FDBC90;pc=#834216;pw=2;" shape[38] = "func=ell;x=130;y=74;width=22;height=17;angle=15;bc=#FDBC90;pw=0;" shape[39] = "func=ell;x=156;y=73;width=22;height=18;angle=348;bc=#FDBC90;pw=0;" shape[40] = "func=tri;x=111;y=90;x1=10;y1=0;x2=0;y2=22;x3=20;y3=22;angle=298;bc=#FFFFFF;pc=#000000;pw=2;" shape[41] = "func=tri;x=172;y=91;x1=11;y1=0;x2=0;y2=23;x3=22;y3=23;angle=62;bc=#FFFFFF;pc=#000000;pw=2;" shape[42] = "func=rect;x=125;y=97;width=55;height=21;bc=#FFFFFF;pc=#000000;pw=2;" shape[43] = "func=ell;x=135;y=78;width=15;height=9;angle=23;bc=#834216;pw=0;" shape[44] = "func=ell;x=159;y=77;width=15;height=9;angle=339;bc=#834216;pw=0;" shape[45] = "func=line;x=152;y=97;x1=0;y1=0;x2=0;y2=19;pc=#000000;pw=2;" shape[46] = "func=line;x=137;y=98;x1=0;y1=0;x2=0;y2=19;pc=#000000;pw=2;" shape[47] = "func=line;x=167;y=99;x1=0;y1=0;x2=0;y2=18;pc=#000000;pw=2;" EndSub End>GMP163.sb< Start>GMR939.sb< 'Drive This -- JKrueg 2012 ' Use the mouse to steer ' Left click for gas ' Right click for brake ' Escape if the boss walks in GraphicsWindow.Hide() GraphicsWindow.Top = 5 GraphicsWindow.Left = 5 WindowWidth = 600 WindowHeight = 600 GraphicsWindow.Width = WindowWidth GraphicsWindow.Height = WindowHeight GraphicsWindow.BackgroundColor = "Black" path = "http://www.krueg.com/sb/" 'Path = "file://C:/Users/krueg/Documents/SmallBasic/MyProjects/DriveThis/" BlueCone = ImageList.LoadImage(path + "bluecone.png") RaceCar = ImageList.LoadImage(path + "car.png") DriveThisPic = ImageList.LoadImage(Path + "DriveThis.png") InstructionsPic = ImageList.LoadImage(Path + "Instructions.png") GameOverPic = ImageList.LoadImage(Path + "GameOver.png") Car = Shapes.AddImage(racecar) Shapes.Move(Car,300,500) GraphicsWindow.Show() GraphicsWindow.KeyDown = OnKeyboardPress LetsPlay = 0 Intro() debug = "on" 'Turn debug window on by taking out the space from "o n" If debug = "on" Then 'Display text window if debug is "on" debug1() EndIf Reset: Mouse.HideCursor() CarX = 300 'Start car here CarY = 500 Mouse.MouseX = CarX 'Move mouse here Mouse.MouseY = CarY GraphicsWindow.MouseMove = OnMousePosition GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseUp = OnMouseUp Score = 0 Speed = 0 IncSpeed = 0 ConeRows = 10 SetupCones() SetClock() While TimeLeft > -1 'The main game loop If debug = "on" Then 'Show variables in text window if debug is "on" debug2() EndIf SetSpeed() AdvanceCones() GraphicsWindow.Title = "Drive This -- Score - " + Score + " Time - " + TimeLeft + " Krueg 2012" Program.Delay(50) TimeLeft = Math.Round((EndClock - Clock.ElapsedMilliseconds)/1000) EndWhile GraphicsWindow.MouseMove = Disable GraphicsWindow.MouseDown = Disable GraphicsWindow.MouseUp = Disable Mouse.ShowCursor() GameOver = Shapes.AddImage(GameOverPic) Shapes.Move(GameOver,128,12) Program.Delay(2000) Ready = Controls.AddButton("You Gonna Try Again?",400,450) Controls.SetSize(Ready,160,30) Quit = Controls.AddButton("Quit",460,500) Controls.SetSize(Quit,60,30) Controls.ButtonClicked = OnButtonPress TryAgain: If LetsPlay = 0 Then Goto TryAgain EndIf LetsPlay = 0 Shapes.Remove(GameOver) Controls.Remove(Ready) Controls.Remove(Quit) For i = 1 To ConeRows 'Count through the rows of cones Shapes.Remove(ConeLeftPic[i]) 'Remove left cone shape Shapes.Remove(ConeRightPic[i]) 'Remove right cone shape EndFor Program.Delay(2000) Goto Reset Sub OnMousePosition 'Move car to mouse's X position Carx = GraphicsWindow.MouseX Shapes.Rotate(Car,(CarX - LastCarX)*5) 'Turn car in direction of mouse movement Shapes.Move(Car,CarX,CarY) LastCarX = CarX 'Remember where the car is for next mouse movement EndSub Sub OnMouseUp 'Player has let off the gas and brake IncSpeed = -.05 'Slow down when off the gas EndSub Sub OnMouseDown If Mouse.IsLeftButtonDown Then 'Player is pressing left mouse button for gas IncSpeed = .5 'Set acceleration here EndIf If Mouse.IsRightButtonDown Then 'Payer is pressing right mouse button for brakes IncSpeed = -1 'Set brakes here EndIf EndSub Sub SetSpeed Speed = Speed + IncSpeed 'Adjust speed depending on mouse buttons being pressed If Speed > 30 Then Speed = 30 'Set max speed here ElseIf Speed < 0 then Speed = 0 'Minimum speed is stopped, no reverse EndIf EndSub Sub AdvanceCones For i = 1 To ConeRows 'Step through all the rows of cones If ConeY[i] > 470 And CarX < ConeLeftX[i] + 25 Then 'Check if car hits left cone Bump = 1 'Turn on bump flag Mouse.MouseX = CarX + TrackWidth/2 'Push car to the right EndIf If ConeY[i] > 470 And CarX > ConeRightX[i] -37 Then 'Check if car hits right cone Bump = 1 'Turn on bump flag Mouse.MouseX = CarX - TrackWidth/2 'Push car to the left EndIf ConeY[i] = ConeY[i] + Math.Round(Speed) 'Move cones down the screen If ConeY[i] > WindowHeight Then 'Did cone go off the bottom of the screen? ConeY[i] = ConeY[i] - WindowHeight 'Move cone to the top of the screen Turn = Turn + TurnStep If Math.Abs(Turn) > Math.Abs(TurnMax) And Turn*TurnMax > 0 Then 'Here's the turning problem ++++++++++++++ Turn = TurnMax EndIf TrackXPath = TrackXPath + Turn 'Add amount of turn to track centerline ConeLeftX[i] = TrackXPath - TrackWidth 'Position of left cone from track centerline ConeRightX[i] = TrackXPath + TrackWidth 'Position of right cone from track centerline EndIf Shapes.Move(ConeLeftPic[i],ConeLeftX[i],ConeY[i]) 'Move left cone image into position Shapes.Move(ConeRightPic[i],ConeRightX[i],ConeY[i]) 'Move right cone image into position EndFor If Bump = 1 Then 'Did car hit a cone on line 82 or 86 Speed = Math.Round(Speed * .5) 'Cut the car's speed in half Bump = 0 'We delt with the bump so turn bump flag off EndIf If NextXPath - TrackXPath < 20 And NextXPath - TrackXPath > -20 Then 'Is track X close to, next X position While Math.Abs(NextXPath - TrackXPath) < 100 NextXPath = Math.GetRandomNumber(300) + 150 'Track will turn to this, next X position EndWhile TurnMax = Math.Round((NextXPath - TrackXPath) / 10) 'This is the max increment of, turn, to get to, next X postition TurnStep = Math.Round((NextXPath - TrackXPath) / 50) 'This is the amount to add to, turn EndIf Score = Score + Math.Round(Speed/2) 'It's not a real game without a score EndSub Sub SetClock EndClock = Clock.ElapsedMilliseconds + 60000 TimeLeft = Math.Round((EndClock - Clock.ElapsedMilliseconds)/1000) EndSub Sub SetupCones 'Setup game variables and cone array TrackXPath = 300 'Track centerline NextXPath = 300 'Position the track heads to TrackWidth = 100 'Width of track from centerline For i = 1 To ConeRows 'Count through the rows of cones ConeLeftX[i] = TrackXPath - TrackWidth 'Left cone X position from centerline ConeY[i] = WindowHeight / ConeRows * i 'Left cone and right cone Y position ConeLeftPic[i] = Shapes.AddImage(BlueCone) 'Add left cone picture Shapes.Move(ConeLeftPic[i],ConeLeftX[i],ConeY[i]) 'Move left cone shape into position ConeRightX[i] = TrackXPath + TrackWidth 'Right cone X position from centerline ConeRightPic[i] = Shapes.AddImage(BlueCone) 'All right cone picture Shapes.Move(ConeRightPic[i],ConeRightX[i],ConeY[i]) 'Move right cone shape into position EndFor EndSub Sub Disable 'Disable a mouse event EndSub Sub Intro DriveThis = Shapes.AddImage(DriveThisPic) For i = 128 To 1 Step -1 izoom = 1/i+.2 Shapes.Zoom(DriveThis,izoom,izoom) Shapes.Rotate(DriveThis,i*15) Shapes.Move(DriveThis,128-i,12-i) Program.Delay(15) EndFor Shapes.Zoom(DriveThis,1,1) Shapes.Rotate(DriveThis,0) Instructions = Shapes.AddImage(InstructionsPic) Shapes.Move(Instructions,20,400) Program.Delay(2000) GraphicsWindow.FontSize = 12 GraphicsWindow.BrushColor = "Black" Ready = Controls.AddButton("You Think Your Ready?",400,450) Controls.SetSize(Ready,160,30) Quit = Controls.AddButton("Quit",460,500) Controls.SetSize(Quit,60,30) Controls.ButtonClicked = OnButtonPress Wait: If LetsPlay = 0 Then Goto Wait EndIf LetsPlay = 0 Controls.Remove(Ready) Controls.Remove(Quit) For i = 100 To 15 Step -.02 Shapes.SetOpacity(DriveThis,i) Shapes.SetOpacity(Instructions,i) EndFor Shapes.Remove(Instructions) EndSub Sub OnKeyboardPress If GraphicsWindow.LastKey = "Escape" Then Program.End() 'Press ESCAPE to quit game EndIf EndSub Sub OnButtonPress If Controls.LastClickedButton = Ready Then LetsPlay = 1 EndIf If Controls.LastClickedButton = Quit Then Program.End() EndIf EndSub Sub debug1 'Debug widow setup TextWindow.Top = 5 TextWindow.Left = 620 TextWindow.BackgroundColor = "Black" EndSub Sub debug2 'Debug window show values TextWindow.Clear() TextWindow.WriteLine("Car X = " + CarX) TextWindow.WriteLine("Car Y = " + CarY) TextWindow.WriteLine("Speed = " + Speed) TextWindow.WriteLine("Clock.ElpsMS = " + Clock.ElapsedMilliseconds) TextWindow.WriteLine("Time Left = " + TimeLeft) TextWindow.WriteLine("") TextWindow.WriteLine("Track X Path = " + TrackXPath) TextWindow.WriteLine("Next X Path = " + NextXPath) TextWindow.WriteLine("Turn = " + Turn) TextWindow.WriteLine("TurnStep = " + TurnStep) TextWindow.WriteLine("TurnMax = " + TurnMax) TextWindow.WriteLine("") TextWindow.WriteLine("Cone Left X = " + ConeLeftX) TextWindow.WriteLine("Cone Right X = " + ConeRightX) TextWindow.WriteLine("Cone Y = " + ConeY) EndSub End>GMR939.sb< Start>GMS983-0.sb< GraphicsWindow.Clear() GraphicsWindow.Width = 1024 GraphicsWindow.Height = 576 backColor = "black" XBOMBE=1000 YBOMBE=200 BMB="http://www.ctv-production.com/smallbasic/forum/BOMBE" For i=1 to 10 sprite[i]=Shapes.AddImage(BMB+i+".png") Shapes.HideShape(sprite[i]) ' This is the point endfor ib=1 DEBUT : Program.Delay(40) COMPILSPRITE() Shapes.move(sprite[ib], XBOMBE, YBOMBE+200) Perc=math.floor( 100*XBOMBE/1000) ' added Shapes.SetOpacity(sprite[ib],Perc) ' added XBOMBE=XBOMBE-5 If XBOMBE<-50 then XBOMBE=1000 endif YBOMBE=-50 * math.sin (10*XBOMBE) Goto DEBUT SUB COMPILSPRITE Shapes.ShowShape(sprite[ib]) ' add this ib=ib+1 If ib>=10 Then ib=1 endif endsub End>GMS983-0.sb< Start>GMS983.sb< GraphicsWindow.Clear() GraphicsWindow.Width = 1024 GraphicsWindow.Height = 576 backColor = "black" XBOMBE=1000 YBOMBE=200 BMB="http://www.ctv-production.com/smallbasic/forum/BOMBE" For i=1 to 10 sprite[i]=Shapes.AddImage(BMB+i+".png") Shapes.HideShape(sprite[i]) ' This is the point endfor ib=1 DEBUT : Program.Delay(40) COMPILSPRITE() Shapes.move(sprite[ib], XBOMBE, YBOMBE+200) XBOMBE=XBOMBE-5 If XBOMBE<-50 then XBOMBE=1000 endif YBOMBE=-50 * math.sin (10*XBOMBE) Goto DEBUT SUB COMPILSPRITE Shapes.ShowShape(sprite[ib]) ' add this ib=ib+1 If ib>=10 Then ib=1 endif endsub End>GMS983.sb< Start>GMT047-1.sb< ' micro:bit ' Version 0.3 ' Copyright © 2017-2019 Nonki Takahashi. The MIT License. ' 2017-08-28 16:15:18 Shapes generated by Shapes 2.3b. ' Last update 2019-04-29 ' Program ID GMT047-1 SB_Workaround() Init() ' initialize micro:bit shapes Shapes_Init_Caption() base = shY + 50 scale = 1 angle = 0 iMin = 1 iMax = Array.GetItemCount(shape) Shapes_Add() ' initialize micro:bit shapes Shapes_Init_Microbit() scale = 1.6 iMax = Array.GetItemCount(shape) Shapes_Add() x = (gw - 166 * scale) / 2 y = (base - 146 * scale) / 2 Shapes_Move() ' turn off LEDs FindLEDs() For y = 0 To 4 For x = 0 To 4 OffLED() EndFor EndFor FindButtons() ax1 = Shapes.GetLeft(objButton["A"]) ay1 = Shapes.GetTop(objButton["A"]) bx1 = Shapes.GetLeft(objButton["B"]) by1 = Shapes.GetTop(objButton["B"]) bs = 10 * scale ' button size ax2 = ax1 + bs - 1 ay2 = ay1 + bs - 1 bx2 = bx1 + bs - 1 by2 = by1 + bs - 1 GraphicsWindow.MouseDown = OnMouseDown ms = Clock.ElapsedMilliseconds While "True" If 1000 < Clock.ElapsedMilliseconds - ms Then ms = Clock.ElapsedMilliseconds id = id + 1 If idMax < id Then id = 1 EndIf LoadIcon() ShowLEDs() EndIf If mouseDown Then If ax1 <= mx And mx <= ax2 And ay1 <= my And my <= ay2 Then LoadA() ShowLEDs() angle = -1 Shapes_Rotate() Program.Delay(200) angle = 0 Shapes_Rotate() ElseIf bx1 <= mx And mx <= bx2 And by1 <= my And my <= by2 Then LoadB() ShowLEDs() angle = 1 Shapes_Rotate() Program.Delay(200) angle = 0 Shapes_Rotate() EndIf mouseDown = "False" Else Program.Delay(200) EndIf EndWhile Sub Init LF = Text.GetCharacter(10) gw = 598 gh = 428 idMax = 40 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Title = "micro:bit" EndSub Sub FindButtons For i = iMin To iMax shp = shape[i] If Text.StartsWith(shp["name"], "button ") Then bc = shp["bc"] If bc = "#000000" Then name = shp["name"] ab = Text.GetSubText(name, 8, 1) objButton[ab] = shp["obj"] EndIf EndIf EndFor EndSub Sub FindLEDs For i = iMin To iMax shp = shape[i] If Text.StartsWith(shp["name"], "LED ") Then name = shp["name"] x = Text.GetSubText(name, 5, 1) y = Text.GetSubText(name, 7, 1) objLED[x][y] = shp["obj"] ElseIf Text.StartsWith(shp["name"], "Flare ") Then name = shp["name"] x = Text.GetSubText(name, 7, 1) y = Text.GetSubText(name, 9, 1) objFlare[x][y] = shp["obj"] EndIf EndFor EndSub Sub LoadA img = "" + LF img = img + " . # # . . " + LF img = img + " # . . # . " + LF img = img + " # # # # . " + LF img = img + " # . . # . " + LF img = img + " # . . # . " + LF EndSub Sub LoadB img = "" + LF img = img + " # # # . . " + LF img = img + " # . . # . " + LF img = img + " # # # . . " + LF img = img + " # . . # . " + LF img = img + " # # # . . " + LF EndSub Sub LoadIcon img = "" + LF If id = 1 Then ' heart img = img + " . # . # . " + LF img = img + " # # # # # " + LF img = img + " # # # # # " + LF img = img + " . # # # . " + LF img = img + " . . # . . " + LF ElseIf id = 2 Then ' small heart img = img + " . . . . . " + LF img = img + " . # . # . " + LF img = img + " . # # # . " + LF img = img + " . . # . . " + LF img = img + " . . . . . " + LF ElseIf id = 3 Then ' yes img = img + " . . . . . " + LF img = img + " . . . . # " + LF img = img + " . . . # . " + LF img = img + " # . # . . " + LF img = img + " . # . . . " + LF ElseIf id = 4 Then ' no img = img + " # . . . # " + LF img = img + " . # . # . " + LF img = img + " . . # . . " + LF img = img + " . # . # . " + LF img = img + " # . . . # " + LF ElseIf id = 5 Then ' happy img = img + " . . . . . " + LF img = img + " . # . # . " + LF img = img + " . . . . . " + LF img = img + " # . . . # " + LF img = img + " . # # # . " + LF ElseIf id = 6 Then ' sad img = img + " . . . . . " + LF img = img + " . # . # . " + LF img = img + " . . . . . " + LF img = img + " . # # # . " + LF img = img + " # . . . # " + LF ElseIf id = 7 Then ' confused img = img + " . . . . . " + LF img = img + " . # . # . " + LF img = img + " . . . . . " + LF img = img + " . # . # . " + LF img = img + " # . # . # " + LF ElseIf id = 8 Then ' angry img = img + " # . . . # " + LF img = img + " . # . # . " + LF img = img + " . . . . . " + LF img = img + " # # # # # " + LF img = img + " # . # . # " + LF ElseIf id = 9 Then ' asleep img = img + " . . . . . " + LF img = img + " # # . # # " + LF img = img + " . . . . . " + LF img = img + " . # # # . " + LF img = img + " . . . . . " + LF ElseIf id = 10 Then ' surprised img = img + " . # . # . " + LF img = img + " . . . . . " + LF img = img + " . . # . . " + LF img = img + " . # . # . " + LF img = img + " . . # . . " + LF ElseIf id = 11 Then ' silly img = img + " # . . . # " + LF img = img + " . . . . . " + LF img = img + " # # # # # " + LF img = img + " . . . # # " + LF img = img + " . . . # # " + LF ElseIf id = 12 Then ' fabulous img = img + " # # # # # " + LF img = img + " # # . # # " + LF img = img + " . . . . . " + LF img = img + " . # . # . " + LF img = img + " . # # # . " + LF ElseIf id = 13 Then ' meh img = img + " # # . # # " + LF img = img + " . . . . . " + LF img = img + " . . . # . " + LF img = img + " . . # . . " + LF img = img + " . # . . . " + LF ElseIf id = 14 Then ' t-shirt img = img + " # # . # # " + LF img = img + " # # # # # " + LF img = img + " . # # # . " + LF img = img + " . # # # . " + LF img = img + " . # # # . " + LF ElseIf id = 15 Then ' roller skate img = img + " . . . # # " + LF img = img + " . . . # # " + LF img = img + " # # # # # " + LF img = img + " # # # # # " + LF img = img + " . # . # . " + LF ElseIf id = 16 Then ' duck img = img + " . # # . . " + LF img = img + " # # # . . " + LF img = img + " . # # # # " + LF img = img + " . # # # . " + LF img = img + " . . . . . " + LF ElseIf id = 17 Then ' house img = img + " . . # . . " + LF img = img + " . # # # . " + LF img = img + " # # # # # " + LF img = img + " . # # # . " + LF img = img + " . # . # . " + LF ElseIf id = 18 Then ' tortoise img = img + " . . . . . " + LF img = img + " . # # # . " + LF img = img + " # # # # # " + LF img = img + " . # . # . " + LF img = img + " . . . . . " + LF ElseIf id = 19 Then ' butterfly img = img + " # # . # # " + LF img = img + " # # # # # " + LF img = img + " . . # . . " + LF img = img + " # # # # # " + LF img = img + " # # . # # " + LF ElseIf id = 20 Then ' stick figure img = img + " . . # . . " + LF img = img + " # # # # # " + LF img = img + " . . # . . " + LF img = img + " . # . # . " + LF img = img + " # . . . # " + LF ElseIf id = 21 Then ' ghost img = img + " . # # # . " + LF img = img + " # . # . # " + LF img = img + " # # # # # " + LF img = img + " # # # # # " + LF img = img + " # . # . # " + LF ElseIf id = 22 Then ' sword img = img + " . . # . . " + LF img = img + " . . # . . " + LF img = img + " . . # . . " + LF img = img + " . # # # . " + LF img = img + " . . # . . " + LF ElseIf id = 23 Then ' giraffe img = img + " # # . . . " + LF img = img + " . # . . . " + LF img = img + " . # . . . " + LF img = img + " . # # # . " + LF img = img + " . # . # . " + LF ElseIf id = 24 Then ' skull img = img + " . # # # . " + LF img = img + " # . # . # " + LF img = img + " # # # # # " + LF img = img + " . # # # . " + LF img = img + " . # # # . " + LF ElseIf id = 25 Then ' umbrella img = img + " . # # # . " + LF img = img + " # # # # # " + LF img = img + " . . # . . " + LF img = img + " # . # . . " + LF img = img + " # # # . . " + LF ElseIf id = 26 Then ' snake img = img + " # # . . . " + LF img = img + " # # . # # " + LF img = img + " . # . # . " + LF img = img + " . # # # . " + LF img = img + " . . . . . " + LF ElseIf id = 27 Then ' rabbit img = img + " # . # . . " + LF img = img + " # . # . . " + LF img = img + " # # # # . " + LF img = img + " # # . # . " + LF img = img + " # # # # . " + LF ElseIf id = 28 Then ' cow img = img + " # . . . # " + LF img = img + " # . . . # " + LF img = img + " # # # # # " + LF img = img + " . # # # . " + LF img = img + " . . # . . " + LF ElseIf id = 29 Then ' quater note img = img + " . . # . . " + LF img = img + " . . # . . " + LF img = img + " . . # . . " + LF img = img + " # # # . . " + LF img = img + " # # # . . " + LF ElseIf id = 30 Then ' eigth note img = img + " . . # . . " + LF img = img + " . . # # . " + LF img = img + " . . # . # " + LF img = img + " # # # . . " + LF img = img + " # # # . . " + LF ElseIf id = 31 Then ' pitchfork img = img + " # . # . # " + LF img = img + " # . # . # " + LF img = img + " # # # # # " + LF img = img + " . . # . . " + LF img = img + " . . # . . " + LF ElseIf id = 32 Then ' target img = img + " . . # . . " + LF img = img + " . # # # . " + LF img = img + " # # . # # " + LF img = img + " . # # # . " + LF img = img + " . . # . . " + LF ElseIf id = 33 Then ' triangle img = img + " . . . . . " + LF img = img + " . . # . . " + LF img = img + " . # . # . " + LF img = img + " # # # # # " + LF img = img + " . . . . . " + LF ElseIf id = 34 Then ' left triangle img = img + " # . . . . " + LF img = img + " # # . . . " + LF img = img + " # . # . . " + LF img = img + " # . . # . " + LF img = img + " # # # # # " + LF ElseIf id = 35 Then ' chess board img = img + " . # . # . " + LF img = img + " # . # . # " + LF img = img + " . # . # . " + LF img = img + " # . # . # " + LF img = img + " . # . # . " + LF ElseIf id = 36 Then ' diamond img = img + " . . # . . " + LF img = img + " . # . # . " + LF img = img + " # . . . # " + LF img = img + " . # . # . " + LF img = img + " . . # . . " + LF ElseIf id = 37 Then ' small diamond img = img + " . . . . . " + LF img = img + " . . # . . " + LF img = img + " . # . # . " + LF img = img + " . . # . . " + LF img = img + " . . . . . " + LF ElseIf id = 38 Then ' square img = img + " # # # # # " + LF img = img + " # . . . # " + LF img = img + " # . . . # " + LF img = img + " # . . . # " + LF img = img + " # # # # # " + LF ElseIf id = 39 Then ' small square img = img + " . . . . . " + LF img = img + " . # # # . " + LF img = img + " . # . # . " + LF img = img + " . # # # . " + LF img = img + " . . . . . " + LF ElseIf id = 40 Then ' scissors img = img + " # # . . # " + LF img = img + " # # . # . " + LF img = img + " . . # . . " + LF img = img + " # # . # . " + LF img = img + " # # . . # " + LF EndIf EndSub Sub OnMouseDown mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY mouseDown = "True" EndSub Sub ShowLEDs p = 1 y = 0 x = 0 While p <= Text.GetLength(img) c = Text.GetSubText(img, p, 1) If c = "." Then Shapes.HideShape(objFlare[x][y]) Shapes.HideShape(objLED[x][y]) ElseIf c = "#" Then Shapes.ShowShape(objFlare[x][y]) Shapes.ShowShape(objLED[x][y]) EndIf If Text.IsSubText(".#", c) THen x = x + 1 If 4 < x Then x = 0 y = y + 1 EndIf EndIf p = p + 1 EndWhile EndSub Sub OnLED Shapes.ShowShape(objFlare[x][y]) Shapes.ShowShape(objLED[x][y]) EndSub Sub OffLED Shapes.HideShape(objFlare[x][y]) Shapes.HideShape(objLED[x][y]) EndSub Sub Shapes_Init_Caption ' Shapes | Initialize shapes data ' return shX, shY - current position of shapes ' return shape - array of shapes shX = 362 ' x offset shY = 358 ' y offset shape = "" shape[1] = "func=text;x=0;y=0;text=micro:bit;fs=50;fn=Trebuchet MS;bc=#DDDDDD;" EndSub Sub Shapes_Init_Microbit ' Shapes | Initialize shapes data ' return shX, shY - current position of shapes ' return shape - array of shapes shX = 210 ' x offset shY = 130 ' y offset shape = "" shape[1] = "func=rect;x=8;y=0;width=150;height=8;bc=#000000;pw=0;name=top;" shape[2] = "func=ell;x=0;y=0;width=16;height=16;bc=#00FF99;pw=0;name=corner;" shape[3] = "func=ell;x=150;y=0;width=16;height=16;bc=#000000;pw=0;name=corner;" shape[4] = "func=rect;x=0;y=8;width=166;height=110;bc=#000000;pw=0;name=board;" shape[5] = "func=tri;x=-7;y=-3.5;x1=22;y1=0;x2=0;y2=22;x3=44;y3=22;bc=#00FF99;pw=0;angle=-45;" shape[6] = "func=tri;x=-14.5;y=4.5;x1=22;y1=0;x2=0;y2=22;x3=44;y3=22;bc=#00FF99;pw=0;angle=-45;" shape[7] = "func=tri;x=30;y=-1.7;x1=12;y1=0;x2=0;y2=12;x3=24;y3=12;bc=#00FF99;pw=0;angle=-45;" shape[8] = "func=tri;x=52;y=-1;x1=6;y1=0;x2=0;y2=6;x3=12;y3=6;bc=#00FF99;pw=0;angle=-45;" shape[9] = "func=ell;x=67;y=19;width=20;height=20;bc=#00FF99;pw=0;name=face;" shape[10] = "func=ell;x=83;y=19;width=20;height=20;bc=#00FF99;pw=0;name=face;" shape[11] = "func=rect;x=76;y=19;width=16;height=20;bc=#00FF99;pw=0;name=face;" shape[12] = "func=rect;x=79;y=23;width=12;height=12;bc=#000000;pw=0;name=face;" shape[13] = "func=line;x=77;y=25;x1=0;y1=0;x2=16;y2=0;pc=#000000;pw=4;name=face;" shape[14] = "func=line;x=77;y=33;x1=0;y1=0;x2=16;y2=0;pc=#000000;pw=4;name=face;" shape[15] = "func=ell;x=71;y=23;width=12;height=12;bc=#00FF99;pc=#000000;pw=4;name=eye;" shape[16] = "func=ell;x=87;y=23;width=12;height=12;bc=#00FF99;pc=#000000;pw=4;name=eye;" shape[17] = "func=rect;x=56;y=47;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[18] = "func=rect;x=54;y=47;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 0,0;" shape[19] = "func=rect;x=56;y=49;width=4;height=7;bc=#FF6666;pw=0;name=LED 0,0;" shape[20] = "func=rect;x=56;y=60;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[21] = "func=rect;x=54;y=60;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 0,1;" shape[22] = "func=rect;x=56;y=62;width=4;height=7;bc=#FF6666;pw=0;name=LED 0,1;" shape[23] = "func=rect;x=56;y=73;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[24] = "func=rect;x=54;y=73;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 0,2;" shape[25] = "func=rect;x=56;y=75;width=4;height=7;bc=#FF6666;pw=0;name=LED 0,2;" shape[26] = "func=rect;x=56;y=86;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[27] = "func=rect;x=54;y=86;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 0,3;" shape[28] = "func=rect;x=56;y=88;width=4;height=7;bc=#FF6666;pw=0;name=LED 0,3;" shape[29] = "func=rect;x=56;y=99;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[30] = "func=rect;x=54;y=99;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 0,4;" shape[31] = "func=rect;x=56;y=101;width=4;height=7;bc=#FF6666;pw=0;name=LED 0,4;" shape[32] = "func=rect;x=69;y=47;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[33] = "func=rect;x=67;y=47;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 1,0;" shape[34] = "func=rect;x=69;y=49;width=4;height=7;bc=#FF6666;pw=0;name=LED 1,0;" shape[35] = "func=rect;x=69;y=60;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[36] = "func=rect;x=67;y=60;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 1,1;" shape[37] = "func=rect;x=69;y=62;width=4;height=7;bc=#FF6666;pw=0;name=LED 1,1;" shape[38] = "func=rect;x=69;y=73;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[39] = "func=rect;x=67;y=73;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 1,2;" shape[40] = "func=rect;x=69;y=75;width=4;height=7;bc=#FF6666;pw=0;name=LED 1,2;" shape[41] = "func=rect;x=69;y=86;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[42] = "func=rect;x=67;y=86;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 1,3;" shape[43] = "func=rect;x=69;y=88;width=4;height=7;bc=#FF6666;pw=0;name=LED 1,3;" shape[44] = "func=rect;x=69;y=99;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[45] = "func=rect;x=67;y=99;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 1,4;" shape[46] = "func=rect;x=69;y=101;width=4;height=7;bc=#FF6666;pw=0;name=LED 1,4;" shape[47] = "func=rect;x=82;y=47;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[48] = "func=rect;x=80;y=47;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 2,0;" shape[49] = "func=rect;x=82;y=49;width=4;height=7;bc=#FF6666;pw=0;name=LED 2,0;" shape[50] = "func=rect;x=82;y=60;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[51] = "func=rect;x=80;y=60;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 2,1;" shape[52] = "func=rect;x=82;y=62;width=4;height=7;bc=#FF6666;pw=0;name=LED 2,1;" shape[53] = "func=rect;x=82;y=73;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[54] = "func=rect;x=80;y=73;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 2,2;" shape[55] = "func=rect;x=82;y=75;width=4;height=7;bc=#FF6666;pw=0;name=LED 2,2;" shape[56] = "func=rect;x=82;y=86;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[57] = "func=rect;x=80;y=86;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 2,3;" shape[58] = "func=rect;x=82;y=88;width=4;height=7;bc=#FF6666;pw=0;name=LED 2,3;" shape[59] = "func=rect;x=82;y=99;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[60] = "func=rect;x=80;y=99;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 2,4;" shape[61] = "func=rect;x=82;y=101;width=4;height=7;bc=#FF6666;pw=0;name=LED 2,4;" shape[62] = "func=rect;x=95;y=47;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[63] = "func=rect;x=93;y=47;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 3,0;" shape[64] = "func=rect;x=95;y=49;width=4;height=7;bc=#FF6666;pw=0;name=LED 3,0;" shape[65] = "func=rect;x=95;y=60;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[66] = "func=rect;x=93;y=60;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 3,1;" shape[67] = "func=rect;x=95;y=62;width=4;height=7;bc=#FF6666;pw=0;name=LED 3,1;" shape[68] = "func=rect;x=95;y=73;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[69] = "func=rect;x=93;y=73;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 3,2;" shape[70] = "func=rect;x=95;y=75;width=4;height=7;bc=#FF6666;pw=0;name=LED 3,2;" shape[71] = "func=rect;x=95;y=86;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[72] = "func=rect;x=93;y=86;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 3,3;" shape[73] = "func=rect;x=95;y=88;width=4;height=7;bc=#FF6666;pw=0;name=LED 3,3;" shape[74] = "func=rect;x=95;y=99;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[75] = "func=rect;x=93;y=99;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 3,4;" shape[76] = "func=rect;x=95;y=101;width=4;height=7;bc=#FF6666;pw=0;name=LED 3,4;" shape[77] = "func=rect;x=108;y=47;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[78] = "func=rect;x=106;y=47;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 4,0;" shape[79] = "func=rect;x=108;y=49;width=4;height=7;bc=#FF6666;pw=0;name=LED 4,0;" shape[80] = "func=rect;x=108;y=60;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[81] = "func=rect;x=106;y=60;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 4,1;" shape[82] = "func=rect;x=108;y=62;width=4;height=7;bc=#FF6666;pw=0;name=LED 4,1;" shape[83] = "func=rect;x=108;y=73;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[84] = "func=rect;x=106;y=73;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 4,2;" shape[85] = "func=rect;x=108;y=75;width=4;height=7;bc=#FF6666;pw=0;name=LED 4,2;" shape[86] = "func=rect;x=108;y=86;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[87] = "func=rect;x=106;y=86;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 4,3;" shape[88] = "func=rect;x=108;y=88;width=4;height=7;bc=#FF6666;pw=0;name=LED 4,3;" shape[89] = "func=rect;x=108;y=99;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[90] = "func=rect;x=106;y=99;width=8;height=11;bc=#99FF0000;pw=0;name=Flare 4,4;" shape[91] = "func=rect;x=108;y=101;width=4;height=7;bc=#FF6666;pw=0;name=LED 4,4;" shape[92] = "func=rect;x=6;y=60;width=18;height=18;bc=#808080;pw=0;name=button A;" shape[93] = "func=ell;x=10;y=64;width=10;height=10;bc=#000000;pw=0;name=button A;" shape[94] = "func=ell;x=7;y=61;width=4;height=4;bc=#885544;pw=0;name=button A;" shape[95] = "func=ell;x=19;y=61;width=4;height=4;bc=#885544;pw=0;name=button A;" shape[96] = "func=ell;x=7;y=73;width=4;height=4;bc=#885544;pw=0;name=button A;" shape[97] = "func=ell;x=19;y=73;width=4;height=4;bc=#885544;pw=0;name=button A;" shape[98] = "func=rect;x=142;y=60;width=18;height=18;bc=#808080;pw=0;name=button B;" shape[99] = "func=ell;x=146;y=64;width=10;height=10;bc=#000000;pw=0;name=button B;" shape[100] = "func=ell;x=143;y=61;width=4;height=4;bc=#885544;pw=0;name=button B;" shape[101] = "func=ell;x=155;y=61;width=4;height=4;bc=#885544;pw=0;name=button B;" shape[102] = "func=ell;x=143;y=73;width=4;height=4;bc=#885544;pw=0;name=button B;" shape[103] = "func=ell;x=155;y=73;width=4;height=4;bc=#885544;pw=0;name=button B;" shape[104] = "func=rect;x=0;y=130;width=166;height=8;bc=#000000;pw=0;name=bottom;" shape[105] = "func=rect;x=8;y=138;width=150;height=8;bc=#000000;pw=0;name=bottom;" shape[106] = "func=ell;x=0;y=130;width=16;height=16;bc=#000000;pw=0;name=corner;" shape[107] = "func=ell;x=150;y=130;width=16;height=16;bc=#000000;pw=0;name=corner;" shape[108] = "func=rect;x=0;y=118;width=6;height=12;bc=#000000;pw=0;name=gap;" shape[109] = "func=rect;x=17;y=118;width=22;height=12;bc=#000000;pw=0;name=gap;" shape[110] = "func=rect;x=50;y=118;width=27;height=12;bc=#000000;pw=0;name=gap;" shape[111] = "func=rect;x=88;y=118;width=27;height=12;bc=#000000;pw=0;name=gap;" shape[112] = "func=rect;x=126;y=118;width=22;height=12;bc=#000000;pw=0;name=gap;" shape[113] = "func=rect;x=160;y=118;width=6;height=12;bc=#000000;pw=0;name=gap;" shape[114] = "func=ell;x=3;y=114;width=18;height=18;bc=Transparent;pc=#BFA95A;pw=4;" shape[115] = "func=rect;x=6;y=128;width=11;height=18;bc=#BFA95A;pw=0;name=port 0;" shape[116] = "func=ell;x=36;y=114;width=18;height=18;bc=Transparent;pc=#BFA95A;pw=4;" shape[117] = "func=rect;x=39;y=128;width=11;height=18;bc=#BFA95A;pw=0;name=port 1;" shape[118] = "func=ell;x=74;y=114;width=18;height=18;bc=Transparent;pc=#BFA95A;pw=4;" shape[119] = "func=rect;x=77;y=128;width=11;height=18;bc=#BFA95A;pw=0;name=port 2;" shape[120] = "func=ell;x=112;y=114;width=18;height=18;bc=Transparent;pc=#BFA95A;pw=4;" shape[121] = "func=rect;x=115;y=128;width=11;height=18;bc=#BFA95A;pw=0;name=port 3V;" shape[122] = "func=ell;x=145;y=114;width=18;height=18;bc=Transparent;pc=#BFA95A;pw=4;" shape[123] = "func=rect;x=148;y=128;width=11;height=18;bc=#BFA95A;pw=0;name=port GND;" shape[124] = "func=tri;x=6;y=84;x1=8;y1=0;x2=0;y2=8;x3=16;y3=8;bc=#00FF99;pw=0;angle=135;name=tri;" shape[125] = "func=text;x=12;y=83;text=A;fs=6;fn=Trebuchet MS;bc=#000000;" shape[126] = "func=tri;x=145;y=46;x1=8;y1=0;x2=0;y2=8;x3=16;y3=8;bc=#00FF99;pw=0;angle=-45;name=tri;" shape[127] = "func=text;x=151;y=47;text=B;fs=6;fn=Trebuchet MS;bc=#000000;" shape[128] = "func=text;x=10;y=134;text=0;fs=6;fn=Trebuchet MS;bc=#000000;" shape[129] = "func=text;x=43;y=134;text=1;fs=6;fn=Trebuchet MS;bc=#000000;" shape[130] = "func=text;x=81;y=134;text=2;fs=6;fn=Trebuchet MS;bc=#000000;" shape[131] = "func=text;x=117;y=134;text=3V;fs=6;fn=Trebuchet MS;bc=#000000;" shape[132] = "func=text;x=148;y=134;text=GND;fs=6;fn=Trebuchet MS;bc=#000000;" shape[133] = "func=rect;x=1;y=130;width=3;height=13;bc=#BFA95A;pw=0;" shape[134] = "func=rect;x=19;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[135] = "func=rect;x=24;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[136] = "func=rect;x=29;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[137] = "func=rect;x=34;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[138] = "func=rect;x=52;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[139] = "func=rect;x=57;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[140] = "func=rect;x=62;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[141] = "func=rect;x=67;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[142] = "func=rect;x=72;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[143] = "func=rect;x=90;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[144] = "func=rect;x=95;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[145] = "func=rect;x=100;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[146] = "func=rect;x=105;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[147] = "func=rect;x=110;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[148] = "func=rect;x=128;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[149] = "func=rect;x=133;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[150] = "func=rect;x=138;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[151] = "func=rect;x=143;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[152] = "func=rect;x=161;y=130;width=3;height=13;bc=#BFA95A;pw=0;" shape[153] = "func=tri;x=0.879;y=142.379;x1=2.121;y1=0;x2=0;y2=2.121;x3=4.242;y3=2.121;bc=#BFA95A;pw=0;angle=45;" shape[154] = "func=tri;x=159.879;y=142.379;x1=2.121;y1=0;x2=0;y2=2.121;x3=4.242;y3=2.121;bc=#BFA95A;pw=0;angle=-45;" EndSub Sub Math_CartesianToPolar ' Math | convert cartesian coodinate to polar coordinate ' param x, y - cartesian coordinate ' return r, a - polar coordinate r = Math.SquareRoot(x * x + y * y) If x = 0 And y > 0 Then a = 90 ' [degree] ElseIf x = 0 And y < 0 Then a = -90 ElseIf x = 0 Then a = 0 Else a = Math.ArcTan(y / x) * 180 / Math.Pi EndIf If x < 0 Then a = a + 180 ElseIf x > 0 And y < 0 Then a = a + 360 EndIf EndSub Sub SB_RotateWorkaround ' Small Basic | Rotate workaround for Silverlight ' param shp - current shape ' param x, y - original coordinate ' param alpha - angle [radian] ' returns x, y - workaround coordinate If shp["func"] = "tri" Then x1 = -Math.Floor(shp["x3"] / 2) y1 = -Math.Floor(shp["y3"] / 2) ElseIf shp["func"] = "line" Then x1 = -Math.Floor(Math.Abs(shp["x1"] - shp["x2"]) / 2) y1 = -Math.Floor(Math.Abs(shp["y1"] - shp["y2"]) / 2) EndIf ox = x - x1 oy = y - y1 x = x1 * Math.Cos(alpha) - y1 * Math.Sin(alpha) + ox y = x1 * Math.Sin(alpha) + y1 * Math.Cos(alpha) + oy EndSub Sub SB_Workaround ' Small Basic | Workaround for Silverlight ' returns silverlight - "True" if in remote color = GraphicsWindow.GetPixel(0, 0) If Text.GetLength(color) > 7 Then silverlight = "True" msWait = 300 Else silverlight = "False" EndIf EndSub Sub Shapes_Add ' Shapes | add shapes as shapes data ' param iMin, iMax - shape indices to add ' param shape - array of shapes ' param scale - 1 if same scale ' return shWidth, shHeight - total size of shapes ' return shAngle - current angle of shapes Stack.PushValue("local", i) Stack.PushValue("local", x) Stack.PushValue("local", y) Shapes_CalcWidthAndHeight() s = scale For i = iMin To iMax shp = shape[i] GraphicsWindow.PenWidth = shp["pw"] * s If shp["pw"] > 0 Then GraphicsWindow.PenColor = shp["pc"] EndIf If Text.IsSubText("rect|ell|tri|text", shp["func"]) Then GraphicsWindow.BrushColor = shp["bc"] EndIf If shp["func"] = "rect" Then shp["obj"] = Shapes.AddRectangle(shp["width"] * s, shp["height"] * s) ElseIf shp["func"] = "ell" Then shp["obj"] = Shapes.AddEllipse(shp["width"] * s, shp["height"] * s) ElseIf shp["func"] = "tri" Then shp["obj"] = Shapes.AddTriangle(shp["x1"] * s, shp["y1"] * s, shp["x2"] * s, shp["y2"] * s, shp["x3"] * s, shp["y3"] * s) ElseIf shp["func"] = "line" Then shp["obj"] = Shapes.AddLine(shp["x1"] * s, shp["y1"] * s, shp["x2"] * s, shp["y2"] * s) ElseIf shp["func"] = "text" Then If silverlight Then fs = Math.Floor(shp["fs"] * 0.9) Else fs = shp["fs"] EndIf GraphicsWindow.FontSize = fs * s GraphicsWindow.FontName = shp["fn"] shp["obj"] = Shapes.AddText(shp["text"]) EndIf x = shp["x"] y = shp["y"] shp["rx"] = x shp["ry"] = y If silverlight And Text.IsSubText("tri|line", shp["func"]) Then alpha = Math.GetRadians(shp["angle"]) SB_RotateWorkaround() shp["wx"] = x shp["wy"] = y EndIf Shapes.Move(shp["obj"], shX + x * s, shY + y * s) If Text.IsSubText("rect|ell|tri|text", shp["func"]) And (shp["angle"] <> 0) And (shp["angle"] <> "") Then Shapes.Rotate(shp["obj"], shp["angle"]) EndIf shape[i] = shp EndFor shAngle = 0 y = Stack.PopValue("local") x = Stack.PopValue("local") i = Stack.PopValue("local") EndSub Sub Shapes_CalcRotatePos ' Shapes | Calculate position for rotated shape ' param["x"], param["y"] - position of a shape ' param["width"], param["height"] - size of a shape ' param ["cx"], param["cy"] - center of rotation ' param ["angle"] - rotate angle ' return x, y - rotated position of a shape _cx = param["x"] + param["width"] / 2 _cy = param["y"] + param["height"] / 2 x = _cx - param["cx"] y = _cy - param["cy"] Math_CartesianToPolar() a = a + param["angle"] x = r * Math.Cos(a * Math.Pi / 180) y = r * Math.Sin(a * Math.Pi / 180) _cx = x + param["cx"] _cy = y + param["cy"] x = _cx - param["width"] / 2 y = _cy - param["height"] / 2 EndSub Sub Shapes_CalcWidthAndHeight ' Shapes | Calculate total width and height of shapes ' param iMin, iMax - shape indices to add ' return shWidth, shHeight - total size of shapes For i = iMin To iMax shp = shape[i] If shp["func"] = "tri" Or shp["func"] = "line" Then xmin = shp["x1"] xmax = shp["x1"] ymin = shp["y1"] ymax = shp["y1"] If shp["x2"] < xmin Then xmin = shp["x2"] EndIf If xmax < shp["x2"] Then xmax = shp["x2"] EndIf If shp["y2"] < ymin Then ymin = shp["y2"] EndIf If ymax < shp["y2"] Then ymax = shp["y2"] EndIf If shp["func"] = "tri" Then If shp["x3"] < xmin Then xmin = shp["x3"] EndIf If xmax < shp["x3"] Then xmax = shp["x3"] EndIf If shp["y3"] < ymin Then ymin = shp["y3"] EndIf If ymax < shp["y3"] Then ymax = shp["y3"] EndIf EndIf shp["width"] = xmax - xmin shp["height"] = ymax - ymin EndIf If i = 1 Then shWidth = shp["x"] + shp["width"] shHeight = shp["y"] + shp["height"] Else If shWidth < shp["x"] + shp["width"] Then shWidth = shp["x"] + shp["width"] EndIf If shHeight < shp["y"] + shp["height"] Then shHeight = shp["y"] + shp["height"] EndIf EndIf shape[i] = shp EndFor EndSub Sub Shapes_Move ' Shapes | Move shapes ' param iMin, iMax - shape indices to add ' param shape - array of shapes ' param scale - to zoom ' param x, y - position to move ' return shX, shY - new position of shapes Stack.PushValue("local", i) s = scale shX = x shY = y For i = iMin To iMax shp = shape[i] If silverlight And Text.IsSubText("tri|line", shp["func"]) Then _x = shp["wx"] _y = shp["wy"] Else _x = shp["rx"] _y = shp["ry"] EndIf Shapes.Move(shp["obj"], shX + _x * s, shY + _y * s) EndFor i = Stack.PopValue("local") EndSub Sub Shapes_Remove ' Shapes | Remove shapes ' param iMin, iMax - shapes indices to remove ' param shape - array of shapes Stack.PushValue("local", i) For i = iMin To iMax shp = shape[i] Shapes.Remove(shp["obj"]) EndFor i = Stack.PopValue("local") EndSub Sub Shapes_Rotate ' Shapes | Rotate shapes ' param iMin, iMax - shapes indices to rotate ' param shape - array of shapes ' param cx, cy - rotation center ' param scale - to zoom ' param angle - to rotate Stack.PushValue("local", i) Stack.PushValue("local", x) Stack.PushValue("local", y) s = scale param["angle"] = angle If cx <> "" Then param["cx"] = cx Else cx = "" ' to avoid syntax error param["cx"] = shWidth / 2 EndIf If cy <> "" Then param["cy"] = cy Else cy = "" ' to avoid syntax error param["cy"] = shHeight / 2 EndIf For i = iMin To iMax shp = shape[i] param["x"] = shp["x"] param["y"] = shp["y"] param["width"] = shp["width"] param["height"] = shp["height"] Shapes_CalcRotatePos() shp["rx"] = x shp["ry"] = y If silverlight And Text.IsSubText("tri|line", shp["func"]) Then alpha = Math.GetRadians(angle + shp["angle"]) SB_RotateWorkAround() shp["wx"] = x shp["wy"] = y EndIf Shapes.Move(shp["obj"], shX + x * s, shY + y * s) Shapes.Rotate(shp["obj"], angle + shp["angle"]) shape[i] = shp EndFor y = Stack.PopValue("local") x = Stack.PopValue("local") i = Stack.PopValue("local") EndSub End>GMT047-1.sb< Start>GMT047.sb< ' micro:bit ' Copyright © Nonki Takahashi. The MIT License. ' 2017-08-28 16:15:18 Shapes generated by Shapes 2.3b. ' SB_Workaround() LF = Text.GetCharacter(10) gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Title = "micro:bit" ' initialize shapes Shapes_Init() ' add shapes scale = 1 angle = 0 iMin = 1 iMax = 120 Shapes_Add() FindLEDs() img = "" + LF img = img + " . # # # . " + LF img = img + " # . . . # " + LF img = img + " # . . . # " + LF img = img + " # . . . # " + LF img = img + " . # # # . " + LF ShowLEDs() x = 2 y = 2 OnLED() Program.Delay(1000) OffLED() Sub FindLEDs For i = iMin To iMax shp = shape[i] If Text.StartsWith(shp["name"], "LED ") Then name = shp["name"] x = Text.GetSubText(name, 5, 1) y = Text.GetSubText(name, 7, 1) objLED[x][y] = shp["obj"] EndIf EndFor EndSub Sub ShowLEDs p = 1 y = 0 x = 0 While p <= Text.GetLength(img) c = Text.GetSubText(img, p, 1) If c = "." Then Shapes.HideShape(objLED[x][y]) ElseIf c = "#" Then Shapes.ShowShape(objLED[x][y]) EndIf If Text.IsSubText(".#", c) THen x = x + 1 If 4 < x Then x = 0 y = y + 1 EndIf EndIf p = p + 1 EndWhile EndSub Sub OnLED Shapes.ShowShape(objLED[x][y]) EndSub Sub OffLED Shapes.HideShape(objLED[x][y]) EndSub Sub Shapes_Init ' Shapes | Initialize shapes data ' return shX, shY - current position of shapes ' return shape - array of shapes shX = 210 ' x offset shY = 130 ' y offset shape = "" shape[1] = "func=rect;x=8;y=0;width=150;height=8;bc=#000000;pw=0;name=top;" shape[2] = "func=ell;x=0;y=0;width=16;height=16;bc=#009966;pw=0;name=corner;" shape[3] = "func=ell;x=150;y=0;width=16;height=16;bc=#000000;pw=0;name=corner;" shape[4] = "func=rect;x=0;y=8;width=166;height=110;bc=#000000;pw=0;name=board;" shape[5] = "func=tri;x=-7;y=-3.5;x1=22;y1=0;x2=0;y2=22;x3=44;y3=22;bc=#009966;pw=0;angle=-45;" shape[6] = "func=tri;x=-14.5;y=4.5;x1=22;y1=0;x2=0;y2=22;x3=44;y3=22;bc=#009966;pw=0;angle=-45;" shape[7] = "func=tri;x=30;y=-1.7;x1=12;y1=0;x2=0;y2=12;x3=24;y3=12;bc=#009966;pw=0;angle=-45;" shape[8] = "func=tri;x=52;y=-1;x1=6;y1=0;x2=0;y2=6;x3=12;y3=6;bc=#009966;pw=0;angle=-45;" shape[9] = "func=ell;x=67;y=19;width=20;height=20;bc=#009966;pw=0;name=face;" shape[10] = "func=ell;x=83;y=19;width=20;height=20;bc=#009966;pw=0;name=face;" shape[11] = "func=rect;x=76;y=19;width=16;height=20;bc=#009966;pw=0;name=face;" shape[12] = "func=rect;x=79;y=23;width=12;height=12;bc=#000000;pw=0;name=face;" shape[13] = "func=ell;x=71;y=23;width=12;height=12;bc=#009966;pc=#000000;pw=4;name=eye;" shape[14] = "func=ell;x=87;y=23;width=12;height=12;bc=#009966;pc=#000000;pw=4;name=eye;" shape[15] = "func=rect;x=56;y=47;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[16] = "func=rect;x=56;y=49;width=4;height=7;bc=#FF0000;pw=0;name=LED 0,0;" shape[17] = "func=rect;x=56;y=60;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[18] = "func=rect;x=56;y=62;width=4;height=7;bc=#FF0000;pw=0;name=LED 0,1;" shape[19] = "func=rect;x=56;y=73;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[20] = "func=rect;x=56;y=75;width=4;height=7;bc=#FF0000;pw=0;name=LED 0,2;" shape[21] = "func=rect;x=56;y=86;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[22] = "func=rect;x=56;y=88;width=4;height=7;bc=#FF0000;pw=0;name=LED 0,3;" shape[23] = "func=rect;x=56;y=99;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[24] = "func=rect;x=56;y=101;width=4;height=7;bc=#FF0000;pw=0;name=LED 0,4;" shape[25] = "func=rect;x=69;y=47;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[26] = "func=rect;x=69;y=49;width=4;height=7;bc=#FF0000;pw=0;name=LED 1,0;" shape[27] = "func=rect;x=69;y=60;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[28] = "func=rect;x=69;y=62;width=4;height=7;bc=#FF0000;pw=0;name=LED 1,1;" shape[29] = "func=rect;x=69;y=73;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[30] = "func=rect;x=69;y=75;width=4;height=7;bc=#FF0000;pw=0;name=LED 1,2;" shape[31] = "func=rect;x=69;y=86;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[32] = "func=rect;x=69;y=88;width=4;height=7;bc=#FF0000;pw=0;name=LED 1,3;" shape[33] = "func=rect;x=69;y=99;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[34] = "func=rect;x=69;y=101;width=4;height=7;bc=#FF0000;pw=0;name=LED 1,4;" shape[35] = "func=rect;x=82;y=47;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[36] = "func=rect;x=82;y=49;width=4;height=7;bc=#FF0000;pw=0;name=LED 2,0;" shape[37] = "func=rect;x=82;y=60;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[38] = "func=rect;x=82;y=62;width=4;height=7;bc=#FF0000;pw=0;name=LED 2,1;" shape[39] = "func=rect;x=82;y=73;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[40] = "func=rect;x=82;y=75;width=4;height=7;bc=#FF0000;pw=0;name=LED 2,2;" shape[41] = "func=rect;x=82;y=86;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[42] = "func=rect;x=82;y=88;width=4;height=7;bc=#FF0000;pw=0;name=LED 2,3;" shape[43] = "func=rect;x=82;y=99;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[44] = "func=rect;x=82;y=101;width=4;height=7;bc=#FF0000;pw=0;name=LED 2,4;" shape[45] = "func=rect;x=95;y=47;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[46] = "func=rect;x=95;y=49;width=4;height=7;bc=#FF0000;pw=0;name=LED 3,0;" shape[47] = "func=rect;x=95;y=60;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[48] = "func=rect;x=95;y=62;width=4;height=7;bc=#FF0000;pw=0;name=LED 3,1;" shape[49] = "func=rect;x=95;y=73;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[50] = "func=rect;x=95;y=75;width=4;height=7;bc=#FF0000;pw=0;name=LED 3,2;" shape[51] = "func=rect;x=95;y=86;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[52] = "func=rect;x=95;y=88;width=4;height=7;bc=#FF0000;pw=0;name=LED 3,3;" shape[53] = "func=rect;x=95;y=99;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[54] = "func=rect;x=95;y=101;width=4;height=7;bc=#FF0000;pw=0;name=LED 3,4;" shape[55] = "func=rect;x=108;y=47;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[56] = "func=rect;x=108;y=49;width=4;height=7;bc=#FF0000;pw=0;name=LED 4,0;" shape[57] = "func=rect;x=108;y=60;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[58] = "func=rect;x=108;y=62;width=4;height=7;bc=#FF0000;pw=0;name=LED 4,1;" shape[59] = "func=rect;x=108;y=73;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[60] = "func=rect;x=108;y=75;width=4;height=7;bc=#FF0000;pw=0;name=LED 4,2;" shape[61] = "func=rect;x=108;y=86;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[62] = "func=rect;x=108;y=88;width=4;height=7;bc=#FF0000;pw=0;name=LED 4,3;" shape[63] = "func=rect;x=108;y=99;width=4;height=11;bc=#333333;pw=0;name=LED;" shape[64] = "func=rect;x=108;y=101;width=4;height=7;bc=#FF0000;pw=0;name=LED 4,4;" shape[65] = "func=rect;x=6;y=60;width=18;height=18;bc=#808080;pw=0;name=button A;" shape[66] = "func=ell;x=10;y=64;width=10;height=10;bc=#000000;pw=0;name=button A;" shape[67] = "func=rect;x=142;y=60;width=18;height=18;bc=#808080;pw=0;name=button B;" shape[68] = "func=ell;x=146;y=64;width=10;height=10;bc=#000000;pw=0;name=button B;" shape[69] = "func=rect;x=0;y=130;width=166;height=8;bc=#000000;pw=0;name=bottom;" shape[70] = "func=rect;x=8;y=138;width=150;height=8;bc=#000000;pw=0;name=bottom;" shape[71] = "func=ell;x=0;y=130;width=16;height=16;bc=#000000;pw=0;name=corner;" shape[72] = "func=ell;x=150;y=130;width=16;height=16;bc=#000000;pw=0;name=corner;" shape[73] = "func=rect;x=0;y=118;width=6;height=12;bc=#000000;pw=0;name=gap;" shape[74] = "func=rect;x=17;y=118;width=22;height=12;bc=#000000;pw=0;name=gap;" shape[75] = "func=rect;x=50;y=118;width=27;height=12;bc=#000000;pw=0;name=gap;" shape[76] = "func=rect;x=88;y=118;width=27;height=12;bc=#000000;pw=0;name=gap;" shape[77] = "func=rect;x=126;y=118;width=22;height=12;bc=#000000;pw=0;name=gap;" shape[78] = "func=rect;x=160;y=118;width=6;height=12;bc=#000000;pw=0;name=gap;" shape[79] = "func=ell;x=3;y=114;width=18;height=18;bc=Transparent;pc=#BFA95A;pw=4;" shape[80] = "func=rect;x=6;y=128;width=11;height=18;bc=#BFA95A;pw=0;name=port 0;" shape[81] = "func=ell;x=36;y=114;width=18;height=18;bc=Transparent;pc=#BFA95A;pw=4;" shape[82] = "func=rect;x=39;y=128;width=11;height=18;bc=#BFA95A;pw=0;name=port 1;" shape[83] = "func=ell;x=74;y=114;width=18;height=18;bc=Transparent;pc=#BFA95A;pw=4;" shape[84] = "func=rect;x=77;y=128;width=11;height=18;bc=#BFA95A;pw=0;name=port 2;" shape[85] = "func=ell;x=112;y=114;width=18;height=18;bc=Transparent;pc=#BFA95A;pw=4;" shape[86] = "func=rect;x=115;y=128;width=11;height=18;bc=#BFA95A;pw=0;name=port 3V;" shape[87] = "func=ell;x=145;y=114;width=18;height=18;bc=Transparent;pc=#BFA95A;pw=4;" shape[88] = "func=rect;x=148;y=128;width=11;height=18;bc=#BFA95A;pw=0;name=port GND;" shape[89] = "func=tri;x=6;y=84;x1=8;y1=0;x2=0;y2=8;x3=16;y3=8;bc=#009966;pw=0;angle=135;name=tri;" shape[90] = "func=text;x=12;y=83;text=A;fs=6;fn=Trebuchet MS;bc=#000000;" shape[91] = "func=tri;x=145;y=46;x1=8;y1=0;x2=0;y2=8;x3=16;y3=8;bc=#009966;pw=0;angle=-45;name=tri;" shape[92] = "func=text;x=151;y=47;text=B;fs=6;fn=Trebuchet MS;bc=#000000;" shape[93] = "func=text;x=10;y=134;text=0;fs=6;fn=Trebuchet MS;bc=#000000;" shape[94] = "func=text;x=43;y=134;text=1;fs=6;fn=Trebuchet MS;bc=#000000;" shape[95] = "func=text;x=81;y=134;text=2;fs=6;fn=Trebuchet MS;bc=#000000;" shape[96] = "func=text;x=117;y=134;text=3V;fs=6;fn=Trebuchet MS;bc=#000000;" shape[97] = "func=text;x=148;y=134;text=GND;fs=6;fn=Trebuchet MS;bc=#000000;" shape[98] = "func=rect;x=1;y=130;width=3;height=13;bc=#BFA95A;pw=0;" shape[99] = "func=rect;x=19;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[100] = "func=rect;x=24;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[101] = "func=rect;x=29;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[102] = "func=rect;x=34;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[103] = "func=rect;x=52;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[104] = "func=rect;x=57;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[105] = "func=rect;x=62;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[106] = "func=rect;x=67;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[107] = "func=rect;x=72;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[108] = "func=rect;x=90;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[109] = "func=rect;x=95;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[110] = "func=rect;x=100;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[111] = "func=rect;x=105;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[112] = "func=rect;x=110;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[113] = "func=rect;x=128;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[114] = "func=rect;x=133;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[115] = "func=rect;x=138;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[116] = "func=rect;x=143;y=130;width=3;height=16;bc=#BFA95A;pw=0;" shape[117] = "func=rect;x=161;y=130;width=3;height=13;bc=#BFA95A;pw=0;" shape[118] = "func=tri;x=0.879;y=142.379;x1=2.121;y1=0;x2=0;y2=2.121;x3=4.242;y3=2.121;bc=#BFA95A;pw=0;angle=45;" shape[119] = "func=tri;x=159.879;y=142.379;x1=2.121;y1=0;x2=0;y2=2.121;x3=4.242;y3=2.121;bc=#BFA95A;pw=0;angle=-45;" shape[120] = "func=text;x=168;y=177;text=micro:bit;fs=20;fn=Trebuchet MS;bc=#000000;" EndSub Sub Math_CartesianToPolar ' Math | convert cartesian coodinate to polar coordinate ' param x, y - cartesian coordinate ' return r, a - polar coordinate r = Math.SquareRoot(x * x + y * y) If x = 0 And y > 0 Then a = 90 ' [degree] ElseIf x = 0 And y < 0 Then a = -90 ElseIf x = 0 Then a = 0 Else a = Math.ArcTan(y / x) * 180 / Math.Pi EndIf If x < 0 Then a = a + 180 ElseIf x > 0 And y < 0 Then a = a + 360 EndIf EndSub Sub SB_RotateWorkaround ' Small Basic | Rotate workaround for Silverlight ' param shp - current shape ' param x, y - original coordinate ' param alpha - angle [radian] ' returns x, y - workaround coordinate If shp["func"] = "tri" Then x1 = -Math.Floor(shp["x3"] / 2) y1 = -Math.Floor(shp["y3"] / 2) ElseIf shp["func"] = "line" Then x1 = -Math.Floor(Math.Abs(shp["x1"] - shp["x2"]) / 2) y1 = -Math.Floor(Math.Abs(shp["y1"] - shp["y2"]) / 2) EndIf ox = x - x1 oy = y - y1 x = x1 * Math.Cos(alpha) - y1 * Math.Sin(alpha) + ox y = x1 * Math.Sin(alpha) + y1 * Math.Cos(alpha) + oy EndSub Sub SB_Workaround ' Small Basic | Workaround for Silverlight ' returns silverlight - "True" if in remote color = GraphicsWindow.GetPixel(0, 0) If Text.GetLength(color) > 7 Then silverlight = "True" msWait = 300 Else silverlight = "False" EndIf EndSub Sub Shapes_Add ' Shapes | add shapes as shapes data ' param iMin, iMax - shape indices to add ' param shape - array of shapes ' param scale - 1 if same scale ' return shWidth, shHeight - total size of shapes ' return shAngle - current angle of shapes Stack.PushValue("local", i) Stack.PushValue("local", x) Stack.PushValue("local", y) Shapes_CalcWidthAndHeight() s = scale For i = iMin To iMax shp = shape[i] GraphicsWindow.PenWidth = shp["pw"] * s If shp["pw"] > 0 Then GraphicsWindow.PenColor = shp["pc"] EndIf If Text.IsSubText("rect|ell|tri|text", shp["func"]) Then GraphicsWindow.BrushColor = shp["bc"] EndIf If shp["func"] = "rect" Then shp["obj"] = Shapes.AddRectangle(shp["width"] * s, shp["height"] * s) ElseIf shp["func"] = "ell" Then shp["obj"] = Shapes.AddEllipse(shp["width"] * s, shp["height"] * s) ElseIf shp["func"] = "tri" Then shp["obj"] = Shapes.AddTriangle(shp["x1"] * s, shp["y1"] * s, shp["x2"] * s, shp["y2"] * s, shp["x3"] * s, shp["y3"] * s) ElseIf shp["func"] = "line" Then shp["obj"] = Shapes.AddLine(shp["x1"] * s, shp["y1"] * s, shp["x2"] * s, shp["y2"] * s) ElseIf shp["func"] = "text" Then If silverlight Then fs = Math.Floor(shp["fs"] * 0.9) Else fs = shp["fs"] EndIf GraphicsWindow.FontSize = fs * s GraphicsWindow.FontName = shp["fn"] shp["obj"] = Shapes.AddText(shp["text"]) EndIf x = shp["x"] y = shp["y"] shp["rx"] = x shp["ry"] = y If silverlight And Text.IsSubText("tri|line", shp["func"]) Then alpha = Math.GetRadians(shp["angle"]) SB_RotateWorkaround() shp["wx"] = x shp["wy"] = y EndIf Shapes.Move(shp["obj"], shX + x * s, shY + y * s) If Text.IsSubText("rect|ell|tri|text", shp["func"]) And (shp["angle"] <> 0) And (shp["angle"] <> "") Then Shapes.Rotate(shp["obj"], shp["angle"]) EndIf shape[i] = shp EndFor shAngle = 0 y = Stack.PopValue("local") x = Stack.PopValue("local") i = Stack.PopValue("local") EndSub Sub Shapes_CalcRotatePos ' Shapes | Calculate position for rotated shape ' param["x"], param["y"] - position of a shape ' param["width"], param["height"] - size of a shape ' param ["cx"], param["cy"] - center of rotation ' param ["angle"] - rotate angle ' return x, y - rotated position of a shape _cx = param["x"] + param["width"] / 2 _cy = param["y"] + param["height"] / 2 x = _cx - param["cx"] y = _cy - param["cy"] Math_CartesianToPolar() a = a + param["angle"] x = r * Math.Cos(a * Math.Pi / 180) y = r * Math.Sin(a * Math.Pi / 180) _cx = x + param["cx"] _cy = y + param["cy"] x = _cx - param["width"] / 2 y = _cy - param["height"] / 2 EndSub Sub Shapes_CalcWidthAndHeight ' Shapes | Calculate total width and height of shapes ' param iMin, iMax - shape indices to add ' return shWidth, shHeight - total size of shapes For i = iMin To iMax shp = shape[i] If shp["func"] = "tri" Or shp["func"] = "line" Then xmin = shp["x1"] xmax = shp["x1"] ymin = shp["y1"] ymax = shp["y1"] If shp["x2"] < xmin Then xmin = shp["x2"] EndIf If xmax < shp["x2"] Then xmax = shp["x2"] EndIf If shp["y2"] < ymin Then ymin = shp["y2"] EndIf If ymax < shp["y2"] Then ymax = shp["y2"] EndIf If shp["func"] = "tri" Then If shp["x3"] < xmin Then xmin = shp["x3"] EndIf If xmax < shp["x3"] Then xmax = shp["x3"] EndIf If shp["y3"] < ymin Then ymin = shp["y3"] EndIf If ymax < shp["y3"] Then ymax = shp["y3"] EndIf EndIf shp["width"] = xmax - xmin shp["height"] = ymax - ymin EndIf If i = 1 Then shWidth = shp["x"] + shp["width"] shHeight = shp["y"] + shp["height"] Else If shWidth < shp["x"] + shp["width"] Then shWidth = shp["x"] + shp["width"] EndIf If shHeight < shp["y"] + shp["height"] Then shHeight = shp["y"] + shp["height"] EndIf EndIf shape[i] = shp EndFor EndSub Sub Shapes_Move ' Shapes | Move shapes ' param iMin, iMax - shape indices to add ' param shape - array of shapes ' param scale - to zoom ' param x, y - position to move ' return shX, shY - new position of shapes Stack.PushValue("local", i) s = scale shX = x shY = y For i = iMin To iMax shp = shape[i] If silverlight And Text.IsSubText("tri|line", shp["func"]) Then _x = shp["wx"] _y = shp["wy"] Else _x = shp["rx"] _y = shp["ry"] EndIf Shapes.Move(shp["obj"], shX + _x * s, shY + _y * s) EndFor i = Stack.PopValue("local") EndSub Sub Shapes_Remove ' Shapes | Remove shapes ' param iMin, iMax - shapes indices to remove ' param shape - array of shapes Stack.PushValue("local", i) For i = iMin To iMax shp = shape[i] Shapes.Remove(shp["obj"]) EndFor i = Stack.PopValue("local") EndSub Sub Shapes_Rotate ' Shapes | Rotate shapes ' param iMin, iMax - shapes indices to rotate ' param shape - array of shapes ' param cx, cy - rotation center ' param scale - to zoom ' param angle - to rotate Stack.PushValue("local", i) Stack.PushValue("local", x) Stack.PushValue("local", y) s = scale param["angle"] = angle If cx <> "" Then param["cx"] = cx Else cx = "" ' to avoid syntax error param["cx"] = shWidth / 2 EndIf If cy <> "" Then param["cy"] = cy Else cy = "" ' to avoid syntax error param["cy"] = shHeight / 2 EndIf For i = iMin To iMax shp = shape[i] param["x"] = shp["x"] param["y"] = shp["y"] param["width"] = shp["width"] param["height"] = shp["height"] Shapes_CalcRotatePos() shp["rx"] = x shp["ry"] = y If silverlight And Text.IsSubText("tri|line", shp["func"]) Then alpha = Math.GetRadians(angle + shp["angle"]) SB_RotateWorkAround() shp["wx"] = x shp["wy"] = y EndIf Shapes.Move(shp["obj"], shX + x * s, shY + y * s) Shapes.Rotate(shp["obj"], angle + shp["angle"]) shape[i] = shp EndFor y = Stack.PopValue("local") x = Stack.PopValue("local") i = Stack.PopValue("local") EndSub End>GMT047.sb< Start>GMT163.sb< '========================================== 'INITIALISE '========================================== Initialise() '========================================== 'MAIN GAME LOOP '========================================== start: playing = "True" While (playing) start = Clock.ElapsedMilliseconds speed = speed+0.01 If (start-musicLast > 70000) Then Sound.Stop(music) Sound.Play(music) musicLast = start EndIf MoveLanes() MoveCars() CrashCheck() score = score+speed/100 Shapes.SetText(scoreBox,"Score "+Math.Floor(score)+" Crashes "+crashes) If (crashes = 5) Then playing = "False" EndIf delay = 20-(Clock.ElapsedMilliseconds-start) If (delay > 0) Then Program.Delay(delay) EndIf EndWhile newGAme() Goto start '========================================== 'SUBROUTINES '========================================== Sub Initialise laneWidth = 100 gw = 5*laneWidth gh = 700 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Top = 0 GraphicsWindow.Left = (Desktop.Width-gw)/2 GraphicsWindow.Title = "Car Lane Changer" GraphicsWindow.BackgroundColor = "LightGray" GraphicsWindow.BrushColor = "White" GraphicsWindow.PenWidth = 0 For i = 1 To 4 For j = 1 To 8 lane[i][j] = Shapes.AddRectangle(6,100) Shapes.Move(lane[i][j],laneWidth*i-3,200*j-100) EndFor EndFor GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = laneWidth/2 loading = Shapes.AddText("Loading...") Shapes.Move(loading,gw/4,gh/2-100) GraphicsWindow.KeyDown = OnKeyDown Timer.Interval = 1000 Timer.Tick = OnTick While (music = "") EndWhile speed = 10 score = 0 crashes = 0 GraphicsWindow.FontSize = 20 GraphicsWindow.BrushColor = "DarkRed" scoreBox = Shapes.AddText("") Shapes.Move(scoreBox,gw/2-100,0) CR = Text.GetCharacter(10) Shapes.Remove(loading) EndSub Sub GetResources For res = 1 To 8 resources[res] = "car"+res+".png" EndFor resources[9] = "backgroundMusic.mp3" resources[10] = "crashSound.mp3" path = Program.Directory+"/" web = "http://litdev.co.uk/game_images/" ' The following line could be harmful and has been automatically commented. ' files = File.GetFiles(path) For res = 1 To Array.GetItemCount(resources) If (Array.ContainsValue(files,path+resources[res]) = "False") Then tempFile = Network.DownloadFile(web+resources[res]) ' The following line could be harmful and has been automatically commented. ' File.CopyFile(tempFile,path+resources[res]) ' The following line could be harmful and has been automatically commented. ' File.DeleteFile(tempFile) EndIf If (Text.EndsWith(resources[res],"png")) Then image = ImageList.LoadImage(web+"car"+res+".png") carWidth[res] = ImageList.GetWidthOfImage(image) carHeight[res] = ImageList.GetHeightOfImage(image) cars[res] = Shapes.AddImage(image) If (res = 1) Then carLane[res] = 3 carY[res] = gh-carHeight[res] Else carLane[res] = Math.GetRandomNumber(5) carY[res] = gh EndIf Shapes.Move(cars[res],-carWidth[res]/2+laneWidth*(carLane[res]-0.5),carY[res]) EndIf EndFor music = path+resources[9] crash = path+resources[10] EndSub Sub MoveLanes laneY = laneY+speed If (laneY > 200) Then laneY = laneY-200 EndIf For i = 1 To 4 For j = 1 To 8 Shapes.Move(lane[i][j],laneWidth*i-3,laneY+200*j-500) EndFor EndFor EndSub Sub MoveCars For i = 2 To 8 carY[i] = carY[i]+speed/2 If (carY[i] > gh) Then carLane[i] = Math.GetRandomNumber(5) carY[i] = -Math.GetRandomNumber(2500) For j = 2 To 8 If (i <> j And carLane[i] = carLane[j]) Then carY[i] = Math.Min(carY[i],carY[j]-800) EndIf EndFor EndIf Shapes.Move(cars[i],-carWidth[i]/2+laneWidth*(carLane[i]-0.5),carY[i]) EndFor Shapes.Animate(cars[1],-carWidth[1]/2+laneWidth*(carLane[1]-0.5),carY[1],50) EndSub Sub CrashCheck For i = 2 To 8 If (carLane[i] = carLane[1] And carY[i]+carHeight[i] > gh-carHeight[1]) Then Sound.Stop(crash) Sound.Play(crash) carY[i] = gh speed = 10 crashes = crashes+1 EndIf EndFor EndSub Sub newGame score = Math.Floor(score) ' The following line could be harmful and has been automatically commented. ' highscore = File.ReadContents(File.GetSettingsFilePath()) If (score > highscore) Then highscore = score ' The following line could be harmful and has been automatically commented. ' File.WriteContents(File.GetSettingsFilePath(),highscore) EndIf Program.Delay(500) GraphicsWindow.BrushColor = "DarkRed" GraphicsWindow.FontSize = 20 message = Shapes.AddText(" Your Score is "+score+CR+" High Score is "+highscore+CR+"(Press a key to play again)") Shapes.Move(message,gw/2-130,gh/4) Shapes.Animate(message,gw/2-130,gh/2,1000) keys = "" While (keys = "") Program.Delay(100) EndWhile Shapes.Remove(message) speed = 10 score = 0 crashes = 0 For i = 2 To 8 carY[i] = gh EndFor EndSub '========================================== 'EVENTS '========================================== Sub OnTick Timer.Pause() GetResources() EndSub Sub OnKeyDown key = GraphicsWindow.LastKey keys[key] = "True" If (key = "Left" And carLane[1] > 1) Then carLane[1] = carLane[1]-1 ElseIf (key = "Right" And carLane[1] < 5) Then carLane[1] = carLane[1]+1 EndIf EndSub Sub OnKeyUp key = GraphicsWindow.LastKey keys[key] = "" EndSub End>GMT163.sb< Start>GMV958-0.sb< ' MasterMind Game ' Original by _paul_ (Visual Basic Version) ' Modified by Nonki Takahashi (Small Basic Version) ' Last update 2019-10-06 ' Program ID GMV958-0 Form_Load() While "True" If Controls_triggered Then Controls_Proc() If selectedIndexChanged Then Form_SelectedIndexChanged() EndIf ElseIf btnCheck_Clicked Then Form_btnCheck_Click() btnCheck_Clicked = "False" ElseIf btnNew_Clicked Then Form_btnNew_Click() btnNew_Clicked = "False" ElseIf Controls_mouseDown Then Peg_Click_Check() Controls_mouseDown = "False" Else Program.Delay(200) EndIf EndWhile Sub Dummy cms = "Not Used" EndSub Sub Controls_AddComboBox ' param item - array of items ' param left - the x co-ordinate of the combo box ' param top - the y co-ordinate of the combo box ' return cbox - the combo box Stack.PushValue("local", i) nCBox = nCBox + 1 fs = GraphicsWindow.FontSize cbProp[nCBox]["height"] = fs * 1.8 nItem = Array.GetItemCount(item) cbProp[nCBox]["nItem"] = nItem cbProp[nCBox]["item"] = item widthMax = 0 For i = 1 To nItem len = Text.GetLength(item[i]) width = 0 For j = 1 To len width = width + Math.Floor(luw[Text.GetSubText(item[i], j, 1)] * fs / 100) EndFor If widthMax < width Then widthMax = width EndIf EndFor tboxWidth = widthMax ' + fs cbProp[nCBox]["width"] = tboxWidth cbProp[nCBox]["x"] = left cbProp[nCBox]["y"] = top cbProp[nCBox]["tbox"] = Controls.AddTextBox(left, top) Controls.SetSize(cbProp[nCBox]["tbox"], tboxWidth, cbProp[nCBox]["height"]) selectedIndex = 1 Controls.SetTextBoxText(cbProp[nCBox]["tbox"], cbProp[nCBox]["item"][selectedIndex]) cbProp[nCBox]["btn"] = Controls.AddButton("▾", left + tboxWidth - 1, top) Controls.SetSize(cbProp[nCBox]["btn"], fs * 1.8, cbProp[nCBox]["height"]) cbox = "ComboBox" + nCBox Controls.ButtonClicked = Controls_OnButtonClicked GraphicsWindow.MouseMove = Controls_OnMouseMove GraphicsWindow.MouseDown = Controls_OnMouseDown i = Stack.PopValue("local") EndSub Sub Controls_Proc ' selectedIndexChanged = "False" For i = 1 To nCBox If Controls.LastClickedButton = cbProp[i]["btn"] Then GraphicsWindow.PenColor = "Gray" GraphicsWindow.PenWidth = 1 GraphicsWindow.BrushColor = "White" rect = Shapes.AddRectangle(cbProp[i]["width"], cbProp[i]["height"] * cbProp[i]["nItem"]) Shapes.Move(rect, cbProp[i]["x"], cbProp[i]["y"] + cbProp[i]["height"] - 1) GraphicsWindow.BrushColor = "Black" For j = 1 To cbProp[i]["nItem"] it[j] = Shapes.AddText(cbProp[i]["item"][j]) Shapes.Move(it[j], cbProp[i]["x"] + cbProp[i]["height"] * 0.3, cbProp[i]["y"] + (j + 0.2) * cbProp[i]["height"]) EndFor Controls_mouseDown = "False" While Not[Controls_mouseDown] If Controls_mouseMove Then Controls_Select() Controls_mouseMove = "False" Else Program.Delay(200) EndIf EndWhile Controls_Select() Shapes.Remove(cbSelect) cbSelect = "" For j = 1 To cbProp[i]["nItem"] Shapes.Remove(it[j]) EndFor Shapes.Remove(rect) If selected <> 0 Then lastItem = Controls.GetTextBoxText(cbProp[i]["tbox"]) If lastItem <> cbProp[i]["item"][selected] Then Controls.SetTextBoxText(cbProp[i]["tbox"],cbProp[i]["item"][selected]) selectedIndexChanged = "True" selectedIndex = selected EndIf EndIf EndIf EndFor Controls_triggered = "False" EndSub Sub Controls_Init Not = "False=True;True=False;" GraphicsWindow.FontName = "Lucida UI" GraphicsWindow.BrushColor = "Black" WQ = Text.GetCharacter(34) ' Lucida UI font width [px] table while the size (height) 100 [px] luw = " =60;!=65;" + WQ + "=82;#=92;$=90;%=119;&=117;'=62;(=69;)=69;" luw = luw + "*=78;+=103;,=59;-=73;.=59;/=77;0=90;1=90;2=90;3=90;4=90;" luw = luw + "5=90;6=90;7=90;8=90;9=90;:=59;\;=59;<=103;\==103;>=103;" luw = luw + "?=76;@=128;A=86;B=94;C=80;D=94;E=86;F=71;G=94;H=93;I=61;" luw = luw + "J=61;K=88;L=61;M=124;N=93;O=94;P=94;Q=94;R=72;S=76;T=71;" luw = luw + "U=93;V=87;W=112;X=88;Y=86;Z=80;[=69;\\=76;]=69;^=103;_=74;" luw = luw + "`=64;{=69;|=65;}=69;~=103; =60;¡=65;¢=90;£=90;¤=88;¥=90;" luw = luw + "¦=65;§=81;¨=79;©=120;ª=73;«=90;¬=103;­=32;®=120;¯=74;°=70;" luw = luw + "±=103;²=73;³=73;´=63;µ=94;¶=83;·=59;¸=54;¹=72;º=78;»=90;" luw = luw + "¼=128;½=129;¾=130;¿=76;À=86;Á=86;Â=86;Ã=86;Ä=86;Å=86;Æ=115;" luw = luw + "Ç=80;È=86;É=86;Ê=86;Ë=86;Ì=61;Í=61;Î=61;Ï=61;Ð=92;Ñ=93;Ò=93;" luw = luw + "Ó=93;Ô=93;Õ=93;Ö=93;×=103;Ø=94;Ù=93;Ú=93;Û=93;Ü=93;Ý=86;" luw = luw + "Þ=94;ß=95;÷=103;ÿ=86;" Controls_triggered = "False" EndSub Sub Controls_OnButtonClicked ' button handler for [Check] and [New Game] buttons and combo box btn = Controls.LastClickedButton If btn = btnCheck Then btnCheck_Clicked = "True" ElseIf btn = btnNew Then btnNew_Clicked = "True" Else Controls_triggered = "True" EndIf EndSub Sub Controls_OnMouseMove ' mouse move handler for combo box Controls_mx = GraphicsWindow.MouseX Controls_my = GraphicsWindow.MouseY Controls_mouseMove = "True" EndSub Sub Controls_OnMouseDown ' mouse down handler for combo box and peg Controls_mx = GraphicsWindow.MouseX Controls_my = GraphicsWindow.MouseY Controls_mouseDown = "True" EndSub Sub Controls_Select ' select an item from combo box menu ' return selected - item selected = 0 If cbProp[i]["x"] <= Controls_mx And Controls_mx <= cbProp[i]["x"] + cbProp[i]["width"] Then For j = 1 To cbProp[i]["nItem"] y1 = cbProp[i]["y"] + j * cbProp[i]["height"] y2 = y1 + cbProp[i]["height"] If y1 <= Controls_my And Controls_my <= y2 Then GraphicsWindow.BrushColor = "#663399FF" GraphicsWindow.PenWidth = 0 If cbSelect = "" Then cbSelect = Shapes.AddRectangle(cbProp[i]["width"], cbProp[i]["height"]) EndIf Shapes.Move(cbSelect, cbProp[i]["x"], y1 - 1) selected = j EndIf EndFor EndIf EndSub ' ---------------------------------------------------------------- ' Code (The pegPlace custom control): ' ---------------------------------------------------------------- ' The rows of ellipses are actually controls derived from the Control Class with a ' pegColor Property (which is initially set to Empty), and a Boolean property: ' CMSEnabled: Sub Peg_Init pegColor = "" CMSEnabled = "" EndSub ' ...an overridden OnPaint event. (I eventually decided regular Green and Blue were ' too dark, so I chose Lime and RoyalBlue instead): Sub Peg_OnPaint If visible[peg] Then GraphicsWindow.BrushColor = bg GraphicsWindow.FillRectangle(pegX[peg] - 1, pegY[peg] - 1, 17, 17) If pegColor[peg] = "Green" Then GraphicsWindow.BrushColor = "Lime" ElseIf pegColor[peg] = "Blue" Then GraphicsWindow.BrushColor = "RoyalBlue" Else GraphicsWindow.BrushColor = pegColor[peg] EndIf GraphicsWindow.FillEllipse(pegX[peg], pegY[peg], 15, 15) GraphicsWindow.PenWidth = 1 GraphicsWindow.PenColor = black GraphicsWindow.DrawEllipse(pegX[peg], pegY[peg], 15, 15) EndIf EndSub ' ...a reset method: Sub Peg_Reset pegColor[peg] = bg Peg_Invalidate() EndSub ' ...a ContextMenuStrip and some handlers and a public event: 'Public Event colorSelected(sender As Object) 'Private WithEvents cms As New ContextMenuStrip Sub Peg_ItemClicked ' param sender As Object ' param e As EventArgs peg = sender c = toolStripMenuItem[peg][1] pegColor[peg] = c Peg_Invalidate() Form_ColorSelected() EndSub Sub Peg_CMS_Opening ' param sender As Object ' param e As System_ComponentModel_CancelEventArgs ' Handles cms_Opening e_Cancel = Not[CMSEnabled] EndSub ' Notice how the ContextMenuStrip only opens for controls in the current line? ' In the itemClicked event, I raised an event to inform the parent control (Form1) ' that color had been set for the pegPlace. On receiving that event notification, ' the code in the form checks whether to enable btnCheck or not. ' This code is duplicated in the control’s MouseDown event, where you can click to ' cycle through the colors: Sub Peg_OnMouseDown ' param e As MouseEventArgs If CMSEnabled[peg] Then 'And Mouse.IsLeftButtonDown Then colors = "1=Red;2=Green;3=Blue;4=Yellow;" Color_FromName = "Red=1;Green=2;Blue=3;Yellow=4;" index = 0 For i = 1 To 4 If pegColor[peg] = colors[i] Then index = i i = 4 ' exit For EndIf EndFor index = Math.Remainder(index, 4) + 1 pegColor[peg] = colors[index] Peg_Invalidate() Form_ColorSelected() EndIf EndSub Sub Peg_Click_Check y = lineIndex For x = 1 To 6 peg = lines[y][x] If visible[peg] Then x1 = pegX[peg] x2 = x1 + size[peg]["x"] y1 = pegY[peg] y2 = y1 + size[peg]["y"] mx = Controls_mx my = Controls_my If (x1 <= mx) And (mx <= x2) And (y1 <= my) And (my <= y2) Then sender = peg Peg_OnMouseDown() EndIf EndIf EndFor EndSub ' In the control’s constructor, I set the size, and setup the ContextMenuStrip: ' ' A ContextMenuStrip_Items property contains objects of type: ToolStripMenuItem. ' In the code I added an array of ToolStripMenuItem, created from an array of ' Strings, using the Array_ConvertAll Generic Method with a Lambda Function to ' convert each string to a ToolStripMenuItem, using the ToolStripMenuItem ' OverLoad that takes a String (the text), an Image (unused in my implementation), ' and an EventHandler (the common itemClicked Sub-Procedure): Sub Peg_New size[peg] = "x=16;y=16;" contextMenuStrip[peg] = cms toolStripMenuItem[peg] = "1=Red;2=Green;3=Blue;4=Yellow;" EndSub Sub Peg_Invalidate Peg_OnPaint() EndSub ' ---------------------------------------------------------------- ' Code (The Form): ' ---------------------------------------------------------------- ' In the Load event, I load some arrays (which are reference types ) and add the ' pegPlace colorSelected event handler, which enables or disables btnCheck. Setting ' the ToolStripComboBox_SelectedIndex sets up the UI and the call to newGame() ' initializes the variables for gameplay: ' ' The winning line array is a string array, which contains the current random ' winning sequence of colors. Colors are assigned with a Form level Random object, ' ensuring maximum randomness (see: Random Class and: Random Constructor (Int32) ): Sub Form_Load ' param sender As Object ' param e As EventArgs ' Handles MyBase_Load title = "mastermind" GraphicsWindow.Title = title black = "#CC000000" bg = "#EEEEEE" GraphicsWindow.BackgroundColor = bg Controls_Init() gw = 154 gh = 329 GraphicsWindow.Width = gw GraphicsWindow.Height = gh item = "1=Beginner;2=Intermediate;3=Advanced;" left = 12 top = 10 Controls_AddComboBox() scoreLine = "1=1;2=2;3=3;4=4;5=37;6=38;" lines[1] = "1=5;2=6;3=7;4=8;5=39;6=40;" lines[2] = "1=9;2=10;3=11;4=12;5=41;6=42;" lines[3] = "1=13;2=14;3=15;4=16;5=43;6=44;" lines[4] = "1=17;2=18;3=19;4=20;5=45;6=46;" lines[5] = "1=21;2=22;3=23;4=24;5=47;6=48;" lines[6] = "1=25;2=26;3=27;4=28;5=49;6=50;" lines[7] = "1=29;2=30;3=31;4=32;5=51;6=52;" lines[8] = "1=33;2=34;3=35;4=36;5=53;6=54;" lines[9] = "1=55;2=56;3=57;4=58;5=59;6=60;" lines[10] = "1=61;2=62;3=63;4=64;5=65;6=66;" lines[11] = "1=67;2=68;3=69;4=70;5=71;6=72;" lines[12] = "1=73;2=74;3=75;4=76;5=77;6=78;" gx = left gy = top + 32 For x = 1 To 6 peg = scoreLine[x] Peg_New() pegX[peg] = gx pegY[peg] = gy gx = gx + size[peg]["x"] * 1.5 EndFor gy = gy + size[peg]["y"] * 2 For y = 1 To 12 gx = left For x = 1 To 6 peg = lines[y][x] Peg_New() pegX[peg] = gx pegY[peg] = gy gx = gx + size[peg]["x"] * 1.5 EndFor gy = gy + size[peg]["y"] * 1.5 EndFor GraphicsWindow.BrushColor = "Black" btnCheck = Controls.AddButton("Check", left, gy) GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "#99" + Text.GetSubText(bg, 2, 6) btnCheckDisabled = Shapes.AddRectangle(100, 26) Shapes.Move(btnCheckDisabled, left, gy) gy = gy + 30 GraphicsWindow.BrushColor = "Black" btnNew = Controls.AddButton("New Game", left, gy) GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "#99" + Text.GetSubText(bg, 2, 6) btnNewDisabled = Shapes.AddRectangle(100, 26) Shapes.Move(btnNewDisabled, left, gy) Form_SelectedIndexChanged() EndSub Sub Form_ColorSelected ' param sender As Object For y = 1 To 12 For x = 1 To 6 If sender = lines[y][x] Then containsAll = "True" For i = 1 To level _peg = lines[y][i] If pegColor[_peg] = bg Then containsAll = "False" EndIf EndFor If containsAll Then Shapes.HideShape(btnCheckDisabled) EndIf EndIf EndFor EndFor EndSub Sub Form_SelectedIndexChanged ' param sender As Object ' param e As EventArgs ' Handles ToolStripComboBox1_SelectedIndexChanged level = selectedIndex + 3 levelSizes[1] = "x=154;y=329;" levelSizes[2] = "x=176;y=373;" levelSizes[3] = "x=192;y=416;" gw = levelSizes[selectedIndex]["x"] GraphicsWindow.Width = gw gh = levelSizes[selectedIndex]["y"] GraphicsWindow.Height = gh GraphicsWindow.BrushColor = bg GraphicsWindow.FillRectangle(0, 0, gw, gh) For x = 1 To 6 peg = scoreLine[x] If x <= level Then visible[peg] = "True" Else visible[peg] = "False" EndIf EndFor For y = 1 To 12 For x = 1 To 6 peg = lines[y][x] If (y <= level * 2) And (x <= level) Then visible[peg] = "True" Else visible[peg] = "False" EndIf EndFor If y <= level * 2 Then gy = pegY[peg] + size[peg]["y"] * 1.5 EndIf EndFor Controls.Move(btnCheck, left, gy) Shapes.Move(btnCheckDisabled, left, gy) gy = gy + 30 Controls.Move(btnNew, left, gy) Shapes.Move(btnNewDisabled, left, gy) Form_NewGame() EndSub Sub Form_NewGame colors = "1=Red;2=Green;3=Blue;4=Yellow;" winningLine = "" For x = 1 To level winningLine[x] = colors[Math.GetRandomNumber(4)] EndFor lineIndex = level * 2 Form_broadcastCMSEnabled() clues = "" For x = 1 To 6 peg = scoreLine[x] Peg_Reset() EndFor For y = 1 To 12 For x = 1 To 6 peg = lines[y][x] Peg_Reset() EndFor EndFor Shapes.ShowShape(btnCheckDisabled) Shapes.ShowShape(btnNewDisabled) Form_Invalidate() EndSub '...The feedback scores are stored in an array of structure (again a Reference Type ' array, although each element is a Value Type), with one element for each row of ' pegPlaces. This array is used in the Form’s Paint event, where the feedback ' ellipses are drawn directly on the form: Sub Form_Paint ' param sender As Object ' param e As PaintEventArgs ' Handles Me_Paint GraphicsWindow.PenWidth = 3 GraphicsWindow.PenColor = black GraphicsWindow.DrawLine(12, 65, gw - 12, 65) If level = 6 Then positions[1] = "x=8;y=2;" positions[2] = "x=13;y=2;" positions[3] = "x=18;y=2;" positions[4] = "x=8;y=7;" positions[5] = "x=13;y=7;" positions[6] = "x=18;y=7;" ElseIf level = 5 Then positions[1] = "x=8;y=2;" positions[2] = "x=13;y=2;" positions[3] = "x=18;y=5;" positions[4] = "x=8;y=7;" positions[5] = "x=13;y=7;" Else positions[1] = "x=8;y=2;" positions[2] = "x=13;y=2;" positions[3] = "x=8;y=7;" positions[4] = "x=13;y=7;" EndIf For y = 12 To 1 Step -1 peg = lines[y][1] If visible[peg] Then For x = 1 To level fillColor = "" If x <= clues[y]["black"] Then fillColor = "Black" Else If x <= clues[y]["black"] + clues[y]["red"] Then fillColor = "Red" EndIf EndIf peg = lines[y][level] right = pegX[peg] + size[peg]["x"] top = pegY[peg] If x = 1 Then GraphicsWindow.BrushColor = bg GraphicsWindow.FillRectangle(right, top + 2, 22, 11) EndIf If fillColor <> "" Then GraphicsWindow.BrushColor = fillColor GraphicsWindow.FillEllipse(right + positions[x]["x"], top + positions[x]["y"] + 2, 3, 3) EndIf GraphicsWindow.PenColor = black GraphicsWindow.PenWidth = 1 GraphicsWindow.DrawEllipse(right + positions[x]["x"], top + positions[x]["y"] + 2, 3, 3) EndFor EndIf EndFor EndSub ' ...The btnCheck Click event checks the guessed sequence of colors against the ' winning sequence of colors. During this checking, the feedback for the row being ' checked is calculated, then the Paint event is invoked (Control_Invalidate Method) ' to draw the feedback on the form. ' Also in this event, the app. checks if the game is over, either as a result of a ' correct guess, or because the eight, ten, or twelve guesses have been unsuccessful. ' The two Buttons, btnCheck, and btnNew are enabled or disabled in this event, ' depending on the state of play: Sub Form_btnCheck_Click ' param sender As Object ' param e As EventArgs ' Handles btnCheck_Click line = "" clues[lineIndex] = "black=0;red=0;" countB = 0 countR = 0 For x = 1 To level peg = lines[lineIndex][x] lineColors[x] = pegColor[peg] If winningLine[x] = lineColors[x] Then countB = countB + 1 EndIf EndFor For x = 1 To level If winningLine[x] <> lineColors[x] Then For x2 = 1 To level If (winningLine[x2] <> lineColors[x2]) And (winningLine[x] = lineColors[x2]) Then temp = lineColors[x] lineColors[x] = lineColors[x2] countR = countR + 1 lineColors[x2] = temp If winningLine[x2] = lineColors[x2] Then countR = countR + 1 EndIf EndIf EndFor EndIf EndFor clues[lineIndex]["black"] = countB clues[lineIndex]["red"] = countR Form_Invalidate() If clues[lineIndex]["black"] = level Then GraphicsWindow.ShowMessage("You've won!", title) lineIndex = 0 Form_broadcastCMSEnabled() Shapes.HideShape(btnNewDisabled) Shapes.ShowShape(btnCheckDisabled) Else Shapes.ShowShape(btnCheckDisabled) lineIndex = lineIndex - 1 Form_broadcastCMSEnabled() If lineIndex = 0 Then GraphicsWindow.ShowMessage("You've lost!", title) Shapes.HideShape(btnNewDisabled) Else Goto FbCC_Return EndIf EndIf For x = 1 To level peg = scoreLine[x] pegColor[peg] = winningLine[x] Peg_Invalidate() EndFor FbCC_Return: EndSub Sub Form_Invalidate Form_Paint() EndSub ' ...This method is used after each line is checked to change all of the pegPlaces’ ' CMSEnabled property: Sub Form_broadcastCMSEnabled ' param lineIndex For y = 1 To 12 For x = 1 To 6 peg = lines[y][x] If y = lineIndex Then CMSEnabled[peg] = "True" Else CMSEnabled[peg] = "False" EndIf EndFor EndFor EndSub ' ...The btnNew Click event calls newGame() which puts a new random sequence ' of colors in the winningLine array, then resets all of the Class level variables ' back to their original state, for a fresh start: Sub Form_btnNew_Click ' param sender As Object ' param e As EventArgs ' Handles btnNew_Click Form_NewGame() EndSub End>GMV958-0.sb< Start>GMW425.sb< X = -2.0 Y = -1.4 width = 3.0 height = 3.0 winWidth = GraphicsWindow.Width winHeight = GraphicsWindow.Height Hue = 0 Saturation = 50 Lightness = 50 precision = 2 stripy = "False" For nowX = X To X+width Step width/winWidth*precision screenY = 0 For nowY = Y To Y+height Step height/winHeight*precision realVal = nowX imagVal = nowY InMandelbrot() GraphicsWindow.BrushColor = color GraphicsWindow.FillRectangle(screenX,screenY,precision,precision) screenY = screenY+precision EndFor screenX = screenX+precision EndFor Sub InMandelbrot realCopy = realVal imagCopy = imagVal For i = 1 To 20 a = realCopy b = imagCopy PowerComplex() imagCopy = squareImag+imagVal realCopy = squareReal+realVal dist = realCopy*realCopy+imagCopy*imagCopy If dist>4 Then Hue = i*360/20 HSL_2_RGB() color = GraphicsWindow.GetColorFromRGB(RedCompo,GreenCompo,BlueCompo) i = 20 ElseIf i = 19 And stripy <> "True" Then Hue = 360 HSL_2_RGB() color = GraphicsWindow.GetColorFromRGB(RedCompo,GreenCompo,BlueCompo) EndIf EndFor EndSub Sub HSL_2_RGB H = Hue/360 S = Saturation/100 L = Lightness/100 If L < 0.5 Then tmp1 = L+L*S Else tmp1 = L+S-L*S EndIf tmp2 = 2*L-tmp1 tmpRGB[1] = H+1/3 tmpRGB[2] = H tmpRGB[3] = H-1/3 If 6*tmpRGB[1] < 1 Then RedCompo = tmp2+(tmp1-tmp2)*6*tmpRGB[1] ElseIf 2*tmpRGB[1] < 1 Then RedCompo = tmp1 ElseIf 3*tmpRGB[1] < 2 Then RedCompo = tmp2+(tmp1-tmp2)*(2/3-tmpRGB[1])*6 Else RedCompo = tmp2 EndIf If 6*tmpRGB[2] < 1 Then GreenCompo = tmp2+(tmp1-tmp2)*6*tmpRGB[2] ElseIf 2*tmpRGB[2] < 1 Then GreenCompo = tmp1 ElseIf 3*tmpRGB[2] < 2 Then GreenCompo = tmp2+(tmp1-tmp2)*(2/3-tmpRGB[2])*6 Else GreenCompo = tmp2 EndIf If 6*tmpRGB[3] < 1 Then BlueCompo = tmp2+(tmp1-tmp2)*6*tmpRGB[3] ElseIf 2*tmpRGB[3] < 1 Then BlueCompo = tmp1 ElseIf 3*tmpRGB[3] < 2 Then BlueCompo = tmp2+(tmp1-tmp2)*(2/3-tmpRGB[3])*6 Else BlueCompo = tmp2 EndIf BlueCompo = Math.Round(Math.Max(BlueCompo*255,0)) RedCompo = Math.Round(Math.Max(RedCompo*255,0)) GreenCompo = Math.Round(Math.Max(GreenCompo*255,0)) EndSub Sub PowerComplex squareReal = a*a*a-3*a*b*b squareImag = 3*a*a*b-b*b*b EndSub End>GMW425.sb< Start>GMX344.sb< ' Chalk Drawing MaRch 2017 ' Updated mahreen miangul ' Orignal Nonki GraphicsWindow.Show() GraphicsWindow.width = 1080 GraphicsWindow.Height = 420 GraphicsWindow.BackgroundColor = "rosybrown" GraphicsWindow.Title = "Face" GraphicsWindow.PenWidth = 12 GraphicsWindow.Pencolor = "darkslategray"' mahreen miangul ' Drawing Face ' MaRch 2017 GraphicsWindow.Title = "Face" GraphicsWindow.Width = "1080" GraphicsWindow.Height = "420" GraphicsWindow.BackgroundColor = "LightYellow" GraphicsWindow.FontName = "Times New Roman" GraphicsWindow.FontSize = 120 GraphicsWindow.FontItalic = "True" GraphicsWindow.BrushColor = "Silver" ' Text shadow color GraphicsWindow.DrawText(5, 5, "mahreen miangul!") ' Shadow position/text GraphicsWindow.BrushColor = "teal" ' Text color GraphicsWindow.DrawText(0, 0, "mahreen miangul!") ' Position and text ' ears GraphicsWindow.brushcolor = "bisque" graphicswindow.fillellipse(480,170,40,50)'----1 param = "x=480;y=170;width=40;height=50;" DrawEllipse() graphicswindow.fillellipse(630,170,40,50)'----2 param = "x=630;y=170;width=40;height=50;" DrawEllipse() ' face graphicswindow.fillellipse(500,120,150,150) param = "x=500;y=120;width=150;height=150;" DrawEllipse() ' mouth GraphicsWindow.PenWidth = 8 GraphicsWindow.BrushColor = "firebrick" ' eyes GraphicsWindow.FillEllipse(530,180,15,15) param = "x=530;y=180;width=15;height=15;"'----1 DrawEllipse() GraphicsWindow.FillEllipse(600,180,15,15) param = "x=600;y=180;width=15;height=15;"'----2 DrawEllipse() GraphicsWindow.FillEllipse(555, 240,35, 16) param = "x=555;y=240;width=35;height=16" DrawEllipse() ' nose param = "x=565;y=191;width=12;height=30;" DrawEllipse() GraphicsWindow.FillEllipse(565,191,12,30) ' hat GraphicsWindow.FillEllipse(500,110,150,50) param = "x=500;y=110;width=150;height=50;" DrawEllipse() param = "x=600;y=128;width=15;height=15;" DrawEllipse() ' mushtash param = "x1=580;y1=228;x2=600;y2=233;"'--------1 DrawLine() param = "x1=560;y1=228;x2=533;y2=236;"'--------2 DrawLine() Sub DrawLine pc = GraphicsWindow.PenColor bc = GraphicsWindow.BrushColor GraphicsWindow.BrushColor = pc pw = GraphicsWindow.PenWidth x1 = param["x1"] y1 = param["y1"] x2 = param["x2"] y2 = param["y2"] len = Math.SquareRoot((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)) For k = 0 To 1 Step pw / len / 3 x = x1 * (1 - k) + x2 * k y = y1 * (1 - k) + y2 * k _dx = Math.GetRandomNumber(2) - 1 _dy = Math.GetRandomNumber(2) - 1 _pw = (Math.GetRandomNumber(2) / 10 + 0.9) * pw GraphicsWindow.FillEllipse(x - _pw / 2 + _dx, y - _pw / 2 + _dy, _pw, _pw) EndFor GraphicsWindow.BrushColor = bc EndSub Sub DrawEllipse pc = GraphicsWindow.PenColor bc = GraphicsWindow.BrushColor GraphicsWindow.BrushColor = pc pw = GraphicsWindow.PenWidth x = param["x"] y = param["y"] width = param["width"] height = param["height"] a = width / 2 b = height / 2 len = 2 * Math.Pi * Math.Max(a, b) For θ = 0 To 2 * Math.Pi Step pw / len * 3 _x = (x + a) + a * Math.Cos(θ) _y = (y + b) + b * Math.Sin(θ) _dx = Math.GetRandomNumber(2) - 1 _dy = Math.GetRandomNumber(2) - 1 _pw = (Math.GetRandomNumber(2) / 10 + 0.9) * pw GraphicsWindow.FillEllipse(_x - _pw / 2 + _dx, _y - _pw / 2 + _dy, _pw, _pw) EndFor GraphicsWindow.BrushColor = bc EndSub End>GMX344.sb< Start>GND628.sb< dw=1200 dh=900 GraphicsWindow .Left =0 GraphicsWindow.Top=0 'TextWindow.Show () TextWindow.Left=1230 TextWindow.top=0 TextWindow.BackgroundColor="darkblue TextWindow.ForegroundColor="lime TextWindow.Hide () LDUtilities.ShowErrors="false nln=text.GetCharacter (13)+Text.GetCharacter(10) For z=0 To 5 Step .4 For f=0 to 360 Step 10 cc=cc+f/50+":"+ldmath.FixDecimal (LDMath.Sin (f)*4*LDMath.Sin(z*30) 2)+":"+z+":" EndFor endfor ln=LDText.Split (cc,":" ) GraphicsWindow.BackgroundColor="teal GraphicsWindow.Width=dw GraphicsWindow.Height=dh view3D = LD3DView.AddView(dw,dh,"true") 'Will not clip to size if window rescaled LD3DView.AddDirectionalLight (view3D,"gold",-1 ,-1 ,-1) LD3DView.AddDirectionalLight(view3D,"white",1,1,1) LD3DView.AddAmbientLight(view3D,"#55888888") LD3DView.ResetCamera(view3D,0,10,10, -1, -1, -1, "","","") nrmz="0 0 1: 0 0 1: 0 0 1: 0 0 1: 0 0 1: 0 0 1 indices = "0 1 2 3 4 5 ii=1 ta[0]=1 rt="" args=0 txtr="0 0 :1 0 :1 1"': 1 1 :0 1 :0 0 im=ImageList .LoadImage ("e:\wood.jpg") LDImage.EffectGamma (im 2.5) Sub addnd al=ldtext.Split (args[1] ":") For f=1 To Array.GetItemCount (al) ag=ldtext.Split (al[f] " ") rt="" For r=1 To 3 rt=rt+(ldarray.GetValue (lsx ag[r]))+": rt=rt+ldarray.GetValue (lsz ag[r])+": rt=rt+(ldarray.GetValue (lsy ag[r]))+": EndFor 'TextWindow.WriteLine (">>"+rt) o1=LD3DView.AddGeometry(view3D,rt,indices,nrmz,"White","D") LD3DView.AddImage (view3D o1 txtr im "D") EndFor endsub Sub addnd1 al=ldtext.Split (args[1] ":") For f=1 To Array.GetItemCount (al) ag=ldtext.Split (al[f] " ") rt="" For r=1 To 3 rt=text.Append (rt ldarray.GetValue (lsx ag[r])+":") rt=text.Append (rt ldarray.GetValue (lsz ag[r])+":") rt=text.Append (rt (ldarray.GetValue (lsy ag[r]))+":") EndFor o1=LD3DView.AddGeometry(view3D,rt,indices,nrmz,"White","D") LD3DView.ReverseNormals (view3D o1) LD3DView.AddImage (view3D o1 txtr im "D") EndFor endsub Sub make2tr al=args ret=al[1]+" " ret=text.Append (ret, al[2]+" ") ret=text.Append (ret, al[3]+":") ret=text.Append (ret, al[1]+" ") ret=text.Append (ret, al[3]+" ") ret=text.Append (ret, al[4]+":") 'TextWindow.WriteLine (ret) return=ret EndSub lsx=LDArray.Create (2000) lsz=LDArray.Create (2000) lsy=LDArray.Create (2000) ix=1 For f=1 To Array.GetItemCount (ln) Step 3 LDarray.SetValue (lsx ix ln[f]) LDarray.SetValue (lsz ix ln[f+1]) LDarray.SetValue (lsy ix ln[f+2]) nxx: ix=ix+1 endfor For ro=0 to 20 GraphicsWindow.Title=ro+"/20" For o=0 to 36 ff=ldcall.Function4 ("make2tr" o+1+ro*37 o+ro*37 o+38+ro*37 o+39+ro*37) '"2 1 38 39") ldcall.Function ("addnd" ff) endfor endfor GraphicsWindow.Title=(ix-1) +"nodes" 'LD3DView.AutoControl ("true" "true", -1 .25) ya=10 r35=20 ai=1 aa=45 LDEvents.MouseWheel=mww GraphicsWindow.KeyDown=kdd cs=LD3DView.AddSphere (view3D .055 30 "red" "E") Sub sset GraphicsWindow.Title =ii px=ldarray.GetValue(lsx ii) py=ldarray.GetValue(lsy ii) pz=ldarray.GetValue(lsz ii) ' LD3DView.ModifyObject (view3D sf[ii] "H") ' LD3DView.ModifyObject (view3D sf[oi] "S") oi=ii LD3DView.TranslateGeometry(view3D cs px pz py)'lsxx[ii] lsxz[ii] lsxy[ii] 'Addtube (view3D LDList.GetAt (lss ii) .1 10 "red" "E") ' EndSub While "true For aa=0 To 360 Step .5 If Text.IsSubText ("space up down d1 home" lk) Then aa=aa-.5 else px= LDMath.Cos(aa) py= LDMath.sin (aa) LD3DView.ResetCamera(view3D, px*r35,ya,py*r35, -px, -.5, -py, "","","") endif Program.Delay (15) EndFor EndWhile Sub kdd lk= text.ConvertToLowerCase (GraphicsWindow.LastKey) 'GraphicsWindow.Title =lk If (lk="up") then ii=ii-1 If ii<1 Then ii=1 endif sset() ElseIf lk="d1" then TextWindow.Write ("Node: ") ii=TextWindow.ReadNumber() ElseIf lk="down" then ii=ii+1 sset() ElseIf lk="home" then ii=1 sset() EndIf GraphicsWindow.Title =ii xx: EndSub Sub mww If GraphicsWindow.LastKey="LeftCtrl" then ya=ya+ LDEvents.LastMouseWheelDelta/5 else r35=r35+ LDEvents.LastMouseWheelDelta/3 endif EndSub End>GND628.sb< Start>GNF051.sb< ' Generated By GUI Designer v2.0.1 GraphicsWindow.Show() GraphicsWindow.Width = GraphicsWindow.Width + 800 GraphicsWindow.Height = 441 GraphicsWindow.BrushColor = "darkblue GraphicsWindow.BackgroundColor = "teal GraphicsWindow.BrushColor = "White rect[1] = Shapes.AddRectangle(70,60) Shapes.Move(rect[1],147,158) line[1] = Shapes.AddLine(153,190,169,204) line[2] = Shapes.AddLine(169,203,198,173) Text1 = Shapes.AddText("State") Shapes.Move(Text1,271,178) GraphicsWindow.BrushColor = "Black Text2 = Shapes.AddText("On") Shapes.Move(Text2,320,178) state = "on" GraphicsWindow.MouseDown = OnMD Sub OnMD minecraftX = GraphicsWindow.MouseX minecraftY = GraphicsWindow.MouseY widthofImage = 147 heightOfImage = 158 If minecraftX >= Shapes.GetLeft(rect[1]) And minecraftX <= Shapes.GetLeft(rect[1]) + widthofImage Then If minecraftY >= Shapes.GetTop(rect[1]) And minecraftY <= Shapes.GetTop(rect[1]) + heightOfImage Then If state = "on" Then Shapes.HideShape(line[1]) Shapes.HideShape(line[2]) state = "off" Shapes.SetText(Text2,state) ElseIf state = "off" Then Shapes.ShowShape(line[1]) Shapes.ShowShape(line[2]) state = "on" Shapes.SetText(Text2,state) EndIf EndIf EndIf EndSub End>GNF051.sb< Start>GNF678-0.sb< ' Moon ' Version 0.2 ' Copyright © 2019 Nonki Takahashi. The MIT License. ' 2019-01-05 9:03:11 PM Shapes generated by Shapes 2.3b. ' Program ID GNF678-0 GraphicsWindow.Title = "Moon" SB_Workaround() gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh size = 260 GraphicsWindow.BackgroundColor = "Black" ' initialize shapes Shapes_Init() ' add shapes scale = 0.6 angle = 0 iMin = 1 iMax = Array.GetItemCount(shape) Shapes_Add() DrawStars() mask = "left=2;right=3;dark=4;light=5;h1=17;h2=18;h3=19;h4=20;" While "True" Program.Delay(500) angle = angle - 12 If angle < 0 Then angle = angle + 360 EndIf RotateMoon() EndWhile Sub DrawStars ox = shX + 139 * scale oy = shY + 130 * scale r = 130 * scale For i = 1 To 500 x = Math.GetRandomNumber(gw) y = Math.GetRandomNumber(gh) s = Math.GetRandomNumber(4) l = Text.GetSubText("ABCDEF", Math.GetRandomNumber(6), 1) GraphicsWindow.PenWidth = 0 c = "#" + l + l + l + l + l + l GraphicsWindow.PenColor = c GraphicsWindow.BrushColor = c dx = x - ox dy = y - oy If r + s / 2 < Math.SquareRoot(dx * dx + dy * dy) Then star = Shapes.AddEllipse(s, s) Shapes.Move(star, x - s / 2, y - s / 2) EndIf EndFor EndSub Sub RotateMoon i = mask["left"] shp = shape[i] If (0 < angle) And (angle <= 180) Then Shapes.ShowShape(shp["obj"]) Else Shapes.HideShape(shp["obj"]) EndIf i = mask["right"] shp = shape[i] If (180 <= angle) And (angle < 360) Then Shapes.ShowShape(shp["obj"]) Else Shapes.HideShape(shp["obj"]) EndIf _angle = Math.GetRadians(angle) i = mask["light"] shp = shape[i] k = Math.Abs(Math.Cos(_angle)) If (0 < angle And angle < 90) Or (270 < angle And angle < 360) Then If k < 0.1 Then Shapes.HideShape(shp["obj"]) Else Shapes.ShowShape(shp["obj"]) Shapes.Zoom(shp["obj"], k, 1) EndIf Else Shapes.HideShape(shp["obj"]) EndIf i = mask["dark"] shp = shape[i] k = Math.Abs(Math.Cos(_angle)) If 90 < angle And angle < 270 Then If k < 0.1 Then Shapes.HideShape(shp["obj"]) Else Shapes.ShowShape(shp["obj"]) Shapes.Zoom(shp["obj"], k, 1) EndIf Else Shapes.HideShape(shp["obj"]) EndIf ' hills i = mask["h1"] shp = shape[i] If (228 <= angle) Or (angle <= 36) Then Shapes.ShowShape(shp["obj"]) Else Shapes.HideShape(shp["obj"]) EndIf i = mask["h2"] shp = shape[i] If (240 <= angle) Or (angle <= 48) Then Shapes.ShowShape(shp["obj"]) Else Shapes.HideShape(shp["obj"]) EndIf i = mask["h3"] shp = shape[i] If (264 <= angle) Or (angle <= 72) Then Shapes.ShowShape(shp["obj"]) Else Shapes.HideShape(shp["obj"]) EndIf i = mask["h4"] shp = shape[i] If (288 <= angle) Or (angle <= 96) Then Shapes.ShowShape(shp["obj"]) Else Shapes.HideShape(shp["obj"]) EndIf EndSub Sub Shapes_Init ' Shapes | Initialize shapes data ' return shX, shY - current position of shapes ' return shape - array of shapes shX = 61 ' x offset shY = 70 ' y offset shape = "" shape[1] = "func=ell;x=9;y=0;width=260;height=260;bc=#FFFFCC;pw=0;" shape[2] = "func=rect;x=9;y=0;width=130;height=260;bc=#000000;pw=0;" shape[3] = "func=rect;x=139;y=0;width=130;height=260;bc=#000000;pw=0;" shape[4] = "func=ell;x=9;y=0;width=260;height=260;bc=#000000;pw=0;" shape[5] = "func=ell;x=9;y=0;width=260;height=260;bc=#FFFFCC;pw=0;" shape[6] = "func=ell;x=216.32;y=58.47;width=35;height=21;angle=57;bc=#08000000;pw=0;" shape[7] = "func=ell;x=220;y=102;width=38;height=26;angle=70;bc=#08000000;pw=0;" shape[8] = "func=ell;x=179;y=80;width=46;height=42;angle=58;bc=#08000000;pw=0;" shape[9] = "func=ell;x=205.59;y=134.03;width=21;height=16;angle=57;bc=#08000000;pw=0;" shape[10] = "func=ell;x=142;y=46;width=53;height=39;angle=385;bc=#08000000;pw=0;" shape[11] = "func=ell;x=56;y=37;width=89;height=75;angle=327;bc=#08000000;pw=0;" shape[12] = "func=ell;x=9.38;y=124.31;width=82;height=49;angle=57;bc=#08000000;pw=0;" shape[13] = "func=ell;x=84.37;y=135.98;width=66;height=48;angle=71;bc=#08000000;pw=0;" shape[14] = "func=ell;x=73.43;y=173.2;width=34;height=26;angle=392;bc=#08000000;pw=0;" shape[15] = "func=ell;x=131;y=90;width=41;height=51;angle=46;bc=#08000000;pw=0;" shape[16] = "func=ell;x=0;y=77;width=77;height=43;angle=287;bc=#08000000;pw=0;" shape[17] = "func=ell;x=37.49;y=107.24;width=12;height=10;angle=60;bc=#FFFFCC;pw=0;" shape[18] = "func=ell;x=55.79;y=138.08;width=17;height=11;angle=65;bc=#FFFFCC;pw=0;" shape[19] = "func=ell;x=90;y=135;width=43;height=13;angle=58;bc=#FFFFCC;pw=0;" shape[20] = "func=ell;x=155;y=109;width=22;height=21;angle=357;bc=#FFFFCC;pw=0;" EndSub Sub Math_CartesianToPolar ' Math | convert cartesian coodinate to polar coordinate ' param x, y - cartesian coordinate ' return r, a - polar coordinate r = Math.SquareRoot(x * x + y * y) If x = 0 And y > 0 Then a = 90 ' [degree] ElseIf x = 0 And y < 0 Then a = -90 ElseIf x = 0 Then a = 0 Else a = Math.ArcTan(y / x) * 180 / Math.Pi EndIf If x < 0 Then a = a + 180 ElseIf x > 0 And y < 0 Then a = a + 360 EndIf EndSub Sub SB_RotateWorkaround ' Small Basic | Rotate workaround for Silverlight ' param shp - current shape ' param x, y - original coordinate ' param alpha - angle [radian] ' returns x, y - workaround coordinate If shp["func"] = "tri" Then x1 = -Math.Floor(shp["x3"] / 2) y1 = -Math.Floor(shp["y3"] / 2) ElseIf shp["func"] = "line" Then x1 = -Math.Floor(Math.Abs(shp["x1"] - shp["x2"]) / 2) y1 = -Math.Floor(Math.Abs(shp["y1"] - shp["y2"]) / 2) EndIf ox = x - x1 oy = y - y1 x = x1 * Math.Cos(alpha) - y1 * Math.Sin(alpha) + ox y = x1 * Math.Sin(alpha) + y1 * Math.Cos(alpha) + oy EndSub Sub SB_Workaround ' Small Basic | Workaround for Silverlight ' returns silverlight - "True" if in remote color = GraphicsWindow.GetPixel(0, 0) If Text.GetLength(color) > 7 Then silverlight = "True" msWait = 300 Else silverlight = "False" EndIf EndSub Sub Shapes_Add ' Shapes | add shapes as shapes data ' param iMin, iMax - shape indices to add ' param shape - array of shapes ' param scale - 1 if same scale ' return shWidth, shHeight - total size of shapes ' return shAngle - current angle of shapes Stack.PushValue("local", i) Stack.PushValue("local", x) Stack.PushValue("local", y) Shapes_CalcWidthAndHeight() s = scale For i = iMin To iMax shp = shape[i] GraphicsWindow.PenWidth = shp["pw"] * s If shp["pw"] > 0 Then GraphicsWindow.PenColor = shp["pc"] EndIf If Text.IsSubText("rect|ell|tri|text", shp["func"]) Then GraphicsWindow.BrushColor = shp["bc"] EndIf If shp["func"] = "rect" Then shp["obj"] = Shapes.AddRectangle(shp["width"] * s, shp["height"] * s) ElseIf shp["func"] = "ell" Then shp["obj"] = Shapes.AddEllipse(shp["width"] * s, shp["height"] * s) ElseIf shp["func"] = "tri" Then shp["obj"] = Shapes.AddTriangle(shp["x1"] * s, shp["y1"] * s, shp["x2"] * s, shp["y2"] * s, shp["x3"] * s, shp["y3"] * s) ElseIf shp["func"] = "line" Then shp["obj"] = Shapes.AddLine(shp["x1"] * s, shp["y1"] * s, shp["x2"] * s, shp["y2"] * s) ElseIf shp["func"] = "text" Then If silverlight Then fs = Math.Floor(shp["fs"] * 0.9) Else fs = shp["fs"] EndIf GraphicsWindow.FontSize = fs * s GraphicsWindow.FontName = shp["fn"] shp["obj"] = Shapes.AddText(shp["text"]) EndIf x = shp["x"] y = shp["y"] shp["rx"] = x shp["ry"] = y If silverlight And Text.IsSubText("tri|line", shp["func"]) Then alpha = Math.GetRadians(shp["angle"]) SB_RotateWorkaround() shp["wx"] = x shp["wy"] = y EndIf Shapes.Move(shp["obj"], shX + x * s, shY + y * s) If Text.IsSubText("rect|ell|tri|text", shp["func"]) And (shp["angle"] <> 0) And (shp["angle"] <> "") Then Shapes.Rotate(shp["obj"], shp["angle"]) EndIf shape[i] = shp EndFor shAngle = 0 y = Stack.PopValue("local") x = Stack.PopValue("local") i = Stack.PopValue("local") EndSub Sub Shapes_CalcRotatePos ' Shapes | Calculate position for rotated shape ' param["x"], param["y"] - position of a shape ' param["width"], param["height"] - size of a shape ' param ["cx"], param["cy"] - center of rotation ' param ["angle"] - rotate angle ' return x, y - rotated position of a shape _cx = param["x"] + param["width"] / 2 _cy = param["y"] + param["height"] / 2 x = _cx - param["cx"] y = _cy - param["cy"] Math_CartesianToPolar() a = a + param["angle"] x = r * Math.Cos(a * Math.Pi / 180) y = r * Math.Sin(a * Math.Pi / 180) _cx = x + param["cx"] _cy = y + param["cy"] x = _cx - param["width"] / 2 y = _cy - param["height"] / 2 EndSub Sub Shapes_CalcWidthAndHeight ' Shapes | Calculate total width and height of shapes ' param iMin, iMax - shape indices to add ' return shWidth, shHeight - total size of shapes For i = iMin To iMax shp = shape[i] If shp["func"] = "tri" Or shp["func"] = "line" Then xmin = shp["x1"] xmax = shp["x1"] ymin = shp["y1"] ymax = shp["y1"] If shp["x2"] < xmin Then xmin = shp["x2"] EndIf If xmax < shp["x2"] Then xmax = shp["x2"] EndIf If shp["y2"] < ymin Then ymin = shp["y2"] EndIf If ymax < shp["y2"] Then ymax = shp["y2"] EndIf If shp["func"] = "tri" Then If shp["x3"] < xmin Then xmin = shp["x3"] EndIf If xmax < shp["x3"] Then xmax = shp["x3"] EndIf If shp["y3"] < ymin Then ymin = shp["y3"] EndIf If ymax < shp["y3"] Then ymax = shp["y3"] EndIf EndIf shp["width"] = xmax - xmin shp["height"] = ymax - ymin EndIf If i = 1 Then shWidth = shp["x"] + shp["width"] shHeight = shp["y"] + shp["height"] Else If shWidth < shp["x"] + shp["width"] Then shWidth = shp["x"] + shp["width"] EndIf If shHeight < shp["y"] + shp["height"] Then shHeight = shp["y"] + shp["height"] EndIf EndIf shape[i] = shp EndFor EndSub Sub Shapes_Move ' Shapes | Move shapes ' param iMin, iMax - shape indices to add ' param shape - array of shapes ' param scale - to zoom ' param x, y - position to move ' return shX, shY - new position of shapes Stack.PushValue("local", i) s = scale shX = x shY = y For i = iMin To iMax shp = shape[i] If silverlight And Text.IsSubText("tri|line", shp["func"]) Then _x = shp["wx"] _y = shp["wy"] Else _x = shp["rx"] _y = shp["ry"] EndIf Shapes.Move(shp["obj"], shX + _x * s, shY + _y * s) EndFor i = Stack.PopValue("local") EndSub Sub Shapes_Remove ' Shapes | Remove shapes ' param iMin, iMax - shapes indices to remove ' param shape - array of shapes Stack.PushValue("local", i) For i = iMin To iMax shp = shape[i] Shapes.Remove(shp["obj"]) EndFor i = Stack.PopValue("local") EndSub Sub Shapes_Rotate ' Shapes | Rotate shapes ' param iMin, iMax - shapes indices to rotate ' param shape - array of shapes ' param cx, cy - rotation center ' param scale - to zoom ' param angle - to rotate Stack.PushValue("local", i) Stack.PushValue("local", x) Stack.PushValue("local", y) s = scale param["angle"] = angle If cx <> "" Then param["cx"] = cx Else cx = "" ' to avoid syntax error param["cx"] = shWidth / 2 EndIf If cy <> "" Then param["cy"] = cy Else cy = "" ' to avoid syntax error param["cy"] = shHeight / 2 EndIf For i = iMin To iMax shp = shape[i] param["x"] = shp["x"] param["y"] = shp["y"] param["width"] = shp["width"] param["height"] = shp["height"] Shapes_CalcRotatePos() shp["rx"] = x shp["ry"] = y If silverlight And Text.IsSubText("tri|line", shp["func"]) Then alpha = Math.GetRadians(angle + shp["angle"]) SB_RotateWorkAround() shp["wx"] = x shp["wy"] = y EndIf Shapes.Move(shp["obj"], shX + x * s, shY + y * s) Shapes.Rotate(shp["obj"], angle + shp["angle"]) shape[i] = shp EndFor y = Stack.PopValue("local") x = Stack.PopValue("local") i = Stack.PopValue("local") EndSub End>GNF678-0.sb< Start>GNF678.sb< ' Moon ' Copyright © 2019 Nonki Takahashi. The MIT License. ' 2019-01-05 9:03:11 PM Shapes generated by Shapes 2.3b. GraphicsWindow.Title = "Moon" SB_Workaround() gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh size = 260 GraphicsWindow.BackgroundColor = "Black" ' initialize shapes Shapes_Init() ' add shapes scale = 0.6 angle = 0 iMin = 1 iMax = Array.GetItemCount(shape) Shapes_Add() DrawStars() mask = "left=2;right=3;dark=4;light=5;h1=17;h2=18;h3=19;h4=20;" While "True" Program.Delay(500) angle = angle + 12 If 360 <= angle Then angle = angle - 360 EndIf RotateMoon() EndWhile Sub DrawStars ox = shX + 139 * scale oy = shY + 130 * scale r = 130 * scale For i = 1 To 500 x = Math.GetRandomNumber(gw) y = Math.GetRandomNumber(gh) s = Math.GetRandomNumber(4) l = Text.GetSubText("ABCDEF", Math.GetRandomNumber(6), 1) GraphicsWindow.PenWidth = 0 c = "#" + l + l + l + l + l + l GraphicsWindow.PenColor = c GraphicsWindow.BrushColor = c dx = x - ox dy = y - oy If r + s / 2 < Math.SquareRoot(dx * dx + dy * dy) Then star = Shapes.AddEllipse(s, s) Shapes.Move(star, x - s / 2, y - s / 2) EndIf EndFor EndSub Sub RotateMoon i = mask["left"] shp = shape[i] If (0 < angle) And (angle <= 180) Then Shapes.ShowShape(shp["obj"]) Else Shapes.HideShape(shp["obj"]) EndIf i = mask["right"] shp = shape[i] If (180 <= angle) And (angle < 360) Then Shapes.ShowShape(shp["obj"]) Else Shapes.HideShape(shp["obj"]) EndIf _angle = Math.GetRadians(angle) i = mask["light"] shp = shape[i] k = Math.Abs(Math.Cos(_angle)) If (0 < angle And angle < 90) Or (270 < angle And angle < 360) Then If k < 0.1 Then Shapes.HideShape(shp["obj"]) Else Shapes.ShowShape(shp["obj"]) Shapes.Zoom(shp["obj"], k, 1) EndIf Else Shapes.HideShape(shp["obj"]) EndIf i = mask["dark"] shp = shape[i] k = Math.Abs(Math.Cos(_angle)) If 90 < angle And angle < 270 Then If k < 0.1 Then Shapes.HideShape(shp["obj"]) Else Shapes.ShowShape(shp["obj"]) Shapes.Zoom(shp["obj"], k, 1) EndIf Else Shapes.HideShape(shp["obj"]) EndIf ' hills i = mask["h1"] shp = shape[i] If (228 <= angle) Or (angle <= 36) Then Shapes.ShowShape(shp["obj"]) Else Shapes.HideShape(shp["obj"]) EndIf i = mask["h2"] shp = shape[i] If (240 <= angle) Or (angle <= 48) Then Shapes.ShowShape(shp["obj"]) Else Shapes.HideShape(shp["obj"]) EndIf i = mask["h3"] shp = shape[i] If (264 <= angle) Or (angle <= 72) Then Shapes.ShowShape(shp["obj"]) Else Shapes.HideShape(shp["obj"]) EndIf i = mask["h4"] shp = shape[i] If (288 <= angle) Or (angle <= 96) Then Shapes.ShowShape(shp["obj"]) Else Shapes.HideShape(shp["obj"]) EndIf EndSub Sub Shapes_Init ' Shapes | Initialize shapes data ' return shX, shY - current position of shapes ' return shape - array of shapes shX = 61 ' x offset shY = 70 ' y offset shape = "" shape[1] = "func=ell;x=9;y=0;width=260;height=260;bc=#FFFFCC;pw=0;" shape[2] = "func=rect;x=9;y=0;width=130;height=260;bc=#000000;pw=0;" shape[3] = "func=rect;x=139;y=0;width=130;height=260;bc=#000000;pw=0;" shape[4] = "func=ell;x=9;y=0;width=260;height=260;bc=#000000;pw=0;" shape[5] = "func=ell;x=9;y=0;width=260;height=260;bc=#FFFFCC;pw=0;" shape[6] = "func=ell;x=216.32;y=58.47;width=35;height=21;angle=57;bc=#08000000;pw=0;" shape[7] = "func=ell;x=220;y=102;width=38;height=26;angle=70;bc=#08000000;pw=0;" shape[8] = "func=ell;x=179;y=80;width=46;height=42;angle=58;bc=#08000000;pw=0;" shape[9] = "func=ell;x=205.59;y=134.03;width=21;height=16;angle=57;bc=#08000000;pw=0;" shape[10] = "func=ell;x=142;y=46;width=53;height=39;angle=385;bc=#08000000;pw=0;" shape[11] = "func=ell;x=56;y=37;width=89;height=75;angle=327;bc=#08000000;pw=0;" shape[12] = "func=ell;x=9.38;y=124.31;width=82;height=49;angle=57;bc=#08000000;pw=0;" shape[13] = "func=ell;x=84.37;y=135.98;width=66;height=48;angle=71;bc=#08000000;pw=0;" shape[14] = "func=ell;x=73.43;y=173.2;width=34;height=26;angle=392;bc=#08000000;pw=0;" shape[15] = "func=ell;x=131;y=90;width=41;height=51;angle=46;bc=#08000000;pw=0;" shape[16] = "func=ell;x=0;y=77;width=77;height=43;angle=287;bc=#08000000;pw=0;" shape[17] = "func=ell;x=37.49;y=107.24;width=12;height=10;angle=60;bc=#FFFFCC;pw=0;" shape[18] = "func=ell;x=55.79;y=138.08;width=17;height=11;angle=65;bc=#FFFFCC;pw=0;" shape[19] = "func=ell;x=90;y=135;width=43;height=13;angle=58;bc=#FFFFCC;pw=0;" shape[20] = "func=ell;x=155;y=109;width=22;height=21;angle=357;bc=#FFFFCC;pw=0;" EndSub Sub Math_CartesianToPolar ' Math | convert cartesian coodinate to polar coordinate ' param x, y - cartesian coordinate ' return r, a - polar coordinate r = Math.SquareRoot(x * x + y * y) If x = 0 And y > 0 Then a = 90 ' [degree] ElseIf x = 0 And y < 0 Then a = -90 ElseIf x = 0 Then a = 0 Else a = Math.ArcTan(y / x) * 180 / Math.Pi EndIf If x < 0 Then a = a + 180 ElseIf x > 0 And y < 0 Then a = a + 360 EndIf EndSub Sub SB_RotateWorkaround ' Small Basic | Rotate workaround for Silverlight ' param shp - current shape ' param x, y - original coordinate ' param alpha - angle [radian] ' returns x, y - workaround coordinate If shp["func"] = "tri" Then x1 = -Math.Floor(shp["x3"] / 2) y1 = -Math.Floor(shp["y3"] / 2) ElseIf shp["func"] = "line" Then x1 = -Math.Floor(Math.Abs(shp["x1"] - shp["x2"]) / 2) y1 = -Math.Floor(Math.Abs(shp["y1"] - shp["y2"]) / 2) EndIf ox = x - x1 oy = y - y1 x = x1 * Math.Cos(alpha) - y1 * Math.Sin(alpha) + ox y = x1 * Math.Sin(alpha) + y1 * Math.Cos(alpha) + oy EndSub Sub SB_Workaround ' Small Basic | Workaround for Silverlight ' returns silverlight - "True" if in remote color = GraphicsWindow.GetPixel(0, 0) If Text.GetLength(color) > 7 Then silverlight = "True" msWait = 300 Else silverlight = "False" EndIf EndSub Sub Shapes_Add ' Shapes | add shapes as shapes data ' param iMin, iMax - shape indices to add ' param shape - array of shapes ' param scale - 1 if same scale ' return shWidth, shHeight - total size of shapes ' return shAngle - current angle of shapes Stack.PushValue("local", i) Stack.PushValue("local", x) Stack.PushValue("local", y) Shapes_CalcWidthAndHeight() s = scale For i = iMin To iMax shp = shape[i] GraphicsWindow.PenWidth = shp["pw"] * s If shp["pw"] > 0 Then GraphicsWindow.PenColor = shp["pc"] EndIf If Text.IsSubText("rect|ell|tri|text", shp["func"]) Then GraphicsWindow.BrushColor = shp["bc"] EndIf If shp["func"] = "rect" Then shp["obj"] = Shapes.AddRectangle(shp["width"] * s, shp["height"] * s) ElseIf shp["func"] = "ell" Then shp["obj"] = Shapes.AddEllipse(shp["width"] * s, shp["height"] * s) ElseIf shp["func"] = "tri" Then shp["obj"] = Shapes.AddTriangle(shp["x1"] * s, shp["y1"] * s, shp["x2"] * s, shp["y2"] * s, shp["x3"] * s, shp["y3"] * s) ElseIf shp["func"] = "line" Then shp["obj"] = Shapes.AddLine(shp["x1"] * s, shp["y1"] * s, shp["x2"] * s, shp["y2"] * s) ElseIf shp["func"] = "text" Then If silverlight Then fs = Math.Floor(shp["fs"] * 0.9) Else fs = shp["fs"] EndIf GraphicsWindow.FontSize = fs * s GraphicsWindow.FontName = shp["fn"] shp["obj"] = Shapes.AddText(shp["text"]) EndIf x = shp["x"] y = shp["y"] shp["rx"] = x shp["ry"] = y If silverlight And Text.IsSubText("tri|line", shp["func"]) Then alpha = Math.GetRadians(shp["angle"]) SB_RotateWorkaround() shp["wx"] = x shp["wy"] = y EndIf Shapes.Move(shp["obj"], shX + x * s, shY + y * s) If Text.IsSubText("rect|ell|tri|text", shp["func"]) And (shp["angle"] <> 0) And (shp["angle"] <> "") Then Shapes.Rotate(shp["obj"], shp["angle"]) EndIf shape[i] = shp EndFor shAngle = 0 y = Stack.PopValue("local") x = Stack.PopValue("local") i = Stack.PopValue("local") EndSub Sub Shapes_CalcRotatePos ' Shapes | Calculate position for rotated shape ' param["x"], param["y"] - position of a shape ' param["width"], param["height"] - size of a shape ' param ["cx"], param["cy"] - center of rotation ' param ["angle"] - rotate angle ' return x, y - rotated position of a shape _cx = param["x"] + param["width"] / 2 _cy = param["y"] + param["height"] / 2 x = _cx - param["cx"] y = _cy - param["cy"] Math_CartesianToPolar() a = a + param["angle"] x = r * Math.Cos(a * Math.Pi / 180) y = r * Math.Sin(a * Math.Pi / 180) _cx = x + param["cx"] _cy = y + param["cy"] x = _cx - param["width"] / 2 y = _cy - param["height"] / 2 EndSub Sub Shapes_CalcWidthAndHeight ' Shapes | Calculate total width and height of shapes ' param iMin, iMax - shape indices to add ' return shWidth, shHeight - total size of shapes For i = iMin To iMax shp = shape[i] If shp["func"] = "tri" Or shp["func"] = "line" Then xmin = shp["x1"] xmax = shp["x1"] ymin = shp["y1"] ymax = shp["y1"] If shp["x2"] < xmin Then xmin = shp["x2"] EndIf If xmax < shp["x2"] Then xmax = shp["x2"] EndIf If shp["y2"] < ymin Then ymin = shp["y2"] EndIf If ymax < shp["y2"] Then ymax = shp["y2"] EndIf If shp["func"] = "tri" Then If shp["x3"] < xmin Then xmin = shp["x3"] EndIf If xmax < shp["x3"] Then xmax = shp["x3"] EndIf If shp["y3"] < ymin Then ymin = shp["y3"] EndIf If ymax < shp["y3"] Then ymax = shp["y3"] EndIf EndIf shp["width"] = xmax - xmin shp["height"] = ymax - ymin EndIf If i = 1 Then shWidth = shp["x"] + shp["width"] shHeight = shp["y"] + shp["height"] Else If shWidth < shp["x"] + shp["width"] Then shWidth = shp["x"] + shp["width"] EndIf If shHeight < shp["y"] + shp["height"] Then shHeight = shp["y"] + shp["height"] EndIf EndIf shape[i] = shp EndFor EndSub Sub Shapes_Move ' Shapes | Move shapes ' param iMin, iMax - shape indices to add ' param shape - array of shapes ' param scale - to zoom ' param x, y - position to move ' return shX, shY - new position of shapes Stack.PushValue("local", i) s = scale shX = x shY = y For i = iMin To iMax shp = shape[i] If silverlight And Text.IsSubText("tri|line", shp["func"]) Then _x = shp["wx"] _y = shp["wy"] Else _x = shp["rx"] _y = shp["ry"] EndIf Shapes.Move(shp["obj"], shX + _x * s, shY + _y * s) EndFor i = Stack.PopValue("local") EndSub Sub Shapes_Remove ' Shapes | Remove shapes ' param iMin, iMax - shapes indices to remove ' param shape - array of shapes Stack.PushValue("local", i) For i = iMin To iMax shp = shape[i] Shapes.Remove(shp["obj"]) EndFor i = Stack.PopValue("local") EndSub Sub Shapes_Rotate ' Shapes | Rotate shapes ' param iMin, iMax - shapes indices to rotate ' param shape - array of shapes ' param cx, cy - rotation center ' param scale - to zoom ' param angle - to rotate Stack.PushValue("local", i) Stack.PushValue("local", x) Stack.PushValue("local", y) s = scale param["angle"] = angle If cx <> "" Then param["cx"] = cx Else cx = "" ' to avoid syntax error param["cx"] = shWidth / 2 EndIf If cy <> "" Then param["cy"] = cy Else cy = "" ' to avoid syntax error param["cy"] = shHeight / 2 EndIf For i = iMin To iMax shp = shape[i] param["x"] = shp["x"] param["y"] = shp["y"] param["width"] = shp["width"] param["height"] = shp["height"] Shapes_CalcRotatePos() shp["rx"] = x shp["ry"] = y If silverlight And Text.IsSubText("tri|line", shp["func"]) Then alpha = Math.GetRadians(angle + shp["angle"]) SB_RotateWorkAround() shp["wx"] = x shp["wy"] = y EndIf Shapes.Move(shp["obj"], shX + x * s, shY + y * s) Shapes.Rotate(shp["obj"], angle + shp["angle"]) shape[i] = shp EndFor y = Stack.PopValue("local") x = Stack.PopValue("local") i = Stack.PopValue("local") EndSub End>GNF678.sb< Start>GNG357.sb< an=137.5030902348578 GraphicsWindow.Title ="Golden ratio angle demo GraphicsWindow.BackgroundColor ="darkblue GraphicsWindow.Width=800 GraphicsWindow.Height =800 GraphicsWindow.Clear () Turtle.Speed =10 Turtle.x=400 Turtle.y=400 For x=1 To 250 r=30-x/10 d=300-x*1.1 GraphicsWindow.PenColor =LDColours.HSLtoRGB (Turtle.Angle ,1 0.6) GraphicsWindow.BrushColor =GraphicsWindow.PenColor GraphicsWindow.PenWidth =1 Turtle.Move (d) GraphicsWindow.fillEllipse (Turtle.x, Turtle.Y r r) Turtle.Move (-d) Turtle.Angle =Turtle.Angle +an endfor Turtle.Hide () Program.Delay (2222) LDShapes.RemoveTurtleLines () End>GNG357.sb< Start>GNH167.sb< ' Find the longest word in a sentence ' December 2018 small basic challenge ' ZJB016 ' Text window to ask for a sentence TextWindow.ForegroundColor = "Yellow" TextWindow.Write("Enter your sentence: ") MyText = TextWindow.Read() ' If text doesn't have a comma at the end, add it if (Text.EndsWith (MyText, ".")) Then ' all good Else MyText = Text.Append (MyText, ".") EndIf ' Get a lenght TextWindow.WriteLine("Now I will find the longest word in your sentence") x = Text.GetLength(MyText) TextWindow.WriteLine(" ") TextWindow.WriteLine(MyText) TextWindow.WriteLine("your text is long " + x + " letters including spaces.") ' Find positions of spaces, commas and a period. y=1 For i=1 To x character = Text.GetSubText (MyText, i, 1) If (character = " " or character = "." Or character ="," Or character =":") Then space_position[y] = i TextWindow.WriteLine("Position of non-letter is: " + space_position[y]) y = y + 1 EndIf EndFor ' Calculate a length of the longest word count = Array.GetItemCount(space_position) max_word = 0 duplicate = "False" dupl_count = -1 For y = 1 To (count) length = (space_position[y] - space_position[y-1] -1) TextWindow.WriteLine("length of word: " + length) If length > max_word Then max_word = length max_word_starts = space_position[y] - length EndIf EndFor ' Verfiy how many words with the max lenghth For y = 1 To (count) length = (space_position[y] - space_position[y-1] -1) If max_word = length then duplicate = "true" dupl_count = dupl_count + 1 EndIf EndFor TextWindow.WriteLine("max_word_starts: " + max_word_starts) my_word = Text.GetSubText(MyText, max_word_starts, max_word) ' result TextWindow.ForegroundColor = "Red" TextWindow.WriteLine("the longest word is long: " + max_word + " characters.") TextWindow.WriteLine("Longest word is: " + my_word) If duplicate Then If dupl_count = 1 Then TextWindow.WriteLine("You have in your sentence another " + dupl_count + " word with the same lenght.") ElseIf dupl_count > 1 then TextWindow.WriteLine("You have in your sentence another " + dupl_count + " words with the same lenght.") EndIf EndIf TextWindow.ForegroundColor = "Yellow" End>GNH167.sb< Start>GNK394.sb< '-------------------------------Anfangs Einstellungen-----------------' GraphicsWindow.BackgroundColor = "Green" GraphicsWindow.Width = 1600 GraphicsWindow.Height = 900 GraphicsWindow.Top = 0 GraphicsWindow.left=0 GraphicsWindow.BrushColor = "White" GraphicsWindow.fillrectangle(900,60,200,350) GraphicsWindow.FontSize = 20 GraphicsWindow.BrushColor = "Black" Pos1wert=0 Pos2wert=0 Pos3wert=0 Pos4wert=0 Pos5wert=0 Pos6wert=0 Pos1oben=0 Pos2oben=0 Pos3oben=0 Pos4oben=0 Pos5oben=0 Pos6oben=0 pos1obenfrei = 0 '0 gleich frei, 1 gleich belegt' pos2obenfrei = 0 '0 gleich frei, 1 gleich belegt' pos3obenfrei = 0 '0 gleich frei, 1 gleich belegt' pos4obenfrei = 0 '0 gleich frei, 1 gleich belegt' pos5obenfrei = 0 '0 gleich frei, 1 gleich belegt' pos6obenfrei = 0 '0 gleich frei, 1 gleich belegt' ZaehlerDrilling1=0 ZaehlerDrilling2=0 ZaehlerDrilling3=0 ZaehlerDrilling4=0 ZaehlerDrilling5=0 ZaehlerDrilling6=0 Einserdrilling = 0 '0 gleich kein Drilling, 1 gleich Drilling' Zweierdrilling = 0 '0 gleich kein Drilling, 1 gleich Drilling' Dreierdrilling = 0 '0 gleich kein Drilling, 1 gleich Drilling' Viererdrilling = 0 '0 gleich kein Drilling, 1 gleich Drilling' Fünferdrilling = 0 '0 gleich kein Drilling, 1 gleich Drilling' sechserdrilling = 0 '0 gleich kein Drilling, 1 gleich Drilling' wievielehochgezogen=0 ZaehlerEinser = 0 Zaehlerfuenfer = 0 GraphicsWindow.PenWidth = 4 GraphicsWindow.BrushColor = "Pink" GraphicsWindow.FillRectangle(300, 30, 153, 50) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawRectangle(300, 30, 153, 50) GraphicsWindow.FontItalic = "False" GraphicsWindow.FontSize = 32 GraphicsWindow.FontName = "Impact" '----------------------------Hauptprogramm-------------------------------' RückseitenKartezeigen() startknopf = Controls.AddButton(" START ", 1400, 600) Controls.ButtonClicked = clickstart wuerfelknopf = Controls.AddButton(" WÜRFELN ", 1400, 700) Controls.ButtonClicked = clickstart stopknopf = Controls.AddButton(" STOP ", 1400, 800) Controls.ButtonClicked = clickstart OnMouseDown() '---------------------------Drillingcheck------------------------------------" Sub Drillingcheck if Pos1wert = 1 Then ZaehlerDrilling1 = ZaehlerDrilling1 + 1 endif if Pos2wert = 1 Then ZaehlerDrilling1 = ZaehlerDrilling1 + 1 endif if Pos3wert = 1 Then ZaehlerDrilling1 = ZaehlerDrilling1 + 1 endif if Pos4wert = 1 Then ZaehlerDrilling1 =ZaehlerDrilling1 + 1 endif if Pos5wert = 1 Then ZaehlerDrilling1 = ZaehlerDrilling1 + 1 endif if Pos6wert = 1 Then ZaehlerDrilling1 = ZaehlerDrilling1 + 1 endif if Pos1wert = 2 Then ZaehlerDrilling2=ZaehlerDrilling2 + 1 endif if Pos2wert = 2 Then ZaehlerDrilling2=ZaehlerDrilling2 + 1 endif if Pos3wert = 2 Then ZaehlerDrilling2=ZaehlerDrilling2 + 1 endif if Pos4wert = 2 Then ZaehlerDrilling2=ZaehlerDrilling2 + 1 endif if Pos5wert = 2 Then ZaehlerDrilling2=ZaehlerDrilling2 + 1 endif if Pos6wert = 2 Then ZaehlerDrilling2=ZaehlerDrilling2 + 1 endif if Pos1wert = 3 Then ZaehlerDrilling3=ZaehlerDrilling3 + 1 endif if Pos2wert = 3 Then ZaehlerDrilling3=ZaehlerDrilling3 + 1 endif if Pos3wert = 3 Then ZaehlerDrilling3=ZaehlerDrilling3 + 1 endif if Pos4wert = 3 Then ZaehlerDrilling3=ZaehlerDrilling3 + 1 endif if Pos5wert = 3 Then ZaehlerDrilling3=ZaehlerDrilling3 + 1 endif if Pos6wert = 3 Then ZaehlerDrilling3=ZaehlerDrilling3 + 1 endif if Pos1wert = 4 Then ZaehlerDrilling4= ZaehlerDrilling4 + 1 endif if Pos2wert = 4 Then ZaehlerDrilling4=ZaehlerDrilling4 + 1 endif if Pos3wert = 4 Then ZaehlerDrilling4=ZaehlerDrilling4 + 1 endif if Pos4wert = 4 Then ZaehlerDrilling4=ZaehlerDrilling4 + 1 endif if Pos5wert = 4 Then ZaehlerDrilling4=ZaehlerDrilling4 + 1 endif if Pos6wert = 4 Then ZaehlerDrilling4=ZaehlerDrilling4 + 1 endif if Pos1wert = 5 Then ZaehlerDrilling5=ZaehlerDrilling5 + 1 endif if Pos2wert = 5 Then ZaehlerDrilling5=ZaehlerDrilling5 + 1 endif if Pos3wert = 5 Then ZaehlerDrilling5=ZaehlerDrilling5 + 1 endif if Pos4wert = 5 Then ZaehlerDrilling5=ZaehlerDrilling5 + 1 endif if Pos5wert = 5 Then ZaehlerDrilling5=ZaehlerDrilling5 + 1 endif if Pos6wert = 5 Then ZaehlerDrilling5=ZaehlerDrilling5 + 1 endif if Pos1wert = 6 Then ZaehlerDrilling6=ZaehlerDrilling6 + 1 endif if Pos2wert = 6 Then ZaehlerDrilling6=ZaehlerDrilling6 + 1 endif if Pos3wert = 6 Then ZaehlerDrilling6=ZaehlerDrilling6 + 1 endif if Pos4wert = 6 Then ZaehlerDrilling6=ZaehlerDrilling6 + 1 endif if Pos5wert = 6 Then ZaehlerDrilling6=ZaehlerDrilling6 + 1 endif if Pos6wert = 6 Then ZaehlerDrilling6=ZaehlerDrilling6 + 1 endif GraphicsWindow.BrushColor = "Black" If ZaehlerDrilling1 >= 3 Then Einserdrilling = 1 elseif ZaehlerDrilling2 >= 3 Then Zweierdrilling = 1 elseif ZaehlerDrilling3 >= 3 Then Dreierdrilling = 1 elseif ZaehlerDrilling4 >= 3 Then Viererdrilling = 1 elseif ZaehlerDrilling5 >= 3 Then Fünferdrilling = 1 elseif ZaehlerDrilling6 >= 3 Then sechserdrilling = 1 EndIf EndSub '----------------------------erster Würfel anklicken--------------------------' Sub OnMouseDown GraphicsWindow.MouseDown = DoNothing x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY If x>300 And x<340 And y>600 And y<640 Then wievielehochgezogen=wievielehochgezogen+1 Pos1loeschen() if Pos1wert = 1 Then If pos1obenfrei =0 then Pos1obenAuge1() pos1oben=1 Goto sprung1 Elseif Pos2obenfrei = 0 then Pos2obenAuge1() pos2oben=1 Goto sprung1 Elseif Pos3obenfrei = 0 then Pos3obenAuge1() pos3oben=1 Goto sprung1 Elseif Pos4obenfrei = 0 then Pos4obenAuge1() pos4oben=1 Goto sprung1 Elseif Pos5obenfrei = 0 then Pos5obenAuge1() pos5oben=1 Goto sprung1 Elseif Pos6obenfrei = 0 then Pos6obenAuge1() pos6oben=1 endif sprung1: anzeigeaktualisieren() elseif Pos1wert = 2 Then If pos1obenfrei=0 then Pos1obenAuge2() pos1oben=2 Goto sprung2 Elseif Pos2obenfrei = 0 then Pos2obenAuge2() pos2oben=2 Goto sprung2 Elseif Pos3obenfrei = 0 then Pos3obenAuge2() pos3oben=2 Goto sprung2 Elseif Pos4obenfrei = 0 then Pos4obenAuge2() pos4oben=2 Goto sprung2 Elseif Pos5obenfrei = 0 then Pos5obenAuge2() pos5oben=2 Goto sprung2 Elseif Pos6obenfrei = 0 then Pos6obenAuge2() pos6oben=2 endif sprung2: anzeigeaktualisieren() elseif Pos1wert = 3 Then If pos1obenfrei=0 then Pos1obenAuge3() pos1oben=3 Goto sprung3 Elseif Pos2obenfrei = 0 then Pos2obenAuge3() pos2oben=3 Goto sprung3 Elseif Pos3obenfrei = 0 then Pos3obenAuge3() pos3oben=3 Goto sprung3 Elseif Pos4obenfrei = 0 then Pos4obenAuge3() pos4oben=3 Goto sprung3 Elseif Pos5obenfrei = 0 then Pos5obenAuge3() pos5oben=3 Goto sprung3 Elseif Pos6obenfrei = 0 then Pos6obenAuge3() pos6oben=3 endif sprung3: anzeigeaktualisieren() elseif Pos1wert = 4 Then If pos1obenfrei=0 then Pos1obenAuge4() pos1oben=4 Goto sprung4 Elseif Pos2obenfrei = 0 then Pos2obenAuge4() pos2oben=4 Goto sprung4 Elseif Pos3obenfrei = 0 then Pos3obenAuge4() pos3oben=4 Goto sprung4 Elseif Pos4obenfrei = 0 then Pos4obenAuge4() pos4oben=4 Goto sprung4 Elseif Pos5obenfrei = 0 then Pos5obenAuge4() pos5oben=4 Goto sprung4 Elseif Pos6obenfrei = 0 then Pos6obenAuge4() pos6oben=4 endif sprung4: anzeigeaktualisieren() elseif Pos1wert = 5 Then If pos1obenfrei=0 then Pos1obenAuge5() pos1oben=5 Goto sprung5 Elseif Pos2obenfrei = 0 then Pos2obenAuge5() pos2oben=5 Goto sprung5 Elseif Pos3obenfrei = 0 then Pos3obenAuge5() pos3oben=5 Goto sprung5 Elseif Pos4obenfrei = 0 then Pos4obenAuge5() pos4oben=5 Goto sprung5 Elseif Pos5obenfrei = 0 then Pos5obenAuge5() pos5oben=5 Goto sprung5 Elseif Pos6obenfrei = 0 then Pos6obenAuge5() pos6oben=5 endif sprung5: anzeigeaktualisieren() elseif Pos1wert = 6 Then If pos1obenfrei=0 then Pos1obenAuge6() pos1oben=6 Goto sprung6 Elseif Pos2obenfrei = 0 then Pos2obenAuge6() pos2oben=6 Goto sprung6 Elseif Pos3obenfrei = 0 then Pos3obenAuge6() pos3oben=6 Goto sprung6 Elseif Pos4obenfrei = 0 then Pos4obenAuge6() pos4oben=6 Goto sprung6 Elseif Pos5obenfrei = 0 then Pos5obenAuge6() pos5oben=6 Goto sprung6 Elseif Pos6obenfrei = 0 then Pos6obenAuge6() pos6oben=6 endif sprung6: anzeigeaktualisieren() EndIf '----------------------------zweiter Würfel anklicken--------------------------' Elseif x>550 And x<590 And y>620 And y<660 Then wievielehochgezogen=wievielehochgezogen+1 Pos2loeschen() if Pos2wert = 1 Then If pos1obenfrei=0 then Pos1obenAuge1() pos1oben=1 Goto sprung7 Elseif Pos2obenfrei = 0 then Pos2obenAuge1() pos2oben=1 Goto sprung7 Elseif Pos3obenfrei = 0 then Pos3obenAuge1() pos3oben=1 Goto sprung7 Elseif Pos4obenfrei = 0 then Pos4obenAuge1() pos4oben=1 Goto sprung7 Elseif Pos5obenfrei = 0 then Pos5obenAuge1() pos5oben=1 Goto sprung7 Elseif Pos6obenfrei = 0 then Pos6obenAuge1() pos6oben=1 endif sprung7: anzeigeaktualisieren() elseif Pos2wert = 2 Then If pos1obenfrei=0 then Pos1obenAuge2() pos1oben=2 Goto sprung8 Elseif Pos2obenfrei = 0 then Pos2obenAuge2() pos2oben=2 Goto sprung8 Elseif Pos3obenfrei = 0 then Pos3obenAuge2() pos3oben=2 Goto sprung8 Elseif Pos4obenfrei = 0 then Pos4obenAuge2() pos4oben=2 Goto sprung8 Elseif Pos5obenfrei = 0 then Pos5obenAuge2() pos5oben=2 Goto sprung8 Elseif Pos6obenfrei = 0 then Pos6obenAuge2() pos6oben=2 endif sprung8: anzeigeaktualisieren() elseif Pos2wert = 3 Then If pos1obenfrei=0 then Pos1obenAuge3() pos1oben=3 Goto sprung9 Elseif Pos2obenfrei = 0 then Pos2obenAuge3() pos2oben=3 Goto sprung9 Elseif Pos3obenfrei = 0 then Pos3obenAuge3() pos3oben=3 Goto sprung9 Elseif Pos4obenfrei = 0 then Pos4obenAuge3() pos4oben=3 Goto sprung9 Elseif Pos5obenfrei = 0 then Pos5obenAuge3() pos5oben=3 Goto sprung9 Elseif Pos6obenfrei = 0 then Pos6obenAuge3() pos6oben=3 endif sprung9: anzeigeaktualisieren() elseif Pos2wert = 4 Then If pos1obenfrei=0 then Pos1obenAuge4() pos1oben=4 Goto sprung10 Elseif Pos2obenfrei = 0 then Pos2obenAuge4() pos2oben=4 Goto sprung10 Elseif Pos3obenfrei = 0 then Pos3obenAuge4() pos3oben=4 Goto sprung10 Elseif Pos4obenfrei = 0 then Pos4obenAuge4() pos4oben=4 Goto sprung10 Elseif Pos5obenfrei = 0 then Pos5obenAuge4() pos5oben=4 Goto sprung10 Elseif Pos6obenfrei = 0 then Pos6obenAuge4() pos6oben=4 endif sprung10: anzeigeaktualisieren() elseif Pos2wert = 5 Then If pos1obenfrei=0 then Pos1obenAuge5() pos1oben=5 Goto sprung11 Elseif Pos2obenfrei = 0 then Pos2obenAuge5() pos2oben=5 Goto sprung11 Elseif Pos3obenfrei = 0 then Pos3obenAuge5() pos3oben=5 Goto sprung11 Elseif Pos4obenfrei = 0 then Pos4obenAuge5() pos4oben=5 Goto sprung11 Elseif Pos5obenfrei = 0 then Pos5obenAuge5() pos5oben=5 Goto sprung11 Elseif Pos6obenfrei = 0 then Pos6obenAuge5() pos6oben=5 endif sprung11: anzeigeaktualisieren() elseif Pos2wert = 6 Then If pos1obenfrei=0 then Pos1obenAuge6() pos1oben=6 Goto sprung12 Elseif Pos2obenfrei = 0 then Pos2obenAuge6() pos2oben=6 Goto sprung12 Elseif Pos3obenfrei = 0 then Pos3obenAuge6() pos3oben=6 Goto sprung12 Elseif Pos4obenfrei = 0 then Pos4obenAuge6() pos4oben=6 Goto sprung12 Elseif Pos5obenfrei = 0 then Pos5obenAuge6() pos5oben=6 Goto sprung12 Elseif Pos6obenfrei = 0 then Pos6obenAuge6() pos6oben=6 endif sprung12: anzeigeaktualisieren() EndIf '----------------------------dritter Würfel anklicken--------------------------' Elseif x>400 And x<440 And y>490 And y<530 Then wievielehochgezogen=wievielehochgezogen+1 Pos3loeschen() if Pos3wert = 1 Then If pos1obenfrei=0 then Pos1obenAuge1() pos1oben=1 Goto sprung13 Elseif Pos2obenfrei = 0 then Pos2obenAuge1() pos2oben=1 Goto sprung13 Elseif Pos3obenfrei = 0 then Pos3obenAuge1() pos3oben=1 Goto sprung13 Elseif Pos4obenfrei = 0 then Pos4obenAuge1() pos4oben=1 Goto sprung13 Elseif Pos5obenfrei = 0 then Pos5obenAuge1() pos5oben=1 Goto sprung13 Elseif Pos6obenfrei = 0 then Pos6obenAuge1() pos6oben=1 endif sprung13: anzeigeaktualisieren() elseif Pos3wert = 2 Then If pos1obenfrei=0 then Pos1obenAuge2() pos1oben=2 Goto sprung14 Elseif Pos2obenfrei = 0 then Pos2obenAuge2() pos2oben=2 Goto sprung14 Elseif Pos3obenfrei = 0 then Pos3obenAuge2() pos3oben=2 Goto sprung14 Elseif Pos4obenfrei = 0 then Pos4obenAuge2() pos4oben=2 Goto sprung14 Elseif Pos5obenfrei = 0 then Pos5obenAuge2() pos5oben=2 Goto sprung14 Elseif Pos6obenfrei = 0 then Pos6obenAuge2() pos6oben=2 endif sprung14: anzeigeaktualisieren() elseif Pos3wert = 3 Then If pos1obenfrei=0 then Pos1obenAuge3() pos1oben=3 Goto sprung15 Elseif Pos2obenfrei = 0 then Pos2obenAuge3() pos2oben=3 Goto sprung15 Elseif Pos3obenfrei = 0 then Pos3obenAuge3() pos3oben=3 Goto sprung15 Elseif Pos4obenfrei = 0 then Pos4obenAuge3() pos4oben=3 Goto sprung15 Elseif Pos5obenfrei = 0 then Pos5obenAuge3() pos5oben=3 Goto sprung15 Elseif Pos6obenfrei = 0 then Pos6obenAuge3() pos6oben=3 endif sprung15: anzeigeaktualisieren() elseif Pos3wert = 4 Then If pos1obenfrei=0 then Pos1obenAuge4() pos1oben=4 Goto sprung16 Elseif Pos2obenfrei = 0 then Pos2obenAuge4() pos2oben=4 Goto sprung16 Elseif Pos3obenfrei = 0 then Pos3obenAuge4() pos3oben=4 Goto sprung16 Elseif Pos4obenfrei = 0 then Pos4obenAuge4() pos4oben=4 Goto sprung16 Elseif Pos5obenfrei = 0 then Pos5obenAuge4() pos5oben=4 Goto sprung16 Elseif Pos6obenfrei = 0 then Pos6obenAuge4() pos6oben=4 endif sprung16: anzeigeaktualisieren() elseif Pos3wert = 5 Then If pos1obenfrei=0 then Pos1obenAuge5() pos1oben=5 Goto sprung17 Elseif Pos2obenfrei = 0 then Pos2obenAuge5() pos2oben=5 Goto sprung17 Elseif Pos3obenfrei = 0 then Pos3obenAuge5() pos3oben=5 Goto sprung17 Elseif Pos4obenfrei = 0 then Pos4obenAuge5() pos4oben=5 Goto sprung17 Elseif Pos5obenfrei = 0 then Pos5obenAuge5() pos5oben=5 Goto sprung17 Elseif Pos6obenfrei = 0 then Pos6obenAuge5() pos6oben=5 endif sprung17: anzeigeaktualisieren() elseif Pos3wert = 6 Then If pos1obenfrei=0 then Pos1obenAuge6() pos1oben=6 Goto sprung18 Elseif Pos2obenfrei = 0 then Pos2obenAuge6() pos2oben=6 Goto sprung18 Elseif Pos3obenfrei = 0 then Pos3obenAuge6() pos3oben=6 Goto sprung18 Elseif Pos4obenfrei = 0 then Pos4obenAuge6() pos4oben=6 Goto sprung18 Elseif Pos5obenfrei = 0 then Pos5obenAuge6() pos5oben=6 Goto sprung18 Elseif Pos6obenfrei = 0 then Pos6obenAuge6() pos6oben=6 endif sprung18: anzeigeaktualisieren() EndIf '----------------------------vierter Würfel anklicken--------------------------' Elseif x>550 And x<590 And y>450 And y<490 Then wievielehochgezogen=wievielehochgezogen+1 Pos4loeschen() if Pos4wert = 1 Then If pos1obenfrei=0 then Pos1obenAuge1() pos1oben=1 Goto sprung1 Elseif Pos2obenfrei = 0 then Pos2obenAuge1() pos3oben=1 Goto sprung19 Elseif Pos3obenfrei = 0 then Pos3obenAuge1() pos4oben=1 Goto sprung19 Elseif Pos4obenfrei = 0 then Pos4obenAuge1() pos5oben=1 Goto sprung19 Elseif Pos5obenfrei = 0 then Pos5obenAuge1() pos6oben=1 Goto sprung19 Elseif Pos6obenfrei = 0 then Pos6obenAuge1() pos6oben=1 endif sprung19: anzeigeaktualisieren() elseif Pos4wert = 2 Then If pos1obenfrei=0 then Pos1obenAuge2() pos1oben=2 Goto sprung20 Elseif Pos2obenfrei = 0 then Pos2obenAuge2() pos2oben=2 Goto sprung20 Elseif Pos3obenfrei = 0 then Pos3obenAuge2() pos3oben=2 Goto sprung20 Elseif Pos4obenfrei = 0 then Pos4obenAuge2() pos4oben=2 Goto sprung20 Elseif Pos5obenfrei = 0 then Pos5obenAuge2() pos5oben=2 Goto sprung20 Elseif Pos6obenfrei = 0 then Pos6obenAuge2() pos6oben=2 endif sprung20: anzeigeaktualisieren() elseif Pos4wert = 3 Then If pos1obenfrei=0 then Pos1obenAuge3() pos1oben=3 Goto sprung21 Elseif Pos2obenfrei = 0 then Pos2obenAuge3() pos2oben=3 Goto sprung21 Elseif Pos3obenfrei = 0 then Pos3obenAuge3() pos3oben=3 Goto sprung21 Elseif Pos4obenfrei = 0 then Pos4obenAuge3() pos4oben=3 Goto sprung21 Elseif Pos5obenfrei = 0 then Pos5obenAuge3() pos5oben=3 Goto sprung21 Elseif Pos6obenfrei = 0 then Pos6obenAuge3() pos6oben=3 endif sprung21: anzeigeaktualisieren() elseif Pos4wert = 4 Then If pos1obenfrei=0 then Pos1obenAuge4() pos1oben=4 Goto sprung22 Elseif Pos2obenfrei = 0 then Pos2obenAuge4() pos2oben=4 Goto sprung22 Elseif Pos3obenfrei = 0 then Pos3obenAuge4() pos3oben=4 Goto sprung22 Elseif Pos4obenfrei = 0 then Pos4obenAuge4() pos4oben=4 Goto sprung22 Elseif Pos5obenfrei = 0 then Pos5obenAuge4() pos5oben=4 Goto sprung4 Elseif Pos6obenfrei = 0 then Pos6obenAuge4() pos6oben=4 endif sprung22: anzeigeaktualisieren() elseif Pos4wert = 5 Then If pos1obenfrei=0 then Pos1obenAuge5() pos1oben=5 Goto sprung23 Elseif Pos2obenfrei = 0 then Pos2obenAuge5() pos2oben=5 Goto sprung23 Elseif Pos3obenfrei = 0 then Pos3obenAuge5() pos3oben=5 Goto sprung23 Elseif Pos4obenfrei = 0 then Pos4obenAuge5() pos4oben=5 Goto sprung23 Elseif Pos5obenfrei = 0 then Pos5obenAuge5() pos5oben=5 Goto sprung23 Elseif Pos6obenfrei = 0 then Pos6obenAuge5() pos6oben=5 endif sprung23: anzeigeaktualisieren() elseif Pos4wert = 6 Then If pos1obenfrei=0 then Pos1obenAuge6() pos1oben=6 Goto sprung24 Elseif Pos2obenfrei = 0 then Pos2obenAuge6() pos2oben=6 Goto sprung24 Elseif Pos3obenfrei = 0 then Pos3obenAuge6() pos3oben=6 Goto sprung24 Elseif Pos4obenfrei = 0 then Pos4obenAuge6() pos4oben=6 Goto sprung24 Elseif Pos5obenfrei = 0 then Pos5obenAuge6() pos5oben=6 Goto sprung24 Elseif Pos6obenfrei = 0 then Pos6obenAuge6() pos6oben=6 endif sprung24: anzeigeaktualisieren() EndIf '----------------------------fünfter Würfel anklicken--------------------------' Elseif x>450 And x<490 And y>600 And y<640 Then wievielehochgezogen=wievielehochgezogen+1 Pos5loeschen() if Pos5wert = 1 Then If pos1obenfrei=0 then Pos1obenAuge1() pos1oben=1 Goto sprung25 Elseif Pos2obenfrei = 0 then Pos2obenAuge1() pos2oben=1 Goto sprung25 Elseif Pos3obenfrei = 0 then Pos3obenAuge1() pos3oben=1 Goto sprung25 Elseif Pos4obenfrei = 0 then Pos4obenAuge1() pos4oben=1 Goto sprung25 Elseif Pos5obenfrei = 0 then Pos5obenAuge1() pos5oben=1 Goto sprung25 Elseif Pos6obenfrei = 0 then Pos6obenAuge1() pos6oben=1 endif sprung25: anzeigeaktualisieren() elseif Pos5wert = 2 Then If pos1obenfrei=0 then Pos1obenAuge2() pos1oben=2 Goto sprung26 Elseif Pos2obenfrei = 0 then Pos2obenAuge2() pos2oben=2 Goto sprung26 Elseif Pos3obenfrei = 0 then Pos3obenAuge2() pos3oben=2 Goto sprung26 Elseif Pos4obenfrei = 0 then Pos4obenAuge2() pos4oben=2 Goto sprung26 Elseif Pos5obenfrei = 0 then Pos5obenAuge2() pos5oben=2 Goto sprung26 Elseif Pos6obenfrei = 0 then Pos6obenAuge2() pos6oben=2 endif sprung26: anzeigeaktualisieren() elseif Pos5wert = 3 Then If pos1obenfrei=0 then Pos1obenAuge3() pos1oben=3 Goto sprung27 Elseif Pos2obenfrei = 0 then Pos2obenAuge3() pos2oben=3 Goto sprung27 Elseif Pos3obenfrei = 0 then Pos3obenAuge3() pos3oben=3 Goto sprung27 Elseif Pos4obenfrei = 0 then Pos4obenAuge3() pos4oben=3 Goto sprung27 Elseif Pos5obenfrei = 0 then Pos5obenAuge3() pos5oben=3 Goto sprung27 Elseif Pos6obenfrei = 0 then Pos6obenAuge3() pos6oben=3 endif sprung27: anzeigeaktualisieren() elseif Pos5wert = 4 Then If pos1obenfrei=0 then Pos1obenAuge4() pos1oben=4 Goto sprung28 Elseif Pos2obenfrei = 0 then Pos2obenAuge4() pos2oben=4 Goto sprung28 Elseif Pos3obenfrei = 0 then Pos3obenAuge4() pos3oben=4 Goto sprung28 Elseif Pos4obenfrei = 0 then Pos4obenAuge4() pos4oben=4 Goto sprung28 Elseif Pos5obenfrei = 0 then Pos5obenAuge4() pos5oben=4 Goto sprung28 Elseif Pos6obenfrei = 0 then Pos6obenAuge4() pos6oben=4 endif sprung28: anzeigeaktualisieren() elseif Pos5wert = 5 Then If pos1obenfrei=0 then Pos1obenAuge5() pos1oben=5 Goto sprung29 Elseif Pos2obenfrei = 0 then Pos2obenAuge5() pos2oben=5 Goto sprung29 Elseif Pos3obenfrei = 0 then Pos3obenAuge5() pos3oben=5 Goto sprung29 Elseif Pos4obenfrei = 0 then Pos4obenAuge5() pos4oben=5 Goto sprung29 Elseif Pos5obenfrei = 0 then Pos5obenAuge5() pos5oben=5 Goto sprung29 Elseif Pos6obenfrei = 0 then Pos6obenAuge5() pos6oben=5 endif sprung29: anzeigeaktualisieren() elseif Pos5wert = 6 Then If pos1obenfrei=0 then Pos1obenAuge6() pos1oben=6 Goto sprung30 Elseif Pos2obenfrei = 0 then Pos2obenAuge6() pos2oben=6 Goto sprung3 Elseif Pos3obenfrei = 0 then Pos3obenAuge6() pos3oben=6 Goto sprung30 Elseif Pos4obenfrei = 0 then Pos4obenAuge6() pos4oben=6 Goto sprung30 Elseif Pos5obenfrei = 0 then Pos5obenAuge6() pos5oben=6 Goto sprung30 Elseif Pos6obenfrei = 0 then Pos6obenAuge6() pos6oben=6 endif sprung30: anzeigeaktualisieren() EndIf '----------------------------sechster Würfel anklicken--------------------------' Elseif x>500 And x<540 And y>550 And y<590 Then wievielehochgezogen=wievielehochgezogen+1 Pos6loeschen() if Pos6wert = 1 Then If pos1obenfrei=0 then Pos1obenAuge1() pos1oben=1 Goto sprung31 Elseif Pos2obenfrei = 0 then Pos2obenAuge1() pos2oben=1 Goto sprung31 Elseif Pos3obenfrei = 0 then Pos3obenAuge1() pos3oben=1 Goto sprung31 Elseif Pos4obenfrei = 0 then Pos4obenAuge1() pos4oben=1 Goto sprung31 Elseif Pos5obenfrei = 0 then Pos5obenAuge1() pos5oben=1 Goto sprung31 Elseif Pos6obenfrei = 0 then Pos6obenAuge1() pos6oben=1 endif sprung31: anzeigeaktualisieren() elseif Pos6wert = 2 Then If pos1obenfrei=0 then Pos1obenAuge2() pos1oben=2 Goto sprung36 Elseif Pos2obenfrei = 0 then Pos2obenAuge2() pos2oben=2 Goto sprung36 Elseif Pos3obenfrei = 0 then Pos3obenAuge2() pos3oben=2 Goto sprung36 Elseif Pos4obenfrei = 0 then Pos4obenAuge2() pos4oben=2 Goto sprung36 Elseif Pos5obenfrei = 0 then Pos5obenAuge2() pos5oben=2 Goto sprung36 Elseif Pos6obenfrei = 0 then Pos6obenAuge2() pos6oben=2 endif sprung36: anzeigeaktualisieren() elseif Pos6wert = 3 Then If pos1obenfrei=0 then Pos1obenAuge3() pos1oben=3 Goto sprung37 Elseif Pos2obenfrei = 0 then Pos2obenAuge3() pos2oben=3 Goto sprung37 Elseif Pos3obenfrei = 0 then Pos3obenAuge3() pos3oben=3 Goto sprung37 Elseif Pos4obenfrei = 0 then Pos4obenAuge3() pos4oben=3 Goto sprung37 Elseif Pos5obenfrei = 0 then Pos5obenAuge3() pos5oben=3 Goto sprung37 Elseif Pos6obenfrei = 0 then Pos6obenAuge3() pos6oben=3 endif sprung37: anzeigeaktualisieren() elseif Pos6wert = 4 Then If pos1obenfrei=0 then Pos1obenAuge4() pos1oben=4 Goto sprung38 Elseif Pos2obenfrei = 0 then Pos2obenAuge4() pos2oben=4 Goto sprung38 Elseif Pos3obenfrei = 0 then Pos3obenAuge4() pos3oben=4 Goto sprung38 Elseif Pos4obenfrei = 0 then Pos4obenAuge4() pos4oben=4 Goto sprung38 Elseif Pos5obenfrei = 0 then Pos5obenAuge4() pos5oben=4 Goto sprung38 Elseif Pos6obenfrei = 0 then Pos6obenAuge4() pos6oben=4 endif sprung38: anzeigeaktualisieren() elseif Pos6wert = 5 Then If pos1obenfrei=0 then Pos1obenAuge5() pos1oben=5 Goto sprung39 Elseif Pos2obenfrei = 0 then Pos2obenAuge5() pos2oben=5 Goto sprung39 Elseif Pos3obenfrei = 0 then Pos3obenAuge5() pos3oben=5 Goto sprung39 Elseif Pos4obenfrei = 0 then Pos4obenAuge5() pos4oben=5 Goto sprung39 Elseif Pos5obenfrei = 0 then Pos5obenAuge5() pos5oben=5 Goto sprung39 Elseif Pos6obenfrei = 0 then Pos6obenAuge5() pos6oben=5 endif sprung39: anzeigeaktualisieren() elseif Pos6wert = 6 Then If pos1obenfrei=0 then Pos1obenAuge6() pos1oben=6 Goto sprung40 Elseif Pos2obenfrei = 0 then Pos2obenAuge6() pos2oben=6 Goto sprung40 Elseif Pos3obenfrei = 0 then Pos3obenAuge6() pos3oben=6 Goto sprung40 Elseif Pos4obenfrei = 0 then Pos4obenAuge6() pos4oben=6 Goto sprung40 Elseif Pos5obenfrei = 0 then Pos5obenAuge6() pos5oben=6 Goto sprung40 Elseif Pos6obenfrei = 0 then Pos6obenAuge6() pos6oben=6 endif sprung40: anzeigeaktualisieren() EndIf endif GraphicsWindow.MouseDown = OnMouseDown EndSub Sub DoNothing OnMouseDown = "" EndSub '--------------------------------Karte zeigen---------------------------------' Sub RückseitenKartezeigen image = "C:\Programmieren\Small Basic\Tutto\Rueckseite.jpg" GraphicsWindow.DrawImage(image, 1200, 50) EndSub Sub Kartezeigen300 image = "C:\Programmieren\Small Basic\Tutto\Karte300.jpg" GraphicsWindow.DrawImage(image, 900, 50) EndSub Sub Kartezeigen600 image = "C:\Programmieren\Small Basic\Tutto\Karte600.jpg" GraphicsWindow.DrawImage(image, 900, 50) EndSub Sub clickstart ZaehlerDrilling1=0 ZaehlerDrilling2=0 ZaehlerDrilling3=0 ZaehlerDrilling4=0 ZaehlerDrilling5=0 ZaehlerDrilling6=0 If Controls.LastClickedButton = startknopf Then Zufallszahl=Math.GetRandomNumber(2) If Zufallszahl = 1 Then Kartezeigen300() Elseif Zufallszahl = 2 Then Kartezeigen600() endif '------------------------------------------------------------------------------------------Würfelknopf--------------------------------------------------------------------------------------' elseIf Controls.LastClickedButton = wuerfelknopf Then Pos1loeschen() Pos2loeschen() Pos3loeschen() Pos4loeschen() Pos5loeschen() Pos6loeschen() If wievielehochgezogen<1 then Wuerfelzufall1 =Math.GetRandomNumber(6) If Wuerfelzufall1 = 1 Then Pos1Auge1() pos1wert=1 Elseif Wuerfelzufall1 = 2 Then Pos1Auge2() pos1wert=2 Elseif Wuerfelzufall1 = 3 Then Pos1Auge3() pos1wert=3 Elseif Wuerfelzufall1 = 4 Then Pos1Auge4() pos1wert=4 Elseif Wuerfelzufall1 = 5 Then Pos1Auge5() pos1wert=5 Elseif Wuerfelzufall1 = 6 Then Pos1Auge6() pos1wert=6 endif endif If wievielehochgezogen<2 then Wuerfelzufall2 =Math.GetRandomNumber(6) If Wuerfelzufall2 = 1 Then Pos2Auge1() pos2wert=1 Elseif Wuerfelzufall2 = 2 Then Pos2Auge2() pos2wert=2 Elseif Wuerfelzufall2 = 3 Then Pos2Auge3() pos2wert=3 Elseif Wuerfelzufall2 = 4 Then Pos2Auge4() pos2wert=4 Elseif Wuerfelzufall2 = 5 Then Pos2Auge5() pos2wert=5 Elseif Wuerfelzufall2 = 6 Then Pos2Auge6() pos2wert=6 endif endif If wievielehochgezogen<3 then Wuerfelzufall3 =Math.GetRandomNumber(6) If Wuerfelzufall3 = 1 Then Pos3Auge1() pos3wert=1 Elseif Wuerfelzufall3 = 2 Then Pos3Auge2() pos3wert=2 Elseif Wuerfelzufall3 = 3 Then Pos3Auge3() pos3wert=3 Elseif Wuerfelzufall3 = 4 Then Pos3Auge4() pos3wert=4 Elseif Wuerfelzufall3 = 5 Then Pos3Auge5() pos3wert=5 Elseif Wuerfelzufall3 = 6 Then Pos3Auge6() pos3wert=6 endif endif If wievielehochgezogen<4 then Wuerfelzufall4 =Math.GetRandomNumber(6) If Wuerfelzufall4 = 1 Then Pos4Auge1() pos4wert=1 Elseif Wuerfelzufall4 = 2 Then Pos4Auge2() pos4wert=2 Elseif Wuerfelzufall4 = 3 Then Pos4Auge3() pos4wert=3 Elseif Wuerfelzufall4 = 4 Then Pos4Auge4() pos4wert=4 Elseif Wuerfelzufall4 = 5 Then Pos4Auge5() pos4wert=5 Elseif Wuerfelzufall4 = 6 Then Pos4Auge6() pos4wert=6 endif endif If wievielehochgezogen<5 then Wuerfelzufall5 =Math.GetRandomNumber(6) If Wuerfelzufall5 = 1 Then Pos5Auge1() pos5wert=1 Elseif Wuerfelzufall5 = 2 Then Pos5Auge2() pos5wert=2 Elseif Wuerfelzufall5 = 3 Then Pos5Auge3() pos5wert=3 Elseif Wuerfelzufall5 = 4 Then Pos5Auge4() pos5wert=4 Elseif Wuerfelzufall5 = 5 Then Pos5Auge5() pos5wert=5 Elseif Wuerfelzufall5 = 6 Then Pos5Auge6() pos5wert=6 endif endif If wievielehochgezogen<6 then Wuerfelzufall6 =Math.GetRandomNumber(6) If Wuerfelzufall6 = 1 Then Pos6Auge1() pos6wert=1 Elseif Wuerfelzufall6 = 2 Then Pos6Auge2() pos6wert=2 Elseif Wuerfelzufall6 = 3 Then Pos6Auge3() pos6wert=3 Elseif Wuerfelzufall6 = 4 Then Pos6Auge4() pos6wert=4 Elseif Wuerfelzufall6 = 5 Then Pos6Auge5() pos6wert=5 Elseif Wuerfelzufall6 = 6 Then Pos6Auge6() pos6wert=6 endif endif '------------------------------------------------------------------------------------------Stopknopf--------------------------------------------------------------------------------------' elseIf Controls.LastClickedButton = stopknopf Then endif Drillingcheck() EndSub '----------------------------------WÜRFEL---------------------------------' '--------------------------------Pos1--------------------------------------' ''-----------------------------------Pos 1 Auge1-----------------------" Sub Pos1Auge1 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(300,600,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(315, 615, 10, 10) Endsub '---------------------------------Pos 1 Auge 2--------------------------------------------' Sub Pos1Auge2 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(300,600,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(325, 605, 10, 10) GraphicsWindow.FillEllipse(305, 625, 10, 10) Endsub '---------------------------------Pos 1 Auge 3--------------------------------------------' Sub Pos1Auge3 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(300,600,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(325, 605, 10, 10) GraphicsWindow.FillEllipse(305, 625, 10, 10) GraphicsWindow.FillEllipse(315, 615, 10, 10) Endsub '---------------------------------Pos 1 Auge 4--------------------------------------------' Sub Pos1Auge4 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(300,600,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(325, 605, 10, 10) GraphicsWindow.FillEllipse(305, 625, 10, 10) GraphicsWindow.FillEllipse(325, 625, 10, 10) GraphicsWindow.FillEllipse(305, 605, 10, 10) Endsub '---------------------------------Pos 1 Auge 5--------------------------------------------' Sub Pos1Auge5 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(300,600,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(325, 605, 10, 10) GraphicsWindow.FillEllipse(305, 625, 10, 10) GraphicsWindow.FillEllipse(325, 625, 10, 10) GraphicsWindow.FillEllipse(305, 605, 10, 10) GraphicsWindow.FillEllipse(315, 615, 10, 10) Endsub '---------------------------------Pos 1 Auge 6--------------------------------------------' Sub Pos1Auge6 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(300,600,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(325, 605, 10, 10) GraphicsWindow.FillEllipse(305, 625, 10, 10) GraphicsWindow.FillEllipse(325, 625, 10, 10) GraphicsWindow.FillEllipse(305, 605, 10, 10) GraphicsWindow.FillEllipse(325, 615, 10, 10) GraphicsWindow.FillEllipse(305, 615, 10, 10) Endsub '-----------------------------------------Pos2----------------------------------' '-----------------------------------Pos2 Auge1-----------------------" Sub Pos2Auge1 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(550,620,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(565, 635, 10, 10) Endsub '-----------------------------------Pos2 Auge2-----------------------" Sub Pos2Auge2 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(550,620,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(575, 625, 10, 10) GraphicsWindow.FillEllipse(555, 645, 10, 10) Endsub '-----------------------------------Pos 2 Auge 3-----------------------" Sub Pos2Auge3 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(550,620,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(575, 625, 10, 10) GraphicsWindow.FillEllipse(555, 645, 10, 10) GraphicsWindow.FillEllipse(565, 635, 10, 10) Endsub '-----------------------------------Pos 2 Auge 4-----------------------" Sub Pos2Auge4 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(550,620,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(575, 625, 10, 10) GraphicsWindow.FillEllipse(555, 645, 10, 10) GraphicsWindow.FillEllipse(575, 645, 10, 10) GraphicsWindow.FillEllipse(555, 625, 10, 10) Endsub '-----------------------------------Pos 2 Auge 5-----------------------" Sub Pos2Auge5 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(550,620,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(575, 625, 10, 10) GraphicsWindow.FillEllipse(555, 645, 10, 10) GraphicsWindow.FillEllipse(575, 645, 10, 10) GraphicsWindow.FillEllipse(555, 625, 10, 10) GraphicsWindow.FillEllipse(565, 635, 10, 10) Endsub '-----------------------------------Pos 2 Auge 6-----------------------" Sub Pos2Auge6 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(550,620,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(575, 625, 10, 10) GraphicsWindow.FillEllipse(555, 645, 10, 10) GraphicsWindow.FillEllipse(575, 645, 10, 10) GraphicsWindow.FillEllipse(555, 625, 10, 10) GraphicsWindow.FillEllipse(575, 635, 10, 10) GraphicsWindow.FillEllipse(555, 635, 10, 10) Endsub '---------------------------------------Pos3---------------------------------' '-----------------------------------Pos3 Auge1-----------------------" Sub Pos3Auge1 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(400,490,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(415, 505, 10, 10) Endsub '-----------------------------------Pos3 Auge2-----------------------" Sub Pos3Auge2 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(400,490,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(425, 495, 10, 10) GraphicsWindow.FillEllipse(405, 515, 10, 10) Endsub '-----------------------------------Pos3 Auge3-----------------------" Sub Pos3Auge3 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(400,490,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(425, 495, 10, 10) GraphicsWindow.FillEllipse(405, 515, 10, 10) GraphicsWindow.FillEllipse(415, 505, 10, 10) Endsub '-------------------------------------Pos3 Auge4---------------------------' Sub Pos3Auge4 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(400,490,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(425, 495, 10, 10) GraphicsWindow.FillEllipse(405, 515, 10, 10) GraphicsWindow.FillEllipse(425, 515, 10, 10) GraphicsWindow.FillEllipse(405, 495, 10, 10) Endsub '-------------------------------------Pos3 Auge5---------------------------' Sub Pos3Auge5 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(400,490,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(425, 495, 10, 10) GraphicsWindow.FillEllipse(405, 515, 10, 10) GraphicsWindow.FillEllipse(425, 515, 10, 10) GraphicsWindow.FillEllipse(405, 495, 10, 10) GraphicsWindow.FillEllipse(415, 505, 10, 10) Endsub '-------------------------------------Pos3 Auge6--------------------------' Sub Pos3Auge6 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(400,490,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(425, 495, 10, 10) GraphicsWindow.FillEllipse(405, 515, 10, 10) GraphicsWindow.FillEllipse(425, 515, 10, 10) GraphicsWindow.FillEllipse(405, 495, 10, 10) GraphicsWindow.FillEllipse(425, 505, 10, 10) GraphicsWindow.FillEllipse(405, 505, 10, 10) Endsub '-----------------------------------------Pos4--------------------------------' '-----------------------------------Pos4 Auge1-----------------------" Sub Pos4Auge1 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(550,450,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(565, 465, 10, 10) Endsub '-----------------------------------Pos4 Auge2-----------------------" Sub Pos4Auge2 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(550,450,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(555, 475, 10, 10) GraphicsWindow.FillEllipse(575, 455, 10, 10) Endsub '-----------------------------------Pos4 Auge3-----------------------" Sub Pos4Auge3 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(550,450,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(555, 475, 10, 10) GraphicsWindow.FillEllipse(575, 455, 10, 10) GraphicsWindow.FillEllipse(565, 465, 10, 10) Endsub '-----------------------------------Pos4 Auge4-----------------------" Sub Pos4Auge4 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(550,450,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(555, 475, 10, 10) GraphicsWindow.FillEllipse(575, 455, 10, 10) GraphicsWindow.FillEllipse(555, 455, 10, 10) GraphicsWindow.FillEllipse(575, 475, 10, 10) Endsub '-----------------------------------Pos4 Auge5-----------------------" Sub Pos4Auge5 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(550,450,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(555, 475, 10, 10) GraphicsWindow.FillEllipse(575, 455, 10, 10) GraphicsWindow.FillEllipse(555, 455, 10, 10) GraphicsWindow.FillEllipse(575, 475, 10, 10) GraphicsWindow.FillEllipse(565, 465, 10, 10) Endsub '-----------------------------------Pos4 Auge6-----------------------" Sub Pos4Auge6 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(550,450,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(555, 475, 10, 10) GraphicsWindow.FillEllipse(575, 455, 10, 10) GraphicsWindow.FillEllipse(555, 455, 10, 10) GraphicsWindow.FillEllipse(575, 475, 10, 10) GraphicsWindow.FillEllipse(555, 465, 10, 10) GraphicsWindow.FillEllipse(575, 465, 10, 10) Endsub '-----------------------------------------Pos5--------------------------------' '-----------------------------------Pos5 Auge1-----------------------' Sub Pos5Auge1 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(450,600,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(465, 615, 10, 10) Endsub '-----------------------------------Pos5 Auge2-----------------------' Sub Pos5Auge2 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(450,600,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(455, 625, 10, 10) GraphicsWindow.FillEllipse(475, 605, 10, 10) Endsub '-----------------------------------Pos5 Auge3-----------------------' Sub Pos5Auge3 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(450,600,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(455, 625, 10, 10) GraphicsWindow.FillEllipse(475, 605, 10, 10) GraphicsWindow.FillEllipse(465, 615, 10, 10) Endsub '-----------------------------------Pos5 Auge4-----------------------' Sub Pos5Auge4 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(450,600,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(455, 625, 10, 10) GraphicsWindow.FillEllipse(475, 605, 10, 10) GraphicsWindow.FillEllipse(455, 605, 10, 10) GraphicsWindow.FillEllipse(475, 625, 10, 10) Endsub '-----------------------------------Pos5 Auge5-----------------------' Sub Pos5Auge5 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(450,600,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(455, 625, 10, 10) GraphicsWindow.FillEllipse(475, 605, 10, 10) GraphicsWindow.FillEllipse(455, 605, 10, 10) GraphicsWindow.FillEllipse(475, 625, 10, 10) GraphicsWindow.FillEllipse(465, 615, 10, 10) Endsub '-----------------------------------Pos5 Auge6-----------------------' Sub Pos5Auge6 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(450,600,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(455, 625, 10, 10) GraphicsWindow.FillEllipse(475, 605, 10, 10) GraphicsWindow.FillEllipse(455, 605, 10, 10) GraphicsWindow.FillEllipse(475, 625, 10, 10) GraphicsWindow.FillEllipse(455, 615, 10, 10) GraphicsWindow.FillEllipse(475, 615, 10, 10) Endsub '-----------------------------------------Pos6--------------------------------' '-----------------------------------Pos6 Auge1-----------------------' Sub Pos6Auge1 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(500,550,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(515, 565, 10, 10) Endsub '-----------------------------------Pos6 Auge2-----------------------' Sub Pos6Auge2 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(500,550,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(505, 575, 10, 10) GraphicsWindow.FillEllipse(525, 555, 10, 10) Endsub '-----------------------------------Pos6 Auge3-----------------------' Sub Pos6Auge3 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(500,550,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(505, 575, 10, 10) GraphicsWindow.FillEllipse(525, 555, 10, 10) GraphicsWindow.FillEllipse(515, 565, 10, 10) Endsub '-----------------------------------Pos6 Auge4-----------------------' Sub Pos6Auge4 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(500,550,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(505, 575, 10, 10) GraphicsWindow.FillEllipse(525, 555, 10, 10) GraphicsWindow.FillEllipse(505, 555, 10, 10) GraphicsWindow.FillEllipse(525, 575, 10, 10) Endsub '-----------------------------------Pos6 Auge5-----------------------' Sub Pos6Auge5 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(500,550,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(505, 575, 10, 10) GraphicsWindow.FillEllipse(525, 555, 10, 10) GraphicsWindow.FillEllipse(505, 555, 10, 10) GraphicsWindow.FillEllipse(525, 575, 10, 10) GraphicsWindow.FillEllipse(515, 565, 10, 10) Endsub '-----------------------------------Pos6 Auge6-----------------------' Sub Pos6Auge6 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(500,550,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(505, 575, 10, 10) GraphicsWindow.FillEllipse(525, 555, 10, 10) GraphicsWindow.FillEllipse(505, 555, 10, 10) GraphicsWindow.FillEllipse(525, 575, 10, 10) GraphicsWindow.FillEllipse(505, 565, 10, 10) GraphicsWindow.FillEllipse(525, 565, 10, 10) Endsub Sub AuswahlFelder GraphicsWindow.fillrectangle(200,550,40,40) GraphicsWindow.fillrectangle(200,550,40,40) EndSub ''-----------------------------------Pos 1 oben Auge1-----------------------" Sub Pos1obenAuge1 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(100,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(115, 115, 10, 10) pos1obenfrei = 1 Endsub '---------------------------------Pos 1 obenAuge 2--------------------------------------------' Sub Pos1obenAuge2 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(100,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(125, 105, 10, 10) GraphicsWindow.FillEllipse(105, 125, 10, 10) pos1obenfrei = 1 Endsub '---------------------------------Pos 1 obenAuge 3--------------------------------------------' Sub Pos1obenAuge3 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(100,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(125, 105, 10, 10) GraphicsWindow.FillEllipse(105, 125, 10, 10) GraphicsWindow.FillEllipse(115, 115, 10, 10) pos1obenfrei = 1 Endsub '---------------------------------Pos 1 obenAuge 4--------------------------------------------' Sub Pos1obenAuge4 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(100,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(125, 105, 10, 10) GraphicsWindow.FillEllipse(105, 125, 10, 10) GraphicsWindow.FillEllipse(125, 125, 10, 10) GraphicsWindow.FillEllipse(105, 105, 10, 10) pos1obenfrei = 1 Endsub '---------------------------------Pos 1 obenAuge 5--------------------------------------------' Sub Pos1obenAuge5 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(100,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(125, 105, 10, 10) GraphicsWindow.FillEllipse(105, 125, 10, 10) GraphicsWindow.FillEllipse(125, 125, 10, 10) GraphicsWindow.FillEllipse(105, 105, 10, 10) GraphicsWindow.FillEllipse(115, 115, 10, 10) pos1obenfrei = 1 Endsub '---------------------------------Pos 1 obenAuge 6--------------------------------------------' Sub Pos1obenAuge6 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(100,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(125, 105, 10, 10) GraphicsWindow.FillEllipse(105, 125, 10, 10) GraphicsWindow.FillEllipse(125, 125, 10, 10) GraphicsWindow.FillEllipse(105, 105, 10, 10) GraphicsWindow.FillEllipse(125, 115, 10, 10) GraphicsWindow.FillEllipse(105, 115, 10, 10) pos1obenfrei = 1 Endsub ''-----------------------------------Pos 2 oben Auge1-----------------------" Sub Pos2obenAuge1 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(200,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(215, 115, 10, 10) pos2obenfrei = 1 Endsub '---------------------------------Pos 2 obenAuge 2--------------------------------------------' Sub Pos2obenAuge2 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(200,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(225, 105, 10, 10) GraphicsWindow.FillEllipse(205, 125, 10, 10) pos2obenfrei = 1 Endsub '---------------------------------Pos 2 obenAuge 3--------------------------------------------' Sub Pos2obenAuge3 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(200,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(225, 105, 10, 10) GraphicsWindow.FillEllipse(205, 125, 10, 10) GraphicsWindow.FillEllipse(215, 115, 10, 10) pos2obenfrei = 1 Endsub '---------------------------------Pos 2 obenAuge 4--------------------------------------------' Sub Pos2obenAuge4 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(200,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(225, 105, 10, 10) GraphicsWindow.FillEllipse(205, 125, 10, 10) GraphicsWindow.FillEllipse(225, 125, 10, 10) GraphicsWindow.FillEllipse(205, 105, 10, 10) pos2obenfrei = 1 Endsub '---------------------------------Pos 2 obenAuge 5--------------------------------------------' Sub Pos2obenAuge5 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(200,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(225, 105, 10, 10) GraphicsWindow.FillEllipse(205, 125, 10, 10) GraphicsWindow.FillEllipse(225, 125, 10, 10) GraphicsWindow.FillEllipse(205, 105, 10, 10) GraphicsWindow.FillEllipse(215, 115, 10, 10) pos2obenfrei = 1 Endsub '---------------------------------Pos 2 obenAuge 6--------------------------------------------' Sub Pos2obenAuge6 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(200,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(225, 105, 10, 10) GraphicsWindow.FillEllipse(205, 125, 10, 10) GraphicsWindow.FillEllipse(225, 125, 10, 10) GraphicsWindow.FillEllipse(205, 105, 10, 10) GraphicsWindow.FillEllipse(225, 115, 10, 10) GraphicsWindow.FillEllipse(205, 115, 10, 10) pos2obenfrei = 1 Endsub ''-----------------------------------Pos 3 oben Auge1-----------------------" Sub Pos3obenAuge1 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(300,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(315, 115, 10, 10) pos3obenfrei = 1 Endsub '---------------------------------Pos 3 obenAuge 2--------------------------------------------' Sub Pos3obenAuge2 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(300,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(325, 105, 10, 10) GraphicsWindow.FillEllipse(305, 125, 10, 10) pos3obenfrei = 1 Endsub '---------------------------------Pos 3 obenAuge 3--------------------------------------------' Sub Pos3obenAuge3 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(300,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(325, 105, 10, 10) GraphicsWindow.FillEllipse(305, 125, 10, 10) GraphicsWindow.FillEllipse(315, 115, 10, 10) pos3obenfrei = 1 Endsub '---------------------------------Pos 3 obenAuge 4--------------------------------------------' Sub Pos3obenAuge4 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(300,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(325, 105, 10, 10) GraphicsWindow.FillEllipse(305, 125, 10, 10) GraphicsWindow.FillEllipse(325, 125, 10, 10) GraphicsWindow.FillEllipse(305, 105, 10, 10) pos3obenfrei = 1 Endsub '---------------------------------Pos 3 obenAuge 5--------------------------------------------' Sub Pos3obenAuge5 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(300,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(325, 105, 10, 10) GraphicsWindow.FillEllipse(305, 125, 10, 10) GraphicsWindow.FillEllipse(325, 125, 10, 10) GraphicsWindow.FillEllipse(305, 105, 10, 10) GraphicsWindow.FillEllipse(315, 115, 10, 10) pos3obenfrei = 1 Endsub '---------------------------------Pos 3 obenAuge 6--------------------------------------------' Sub Pos3obenAuge6 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(300,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(325, 105, 10, 10) GraphicsWindow.FillEllipse(305, 125, 10, 10) GraphicsWindow.FillEllipse(325, 125, 10, 10) GraphicsWindow.FillEllipse(305, 105, 10, 10) GraphicsWindow.FillEllipse(325, 115, 10, 10) GraphicsWindow.FillEllipse(305, 115, 10, 10) pos3obenfrei = 1 Endsub ''-----------------------------------Pos 4 oben Auge1-----------------------" Sub Pos4obenAuge1 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(400,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(415, 115, 10, 10) pos4obenfrei = 1 Endsub '---------------------------------Pos 4 obenAuge 2--------------------------------------------' Sub Pos4obenAuge2 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(400,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(425, 105, 10, 10) GraphicsWindow.FillEllipse(405, 125, 10, 10) pos4obenfrei = 1 Endsub '---------------------------------Pos 4 obenAuge 3--------------------------------------------' Sub Pos4obenAuge3 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(400,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(425, 105, 10, 10) GraphicsWindow.FillEllipse(405, 125, 10, 10) GraphicsWindow.FillEllipse(415, 115, 10, 10) pos4obenfrei = 1 Endsub '---------------------------------Pos 4 obenAuge 4--------------------------------------------' Sub Pos4obenAuge4 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(400,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(425, 105, 10, 10) GraphicsWindow.FillEllipse(405, 125, 10, 10) GraphicsWindow.FillEllipse(425, 125, 10, 10) GraphicsWindow.FillEllipse(405, 105, 10, 10) pos4obenfrei = 1 Endsub '---------------------------------Pos 4 obenAuge 5--------------------------------------------' Sub Pos4obenAuge5 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(400,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(425, 105, 10, 10) GraphicsWindow.FillEllipse(405, 125, 10, 10) GraphicsWindow.FillEllipse(425, 125, 10, 10) GraphicsWindow.FillEllipse(405, 105, 10, 10) GraphicsWindow.FillEllipse(415, 115, 10, 10) pos4obenfrei = 1 Endsub '---------------------------------Pos 4 obenAuge 6--------------------------------------------' Sub Pos4obenAuge6 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(400,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(425, 105, 10, 10) GraphicsWindow.FillEllipse(405, 125, 10, 10) GraphicsWindow.FillEllipse(425, 125, 10, 10) GraphicsWindow.FillEllipse(405, 105, 10, 10) GraphicsWindow.FillEllipse(425, 115, 10, 10) GraphicsWindow.FillEllipse(405, 115, 10, 10) pos4obenfrei = 1 Endsub ''-----------------------------------Pos 5 oben Auge1-----------------------" Sub Pos5obenAuge1 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(500,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(515, 115, 10, 10) pos5obenfrei = 1 Endsub '---------------------------------Pos 5 obenAuge 2--------------------------------------------' Sub Pos5obenAuge2 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(500,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(525, 105, 10, 10) GraphicsWindow.FillEllipse(505, 125, 10, 10) pos5obenfrei = 1 Endsub '---------------------------------Pos 5 obenAuge 3--------------------------------------------' Sub Pos5obenAuge3 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(500,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(525, 105, 10, 10) GraphicsWindow.FillEllipse(505, 125, 10, 10) GraphicsWindow.FillEllipse(515, 115, 10, 10) pos5obenfrei = 1 Endsub '---------------------------------Pos 5 obenAuge 4--------------------------------------------' Sub Pos5obenAuge4 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(500,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(525, 105, 10, 10) GraphicsWindow.FillEllipse(505, 125, 10, 10) GraphicsWindow.FillEllipse(525, 125, 10, 10) GraphicsWindow.FillEllipse(505, 105, 10, 10) pos5obenfrei = 1 Endsub '---------------------------------Pos 5 obenAuge 5--------------------------------------------' Sub Pos5obenAuge5 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(500,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(525, 105, 10, 10) GraphicsWindow.FillEllipse(505, 125, 10, 10) GraphicsWindow.FillEllipse(525, 125, 10, 10) GraphicsWindow.FillEllipse(505, 105, 10, 10) GraphicsWindow.FillEllipse(515, 115, 10, 10) pos5obenfrei = 1 Endsub '---------------------------------Pos 5 obenAuge 6--------------------------------------------' Sub Pos5obenAuge6 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(500,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(525, 105, 10, 10) GraphicsWindow.FillEllipse(505, 125, 10, 10) GraphicsWindow.FillEllipse(525, 125, 10, 10) GraphicsWindow.FillEllipse(505, 105, 10, 10) GraphicsWindow.FillEllipse(525, 115, 10, 10) GraphicsWindow.FillEllipse(505, 115, 10, 10) pos5obenfrei = 1 Endsub ''-----------------------------------Pos 6 oben Auge1-----------------------" Sub Pos6obenAuge1 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(600,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(615, 115, 10, 10) pos6obenfrei = 1 Endsub '---------------------------------Pos 6 obenAuge 2--------------------------------------------' Sub Pos6obenAuge2 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(600,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(625, 105, 10, 10) GraphicsWindow.FillEllipse(605, 125, 10, 10) pos6obenfrei = 1 Endsub '---------------------------------Pos 6 obenAuge 3--------------------------------------------' Sub Pos6obenAuge3 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(600,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(625, 105, 10, 10) GraphicsWindow.FillEllipse(605, 125, 10, 10) GraphicsWindow.FillEllipse(615, 115, 10, 10) pos6obenfrei = 1 Endsub '---------------------------------Pos 6 obenAuge 4--------------------------------------------' Sub Pos6obenAuge4 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(600,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(625, 105, 10, 10) GraphicsWindow.FillEllipse(605, 125, 10, 10) GraphicsWindow.FillEllipse(625, 125, 10, 10) GraphicsWindow.FillEllipse(605, 105, 10, 10) pos6obenfrei = 1 Endsub '---------------------------------Pos 6 obenAuge 5--------------------------------------------' Sub Pos6obenAuge5 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(600,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(625, 105, 10, 10) GraphicsWindow.FillEllipse(605, 125, 10, 10) GraphicsWindow.FillEllipse(625, 125, 10, 10) GraphicsWindow.FillEllipse(605, 105, 10, 10) GraphicsWindow.FillEllipse(615, 115, 10, 10) pos6obenfrei = 1 Endsub '---------------------------------Pos 6 obenAuge 6--------------------------------------------' Sub Pos6obenAuge6 GraphicsWindow.BrushColor = "White GraphicsWindow.fillrectangle(600,100,40,40) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(625, 105, 10, 10) GraphicsWindow.FillEllipse(605, 125, 10, 10) GraphicsWindow.FillEllipse(625, 125, 10, 10) GraphicsWindow.FillEllipse(605, 105, 10, 10) GraphicsWindow.FillEllipse(625, 115, 10, 10) GraphicsWindow.FillEllipse(605, 115, 10, 10) pos6obenfrei = 1 Endsub ''-----------------------------------Pos 1 loeschen-----------------------" Sub Pos1loeschen GraphicsWindow.BrushColor = "Green" GraphicsWindow.fillrectangle(300,600,40,40) Endsub ''-----------------------------------Pos 2 loeschen-----------------------" Sub Pos2loeschen GraphicsWindow.BrushColor = "Green" GraphicsWindow.fillrectangle(550,620,40,40) Endsub '---------------------------------Pos 3 loeschen--------------------------------------------' Sub Pos3loeschen GraphicsWindow.BrushColor = "Green" GraphicsWindow.fillrectangle(400,490,40,40) Endsub '---------------------------------Pos 4 loeschen--------------------------------------------' Sub Pos4loeschen GraphicsWindow.BrushColor = "Green" GraphicsWindow.fillrectangle(550,450,40,40) Endsub '---------------------------------Pos 5 loeschen--------------------------------------------' Sub Pos5loeschen GraphicsWindow.BrushColor = "Green" GraphicsWindow.fillrectangle(450,600,40,40) Endsub '---------------------------------Pos 6 loeschen--------------------------------------------' Sub Pos6loeschen GraphicsWindow.BrushColor = "Green" GraphicsWindow.fillrectangle(500,550,40,40) Endsub '----------------------------------------------------------------- Anzeige aktualisieren und rechnen -------------------------------------------------------' Sub anzeigeaktualisieren ZaehlerEinser =0 Zaehlerfuenfer =0 Drillingcheck() wenn Einserdrilling = 1 then score = score + 1000 wenn Zweierdrilling = 1 then score = score + 200 wenn Dreierdrilling = 1 then score = score + 1000 If Pos1oben=1 then ZaehlerEinser = ZaehlerEinser +1 EndIf If Pos2oben=1 then ZaehlerEinser = ZaehlerEinser +1 EndIf If Pos3oben=1 then ZaehlerEinser = ZaehlerEinser +1 EndIf If Pos4oben=1 then ZaehlerEinser = ZaehlerEinser +1 EndIf If Pos5oben=1 then ZaehlerEinser = ZaehlerEinser +1 EndIf If Pos6oben=1 then ZaehlerEinser = ZaehlerEinser +1 EndIf score = ZaehlerEinser * 100 If Pos1oben=5 then Zaehlerfuenfer = Zaehlerfuenfer +1 EndIf If Pos2oben=5 then Zaehlerfuenfer = Zaehlerfuenfer +1 EndIf If Pos3oben=5 then Zaehlerfuenfer = Zaehlerfuenfer +1 EndIf If Pos4oben=5 then Zaehlerfuenfer = Zaehlerfuenfer +1 EndIf If Pos5oben=5 then Zaehlerfuenfer = Zaehlerfuenfer +1 EndIf If Pos6oben=5 then Zaehlerfuenfer = Zaehlerfuenfer +1 EndIf score = score + (Zaehlerfuenfer * 50) GraphicsWindow.BrushColor = "Pink" GraphicsWindow.FillRectangle(300, 30, 153, 50) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawRectangle(300, 30, 153, 50) GraphicsWindow.DrawText(305, 35, Text.Append(Text.GetSubText( "00000000", 0, 8 - Text.GetLength( score ) ), score)) endsub End>GNK394.sb< Start>GNM401.sb< GraphicsWindow.Title ="Current U.S. Weather" GraphicsWindow.Width= 600 GraphicsWindow.Height =405 weather = ImageList.LoadImage("http://image.weather.com/images/maps/current/curwx_600x405.jpg") GraphicsWindow.DrawImage(weather, 0, 0) End>GNM401.sb< Start>GNM423-0.sb< string = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur sodales ligula in libero." gh = 420 - 17 If Text.StartsWith(Program.Directory, "http://smallbasic.com") Then gh = 420 - 25 EndIf 'Tally the letters used For i = 1 To Text.GetLength(string) lowerCaseCharacterCode = Text.GetCharacterCode(Text.ConvertToLowerCase(Text.GetSubText(string, i, 1))) If lowerCaseCharacterCode >= Text.GetCharacterCode("a") And lowerCaseCharacterCode <= Text.GetCharacterCode("z") Then tally[lowerCaseCharacterCode] = tally[lowerCaseCharacterCode] + 1 max = Math.Max(max, tally[lowerCaseCharacterCode]) EndIf EndFor 'Calibrate GraphicsWindow.BrushColor = "#2B2828" For y = 0 To gh Step gh /5 *2 GraphicsWindow.FillRectangle(0, y, GraphicsWindow.Width, gh /5) EndFor GraphicsWindow.BrushColor = "silver" For i = 1 To 5 ref = Shapes.AddText(Math.Round(max - (i-1) * max /5)) Shapes.Move(ref, 0, gh /5 *(i-1)) EndFor 'Draw Tally from a to z GraphicsWindow.PenWidth = 15 GraphicsWindow.PenColor = "DodgerBlue" For i = Text.GetCharacterCode("a") To Text.GetCharacterCode("z") If tally[i] > 0 Then j = j + 1 x = (GraphicsWindow.PenWidth * (j-1)) + GraphicsWindow.PenWidth /3 *j + GraphicsWindow.PenWidth/2 +15 y = gh - tally[i] / max * gh GraphicsWindow.DrawLine(x, y, x, gh) GraphicsWindow.DrawText(x-5 , gh, Text.GetCharacter(i)) 'fudge in x offset sum = sum + tally[i] EndIf EndFor GraphicsWindow.CanResize = 0 GraphicsWindow.Width = (GraphicsWindow.PenWidth * (j)) + GraphicsWindow.PenWidth /3 *(j+1) + 15 GraphicsWindow.Height = 420 GraphicsWindow.BackgroundColor = "black" GraphicsWindow.Title = "Letter Frequency. [Count = " + sum + "]" End>GNM423-0.sb< Start>GNM524.sb< 'add game play buttons, 1st create space for them: TOP for menu, BOTTOM for display 'DEBUG() boxSize = 3 ribbonHeight = 25 GraphicsWindow.MouseDown = OnMouseDown Timer.Tick = OnTick Timer.Interval = 1000 InitialiseGraphicsWindow() box = Shapes.AddRectangle(boxSize, boxSize) ShowBox() 'initialise boxZoom and position, then hide. ????? Shapes.HideShape(box) 'GraphicsWindow.Show() While "True" If flag = "Box Clicked On" Then Sound.PlayChime() Program.Delay(300) HideBox() flag = "" ElseIf flag = "Show Box" Then ShowBox() flag = "" EndIf Program.Delay(20) EndWhile Sub OnTick Timer.Interval = Math.GetRandomNumber(2500) + 500 flag = "Show Box" EndSub Sub OnMouseDown If GraphicsWindow.MouseX >= boxX And GraphicsWindow.MouseX <= boxX + boxTrueSize Then If GraphicsWindow.MouseY >= boxY And GraphicsWindow.MouseY <= boxY + boxTrueSize Then flag = "Box Clicked On" 'can't run animation in event thread EndIf EndIf EndSub Sub ShowBox boxZoom = Math.GetRandomNumber(20 - 5) + 5 '5'20 boxZoomOffset = ((boxSize * boxZoom) - boxSize) / 2 boxTrueSize = boxSize * boxZoom boxX = Math.GetRandomNumber(gw - (boxSize * boxZoom)) boxY = Math.GetRandomNumber(gh - (boxSize * boxZoom) - ribbonHeight * 2) + ribbonHeight Shapes.Zoom(box, boxZoom, boxZoom) Shapes.Move(box, boxX + boxZoomOffset, boxY + boxZoomOffset) Shapes.ShowShape(box) EndSub Sub HideBox While boxZoom > 0.5 boxZoom = boxZoom - 0.2 Shapes.Zoom(box, boxZoom, boxZoom) Program.Delay(5) EndWhile Shapes.HideShape(box) EndSub Sub InitialiseGraphicsWindow 'GraphicsWindow.Hide() gw = GraphicsWindow.Width gh = GraphicsWindow.Height GraphicsWindow.Left = (Desktop.Width - gw) / 2 GraphicsWindow.Top = 10 GraphicsWindow.BackgroundColor = "black" GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "yellow" EndSub Sub DEBUG TextWindow.Title = "DEBUGGING" TextWindow.Left = 5 TextWindow.Top = 80 EndSub End>GNM524.sb< Start>GNN443.sb< GraphicsWindow.BackgroundColor="tan GraphicsWindow.Title = "Draw Circle Game GraphicsWindow.FontName="Lucida console GraphicsWindow.FontSize=16 GraphicsWindow.FontBold="false args=0 Init() While "True" DrawCircle() If n>5 Then Result() EndIf Clear() EndWhile Sub Clear GraphicsWindow.BrushColor = "tan GraphicsWindow.FillRectangle(0, 0, gw, gh) n = 0 x = "" y = "" EndSub Sub DrawCircle buttonClicked = "False" GraphicsWindow.BrushColor = "Black" While Not[buttonClicked] If mouseMove And Mouse.IsLeftButtonDown Then If GraphicsWindow.MouseY < gh - 10 Then n = n + 1 x[n] = GraphicsWindow.MouseX y[n] = GraphicsWindow.MouseY GraphicsWindow.FillEllipse(x[n] - 2, y[n] - 2, 4, 4) EndIf mouseMove = "False" EndIf EndWhile EndSub Sub Init Not = "False=True;True=False CR = Text.GetCharacter(13) LF = Text.GetCharacter(10) dx = "1=1;2=0;3=-1;4=0 dy = "1=0;2=1;3=0;4=-1 gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BrushColor = "Black" bbb=Controls.AddButton("Check", gw - 60, gh - 30) Controls.ButtonClicked = OnButtonClicked GraphicsWindow.MouseMove = OnMouseMove EndSub Sub OnButtonClicked buttonClicked = "True" EndSub Sub OnMouseMove mouseMove = "True" EndSub Sub Result txt = "nodes: " + n + CR + LF sx = 0 sy = 0 For i = 1 To n sx = sx + x[i] sy = sy + y[i] EndFor ax = Math.Floor(sx / n) ay = Math.Floor(sy / n) txt = txt + "Σx: " + ldcall.Function2("fmt" sx 6) + " | avr(x): " + ax + CR + LF txt = txt + "Σy: " + ldcall.Function2("fmt" sy 6) + " | avr(y): " + ay + CR + LF GraphicsWindow.BrushColor = "Red" GraphicsWindow.FillEllipse(ax - 2, ay - 2, 4, 4) sr = 0 For i = 1 To n rx = x[i] - ax ry = y[i] - ay r[i] = Math.SquareRoot(rx * rx + ry * ry) sr = sr + r[i] EndFor sr = Math.Floor(sr) ar = Math.Floor(sr / n) txt = txt + "Σr: " + ldcall.Function2("fmt" sr 6) + " | avr(r): " + ar + CR + LF GraphicsWindow.PenColor = "Red" GraphicsWindow.DrawEllipse(ax - ar, ay - ar, 2 * ar, 2 * ar) se = 0 For i = 1 To n e = Math.Abs(r[i] - ar) se = se + e EndFor se = Math.Floor(se) txt = txt + "Σe: " + se + CR + LF txt = txt + "score [n*avr(r)/Σe] = " + Math.Floor(n * ar / se) GraphicsWindow.BrushColor="darkblue GraphicsWindow.DrawBoundText(10, gh - 110 gw - 60 txt) Controls.SetButtonCaption(bbb "New") Wait() EndSub sub fmt aa=args[1] ll=args[2] return=Text.GetSubTextToEnd(Math.Power(10 ll)+aa 2) EndSub Sub Wait buttonClicked = "False" While Not[buttonClicked] Program.Delay(20) EndWhile Controls.SetButtonCaption(bbb "Check") EndSub End>GNN443.sb< Start>GNQ946.sb< gw = 600 gh = 600 SetupWindow() InitGlobals() playerInit() ObstacleInit() ExplosionInit() While (gamePlay = true) start = Clock.ElapsedMilliseconds ObstacleUpdate() If (exploding = false) Then playerUpdate() Else Explode() PlayerDie() EndIf delay = 20 - (Clock.ElapsedMilliseconds - start) If (delay > 0) Then Program.Delay(delay) EndIf EndWhile ' End Game Shapes.Move(gameOverLabel, 160, gh/2-50) Shapes.ShowShape(gameOverLabel) For op = 1 to 200 Step 0.5 ObstacleUpdate() Shapes.SetOpacity(gameOverLabel, op) Program.Delay(20) EndFor Sub SetupWindow GraphicsWindow.Hide() GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BackgroundColor = "Black" GraphicsWindow.Left = (Desktop.Width - gw) /2 GraphicsWindow.Top = (Desktop.Height - gh) /3 GraphicsWindow.Title = "Dodge the Falling Things" GraphicsWindow.Show() ' Setup Score display GraphicsWindow.FontSize = 35 GraphicsWindow.FontBold = false GraphicsWindow.BrushColor = "White" scoreLabel = Shapes.AddText(0) Shapes.Move(scoreLabel, gw - 100, 20) ' Setup Game Over Display GraphicsWindow.FontSize = 50 gameOverLabel = Shapes.AddText("") Shapes.Move(gameOverLabel, -100, -100) Shapes.HideShape(gameOverLabel) Shapes.SetText(gameOverLabel, "GAME OVER") ' Add Event Handlers GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp interval = 1000 Timer.Interval = interval Timer.Tick = AddObstacle Timer.Pause() EndSub Sub InitGlobals true = "True" false = "False" keyLeft = false keyRight = false gamePlay = true gravity = 0.1 exploding = false score = 0 EndSub Sub playerInit playerSpeed = 5 playerX = gw/2 playerY = gh - 40 playerW = 30 playerH = 20 playerZoom = 1.0 GraphicsWindow.PenColor = "White" GraphicsWindow.BrushColor = "Blue" player = Shapes.AddRectangle(playerW, playerH) Shapes.Move(player, playerX - playerW/2, playerY - playerH/2) 'GraphicsWindow.DrawLine(gw/2,0,gw/2,gh) EndSub sub ObstacleInit numObstacles = 14 activeObstacles = 0 For i = 1 To numObstacles radius = (Math.GetRandomNumber(7) + 5) * 3 r = Math.GetRandomNumber(200) + 50 g = Math.GetRandomNumber(200) + 50 b = Math.GetRandomNumber(200) + 50 GraphicsWindow.BrushColor = GraphicsWindow.GetColorFromRGB(r,g,b) GraphicsWindow.PenColor = "Transparent" obstacles[i] = Shapes.AddEllipse(radius*2,radius*2) shapes.Move(obstacles[i], -100, -100) obstacleRadius[i] = radius EndFor For i = 1 To numObstacles obstacleIndex = i ObstacleReset() EndFor Timer.Resume() EndSub Sub ObstacleReset ' Takes in 'obstacleIndex' as a parameter to determine the obstacle to act on ' obstacleIndex' must be set to the current obstacle prior to calling this finction localX = Math.GetRandomNumber(gw-30) + 15 localY = -(Math.GetRandomNumber(30) + 50) obstacleX[obstacleIndex] = localX obstacleY[obstacleIndex] = localY obstacleSpeed[obstacleIndex] = Math.GetRandomNumber(6) + 1 Shapes.Move(obstacles[obstacleIndex], localX-obstacleRadius[obstacleIndex], localY-obstacleRadius[obstacleIndex]) EndSub Sub ObstacleUpdate For i = 1 To activeObstacles obstacleY[i] = obstacleY[i] + obstacleSpeed[i] obstacleSpeed[i] = obstacleSpeed[i] + gravity Shapes.Move(obstacles[i], obstacleX[i]-obstacleRadius[i], obstacleY[i]-obstacleRadius[i]) If (exploding = false) Then If (obstacleY[i] > gh + 36) Then obstacleIndex = i ObstacleReset() ScoreUpdate() EndIf EndIf EndFor EndSub Sub ScoreUpdate score = score + 1 Shapes.SetText(scoreLabel, score) EndSub Sub playerUpdate If (keyLeft) Then playerX = playerX - playerSpeed ElseIf (keyRight) Then playerX = playerX + playerSpeed EndIf playerX = Math.Min(playerX, gw-playerW/2) playerX = Math.Max(playerX, playerW/2) playerLeft = playerX - playerW/2 playerTop = playerY - playerH/2 playerRight = playerLeft + playerW playerBottom = playerTop + playerH Shapes.Move(player, playerX-playerW/2, playerY-playerH/2) CheckCollisions() EndSub Sub PlayerDie deathElapsed = (Clock.ElapsedMilliseconds - explosionStart) If (playerZoom >= 0.1) Then playerZoom = 1.0 - ((deathElapsed / 500) * 1.0) Shapes.Zoom(player, playerZoom, playerZoom) Else Shapes.HideShape(player) EndIf EndSub Sub CheckCollisions For i = 1 To activeObstacles closestX = Math.Min(Math.Max(obstacleX[i], playerLeft), playerRight) closestY = Math.Min(Math.Max(obstacleY[i], playerTop), playerBottom) distanceX = closestX - obstacleX[i] distanceY = closestY - obstacleY[i] distance = Math.SquareRoot((distanceX * distanceX) + (distanceY * distanceY)) If distance < obstacleRadius[i] Then collision = true collisionIndex = i EndIf EndFor If collision = true Then SetExplosion() EndIf EndSub Sub ExplosionInit numParticles = 15 explosionTime = 1000 explosionZoom = 1.0 GraphicsWindow.BrushColor = "Red" For i = 1 To numParticles particles[i] = Shapes.AddEllipse(20,20) Shapes.Move(particles[i], -100, -100) px[i] = Math.GetRandomNumber(10) - 5 py[i] = -Math.GetRandomNumber(5) EndFor EndSub Sub SetExplosion 'GraphicsWindow.BackgroundColor = "Yellow" For i = 1 To numParticles pStartY = playerY - 10 pStartX = playerX - 10 Shapes.Move(particles[i], pStartX, pStartY) Shapes.SetOpacity(particles[i], 100) Shapes.ShowShape(particles[i]) EndFor collision = false exploding = true Timer.Pause() playerZoom = 1.0 explosionTime = 1000 opacity = 100 explosionStart = Clock.ElapsedMilliseconds For i = 1 To numParticles destX = pStartX + (px[i] * 50) destY = pStartY + (py[i] * 50) Shapes.Animate(particles[i], destX, destY, explosionTime) EndFor EndSub Sub Explode elapsed = Clock.ElapsedMilliseconds - explosionStart If opacity >= 0 Then opacity = 100 - ((elapsed/explosionTime) * 100) explosionZoom = explosionZoom + ((elapsed/explosionTime) * 0.5) For o = 1 to numParticles Shapes.SetOpacity(particles[o], opacity) Shapes.Zoom(particles[o], explosionZoom,explosionZoom) endfor EndIf If opacity < 0 Then Shapes.HideShape(particles[o]) gamePlay = false EndIf EndSub '++++++++++++++++++++++++ ' Event Handlers '++++++++++++++++++++++++ Sub OnKeyDown lastKeyDown = GraphicsWindow.LastKey If (lastKeyDown = "Escape") Then Program.End() ElseIf (lastKeyDown = "Left") Then keyLeft = true ElseIf (lastKeyDown = "Right") Then keyRight = true EndIf EndSub Sub OnKeyUp lastKeyUp = GraphicsWindow.LastKey If (lastKeyUp = "Left") Then keyLeft = false ElseIf (lastKeyUp = "Right") Then keyRight = false EndIf EndSub Sub AddObstacle ' Timer event to increase the number of falling obstacles If (activeObstacles < numObstacles) Then activeObstacles = activeObstacles + 1 EndIf 'initally add obstacles quickly, then slow down after a few seconds If (Timer.Interval < 3000) Then Timer.Interval = Timer.Interval + 500 Endif If activeObstacles > 9 Then Timer.Interval = 30000 EndIf EndSub End>GNQ946.sb< Start>GNR897.sb< LDUtilities.transparentgw() i=1 Timer.Tick=ttt Timer.Interval=100 Timer.Pause () LDShapes.ShapeEvent=shhp GraphicsWindow.Title ="Wait... for x=1 To 20 for y=1 to 20 oo[i]=Shapes.AddEllipse (22,22) ss[oo[i]]=LDFastShapes.ShapeIndex (oo[i]) LDFastShapes.Move (ss[oo[i]],x*15,y*15) LDFastShapes.SetOpacity (ss[oo[i]],90) LDShapes.PenWidth(oo[i],0) LDShapes.BrushColour (oo[i], LDColours.HSLtoRGB(x*10,0.9,0.2+y*0.7/30)) LDShapes.SetShapeEvent (oo[i]) i=i+1 EndFor EndFor LDFastShapes.Update () GraphicsWindow.Title ="OK Timer.Resume () Sub shhp ls=ldshapes.LastEventShape lt= LDShapes.LastEventType If lt="MouseEnter" and Mouse.IsLeftButtonDown then GraphicsWindow.Title=ss[ls] LDFastShapes.SetOpacity(ss[ls], LDFastShapes.GetOpacity (ss[ls])/3) EndIf LDFastShapes.Update () EndSub Sub ttt i=1 for x=1 To 20 for y=1 to 20 j=LDFastShapes.GetOpacity(i)*1.1 If j>100 Then j=100 endif LDFastShapes.SetOpacity(i,j) i=i+1 EndFor EndFor LDFastShapes.Update () EndSub End>GNR897.sb< Start>GNS667.sb< GraphicsWindow.left= 0 GraphicsWindow.Top=0 GraphicsWindow.Width = 1280 GraphicsWindow.Height = 666 GraphicsWindow.BackgroundColor="darkgreen GraphicsWindow.Title="Planes GraphicsWindow.BrushColor="#00bbcc GraphicsWindow.FillRectangle(0 0 1300 300) SPRITE_init() s = 0.7 shX= -450 shY= 50 add_shapes() s = 0.4 shX= -250 shY= 150 add_shapes() s = 1.2 shX= -1050 shY= 250 add_shapes() Sub add_shapes ss=s _shx=shx _shY=shY _shape=shape For i=1 To 37 GraphicsWindow.PenWidth = _shape[i]["pw"] GraphicsWindow.BrushColor = _shape[i]["bc"] GraphicsWindow.penColor = _shape[i]["pc"] If _shape[i]["func"]="ell" Then shp [i] = Shapes.AddEllipse(_shape[i]["width"]*ss, _shape[i]["height"]*ss) ElseIf _shape[i]["func"]="rect" Then shp [i] = Shapes.AddRectangle(_shape[i]["width"]*ss, _shape[i]["height"]*ss) ElseIf _shape[i]["func"]="tri" Then shp [i] = Shapes.Addtriangle(_shape[i]["x1"]*ss, _shape[i]["y1"]*ss,_shape[i]["x2"]*ss, _shape[i]["y2"]*ss, _shape[i]["x3"]*ss, _shape[i]["y3"]*ss) ElseIf _shape[i]["func"]="line" Then shp [i] = Shapes.Addline(_shape[i]["x1"]*ss, _shape[i]["y1"]*ss,_shape[i]["x2"]*ss, _shape[i]["y2"]*ss) EndIf Shapes.Animate(shp [i], _shape[i]["x"]*ss+_shX, _shape[i]["y"]*ss+_shY, 500) Shapes.Rotate(shp [i], _Shape[i]["angle"]) EndFor EndSub Sub SPRITE_init shape[1] ="func=ell;x=1400;y=45;width=70;height=50;angle=-10;bc=green;pc=black;pw=1" shape[2] ="func=ell;x=1430;y=45;width=70;height=50;angle=5;bc=green;pc=black;pw=1" shape[3] ="func=ell;x=1440;y=70;width=180;height=130;angle=0;bc=red;pc=black;pw=2" shape[4] ="func=ell;x=1370;y=80;width=100;height=100;bc=red;pc=black;pw=2" shape[5] ="func=ell;x=1378;y=90;width=80;height=80;bc=white;pc=black;pw=2" shape[6] ="func=ell;x=1400;y=110;width=30;height=40;bc=black;pc=black;pw=2" shape[7] ="func=ell;x=1415;y=65;width=100;height=100;bc=red;pc=black;pw=2" shape[8] ="func=ell;x=1425;y=75;width=80;height=80;bc=white;pc=black;pw=2" shape[9] ="func=ell;x=1450;y=95;width=30;height=40;bc=black;pc=black;pw=2" shape[10] ="func=ell;x=1280;y=180;width=140;height=40;angle=-10;bc=red;pc=black;pw=0" shape[11] ="func=ell;x=1355;y=150;width=110;height=70;angle=20;bc=yellow;pw=0" shape[12] ="" shape[13] ="func=ell;x=1400;y=130;width=180;height=110;angle=0;bc=yellow;pw=0" shape[14] ="func=ell;x=1520;y=140;width=110;height=70;angle=-40;bc=yellow;pw=0" shape[15] = "" shape[16] = "" shape[17] = "func=ell;x=1600;y=-10;width=50;height=130;angle=-10;bc=red;pc=black;pw=0" shape[18] = "func=line;x=1440;y=60;x1=100;y1=80;x2=200;y2=80;angle=0;pc=black;pw=2 shape[19] = "func=line;x=1440;y=80;x1=100;y1=80;x2=200;y2=80;angle=0;pc=black;pw=2 shape[20] = "func=line;x=1440;y=100;x1=100;y1=80;x2=200;y2=80;angle=0;pc=black;pw=2 shape[21] ="func=ell;x=1450;y=185;width=40;height=50;angle=-40;bc=orange;pw=0" shape[22] ="func=ell;x=1435;y=170;width=50;height=50;angle=-40;bc=orange;pw=0" shape[23] ="func=ell;x=1401;y=150;width=80;height=50;angle=-20;bc=black;pw=0" shape[24] ="func=ell;x=1400;y=147;width=75;height=50;angle=-20;bc=yellow;pw=0" shape[25] ="func=ell;x=1350;y=135;width=40;height=30;angle=30;bc=red;pc=black;pw=0" shape[26] ="func=ell;x=1390;y=70;width=50;height=20;angle=-25;bc=green;pc=black;pw=1" shape[27] ="func=ell;x=1550;y=50;width=210;height=60;angle=-30;bc=red;pc=black;pw=0" shape[28] = "func=ell;x=1580;y=110;width=150;height=30;angle=-10;bc=red;pw=0" shape[29] = "func=ell;x=1640;y=160;width=40;height=40;angle=10;bc=red;pc=LightSlateGray;pw=8" shape[30] = "func=ell;x=1620;y=170;width=40;height=15;angle=10;bc=red;pw=0" shape[31] = "func=ell;x=1500;y=250;width=35;height=35;angle=0;bc=LightSlateGray;=pw=0" shape[32] = "func=ell;x=1520;y=250;width=40;height=40;angle=0;bc=LightSlateGray;pw=0" shape[33] = "func=ell;x=1530;y=245;width=15;height=30;angle=-30;bc=red;pw=0" shape[34] = "func=ell;x=1500;y=205;width=50;height=55;angle=-20;bc=red;pw=0" shape[35] = "func=ell;x=1480;y=240;width=40;height=20;angle=-10;bc=red;pw=0" shape[36] = "func=ell;x=1480;y=235;width=15;height=40;angle=-40;bc=red;pw=0" shape[37] = "func=ell;x=1510;y=255;width=20;height=15;angle=-10;bc=red;pw=0" EndSub End>GNS667.sb< Start>GNT311.sb< '2012/10/28 21:01:13 Code generated by Small Basic Parser Generator 1.3 version = "1.3" CBG_Main() Sub CBG_Main ' Code Block Generator | Main title = "Code Block Generator " + version traceC = "False" ' trace subroutine call traceX = "False" ' trace operation execution WQ = Text.GetCharacter(34) CRLF = Text.GetCharacter(13) + Text.GetCharacter(10) bcolor[1] = "#FFFFFF" ' background color 1 bcolor[0] = "#F8F8F8" ' background color 2 rcolor = "#008020" ' remark (comment) color lcolor = "#DD6633" ' literal color kcolor = "#7777FF" ' keyword color ccolor = "#006060" ' class (object) color mcolor = "#802020" ' member (property, operation, event) color ocolor = "#800000" ' operator color ncolor = "#5C5C5C" ' line number color fcolor = "#7F9DB9" ' frame color vcolor = "#000000" ' variable (or label) color sample[1] = "' Sample Program" sample[2] = "For i = 1 To 10" sample[3] = " TextWindow.Write(i + " + WQ + " " + WQ + ")" sample[4] = "EndFor" sample[5] = "TextWindow.WriteLine(" + WQ + WQ + ")" GraphicsWindow.Title = title GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontName = "Consolas" fsize = 12 GraphicsWindow.FontSize = fsize lheight = fsize * 1.22 ' line height cwidth = fsize * 0.54 ' column width gwidth = GraphicsWindow.Width gheight = GraphicsWindow.Height oheight = lheight * 6 ' options height fheight = lheight * 3 ' footer height bheight = (gheight - oheight - fheight - lheight * 3 - 20) / 2 ' source / preview text box dheight = gheight - fheight - lheight - 20 ' destination text box Lex_Init() While "True" CBG_ShowSourceWindow() nlines = Array.GetItemCount(sample) ' number of lines sbuf = "" For line = 1 To nlines sbuf = Text.Append(sbuf, sample[line]) If line < nlines Then sbuf = Text.Append(sbuf, CRLF) EndIf EndFor Controls.SetTextBoxText(stextbox, sbuf) Controls.ButtonClicked = CBG_OnButtonClicked GraphicsWindow.MouseDown = CBG_OnMouseDown clicked = "" x0 = 12 x = x0 + 4 y0 = 10 + lheight * 3 + bheight + oheight + 2 height = lheight While clicked <> obutton If clicked = pbutton Then clicked = "" swidth = Controls.GetTextBoxText(wtextbox) ' max snippet width sheight = Controls.GetTextBoxText(htextbox) ' max snippet height GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle(x0 - 4, y0 - 4, _swidth + 4, _sheight + 4) If (swidth <> lswidth) Or (sheight <> lsheight)Then lswidth = swidth ' last snippet width lsheight = sheight ' last snippet height If Text.EndsWith(swidth, "%") Then percent = Text.GetSubText(swidth, 1, Text.GetLength(swidth) - 1) _swidth = Math.Floor((gwidth - 20) * percent / 100) ElseIf swidth = "" Then _swidth = gwidth - 20 Else _swidth = swidth EndIf If Text.EndsWith(sheight, "%") Then percent = Text.GetSubText(sheight, 1, Text.GetLength(sheight) - 1) _sheight = Math.Floor(bheight * percent / 100) ElseIf sheight = "" Then _sheight = bheight Else _sheight = sheight EndIf EndIf GraphicsWindow.PenWidth = 1 GraphicsWindow.PenColor = fcolor GraphicsWindow.DrawRectangle(x0 - 2, y0 - 2, _swidth, _sheight) sbuf = Controls.GetTextBoxText(stextbox) ' source buffer CBG_GetLineCount() ' get nlines (number of lines) max = Math.Floor(_sheight / lheight) nlines = Math.Min(nlines, max) display = "True" CBG_Parse() ElseIf clicked = "cbox" Then clicked = "" If dispnum Then dispnum = "False" Shapes.HideShape(check) Else dispnum = "True" Shapes.ShowShape(check) EndIf Else Program.Delay(100) EndIf EndWhile display = "False" swidth = Controls.GetTextBoxText(wtextbox) ' max snippet width sheight = Controls.GetTextBoxText(htextbox) ' max snippet height sbuf = Controls.GetTextBoxText(stextbox) ' source buffer CBG_GetLineCount() ' get nlines (number of lines) CBG_Parse() CBG_ShowDestinationWindow() clicked = "" While clicked <> obutton Program.Delay(100) EndWhile EndWhile EndSub Sub CBG_GetLine ' param sbuf - source buffer ' param slen - source buffer length ' param sptr - source buffer pointer ' return buf - line buffer _ptr = Text.GetIndexOf(Text.GetSubTextToEnd(sbuf, sptr), CRLF) If _ptr = 0 Then _ptr = slen - sptr + 2 EndIf buf = Text.GetSubText(sbuf, sptr, _ptr - 1) sptr = sptr + _ptr + 1 EndSub Sub CBG_GetLineCount ' param sbuf - source buffer ' return slen - source buffer length ' return nlines - source buffer number of lines ' return sptr - source buffer pointer = 1 slen = Text.GetLength(sbuf) sptr = 1 _ptr = 1 nlines = 0 While 0 < _ptr And _ptr <= slen nlines = nlines + 1 _ptr = Text.GetIndexOf(Text.GetSubTextToEnd(sbuf, sptr), CRLF) If 0 < _ptr Then sptr = sptr + _ptr + 1 EndIf EndWhile sptr = 1 EndSub Sub CBG_OnButtonClicked clicked = Controls.LastClickedButton EndSub Sub CBG_OnMouseDown mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY If (bx0 <= mx) And (mx <= bx1) And (by0 <= my) And (my <= by1) Then clicked = "cbox" EndIf EndSub Sub CBG_Parse GraphicsWindow.FontBold = "False" cbuf = "
"" Then cbuf = cbuf + "width:" + swidth If Text.EndsWith(swidth, "%") = "False" Then cbuf = cbuf + "px" EndIf cbuf = cbuf + "; " EndIf If sheight <> "" Then cbuf = cbuf + "height:" + sheight If Text.EndsWith(sheight, "%") = "False" Then cbuf = cbuf + "px" EndIf cbuf = cbuf + "; " EndIf cbuf = cbuf + "overflow-y:auto; font-size:12px;" + WQ + ">" + CRLF + " " For line = 1 To nlines linetop = "True" cbuf = cbuf + "
" If dispnum Then cbuf = cbuf + "" + line + "." EndIf If display Then y = y0 + height * (line - 1) GraphicsWindow.BrushColor = bcolor[Math.Remainder(line, 2)] GraphicsWindow.FillRectangle(x0, y, _swidth - 4, height) If dispnum Then GraphicsWindow.BrushColor = ncolor GraphicsWindow.DrawText(x, y, Text.Append(line, ".")) column = 5 Else column = 1 EndIf EndIf CBG_GetLine() len = Text.GetLength(buf) ptr = 1 Parse_State() If linetop Then linetop = "False" cbuf = cbuf + " " ' to avoid null line collapse Else cbuf = cbuf + "" EndIf cbuf = cbuf + " End>GNT311.sb< Start>GNT471.sb< ' Generated By GUI Designer v2.0.1 GraphicsWindow.Show() GraphicsWindow.Width = GraphicsWindow.Width + 800 GraphicsWindow.Height = 441 GraphicsWindow.BrushColor = "darkblue GraphicsWindow.BackgroundColor = "teal GraphicsWindow.BrushColor = "White GraphicsWindow.PenColor = "White rect[1] = Shapes.AddRectangle(1365,349) Shapes.Move(rect[1],0,354) GraphicsWindow.BrushColor = "#420000 GraphicsWindow.BrushColor = "#460000 GraphicsWindow.PenColor = "Black rect[2] = Shapes.AddRectangle(51,267) Shapes.Move(rect[2],93,241) GraphicsWindow.BrushColor = "Lime tri[1] = Shapes.AddTriangle(119,171,27,327,237,320) tri[2] = Shapes.AddTriangle(33,232,231,227,119,83) GraphicsWindow.BrushColor = "White ell[1] = Shapes.AddEllipse(140,144) Shapes.Move(ell[1],343,183) ell[2] = Shapes.AddEllipse(197,197) Shapes.Move(ell[2],316,291) GraphicsWindow.BrushColor = "Black ell[3] = Shapes.AddEllipse(16,16) Shapes.Move(ell[3],373,214) ell[4] = Shapes.AddEllipse(15,17) Shapes.Move(ell[4],434,213) GraphicsWindow.BrushColor = "#FF8000 tri[3] = Shapes.AddTriangle(407,232,395,257,428,260) line[1] = Shapes.AddLine(369,266,410,283) line[2] = Shapes.AddLine(410,283,449,254) GraphicsWindow.FontName = "Calibri GraphicsWindow.FontSize = 27.75 GraphicsWindow.FontBold = "False GraphicsWindow.FontItalic = "False Text1 = Shapes.AddText("X-MAS MUSIC") Shapes.Move(Text1,610,149) GraphicsWindow.BrushColor = "#400000 rect[3] = Shapes.AddRectangle(42,239) Shapes.Move(rect[3],1095,259) GraphicsWindow.BrushColor = "Lime tri[4] = Shapes.AddTriangle(1007,315,1211,312,1107,138) tri[5] = Shapes.AddTriangle(1002,206,1223,200,1103,82) GraphicsWindow.BrushColor = "White GraphicsWindow.PenColor = "White ell[5] = Shapes.AddEllipse(29,24) Shapes.Move(ell[5],865,119) ell[6] = Shapes.AddEllipse(26,25) Shapes.Move(ell[6],239,105) ell[7] = Shapes.AddEllipse(31,23) Shapes.Move(ell[7],347,133) ell[8] = Shapes.AddEllipse(35,29) Shapes.Move(ell[8],468,112) ell[9] = Shapes.AddEllipse(43,39) Shapes.Move(ell[9],537,201) ell[10] = Shapes.AddEllipse(35,28) Shapes.Move(ell[10],628,102) ell[11] = Shapes.AddEllipse(34,30) Shapes.Move(ell[11],624,207) ell[12] = Shapes.AddEllipse(39,34) Shapes.Move(ell[12],570,275) ell[13] = Shapes.AddEllipse(31,35) Shapes.Move(ell[13],19,101) ell[14] = Shapes.AddEllipse(33,34) Shapes.Move(ell[14],275,238) ell[15] = Shapes.AddEllipse(36,30) Shapes.Move(ell[15],713,233) ell[16] = Shapes.AddEllipse(38,36) Shapes.Move(ell[16],668,283) ell[17] = Shapes.AddEllipse(30,28) Shapes.Move(ell[17],867,185) ell[18] = Shapes.AddEllipse(25,28) Shapes.Move(ell[18],820,240) ell[19] = Shapes.AddEllipse(35,30) Shapes.Move(ell[19],841,297) ell[20] = Shapes.AddEllipse(31,30) Shapes.Move(ell[20],956,224) ell[21] = Shapes.AddEllipse(37,28) Shapes.Move(ell[21],943,280) ell[22] = Shapes.AddEllipse(34,32) Shapes.Move(ell[22],1221,107) ell[23] = Shapes.AddEllipse(43,39) Shapes.Move(ell[23],1296,111) ell[24] = Shapes.AddEllipse(42,35) Shapes.Move(ell[24],1230,208) ell[25] = Shapes.AddEllipse(39,37) Shapes.Move(ell[25],1324,224) ell[26] = Shapes.AddEllipse(40,37) Shapes.Move(ell[26],1236,287) ell[27] = Shapes.AddEllipse(36,36) Shapes.Move(ell[27],1309,292) While ("True") Sound.PlayMusic("O5 C8 C8 G8 G8 A8 A8 G4 F8 F8 E8 E8 D8 D8 C4") EndWhile End>GNT471.sb< Start>GNV519.sb< gw = 600 gh = 600 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Title = "3D Rubic Cube" GraphicsWindow.BackgroundColor = "teal view = LD3DView.AddView(gw,gh,"True") LD3DView.ResetCamera(view,-5,-5,-5,1,1,1,0,1,0) LD3DView.AutoControl2(10,1) LD3DView.AddAmbientLight(view,"#FFFFFF") image = ImageList.LoadImage(Flickr.GetRandomPicture ("sun")) '"http://litdev.co.uk/game_images/rubic.png") For x=1 to 6 img[x]=LDImage.Copy(image) endfor LDGraphicsWindow.BackgroundImage (image) LDImage.EffectRed (img[1]) LDImage.EffectGreen (img[2]) LDImage.EffectBlue (img[3]) LDImage.EffectYellow (img[4]) LDImage.EffectGray (img[5]) LDImage.EffectCyan (img[6]) numBit = 0 'Outward faces For iFace = 1 To 6 For i = 1 To 3 For j = 1 To 3 i1 = i-2.5 i2 = i-1.5 j1 = j-2.5 j2 = j-1.5 k1 = -1.5 k2 = 1.5 If (iFace = 1) Then p0 = k1+":"+i1+":"+j1 p1 = k1+":"+i2+":"+j1 p2 = k1+":"+i1+":"+j2 p3 = k1+":"+i2+":"+j2 x = 1 y = i z = j ElseIf (iFace = 2) Then p0 = k2+":"+i1+":"+j2 p1 = k2+":"+i2+":"+j2 p2 = k2+":"+i1+":"+j1 p3 = k2+":"+i2+":"+j1 x = 3 y = i z = j ElseIf (iFace = 3) Then p0 = j1+":"+k1+":"+i1 p1 = j1+":"+k1+":"+i2 p2 = j2+":"+k1+":"+i1 p3 = j2+":"+k1+":"+i2 x = j y = 1 z = i ElseIf (iFace = 4) Then p0 = j2+":"+k2+":"+i1 p1 = j2+":"+k2+":"+i2 p2 = j1+":"+k2+":"+i1 p3 = j1+":"+k2+":"+i2 x = j y = 3 z = i ElseIf (iFace = 5) Then p0 = i1+":"+j1+":"+k1 p1 = i2+":"+j1+":"+k1 p2 = i1+":"+j2+":"+k1 p3 = i2+":"+j2+":"+k1 x = i y = j z = 1 ElseIf (iFace = 6) Then p0 = i1+":"+j2+":"+k2 p1 = i2+":"+j2+":"+k2 p2 = i1+":"+j1+":"+k2 p3 = i2+":"+j1+":"+k2 x = i y = j z = 3 EndIf points = p0+" "+p1+" "+p2+" "+p3 numBit = numBit+1 bitX[numBit] = x bitY[numBit] = y bitZ[numBit] = z bitCol[numBit] = iface bit[numBit] = LD3DView.AddGeometry(view,points,"0:2:1 1:2:3","","white","D") LD3DView.AddImage(view,bit[numBit],"0:0 1:0 0:1 1:1",img[iface] ,"D") bitPos[numBit] = LD3DView.GetPosition(view,bit[numBit]) LD3DView.SetCentre(view,bit[numBit],0,0,0,"R1R2") EndFor EndFor EndFor 'Interior colour cubes For x = 1 To 3 For y = 1 To 3 For z = 1 To 3 numBit = numBit+1 bitX[numBit] = x bitY[numBit] = y bitZ[numBit] = z bit[numBit] = LD3DView.AddCube(view,1,"Black","E") LD3DView.ReverseNormals(view,bit[numBit]) LD3DView.TranslateGeometry(view,bit[numBit],x-2,y-2,z-2) bitPos[numBit] = LD3DView.GetPosition(view,bit[numBit]) LD3DView.SetCentre(view,bit[numBit],2-x,2-y,2-z,"R2") EndFor EndFor EndFor time = 0.2 repeat = 1 numTurn = 50 For turn = 1 To numTurn turnData[turn]["dir"] = Math.GetRandomNumber(3) turnData[turn]["slice"] = Math.GetRandomNumber(3) turnData[turn]["angle"] = 90*(Math.GetRandomNumber(7)-4) EndFor reverse = "False" DoTurns() Program.Delay(1000) reverse = "True" DoTurns() Sub DoTurns For turn = 1 To numTurn xVal = 0 yVal = 0 zVal = 0 If (reverse) Then iTurn = numTurn+1-turn angle = -turnData[iTurn]["angle"] Else iTurn = turn angle = turnData[iTurn]["angle"] EndIf If (turnData[iTurn]["dir"] = 1) Then xVal = turnData[iTurn]["slice"] ElseIf (turnData[iTurn]["dir"] = 2) Then yVal = turnData[iTurn]["slice"] ElseIf (turnData[iTurn]["dir"] = 3) Then zVal = turnData[iTurn]["slice"] EndIf Rotate() EndFor EndSub Sub Rotate LDList.Clear("setX") 'Use a list to be fast and start all rotations at the same time as much as possible LDList.Clear("setY") LDList.Clear("setZ") For i = 1 To numBit If (bitX[i] = xVal) Then LDList.Add("setX",bit[i]) ElseIf (bitY[i] = yVal) Then LDList.Add("setY",bit[i]) ElseIf (bitZ[i] = zVal) Then LDList.Add("setZ",bit[i]) EndIf EndFor duration = time*Math.Abs(angle/90) For i = 1 To LDList.Count("setX") LD3DView.AnimateRotation(view,LDList.GetAt("setX",i),1,0,0,0,angle,duration,repeat) EndFor For i = 1 To LDList.Count("setY") LD3DView.AnimateRotation(view,LDList.GetAt("setY",i),0,1,0,0,angle,duration,repeat) EndFor For i = 1 To LDList.Count("setZ") LD3DView.AnimateRotation(view,LDList.GetAt("setZ",i),0,0,1,0,angle,duration,repeat) EndFor Program.Delay(1010*duration) LDGraphicsWindow.PauseUpdates() lastCol = bitCol For i = 1 To numBit If (bitCol[i] <> "" And (bitX[i] = xVal Or bitY[i] = yVal Or bitZ[i] = zVal)) Then pos1 = bitPos[i] For j = 1 To numBit If (bitCol[j] <> "" And (bitX[j] = xVal Or bitY[j] = yVal Or bitZ[j] = zVal)) Then pos2 = LD3DView.GetPosition(view,bit[j]) distSquared = (pos1[1]-pos2[1])*(pos1[1]-pos2[1]) + (pos1[2]-pos2[2])*(pos1[2]-pos2[2]) + (pos1[3]-pos2[3])*(pos1[3]-pos2[3]) If (distSquared < 0.1) Then 'bit j is now where i started bitCol[i] = lastCol[j] LD3DView.ResetMaterial(view,bit[i],"black","E") LD3DView.AddImage(view,bit[i],"0:0 1:0 0:1 1:1",img[bitCol[i]],"D") EndIf EndIf EndFor EndIf EndFor For i = 1 To numBit LD3DView.RotateGeometry2(view,bit[i],1,0,0,0) EndFor Program.Delay(10) LDGraphicsWindow.ResumeUpdates() EndSub End>GNV519.sb< Start>GNV681.sb< args=0 stt="s1 acc=0 pc=1 Sub init GraphicsWindow.BackgroundColor="midnightblue GraphicsWindow.BrushColor="transparent GraphicsWindow.PenWidth=0 GraphicsWindow.Width=800 rc=Shapes.AddRectangle(90 300) ppr=FCDrawings.CreateGraphicsFromControl(rc) Shapes.Move(rc 250, 290) ppp=5 GraphicsWindow.BrushColor="darkblue LDCall.Function3("ledd" 100 50 1) LDCall.Function3("ledd" 250 300 2) LDCall.Function2("lsett" "0 0 0 0 1 1 1 1" 1) mm[00]=". * * * * * * * mm[01]=". . . . * . . * mm[02]=". . . . * . . * mm[03]=". . . . . * * . mm[04]=". . . . . . . . mm[05]=". * * * * * * * mm[06]=". . . * * . . * mm[07]=". . * . * . . * mm[08]=". * . . . * * . mm[09]=". . . . . . . . mm[10]=". * * * * * * * mm[11]=". . . . . . . . mm[12]=". * * * * * * * mm[13]=". . . . . . * . mm[14]=". . . . . * . . mm[15]=". * * * * * * * mm[16]=". . . . . . . . mm[17]=". . . . . . . * mm[18]=". * * * * * * * mm[19]=". . . . . . . * mm[20]=". . . . . . . . mm[21]=". * * * * * * * mm[22]=". * . . * . . * mm[23]=". * . . * . . * mm[24]=". * . . . . . * mm[25]=". . . . . . . . mm[26]=". . . . . . . . mm[27]=". . . . . . . . mm[28]=". . . . . . . . mm[29]=". . . . . . . . mm[30]=". . . . . * . . mm[31]=". * . . . . * . mm[32]=". * * * * * * * mm[33]=". * . . . . . . mm[34]=". . . . . . . . mm[35]=". * * . . . * . mm[36]=". * . * . . . * mm[37]=". * . . * . . * mm[38]=". * . . . * * . mm[39]=". . . . . . . . mm[40]=". . * . . . * . mm[41]=". * . . * . . * mm[42]=". * . . * . . * mm[43]=". . * * . * * . mm[44]=". . . . . . . . mm[45]=". . . * * * . . mm[46]=". * . * . . * . mm[47]=". * * * * * * * mm[48]=". * . * . . . . mm[49]=". . . . . . . . mm[50]=". . * . * * * * mm[51]=". * . . * . . * mm[52]=". * . . * . . * mm[53]=". . * * . . . * mm[54]=". . . . . . . . mm[75]=". . * * * * * . mm[76]=". * . . * . . * mm[77]=". * . . . * . * mm[78]=". . * * * * * . mm[79]=". . . . . . . . mm[65]=". . * * . * * . mm[66]=". * . . * . . * mm[67]=". * . . * . . * mm[68]=". . * * . * * . mm[69]=". . . . . . . . mm[70]=". . * . . * * . mm[71]=". * . . * . . * mm[72]=". * . . * . . * mm[73]=". . * * * * * . mm[74]=". . . . . . . . mm[55]=". . * * * * * . mm[56]=". * . . * . . * mm[57]=". * . . * . . * mm[58]=". . * * . . * . mm[59]=". . . . . . . . mm[60]=". . . . . . . * mm[61]=". * * * * . . * mm[62]=". . . . . * . * mm[63]=". . . . . . * * mm[64]=". . . . . . . . s9=5 EndSub init() GraphicsWindow.Title="8bit Computer Screen Demo undd="true off=0 pc=1 For rr=30 To 79 prtt() pc=pc+1 EndFor Sub nxt cpp=LDGraphicsWindow.Capture("" "false") Shapes.Remove(rc) LDImage.Crop(cpp 250 0 549 300) sss=Shapes.AddImage(cpp) Shapes.Move(sss 250 0) Shapes.Animate(sss 300 0 750) Program.Delay(800) GraphicsWindow.DrawImage(cpp 300 0) Shapes.Remove(sss) GraphicsWindow.BrushColor="transparent rc=Shapes.AddRectangle(90 300) ppr=FCDrawings.CreateGraphicsFromControl(rc) Shapes.Move(rc 250, 290) pc=pc+1 ppp=5 EndSub nxt() ppp=5 LDShapes.ZIndex(rc,-1) undd="false prg=LDText.Split("get num:;prt x;psh 2;pst t;psa x;get op:;cmp 1;pop x;jnz 3;sbb x;jpr 2;mul x;prt true" ";") rpp: pc=1 act=Array.GetItemCount(prg) While pc<=act ll=LDText.Split(prg[pc] " ") LDCall.Function(ll[1] ll[2]) EndWhile Goto rpp '-------------===== asm set ===== Sub nop'----------- 00 pc=pc+1 EndSub Sub psh'----------- 01 Stack.PushValue(stt args[1]) pc=pc+1 EndSub Sub mov'----------- 02 acc=args[1] pc=pc+1 EndSub Sub mbc'----------- 03 bc=args[1] pc=pc+1 EndSub Sub djz'----------- 04 bc=bc-1 If bc>0 Then pc=pc-args[1] Else pc=pc+1 EndIf EndSub Sub pop'----------- 05 If Stack.GetCount(stt)>0 Then acc=stack.PopValue(stt ) Else GraphicsWindow.ShowMessage("unexpected: stack empty!" "err01") EndIf pc=pc+1 EndSub Sub add'----------- 06 acc=acc+stack.PopValue(stt ) pc=pc+1 EndSub Sub SBB'----------- 07 acc=acc-stack.PopValue(stt ) pc=pc+1 EndSub Sub mul'----------- 08 acc=acc*stack.PopValue(stt ) pc=pc+1 'TextWindow.WriteLine(pc+":"+acc) EndSub Sub Div'----------- 09 acc=math.floor(acc/stack.PopValue(stt )) pc=pc+1 EndSub Sub cmp'----------- 0a oa=acc acc=acc-args[1] If acc=0 Then fl["z"]=1 fl["m"]=0 fl["p"]=0 ElseIf acc<0 Then fl["m"]=1 fl["z"]=0 fl["p"]=0 Else fl["z"]=0 fl["m"]=0 fl["p"]=1 EndIf acc=oa pc=pc+1 EndSub Sub jrz'----------- 0b If fl["z"]=1 Then pc=pc+args[1] Else pc=pc+1 EndIf EndSub Sub jnz'----------- 0c If fl["z"]=0 Then pc=pc+args[1] Else pc=pc+1 EndIf EndSub Sub jrm'----------- 0d If fl["m"]=1 Then pc=pc+args[1] Else pc=pc+1 EndIf EndSub Sub jrp'----------- 0e If fl["p"]=1 Then pc=pc+args[1] Else pc=pc+1 EndIf EndSub Sub jnm'----------- 0f If fl["m"]=0 Then pc=pc+args[1] Else pc=pc+1 EndIf EndSub Sub jnp'----------- 10 If fl["p"]=0 Then pc=pc+args[1] Else pc=pc+1 EndIf EndSub Sub mem'----------- 11 acc=amm[args[1]] pc=pc+1 EndSub Sub put'----------- 12 amm[args[1]]=acc pc=pc+1 EndSub Sub Get'----------- 13 acc=FCDialogs.AskForTextLine(args[1]) pc=pc+1 EndSub Sub prt'----------- 14 ' TextWindow.WriteLine(">"+acc+"<") undd=args[1] For vv=1 To Text.GetLength(acc) off=0 cf=Text.GetSubText(acc vv 1) sa=(cf-1)*5+30 If cf=0 Then sa=75 EndIf For rr=sa To sa+4 prtt() EndFor EndFor nxt() EndSub Sub pst'----------- 15 ' TextWindow.WriteLine(">"+acc+"<") sw=Stack.PopValue(stt) If args[1]="t" Then Stack.PushValue(stt sw) EndIf For vv=1 To Text.GetLength(sw) off=0 cf=Text.GetSubText(sw vv 1) sa=(cf-1)*5+30 If cf=0 Then sa=75 EndIf For rr=sa To sa+4 prtt() EndFor EndFor nxt() EndSub Sub jpr'----------- 16 pc=pc+args[1] EndSub Sub psa'----------- 17 Stack.PushValue(stt acc) pc=pc+1 EndSub '------------------------------------- Sub prtt ff=LDText.Replace(mm[rr-off] "." "0") If undd Then ff="1 "+Text.GetSubTextToEnd(ff 3) EndIf ' TextWindow.WriteLine(ff) rrr=LDMath.Decimal2Base(256+pc 2) rw="" For fq=2 To 9 rw=Text.Append(rw Text.GetSubText(rrr fq 1)+" ") EndFor LDCall.Function3("lsett" rw 1 0) ppp=LDCall.Function4("lsett" ff 2 "true" ppp) EndSub Sub ledd bx=args[1] by=args[2] bb=args[3] rrq=Shapes.AddRectangle(90 45) Shapes.Move(rrq bx by) For x=8 To 1 Step -1 ss[bb][9-x]=Shapes.AddRectangle(7 35) Shapes.Move(ss[bb][9-x] bx+x*9 by+5) LDShapes.BrushColour(ss[bb][9-x] "#3300cc") EndFor EndSub Sub lsett w=ldtext.split(args[1] " ") bb=args[2] tpp=args[3] tpv=args[4] For x=1 To 8 If w[x]="0" Then clr="transparent LDShapes.BrushColour(ss[bb][9-x] "#330099") Else clr="lime LDShapes.BrushColour(ss[bb][9-x] "lime") EndIf If tpp Then If x=1 and w[x]="1" Then clr="red EndIf FCDrawings.fillRectangle(ppr clr x*6 tpv 3 s9) EndIf EndFor If tpp Then tpv=tpv+s9 px=Shapes.GetLeft(rc) py=Shapes.GetTop(rc)-s9 ii=FCDrawings.GenerateImage(ppr) Shapes.Remove(rc) rc=Shapes.AddImage(ii) LDShapes.ZIndex(rc, 0) Shapes.Move(rc px py) ppr=FCDrawings.CreateGraphicsFromControl(rc) FCDrawings.DrawImage(ppr ii 0 0) LDShapes.ZIndex(rc,-1) return=tpv EndIf EndSub End>GNV681.sb< Start>GNV721.sb< ll="` Vis.Fortran;MS Dos;TurboPascal;0815;11l;360 Assembly;4D;4DOS Batch;6502 Assembly;6800 Assembly;68000 Assembly;8 1/2;80386 Assembly;8051 Assembly;8080 Assembly;8086 Assembly;8th;A+;ABAP;ACL2;Action!;ActionScript;Ada;Agda;Agda2;Agena;Aikido;Aime;Algae;ALGOL;ALGOL 60;ALGOL 68;ALGOL W;ALGOL-M;Alice ML;Alore;AmbientTalk;AmigaE;AMPL;AngelScript;ANT;ANTLR;Anyways;Apex;APL;App Inventor;AppleScript;Applesoft BASIC;Application Master;Apricot;Arbre;Arc;Arendelle;Argile;ARM Assembly;{ArnoldC;AsciiDots;ASP;ASP.Net;{AspectC++;AspectJ;Astro;Asymptote;ATS;AutoHotkey;AutoIt;AutoLISP;AWK;Axe;Axiom;Axum;B;B4J;Babel;BaCon;BASIC;Basic Casio;BASIC256;Batch File;Battlestar;BBC BASIC;Bc;BCPL;Beeswax;Befunge;Beta;Biferno;Binary Lambda Calculus;Blast;BlitzMax;Blz;BML;Boo;Bori;Brace;Bracmat;Brainf***;Brat;Brlcad;Burlesque;{C;{C#;{C Shell;{C++;{C++/CLI;C0H;C1R;Caché ObjectScript;CafeOBJ;Caml;Cat;CB80;Cduce;Cecil;Ceylon;Chapel;Chef;CHR;ChucK;Cilk;Cilk++;Clarion;Clay;Clean;Clio;Clipper;Clipper/XBase++;CLIPS;Clojure;CMake;COBOL;Cobra;Coco;CoffeeScript;ColdFusion;Comal;Comefrom0x10;Commodore BASIC;Common Lisp;Component Pascal;Computer/zero Assembly;Coq;Crack;Crystal;Cubescript;Curry;D;Dafny;Dao;Dart;Datalog;Dc;DCL;DDNC;> Delphi;Deluge;DeviousYarn;Diesel;DIV Games Studio;DM;DMS;Dodo0;DUP;DWScript;Dylan;Dylan.NET;Déjà Vu;E;EC;EchoLisp;ECL;EDSAC order code;Eero;Efene;Egel;Egison;EGL;EhBASIC;Eiffel;Ela;Elan;{ElastiC;Elena;Elisa;Elixir;ELLA;Elm;Emacs Lisp;Emojicode;Epigram;Erlang;ERRE;Es;ESQL;Euler;Euphoria;Ezhil;F;F# ;Factor;Falcon;FALSE;Fan;Fancy;Fantom;FAUST;FBSL;{FeatureC++;Felix;Ferite;Fexl;Fish;FLORA-2;Florid;FOCAL;FormulaOne;Forth;` Fortran;Fortress;FP;FPI;Free Pascal;FreeBASIC;FreeMat;Frege;Friendly interactive shell;Frink;FRISC Assembly;FunL;Futhark;FutureBasic;FUZE BASIC;Formulæ;Gambas;GAP;Gastona;Gecho;Gema;Gentee;Genyris;GEORGE;GFA Basic;Glagol;GLBasic;Glee;Global Script;GlovePIE;GLSL;GML;Gnuplot;Go;Go!;Golfscript;Golo;Goo;Gosu;Gri;Groovy;GUISS;GW-BASIC;Hack;Halon;Harbour;Haskell;Haxe;Heron;HicEst;HLA;{HolyC;Hoon;Hope;HPPPL;HQ9+;Huginn;Hy;HyperTalk;I;Icon;IDL;Idris;Inform 6;Inform 7;Informix 4GL;Integer BASIC;Intercal;Io;Ioke;Iptscrae;IS-BASIC;IWBASIC;J;Jabaco;Jack;Jacquard Loom;JAMES II/Rule-based Cellular Automata;Java;JavaFX Script;JavaScript;JCL;JoCaml;JOVIAL;Joy;Jq;JScript.NET;JudoScript;Julia;K;Kabap;Kamailio Script;Kaya;KeyList Databasing;Kite;Kitten;Klong;KonsolScript;Kotlin;L++;L.in.oleum;LabVIEW;Lambda Prolog;Lambdatalk;Lang5;Lasso;LaTeX;LC2200 Assembly;LC3 Assembly;Leon;LFE;Lhogho;Liberty BASIC;LibreOffice Basic;Lily;Lilypond;Limbo;Lingo;Lisaac;Lisp;LiveCode;Livecode;LiveScript;LLP;LLVM;Lobster;Locomotive Basic;Loglan82;Logo;Logtalk;LOLCODE;Lolli;Lotus123 MacroScript;LotusScript;Lout;LSE64;LSL;Lua;Lucid;Luck;Luna;Lush;Lygon;M2000 Interpreter;M4;M680x0;Make;Malbolge;Maple;MAPPER;MathCortex;Mathematica;Mathprog;MATLAB;Maude;Maxima;MAXScript;MBS;MDL;ME10 macro;MEL;Mercury;Metafont;Metapost;MGS;MS Small Basic;MINIL;MIPS Assembly;Mirah;MIRC Scripting Lang.;Mirelle;ML;ML/I;MLite;MMIX;Modula-2;Modula-3;Mond;Monicelli;Monkey;Monte;MontiLang;MOO;MoonScript;Morfa;MSX Basic;MUF;MUMPS;Myrddin;MyrtleScript;MySQL;Mython;Mythryl;MC++;MK-61/52;N/t/roff;Nanoquery;NASL;Neat;Neko;Nemerle;NESL;NetLogo;NetRexx;NewLISP;NewtonScript;NGS;Nial;Nice;Nickle;Nim;Nit;Niue;Nix;NQP;NSIS;OASYS;OASYS assembler;Oberon-2;Objeck;Object Pascal;ObjectIcon;{Objective-C;OCaml;Occam;Octave;` Oforth;Ol;Omega;Onyx;OOC;OOCalc;OoRexx;Opa;{OpenC++;OpenEdge/Progress;OpenLisp;Openscad;OPL;Order;OxygenBasic;Oxygene;Oz;Panda;Panoramic;Pare;PARI/GP;Pascal;PASM;PDP-11 Assembly;Peloton;Pentium Assembly;PeopleCode;Perl;Perl 6;Perl5i;Phix;PHL;PHP;Picat;PicoLisp;Pict;Piet;Pike;PILOT;PIR;PL/B;PL/I;PL/M;PL/pgSQL;PL/SQL;PlainTeX;Plan;PLUS;PLZ/SYS;Pony;Pop11;PostScript;Potion;POV-Ray;PowerBASIC;Powerbuilder;# PowerShell;PPC Assembly;PPL;{Processing;ProDOS;Prolog;PSQL;Pure;Pure Data;PureBasic;Purity;Pyret;Python;Q;QBasic;Qi;Qore;{QuakeC;Quill;Quite BASIC;QL Basic;R;Ra;Racket;RapidQ;Rapira;Rascal;Raven;REALbasic;Reason;REBOL;Red;Reduce;Refal;Retro;REXX;Rhope;Ring;RLaB;RLSL;Robotic;Rockstar;RPG;RPGIV;RPL;RPL/2;RTL/2;RTSL;Ruby;Rubylog;Run BASIC;Rust;S BASIC;S-lang;Sage;Salmon;SAS;SASL;Sass/SCSS;Sather;Scala;Scheme;Scilab;Scratch;Script Basic;Script3D;ScriptBasic;Sed;Seed7;Self;SequenceL;Set lang;SETL;Setl4;SheerPower 4GL;Shen;Shiny;Sidef;SimpleLang;SIMPOL;Simula;Sinc.ZX81 BASIC;Sisal;SkookumScript;Slate;Smalltalk;Smart BASIC;SMEQL;SmileBASIC;Snobol;SNOBOL4;SNUSP;Soar;SoneKing Assembly;SPAD;SPARC Assembly;SPARK;Sparkling;Spin;SPL;SQL;SQL PL;Squirrel;SSEM;Standard ML;Star;Stata;StreamIt;Suneido;Superbase BASIC;SuperCollider;Supernova;SuperTalk;Swift;Symsyn;SystemVerilog;TAL;Tbas;Tcl;TechBASIC;Teco;TeLa;Terra;TestML;Thistle;Thyrd;TI-83 BASIC;TI-83 Hex Assembly;TI-89 BASIC;TIScript;ToffeeScript;Toka;TorqueScript;TPP;Transact-SQL;` TransFORTH;Trith;True BASIC;TSE SAL;Turing;TUSCRIPT;Twelf;TXR;TypeScript;UC++;Unicon;Uniface;UNIX Shell;UnixPipes;Unlambda;Ursa;Ursala;UScript;UserRPL;UTFool;V;Vala;VAX Assembly;' VB6;' VBA;VBScript;Vedit macro language;Verbexx;Verilog;VHDL;Vim Script;Visual Basic;Visual Basic .NET;Visual FoxPro;Visual Objects;Visual Prolog;Viua VM assembly;Vorpal;Vox;VRML;Wart;WDTE;WebAssembly;Whenever;Whitespace;WML;Wolfram Language;Wollok;Wortel;Wrapl;Wren;X10;X86 64 Assembly;X86 Assembly;Xanadu;XBase;XEec;XL;XLISP;Xojo;XPath 2.0;XPL0;XProc;XQuery;XS;XSLT;XSLT 1.0;XSLT 2.0;XTalk;XUL;Ya;Yabasic;Yacas;Yorick;Z80 Assembly;ZED;Zig;Zkl;Zonnon;ZPL;ZX Spectrum Basic GraphicsWindow.Title="Programing/scripting Languages lng=LDText.Split(ll ";") For f=1 To Array.GetItemCount(lng) If Text.IsSubText(text.ConvertToLowerCase( lng[f]) ".net") Then lng[f]=". "+lng[f] ElseIf Text.IsSubText(text.ConvertToLowerCase( lng[f]) "basic") Then lng[f]="' "+lng[f] ElseIf Text.IsSubText(text.ConvertToLowerCase( lng[f]) "sql") Then lng[f]="_ "+lng[f] ElseIf Text.IsSubText(text.ConvertToLowerCase( lng[f]) "script") Then lng[f]="$ "+lng[f] ElseIf Text.IsSubText(text.ConvertToLowerCase( lng[f]) "assemb") Then lng[f]="~ "+lng[f] ElseIf Text.IsSubText(text.ConvertToLowerCase( lng[f]) "pascal") Then lng[f]="> "+lng[f] ElseIf Text.IsSubText(text.ConvertToLowerCase( lng[f]) "prolog") Then lng[f]="[ "+lng[f] ElseIf Text.IsSubText(text.ConvertToLowerCase( lng[f]) "logo") Then lng[f]="+ "+lng[f] ElseIf Text.IsSubText(text.ConvertToLowerCase( lng[f]) "lisp") Then lng[f]="] "+lng[f] ElseIf Text.IsSubText(text.ConvertToLowerCase( lng[f]) "dos") Then lng[f]="# "+lng[f] ElseIf Text.StartsWith(lng[f] "{") or Text.StartsWith(lng[f] "'") Then 'nix ElseIf Text.GetLength(lng[f])=3 Then lng[f]=") "+lng[f] ElseIf Text.GetLength(lng[f])<=2 Then lng[f]="( "+lng[f] ElseIf Text.GetLength(lng[f])=4 or Text.GetLength(lng[f])=5 Then lng[f]="| "+lng[f] ElseIf Text.GetLength(lng[f])>13 Then lng[f]="zz "+lng[f] EndIf EndFor 'lng=LDText.Replace(lng "Basic" "bsc") 'lng=LDText.Replace(lng "BASIC" "bsc") lng=LDText.Replace(lng "Script" "scr.") lng=LDText.Replace(lng "Assembly" "asm.") lng=LDText.Replace(lng "assembler" "asm.") 'lng=LDText.Replace(lng "Pascal" "Ps$") ls=LDList.CreateFromValues(lng) LDList.SortByText(ls) GraphicsWindow.FontSize=10 GraphicsWindow.FontName="lucida console GraphicsWindow.FontBold="false GraphicsWindow.Width=1300 GraphicsWindow.Height=720 GraphicsWindow.Left=5 GraphicsWindow.Top=5 GraphicsWindow.BackgroundColor="tan GraphicsWindow.BrushColor="darkblue aa=LDList.ToArray(ls) for f=1 to Array.GetItemCount(aa) if text.IsSubText("[]~><()%$}|#'._+`" text.GetSubText(aa[f] 1 1)) then aa[f]=Text.GetSubTextToEnd(aa[f] 3) elseif Text.StartsWith(aa[f] "{") Then aa[f]=Text.GetSubTextToEnd(aa[f] 2) elseif Text.StartsWith(aa[f] "zz ") Then aa[f]=Text.GetSubTextToEnd(aa[f] 4) EndIf EndFor l68=70 For n=0 To 10 b="" For x=1 To l68 b=b+aa[x+n*l68]+Text.GetCharacter(10) EndFor GraphicsWindow.DrawBoundText(n*120+5 2 112 b) EndFor End>GNV721.sb< Start>GNW384-1.sb< 'Minesweeper 'By Simon Archer 'osimonbinladen@gmail.com 'Colors: BackColor = "White" TextColor = "CornflowerBlue" UnclickedSquare = "Blue" SquareText = "White" ClickedSquare = "LightBlue" FlaggedSquare = "Silver" BombSquare = "Red" BombText = "White" 'Game Variables rows = 16 cols = 30 mines = 99 'If you want to enable cheats: (For Debug Purposes) GraphicsWindow.KeyUp = Cheat InGame = "false" InitScreen() Sub InitScreen GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = BackColor GraphicsWindow.Title = "Minesweeper" GraphicsWindow.CanResize = False GraphicsWindow.Height = 22 + (rows * 15) GraphicsWindow.Width = 10 + (cols * 15) GraphicsWindow.BrushColor = TextColor GraphicsWindow.DrawText(10, 5, "Time:") GraphicsWindow.BrushColor = UnclickedSquare For r = 1 To rows For c = 1 To cols GraphicsWindow.FillRectangle(((c - 1)*15 + 5), ((r - 1)*15 + 22), 12, 12) EndFor EndFor GraphicsWindow.MouseDown = Click EndSub Sub StartGame squares = rows * cols If mines + 10 > squares Then mines = mines - 10 EndIf minesleft = mines clicked = 0 cheated = "" time = 0 Timer.Interval = 1000 Timer.Tick = UpdateTime For i = 1 To mines spot = Math.GetRandomNumber(squares) While Array.GetValue("spots", spot) = 1 Or spot = ((ny * cols) + nx) spot = Math.GetRandomNumber(squares) EndWhile Array.SetValue("spots", spot, 1) EndFor For i = 1 To squares Array.SetValue("map", i, "") EndFor InGame = "true" UpdateTime() UpdateMines() EndSub Sub UpdateTime time = time + 1 If time < 1000 Then GraphicsWindow.BrushColor = BackColor GraphicsWindow.FillRectangle(50, 5, 30, 12) GraphicsWindow.BrushColor = TextColor GraphicsWindow.DrawText(50, 5, time) EndIf EndSub Sub UpdateMines GraphicsWindow.BrushColor = BackColor GraphicsWindow.FillRectangle(GraphicsWindow.Width - 60, 5, 60, 15) GraphicsWindow.BrushColor = TextColor GraphicsWindow.DrawText(GraphicsWindow.Width - 60, 5, minesleft + "/" + mines) EndSub Sub Click x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY If x > 5 And x < GraphicsWindow.Width - 9 And y > 22 And y < GraphicsWindow.Height - 5 Then mod = x' - 5 While mod > 15 mod = mod - 15 EndWhile x = ((x - mod) / 15) + 1 mod = y' - 22 While mod > 15 mod = mod - 15 EndWhile y = ((y - mod) / 15) - 1 If InGame = "false" Then nx = x ny = y InitScreen() StartGame() EndIf If Mouse.IsRightButtondown And minesleft > 0 And InGame = "true" Then If Array.GetValue("map", ((y * cols) + x)) = "" Then Array.SetValue("map", ((y * cols) + x), "X") minesleft = minesleft - 1 ElseIf Array.GetValue("map", ((y * cols) + x)) = "X" Then Array.SetValue("map", ((y * cols) + x), "?") minesleft = minesleft + 1 ElseIf Array.GetValue("map", ((y * cols) + x)) = "?" Then Array.SetValue("map", ((y * cols) + x), "") EndIf Value = Array.GetValue("map", ((y * cols) + x)) If Value = "X" Or Value = "?" Then GraphicsWindow.BrushColor = FlaggedSquare ElseIf Value = "" Then GraphicsWindow.BrushColor = UnclickedSquare Else GraphicsWindow.BrushColor = ClickSquare EndIf GraphicsWindow.FillRectangle(((x - 1) * 15 + 5), (y * 15 + 22), 12, 12) GraphicsWindow.BrushColor = SquareText GraphicsWindow.DrawText(((x - 1) * 15 + 7), (y * 15 + 21), Array.GetValue("map", ((y * cols) + x))) ElseIf Mouse.IsLeftButtonDown And InGame = "true" Then If Array.GetValue("spots", ((y * cols) + x)) = 1 And Array.GetValue("map", ((y * cols) + x)) = "" Then EndGame() GraphicsWindow.ShowMessage("Game Over~!", "Minesweeper"+cheated) ElseIf Array.GetValue("map", ((y * cols) + x)) = "" Then mx = x my = y CountMines() Array.SetValue("map", (y * cols) + x, NoOfMines) GraphicsWindow.BrushColor = ClickedSquare GraphicsWindow.FillRectangle(((x - 1) * 15 + 5), (y * 15 + 22), 12, 12) GraphicsWindow.BrushColor = SquareText If NoOfMines = 0 Then 'Set a stack with the current no-mine neighbour and call NoMines() to clear all adjacent no-mine neighbours Stack.PushValue("sx",mx) Stack.PushValue("sy",my) NoMines() Else GraphicsWindow.DrawText(((x - 1) * 15 + 7), (y * 15 + 21), NoOfMines) EndIf clicked = clicked + 1 EndIf EndIf EndIf UpdateMines() CheckWin() EndSub Sub EndGame ShowMines() Timer.Pause() InGame = "false" ClearMines() EndSub Sub ShowMines For i = 1 To squares If Array.ContainsIndex("spots", i) Then mod = i While mod > cols mod = mod - cols EndWhile x = mod y = ((i - mod) / cols) GraphicsWindow.BrushColor = BombSquare GraphicsWindow.FillRectangle(((x - 1) * 15 + 5), (y * 15 + 22), 12, 12) GraphicsWindow.BrushColor = BombText GraphicsWindow.DrawText(((x - 1) * 15 + 7), (y * 15 + 21), "*") EndIf EndFor EndSub Sub ClearMines For i = 1 To squares If Array.ContainsIndex("spots", i) Then Array.RemoveValue("spots", i) EndIf EndFor EndSub Sub CountMines tmpy = mx tmpx = my NoOfMines = 0 If Array.GetValue("spots", ((my - 1) * cols) + (mx - 1)) = 1 And mx > 1 Then NoOfMines = NoOfMines + 1 EndIf If Array.GetValue("spots", ((my - 1) * cols) + (mx)) = 1 Then NoOfMines = NoOfMines + 1 EndIf If Array.GetValue("spots", ((my - 1) * cols) + (mx + 1)) = 1 And mx < cols Then NoOfMines = NoOfMines + 1 EndIf If Array.GetValue("spots", ((my) * cols) + (mx - 1)) = 1 And mx > 1 Then NoOfMines = NoOfMines + 1 EndIf If Array.GetValue("spots", ((my) * cols) + (mx + 1)) = 1 And mx < cols Then NoOfMines = NoOfMines + 1 EndIf If Array.GetValue("spots", ((my + 1) * cols) + (mx - 1)) = 1 And mx > 1 Then NoOfMines = NoOfMines + 1 EndIf If Array.GetValue("spots", ((my + 1) * cols) + (mx)) = 1 Then NoOfMines = NoOfMines + 1 EndIf If Array.GetValue("spots", ((my + 1) * cols) + (mx + 1)) = 1 And mx < cols Then NoOfMines = NoOfMines + 1 EndIf EndSub Sub CheckWin win = "true" i = 0 While win = "true" And i <> squares i = i + 1 check = Array.GetValue("map", i) If check = "" Then win = "false" EndIf EndWhile If clicked = squares - mines Then win = "true" EndIf If win = "true" Then EndGame() GraphicsWindow.ShowMessage("You managed to win in "+time+" seconds~!", "Minesweeper"+cheated) EndIf EndSub Sub Cheat cheated = " [CHEATED]" 'Cheats for "debug purposes" If GraphicsWindow.LastKey = "LeftShift" Or GraphicsWindow.LastKey = "RightShift" Then If code = "WINZ" Then EndGame() GraphicsWindow.ShowMessage("You managed to win in "+time+" seconds~!", "Minesweeper"+cheated) ElseIf code = "LOOZE" Then EndGame() GraphicsWindow.ShowMessage("Game over~!", "Minesweeper"+cheated) ElseIf code = "PEEKABOO" Then ShowMines() EndIf code = "" Else code = code + GraphicsWindow.LastKey EndIf EndSub 'Clear all adjacent neighbours for a click with no neighbour mines Sub NoMines ' Loop while there are no-neighbour-mine cells in the stack While (Stack.GetCount("sx") > 0 And Stack.GetCount("sy") > 0) 'Get the most recent cell with no mine neighbours from the stack - this removes it from the stack - all neighbours will be checked now cellx = Stack.PopValue("sx") celly = Stack.PopValue("sy") 'Check all neighbours of cell (cellx,celly) - only cells within the grid, hence the min-max limits 'A bit confusing that x runs from 1 to cols and y runs from 0 to rows-1 : a bit of effort to trace this! 'Use mx,my from here since this is the variable used by CountMines() For mx = Math.Max(1,cellx-1) To Math.Min(cols,cellx+1) For my = Math.Max(0,celly-1) To Math.Min(rows-1,celly+1) 'If we have not checked the current cell (mx,my) then check it If (Array.GetValue("map", (my * cols) + mx) = "") Then 'Get the number of mine neigbours 'If is is zero then add to stack to be checked later, otherwise show neighbour-mine count CountMines() Array.SetValue("map", (my * cols) + mx, NoOfMines) GraphicsWindow.BrushColor = ClickedSquare GraphicsWindow.FillRectangle(((mx - 1) * 15 + 5), (my * 15 + 22), 12, 12) If (NoOfMines = 0) Then Stack.PushValue("sx",mx) Stack.PushValue("sy",my) Else GraphicsWindow.BrushColor = SquareText GraphicsWindow.DrawText(((mx - 1) * 15 + 7), (my * 15 + 21), NoOfMines) EndIf EndIf EndFor EndFor EndWhile EndSub End>GNW384-1.sb< Start>GNW384.sb< 'Minesweeper 'By Simon Archer 'osimonbinladen@gmail.com 'Colors: BackColor = "White" TextColor = "CornflowerBlue" UnclickedSquare = "Blue" SquareText = "White" ClickedSquare = "LightBlue" FlaggedSquare = "Silver" BombSquare = "Red" BombText = "White" 'Game Variables rows = 16 cols = 30 mines = 99 'If you want to enable cheats: (For Debug Purposes) GraphicsWindow.KeyUp = Cheat InGame = "false" InitScreen() Sub InitScreen GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = BackColor GraphicsWindow.Title = "Minesweeper" GraphicsWindow.CanResize = False GraphicsWindow.Height = 22 + (rows * 15) GraphicsWindow.Width = 10 + (cols * 15) GraphicsWindow.BrushColor = TextColor GraphicsWindow.DrawText(10, 5, "Time:") GraphicsWindow.BrushColor = UnclickedSquare For r = 1 To rows For c = 1 To cols GraphicsWindow.FillRectangle(((c - 1)*15 + 5), ((r - 1)*15 + 22), 12, 12) EndFor EndFor GraphicsWindow.MouseDown = Click EndSub Sub StartGame squares = rows * cols If mines + 10 > squares Then mines = mines - 10 EndIf minesleft = mines clicked = 0 cheated = "" time = 0 Timer.Interval = 1000 Timer.Tick = UpdateTime For i = 1 To mines spot = Math.GetRandomNumber(squares) While Array.GetValue("spots", spot) = 1 Or spot = ((ny * cols) + nx) spot = Math.GetRandomNumber(squares) EndWhile Array.SetValue("spots", spot, 1) EndFor For i = 1 To squares Array.SetValue("map", i, "") EndFor InGame = "true" UpdateTime() UpdateMines() EndSub Sub UpdateTime time = time + 1 If time < 1000 Then GraphicsWindow.BrushColor = BackColor GraphicsWindow.FillRectangle(50, 5, 30, 12) GraphicsWindow.BrushColor = TextColor GraphicsWindow.DrawText(50, 5, time) EndIf EndSub Sub UpdateMines GraphicsWindow.BrushColor = BackColor GraphicsWindow.FillRectangle(GraphicsWindow.Width - 60, 5, 60, 15) GraphicsWindow.BrushColor = TextColor GraphicsWindow.DrawText(GraphicsWindow.Width - 60, 5, minesleft + "/" + mines) EndSub Sub Click x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY If x > 5 And x < GraphicsWindow.Width - 9 And y > 22 And y < GraphicsWindow.Height - 5 Then mod = x' - 5 While mod > 15 mod = mod - 15 EndWhile x = ((x - mod) / 15) + 1 mod = y' - 22 While mod > 15 mod = mod - 15 EndWhile y = ((y - mod) / 15) - 1 If InGame = "false" Then nx = x ny = y InitScreen() StartGame() EndIf If Mouse.IsRightButtondown And minesleft > 0 And InGame = "true" Then If Array.GetValue("map", ((y * cols) + x)) = "" Then Array.SetValue("map", ((y * cols) + x), "X") minesleft = minesleft - 1 ElseIf Array.GetValue("map", ((y * cols) + x)) = "X" Then Array.SetValue("map", ((y * cols) + x), "?") minesleft = minesleft + 1 ElseIf Array.GetValue("map", ((y * cols) + x)) = "?" Then Array.SetValue("map", ((y * cols) + x), "") EndIf Value = Array.GetValue("map", ((y * cols) + x)) If Value = "X" Or Value = "?" Then GraphicsWindow.BrushColor = FlaggedSquare ElseIf Value = "" Then GraphicsWindow.BrushColor = UnclickedSquare Else GraphicsWindow.BrushColor = ClickSquare EndIf GraphicsWindow.FillRectangle(((x - 1) * 15 + 5), (y * 15 + 22), 12, 12) GraphicsWindow.BrushColor = SquareText GraphicsWindow.DrawText(((x - 1) * 15 + 7), (y * 15 + 21), Array.GetValue("map", ((y * cols) + x))) ElseIf Mouse.IsLeftButtonDown And InGame = "true" Then If Array.GetValue("spots", ((y * cols) + x)) = 1 And Array.GetValue("map", ((y * cols) + x)) = "" Then EndGame() GraphicsWindow.ShowMessage("Game Over~!", "Minesweeper"+cheated) ElseIf Array.GetValue("map", ((y * cols) + x)) = "" Then mx = x my = y CountMines() Array.SetValue("map", (y * cols) + x, NoOfMines) GraphicsWindow.BrushColor = ClickedSquare GraphicsWindow.FillRectangle(((x - 1) * 15 + 5), (y * 15 + 22), 12, 12) GraphicsWindow.BrushColor = SquareText If NoOfMines = 0 Then 'Set a stack with the current no-mine neighbour and call NoMines() to clear all adjacent no-mine neighbours Stack.PushValue("sx",mx) Stack.PushValue("sy",my) NoMines() Else GraphicsWindow.DrawText(((x - 1) * 15 + 7), (y * 15 + 21), NoOfMines) EndIf clicked = clicked + 1 EndIf EndIf EndIf UpdateMines() CheckWin() EndSub Sub EndGame ShowMines() Timer.Pause() InGame = "false" ClearMines() EndSub Sub ShowMines For i = 1 To squares If Array.ContainsIndex("spots", i) Then mod = i While mod > cols mod = mod - cols EndWhile x = mod y = ((i - mod) / cols) GraphicsWindow.BrushColor = BombSquare GraphicsWindow.FillRectangle(((x - 1) * 15 + 5), (y * 15 + 22), 12, 12) GraphicsWindow.BrushColor = BombText GraphicsWindow.DrawText(((x - 1) * 15 + 7), (y * 15 + 21), "*") EndIf EndFor EndSub Sub ClearMines For i = 1 To squares If Array.ContainsIndex("spots", i) Then Array.RemoveValue("spots", i) EndIf EndFor EndSub Sub CountMines tmpy = mx tmpx = my NoOfMines = 0 If Array.GetValue("spots", ((my - 1) * cols) + (mx - 1)) = 1 And mx > 1 Then NoOfMines = NoOfMines + 1 EndIf If Array.GetValue("spots", ((my - 1) * cols) + (mx)) = 1 Then NoOfMines = NoOfMines + 1 EndIf If Array.GetValue("spots", ((my - 1) * cols) + (mx + 1)) = 1 And mx < cols Then NoOfMines = NoOfMines + 1 EndIf If Array.GetValue("spots", ((my) * cols) + (mx - 1)) = 1 And mx > 1 Then NoOfMines = NoOfMines + 1 EndIf If Array.GetValue("spots", ((my) * cols) + (mx + 1)) = 1 And mx < cols Then NoOfMines = NoOfMines + 1 EndIf If Array.GetValue("spots", ((my + 1) * cols) + (mx - 1)) = 1 And mx > 1 Then NoOfMines = NoOfMines + 1 EndIf If Array.GetValue("spots", ((my + 1) * cols) + (mx)) = 1 Then NoOfMines = NoOfMines + 1 EndIf If Array.GetValue("spots", ((my + 1) * cols) + (mx + 1)) = 1 And mx < cols Then NoOfMines = NoOfMines + 1 EndIf EndSub Sub CheckWin win = "true" i = 0 While win = "true" And i <> squares i = i + 1 check = Array.GetValue("map", i) If check = "" Then win = "false" EndIf EndWhile If clicked = squares - mines Then win = "true" EndIf If win = "true" Then EndGame() GraphicsWindow.ShowMessage("You managed to win in "+time+" seconds~!", "Minesweeper"+cheated) EndIf EndSub Sub Cheat cheated = " [CHEATED]" 'Cheats for "debug purposes" If GraphicsWindow.LastKey = "LeftShift" Or GraphicsWindow.LastKey = "RightShift" Then If code = "WINZ" Then EndGame() GraphicsWindow.ShowMessage("You managed to win in "+time+" seconds~!", "Minesweeper"+cheated) ElseIf code = "LOOZE" Then EndGame() GraphicsWindow.ShowMessage("Game over~!", "Minesweeper"+cheated) ElseIf code = "PEEKABOO" Then ShowMines() EndIf code = "" Else code = code + GraphicsWindow.LastKey EndIf EndSub 'Clear all adjacent neighbours for a click with no neighbour mines Sub NoMines ' Loop while there are no-neighbour-bomb cells in the stack While (Stack.GetCount("sx") > 0 And Stack.GetCount("sy") > 0) 'Get the most recent cell with no mine neighbours from the stack - this removes it from the stack so we may have to put it back if adjacent cells have no mine neighbours cellx = Stack.PopValue("sx") celly = Stack.PopValue("sy") ' Set a flag to completed for the current cell ' If we find neighbours with no mines, then we will add these to the stack to check first, later returning to the current cell as the stack unwinds complete = 1 'Check all neighbours of cell (cellx,celly) - only cells within the grid, hence the min-max limits 'A bit confusing that x runs from 1 to cols and y runs from 0 to rows-1 : a bit of effort to trace this! 'Use mx,my from here since this is the variable used by CountMines() For mx = Math.Max(1,cellx-1) To Math.Min(cols,cellx+1) For my = Math.Max(0,celly-1) To Math.Min(rows-1,celly+1) 'If we have not checked the current cell (mx,my) then check it and set the cell (cellx,celly) as unfinished - there may be other no-bomb neighbours If (Array.GetValue("map", (my * cols) + mx) = "") Then complete = 0 'Get the number of mine neigbours 'If is is zero then add to stack to be checked later, otherwise show neighbour-mine count CountMines() Array.SetValue("map", (my * cols) + mx, NoOfMines) GraphicsWindow.BrushColor = ClickedSquare GraphicsWindow.FillRectangle(((mx - 1) * 15 + 5), (my * 15 + 22), 12, 12) If (NoOfMines = 0) Then Stack.PushValue("sx",mx) Stack.PushValue("sy",my) Else GraphicsWindow.BrushColor = SquareText GraphicsWindow.DrawText(((mx - 1) * 15 + 7), (my * 15 + 21), NoOfMines) EndIf EndIf EndFor EndFor 'If the current cell (cellx,celly) has not been completely checked (some no-mine neighbours) then return it to the stack to be checked again If (complete = 0) Then Stack.PushValue("sx",cellx) Stack.PushValue("sy",celly) EndIf EndWhile EndSub End>GNW384.sb< Start>GNX021.sb< Args[0] = "Good Evening!" Builder = Interop.CreateObject("System.Text.StringBuilder",Args) ClearArgs() Args[0] = "StringBuilder Object Created !" Args[1] = "Fremy's TestApp for Interop" Interop.CallSharedSub("System.Windows.Forms.MessageBox", "Show", Args) ClearArgs() TextWindow.Write("Please enter your name here: ") Args[0] = TextWindow.Read() Interop.CallSub(Builder, "Append", Args) ClearArgs() Args[0] = "The StringBuilder Object seems to work allright!" Args[1] = "Fremy's TestApp for Interop" Interop.CallSharedSub("System.Windows.Forms.MessageBox", "Show", Args) ClearArgs() TextWindow.WriteLine(Interop.ToString(Builder)) TextWindow.Read() Sub ClearArgs Args = "" EndSub End>GNX021.sb< Start>GNZ675.sb< GraphicsWindow.Width = GraphicsWindow.Height + 50 GraphicsWindow.BrushColor = "Black" offx = 40 offy = 0 For x = 1 To 5 For y = 1 To 5 GraphicsWindow.FillRectangle(((x*100) - 100) + offx,((y*100) - 100) + offy ,50,50) EndFor EndFor offx = 10 offy = 50 For x = 1 To 5 For y = 1 To 5 GraphicsWindow.FillRectangle(((x*100) - 100) + offx,((y*100) - 100) + offy ,50,50) EndFor EndFor GraphicsWindow.PenColor = GraphicsWindow.GetColorFromRGB(128,128,128) For i = 1 To 8 GraphicsWindow.DrawLine(0,i*50, GraphicsWindow.Width,i*50) EndFor End>GNZ675.sb< Start>GPB899.sb< GraphicsWindow.PenWidth=0 cc="0=red;1=cyan GraphicsWindow.FontName="zx spectrum GraphicsWindow.FontBold="false GraphicsWindow.FontSize=18 For x=0 To 30 GraphicsWindow.BrushColor=cc[Math.Remainder(x 2)] s=Shapes.AddRectangle(700 30) Shapes.Move(s 0 x*30) EndFor GraphicsWindow.BrushColor="white r=Shapes.AddRectangle(GraphicsWindow.Width-130 GraphicsWindow.Height-90) For y=1 To -200 Step -2 LDGraphicsWindow.Reposition(1 1 0 y 0) Shapes.Move(r 60, -y+45) Program.Delay(22) EndFor GraphicsWindow.BrushColor="black ss=Shapes.AddText("Bytes: Screen") Shapes.Move(ss 66, -3000+5+45) LDGraphicsWindow.Reposition(1 1 0, 3000 0) Program.Delay(777) For y=1 To -120 Step -2 LDGraphicsWindow.Reposition(1 1 0 y 0) Shapes.Move(r 60, -y+45) Shapes.Move(ss 66 Shapes.GetTop(r)+5) Program.Delay(22) EndFor GraphicsWindow.Clear() cc=0 cc="1=yellow;2=darkblue ii=ImageList.LoadImage("e:\hr1.png") jj=LDImage.Copy(ii) LDImage.ReplaceColour(ii "yellow" "transparent" 22) LDImage.ReplaceColour(ii "yellow" "transparent" 22) LDImage.ReplaceColour(ii "lime" "black" 22) LDImage.ReplaceColour(ii "blue" "black" 22) LDImage.ReplaceColour(ii "magenta" "black" 95) LDImage.ReplaceColour(ii "#B05800" "white" 66) LDImage.ReplaceColour(ii "#FF90B7" "white" 66) LDImage.ReplaceColour(ii "#FF8308" "white" 66) LDImage.ReplaceColour(ii "cyan" "white" 22) LDGraphicsWindow.Reposition(1 1 0 0 0) For x=0 To 50 GraphicsWindow.BrushColor=cc[Math.GetRandomNumber(2)] s[x]=Shapes.AddRectangle(700 10) Shapes.Move(s[x] 0 x*10) EndFor GraphicsWindow.BrushColor="white r=Shapes.AddRectangle(GraphicsWindow.Width-125 GraphicsWindow.Height-90) Shapes.Move(r 60 45) For m=1 To 1085 Step 2 For x=0 To 50 LDShapes.BrushColour(s[x] cc[Math.GetRandomNumber(2)]) EndFor Program.Delay(44) ix=LDImage.Copy(ii) LDImage.Crop(ix 0 0 500 m/3+1) Shapes.Remove(sq) sq=Shapes.AddImage(ix) Shapes.Move(sq 60 45) EndFor For x=0 To 50 Shapes.Remove(s[x]) EndFor For y=0 To 17 For x=0 To 24 ww=LDImage.Copy(jj) LDImage.Crop(ww x*20 y*20 20 21) qq=Shapes.AddImage(ww) Shapes.Move(qq x*20+60 y*20+45) Program.Delay(3) EndFor EndFor End>GPB899.sb< Start>GPD020.sb< 'Open ComPort if ComPort.OpenPort("com5",115200) = "true" then While ("true") 'Building the screen with layout image cycle = 0 GraphicsWindow.Title = "Bankquay Railway" GraphicsWindow.Height = 700 GraphicsWindow.Width = 900 Controls.ButtonClicked = OnClick 'Determine filepath ' The following line could be harmful and has been automatically commented. ' Path = File.GetSettingsFilePath() For i = Text.GetLength(Path) To 1 Step -1 If Text.GetSubText(Path,i,1) = "\" Then Goto BuildPath EndIf EndFor BuildPath: For j = 1 to i ModelPath = Text.Append(ModelPath,Text.GetSubText(Path,j,1)) Endfor 'Load track image and write filepath LayoutImage = ImageList.LoadImage (ModelPath + "tracklayout2.bmp") GraphicsWindow.DrawImage (LayoutImage, 0 , 0 ) GraphicsWindow.DrawText (3,681,ModelPath) 'Button: End program and store rundata bExit = Controls.AddButton("Stop en gegevens opslaan", 700,618) 'Read unique blocks of origen, if not unique then 0 'Textformat in that file is "nn,nn vrije tekst" For i = 1 To 63 ' The following line could be harmful and has been automatically commented. ' Read = File.ReadLine(ModelPath+"BlokVanHerkomst.txt",i) Hb[i] = Text.GetSubText(Read,4,2) EndFor 'Defining signal control positions on the screen For i = 0 To 63 S[i] = 0 'Danger=0 Safe=1 NS[i] = 1 SK[i] = 0 'Not manual set=0 Manual set=1 'Open block keys are set to 1 as default If (i>0 And i<5) Or i=28 Or i=29 Or i=34 Or i=40 Or i=42 Or i=45 Or i=47 Or (i>54 And i<59) Then SK[i]=1 EndIf SL[i] = 0 'Red=0 Yellow=1 Green=2 WS[i] = 0 DIV[i] = 0 NDIV[i] = 1 RV[i] = 0 NRV[i] = 1 B[i] = 1 SB[i]=1 WB[i]=1 EndFor 'Signal Key Positions on screen read from SignalKey.txt Sn=0 For i = 1 To 64 ' The following line could be harmful and has been automatically commented. ' Read = File.ReadLine(ModelPath+"SignalKey.txt",i) k=0 For n = 1 To Text.GetLength (Read) If Text.GetSubText (Read,n,1) = "," Then k=k+1 Kpos[k] = n EndIf EndFor Sn = Text.GetSubText (Read,1,Kpos[1]-1) XposSK[Sn] = Text.GetSubText (Read,Kpos[1]+1,Kpos[2]-Kpos[1]-1) YposSK[Sn] = Text.GetSubText (Read,Kpos[2]+1,Text.GetLength(Read)-Kpos[2]) EndFor 'Point Key Positions on screen read from PointKey.txt Wn=0 For i = 1 To 43 ' The following line could be harmful and has been automatically commented. ' Read = File.ReadLine(ModelPath+"PointKey.txt",i) k=0 For n = 1 To Text.GetLength (Read) If Text.GetSubText (Read,n,1) = "," Then k=k+1 Kpos[k] = n EndIf EndFor Wn = Text.GetSubText (Read,1,Kpos[1]-1) XposW[Wn] = Text.GetSubText (Read,Kpos[1]+1,Kpos[2]-Kpos[1]-1) YposW[Wn] = Text.GetSubText (Read,Kpos[2]+1,Text.GetLength(Read)-Kpos[2]) EndFor For i = 1 To 43 WK[i]=0 EndFor 'Define block-engaged indicator lines read from BlockLines.txt GraphicsWindow.PenColor = "Red" Bn = 0 For i = 0 To 63 ' The following line could be harmful and has been automatically commented. ' Read = File.ReadLine(ModelPath+"BlockLines.txt",i+1) k=0 For n = 1 To Text.GetLength (Read) If Text.GetSubText (Read,n,1) = "," Then k=k+1 Kpos[k] = n EndIf EndFor Bn = Text.GetSubText (Read,1,Kpos[1]-1) x1 = Text.GetSubText (Read,Kpos[1]+1,Kpos[2]-Kpos[1]-1) y1 = Text.GetSubText (Read,Kpos[2]+1,Kpos[3]-Kpos[2]-1) x2 = Text.GetSubText (Read,Kpos[3]+1,Kpos[4]-Kpos[3]-1) y2 = Text.GetSubText (Read,Kpos[4]+1,Text.GetLength(Read)-Kpos[4]) Bind[Bn] = Shapes.AddLine (x1,y1,x2,y2) Endfor 'Define Point Indicators, positions read from PointLines.txt GraphicsWindow.PenColor = "Yellow" Wn = 0 For i = 1 To 86 Step 2 ' The following line could be harmful and has been automatically commented. ' Read = File.ReadLine(ModelPath+"PointLines.txt",i) k=0 For n = 1 To Text.GetLength (Read) If Text.GetSubText (Read,n,1) = "," Then k=k+1 Kpos[k] = n EndIf EndFor Wn = Text.GetSubText (Read,1,Kpos[1]-1) x1 = Text.GetSubText (Read,Kpos[1]+1,Kpos[2]-Kpos[1]-1) y1 = Text.GetSubText (Read,Kpos[2]+1,Kpos[3]-Kpos[2]-1) x2 = Text.GetSubText (Read,Kpos[3]+1,Kpos[4]-Kpos[3]-1) y2 = Text.GetSubText (Read,Kpos[4]+1,Text.GetLength(Read)-Kpos[4]) Wind0[Wn] = Shapes.AddLine (x1,y1,x2,y2) ' The following line could be harmful and has been automatically commented. ' Read = File.ReadLine(ModelPath+"PointLines.txt",i+1) k=0 For n = 1 To Text.GetLength (Read) If Text.GetSubText (Read,n,1) = "," Then k=k+1 Kpos[k] = n EndIf EndFor Wn = Text.GetSubText (Read,1,Kpos[1]-1) x1 = Text.GetSubText (Read,Kpos[1]+1,Kpos[2]-Kpos[1]-1) y1 = Text.GetSubText (Read,Kpos[2]+1,Kpos[3]-Kpos[2]-1) x2 = Text.GetSubText (Read,Kpos[3]+1,Kpos[4]-Kpos[3]-1) y2 = Text.GetSubText (Read,Kpos[4]+1,Text.GetLength(Read)-Kpos[4]) Wind1[Wn] = Shapes.AddLine (x1,y1,x2,y2) EndFor 'Indicator numbering GraphicsWindow.BrushColor = "White" For i = 0 To 63 Step 5 GraphicsWindow.FillRectangle (22+8*(i-1), 550,2,6) GraphicsWindow.DrawText (20+8*(i-1), 535,i) EndFor 'Order tables for data read from track 8x8 SB, 8x8 B, 8x8 WB xa = 0 For i = 0 To 23 ' The following line could be harmful and has been automatically commented. ' Read = File.ReadLine(ModelPath+"ReadOrder.txt",i+1) k=0 For n = 1 To Text.GetLength (Read) If Text.GetSubText (Read,n,1) = "," Then k=k+1 Kpos[k] = n EndIf EndFor xa = Text.GetSubText (Read,1,Kpos[1]-1) pos[i][7] = Text.GetSubText (Read,Kpos[1]+1,Kpos[2]-Kpos[1]-1) pos[i][6] = Text.GetSubText (Read,Kpos[2]+1,Kpos[3]-Kpos[2]-1) pos[i][5] = Text.GetSubText (Read,Kpos[3]+1,Kpos[4]-Kpos[3]-1) pos[i][4] = Text.GetSubText (Read,Kpos[4]+1,Kpos[5]-Kpos[4]-1) pos[i][3] = Text.GetSubText (Read,Kpos[5]+1,Kpos[6]-Kpos[5]-1) pos[i][2] = Text.GetSubText (Read,Kpos[6]+1,Kpos[7]-Kpos[6]-1) pos[i][1] = Text.GetSubText (Read,Kpos[7]+1,Kpos[8]-Kpos[7]-1) pos[i][0] = Text.GetSubText (Read,Kpos[8]+1,Text.GetLength(Read)-Kpos[8]) Endfor '32 Treinregelaars 'Lok-data : Nr, type, Vmin,Vmed,Vmax Ln = 0 For i = 0 To 31 ' The following line could be harmful and has been automatically commented. ' Read = File.ReadLine(ModelPath+"LokData.txt",i+1) k=0 For n = 1 To Text.GetLength (Read) If Text.GetSubText (Read,n,1) = "," Then k=k+1 Kpos[k] = n EndIf EndFor Ln = Text.GetSubText (Read,1,Kpos[1]-1) Mt[Ln] = Text.GetSubText (Read,Kpos[1]+1,Kpos[2]-Kpos[1]-1) Vmin[Ln] = Text.GetSubText (Read,Kpos[2]+1,Kpos[3]-Kpos[2]-1) Vmed[Ln] = Text.GetSubText (Read,Kpos[3]+1,Kpos[4]-Kpos[3]-1) Vmax[Ln] = Text.GetSubText (Read,Kpos[4]+1,Text.GetLength(Read)-Kpos[4]) Endfor GraphicsWindow.PenColor = "White" For i = 0 To 31 f1[i]=0 f2[i]=0 f3[i]=0 f4[i]=0 V[i] =0 GraphicsWindow.BrushColor = "White" SpeedDial[i] = Shapes.AddRectangle(8,5) GraphicsWindow.BrushColor = "Gray" GraphicsWindow.FillRectangle(28+20*(i-1), 380,8,128) GraphicsWindow.BrushColor = "Red" GraphicsWindow.FillRectangle(28+20*(i-1), 380+128-8*Vmax[i],8,8*Vmax[i]) GraphicsWindow.BrushColor = "Orange" GraphicsWindow.FillRectangle(28+20*(i-1), 380+128-8*Vmed[i],8,8*Vmed[i]) GraphicsWindow.BrushColor = "Green" GraphicsWindow.FillRectangle(28+20*(i-1), 380+128-8*Vmin[i],8,8*Vmin[i]) EndFor 'Gegevens vorige run Ln = 0 For i = 0 To 63 ' The following line could be harmful and has been automatically commented. ' Read = File.ReadLine(ModelPath+"Rundata.txt",i+1) k=0 For n = 1 To Text.GetLength (Read) If Text.GetSubText (Read,n,1) = "," Then k=k+1 Kpos[k] = n EndIf EndFor Ln = Text.GetSubText (Read,1,Kpos[1]-1) Park[Ln] = Text.GetSubText (Read,Kpos[1]+1,Kpos[2]-Kpos[1]-1) TB[Ln] = Text.GetSubText (Read,Kpos[2]+1,Kpos[3]-Kpos[2]-1) ha[ln] = Text.GetSubText (Read,Kpos[3]+1,Kpos[4]-Kpos[3]-1) fu[ln] = Text.GetSubText (Read,Kpos[4]+1,Kpos[5]-Kpos[4]-1) dir[Ln] = Text.GetSubText (Read,Kpos[5]+1,Text.GetLength(Read)-Kpos[5]) Endfor 'Reverse buttons For i = 0 To 31 GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(28+20*(i-1), 514,8,8) Endfor 'Parking Buttons For i = 0 To 31 GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(28+20*(i-1), 524,8,8) Endfor 'Labels for statusindicators GraphicsWindow.BrushColor = "White" GraphicsWindow.DrawText(534,555,"B") GraphicsWindow.DrawText(534,565,"SB") GraphicsWindow.DrawText(534,575,"WB") GraphicsWindow.DrawText(534,585,"SL") GraphicsWindow.DrawText(534,595,"S") GraphicsWindow.DrawText(534,605,"SK") GraphicsWindow.DrawText(404,615,"W") GraphicsWindow.DrawText(404,625,"WK") GraphicsWindow.DrawText(404,635,"Wfree") GraphicsWindow.DrawText(404,645,"R") GraphicsWindow.DrawText(404,655,"Rfree") GraphicsWindow.DrawText(270,665,"Misc") 'Train indicator numbering GraphicsWindow.BrushColor = "White" For i = 0 To 31 GraphicsWindow.DrawText (26+20*(i-1),307,i) EndFor Sound.PlayChimeAndWait() 'Start Program Loop =========================================================== While ("True") 'Check op beëindigen programma If clicked = 1 Then 'belangrijke data opslaan voor de volgende keer, dan de bel luiden en stoppen For i = 0 to 31 Rundat = i + "," + Park[i] + "," + TB[i] + "," + ha[i] +"," + fu[i] +"," + dir[i] ' The following line could be harmful and has been automatically commented. ' File.WriteLine(ModelPath + "Rundata.txt" , i+1 , Rundat) EndFor Sound.PlayBellRingAndWait() Program.End() EndIf 'Niet gestopt dus subiet verder met het programma dat hier start of weer start met een volgende lus. 'Screen update, Adjust signal colours and point positions. 'Hand / automatic indicators For i = 0 To 31 If ha[i] = 1 Then GraphicsWindow.BrushColor = "Red" Else GraphicsWindow.BrushColor = "Black" EndIf GraphicsWindow.FillRectangle (28+20*(i-1), 320,8,8) EndFor 'Function indicators For i = 0 To 31 If fu[i] = 1 Then GraphicsWindow.BrushColor = "White" Else GraphicsWindow.BrushColor = "Black" EndIf GraphicsWindow.FillRectangle (28+20*(i-1), 330,8,8) EndFor 'Extra function indicators For i = 0 To 31 If f1[i] = 1 Then GraphicsWindow.BrushColor = "White" Else GraphicsWindow.BrushColor = "Black" EndIf If Mt[i] = 1 then GraphicsWindow.FillRectangle (28+20*(i-1), 340,8,8) EndIf EndFor For i = 0 To 31 If f2[i] = 1 Then GraphicsWindow.BrushColor = "White" Else GraphicsWindow.BrushColor = "Black" EndIf If Mt[i] = 1 then GraphicsWindow.FillRectangle (28+20*(i-1), 350,8,8) EndIf EndFor For i = 0 To 31 If f3[i] = 1 Then GraphicsWindow.BrushColor = "White" Else GraphicsWindow.BrushColor = "Black" EndIf If Mt[i] = 1 then GraphicsWindow.FillRectangle (28+20*(i-1), 360,8,8) EndIf EndFor For i = 0 To 31 If f4[i] = 1 Then GraphicsWindow.BrushColor = "White" Else GraphicsWindow.BrushColor = "Black" EndIf If Mt[i] = 1 then GraphicsWindow.FillRectangle (28+20*(i-1), 370,8,8) EndIf EndFor 'Actual speed indicators For i = 0 To 31 Shapes.Move(SpeedDial[i],28+20*(i-1),503-8*V[i]) EndFor 'Travel direction indicators For i = 0 To 31 If Dir[i] = 0 Then GraphicsWindow.BrushColor = "Green" Else GraphicsWindow.BrushColor = "Red" EndIf GraphicsWindow.FillRectangle (28+20*(i-1), 514,8,8) EndFor 'Parking indicators For i = 0 To 31 If Park[i] = 1 Then GraphicsWindow.BrushColor = "LightGreen" Else GraphicsWindow.BrushColor = "Red" EndIf GraphicsWindow.FillRectangle (28+20*(i-1), 524,8,8) EndFor 'Block indicators B, SB and WB For i = 0 To 63 If B[i] = 1 Then GraphicsWindow.BrushColor = "White" Else GraphicsWindow.BrushColor = "Black" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 560,6,6) EndFor For i = 0 To 63 If SB[i] = 1 Then GraphicsWindow.BrushColor = "White" Else GraphicsWindow.BrushColor = "Black" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 570,6,6) EndFor For i = 0 To 63 If WB[i] = 1 Then GraphicsWindow.BrushColor = "White" Else GraphicsWindow.BrushColor = "Black" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 580,6,6) EndFor 'Signal light indicatots For i = 0 To 63 If SL[i] = 0 Then GraphicsWindow.BrushColor = "Red" EndIf If SL[i] = 1 Then GraphicsWindow.BrushColor = "Yellow" EndIf If SL[i] = 2 Then GraphicsWindow.BrushColor ="LightGreen" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 590,6,6) EndFor 'Signal Status indicators For i = 0 To 63 If S[i] = 1 Then GraphicsWindow.BrushColor = "WHite" Else GraphicsWindow.BrushColor = "Black" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 600,6,6) EndFor 'Signal Key indicators For i = 0 To 63 If SK[i] = 1 Then GraphicsWindow.BrushColor = "WHite" Else GraphicsWindow.BrushColor = "Black" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 610,6,6) EndFor 'Point indicatots For i = 0 To 43 If W[i] = 1 Then GraphicsWindow.BrushColor = "Yellow" Else GraphicsWindow.BrushColor = "blue" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 620,6,6) EndFor 'Point Key indicatots For i = 0 To 43 If WK[i] = 1 Then GraphicsWindow.BrushColor = "Yellow" Else GraphicsWindow.BrushColor = "blue" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 630,6,6) EndFor 'Free Point Key indicatots For i = 0 To 43 If WV[i] = 1 Then GraphicsWindow.BrushColor = "Yellow" Else GraphicsWindow.BrushColor = "blue" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 640,6,6) EndFor 'Route indicatots For i = 0 To 46 If R[i] = 1 Then GraphicsWindow.BrushColor = "Yellow" Else GraphicsWindow.BrushColor = "blue" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 650,6,6) EndFor 'Free-Route indicatots For i = 0 To 46 If RV[i] = 1 Then GraphicsWindow.BrushColor = "Yellow" Else GraphicsWindow.BrushColor = "blue" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 660,6,6) EndFor 'Miscelanouw function indicators For i = 0 To 31 If DIV[i] = 1 Then GraphicsWindow.BrushColor = "WHite" Else GraphicsWindow.BrushColor = "Black" EndIf GraphicsWindow.FillRectangle (20+8*(i-1), 670,6,6) EndFor 'Signal lights on screen For i = 0 To 63 If SL[i] = 0 Then GraphicsWindow.BrushColor = "Red" GraphicsWindow.FillRectangle (XposSK[i],YposSK[i],7,7) EndIf If SL[i] = 1 Then GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.FillRectangle (XposSK[i],YposSK[i],7,7) EndIf If SL[i] = 2 Then GraphicsWindow.BrushColor = "MediumSpringGreen" GraphicsWindow.FillRectangle (XposSK[i],YposSK[i],7,7) EndIf EndFor 'Block-engaged lines on screen For i = 0 To 63 If B[i] = 0 Then Shapes.ShowShape(Bind[i]) Else Shapes.HideShape(Bind[i]) EndIf EndFor 'Point positions on screen For i =1 To 43 If W[i] = 0 Then Shapes.HideShape(Wind1[i]) Shapes.ShowShape(Wind0[i]) Else Shapes.HideShape(Wind0[i]) Shapes.ShowShape(Wind1[i]) EndIf EndFor 'Block-positions of trains TB[lok] GraphicsWindow.BrushColor = "Yellow" For i = 0 To 31 GraphicsWindow.DrawText (26+20*(i-1),295,TB[i]) EndFor 'Manual Input Sugnal key SK[i], Point key WK[j] 'Sound.PlayClickAndWait() If Mouse.IsLeftButtonDown Then 'Find signal to be set For i = 0 To 63 If GraphicsWindow.MouseX > XposSK[i] And GraphicsWindow.MouseX < XposSK[i] + 8 Then If GraphicsWindow.MouseY > YposSK[i] And GraphicsWindow.MouseY < YposSK[i] + 8 Then 'Signal key will be Toggled. Reset when sinal goes from danger to safe If SK[i] = 0 Then SK[i] = 1 Else SK[i] = 0 EndIf Goto SKHit EndIf EndIf EndFor SKHit: If i < 64 Then Sound.PlayClickAndWait() GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle (700,654,180,22) GraphicsWindow.BrushColor = "Blue" GraphicsWindow.DrawText (707, 658,"Signal "+i) EndIf 'Find points to be set For i = 1 To 43 If GraphicsWindow.MouseX > XposW[i] And GraphicsWindow.MouseX < XposW[i] + 9 Then If GraphicsWindow.MouseY > YposW[i] And GraphicsWindow.MouseY < YposW[i] + 9 Then 'Sound.PlayChimesAndWait() If WK[i] = 0 Then WK[i] = 1 Else WK[i] = 0 EndIf Goto WKHit EndIf EndIf EndFor WKHit: If i < 44 Then Sound.PlayClickAndWait() GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle (700,654,180,22) GraphicsWindow.BrushColor = "Blue" GraphicsWindow.DrawText (707, 658,"Points "+i) EndIf 'Find miscellaneuos functions DIV[i] to be set For i = 0 To 31 If GraphicsWindow.MouseX > 20+(i-1)*8 And GraphicsWindow.MouseX < 28+(i-1)*8 Then If GraphicsWindow.MouseY > 670 And GraphicsWindow.MouseY < 678 Then If DIV[i] = 0 Then DIV[i] = 1 NDIV[i] = 0 Else DIV[i] = 0 NDIV[i] = 1 EndIf Sound.PlayClick() Goto DIVHit EndIf EndIf EndFor DIVHit: 'Find Hand / Automatic to be (re)set For i = 0 To 31 If GraphicsWindow.MouseX > 28+(i-1)*20 And GraphicsWindow.MouseX < 36+(i-1)*20 Then If GraphicsWindow.MouseY > 320 And GraphicsWindow.MouseY < 328 Then If ha[i] = 0 Then ha[i] = 1 Else ha[i] = 0 EndIf Sound.PlayClick() Goto haHit EndIf EndIf EndFor haHit: 'Find Function to be (re)set For i = 0 To 31 If GraphicsWindow.MouseX > 28+(i-1)*20 And GraphicsWindow.MouseX < 36+(i-1)*20 Then If GraphicsWindow.MouseY > 330 And GraphicsWindow.MouseY < 338 Then If fu[i] = 0 Then fu[i] = 1 Else fu[i] = 0 EndIf Sound.PlayClick() Goto fuHit EndIf EndIf EndFor fuHit: 'Find f1 to be (re)set For i = 0 To 31 If Mt[i] = 1 Then If GraphicsWindow.MouseX > 28+(i-1)*20 And GraphicsWindow.MouseX < 36+(i-1)*20 Then If GraphicsWindow.MouseY > 340 And GraphicsWindow.MouseY < 348 Then If f1[i] = 0 Then f1[i] = 1 Else f1[i] = 0 EndIf Sound.PlayClick() Goto f1Hit EndIf EndIf EndIf EndFor f1Hit: 'Find f2 to be (re)set For i = 0 To 31 If Mt[i] = 1 Then If GraphicsWindow.MouseX > 28+(i-1)*20 And GraphicsWindow.MouseX < 36+(i-1)*20 Then If GraphicsWindow.MouseY > 350 And GraphicsWindow.MouseY < 358 Then If f2[i] = 0 Then f2[i] = 1 Else f2[i] = 0 EndIf Sound.PlayClick() Goto f2Hit EndIf EndIf EndIf EndFor f2Hit: 'Find f3 to be (re)set For i = 0 To 31 If Mt[i] = 1 Then If GraphicsWindow.MouseX > 28+(i-1)*20 And GraphicsWindow.MouseX < 36+(i-1)*20 Then If GraphicsWindow.MouseY > 360 And GraphicsWindow.MouseY < 368 Then If f3[i] = 0 Then f3[i] = 1 Else f3[i] = 0 EndIf Sound.PlayClick() Goto f3Hit EndIf EndIf EndIf EndFor f3Hit: 'Find f4 to be (re)set For i = 0 To 31 If Mt[i] = 1 Then If GraphicsWindow.MouseX > 28+(i-1)*20 And GraphicsWindow.MouseX < 36+(i-1)*20 Then If GraphicsWindow.MouseY > 370 And GraphicsWindow.MouseY < 378 Then If f4[i] = 0 Then f4[i] = 1 Else f4[i] = 0 EndIf Sound.PlayClick() Goto f4Hit EndIf EndIf EndIf EndFor f4Hit: 'Find speed to be (re)set For i = 0 To 31 If ha[i] = 0 Then If GraphicsWindow.MouseX > 28+(i-1)*20 And GraphicsWindow.MouseX < 36+(i-1)*20 Then Position = GraphicsWindow.MouseY If Position > 380 And Position < 508 then V[i] = Math.Floor((508-Position)/8) If V[i] > 15 Then V[i] = 15 EndIf If V[i] = 1 then V[i] = 2 EndIf Sound.PlayClickAndWait() EndIf EndIf EndIf EndFor SpeedHit: 'Find reverse travel direction For i = 0 To 31 If ha[i] = 0 Then If GraphicsWindow.MouseX > 28+(i-1)*20 And GraphicsWindow.MouseX < 36+(i-1)*20 Then If GraphicsWindow.MouseY > 514 And GraphicsWindow.MouseY < 522 Then Sound.PlayClickAndWait() If Mt[i] = 0 Then If V[i] = 0 Then V[i] = 1 Dir[i] = 1 Else V[i] = 0 Dir[i] = 0 EndIf Goto RevHit EndIf If Mt[i] = 1 Then If Dir[i] = 0 Then Dir[i] = 1 Else Dir[i] = 0 EndIf Goto RevHit EndIf EndIf Endif EndIf EndFor RevHit: 'Find Parking to be (re)set For i = 0 To 31 If GraphicsWindow.MouseX > 28+(i-1)*20 And GraphicsWindow.MouseX < 36+(i-1)*20 Then If GraphicsWindow.MouseY > 524 And GraphicsWindow.MouseY < 534 Then If Park[i] = 0 Then Park[i] = 1 Else Park[i] = 0 EndIf Sound.PlayClick() Goto ParkHit EndIf EndIf EndFor ParkHit: 'Temporary block-status manual toggle for testpurposes 'For i = 0 To 63 ' If GraphicsWindow.MouseX > 20+(i-1)*8 And GraphicsWindow.MouseX < 28+(i-1)*8 Then ' If GraphicsWindow.MouseY > 560 And GraphicsWindow.MouseY < 570 Then ' If B[i] = 0 Then ' B[i] = 1 ' Else ' B[i] = 0 ' EndIf ' Goto BHit ' EndIf ' EndIf 'EndFor 'BHit: WaitForMouseUpAgain: If Mouse.IsLeftButtonDown Then Goto WaitForMouseUpAgain EndIf EndIf 'End of mouse-is left button down 'Sound.PlayClickAndWait() 'Reading Block B[i] ,Stop-Block SB[i] and point-block WB[i] data from the track If cycle = 1 Then Sound.PlayClickAndWait() ComPort.TXByte(82) 'Vertel Piccolino dat blok-bezet gegevens moeten komen Program.Delay(5) reply = ComPort.RXByte() 'reply = 83 If reply = 83 Then 'Piccolino heeft het begrepen en stuurt meteen alle 24 bytes door For i = 0 To 23 DR[i] = ComPort.RXByte() 'DR[i] = 255 EndFor EndIf If reply <>83 then Sound.PlayBellRingAndWait() EndIf 'Haal block gegevens uit DR[i] DR[5]=255 For i = 0 To 23 bit[i][7] = Math.Floor(DR[i]/128) rest = DR[i] - bit[i][7]*128 bit[i][6] = Math.Floor(rest/64) rest = rest - bit[i][6]*64 bit[i][5] = Math.Floor(rest/32) rest = rest - bit[i][5]*32 bit[i][4] = Math.Floor(rest/16) rest = rest - bit[i][4]*16 bit[i][3] = Math.Floor(rest/8) rest = rest - bit[i][3]*8 bit[i][2] = Math.Floor(rest/4) rest = rest - bit[i][2]*4 bit[i][1] = Math.Floor(rest/2) rest = rest - bit[i][1]*2 bit[i][0] = Math.Floor(rest) EndFor For i = 0 To 7 For j = 0 To 7 SB[pos[i][j]]= 1 'bit[i][j] EndFor EndFor For i = 8 To 15 For j = 0 To 7 B[pos[i][j]]= 1 'bit[i][j] EndFor EndFor For i = 16 To 23 For j = 0 To 7 WB[pos[i][j]]= 1 'bit[i][j] EndFor EndFor EndIf 'Calculate railroad crossings from block status changes OVW[n] 'Synchronise Block / Stop Block / Double Direction Blocks For i = 0 To 63 If SB[i]=0 Then B[i]=0 EndIf EndFor B[22]=B[13] B[24]=B[15] B[26]=B[9] B[54]=B[35] B[52]=B[39] B[50]=B[37] B[48]=B[41] B[46]=B[43] B[47]=B[42] B[45]=B[44] B[49]=B[40] B[59]=B[56] B[58]=B[57] B[60]=B[55] B[21]=B[8] B[23]=B[10] B[25]=B[12] B[27]=B[14] B[53]=B[38] B[51]=B[36] 'Traintracking from block status changes TB[t] 'Find the block(s) that became occuopied during this program cycle For i = 1 To 63 If Bprev[i] - B[i] = 1 Then 'Block[i] got occupied 'Determine where the train entering this block came from Bvh = Hb[i] If Bvh = 0 Then 'No unique origin 'Procedure WhereFrom uses i and returns BvH WhereFrom() EndIf 'Now find the train-nr. and and allocate the new block i to it TB[#train] For j = 0 to 32 'Check all trains If TB[j] = Bvh Then TB[j] = i EndIf EndFor EndIf Bprev[i] = B[i] EndFor 'Calculate new signal and point position values from manual input and track-data '1) Set Points according to manual input and do Route calculations R[j] For i = 1 To 43 If WV[i] = 1 Then W[i] = WK[i] EndIf x=W[i] NOT() NW[i]=x R[i] = 0 EndFor R[0] = NW[16]*NW[17] R[1] = NW[3] R[2] = W[3] * W[4] R[3] = W[3] * NW[4] R[4] = NW[5] R[5] = W[5] R[6] = NW[7]*W[9]*W[38] R[7] = NW[7]*NW[9]*NW[38] R[8] = W[7]*W[8]*NW[38]*NW[39] R[9] = W[7]*NW[8]*w[39]*nw[38] R[10] = NW[12]*NW[14]*W[13]*W[11] R[11] = NW[12]*NW[14]*W[13]*NW[11] R[12] = NW[12]*W[14]*NW[13]*NW[10] R[13] = NW[12]*NW[14]*W[10] R[14] = W[14]*NW[10]*W[13]*W[11] R[15] = W[14]*NW[10]*W[13]*NW[11] R[16] = W[14]*NW[10]*NW[13] R[17] = W[14]*W[10] R[18] = NW[14]*NW[10] R[19] = NW[2]*NW[1] R[20] = NW[2]*W[1]*NW[26]*NW[25]*NDIV[6] R[21] = NW[24]*W[25]*NDIV[6] R[22] = W[24]*NW[28]*NDIV[6] R[23] = NW[23]*NDIV[6] R[24] = W[23]*NDIV[6] R[25] = NW[25]*NW[26]*W[1]*W[2]*NDIV[6] R[26] = NW[25]*NW[26]*W[1]*NW[2]*NDIV[6] R[27] = W[25]*NW[24]*NDIV[6] R[28] = NW[34] R[29] = W[34] R[30] = NW[33] R[31] = W[33] R[32] = NW[3]*NW[4] R[33] = NW[3]*W[4] R[34] = W[10]*NW[14]*W[12] R[35] = NW[10]*NW[14]*W[12] R[36] = NW[11]*NW[13]*NW[12] R[37] = W[11]*NW[13]*NW[12] R[38] = NW[10]*NW[14] R[39] = NW[13]*NW[10]*W[14] R[40] = NW[11]*W[13]*NW[10]*W[14] R[41] = W[11]*W[13]*NW[10]*W[14] R[42] = W[10]*W[14] R[43] = 1 R[44] = NW[42] R[45] = W[42]*NW[43] R[46] = W[42]*W[43] '2) Calculate safety conditions C[i] per signal S[i] c[0] = NRV[20]*NRV[21]*NRV[23]*NRV[24]*NRV[25]*NRV[26]*NRV[27] C[1] = B[3] C[10] = NW[8]*NW[39]*B[16]*NS[12]*NS[14] C[11] = B[17]*NS[13]*NS[15] C[12] = NW[38]*W[9]*B[16]*NS[10]*NS[8] C[13] = B[17]*W[5]*NRV[5] C[14] = W[38]*NW[9]*B[16]*NS[10]*NS[8] C[15] = B[17]*NW[5]*NRV[4] C[16] = NS[33]*B[18]*NW[6] C[17] = NW[6]*B[19]+W[6]*B[2]*NS[16]*WB[44] C[18] = (R[4]*B[22]*NRV[2]*NRV[32]+R[5]*B[24]*NRV[3]*NRV[33])*NS[20] C[19] = R[6]*B[27]*(NRV[10]+NRV[14])+R[7]*B[25]*(NRV[11]+NRV[15])+R[8]*B[23]*(NRV[12]+NRV[16])+R[9]*B[21]*(NRV[13]+NRV[17]) C[2] = B[4] C[20] = (R[4]*B[22]*NRV[2]*NRV[32]+R[5]*B[24]*NRV[3]*NRV[33])*NS[18]*NS[13]*NS[15] C[21] = R[34]*B[29]+(R[38]+R[42])*B[35]*NRV[43] C[22] = B[26]*NW[3]*NW[4] C[23] = R[35]*B[29]+R[39]*B[35]*NRV[43] C[24] = B[26]*NW[3]*W[4] C[25] = R[36]*B[29]+R[40]*B[35]*NRV[43] C[26] = R[19]*B[28]+R[20]*B[36]*NRV[26]*NRV[23] C[27] = R[37]*B[29]+R[41]*B[35]*NRV[43] C[28] = B[30] C[29] = B[31] C[3] = B[5] C[30] = R[44]*B[32]+R[45]*B[62]+R[46]*B[63] C[31] = NW[15]*B[33]+w[15]*B[20] C[32] = NS[62]*NS[63]*B[34] C[33] = NS[16]*B[18] C[34] = B[1] C[35] = R[28]*B[37]*NRV[30]+R[29]*B[39]*NRV[31] C[36] = B[40]*RR1*NW[23] C[37] = NW[33]*B[41]*NS[46]*NS[59] C[38] = B[40]*RR1*W[23] C[39] = W[33]*B[41]*NS[46]*NS[59] C[4] = B[6] C[40] = B[42]*RR1 C[41] = WB[32]*B[56]*RR3+NW[32]*B[43]*NS[44] C[42] = B[44]*RR1 C[43] = NW[31]*B[45]*RR2 C[44] = NW[31]*B[46] C[45] = B[47]*RR2 C[46] = B[48]*NW[32]*NS[37]*NS[39] C[47] = B[47]*RR2 C[48] = R[30]*B[50]*NRV[28]+R[31]*B[52]*NRV[29] C[49] = NDIV[6]*(R[23]*B[51]*NRV[21]+R[24]*B[53]*NRV[22]) C[5] = B[7]*NW[2] C[50] = NW[34]*B[54]*NRV[38]*NRV[39]*NRV[40]*NRV[41]*NRV[42] C[51] = NDIV[6]*(B[55]*R[27]+(B[7]*R[25]+B[9]*R[26])*NRV[20]) C[52] = W[34]*B[54]*NRV[38]*NRV[39]*NRV[40]*NRV[41]*NRV[42] C[53] = NDIV[6]*W[24]*B[55] C[54] = R[14]*B[14]*NRV[6]+R[15]*B[12]*NRV[7]+R[16]*B[10]*NRV[8]+(R[17]+R[18])*B[8]*NRV[9] C[55] = B[57]*RR4 C[56] = B[58]*RR3 C[57] = NW[29]*B[59]*RR4 C[58] = B[60]*RR3 C[59] = B[48]*W[32]*NS[37]*NS[39] C[6] = R[10]*B[14]*NRV[6]+R[11]*B[12]*NRV[7]+R[12]*B[10]*NRV[8]+R[13]*B[8]*NRV[9] C[60] = NDIV[6]*(R[22]*B[38]*NRV[24]+R[21]*B[36]*NRV[23]) C[61] = NW[17]*NW[16] C[62] = NS[32]*NS[63]*B[34] C[63] = NS[62]*NS[32]*B[34] C[7] = R[1]*B[11]+(R[2]*B[13]+R[3]*B[15])*(NRV[4]+NRV[5]) C[8] = W[8]*W[39]*B[16]*NS[12]*NS[14] C[9] = (R[32]*B[13]*NRV[4]+R[33]*B[15]*NRV[5]) VT1 = B[45]*B[47]*B[49] If VT1*NS[36]*NS[38]*NS[43] = 1 Then RR1 = 1 RR2 = 1 EndIf VT2 = B[56]*B[58]*B[60] If VT2*(NS[41]+S[41]*NW[32])*NRV[27]*NS[53] = 1 Then RR3 = 1 RR4 = 1 EndIf '3) Calculate (new) signal status For i = 1 To 63 Snow = S[i] S[i] = C[i] * (SK[i] + S[i]) If S[i] > 1 Then S[i] = 1 EndIf NS[i] = 1-S[i] 'Reset SK[i] when S[i] changed from danger to safe. 'but not for open blocks 0,1,2,3,4,28,29,34,40,42,43,44,45,47 If (i>=0 And i<5) Or i=28 Or i=29 Or i=34 Or i=40 Or i=42 Or i=45 Or i=47 Or (i>54 And i<59) Then Goto SignalEnd EndIf If S[i] > Snow Then SK[i] = 0 EndIf SignalEnd: EndFor S[0]= C[0]*SK[0] DIV[6]=S[0] NDIV[6]=1-DIV[6] 'Block travel directions for singel track lines when given free in opposite direction If S[41]*W[32]=1 Then RR4 = 0 EndIf If S[51]*R[27]=1 Then RR3 = 0 EndIf If S[53] = 1 Then RR3 = 0 EndIf If S[36]+S[38]=1 Then RR2 = 0 EndIf If S[43] = 1 Then RR1 = 0 EndIf 'Determine Free Routes (open for travel) RV[1]=S[7]*R[1] RV[2]=S[7]*R[2] RV[3]=S[7]*R[3] RV[4]=R[4]*(S[18]+S[20]) RV[5]=R[5]*(S[18]+S[20]) RV[6]=R[6]*S[19] RV[7]=R[7]*S[19] RV[8]=R[8]*S[19] RV[9]=R[9]*S[19] RV[10]=R[10]*S[6] RV[11]=R[11]*S[6] RV[12]=R[12]*S[6] RV[13]=R[13]*S[6] RV[14]=R[14]*S[54] RV[15]=R[15]*S[54] RV[16]=R[16]*S[54] RV[17]=R[17]*S[54] RV[18]=R[18]*S[54] RV[19]=R[19]*S[26] RV[20]=R[20]*S[26] RV[21]=R[21]*S[60] RV[22]=R[22]*S[60] RV[23]=R[23]*S[49] RV[24]=R[24]*S[49] RV[25]=R[25]*S[51] RV[26]=R[26]*S[51] RV[27]=R[27]*S[51] RV[28]=R[28]*S[35] RV[29]=R[29]*S[35] RV[30]=R[30]*S[48] RV[31]=R[31]*S[48] RV[32]=R[32]*S[9] RV[33]=R[33]*S[9] RV[34]=R[34]*S[21] RV[35]=R[35]*S[23] RV[36]=R[36]*S[25] RV[37]=R[37]*S[27] RV[38]=R[38]*S[21] RV[39]=R[39]*S[23] RV[40]=R[40]*S[25] RV[41]=R[41]*S[27] RV[42]=R[42]*S[21] RV[43]=S[50]+S[52] RV[44]=R[44]*S[30] RV[45]=R[45]*S[30] RV[46]=R[46]*S[30] For i = 1 To 46 NRV[i] = 1-RV[i] EndFor '4) Calculate Free Points WV[i] 'At first make all points free to be set (WV[i]=1) 'unless a train is on it (WB[i]=0 in that case) For i = 1 To 43 WV[i] = WB[i] EndFor 'Then determine which ones need to be blocked 'Points [1] and [2] If S[26]*R[20] = 1 Then WV[2] = 0 WV[1] = 0 WV[26] = 0 WV[25] = 0 EndIf If S[26] = 1 Then WV[2] = 0 WV[1] = 0 Else If S[51]*(R[25]+R[26]) = 1 Then WV[1] = 0 WV[2] = 0 WV[25] = 0 WV[26] = 0 EndIf EndIf If S[5] = 1 Then WV[2] = 0 EndIf If S[7] = 1 Then WV[3] = 0 If (R[2]+R[3]) = 1 Then WV[4] = 0 EndIf Else If S[22]+S[24] = 1 Then WV[3] = 0 WV[4] = 0 EndIf EndIf If S[9] = 1 Then WV[4] = 0 WV[3] = 0 EndIf If S[30] = 1 Then WV[42] = 0 WV[43] = 0 EndIf '5) Calculate special functions '6) Calculate signal light values For i = 0 To 63 SL[i] = 0 EndFor SL[0]=S[0] SL[1]=S[1]*(S[1]+S[3]) SL[10]=S[10]*(S[10]+S[16]) SL[11]=S[11]*(S[11]+S[17]) SL[18]=S[18]*(S[18]+R[4]*S[22]+R[5]*S[24]) SL[12]=S[12]*(S[12]+S[16]) SL[13]=S[13]*(S[13]+S[17]) SL[14]=S[12]*(S[12]+S[16]) SL[15]=S[15]*(S[15]+S[17]) SL[16]=S[16]*(S[16]+S[18]) SL[17]=S[17]*(S[17]+NW[6]*S[19]+W[6]*S[2]) SL[18]=S[18]*(S[18]+R[4]*S[22]+R[5]*S[24]) SL[19]=S[19]*(S[19]+R[6]*S[27]+R[7]*S[25]+R[8]*S[23]+R[9]*S[21]) SL[2]=S[2]*(S[2]+S[4]) SL[20]=S[20]*(S[20]+R[4]*S[22]+R[5]*S[24]) SL[21]=S[21]*(S[21]+R[34]*S[29]+R[38]*S[35]+R[42]*S[35]) SL[22]=S[22]*(S[22]+S[26]) SL[23]=S[23]*(S[23]+R[35]*S[29]+R[39]*S[35]) SL[24]=S[24]*(S[24]+S[26]) SL[25]=S[25]*(S[25]+R[36]*S[29]+R[40]*S[35]) SL[26]=S[26]*(S[26]+R[19]*S[28]+R[20]*S[36]) SL[27]=S[27]*(S[27]+R[37]*S[29]+R[41]*S[35]) SL[28]=S[28]*(S[28]+S[30]) SL[29]=S[29]*(S[29]+S[31]) SL[3]=S[3]*(S[3]+S[5]) SL[30]=S[30]*(S[30]+R[44]*S[32]+R[45]*S[62]+R[46]*S[63]) SL[31]=S[31]*(S[31]+W[15]*S[20]+NW[15]*S[33]) SL[32]=S[32]*(S[32]+S[34]) SL[33]=S[33]*(S[33]+S[18]) SL[34]=S[34]*(S[34]+S[1]) SL[35]=S[35]*(S[35]+R[28]*S[37]+R[29]*S[39]) SL[36]=S[36]*(S[36]+S[40]) SL[37]=S[37]*(S[37]+S[41]) SL[38]=S[38]*(S[38]+S[40]) SL[39]=S[39]*(S[39]+S[41]) SL[4]=S[4]*(S[4]+S[6]) SL[40]=S[40]*(S[40]+S[42]) SL[41]=S[41]*(S[41]+W[32]*S[56]+NW[32]*S[43]) SL[42]=S[42]*(S[42]+S[44]) SL[43]=S[43]*(S[43]+S[45]) SL[44]=S[44]*(S[44]+S[46]) SL[45]=S[45]*(S[45]+S[47]) SL[46]=S[46]*(S[46]+S[48]) SL[47]=S[47]*(S[47]+S[49]) SL[48]=S[48]*(S[48]+W[33]*S[52]+NW[33]*S[50]) SL[49]=S[49]*(S[49]+R[23]*S[51]+R[24]*S[53]) SL[5]=S[5]*(S[5]+S[7]) SL[50]=S[50]*(S[50]+S[54]) SL[51]=S[51]*(S[51]+R[27]*B[55]+R[26]*S[9]) SL[52]=S[52]*(S[52]+S[54]) SL[53]=S[53]*(S[53]+S[55]) SL[54]=S[54]*(S[54]+R[14]*S[14]+R[15]*S[12]+R[16]*S[10]+R[17]*S[8]+R[18]*S[8]) SL[55]=S[55]*(S[55]+S[57]) SL[56]=S[56]*(S[56]+S[58]) SL[57]=S[57]*(S[57]+S[59]) SL[58]=S[58]*(S[58]+S[60]) SL[59]=S[59]*(S[59]+S[48]) SL[6]=S[6]*(S[6]+R[10]*S[14]+R[11]*S[12]+R[12]*S[10]+R[13]*S[8]) SL[60]=S[60]*(S[60]+R[21]*S[36]+R[22]*S[38]) SL[61]=S[61] SL[62]=S[62]*(S[62]+S[34]) SL[63]=S[63]*(S[63]+S[34]) SL[7]=S[7]*(S[7]+R[1]*S[11]+R[2]*S[13]+R[3]*S[15]) SL[8]=S[8]*(S[8]+S[16]) SL[9]=S[9]*(S[9]+R[32]*S[13]+R[33]*S[15]) For i = 0 To 63 NSL[i] = 3 - SL[i] EndFor 'Calculate train traction (speeds) V[t] 'Write signal lights, point and function data to the track 'Compiled data per adres is DA[TA] '1) Signal lights SL - track addresses TA 0-10 (decimal, 11-15 spare) 'Interface I DA[0] = NSL[20] + 4*NSL[11] + 16*NSL[18] + 64*NSL[13] DA[1] = NSL[17] + 4*NSL[16] + 16*NSL[16] + 64*NSL[48] DA[2] = NSL[37] + 4*NSL[39] + 16*NSL[50] + 64*NSL[32] DA[3] = NSL[2] + 4*NSL[19] + 16*NSL[33] + 64*NSL[56] 'Interface VI DA[4] = NSL[10] + 4*NSL[8] + 16*NSL[12] + 64*NSL[14] DA[5] = NSL[29] + 4*NSL[27] + 16*NSL[23] + 64*NSL[21] DA[6] = NSL[41] + 4*NSL[44] + 16*NSL[31] + 64*NSL[57] DA[7] = NSL[61] + 4*NSL[61] + 16*NSL[59] + 64*NSL[46] 'Interface VII DA[8] = NSL[58] + 4*NSL[55] + 16*NSL[24] + 64*NSL[22] DA[9] = NSL[3] + 4*NSL[28] + 16*NSL[45] + 64*NSL[5] DA[10] = NSL[60] + 4*NSL[45] + 16*NSL[51] + 64*NSL[53] 'Not implemented For j = 11 To 15 DA[j]=0 EndFor '2) Point Selenoids WS - track addresses TA 16-31 (decimal 'Interface II DA[16] = WS[3] + 4*WS[4] + 16*WS[21] + 64*WS[22] DA[17] = WS[24] + 4*WS[5] + 16*WS[2] + 64*WS[1] DA[18] = WS[26] + 4*WS[27] + 16*WS[28] + 64*WS[25] 'Interface IV DA[19] = WS[36] + 4*WS[38] + 16*WS[37] + 64*WS[35] DA[20] = WS[10] + 4*WS[9] + 16*WS[8] + 64*WS[7] DA[21] = WS[12] + 4*WS[14] + 16*WS[33] + 64*WS[41] DA[22] = WS[11] + 4*WS[13] + 16*WS[40] + 64*WS[34] 'Interface V DA[23] = WS[23] + 4*WS[6] + 16*WS[15] + 64*WS[16] DA[24] = WS[17] + 4*WS[18] + 16*WS[19] + 64*WS[20] DA[25] = WS[30] + 4*WS[32] + 16*WS[31] + 64*WS[29] 'Interface VII DA[26] = WS[5] + 4*WS[43] + 16*WS[42] + 64*WS[23] 'Not implemented For j = 27 To 31 DA[j]=0 EndFor '3) Other functions DIV - track addresses 32-39 (decimal) 'Interface II DA[32] = DIV[1] + 2*DIV[2] + 4*DIV[3] + 8*DIV[4] + 16*DIV[5] + 32*DIV[6] + 64*DIV[8] + 128*DIV[7] 'Interface VII DA[33] = DIV[24] + 2*DIV[28] + 4*DIV[27] + 8*DIV[26] + 16*DIV[25] + 32*DIV[31] + 64*DIV[3] + 128*DIV[29] DA[34] = DIV[23] + 2*DIV[22] + 4*DIV[21] + 8*DIV[20] + 16*DIV[19] + 32*DIV[17] + 64*DIV[18] + 128*DIV[16] DA[35] = DIV[14] + 2*DIV[12] + 4*DIV[11] + 8*DIV[10] + 16*DIV[9] + 32*DIV[3] + 64*DIV[2] + 128*DIV[1] 'Not implemented For j = 36 To 39 DA[j]=0 EndFor 'Speed data for 32 trains, 8 bits snelheids data, inclusief rijrichting en f1, f2, f3, f4 'Trein 5 voorlopig vast op handregelaar V[7] = 16 For j = 0 To 31 DA[j+40] = V[j] 'Speed van loks 0 t/m 31 in DA[40 t/m 71] EndFor For j = 0 To 31 DA[j+72] = Mt[j]*128 + Park[j]*64 +Dir[j]*32 + fu[j]*16 + f4[j]*8 +f3[j]*4 + f2[j]*2 +f1[j] EndFor 'Transfer data to track every second cycle If cycle = 0 Then Sound.PlayClickAndWait() 'eerste klik verwittig Piccolino ComPort.TXByte(87) 'Vertel Piccolino dat er baan-data klaar staan reply = ComPort.RXByte() If reply = 88 Then 'Piccolino heeft het begrepen Sound.PlayClickAndWait() 'tweede klik als verzenden begint For j = 0 To 75 '76 bytes ComPort.TXByte(DA[j]) 'send a byte reply2 = ComPort.RXByte() 'wacht op een antwoord voor de volgende byte verzonden kan worden. EndFor Sound.PlayClickAndWait() 'derde klik als alle 76 weg zijn EndIf EndIf 'Repeat Program Loop and blink in upper corner If cycle = 0 Then cycle = 1 GraphicsWindow.BrushColor ="white" Else cycle =0 GraphicsWindow.BrushColor = "red" EndIf GraphicsWindow.FillRectangle (1,1,10,10) 'Program.Delay(500) EndWhile EndWhile Else GraphicsWindow.ShowMessage("ComPort not available", "Warning") Sound.PlayBellRingAndWait() Program.End() Endif Sub NOT If x =1 Then x=0 Else x=1 EndIf EndSub Sub OnClick If (Controls.LastClickedButton=bExit) Then clicked=1 EndIf EndSub Sub WhereFrom If i = 7 Then If RV[25] = 1 Then Bvh = 51 EndIf If S[5] = 1 Then Bvh = 5 EndIf EndIf If i = 13 Then If RV[2] = 1 Then Bvh = 7 EndIf If RV[32] = 1 Then Bvh = 9 EndIf EndIf If i = 15 Then If RV[3] = 1 Then Bvh = 7 EndIf If RV[33] = 1 Then Bvh = 9 EndIf EndIf If i = 8 Then If RV[13] = 1 Then Bvh = 6 EndIf If RV[18] = 1 Then Bvh = 54 EndIf If RV[3] = 1 Then Bvh = 7 EndIf EndIf If i = 10 Then If RV[12] = 1 Then Bvh = 6 EndIf If RV[16] = 1 Then Bvh = 54 EndIf If RV[3] = 1 Then Bvh = 7 EndIf EndIf If i = 12 Then If RV[11] = 1 Then Bvh = 6 EndIf If RV[15] = 1 Then Bvh = 54 EndIf If RV[3] = 1 Then Bvh = 7 EndIf EndIf If i = 14 Then If RV[10] = 1 Then Bvh = 6 EndIf If RV[14] = 1 Then Bvh = 54 EndIf If RV[3] = 1 Then Bvh = 7 EndIf EndIf If i = 18 Then If S[16] = 1 Then Bvh = 16 Else Bvh = 33 EndIf EndIf If i = 22 Then If RV[4] = 1 Then If S[18] = 1 Then Bvh = 18 Else Bvh = 20 EndIf EndIf EndIf If i = 24 Then If RV[5] = 1 Then If S[18] = 1 Then Bvh = 18 Else Bvh = 20 EndIf EndIf EndIf If i = 36 Then If RV[20] = 1 Then Bvh = 26 EndIf If RV[21] = 1 Then Bvh = 60 EndIf EndIf If i = 38 Then If RV[22] = 1 Then Bvh = 60 EndIf EndIf If i = 51 Then If RV[23] = 1 Then Bvh = 49 EndIf EndIf If i = 53 Then If RV[24] = 1 Then Bvh = 49 EndIf EndIf If i = 16 Then If S[8] = 1 Then Bhv = 8 EndIf If S[10] = 1 Then Bhv = 10 EndIf If S[12] = 1 Then Bhv = 12 EndIf If S[14] = 1 Then Bhv = 14 EndIf EndIf If i = 17 Then If S[11] = 1 Then Bhv = 11 EndIf If S[13] = 1 Then Bhv = 13 EndIf If S[15] = 1 Then Bhv = 15 EndIf EndIf If i = 34 Then If S[32] = 1 Then Bhv = 32 EndIf If S[62] = 1 Then Bhv = 62 EndIf If S[63] = 1 Then Bhv = 63 EndIf EndIf If i = 29 Then If RV[34] = 1 Then Bvh = 21 EndIf If RV[35] = 1 Then Bvh = 23 EndIf If RV[36] = 1 Then Bvh = 25 EndIf If RV[37] = 1 Then Bvh = 27 EndIf EndIf If i = 35 Then If RV[38] = 1 Then Bvh = 21 EndIf If RV[39] = 1 Then Bvh = 23 EndIf If RV[40] = 1 Then Bvh = 25 EndIf If RV[41] = 1 Then Bvh = 27 EndIf EndIf If i = 9 Then If RV[26] = 1 Then Bhv = 51 EndIf EndIf If i = 26 Then If S[22] = 1 Then Bvh = 22 EndIf If S[24] = 1 Then Bvh = 24 EndIf EndIf If i = 21 Then If RV[9] = 1 Then Bvh = 19 EndIf EndIf If i = 23 Then If RV[8] = 1 Then Bvh = 19 EndIf EndIf If i = 25 Then If RV[7] = 1 Then Bvh = 19 EndIf EndIf If i = 27 Then If RV[6] = 1 Then Bvh = 19 EndIf EndIf If i = 41 Then If S[37] = 1 Then Bvh = 37 EndIf If S[39] = 1 Then Bvh = 39 EndIf EndIf If i = 48 Then If S[46] = 1 Then Bvh = 46 EndIf If S[59] = 1 Then Bvh = 59 EndIf EndIf If i = 40 Then If S[36] = 1 Then Bvh = 36 EndIf If S[38] = 1 Then Bvh = 38 EndIf EndIf If i = 54 Then If S[50] = 1 Then Bvh = 50 EndIf If S[52] = 1 Then Bvh = 52 EndIf EndIf If i = 37 Then If RV[28] = 1 Then Bvh = 35 EndIf EndIf If i = 39 Then If RV[29] = 1 Then Bvh = 35 EndIf EndIf If i = 50 Then If RV[31] = 1 Then Bvh = 48 EndIf EndIf If i = 52 Then If RV[32] = 1 Then Bvh = 48 EndIf EndIf If i = 55 Then If RV[27] = 1 Then Bvh = 51 EndIf EndIf If i = 60 Then If S[58] = 1 Then Bvh = 58 EndIf EndIf If i = 57 Then If S[55] = 1 Then Bvh = 55 EndIf EndIf If i = 58 Then If S[56] = 1 Then Bvh = 56 EndIf EndIf If i = 56 Then If S[41] = 1 Then If W[32] = 1 Then Bvh = 41 EndIf EndIf EndIf If i = 59 Then If S[57] = 1 Then Bvh = 57 EndIf EndIf If i = 43 Then If S[41] = 1 Then If W[32] = 0 Then Bvh = 41 EndIf EndIf EndIf If i = 42 Then If S[40] = 1 Then Bvh = 540 EndIf EndIf If i = 44 Then If S[42] = 1 Then Bvh = 42 EndIf EndIf If i = 46 Then If S[44] = 1 Then Bvh = 44 EndIf EndIf If i = 45 Then If S[43] = 1 Then Bvh = 43 EndIf EndIf If i = 47 Then If S[45] = 1 Then Bvh = 45 EndIf EndIf If i = 49 Then If S[47] = 1 Then Bvh = 47 EndIf EndIf EndSub End>GPD020.sb< Start>GPG512.sb< ee=Shapes.AddEllipse (10 10) pp=shapes.AddRectangle (30 30) ll11=shapes.AddRectangle (90 20) ll1=shapes.AddRectangle (90 20) ll2=shapes.AddRectangle (400 20) ll22=shapes.AddRectangle (400 20) ll2v=shapes.AddRectangle (400 20) ll3=shapes.AddRectangle (60 10) ll31=shapes.AddRectangle (60 10) ll311=shapes.AddRectangle (55 10) ll32=shapes.AddRectangle (125 10) gg=shapes.AddRectangle (20 10) ggi=shapes.AddRectangle (29 25) GraphicsWindow.BrushColor ="white GraphicsWindow.PenWidth=0 rr=shapes.AddEllipse (10 10) GraphicsWindow.BackgroundColor ="teal GraphicsWindow.Width=600 GraphicsWindow.Height =380 LDPhysics.Reset () dd=200 w=30+dd Shapes.Move (ee 90 90+dd) Shapes.Move (ll1 180 52+w) Shapes.Move (ll2 180 102+w) Shapes.Move (ll22 300 52+w) Shapes.Move (pp 180 71+w) Shapes.Move (ll3 125 80+w) LDPhysics.SetGravity (0 110) LDPhysics.AddFixedShape (ll11 0 0) LDPhysics.SetPosition (ll11 580 400, -45) LDPhysics.AddFixedShape (ll1 0 0) LDPhysics.AddFixedShape (ll2 0 0) LDPhysics.AddFixedShape (ll22 0 0) LDPhysics.AddFixedShape (ll2v 0 0) LDPhysics.AddFixedShape (ll31 0 0) LDPhysics.AddFixedShape (ll311 0 0) LDPhysics.AddFixedShape (ll32 0 0) LDPhysics.AddFixedShape (gg 0 0) LDPhysics.AddmovingShape (ggi 0 0 0.1) LDPhysics.SetPosition (ll2v 30 120 90) LDPhysics.SetPosition (ll31 10 370 45) LDPhysics.SetPosition (ll311 50 340 45) LDPhysics.SetPosition (ll32 122 345, -10) LDPhysics.SetPosition (gg 28 305,0) LDPhysics.AddMovingShape(pp 0 0 1) LDPhysics.AddMovingShape(ll3 0 0 1) LDPhysics.GroupShapes (ll3 pp) LDPhysics.AddMovingShape (ee 0 0 1) aa=LDPhysics.AddFixedAnchor(90+20 110+dd) LDPhysics.AttachShapesWithRotation (aa ee) LDPhysics.AddMovingShape (rr 0 0 1) mm=LDPhysics.GetPosition (pp) LDPhysics.SetPosition (pp mm[1]+30 mm[2], 0) 'LDPhysics.AttachShapesWithJoint (pp ee "Distance" "True" "") 'LDPhysics.AttachShapesWithRotation (rr pp) 'LDPhysics.AttachShapesWithJoint (rr pp "Distance" "True" "") LDPhysics.AttachShapesWithjoint(ee,pp,"Distance",0,"") joint = LDPhysics.AttachShapesWithJoint(aa,ee,"Revolute",0,"") LDPhysics.SetJointMotor(joint,550,1000000000000000000000) LDPhysics.SetPosition (rr 290 20 10) LDPhysics.SetShapeGravity (rr 0 0) bc=1 While "true cc=cc+1 po= LDPhysics.GetPosition (ggi) LDPhysics.DoTimestep () Program.Delay (15) GraphicsWindow.Title =bc+" | press:"+Math.Round (288-po[2]) If cc>17 Then LDPhysics.SetShapeGravity (rr 1 100) bc=bc+1 If Math.Remainder (bc 2)=0 then rr=shapes.AddEllipse (10 10) LDPhysics.AddMovingShape (rr 0 0 1) LDPhysics.SetPosition (rr 290 20 10) LDPhysics.SetShapeGravity (rr 0 0) endif cc=0 EndIf EndWhile End>GPG512.sb< Start>GPH887.sb< GraphicsWindow.BackgroundColor ="darkblue GraphicsWindow.FontName="Calibri GraphicsWindow.FontSize=22 GraphicsWindow.FontBold ="false GraphicsWindow.FontItalic ="true txx="* ~Merry~Xmass &~Very Happy New ~2018 Year~from~SB team.~~Buon~Natale~e molto felice~Anno Nuovo 2018 ~vi augura~il team~di SB.~~Čestitamo ~Vam Božić i Novu ~2018. godinu~od SB tima.~~ txx=ldtext.Replace (txx "~" Text.GetCharacter(13)) txx=txx+txx txx=txx+txx GraphicsWindow.Height =700 GraphicsWindow.Width =Desktop.Width mxx= GraphicsWindow.Width GraphicsWindow.BrushColor ="white GraphicsWindow.Filltriangle (0 300 mxx 700 0 700) GraphicsWindow.BrushColor="darkblue GraphicsWindow.DrawBoundText (50 50 300 txx) GraphicsWindow.BrushColor="#bbffaa00 GraphicsWindow.DrawBoundText (50 50 300 txx) GraphicsWindow.Title ="Happy New 2018 Year ss=Shapes.AddText ("*2*0*1*8*") LDShapes.Font (ss "Curlz mt" 255 "true" "true") LDEffect.DropShaddow (ss "") Shapes.Animate (ss mxx+30 0 15000) LDShapes.AnimateOpacity (ss 2000 0) LDShapes.AnimateZoom (ss 1000 0 1.5 1.5) LDShapes.PenColour (ss "red") tt=Shapes.AddText ("⛄") LDEffect.DropShaddow (tt "") LDShapes.Font (tt "Arial" 300 "false" "false") Shapes.Animate (tt mxx 430 10000) Program.Delay (15000) LDShapes.move (ss 300 30) 'FRZ234 End>GPH887.sb< Start>GPK002.sb< MyTitle = "My Message" GraphicsWindow.Show() GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 GraphicsWindow.Height = 300 GraphicsWindow.Width = 400 N = Text.GetCharacter(13) Note[1] = "You are the best program language of the world."+ N + "My english is not good but this sampe are exelent." + N + "This text is a sample for more then 1 line." Note[2] = "Message 2" Note[3] = "Message 3" Note[4] = "Message 4" Note[5] = "Message 5" Note[6] = "Message 6" Note[7] = "Message 7" Note[8] = "Message 8" Note[9] = "Message 9" IndexNote = Math.GetRandomNumber(Array.GetItemCount(Note)) MultiTextzContr = Controls.AddMultiLineTextBox(0,0) Controls.SetSize(MultiTextzContr,400,200) Controls.SetTextBoxText(MultiTextzContr,Note[IndexNote]) ok = Controls.AddButton(" O K ",180,250) While 1 = 1 if Controls.LastClickedButton = ok Then Program.End() EndIf Program.Delay(30) EndWhile End>GPK002.sb< Start>GPP417.sb< GameWidth = 700 GameHeight = 450 BrickWidth = 40 BrickHight = 20 BallWidth = 15 BallHeight = BallWidth PaddleWidth = 120 PaddleHeight = 15 GameRunning = "False" deltaX = 1 deltaY = -1 Score = 0 GraphicsWindow.Width = GameWidth GraphicsWindow.Height = GameHeight GraphicsWindow.MouseMove = onMouseMove GraphicsWindow.MouseDown = onClick DrawBricks() CreateBallAndPaddle() Sub CreateBallAndPaddle Paddle = Shapes.AddRectangle(PaddleWidth,PaddleHeight) Shapes.Move(Paddle,GameWidth/2-PaddleWidth/2,GameHeight-PaddleHeight) Ball = Shapes.AddEllipse(BallWidth,BallHeight) Shapes.Move(Ball,GameWidth/2-BallWidth/2,GameHeight-PaddleHeight-BallHeight) EndSub Sub DrawBricks For Collumn = 1 To 5 For Row = 1 To 8 GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor() Bricks[Collumn][Row] = Shapes.AddRectangle(BrickWidth,BrickHight) Shapes.Animate(Bricks[Collumn][Row],(BrickWidth+35)*Row,(BrickHight+10)*Collumn,500) EndFor EndFor EndSub Sub onMouseMove PadX = GraphicsWindow.MouseX If PadX < PaddleWidth/2 Then PadX = PaddleWidth/2 ElseIf PadX > GameWidth - PaddleWidth/2 Then PadX =GameWidth - PaddleWidth/2 EndIf PadPos = PadX - PaddleWidth/2 Shapes.Move(Paddle,PadPos,GameHeight-PaddleHeight) If GameRunning = "False" Then Shapes.Move(Ball,(PadPos+PaddleWidth/2)-BallWidth/2,GameHeight-PaddleHeight-BallHeight) XPos = Shapes.GetLeft(Ball) YPos = Shapes.GetTop(Ball) EndIf EndSub Sub onClick XPos = Shapes.GetLeft(Ball) YPos = Shapes.GetTop(Ball) GameRunning = "True" EndSub While "True" XPos = XPos + deltaX YPos = YPos + deltaY If XPos > GameWidth - BallWidth Or XPos < 0 Then deltaX = -deltaX EndIf If YPos <= 0 Then deltaY = -deltaY EndIf PaddleX = Shapes.GetLeft(Paddle) If YPos = GameHeight-BallHeight-PaddleHeight And XPos > PaddleX And XPos < paddleX + PaddleWidth Then deltaY = -deltaY EndIf If YPos > GameHeight - BallHeight Then GameRunning = "False" deltaX = 1 deltaY = -1 Shapes.Move(Ball,(PadPos+PaddleWidth/2)-BallWidth/2,GameHeight-PaddleHeight-BallHeight) GraphicsWindow.Title = "You missed!" onMouseMove() EndIf Shapes.Move(Ball,XPos,YPos) 'GraphicsWindow.SetPixel(XPos,YPos,"Red") CollisionCheck() Program.Delay(5) EndWhile Sub CollisionCheck For Collumn = 1 To 5 For Row = 1 To 8 BrickTop = Shapes.GetTop(Bricks[Collumn][Row]) BrickLeft = Shapes.GetLeft(Bricks[Collumn][Row]) If XPos + BallWidth >= BrickLeft And XPos <= BrickLeft + BrickWidth And YPos < BrickTop + BrickHight And YPos + BallHeight > BrickTop Then deltaY = -deltaY Shapes.Remove(Bricks[Collumn][Row]) Score = Score + 1 TextWindow.WriteLine("HIT "+Score) GraphicsWindow.Title = Score * Clock.Second If Score = 40 Then Sound.PlayChime() deltaX =1 deltaY = -1 Score = 0 GameRunning = "False" 'Remove all remaining shaped For Collumn = 1 To 5 For Row = 1 To 8 Shapes.Remove(Bricks[Collumn][Row]) EndFor EndFor DrawBricks() onMouseMove() EndIf EndIf EndFor EndFor EndSub End>GPP417.sb< Start>GPV107.sb< 'WINDOW GraphicsWindow.Hide() GraphicsWindow.Width = 800 GraphicsWindow.Height = 500 GraphicsWindow.Left = (Desktop.Width - 800) / 2 GraphicsWindow.Top = 50 GraphicsWindow.CanResize = "false" GraphicsWindow.Title = "Escape Game" 'TRAFFIC_POLICEMAN closed_active = Controls.AddButton(1, 0, 0) Controls.HideControl(closed_active) choice_active = Controls.AddButton(0, 0, 0) Controls.HideControl(choice_active) doors_active = Controls.AddButton(0, 0, 0) Controls.HideControl(doors_active) holes_active = Controls.AddButton(0, 0, 0) Controls.HideControl(holes_active) rectangle_active = Controls.AddButton(0, 0, 0) Controls.HideControl(rectangle_active) circle_active = Controls.AddButton(0, 0, 0) Controls.HideControl(circle_active) triangle_active = Controls.AddButton(0, 0, 0) Controls.HideControl(triangle_active) 'CLOSED_BOOK GraphicsWindow.PenWidth = 3 GraphicsWindow.PenColor = "darkgoldenrod" GraphicsWindow.BrushColor = "saddlebrown" closed_book = Shapes.AddRectangle(150, 200) Shapes.Move(closed_book, (800 - 150) / 2, 150) GraphicsWindow.BrushColor = "gold" GraphicsWindow.PenWidth = 2 GraphicsWindow.PenColor = "goldenrod" stamp = Shapes.AddEllipse(40, 50) Shapes.Move(stamp, (800 - 40) / 2, (500 - 50) / 2.2) GraphicsWindow.FontSize = 35 GraphicsWindow.FontBold = "false" GraphicsWindow.FontName = "Edwardian Script ITC" cover_txt = Shapes.AddText("Book") Shapes.Move(cover_txt, (800 - 60) / 2.05, (500 - 28) / 1.7) 'OPENED_BOOK GraphicsWindow.PenColor = "saddlebrown" GraphicsWindow.BrushColor = "navajowhite" opened_book = Shapes.AddRectangle(300, 200) Shapes.Move(opened_book, 250, 150) Shapes.HideShape(opened_book) GraphicsWindow.PenColor = "saddlebrown" seperate_book = Shapes.AddLine(400, 150, 400, 350) Shapes.HideShape(seperate_book) 'RIDDLE GraphicsWindow.FontSize = 11 GraphicsWindow.BrushColor = "black" GraphicsWindow.FontName = "Book Antiqua" line1 = Shapes.AddText("If a man carried my burden,") Shapes.Move(line1, 255, 152) Shapes.HideShape(line1) line2 = Shapes.AddText("He would break his back.") Shapes.Move(line2, 255, 167) Shapes.HideShape(line2) line3 = Shapes.AddText("I am not rich,") Shapes.Move(line3, 255, 182) Shapes.HideShape(line3) line4 = Shapes.AddText("But I leave silver in my track.") Shapes.Move(line4, 255, 197) Shapes.HideShape(line4) line5 = Shapes.AddText("What am I?") Shapes.Move(line5, 255, 212) Shapes.HideShape(line5) 'CHOICES GraphicsWindow.PenColor = "lightsalmon" GraphicsWindow.BrushColor = "lightsalmon" choice_back_1 = Shapes.AddRectangle(147, 15) Shapes.Move(choice_back_1, 401, 160) Shapes.HideShape(choice_back_1) choice_back_2 = Shapes.AddRectangle(147, 15) Shapes.Move(choice_back_2, 401, 180) Shapes.HideShape(choice_back_2) GraphicsWindow.BrushColor = "black" choice1 = Shapes.AddText("Snail") Shapes.Move(choice1, 460, 160) Shapes.HideShape(choice1) choice2 = Shapes.AddText("Stone") Shapes.Move(choice2, 460, 180) Shapes.HideShape(choice2) 'THREE_DOORS GraphicsWindow.BrushColor = "lightsalmon" GraphicsWindow.PenColor = "lightsalmon" door_back_1 = Shapes.AddRectangle(220, 320) Shapes.Move(door_back_1, 40, 90) Shapes.HideShape(door_back_1) door_back_2 = Shapes.AddRectangle(220, 320) Shapes.Move(door_back_2, 290, 90) Shapes.HideShape(door_back_2) door_back_3 = Shapes.AddRectangle(220, 320) Shapes.Move(door_back_3, 540, 90) Shapes.HideShape(door_back_3) GraphicsWindow.PenWidth = 5 brown = GraphicsWindow.GetColorFromRGB(120, 80, 40) GraphicsWindow.BrushColor = brown darkbrown = GraphicsWindow.GetColorFromRGB(105, 65, 25) GraphicsWindow.PenColor = darkbrown door1 = Shapes.AddRectangle(200, 300) Shapes.Move(door1, 50, 100) Shapes.HideShape(door1) door2 = Shapes.AddRectangle(200, 300) Shapes.Move(door2, 300, 100) Shapes.HideShape(door2) door3 = Shapes.AddRectangle(200, 300) Shapes.Move(door3, 550, 100) Shapes.HideShape(door3) GraphicsWindow.PenColor = "goldenrod" GraphicsWindow.BrushColor = "gold" GraphicsWindow.PenWidth = 2 handle1 = Shapes.AddEllipse(20, 20) Shapes.Move(handle1, 210, 250) Shapes.HideShape(handle1) handle2 = Shapes.AddEllipse(20, 20) Shapes.Move(handle2, 460, 250) Shapes.HideShape(handle2) handle3 = Shapes.AddEllipse(20, 20) Shapes.Move(handle3, 710, 250) Shapes.HideShape(handle3) GraphicsWindow.PenColor = "darkgreen" GraphicsWindow.BrushColor = "green" sign_back_1 = Shapes.AddRectangle(70, 30) Shapes.Move(sign_back_1, 115, 50) Shapes.HideShape(sign_back_1) sign_back_2 = Shapes.AddRectangle(70, 30) Shapes.Move(sign_back_2, 365, 50) Shapes.HideShape(sign_back_2) sign_back_3 = Shapes.AddRectangle(70, 30) Shapes.Move(sign_back_3, 615, 50) Shapes.HideShape(sign_back_3) GraphicsWindow.BrushColor = "white" GraphicsWindow.FontName = "Arial" GraphicsWindow.FontBold = "true" GraphicsWindow.FontSize = 15 sign1 = Shapes.AddText("EXIT") Shapes.Move(sign1, 132, 56) Shapes.HideShape(sign1) sign2 = Shapes.AddText("BACK") Shapes.Move(sign2, 378, 56) Shapes.HideShape(sign2) sign3 = Shapes.AddText("NEXT") Shapes.Move(sign3, 629, 56) Shapes.HideShape(sign3) 'HOLES GraphicsWindow.BrushColor = "navajowhite" GraphicsWindow.PenColor = "black" up_back = Shapes.AddRectangle(500, 200) Shapes.Move(up_back, 150, 25) Shapes.HideShape(up_back) down_back = Shapes.AddRectangle(500, 200) Shapes.Move(down_back, 150, 275) Shapes.HideShape(down_back) GraphicsWindow.PenColor = "black" GraphicsWindow.BrushColor = "red" filler1 = Shapes.AddRectangle(100, 100) Shapes.Move(filler1, 200, 75) Shapes.HideShape(filler1) GraphicsWindow.BrushColor = "green" filler2 = Shapes.AddEllipse(100, 100) Shapes.Move(filler2, 350, 75) Shapes.HideShape(filler2) GraphicsWindow.BrushColor = "blue" filler3 = Shapes.AddTriangle(500, 175, 550, 75, 600, 175) Shapes.HideShape(filler3) GraphicsWindow.PenColor = "green" GraphicsWindow.BrushColor = "lime" filler_back_1 = Shapes.AddRectangle(104, 104) Shapes.Move(filler_back_1, 348, 73) Shapes.SetOpacity(filler_back_1, 20) Shapes.HideShape(filler_back_1) GraphicsWindow.BrushColor = "white" GraphicsWindow.PenColor = "black" hole1 = Shapes.AddTriangle(250, 325, 200, 425, 300, 425) Shapes.HideShape(hole1) hole2 = Shapes.AddEllipse(100, 100) Shapes.Move(hole2, 350, 325) Shapes.HideShape(hole2) hole3 = Shapes.AddRectangle(100, 100) Shapes.Move(hole3, 500, 325) Shapes.HideShape(hole3) GraphicsWindow.FontName = "Jokerman" GraphicsWindow.FontSize = 40 GraphicsWindow.BrushColor = "green" victory = Shapes.AddText("Victory") Shapes.Move(victory, 325, 95) Shapes.HideShape(victory) 'REC GraphicsWindow.PenColor = "black" GraphicsWindow.BrushColor = "black" rec = Shapes.AddRectangle(800, 500) Shapes.HideShape(rec) 'RETRY GraphicsWindow.BrushColor = "black" GraphicsWindow.FontBold = "false" GraphicsWindow.FontName = "consolas" GraphicsWindow.FontSize = 15 retry = Controls.AddButton("Retry", 350, 150) Controls.SetSize(retry, 100, 30) Controls.HideControl(retry) retry2 = Controls.AddButton("Retry", 350, 150) Controls.SetSize(retry2, 100, 30) Controls.HideControl(retry2) retry3 = Controls.AddButton("Retry", 350, 150) Controls.SetSize(retry3, 100, 30) Controls.HideControl(retry3) 'SUBROUTINES '*'*'*'*'*'*'*'*'*'*'*' 'MOUSE_DOWN GraphicsWindow.MouseDown = click Sub click x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY get_closed_active = Controls.GetButtonCaption(closed_active) If get_closed_active = 1 Then If x > (800 - 150) / 2 And x < ((800 - 150) / 2) + 150 And y > 150 And y < 350 Then Sound.PlayClick() Shapes.HideShape(closed_book) Shapes.HideShape(stamp) Shapes.HideShape(cover_txt) Shapes.ShowShape(opened_book) Shapes.ShowShape(seperate_book) Controls.SetButtonCaption(closed_active, 0) Shapes.ShowShape(line1) Shapes.ShowShape(line2) Shapes.ShowShape(line3) Shapes.ShowShape(line4) Shapes.ShowShape(line5) Shapes.ShowShape(choice1) Shapes.ShowShape(choice2) Controls.SetButtonCaption(choice_active, 1) get_choice_active = Controls.GetButtonCaption(choice_active) EndIf EndIf 'WRONG_ANSWER_STONE If get_choice_active = 1 Then If x > 401 And x < 548 And y > 180 And y < 195 Then defeat() Controls.ShowControl(retry) EndIf EndIf 'WRONG_DOOR_FIRST get_doors_active = Controls.GetButtonCaption(doors_active) If get_doors_active = 1 Then If x > 50 And x < 250 And y > 100 And y < 400 Then defeat() Controls.ShowControl(retry2) Shapes.Move(rec, 0, 0) Shapes.ShowShape(rec) EndIf 'WRONG_DOOR_SECOND If x > 300 And x < 500 And y > 100 And y < 400 Then defeat() Controls.ShowControl(retry2) Shapes.Move(rec, 0, 0) Shapes.ShowShape(rec) EndIf 'CORRECT_DOOR If x > 550 And x < 750 And y > 100 And y < 400 Then Sound.PlayChimes() Controls.SetButtonCaption(doors_active, 0) controls.SetButtonCaption(holes_active, 1) Controls.SetButtonCaption(rectangle_active, 1) Controls.SetButtonCaption(circle_active, 1) Controls.SetButtonCaption(triangle_active, 1) Shapes.HideShape(door_back_3) Shapes.HideShape(door1) Shapes.HideShape(door2) Shapes.HideShape(door3) Shapes.HideShape(sign_back_1) Shapes.HideShape(sign_back_2) Shapes.HideShape(sign_back_3) Shapes.HideShape(sign1) Shapes.HideShape(sign2) Shapes.HideShape(sign3) Shapes.HideShape(handle1) Shapes.HideShape(handle2) Shapes.HideShape(handle3) Shapes.ShowShape(filler_back_1) showholes() EndIf EndIf 'CLICK_FILLERS get_holes_active = Controls.GetButtonCaption(holes_active) get_rectangle_active = Controls.GetButtonCaption(rectangle_active) get_circle_active = Controls.GetButtonCaption(circle_active) get_triangle_active = Controls.GetButtonCaption(triangle_active) If get_holes_active = 1 Then If get_rectangle_active = 1 Then If x > 200 And x < 300 And y > 75 And y < 175 Then Sound.PlayClick() Shapes.ShowShape(filler_back_1) Shapes.Move(filler_back_1, 198, 73) EndIf EndIf If get_circle_active = 1 Then If x > 350 And x < 450 And y > 75 And y < 175 Then Sound.PlayClick() Shapes.ShowShape(filler_back_1) Shapes.Move(filler_back_1, 348, 73) EndIf EndIf If get_triangle_active = 1 Then If x > 500 And x < 600 And y > 75 And y < 175 Then Sound.PlayClick() Shapes.ShowShape(filler_back_1) Shapes.Move(filler_back_1, 498, 73) EndIf EndIf 'CLICK_HOLES If get_triangle_active = 1 Then If x > 200 And x < 300 And y > 325 And y < 425 Then get_fb_left = Shapes.GetLeft(filler_back_1) If get_fb_left = 498 Then Sound.PlayClick() Shapes.HideShape(filler_back_1) Shapes.HideShape(hole1) Shapes.Animate(filler3, -300, 250, 300) Controls.SetButtonCaption(triangle_active, 0) victorycheck() Else defeat() Controls.ShowControl(retry3) EndIf EndIf EndIf If get_circle_active = 1 Then If x > 350 And x < 450 And y > 325 And y < 425 Then get_fb_left = Shapes.GetLeft(filler_back_1) If get_fb_left = 348 Then Sound.PlayClick() Shapes.HideShape(filler_back_1) Shapes.HideShape(hole2) Shapes.Animate(filler2, 350, 325, 300) Controls.SetButtonCaption(circle_active, 0) victorycheck() Else defeat() Controls.ShowControl(retry3) EndIf EndIf EndIf If get_rectangle_active = 1 Then If x > 500 And x < 600 And y > 325 And y < 425 Then get_fb_left = Shapes.GetLeft(filler_back_1) If get_fb_left = 198 Then Sound.PlayClick() Shapes.HideShape(filler_back_1) Shapes.HideShape(hole3) Shapes.Animate(filler1, 500, 325, 300) Controls.SetButtonCaption(rectangle_active, 0) victorycheck() Else defeat() Controls.ShowControl(retry3) EndIf EndIf EndIf EndIf EndSub 'MOUSE_UP GraphicsWindow.MouseUp = mu Sub mu x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY 'CORRECT_ANSWER_SNAIL get_choice_active = Controls.GetButtonCaption(choice_active) If get_choice_active = 1 Then If x > 401 And x < 548 And y > 160 And y < 175 Then Sound.PlayChimes() Shapes.HideShape(opened_book) Shapes.HideShape(choice1) Shapes.HideShape(choice2) Shapes.HideShape(choice_back_1) Shapes.HideShape(choice_back_2) Shapes.HideShape(line1) Shapes.HideShape(line2) Shapes.HideShape(line3) Shapes.HideShape(line4) Shapes.HideShape(line5) Shapes.HideShape(seperate_book) Controls.SetButtonCaption(choice_active, 0) Shapes.ShowShape(door1) Shapes.ShowShape(door2) Shapes.ShowShape(door3) Shapes.ShowShape(sign_back_1) Shapes.ShowShape(sign_back_2) Shapes.ShowShape(sign_back_3) Shapes.ShowShape(sign1) Shapes.ShowShape(sign2) Shapes.ShowShape(sign3) Shapes.ShowShape(handle1) Shapes.ShowShape(handle2) Shapes.ShowShape(handle3) Controls.SetButtonCaption(doors_active, 1) EndIf EndIf EndSub 'MOUSE_MOVE GraphicsWindow.MouseMove = mm Sub mm x = GraphicsWindow.MouseX y = Graphicswindow.MouseY 'CHOICES get_choice_active = Controls.GetButtonCaption(choice_active) If get_choice_active = 1 Then If x > 401 And x < 548 And y > 160 And y < 175 Then Shapes.ShowShape(choice_back_1) Else Shapes.HideShape(choice_back_1) EndIf If x > 401 And x < 548 And y > 180 And y < 195 Then Shapes.ShowShape(choice_back_2) Else Shapes.HideShape(choice_back_2) EndIf EndIf 'DOORS get_doors_active = Controls.GetButtonCaption(doors_active) If get_doors_active = 1 Then If x > 50 And x < 250 And y > 100 And y < 400 Then Shapes.ShowShape(door_back_1) Else Shapes.HideShape(door_back_1) EndIf If x > 300 And x < 500 And y > 100 And y < 400 Then Shapes.ShowShape(door_back_2) Else Shapes.HideShape(door_back_2) EndIf If x > 550 And x < 750 And y > 100 And y < 400 Then Shapes.ShowShape(door_back_3) Else Shapes.HideShape(door_back_3) EndIf EndIf EndSub 'BUTTON_DOWN Controls.ButtonClicked = bc Sub bc lcb = Controls.LastClickedButton 'RETRY If lcb = retry Then Controls.SetButtonCaption(choice_active, 1) Sound.PlayClick() Controls.HideControl(retry) Shapes.Animate(rec, 800, 0, 400) EndIf 'RETRY_2 If lcb = retry2 Then Sound.PlayClick() Controls.SetButtonCaption(doors_active, 1) Controls.HideControl(retry2) Shapes.Animate(rec, 800, 0, 400) EndIf 'RETR_3 If lcb = retry3 Then Sound.PlayClick() Controls.SetButtonCaption(holes_active, 1) Controls.HideControl(retry3) Shapes.Animate(rec, 800, 0, 400) EndIf EndSub 'MY_SUBROUTINES sub defeat Sound.PlayMusic("o3 f") Controls.SetButtonCaption(choice_active, 0) Controls.SetButtonCaption(doors_active, 0) Controls.SetButtonCaption(holes_active, 0) Shapes.Move(rec, 0, 0) Shapes.ShowShape(rec) Shapes.SetOpacity(rec, 0) For i = 0 To 100 Step 0.5 Shapes.SetOpacity(rec, i) Program.Delay(10) EndFor EndSub Sub showholes Shapes.ShowShape(up_back) Shapes.ShowShape(down_back) Shapes.ShowShape(hole1) Shapes.ShowShape(hole2) Shapes.ShowShape(hole3) Shapes.ShowShape(filler1) Shapes.ShowShape(filler2) Shapes.ShowShape(filler3) EndSub Sub victorycheck get_rectangle_top = Shapes.GetTop(filler1) get_circle_top = Shapes.GetTop(filler2) get_triangle_top = Shapes.GetTop(filler3) If get_rectangle_top = 325 And get_circle_top = 325 And get_triangle_top = 250 Then Sound.PlayBellRing() Shapes.Zoom(up_back, 0.5, 0.5) Shapes.ShowShape(victory) GraphicsWindow.BrushColor = "white" GraphicsWindow.PenColor = "white" cover = Shapes.AddRectangle(500, 200) Shapes.Move(cover, 150, 275) EndIf EndSub 'SHOW_WINDOW GraphicsWindow.Show() End>GPV107.sb< Start>GPZ070.sb< ' Krueg -- Starfield -- Sept. 2012 Delay = 60 'Delay for smooth framrate StarQty = 80 'Number of stars, Too many and it slows the program SetupWindow() CreateStars() While ("True") MoveStars() RefreshRate() 'Comment out this line to see the jerkiness of the array proccessing EndWhile Sub RefreshRate While Clock.ElapsedMilliseconds < FrameRate EndWhile FrameRate = Clock.ElapsedMilliseconds + Delay EndSub Sub MoveStars For i = 1 To StarQty StarY[i] = StarY[i] + StarHeight[i] * 1.5 If StarY[i] > gh Then StarY[i] = StarY[i] - gh StarX[i] = Math.GetRandomNumber(gw - 10) + 5 EndIf Shapes.Move(Star[i],StarX[i],StarY[i]) 'Checking which moves smother, Shapes.Move or Shapes.Animate 'Shapes.Animate(Star[i],StarX[i],StarY[i],0) EndFor EndSub Sub CreateStars For i = 1 To StarQty GraphicsWindow.PenColor = "White" GraphicsWindow.BrushColor = "White" StarWidth[i] = Math.GetRandomNumber(2) If i < (StarQty * .9) Then StarHeight[i] = Math.GetRandomNumber(3) 'Create more small stars than big Else StarHeight[i] = Math.GetRandomNumber(4)+4 EndIf Star[i] = Shapes.AddEllipse(StarWidth[i],StarHeight[i]) Shapes.SetOpacity(Star[i],StarHeight[i]*5+50) StarX[i] = Math.GetRandomNumber(gw - 10) + 5 StarY[i] = Math.GetRandomNumber(gh) Shapes.Move(Star[i],StarX[i],StarY[i]) EndFor EndSub Sub SetupWindow gw = 800 gh = 600 GraphicsWindow.Top = 5 GraphicsWindow.Left = 5 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BackgroundColor = "Black" EndSub End>GPZ070.sb< Start>GPZ097.sb< 'Variables CurrentMenu = "MainMenu" RandomSymbol1 = "" RandomSymbol2 = "" RandomSymbol3 = "" CanDoSymbolRoll = "Yes" HandleClicked = "No" CanClickHandle = "Yes" DoingSymbolRoll = "No" CurrentMoney = 100 CurrentPayout = 0 TimerOn = "No" CanPlayHandleSnd = "Yes" TextWindow.CursorTop = 3 TextWindow.WriteLine("D/loading images - please wait...") 'Images ImgBtn = ImageList.LoadImage("http://i.stack.imgur.com/IYtSy.png") ImgMMBackground = ImageList.LoadImage("https://lh3.ggpht.com/0U2EjcQgYcvc2dKLUyd13hkZt7l2k4lE6tB0z3-IPfPUYpMGSSVREq-IQ0Q6em0r7w=h900") ImgSlotMachine = ImageList.LoadImage("http://vignette2.wikia.nocookie.net/capx/images/5/5c/Slot_machine_with_key.png/revision/latest?cb=20130430031220") ImgTopMenu = ImageList.LoadImage("https://camo.githubusercontent.com/ea0dac1ccfffa8be8beff9f9b8f0142295ae914e/687474703a2f2f7331372e706f7374696d6167652e6f72672f38687865746e7a30762f616374696f6e5f426c61636b5f427574746f6e5f32782e706e67") ImgHandle = ImageList.LoadImage("https://social.msdn.microsoft.com/Forums/getfile/650084") ImgHandleHand = ImageList.LoadImage("http://icons.iconarchive.com/icons/anton-gerasimenko/simpsons/128/Hand-icon.png") ImgBackSlot = ImageList.LoadImage("http://i96.photobucket.com/albums/l185/nicosci2006/portfolio/button.png") ImgTakeMyMoney = ImageList.LoadImage("https://ip.bitcointalk.org/?u=http%3A%2F%2Fih1.redbubble.net%2Fimage.13863766.9187%2Fsticker%2C375x360.u2.png&t=549&c=Cs2ucCnRDXq21w") ImgLeaving = ImageList.LoadImage("http://www.bellyfeel.co.uk/bfblog/wp-content/uploads/2014/09/TSTO-Pic.png") ImgJackpot = ImageList.LoadImage("http://www.mcxprofits.com/images/jackpot_img.png") ImgMoney = ImageList.LoadImage("http://www.sorryopenerp.com/img/apps/money.png") ImgBroke = ImageList.LoadImage("http://www.allianceforwomenandchildren.org/site_images/wee_clipart2.png") 'Sounds SndHandle = "http://rickmurphy.byethost5.com/SmallBasic/ProgramListing/SlotMachine/assets/handleSFX.au" TextWindow.ForegroundColor = "Red" TextWindow.CursorTop = TextWindow.CursorTop + 3 TextWindow.WriteLine("To play - Click on the Red Handle, Drag it Down and Release!") TextWindow.Pause() TextWindow.Hide() 'Window GraphicsWindow.Hide() GraphicsWindow.Title = "Vegas Slot" GraphicsWindow.Width = 768 GraphicsWindow.Height = 549 GraphicsWindow.Left = (Desktop.Width - 768) / 2 GraphicsWindow.Top = (Desktop.Height - 639) / 2 GraphicsWindow.CanResize = "False" GraphicsWindow.FontBold = "False" 'MainMenu MMBackground = Shapes.AddImage(ImgMMBackground) Shapes.Zoom(MMBackground, 0.75, 0.8) Shapes.Move(MMBackground, 0, -51) MMBtnBackPlay = Shapes.AddImage(ImgBtn) Shapes.Move(MMBtnBackPlay, 325, 404) MMBtnBackExit = Shapes.AddImage(ImgBtn) Shapes.Move(MMBtnBackExit, 325, 461) GraphicsWindow.FontName = "Ravie" GraphicsWindow.FontSize = 17 GraphicsWindow.BrushColor = "White" MMLblPlay = Shapes.AddText("Play") Shapes.Move(MMLblPlay, 362, 412) MMLblExit = Shapes.AddText("Exit") Shapes.Move(MMLblExit, 362, 470) MMBtnPlay = Controls.AddButton("", 325, 404) Controls.SetSize(MMBtnPlay, 127, 42) Shapes.SetOpacity(MMBtnPlay, 0) MMBtnExit = Controls.AddButton("", 325, 461) Controls.SetSize(MMBtnExit, 127, 42) Shapes.SetOpacity(MMBtnExit, 0) GraphicsWindow.Show() 'SUBROUTINES '*************** 'MouseMove GraphicsWindow.MouseMove = MouseMove Sub MouseMove x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY If CurrentMenu = "MainMenu" Then If x > Shapes.GetLeft(MMBtnBackPlay) And x < Shapes.GetLeft(MMBtnBackPlay) + 127 And y > Shapes.GetTop(MMBtnBackPlay) And y < Shapes.GetTop(MMBtnBackPlay) + 42 Then Shapes.Zoom(MMBtnBackPlay, 1.2, 1.1) Shapes.Zoom(MMLblPlay, 1.2, 1.1) ElseIf x > Shapes.GetLeft(MMBtnBackExit) And x < Shapes.GetLeft(MMBtnBackExit) + 127 And y > Shapes.GetTop(MMBtnBackExit) And y < Shapes.GetTop(MMBtnBackExit) + 42 Then Shapes.Zoom(MMBtnBackExit, 1.2, 1.1) Shapes.Zoom(MMLblExit, 1.2, 1.1) Else Shapes.Zoom(MMBtnBackPlay, 1, 1) Shapes.Zoom(MMLblPlay, 1, 1) Shapes.Zoom(MMBtnBackExit, 1, 1) Shapes.Zoom(MMLblExit, 1, 1) EndIf ElseIf CurrentMenu = "GameOn" Then If HandleClicked = "Yes" Then Shapes.Move(GOHandle, 778, y - 24) Shapes.Move(GOHandleHand, 732, y - 15) Mouse.MouseX = (Desktop.Width - GraphicsWindow.Width) + 540 HandleLeft = Shapes.GetLeft(GOHandle) HandleTop = Shapes.GetTop(GOHandle) If HandleTop >= 399 Then HandleClicked = "No" CurrentMoney = CurrentMoney - 10 Mouse.HideCursor() Shapes.SetText(GOMoney, CurrentMoney) ResetHandle() RefreshSymbols() DoSymbolRoll() ElseIf HandleTop > 150 Then If CanPlayHandleSnd = "Yes" Then CanPlayHandleSnd = "No" Sound.Stop(SndHandle) Sound.Play(SndHandle) EndIf EndIf EndIf ElseIf CurrentMenu = "NoMoneyMenu" Then If x > Shapes.GetLeft(NMMBackContinue) And x < Shapes.GetLeft(NMMBackContinue) + 370 And y > Shapes.GetTop(NMMBackContinue) And y < Shapes.GetTop(NMMBackContinue) + 310 Then Shapes.SetOpacity(NMMBtnYes, 35) ElseIf x > Shapes.GetLeft(NMMBackExit) And x < Shapes.GetLeft(NMMBackExit) + 280 And y > Shapes.GetTop(NMMBackExit) And y < Shapes.GetTop(NMMBackExit) + 310 Then Shapes.SetOpacity(NMMBtnNo, 35) Else Shapes.SetOpacity(NMMBtnYes, 10) Shapes.SetOpacity(NMMBtnNo, 10) EndIf EndIf EndSub 'MouseDown GraphicsWindow.MouseDown = MouseDown Sub MouseDown x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY If CurrentMenu = "GameOn" Then HandleLeft = Shapes.GetLeft(GOHandle) HandleTop = Shapes.GetTop(GOHandle) If CanClickHandle = "Yes" Then If x > HandleLeft And x < HandleLeft + 45 And y > HandleTop And y < HandleTop + 45 Then Sound.PlayClick() Mouse.HideCursor() Shapes.ShowShape(GOHandleHand) HandleClicked = "Yes" CanClickHandle = "No" EndIf EndIf EndIf EndSub 'MouseUp GraphicsWindow.MouseUp = MouseUp Sub MouseUp x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY If CurrentMenu = "GameOn" Then If HandleClicked = "Yes" Then Shapes.HideShape(GOHandleHand) ResetHandle() If DoingSymbolRoll = "No" Then CanClickHandle = "Yes" EndIf HandleClicked = "No" EndIf EndIf EndSub 'ButtonClicked Controls.ButtonClicked = ButtonClicked Sub ButtonClicked If CurrentMenu = "MainMenu" Then If Controls.LastClickedButton = MMBtnPlay Then Sound.PlayClick() GraphicsWindow.Hide() RemoveMainMenu() StartGame() ElseIf Controls.LastClickedButton = MMBtnExit Then Sound.PlayClickAndWait() Program.End() EndIf ElseIf CurrentMenu = "NoMoneyMenu" Then If Controls.LastClickedButton = NMMBtnYes Then Sound.PlayClick() HideNoMoneyMenu() ShowDrawFromPayout() ElseIf Controls.LastClickedButton = NMMBtnNo Then Sound.PlayClickAndWait() Program.End() EndIf ElseIf CurrentMenu = "DrawFromPayout" Then If Controls.LastClickedButton = DFPBtnConfirm Then Sound.PlayClick() GetAmount = Controls.GetTextBoxText(DFPTBPayoutAmount) If GetAmount > 0 And GetAmount <= CurrentPayout Then CurrentMoney = CurrentMoney + GetAmount CurrentPayout = CurrentPayout - GetAmount Shapes.SetText(GOMoney, CurrentMoney) Shapes.SetText(GOPayout, CurrentPayout) HideDrawFromPayout() ShowGameMenu() Else Sound.PlayClick() GraphicsWindow.ShowMessage("You can't draw " + GetAmount + " dollars.", "Information") Sound.PlayClick() EndIf EndIf ElseIf CurrentMenu = "DefeatMenu" Then If Controls.LastClickedButton = DMBtnNo Then Sound.PlayClickAndWait() Program.End() ElseIf Controls.LastClickedButton = DMBtnYes Then Sound.PlayClick() HideDefeatMenu() CurrentMoney = 100 Shapes.SetText(GOMoney, 100) ShowGameMenu() CurrentMenu = "GameOn" CanClickHandle = "Yes" EndIf EndIf EndSub 'RemoveMainMenu Sub RemoveMainMenu Shapes.Remove(MMBackground) Shapes.Remove(MMBtnBackPlay) Shapes.Remove(MMBtnBackExit) Shapes.Remove(MMLblPlay) Shapes.Remove(MMLblExit) Controls.Remove(MMBtnPlay) Controls.Remove(MMBtnExit) Sound.Play(SndHandle) Sound.Stop(SndHandle) EndSub 'StartGame Sub StartGame GOSlotMachine = Shapes.AddImage(ImgSlotMachine) Shapes.Move(GOSlotMachine, 0, 0) GraphicsWindow.BrushColor = GraphicsWindow.GetColorFromRGB(15, 15, 15) GraphicsWindow.PenColor = GraphicsWindow.GetColorFromRGB(15, 15, 15) GOShieldCredit = Shapes.AddRectangle(125, 25) Shapes.Move(GOShieldCredit, 215, 504) GOShieldPayout = Shapes.AddRectangle(125, 25) Shapes.Move(GOShieldPayout, 425, 504) GraphicsWindow.FontBold = "False" GraphicsWindow.BrushColor = "LimeGreen" GraphicsWindow.FontSize = 20 GOMoney = Shapes.AddText("100") Shapes.Move(GOMoney, 232, 502) GOPayout = Shapes.AddText(0) Shapes.Move(GOPayout, 447, 504) GOHandleBackground = Shapes.AddImage(ImgTopMenu) Shapes.Rotate(GOHandleBackground, 90) Shapes.Zoom(GOHandleBackground, 0.85, 1.7) Shapes.Move(GOHandleBackground, 525, 89) GOBackSlot1 = Shapes.AddImage(ImgBackSlot) Shapes.Zoom(GOBackSlot1, 0.56, 2.18) Shapes.Move(GOBackSlot1, 60, 139) Shapes.SetOpacity(GOBackSlot1, 50) GOBackSlot2 = Shapes.AddImage(ImgBackSlot) Shapes.Zoom(GOBackSlot2, 0.56, 2.18) Shapes.Move(GOBackSlot2, 240, 139) Shapes.SetOpacity(GOBackSlot2, 50) GOBackSlot3 = Shapes.AddImage(ImgBackSlot) Shapes.Zoom(GOBackSlot3, 0.56, 2.18) Shapes.Move(GOBackSlot3, 420, 139) Shapes.SetOpacity(GOBackSlot3, 50) GraphicsWindow.FontName = "Webdings" GraphicsWindow.FontSize = 150 GraphicsWindow.FontBold = "False" RefreshSymbols() GOHandle = Shapes.AddImage(ImgHandle) Shapes.Move(GOHandle, 778, 25) GOHandleHand = Shapes.AddImage(ImgHandleHand) Shapes.Move(GOHandleHand, 732, 30) Shapes.Rotate(GOHandleHand, -8) Shapes.HideShape(GOHandleHand) HideMainMenu() GraphicsWindow.Width = 840 GraphicsWindow.Left = (Desktop.Width - 840) / 2 JackpotImage = Shapes.AddImage(ImgJackpot) Shapes.HideShape(JackpotImage) Shapes.Move(JackpotImage, (GraphicsWindow.Width - 290) / 2, (GraphicsWindow.Height - 235) / 2) GraphicsWindow.Show() CurrentMenu = "GameOn" EndSub 'HideMainMenu Sub HideMainMenu Shapes.HideShape(MMBackground) Shapes.HideShape(MMBtnBackPlay) Shapes.HideShape(MMBtnBackExit) Shapes.HideShape(MMLblPlay) Shapes.HideShape(MMLblExit) Controls.HideControl(MMBtnPlay) Controls.HideControl(MMBtnExit) EndSub 'ShowOptionsMenu Sub ShowOptionsMenu CurrentMenu = "Options" EndSub 'HideOptionsMenu Sub HideOptionsMenu EndSub 'StartRound Sub StartRound RandomNum1 = Math.GetRandomNumber(5) RandomNum2 = Math.GetRandomNumber(5) RandomNum3 = Math.GetRandomNumber(5) CalculateSymbols() RandomSymbol1 = RandomNum1 RandomSymbol2 = RandomNum2 RandomSymbol3 = RandomNum3 Shapes.SetText(GOSymbol1, RandomSymbol1) Shapes.SetText(GOSymbol2, RandomSymbol2) Shapes.SetText(GOSymbol3, RandomSymbol3) EndSub 'CalculateSymbols Sub CalculateSymbols If RandomNum1 = 1 Then RandomNum1 = "L" ElseIf RandomNum1 = 2 Then RandomNum1 = "N" ElseIf RandomNum1 = 3 Then RandomNum1 = "O" ElseIf RandomNum1 = 4 Then RandomNum1 = "U" ElseIf RandomNum1 = 5 Then RandomNum1 = "Z" EndIf If RandomNum2 = 1 Then RandomNum2 = "L" ElseIf RandomNum2 = 2 Then RandomNum2 = "N" ElseIf RandomNum2 = 3 Then RandomNum2 = "O" ElseIf RandomNum2 = 4 Then RandomNum2 = "U" ElseIf RandomNum2 = 5 Then RandomNum2 = "Z" EndIf If RandomNum3 = 1 Then RandomNum3 = "L" ElseIf RandomNum3 = 2 Then RandomNum3 = "N" ElseIf RandomNum3 = 3 Then RandomNum3 = "O" ElseIf RandomNum3 = 4 Then RandomNum3 = "U" ElseIf RandomNum3 = 5 Then RandomNum3 = "Z" EndIf EndSub 'GetRandomColors Sub GetRandomColors x = Math.GetRandomNumber(200) y = Math.GetRandomNumber(200) z = Math.GetRandomNumber(200) EndSub 'CheckForJackpot Sub CheckForJackpot If CurrentRound = 10000 Then DoingSymbolRoll = "No" CurrentRound = 0 If RandomSymbol1 = RandomSymbol2 And RandomSymbol1 = RandomSymbol3 And RandomSymbol2 = RandomSymbol3 Then Jackpot() EndIf CanClickHandle = "Yes" EndIf EndSub 'DoSymbolRoll Sub DoSymbolRoll DoingSymbolRoll = "Yes" For Times = 1 To 10000 StartRound() CurrentRound = CurrentRound + 1 CheckForJackpot() EndFor If CurrentMoney <= 0 Then CanClickHandle = "No" HideGameMenu() ShowNoMoneyMenu() EndIf EndSub 'ResetHandle Sub ResetHandle Mouse.ShowCursor() Shapes.HideShape(GOHandleHand) If Shapes.GetTop(GOHandle) > 300 Then Shapes.Animate(GOHandle, 778, 25, 1000) Shapes.Animate(GOHandleHand, 732, 30, 1000) ElseIf Shapes.GetTop(GOHandle) < 300 Then Shapes.Animate(GOHandle, 778, 25, 500) Shapes.Animate(GOHandleHand, 732, 30, 500) EndIf CanPlayHandleSnd = "Yes" EndSub 'RefreshSymbols Sub RefreshSymbols Shapes.Remove(GOSymbol1) Shapes.Remove(GOSymbol2) Shapes.Remove(GOSymbol3) GetRandomColors() GraphicsWindow.BrushColor = GraphicsWindow.GetColorFromRGB(x, y, z) GOSymbol1 = Shapes.AddText(RandomSymbol1) Shapes.Move(GOSymbol1, 130, 149) GetRandomColors() GraphicsWindow.BrushColor = GraphicsWindow.GetColorFromRGB(x, y, z) GOSymbol2 = Shapes.AddText(RandomSymbol2) Shapes.Move(GOSymbol2, 310, 149) GetRandomColors() GraphicsWindow.BrushColor = GraphicsWindow.GetColorFromRGB(x, y, z) GOSymbol3 = Shapes.AddText(RandomSymbol3) Shapes.Move(GOSymbol3, 490, 149) EndSub 'HideGameMenu Sub HideGameMenu Shapes.HideShape(GOSlotMachine) Shapes.HideShape(GOBackSlot1) Shapes.HideShape(GOBackSlot2) Shapes.HideShape(GOBackSlot3) Shapes.HideShape(GOSymbol1) Shapes.HideShape(GOSymbol2) Shapes.HideShape(GOSymbol3) Shapes.HideShape(GOHandle) Shapes.HideShape(GOHandleHand) Shapes.HideShape(GOHandleBackground) Shapes.HideShape(GOShieldCredit) Shapes.HideShape(GOShieldPayout) Shapes.HideShape(GOMoney) Shapes.HideShape(GOPayout) EndSub 'Jackpot Sub Jackpot CanClickHandle = "No" Sound.PlayBellRing() Shield = Shapes.AddRectangle(GraphicsWindow.Width, GraphicsWindow.Height) Shapes.SetOpacity(Shield, 0) Shapes.HideShape(GOSymbol1) Shapes.HideShape(GOSymbol2) Shapes.HideShape(GOSymbol3) Shapes.ShowShape(JackpotImage) For i = 1 To 2 Step 0.00005 Shapes.Zoom(JackpotImage, i, i) EndFor CurrentPayout = CurrentPayout + 100 Shapes.SetText(GOPayout, CurrentPayout) Shapes.HideShape(JackpotImage) Shapes.Zoom(JackpotImage, 1, 1) Shapes.Remove(Shield) Shapes.ShowShape(GOSymbol1) Shapes.ShowShape(GOSymbol2) Shapes.ShowShape(GOSymbol3) CanClickHandle = "Yes" EndSub 'PullHandleAnimation Sub PullHandleAnimation Shapes.ShowShape(GOHandleHand) Shapes.Animate(GOHandle, 778, 399, 1000) Shapes.Animate(GOHandleHand, 732, 399, 1000) EndSub 'ShowNoMoneyMenu Sub ShowNoMoneyMenu If CurrentPayout > 0 Then CurrentMenu = "NoMoneyMenu" GraphicsWindow.PenColor = "GoldenRod" GraphicsWindow.BrushColor = "GoldenRod" NMMBackground = Shapes.AddRectangle(GraphicsWindow.Width, GraphicsWindow.Height) Shapes.SetOpacity(NMMBackground, 0) For Appear = 0 To 100 Step 0.009 Shapes.SetOpacity(NMMBackground, Appear) EndFor GraphicsWindow.BrushColor = "DarkGoldenRod" GraphicsWindow.PenColor = "Yellow" NMMBackExit = Shapes.AddRectangle(280, 310) Shapes.HideShape(NMMBackExit) Shapes.Move(NMMBackExit, 40, 230) NMMLeaving = Shapes.AddImage(ImgLeaving) Shapes.HideShape(NMMLeaving) Shapes.Move(NMMLeaving, 50, 270) Shapes.Zoom(NMMLeaving, 0.5, 0.5) NMMBackContinue = Shapes.AddRectangle(370, 310) Shapes.HideShape(NMMBackContinue) Shapes.Move(NMMBackContinue, 405, 230) NMMTakeMyMoney = Shapes.AddImage(ImgTakeMyMoney) Shapes.HideShape(NMMTakeMyMoney) Shapes.Move(NMMTakeMyMoney, 400, 220) GraphicsWindow.BrushColor = "DarkGoldenRod" GraphicsWindow.PenColor = "Yellow" NMMBackTitle = Shapes.AddRectangle(768, 100) Shapes.HideShape(NMMBackTitle) Shapes.Move(NMMBackTitle, 20, 20) GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.FontName = "Ravie" GraphicsWindow.FontSize = 18 NMMLblNo = Shapes.AddText("NO") Shapes.HideShape(NMMLblNo) Shapes.Move(NMMLblNo, 165, 240) NMMLblYes = Shapes.AddText("YES") Shapes.HideShape(NMMLblYes) Shapes.Move(NMMLblYes, 570, 240) NMMTitle = Shapes.AddText("You have 0 money left but you can draw money from your") Shapes.HideShape(NMMTitle) Shapes.Move(NMMTitle, 50, 30) NMMTitle2 = Shapes.AddText("payout. Your current payout is " + CurrentPayout + ". Would you like to take") Shapes.HideShape(NMMTitle2) Shapes.Move(NMMTitle2, 50, 55) NMMTitle3 = Shapes.AddText("money from your payout and continue playing Vegas Slot?") Shapes.HideShape(NMMTitle3) Shapes.Move(NMMTitle3, 50, 80) NMMBtnYes = Controls.AddButton("", 405, 230) Controls.HideControl(NMMBtnYes) Shapes.SetOpacity(NMMBtnYes, 10) Controls.SetSize(NMMBtnYes, 370, 310) NMMBtnNo = Controls.AddButton("", 40, 230) Controls.HideControl(NMMBtnNo) Shapes.SetOpacity(NMMBtnNo, 10) Controls.SetSize(NMMBtnNo, 280, 310) Shapes.ShowShape(NMMBackExit) Shapes.ShowShape(NMMLblNo) Shapes.ShowShape(NMMLeaving) Controls.ShowControl(NMMBtnYes) Controls.ShowControl(NMMBtnNo) Shapes.ShowShape(NMMBackContinue) Shapes.ShowShape(NMMLblYes) Shapes.ShowShape(NMMTakeMyMoney) Shapes.ShowShape(NMMTitle) Shapes.ShowShape(NMMTitle2) Shapes.ShowShape(NMMTitle3) Shapes.ShowShape(NMMBackTitle) ElseIf CurrentPayout = 0 Then ShowDefeatMenu() EndIf EndSub 'HideNoMoneyMenu Sub HideNoMoneyMenu Shapes.HideShape(NMMTitle) Shapes.HideShape(NMMTitle2) Shapes.HideShape(NMMTitle3) Shapes.HideShape(NMMBackTitle) Shapes.HideShape(NMMBackContinue) Shapes.HideShape(NMMBackExit) Shapes.HideShape(NMMLblNo) Shapes.HideShape(NMMLblYes) Shapes.HideShape(NMMLeaving) Shapes.HideShape(NMMTakeMyMoney) Controls.HideControl(NMMBtnNo) Controls.HideControl(NMMBtnYes) Shapes.HideShape(NMMBackground) EndSub 'ShowDrawFromPayout Sub ShowDrawFromPayout CurrentMenu = "DrawFromPayout" GraphicsWindow.BrushColor = "GoldenRod" GraphicsWindow.PenColor = "GoldenRod" DFPBackground = Shapes.AddRectangle(GraphicsWindow.Width, GraphicsWindow.Height) DFPMoney = Shapes.AddImage(ImgMoney) Shapes.Move(DFPMoney, (GraphicsWindow.Width - 346) / 2, 10) GraphicsWindow.BrushColor = "DarkGoldenRod" GraphicsWindow.PenColor = "Yellow" DFPBackTitle = Shapes.AddRectangle(500, 50) Shapes.Move(DFPBackTitle, (GraphicsWindow.Width - 500) / 2, 270) GraphicsWindow.BrushColor = "Yellow" DFPTitle = Shapes.AddText("How much money do you wish to draw?") Shapes.Move(DFPTitle, 185, 282) GraphicsWindow.BrushColor = "DarkGoldenRod" DFPBackground2 = Shapes.AddRectangle(500, 130) Shapes.Move(DFPBackground2, (GraphicsWindow.Width - 500) / 2, 350) GraphicsWindow.BrushColor = "Yellow" DFPLbl = Shapes.AddText("Current payout: " + CurrentPayout) Shapes.Move(DFPLbl, (GraphicsWindow.Width - 500) / 1.6, 370) DFPLbl2 = Shapes.AddText("Enter amount:") Shapes.Move(DFPLbl2, (GraphicsWindow.Width - 500) / 1.6, 420) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontName = "Microsoft Sans Serif" GraphicsWindow.FontSize = 15 DFPBtnConfirm = Controls.AddButton("Confirm", 570, 490) Controls.SetSize(DFPBtnConfirm, 100, 30) DFPTBPayoutAmount = Controls.AddTextBox((GraphicsWindow.Width - 350) / 1.2, 420) GraphicsWindow.FontName = "Webdings" GraphicsWindow.FontSize = 150 EndSub 'HideDrawFromPayout Sub HideDrawFromPayout Shapes.HideShape(DFPBackground) Shapes.HideShape(DFPBackground2) Shapes.HideShape(DFPBackTitle) Shapes.HideShape(DFPLbl) Shapes.HideShape(DFPLbl2) Shapes.HideShape(DFPMoney) Shapes.HideShape(DFPTBPayoutAmount) Shapes.HideShape(DFPTitle) Controls.HideControl(DFPBtnConfirm) EndSub 'ShowGameMenu Sub ShowGameMenu Shapes.ShowShape(GOSlotMachine) Shapes.ShowShape(GOBackSlot1) Shapes.ShowShape(GOBackSlot2) Shapes.ShowShape(GOBackSlot3) Shapes.ShowShape(GOSymbol1) Shapes.ShowShape(GOSymbol2) Shapes.ShowShape(GOSymbol3) Shapes.ShowShape(GOHandle) Shapes.ShowShape(GOHandleBackground) Shapes.ShowShape(GOShieldCredit) Shapes.ShowShape(GOShieldPayout) Shapes.ShowShape(GOMoney) Shapes.ShowShape(GOPayout) CurrentMenu = "GameOn" CanClickHandle = "Yes" EndSub 'ShowDefeatMenu Sub ShowDefeatMenu CurrentMenu = "DefeatMenu" GraphicsWindow.BrushColor = "GoldenRod" GraphicsWindow.PenColor = "GoldenRod" DMBackground = Shapes.AddRectangle(GraphicsWindow.Width, GraphicsWindow.Height) Shapes.SetOpacity(DMBackground, 0) For Appear = 0 To 100 Step 0.009 Shapes.SetOpacity(DMBackground, Appear) EndFor DMBrokeImg = Shapes.AddImage(ImgBroke) Shapes.Move(DMBrokeImg, (GraphicsWindow.Width - 377) / 2, 50) GraphicsWindow.PenColor = "Yellow" GraphicsWindow.BrushColor = "DarkGoldenRod" GraphicsWindow.FontName = "Ravie" GraphicsWindow.FontSize = 18 DMBackTitle = Shapes.AddRectangle(500, 80) Shapes.Move(DMBackTitle, (GraphicsWindow.Width - 500) / 2, 340) GraphicsWindow.BrushColor = "Yellow" DMTitle = Shapes.AddText("You have 0 money and 0 payout. Do you") Shapes.Move(DMTitle, (GraphicsWindow.Width - 480) / 2, 350) DMTitle2 = Shapes.AddText("wish to play another round?") Shapes.Move(DMTitle2, (GraphicsWindow.Width - 480) / 2, 380) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontName = "Microsoft Sans Serif" GraphicsWindow.FontSize = 15 DMBtnNo = Controls.AddButton("No", (GraphicsWindow.Width - 150) / 2, 440) Controls.SetSize(DMBtnNo, 70, 30) DMBtnYes = Controls.AddButton("Yes", 420, 440) Controls.SetSize(DMBtnYes, 70, 30) GraphicsWindow.FontName = "Webdings" GraphicsWindow.FontSize = 150 EndSub 'HideDefeatMenu Sub HideDefeatMenu Shapes.HideShape(DMBackground) Shapes.HideShape(DMBrokeImg) Shapes.HideShape(DMBackTitle) Shapes.HideShape(DMTitle) Shapes.HideShape(DMTitle2) Controls.HideControl(DMBtnNo) Controls.HideControl(DMBtnYes) EndSub End>GPZ097.sb< Start>GQC905.sb< 'Welcome to GoQuiz! 'Created by Nicolás Gómez Vega 4º ESO 'Creation of the main menu that explains the game main() Sub main GraphicsWindow.Show() GraphicsWindow.Title="GoQuiz" GraphicsWindow.Height=700 GraphicsWindow.Width=700 GraphicsWindow.BackgroundColor="SlateBlue" GraphicsWindow.DrawRectangle (60,40,580,120) GraphicsWindow.DrawRectangle (70,210,560,420) GraphicsWindow.BrushColor="LightSalmon" GraphicsWindow.FillRectangle (60,40,580,120) GraphicsWindow.BrushColor="Lavender" GraphicsWindow.FillRectangle (70,210,560,420) GraphicsWindow.FontName="Comic Sans MS" GraphicsWindow.FontSize=50 GraphicsWindow.BrushColor="DarkViolet" GraphicsWindow.DrawBoundText (230, 60,300, "GoQuiz!") GraphicsWindow.FontSize=30 GraphicsWindow.FontName="Arial" GraphicsWindow.BrushColor="Black" GraphicsWindow.DrawBoundText (80,230,540,"Are you clever enough for solving GoQuiz? You will have to answer correctly seven questions about technology, but be careful! You will only have three minutes for answering all the questions. Are you ready?") GraphicsWindow.FontSize=24 GraphicsWindow.DrawBoundText (160, 550, 500, "Press the space bar to continue") GraphicsWindow.FontSize=30 GraphicsWindow.KeyDown = onKeyDown Endsub 'If the user presses the space bar the screen of selection of difficulty will appear Sub onKeyDown 'This is the subrutine for pressing the space bar If GraphicsWindow.LastKey="Space" Then GraphicsWindow.Clear() comp=imagelist.LoadImage (Program.Directory+"\Images\Computer.png") GraphicsWindow.DrawresizedImage(comp, 500,500,200,200) GraphicsWindow.DrawRectangle (60,40,580,120) GraphicsWindow.BrushColor="LightSalmon" GraphicsWindow.FillRectangle (60,40,580,120) GraphicsWindow.BrushColor="lightblue" GraphicsWindow.DrawRectangle (200,285,300,100) GraphicsWindow.DrawRectangle (200,485,300,100) GraphicsWindow.FillRectangle (200,285,300,100) GraphicsWindow.FillRectangle (200,485,300,100) GraphicsWindow.BrushColor="black" GraphicsWindow.DrawBoundText (80,55,550,"Before starting, please choose the level of difficulty for GoQuiz") GraphicsWindow.FontSize="40" Easy=Controls.AddButton ("Easy (8 to 13)", 217,500) Normal=Controls.AddButton ("Normal", 265,300) GraphicsWindow.FontSize="30" 'The event of seles¡ction of difficulty is called "difficulty" Controls.ButtonClicked=difficulty EndIf Endsub Sub difficulty If Controls.LastClickedButton=Normal then 'The questions are chosen randomly according to some variables f=Math.GetRandomNumber (8) 'In the normal difficluty "c" is the name of the variable that controls t c=1 'The timer starts, there are only three minutes for finishing GoQuiz GraphicsWindow.Clear() Timer.Resume() Timer.Tick =timeover Timer.Interval=180000 'This is going to be the basic GraphicsWindow for Normal questions GraphicsWindow.BackgroundColor="blue" GraphicsWindow.DrawRectangle (60,40,580,120) GraphicsWindow.BrushColor="Lightgreen" GraphicsWindow.FillRectangle (60,40,580,120) GraphicsWindow.DrawRectangle (100, 200, 500,100) GraphicsWindow.DrawRectangle (100, 340, 500,100) GraphicsWindow.DrawRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="Lightblue" GraphicsWindow.FillRectangle (100, 200, 500,100) GraphicsWindow.FillRectangle (100, 340, 500,100) GraphicsWindow.FillRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="black" 'The array "pool" contains the questions that are going to be used in the program pool[1][1]="Who are the founders of Microsoft?" pool [2][1]="Who founded Apple?" pool [3][1]="In which country can we find the headquarters of Microsoft?" pool[4][1]="Which of the following objects uses lithium?" pool[5][1]="Which of the following is not a programming language?" pool[6][1]="Which of the following programs is a spreadsheet?" pool[7][1]="Which program is used in Windows for introducing commands?" pool[8][1]="Which is the limit of characters that an user can use in Twitter? 'OptionsA is the array that contains the first possible answers for the questions of "pool" OptionsA[1][1]="Bill Gates and Paul Allen" OptionsA[2][1]="Bill Gates and Paul Allen" OptionsA[3][1]="Canada" OptionsA[4][1]="A pen drive" OptionsA[5][1]="C++" OptionsA[6][1]="OpenOffice Calc" OptionsA[7][1]="Absolute Commander" OptionsA[8][1]="130" 'OptionsB is the array that contains the second possible answers for the questions of "pool" OptionsB[1][1]="James Caan and Paul Allen" OptionsB[2][1]="James Caan and Bill Gates" OptionsB[3][1]="USA" OptionsB[4][1]="A computer screen" OptionsB[5][1]="BAS1C" OptionsB[6][1]="OpenOffice Writer" OptionsB[7][1]="Command Prompt" OptionsB[8][1]="140" 'OptionsC is the array that contains the third possible answers for the questions of "pool" OptionsC[1][1]="Bill Gates and Steve Jobs" OptionsC[2][1]="Steve Jobs and Steve Wozniak" OptionsC[3][1]="United Kingdom" OptionsC[4][1]="A regular battery" OptionsC[5][1]="Java" OptionsC[6][1]="OpenOffice Base" OptionsC[7][1]="command.com" OptionsC[8][1]="150" 'This text contains the question that the user will see GraphicsWindow.DrawBoundText (70,50,560,Pool[f][c]) 'The buttons contain the possible options A[f][c]=Controls.AddButton (OptionsA[f][c],100,200) 'This button is called "A" B[f][c]=Controls.AddButton (OptionsB[f][c],100,340)'This button is called "B" D[f][c]=Controls.AddButton (OptionsC[f][c],100,480)'This button is called "C" 'The event of pressing a button is called onButtonClicked in Normal questions. It will contain the number of the round in the following questions Controls.ButtonClicked=onButtonClicked 'These are the correct answers for every question Answers[1][1]=A[1][1] Answers[2][1]=D[2][1] Answers[3][1]=B[3][1] Answers[4][1]=D[4][1] Answers[5][1]=B[5][1] Answers[6][1]=A[6][1] Answers[7][1]=B[7][1] Answers[8][1]=B[8][1] ElseIf Controls.LastClickedButton=easy then 'If the user choses the Easy difficulty this is going to be the result 'The variable "s" is the name of the round s=1 t=Math.GetRandomNumber(6) '"lost" is the image that will appear if the user loses lost=ImageList.LoadImage (Program.Directory+"\Images\Wrong.gif") GraphicsWindow.Clear() 'The timer starts Timer.Resume() Timer.Tick =time Timer.Interval=180000 'This is the GraphicsWindow appearence for Easy questions GraphicsWindow.BackgroundColor="springgreen" GraphicsWindow.DrawRectangle (60,40,580,120) GraphicsWindow.BrushColor="blue" GraphicsWindow.FillRectangle (60,40,580,120) GraphicsWindow.DrawRectangle (100, 200, 500,100) GraphicsWindow.DrawRectangle (100, 340, 500,100) GraphicsWindow.DrawRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="Lightblue" GraphicsWindow.FillRectangle (100, 200, 500,100) GraphicsWindow.FillRectangle (100, 340, 500,100) GraphicsWindow.FillRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="white" 'The array for easy questions is also going to be called "pool" pool[1][1]="What is a gigabyte?" pool [2][1]="What is the name of the predetermined web explorer of Windows?" pool [3][1]="Is it possible to turn off the computer without using the mouse?" pool[4][1]="Which of the following programs is property of Microsoft?" pool[5][1]="Which is the name of the interface that shows information to the user of the computer?" pool[6][1]="In which century was the first Apple computer created?" OptionsA[1][1]="Unit used for storing information" OptionsA[2][1]="Safari" OptionsA[3][1]="Yes" OptionsA[4][1]="Calc" OptionsA[5][1]="Keyboard" OptionsA[6][1]="20th century" OptionsB[1][1]="It is a type of pen drive" OptionsB[2][1]="Google Chrome" OptionsB[3][1]="Only in Linux" OptionsB[4][1]="Writer" OptionsB[5][1]="Screen" OptionsB[6][1]="21st century" OptionsC[1][1]="The name of a supercomputer" OptionsC[2][1]="Internet Explorer" OptionsC[3][1]="No" OptionsC[4][1]="Excel" OptionsC[5][1]="CPU" OptionsC[6][1]="19th century" 'The creation of buttons works exactly te same as in Normal questions GraphicsWindow.DrawBoundText (70,50,560,Pool[t][s]) GraphicsWindow.BrushColor="black" A[t][s]=Controls.AddButton (OptionsA[t][s],100,200) B[t][s]=Controls.AddButton (OptionsB[t][s],100,340) D[t][s]=Controls.AddButton (OptionsC[t][s],100,480) Answers[1][1]=A[1][1] Answers[2][1]=D[2][1] Answers[3][1]=A[3][1] Answers[4][1]=D[4][1] Answers[5][1]=B[5][1] Answers[6][1]=A[6][1] Controls.ButtonClicked=eButtonClicked Endif Endsub 'This is the subrutine for the end of the time in Normal questions Sub timeover 'When the time is over a ring sounds Sound.PlayBellRing() 'If the time finishes, a message will appear and the program will end. GraphicsWindow.ShowMessage ("You reached the round "+c+"/7", "Time is over") GraphicsWindow.Clear() main() Endsub 'This is the subrutine for the end of the time in Easy questions Sub time 'When the time is over a ring sounds Sound.PlayBellRing() 'If the time finishes, a message will appear and the program will end. GraphicsWindow.ShowMessage ("You reached the round "+c+"/7", "Time is over") GraphicsWindow.Clear() main() Endsub Sub onButtonClicked 'This is teh subrutine for the answer of the first Normal question If Controls.LastClickedButton=Answers[f][c] Then 'This is the process that will occur if the answer is correct c=c+1 GraphicsWindow.Clear() g=Math.GetRandomNumber(8) GraphicsWindow.BackgroundColor="blue" GraphicsWindow.DrawRectangle (60,40,580,120) GraphicsWindow.BrushColor="Lightgreen" GraphicsWindow.FillRectangle (60,40,580,120) GraphicsWindow.DrawRectangle (100, 200, 500,100) GraphicsWindow.DrawRectangle (100, 340, 500,100) GraphicsWindow.DrawRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="Lightblue" GraphicsWindow.FillRectangle (100, 200, 500,100) GraphicsWindow.FillRectangle (100, 340, 500,100) GraphicsWindow.FillRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="black" pool[1][2]="What is the main product manufactured by Intel?" pool [2][2]="Who invented the mass production?" pool [3][2]="What is the meaning of HP?" pool[4][2]="Which is the maximum capacity of a single-layer Blu-Ray disc?" pool[5][2]="Which is the process used in nuclear power stations for producing energy?" pool[6][2]="Which element is used in nuclear fusion?" pool[7][2]="Which was the first version of Windows?" pool[8][2]="Which is the name of the explorer created by the Mozilla Corporation?" OptionsA[1][2]="Laptops" OptionsA[2][2]="Henry Ford" OptionsA[3][2]="Herbert Patricks" OptionsA[4][2]="15 GB" OptionsA[5][2]="Nuclear fission" OptionsA[6][2]="Hydrogen" OptionsA[7][2]="Windows 98" OptionsA[8][2]="Opera" OptionsB[1][2]="Microprocessors" OptionsB[2][2]="Franklin Delano Roosevelt" OptionsB[3][2]="Howard Philips" OptionsB[4][2]="20 GB" OptionsB[5][2]="Nuclear fusion" OptionsB[6][2]="Helium" OptionsB[7][2]="Windows" OptionsB[8][2]="Chrome" OptionsC[1][2]="Computer software" OptionsC[2][2]="Karel Capek" OptionsC[3][2]="Hewlett-Packard" OptionsC[4][2]="25 GB" OptionsC[5][2]="Cold fusion" OptionsC[6][2]="Uranium" OptionsC[7][2]="Windows 1.0" OptionsC[8][2]="Firefox" GraphicsWindow.DrawBoundText (70,50,560,Pool[g][c]) A[g][c]=Controls.AddButton (OptionsA[g][c],100,200) B[g][c]=Controls.AddButton (OptionsB[g][c],100,340) D[g][c]=Controls.AddButton (OptionsC[g][c],100,480) Answers[1][2]=B[1][2] Answers[2][2]=A[2][2] Answers[3][2]=D[3][2] Answers[4][2]=D[4][2] Answers[5][2]=A[5][2] Answers[6][2]=A[6][2] Answers[7][2]=D[7][2] Answers[8][2]=D[8][2] Controls.ButtonClicked=onButton2Clicked Else 'This is the process that will occur if the answer is not correct Sound.PlayBellRing() 'A bell sounds and a message appears Timer.Pause() 'Timer stops GraphicsWindow.ShowMessage ("Oh, you lost in the first question. You reached the round "+c+"/7","Wrong Answer") GraphicsWindow.Clear() main() Endif Endsub Sub onButton2Clicked If Controls.LastClickedButton=Answers[g][c] Then c=c+1 GraphicsWindow.Clear() h=Math.GetRandomNumber (8) GraphicsWindow.BackgroundColor="blue" GraphicsWindow.DrawRectangle (60,40,580,120) GraphicsWindow.BrushColor="Lightgreen" GraphicsWindow.FillRectangle (60,40,580,120) GraphicsWindow.DrawRectangle (100, 200, 500,100) GraphicsWindow.DrawRectangle (100, 340, 500,100) GraphicsWindow.DrawRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="Lightblue" GraphicsWindow.FillRectangle (100, 200, 500,100) GraphicsWindow.FillRectangle (100, 340, 500,100) GraphicsWindow.FillRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="black" pool[1][3]="What is the name for a popular technology that allows an electronic device to exchange data wirelessly?" pool [2][3]="Which of the following sites is property of Google Inc?" pool [3][3]="Which of the following OS is property of Google Inc.? pool[4][3]="Who designed the first Lightning rod?" pool[5][3]="What is the meaning of AC power?" pool[6][3]="Who invented the first voltaic pile?" pool[7][3]="How many megabytes can we find in a gigabyte?" pool[8][3]="Who patented the phonograph?" OptionsA[1][3]="Microwaves" OptionsA[2][3]="Blogger" OptionsA[3][3]="Linux" OptionsA[4][3]="Benjamin Franklin" OptionsA[5][3]="Actinium" OptionsA[6][3]="James Watt" OptionsA[7][3]="1000" OptionsA[8][3]="Nikola Tesla" OptionsB[1][3]="Router" OptionsB[2][3]="WordPress" OptionsB[3][3]="Ubuntu" OptionsB[4][3]="Akinfiy Demidov" OptionsB[5][3]="Alternating Current" OptionsB[6][3]="Dmitri Mendeleev" OptionsB[7][3]="1024" OptionsB[8][3]="Thomas Edison" OptionsC[1][3]="Wi-Fi" OptionsC[2][3]="Twitter" OptionsC[3][3]="Android" OptionsC[4][3]="William Snow Harris" OptionsC[5][3]="Average current" OptionsC[6][3]="Alessandro Volta" OptionsC[7][3]="1012" OptionsC[8][3]="Alexander Graham Bell" GraphicsWindow.DrawBoundText (70,50,560,Pool[h][c]) A[h][c]=Controls.AddButton (OptionsA[h][c],100,200) B[h][c]=Controls.AddButton (OptionsB[h][c],100,340) D[h][c]=Controls.AddButton (OptionsC[h][c],100,480) Answers[1][3]=D[1][3] Answers[2][3]=A[2][3] Answers[3][3]=D[3][3] Answers[4][3]=A[4][3] Answers[5][3]=B[5][3] Answers[6][3]=D[6][3] Answers[7][3]=B[7][3] Answers[8][3]=B[8][3] Controls.ButtonClicked=onButton3Clicked Else Sound.PlayBellRing() Timer.Pause() GraphicsWindow.ShowMessage ("You reached the round "+c+"/7","Wrong Answer") GraphicsWindow.Clear() main() Endif Endsub Sub onButton3Clicked If Controls.LastClickedButton=Answers[h][c] Then c=c+1 i=Math.GetRandomNumber(8) GraphicsWindow.Clear() GraphicsWindow.BackgroundColor="blue" GraphicsWindow.DrawRectangle (60,40,580,120) GraphicsWindow.BrushColor="Lightgreen" GraphicsWindow.FillRectangle (60,40,580,120) GraphicsWindow.DrawRectangle (100, 200, 500,100) GraphicsWindow.DrawRectangle (100, 340, 500,100) GraphicsWindow.DrawRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="Lightblue" GraphicsWindow.FillRectangle (100, 200, 500,100) GraphicsWindow.FillRectangle (100, 340, 500,100) GraphicsWindow.FillRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="black" pool[1][4]="Which hominid controlled the fire?" pool [2][4]="In which country can we find the headquarters of the aeronautic manufacturer CASA?" pool [3][4]="Which Japanese multinational created the robot ASIMO? pool[4][4]="Which of the following materials consists on a one-atom thick layer of carbon?" pool [5][4]="How many bits are there in a byte?" pool [6][4]="When was CTR, currently known as IBM, created?" pool[7][4]="Which command can be used in Windows for turning off the computer?" pool[8][4]="Which was the first event transmitted by TV?" OptionsA[1][4]="Homo antecessor" OptionsA[2][4]="In France" OptionsA[3][4]="Honda" OptionsA[4][4]="Diamond" OptionsA[5][4]="8" OptionsA[6][4]="1911" OptionsA[7][4]="turnoff" OptionsA[8][4]="The Olympic Games of Berlin" OptionsB[1][4]="Homo habilis" OptionsB[2][4]="In the USA" OptionsB[3][4]="Sony" OptionsB[4][4]="Graphite" OptionsB[5][4]="7" OptionsB[6][4]="1921" OptionsB[7][4]="shutdown/r" OptionsB[8][4]="The investment of Roosevelt" OptionsC[1][4]="Homo erectus" OptionsC[2][4]="In Spain" OptionsC[3][4]="Huawei" OptionsC[4][4]="Graphene" OptionsC[5][4]="9" OptionsC[6][4]="1931" OptionsC[7][4]="shutdown/s" OptionsC[8][4]="A message of the British king" GraphicsWindow.DrawBoundText (70,50,560,Pool[i][c]) A[i][c]=Controls.AddButton (OptionsA[i][c],100,200) B[i][c]=Controls.AddButton (OptionsB[i][c],100,340) D[i][c]=Controls.AddButton (OptionsC[i][c],100,480) Answers[1][4]=D[1][4] Answers[2][4]=D[2][4] Answers[3][4]=A[3][4] Answers[4][4]=D[4][4] Answers[5][4]=A[5][4] Answers[6][4]=A[6][4] Answers[7][4]=D[7][4] Answers[8][4]=A[8][4] Controls.ButtonClicked=onButton4Clicked Else Sound.PlayBellRing() Timer.Pause() GraphicsWindow.ShowMessage ("You reached the round "+c+"/7","Wrong Answer") GraphicsWindow.Clear() main() Endif Endsub Sub onButton4Clicked If Controls.LastClickedButton=Answers[i][c] Then c=c+1 GraphicsWindow.Clear() j=Math.GetRandomNumber(8) GraphicsWindow.DrawRectangle (60,40,580,120) GraphicsWindow.BrushColor="Lightgreen" GraphicsWindow.FillRectangle (60,40,580,120) GraphicsWindow.DrawRectangle (100, 200, 500,100) GraphicsWindow.DrawRectangle (100, 340, 500,100) GraphicsWindow.DrawRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="Lightblue" GraphicsWindow.FillRectangle (100, 200, 500,100) GraphicsWindow.FillRectangle (100, 340, 500,100) GraphicsWindow.FillRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="black" pool[1][5]="Who invented the first steam machine?" pool [2][5]="When was the wheel invented?" pool [3][5]="Which was the name of the evil computer of the film 2001: A Space Odyssey?" pool[4][5]="Which of the following computer games was invented before?" pool[5][5]="Which of the following video game consoles was invented before?" pool[6][5]="Which of the following units stores more information?" pool[7][5]="Which of the following pieces of classical music can be stored (in wav) in just one CD?" pool[8][5]="Which was the name of the first car model produced in mass?" OptionsA[1][5]="Thomas Edison" OptionsA[2][5]="In the Iron Age" OptionsA[3][5]="KITT" OptionsA[4][5]="OXO" OptionsA[5][5]="NES" OptionsA[6][5]="Yobibyte" OptionsA[7][5]="Beethoven's Ninth Symphony" OptionsA[8][5]="Ford Y 8 HP" OptionsB[1][5]="Heron of Alexandria" OptionsB[2][5]="In the Neolithic" OptionsB[3][5]="Alpha-60" OptionsB[4][5]="Tennis for Two" OptionsB[6][5]="Petabyte" OptionsB[5][5]="Mega Drive" OptionsB[7][5]="The Marriage of Figaro by Mozart" OptionsB[8][5]="Ford Model T" OptionsC[1][5]="James Watt" OptionsC[2][5]="In the Bronze Age" OptionsC[3][5]="HAL 9000" OptionsC[4][5]="Spacewar!" OptionsC[5][5]="Fairchild Channel F" OptionsC[6][5]="Tebibyte" OptionsC[7][5]="The Valkyrie by Wagner" OptionsC[8][5]="Ford F-100" GraphicsWindow.DrawBoundText (70,50,560,Pool[j][c]) A[j][c]=Controls.AddButton (OptionsA[j][c],100,200) B[j][c]=Controls.AddButton (OptionsB[j][c],100,340) D[j][c]=Controls.AddButton (OptionsC[j][c],100,480) Controls.ButtonClicked=onButton5Clicked Answers[1][5]=B[1][5] Answers[2][5]=D[2][5] Answers[3][5]=D[3][5] Answers[4][5]=A[4][5] Answers[5][5]=D[5][5] Answers[6][5]=A[6][5] Answers[7][5]=A[7][5] Answers[8][5]=B[8][5] Else Sound.PlayBellRing() Timer.Pause() GraphicsWindow.ShowMessage ("You reached the round "+c+"/7","Wrong answer") GraphicsWindow.Clear() main() Endif Endsub Sub onButton5Clicked If Controls.LastClickedButton=Answers[j][c] Then c=c+1 GraphicsWindow.Clear() k=Math.GetRandomNumber(8) GraphicsWindow.DrawRectangle (60,40,580,120) GraphicsWindow.BrushColor="Lightgreen" GraphicsWindow.FillRectangle (60,40,580,120) GraphicsWindow.DrawRectangle (100, 200, 500,100) GraphicsWindow.DrawRectangle (100, 340, 500,100) GraphicsWindow.DrawRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="Lightblue" GraphicsWindow.FillRectangle (100, 200, 500,100) GraphicsWindow.FillRectangle (100, 340, 500,100) GraphicsWindow.FillRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="black" pool[1][6]="Which was the name of the computer designed for playing chess with Kasparov" pool [2][6]="Which is the name of a project for discovering commercial nuclear fusion?" pool [3][6]="Where was the first atomic bomb detonated?" pool[4][6]="When was the OS Windows created?" pool[5][6]="Who coined the term Robot?" pool[6][6]="Which was the first video game console created by Nintendo?" pool[7][6]="Which was the first melody song by a computer?" pool[8][6]="Who created the programming language C++?" OptionsA[1][6]="RS/6000" OptionsA[2][6]="Manhattan Project" OptionsA[3][6]="Hiroshima" OptionsA[4][6]="1985" OptionsA[5][6]="Gustáv Husák" OptionsA[6][6]="Famicom" OptionsA[7][6]="Stand by me" OptionsA[8][6]="Bjarne Stroustrup" OptionsB[1][6]="Deep Blue" OptionsB[2][6]="Gauss" OptionsB[3][6]="Arizona's desert" OptionsB[4][6]="1986" OptionsB[5][6]="Karel Capek" OptionsB[6][6]="Colour TV Game" OptionsB[7][6]="Daisy Bell" OptionsB[8][6]="Ada Lovelace" OptionsC[1][6]="Deep Thought" OptionsC[2][6]="Iter" OptionsC[3][6]="New Mexico's desert" OptionsC[4][6]="1987" OptionsC[5][6]="Jan Syrový" OptionsC[6][6]="Nintendo Entertainment System" OptionsC[7][6]="The Ninth Symphony" OptionsC[8][6]="Alan Turing" GraphicsWindow.DrawBoundText (70,50,560,Pool[k][c]) A[k][c]=Controls.AddButton (OptionsA[k][c],100,200) B[k][c]=Controls.AddButton (OptionsB[k][c],100,340) D[k][c]=Controls.AddButton (OptionsC[k][c],100,480) Answers[1][6]=B[1][6] Answers[2][6]=D[2][6] Answers[3][6]=D[3][6] Answers[4][6]=A[4][6] Answers[5][6]=B[5][6] Answers[6][6]=B[6][6] Answers[7][6]=B[7][6] Answers[8][6]=A[8][6] Controls.ButtonClicked=onButton6Clicked Else Sound.PlayBellRing() Timer.Pause() GraphicsWindow.ShowMessage ("You reached the round "+c+"/7","Wrong answer") GraphicsWindow.Clear() main() Endif Endsub Sub onButton6Clicked If Controls.LastClickedButton=Answers[k][c] Then c=c+1 GraphicsWindow.Clear() l=math.GetRandomNumber(8) GraphicsWindow.BackgroundColor="blue" GraphicsWindow.DrawRectangle (60,40,580,120) GraphicsWindow.BrushColor="Lightgreen" GraphicsWindow.FillRectangle (60,40,580,120) GraphicsWindow.DrawRectangle (100, 200, 500,100) GraphicsWindow.DrawRectangle (100, 340, 500,100) GraphicsWindow.DrawRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="Lightblue" GraphicsWindow.FillRectangle (100, 200, 500,100) GraphicsWindow.FillRectangle (100, 340, 500,100) GraphicsWindow.FillRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="black" pool[1][7]="According to the Supreme Court of the US, who invented the radio?" pool [2][7]="When was the first alternating current engine invented?" pool [3][7]="Where was the first Edison's research lab built?" pool[4][7]="To which number does the following binary code correspond: 101101?" pool[5][7]="Which was the name of the first tablet computer?" pool[6][7]="Which was the name of the Nazi cipher machine used for encryption?" pool[7][7]="Which was the name of the first commercial cell phone?" pool[8][7]="Which is the name of the most powerful nuclear weapon ever detonated?" OptionsA[1][7]="Guillermo Marconi" OptionsA[2][7]="1882" OptionsA[3][7]="In Menlo Park, New Jersey" OptionsA[4][7]="51" OptionsA[5][7]="Dynabook" OptionsA[6][7]="Typex CT-2000" OptionsA[7][7]="ENIAC" OptionsA[8][7]="Little Boy" OptionsB[1][7]="Thomas Edison" OptionsB[2][7]="1892" OptionsB[3][7]="In Menlo Park, Boston" OptionsB[4][7]="47" OptionsB[5][7]="Motorola Xoom" OptionsB[6][7]="Enigma" OptionsB[7][7]="Qualcomm QCP-2700" OptionsB[8][7]="Lenin's Bomb" OptionsC[1][7]="Nikola Tesla" OptionsC[2][7]="1902" OptionsC[3][7]="In Menlo Park, California" OptionsC[4][7]="45" OptionsC[5][7]="Microsoft Tablet PC" OptionsC[6][7]="Ultra" OptionsC[7][7]="Motorola DynaTAC 8000x" OptionsC[8][7]="Tsar Bomba" GraphicsWindow.DrawBoundText (70,50,560,Pool[l][c]) A[l][c]=Controls.AddButton (OptionsA[l][c],100,200) B[l][c]=Controls.AddButton (OptionsB[l][c],100,340) D[l][c]=Controls.AddButton (OptionsC[l][c],100,480) Controls.ButtonClicked=onButton7Clicked Answers[1][7]=D[1][7] Answers[2][7]=A[2][7] Answers[3][7]=A[3][7] Answers[4][7]=D[4][7] Answers[5][7]=A[5][7] Answers[6][7]=B[6][7] Answers[7][7]=D[7][7] Answers[8][7]=D[8][7] Else Sound.PlayBellRing() Timer.Pause() GraphicsWindow.ShowMessage ("You reached the round "+c+"/7","Wrong answer") GraphicsWindow.Clear() main() Endif Endsub sub onButton7Clicked 'This is the subrutine for the last Normal question If Controls.LastClickedButton=Answers[l][c] Then 'If the answer is correct this will happen Sound.PlayChime() ' A chime sounds Timer.Pause() 'Timer stops GraphicsWindow.Clear() 'An image of a trophy appears win=ImageList.LoadImage (Program.Directory+"\Images\Normal.jpg") GraphicsWindow.DrawresizedImage(win,0,0,700,700) 'And a message appears GraphicsWindow.ShowMessage ("You have completed GoQuiz successfully!","Congratulations") GraphicsWindow.Clear() main() Else 'If the last answer is incorrect: Sound.PlayBellRing() 'A bell rings Timer.Pause() GraphicsWindow.ShowMessage ("Oh, what a pity! GoQuiz was almost done...You reached the round "+c+"/7","Wrong answer") 'And a special message appears GraphicsWindow.Clear() main() EndIf Endsub 'This is the subrutine for the choice of the user in the first Easy question Sub eButtonClicked If Controls.LastClickedButton=Answers[t][s] Then 'This will happen if the option is correct s=s+1 u=math.GetRandomNumber(6) GraphicsWindow.Clear() GraphicsWindow.BackgroundColor="springgreen" GraphicsWindow.DrawRectangle (60,40,580,120) GraphicsWindow.BrushColor="blue" GraphicsWindow.FillRectangle (60,40,580,120) GraphicsWindow.DrawRectangle (100, 200, 500,100) GraphicsWindow.DrawRectangle (100, 340, 500,100) GraphicsWindow.DrawRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="Lightblue" GraphicsWindow.FillRectangle (100, 200, 500,100) GraphicsWindow.FillRectangle (100, 340, 500,100) GraphicsWindow.FillRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="white" pool[1][2]="What is a peripheral?" pool [2][2]="What is the name of the videogame console familily created by Sony?" pool [3][2]="Which of the following is a video editing program?" pool[4][2]="Where did Steve Jobs live?" pool[5][2]="What does OS mean in technology?" pool[6][2]="Which is the name of the OS used in Apple computers?" OptionsA[1][2]="A type of software" OptionsA[2][2]="PlayStation" OptionsA[3][2]="Microsoft Publisher" OptionsA[4][2]="In the UK" OptionsA[5][2]="Operating system" OptionsA[6][2]="Macintosh" OptionsB[1][2]="Device connected to the computer" OptionsB[2][2]="Xbox" OptionsB[3][2]="Adobe Flash" OptionsB[4][2]="In Australia" OptionsB[5][2]="Objective Screen" OptionsB[6][2]="Mac OS" OptionsC[1][2]="A type of external memory" OptionsC[2][2]="Wii" OptionsC[3][2]="Windows Movie Maker" OptionsC[4][2]="In the USA" OptionsC[5][2]="Osmium" OptionsC[6][2]="Windows" GraphicsWindow.DrawBoundText (70,50,560,Pool[u][s]) GraphicsWindow.BrushColor="black" A[u][s]=Controls.AddButton (OptionsA[u][s],100,200) B[u][s]=Controls.AddButton (OptionsB[u][s],100,340) D[u][s]=Controls.AddButton (OptionsC[u][s],100,480) Answers[1][2]=B[1][2] Answers[2][2]=A[2][2] Answers[3][2]=D[3][2] Answers[4][2]=D[4][2] Answers[5][2]=A[5][2] Answers[6][2]=B[6][2] Controls.ButtonClicked=eButton2Clicked Else 'This happens if the choice is wrong Sound.PlayBellRing() 'A bell rings GraphicsWindow.Clear() Timer.Pause() 'Timer stops GraphicsWindow.DrawResizedImage (lost, 0,0,700,700) 'A picture and a message appear GraphicsWindow.ShowMessage ("Oh, you lost in the first question of Easy GoQuiz! You reached the round "+s+"/7","Wrong Answer") GraphicsWindow.Clear() main() Endif Endsub Sub eButton2Clicked If Controls.LastClickedButton=Answers[u][s] Then s=s+1 v=math.GetRandomNumber(6) GraphicsWindow.Clear() GraphicsWindow.BackgroundColor="springgreen" GraphicsWindow.DrawRectangle (60,40,580,120) GraphicsWindow.BrushColor="blue" GraphicsWindow.FillRectangle (60,40,580,120) GraphicsWindow.DrawRectangle (100, 200, 500,100) GraphicsWindow.DrawRectangle (100, 340, 500,100) GraphicsWindow.DrawRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="Lightblue" GraphicsWindow.FillRectangle (100, 200, 500,100) GraphicsWindow.FillRectangle (100, 340, 500,100) GraphicsWindow.FillRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="white" pool[1][3]="What is the part of the the hardware within a computer that carries out the instructions of a computer program?" pool [2][3]="What is the name given to connections without cables?" pool [3][3]="What is the meaning of www in technology?" pool[4][3]="Which is the name of the code for used for representing numbers by using 1 and 0?" pool[5][3]="What is the meaning of CD?" pool[6][3]="What is the name of the optical disc storage format invented in 1995?" OptionsA[1][3]="Central processing unit" OptionsA[2][3]="Cableless" OptionsA[3][3]="What a Wonderful World" OptionsA[4][3]="1/0 code" OptionsA[5][3]="Complete disc" OptionsA[6][3]="DVD" OptionsB[1][3]="Random-access memory" OptionsB[2][3]="Router" OptionsB[3][3]="World Wild Web" OptionsB[4][3]="Binary code" OptionsB[5][3]="Compact disc" OptionsB[6][3]="Walkman" OptionsC[1][3]="OS" OptionsC[2][3]="Wireless" OptionsC[3][3]="World Wide Web" OptionsC[4][3]="Base-0 system" OptionsC[5][3]="Complex disc" OptionsC[6][3]="Blu-Ray" GraphicsWindow.DrawBoundText (70,50,560,Pool[v][s]) GraphicsWindow.BrushColor="black" A[v][s]=Controls.AddButton (OptionsA[v][s],100,200) B[v][s]=Controls.AddButton (OptionsB[v][s],100,340) D[v][s]=Controls.AddButton (OptionsC[v][s],100,480) Answers[1][3]=A[1][3] Answers[2][3]=D[2][3] Answers[3][3]=D[3][3] Answers[4][3]=B[4][3] Answers[5][3]=B[5][3] Answers[6][3]=A[6][3] Controls.ButtonClicked=eButton3Clicked Else 'This will happen if the first choice is incorrect Sound.PlayBellRing() Timer.Pause() GraphicsWindow.Clear() GraphicsWindow.DrawResizedImage (lost, 0,0,700,700) GraphicsWindow.ShowMessage ("You reached the round "+s+"/7","Wrong Answer") GraphicsWindow.Clear() main() Endif Endsub Sub eButton3Clicked If Controls.LastClickedButton=Answers[v][s] Then s=s+1 w=math.GetRandomNumber(6) GraphicsWindow.Clear() GraphicsWindow.BackgroundColor="springgreen" GraphicsWindow.DrawRectangle (60,40,580,120) GraphicsWindow.BrushColor="blue" GraphicsWindow.FillRectangle (60,40,580,120) GraphicsWindow.DrawRectangle (100, 200, 500,100) GraphicsWindow.DrawRectangle (100, 340, 500,100) GraphicsWindow.DrawRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="Lightblue" GraphicsWindow.FillRectangle (100, 200, 500,100) GraphicsWindow.FillRectangle (100, 340, 500,100) GraphicsWindow.FillRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="white" pool[1][4]="Who are the founders of Microsoft?" pool [2][4]="Who founded Apple?" pool [3][4]="Which program is used in Windows for introducing commands?" pool[4][4]="Which of the following objects uses lithium?" pool[5][4]="Which is the limit of characters that an user can use in Twitter?" pool[6][4]="Which of the following programs is a spreadsheet?" OptionsA[1][4]="Bill Gates and Paul Allen" OptionsA[2][4]="Bill Gates and Paul Allen" OptionsA[3][4]="Absolute commander" OptionsA[4][4]="A pen drive" OptionsA[5][4]="130" OptionsA[6][4]="OpenOffice Calc" OptionsB[1][4]="James Caan and Paul Allen" OptionsB[2][4]="James Caan and Bill Gates" OptionsB[3][4]="command.com" OptionsB[4][4]="A regular battery" OptionsB[5][4]="140" OptionsB[6][4]="OpenOffice Writer" OptionsC[1][4]="Bill Gates and Steve Jobs" OptionsC[2][4]="Steve Jobs and Steve Wozniak" OptionsC[3][4]="Command Prompt" OptionsC[4][4]="A computer screen" OptionsC[5][4]="150" OptionsC[6][4]="OpenOffice Base" GraphicsWindow.DrawBoundText (70,50,560,Pool[w][s]) GraphicsWindow.BrushColor="black" A[w][s]=Controls.AddButton (OptionsA[w][s],100,200) B[w][s]=Controls.AddButton (OptionsB[w][s],100,340) D[w][s]=Controls.AddButton (OptionsC[w][s],100,480) Answers[1][4]=A[1][4] Answers[2][4]=D[2][4] Answers[3][4]=D[3][4] Answers[4][4]=B[4][4] Answers[5][4]=B[5][4] Answers[6][4]=A[6][4] Controls.ButtonClicked=eButton4Clicked Else Sound.PlayBellRing() Timer.Pause() GraphicsWindow.Clear() GraphicsWindow.DrawResizedImage (lost, 0,0,700,700) GraphicsWindow.ShowMessage ("You reached the round "+s+"/7","Wrong Answer") GraphicsWindow.Clear() main() Endif Endsub Sub eButton4Clicked If Controls.LastClickedButton=Answers[w][s] Then s=s+1 x=math.GetRandomNumber(6) GraphicsWindow.Clear() GraphicsWindow.BackgroundColor="springgreen" GraphicsWindow.DrawRectangle (60,40,580,120) GraphicsWindow.BrushColor="blue" GraphicsWindow.FillRectangle (60,40,580,120) GraphicsWindow.DrawRectangle (100, 200, 500,100) GraphicsWindow.DrawRectangle (100, 340, 500,100) GraphicsWindow.DrawRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="Lightblue" GraphicsWindow.FillRectangle (100, 200, 500,100) GraphicsWindow.FillRectangle (100, 340, 500,100) GraphicsWindow.FillRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="white" pool[1][5]="What is the main set of products manufactured by Intel?" pool [2][5]="Who invented the mass production?" pool [3][5]="What is the meaning of HP?" pool[4][5]="Which of the following softwares is not an Operating System?" pool[5][5]="What is the meaning of the name of the company LG?" pool[6][5]="Which element is usually used in nuclear fission?" OptionsA[1][5]="Laptops" OptionsA[2][5]="Henry Ford" OptionsA[3][5]="Hewlett-Packard" OptionsA[4][5]="Safari" OptionsA[5][5]="Lawful Good" OptionsA[6][5]="Hydrogen" OptionsB[1][5]="Microprocessors" OptionsB[2][5]="Franklin Delano Roosevelt" OptionsB[3][5]="Howard Philips" OptionsB[4][5]="Linux" OptionsB[5][5]="Life's Great" OptionsB[6][5]="Uranium" OptionsC[1][5]="Computer software" OptionsC[2][5]="Gustave Renault" OptionsC[3][5]="Herbert-Patricks" OptionsC[4][5]="Ubuntu" OptionsC[5][5]="Life's Good" OptionsC[6][5]="Helium" GraphicsWindow.DrawBoundText (70,50,560,Pool[x][s]) GraphicsWindow.BrushColor="black" A[x][s]=Controls.AddButton (OptionsA[x][s],100,200) B[x][s]=Controls.AddButton (OptionsB[x][s],100,340) D[x][s]=Controls.AddButton (OptionsC[x][s],100,480) Answers[1][5]=B[1][5] Answers[2][5]=A[2][5] Answers[3][5]=A[3][5] Answers[4][5]=A[4][5] Answers[5][5]=D[5][5] Answers[6][5]=B[6][5] Controls.ButtonClicked=eButton5Clicked Else Sound.PlayBellRing() Timer.Pause() GraphicsWindow.Clear() GraphicsWindow.DrawResizedImage (lost, 0,0,700,700) GraphicsWindow.ShowMessage ("You reached the round "+s+"/7","Wrong Answer") GraphicsWindow.Clear() main() Endif Endsub Sub eButton5Clicked If Controls.LastClickedButton=Answers[x][s] Then s=s+1 y=math.GetRandomNumber(6) GraphicsWindow.Clear() GraphicsWindow.BackgroundColor="springgreen" GraphicsWindow.DrawRectangle (60,40,580,120) GraphicsWindow.BrushColor="blue" GraphicsWindow.FillRectangle (60,40,580,120) GraphicsWindow.DrawRectangle (100, 200, 500,100) GraphicsWindow.DrawRectangle (100, 340, 500,100) GraphicsWindow.DrawRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="Lightblue" GraphicsWindow.FillRectangle (100, 200, 500,100) GraphicsWindow.FillRectangle (100, 340, 500,100) GraphicsWindow.FillRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="white" pool[1][6]="What is the name for a popular technology that allows an electronic device to exchange data wirelessly?" pool [2][6]="Which of the following sites is property of Google Inc?" pool[3][6]="Who designed the first Lightning rod?" pool[4][6]="What is the meaning of AC power?" pool[5][6]="Who invented the first voltaic pile?" pool[6][6]="Who patented the phonograph?" OptionsA[1][6]="Microwaves" OptionsA[2][6]="Blogger" OptionsA[3][6]="Benjamin Franklin" OptionsA[4][6]="Actinium" OptionsA[5][6]="James Watt" OptionsA[6][6]="Nikola Tesla" OptionsB[1][6]="Router" OptionsB[2][6]="WordPress" OptionsB[3][6]="Akinfiy Demidov" OptionsB[4][6]="Average current" OptionsB[5][6]="Dmitri Mendeleev" OptionsB[6][6]="Thomas Edison" OptionsC[1][6]="Wi-Fi" OptionsC[2][6]="Twitter" OptionsC[3][6]="William Snow Harris" OptionsC[4][6]="Alternating Current" OptionsC[5][6]="Alessandro Volta" OptionsC[6][6]="Guillermo Marconi" GraphicsWindow.DrawBoundText (70,50,560,Pool[y][s]) GraphicsWindow.BrushColor="black" A[y][s]=Controls.AddButton (OptionsA[y][s],100,200) B[y][s]=Controls.AddButton (OptionsB[y][s],100,340) D[y][s]=Controls.AddButton (OptionsC[y][s],100,480) Answers[1][6]=D[1][6] Answers[2][6]=A[2][6] Answers[3][6]=A[3][6] Answers[4][6]=D[4][6] Answers[5][6]=D[5][6] Answers[6][6]=B[6][6] Controls.ButtonClicked=eButton6Clicked Else Sound.PlayBellRing() Timer.Pause() GraphicsWindow.Clear() GraphicsWindow.DrawResizedImage (lost, 0,0,700,700) GraphicsWindow.ShowMessage ("You reached the round "+s+"/7","Wrong Answer") GraphicsWindow.Clear() main() Endif Endsub Sub eButton6Clicked If Controls.LastClickedButton=Answers[y][s] Then s=s+1 z=math.GetRandomNumber(6) GraphicsWindow.Clear() GraphicsWindow.BackgroundColor="springgreen" GraphicsWindow.DrawRectangle (60,40,580,120) GraphicsWindow.BrushColor="blue" GraphicsWindow.FillRectangle (60,40,580,120) GraphicsWindow.DrawRectangle (100, 200, 500,100) GraphicsWindow.DrawRectangle (100, 340, 500,100) GraphicsWindow.DrawRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="Lightblue" GraphicsWindow.FillRectangle (100, 200, 500,100) GraphicsWindow.FillRectangle (100, 340, 500,100) GraphicsWindow.FillRectangle (100, 480, 500,100) GraphicsWindow.BrushColor="white" pool[1][7]="Who was the famous chess champion who played chess with the computer Deep Blue?" pool [2][7]="Which was the name of the American program for discovering the atomic bomb?" pool [3][7]="Where was the first atomic bomb detonated?" pool[4][7]="When was the OS Windows created?" pool[5][7]="Which was the first videogame console created by Nintendo?" pool[6][7]="Which was the first melody song by a computer?" OptionsA[1][7]="Vladimir Ivashko" OptionsA[2][7]="Manhattan Project" OptionsA[3][7]="Hiroshima" OptionsA[4][7]="1985" OptionsA[5][7]="Famicom" OptionsA[6][7]="Viva Las Vegas" OptionsB[1][7]="Garry Kásparov" OptionsB[2][7]="Project Oppenheimer" OptionsB[3][7]="Arizona's desert" OptionsB[4][7]="1986" OptionsB[5][7]="Colour TV Game" OptionsB[6][7]="Daisy Bell" OptionsC[1][7]="Ivan Silayev" OptionsC[2][7]="Iter Project" OptionsC[3][7]="New Mexico's desert" OptionsC[4][7]="1987" OptionsC[5][7]="Nintendo Entertainment System" OptionsC[6][7]="The Ninth Symphony" GraphicsWindow.DrawBoundText (70,50,560,Pool[z][s]) GraphicsWindow.BrushColor="black" A[z][s]=Controls.AddButton (OptionsA[z][s],100,200) B[z][s]=Controls.AddButton (OptionsB[z][s],100,340) D[z][s]=Controls.AddButton (OptionsC[z][s],100,480) Answers[1][7]=B[1][7] Answers[2][7]=A[2][7] Answers[3][7]=D[3][7] Answers[4][7]=A[4][7] Answers[5][7]=B[5][7] Answers[6][7]=B[6][7] Controls.ButtonClicked=eButton7Clicked Else Sound.PlayBellRing() GraphicsWindow.Clear() GraphicsWindow.DrawResizedImage (lost, 0,0,700,700) GraphicsWindow.ShowMessage ("You reached the round "+s+"/7","Wrong Answer") GraphicsWindow.Clear() main() Endif Endsub sub eButton7Clicked 'This is the subrutine for the last Easy question If Controls.LastClickedButton=Answers[z][s] Then 'If the answer is correct: Sound.PlayChime() 'A chime sounds Timer.Pause() GraphicsWindow.Clear() GraphicsWindow.BackgroundColor="white" vict=ImageList.LoadImage (Program.Directory+"\Images\Easy.jpg") GraphicsWindow.DrawresizedImage (vict,210,100, 300, 500) 'An image of a trophy and a message appear GraphicsWindow.ShowMessage ("You have completed Easy GoQuiz successfully! Now you are ready to try the Normal GoQuiz!","Congratulations") GraphicsWindow.Clear() main() Else 'If the answer is not correct Sound.PlayBellRing() 'A bell rings Timer.Pause() 'The timer stops GraphicsWindow.Clear() GraphicsWindow.DrawResizedImage (lost, 0,0,700,700) 'An image and a special message appear GraphicsWindow.ShowMessage ("Oh, what a pity! Easy GoQniz was almost done...You reached the round "+c+"/7","Wrong answer") GraphicsWindow.Clear() main() EndIf Endsub 'And GoQuiz is done! End>GQC905.sb< Start>GQF135-0.sb< ' Kitchen Timer 0.2b ' Copyright © 2014-2015 Nonki Takahashi. The MIT License. ' Last update 2015-07-14 ' Program ID GQF135-0 ' gw = 598 gh = 428 WQ = Text.GetCharacter(34) Not = "False=True;True=False;" title = "Kitchen Timer 0.2b" GraphicsWindow.Title = title DrawKitchenTimer() AddMinuteHand() MouseInit() TimerInit() While "True" If mouseDown Then CheckOnHand() If isOnHand Then Timer.Pause() mouseUp = "False" While Not[mouseUp] If mouseMove Then x = mx - gw / 2 y = my - gh / 2 Math_CartesianToPolar() a = a - da + 90 Shapes.Rotate(hand, a) m = Math.Remainder(a / 360 * 60, 60) ShowTitle() Timer.Resume() mouseMove = "False" EndIf EndWhile mouseUp = "False" EndIf mouseDown = "False" EndIf EndWhile Sub ShowTitle ' param m - minutes If 0 < m Then min = Math.Floor(m) sec = Math.Floor(Math.Remainder(m, 1) * 60) GraphicsWindow.Title = title + " - " + min + "'" + sec + WQ Else GraphicsWindow.Title = title EndIf EndSub Sub DrawKitchenTimer size = 300 GraphicsWindow.BackgroundColor = "SkyBlue" x = (gw - size) / 2 y = (gh - size) / 2 GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle(x, y, size, size) x = (gw - size * 0.9) / 2 y = (gh - size * 0.9) / 2 GraphicsWindow.BrushColor = "SkyBlue" GraphicsWindow.FillEllipse(x, y, size * 0.9, size * 0.9) x = (gw - size * 0.7) / 2 y = (gh - size * 0.7) / 2 GraphicsWindow.BrushColor = "White" GraphicsWindow.FillEllipse(x, y, size * 0.7, size * 0.7) r2 = size * 0.9 / 2 GraphicsWindow.PenColor = "LightGray" For m = 0 To 59 If Math.Remainder(m, 10) = 0 Then r1 = size * 0.7 / 2 Else r1 = size * 0.8 / 2 EndIf _a = Math.GetRadians(m * 360 / 60) x1 = gw / 2 + r1 * Math.Sin(_a) y1 = gh / 2 + r1 * Math.Cos(_a) x2 = gw / 2 + r2 * Math.Sin(_a) y2 = gh / 2 + r2 * Math.Cos(_a) GraphicsWindow.DrawLine(x1, y1, x2, y2) EndFor EndSub Sub AddMinuteHand x1 = 0 y1 = size * 0.9 x2 = size * 0.1 y2 = 0 x3 = size * 0.2 y3 = size * 0.9 GraphicsWindow.PenColor = "LightGray" GraphicsWindow.BrushColor = "White" hand = Shapes.AddTriangle(x1, y1, x2, y2, x3, y3) Shapes.Move(hand, gw / 2 - size * 0.1, gh / 2 - size * 0.45) EndSub Sub CheckOnHand isOnHand = "False" x = mx - gw / 2 y = my - gh / 2 Math_CartesianToPolar() a = a + 90 If 360 <= a Then a = a - 360 EndIf ah = m * 360 / 60 cosDa = Math.Cos(Math.GetRadians(a - ah)) hh = y1 / 2 - r * cosDa wh = hh * (x2 / 2) / (y1 / 2) wd = r * Math.Abs(Math.Sin(Math.GetRadians(a - ah))) If (r <= y1 / 2) And (0 <= cosDa) And (wd <= wh) Then da = a - ah isOnHand = "True" EndIf EndSub Sub TimerInit Timer.Interval = 500 Timer.Tick = OnTick Timer.Pause() m = 0 EndSub Sub OnTick If 0 < m Then m = m - 0.5 / 60 a = m * 360 / 60 Shapes.Rotate(hand, a) ShowTitle() If min = 0 And sec = 0 Then Timer.Pause() Sound.PlayBellRing() EndIf EndIf EndSub Sub MouseInit mouseMove = "False" mouseDown = "False" mouseUp = "False" GraphicsWindow.MouseMove = OnMouseMove GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseUp = OnMouseUp EndSub Sub OnMouseMove mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY mouseMove = "True" EndSub Sub OnMouseDown mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY mouseDown = "True" EndSub Sub OnMouseUp mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY mouseUp = "True" EndSub Sub Math_CartesianToPolar ' Math | convert cartesian coodinate to polar coordinate ' param x, y - cartesian coordinate ' return r, a - polar coordinate r = Math.SquareRoot(x * x + y * y) If x = 0 And y > 0 Then a = 90 ' [degree] ElseIf x = 0 And y < 0 Then a = -90 Else a = Math.ArcTan(y / x) * 180 / Math.Pi EndIf If x < 0 Then a = a + 180 ElseIf x >= 0 And y < 0 Then a = a + 360 EndIf EndSub End>GQF135-0.sb< Start>GQF135-6.sb< ' Kitchen Timer 0.6b ' Copyright © 2014-2015 Nonki Takahashi. The MIT License. ' Last update 2015-07-14 ' Program ID GQF135-6 ' title = "Kitchen Timer 0.6b" GraphicsWindow.Title = title WQ = Text.GetCharacter(34) Not = "False=True;True=False;" If Text.GetLength(GraphicsWindow.GetPixel(0, 0)) = 9 Then silverlight = "True" Else silverlight = "False" EndIf gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh DrawKitchenTimer() AddMinuteHand() MouseInit() TimerInit() While "True" If mouseDown Then CheckOnHand() If isOnHand Then Timer.Pause() mouseUp = "False" While Not[mouseUp] If mouseMove Then x = mx - gw / 2 y = my - gh / 2 Math_CartesianToPolar() a = a - da + 90 Shapes.Rotate(hand, a) AdjustMinuteHand() m = Math.Remainder(a / 360 * 60, 60) ShowTitle() Timer.Resume() mouseMove = "False" EndIf Program.Delay(50) EndWhile mouseUp = "False" EndIf mouseDown = "False" EndIf Program.Delay(50) EndWhile Sub AdjustMinuteHand If silverlight Then _a = Math.GetRadians(a) _cx = cx * Math.Cos(_a) - cy * Math.Sin(_a) _cy = cx * Math.Sin(_a) + cy * Math.Cos(_a) _ox = ox - (_cx - cx) _oy = oy - (_cy - cy) Shapes.Move(hand, _ox, _oy) EndIf EndSub Sub ShowTitle ' param m - minutes If 0 < m Then min = Math.Floor(m) sec = Math.Floor(Math.Remainder(m, 1) * 60) GraphicsWindow.Title = title + " - " + min + "'" + sec + WQ Else GraphicsWindow.Title = title EndIf EndSub Sub DrawKitchenTimer size = 300 GraphicsWindow.BackgroundColor = "SkyBlue" x = (gw - size) / 2 y = (gh - size) / 2 GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle(x, y, size, size) x = (gw - size * 0.9) / 2 y = (gh - size * 0.9) / 2 GraphicsWindow.BrushColor = "SkyBlue" GraphicsWindow.FillEllipse(x, y, size * 0.9, size * 0.9) x = (gw - size * 0.7) / 2 y = (gh - size * 0.7) / 2 GraphicsWindow.BrushColor = "White" GraphicsWindow.FillEllipse(x, y, size * 0.7, size * 0.7) r2 = size * 0.9 / 2 GraphicsWindow.PenColor = "LightGray" For m = 0 To 59 If Math.Remainder(m, 10) = 0 Then r1 = size * 0.7 / 2 Else r1 = size * 0.8 / 2 EndIf _a = Math.GetRadians(m * 360 / 60) x1 = gw / 2 + r1 * Math.Sin(_a) y1 = gh / 2 + r1 * Math.Cos(_a) x2 = gw / 2 + r2 * Math.Sin(_a) y2 = gh / 2 + r2 * Math.Cos(_a) GraphicsWindow.DrawLine(x1, y1, x2, y2) EndFor EndSub Sub AddMinuteHand x1 = 0 y1 = size * 0.9 x2 = size * 0.1 y2 = 0 x3 = size * 0.2 y3 = size * 0.9 GraphicsWindow.PenColor = "LightGray" GraphicsWindow.BrushColor = "White" hand = Shapes.AddTriangle(x1, y1, x2, y2, x3, y3) cx = x2 / 2 cy = y1 / 2 ox = gw / 2 - size * 0.1 oy = gh / 2 - size * 0.45 Shapes.Move(hand, ox, oy) EndSub Sub CheckOnHand isOnHand = "False" x = mx - gw / 2 y = my - gh / 2 Math_CartesianToPolar() a = a + 90 If 360 <= a Then a = a - 360 EndIf ah = m * 360 / 60 cosDa = Math.Cos(Math.GetRadians(a - ah)) hh = y1 / 2 - r * cosDa wh = hh * (x2 / 2) / (y1 / 2) wd = r * Math.Abs(Math.Sin(Math.GetRadians(a - ah))) If (r <= y1 / 2) And (0 <= cosDa) And (wd <= wh) Then da = a - ah isOnHand = "True" EndIf EndSub Sub TimerInit Timer.Interval = 500 Timer.Tick = OnTick Timer.Pause() m = 0 EndSub Sub OnTick If 0 < m Then m = m - 0.5 / 60 a = m * 360 / 60 Shapes.Rotate(hand, a) AdjustMinuteHand() ShowTitle() If min = 0 And sec = 0 Then Timer.Pause() Sound.PlayBellRing() EndIf EndIf EndSub Sub MouseInit mouseMove = "False" mouseDown = "False" mouseUp = "False" GraphicsWindow.MouseMove = OnMouseMove GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseUp = OnMouseUp EndSub Sub OnMouseMove mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY mouseMove = "True" EndSub Sub OnMouseDown mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY mouseDown = "True" EndSub Sub OnMouseUp mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY mouseUp = "True" EndSub Sub Math_CartesianToPolar ' Math | convert cartesian coodinate to polar coordinate ' param x, y - cartesian coordinate ' return r, a - polar coordinate r = Math.SquareRoot(x * x + y * y) If x = 0 And y > 0 Then a = 90 ' [degree] ElseIf x = 0 And y < 0 Then a = -90 Else a = Math.ArcTan(y / x) * 180 / Math.Pi EndIf If x < 0 Then a = a + 180 ElseIf x >= 0 And y < 0 Then a = a + 360 EndIf EndSub End>GQF135-6.sb< Start>GQF135.sb< ' Kitchen Timer 0.1a ' Copyright (c) 2014 Nonki Takahashi. The MIT License. ' gw = 598 gh = 428 GraphicsWindow.Title = "Kitchen Timer 0.1a" DrawKitchenTimer() AddMinuteHand() StartTimer() Sub DrawKitchenTimer size = 300 GraphicsWindow.BackgroundColor = "SkyBlue" x = (gw - size) / 2 y = (gh - size) / 2 GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle(x, y, size, size) x = (gw - size * 0.9) / 2 y = (gh - size * 0.9) / 2 GraphicsWindow.BrushColor = "SkyBlue" GraphicsWindow.FillEllipse(x, y, size * 0.9, size * 0.9) x = (gw - size * 0.7) / 2 y = (gh - size * 0.7) / 2 GraphicsWindow.BrushColor = "White" GraphicsWindow.FillEllipse(x, y, size * 0.7, size * 0.7) r2 = size * 0.9 / 2 GraphicsWindow.PenColor = "LightGray" For m = 0 To 59 If Math.Remainder(m, 10) = 0 Then r1 = size * 0.7 / 2 Else r1 = size * 0.8 / 2 EndIf _a = Math.GetRadians(m * 360 / 60) x1 = gw / 2 + r1 * Math.Sin(_a) y1 = gh / 2 + r1 * Math.Cos(_a) x2 = gw / 2 + r2 * Math.Sin(_a) y2 = gh / 2 + r2 * Math.Cos(_a) GraphicsWindow.DrawLine(x1, y1, x2, y2) EndFor EndSub Sub AddMinuteHand x1 = 0 y1 = size * 0.9 x2 = size * 0.1 y2 = 0 x3 = size * 0.2 y3 = size * 0.9 GraphicsWindow.PenColor = "LightGray" GraphicsWindow.BrushColor = "White" hand = Shapes.AddTriangle(x1, y1, x2, y2, x3, y3) Shapes.Move(hand, gw / 2 - size * 0.1, gh / 2 - size * 0.45) EndSub Sub StartTimer Timer.Interval = 500 Timer.Tick = OnTick m = 3 EndSub Sub OnTick If 0 < m Then m = m - 0.5 / 60 a = m * 360 / 60 Shapes.Rotate(hand, a) Else Timer.Pause() Sound.PlayBellRing() EndIf EndSub End>GQF135.sb< Start>GQG962.sb< sc=4580 'students code pc=7230 'principaal code tc=2048 'teacher code pt[1]=1111 'karamee pt[2]=2222 'naderee pt[3]=3333 'mosavee pt[4]=4444 ' heidaree pt[5]=5555 '"amerian pt[6]=6666 '"hosseinee pt[7]=7777 '"dastafkan pt[8]=8888 '"abedian pt[9]=9999 '"arabameree pt[10]=10101010 '"tofighee pt[11]=11111111 '"karimee pt[12]=12121212 '"dahaee pt[13]=13131313 'norozi pt[14]=14141414 'akbary pt[15]=15151515 'shokohee data() run() Sub run TextWindow.ForegroundColor="gray" TextWindow.Write("enter number students : ") n=TextWindow.ReadNumber() If n > (Array.GetItemCount(name)*Array.GetItemCount(family)) Then n=(Array.GetItemCount(name)*Array.GetItemCount(family)) EndIf TextWindow.Write("enter your access code : ") a1=TextWindow.ReadNumber() If a1=pc then write() search() elseif a1=sc then write2() pass() Elseif a1=pt[1] then If n >= 40 then n=40 EndIf rg=1 write3() search() Elseif a1=pt[2] then If n >= 40 then n=40 EndIf rg=2 write3() search() Elseif a1=pt[3] then If n >= 40 then n=40 EndIf rg=3 write3() search() Elseif a1=pt[4] then If n >= 40 then n=40 EndIf rg=4 write3() search() Elseif a1=pt[5] then If n >= 40 then n=40 EndIf rg=5 write3() search() Elseif a1=pt[6] then If n >= 40 then n=40 EndIf rg=6 write3() search() Elseif a1=pt[7] then If n >= 40 then n=40 EndIf rg=7 write3() search() Elseif a1=pt[8] then If n >= 40 then n=40 EndIf rg=8 write3() search() Elseif a1=pt[9] then If n >= 40 then n=40 EndIf rg=9 write3() search() Elseif a1=pt[10] then If n >= 40 then n=40 EndIf rg=10 write3() search() Elseif a1=pt[11] then If n >= 40 then n=40 EndIf rg=11 write3() search() Elseif a1=pt[12] then If n >= 40 then n=40 EndIf rg=12 write3() search() Elseif a1=pt[13] then If n >= 40 then n=40 EndIf rg=13 write3() search() Elseif a1=pt[14] then If n >= 40 then n=40 EndIf rg=14 write3() search() Elseif a1=pt[15] then If n >= 40 then n=40 EndIf rg=15 write3() search() Else run() endif EndSub Sub write3 r1=Math.GetRandomNumber(Array.GetItemCount(name)) r2=Math.GetRandomNumber(Array.GetItemCount(family)) TextWindow.ForegroundColor="green" TextWindow.WriteLine("") students[1][1]=name[r1][1] students[1][2]=family[r2] students[1][3]=name[r1][2] TextWindow.Write(" name ") TextWindow.CursorLeft=23 TextWindow.Write("family") TextWindow.CursorLeft=42 TextWindow.Write("gender") TextWindow.CursorLeft=55 TextWindow.Write("GPA") TextWindow.CursorLeft=72 TextWindow.WriteLine("class") p2[1]=1 darsada=0 darsadc=0 For i=2 To n p[i]=i stamt: w=i-1 r1=Math.GetRandomNumber(Array.GetItemCount(name)) r2=Math.GetRandomNumber(Array.GetItemCount(family)) While w > 0 If name[r1][1] <> students[w][1] Or family[r2] <> students[w][2] Then w=w-1 Else Goto stamt EndIf EndWhile ''aaaaaaaa students[i][1]=name[r1][1] students[i][2]=family[r2] students[i][3]=name[r1][2] students[i][4]=rg EndFor 'asdsdsssssssssssss For j = 1 To n-1 For i = j+1 To n If moadel[j] < moadel[i] Then l5=moadel[j] moadel[j]=moadel[i] moadel[i]=l5 m15=student[j][1] student[j][1]=student[i][1] student[i][1]=m15 m16=student[j][2] student[j][2]=student[i][2] student[i][2]=m16 m17=student[j][3] student[j][3]=student[i][3] student[i][3]=m17 EndIf EndFor EndFor ' m18=student[j][4] ' student[j][4]=student[i][4] ' student[i][4]=m18 d=1 TextWindow.ForegroundColor="yellow" TextWindow.Write( d+"." +" "+students[1][1]) student[1][8][1]=d TextWindow.CursorLeft=23 TextWindow.Write(students[1][2]) TextWindow.CursorLeft=42 TextWindow.Write(students[1][3]) TextWindow.CursorLeft=55 TextWindow.Write(moadel[1]) TextWindow.CursorLeft=75 TextWindow.ForegroundColor="blue" TextWindow.Write(rg) If moadel[1]>= k Then TextWindow.ForegroundColor="green " TextWindow.CursorLeft=60 TextWindow.WriteLine(" Accepted ") darsada=darsada+1 Else TextWindow.ForegroundColor="red" TextWindow.CursorLeft=60 TextWindow.WriteLine(" Castaway ") darsadc=darsadc+1 EndIf For i= 2 To n d=d+1 If Math.Remainder(i,2)=0 Then TextWindow.ForegroundColor="gray" Else TextWindow.ForegroundColor="yellow" EndIf TextWindow.CursorLeft=0 TextWindow.Write(d+"."+" "+students[i][1]) student[1][8][i]=d TextWindow.CursorLeft=23 TextWindow.Write(students[i][2]) TextWindow.CursorLeft=42 TextWindow.Write(students[i][3]) TextWindow.CursorLeft=55 TextWindow.Write(moadel[i]) TextWindow.CursorLeft=60 If moadel[i] >= k Then TextWindow.ForegroundColor="green" TextWindow.Write(" Accepted ") darsada=darsada+1 Else TextWindow.ForegroundColor="red" TextWindow.Write(" Castaway ") darsadc=darsadc+1 EndIf TextWindow.ForegroundColor="blue" TextWindow.CursorLeft=75 TextWindow.WriteLine(students[i][4]) EndFor class44=d ac=darsada+darsadc ac=100/ac darsada=Math.Round(darsada*ac*100)/100 darsadc=Math.Round(darsadc*ac*100)/100 TextWindow.ForegroundColor="green" TextWindow.WriteLine("") TextWindow.WriteLine("accepted :"+darsada+"%") TextWindow.WriteLine("") TextWindow.ForegroundColor="red" TextWindow.WriteLine("castway :"+darsadc+"%") TextWindow.WriteLine("") TextWindow.ForegroundColor="magenta" TextWindow.WriteLine("1.search ") TextWindow.WriteLine("2. restart program ") TextWindow.WriteLine("3.exit ") TextWindow.Write("enter Operation code : ") m4=TextWindow.ReadNumber() TextWindow.ForegroundColor="black" If m4="3" Then Program.End() ElseIf m4="1" then TextWindow.WriteLine("") search() ElseIf m4="2" then TextWindow.Clear() run() EndIf EndSub Sub pass TextWindow.WriteLine("") TextWindow.ForegroundColor="blue" TextWindow.Write("enter name : ") TextWindow.ForegroundColor="gray" s2=TextWindow.Read() TextWindow.WriteLine("") TextWindow.Write("enter password : ") p1=TextWindow.ReadNumber() d3=0 For i=1 To n If s2 = students[i][1] + students[i][2] And p1=students[i][5] Then d3=1 j=i Goto out EndIf If s2 = students[i][1] + students[i][2] And p1=p2[i] Then d3=1 j=i Goto out Else d3=-1 EndIf EndFor out: If d3 > 0 Then ' TextWindow.Clear() TextWindow.WriteLine("") TextWindow.CursorLeft=5 TextWindow.Write("first name : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=20 TextWindow.Write(students[j][1]) TextWindow.CursorLeft=40 TextWindow.ForegroundColor="gray" TextWindow.Write("GPU : ") TextWindow.ForegroundColor="yellow" TextWindow.Write(moadel[j]) TextWindow.CursorLeft=50 If moadel[j]>= k Then TextWindow.ForegroundColor="green " TextWindow.WriteLine(" Accepted ") Else TextWindow.ForegroundColor="red" TextWindow.WriteLine(" Castaway ") EndIf TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=5 TextWindow.Write("last name : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=20 TextWindow.Write(students[j][2]) TextWindow.CursorLeft=40 TextWindow.ForegroundColor="gray" TextWindow.Write("class ") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine(students[j][4]) TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=5 TextWindow.Write("Gender : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=20 TextWindow.WriteLine(students[j][3]) TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=40 TextWindow.Write("The number of class members : ") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine(class[students[j][4]]) TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=5 TextWindow.Write("DOB : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=20 TextWindow.WriteLine(data[j][1]) TextWindow.WriteLine("") TextWindow.CursorLeft=40 TextWindow.ForegroundColor="gray" TextWindow.WriteLine("Partial scores : ") TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=40 TextWindow.Write("math : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=57 TextWindow.Write(dars[j][1]) TextWindow.CursorLeft=62 if dars[j][1] >= k Then TextWindow.ForegroundColor="green" TextWindow.WriteLine("accepted") Else TextWindow.ForegroundColor="red" TextWindow.WriteLine("Castaway") EndIf TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=40 TextWindow.Write("Geometry : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=57 TextWindow.Write(dars[j][2]) TextWindow.CursorLeft=62 if dars[j][2] >= k Then TextWindow.ForegroundColor="green" TextWindow.WriteLine("accepted") Else TextWindow.ForegroundColor="red" TextWindow.WriteLine("Castaway") EndIf TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=40 TextWindow.Write("Geography : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=57 TextWindow.Write(dars[j][3]) TextWindow.CursorLeft=62 if dars[j][3] >= k Then TextWindow.ForegroundColor="green" TextWindow.WriteLine("accepted") Else TextWindow.ForegroundColor="red" TextWindow.WriteLine("Castaway") EndIf TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=40 TextWindow.Write("arabic : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=57 TextWindow.Write(dars[j][4]) TextWindow.CursorLeft=62 if dars[j][4] >= k Then TextWindow.ForegroundColor="green" TextWindow.WriteLine("accepted") Else TextWindow.ForegroundColor="red" TextWindow.WriteLine("Castaway") EndIf TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=40 TextWindow.Write("Physics : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=57 TextWindow.Write(dars[j][5]) TextWindow.CursorLeft=62 if dars[j][5] >= k Then TextWindow.ForegroundColor="green" TextWindow.WriteLine("accepted") Else TextWindow.ForegroundColor="red" TextWindow.WriteLine("Castaway") EndIf TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=40 TextWindow.Write("Chemistry : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=57 TextWindow.Write(dars[j][6]) TextWindow.CursorLeft=62 if dars[j][6] >= k Then TextWindow.ForegroundColor="green" TextWindow.WriteLine("accepted") Else TextWindow.ForegroundColor="red" TextWindow.WriteLine("Castaway") EndIf TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=40 TextWindow.Write("Statistics : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=57 TextWindow.Write(dars[j][7]) TextWindow.CursorLeft=62 if dars[j][7] >= k Then TextWindow.ForegroundColor="green" TextWindow.WriteLine("accepted") Else TextWindow.ForegroundColor="red" TextWindow.WriteLine("Castaway") EndIf TextWindow.CursorLeft=5 TextWindow.ForegroundColor="gray" TextWindow.Write("Teacher : ") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine(teacher[students[j][4]]) TextWindow.WriteLine("") TextWindow.ForegroundColor="magenta" TextWindow.WriteLine("1.search again ") TextWindow.WriteLine("2. restart program ") TextWindow.WriteLine("3.exit ") TextWindow.Write("enter Operation code : ") m1=TextWindow.ReadNumber() TextWindow.ForegroundColor="black" If m1="3" Then Program.End() ElseIf m1="1" then TextWindow.WriteLine("") pass() ElseIf m1="2" then TextWindow.Clear() run() EndIf Else TextWindow.WriteLine("is not available") pass() EndIf EndSub Sub write2 r1=Math.GetRandomNumber(Array.GetItemCount(name)) r2=Math.GetRandomNumber(Array.GetItemCount(family)) TextWindow.ForegroundColor="green" TextWindow.WriteLine("") students[1][1]=name[r1][1] students[1][2]=family[r2] students[1][3]=name[r1][2] students[1][5]=pt[1] TextWindow.Write(" name ") TextWindow.CursorLeft=23 TextWindow.Write("family") TextWindow.CursorLeft=42 TextWindow.Write("gender") TextWindow.CursorLeft=52 TextWindow.WriteLine("class") d=1 p2[1]=d r=1 class[1]=1 students[1][4]=class[1] For i = 2 To 11 class[i]=0 EndFor TextWindow.ForegroundColor="yellow" TextWindow.Write( d+"." +" "+students[1][1]) TextWindow.CursorLeft=23 TextWindow.Write(students[1][2]) TextWindow.CursorLeft=42 TextWindow.Write(students[1][3]) TextWindow.CursorLeft=52 TextWindow.WriteLine(students[1][4]) For i=2 To n p2[i]=i If Math.Remainder(i,2)=0 Then TextWindow.ForegroundColor="gray" Else TextWindow.ForegroundColor="yellow" EndIf start: w=i-1 r1=Math.GetRandomNumber(Array.GetItemCount(name)) r2=Math.GetRandomNumber(Array.GetItemCount(family)) While w > 0 If name[r1][1] <> students[w][1] Or family[r2] <> students[w][2] Then w=w-1 Else Goto start EndIf EndWhile d=d+1 n1=25 n2=86 n3=145 n4=210 n5=268 n6=329 n7=390 n8=442 If d < n1 Then r=1 ElseIf d >=n1 and d <61 then r=2 Elseif d >=61 and d =n2 and d <121 then r=4 Elseif d >=121 and d =n3 and d <181 then r=6 Elseif d >=181 and d =n4 and d <241 then r=8 Elseif d >=241 and d =n5 and d <301 then r=10 Elseif d >=301 and d =n6 and d <361 then r=12 Elseif d >=361 and d =n7 and d <421 then r=14 Elseif d >=421 and d 0 Then TextWindow.WriteLine("") TextWindow.CursorLeft=5 TextWindow.Write("first name : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=20 TextWindow.Write(students[i][1]) TextWindow.CursorLeft=40 TextWindow.ForegroundColor="gray" TextWindow.Write("GPU : ") TextWindow.ForegroundColor="yellow" TextWindow.Write(moadel[i]) TextWindow.CursorLeft=50 If moadel[i]>= k Then TextWindow.ForegroundColor="green " TextWindow.WriteLine(" Accepted ") Else TextWindow.ForegroundColor="red" TextWindow.WriteLine(" Castaway ") EndIf TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=5 TextWindow.Write("last name : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=20 TextWindow.Write(students[i][2]) TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=40 TextWindow.Write("class ") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine(students[i][4]) TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=5 TextWindow.Write("Gender : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=20 TextWindow.WriteLine(students[i][3]) TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=5 TextWindow.Write("DOB : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=20 TextWindow.WriteLine(data[i][1]) TextWindow.WriteLine("") TextWindow.CursorLeft=40 TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=40 TextWindow.Write("The number of class members : ") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine(class44) TextWindow.WriteLine("") TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=40 TextWindow.Write("rotbeh : ") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine(student[1][8][i]) TextWindow.CursorLeft=40 TextWindow.ForegroundColor="gray" TextWindow.WriteLine("Partial scores : ") TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=40 TextWindow.Write("math : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=57 TextWindow.Write(dars[i][1]) TextWindow.CursorLeft=63 if dars[i][1] >= k Then TextWindow.ForegroundColor="green" TextWindow.WriteLine("accepted") Else TextWindow.ForegroundColor="red" TextWindow.WriteLine("Castaway") EndIf TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=40 TextWindow.Write("Geometry : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=57 TextWindow.Write(dars[i][2]) TextWindow.CursorLeft=63 if dars[i][2] >= k Then TextWindow.ForegroundColor="green" TextWindow.WriteLine("accepted") Else TextWindow.ForegroundColor="red" TextWindow.WriteLine("Castaway") EndIf TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=40 TextWindow.Write("arabic : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=57 TextWindow.Write(dars[i][3]) TextWindow.CursorLeft=63 if dars[i][3] >= k Then TextWindow.ForegroundColor="green" TextWindow.WriteLine("accepted") Else TextWindow.ForegroundColor="red" TextWindow.WriteLine("Castaway") EndIf TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=40 TextWindow.Write("Physics : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=57 TextWindow.Write(dars[i][4]) TextWindow.CursorLeft=63 if dars[i][4] >= k Then TextWindow.ForegroundColor="green" TextWindow.WriteLine("accepted") Else TextWindow.ForegroundColor="red" TextWindow.WriteLine("Castaway") EndIf TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=40 TextWindow.Write("Chemistry : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=57 TextWindow.Write(dars[i][5]) TextWindow.CursorLeft=63 if dars[i][5] >= k Then TextWindow.ForegroundColor="green" TextWindow.WriteLine("accepted") Else TextWindow.ForegroundColor="red" TextWindow.WriteLine("Castaway") EndIf TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=40 TextWindow.Write("Statistics : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=57 TextWindow.Write(dars[i][6]) TextWindow.CursorLeft=63 if dars[i][6] >= k Then TextWindow.ForegroundColor="green" TextWindow.WriteLine("accepted") Else TextWindow.ForegroundColor="red" TextWindow.WriteLine("Castaway") EndIf TextWindow.ForegroundColor="gray" TextWindow.CursorLeft=40 TextWindow.Write("Geography : ") TextWindow.ForegroundColor="yellow" TextWindow.CursorLeft=57 TextWindow.Write(dars[i][7]) TextWindow.CursorLeft=63 if dars[i][7] >= k Then TextWindow.ForegroundColor="green" TextWindow.WriteLine("accepted") Else TextWindow.ForegroundColor="red" TextWindow.WriteLine("Castaway") EndIf TextWindow.ForegroundColor="gray" TextWindow.Write("Teacher : ") TextWindow.ForegroundColor="yellow" TextWindow.WriteLine(teacher[students[i][4]]) TextWindow.WriteLine("") TextWindow.ForegroundColor="magenta" TextWindow.WriteLine("1.search again") TextWindow.WriteLine("2.restart program") TextWindow.WriteLine("3.exit ") TextWindow.WriteLine("") TextWindow.ForegroundColor="gray" TextWindow.Write("enter Operation code : ") m2=TextWindow.ReadNumber() If m2="3" Then Program.End() ElseIf m2="1" then TextWindow.WriteLine("") search() ElseIf m2="2" then TextWindow.Clear() run() EndIf TextWindow.ForegroundColor="black" ElseIf d2 < 0 then TextWindow.WriteLine("is not available") search() EndIf EndSub Sub write r1=Math.GetRandomNumber(Array.GetItemCount(name)) r2=Math.GetRandomNumber(Array.GetItemCount(family)) TextWindow.ForegroundColor="green" TextWindow.WriteLine("") students[1][1]=name[r1][1] students[1][2]=family[r2] students[1][3]=name[r1][2] TextWindow.Write(" name ") TextWindow.CursorLeft=23 TextWindow.Write("family") TextWindow.CursorLeft=42 TextWindow.Write("gender") TextWindow.CursorLeft=55 TextWindow.Write("GPA") TextWindow.CursorLeft=72 TextWindow.WriteLine("class") d=1 p2[1]=1 darsada=0 darsadc=0 classs[1]=1 For i = 2 To 11 classs[i]=0 EndFor TextWindow.ForegroundColor="yellow" TextWindow.Write( d+"." +" "+students[1][1]) TextWindow.CursorLeft=23 TextWindow.Write(students[1][2]) TextWindow.CursorLeft=42 TextWindow.Write(students[1][3]) TextWindow.CursorLeft=55 TextWindow.Write(moadel[1]) TextWindow.CursorLeft=75 TextWindow.ForegroundColor="blue" TextWindow.Write("1") If moadel[1]>= k Then TextWindow.ForegroundColor="green " TextWindow.CursorLeft=60 TextWindow.WriteLine(" Accepted ") darsada=darsada+1 Else TextWindow.ForegroundColor="red" TextWindow.CursorLeft=60 TextWindow.WriteLine(" Castaway ") darsadc=darsadc+1 EndIf For i=2 To n p[i]=i If Math.Remainder(i,2)=0 Then TextWindow.ForegroundColor="gray" Else TextWindow.ForegroundColor="yellow" EndIf starmt: w=i-1 r1=Math.GetRandomNumber(Array.GetItemCount(name)) r2=Math.GetRandomNumber(Array.GetItemCount(family)) While w > 0 If name[r1][1] <> students[w][1] Or family[r2] <> students[w][2] Then w=w-1 Else Goto starmt EndIf EndWhile d=d+1 'aaaaaaaa n11=41 n12=85 n13=147 n14=209 n15=270 n16=330 n17=391 n18=451 If d < n11 Then rr=1 ElseIf d >=n11 and d <65 then rr=2 Elseif d >=65 and d =n12 and d <121 then rr=4 Elseif d >=121 and d =n13 and d <181 then rr=6 Elseif d >=181 and d =n14 and d <241 then rr=8 Elseif d >=241 and d =n15 and d <301 then rr=10 Elseif d >=301 and d =n16 and d <361 then rr=12 Elseif d >=361 and d =n17 and d <421 then rr=14 Elseif d >=421 and d = k Then TextWindow.ForegroundColor="green" TextWindow.Write(" Accepted ") darsada=darsada+1 Else TextWindow.ForegroundColor="red" TextWindow.Write(" Castaway ") darsadc=darsadc+1 EndIf TextWindow.ForegroundColor="blue" TextWindow.CursorLeft=75 TextWindow.WriteLine(students[i][4]) EndFor ac=darsada+darsadc ac=100/ac darsada=Math.Round(darsada*ac*100)/100 darsadc=Math.Round(darsadc*ac*100)/100 TextWindow.ForegroundColor="green" TextWindow.WriteLine("") TextWindow.WriteLine("accepted :"+darsada+"%") TextWindow.WriteLine("") TextWindow.ForegroundColor="red" TextWindow.WriteLine("castway :"+darsadc+"%") TextWindow.WriteLine("") TextWindow.ForegroundColor="magenta" TextWindow.WriteLine("1.restart program ") TextWindow.WriteLine("2.search ") TextWindow.WriteLine("3.exit") TextWindow.WriteLine("") TextWindow.ForegroundColor="gray" TextWindow.Write("enter Operation code : ") m3=TextWindow.ReadNumber() If m3="2" Then search() ElseIf m3= "1" then TextWindow.Clear() run() Elseif m3="3" then Program.End() EndIf EndSub Sub data k=12 'نمره قبولی name[1][1]="ali" name[1][2]="male " name[2][1]="zahra" name[2][2]="female" name[3][1]="reza" name[3][2]="male " name[4][1]="sara" name[4][2]="female" name[5][1]="mohsen" name[5][2]="male " name[6][1]="setaish" name[6][2]="female" name[7][1]="korosh" name[7][2]="male " name[8][1]="maryam" name[8][2]="female" name[9][1]="mohamad" name[9][2]="male " name[10][1]="fatemeh" name[10][2]="female" name[11][1]="alireza" name[11][2]="male " name[12][1]="milad" name[12][2]="male " name[13][1]="mahdi" name[13][2]="male " name[14][1]="fariba" name[14][2]="female" name[15][1]="hossein" name[15][2]="male " name[16][1]="akram" name[16][2]="female" name[17][1]="mahmud" name[17][2]="male " name[18][1]="amir" name[18][2]="male" name[19][1]="mersad" name[19][2]="male " name[20][1]="saeed" name[20][2]="male " name[21][1]="mehrzad" name[21][2]="male " family[1]="dahaee" family[2]="rezaee" family[3]="akbary" family[4]="zahedee" family[5]="hosseinee" family[6]="hasanee" family[7]="jalalee" family[8]="jamalee" family[9]="akbaree" family[10]="gholeepor" family[11]="daneshvar" family[12]="mola" family[13]="rashedee" family[14]="mosave" family[15]="norozee" family[16]="fatemee" family[17]="khosravee" family[18]="farokhee" family[19]="yosefee" family[20]="argmand" family[21]="gerami" teacher[1]="karamee" teacher[2]="naderee" teacher[3]="mosavee" teacher[4]="heidaree" teacher[5]="amerian" teacher[6]="hosseinee" teacher[7]="dastafkan" teacher[8]="abedian" teacher[9]="arabameree" teacher[10]="tofighee" teacher[11]="karimee" teacher[12]="dahaee" teacher[13]="norozi" teacher[14]="akbary" teacher[15]="shokohee" For q=1 To (Array.GetItemCount(name)*Array.GetItemCount(family)) dars[q][1]=Math.GetRandomNumber(16)+4 dars[q][2]=Math.GetRandomNumber(16)+4 dars[q][3]=Math.GetRandomNumber(16)+4 dars[q][4]=Math.GetRandomNumber(16)+4 dars[q][5]=Math.GetRandomNumber(16)+4 dars[q][6]=Math.GetRandomNumber(16)+4 dars[q][7]=Math.GetRandomNumber(16)+4 EndFor For w=1 To (Array.GetItemCount(name)*Array.GetItemCount(family)) moadel[w]=(dars[w][1]+ dars[w][2]+dars[w][3]+dars[w][4] +dars[w][5]+ dars[w][6]+ dars[w][7])/7 moadel[w]=Math.Round(moadel[w]*10)/10 EndFor For i=1 To (Array.GetItemCount(name)*Array.GetItemCount(family)) data[i][1]="1371/"+Math.GetRandomNumber(11)+"/"+Math.GetRandomNumber(28) EndFor EndSub End>GQG962.sb< Start>GQJ530.sb< 'Krueg Trigonometry Lesson GraphicsWindow.Width = 800 GraphicsWindow.Height = 600 GraphicsWindow.Top = 5 GraphicsWindow.Left = 5 GraphicsWindow.BackgroundColor = "Black" GraphicsWindow.BrushColor = "Black" GraphicsWindow.PenColor = "White" cross = Shapes.AddEllipse(26,26) cross1 = Shapes.AddLine(10,13,16,13) cross2 = Shapes.AddLine(13,10,13,16) gun = Shapes.AddRectangle(3,35) gx = 400 'Gun X-position gy = 510 'Gun Y-position Mouse.HideCursor() GraphicsWindow.MouseMove = target Sub target tx = GraphicsWindow.MouseX 'Target X-position ty = GraphicsWindow.MouseY 'Target Y-position Shapes.Move(cross ,tx-13,ty-13) Shapes.Move(cross1,tx-13,ty-13) Shapes.Move(cross2,tx-13,ty-13) ga = Math.GetDegrees(Math.ArcTan((gx-tx)/(gy-ty))) Shapes.Rotate(gun,-ga) Shapes.Move(gun,gx,gy) EndSub End>GQJ530.sb< Start>GQK039.sb< ' Shapes ' Copyright © 2012-2015 Nonki Takahashi.The MIT License. ' Version 2.0b ' Last update 2015-01-08 ' Program ID XFZ657-19 '*Comments are removed for Publish '*File I/O routines are removed for Publish title="Shapes 2.0b" pgmname="Shapes.smallbasic" GraphicsWindow.Title=title debug="False" SB_Workaround() gw=800 gh=600 GraphicsWindow.Width=gw GraphicsWindow.Height=gh Not="False=True;True=False;" WQ=Text.GetCharacter(34) qt=WQ CR=Text.GetCharacter(13) LF=Text.GetCharacter(10) LT="<" UPPER="ABCDEFGHIJKLMNOPQRSTUVWXYZ" LOWER="abcdefghijkomnopqrstuvwxyz" DIGIT="0123456789" LCHAR=UPPER+LOWER+"_" TCHAR=LCHAR+DIGIT Popup_Init() CS_InitPalette() DrawMenu() shape="" nShapes=0 iMin=1 iMax=nShapes cont="True" Mouse_Init() KB_Init() param="down=True;move=False;up=True;" Mouse_SetHandler() While cont If clicked Then DetectClickedObject() DoObject() param="down=True;move=False;up=True;" Mouse_SetHandler() ElseIf in>out Then KB_InKey() If c="^x" Then obj="menu"+icut DoMenu() ElseIf c="^c" Then obj="menu"+icopy DoMenu() ElseIf c="^v" Then obj="menu"+ipaste DoMenu() ElseIf c="DEL" Then If selectedshape<>"" Then DeleteSelectedShape() i=selectedshape select="False" ShapeSelect() EndIf ElseIf c="LEFT" Or c="RIGHT" Or c="UP" Or c="DOWN" Then If selectedshape<>"" Then i=selectedshape shp=shape[i] _x=shp["x"]+arrow_dx[c] _y=shp["y"]+arrow_dy[c] MoveShape() EndIf EndIf param="down=True;move=False;up=True;" Mouse_SetHandler() Else Program.Delay(100) EndIf EndWhile Sub CalcDetectBorder shp=shape[i] If shp["func"]="line" Then x=shp["x2"]-shp["x1"] y=shp["y2"]-shp["y1"] Math_CartesianToPolar() If 180<=a Then a=a-180 EndIf shp["angle"]=a cx=shp["x"]+Math.Abs(x)/2 cy=shp["y"]+Math.Abs(y)/2 len=Math.SquareRoot(x*x+y*y) shp["_x0"]=Math.Floor(cx-len/2) shp["_x1"]=Math.Floor(cx+len/2) shp["_y0"]=cy-4 shp["_y1"]=cy+4 Else If shp["func"]="tri" Then shp["width"]=shp["x3"] shp["height"]=shp["y2"] EndIf shp["_x0"]=shp["x"] shp["_y0"]=shp["y"] shp["_x1"]=shp["x"]+shp["width"] shp["_y1"]=shp["y"]+shp["height"] EndIf shape[i]=shp EndSub Sub CalcPinchPos shp=shape[i] _x=shp["x"] _y=shp["y"] width=shp["width"] height=shp["height"] angle=shp["angle"] param="width=0;height=0;angle="+angle+";" param["cx"]=_x+width/2 param["cy"]=_y+height/2 Stack.PushValue("local",x) Stack.PushValue("local",y) Stack.PushValue("local",_x) Stack.PushValue("local",_y) param["x"]=param["cx"] param["y"]=param["cy"]-10 Shapes_CalcRotatePos() mxM=x myM=y _y=Stack.PopValue("local") _x=Stack.PopValue("local") y=Stack.PopValue("local") x=Stack.PopValue("local") EndSub Sub CalcVertexes shp=shape[selectedshape] If shp["func"]="line" Then If i=1 Then mxM=shp["x"]+shp["x1"] myM=shp["y"]+shp["y1"] mxD=shp["x"]+shp["x2"] myD=shp["y"]+shp["y2"] ElseIf i=2 Then mxM=shp["x"]+shp["x2"] myM=shp["y"]+shp["y2"] mxD=shp["x"]+shp["x1"] myD=shp["y"]+shp["y1"] EndIf Else mxM=shp["x"] myM=shp["y"] mxD=mxM myD=myM If i=1 Or i=3 Then mxD=mxD+shp["width"] EndIf If i=1 Or i=2 Then myD=myD+shp["height"] EndIf If i=2 Or i=4 Then mxM=mxM+shp["width"] EndIf If i=3 Or i=4 Then myM=myM+shp["height"] EndIf param="x="+mxD+";y="+myD+";width=0;height=0;angle="+angle param=param+";cx="+(mxD+mxM)/2+";cy="+(myD+myM)/2+";" Shapes_CalcRotatePos() mxD=x myD=y param["x"]=mxM param["y"]=myM Shapes_CalcRotatePos() mxM=x myM=y EndIf EndSub Sub DeleteSelectedShape shp=shape[selectedshape] Shapes.Remove(shp["obj"]) nShapes=nShapes-1 For _i=selectedshape To nShapes shape[_i]=shape[_i+1] EndFor shape[nShapes+1]="" selectedshape="" EndSub Sub DetectClickedObject Stack.PushValue("local",i) obj="" For i=1 To nPinch pnch=pinch[i] If pnch["_x0"]<=mxD And mxD<=pnch["_x1"] And pnch["_y0"]<=myD And myD<=pnch["_y1"] Then obj="pinch"+i Goto dco_exit EndIf EndFor For i=nShapes To 1 Step -1 shp=shape[i] param="x="+mxD+";y="+myD+";width=0;height=0;" param["cx"]=(shp["_x0"]+shp["_x1"])/2 param["cy"]=(shp["_y0"]+shp["_y1"])/2 param["angle"]=-shp["angle"] Shapes_CalcRotatePos() If shp["_x0"]<=x And x<=shp["_x1"] And shp["_y0"]<=y And y<=shp["_y1"] Then If shp["func"]="rect" Or shp["func"]="line" Then obj="shape"+i Goto dco_exit ElseIf shp["func"]="ell" Then x=(x-param["cx"])/shp["width"]*2 y=(y-param["cy"])/shp["height"]*2 r=Math.SquareRoot(x*x+y*y) If r<=1 Then obj="shape"+i Goto dco_exit EndIf ElseIf shp["func"]="tri" Then x=(x-param["cx"])/shp["width"]*2 y=(y-shp["_y1"])/shp["height"] r=Math.Abs(x)+Math.Abs(y) If r<=1 And y<=0 Then obj="shape"+i Goto dco_exit EndIf EndIf EndIf EndFor For i=1 To nMenu mnu=menu[i] If mnu["func"]<>"" And mnu["_x0"]<=mxD And mxD<=mnu["_x1"] And mnu["_y0"]<=myD And myD<=mnu["_y1"] Then obj="menu"+i Goto dco_exit EndIf EndFor dco_exit: If obj="" And selectedshape<>"" Then i=selectedshape select="False" ShapeSelect() EndIf i=Stack.PopValue("local") EndSub Sub DoMenu If Text.StartsWith(obj,"menu") Then param="down=False;move=False;up=False;" Mouse_SetHandler() i=Text.GetSubTextToEnd(obj,5) obj="" mnu=menu[i] func=mnu["func"] select="True" ItemSelect() If selecteditem=i And Text.IsSubText("rect|ell|tri|line",func) Then If mode="repeat" Then mode="single" Shapes.HideShape(repeat[func]) Else mode="repeat" Shapes.ShowShape(repeat[func]) EndIf Else mode="single" EndIf selecteditem=i If Text.IsSubText("open|save|cut|paste|rect|ell|tri|line",func) And selectedshape<>"" Then i=selectedshape select="False" ShapeSelect() If func="cut" Then selectedshape=i EndIf EndIf If func="open" Then ReadShapes() ElseIf func="save" Then WriteShapes() ElseIf func="cut" Then If selectedshape<>"" Then clipboard=shape[selectedshape] DeleteSelectedShape() EndIf ElseIf func="copy" Then If selectedshape<>"" Then clipboard=shape[selectedshape] index="1=x;2=y;3=_x0;4=_x1;5=_y0;6=_y1;" For _i=1 To 6 clipboard[index[_i]]=clipboard[index[_i]]+10 EndFor EndIf ElseIf func="paste" Then If clipboard<>"" Then nShapes=nShapes+1 shape[nShapes]=clipboard index="1=x;2=y;3=_x0;4=_x1;5=_y0;6=_y1;" For _i=1 To 6 clipboard[index[_i]]=clipboard[index[_i]]+10 EndFor iMin=nShapes iMax=nShapes scale=1 shX=0 shY=0 Shapes_Add() i=nShapes select="True" ShapeSelect() EndIf ElseIf func="rect" Or func="ell" Or func="tri" Then While "True" WaitToClick() DetectClickedObject() If Text.StartsWith(obj,"menu") Then Goto dm_exit EndIf obj="" mxM=mxD myM=myD angle=0 WaitToReleaseS() resize="False" nShapes=nShapes+1 i=nShapes RegisterShapeData() If w=0 And h=0 Then shape[i]="" nShapes=nShapes-1 Goto dm_exit EndIf GraphicsWindow.BrushColor=bcolor GraphicsWindow.PenWidth=pwidth If pwidth>0 Then GraphicsWindow.PenColor=pcolor EndIf shp=shape[nShapes] If func="rect" Then shp["obj"]=Shapes.AddRectangle(w,h) ElseIf func="ell" Then shp["obj"]=Shapes.AddEllipse(w,h) ElseIf func="tri" Then shp["obj"]=Shapes.AddTriangle(xt,0,0,h,w,h) EndIf Shapes.Move(shp["obj"],xmin,ymin) shape[nShapes]=shp If mode="single" Then Goto dm_exit EndIf EndWhile ElseIf func="line" Then While "True" WaitToClick() DetectClickedObject() If Text.StartsWith(obj,"menu") Then Goto dm_exit EndIf obj="" mxM=mxD myM=myD WaitToReleaseS() nShapes=nShapes+1 i=nShapes RegisterShapeData() If x1=x2 And y1=y2 Then shape[i]="" nShapes=nShapes-1 Goto dm_exit EndIf GraphicsWindow.BrushColor=bcolor GraphicsWindow.PenWidth=pwidth If pwidth>0 Then GraphicsWindow.PenColor=pcolor EndIf shp=shape[nShapes] shp["obj"]=Shapes.AddLine(x1,y1,x2,y2) Shapes.Move(shp["obj"],xmin,ymin) shape[nShapes]=shp If mode="single" Then Goto dm_exit EndIf EndWhile ElseIf func="pw" Then If pen=nPen Then pen=1 Else pen=pen+1 EndIf pwidth=pw[pen] mnu=menu[i] x=mnu["_x0"] y=mnu["_y0"] size=mnu["_x1"]-x GraphicsWindow.BrushColor="#EEEEEE" GraphicsWindow.FillRectangle(x,y,size,size) DrawMenuItem() ElseIf func="pc" Then color=pcolor CS_ShowPopup() pcolor=color DrawMenuItem() ElseIf func="bc" Then color=bcolor CS_ShowPopup() bcolor=color DrawMenuItem() ElseIf func="gr" Then grid=Not[grid] If grid Then colorGrid="#EEEEEE" stepGrid=10 DrawGrid() colorGrid="#AAAAAA" stepGrid=50 DrawGrid() colorGrid="#666666" stepGrid=100 DrawGrid() Else GraphicsWindow.BrushColor="White" GraphicsWindow.FillRectangle(0,sizeMenu+20,gw,gh-sizeMenu-20) EndIf ElseIf func="menubar" And selectedshape<>"" Then i=selectedshape select="False" ShapeSelect() EndIf If selectedshape<>"" And (func="pw" Or func="pc" Or func="bc") Then i=selectedshape select="False" ShapeSelect() shp=shape[i] If func="pw" Then shp["pw"]=pwidth ElseIf func="pc" Then shp["pc"]=pcolor ElseIf func="bc" Then shp["bc"]=color EndIf shape[i]=shp iMin=i iMax=nShapes Shapes_Remove() scale=1 shX=0 shY=0 Shapes_Add() select="True" ShapeSelect() EndIf dm_exit: i=selecteditem select="False" ItemSelect() If Text.IsSubText("rect|ell|tri|line",func) Then Shapes.HideShape(repeat[func]) EndIf EndIf EndSub Sub DoObject While obj<>"" fromMenu="False" DoMenu() If obj<>"" Then DoShape() EndIf If obj<>"" Then DoPinch() EndIf EndWhile EndSub Sub DoPinch If Text.StartsWith(obj,"pinch") Then i=Text.GetSubTextToEnd(obj,6) obj="" If i=5 Then i=selectedshape WaitToReleaseR() shp=shape[i] Shapes.Rotate(shp["obj"],angle) shp["angle"]=Math.Floor(angle) shape[i]=shp select="False" ShapeSelect() select="True" ShapeSelect() Else shp=shape[selectedshape] angle=shp["angle"] CalcVertexes() func=shp["func"] WaitToReleaseS() i=selectedshape select="False" ShapeSelect() RegisterShapeMetrics() iMin=i iMax=nShapes Shapes_Remove() scale=1 shX=0 shY=0 Shapes_Add() select="True" ShapeSelect() EndIf EndIf EndSub Sub DoShape If Text.StartsWith(obj,"shape") Then If selectedshape<>"" Then i=selectedshape select="False" ShapeSelect() EndIf i=Text.GetSubTextToEnd(obj,6) select="True" ShapeSelect() Mouse_SetHandler() WaitToReleaseM() clicked="False" obj="" EndIf EndSub Sub DrawGrid GraphicsWindow.PenWidth=1 GraphicsWindow.PenColor=colorGrid For x=0 To gw-1 Step stepGrid GraphicsWindow.DrawLine(x,sizeMenu+20,x,gh) EndFor For y=sizeMenu+20 To gh-1 Step stepGrid GraphicsWindow.DrawLine(0,y,gw,y) EndFor EndSub Sub DrawMenu pwidth=GraphicsWindow.PenWidth cxMenu=6 cyMenu=6 sizeMenu=40 nMenu=13 grid="False" GraphicsWindow.BrushColor="#EEEEEE" GraphicsWindow.FillRectangle(0,0,gw,20+sizeMenu) pw="1=2;2=4;3=8;4=16;5=0;6=1;" pen=1 nPen=6 For i=1 To nMenu xMenu=cxMenu+Math.Floor((i-1)/1)*(sizeMenu+4) yMenu=cyMenu+Math.Remainder(i-1,1)*(sizeMenu+14) GraphicsWindow.BrushColor="#EEEEEE" GraphicsWindow.FillRectangle(xMenu,yMenu,sizeMenu,sizeMenu) mnu=menu[i] mnu["_x0"]=xMenu mnu["_y0"]=yMenu mnu["_x1"]=xMenu+sizeMenu mnu["_y1"]=yMenu+sizeMenu menu[i]=mnu DrawMenuItem() EndFor nMenu=nMenu+1 imenubar=nMenu mnu=menu[i] mnu["_x0"]=0 mnu["_y0"]=0 mnu["_x1"]=gw mnu["_y1"]=20+sizeMenu mnu["func"]="menubar" menu[i]=mnu EndSub Sub DrawMenuItem margin=4 mnu=menu[i] x=mnu["_x0"] y=mnu["_y0"] size=mnu["_x1"]-x GraphicsWindow.PenColor="Black" GraphicsWindow.PenWidth=2 GraphicsWindow.FontBold="False" GraphicsWindow.FontSize=8 url="http://www.nonkit.com/smallbasic.files/" If i=1 Then mnu["func"]="open" GraphicsWindow.DrawImage(url+"open.png",x,y) itemname[i]="Open" ElseIf i=2 Then mnu["func"]="save" GraphicsWindow.DrawImage(url+"save.png",x,y) Program.Delay(msWait) itemname[i]="Save" ElseIf i=3 Then icut=i mnu["func"]="cut" Shapes_Init() nShapes=Array.GetItemCount(shape) scale=0.11 iMin=1 iMax=nShapes Shapes_Add() x=x+14 Program.Delay(msWait) Shapes_Move() x=x-14 iMax=3 For t=0 To 360*0.3 angle=30-30*Math.Cos(t*Math.Pi/180) Shapes_Rotate() EndFor itemname[i]="Cut" ElseIf i=4 Then icopy=i mnu["func"]="copy" GraphicsWindow.DrawImage(url+"copy.png",x,y) Program.Delay(msWait) itemname[i]="Copy" ElseIf i=5 Then ipaste=i mnu["func"]="paste" GraphicsWindow.DrawImage(url+"paste.png",x,y) Program.Delay(msWait) itemname[i]="Paste" ElseIf i=6 Then mnu["func"]="rect" GraphicsWindow.DrawRectangle(x+margin,y+margin,size-margin*2,size-margin*2) itemname[i]="Rectangle" repeat["rect"]=Shapes.AddImage(url+"repeat.png") Shapes.Move(repeat["rect"],x,y) Shapes.HideShape(repeat["rect"]) ElseIf i=7 Then mnu["func"]="ell" GraphicsWindow.DrawEllipse(x+margin,y+margin,size-margin*2,size-margin*2) itemname[i]="Ellipse" repeat["ell"]=Shapes.AddImage(url+"repeat.png") Shapes.Move(repeat["ell"],x,y) Shapes.HideShape(repeat["ell"]) ElseIf i=8 Then mnu["func"]="tri" x1=x+size/2 y1=y+margin x2=x+margin y2=y+size-margin x3=x+size-margin y3=y+size-margin GraphicsWindow.DrawTriangle(x1,y1,x2,y2,x3,y3) itemname[i]="Triangle" repeat["tri"]=Shapes.AddImage(url+"repeat.png") Shapes.Move(repeat["tri"],x,y) Shapes.HideShape(repeat["tri"]) ElseIf i=9 Then mnu["func"]="line" x1=x+margin y1=y+margin x2=x+size-margin y2=y+size-margin GraphicsWindow.DrawLine(x1,y1,x2,y2) itemname[i]="Line" repeat["line"]=Shapes.AddImage(url+"repeat.png") Shapes.Move(repeat["line"],x,y) Shapes.HideShape(repeat["line"]) ElseIf i=10 Then mnu["func"]="pw" GraphicsWindow.PenWidth=pwidth x1=x+margin y1=y+size/2 x2=x+size-margin y2=y+size/2 GraphicsWindow.DrawLine(x1,y1,x2,y2) itemname[i]="Pen Width" ElseIf i=11 Then mnu["func"]="pc" margin=6 GraphicsWindow.PenWidth=4 GraphicsWindow.PenColor=pcolor GraphicsWindow.DrawRectangle(x+margin,y+margin,size-margin*2,size-margin*2) itemname[i]="Pen Color" ElseIf i=12 Then mnu["func"]="bc" GraphicsWindow.BrushColor=bcolor GraphicsWindow.FillRectangle(x+margin,y+margin,size-margin*2,size-margin*2) GraphicsWindow.PenColor="Black" GraphicsWindow.PenWidth=2 GraphicsWindow.DrawRectangle(x+margin,y+margin,size-margin*2,size-margin*2) itemname[i]="Brush Color" ElseIf i=13 Then mnu["func"]="gr" GraphicsWindow.PenColor="#AAAAAA" GraphicsWindow.PenWidth=1 For _x=x+margin To x+size-margin Step (size-margin*2)/4 GraphicsWindow.DrawLine(_x,y+margin,_x,y+size-margin) EndFor For _y=y+margin To y+size-margin Step (size-margin*2)/4 GraphicsWindow.DrawLine(x+margin,_y,x+size-margin,_y) EndFor itemname[i]="Grid" EndIf menu[i]=mnu If itemname[i]<>"" And oItem[i]="" Then GraphicsWindow.BrushColor="Black" oItem[i]=Shapes.AddText(itemname[i]) Shapes.Move(oItem[i],x+margin,y+size) EndIf GraphicsWindow.FontBold="True" GraphicsWindow.FontSize=12 EndSub Sub GenerateSB buf="' " buf=buf+Clock.Year+"-" month=Clock.month If Text.GetLength(month)=1 Then buf=buf+"0" EndIf buf=buf+month+"-" day=Clock.Day If Text.GetLength(day)=1 Then buf=buf+"0" EndIf buf=buf+day+" "+Clock.Time+" Shapes generated" buf=buf+" by "+title+"."+CR+LF buf=buf+"'"+CR+LF buf=buf+"' initialize shapes"+CR+LF buf=buf+"SB_Workaround()"+CR+LF buf=buf+"gw=598"+CR+LF buf=buf+"gh=428"+CR+LF buf=buf+"GraphicsWindow.Width=gw"+CR+LF buf=buf+"GraphicsWindow.Height=gh"+CR+LF buf=buf+"Shapes_Init()"+CR+LF buf=buf+"' add shapes"+CR+LF buf=buf+"scale=1"+CR+LF buf=buf+"angle=0"+CR+LF buf=buf+"iMin=1"+CR+LF buf=buf+"iMax="+nShapes+CR+LF buf=buf+"Shapes_Add()"+CR+LF buf=buf+"Sub "+"Shapes_Init"+CR+LF buf=buf+"' Shapes | Initialize shapes data"+CR+LF buf=buf+"' return shX,shY-current position of shapes"+CR+LF buf=buf+"' return shape-array of shapes"+CR+LF If nShapes>0 Then xmin=shape[1]["x"] ymin=shape[1]["y"] xmax=shape[1]["x"] ymax=shape[1]["y"] EndIf For i=2 To nShapes If shape[i]["x"]0 And shape[i]["angle"]<>"" Then buf=buf+"angle="+shape[i]["angle"]+";" EndIf buf=buf+"bc="+shape[i]["bc"]+";" ElseIf shape[i]["func"]="tri" Then buf=buf+"shape["+i+"]="+WQ+"func=tri;" buf=buf+"x="+(shape[i]["x"]-xmin)+";" buf=buf+"y="+(shape[i]["y"]-ymin)+";" buf=buf+"x1="+shape[i]["x1"]+";" buf=buf+"y1="+shape[i]["y1"]+";" buf=buf+"x2="+shape[i]["x2"]+";" buf=buf+"y2="+shape[i]["y2"]+";" buf=buf+"x3="+shape[i]["x3"]+";" buf=buf+"y3="+shape[i]["y3"]+";" If shape[i]["angle"]<>0 And shape[i]["angle"]<>"" Then buf=buf+"angle="+shape[i]["angle"]+";" EndIf buf=buf+"bc="+shape[i]["bc"]+";" ElseIf shape[i]["func"]="line" Then buf=buf+"shape["+i+"]="+WQ+"func=line;" buf=buf+"x="+(shape[i]["x"]-xmin)+";" buf=buf+"y="+(shape[i]["y"]-ymin)+";" buf=buf+"x1="+shape[i]["x1"]+";" buf=buf+"y1="+shape[i]["y1"]+";" buf=buf+"x2="+shape[i]["x2"]+";" buf=buf+"y2="+shape[i]["y2"]+";" EndIf If shape[i]["pw"]>0 Then buf=buf+"pc="+shape[i]["pc"]+";" EndIf buf=buf+"pw="+shape[i]["pw"]+";"+WQ+CR+LF EndFor buf=buf+"EndSub"+CR+LF EndSub Sub GenerateSVG sp[4]="" sp[6]="" sp[8]="" buf=LT+"svg width="+WQ+gw+WQ+" " buf=buf+"height="+WQ+gh+WQ+">"+CR+LF buf=buf+""+LT+"defs>"+CR+LF buf=buf+sp[4]+LT+"g id="+WQ+"g1"+WQ+">"+CR+LF If nShapes>0 Then shp=shape[1] xmin=shp["x"] ymin=shp["y"] xmax=shp["x"] ymax=shp["y"] EndIf For i=2 To nShapes shp=shape[i] If shp["x"]0 And shp["angle"]<>"" Then buf=buf+CR+LF+sp[8] buf=buf+"transform="+WQ+"rotate("+shp["angle"]+" " buf=buf+Math.Floor(shp["width"]/2+shp["x"]-xmin)+" " buf=buf+Math.Floor(shp["height"]/2+shp["y"]-ymin)+")"+WQ+" " EndIf buf=buf+CR+LF+sp[8] buf=buf+"style="+WQ+"fill:"+Text.ConvertToLowerCase(shp["bc"])+";" ElseIf shp["func"]="ell" Then buf=buf+sp[6]+LT+"ellipse " cx=Math.Floor(shp["width"]/2+shp["x"]-xmin) cy=Math.Floor(shp["height"]/2+shp["y"]-ymin) rx=Math.Floor((shp["width"]-shp["pw"])/2) ry=Math.Floor((shp["height"]-shp["pw"])/2) buf=buf+"cx="+WQ+cx+WQ+" " buf=buf+"cy="+WQ+cy+WQ+" " buf=buf+"rx="+WQ+rx+WQ+" " buf=buf+"ry="+WQ+ry+WQ+" " If shp["angle"]<>0 And shp["angle"]<>"" Then buf=buf+CR+LF+sp[8] buf=buf+"transform="+WQ+"rotate("+shp["angle"]+" " buf=buf+cx+" " buf=buf+cy+")"+WQ+" " EndIf buf=buf+CR+LF+sp[8] buf=buf+"style="+WQ+"fill:"+Text.ConvertToLowerCase(shp["bc"])+";" ElseIf shp["func"]="tri" Then buf=buf+sp[6]+LT+"polygon points="+WQ buf=buf+(shp["x1"]+shp["x"]-xmin)+"," buf=buf+(shp["y1"]+shp["y"]-ymin)+" " buf=buf+(shp["x2"]+shp["x"]-xmin)+"," buf=buf+(shp["y2"]+shp["y"]-ymin)+" " buf=buf+(shp["x3"]+shp["x"]-xmin)+"," buf=buf+(shp["y3"]+shp["y"]-ymin)+WQ+" " If shp["angle"]<>0 And shp["angle"]<>"" Then buf=buf+CR+LF+sp[8] buf=buf+"transform="+WQ+"rotate("+shp["angle"]+" " buf=buf+(shp["x1"]+shp["x"]-xmin)+" " buf=buf+Math.Floor((shp["y2"]-shp["y1"])/2+shp["y"]-ymin)+")"+WQ+" " EndIf buf=buf+CR+LF+sp[8] buf=buf+"style="+WQ+"fill:"+Text.ConvertToLowerCase(shp["bc"])+";" ElseIf shp["func"]="line" Then buf=buf+sp[6]+LT+"line " buf=buf+"x1="+WQ+(shp["x1"]+shp["x"]-xmin)+WQ+" " buf=buf+"y1="+WQ+(shp["y1"]+shp["y"]-ymin)+WQ+" " buf=buf+"x2="+WQ+(shp["x2"]+shp["x"]-xmin)+WQ+" " buf=buf+"y2="+WQ+(shp["y2"]+shp["y"]-ymin)+WQ+" " buf=buf+CR+LF+sp[8] buf=buf+"style="+WQ EndIf If shp["pw"]>0 Then buf=buf+"stroke:"+Text.ConvertToLowerCase(shp["pc"])+";" EndIf buf=buf+"stroke-width:"+shp["pw"]+WQ+"/>"+CR+LF EndFor buf=buf+sp[4]+LT+"/g>"+CR+LF buf=buf+""+LT+"/defs>"+CR+LF buf=buf+""+LT+"use x="+WQ+xmin+WQ+" y="+WQ+ymin+WQ+" xlink:href="+WQ+"#g1"+WQ+" />"+CR+LF buf=buf+LT+"/svg>"+CR+LF EndSub Sub ItemSelect If i<>imenubar Then If select Then GraphicsWindow.PenColor="Gray" Else GraphicsWindow.PenColor="#EEEEEE" EndIf GraphicsWindow.PenWidth=2 mnu=menu[i] x=mnu["_x0"]-1 y=mnu["_y0"]-1 width=mnu["_x1"]-x+1 height=mnu["_y1"]-y+1 GraphicsWindow.DrawRectangle(x,y,width,height) EndIf EndSub Sub MoveShape shp=shape[i] dx=_x-shp["x"] dy=_y-shp["y"] shp["x"]=_x shp["y"]=_y shp["_x0"]=shp["_x0"]+dx shp["_x1"]=shp["_x1"]+dx shp["_y0"]=shp["_y0"]+dy shp["_y1"]=shp["_y1"]+dy shape[i]=shp Shapes.Move(shp["obj"],_x,_y) If shp["func"]="line" Then _iMax=2 Else _iMax=5 EndIf For _i=1 To _iMax pnch=pinch[_i] pnch["_x0"]=pnch["_x0"]+dx pnch["_x1"]=pnch["_x1"]+dx pnch["_y0"]=pnch["_y0"]+dy pnch["_y1"]=pnch["_y1"]+dy pinch[_i]=pnch Shapes.Move(pnch["obj"],pnch["_x0"],pnch["_y0"]) EndFor EndSub Sub NormalizePos param="x="+mxD+";y="+myD+";width=0;height=0;" param["cx"]=(mxD+mxM)/2 param["cy"]=(myD+myM)/2 param["angle"]=-angle Shapes_CalcRotatePos() _mxD=Math.Floor(x) _myD=Math.Floor(y) param["x"]=mxM param["y"]=myM Shapes_CalcRotatePos() _mxM=Math.Floor(x) _myM=Math.Floor(y) EndSub Sub ReadShapes File_Open() File_GetBasename() lowerExt=Text.ConvertToLowerCase(ext) If lowerExt="svg" Then Parse_SVG() ElseIf (lowerExt="sb") Or (lowerExt="smallbasic") Then Parse_SB() EndIf Shapes_Add() EndSub Sub RegisterShapeData shp=shape[i] shp["func"]=func shape[i]=shp RegisterShapeStyle() RegisterShapeMetrics() EndSub Sub RegisterShapeMetrics shp=shape[i] If func="line" Then xmin=Math.Min(mxD,mxU) ymin=Math.Min(myD,myU) xmax=Math.Max(mxD,mxU) ymax=Math.Max(myD,myU) x1=mxD-xmin y1=myD-ymin x2=mxU-xmin y2=myU-ymin shp["x1"]=x1 shp["y1"]=y1 shp["x2"]=x2 shp["y2"]=y2 Else mxM=mxU myM=myU angle=shp["angle"] NormalizePos() xmin=Math.Min(_mxD,_mxM) ymin=Math.Min(_myD,_myM) xmax=Math.Max(_mxD,_mxM) ymax=Math.Max(_myD,_myM) w=xmax-xmin h=ymax-ymin shp["width"]=w shp["height"]=h EndIf shp["x"]=xmin shp["y"]=ymin If func="tri" Then xt=Math.Floor((xmax-xmin)/2) shp["x1"]=xt shp["y1"]=0 shp["x2"]=0 shp["y2"]=h shp["x3"]=w shp["y3"]=h EndIf shape[i]=shp CalcDetectBorder() EndSub Sub RegisterShapeStyle shp=shape[i] shp["pw"]=pwidth If pwidth>0 Then shp["pc"]=pcolor Else shp["pc"]="" EndIf If func<>"line" Then shp["bc"]=bcolor EndIf shape[i]=shp EndSub Sub ShapeSelect If select Then shp=shape[i] Stack.PushValue("local",x) Stack.PushValue("local",y) GraphicsWindow.PenColor="Black" GraphicsWindow.PenWidth=1 sizePinch=10 selectedshape=i shX=shp["x"] shY=shp["y"] GraphicsWindow.BrushColor="Lime" If shp["func"]="line" Then nPinch=2 For _i=1 To nPinch pnch=pinch[_i] pnch["obj"]=Shapes.AddEllipse(sizePinch,sizePinch) x=shX+shp["x"+_i]-sizePinch/2 y=shY+shp["y"+_i]-sizePinch/2 Shapes.Move(pnch["obj"],x,y) pnch["_x0"]=x pnch["_y0"]=y pnch["_x1"]=x+sizePinch pnch["_y1"]=y+sizePinch pinch[_i]=pnch EndFor Else pnch=pinch[5] pnch["obj"]=Shapes.AddEllipse(sizePinch,sizePinch) shWidth=shp["width"] shHeight=shp["height"] param["cx"]=shX+shWidth/2 param["cy"]=shY+shHeight/2 param["angle"]=shp["angle"] param["x"]=shX+shWidth/2-sizePinch/2 param["y"]=shY-30-sizePinch/2 param["width"]=sizePinch param["height"]=sizePinch Shapes_CalcRotatePos() Shapes.Move(pnch["obj"],x,y) pnch["_x0"]=x pnch["_y0"]=y pnch["_x1"]=x+sizePinch pnch["_y1"]=y+sizePinch pinch[5]=pnch nPinch=5 xPinch="1=0;2="+shWidth+";3=0;4="+shWidth+";" yPinch="1=0;2=0;3="+shHeight+";4="+shHeight+";" GraphicsWindow.BrushColor="#639AE7" For _i=1 To 4 pnch=pinch[_i] pnch["obj"]=Shapes.AddEllipse(sizePinch,sizePinch) param["x"]=shX+xPinch[_i]-sizePinch/2 param["y"]=shY+yPinch[_i]-sizePinch/2 Shapes_CalcRotatePos() Shapes.Move(pnch["obj"],x,y) pnch["_x0"]=x pnch["_y0"]=y pnch["_x1"]=x+sizePinch pnch["_y1"]=y+sizePinch pinch[_i]=pnch EndFor shape[i]=shp EndIf y=Stack.PopValue("local") x=Stack.PopValue("local") Else selectedshape="" For _i=1 To nPinch pnch=pinch[_i] Shapes.Remove(pnch["obj"]) EndFor nPinch=0 EndIf EndSub Sub WaitToClick param="down=True;move=False;up=False;" Mouse_SetHandler() While clicked="False" Program.Delay(100) EndWhile EndSub Sub WaitToReleaseM GraphicsWindow.PenWidth=1 GraphicsWindow.PenColor="Black" GraphicsWindow.BrushColor="White" param="down=False;move=True;" Mouse_SetHandler() shp=shape[i] func=shp["func"] _x=shp["x"] _y=shp["y"] shAngle=shp["angle"] mxM=mxD myM=myD moved="True" While released="False" If moved Then param="move=False;" Mouse_SetHandler() _x=shp["x"]+mxM-mxD _y=shp["y"]+myM-myD If oFrame[func]="" Then If func="rect" Then oFrame[func]=Shapes.AddRectangle(shp["width"],shp["height"]) ElseIf func="ell" Then oFrame[func]=Shapes.AddEllipse(shp["width"],shp["height"]) ElseIf func="tri" Then _x1=shp["x1"] _y1=shp["y1"] _x2=shp["x2"] _y2=shp["y2"] _x3=shp["x3"] _y3=shp["y3"] oFrame[func]=Shapes.AddTriangle(_x1,_y1,_x2,_y2,_x3,_y3) ElseIf func="line" Then _x1=shp["x1"] _y1=shp["y1"] _x2=shp["x2"] _y2=shp["y2"] oFrame[func]=Shapes.AddLine(_x1,_y1,_x2,_y2) Shapes.SetOpacity(oFrame[func],50) EndIf EndIf If func="rect" Or func="ell" Or func="tri" Then Shapes.SetOpacity(oFrame[func],0) Shapes.Move(oFrame[func],_x,_y) Shapes.Rotate(oFrame[func],shAngle) Shapes.SetOpacity(oFrame[func],50) ElseIf func="line" Then Shapes.Move(oFrame[func],_x,_y) EndIf param="move=True;" Mouse_SetHandler() Else Program.Delay(100) EndIf EndWhile param="move=False;up=False;" Mouse_SetHandler() MoveShape() If oFrame[func]<>"" Then Shapes.Remove(oFrame[func]) oFrame[func]="" EndIf EndSub Sub WaitToReleaseR GraphicsWindow.PenWidth=1 GraphicsWindow.PenColor="Black" GraphicsWindow.BrushColor="White" param="down=False;move=True;up=True;" Mouse_SetHandler() CalcPinchPos() cx=param["cx"] cy=param["cy"] shp=shape[i] func=shp["func"] If func="tri" Then x1=shp["x1"] y1=shp["y1"] x2=shp["x2"] y2=shp["y2"] x3=shp["x3"] y3=shp["y3"] EndIf moved="True" If oFrame[func]<>"" Then Shapes.Remove(oFrame[func]) EndIf If func="rect" Then oFrame[func]=Shapes.AddRectangle(width,height) ElseIf func="ell" Then oFrame[func]=Shapes.AddEllipse(width,height) ElseIf func="tri" Then oFrame[func]=Shapes.AddTriangle(x1,y1,x2,y2,x3,y3) EndIf Shapes.SetOpacity(oFrame[func],0) Shapes.Move(oFrame[func],_x,_y) While released="False" If moved Then param="move=False;" Mouse_SetHandler() x=mxM-cx y=myM-cy If x<>0 Or y<>0 Then Math_CartesianToPolar() angle=Math.Floor(a+90) If angle >= 360 Then angle=angle-360 EndIf EndIf Shapes.Rotate(oFrame[func],angle) Shapes.SetOpacity(oFrame[func],50) param="move=True;" Mouse_SetHandler() Else Program.Delay(100) EndIf EndWhile param="move=False;up=False;" Mouse_SetHandler() If oFrame[func]<>"" Then Shapes.Remove(oFrame[func]) oFrame[func]="" EndIf EndSub Sub WaitToReleaseS GraphicsWindow.PenWidth=1 GraphicsWindow.PenColor="Black" GraphicsWindow.BrushColor="White" param="down=False;move=True;up=True;" Mouse_SetHandler() moved="True" While released="False" If moved Then param="move=False;" Mouse_SetHandler() If func="rect" Or func="ell" Or func="tri" Then If oFrame[func]<>"" Then Shapes.Remove(oFrame[func]) EndIf NormalizePos() xmin=Math.Min(_mxD,_mxM) ymin=Math.Min(_myD,_myM) xmax=Math.Max(_mxD,_mxM) ymax=Math.Max(_myD,_myM) If func="rect" Then oFrame[func]=Shapes.AddRectangle(xmax-xmin,ymax-ymin) ElseIf func="ell" Then oFrame[func]=Shapes.AddEllipse(xmax-xmin,ymax-ymin) ElseIf func="tri" Then oFrame[func]=Shapes.AddTriangle((xmax-xmin)/2,0,0,ymax-ymin,xmax-xmin,ymax-ymin) EndIf Shapes.SetOpacity(oFrame[func],0) Shapes.Move(oFrame[func],xmin,ymin) Shapes.Rotate(oFrame[func],angle) Shapes.SetOpacity(oFrame[func],50) ElseIf func="line" Then If oFrame[func]<>"" Then Shapes.Remove(oFrame[func]) EndIf oFrame[func]=Shapes.AddLine(mxD,myD,mxM,myM) Shapes.SetOpacity(oFrame[func],50) EndIf param="move=True;" Mouse_SetHandler() Else Program.Delay(100) EndIf EndWhile param="move=False;up=False;" Mouse_SetHandler() If oFrame[func]<>"" Then Shapes.Remove(oFrame[func]) oFrame[func]="" EndIf EndSub Sub WriteShapes Stack.PushValue("local",i) If (lowerExt="sb") Or (lowerExt="smallbasic") Then GenerateSB() Else GenerateSVG() EndIf File_Save() i=Stack.PopValue("local") EndSub Sub Color_ColorToRGB sR=Text.GetSubText(sColor,2,2) sG=Text.GetSubText(sColor,4,2) sB=Text.GetSubText(sColor,6,2) sHex=sR Math_Hex2Dec() iR=iDec sHex=sG Math_Hex2Dec() iG=iDec sHex=sB Math_Hex2Dec() iB=iDec EndSub Sub Color_HSLtoRGB If rLightness<=0.5 Then rN2=rLightness*(1+rSaturation) Else rN2=rLightness+rSaturation-rLightness*rSaturation EndIf rN1=2*rLightness-rN2 If rSaturation=0 Then iR=Math.Round(rLightness*255) iG=Math.Round(rLightness*255) iB=Math.Round(rLightness*255) Else rH=rHue+120 Color_Value() iR=iValue rH=rHue Color_Value() iG=iValue rH=rHue-120 Color_Value() iB=iValue EndIf sColor=GraphicsWindow.GetColorFromRGB(iR,iG,iB) EndSub Sub Color_RGBtoHSL Color_ColorToRGB() rR=Math.Round(iR/255*10000)/10000 rG=Math.Round(iG/255*10000)/10000 rB=Math.Round(iB/255*10000)/10000 rMax=Math.Max(rR,rG) rMax=Math.Max(rMax,rB) rMin=Math.Min(rR,rG) rMin=Math.Min(rMin,rB) rLightness=(rMax+rMin)/2 If rMax=rMin Then rSaturation=0 rHue=UNDEFINED Else If rLightness<=0.5 Then rSaturation=(rMax-rMin)/(rMax+rMin) Else rSaturation=(rMax-rMin)/(2-rMax-rMin) EndIf rRC=(rMax-rR)/(rMax-rMin) rGC=(rMax-rG)/(rMax-rMin) rBC=(rMax-rB)/(rMax-rMin) If rR=rMax Then rHue=rBC-rGC ElseIf rG=rMax Then rHue=2+rRC-rBC ElseIf rB=rMax Then rHue=4+rGC-rRC Else TextWindow.WriteLine("Error:") TextWindow.WriteLine("rMax="+rMax) TextWindow.WriteLine("rR="+rR+",sR="+sR) TextWindow.WriteLine("rG="+rG+",sG="+sG) TextWindow.WriteLine("rB="+rB+",sB="+sB) EndIf rHue=rHue*60 If rHue<0 Then rHue=rHue+360 EndIf EndIf EndSub Sub Color_Value If rH >= 360 Then rH=rH-360 EndIF If rH<0 Then rH=rH+360 EndIF If rH<60 Then rV=rN1+(rN2-rN1)*rH/60 ElseIf rH<180 Then rV=rN2 ElseIf rH<240 Then rV=rN1+(rN2-rN1)*(240-rH)/60 Else rV=rN1 EndIf iValue=Math.Round(rV*255) EndSub Sub CS_AddColorToPalette Stack.PushValue("local",i) For i=1 To nPalette pltt=palette[i] If color=pltt["color"] Then Goto csactp_not_new_color EndIf EndFor pltt=palette[tPalette] pltt["color"]=color palette[tPalette]=pltt If nPalette"" CS_DoSlider() If obj<>"" Then CS_DoPalette() EndIf EndWhile EndSub Sub CS_DoPalette If Text.StartsWith(obj,"palette") Then iPalette=Text.GetSubTextToEnd(obj,8) pltt=palette[iPalette] color=pltt["color"] CS_SetColorToSlider() CS_ShowNewColor() CS_DrawColorRect() obj="" param="down=True;move=False;up=False;" Mouse_SetHandler() EndIf EndSub Sub CS_DoSlider If Text.StartsWith(obj,"slider") Then Slider_WaitToRelease() obj="" param="down=True;move=False;up=False;" Mouse_SetHandler() EndIf EndSub Sub CS_DrawColorRect GraphicsWindow.BrushColor=color GraphicsWindow.PenColor=BORDERCOLOR If oRect<>"" Then Shapes.Remove(oRect) EndIf oRect=Shapes.AddRectangle(width,height) Shapes.Move(oRect,x,y) EndSub Sub CS_DrawPalette Stack.PushValue("local",i) GraphicsWindow.PenColor=BORDERCOLOR For i=1 To nPalette pltt=palette[i] GraphicsWindow.BrushColor=pltt["color"] pltt["oCell"]=Shapes.AddRectangle(width,height) dx=Math.Remainder((i-1),8)*(width+4) dy=Math.Floor((i-1)/8)*(height+4) Shapes.Move(pltt["oCell"],x+dx,y+dy) pltt["x"]=x+dx pltt["y"]=y+dy pltt["width"]=width pltt["height"]=height palette[i]=pltt EndFor i=Stack.PopValue("local") EndSub Sub CS_GetColorFromSlider Stack.PushValue("local",iSlider) iSlider=iRed Slider_GetLevel() red=level iSlider=iGreen Slider_GetLevel() green=level iSlider=iBlue Slider_GetLevel() blue=level color=GraphicsWindow.GetColorFromRGB(red,green,blue) iSlider=Stack.PopValue("local") EndSub Sub CS_Init width=256 min=0 max=255 left=190 top=TOPY caption="R" Slider_Add() iRed=iSlider top=top+DELTAY caption="G" Slider_Add() iGreen=iSlider top=top+DELTAY caption="B" Slider_Add() iBlue=iSlider width=360 top=top+DELTAY max=360 caption="H" Slider_Add() iHue=iSlider width=100 top=top+DELTAY max=100 caption="S" Slider_Add() iSaturation=iSlider width=100 top=top+DELTAY max=100 caption="L" Slider_Add() iLightness=iSlider CS_GetColorFromSlider() CS_ShowNewColor() x=LEFTX y=TOPY+DELTAY*4 width=100 height=100 CS_DrawColorRect() GraphicsWindow.BrushColor=CAPTIONCOLOR top=y+height+4 oNewColor=Shapes.AddText("") Shapes.Move(oNewColor,LEFTX,top) EndSub Sub CS_InitPalette pcolor=GraphicsWindow.PenColor If Text.GetLength(pcolor)=9 Then pcolor="#"+Text.GetSubText(pcolor,4,6) EndIf bcolor=GraphicsWindow.BrushColor If Text.GetLength(bcolor)=9 Then bcolor="#"+Text.GetSubText(bcolor,4,6) EndIf maxPalette=16 nPalette=2 tPalette=3 pltt=palette[1] pltt["color"]=pcolor palette[1]=pltt pltt=palette[2] pltt["color"]=bcolor palette[2]=pltt EndSub Sub CS_RemovePalette Stack.PushValue("local",i) For i=1 To nPalette oPalette="Palette"+i pltt=palette[i] Shapes.Remove(pltt["oCell"]) EndFor i=Stack.PopValue("local") EndSub Sub CS_RemoveSliders For iSlider=1 To numSlider Slider_Remove() EndFor numSlider=0 EndSub Sub CS_SearchClickedObject Stack.PushValue("local",i) For iSlider=1 To numSlider obj="slider"+iSlider sldr=slider[iSlider] x2=sldr["x2"] y2=sldr["y2"] x3=sldr["x3"] y3=sldr["y3"] If x2<=mxD And mxD<=x3 And y2<=myD And myD<=y3 Then Goto scco_obj_found EndIf EndFor For iPalette=1 To nPalette obj="palette"+iPalette pltt=palette[iPalette] x2=pltt["x"] y2=pltt["y"] x3=pltt["x"]+pltt["width"] y3=pltt["y"]+pltt["height"] If x2<=mxD And mxD<=x3 And y2<=myD And myD<=y3 Then Goto scco_obj_found EndIf EndFor obj="" scco_obj_found: i=Stack.PopValue("local") EndSub Sub CS_SetColorToSlider Stack.PushValue("local",iSlider) sColor=color Color_ColorToRGB() iSlider=iRed level=iR Slider_SetLevel() iSlider=iGreen level=iG Slider_SetLevel() iSlider=iBlue level=iB Slider_SetLevel() CS_AdjustSlider() iSlider=Stack.PopValue("local") EndSub Sub CS_ShowNewColor Shapes.SetText(oNewColor,color) EndSub Sub CS_ShowPopup Stack.PushValue("local",cont) colorInit=color GraphicsWindow.PenWidth=2 GraphicsWindow.PenColor=POPUPCOLOR GraphicsWindow.BrushColor=POPUPCOLOR oPopup=Shapes.AddRectangle(gw,gh) Shapes.SetOpacity(oPopup,64) Shapes.Move(oPopup,LEFTX-10,TOPY-10) GraphicsWindow.BrushColor=CAPTIONCOLOR oOK=Controls.AddButton("OK",gw-100,gh-34) oCancel=Controls.AddButton("Cancel",gw-60,gh-34) Controls.ButtonClicked=CS_OnButtonClicked CS_Init() Stack.PushValue("local",y) y=TOPY color=colorInit CS_DrawColorRect() oRectCurrent=oRect oRect="" If Text.GetLength(color)=9 Then color="#"+Text.GetSubText(color,4,6) EndIf GraphicsWindow.BrushColor=CAPTIONCOLOR oColor=Shapes.AddText(colorInit) Shapes.Move(oColor,x,y+height+2) y=Stack.PopValue("local") CS_SetColorToSlider() CS_DrawColorRect() CS_ShowNewColor() Stack.PushValue("local",x) Stack.PushValue("local",y) Stack.PushValue("local",width) Stack.PushValue("local",height) x=x+width+30 y=TOPY+height*2+24 width=30 height=30 CS_DrawPalette() height=Stack.PopValue("local") width=Stack.PopValue("local") y=Stack.PopValue("local") x=Stack.PopValue("local") cont="True" param="down=True;move=False;up=False;" Mouse_SetHandler() While cont If clicked Then CS_SearchClickedObject() CS_DoObject() clicked="False" Else Program.Delay(100) EndIf EndWhile If cancel Then color=colorInit Else CS_AddColorToPalette() EndIf CS_RemovePalette() CS_RemoveSliders() Shapes.Remove(oColor) Shapes.Remove(oNewColor) Shapes.Remove(oRectCurrent) Shapes.Remove(oRect) Controls.Remove(oOK) Controls.Remove(oCancel) Shapes.Remove(oPopup) cont=Stack.PopValue("local") EndSub Sub CS_OnButtonClicked cont="False" If Controls.LastClickedButton=oCancel Then cancel="True" Else cancel="False" EndIf EndSub Sub File_CloseDialog Controls.Remove(oCancel) Controls.Remove(oMsg) Controls.Remove(oText) Controls.Remove(oFilename) Controls.Remove(oCaption) Controls.Remove(oPopup) EndSub Sub File_GetBasename pFilename=1 While Text.IsSubText(Text.GetSubTextToEnd(filename,pFilename),"\") iBackslash=Text.GetIndexOf(Text.GetSubTextToEnd(filename,pFilename),"\") pFilename=pFilename+iBackslash EndWhile iDot=Text.GetIndexOf(Text.GetSubTextToEnd(filename,pFilename),".") If 0lowerExt Then If (lowerExt="sb") Or (lowerExt="smallbasic") Then GenerateSB() Else GenerateSVG() EndIf Controls.SetTextBoxText(oText,buf) lastExt=lowerExt EndIf typed="False" Else Program.Delay(500) EndIf EndWhile buf=Controls.GetTextBoxText(oText) If Controls.LastClickedButton=oSave Then caution="Save is not supported for web browser."+CR+LF+"Click code,push Ctrl+A,Ctrl+C to copy to clipboard." GraphicsWindow.BrushColor=POPUPCOLOR oMsgBox=Shapes.AddRectangle(gw,gh) Shapes.SetOpacity(oMsgBox,64) GraphicsWindow.BrushColor=CAPTIONCOLOR oCaution=Shapes.AddText(caution) yCaution=(gh-80)/2 Shapes.Move(oCaution,150,yCaution) oOK2=Controls.AddButton("OK",400,yCaution+50) cont="True" Controls.ButtonClicked=File_OnButtonClicked While cont Program.Delay(500) EndWhile Controls.Remove(oOK2) Shapes.Remove(oCaution) Shapes.Remove(oMsgBox) ElseIf Controls.LastClickedButton=oCancel Then done="True" EndIf EndWhile Controls.Remove(oSave) File_CloseDialog() cont=Stack.PopValue("local") EndSub Sub File_OnButtonClicked cont="False" EndSub Sub KB_FlushFIFO For out=out+1 To in fifok[out]="" fifos[out]="" fifoc[out]="" EndFor EndSub Sub KB_InKey c="" If in>out Then out=out+1 c=fifok[out] _shift=fifos[out] _ctrl=fifoc[out] fifok[out]="" fifos[out]="" fifoc[out]="" If Text.GetLength(c)>1 Then If Array.ContainsIndex(keys,c) Then c=keys[_shift+c] Else c="<"+c+">" EndIf ElseIf _shift="" Then c=Text.ConvertToLowerCase(c) EndIf c=Text.Append(_ctrl,c) EndIf EndSub Sub KB_Init shift="" ctrl="" in=0 out=0 keys="Delete=DEL;Left=LEFT;Right=RIGHT;Up=UP;Down=DOWN;" arrow_dx="LEFT=-1;RIGHT=1;UP=0;DOWN=0;" arrow_dy="LEFT=0;RIGHT=0;UP=-1;DOWN=1;" GraphicsWindow.KeyDown=KB_OnKeyDown GraphicsWindow.KeyUp=KB_OnKeyUp EndSub Sub KB_OnKeyDown key=GraphicsWindow.LastKey If key="LeftShift" Or key="RightShift" Then shift="+" ElseIf key="LeftCtrl" Or key="RightCtrl" Then ctrl="^" Else in=in+1 fifok[in]=key fifos[in]=shift fifoc[in]=ctrl EndIf EndSub Sub KB_OnKeyUp key=GraphicsWindow.LastKey If key="LeftShift" Or key="RightShift" Then shift="" ElseIf key="LeftCtrl" Or key="RightCtrl" Then ctrl="" EndIf EndSub Sub Math_CartesianToPolar r=Math.SquareRoot(x*x+y*y) If x=0 And y>0 Then a=90 ElseIf x=0 And y<0 Then a=-90 Else a=Math.ArcTan(y/x)*180/Math.Pi EndIf If x<0 Then a=a+180 ElseIf x>0 And y<0 Then a=a+360 EndIf EndSub Sub Math_Hex2Dec iDec=0 iLen=Text.GetLength(sHex) For iPtr=1 To iLen iDec=iDec*16+Text.GetIndexOf("0123456789ABCDEF",Text.GetSubText(sHex,iPtr,1))-1 EndFor EndSub Sub Mouse_Init clicked="False" moved="False" released="False" If debug Then Timer.Interval=200 Timer.Tick=Mouse_OnTick EndIf EndSub Sub Mouse_SetHandler If param["up"] Then released="False" GraphicsWindow.MouseUp=Mouse_OnUp handler["up"]="U" ElseIf param["up"]="False" Then GraphicsWindow.MouseUp=Mouse_DoNothing handler["up"]="" EndIf If param["down"] Then clicked="False" GraphicsWindow.MouseDown=Mouse_OnDown handler["down"]="D" ElseIf param["down"]="False" Then GraphicsWindow.MouseDown=Mouse_DoNothing handler["down"]="" EndIf If param["move"] Then moved="False" GraphicsWindow.MouseMove=Mouse_OnMove handler["move"]="M" ElseIf param["move"]="False" Then GraphicsWindow.MouseMove=Mouse_DoNothing handler["move"]="" EndIf dmu=handler["down"]+handler["move"]+handler["up"] If debug Then smrc=" set " EndIf EndSub Sub Mouse_OnDown mxD=Math.Floor(GraphicsWindow.MouseX) myD=Math.Floor(GraphicsWindow.MouseY) clicked="True" released="False" If debug Then smrc=" clicked "+mxD+","+myD EndIf EndSub Sub Mouse_DoNothing EndSub Sub Mouse_OnMove mxM=Math.Floor(GraphicsWindow.MouseX) myM=Math.Floor(GraphicsWindow.MouseY) moved="True" If debug Then smrc=" moved "+mxM+","+myM EndIf EndSub Sub Mouse_OnTick If clicked Then cmr="C" Else cmr="" EndIf If moved Then cmr=cmr+"M" EndIf If released Then cmr=cmr+"R" EndIf GraphicsWindow.Title=title+smrc+" "+dmu+" "+cmr EndSub Sub Mouse_OnUp mxU=Math.Floor(GraphicsWindow.MouseX) myU=Math.Floor(GraphicsWindow.MouseY) released="True" If debug Then smrc=" released "+mxU+","+myU EndIf EndSub Sub Parse_Angle angle="" If attr["transform"]<>"" Then pAngle=8 lAngle=Text.GetIndexOf(Text.GetSubTextToEnd(attr["transform"],pAngle)," ")-1 angle=Text.GetSubText(attr["transform"],pAngle,lAngle) EndIf EndSub Sub Parse_Defs match="False" If Text.StartsWith(Text.GetSubTextToEnd(buf,p),LT+"defs>") Then Stack.PushValue("local",p) p=p+6 Parse_Space() match="False" If Text.StartsWith(Text.GetSubTextToEnd(buf,p),LT+"g id="+WQ+"g1"+WQ+">") Then p=p+11 match="True" EndIf _p=Stack.PopValue("local") If Not[match] Then p=_p EndIf EndIf EndSub Sub Parse_Ellipse match="False" If Text.StartsWith(Text.GetSubTextToEnd(buf,p),LT+"ellipse") Then param="tag=ellipse;" Parse_FindTag() Parse_GetAttrAndText() cx=attr["cx"] cy=attr["cy"] rx=attr["rx"] ry=attr["ry"] Parse_SetStyle() Parse_Angle() shp="" shp["func"]="ell" shp["x"]=cx-rx-Math.Floor(pw/2) shp["y"]=cy-ry-Math.Floor(pw/2) shp["width"]=2*rx+pw shp["height"]=2*ry+pw shp["angle"]=angle shp["pw"]=pw shp["pc"]=pc shp["bc"]=bc match="True" EndIf EndSub Sub Parse_FindTag pSave=p tag="" findNext="True" While findNext findNext="False" pTag=Text.GetIndexOf(Text.GetSubTextToEnd(buf,p),LT+param["tag"]) If 0") If len=0 Then lTag=1 len=Text.GetIndexOf(Text.GetSubTextToEnd(buf,pTag),"/>") EndIf If param["class"]="" Then len=len+lTag tag=Text.GetSubText(buf,pTag,len) findNext="False" ElseIf 0") attr="" While pTag<=pEnd Parse_SkipSpaceInTag() pEq=Text.GetIndexOf(Text.GetSubTextToEnd(tag,pTag),"=") If 0") If 0") If 00 shX=Text.Append(shX,c) ptr=ptr+1 c=Text.GetSubText(buf,ptr,1) EndWhile _ptr=Text.GetIndexOf(Text.GetSubTextToEnd(buf,ptr),"shY=") If _ptr=0 Then Goto rs_exit EndIf shY="" ptr=ptr+_ptr+5 c=Text.GetSubText(buf,ptr,1) While Text.GetIndexOf("0123456789",c)>0 shY=Text.Append(shY,c) ptr=ptr+1 c=Text.GetSubText(buf,ptr,1) EndWhile While "True" _ptr=Text.GetIndexOf(Text.GetSubTextToEnd(buf,ptr),"shape[") If _ptr=0 Then Goto rs_exit EndIf ptr=ptr+_ptr+5 _ptr=Text.GetIndexOf(Text.GetSubTextToEnd(buf,ptr),"]="+WQ) If _ptr=0 Then Goto rs_exit EndIf i=Text.GetSubText(buf,ptr,_ptr-1) If (i*1)<>(i+0) Then Goto rs_exit EndIf ptr=ptr+_ptr+4 _ptr=Text.GetIndexOf(Text.GetSubTextToEnd(buf,ptr),WQ) If _ptr=0 Then Goto rs_exit EndIf shape[nShapes+i]=Text.GetSubText(buf,ptr,_ptr-1) ptr=ptr+_ptr EndWhile rs_exit: iMin=nShapes+1 nShapes=Array.GetItemCount(shape) iMax=nShapes For i=iMin To iMax shape[i]["x"]=shape[i]["x"]+shX shape[i]["y"]=shape[i]["y"]+shY If shape[i]["func"]="tri" And (shape[i]["y2"]= 360 Then shape[i]["angle"]=shape[i]["angle"]-360 EndIf EndIf CalcDetectBorder() If shape[i]["pc"]<>"" Then color=shape[i]["pc"] CS_AddColorToPalette() EndIf If shape[i]["bc"]<>"" Then color=shape[i]["bc"] CS_AddColorToPalette() EndIf EndFor shX=0 shY=0 scale=1 EndSub Sub Parse_SkipSpaceInTag isSpace="True" While isSpace char=Text.GetSubText(tag,pTag,1) If Text.IsSubText(" "+CR+LF,char) Then pTag=pTag+1 Else isSpace="False" EndIf EndWhile EndSub Sub Parse_Space isSpace="True" While isSpace char=Text.GetSubText(buf,p,1) If Text.IsSubText(" "+CR+LF,char) Then p=p+1 Else isSpace="False" EndIf EndWhile EndSub Sub Parse_SVG scale=1 iMin=nShapes+1 iMax=nShapes p=1 Parse_Header() Parse_Space() Parse_Defs() While match Parse_Space() Parse_Rect() If match Then iMax=iMax+1 shape[iMax]=shp EndIf If Not[match] Then Parse_Ellipse() If match Then iMax=iMax+1 shape[iMax]=shp EndIf EndIf If Not[match] Then Parse_Polygon() If match Then iMax=iMax+1 shape[iMax]=shp EndIf EndIf If Not[match] Then Parse_Line() If match Then iMax=iMax+1 shape[iMax]=shp EndIf EndIf EndWhile nShapes=iMax Parse_Use() EndSub Sub Parse_Rect match="False" If Text.StartsWith(Text.GetSubTextToEnd(buf,p),LT+"rect") Then param="tag=rect;" Parse_FindTag() Parse_GetAttrAndText() x=attr["x"] y=attr["y"] width=attr["width"] height=attr["height"] Parse_SetStyle() Parse_Angle() shp="" shp["func"]="rect" shp["x"]=x-Math.Floor(pw/2) shp["y"]=y-Math.Floor(pw/2) shp["width"]=width+pw shp["height"]=height+pw shp["angle"]=angle shp["pw"]=pw shp["pc"]=pc shp["bc"]=bc match="True" EndIf EndSub Sub Parse_Use param="tag=use;" Parse_FindTag() Parse_GetAttrAndText() shX=0 shY=0 For i=iMin To iMax shp=shape[i] shp["x"]=shp["x"]+attr["x"] shp["y"]=shp["y"]+attr["y"] If shp["func"]="tri" And (shp["y2"]"" Then color=shp["pc"] CS_AddColorToPalette() EndIf If shp["bc"]<>"" Then color=shp["bc"] CS_AddColorToPalette() EndIf shape[i]=shp CalcDetectBorder() EndFor EndSub Sub Popup_Init TOPY=10 LEFTX=10 DELTAY=36 OPACITY=70 POPUPCOLOR="LightGray" CAPTIONCOLOR="Black" TEXTCOLOR="Black" BORDERCOLOR="#666666" BOXCOLOR="LightGray" SLITCOLOR="#555555" UNDEFINED="N/A" EndSub Sub SB_RotateWorkaround If shp["func"]="tri" Then x1=-Math.Floor(shp["x3"]/2) y1=-Math.Floor(shp["y3"]/2) ElseIf shp["func"]="line" Then x1=-Math.Floor(Math.Abs(shp["x1"]-shp["x2"])/2) y1=-Math.Floor(Math.Abs(shp["y1"]-shp["y2"])/2) EndIf ox=x-x1 oy=y-y1 x=x1*Math.Cos(alpha)-y1*Math.Sin(alpha)+ox y=x1*Math.Sin(alpha)+y1*Math.Cos(alpha)+oy EndSub Sub SB_Workaround color=GraphicsWindow.GetPixel(0,0) If Text.GetLength(color)>7 Then silverlight="True" msWait=300 Else silverlight="False" EndIf EndSub Sub Shapes_Init shX=230 shY=30 shape="" shape[1]="func=tri;x=45;y=0;x1=22;y1=0;x2=0;y2=213;x3=44;y3=213;bc=#6E6E6E;pw=0;" shape[2]="func=rect;x=45;y=212;width=15;height=47;bc=#6E6E6E;pw=0;" shape[3]="func=ell;x=0;y=235;width=66;height=104;bc=#00EEEEEE;pc=#0C95BB;pw=16;" shape[4]="func=tri;x=45;y=0;x1=22;y1=0;x2=0;y2=213;x3=44;y3=213;bc=#939393;pw=0;" shape[5]="func=rect;x=75;y=212;width=14;height=49;bc=#919191;pw=0;" shape[6]="func=ell;x=61;y=163;width=13;height=15;bc=#6E6E6E;pw=0;" shape[7]="func=ell;x=70;y=236;width=64;height=104;bc=#00EEEEEE;pc=#0C95BB;pw=16;" EndSub Sub Shapes_Add Stack.PushValue("local",i) Stack.PushValue("local",x) Stack.PushValue("local",y) Shapes_CalcWidthAndHeight() s=scale For i=iMin To iMax shp=shape[i] GraphicsWindow.PenWidth=shp["pw"]*s If shp["pw"]>0 Then GraphicsWindow.PenColor=shp["pc"] EndIf If Text.IsSubText("rect|ell|tri|text",shp["func"]) Then GraphicsWindow.BrushColor=shp["bc"] EndIf If shp["func"]="rect" Then shp["obj"]=Shapes.AddRectangle(shp["width"]*s,shp["height"]*s) ElseIf shp["func"]="ell" Then shp["obj"]=Shapes.AddEllipse(shp["width"]*s,shp["height"]*s) ElseIf shp["func"]="tri" Then shp["obj"]=Shapes.AddTriangle(shp["x1"]*s,shp["y1"]*s,shp["x2"]*s,shp["y2"]*s,shp["x3"]*s,shp["y3"]*s) ElseIf shp["func"]="line" Then shp["obj"]=Shapes.AddLine(shp["x1"]*s,shp["y1"]*s,shp["x2"]*s,shp["y2"]*s) ElseIf shp["func"]="text" Then If silverlight Then fs=Math.Floor(shp["fs"]*0.9) Else fs=shp["fs"] EndIf GraphicsWindow.FontSize=fs*s GraphicsWindow.FontName=shp["fn"] shp["obj"]=Shapes.AddText(shp["text"]) EndIf x=shp["x"] y=shp["y"] shp["rx"]=x shp["ry"]=y If silverlight And Text.IsSubText("tri|line",shp["func"]) Then alpha=Math.GetRadians(shp["angle"]) SB_RotateWorkaround() shp["wx"]=x shp["wy"]=y EndIf Shapes.Move(shp["obj"],shX+x*s,shY+y*s) If Text.IsSubText("rect|ell|tri|text",shp["func"]) And (shp["angle"]<>0) And (shp["angle"]<>"") Then Shapes.Rotate(shp["obj"],shp["angle"]) EndIf shape[i]=shp EndFor shAngle=0 y=Stack.PopValue("local") x=Stack.PopValue("local") i=Stack.PopValue("local") EndSub Sub Shapes_CalcRotatePos _cx=param["x"]+param["width"]/2 _cy=param["y"]+param["height"]/2 x=_cx-param["cx"] y=_cy-param["cy"] Math_CartesianToPolar() a=a+param["angle"] x=r*Math.Cos(a*Math.Pi/180) y=r*Math.Sin(a*Math.Pi/180) _cx=x+param["cx"] _cy=y+param["cy"] x=_cx-param["width"]/2 y=_cy-param["height"]/2 EndSub Sub Shapes_CalcWidthAndHeight For i=iMin To iMax shp=shape[i] If shp["func"]="tri" Or shp["func"]="line" Then xmin=shp["x1"] xmax=shp["x1"] ymin=shp["y1"] ymax=shp["y1"] If shp["x2"]GQK039.sb< Start>GQK086.sb< Initialise() GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseUp = OnMouseUp While "True" start = Clock.ElapsedMilliseconds MovePlayer() MoveObjects() If (mouseDown <> "True") Then RandomDelete() RandomGold() EndIf GraphicsWindow.Title = "Score = "+score delay = 20 - (Clock.ElapsedMilliseconds-start) If (delay > 0) Then Program.Delay(delay) EndIf EndWhile '======================================================== 'SUBROUTINES '======================================================== Sub Initialise gw = Desktop.Width gh = Desktop.Height GraphicsWindow.Width = gw-14 GraphicsWindow.Height = gh-28 GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 speed = 3 gravity = 0.5 jumpPower = 10 playerSize = 20 rateDisappear = 500 rateGold = 250 objectColor = "DarkBlue" score = 0 GraphicsWindow.BackgroundColor = "LightBlue" GraphicsWindow.PenWidth = 0.2 GraphicsWindow.BrushColor = "Red" GraphicsWindow.FontSize = 25 GraphicsWindow.DrawText(50,50,"Left, Right and Space to Jump") GraphicsWindow.DrawText(50,100,"Draw your own platforms with the mouse") GraphicsWindow.DrawText(50,150,"Delete a platform with right click") GraphicsWindow.DrawText(50,200,"Platforms will randomly disappear") GraphicsWindow.DrawText(50,250,"Collect Gold coins") GraphicsWindow.BrushColor = "Red" player = Shapes.AddEllipse(2*playerSize,2*playerSize) ResetPlayer() GraphicsWindow.BrushColor = objectColor numObject = 1 objectW[numObject] = 100 objectH[numObject] = 20 objectPosX[numObject] = playerPosX objectPosY[numObject] = gh-100 object[numObject] = Shapes.AddRectangle(2*objectW[numObject],2*objectH[numObject]) objectType[numObject] = "Wall" EndSub '======================================================== Sub MovePlayer If (Clock.ElapsedMilliseconds-onGround < 100) Then 'Not in the air playerVelX = 0 'Jump If (keyState["Space"]) Then keyState["Space"] = "False" playerVelY = -jumpPower EndIf EndIf 'Forwards-backwards If (keyState["Left"] And collisionData["Left"] <> "True") Then playerVelX = -speed EndIf If (keyState["Right"] And collisionData["Right"] <> "True") Then playerVelX = speed EndIf 'Update position (move player or objects depending on player position) If ((playerPosX < gw/5 And playerVelX < 0) Or (playerPosX > gw/2 And playerVelX > 0))Then For i = 1 To numObject objectPosX[i] = objectPosX[i]-playerVelX EndFor Else playerPosX = playerPosX+playerVelX EndIf playerPosY = playerPosY+playerVelY 'Check for collision overlap Collisions() If (collisionData<> "") Then 'TextWindow.WriteLine(collisionData) EndIf If (collisionData = "" Or collisionData["Wall"]) Then 'Left obstacle If (collisionData["Left"]) Then playerVelX = 0 playerPosX = playerPosX+speed Endif 'Right obstacle If (collisionData["Right"]) Then playerVelX = 0 playerPosX = playerPosX-speed EndIf 'Top obstacle If (collisionData["Top"]) Then playerVelY = 0 playerPosY = playerPosY+speed EndIf ''Gravity and Bottom obstacle If (collisionData["Bottom"]) Then playerVelY = 0 onGround = Clock.ElapsedMilliseconds playerPosY = playerPosY-1 Collisions() While (collisionData["Bottom"]) playerPosY = playerPosY-1 Collisions() EndWhile playerPosY = playerPosY+1 Else playerVelY = playerVelY+gravity If (playerPosY >= gh+playerSize) Then score = score-1 ResetPlayer() EndIf EndIf ElseIf (collisionData["Gold"]) Then i = collisionData["Index"] DeleteObject() score = score+1 EndIf Shapes.Move(player,playerPosX-playerSize,playerPosY-playerSize) EndSub '======================================================== Sub ResetPlayer playerPosX = gw/4 playerPosY = playerSize playerVelX = 0 playerVelY = 0 EndSub '======================================================== Sub Collisions collisionData= "" edgeScale = 0.5 For i = 1 To numObject testX = playerPosX testY = playerPosY+playerSize CheckOverlap() If (overlap) Then collisionData["Bottom"] = "True" EndIf testX = playerPosX-playerSize*edgeScale testY = playerPosY+playerSize CheckOverlap() If (overlap) Then collisionData["Bottom"] = "True" EndIf testX = playerPosX+playerSize*edgeScale testY = playerPosY+playerSize CheckOverlap() If (overlap) Then collisionData["Bottom"] = "True" EndIf testX = playerPosX testY = playerPosY-playerSize CheckOverlap() If (overlap) Then collisionData["Top"] = "True" EndIf testX = playerPosX-playerSize*edgeScale testY = playerPosY-playerSize CheckOverlap() If (overlap) Then collisionData["Top"] = "True" EndIf testX = playerPosX+playerSize*edgeScale testY = playerPosY-playerSize CheckOverlap() If (overlap) Then collisionData["Top"] = "True" EndIf testX = playerPosX-playerSize testY = playerPosY CheckOverlap() If (overlap) Then collisionData["Left"] = "True" EndIf testX = playerPosX-playerSize testY = playerPosY-playerSize*edgeScale CheckOverlap() If (overlap) Then collisionData["Left"] = "True" EndIf testX = playerPosX-playerSize testY = playerPosY+playerSize*edgeScale CheckOverlap() If (overlap) Then collisionData["Left"] = "True" EndIf testX = playerPosX+playerSize testY = playerPosY CheckOverlap() If (overlap) Then collisionData["Right"] = "True" EndIf testX = playerPosX+playerSize testY = playerPosY-playerSize*edgeScale CheckOverlap() If (overlap) Then collisionData["Right"] = "True" EndIf testX = playerPosX+playerSize testY = playerPosY+playerSize*edgeScale CheckOverlap() If (overlap) Then collisionData["Right"] = "True" EndIf If (collisionData<> "") Then collisionData[objectType[i]] = "True" collisionData["Index"] = i i = numObject EndIf EndFor EndSub '======================================================== Sub CheckOverlap If (testX < objectPosX[i]+objectW[i] And testX > objectPosX[i]-objectW[i] And testY < objectPosY[i]+objectH[i] And testY > objectPosY[i]-objectH[i]) Then overlap = "True" Else overlap = "false" EndIf EndSub '======================================================== Sub MoveObjects For i = 1 To numObject If (objectPosX[i] < -gw) Then objectPosX[i] = objectPosX[i]+3*gw EndIf If (objectPosX[i] > 2*gw) Then objectPosX[i] = objectPosX[i]-3*gw EndIf Shapes.Move(object[i],objectPosX[i]-objectW[i],objectPosY[i]-objectH[i]) EndFor If (mouseDown) Then x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY objectW[numObject+1] = Math.Abs(x-startX)/2 objectH[numObject+1] = Math.Abs(y-startY)/2 objectPosX[numObject+1] = Math.Min(x,startX)+objectW[numObject+1] objectPosY[numObject+1] = Math.Min(y,startY)+objectH[numObject+1] GraphicsWindow.BrushColor = GraphicsWindow.BackgroundColor GraphicsWindow.FillRectangle(0,0,gw,gh) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawRectangle(objectPosX[numObject+1]-objectW[numObject+1],objectPosY[numObject+1]-objectH[numObject+1],2*objectW[numObject+1],2*objectH[numObject+1]) EndIf If (delete) Then delete = "False" For i = 1 To numObject testX = startX testY = startY CheckOverlap() If (overlap) Then DeleteObject() i = numObject EndIf EndFor EndIf EndSub '======================================================== Sub DeleteObject Shapes.Remove(object[i]) For j = i+1 To numObject object[j-1] = object[j] objectW[j-1] = objectW[j] objectH[j-1] = objectH[j] objectPosX[j-1] = objectPosX[j] objectPosY[j-1] = objectPosY[j] objectType[j-1] = objectType[j] EndFor numObject = numObject-1 EndSub '======================================================== Sub RandomDelete If (numObject > 0 And Math.GetRandomNumber(rateDisappear) = 1) Then i = Math.GetRandomNumber(numObject) DeleteObject() EndIf EndSub '======================================================== Sub AddGold GraphicsWindow.BrushColor = "Gold" numObject = numObject+1 objectW[numObject] = playerSize objectH[numObject] = playerSize objectPosX[numObject] = Math.GetRandomNumber(3*gw) - gw objectPosY[numObject] = gh/8+Math.GetRandomNumber(gh/2) object[numObject] = Shapes.AddEllipse(2*objectW[numObject],2*objectH[numObject]) objectType[numObject] = "Gold" EndSub '======================================================== Sub RandomGold If (Math.GetRandomNumber(rateGold) = 1) Then AddGold() EndIf EndSub '======================================================== 'EVENT SUBROUTINES '======================================================== Sub OnKeyDown key = GraphicsWindow.LastKey keyState[key] = "True" EndSub Sub OnKeyUp key = GraphicsWindow.LastKey keyState[key] = "False" EndSub Sub OnMouseDown startX = GraphicsWindow.MouseX startY = GraphicsWindow.MouseY If (Mouse.IsRightButtonDown) Then delete = "True" Else mouseDown = "True" EndIf EndSub Sub OnMouseUp If (mouseDown) Then GraphicsWindow.BrushColor = GraphicsWindow.BackgroundColor GraphicsWindow.FillRectangle(0,0,gw,gh) GraphicsWindow.BrushColor = objectColor If (objectW[numObject+1] < 5) Then objectW[numObject+1] = 5 EndIf If (objectH[numObject+1] < 20) Then objectH[numObject+1] = 20 EndIf object[numObject+1] = Shapes.AddRectangle(2*objectW[numObject+1],2*objectH[numObject+1]) objectType[numObject+1] = "Wall" numObject = numObject+1 mouseDown = "False" EndIf EndSub End>GQK086.sb< Start>GQK843.sb< GraphicsWindow.Title = "CubModeler" GraphicsWindow.BackgroundColor = "teal Init() LDUtilities.ShowErrors="false args=0 ss=8 dx=50 dy=24 p300=300 objmd="true ob=1 ii=1 par = "y=-2;x=4;z=0;color=darkblue|y=-2;x=1;z=0;color=darkblue dvox() param = "y="+(dy-4)+";x="+dx+";z=1;width=3;height=5;depth=1;color=Red DrawCuboid() par = "y=-4;x=5;z=1;color=Yellow|y=-3;x=5;z=1;color=Red|y=-2;x=5;z=1;color=Yellow dvox() param = "y="+(dy-4)+";x="+(4+dx)+";z=2;width=3;height=1;depth=1;color=Orange;" DrawCuboid() For r=1 to 360 cmat[r]= LDColours.HSLtoRGB (r,1,0.4) endfor dx=10 dy=10 z45=20 objmd="false For zz=1 to z45 GraphicsWindow.Title =">>"+zz For xx=1 to 50 For yy=1 To 50 cdf[zz][xx][yy]=0 endfor EndFor endfor f=10 For z=1 To z45 If z>4 Then f=f-.5 endif GraphicsWindow.Title =z For t=0 to 720 Step 2 py=math.Floor(LDMath.Sin(t+90)*(f+t/30))+25 px=math.Floor(LDMath.cos(t+90)*(f+t/30))+25 cdf[z][px][py]=t/2 EndFor endfor For zz=1 to z45 GraphicsWindow.Title =">>"+zz For xxx=1 to 50 For xyy=1 To 50 co=cdf[zz][xxx][xyy] If co>0 Then GraphicsWindow.Title="**"+zz param = "y="+xyy+";x="+xxx+";z="+zz+";color="+cmat[co] drawvoxel () endif endfor EndFor endfor Sub smove For tt=1 to args[3] for w=1 to Array.GetItemCount (po[ii]) Shapes.Move(po[ii][w],Shapes.GetLeft(po[ii][w])+args[1],Shapes.Gettop(po[ii][w])+args[2]) endfor Program.Delay(p300) endfor EndSub Sub dvox pa=LDText.Split (par,"|") For r=1 to Array.GetItemCount (pa) param=pa[r] DrawVoxel() endfor EndSub Sub drawvoxel LDCall.Function5 ("drawcube" param["x"]+dx param["y"]+dy param["z"] ss param["color"]) EndSub Sub DrawCuboid Stack.PushValue("local", param) xmin = param["x"] ymin = param["y"] zmin = param["z"] xmax = param["height"] + xmin - 1 ymax = param["width"] + ymin - 1 zmax = param["depth"] + zmin - 1 sColor = param["color"] For _z = zmin To zmax For _y = ymin To ymax For _x = xmin To xmax LDCall.Function5("drawcube",_x _y _z ss sColor ) EndFor EndFor EndFor param = Stack.PopValue("local") EndSub Sub Conv3Dto2D cx = gw / 2 - Math.SquareRoot(1 / 2) * args[1]*ss cx = cx + Math.SquareRoot(1 / 2) * args[2]*ss cy = gh / 2 + Math.SquareRoot(1 / 6) * args[1]*ss cy = cy + Math.SquareRoot(1 / 6) * args[2]*ss cy = cy - Math.SquareRoot(2 / 3) * args[3]*ss EndSub Sub Color_RGBtoHSL rHue=LDColours.GetHue (sColor) rLightness=LDColours.GetLightness(sColor ) rSaturation=LDColours.GetSaturation (sColor ) EndSub Sub DrawCube lz=args[3] xx=args[1] yy=args[2] Conv3Dto2D() edge = Math.SquareRoot(2 / 3) * args[4] x1 = math.Round (cx) y1 = math.Round (cy) sColor = args[5] ccc=ldcolours.GetHue(scolor) For i=1 To 3 color[i] = LDColours.HSLtoRGB(ccc 1 .8/Math.Power(1.5 i)) EndFor GraphicsWindow.PenWidth =0 x3=0 x4=0 y3=0 y4=0 For a = 60 To 420 Step 60 x2 = math.Round (cx - edge * ldMath.Sin(a)) y2 = math.Round (cy - edge * ldMath.Cos(a)) If a>60 and math.Remainder ((a-60),120)=0 Then ppp=0 ppp[1][1]=x1+50 ppp[1][2]=y1-30 ppp[2][1]=x2+50 ppp[2][2]=y2-30 ppp[3][1]=x3+50 ppp[3][2]=y3-30 ppp[4][1]=x4+50 ppp[4][2]=y4-30 of=1 If objmd then po[ob][pc]=LDShapes.AddPolygon (ppp) LDShapes.BrushColour(po[ob][pc],color[(a-60)/120]) pc=pc+1 else br=LDShapes.BrushGradient("1="+color[(a-60) / 120]+";2="+color[(a-60) / 120],"V") LDShapes.BrushPolygon (br,ppp) endif EndIf x4 = x3 y4 = y3 x3 = x2 y3 = y2 EndFor EndSub Sub Init gw = 800 gh = 800 GraphicsWindow.BackgroundColor ="teal GraphicsWindow.Left =10 GraphicsWindow.top=10 GraphicsWindow.Width = gw GraphicsWindow.Height = gh xo = gw / 2 yo = gh * 3 / 4 u = 20 r = u * Math.SquareRoot(2 / 3) a60 = Math.GetRadians(60) EndSub End>GQK843.sb< Start>GQM141.sb< 'The lines are straight gw = 500 gh = gw GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BackgroundColor = "Gray" For row = 1 To 20 For col = 0 To 10 x = (col-1)*50+2 y = (row-1)*25+2 If (Math.Remainder(row,2) = 1) Then x = x+12 EndIf GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(x,y,23,23) GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle(x+25,y,23,23) EndFor EndFor End>GQM141.sb< Start>GQM958.sb< 'Challenge of the Month - January 2019 'Graphics Challenge: '1. Draw a picture of a space ship '2. Give it a cool space starry background gw = 615 gh = 850 GraphicsWindow.Hide() GraphicsWindow.Left = (Desktop.Width - gw) /2 GraphicsWindow.Top = (Desktop.Height - gh) /2 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BackgroundColor = "MidnightBlue" GraphicsWindow.Show() GraphicsWindow.KeyDown = ExitProgram Ellipse1() Ellipse2() Ellipse3() Ellipse4() Triangle1() Triangle2() Triangle3() 'Triangle4() 'GraphicsWindow.PenColor = "Yellow" 'GraphicsWindow.PenWidth = 9 'Shapes.AddLine(263, 330, 358, 330) 'GraphicsWindow.PenColor = "Yellow" 'Shapes.HideShape(Elli6) 'Elli6 = Shapes.AddEllipse(6, 6) 'Shapes.Move(Elli6, 259, 328) 'Shapes.HideShape(Ellip7) 'Ellip7 = Shapes.AddEllipse(7, 8) 'Shapes.Move(Ellip7, 355, 327) 'Ellipse - Main body of Space Ship Sub Ellipse1 GraphicsWindow.PenColor = "Black" GraphicsWindow.PenWidth = 8 GraphicsWindow.BrushColor = "Yellow" Elli8 = Shapes.AddEllipse(263, 393) Shapes.HideShape(Elli8) Shapes.Move(Elli8, 180, 307) Shapes.ShowShape(Elli8) EndSub 'Left Triangle (Bottom Left of main body of Space Ship) Sub Triangle1 GraphicsWindow.PenColor = "Black" GraphicsWindow.PenWidth = 8 GraphicsWindow.BrushColor = "Yellow" Shapes.AddTriangle(197, 590, 250, 700, 380, 700) EndSub 'Right Triangle (Bottom Right of main body of Space Ship) Sub Triangle2 GraphicsWindow.PenColor = "Black" GraphicsWindow.PenWidth = 8 GraphicsWindow.BrushColor = "Yellow" Shapes.AddTriangle(390, 700, 422, 600, 315, 700) EndSub 'Top Triangle of main body of Space Ship Sub Triangle3 GraphicsWindow.PenColor = "Black" GraphicsWindow.PenWidth = 8 GraphicsWindow.BrushColor = "Yellow" Shapes.AddTriangle(310, 270, 255, 330, 366, 330) EndSub 'Window 1 Sub Ellipse2 GraphicsWindow.PenColor = "Black" GraphicsWindow.PenWidth = 8 GraphicsWindow.BrushColor = "Teal" Elli9 = Shapes.AddEllipse(105, 57) Shapes.HideShape(Elli9) Shapes.Move(Elli9, 260, 354) Shapes.ShowShape(Elli9) EndSub 'Window 2 Sub Ellipse3 GraphicsWindow.PenColor = "Black" GraphicsWindow.PenWidth = 8 GraphicsWindow.BrushColor = "Teal" Elli10 = Shapes.AddEllipse(105, 57) Shapes.HideShape(Elli10) Shapes.Move(Elli10, 260, 429) Shapes.ShowShape(Elli10) EndSub 'Window 3 Sub Ellipse4 GraphicsWindow.PenColor = "Black" GraphicsWindow.PenWidth = 8 GraphicsWindow.BrushColor = "Teal" Elli11 = Shapes.AddEllipse(105, 57) Shapes.HideShape(Elli11) Shapes.Move(Elli11, 260, 504) Shapes.ShowShape(Elli11) EndSub 'Start of First Wing 'Sub Triangle4 ' GraphicsWindow.PenColor = "Black" ' GraphicsWindow.PenWidth = 8 ' GraphicsWindow.BrushColor = "Yellow" ' Shapes.AddTriangle(187, 700, 250, 700, 226, 772) 'EndSub 'Background with Stars For i = 0 To 800 GraphicsWindow.FontSize = Math.GetRandomNumber(30) x = Math.GetRandomNumber(GraphicsWindow.Width) y = Math.GetRandomNumber(GraphicsWindow.Height) GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor() GraphicsWindow.DrawText(x, y, "*") Program.Delay(10) EndFor 'Close Program Sub ExitProgram If GraphicsWindow.LastKey = "Escape" Then Program.End() EndIf EndSub End>GQM958.sb< Start>GQP435.sb< 'Example SQL taken from http://zetcode.com/db/sqlite/select/ 'Set a database file - it is created if it doesn't exist yet datFile = Program.Directory+"\database.db" database = LDDataBase.ConnectSQLite(datFile) 'Create a listview control to view the table data GraphicsWindow.Show() dataView = LDDataBase.AddDataView(GraphicsWindow.Width,GraphicsWindow.Height-50) If ("True") Then 'Turn to false to useexisting database 'Create a Cars table command = "BEGIN TRANSACTION;" command = command + "DROP TABLE IF EXISTS Cars;" command = command + "CREATE TABLE Cars(Id INTEGER PRIMARY KEY, Name TEXT, Cost NUM);" command = command + "INSERT INTO Cars(Name,Cost)VALUES('Audi','52642');" command = command + "INSERT INTO Cars(Name,Cost)VALUES('Mercedes','57127');" command = command + "INSERT INTO Cars(Name,Cost)VALUES('Skoda','9000');" command = command + "INSERT INTO Cars(Name,Cost)VALUES('Volvo','29000');" command = command + "INSERT INTO Cars(Name,Cost)VALUES('Bentley','350000');" command = command + "INSERT INTO Cars(Name,Cost)VALUES('Citroen','21000');" command = command + "INSERT INTO Cars(Name,Cost)VALUES('Hummer','41400');" command = command + "INSERT INTO Cars(Name,Cost)VALUES('Volkswagen','21600');" command = command + "COMMIT;" LDDataBase.Command(database,command) EndIf save =Controls.AddButton("Save",100,GraphicsWindow.Height-40) Controls.ButtonClicked = OnButtonClicked LDDataBase.EditTable(database,"Cars",dataView) Sub OnButtonClicked LDDataBase.SaveTable(database,dataView) EndSub End>GQP435.sb< Start>GQP792.sb< cd="~;yy=40.685;xx=118.53|~;yy=40.685;xx=158.53|~;yy=40.685;xx=198.53|~;yy=40.685;xx=238.53|~;yy=40.685;xx=298.53|~;yy=40.685;xx=378.53|~;yy=40.685;xx=418.53|~;yy=40.685;xx=478.53|~;yy=40.685;xx=558.53|~;yy=40.685;xx=598.53|~;yy=40.685;xx=658.53|~;yy=40.685;xx=738.53|~;yy=100.69;xx=658.53|~;yy=100.69;xx=738.53|~;yy=140.69;xx=658.53|~;yy=140.69;xx=738.53|~;yy=260.69;xx=658.53|~;yy=260.69;xx=738.53|~;yy=100.69;xx=878.53|~;yy=100.69;xx=918.53|~;yy=140.69;xx=798.53|~;yy=140.69;xx=878.53|hh=80;ww=40;yy=140.69;xx=918.53|~;yy=180.69;xx=798.53|~;yy=180.69;xx=878.53|~;yy=220.69;xx=798.53|~;yy=220.69;xx=878.53|hh=40;ww=80;yy=260.69;xx=798.53|~;yy=260.69;xx=878.53|hh=80;ww=40;yy=220.69;xx=918.53|~;yy=100.69;xx=38.526|~;yy=100.69;xx=78.526|~;yy=100.69;xx=118.53|~;yy=100.69;xx=158.53|~;yy=100.69;xx=198.53|~;yy=100.69;xx=238.53|~;yy=100.69;xx=278.53|~;yy=100.69;xx=318.53|~;yy=100.69;xx=358.53|~;yy=100.69;xx=398.53|~;yy=100.69;xx=438.53|~;yy=100.69;xx=478.53|~;yy=100.69;xx=518.53|~;yy=100.69;xx=558.53|~;yy=100.69;xx=598.53|hh=40;ww=60;yy=140.69;xx=38.526|~;yy=140.69;xx=98.526|~;yy=140.69;xx=138.53|~;yy=140.69;xx=178.53|~;yy=140.69;xx=218.53|~;yy=140.69;xx=258.53|~;yy=140.69;xx=298.53|~;yy=140.69;xx=338.53|~;yy=140.69;xx=378.53|~;yy=140.69;xx=418.53|~;yy=140.69;xx=458.53|~;yy=140.69;xx=498.53|~;yy=140.69;xx=538.53|hh=40;ww=60;yy=180.69;xx=38.526|~;yy=180.69;xx=118.53|~;yy=180.69;xx=158.53|~;yy=180.69;xx=198.53|~;yy=180.69;xx=238.53|~;yy=180.69;xx=278.53|~;yy=180.69;xx=318.53|~;yy=180.69;xx=358.53|~;yy=180.69;xx=398.53|~;yy=180.69;xx=438.53|~;yy=180.69;xx=478.53|~;yy=180.69;xx=518.53|hh=40;ww=20;yy=180.69;xx=98.526|~;yy=220.69;xx=138.53|~;yy=220.69;xx=178.53|~;yy=220.69;xx=218.53|~;yy=220.69;xx=258.53|~;yy=220.69;xx=298.53|~;yy=220.69;xx=338.53|~;yy=220.69;xx=378.53|~;yy=220.69;xx=418.53|~;yy=220.69;xx=458.53|~;yy=220.69;xx=498.53|hh=40;ww=100;yy=220.69;xx=538.53|hh=40;ww=100;yy=220.69;xx=38.526|~;yy=260.69;xx=38.526|hh=40;ww=60;yy=260.69;xx=78.526|hh=40;ww=60;yy=260.69;xx=138.53|hh=40;ww=240;yy=260.69;xx=198.53|hh=40;ww=60;yy=260.69;xx=438.53|hh=40;ww=60;yy=260.69;xx=498.53|~;yy=260.69;xx=558.53|~;yy=260.69;xx=598.53|~;yy=40.685;xx=38.526|~;yy=40.685;xx=698.53|~;yy=140.69;xx=698.53|~;yy=40.685;xx=338.53|~;yy=40.685;xx=518.53|~;yy=260.69;xx=698.53|~;yy=220.69;xx=698.53|~;yy=220.69;xx=838.53|~;yy=180.69;xx=838.53|~;yy=140.69;xx=838.53|~;yy=100.69;xx=838.53|~;yy=100.69;xx=798.53|~;yy=100.69;xx=698.53|hh=40;ww=160;yy=40.685;xx=798.53|hh=8;ww=16;yy=56.685;xx=826.71|hh=8;ww=16;yy=56.685;xx=870.53|hh=8;ww=16;yy=56.685;xx=914.34 cd=LDText.Replace(cd "~" "hh=40;ww=40") cc=LDText.Split(cd "|") cm="yy=116.14627;xx=58.525745;cc=~|yy=133.78528;xx=58.525745;cc=`|yy=116.14627;xx=98.525742;cc=!|yy=133.78528;xx=98.525742;cc=1|yy=116.14627;xx=138.52574;cc=@|yy=133.78528;xx=138.52574;cc=2|yy=116.14627;xx=178.52574;cc=#0|yy=133.78528;xx=178.52574;cc=3|yy=116.14627;xx=218.52574;cc=$|yy=133.78528;xx=218.52574;cc=4|yy=116.14627;xx=258.52576;cc=%|yy=133.78528;xx=258.52576;cc=5|yy=116.14627;xx=298.52576;cc=^|yy=133.78528;xx=298.52576;cc=6|yy=116.14627;xx=338.52576;cc=&|yy=133.78528;xx=338.52576;cc=7|yy=116.14627;xx=378.52576;cc=*|yy=133.78528;xx=378.52576;cc=8|yy=116.14627;xx=418.52576;cc=(|yy=133.78528;xx=418.52576;cc=9|yy=116.14627;xx=458.52576;cc=)|yy=133.78528;xx=458.52576;cc=0|yy=116.14627;xx=498.52576;cc=_|yy=133.78528;xx=498.52576;cc=-|yy=116.14627;xx=538.52576;cc=+|yy=133.78528;xx=538.52576;cc=#1|yy=116.14627;xx=578.52576;cc=#4|yy=133.78528;xx=578.52576;cc=\|yy=124.96627;xx=618.52576;cc=←|yy=164.96628;xx=68.525742;cc=Tab|yy=164.96628;xx=118.52574;cc=Q|yy=164.96628;xx=158.52574;cc=W|yy=164.96628;xx=198.52574;cc=E|yy=164.96628;xx=238.52574;cc=R|yy=164.96628;xx=278.52576;cc=T|yy=164.96628;xx=318.52576;cc=Y|yy=164.96628;xx=358.52576;cc=U|yy=164.96628;xx=398.52576;cc=I|yy=164.96628;xx=438.52576;cc=O|yy=164.96628;xx=478.52576;cc=P|yy=156.14627;xx=518.52576;cc={|yy=173.78528;xx=518.52576;cc=[|yy=156.14627;xx=558.52576;cc=}|yy=173.78528;xx=558.52576;cc=]|yy=204.96628;xx=598.52576;cc=Enter|yy=204.96628;xx=68.525742;cc=Caps|yy=204.96628;xx=138.52574;cc=A|yy=204.96628;xx=178.52574;cc=S|yy=204.96628;xx=218.52574;cc=D|yy=204.96628;xx=258.52576;cc=F|yy=204.96628;xx=298.52576;cc=G|yy=204.96628;xx=338.52576;cc=H|yy=204.96628;xx=378.52576;cc=J|yy=204.96628;xx=418.52576;cc=K|yy=204.96628;xx=458.52576;cc=L|yy=196.14627;xx=498.52576;cc=:|yy=213.78528;xx=498.52576;cc=#5|yy=196.14627;xx=538.52576;cc=#8|yy=213.78528;xx=538.52576;cc=#9|yy=244.96628;xx=158.52574;cc=Z|yy=244.96628;xx=198.52574;cc=X|yy=244.96628;xx=238.52574;cc=C|yy=244.96628;xx=278.52576;cc=V|yy=244.96628;xx=318.52576;cc=B|yy=244.96628;xx=358.52576;cc=N|yy=244.96628;xx=398.52576;cc=M|yy=236.14627;xx=438.52576;cc=#2;|yy=253.78528;xx=438.52576;cc=,|yy=236.14627;xx=478.52576;cc=#3;|yy=253.78528;xx=478.52576;cc=.|yy=236.14627;xx=518.52576;cc=?|yy=253.78528;xx=518.52576;cc=/|yy=244.96628;xx=588.52576;cc=Shift|yy=244.96628;xx=88.525742;cc=Shift|yy=284.96628;xx=58.525745;cc=Ctrl|yy=284.96628;xx=168.52574;cc=Alt|yy=284.96628;xx=468.52576;cc=Alt|yy=284.96628;xx=618.52576;cc=Ctrl|yy=215.07796;xx=818.52527;cc=#!2190|yy=215.07796;xx=898.52527;cc=#!2192|yy=256.20148;xx=858.52527;cc=#!2193|yy=176.20148;xx=858.52527;cc=#!2191|yy=64.965874;xx=58.525745;cc=Esc|yy=64.965874;xx=138.52574;cc=F1|yy=64.965874;xx=178.52574;cc=F2|yy=64.965874;xx=218.52574;cc=F3|yy=64.965874;xx=258.52576;cc=F4|yy=64.965874;xx=318.52576;cc=F5|yy=64.965874;xx=358.52576;cc=F6|yy=64.965874;xx=398.52576;cc=F7|yy=64.965874;xx=438.52576;cc=F8|yy=64.965874;xx=498.52576;cc=F9|yy=64.965874;xx=538.52576;cc=F10|yy=64.965874;xx=578.52576;cc=F11|yy=64.965874;xx=618.52576;cc=F12|yy=284.96628;xx=678.52576;cc=#!2190|yy=284.96628;xx=758.52576;cc=#!2192|yy=284.96628;xx=718.52576;cc=#!2193|yy=244.96628;xx=718.52576;cc=#!2191|yy=124.96627;xx=898.52576;cc=*|yy=124.96627;xx=938.52576;cc=-|yy=164.96628;xx=818.52576;cc=7|yy=164.96628;xx=898.52576;cc=9|yy=184.96628;xx=938.52576;cc=+|yy=204.96628;xx=818.52576;cc=4|yy=204.96628;xx=898.52576;cc=6|yy=244.96628;xx=818.52576;cc=1|yy=244.96628;xx=898.52576;cc=3|yy=284.96628;xx=838.52576;cc=0|yy=284.96628;xx=898.52576;cc=.|yy=244.96628;xx=858.52576;cc=2|yy=204.96628;xx=858.52576;cc=5|yy=164.96628;xx=858.52576;cc=8|yy=124.96627;xx=858.52576;cc=/ ct=LDText.Split(cm "|") cn="yy=123.24327;xx=678.52576;cc=Insert|yy=117.95227;xx=758.52576;cc=Page|yy=128.53526;xx=758.52576;cc=Up|yy=163.24327;xx=678.52576;cc=Delete|yy=157.95227;xx=758.52576;cc=Page|yy=168.53528;xx=758.52576;cc=Down|yy=163.24327;xx=718.52576;cc=End|yy=123.24327;xx=718.52576;cc=Home|yy=263.24329;xx=938.52576;cc=Enter|yy=117.95227;xx=818.52576;cc=Num|yy=128.53526;xx=818.52576;cc=Lock|yy=173.82727;xx=818.52527;cc=Home|yy=173.82727;xx=898.52527;cc=PgUp|yy=253.82727;xx=818.52527;cc=End|yy=253.82727;xx=898.52527;cc=PgDn|yy=293.82727;xx=838.52527;cc=Ins|yy=293.82727;xx=898.52527;cc=Del|yy=52.660267;xx=678.52576;cc=Print|yy=63.243568;xx=678.52576;cc=Scrn|yy=73.826973;xx=678.52576;cc=SysRq|yy=57.951969;xx=758.52576;cc=Pause|yy=68.535271;xx=758.52576;cc=Break|yy=57.951969;xx=718.52576;cc=Scroll|yy=68.535271;xx=718.52576;cc=Lock kt=LDText.Split(cn "|") GraphicsWindow.PenWidth=.5 GraphicsWindow.BrushColor="lightgray GraphicsWindow.BackgroundColor="darkgray ac=Array.GetItemCount(cc) ac1=Array.GetItemCount(ct) ac11=Array.GetItemCount(kt) ss="!71!85!89!90!" GraphicsWindow.Width=970 GraphicsWindow.Height=310 rrr=LDText.Split("=!!|!;!~6!~7!''" "!") rrr[0]="# GraphicsWindow.Title="PC Classic 101key Kbd bb=LDShapes.BrushGradient("1=white;2=gray" "DD") LDShapes.BrushRoundedRectangle(bb cc[44]["xx"]cc[48]["yy"] 80 80 8) 'Program.Delay(333) For x=1 To ac If Text.IsSubText(ss "!"+x+"!") Then Else LDShapes.BrushRoundedRectangle(bb cc[x]["xx"] cc[x]["yy"] cc[x]["ww"] cc[x]["hh"] 8) 'rr[x]=Shapes.AddRectangle(cc[x]["ww"] cc[x]["hh"]) 'Shapes.Move(rr[x] cc[x]["xx"] cc[x]["yy"]) 'Shapes.Zoom(rr[x] .9 .95) EndIf EndFor GraphicsWindow.BrushColor="black For x=1 To ac1 tt=Shapes.AddText(ldcall.Function("rpp" ct[x]["cc"])) Shapes.Move(tt ct[x]["xx"]-8 ct[x]["yy"]-13) EndFor GraphicsWindow.FontSize=9 For x=1 To ac11 tt=Shapes.AddText(kt[x]["cc"]) Shapes.Move(tt kt[x]["xx"]-12 kt[x]["yy"]-8) EndFor For x=1 To -ac GraphicsWindow.BrushColor="red GraphicsWindow.FillRectangle(cc[x]["xx"] cc[x]["yy"] 20 20) GraphicsWindow.Title=x ' LDShapes.BrushColour(rr[x] "red") Program.Delay(444) ' LDShapes.BrushColour(rr[x] "white") EndFor args=0 Sub rpp If Text.StartsWith(args[1] "#!") Then return=Text.GetCharacter(ldmath.Base2Decimal( Text.GetSubTextToEnd(args[1] 3) 16)) ElseIf Text.StartsWith(args[1] "#") Then return=rrr[Text.GetSubTextToEnd(args[1] 2)] Else return=args[1] EndIf EndSub End>GQP792.sb< Start>GQP876.sb< GraphicsWindow.Show() GraphicsWindow.Width=600 GraphicsWindow.Height=600 TextWindow.Write("Enter X parameter: ") XT=TextWindow.ReadNumber() TextWindow.Write("Enter Y parameter: ") YT=TextWindow.ReadNumber() TextWindow.Hide() For vi=0 To 2*Math.Pi Step 0.0005 GraphicsWindow.SetPixel(300+250*Math.sin(XT*vi),300+250*Math.sin(YT*vi),"black") EndFor End>GQP876.sb< Start>GQQ201.sb< Get Microsoft Silverlight Embed this in your website '*************************************************** ' Small Basic Chomper (SBC) v 1.0 ' Pacman-style game (BETA) 'Version 1.3.7.13 (online version) ' ' Software designed & written in BASIC by Anthony Yarrell (QBasicLover in the SB forums) ' Designed for Microsoft Small Basic 1.0 ' March 2013 ' 'Sprites created using Microsoft Paint 'Maze designed using Microsoft Excel ' 'My Research Sources: '=============== 'Sprite Management & Animation: "Visual Basic Game Programming for Teens", Jonathan S. Harbour; '"Video Game Programming for Teens", Jonathan S. Harbour; Microsoft Small Basic Forums. 'Pacman Sprite Behavior: "The Pacman Dossier" http://home.comcast.net/~jpittman2/pacman/pacmandossier.html; 'Creating a Pacman Maze: http://stackoverflow.com/questions/622471/pacman-maze-in-java; ' '*************************************************** 'These variables control game play: BRAND_NEW_GAME = 0 PLAY_LEVEL = 1 ADVANCE_LEVEL = 2 REPLAY_LEVEL = 3 GAME_OVER = 4 gameState = BRAND_NEW_GAME 'Initialization: mazeScale = 8 'Size of maze and distance between tiles. The game runs better when 'the mazeScale is 2 x the number of animation frames. I set the total animation frames 'to 4 because it gave the best performance while making the math easier. gameScreenHeight = 375 gamescreenWidth = 225 monsterEatenCtr = 0 'Counts the number of monsters eaten in succession per energizer (4= bonus) monsterBonusPts = 1000 'Pts given to player for eating 4 monsters in succession. monsterPts = 200 'Points player gets when he/she eats a monster. monsterPtsMuliplier = 2 'Causes player to get bonus points when monsters are eaten in succession. monstersEatenPerLevel = 0'Counts the number of mosters eaten per level. SBC gets a life if he eats 16 monsters per level. gameSpeed = 20'<-- Decrease if game runs too slowly gameScore = 0 gameLevel = 0 pelletScore = 25 energizerScore = 100 hasReached50K = "False" 'Flag to track if score reaches 50,000. Player gets extra life. initialCountDownTime = 80 'Amount of time (cycles) the monsters stay "frightened" globalCycleCtr = 0 'Used for syncronization and scheduling. '********************************** 'Game loop '*********************************** While (gameState <> GAME_OVER) keyPressed = GraphicsWindow.LastKey start = Clock.ElapsedMilliseconds globalCycleCtr = globalCycleCtr + 1 If (gameState = BRAND_NEW_GAME) Then InitializeLookupTables() SetupGraphicsWindow() LoadBitmaps() InitializeSprites() SpriteArray[SBC][Lives] = 3 gameState = ADVANCE_LEVEL ElseIf (gameState = ADVANCE_LEVEL) Then globalCycleCtr = 0 monstersEatenPerLevel = 0 selectedRotation = 0 ' SBC goes through 4 max rotations. sbcDirection = Dir_R ' SBC moves to the right when level starts. SmallDelay() UpdateLevelState() ConstructGameElements() splashText = "L E V E L : "+ gameLevel DisplayLevelSplash() gameState = PLAY_LEVEL ElseIf (gameState = PLAY_LEVEL) Then LeaveMonsterPenOneByOne() 'Each sprite has a counter that it uses to track when it reaches a tile when moving though the maze. 'When this counter reaches mazeScale, the sprite updates it info and draws. 'Each sprite also has a spritespeed variable that it uses to set its movement speed. For example, 'if spritespeed = 1 then updates will be done on each tick of the global counter. If spritespeed = 2 then 'updates will be done on every 2nd tick, which will slow down that sprite, etc. For Sprites = firstSprite to lastSprite IF Math.Remainder(globalCycleCtr,SpriteArray[Sprites][spriteSpeed])=0 Then Update() Draw() EndIf Endfor ElseIf (gameState = REPLAY_LEVEL) Then sbcDirection = Dir_R Sprites=1 SpriteArray[SBC][Lives] = SpriteArray[sbc][Lives] - 1 SpriteArray[SBC][State] = NORMAL globalCycleCtr = 0 SmallDelay() ClearSpritesFromaze() InitializeSprites() PositionSpritesInMaze() DrawSprites() '<---BUG FIX. A call to DrawSprites( ) fixes an issue where SBC dissapears when level restarts. SmallDelay() gameState = PLAY_LEVEL If (SpriteArray[SBC][Lives] = 0) Then gameState = GAME_OVER splashText = "Game Over" DisplayLevelSplash() Endif Endif delay = gameSpeed - (Clock.ElapsedMilliseconds-start) If (delay > 0) Then Program.Delay(delay) EndIf KeyboardHandler() EndWhile 'End of main state machine '*********************************************************************************** Sub SmallDelay Program.Delay(500) EndSub '******************************************************************************************* 'Updates various games elements (eg maze color, game speed, etc) as the player advances to a new level: '- gameSpeed: Overall speed of game. Game gets faster on each level. '- initialCountDownTime: amount of time that monsters stay afraid. Decreases on each level. Sub UpdateLevelState If math.Remainder(gameLevel,4) = 1 Then mazeBorderColor = "Cyan" ElseIf math.Remainder(gameLevel,4) = 2 then mazeBorderColor = "Red" Elseif math.Remainder(gameLevel,4) = 3 then mazeBorderColor = "midnightblue" Elseif math.Remainder(gameLevel,4) = 0 then mazeBorderColor = "magenta" EndIf gameLevel = gameLevel + 1 gameSpeed = gameSpeed - 2 If (gameSpeed <= 0) Then gameSpeed = 0 EndIf 'Give the player a new life on levels 4 and 8: If (gameLevel = 4 Or gameLevel = 8) Then SpriteArray[sbc][Lives]=SpriteArray[sbc][Lives] + 1 EndIf 'Reduce the amount of time that the monsters stay "Frightened" as game progresses. 'At much higher levels, the monsters won't stay frighened at all: initialCountDownTime = initialCountDownTime - 2 If initialCountDownTime <= 0 Then initialCountDownTime = 0 EndIf EndSub '******************************************************************************************* 'Dsplays a splash screen at the start of each level: Sub DisplayLevelSplash GraphicsWindow.FontSize=14 GraphicsWindow.BrushColor="white" l=Shapes.AddText(splashText) Shapes.Move(l,-200,205) Shapes.Animate(l,80,205,1000) SmallDelay() SmallDelay() SmallDelay() Shapes.Animate(l,-200,205,1000) EndSub '******************************************************************************************* 'The variables Dir_L, Dir_U, Dir_R, Dir_D are used as indexes into the xModifier and yModifier lookup tables. 'For example, xModifier[L] & yModifier[L] produces -1 and 0 respectively. When added to XY or RC values this will cause 'the sprite to go left, etc: Sub KeyboardHandler Dir_L = 1 Dir_U = 2 Dir_R = 3 Dir_D = 4 If (keyPressed = "Left") Then sbcDirection = Dir_L Elseif (keyPressed = "Right") Then sbcDirection = Dir_R Elseif (keyPressed = "Up") Then sbcDirection = Dir_U Elseif (keyPressed = "Down") Then sbcDirection = Dir_D Elseif (keyPressed = "Escape") Then gameState = GAME_OVER Endif EndSub '******************************************************************************************* Sub MoveSBC 'This routine moves SBC around the screen and causes SBC to stop at borders.It checks the maze 'locations adjacent to SBC's current location aganist the direction chosen by an arrow key press. 'If the new direction is possible (eg no borders in the way) SBC will go in the new direction. If 'the new direction is not possible, but the previous direction is, SBC will continue traveling in the 'direction it was moving in prior to the arrow key press. If neither direction is possible, SBC 'will stop moving: If Sprites=SBC Then canMoveInOldDirection = "False" canMoveInNewDirection = "False" 'Get maze data ahead of SBC: aheadDirX = SpriteArray[SBC][mazeCol] + SpriteArray[SBC][DX] aheadDirY = SpriteArray[SBC][mazeRow] + SpriteArray[SBC][DY] aheadDirData = Maze[aheadDirY][aheadDirX] 'Get maze data at location based on arrow key press: newDirX = SpriteArray[SBC][mazeCol] + xModifier[SbcDirection] newDirY = SpriteArray[SBC][mazeRow] + yModifier[SbcDirection] newDirData = Maze[newDirY][newDirX] 'The mazeTokens array holds data that represent ares that are NOT blocked by borders. For a = firstToken To lastToken If (mazeTokens[a] = newDirData) Then canMoveInNewDirection = "True" Goto _XIT_4Loop_Early EndIf If (mazeTokens[a] = aheadDirData) Then canMoveInOldDirection = "True" EndIf EndFor _XIT_4Loop_Early: 'If the new direction is possible, go in new direction: If (canMoveInNewDirection = "True") Then SpriteArray[SBC][DX] = xModifier[sbcDirection] SpriteArray[SBC][DY] = yModifier[sbcDirection] selectedRotation = rotationLookupTable[sbcDirection] EndIf 'If neither old nor new directions are possible, come to a stop: If (canMoveInNewDirection = "False" And canMoveInOldDirection = "False") Then SpriteArray[SBC][DX] = 0 SpriteArray[SBC][DY] = 0 EndIf SpriteArray[SBC][mazeCol] = SpriteArray[SBC][mazeCol] + SpriteArray[SBC][DX] SpriteArray[SBC][mazeRow] = SpriteArray[SBC][mazeRow] + SpriteArray[SBC][DY] EatPellet() EndIf EndSub '******************************************************************************************* Sub MoveMonstersTowardTarget 'This routine moves the monsters toward a target while allowing them to navigate around the maze 'borders. LL is a temporary array: INVALID = 9999 '9999 is used as an invalid flag because the total distance across the maze is 'much lower than 9999 pixels. Later, when the code calculates the distance 'between source to target, anything marked 9999 won't be considered. If (Sprites <> SBC) Then '<--SBC has his own movement routine (see MoveSBC) For a = 1 To 4 'step through XY/RC modifier table: SourceX = SpriteArray[Sprites][mazeCol] + xModifier[a] SourceY = SpriteArray[Sprites][mazeRow] + yModifier[a] targetX = SpriteArray[Sprites][targetCol] targetY = SpriteArray[Sprites][targetRow] For b = firstToken To lastToken 'If the maze area being examined is not a border then calculate the distance from that maze area ' to the target using the Manhattan Distance formula (SourceX-targetCol)+(SourceY-targetRow)... If mazeTokens[b]=Maze[SpriteArray[Sprites][mazeRow] + yModifier[a]][SpriteArray[Sprites][mazeCol]+ xModifier[a]] Then LL[a] = 1+(math.Abs(Sourcex-targetx) + math.Abs(Sourcey-targety)) Goto _XIT4 '...otherwise mark it as invalid because it's a border : Else LL[a] = INVALID EndIf EndFor _XIT4: EndFor 'For each maze area stored in the LL array, check to see if that was visited by the monster during previous 'game loop cycle. If so mark it INVALID, then save the monster's current maze location 'in VX, VY. These two steps will force the monster to travel in forward directions only (no reversing direction): For c = 1 To 4 If SpriteArray[Sprites][mazeCol] + xModifier[c] = SpriteArray[Sprites][VX] Then If SpriteArray[Sprites][mazeRow] + yModifier[c] = SpriteArray[Sprites][VY] Then LL[c] = INVALID EndIf EndIf EndFor SpriteArray[Sprites][VX] = SpriteArray[Sprites][mazeCol] SpriteArray[Sprites][VY] = SpriteArray[Sprites][mazeRow] 'Get the smallest number in temporary LL array, which will represent the direction to move in '1 = go left, 2 = go up, 3 = to right, 4 = go down: initialValue = LL[1] For ictr = 1 TO 4 If initialValue >= LL[ictr] THEN initialValue = LL[ictr] elementfound = ictr EndIf EndFor 'Set the movement direction. The xModifier/yModifier lookup tables eliminate the need for If/Then tests here: SpriteArray[Sprites][DX] = xModifier[elementfound] SpriteArray[Sprites][DY] = yModifier[elementfound] '** There is at least one circumstance where the monster finds a dead end - when the monster is in the 'monster pen at level start. In this instance, the monster's L, D, & R adjacent areas will be invalid 'due to being blocked by visible and invisible borders, and U is blocked because it will be added to the 'VX/VY variables after the first game cycle. When this happens the VX/VY variables must be deleted 'and on the next game cycle the monster will move out of dead end. ' if LL[elementfound] = INVALID Then SpriteArray[Sprites][DX] = 0 SpriteArray[Sprites][DY] = 0 SpriteArray[Sprites][VX] = 0 SpriteArray[Sprites][VY] = 0 EndIf 'Finally, move toward target: SpriteArray[Sprites][mazeCol] = (SpriteArray[Sprites][mazeCol] + SpriteArray[Sprites][dx]) SpriteArray[Sprites][mazeRow] = (SpriteArray[Sprites][mazeRow] + SpriteArray[Sprites][dy]) EndIf Endsub '******************************************************************************************* 'Detects when sprites touch each other and when sprites enter special areas of the maze: Sub CollisionDetect If Sprites <> SBC Then CheckRectangles() If isTouching = "True" Then isTouching = "False" 'Monster dies if touching SBC while fightened and then monster returns to the monster pen: If SpriteArray[Sprites][State] = FRIGHT then ShowEatSplash() SpriteArray[Sprites][State] = DIE hasEatenMonster = "True" ScoreAndBonusManager() 'SBC dies if touching monster when energizer is not active: ElseIf SpriteArray[Sprites][State] = CHASE then SpriteArray[SBC][State] = DIE gameState = REPLAY_LEVEL EndIf hasEatenMonster = "False" EndIf 'When monster reaches monster pen, get body back and leave: If SpriteArray[Sprites][mazeCol] = MonsterPenX and SpriteArray[Sprites][mazeRow]= MonsterPenY Then If SpriteArray[Sprites][State] = DIE then SpriteArray[Sprites][State] = EMERGE EndIf EndIf 'When monster has left monster pen, go back to chasing SBC: If SpriteArray[Sprites][mazeCol] = emergeX and SpriteArray[Sprites][mazeRow] = emergeY Then If SpriteArray[Sprites][State] = EMERGE then SpriteArray[Sprites][State] = CHASE EndIf EndIf EndIf '***BUG FIX: If a monster is in the monster pen when an energizer is eaten it will switch from whatever mode its in to 'FRIGHT mode. However, FRIGHT mode closes to doors when causes the monster to get trapped. This is a side effect - 'my intention was to keep the monsters from re-entering the pen prematurely. The fix below checks to see if a monster 'is in the pen and is the wrong mode. If so, it is switched to EMERGE mode so that it can properly emerge from the pen: If (SpriteArray[Sprites][mazeCol] = MonsterPenX) and (SpriteArray[Sprites][mazeRow] = MonsterPenY) Then If (SpriteArray[Sprites][State] <> DIE) Or (SpriteArray[Sprites][State] <> EMERGE) then SpriteArray[Sprites][State] = EMERGE EndIf EndIf EndSub '******************************************************************************************* 'Sets the targets that the monsters will move towards: Sub SetupMonsterTargets IF (Sprites <>SBC) then 'Sets ghosts to meander around the screen after SBC eats a power pellet: If SpriteArray[Sprites][State] = FRIGHT Then SpriteArray[Sprites][targetRow] = math.GetRandomNumber(maxMazeRows) SpriteArray[Sprites][targetCol] = math.GetRandomNumber(maxMazeCols) 'Sends the monsters back to monster pen after being eaten by SBC: ElseIf SpriteArray[Sprites][State] = DIE Then SpriteArray[Sprites][targetCol] = MonsterPenX SpriteArray[Sprites][targetRow] = MonsterPenY 'Makes the monsters leave home base: ElseIf SpriteArray[Sprites][State] = EMERGE Then SpriteArray[Sprites][targetCol] = emergeX SpriteArray[Sprites][targetRow] = emergeY Elseif SpriteArray[Sprites][State] = CHASE Then If Sprites = RedMonster Then 'Red monster pursues directly: SpriteArray[RedMonster][targetCol] = SpriteArray[SBC][mazeCol] SpriteArray[RedMonster][targetRow] = SpriteArray[SBC][mazeRow] ElseIf Sprites = PinkMonster Then 'Pink monster tries to ambush (***TO DO: needs to be fixed***): SpriteArray[PinkMonster][targetCol] = SpriteArray[SBC][mazeCol] + (SpriteArray[SBC][DX]-1) SpriteArray[PinkMonster][targetRow] = SpriteArray[SBC][mazeRow] + (SpriteArray[SBC][DY]-1) ElseIf Sprites = OrangeMonster Then 'Orange monster wanders around SpriteArray[OrangeMonster][targetCol] = math.GetRandomNumber(maxMazeCols) SpriteArray[OrangeMonster][targetRow] = math.GetRandomNumber(maxMazeRows) ElseIf Sprites = BlueMonster Then 'Blue monster considers red monster's coordinates and SBC's coordinates wheb determining how to move: SpriteArray[BlueMonster][targetCol] = math.abs(SpriteArray[SBC][mazeCol] + SpriteArray[RedMonster][mazeCol]) SpriteArray[BlueMonster][targetRow] = math.abs(SpriteArray[SBC][mazeRow] + SpriteArray[RedMonster][mazeRow]) EndIf EndIf ENDIF EndSub '******************************************************************************************* 'Animation manager. The animation frames are stored in the ImageArray 2D array. This routine 'sets the indexes into that array. FrameCtr + Offset is used as the index into ImageArray. 'When Offset = zero all sprites go through the normal 4-cycle animation sequence. When 'offset = 5, the monsters turn purple (Fright Mode), and when the offset = 6 the monsters turn dark gray '(Die Mode). Sub SetupAnimationSequence SpriteArray[SBC][LastFrame] = 4 SpriteArray[SBC][FirstFrame] = 1 SpriteArray[SBC][offset] = 0 If (Sprites <> SBC) Then If SpriteArray[Sprites][State] = CHASE Then SpriteArray[Sprites][offset] = 0 SpriteArray[Sprites][LastFrame] = 4 SpriteArray[Sprites][FirstFrame] = 1 ElseIf SpriteArray[Sprites][State] = FRIGHT Then SpriteArray[Sprites][offset] = 5 SpriteArray[Sprites][LastFrame] = 5 SpriteArray[Sprites][FirstFrame] = 5 ElseIf SpriteArray[Sprites][State] = DIE Then SpriteArray[Sprites][offset] = 6 SpriteArray[Sprites][LastFrame] = 6 SpriteArray[Sprites][FirstFrame] = 6 ElseIf SpriteArray[Sprites][State] = EMERGE Then SpriteArray[Sprites][offset] = 0 SpriteArray[Sprites][LastFrame] = 4 SpriteArray[Sprites][FirstFrame] = 1 Endif EndIf FlashMonsters() EndSub '******************************************************************************************* Sub EatPellet erasePelletFromScreen = "FALSE" mazeData = Maze[(SpriteArray[SBC][mazeRow])][(SpriteArray[SBC][mazeCol])] 'Pellet = mazeToken[1]. Energizer = mazeToken[2]: If (mazeData = mazeTokens[1] Or mazeData = mazeTokens[2]) Then Maze[(SpriteArray[SBC][mazeRow])][(SpriteArray[SBC][mazeCol])]=mazeTokens[0] 'empty this maze location pelletCount = pelletCount - 1 erasePelletFromScreen = "True" gameScore = gameScore + pelletScore If (mazeData = mazeTokens[1]) Then gameScore = gameScore + pelletScore ElseIf (mazeData = mazeTokens[2]) then monsterEatenCtr=0 SetMonstersToFrightState() gameScore = gameScore + energizerScore energizerTimer = ACTIVE energizerTime = initialCountDownTime EndIf If pelletCount <= 0 Then gameState = ADVANCE_LEVEL EndIf EndIf DoEnergizerTimer() EndSub '******************************************************************************************* 'Sets all monsters to FRIGHT state. VY & VX are zeroed out so that the monsters can switch 'directions. (MoveMonstersTowardTarget( ) normally restricts the monsters to forward-only movements): Sub SetMonstersToFrightState For ee = firstMonster to lastMonster if SpriteArray[ee][State] <> DIE then SpriteArray[ee][State] = FRIGHT shapes.SetOpacity(ImageArray[ee][5],100) SpriteArray[ee][VY] = 0 SpriteArray[ee][VX] = 0 EndIf Endfor EndSub '******************************************************************************************* 'Sets all monsters to CHASE state. This is a bug fix to keep the monsters from switching out of DIE 'mode prematurely: Sub MakeMonstersChase For mc = firstMonster to lastMonster If SpriteArray[mc][State] <> DIE then SpriteArray[mc][State] = CHASE EndIf Endfor EndSub '******************************************************************************************* 'Manages the count down timer that determines how long an energizer lasts. Sub DoEnergizerTimer If (energizerTimer = ACTIVE) Then If (energizerTime <> 0) Then energizerTime = energizerTime -1 Else energizerTimer = INACTIVE monsterEatenCtr=0 MakeMonstersChase() Endif Endif EndSub '******************************************************************************************* 'Dispatch routine for erasing pellets/energizers from the screen: Sub ErasePellet pelletColor = "black" pelletX = SpriteArray[SBC][screenX] + sWidth - mazeScale pelletY = SpriteArray[SBC][screenY] + sHeight - mazeScale DrawEnergizer() EndSub '******************************************************************************************* 'Draws/erases an energizer Sub DrawEnergizer pelletSize = 6 xOffset = -6 yOffset = -6 DP() Endsub '******************************************************************************************* 'Draws/erases a pellet Sub DrawPellet pelletSize = 3 xOffset = -3 yOffset = -3 DP() EndSub '******************************************************************************************* Sub DP GraphicsWindow.BrushColor = pelletColor GraphicsWindow.FillEllipse(pelletX+xOffset, pelletY+yOffset, pelletSize, pelletSize) EndSub '******************************************************************************************* 'Removes sprites from the maze Sub ClearSpritesFromaze For r=firstSprite To lastSprite For t = 1 To 6 Shapes.move(ImageArray[r][t],-100,-100) EndFor EndFor EndSub '******************************************************************************************* 'Draws sprites on screen while advancing through the animation sequence setup by SetupAnimationSequence(). Sub DrawSprites 'To reduce flicker only draw sprites that are moving (SBC sometimes stops) If SpriteArray[Sprites][dx]<>0 Or SpriteArray[Sprites][dy]<>0 Then 'Get a reference to the current animation frame. We will hide it later: oldFrameCtr=SpriteArray[Sprites][FrameCtr] SpriteArray[Sprites][frameCtr]=SpriteArray[Sprites][frameCtr]+1+SpriteArray[Sprites][offset] 'Advance to next frame and check to see if all frames have been displayed: If SpriteArray[Sprites][frameCtr]>SpriteArray[Sprites][lastFrame] then SpriteArray[Sprites][frameCtr]=SpriteArray[Sprites][firstFrame] Endif 'Update screen coordinates: SpriteArray[Sprites][screenX]= SpriteArray[Sprites][screenX]+ SpriteArray[Sprites][DX] * 1 SpriteArray[Sprites][screenY]= SpriteArray[Sprites][screenY]+ SpriteArray[Sprites][DY] * 1.5 'Get reference to new animation frame and apply rotation (for SBC): newFrameCtr=SpriteArray[Sprites][frameCtr] if Sprites = SBC Then Shapes.Rotate(ImageArray[Sprites][newFrameCtr], selectedRotation) EndIf 'Finally, hide previous frame and show new animation frame: shapes.Move(ImageArray[Sprites][oldFrameCtr],-20,-20) Shapes.Move(ImageArray[Sprites][newFrameCtr], SpriteArray[Sprites][screenX], SpriteArray[Sprites][screenY]) EndIf If erasePelletFromScreen = "True" Then ErasePellet() EndIf EndSub '******************************************************************************************* 'This routine intializes general purpose global lookup tables. Sub InitializeLookupTables 'The xModifier & yModifier arrays are used to modify the XY screen coordinates and RC maze coordinates: xModifier[0] = 0 'Stop moving xModifier[1] =-1 'Move Left (when added to X) xModifier[2] = 0 ' xModifier[3] = 1 'Move Right (when added to X) xModifier[4] = 0 yModifier[0] = 0 'Stop moving yModifier[1] = 0 ' yModifier[2] =-1 'Move Up (when added to Y) yModifier[3] = 0 ' yModifier[4] = 1 'Move Down (when added to Y) 'rotationLookupTable holds the rotation angles for SBC. SbcDirection is used as an index: rotationLookupTable[1] = 180 rotationLookupTable[2] = 270 rotationLookupTable[3] = 0 rotationLookupTable[4] = 90 EndSub '******************************************************************************************* 'Sets up sprite data structure and establishes related variables: Sub InitializeSprites 'State variables for sprites: DIE = 0 NORMAL = 1 CHASE = 2 SCATTER = 3 '<--not implemented yet FRIGHT = 4 EMERGE = 5 'State variables for energizer timer: ACTIVE = 1 INACTIVE = 0 'The sprite data structure is a 2D array. These variables are indexes into the 2nd dimension of that array. '(Dimension#1 slects the sprite, dimension #2 sets/gets properties of the particular sprite: firstSprite = SBC lastSprite = PinkMonster firstMonster = RedMonster lastMonster = PinkMonster 'Variables for dimension #2: screenX = 1 'screen x coordinate screenY = 2 'screen y coordinate mazeCol = 3 'maze col mazeRow = 4 'maze row DX = 5 'x/col modifier DY = 6 'y/row modifier targetCol= 7 'maze target col targetRow= 8 'maze target row VX = 9 'visited maze col VY = 10 'visited maze row State = 11 Lives = 12 FrameCtr = 13 'Index into ImageArray[ ][ ] Offset = 14 FirstFrame = 15 LastFrame = 16 cycleCounter= 17 spriteSpeed= 18 'Initialize: For spriteCtr = firstSprite To lastSprite SpriteArray[spriteCtr][FirstFrame] = 1 SpriteArray[spriteCtr][LastFrame] = 4 SpriteArray[spriteCtr][FrameCtr] = 4 SpriteArray[spriteCtr][offset] = 4 SpriteArray[spriteCtr][DX] = 0 SpriteArray[spriteCtr][DY] = 0 SpriteArray[spriteCtr][VX] = 0 SpriteArray[spriteCtr][VY] = 0 SpriteArray[spriteCtr][targetCol] = 0 SpriteArray[spriteCtr][targetRow] = 0 SpriteArray[spriteCtr][State] = CHASE SpriteArray[spriteCtr][spriteSpeed] = 1 SpriteArray[spriteCtr][cycleCounter] = 1 Endfor SpriteArray[SBC][State] = NORMAL sbcDirection = Dir_R EndSub '******************************************************************************************* Sub PositionSpritesInMaze 'Used for alignment hacks: xxOffset= 0 yyOffset= 0 'Position SBC two tiles underneath Monster pen: SpriteArray[SBC][mazeCol] = 15 SpriteArray[SBC][mazeRow] = 24 'Position Red Monster outside & above Monster pen: SpriteArray[RedMonster][mazeCol] = 12 SpriteArray[RedMonster][mazeRow] = 12 'Blue, Orange and Pink Monsters inside Monster pen: SpriteArray[BlueMonster][mazeCol] = 12 SpriteArray[BlueMonster][mazeRow] = 16 SpriteArray[OrangeMonster][mazeCol] = 17 SpriteArray[OrangeMonster][mazeRow] = 16 SpriteArray[PinkMonster][mazeCol] = 14 SpriteArray[PinkMonster][mazeRow] = 15 'Set correct screen positions: For Sprites = firstSprite to lastSprite AdjustScreenCoords() EndFor EndSub '******************************************************************************************* 'Using maze RC values, calculate screen XYs: Sub AdjustScreenCoords SpriteArray[Sprites][screenX] = (SpriteArray[Sprites][mazeCol]) * mazeScale - mazeScale SpriteArray[Sprites][screenY] = (SpriteArray[Sprites][mazeRow]) * mazeScale * 1.5 - mazeScale EndSub '******************************************************************************************* Sub LoadBitmaps 'The sprite data structure is a 2D array. These variables are indexes into the 2nd dimension of that array. '(Dimension#1 slects the sprite, dimension #2 sets/gets properties of the particular sprite. 'Variables to select the sprites (dimension #1 of SpriteArray): SBC = 1 RedMonster = 2 BlueMonster = 3 OrangeMonster = 4 PinkMonster = 5 sWidth = mazeScale * 2 sHeight = mazeScale * 2 'ImageArray is a 2D array that holds references to the bitmaps used by the sprites. Dimension #1 is used 'to select the sprite, dimension #2 is used to select the bitmap. 'Load bitmaps for normal animation sequence: filePath = Program.Directory +"\" 'SBC animation frames ImageArray[SBC][1]=shapes.addimage("http://farm9.staticflickr.com/8240/8528887960_413fda8a5a_t.jpg") ImageArray[SBC][2]=shapes.addimage("http://farm9.staticflickr.com/8379/8528887958_f8f6d3e534_t.jpg") ImageArray[SBC][3]=shapes.addimage("http://farm9.staticflickr.com/8520/8527774169_b73baef828_t.jpg") ImageArray[SBC][4]=shapes.addimage("http://farm9.staticflickr.com/8379/8528887958_f8f6d3e534_t.jpg") 'Red Monster animation frames ImageArray[RedMonster][1]=shapes.addimage("http://farm9.staticflickr.com/8388/8528887972_d45aa82d69_t.jpg") ImageArray[RedMonster][2]=shapes.addimage("http://farm9.staticflickr.com/8388/8528887972_d45aa82d69_t.jpg") ImageArray[RedMonster][3]=shapes.addimage("http://farm9.staticflickr.com/8388/8528887972_d45aa82d69_t.jpg") ImageArray[RedMonster][4]=shapes.addimage("http://farm9.staticflickr.com/8388/8528887972_d45aa82d69_t.jpg") 'Blue Monster animation frames ImageArray[BlueMonster][1]=shapes.addimage("http://farm9.staticflickr.com/8378/8527774263_5f7d6e6aac_t.jpg") ImageArray[BlueMonster][2]=shapes.addimage("http://farm9.staticflickr.com/8378/8527774263_5f7d6e6aac_t.jpg") ImageArray[BlueMonster][3]=shapes.addimage("http://farm9.staticflickr.com/8378/8527774263_5f7d6e6aac_t.jpg") ImageArray[BlueMonster][4]=shapes.addimage("http://farm9.staticflickr.com/8378/8527774263_5f7d6e6aac_t.jpg") 'Orange Monster animation frames ImageArray[OrangeMonster][1]=shapes.addimage("http://farm9.staticflickr.com/8377/8527774201_6fced83ebf_t.jpg") ImageArray[OrangeMonster][2]=shapes.addimage("http://farm9.staticflickr.com/8377/8527774201_6fced83ebf_t.jpg") ImageArray[OrangeMonster][3]=shapes.addimage("http://farm9.staticflickr.com/8377/8527774201_6fced83ebf_t.jpg") ImageArray[OrangeMonster][4]=shapes.addimage("http://farm9.staticflickr.com/8377/8527774201_6fced83ebf_t.jpg") 'Pink Monster animation frames ImageArray[PinkMonster][1]=shapes.addimage("http://farm9.staticflickr.com/8523/8527774181_5fa1ebe6bb_t.jpg") ImageArray[PinkMonster][2]=shapes.addimage("http://farm9.staticflickr.com/8523/8527774181_5fa1ebe6bb_t.jpg") ImageArray[PinkMonster][3]=shapes.addimage("http://farm9.staticflickr.com/8523/8527774181_5fa1ebe6bb_t.jpg") ImageArray[PinkMonster][4]=shapes.addimage("http://farm9.staticflickr.com/8523/8527774181_5fa1ebe6bb_t.jpg") For s= 1 to 5 'Load bitmaps for FRIGHT Mode: ImageArray[s][5]=shapes.addimage("http://farm9.staticflickr.com/8102/8528933134_d80645e3cc_t.jpg") 'Load bitmaps for DIE mode: ImageArray[s][6]=shapes.addimage("http://farm9.staticflickr.com/8532/8528888036_85d4b2906d_t.jpg") Shapes.SetOpacity(ImageArray[s][6],50) Endfor ClearSpritesFromaze() EndSub ''******************************************************************************************* 'Loads maze pattern into maze array, counts the number of pellets added to maze, and gets the 'maze XY coordinates for special areas. Also creates and populates the mazeToken[ ] lookup table: ' Sub LoadMaze M[1] = "/------\/----------\/------\" M[2] = "|......||..........||......|" M[3] = "|*/--\.||./------\.||./--\*|" M[4] = "|.(--).().(------).().(--).|" M[5] = "|..........................|" M[6] = "(-\./\./---\./\./---\./\./-)" M[7] = "oo|.||.| |.||.| |.||.|oo" M[8] = "oo|.||.(---).||.(---).||.|oo" M[9] = "oo|.||.......||.......||.|oo" M[10] = "oo|.|(--\+/--)(--\+/--)|.|oo" M[11] = "--).(---)+(------)+(---).(--" M[12] = "LT+.+++++++E++++++++++++.+SR" M[13] = "--\./---\+/AAAAAAo+/---\./--" M[14] = "oo|.|/--)+|+Co+B+|+(--\|.|oo" M[15] = "oo|.||++++|+oo+o+|++++||.|oo" M[16] = "oo|.||+/\+|MCo+B+|+/\+||.|oo" M[17] = "oo|.()+||+(------)+||+().|oo" M[18] = "oo|.+++||++++++++++||+++.|oo" M[19] = "oo|./--)(--\+/\+/--)(--\.|oo" M[20] = "oo|.(------)+||+(------).|oo" M[21] = "oo|.......+++||+++.......|oo" M[22] = "oo|./---\./--)(--\./---\.|oo" M[23] = "/-).(---).(------).(---).(-\" M[24] = "|............++............|" M[25] = "|./--\./---\./\./---\./--\.|" M[26] = "|.|oo|.|/--).||.(--\|.|oo|.|" M[27] = "|.|oo|.||....||....||.|oo|.|" M[28] = "|*|oo|.||./--)(--\.||.|oo|*|" M[29] = "|.(--).().(------).().(--).|" M[30] = "|..........................|" M[31] = "(--------------------------)" maxMazeRows = Array.GetItemCount(M) maxMazeCols = Text.GetLength(M[1]) 'mazeTokens[ ] hold tokens that represent walkable space in the maze: firstToken = 0 lastToken = 2 mazeTokens[0]= "+" mazeTokens[1]= "." mazeTokens[2]= "*" 'Load the maze pattern into the maze[ ] [ ] array: For rows = 1 To maxMazeRows For cols = 1 To maxMazeCols maze[rows][cols] = Text.GetSubText(M[rows], cols, 1) If maze[rows][cols] = mazeTokens[1] Or maze[rows][cols] = mazeTokens[2] Then pelletCount = pelletCount + 1 EndIf 'Special areas: If Maze[rows][cols] ="M" Then 'DIE mode target Monster Pen tile Maze[rows][cols] = mazeTokens[0] monsterpenX = cols MonsterPenY = rows ElseIf Maze[rows][cols] ="E" Then 'Emerge mode target tile Maze[rows][cols] = mazeTokens[0] emergeX = cols emergeY = rows ElseIf Maze[rows][cols] ="L" Then 'Left tunnel tile Maze[rows][cols] = mazeTokens[0] leftTunnelX = cols leftTunnelY = rows ElseIf Maze[rows][cols] ="R" Then 'Right tunnel tile Maze[rows][cols] = mazeTokens[0] rightTunnelX = cols rightTunnelY = rows ElseIf Maze[rows][cols] ="S" Then 'Right slow-down tunnel tile Maze[rows][cols] = mazeTokens[0] sld1X = cols sld1Y = rows ElseIf Maze[rows][cols] ="T" Then 'Right slow-down tunnel tile Maze[rows][cols] = mazeTokens[0] sld2X = cols sld2Y = rows EndIf EndFor EndFor 'Delete the temporary array holding the maze structure: M="" EndSub '******************************************************************************************* 'Steps through maze[ ] [ ] and draws the pattern on screen: Sub DrawMaze mazeBackgroundColor = "black" GraphicsWindow.BackgroundColor= mazeBackgroundColor x = 0 y = 0 mWidth = mazeScale mHeight = mazeScale MMX = (X + 1 * mWidth) MMY = (Y + 1.5 * mHeight) MMH = (1.5 * mHeight) MMW = (1 * mWidth) For rows = 1 To maxMazeRows tempMMYrows = MMY*rows 'helps speed up draw operations a bit. For cols = 1 To maxMazeCols mazeData = Maze[rows][cols] GraphicsWindow.PenColor = mazeBorderColor GraphicsWindow.PenWidth = 2 ' Upper Left corner: if mazeData = "/" then GraphicsWindow.DrawLine(MMX*cols,TempMMYrows, mazeCol+MMW*cols, TempMMYrows) GraphicsWindow.DrawLine(MMX*cols,TempMMYrows, MMX*cols, MMY+MMH*rows) 'Upper Right corner: elseif mazeData = "\" then GraphicsWindow.DrawLine(MMX*cols,TempMMYrows, MMX*cols-MMW, TempMMYrows) GraphicsWindow.DrawLine(MMX*cols,TempMMYrows, MMX*cols, TempMMYrows+MMH) 'Lower Left corner: elseif mazeData = "(" then GraphicsWindow.DrawLine(MMX*cols,TempMMYrows, MMX*cols, TempMMYrows-MMH) GraphicsWindow.DrawLine(MMX*cols,TempMMYrows, MMX*cols+MMW, TempMMYrows) 'Lower right corner: elseif mazeData = ")" then GraphicsWindow.DrawLine(MMX*cols,TempMMYrows, MMX*cols, TempMMYrows-MMH) GraphicsWindow.DrawLine(MMX*cols,TempMMYrows, MMX*cols-MMW, TempMMYrows) ' 'Vertical line: elseif mazeData = "-" then GraphicsWindow.DrawLine(MMX*cols,TempMMYrows, MMX*cols-MMW, TempMMYrows) GraphicsWindow.DrawLine(MMX*cols,TempMMYrows, MMX*cols+MMW, TempMMYrows) ' 'Vertical line for top door elseif mazeData = "A" then GraphicsWindow.PenColor="white" GraphicsWindow.PenWidth="1" GraphicsWindow.DrawLine(MMX*cols,TempMMYrows, MMX*cols-MMW, TempMMYrows) GraphicsWindow.DrawLine(MMX*cols,TempMMYrows, MMX*cols+MMW, TempMMYrows) ' 'Horizontal line: elseif mazeData = "|" then GraphicsWindow.DrawLine(MMX*cols,TempMMYrows, MMX*cols, TempMMYrows-MMH) GraphicsWindow.DrawLine(MMX*cols,TempMMYrows, MMX*cols, TempMMYrows+MMH) 'Pellet: elseif mazeData = "." then pelletColor = "white" pelletX=(cols * MMW) pelletY=(rows * MMY) DrawPellet() 'Energizer: elseif mazeData = "*" then pelletColor = "white" pelletX=(cols * MMW) pelletY=(rows * MMY) DrawEnergizer() Endif EndFor EndFor EndSub '******************************************************************************************* 'There are three invisible borders that keep the blue, pink and orange ghosts in the monster pen 'and also keeps the monsters from getting back in unless they are in EMERGE or DIE modes. 'The doors are "opened" by adding their tokens to the mazeToken[ ] array and extending the lastToken pointer. 'The doors are "closed" by resetting the lastToken pointer: Sub CloseDoors lastToken = 2 EndSub '******************************************************************************************* Sub OpenLeftDoor mazeTokens[3] = "B" lastToken = lastToken + 1 EndSub '******************************************************************************************* Sub OpenRightDoor mazeTokens[3] = "C" lastToken = lastToken + 1 EndSub '******************************************************************************************* Sub OpenTopDoor mazeTokens[3] = "A" lastToken = lastToken + 1 EndSub '******************************************************************************************* 'This routines causes the monsters to leave the monster pen one-by-one after a certain number of 'cycles have past. This done at game start, on each new level and when a level is replayed . The 'invisible "doors" open whenever the monsters are in EMERGE or DIE modes: Sub LeaveMonsterPenOneByOne If globalCycleCtr = 100 then SpriteArray[PinkMonster][state] = EMERGE ElseIf globalCycleCtr = 200 Then SpriteArray[OrangeMonster][state] = EMERGE Elseif globalCycleCtr = 400 Then SpriteArray[BlueMonster][state] = EMERGE EndIf EndSub '******************************************************************************************* 'Dispatches update-related routines: Sub Update SpriteArray[Sprites][cycleCounter]=SpriteArray[Sprites][cycleCounter]+1 'Do updates when a sprite reaches a new tile. Distance between tiles is set by MazeScale: if (SpriteArray[Sprites][cycleCounter] > mazeScale) Then MoveSBC() SetupMonsterTargets() SetupSpriteSpeed() OpenCloseDoors() MoveMonstersTowardTarget() CheckGoThroughTunnels() SpriteArray[Sprites][cycleCounter]=1 DisplayScore() DisplayLevel() EndIf Endsub '******************************************************************************************* 'Displaches draw-related routines: Sub Draw SetupAnimationSequence() DrawSprites() CollisionDetect() CheckGoThroughTunnels() Endsub '******************************************************************************************* 'Ensures that sprites are moving at correct speed: Sub SetupSpriteSpeed If SpriteArray[Sprites][state] = CHASE Then SpriteArray[Sprites][spriteSpeed] = 1 ElseIf SpriteArray[Sprites][state] = FRIGHT Then SpriteArray[Sprites][spriteSpeed] = 2 ElseIf SpriteArray[Sprites][state] = NORMAL Then SpriteArray[Sprites][spriteSpeed] = 1 ElseIf SpriteArray[Sprites][state] = DIE Then SpriteArray[Sprites][spriteSpeed] = 1 EndIf EndSub '******************************************************************************************* 'Can't speed up maze drawing, so black out the game screen and then construct maze and position 'bitmaps underneath the black cover: Sub ConstructGameElements BlackOutGameScreen() LoadMaze() DrawMaze() DisplayLevel() DisplayLives() ClearSpritesFromaze() InitializeSprites() PositionSpritesInMaze() RemoveBlackScreen() EndSub '******************************************************************************************* 'Causes the monsters to flash briefly as a warning to the player that the monsters are about 'to swtich from Fright to Chase states: '***BUG ??: This routine doesn't work well with Silverlight*** Sub FlashMonsters If (energizerTimer = ACTIVE) And (SpriteArray[Sprites][State] = FRIGHT) Then If (energizerTime < 20) Then If (Math.Remainder(energizerTime,3)=0) Then shapes.SetOpacity(ImageArray[sprites][5],100) 'Visible Else shapes.SetOpacity(ImageArray[sprites][5],10) 'Faint EndIf EndIf EndIf EndSub '********************************************************************************* 'Allows game to cage in or release monsters from monster pen: Sub OpenCloseDoors If SpriteArray[Sprites][State] = CHASE Then CloseDoors() ElseIf SpriteArray[Sprites][State] = FRIGHT Then CloseDoors() ElseIf SpriteArray[Sprites][State] = NORMAL Then CloseDoors() ElseIf SpriteArray[Sprites][State] = DIE Then OpenLeftDoor() OpenRightDoor() OpenTopDoor() ElseIf SpriteArray[Sprites][State] = EMERGE Then OpenLeftDoor() OpenRightDoor() OpenTopDoor() EndIf EndSub '************************************************************************** Sub ScoreAndBonusManager If (hasEatenMonster = "True") Then monsterEatenCtr = monsterEatenCtr + 1 gameScore = gameScore + monsterPts +(monsterEatenCtr * monsterPts) 'Give player a bonus when all 4 monsters are eaten in succession: If monsterEatenCtr = 4 Then gameScore = gameScore + monsterBonusPts splashText=monsterBonusPts + "PT BONUS!" DisplayLevelSplash() monsterEatenCtr=0 EndIf monstersEatenPerLevel = monstersEatenPerLevel + 1 'Give player an extra life whenever 16 monsters are eaten per level: If monstersEatenPerLevel = 16 Then SpriteArray[sbc][lives] = SpriteArray[sbc][lives] + 1 splashText="EXTRA LIFE ADDED!" monstersEatenPerLevel=0 DisplayLevelSplash() EndIf hasEatenMonster="False" EndIf If hasReached50K="False" Then If gameScore > 50000 Then hasReached50K="True" SpriteArray[sbc][lives] = SpriteArray[sbc][lives] + 1 splashText="EXTRA LIFE ADDED!" DisplayLevelSplash() DisplayLives() EndIf EndIf EndSub '******************************************************************************* 'Bounding Box collision detection routine from "Beginning Microsoft Small Basic", 9-30 Sub CheckRectangles isTouching = "False" Object1X=SpriteArray[sbc][screenX] Object1Y=SpriteArray[sbc][screenY] Object2X=SpriteArray[Sprites][screenX] Object2Y=SpriteArray[Sprites][screenY] If ((Object1X + 6 +sWidth - 6) > Object2X +6) Then If (Object1X +6 < (Object2X+6 + sWidth - 6)) Then If ((Object1Y+6 + sHeight - 6) > Object2Y+6) Then If (Object1Y+6 < (Object2Y+6 + sHeight - 6)) Then isTouching = "True" EndIf EndIf EndIf EndIf EndSub '************************************************************************ 'Allows sprites to travel through tunnels and causes the monsters to slow down at tunnel entrances: sub CheckGoThroughTunnels If Sprites <> SBC Then if (SpriteArray[Sprites][mazecol]=sld1X And SpriteArray[Sprites][mazeRow]=sld2Y) or (SpriteArray[Sprites][mazecol]=sld2X And SpriteArray[Sprites][mazeRow]=sld2Y) Then SpriteArray[Sprites][spriteSpeed]=4 EndIf endif If SpriteArray[Sprites][mazeCol] = rightTunnelX and SpriteArray[Sprites][mazeRow] = rightTunnelY Then SpriteArray[Sprites][mazeCol] = leftTunnelX SpriteArray[Sprites][mazeRow] = leftTunnelY AdjustScreenCoords() ElseIf SpriteArray[Sprites][mazeCol] = leftTunnelX and SpriteArray[Sprites][mazeRow] = leftTunnelY Then SpriteArray[Sprites][mazeCol] = rightTunnelX SpriteArray[Sprites][mazeRow] = rightTunnelY AdjustScreenCoords() EndIf EndSub '******************************************************************** 'Shows the per-monster points at the location where the monster was eaten: Sub ShowEatSplash GraphicsWindow.BrushColor="white" GraphicsWindow.FontName="Arial" o=shapes.AddText(monsterPts +(monsterEatenCtr * monsterPts)) osx = SpriteArray[Sprites][screenX] - sWidth osy = SpriteArray[Sprites][screenY] + sHeight Shapes.Move(o,osx,osy) SmallDelay() Shapes.Remove(o) EndSub '******************************************************************************************* sub SetupGraphicsWindow GraphicsWindow.Title="Small Basic Chomper" GraphicsWindow.Width= gamescreenWidth GraphicsWindow.Height=gameScreenHeight GraphicsWindow.CanResize="false" GraphicsWindow.BrushColor="white" GraphicsWindow.FontSize = 10 GraphicsWindow.FontBold = "False" GraphicsWindow.DrawText(10,0,"SCORE: ") GraphicsWindow.DrawText(100,0,"LEVEL: ") GraphicsWindow.DrawText(180,0,"LIVES: ") scoreShape=Shapes.AddText(gameScore) livesShape=Shapes.AddText(SpriteArray[sbc][Lives]) levelShape=Shapes.AddText(gameLevel) Shapes.Move(scoreShape,50,0) Shapes.Move(levelShape,135,0) Shapes.Move(livesShape,220,0) endsub '******************************************************************************************* Sub DisplayScore Shapes.SetText(scoreShape,gamescore) EndSub '******************************************************************************************* Sub DisplayLives Shapes.SetText(livesShape,SpriteArray[sbc][lives]) EndSub '******************************************************************************************* Sub DisplayLevel Shapes.SetText(levelShape,gameLevel) EndSub '******************************************************************************************* Sub BlackoutGameScreen GraphicsWindow.BrushColor="black" blkScreen = Shapes.AddRectangle(gamescreenWidth, gameScreenHeight) Endsub '******************************************************************************************* Sub RemoveBlackScreen Shapes.Remove(blkScreen) EndSub End>GQQ201.sb< Start>GQR102.sb< 'Alarm Clock program written by Cody Frazier. 'This is a basic alarm clock that I have put together because I could not find one that 'was sufficent for me. This can be configured easily. The few things to change are the 'music file, the display messages and the length of time for the snooze. start: TextWindow.Title = "Alarm Clock" TextWindow.Write("What hour do you want the alarm to go off?: ") hour1 = TextWindow.ReadNumber() TextWindow.Write("What minutes do you want the alarm to go off?: ") minutes1 = TextWindow.ReadNumber() TextWindow.Hide() 'Source of music file music = Program.Directory + "\Disturbed - The Night.mp3" hour: If (hour1 = Clock.Hour) Then Goto mins EndIf mins: If (minutes1 = Clock.Minute) Then TextWindow.Show() 'You can change the message for when the alarm is going off. TextWindow.Write("YOUR ALARM IS GOING OFF!!") Sound.Play(music) else Goto hour endif 'The program will clear the message and display the snooze message after 3 seconds. Program.Delay(3000) TextWindow.Clear() TextWindow.Write("SNOOZE?") snooze1 = TextWindow.Read() snooze: If (snooze1 = "") Then Sound.Stop(music) textwindow.Clear() 'The length of time the program will "snooze". Program.Delay(300000) Goto resume else Sound.Stop(music) textwindow.Clear() Goto start endif resume: Sound.Play(music) TextWindow.Write("SNOOZE?") snooze2 = TextWindow.Read() If (snooze2 = "") Then Goto snooze TextWindow.Clear() else Sound.Stop(music) textwindow.Clear() Goto start EndIf End>GQR102.sb< Start>GQT657.sb< TextWindow.Clear() debug = 0 TextWindow.Title = "TCP Server v 0.2" top = Desktop.Height left = Desktop.Width TextWindow.Top = 500 TextWindow.Left = 1000 ' The following line could be harmful and has been automatically commented. ' File.CreateDirectory(Program.Directory + "\" +"Log") mpath = Program.Directory + "\" +"Log" +"\" 'master path path = mpath + "Log.txt" path2 = mpath + "Blacklist.txt" ippath = mpath + "Clients.txt" ipclient = Program.Directory + "\" +"IP.exe" cmd = "C:\Windows\System32\cmd.exe" ' The following line could be harmful and has been automatically commented. ' File.DeleteFile(path) ' The following line could be harmful and has been automatically commented. ' File.DeleteFile(path2) ' The following line could be harmful and has been automatically commented. ' File.DeleteFile(ippath) authtiacte = 1 'Auto Authentiactes user PassswordGet() authtiacte = 0 'De authenticates user last = 0 serverclient = Program.Directory + "\" + "TCPServerClient.exe" ' Server Client Path LDProcess.Start(serverclient,Password) 'Passes Password to Server Client & starts it TextWindow.Write("Initializing server on " + IOTCPServer.IP + ", port 1000...") Sub PassswordGet 'Set Password for Server ; Null = 0 If authtiacte = 1 Then TextWindow.WriteLine("") TextWindow.WriteLine("Please Press Alt + F7 after finishing this prompt.") TextWindow.Write("Set Password for Server : ") password = TextWindow.Read() TextWindow.Write("Please Press Alt + F7.") TextWindow.Read() If Password = "" Then Password = 0 EndIf EndIf TextWindow.Clear() EndSub If IOTCPServer.StartServer(1000) = "SUCCESS" Then TextWindow.ForegroundColor = "Green" TextWindow.CursorLeft = 76 TextWindow.Title = "TCP Server v0.2 [OK] " + IOTCPServer.IP TextWindow.Write("[OK]") Else TextWindow.ForegroundColor = "Red" TextWindow.CursorLeft = 74 TextWindow.Title = "TCP Server v0.2 [FAIL]" TextWindow.Write("[FAIL]") EndIf main() Sub main 'Main Menu TextWindow.ForegroundColor = "Green" IOTCPServer.OnClientConnect = OnClientConnect IOTCPServer.OnMessageRecieved = OnMessageRecieved IOTCPServer.OnClientDisconnect = OnClientDisconnect TextWindow.WriteLine("") TextWindow.WriteLine(" ╔═══════════════════════════════════════════╗") TextWindow.WriteLine(" ║ 1. Boot ║") TextWindow.WriteLine(" ║ 2. Brodcast Message ║") TextWindow.WriteLine(" ║ 3. Send Message ║") TextWindow.WriteLine(" ║ 4. Clients ║") TextWindow.WriteLine(" ║ 5. Clear Screen ║") TextWindow.WriteLine(" ║ 6. Change Password ║") TextWindow.WriteLine(" ║ 7. Shutdown Sever ║") TextWindow.WriteLine(" ╚═══════════════════════════════════════════╝") Start() EndSub Sub Start 'Options IOTCPServer.OnClientConnect = OnClientConnect IOTCPServer.OnMessageRecieved = OnMessageRecieved IOTCPServer.OnClientDisconnect = OnClientDisconnect TextWindow.ForegroundColor = "Gray" TextWindow.Write("Option : ") option = TextWindow.ReadNumber() If option = 1 then TextWindow.Clear() TextWindow.Write("IP:") IPUser = TextWindow.Read() failure = IOTCPServer.SendMessage("***BOOT***",IPUser) failure2 = IOTCPServer.DisconnectClient(IPUser) TextWindow.WriteLine(failure + ";"+ failure2) emsg = LDEncryption.AESEncrypt("Server Boot : " + IPUser + ";" + failure+ ";" + failure2,Password) filemsg = emsg filecolor = 4 writefile() Blacklistprocess() main() ElseIf option = 2 Then msguser = "" Broadcast() msguser = "" Broadcastflag = 0 Start() ElseIf option = 3 then 'Send Message TextWindow.Clear() TextWindow.Write("IP:") IPUser = TextWindow.Read() TextWindow.Write("Message:") msguser = TextWindow.Read() IOTCPServer.SendMessage("Server:",IPUser) failure = IOTCPServer.SendMessage(msguser ,IPUser) TextWindow.WriteLine(failure) emsg = LDEncryption.AESEncrypt("Server Message to " + IPUser + ";" + msguser + ";" + failure,Password) filemsg = emsg filecolor = 4 writefile() Start() Elseif option = 4 then 'Clients arraedip = IOTCPServer.GetClients() index1 = Text.GetIndexOf(arraedip,"=") index2 = Text.GetIndexOf(arraedip,";") emsg = LDEncryption.AESEncrypt("Clients: "+arraedip,Password) filemsg = emsg filecolor = 5 writefile() Start() ElseIf option = 5 then 'Clear Screen TextWindow.Clear() main() elseIf option = 6 then 'Change Password UserAuthenticate() If authtiacte = 1 then PassswordGet() LDProcess.Start(serverclient,Password) EndIf main() ElseIf option = 7 then 'Shutdown Server UserAuthenticate() If authtiacte = 1 then LDProcess.Start(cmd,"cmd /k Taskkill /f /im TCPServerClient.exe") LDProcess.Start(cmd,"cmd /k Taskkill /f /im cmd.exe") ' The following line could be harmful and has been automatically commented. ' File.DeleteFile(path) ' The following line could be harmful and has been automatically commented. ' File.DeleteFile(path2) ' The following line could be harmful and has been automatically commented. ' File.DeleteFile(ippath) TextWindow.WriteLine("Sending Brodcast") msguser = "Server Shutdown Started. All Clients will be booted." Broadcast() IOTCPServer.StopServer() Program.End() else main() EndIf else Start() endIf EndSub Sub OnClientConnect 'When A client connects to the server ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,2,"1") a = IOTCPServer.LastClientConnectIP b = IOTCPServer.LastClientConnectPort blacklist = 0 ' The following line could be harmful and has been automatically commented. ' x = File.ReadLine(path2,1) num = 1 While x <> "" 'Checks File to see if client is blacklisted If x = a Then blacklist = 1 x = "" ElseIf x <> "" then num = num + 1 ' The following line could be harmful and has been automatically commented. ' x = File.ReadLine(path2,num) EndIf EndWhile If blacklist = 1 Then 'Blacklisted Client IOTCPServer.SendMessage("***BOOTL***",a) IOTCPServer.DisconnectClient(a) Else 'Non Blacklisted Client failure = IOTCPServer.SendMessage("You are now connected to the server.",a) emsg = LDEncryption.AESEncrypt("New connection: " + a+ ", port " + b,Password) filemsg = emsg filecolor = 1 writefile() ' The following line could be harmful and has been automatically commented. ' File.DeleteFile(ippath) LDProcess.Start(ipclient,IOTCPServer.GetClients()) EndIf EndSub Sub OnClientDisconnect a = IOTCPServer.LastClientDisconnectIP While x <> "" 'BLacklist Process If x = a Then blacklist = 1 x = "" elseIf x <> "" then num = num + 1 ' The following line could be harmful and has been automatically commented. ' x = File.ReadLine(path2,num) EndIf EndWhile 'If disconnect wasnt caused by being Blacklisted If blacklist <> 1 Then emsg = LDEncryption.AESEncrypt(a + " has disconnected",Password) filemsg = emsg filecolor = 2 writefile() ' The following line could be harmful and has been automatically commented. ' File.DeleteFile(ippath) LDProcess.Start(ipclient,IOTCPServer.GetClients()) EndIf EndSub Sub OnMessageRecieved a = IOTCPServer.LastMessageIP b = IOTCPServer.LastMessageData msgl = Text.GetSubText(b,1,1) If msgl = "*" Then msguser = a + ":" + Text.GetSubTextToEnd(b,2) Broadcast() a = msguser msguser = "" Else emsg = LDEncryption.AESEncrypt("New message from: " + a + ": " + b ,Password) filemsg = emsg filecolor = 3 writefile() EndIf EndSub '1 = Green ; 2 = Red ; 3 = Yellow Sub Blacklistprocess 'Adds an IP to Blacklist File TextWindow.WriteLine("Blacklist?") TextWindow.WriteLine("1.Y") TextWindow.WriteLine("2.N") TextWindow.Write("Option:") options = TextWindow.ReadNumber() If options = 1 then ' The following line could be harmful and has been automatically commented. ' File.AppendContents(path2,IPUser) EndIf EndSub Sub UserAuthenticate TextWindow.Clear() TextWindow.WriteLine("User Authentication:") TextWindow.Write("Password of Server:") temppassword = TextWindow.Read() authtiacte = 0 TextWindow.Clear() If temppassword = "" Then temppassword = 0 EndIf If temppassword = Password Then TextWindow.WriteLine("User Authenitacted") authtiacte = 1 temppassword = "" Else TextWindow.WriteLine("Wrong Password") authtiacte = 0 temppassword = "" EndIf EndSub Sub Broadcast 'Gets Clients connected to the server and sends them a mass message clientlist = mpath + "Clients.txt" If msguser = "" Then TextWindow.Write("Message : " ) msguser = TextWindow.Read() Broadcastflag = 1 EndIf LDProcess.Start(ipclient,IOTCPServer.GetClients()) emsg = LDEncryption.AESEncrypt("Brodcast Message : " + msguser,Password) filemsg = emsg filecolor = 3 writefile() If debug = 1 Then ' The following line could be harmful and has been automatically commented. ' TextWindow.WriteLine(File.ReadContents(clientlist)) EndIf ' The following line could be harmful and has been automatically commented. ' x = File.ReadLine(clientlist,1) ipnum = 2 While x <> "" If debug = 1 then TextWindow.WriteLine(x) EndIf If Broadcastflag = 1 Then err = IOTCPServer.SendMessage("Server : "+msguser,x) Else err = IOTCPServer.SendMessage(msguser,x) EndIf If err = "FAIL" then TextWindow.ForegroundColor = "RED" TextWindow.WriteLine("Could not Broadcast message to : " + x ) TextWindow.ForegroundColor = "Gray" emsg = LDEncryption.AESEncrypt("Could not Broadcast message to : " + x ,Password) filemsg = emsg filecolor = 2 writefile() EndIf ' The following line could be harmful and has been automatically commented. ' x = File.ReadLine(clientlist,ipnum) ipnum = ipnum + 1 EndWhile EndSub Sub writefile ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,1,filemsg) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,2,filecolor) Auto() EndSub Sub Auto 'Data Integrity Unit Server Side; Useful for the TCP Server Client last = last + 1 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(path,3,last) ready = 1 EndSub End>GQT657.sb< Start>GQV782.sb< 'Challenge of the Month - January 2019 'Graphics Challenge: '1. Draw a picture of a space ship '2. Give it a cool space starry background gw = 615 gh = 850 GraphicsWindow.Hide() GraphicsWindow.Left = (Desktop.Width - gw) /2 GraphicsWindow.Top = (Desktop.Height - gh) /2 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BackgroundColor = "MidnightBlue" GraphicsWindow.Show() GraphicsWindow.KeyDown = ExitProgram Ellipse1() Ellipse2() Ellipse3() Ellipse4() Ellipse5() Ellipse7() Triangle1() Triangle2() Triangle3() Triangle4() Triangle5() RedFlame() OrangeFlame() YellowFlame() 'Ellipse - Main body of Space Ship Sub Ellipse1 GraphicsWindow.PenColor = "Black" GraphicsWindow.PenWidth = 8 GraphicsWindow.BrushColor = "Yellow" Elli8 = Shapes.AddEllipse(263, 393) Shapes.HideShape(Elli8) Shapes.Move(Elli8, 180, 307) Shapes.ShowShape(Elli8) EndSub 'Left Triangle (Bottom Left of main body of Space Ship) Sub Triangle1 GraphicsWindow.PenColor = "Yellow" GraphicsWindow.PenWidth = 8 GraphicsWindow.BrushColor = "Yellow" Shapes.AddTriangle(197, 585, 250, 700, 380, 700) GraphicsWindow.PenColor = "Black" Shapes.AddLine(190, 570, 250, 700) EndSub 'Right Triangle (Bottom Right of main body of Space Ship) Sub Triangle2 GraphicsWindow.PenColor = "Yellow" GraphicsWindow.PenWidth = 8 GraphicsWindow.BrushColor = "Yellow" Shapes.AddTriangle(386, 700, 420, 600, 315, 700) GraphicsWindow.PenColor = "Black" Shapes.AddLine(386, 710, 432, 570) Shapes.AddLine(250, 700, 390, 700) EndSub 'Top Triangle of main body of Space Ship Sub Triangle3 GraphicsWindow.PenColor = "Yellow" GraphicsWindow.PenWidth = 8 GraphicsWindow.BrushColor = "Yellow" Shapes.AddTriangle(310, 270, 255, 330, 366, 330) GraphicsWindow.PenColor = "Black" Shapes.AddLine(310, 265, 245, 340) Shapes.AddLine(310, 265, 378, 340) EndSub 'Window 1 Sub Ellipse2 GraphicsWindow.PenColor = "Black" GraphicsWindow.PenWidth = 8 GraphicsWindow.BrushColor = "Teal" Elli9 = Shapes.AddEllipse(105, 57) Shapes.HideShape(Elli9) Shapes.Move(Elli9, 260, 354) Shapes.ShowShape(Elli9) EndSub 'Window 2 Sub Ellipse3 GraphicsWindow.PenColor = "Black" GraphicsWindow.PenWidth = 8 GraphicsWindow.BrushColor = "Teal" Elli10 = Shapes.AddEllipse(105, 57) Shapes.HideShape(Elli10) Shapes.Move(Elli10, 260, 429) Shapes.ShowShape(Elli10) EndSub 'Window 3 Sub Ellipse4 GraphicsWindow.PenColor = "Black" GraphicsWindow.PenWidth = 8 GraphicsWindow.BrushColor = "Teal" Elli11 = Shapes.AddEllipse(105, 57) Shapes.HideShape(Elli11) Shapes.Move(Elli11, 260, 504) Shapes.ShowShape(Elli11) EndSub 'Start of Left Wing Sub Triangle4 GraphicsWindow.PenColor = "Red" GraphicsWindow.PenWidth = 8 GraphicsWindow.BrushColor = "Red" Shapes.AddTriangle(193, 700, 245, 700, 226, 772) GraphicsWindow.PenColor = "Black" Shapes.AddLine(225, 782, 186, 690) Shapes.AddLine(225, 785, 248, 693) EndSub 'Finish of Left Wing Sub Ellipse5 GraphicsWindow.PenColor = "Black" GraphicsWindow.PenWidth = 8 GraphicsWindow.BrushColor = "Red" Elli12 = Shapes.AddEllipse(75, 90) Shapes.Move(Elli12, 180, 630) EndSub 'Start of Right Wing Sub Triangle5 GraphicsWindow.PenColor = "Red" GraphicsWindow.PenWidth = 8 GraphicsWindow.BrushColor = "Red" Shapes.AddTriangle(390, 700, 442, 700, 405, 772) GraphicsWindow.PenColor = "Black" Shapes.AddLine(405, 782, 389, 695) Shapes.AddLine(405, 785, 446, 695) EndSub 'Finish of Rigth Wing Sub Ellipse7 GraphicsWindow.PenColor = "Black" GraphicsWindow.PenWidth = 8 GraphicsWindow.BrushColor = "Red" Elli13 = Shapes.AddEllipse(75, 90) Shapes.Move(Elli13, 380, 630) EndSub Sub RedFlame GraphicsWindow.PenColor = "Red" Rect = Shapes.AddRectangle(16, 150) Shapes.Move(Rect, 270, 705) Rect1 = Shapes.AddRectangle(16, 150) Shapes.Move(Rect1, 340, 705) EndSub Sub OrangeFlame GraphicsWindow.PenColor = "Orange" Rect = Shapes.AddRectangle(16, 150) Shapes.Move(Rect, 284, 705) Rect1 = Shapes.AddRectangle(16, 150) Shapes.Move(Rect1, 326, 705) EndSub Sub YellowFlame GraphicsWindow.PenColor = "Yellow" Rect = Shapes.AddRectangle(16,150) Shapes.Move(Rect, 298, 705) Rect = Shapes.AddRectangle(16,150) Shapes.Move(Rect, 310, 705) EndSub 'Background with Stars For i = 0 To 800 GraphicsWindow.FontSize = Math.GetRandomNumber(30) x = Math.GetRandomNumber(GraphicsWindow.Width) y = Math.GetRandomNumber(GraphicsWindow.Height) GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor() GraphicsWindow.DrawText(x, y, "*") Program.Delay(10) EndFor 'Close Program Sub ExitProgram If GraphicsWindow.LastKey = "Escape" Then Program.End() EndIf EndSub End>GQV782.sb< Start>GQW771.sb< 'Drag & Drop - Sample set up. '************************************************ Initialise() 'MAIN LOOP While 0=0 UpdateProgram() UpdateFrame() FrameRate() EndWhile '======================================= 'MAIN SUBROUTINES Sub UpdateProgram If mouseDown Then SelectBox() 'SelectMenu() mouseDown = "False" EndIf If mouseUp Then DropBox() 'RunMenu() mouseUp = "False" EndIf If mouseMove Then DragBox() 'HighlightMenu() mouseMove = "False" EndIf EndSub Sub UpdateFrame Shapes.Move(dragMe, toX, toY) EndSub Sub FrameRate delay = 20 - (Clock.ElapsedMilliseconds - start) If delay > 0 Then Program.Delay(delay) EndIf start = Clock.ElapsedMilliseconds EndSub '============================================================= 'PROCESS IMPACT OF MOUSE EVENTS ON BOXES Sub SelectBox GetMousePosition() 'Loop thru all boxes boxCount = Array.GetItemCount(box) 'Z-Order: highest index is on Top For i = boxCount To 1 Step -1 If mouseX >= Shapes.GetLeft(box[i]) And mouseX <= Shapes.GetLeft(box[i]) + boxSize Then If mouseY >= Shapes.GetTop(box[i]) And mouseY <= Shapes.GetTop(box[i]) + boxSize Then boxLeft = Shapes.GetLeft(box[i]) 'remember where the box was before removing it boxTop = Shapes.GetTop(box[i]) 'This removes and then re-adds the Shape placing it on top of other Shapes Shapes.Remove(box[i]) box[i] = "" GraphicsWindow.BrushColor = boxColor[i] box[boxCount + 1] = Shapes.AddRectangle(boxSize, boxSize) Shapes.Move(box[boxCount + 1], boxLeft, boxTop) boxColor[boxCount + 1] = boxColor[i] boxColor[i] = "" 'Reindex Shapes & their Colors after Z-order changed getAllIndexes = Array.GetAllIndices(box) For j = 1 To boxCount newColorArray[j] = boxColor[getAllIndexes[j]] newBoxArray[j] = box[getAllIndexes[j]] EndFor boxColor = newColorArray box = newBoxArray dragMe = box[boxCount] 'Move Mouse to Centre of Shape Mouse.MouseX = Mouse.MouseX - GraphicsWindow.MouseX + boxLeft + boxSize /2 Mouse.MouseY = Mouse.MouseY - GraphicsWindow.MouseY + boxTop + boxSize /2 'Workaround. Bug is: moved mouse using Mouse Object then use GraphicsWindow Object to locate Mouse.HideCursor() Mouse.ShowCursor() 'Bug is avoided by re-presenting the Mouse to GraphicsWindow i = 0 'Break Loop as soon as the Shape with highest Index/Z-order is selected EndIf EndIf EndFor EndSub Sub DropBox dragMe = "" EndSub Sub DragBox GetMousePosition() If dragMe <> "" And Mouse.IsLeftButtonDown Then toX = mouseX - boxSize / 2 toY = Math.Max(mouseY - boxSize / 2, menuHeight) EndIf EndSub '==================================================== 'PROCESS IMPACT OF MOUSE EVENTS ON MENU '========================================================== 'OTHER SUBROUTINES Sub GetMousePosition mouseX = GraphicsWindow.MouseX mouseY = GraphicsWindow.MouseY EndSub '========================================== 'INITIALISE PROGRAM Sub Initialise gw = GraphicsWindow.Width gh = GraphicsWindow.Height 'TextWindow.WriteLine(gw) 'TextWindow.WriteLine(gh) InitialiseMenu() 'Add Colorful Boxes anywhere boxSize = 50 boxColor = "1=Blue;2=Red;3=DeepPink;4=Yellow;5=Green;6=Black;7=Lime;8=Purple;9=Cyan;10=DeepSkyBlue" j = menuHeight + iconContextHeight For i = 1 To 10 GraphicsWindow.BrushColor = boxColor[i] box[i] = Shapes.AddRectangle(boxSize, boxSize) Shapes.Move(box[i], Math.GetRandomNumber(gw - boxSize) , Math.GetRandomNumber(gh - boxSize - j) + j) EndFor 'Register Events GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseUp = OnMouseUp GraphicsWindow.MouseMove = OnMouseMove Controls.ButtonClicked = OnButtonClicked EndSub 'EVENT HANDLERS Sub OnMouseDown mouseDown = "True" EndSub Sub OnMouseUp mouseUp = "True" EndSub Sub OnMouseMove mouseMove = "True" EndSub Sub OnButtonClicked buttonClicked = "True" EndSub '---------------------------------------------------------------------------- 'INITIALISE MENU Sub InitialiseMenu 'Declare and Set all the Menu Properties menuHeight = 30 iconWidth = "1=36;2=50" iconText = "1=?;2={}" iconFontSize = "1=28;2=20" iconTextLeftOffset = "1=10;2=12" iconTextTopOffset = "1=-3;2=2" iconContextWidth = "1=27;2=130" iconContextHeight = 14 iconContextContent = "1=Help;2=Source Code" frameWidth = "1=290;2=300" frameHeight = "1=260;2=200" closeBtnSize = 26 EndSub End>GQW771.sb< Start>GRB398.sb< Controls.ButtonClicked = OnButtonClicked GraphicsWindow.BackgroundColor="Black" GraphicsWindow.PenColor="Blue" GraphicsWindow.BrushColor="Blue" GraphicsWindow.FontSize="14" GraphicsWindow.Height="590" GraphicsWindow.Width="590" GraphicsWindow.CanResize="False" CanResize = "True" Sub OnButtonClicked Ab = Controls.LastClickedButton If Ab = mybutton Then GraphicsWindow.Title="Patman V.09" Button2 = Controls.AddButton("Click to start game", 400,580) EndIf If Ab = Button2 Then MyPacman = Shapes.AddImage("H:/Batman.png") Controls.HideControl(Button2) Controls.HideControl(mybutton) EndIf EndSub 'OnButtonClicked mybutton = Controls.AddButton("Start!", 1,580) GraphicsWindow.KeyDown= OnKeyDown Timer.Interval = 60 Timer.Tick = OnTimerTick 'Gw.FR (200-+,250,20-+,200) GraphicsWindow.FillRectangle(1,1,1, 600) Sub OnTimerTick pressed = GraphicsWindow.LastKey If Move = "True" And pressed = "D" Then PacX = PacX + 5 if PacX < 200 + 20 And PacX+25 > 200 And PacY < 450 And PacY+25 > 250 Then PacX=PacX-5 ElseIf PacX < 540 + 80 And PacX+25 > 540 And PacY < 350 And PacY+25 > 3400 Then PacX = PacX -5 EndIf ElseIf Move = "True" And pressed = "A" Then PacX=PacX-5 if PacX < 200 + 20 And PacX+25 > 200 And PacY < 450 And PacY+30 > 250 Then PacX=PacX+5 Shapes.Move(MyPacman,200,200) ElseIf PacX < 540 + 80 And PacX+25 > 540 And PacY < 350 And PacY+25 > 3400 Then PacX = PacX -5 EndIf ElseIf Move = "True" And pressed = "W" Then PacY=PacY-5 if PacX < 200 + 20 And PacX+23 > 200 And PacY < 450 And PacY+26 > 250 Then Pacy=Pacy+5 EndIf Elseif Move = "True" And pressed = "S" Then PacY=PacY+5 if PacX < 200 + 20 And PacX+25 > 200 And PacY < 450 And PacY+30 > 250 Then PacY=PacY-5 ElseIf PacX < 540 + 80 And PacX+25 > 540 And PacY < 350 And PacY+25 > 3400 Then PacX = PacX -5 EndIf EndIf Shapes.Move(MyPacman,PacX,PacY) 'Was a dot eaten If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx1+5 And PacX+30 > Dotx1 And PacY < Doty1+5 And PacY+30 > Doty1 Then Shapes.Remove(dot1) Dotx1 = -100 Doty1 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf If PacX < Dotx2+5 And PacX+30 > Dotx2 And PacY < Doty2+5 And PacY+30 > Doty2 Then Shapes.Remove(dot1) Dotx2 = -100 Doty2 = -100 Points = Points + 10 GraphicsWindow.Title = Points EndIf EndSub Sub OnKeyDown Move = "True" EndSub Move = "False" PacX = 0 PacY = 200 GraphicsWindow.PenWidth="10" GraphicsWindow.FillRectangle(200,250,20,200) GraphicsWindow.FillRectangle(540,340 , 80, 10) GraphicsWindow.FillRectangle(1,1,1, 600) GraphicsWindow.FillRectangle(600,1,600, 600) GraphicsWindow.FillRectangle(1,600, 600,600) GraphicsWindow.FillRectangle(1,1, 600,1) GraphicsWindow.FillRectangle(1,-1, 600,1) Sub Teleporter If pacx + 25 < 600 Then Shapes.Move(MyPacman, 200,200) EndIf If pacx > 600 Then Shapes.Move(MyPacman, 200, 200) EndIf If pacy +25 <600 Then Shapes.Move(MyPacman, 200, 200) EndIf If pacy > 600 Then Shapes.Move(MyPacman, 200, 200) EndIf EndSub GraphicsWindow.PenColor = "White" GraphicsWindow.BrushColor= "White" dot1 = Shapes.AddRectangle(5,5,) dot2 = Shapes.AddRectangle(5,5,) dot3 = Shapes.AddRectangle(5,5,) dot4 = Shapes.AddRectangle(5,5,) dot5 = Shapes.AddRectangle(5,5,) dot6 = Shapes.AddRectangle(5,5,) dot7 = Shapes.AddRectangle(5,5,) dot8 = Shapes.AddRectangle(5,5,) dot9 = Shapes.AddRectangle(5,5,) dot10 = Shapes.AddRectangle(5,5,) dot11 = Shapes.AddRectangle(5,5,) dot12 = Shapes.AddRectangle(5,5,) dot13 = Shapes.AddRectangle(5,5,) dot14 = Shapes.AddRectangle(5,5,) dot15 = Shapes.AddRectangle(5,5,) dot16 = Shapes.AddRectangle(5,5,) dot17 = Shapes.AddRectangle(5,5,) dot18 = Shapes.AddRectangle(5,5,) dot19 = Shapes.AddRectangle(5,5,) dot20 = Shapes.AddRectangle(5,5,) dot21 = Shapes.AddRectangle(5,5,) dot22 = Shapes.AddRectangle(5,5,) dot23 = Shapes.AddRectangle(5,5,) dot24 = Shapes.AddRectangle(5,5,) dot25 = Shapes.AddRectangle(5,5,) dot26 = Shapes.AddRectangle(5,5,) dot27 = Shapes.AddRectangle(5,5,) dot28 = Shapes.AddRectangle(5,5,) dot29 = Shapes.AddRectangle(5,5,) dot30 = Shapes.AddRectangle(5,5,) dot31 = Shapes.AddRectangle(5,5,) dot32 = Shapes.AddRectangle(5,5,) dot33 = Shapes.AddRectangle(5,5,) dot34 = Shapes.AddRectangle(5,5,) dot35 = Shapes.AddRectangle(5,5,) dot36 = Shapes.AddRectangle(5,5,) dot37 = Shapes.AddRectangle(5,5,) dot38 = Shapes.AddRectangle(5,5,) dot39 = Shapes.AddRectangle(5,5,) dot40 = Shapes.AddRectangle(5,5,) dot1 = Shapes.AddRectangle(5,5,) dot2 = Shapes.AddRectangle(5,5,) dot3 = Shapes.AddRectangle(5,5,) dot4 = Shapes.AddRectangle(5,5,) dot5 = Shapes.AddRectangle(5,5,) dot6 = Shapes.AddRectangle(5,5,) dot7 = Shapes.AddRectangle(5,5,) dot8 = Shapes.AddRectangle(5,5,) dot9 = Shapes.AddRectangle(5,5,) dot10 = Shapes.AddRectangle(5,5,) dot11 = Shapes.AddRectangle(5,5,) dot12 = Shapes.AddRectangle(5,5,) dot13 = Shapes.AddRectangle(5,5,) dot14 = Shapes.AddRectangle(5,5,) dot15 = Shapes.AddRectangle(5,5,) dot16 = Shapes.AddRectangle(5,5,) dot17 = Shapes.AddRectangle(5,5,) dot18 = Shapes.AddRectangle(5,5,) dot19 = Shapes.AddRectangle(5,5,) dot20 = Shapes.AddRectangle(5,5,) dot21 = Shapes.AddRectangle(5,5,) dot22 = Shapes.AddRectangle(5,5,) dot23 = Shapes.AddRectangle(5,5,) dot24 = Shapes.AddRectangle(5,5,) dot25 = Shapes.AddRectangle(5,5,) dot26 = Shapes.AddRectangle(5,5,) dot27 = Shapes.AddRectangle(5,5,) dot28 = Shapes.AddRectangle(5,5,) dot29 = Shapes.AddRectangle(5,5,) dot30 = Shapes.AddRectangle(5,5,) dot31 = Shapes.AddRectangle(5,5,) dot32 = Shapes.AddRectangle(5,5,) dot33 = Shapes.AddRectangle(5,5,) dot34 = Shapes.AddRectangle(5,5,) dot35 = Shapes.AddRectangle(5,5,) dot36 = Shapes.AddRectangle(5,5,) dot37 = Shapes.AddRectangle(5,5,) dot38 = Shapes.AddRectangle(5,5,) dot39 = Shapes.AddRectangle(5,5,) dot40 = Shapes.AddRectangle(5,5,) dot41 = Shapes.AddRectangle(5,5,) dot41 = Shapes.AddRectangle(5,5,) dot42 = Shapes.AddRectangle(5,5,) dot43 = Shapes.AddRectangle(5,5,) dot44 = Shapes.AddRectangle(5,5,) dot45 = Shapes.AddRectangle(5,5,) dot46 = Shapes.AddRectangle(5,5,) dot47 = Shapes.AddRectangle(5,5,) dot48 = Shapes.AddRectangle(5,5,) dot49 = Shapes.AddRectangle(5,5,) dot50 = Shapes.AddRectangle(5,5,) dot51 = Shapes.AddRectangle(5,5,) dot52 = Shapes.AddRectangle(5,5,) dot53 = Shapes.AddRectangle(5,5,) dot54 = Shapes.AddRectangle(5,5,) dot55 = Shapes.AddRectangle(5,5,) dot56 = Shapes.AddRectangle(5,5,) dot57 = Shapes.AddRectangle(5,5,) dot58 = Shapes.AddRectangle(5,5,) dot59 = Shapes.AddRectangle(5,5,) dot60 = Shapes.AddRectangle(5,5,) dot61 = Shapes.AddRectangle(5,5,) dot62 = Shapes.AddRectangle(5,5,) dot63 = Shapes.AddRectangle(5,5,) dot64 = Shapes.AddRectangle(5,5,) dot65 = Shapes.AddRectangle(5,5,) dot66 = Shapes.AddRectangle(5,5,) dot67 = Shapes.AddRectangle(5,5,) dot68 = Shapes.AddRectangle(5,5,) dot69 = Shapes.AddRectangle(5,5,) dot70 = Shapes.AddRectangle(5,5,) dot71 = Shapes.AddRectangle(5,5,) dot72 = Shapes.AddRectangle(5,5,) dot73 = Shapes.AddRectangle(5,5,) dot74 = Shapes.AddRectangle(5,5,) dot75 = Shapes.AddRectangle(5,5,) dot76 = Shapes.AddRectangle(5,5,) dot77 = Shapes.AddRectangle(5,5,) dot78 = Shapes.AddRectangle(5,5,) dot79 = Shapes.AddRectangle(5,5,) dot80 = Shapes.AddRectangle(5,5,) Dotx1 = 2 Doty1 =2 Dotx2 = 4 Doty2 = 4 Dotx3 = 6 Doty3 = 6 Dotx4 = 8 Doty4 = 5 Dotx5 = 5 Doty5 =5 Dotx6 =5 Doty6 =5 Dotx7 =5 Doty7 =5 Dotx8 =5 Doty8 =5 Dotx9 =5 Doty9 =5 Dotx10 =5 Doty10 =5 Dotx11 =5 Doty11 =5 Dotx12 =5 Doty12 =5 Dotx13 =5 Doty13 =5 Dotx14 =5 Doty14 =5 Dotx15 =5 Doty15 =5 Dotx16 =5 Doty16 =5 Dotx17 =5 Doty17 =5 Dotx18 =5 Doty18 =5 Dotx19 =5 Doty19 =5 Dotx20 =5 Doty20 =5 Dotx21 =5 Doty21 =5 Dotx22 =5 Doty22 =5 Dotx23 =5 Doty23 =5 Dotx24 =5 Doty24 =5 Dotx25 =5 Doty25 =5 Dotx26 =5 Doty26 =5 Dotx27 =5 Doty27 =5 Dotx28 =5 Doty28 =5 Dotx29 =5 Doty29 =5 Dotx30 =5 Doty30 =5 Dotx31 =5 Doty31 =5 Dotx32 =5 Doty32 =5 Dotx33 =5 Doty33 =5 Dotx34 =5 Doty34 =5 Dotx35 =5 Doty35 =5 Dotx36 =5 Doty36 =5 Dotx37 =5 Doty37 =5 Dotx38 =5 Doty38 =5 Dotx39 =5 Doty39 =5 Dotx40 =5 Doty40 =5 Dotx41 =5 Doty41 =25 Dotx42 =5 Doty42 =5 Dotx43 =5 Doty43 =5 Dotx44 =5 Doty44 =5 Dotx45 =5 Doty45 =5 Dotx46 =5 Doty46 =5 Dotx47 =5 Doty47 =5 Dotx48 =5 Doty48 =5 Dotx49 =5 Doty49 =5 Dotx50 =5 Doty50 =5 Dotx51 =5 Doty51 =5 Dotx52 =5 Doty52 =5 Dotx53 =5 Doty53 =5 Dotx54 =5 Doty54 =5 Dotx55 =5 Doty55 =5 Dotx56 =5 Doty56 =5 Dotx57 =5 Doty57 =5 Dotx58 =55 Doty58 =5 Dotx59 =5 Doty59 =5 Dotx60 =55 Doty60 =5 Dotx61 =5 Doty61 =5 Dotx62 =5 Doty62 =5 Dotx63 =5 Doty63 =5 Dotx64 =5 Doty64 =5 Dotx65 =5 Doty65 =5 Dotx66 =5 Doty66 =5 Dotx67 =5 Doty67 =5 Dotx68 =5 Doty68 =5 Dotx69 =5 Doty69 =5 Dotx70 =5 Doty70 =5 Dotx71 =5 Doty71 =5 Dotx72 =5 Doty72 =55 Dotx73 =5 Doty73 =5 Dotx74 =5 Doty74 =5 Dotx75 =5 Doty75 =5 Dotx76 =55 Doty76 =5 Dotx77 =5 Doty77 =5 Dotx78 =5 Doty78 =5 Dotx79 =5 Doty79 =5 Dotx80 =5 Doty80 =5 Shapes.Move(dot1 , Dotx1 , Doty1) Shapes.Move(dot2 , Dotx2 , Doty2) Shapes.Move(dot3 , Dotx3 , Doty3) Shapes.Move(dot4 , Dotx4 , Doty4) Shapes.Move(dot5 , Dotx5 , Doty5) Shapes.Move(dot6 , Dotx6 , Doty6) Shapes.Move(dot7 , Dotx7 , Doty7) Shapes.Move(dot8 , Dotx8 , Doty8) Shapes.Move(dot9 , Dotx9 , Doty9) Shapes.Move(dot10 , Dotx10 , Doty10) Shapes.Move(dot11 , Dotx11 , Doty11) Shapes.Move(dot12 , Dotx12 , Doty12) Shapes.Move(dot13 , Dotx13 , Doty13) Shapes.Move(dot14, Dotx14 , Doty14) Shapes.Move(dot15 , Dotx15 , Doty15) Shapes.Move(dot16 , Dotx16 , Doty16) Shapes.Move(dot17, Dotx17, Doty17) Shapes.Move(dot18 , Dotx18 , Doty18) Shapes.Move(dot19 , Dotx19 , Doty19) Shapes.Move(dot20 , Dotx20 , Doty20) Shapes.Move(dot21 , Dotx21 , Doty21) Shapes.Move(dot22 , Dotx22 , Doty22) Shapes.Move(dot23, Dotx23 , Doty23) Shapes.Move(dot24 , Dotx24 , Doty24) Shapes.Move(dot25 , Dotx25 , Doty25) Shapes.Move(dot26 , Dotx26 , Doty26) Shapes.Move(dot27 , Dotx27 , Doty27) Shapes.Move(dot28 , Dotx28 , Doty28) Shapes.Move(dot29 , Dotx29 , Doty29) Shapes.Move(dot30 , Dotx30 , Doty30) Shapes.Move(dot31 , Dotx31 , Doty31) Shapes.Move(dot32 , Dotx32 , Doty32) Shapes.Move(dot33 , Dotx33 , Doty33) Shapes.Move(dot34 , Dotx34 , Doty34) Shapes.Move(dot35 , Dotx35, Doty35) Shapes.Move(dot36, Dotx36 , Doty36) Shapes.Move(dot37 , Dotx37 , Doty37) Shapes.Move(dot38, Dotx38 , Doty38) Shapes.Move(dot39 , Dotx39 , Doty39) Shapes.Move(dot40 , Dotx40 , Doty40) Shapes.Move(dot41 , Dotx41 , Doty41) Shapes.Move(dot42 , Dotx42 , Doty42) Shapes.Move(dot43 , Dotx43 , Doty43) Shapes.Move(dot44 , Dotx44 , Doty44) Shapes.Move(dot45 , Dotx45 , Doty45) Shapes.Move(dot46 , Dotx46 , Doty46) Shapes.Move(dot47 , Dotx47 , Doty47) Shapes.Move(dot48 , Dotx48 , Doty48) Shapes.Move(dot49 , Dotx49 , Doty49) Shapes.Move(dot50 , Dotx50 , Doty50) Shapes.Move(dot51 , Dotx51 , Doty51) Shapes.Move(dot52 , Dotx52 , Doty52) Shapes.Move(dot53 , Dotx53 , Doty53) Shapes.Move(dot54 , Dotx54 , Doty54) Shapes.Move(dot55 , Dotx55 , Doty55) Shapes.Move(dot56 , Dotx56 , Doty56) Shapes.Move(dot57 , Dotx57 , Doty57) Shapes.Move(dot58 , Dotx58, Doty58) Shapes.Move(dot59 , Dotx59 , Doty59) Shapes.Move(dot60 , Dotx60 , Doty60) Shapes.Move(dot61 , Dotx61 , Doty61) Shapes.Move(dot62 , Dotx62 , Doty62) Shapes.Move(dot63 , Dotx63 , Doty63) Shapes.Move(dot64 , Dotx64 , Doty64) Shapes.Move(dot65 , Dotx65 , Doty65) Shapes.Move(dot66 , Dotx66 , Doty66) Shapes.Move(dot67 , Dotx67 , Doty67) Shapes.Move(dot68 , Dotx68 , Doty68) Shapes.Move(dot69 , Dotx69 , Doty69) Shapes.Move(dot70 , Dotx70 , Doty70) Shapes.Move(dot71 , Dotx71 , Doty71) Shapes.Move(dot72 , Dotx72 , Doty72) Shapes.Move(dot73 , Dotx73 , Doty73) Shapes.Move(dot74 , Dotx74 , Doty74) Shapes.Move(dot75 , Dotx75 , Doty75) Shapes.Move(dot76 , Dotx76 , Doty76) Shapes.Move(dot77 , Dotx77, Doty77) Shapes.Move(dot78 , Dotx78 , Doty78) Shapes.Move(dot79 , Dotx79 , Doty79) Shapes.Move(dot80 , Dotx80 , Doty80) Points = 0 GraphicsWindow.Title=Points End>GRB398.sb< Start>GRC991.sb< '2014.10.1 开始制作 '更新步骤: GraphicsWindow.Width=700 GraphicsWindow.Height=530 GraphicsWindow.Left=(Desktop.Width-GraphicsWindow.Width)/2-50 GraphicsWindow.Top=(Desktop.Height-GraphicsWindow.Height)/2-50 GraphicsWindow.Title="Island Craft" Controls.ButtonClicked=buttonclicked GraphicsWindow.KeyDown=keydown GraphicsWindow.MouseDown=mousedown screen=1 check=1 gameload=0 path="E:\Island Craft1" '默认打开方式 标准:E:\Island Craft1 , E:\编程\LOCK\LOCK2\lock\文件\Island Craft1 baginformation() typerinformation() drawscreen() worldwidth=100 worldlength=worldwidth Sub drawscreen If screen=1 Then GraphicsWindow.Clear() GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=36 GraphicsWindow.DrawText(50,50,"Island Craft岛屿生存") GraphicsWindow.FontSize=25 GraphicsWindow.DrawText(50,165,"输入存档路径:") enterkeypath=Controls.AddTextBox(50,200) Controls.SetSize(enterkeypath,500,40) Controls.SetTextBoxText(enterkeypath,path) startplaygame=Controls.AddButton("PLAY",580,200) Controls.SetSize(startplaygame,80,40) ElseIf screen=2 Then GraphicsWindow.Clear() firstgameload=0 GraphicsWindow.DrawText(200,150,"第一次进入此存档需要加载") GraphicsWindow.DrawText(280,190,"请耐心等候") showfirstgameload=Shapes.AddText("已加载"+firstgameload+"%") Shapes.Move(showfirstgameload,270,230) mex=Math.Floor(worldwidth/2)+1 mey=Math.Floor(worldlength/2)+1 For i=1 To worldlength For j=1 To worldwidth If i=mex And j=mey Then thing[i][j]=120 ElseIf i=mex-1 And j=mey Then thing[i][j]=120 ElseIf i=mex-2 And j=mey Then thing[i][j]=120 Else thing[i][j]=Math.GetRandomNumber(120) EndIf ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,(i-1)*worldwidth+j+1,thing[i][j]) firstgameload=Math.Round((i*100+j)/worldlength-1)/2 Shapes.SetText(showfirstgameload,"已加载"+firstgameload+"%") EndFor EndFor For i=1 To allcheck ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+i,0) firstgameload=50+Math.Round(50/allcheck)*i-1 Shapes.SetText(showfirstgameload,"已加载"+firstgameload+"%") EndFor For i=1 To 6 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+allcheck+i,0) EndFor ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+8+allcheck,1) ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+9+allcheck,mex) ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+10+allcheck,mey) For i=1 To 12 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+10+allcheck+i,0) EndFor ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+23+allcheck,10) ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+24+allcheck,10) firstgameload=100 Shapes.SetText(showfirstgameload,"已加载"+firstgameload+"%") screen=4 drawscreen() ElseIf screen=3 Then GraphicsWindow.Clear() willgetthing=0 gameload=0 GraphicsWindow.PenWidth=4 GraphicsWindow.DrawLine(0,451,700,451) GraphicsWindow.DrawLine(451,0,451,451) GraphicsWindow.PenWidth=4 GraphicsWindow.FontSize=14 GraphicsWindow.BrushColor="Black" For i=1 To 6 If holdeasybag=i Then GraphicsWindow.PenColor="Red" showholdeasybag1=Shapes.AddRectangle(2,40) showholdeasybag2=Shapes.AddRectangle(2,40) showholdeasybag3=Shapes.AddRectangle(60,2) showholdeasybag4=Shapes.AddRectangle(60,2) Shapes.Move(showholdeasybag1,19+(i-1)*70,486) Shapes.Move(showholdeasybag2,80+(i-1)*70,486) Shapes.Move(showholdeasybag3,20+(i-1)*70,485) Shapes.Move(showholdeasybag4,20+(i-1)*70,526) GraphicsWindow.PenColor="Black" EndIf GraphicsWindow.DrawRectangle(20+(i-1)*70,486,60,40) GraphicsWindow.DrawText(22+(i-1)*70,486,bagthing[easybag[i]]) GraphicsWindow.DrawText(22+(i-1)*70,506,"x"+bagnum[easybag[i]]) EndFor GraphicsWindow.PenWidth=2 GraphicsWindow.FontSize=22 GraphicsWindow.DrawText(10,456,"血量值:"+exchangerblood[blood]) GraphicsWindow.DrawText(300,456,"饥饿值:"+exchangerhung[hunger]) For i=mex-4 To mex+4 For j=mey-4 To mey+4 instead=thing[i][j] If instead<=18 Then '水 GraphicsWindow.BrushColor="CornFlowerBlue" GraphicsWindow.FillRectangle((i-mex+4)*50,(j-mey+4)*50,50,50) Else GraphicsWindow.BrushColor="ForestGreen" GraphicsWindow.FillRectangle((i-mex+4)*50,(j-mey+4)*50,50,50) EndIf If instead>18 And instead<=28 Then '树木 GraphicsWindow.BrushColor="DarkGreen" GraphicsWindow.FillRectangle((i-mex+4)*50+12.5,(j-mey+4)*50,25,50) GraphicsWindow.FillRectangle((i-mex+4)*50,(j-mey+4)*50+12.5,50,25) ElseIf instead>30 And instead<=35 Then '石头 GraphicsWindow.BrushColor="Gray" GraphicsWindow.FillRectangle((i-mex+4)*50+15,(j-mey+4)*50+15,20,20) ElseIf instead=30 Then '蘑菇 GraphicsWindow.BrushColor="Purple" GraphicsWindow.FillEllipse((i-mex+4)*50+19,(j-mey+4)*50+12,12,12) GraphicsWindow.FillRectangle((i-mex+4)*50+21.5,(j-mey+4)*50+22,7,10) ElseIf instead=29 Then '南瓜 GraphicsWindow.BrushColor="Gold" GraphicsWindow.FillRectangle((i-mex+4)*50+20,(j-mey+4)*50+15,10,8) GraphicsWindow.FillEllipse((i-mex+4)*50+15,(j-mey+4)*50+22,20,20) ElseIf instead=121 Then '标记 GraphicsWindow.PenColor="BurlyWood" GraphicsWindow.PenWidth=5 GraphicsWindow.DrawLine((i-mex+4)*50+5,(j-mey+4)*50+5,(i-mex+4)*50+45,(j-mey+4)*50+45) GraphicsWindow.DrawLine((i-mex+4)*50+45,(j-mey+4)*50+5,(i-mex+4)*50+5,(j-mey+4)*50+45) EndIf If i=mex And j=mey Then '我 GraphicsWindow.BrushColor="White" GraphicsWindow.FillRectangle((i-mex+4)*50+16,(j-mey+4)*50+8,17,21) EndIf EndFor EndFor ElseIf screen=4 Then GraphicsWindow.Clear() GraphicsWindow.FontSize=25 GraphicsWindow.DrawText(240,150,"正在载入游戏......") GraphicsWindow.DrawText(280,190,"请耐心等候") showfirstgameload=Shapes.AddText("已加载"+firstgameload+"%") Shapes.Move(showfirstgameload,270,230) ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' mex=File.ReadLine(path,worldlength*worldwidth+9+allcheck) ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' mey=File.ReadLine(path,worldlength*worldwidth+10+allcheck) For i=1 To worldlength For j=1 To worldwidth ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' thing[i][j]=File.ReadLine(path,(i-1)*worldwidth+j+1) firstgameload=Math.Round((i*100+j)/worldlength-1)/2 Shapes.SetText(showfirstgameload,"已加载"+firstgameload+"%") EndFor EndFor For i=1 To allcheck ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' bagnum[i]=File.ReadLine(path,worldlength*worldwidth+1+i) firstgameload=50+Math.Round(50/allcheck)*i-1 Shapes.SetText(showfirstgameload,"已加载"+firstgameload+"%") EndFor For i=1 To 12 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' baglong[i+13]=File.ReadLine(path,worldlength*worldwidth+10+allcheck+i) EndFor For i=1 To 6 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' easybag[i]=File.ReadLine(path,worldlength*worldwidth+1+allcheck+i) EndFor ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' holdeasybag=File.ReadLine(path,worldlength*worldwidth+8+allcheck) ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' blood=File.ReadLine(path,worldlength*worldwidth+23+allcheck) ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' hunger=File.ReadLine(path,worldlength*worldwidth+24+allcheck) firstgameload=100 Shapes.SetText(showfirstgameload,"已加载"+firstgameload+"%") screen=3 Timer.Tick=timecounter Timer.Interval=1000 drawscreen() ElseIf screen=5 Then GraphicsWindow.Clear() GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 GraphicsWindow.DrawRectangle(20,20,660,490) GraphicsWindow.DrawText(30,30,"背包物品:"+bagthing[check]) GraphicsWindow.DrawText(30,60,"物品编号:"+check) GraphicsWindow.DrawText(30,90,"物品数量:"+bagnum[check]) GraphicsWindow.DrawText(30,130,"放入快捷包:") GraphicsWindow.FontSize=22 For i=1 To 6 putinto[i]=Controls.AddButton(i+"号",30+(i-1)*85,160) Controls.SetSize(putinto[i],80,35) EndFor GraphicsWindow.DrawText(30,220,"制作材料1:"+bagthing[bagmake1[check]]+" X"+bagmake1num[check]+" , 拥有"+bagnum[bagmake1[check]]) GraphicsWindow.DrawText(30,250,"制作材料2:"+bagthing[bagmake2[check]]+" X"+bagmake2num[check]+" , 拥有"+bagnum[bagmake2[check]]) GraphicsWindow.DrawText(30,280,"制作材料3:"+bagthing[bagmake3[check]]+" X"+bagmake3num[check]+" , 拥有"+bagnum[bagmake3[check]]) GraphicsWindow.DrawText(30,320,"制作后可得到:"+bagthing[check]+" X"+bagmakeget[check]) makething=Controls.AddButton("制作",30,350) If check>=14 And check<=25 Then GraphicsWindow.DrawText(30,400,"剩余耐久度:"+baglong[check]) EndIf findinbagwri=Controls.AddTextBox(380,28) Controls.SetSize(findinbagwri,180,40) findinbagbut=Controls.AddButton("查找",570,28) Controls.SetSize(findinbagbut,80,40) EndIf EndSub Sub buttonclicked If screen=1 And Controls.LastClickedButton=startplaygame Then path=Controls.GetTextBoxText(enterkeypath) ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' If File.ReadLine(path,1)="" Then ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,1,1) screen=2 drawscreen() Else screen=4 drawscreen() EndIf ElseIf screen=5 Then If bagnum[check]>0 Then For i=1 To 6 If Controls.LastClickedButton=putinto[i] Then For j=1 To 6 If i<>j And easybag[j]=check Then easybag[j]=0 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+allcheck+i,check) EndIf EndFor easybag[i]=check ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+allcheck+i,check) EndIf EndFor EndIf If Controls.LastClickedButton=makething Then If bagnum[bagmake1[check]]>=bagmake1num[check] And bagnum[bagmake2[check]]>=bagmake2num[check] Then If bagnum[bagmake3[check]]>=bagmake3num[check] Then bagnum[bagmake1[check]]=bagnum[bagmake1[check]]-bagmake1num[check] bagnum[bagmake2[check]]=bagnum[bagmake2[check]]-bagmake2num[check] bagnum[bagmake3[check]]=bagnum[bagmake3[check]]-bagmake3num[check] bagnum[check]=bagnum[check]+bagmakeget[check] If bagnum[bagmake1[check]]=0 Then For i=1 To 6 If easybag[i]=bagmake1[check] Then easybag[i]=0 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+allcheck+i,0) EndIf EndFor EndIf If bagnum[bagmake2[check]]=0 Then For i=1 To 6 If easybag[i]=bagmake2[check] Then easybag[i]=0 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+allcheck+i,0) EndIf EndFor EndIf If bagnum[bagmake3[check]]=0 Then For i=1 To 6 If easybag[i]=bagmake3[check] Then easybag[i]=0 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+allcheck+i,0) EndIf EndFor EndIf ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+bagmake1[check],bagnum[bagmake1[check]]) ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+bagmake2[check],bagnum[bagmake2[check]]) ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+bagmake3[check],bagnum[bagmake3[check]]) ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+check,bagnum[check]) If check>=14 And check<=25 And bagnum[check]=1 Then baglong[check]=baghavelong[check] ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+10+allcheck+easybag[holdeasybag],baglong[easybag[holdeasybag]]) EndIf EndIf EndIf drawscreen() ElseIf Controls.LastClickedButton=findinbagbut Then findinbagname=Controls.GetTextBoxText(findinbagwri) For i=1 To allcheck If findinbagname=bagthing[i] Or i=findinbagname Then check=i EndIf EndFor drawscreen() EndIf EndIf EndSub Sub keydown If screen=3 Then If GraphicsWindow.LastKey="W" Or GraphicsWindow.LastKey="Up" Then If mey>1 And thing[mex][mey-1]>29 Then mey=mey-1 drawscreen() EndIf ElseIf GraphicsWindow.LastKey="A" Or GraphicsWindow.LastKey="Left" Then If mex>1 And thing[mex-1][mey]>29 Then mex=mex-1 drawscreen() EndIf ElseIf GraphicsWindow.LastKey="S" Or GraphicsWindow.LastKey="Down" Then If mey29 Then mey=mey+1 drawscreen() EndIf ElseIf GraphicsWindow.LastKey="D" Or GraphicsWindow.LastKey="Right" Then If mex29 Then mex=mex+1 drawscreen() EndIf ElseIf GraphicsWindow.LastKey="E" Then screen=5 drawscreen() EndIf For i=1 To 6 If GraphicsWindow.LastKey="D"+i Then holdeasybag=i Shapes.Move(showholdeasybag1,19+(i-1)*70,486) Shapes.Move(showholdeasybag2,80+(i-1)*70,486) Shapes.Move(showholdeasybag3,20+(i-1)*70,485) Shapes.Move(showholdeasybag4,20+(i-1)*70,526) ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+8+allcheck,holdeasybag) EndIf EndFor ElseIf screen=5 Then If GraphicsWindow.LastKey="W" Or GraphicsWindow.LastKey="Up" Then If check>1 Then check=check-1 Else check=allcheck EndIf drawscreen() ElseIf GraphicsWindow.LastKey="S" Or GraphicsWindow.LastKey="Down" Then If check=14 And easybag[holdeasybag]<=19 Then gameload=gameload-bagspeed[easybag[holdeasybag]] If gameload<=0 Then gameload=1 EndIf EndIf GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=7 ElseIf thing[mx][my]>18 And thing[mx][my]<29 Then '��木 gameload=10 If easybag[holdeasybag]>=14 And easybag[holdeasybag]<=19 Then gameload=gameload-bagspeed[easybag[holdeasybag]] If gameload<=0 Then gameload=1 EndIf EndIf GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=1 ElseIf thing[mx][my]>=31 And thing[mx][my]<=35 Then '石头 If easybag[holdeasybag]>=14 And easybag[holdeasybag]<=19 Then gameload=5 gameload=gameload-bagspeed[easybag[holdeasybag]] If gameload<=0 Then gameload=1 EndIf GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=4 Else GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showmessage=Shapes.AddText("太硬了,挖不动") Shapes.Move(showmessage,460,70) EndIf ElseIf thing[mx][my]>=36 And thing[mx][my]<=38 Then '铁 If easybag[holdeasybag]>=15 And easybag[holdeasybag]<=19 Then gameload=6 gameload=gameload-bagspeed[easybag[holdeasybag]] If gameload<=0 Then gameload=1 EndIf GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=10 Else GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showmessage=Shapes.AddText("太硬了,挖不动") Shapes.Move(showmessage,460,70) EndIf ElseIf thing[mx][my]>38 And thing[mx][my]<41 Then '黄金 If easybag[holdeasybag]>=16 And easybag[holdeasybag]<=19 Then gameload=6 gameload=gameload-bagspeed[easybag[holdeasybag]] If gameload<=0 Then gameload=1 EndIf GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=11 Else GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showmessage=Shapes.AddText("太硬了,挖不动") Shapes.Move(showmessage,460,70) EndIf ElseIf thing[mx][my]=41 Then '钻石 If easybag[holdeasybag]>=17 And easybag[holdeasybag]<=19 Then gameload=8 gameload=gameload-bagspeed[easybag[holdeasybag]] If gameload<=0 Then gameload=1 EndIf GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=12 Else GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showmessage=Shapes.AddText("太硬了,挖不动") Shapes.Move(showmessage,460,70) EndIf ElseIf thing[mx][my]=42 Then '��曜石 If easybag[holdeasybag]>=18 And easybag[holdeasybag]<=19 Then gameload=9 gameload=gameload-bagspeed[easybag[holdeasybag]] If gameload<=0 Then gameload=1 EndIf GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=13 Else GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showmessage=Shapes.AddText("太硬了,挖不动") Shapes.Move(showmessage,460,70) EndIf ElseIf thing[mx][my]>=43 And thing[mx][my]<=45 Then '煤 If easybag[holdeasybag]>=14 And easybag[holdeasybag]<=19 Then gameload=4 gameload=gameload-bagspeed[easybag[holdeasybag]] If gameload<=0 Then gameload=1 EndIf GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=9 Else GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showmessage=Shapes.AddText("太硬了,挖不动") Shapes.Move(showmessage,460,70) EndIf ElseIf thing[mx][my]=29 Then '南瓜 If easybag[holdeasybag]>=14 And easybag[holdeasybag]<=19 Then gameload=6 gameload=gameload-bagspeed[easybag[holdeasybag]] If gameload<=0 Then gameload=1 EndIf GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showpickcomplete=Shapes.AddText("采集剩余时间:"+gameload+"秒") Shapes.Move(showpickcomplete,460,10) willgetthing=8 Else GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showmessage=Shapes.AddText("太硬了,挖不动") Shapes.Move(showmessage,460,70) EndIf EndIf EndIf EndIf ElseIf Mouse.IsRightButtonDown="True" Then If mx<450 And my<450 Then mx=Math.Floor(mx/50)-4+mex my=Math.Floor(my/50)-4+mey If Math.Abs(mex-mx)<=1 And Math.Abs(mey-my)<=1 Then EndIf EndIf EndIf EndSub Sub timecounter digger() EndSub Sub digger If gameload>0 Then gameload=gameload-1 Shapes.SetText(showpickcomplete,"采集剩余时间:"+gameload+"秒") EndIf If gameload=0 Then If willgetthing=7 Then Shapes.HideShape(showpickcomplete) bagnum[7]=bagnum[7]+1 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldwidth*worldlength+8,bagnum[7]) If easybag[holdeasybag]>=14 And easybag[holdeasybag]<=19 Then baglong[easybag[holdeasybag]]=baglong[easybag[holdeasybag]]-1 If baglong[easybag[holdeasybag]]<=0 Then bagnum[easybag[holdeasybag]]=bagnum[easybag[holdeasybag]]-1 If bagnum[easybag[holdeasybag]]>0 Then baglong[easybag[holdeasybag]]=baghavelong[easybag[holdeasybag]] EndIf ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+easybag[holdeasybag],bagnum[easybag[holdeasybag]]) broken=1 EndIf ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth-3+allcheck+easybag[holdeasybag],baglong[easybag[holdeasybag]]) EndIf drawscreen() GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showgetbagthing=Shapes.AddText("获得物品:蘑菇") Shapes.Move(showgetbagthing,460,40) ElseIf willgetthing=1 Then Shapes.HideShape(showpickcomplete) bagnum[1]=bagnum[1]+Math.GetRandomNumber(2)+2 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldwidth*worldlength+2,bagnum[1]) bagnum[3]=bagnum[3]+Math.GetRandomNumber(3) ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldwidth*worldlength+4,bagnum[3]) If easybag[holdeasybag]>=14 And easybag[holdeasybag]<=19 Then baglong[easybag[holdeasybag]]=baglong[easybag[holdeasybag]]-10 If baglong[easybag[holdeasybag]]<=0 Then bagnum[easybag[holdeasybag]]=bagnum[easybag[holdeasybag]]-1 If bagnum[easybag[holdeasybag]]>0 Then baglong[easybag[holdeasybag]]=baghavelong[easybag[holdeasybag]] EndIf ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+easybag[holdeasybag],bagnum[easybag[holdeasybag]]) broken=1 EndIf ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth-3+allcheck+easybag[holdeasybag],baglong[easybag[holdeasybag]]) EndIf drawscreen() GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showgetbagthing=Shapes.AddText("获得物品:树叶、木块") Shapes.Move(showgetbagthing,460,40) ElseIf willgetthing=4 Then Shapes.HideShape(showpickcomplete) bagnum[4]=bagnum[4]+Math.GetRandomNumber(2) ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldwidth*worldlength+5,bagnum[4]) baglong[easybag[holdeasybag]]=baglong[easybag[holdeasybag]]-3 If baglong[easybag[holdeasybag]]<=0 Then bagnum[easybag[holdeasybag]]=bagnum[easybag[holdeasybag]]-1 If bagnum[easybag[holdeasybag]]>0 Then baglong[easybag[holdeasybag]]=baghavelong[easybag[holdeasybag]] EndIf broken=1 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+easybag[holdeasybag],bagnum[easybag[holdeasybag]]) ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth-3+allcheck+easybag[holdeasybag],baglong[easybag[holdeasybag]]) EndIf drawscreen() GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showgetbagthing=Shapes.AddText("获得物品:石头") Shapes.Move(showgetbagthing,460,40) ElseIf willgetthing=10 Then Shapes.HideShape(showpickcomplete) bagnum[10]=bagnum[10]+1 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldwidth*worldlength+11,bagnum[10]) baglong[easybag[holdeasybag]]=baglong[easybag[holdeasybag]]-5 If baglong[easybag[holdeasybag]]<=0 Then bagnum[easybag[holdeasybag]]=bagnum[easybag[holdeasybag]]-1 If bagnum[easybag[holdeasybag]]>0 Then baglong[easybag[holdeasybag]]=baghavelong[easybag[holdeasybag]] EndIf broken=1 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+easybag[holdeasybag],bagnum[easybag[holdeasybag]]) EndIf ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth-3+allcheck+easybag[holdeasybag],baglong[easybag[holdeasybag]]) drawscreen() GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showgetbagthing=Shapes.AddText("获得物品:铁") Shapes.Move(showgetbagthing,460,40) ElseIf willgetthing=11 Then Shapes.HideShape(showpickcomplete) bagnum[11]=bagnum[11]+1 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldwidth*worldlength+12,bagnum[11]) baglong[easybag[holdeasybag]]=baglong[easybag[holdeasybag]]-5.5 If baglong[easybag[holdeasybag]]<=0 Then bagnum[easybag[holdeasybag]]=bagnum[easybag[holdeasybag]]-1 If bagnum[easybag[holdeasybag]]>0 Then baglong[easybag[holdeasybag]]=baghavelong[easybag[holdeasybag]] EndIf broken=1 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+easybag[holdeasybag],bagnum[easybag[holdeasybag]]) EndIf ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth-3+allcheck+easybag[holdeasybag],baglong[easybag[holdeasybag]]) drawscreen() GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showgetbagthing=Shapes.AddText("获得物品:���金") Shapes.Move(showgetbagthing,460,40) ElseIf willgetthing=12 Then Shapes.HideShape(showpickcomplete) bagnum[12]=bagnum[12]+1 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldwidth*worldlength+13,bagnum[12]) baglong[easybag[holdeasybag]]=baglong[easybag[holdeasybag]]-7 If baglong[easybag[holdeasybag]]<=0 Then bagnum[easybag[holdeasybag]]=bagnum[easybag[holdeasybag]]-1 If bagnum[easybag[holdeasybag]]>0 Then baglong[easybag[holdeasybag]]=baghavelong[easybag[holdeasybag]] EndIf broken=1 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+easybag[holdeasybag],bagnum[easybag[holdeasybag]]) EndIf ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth-3+allcheck+easybag[holdeasybag],baglong[easybag[holdeasybag]]) drawscreen() GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showgetbagthing=Shapes.AddText("获得物品:钻石") Shapes.Move(showgetbagthing,460,40) ElseIf willgetthing=11 Then Shapes.HideShape(showpickcomplete) bagnum[11]=bagnum[11]+1 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldwidth*worldlength+12,bagnum[11]) baglong[easybag[holdeasybag]]=baglong[easybag[holdeasybag]]-5.5 If baglong[easybag[holdeasybag]]<=0 Then bagnum[easybag[holdeasybag]]=bagnum[easybag[holdeasybag]]-1 If bagnum[easybag[holdeasybag]]>0 Then baglong[easybag[holdeasybag]]=baghavelong[easybag[holdeasybag]] EndIf broken=1 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+easybag[holdeasybag],bagnum[easybag[holdeasybag]]) EndIf ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth-3+allcheck+easybag[holdeasybag],baglong[easybag[holdeasybag]]) drawscreen() GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showgetbagthing=Shapes.AddText("获得物品:黄金") Shapes.Move(showgetbagthing,460,40) ElseIf willgetthing=12 Then Shapes.HideShape(showpickcomplete) bagnum[12]=bagnum[12]+1 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldwidth*worldlength+13,bagnum[12]) baglong[easybag[holdeasybag]]=baglong[easybag[holdeasybag]]-7 If baglong[easybag[holdeasybag]]<=0 Then bagnum[easybag[holdeasybag]]=bagnum[easybag[holdeasybag]]-1 If bagnum[easybag[holdeasybag]]>0 Then baglong[easybag[holdeasybag]]=baghavelong[easybag[holdeasybag]] EndIf broken=1 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+easybag[holdeasybag],bagnum[easybag[holdeasybag]]) EndIf ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth-3+allcheck+easybag[holdeasybag],baglong[easybag[holdeasybag]]) drawscreen() GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showgetbagthing=Shapes.AddText("获得物品:钻石") Shapes.Move(showgetbagthing,460,40) ElseIf willgetthing=13 Then Shapes.HideShape(showpickcomplete) bagnum[13]=bagnum[13]+1 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldwidth*worldlength+14,bagnum[13]) baglong[easybag[holdeasybag]]=baglong[easybag[holdeasybag]]-8 If baglong[easybag[holdeasybag]]<=0 Then bagnum[easybag[holdeasybag]]=bagnum[easybag[holdeasybag]]-1 If bagnum[easybag[holdeasybag]]>0 Then baglong[easybag[holdeasybag]]=baghavelong[easybag[holdeasybag]] EndIf broken=1 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+easybag[holdeasybag],bagnum[easybag[holdeasybag]]) EndIf ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth-3+allcheck+easybag[holdeasybag],baglong[easybag[holdeasybag]]) drawscreen() GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showgetbagthing=Shapes.AddText("获得物品:黑曜石") Shapes.Move(showgetbagthing,460,40) ElseIf willgetthing=9 Then Shapes.HideShape(showpickcomplete) bagnum[9]=bagnum[9]+Math.GetRandomNumber(2) ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldwidth*worldlength+10,bagnum[9]) baglong[easybag[holdeasybag]]=baglong[easybag[holdeasybag]]-3 If baglong[easybag[holdeasybag]]<=0 Then bagnum[easybag[holdeasybag]]=bagnum[easybag[holdeasybag]]-1 If bagnum[easybag[holdeasybag]]>0 Then baglong[easybag[holdeasybag]]=baghavelong[easybag[holdeasybag]] EndIf broken=1 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+easybag[holdeasybag],bagnum[easybag[holdeasybag]]) EndIf ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth-3+allcheck+easybag[holdeasybag],baglong[easybag[holdeasybag]]) drawscreen() GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showgetbagthing=Shapes.AddText("获得物品:煤炭") Shapes.Move(showgetbagthing,460,40) ElseIf willgetthing=8 Then Shapes.HideShape(showpickcomplete) bagnum[8]=bagnum[8]+1 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldwidth*worldlength+9,bagnum[8]) baglong[easybag[holdeasybag]]=baglong[easybag[holdeasybag]]-5 If baglong[easybag[holdeasybag]]<=0 Then bagnum[easybag[holdeasybag]]=bagnum[easybag[holdeasybag]]-1 If bagnum[easybag[holdeasybag]]>0 Then baglong[easybag[holdeasybag]]=baghavelong[easybag[holdeasybag]] EndIf broken=1 ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth+1+easybag[holdeasybag],bagnum[easybag[holdeasybag]]) EndIf ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(path,worldlength*worldwidth-3+allcheck+easybag[holdeasybag],baglong[easybag[holdeasybag]]) drawscreen() GraphicsWindow.BrushColor="Black" GraphicsWindow.FontSize=25 showgetbagthing=Shapes.AddText("获得物品:南瓜") Shapes.Move(showgetbagthing,460,40) EndIf willgetthing=0 broken=0 If broken=1 Then showmessage=Shapes.AddText("挖掘损坏了一把镐") Shapes.Move(showmessage,460,70) EndIf EndIf EndSub Sub baginformation allcheck=33 bagthing[1]="木块" bagthing[2]="木板" bagthing[3]="树叶" bagthing[4]="石头" bagthing[5]="石块" bagthing[6]="木棍" bagthing[7]="蘑菇" bagthing[8]="南瓜" bagthing[9]="煤炭" bagthing[10]="铁" bagthing[11]="黄金" bagthing[12]="钻石" bagthing[13]="黑曜石" bagthing[14]="木镐" bagthing[15]="石镐" bagthing[16]="铁镐" bagthing[17]="黄金镐" bagthing[18]="钻石镐" bagthing[19]="黑曜石镐" bagthing[20]="木剑" bagthing[21]="石剑" bagthing[22]="铁剑" bagthing[23]="黄金剑" bagthing[24]="钻石剑" bagthing[25]="黑曜石剑" bagthing[26]="生猪肉" bagthing[27]="熟猪肉" bagthing[28]="生牛肉" bagthing[29]="熟牛肉" bagthing[30]="鸡蛋" bagthing[31]="小麦" bagthing[32]="牛奶" bagthing[33]="蛋糕" bagmake1[2]=1 bagmake1num[2]=1 bagmakeget[2]=4 bagmake1[5]=4 bagmake1num[5]=2 bagmakeget[5]=1 bagmake1[6]=2 bagmake1num[6]=2 bagmakeget[6]=4 bagmake1[14]=2 bagmake1num[14]=3 bagmake2[14]=6 bagmake2num[14]=2 bagmakeget[14]=1 bagmake1[15]=5 bagmake1num[15]=3 bagmake2[15]=6 bagmake2num[15]=2 bagmakeget[15]=1 bagmake1[16]=10 bagmake1num[16]=3 bagmake2[16]=6 bagmake2num[16]=2 bagmakeget[16]=1 bagmake1[17]=11 bagmake1num[17]=3 bagmake2[17]=6 bagmake2num[17]=2 bagmakeget[17]=1 bagmake1[18]=12 bagmake1num[18]=3 bagmake2[18]=6 bagmake2num[18]=2 bagmakeget[18]=1 bagmake1[19]=13 bagmake1num[19]=3 bagmake2[19]=6 bagmake2num[19]=2 bagmakeget[19]=1 bagmake1[20]=2 bagmake1num[20]=3 bagmake2[20]=6 bagmake2num[20]=2 bagmakeget[20]=1 bagmake1[21]=5 bagmake1num[21]=3 bagmake2[21]=6 bagmake2num[21]=2 bagmakeget[21]=1 bagmake1[22]=10 bagmake1num[22]=3 bagmake2[22]=6 bagmake2num[22]=2 bagmakeget[22]=1 bagmake1[23]=11 bagmake1num[23]=3 bagmake2[23]=6 bagmake2num[23]=2 bagmakeget[23]=1 bagmake1[24]=12 bagmake1num[24]=3 bagmake2[24]=6 bagmake2num[24]=2 bagmakeget[24]=1 bagmake1[25]=13 bagmake1num[25]=3 bagmake2[25]=6 bagmake2num[25]=2 bagmakeget[25]=1 bagmake1[33]=30 bagmake1num[33]=3 bagmake2[33]=31 bagmake2num[33]=3 bagmake3[33]=32 bagmake3num[33]=3 bagmakeget[33]=1 baghavelong[14]=60 baghavelong[15]=80 baghavelong[16]=140 baghavelong[17]=100 baghavelong[18]=160 baghavelong[19]=180 baghavelong[20]=25 baghavelong[21]=35 baghavelong[22]=45 baghavelong[23]=40 baghavelong[24]=60 baghavelong[25]=70 bagspeed[14]=1 bagspeed[15]=2 bagspeed[16]=2 bagspeed[17]=3 bagspeed[18]=4 bagspeed[19]=4 EndSub Sub typerinformation exchangerblood[1]= "❤" exchangerblood[2]= "❤❤" exchangerblood[3]= "❤❤❤" exchangerblood[4]= "❤❤❤❤" exchangerblood[5]= "❤❤❤❤❤" exchangerblood[6]= "❤❤❤❤❤❤" exchangerblood[7]= "❤❤❤❤❤❤❤" exchangerblood[8]= "❤❤❤❤❤❤❤❤" exchangerblood[9]= "❤❤❤❤❤❤❤❤❤" exchangerblood[10]="❤❤❤❤❤❤❤❤❤❤" exchangerhung[1]= "★" exchangerhung[2]= "★★" exchangerhung[3]= "★★★" exchangerhung[4]= "★★★★" exchangerhung[5]= "★★★★★" exchangerhung[6]= "★★★★★★" exchangerhung[7]= "★★★★★★★" exchangerhung[8]= "★★★★★★★★" exchangerhung[9]= "★★★★★★★★★" exchangerhung[10]="★★★★★★★★★★" EndSub '地图分配 '1-18 水 '19-28 树木 '29 南瓜 '30 蘑菇 '31-35 石头 '36-38 铁 '39-40 黄金 '41 钻石 '42 黑曜石 '43-45 煤 '46 猪 '47 牛 '48 羊 '49 狼 '50 虎 '51 熊 '52 鸡 End>GRC991.sb< Start>GRD203.sb< 'Written by Thaelmann-Pioniere GraphicsWindow.Title="Molecular Challenge-Diaminomethanal(Urea) [(NH2)2CO]" GraphicsWindow.Width=700 GraphicsWindow.Height=500 GraphicsWindow.BrushColor="black" GraphicsWindow.BackgroundColor="#dabc72" GraphicsWindow.FontSize=48 GraphicsWindow.DrawText(390,50,"(NH") GraphicsWindow.FontSize=24 GraphicsWindow.DrawText(490,90,"2") GraphicsWindow.FontSize=48 GraphicsWindow.DrawText(510,50,")") GraphicsWindow.FontSize=24 GraphicsWindow.DrawText(530,90,"2") GraphicsWindow.FontSize=48 GraphicsWindow.DrawText(550,50,"CO") GraphicsWindow.PenWidth=14 r=30' The "r" means "radius" d=r*2' The "d" means "diameter" GraphicsWindow.FillEllipse(320-r,240-r,d,d) direction=120 Turtle.Speed=10 For i = 1 To 2 GraphicsWindow.PenColor="black" Turtle.PenUp() Turtle.MoveTo(320,240) Turtle.Angle=direction Turtle.PenDown() Turtle.Move(r+35) GraphicsWindow.PenColor="blue" Turtle.Move(35+r) direction=direction+120 xofN[i]=Turtle.X-r yofN[i]=Turtle.Y-r EndFor' carbon-nitrogen bonds GraphicsWindow.BrushColor="blue" For i = 1 To 2 GraphicsWindow.FillEllipse(xofN[i],yofN[i],d,d) EndFor' nitrogen atoms Turtle.PenUp() Turtle.MoveTo(305,240) Turtle.Angle=0 GraphicsWindow.PenWidth=7.5 Turtle.PenDown() GraphicsWindow.PenColor="black" Turtle.Move(r+35) GraphicsWindow.PenColor="red" Turtle.Move(35+r) Turtle.PenUp() Turtle.MoveTo(335,240) Turtle.Angle=0 Turtle.PenDown() GraphicsWindow.PenColor="black" Turtle.Move(r+35) GraphicsWindow.PenColor="red" Turtle.Move(35+r)' carbon-oxygen bonds GraphicsWindow.BrushColor="red" GraphicsWindow.FillEllipse(320-r,110-r,d,d)' oxygen atom GraphicsWindow.BrushColor="white" GraphicsWindow.PenWidth=15 For i = 1 To 2 GraphicsWindow.PenColor="blue" Turtle.PenUp() Turtle.MoveTo(xofN[i]+r,yofN[i]+r) Turtle.Angle=180 Turtle.PenDown() Turtle.Move(r+35) GraphicsWindow.PenColor="white" Turtle.Move(35+r) GraphicsWindow.FillEllipse(Turtle.X-r,Turtle.Y-r,d,d)' hydrogen atoms EndFor' hydrogrn-nitrogen bonds direction=60 For i = 1 To 2 GraphicsWindow.PenColor="blue" Turtle.PenUp() Turtle.MoveTo(xofN[i]+r,yofN[i]+r) Turtle.Angle=direction Turtle.PenDown() Turtle.Move(r+35) GraphicsWindow.PenColor="white" Turtle.Move(35+r) GraphicsWindow.FillEllipse(Turtle.X-r,Turtle.Y-r,d,d)' hydrogen atoms direction=direction-120 EndFor' hydrogen-nitrogen bonds Turtle.Hide() End>GRD203.sb< Start>GRD708-0.sb< 'Goat 'Robin Andrews InitTriangles() GraphicsWindow.Brushcolor = "#00ff00" GraphicsWindow.Pencolor = "#00ff00" triangle_number = 1 While (tX[triangle_number-1][1]<>"end") For i=1 To 3 xLine = (2*i-1)+((triangle_number-1)*7) yLine = (2*i)+((triangle_number-1)*7) tX[triangle_number][i] = triangles[triangle_number]["x" + i] tY[triangle_number][i] = triangles[triangle_number]["y" + i] EndFor For i = 1 To 3 x[i] = tX[triangle_number][i] y[i] = tY[triangle_number][i] EndFor Shapes.AddTriangle(x[1],y[1],x[2],y[2],x[3],y[3]) triangle_number = triangle_number + 1 EndWhile Sub InitTriangles triangles[1] = "x1=158;y1=192;x2=193;y2=192;x3=193;y3=157;" triangles[2] = "x1=193;y1=157;x2=228;y2=157;x3=193;y3=192;" triangles[3] = "x1=158;y1=192;x2=207;y2=192;x3=158;y3=242;" triangles[4] = "x1=183;y1=218;x2=207;y2=192;x3=233;y3=218;" triangles[5] = "x1=233;y1=218;x2=183;y2=218;x3=207;y3=242;" triangles[6] = "x1=183;y1=269;x2=233;y2=218;x3=283;y3=269;" triangles[7] = "x1=183;y1=269;x2=219;y2=269;x3=219;y3=304;" triangles[8] = "x1=254;y1=242;x2=326;y2=242;x3=326;y3=310;" triangles[9] = "x1=326;y1=207;x2=351;y2=231;x3=326;y3=255;" triangles[10] = "x1=end;" EndSub End>GRD708-0.sb< Start>GRD708.sb< 'Goat 'Robin Andrews GraphicsWindow.Brushcolor = "#00ff00" GraphicsWindow.Pencolor = "#00ff00" triangle_number = 1 While (tX[triangle_number-1][1]<>"end") For i=1 To 3 xLine = (2*i-1)+((triangle_number-1)*7) yLine = (2*i)+((triangle_number-1)*7) ' The following line could be harmful and has been automatically commented. ' tX[triangle_number][i] = File.ReadLine("C:\Users\Robin\Desktop\Programming\SBprogs\goat_challenge\goat_coordinates.txt", xLine) ' The following line could be harmful and has been automatically commented. ' tY[triangle_number][i] = File.ReadLine("C:\Users\Robin\Desktop\Programming\SBprogs\goat_challenge\goat_coordinates.txt", yLine) EndFor For i = 1 To 3 x[i] = tX[triangle_number][i] y[i] = tY[triangle_number][i] EndFor Shapes.AddTriangle(x[1],y[1],x[2],y[2],x[3],y[3]) triangle_number = triangle_number + 1 EndWhile End>GRD708.sb< Start>GRG567.sb< ' アクションゲーム 1作目 ' ' 岡山科学技術専門学校 情報システム学科 教材 ' 各種定数の定義 cls: GraphicsWindow.Width = 700 GraphicsWindow.Height = 600 GraphicsWindow.BackgroundColor = "#B0F0E6" GraphicsWindow.FontSize = 60 GraphicsWindow.BrushColor = "#C050B0" GraphicsWindow.DrawText(170,8, "ロールボール") GraphicsWindow.FontSize = 30 GraphicsWindow.BrushColor = "Red" GraphicsWindow.DrawText(1,90, "[十字キー]で移動") GraphicsWindow.BrushColor = "Blue" GraphicsWindow.DrawText(1,140, "[スペースキー]で一時停止") GraphicsWindow.BrushColor = "Green" GraphicsWindow.DrawText(1,190, "敵に当たらないようにゴールを目指せ") GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(1,240, "[1~9]または[A~F]を押すと始まります") GraphicsWindow.BrushColor = "#6030A0" GraphicsWindow.DrawText(1,300, "[終了]ボタンを押すと終了します") GraphicsWindow.BrushColor = "Red" GraphicsWindow.DrawText(1,360, "注意") GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(1,390, "ステージにある[山田]という字に意味はありません") GraphicsWindow.BrushColor = "Blue" GraphicsWindow.DrawText(1,450, "1~15のステージがあります") GraphicsWindow.DrawText(1,480, "数字が大きくなるにつれて難易度が上がります") GraphicsWindow.BrushColor = "Red" GraphicsWindow.DrawText(1,530, "ステージナンバー") GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(1,560, "1 2 3 4 5 6 7 8 9 A B C D E F") KeyName = GraphicsWindow.LastKey If KeyName = "D1" Then Goto rt ElseIf KeyName = "D2" Then ss=2 Goto st ElseIf KeyName = "D3" Then ss=3 Goto st ElseIf KeyName = "D4" Then ss=4 Goto st ElseIf KeyName = "D5" Then ss=5 Goto st ElseIf KeyName = "D6" Then ss=6 Goto st ElseIf KeyName = "D7" Then ss=7 Goto st ElseIf KeyName = "D8" Then ss=8 Goto st ElseIf KeyName = "D9" Then ss=9 Goto st ElseIf KeyName = "A" then ss=10 Goto st ElseIf KeyName = "B" Then ss=11 Goto st ElseIf KeyName = "C" Then ss=12 Goto st ElseIf KeyName = "D" Then ss=13 Goto st ElseIf KeyName = "E" Then ss=14 Goto st ElseIf KeyName = "F" Then ss=15 Goto st EndIf Goto cls rt: ss=1 stage = 1 DEATH = 0 click=0 st: GraphicsWindow.Clear() SCREEN_WIDTH = 24 ' スクリーンの幅(ユニット数) SCREEN_HEIGHT = 18 ' スクリーンの高さ(ユニット数) UNIT_SIZE = 30 ' ユニットサイズ(ピクセル) GOAL_X = 1 GOAL_Y = 1 ENEMY_NUM = 5 SPEED = 5 ' 一度に移動するピクセル数 ENEMY_SPEED = 10 ' Enemy Speed DELAY = 50 ' ループ毎の待機時間(ミリ秒) WALL_COLOR = "#808080" ' 壁の色 BACK_COLOR = "#B0F0E6" ' 背景の色 ROBO_COLOR = "#0000FF" ' ロボットの色 ENEMY_COLOR = "#FF0000" ' Enemy Color ' 壁の配置(マップ)を定義 (1:壁あり, それ以外:壁なし) If ss=1 then WALLS [1] = "111111111111111111111111" WALLS [2] = "101010101010111110111111" WALLS [3] = "101010101010111110111111" WALLS [4] = "101010101010110110110111" WALLS [5] = "101010101010110110110111" WALLS [6] = "101010101010110110110111" WALLS [7] = "101010101000110000000111" WALLS [8] = "101000101010111111111111" WALLS [9] = "101010100010000000000001" WALLS [10] = "100010001010111111111001" WALLS [11] = "111010101010100000001001" WALLS [12] = "111010101010101101101001" WALLS [13] = "111010101010101101101001" WALLS [14] = "111010101010100000001001" WALLS [15] = "111010101010101101101001" WALLS [16] = "111010101010101101101001" WALLS [17] = "111010101000100000001001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 3 ey[1] = UNIT_SIZE * 1 exd[1] = 0 eyd[1] = 1 ex[2] = UNIT_SIZE * 5 ey[2] = UNIT_SIZE * 6 exd[2] = 0 eyd[2] = -1 ex[3] = UNIT_SIZE * 7 ey[3] = UNIT_SIZE * 4 exd[3] = 0 eyd[3] = 1 ex[4] = UNIT_SIZE * 9 ey[4] = UNIT_SIZE * 8 exd[4] = 0 eyd[4] = 1 ex[5] = UNIT_SIZE * 11 ey[5] = UNIT_SIZE * 2 exd[5] = 0 eyd[5] = -1 Endif If ss=2 then ENEMY_NUM = 11 ENEMY_SPEED = 8 WALLS [1] = "111111111111111111111111" WALLS [2] = "101111101110111111111111" WALLS [3] = "101000000000000011111111" WALLS [4] = "101011011011011001111111" WALLS [5] = "101000000000000011111111" WALLS [6] = "101011011011011011111111" WALLS [7] = "101011011011011011111111" WALLS [8] = "101000000000000011111111" WALLS [9] = "101011011011011000000001" WALLS [10] = "100011011011011011111001" WALLS [11] = "111000000000000011111001" WALLS [12] = "111011011011011011111001" WALLS [13] = "111011011011011011111001" WALLS [14] = "111000000000000011111001" WALLS [15] = "111011011011011001111001" WALLS [16] = "111000000000000011111001" WALLS [17] = "111111101110111111111001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 3 ey[1] = UNIT_SIZE * 15 exd[1] = 0 eyd[1] = 1 ex[2] = UNIT_SIZE * 6 ey[2] = UNIT_SIZE * 9 exd[2] = 0 eyd[2] = 1 ex[3] = UNIT_SIZE * 9 ey[3] = UNIT_SIZE * 5 exd[3] = 0 eyd[3] = 1 ex[4] = UNIT_SIZE * 12 ey[4] = UNIT_SIZE * 12 exd[4] = 0 eyd[4] = 1 ex[5] = UNIT_SIZE * 15 ey[5] = UNIT_SIZE * 2 exd[5] = 0 eyd[5] = 1 ex[6] = UNIT_SIZE * 3 ey[6] = UNIT_SIZE * 2 exd[6] = 1 eyd[6] = 0 ex[7] = UNIT_SIZE * 7 ey[7] = UNIT_SIZE * 4 exd[7] = 1 eyd[7] = 0 ex[8] = UNIT_SIZE * 12 ey[8] = UNIT_SIZE * 7 exd[8] = 1 eyd[8] = 0 ex[9] = UNIT_SIZE * 4 ey[9] = UNIT_SIZE * 10 exd[9] = 1 eyd[9] = 0 ex[10] = UNIT_SIZE * 9 ey[10] = UNIT_SIZE * 13 exd[10] = 1 eyd[10] = 0 ex[11] = UNIT_SIZE * 3 ey[11] = UNIT_SIZE * 15 exd[11] = 1 eyd[11] = 0 Endif If ss=3 then ENEMY_NUM = 14 ENEMY_SPEED = 8 WALLS [1] = "111111111111111111111111" WALLS [2] = "100111001111111111110111" WALLS [3] = "100111000000000111010101" WALLS [4] = "100111000000000111010101" WALLS [5] = "100011000000000111000001" WALLS [6] = "100001000000000011111111" WALLS [7] = "100100001000100000011111" WALLS [8] = "111110000000000000011111" WALLS [9] = "111111000000001000011111" WALLS [10] = "111111100000000000011111" WALLS [11] = "111111110000000000011111" WALLS [12] = "111111111000001000011111" WALLS [13] = "100000111100000000011111" WALLS [14] = "101010111110000000001111" WALLS [15] = "100000111111000000001001" WALLS [16] = "101010111111100111111001" WALLS [17] = "100000111111110000000001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 6 ey[1] = UNIT_SIZE * 2 exd[1] = 0 eyd[1] = 1 ex[2] = UNIT_SIZE * 7 ey[2] = UNIT_SIZE * 2 exd[2] = 0 eyd[2] = 1 ex[3] = UNIT_SIZE * 9 ey[3] = UNIT_SIZE * 2 exd[3] = 0 eyd[3] = 1 ex[4] = UNIT_SIZE * 10 ey[4] = UNIT_SIZE * 2 exd[4] = 0 eyd[4] = 1 ex[5] = UNIT_SIZE * 11 ey[5] = UNIT_SIZE * 2 exd[5] = 0 eyd[5] = 1 ex[6] = UNIT_SIZE * 13 ey[6] = UNIT_SIZE * 2 exd[6] = 0 eyd[6] = 1 ex[7] = UNIT_SIZE * 14 ey[7] = UNIT_SIZE * 2 exd[7] = 0 eyd[7] = 1 ex[8] = UNIT_SIZE * 18 ey[8] = UNIT_SIZE * 6 exd[8] = -1 eyd[8] = 0 ex[9] = UNIT_SIZE * 18 ey[9] = UNIT_SIZE * 7 exd[9] = -1 eyd[9] = 0 ex[10] = UNIT_SIZE * 18 ey[10] = UNIT_SIZE * 9 exd[10] = -1 eyd[10] = 0 ex[11] = UNIT_SIZE * 18 ey[11] = UNIT_SIZE * 10 exd[11] = -1 eyd[11] = 0 ex[12] = UNIT_SIZE * 18 ey[12] = UNIT_SIZE * 11 exd[12] = -1 eyd[12] = 0 ex[13] = UNIT_SIZE * 18 ey[13] = UNIT_SIZE * 13 exd[13] = -1 eyd[13] = 0 ex[14] = UNIT_SIZE * 18 ey[14] = UNIT_SIZE * 14 exd[14] = -1 eyd[14] = 0 Endif If ss=4 then ENEMY_NUM = 17 ENEMY_SPEED = 7 WALLS [1] = "111111111111111111111111" WALLS [2] = "100011000110001100111001" WALLS [3] = "100011000110001100111001" WALLS [4] = "111011000000001100011001" WALLS [5] = "100011000000101100000001" WALLS [6] = "100111000110001100011001" WALLS [7] = "100011010110001100111001" WALLS [8] = "100011000111001100011001" WALLS [9] = "100011000110001110011001" WALLS [10] = "100011001110001100011001" WALLS [11] = "100011000110001100011001" WALLS [12] = "100011000110001100011001" WALLS [13] = "100011100110001100011001" WALLS [14] = "100000000110000000011001" WALLS [15] = "110000000110000000011001" WALLS [16] = "100011000110001100011001" WALLS [17] = "101111100110011110011001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 1 ey[1] = UNIT_SIZE * 4 exd[1] = 0 eyd[1] = 1 ex[2] = UNIT_SIZE * 2 ey[2] = UNIT_SIZE * 12 exd[2] = 0 eyd[2] = 1 ex[3] = UNIT_SIZE * 3 ey[3] = UNIT_SIZE * 6 exd[3] = 0 eyd[3] = 1 ex[4] = UNIT_SIZE * 18 ey[4] = UNIT_SIZE * 7 exd[4] = 0 eyd[4] = 1 ex[5] = UNIT_SIZE * 6 ey[5] = UNIT_SIZE * 1 exd[5] = 0 eyd[5] = 1 ex[6] = UNIT_SIZE * 7 ey[6] = UNIT_SIZE * 1 exd[6] = 0 eyd[6] = 1 ex[7] = UNIT_SIZE * 7 ey[7] = UNIT_SIZE * 7 exd[7] = 0 eyd[7] = 1 ex[8] = UNIT_SIZE * 8 ey[8] = UNIT_SIZE * 2 exd[8] = 0 eyd[8] = 1 ex[9] = UNIT_SIZE * 8 ey[9] = UNIT_SIZE * 10 exd[9] = 0 eyd[9] = 1 ex[10] = UNIT_SIZE * 11 ey[10] = UNIT_SIZE * 1 exd[10] = 0 eyd[10] = 1 ex[11] = UNIT_SIZE * 11 ey[11] = UNIT_SIZE * 8 exd[11] = 0 eyd[11] = 1 ex[12] = UNIT_SIZE * 12 ey[12] = UNIT_SIZE * 1 exd[12] = 0 eyd[12] = 1 ex[13] = UNIT_SIZE * 12 ey[13] = UNIT_SIZE * 5 exd[13] = 0 eyd[13] = 1 ex[14] = UNIT_SIZE * 13 ey[14] = UNIT_SIZE * 1 exd[14] = 0 eyd[14] = 1 ex[15] = UNIT_SIZE * 16 ey[15] = UNIT_SIZE * 1 exd[15] = 0 eyd[15] = 1 ex[16] = UNIT_SIZE * 16 ey[16] = UNIT_SIZE * 9 exd[16] = 0 eyd[16] = 1 ex[17] = UNIT_SIZE * 17 ey[17] = UNIT_SIZE * 1 exd[17] = 0 eyd[17] = 1 Endif If ss=5 then ENEMY_NUM = 14 ENEMY_SPEED = 8 WALLS [1] = "111111111111111111111111" WALLS [2] = "100000000000000000000001" WALLS [3] = "111111111111111111111001" WALLS [4] = "100000011000100001010001" WALLS [5] = "100000000000000000000001" WALLS [6] = "100100100001111000100011" WALLS [7] = "100011111111111111111111" WALLS [8] = "110011111011111000001111" WALLS [9] = "100011101010111010101111" WALLS [10] = "100011101010111000001111" WALLS [11] = "100111100000111010101111" WALLS [12] = "100011111111111000001111" WALLS [13] = "100011000010011100000001" WALLS [14] = "100000000000000000000001" WALLS [15] = "110000001101001000111001" WALLS [16] = "110111111111111111111001" WALLS [17] = "111111111111111111111001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 3 ey[1] = UNIT_SIZE * 13 exd[1] = 1 eyd[1] = 0 ex[2] = UNIT_SIZE * 7 ey[2] = UNIT_SIZE * 13 exd[2] = -1 eyd[2] = 0 ex[3] = UNIT_SIZE * 12 ey[3] = UNIT_SIZE * 13 exd[3] = 1 eyd[3] = 0 ex[4] = UNIT_SIZE * 4 ey[4] = UNIT_SIZE * 13 exd[4] = -1 eyd[4] = 0 ex[5] = UNIT_SIZE * 6 ey[5] = UNIT_SIZE * 13 exd[5] = 1 eyd[5] = 0 ex[6] = UNIT_SIZE * 2 ey[6] = UNIT_SIZE * 5 exd[6] = 0 eyd[6] = 1 ex[7] = UNIT_SIZE * 2 ey[7] = UNIT_SIZE * 8 exd[7] = 0 eyd[7] = 1 ex[8] = UNIT_SIZE * 2 ey[8] = UNIT_SIZE * 6 exd[8] = 0 eyd[8] = -1 ex[9] = UNIT_SIZE * 2 ey[9] = UNIT_SIZE * 13 exd[9] = 0 eyd[9] = 1 ex[10] = UNIT_SIZE * 7 ey[10] = UNIT_SIZE * 4 exd[10] = -1 eyd[10] = 0 ex[11] = UNIT_SIZE * 13 ey[11] = UNIT_SIZE * 4 exd[11] = -1 eyd[11] = 0 ex[12] = UNIT_SIZE * 17 ey[12] = UNIT_SIZE * 4 exd[12] = 1 eyd[12] = 0 ex[13] = UNIT_SIZE * 10 ey[13] = UNIT_SIZE * 4 exd[13] = 1 eyd[13] = 0 ex[14] = UNIT_SIZE * 6 ey[14] = UNIT_SIZE * 4 exd[14] = 1 eyd[14] = 0 Endif If ss=6 then ENEMY_NUM = 16 ENEMY_SPEED = 7 WALLS [1] = "111111111111111111111111" WALLS [2] = "100000000000001111110111" WALLS [3] = "100011111100001111110111" WALLS [4] = "111111110000000011010101" WALLS [5] = "111111100000000001000001" WALLS [6] = "111111000000000000111111" WALLS [7] = "111110000000000000011111" WALLS [8] = "111100000000000000001111" WALLS [9] = "111000000000000000000111" WALLS [10] = "111000000000000000000111" WALLS [11] = "111100000000000000001111" WALLS [12] = "111110000000000000011111" WALLS [13] = "111111000000000000111111" WALLS [14] = "100000100000000001111111" WALLS [15] = "101010110000000011111111" WALLS [16] = "100000111110011111110001" WALLS [17] = "101010111100000000000001" WALLS [18] = "100000111111111111111111" ex[1] = UNIT_SIZE * 15 ey[1] = UNIT_SIZE * 3 exd[1] = -1 eyd[1] = 0 ex[2] = UNIT_SIZE * 16 ey[2] = UNIT_SIZE * 4 exd[2] = -1 eyd[2] = 0 ex[3] = UNIT_SIZE * 17 ey[3] = UNIT_SIZE * 5 exd[3] = -1 eyd[3] = 0 ex[4] = UNIT_SIZE * 18 ey[4] = UNIT_SIZE * 6 exd[4] = -1 eyd[4] = 0 ex[5] = UNIT_SIZE * 19 ey[5] = UNIT_SIZE * 7 exd[5] = -1 eyd[5] = 0 ex[6] = UNIT_SIZE * 19 ey[6] = UNIT_SIZE * 10 exd[6] = -1 eyd[6] = 0 ex[7] = UNIT_SIZE * 18 ey[7] = UNIT_SIZE * 11 exd[7] = -1 eyd[7] = 0 ex[8] = UNIT_SIZE * 17 ey[8] = UNIT_SIZE * 12 exd[8] = -1 eyd[8] = 0 ex[9] = UNIT_SIZE * 16 ey[9] = UNIT_SIZE * 13 exd[9] = -1 eyd[9] = 0 ex[10] = UNIT_SIZE * 15 ey[10] = UNIT_SIZE * 14 exd[10] = -1 eyd[10] = 0 ex[11] = UNIT_SIZE * 11 ey[11] = UNIT_SIZE * 8 exd[11] = 0 eyd[11] = 1 ex[12] = UNIT_SIZE * 12 ey[12] = UNIT_SIZE * 8 exd[12] = -1 eyd[12] = 0 ex[13] = UNIT_SIZE * 11 ey[13] = UNIT_SIZE * 9 exd[13] = 1 eyd[13] = 0 ex[14] = UNIT_SIZE * 12 ey[14] = UNIT_SIZE * 9 exd[14] = 0 eyd[14] = -1 ex[15] = UNIT_SIZE * 13 ey[15] = UNIT_SIZE * 2 exd[15] = 0 eyd[15] = 1 ex[16] = UNIT_SIZE * 10 ey[16] = UNIT_SIZE * 14 exd[16] = 0 eyd[16] = -1 Endif If ss=7 then ENEMY_NUM = 40 ENEMY_SPEED = 7 WALLS [1] = "111111111111111111111111" WALLS [2] = "100010000000000000000001" WALLS [3] = "100010000000000000000001" WALLS [4] = "100010011111001111110001" WALLS [5] = "100000011111001111111001" WALLS [6] = "111110011111001111111001" WALLS [7] = "100000000000000000000001" WALLS [8] = "100000000000000000000001" WALLS [9] = "100110011111001110011001" WALLS [10] = "100110011111001110011001" WALLS [11] = "100110000000001110011111" WALLS [12] = "100010000000001110011111" WALLS [13] = "100110011011001110011111" WALLS [14] = "100110011111001110000001" WALLS [15] = "100110011111001110010001" WALLS [16] = "100000000000000000010001" WALLS [17] = "100000000000000000010001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 7 ey[1] = UNIT_SIZE * 1 exd[1] = 0 eyd[1] = 0 ex[2] = UNIT_SIZE * 11 ey[2] = UNIT_SIZE * 2 exd[2] = 0 eyd[2] = 0 ex[3] = UNIT_SIZE * 15 ey[3] = UNIT_SIZE * 1 exd[3] = 0 eyd[3] = 0 ex[4] = UNIT_SIZE * 18 ey[4] = UNIT_SIZE * 2 exd[4] = 0 eyd[4] = 0 ex[5] = UNIT_SIZE * 5 ey[5] = UNIT_SIZE * 5 exd[5] = 0 eyd[5] = 0 ex[6] = UNIT_SIZE * 6 ey[6] = UNIT_SIZE * 5 exd[6] = 0 eyd[6] = 0 ex[7] = UNIT_SIZE * 12 ey[7] = UNIT_SIZE * 4 exd[7] = 0 eyd[7] = 0 ex[8] = UNIT_SIZE * 13 ey[8] = UNIT_SIZE * 4 exd[8] = 0 eyd[8] = 0 ex[9] = UNIT_SIZE * 7 ey[9] = UNIT_SIZE * 6 exd[9] = 0 eyd[9] = 0 ex[10] = UNIT_SIZE * 11 ey[10] = UNIT_SIZE * 7 exd[10] = 0 eyd[10] = 0 ex[11] = UNIT_SIZE * 15 ey[11] = UNIT_SIZE * 6 exd[11] = 0 eyd[11] = 0 ex[12] = UNIT_SIZE * 19 ey[12] = UNIT_SIZE * 7 exd[12] = 0 eyd[12] = 0 ex[13] = UNIT_SIZE * 1 ey[13] = UNIT_SIZE * 9 exd[13] = 0 eyd[13] = 0 ex[14] = UNIT_SIZE * 2 ey[14] = UNIT_SIZE * 13 exd[14] = 0 eyd[14] = 0 ex[15] = UNIT_SIZE * 5 ey[15] = UNIT_SIZE * 9 exd[15] = 0 eyd[15] = 0 ex[16] = UNIT_SIZE * 6 ey[16] = UNIT_SIZE * 9 exd[16] = 0 eyd[16] = 0 ex[17] = UNIT_SIZE * 12 ey[17] = UNIT_SIZE * 9 exd[17] = 0 eyd[17] = 0 ex[18] = UNIT_SIZE * 13 ey[18] = UNIT_SIZE * 9 exd[18] = 0 eyd[18] = 0 ex[19] = UNIT_SIZE * 17 ey[19] = UNIT_SIZE * 10 exd[19] = 0 eyd[19] = 0 ex[20] = UNIT_SIZE * 18 ey[20] = UNIT_SIZE * 10 exd[20] = 0 eyd[20] = 0 ex[21] = UNIT_SIZE * 9 ey[21] = UNIT_SIZE * 15 exd[21] = 0 eyd[21] = 0 ex[22] = UNIT_SIZE * 9 ey[22] = UNIT_SIZE * 16 exd[22] = 0 eyd[22] = 0 ex[23] = UNIT_SIZE * 5 ey[23] = UNIT_SIZE * 1 exd[23] = 0 eyd[23] = 1 ex[24] = UNIT_SIZE * 5 ey[24] = UNIT_SIZE * 2 exd[24] = 1 eyd[24] = 0 ex[25] = UNIT_SIZE * 12 ey[25] = UNIT_SIZE * 1 exd[25] = 0 eyd[25] = 1 ex[26] = UNIT_SIZE * 21 ey[26] = UNIT_SIZE * 1 exd[26] = 0 eyd[26] = 1 ex[27] = UNIT_SIZE * 22 ey[27] = UNIT_SIZE * 1 exd[27] = -1 eyd[27] = 0 ex[28] = UNIT_SIZE * 1 ey[28] = UNIT_SIZE * 6 exd[28] = 0 eyd[28] = 1 ex[29] = UNIT_SIZE * 1 ey[29] = UNIT_SIZE * 7 exd[29] = 1 eyd[29] = 0 ex[30] = UNIT_SIZE * 18 ey[30] = UNIT_SIZE * 6 exd[30] = 0 eyd[30] = 1 ex[31] = UNIT_SIZE * 22 ey[31] = UNIT_SIZE * 6 exd[31] = -1 eyd[31] = 0 ex[32] = UNIT_SIZE * 22 ey[32] = UNIT_SIZE * 9 exd[32] = 0 eyd[32] = -1 ex[33] = UNIT_SIZE * 5 ey[33] = UNIT_SIZE * 10 exd[33] = 1 eyd[33] = 0 ex[34] = UNIT_SIZE * 13 ey[34] = UNIT_SIZE * 11 exd[34] = -1 eyd[34] = 0 ex[35] = UNIT_SIZE * 1 ey[35] = UNIT_SIZE * 15 exd[35] = 1 eyd[35] = 0 ex[36] = UNIT_SIZE * 2 ey[36] = UNIT_SIZE * 16 exd[36] = 0 eyd[36] = -1 ex[37] = UNIT_SIZE * 6 ey[37] = UNIT_SIZE * 16 exd[37] = 0 eyd[37] = -1 ex[38] = UNIT_SIZE * 13 ey[38] = UNIT_SIZE * 16 exd[38] = 0 eyd[38] = -1 ex[39] = UNIT_SIZE * 17 ey[39] = UNIT_SIZE * 16 exd[39] = 0 eyd[39] = -1 ex[40] = UNIT_SIZE * 18 ey[40] = UNIT_SIZE * 16 exd[40] = -1 eyd[40] = 0 Endif If ss=8 then ENEMY_NUM = 8 ENEMY_SPEED = 7 WALLS [1] = "111111111111111111111111" WALLS [2] = "100000011011111111110111" WALLS [3] = "100111011011111111110111" WALLS [4] = "111111011011011111010101" WALLS [5] = "110000000000011111000001" WALLS [6] = "111111011011011011111111" WALLS [7] = "111111011011011011111111" WALLS [8] = "111100000000000011011111" WALLS [9] = "111111111011011011011111" WALLS [10] = "111111111011011011011111" WALLS [11] = "111111000000000000011111" WALLS [12] = "111111111111011011011111" WALLS [13] = "100000111111011011011111" WALLS [14] = "101010110000000000001111" WALLS [15] = "100000111111111011011111" WALLS [16] = "101010111111111011011001" WALLS [17] = "100000111111111000000001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 2 ey[1] = UNIT_SIZE * 4 exd[1] = 1 eyd[1] = 0 ex[2] = UNIT_SIZE * 4 ey[2] = UNIT_SIZE * 7 exd[2] = 1 eyd[2] = 0 ex[3] = UNIT_SIZE * 6 ey[3] = UNIT_SIZE * 10 exd[3] = 1 eyd[3] = 0 ex[4] = UNIT_SIZE * 8 ey[4] = UNIT_SIZE * 13 exd[4] = 1 eyd[4] = 0 ex[5] = UNIT_SIZE * 9 ey[5] = UNIT_SIZE * 1 exd[5] = 0 eyd[5] = 1 ex[6] = UNIT_SIZE * 12 ey[6] = UNIT_SIZE * 3 exd[6] = 0 eyd[6] = 1 ex[7] = UNIT_SIZE * 15 ey[7] = UNIT_SIZE * 5 exd[7] = 0 eyd[7] = 1 ex[8] = UNIT_SIZE * 18 ey[8] = UNIT_SIZE * 7 exd[8] = 0 eyd[8] = 1 Endif If ss=9 then ENEMY_NUM = 8 ENEMY_SPEED = 11 WALLS [1] = "111111111111111111111111" WALLS [2] = "100000000000011111111111" WALLS [3] = "100000000100011111011111" WALLS [4] = "100000011101011111011111" WALLS [5] = "100000011100011101010111" WALLS [6] = "100111111101011101010111" WALLS [7] = "100111111100011100000111" WALLS [8] = "100111111001001111111111" WALLS [9] = "100000000000000000000001" WALLS [10] = "100101010100010101010001" WALLS [11] = "100000000000000000000001" WALLS [12] = "111111111001001111111001" WALLS [13] = "110000011100011111111001" WALLS [14] = "110101011101011111000001" WALLS [15] = "110000011100011111000001" WALLS [16] = "110101011101010000000001" WALLS [17] = "110000011100000000000001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 10 ey[1] = UNIT_SIZE * 8 exd[1] = 1 eyd[1] = 0 ex[2] = UNIT_SIZE * 12 ey[2] = UNIT_SIZE * 10 exd[2] = 1 eyd[2] = 0 ex[3] = UNIT_SIZE * 10 ey[3] = UNIT_SIZE * 10 exd[3] = -1 eyd[3] = 0 ex[4] = UNIT_SIZE * 12 ey[4] = UNIT_SIZE * 8 exd[4] = -1 eyd[4] = 0 ex[5] = UNIT_SIZE * 10 ey[5] = UNIT_SIZE * 8 exd[5] = 0 eyd[5] = 1 ex[6] = UNIT_SIZE * 12 ey[6] = UNIT_SIZE * 10 exd[6] = 0 eyd[6] = 1 ex[7] = UNIT_SIZE * 10 ey[7] = UNIT_SIZE * 8 exd[7] = 0 eyd[7] = -1 ex[8] = UNIT_SIZE * 12 ey[8] = UNIT_SIZE * 10 exd[8] = 0 eyd[8] = -1 Endif If ss=10 then ENEMY_NUM = 10 ENEMY_SPEED = 10 WALLS [1] = "111111111111111111111111" WALLS [2] = "100000001000000100000001" WALLS [3] = "100000000011110000000001" WALLS [4] = "110000011100001000000001" WALLS [5] = "100000000000001000000001" WALLS [6] = "110000010100001000000011" WALLS [7] = "100111111101101111001001" WALLS [8] = "101000000000000000000101" WALLS [9] = "101111111101100000000101" WALLS [10] = "101000000001101111111101" WALLS [11] = "101000000000000000000101" WALLS [12] = "100100111101101111111001" WALLS [13] = "110000000100001000000011" WALLS [14] = "100000000100000000000001" WALLS [15] = "100000000100001110000011" WALLS [16] = "100000000011110000000001" WALLS [17] = "100000001000000100000001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 1 ey[1] = UNIT_SIZE * 4 exd[1] = 1 eyd[1] = 0 ex[2] = UNIT_SIZE * 22 ey[2] = UNIT_SIZE * 13 exd[2] = -1 eyd[2] = 0 ex[3] = UNIT_SIZE * 10 ey[3] = UNIT_SIZE * 3 exd[3] = 0 eyd[3] = 1 ex[4] = UNIT_SIZE * 13 ey[4] = UNIT_SIZE * 14 exd[4] = 0 eyd[4] = -1 ex[5] = UNIT_SIZE * 3 ey[5] = UNIT_SIZE * 7 exd[5] = 1 eyd[5] = 0 ex[6] = UNIT_SIZE * 20 ey[6] = UNIT_SIZE * 10 exd[6] = -1 eyd[6] = 0 ex[7] = UNIT_SIZE * 10 ey[7] = UNIT_SIZE * 1 exd[7] = 1 eyd[7] = 0 ex[8] = UNIT_SIZE * 10 ey[8] = UNIT_SIZE * 16 exd[8] = 1 eyd[8] = 0 ex[9] = UNIT_SIZE * 1 ey[9] = UNIT_SIZE * 10 exd[9] = 0 eyd[9] = 1 ex[10] = UNIT_SIZE * 22 ey[10] = UNIT_SIZE * 10 exd[10] = 0 eyd[10] = 1 Endif If ss=11 then ENEMY_NUM = 22 ENEMY_SPEED = 8 WALLS [1] = "111111111111111111111111" WALLS [2] = "100000000000000000000001" WALLS [3] = "111111111111111111111001" WALLS [4] = "110000000000000000000001" WALLS [5] = "111100000000000000001111" WALLS [6] = "111100000000000000001111" WALLS [7] = "111100000000000000001111" WALLS [8] = "111100000000000000001111" WALLS [9] = "111100000000000000001111" WALLS [10] = "111100000000000000001111" WALLS [11] = "111100000000000000001111" WALLS [12] = "111100000000000000001111" WALLS [13] = "111100000000000000001111" WALLS [14] = "100000000000000000000011" WALLS [15] = "100100010010010010001111" WALLS [16] = "100111111111111111111111" WALLS [17] = "100000000000000000000001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 21 ey[1] = UNIT_SIZE * 13 exd[1] = -1 eyd[1] = 0 ex[2] = UNIT_SIZE * 2 ey[2] = UNIT_SIZE * 3 exd[2] = 1 eyd[2] = 0 ex[3] = UNIT_SIZE * 4 ey[3] = UNIT_SIZE * 4 exd[3] = 0 eyd[3] = 1 ex[4] = UNIT_SIZE * 5 ey[4] = UNIT_SIZE * 6 exd[4] = 0 eyd[4] = -1 ex[5] = UNIT_SIZE * 6 ey[5] = UNIT_SIZE * 13 exd[5] = 0 eyd[5] = -1 ex[6] = UNIT_SIZE * 7 ey[6] = UNIT_SIZE * 11 exd[6] = 0 eyd[6] = 1 ex[7] = UNIT_SIZE * 8 ey[7] = UNIT_SIZE * 7 exd[7] = 0 eyd[7] = -1 ex[8] = UNIT_SIZE * 9 ey[8] = UNIT_SIZE * 3 exd[8] = 0 eyd[8] = 1 ex[9] = UNIT_SIZE * 10 ey[9] = UNIT_SIZE * 9 exd[9] = 0 eyd[9] = -1 ex[10] = UNIT_SIZE * 11 ey[10] = UNIT_SIZE * 5 exd[10] = 0 eyd[10] = 1 ex[11] = UNIT_SIZE * 12 ey[11] = UNIT_SIZE * 10 exd[11] = 0 eyd[11] = 1 ex[12] = UNIT_SIZE * 13 ey[12] = UNIT_SIZE * 8 exd[12] = 0 eyd[12] = 1 ex[13] = UNIT_SIZE * 14 ey[13] = UNIT_SIZE * 3 exd[13] = 0 eyd[13] = 1 ex[14] = UNIT_SIZE * 15 ey[14] = UNIT_SIZE * 13 exd[14] = 0 eyd[14] = -1 ex[15] = UNIT_SIZE * 16 ey[15] = UNIT_SIZE * 6 exd[15] = 0 eyd[15] = -1 ex[16] = UNIT_SIZE * 17 ey[16] = UNIT_SIZE * 7 exd[16] = 0 eyd[16] = 1 ex[17] = UNIT_SIZE * 18 ey[17] = UNIT_SIZE * 4 exd[17] = 0 eyd[17] = -1 ex[18] = UNIT_SIZE * 19 ey[18] = UNIT_SIZE * 10 exd[18] = 0 eyd[18] = -1 ex[19] = UNIT_SIZE * 17 ey[19] = UNIT_SIZE * 5 exd[19] = -1 eyd[19] = 0 ex[20] = UNIT_SIZE * 5 ey[20] = UNIT_SIZE * 7 exd[20] = 1 eyd[20] = 0 ex[21] = UNIT_SIZE * 12 ey[21] = UNIT_SIZE * 9 exd[21] = -1 eyd[21] = 0 ex[22] = UNIT_SIZE * 10 ey[22] = UNIT_SIZE * 11 exd[22] = 1 eyd[22] = 0 Endif If ss=12 then ENEMY_NUM = 25 ENEMY_SPEED = 8 WALLS [1] = "111111111111111111111111" WALLS [2] = "100001100000000000000001" WALLS [3] = "101101101101101101101101" WALLS [4] = "101101101101101101101101" WALLS [5] = "100000000000000000000001" WALLS [6] = "111101101101101101101101" WALLS [7] = "111101101101101101101101" WALLS [8] = "100000000000000000000001" WALLS [9] = "101101101101101101101101" WALLS [10] = "101101101101101101101101" WALLS [11] = "100000000000000000000001" WALLS [12] = "101101101101101101101111" WALLS [13] = "101101101101101101101111" WALLS [14] = "100000000000000000000001" WALLS [15] = "101101101101101101101101" WALLS [16] = "101101101101101101101101" WALLS [17] = "100000000000000001100001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 7 ey[1] = UNIT_SIZE * 1 exd[1] = 1 eyd[1] = 0 ex[2] = UNIT_SIZE * 1 ey[2] = UNIT_SIZE * 4 exd[2] = 1 eyd[2] = 0 ex[3] = UNIT_SIZE * 22 ey[3] = UNIT_SIZE * 7 exd[3] = -1 eyd[3] = 0 ex[4] = UNIT_SIZE * 1 ey[4] = UNIT_SIZE * 13 exd[4] = 1 eyd[4] = 0 ex[5] = UNIT_SIZE * 1 ey[5] = UNIT_SIZE * 16 exd[5] = 1 eyd[5] = 0 ex[6] = UNIT_SIZE * 1 ey[6] = UNIT_SIZE * 7 exd[6] = 0 eyd[6] = 1 ex[7] = UNIT_SIZE * 4 ey[7] = UNIT_SIZE * 1 exd[7] = 0 eyd[7] = 1 ex[8] = UNIT_SIZE * 7 ey[8] = UNIT_SIZE * 16 exd[8] = 0 eyd[8] = -1 ex[9] = UNIT_SIZE * 10 ey[9] = UNIT_SIZE * 1 exd[9] = 0 eyd[9] = 1 ex[10] = UNIT_SIZE * 13 ey[10] = UNIT_SIZE * 16 exd[10] = 0 eyd[10] = -1 ex[11] = UNIT_SIZE * 16 ey[11] = UNIT_SIZE * 1 exd[11] = 0 eyd[11] = 1 ex[12] = UNIT_SIZE * 19 ey[12] = UNIT_SIZE * 16 exd[12] = 0 eyd[12] = -1 ex[13] = UNIT_SIZE * 22 ey[13] = UNIT_SIZE * 1 exd[13] = 0 eyd[13] = 1 ex[14] = UNIT_SIZE * 22 ey[14] = UNIT_SIZE * 1 exd[14] = 0 eyd[14] = 0 ex[15] = UNIT_SIZE * 13 ey[15] = UNIT_SIZE * 1 exd[15] = 0 eyd[15] = 0 ex[16] = UNIT_SIZE * 7 ey[16] = UNIT_SIZE * 4 exd[16] = 0 eyd[16] = 0 ex[17] = UNIT_SIZE * 19 ey[17] = UNIT_SIZE * 4 exd[17] = 0 eyd[17] = 0 ex[18] = UNIT_SIZE * 7 ey[18] = UNIT_SIZE * 7 exd[18] = 0 eyd[18] = 0 ex[19] = UNIT_SIZE * 13 ey[19] = UNIT_SIZE * 7 exd[19] = 0 eyd[19] = 0 ex[20] = UNIT_SIZE * 4 ey[20] = UNIT_SIZE * 10 exd[20] = 0 eyd[20] = 0 ex[21] = UNIT_SIZE * 16 ey[21] = UNIT_SIZE * 10 exd[21] = 0 eyd[21] = 0 ex[22] = UNIT_SIZE * 10 ey[22] = UNIT_SIZE * 13 exd[22] = 0 eyd[22] = 0 ex[23] = UNIT_SIZE * 13 ey[23] = UNIT_SIZE * 13 exd[23] = 0 eyd[23] = 0 ex[24] = UNIT_SIZE * 7 ey[24] = UNIT_SIZE * 16 exd[24] = 0 eyd[24] = 0 ex[25] = UNIT_SIZE * 10 ey[25] = UNIT_SIZE * 10 exd[25] = 1 eyd[25] = 0 Endif If ss=13 then ENEMY_NUM = 27 ENEMY_SPEED = 8 WALLS [1] = "111111111111111111111111" WALLS [2] = "101111011101110111011111" WALLS [3] = "100000000000000000000001" WALLS [4] = "110101010101010101010101" WALLS [5] = "110000000000000000000001" WALLS [6] = "110101010101010101010101" WALLS [7] = "100000000000000000000001" WALLS [8] = "110101010101010101010101" WALLS [9] = "110000000000000000000001" WALLS [10] = "110101010101010101010101" WALLS [11] = "100000000000000000000001" WALLS [12] = "110101010101010101010101" WALLS [13] = "110000000000000000000001" WALLS [14] = "110101010101010101010111" WALLS [15] = "100000000000000000000001" WALLS [16] = "110101010101010101010101" WALLS [17] = "110000000000000000010001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 2 ey[1] = UNIT_SIZE * 2 exd[1] = 0 eyd[1] = 1 ex[2] = UNIT_SIZE * 4 ey[2] = UNIT_SIZE * 16 exd[2] = 0 eyd[2] = -1 ex[3] = UNIT_SIZE * 6 ey[3] = UNIT_SIZE * 1 exd[3] = 0 eyd[3] = 1 ex[4] = UNIT_SIZE * 8 ey[4] = UNIT_SIZE * 11 exd[4] = 0 eyd[4] = -1 ex[5] = UNIT_SIZE * 10 ey[5] = UNIT_SIZE * 4 exd[5] = 0 eyd[5] = 1 ex[6] = UNIT_SIZE * 12 ey[6] = UNIT_SIZE * 3 exd[6] = 0 eyd[6] = -1 ex[7] = UNIT_SIZE * 14 ey[7] = UNIT_SIZE * 9 exd[7] = 0 eyd[7] = 1 ex[8] = UNIT_SIZE * 16 ey[8] = UNIT_SIZE * 10 exd[8] = 0 eyd[8] = -1 ex[9] = UNIT_SIZE * 18 ey[9] = UNIT_SIZE * 16 exd[9] = 0 eyd[9] = 1 ex[10] = UNIT_SIZE * 20 ey[10] = UNIT_SIZE * 7 exd[10] = 0 eyd[10] = -1 ex[11] = UNIT_SIZE * 22 ey[11] = UNIT_SIZE * 2 exd[11] = 0 eyd[11] = 1 ex[12] = UNIT_SIZE * 1 ey[12] = UNIT_SIZE * 2 exd[12] = 1 eyd[12] = 0 ex[13] = UNIT_SIZE * 22 ey[13] = UNIT_SIZE * 4 exd[13] = -1 eyd[13] = 0 ex[14] = UNIT_SIZE * 7 ey[14] = UNIT_SIZE * 6 exd[14] = 1 eyd[14] = 0 ex[15] = UNIT_SIZE * 15 ey[15] = UNIT_SIZE * 8 exd[15] = -1 eyd[15] = 0 ex[16] = UNIT_SIZE * 17 ey[16] = UNIT_SIZE * 10 exd[16] = 1 eyd[16] = 0 ex[17] = UNIT_SIZE * 3 ey[17] = UNIT_SIZE * 12 exd[17] = -1 eyd[17] = 0 ex[18] = UNIT_SIZE * 4 ey[18] = UNIT_SIZE * 14 exd[18] = 1 eyd[18] = 0 ex[19] = UNIT_SIZE * 18 ey[19] = UNIT_SIZE * 16 exd[19] = -1 eyd[19] = 0 ex[20] = UNIT_SIZE * 2 ey[20] = UNIT_SIZE * 12 exd[20] = 0 eyd[20] = 0 ex[21] = UNIT_SIZE * 6 ey[21] = UNIT_SIZE * 8 exd[21] = 0 eyd[21] = 0 ex[22] = UNIT_SIZE * 8 ey[22] = UNIT_SIZE * 16 exd[22] = 0 eyd[22] = 0 ex[23] = UNIT_SIZE * 10 ey[23] = UNIT_SIZE * 6 exd[23] = 0 eyd[23] = 0 ex[24] = UNIT_SIZE * 12 ey[24] = UNIT_SIZE * 14 exd[24] = 0 eyd[24] = 0 ex[25] = UNIT_SIZE * 14 ey[25] = UNIT_SIZE * 10 exd[25] = 0 eyd[25] = 0 ex[26] = UNIT_SIZE * 16 ey[26] = UNIT_SIZE * 2 exd[26] = 0 eyd[26] = 0 ex[27] = UNIT_SIZE * 18 ey[27] = UNIT_SIZE * 8 exd[27] = 0 eyd[27] = 0 Endif If ss=14 then ENEMY_NUM = 9 WALLS [1] = "111111111111111111111111" WALLS [2] = "100011000000000000000011" WALLS [3] = "100011011010111101111011" WALLS [4] = "101111011110111101111011" WALLS [5] = "101111011110111101111011" WALLS [6] = "101111011110111101111011" WALLS [7] = "100000000000000000000011" WALLS [8] = "101111011110111101111011" WALLS [9] = "101111001110111101111011" WALLS [10] = "101111011110111001111011" WALLS [11] = "101111011110111101111011" WALLS [12] = "100000000000000000000011" WALLS [13] = "101111011110111101111011" WALLS [14] = "101111011110111101111011" WALLS [15] = "101111011110111101111011" WALLS [16] = "101111011110101101110001" WALLS [17] = "100000000000000001110001" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 6 ey[1] = UNIT_SIZE * 1 exd[1] = 1 eyd[1] = 0 ex[2] = UNIT_SIZE * 21 ey[2] = UNIT_SIZE * 6 exd[2] = -1 eyd[2] = 0 ex[3] = UNIT_SIZE * 1 ey[3] = UNIT_SIZE * 11 exd[3] = 1 eyd[3] = 0 ex[4] = UNIT_SIZE * 16 ey[4] = UNIT_SIZE * 16 exd[4] = -1 eyd[4] = 0 ex[5] = UNIT_SIZE * 1 ey[5] = UNIT_SIZE * 1 exd[5] = 0 eyd[5] = 1 ex[6] = UNIT_SIZE * 6 ey[6] = UNIT_SIZE * 16 exd[6] = 0 eyd[6] = -1 ex[7] = UNIT_SIZE * 11 ey[7] = UNIT_SIZE * 1 exd[7] = 0 eyd[7] = 1 ex[8] = UNIT_SIZE * 16 ey[8] = UNIT_SIZE * 16 exd[8] = 0 eyd[8] = -1 ex[9] = UNIT_SIZE * 21 ey[9] = UNIT_SIZE * 1 exd[9] = 0 eyd[9] = 1 EndIf If ss=15 then ENEMY_NUM = 34 ENEMY_SPEED = 8 WALLS [1] = "111111111111111111111111" WALLS [2] = "101111111000001111111111" WALLS [3] = "101111110000000111111111" WALLS [4] = "101111100000000011111111" WALLS [5] = "101111000000000001111111" WALLS [6] = "101110000000000000111111" WALLS [7] = "101100000000000000011111" WALLS [8] = "101000000000000000001111" WALLS [9] = "100000000000000000000111" WALLS [10] = "111000000000000000000001" WALLS [11] = "111000000000000000000101" WALLS [12] = "111000000000000000000101" WALLS [13] = "111000000000000000000101" WALLS [14] = "111000000000000000000101" WALLS [15] = "111000000000000000000101" WALLS [16] = "111000000000000000000101" WALLS [17] = "111000000000000000000101" WALLS [18] = "111111111111111111111111" ex[1] = UNIT_SIZE * 9 ey[1] = UNIT_SIZE * 1 exd[1] = 1 eyd[1] = 0 ex[2] = UNIT_SIZE * 8 ey[2] = UNIT_SIZE * 2 exd[2] = 1 eyd[2] = 0 ex[3] = UNIT_SIZE * 7 ey[3] = UNIT_SIZE * 3 exd[3] = 1 eyd[3] = 0 ex[4] = UNIT_SIZE * 6 ey[4] = UNIT_SIZE * 4 exd[4] = 1 eyd[4] = 0 ex[5] = UNIT_SIZE * 5 ey[5] = UNIT_SIZE * 5 exd[5] = 1 eyd[5] = 0 ex[6] = UNIT_SIZE * 4 ey[6] = UNIT_SIZE * 6 exd[6] = 1 eyd[6] = 0 ex[7] = UNIT_SIZE * 3 ey[7] = UNIT_SIZE * 7 exd[7] = 1 eyd[7] = 0 ex[8] = UNIT_SIZE * 1 ey[8] = UNIT_SIZE * 8 exd[8] = 1 eyd[8] = 0 ex[9] = UNIT_SIZE * 22 ey[9] = UNIT_SIZE * 9 exd[9] = -1 eyd[9] = 0 ex[10] = UNIT_SIZE * 3 ey[10] = UNIT_SIZE * 10 exd[10] = 1 eyd[10] = 0 ex[11] = UNIT_SIZE * 20 ey[11] = UNIT_SIZE * 11 exd[11] = -1 eyd[11] = 0 ex[12] = UNIT_SIZE * 3 ey[12] = UNIT_SIZE * 12 exd[12] = 1 eyd[12] = 0 ex[13] = UNIT_SIZE * 20 ey[13] = UNIT_SIZE * 13 exd[13] = -1 eyd[13] = 0 ex[14] = UNIT_SIZE * 3 ey[14] = UNIT_SIZE * 14 exd[14] = 1 eyd[14] = 0 ex[15] = UNIT_SIZE * 20 ey[15] = UNIT_SIZE * 15 exd[15] = -1 eyd[15] = 0 ex[16] = UNIT_SIZE * 3 ey[16] = UNIT_SIZE * 16 exd[16] = 1 eyd[16] = 0 ex[17] = UNIT_SIZE * 3 ey[17] = UNIT_SIZE * 7 exd[17] = 0 eyd[17] = 1 ex[18] = UNIT_SIZE * 4 ey[18] = UNIT_SIZE * 6 exd[18] = 0 eyd[18] = 1 ex[19] = UNIT_SIZE * 5 ey[19] = UNIT_SIZE * 5 exd[19] = 0 eyd[19] = 1 ex[20] = UNIT_SIZE * 6 ey[20] = UNIT_SIZE * 4 exd[20] = 0 eyd[20] = 1 ex[21] = UNIT_SIZE * 7 ey[21] = UNIT_SIZE * 3 exd[21] = 0 eyd[21] = 1 ex[22] = UNIT_SIZE * 8 ey[22] = UNIT_SIZE * 2 exd[22] = 0 eyd[22] = 1 ex[23] = UNIT_SIZE * 9 ey[23] = UNIT_SIZE * 1 exd[23] = 0 eyd[23] = 1 ex[24] = UNIT_SIZE * 10 ey[24] = UNIT_SIZE * 16 exd[24] = 0 eyd[24] = -1 ex[25] = UNIT_SIZE * 11 ey[25] = UNIT_SIZE * 1 exd[25] = 0 eyd[25] = 1 ex[26] = UNIT_SIZE * 12 ey[26] = UNIT_SIZE * 16 exd[26] = 0 eyd[26] = -1 ex[27] = UNIT_SIZE * 13 ey[27] = UNIT_SIZE * 1 exd[27] = 0 eyd[27] = 1 ex[28] = UNIT_SIZE * 14 ey[28] = UNIT_SIZE * 2 exd[28] = 0 eyd[28] = 1 ex[29] = UNIT_SIZE * 15 ey[29] = UNIT_SIZE * 3 exd[29] = 0 eyd[29] = 1 ex[30] = UNIT_SIZE * 16 ey[30] = UNIT_SIZE * 4 exd[30] = 0 eyd[30] = 1 ex[31] = UNIT_SIZE * 17 ey[31] = UNIT_SIZE * 5 exd[31] = 0 eyd[31] = 1 ex[32] = UNIT_SIZE * 18 ey[32] = UNIT_SIZE * 6 exd[32] = 0 eyd[32] = 1 ex[33] = UNIT_SIZE * 19 ey[33] = UNIT_SIZE * 7 exd[33] = 0 eyd[33] = 1 ex[34] = UNIT_SIZE * 20 ey[34] = UNIT_SIZE * 8 exd[34] = 0 eyd[34] = 1 EndIf If ss=16 then GraphicsWindow.ShowMessage("全ステージクリア", "おめでとう") Goto gameend Endif ' スクリーンの初期設定 GraphicsWindow.Show() ' 表示 GraphicsWindow.Width = SCREEN_WIDTH * UNIT_SIZE ' 幅を設定 GraphicsWindow.Height = SCREEN_HEIGHT * UNIT_SIZE ' 高さを設定 GraphicsWindow.CanResize = "False" ' サイズを固定 GraphicsWindow.BackgroundColor = BACK_COLOR ' 背景色を設定 ' 壁の描画 GraphicsWindow.BrushColor = WALL_COLOR ' ブラシの色を設定 For iy = 1 To Array.GetItemCount(WALLS) ' 縦方向の���り返し(WALLS配列の数だけ) For ix = 1 To Text.GetLength(WALLS [iy]) ' 横方向の繰り返し(文字列の長さだけ) If Text.GetSubText(WALLS [iy], ix, 1) = "1" Then ' 文字が"1"だったら GraphicsWindow.FillRectangle(UNIT_SIZE * (ix - 1), UNIT_SIZE * (iy - 1), UNIT_SIZE, UNIT_SIZE) EndIf EndFor EndFor ' GOAL GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.FontSize = 20 GraphicsWindow.FontBold = "True" GraphicsWindow.DrawText(GOAL_X * UNIT_SIZE, GOAL_Y * UNIT_SIZE, "GOAL") ' ロボットのスタート地点 x = UNIT_SIZE * 22 ' 横位置 (左から12ユニット) y = UNIT_SIZE * 16 ' 縦位置 (上から10ユニット) xd = 0 ' 横移動方向 (-1:左, 0:止, 1:右) 移動用 yd = 0 ' 縦移動方向 (-1:上, 0:止, 1:下) 移動用 xk = 0 ' 横移動方向 (-1:左, 0:止, 1:右) キーボード受付用 yk = 0 ' 縦移動方向 (-1:上, 0:止, 1:下) キーボード受付用 ' ロボット初期描画 GraphicsWindow.BrushColor = ROBO_COLOR ' ブラシの色を設定 GraphicsWindow.PenColor = ROBO_COLOR ' ペンの色を設定 robot = Shapes.AddEllipse(UNIT_SIZE, UNIT_SIZE) ' ロボットのシェイプを設定 Shapes.Move(robot, x, y) ' ロボットのシェイプを初期位置に ' 敵の描画 GraphicsWindow.BrushColor = ENEMY_COLOR GraphicsWindow.PenColor = ENEMY_COLOR For ie = 1 To ENEMY_NUM enemy[ie] = Shapes.AddEllipse(UNIT_SIZE, UNIT_SIZE) Shapes.Move(enemy[ie], ex[ie], ey[ie]) EndFor Controls.AddButton("終了",660,5) Controls.ButtonClicked = onbutton1 ' キーボードイベントの設定 GraphicsWindow.KeyDown = onKeyDown ' キーが押されたらonKeyDownサブルーチンを呼ぶ While xk = 0 And yk = 0 EndWhile starttime = Clock.ElapsedMilliseconds ' メインループ status = "" While status = "" ' 繰り返し(無条件に) ' キーボードからの方向指示を受け付ける ' ロボットの縦位置・横位置ともにユニット単位だったら If Math.Remainder(x, UNIT_SIZE) = 0 And Math.Remainder(y, UNIT_SIZE) = 0 Then ' キーボード受け付け用の方向情報を移動用の方向情報にコピー xd = xk ' 横方向 yd = yk ' 縦方向 EndIf ' このまま一回分進んだ場合のマップ上の位置を求める ' まずピクセル単位で位置を求め、それをユニットのサイズで割ることでマップ上の位置を求める If xd < 0 Then nx = x - 1 ElseIf 0 < xd then nx = x + UNIT_SIZE + 1 Else nx = x EndIf nxi = Math.Floor(nx / UNIT_SIZE) + 1 If yd < 0 Then ny = y - 1 ElseIf 0 < yd then ny = y + UNIT_SIZE + 1 Else ny = y EndIf nyi = Math.Floor(ny / UNIT_SIZE) + 1 ' マップ上の求めた位置に壁があるか If Text.GetSubText(WALLS [nyi], nxi, 1) = "1" Then ' すべての移動方向を0に設定する(つまり、停止させる) xk = 0 yk = 0 xd = 0 yd = 0 EndIf ' ロボットの移動位置を計算 x = x + xd * SPEED y = y + yd * SPEED ' ロボットのシェイプを移動 Shapes.Move(robot, x, y) ' ゴール判定 If x = GOAL_X * UNIT_SIZE And y = GOAL_Y * UNIT_SIZE Then status = "GOAL" gametime = Clock.ElapsedMilliseconds - starttime GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.DrawText(300,200, gametime / 100) EndIf ' 敵の動き For ie = 1 To ENEMY_NUM If exd[ie] < 0 Then enx = ex[ie] - 1 ElseIf 0 < exd[ie] then enx = ex[ie] + UNIT_SIZE + 1 Else enx = ex[ie] EndIf enxi = Math.Floor(enx / UNIT_SIZE) + 1 If eyd[ie] < 0 Then eny = ey[ie] - 1 ElseIf 0 < eyd[ie] then eny = ey[ie] + UNIT_SIZE + 1 Else eny = ey[ie] EndIf enyi = Math.Floor(eny / UNIT_SIZE) + 1 If Text.GetSubText(WALLS [enyi], enxi, 1) = "1" Then ' 敵が壁にぶつかった時、逆方向に動く exd[ie] = -exd[ie] eyd[ie] = -eyd[ie] EndIf ex[ie] = ex[ie] + exd[ie] * ENEMY_SPEED ey[ie] = ey[ie] + eyd[ie] * ENEMY_SPEED Shapes.Move(enemy[ie], ex[ie], ey[ie]) If (x - ex[ie]) * (x - ex[ie]) + (y - ey[ie]) * (y - ey[ie]) < UNIT_SIZE * UNIT_SIZE Then status = "GAME OVER" GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.PenColor = "Yellow" GraphicsWindow.FillEllipse(x - 135, y - 135, 300, 300) Program.Delay(DELAY) GraphicsWindow.BrushColor = "Black" GraphicsWindow.PenColor = "Black" GraphicsWindow.FillEllipse(x - 135, y - 135, 300, 300) GraphicsWindow.ShowMessage("ギャーーー!!", "OUT") DEATH=DEATH+1 GraphicsWindow.ShowMessage("あなたの死亡回数は"+DEATH+"です", "OUT") If DEATH = 50 then GraphicsWindow.ShowMessage("つらくなってきたかな?", "がんばれ") Endif If DEATH = 100 then GraphicsWindow.ShowMessage("もうだめぽ", "OUT") GraphicsWindow.Clear() Goto gameend Endif Goto st EndIf If click = 1 then GraphicsWindow.ShowMessage("お疲れさまでした", "ゲームを終了します") GraphicsWindow.Clear() click = 0 Goto cls EndIf GraphicsWindow.BrushColor = "Red" GraphicsWindow.DrawText(3,3, ""+ss+"") EndFor ' 速度調整のための待機 Program.Delay(DELAY) EndWhile If status = "GOAL" then If ss=6 then GraphicsWindow.ShowMessage ("残機が15機増えた","命を手に入れた") DEATH = DEATH - 15 If DEATH < 0 then DEATH = 0 EndIf EndIf GraphicsWindow.ShowMessage("次のステージへ", "ゴール") ss=ss+1 GraphicsWindow.BrushColor = "Red" GraphicsWindow.DrawText(3,3, ""+ss+"") goto st EndIf gameend: Goto cls Sub onbutton1 click = click + 1 EndSub ' サブルーチン (キーが押されたときに呼ばれる) Sub onKeyDown KeyName = GraphicsWindow.LastKey ' 最後に操作されたキーの名前を取得 If KeyName = "Left" Then ' カーソル(左)キーだったら xk = -1 ' 横移動方向を左(-1)に yk = 0 ' 縦移動方向を止(0)に ElseIf KeyName = "Right" Then ' カーソル(右)キーだったら xk = 1 ' 横移動方向を右(1)に yk = 0 ' 縦移動方向を止(0)に ElseIf KeyName = "Up" Then ' カーソル(上)キーだったら xk = 0 ' 横移動方向を止(0)に yk = -1 ' 縦移動方向を上(-1)に ElseIf KeyName = "Down" Then ' カーソル(下)キーだったら xk = 0 ' 横移動方向を止(0)に yk = 1 ' 縦移��方向を下(1)に ElseIf KeyName = "Space" Then xk = 0 yk = 0 EndIf EndSub End>GRG567.sb< Start>GRH620.sb< Controls.ButtonClicked = OnButtonClicked FirstInit() ColourInit() MM = 50 Titel = "Colour-Tip" BeforeOrAfter() Start() While A[an] <> B[101] Init() NewColour() ShowColour() Wait4Answer() ShowResult() EndWhile End() Program.Delay(600) Program.End() '---------------------------------------------------------------------------------------- Sub OnButtonClicked an = an + 1 A[an] = Controls.LastClickedButton If Controls.LastClickedButton = B[102] Then A[an] = B[100] EndIf EndSub 'OnButtonClicked Sub FirstInit ww = 600 wh = 600 GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 GraphicsWindow.Width = ww GraphicsWindow.Height = wh GraphicsWindow.Title = "Colour-Tip" GraphicsWindow.BrushColor = "SteelBlue" GraphicsWindow.PenColor = "Black" GraphicsWindow.BackgroundColor = "Moccasin" GraphicsWindow.FontBold = "True" GraphicsWindow.FontName = "Arial" GraphicsWindow.FontSize = 12 GraphicsWindow.Show() points = 0 ca = 3 cp = 0 tp = 600 M[1] = "C8" M[2] = "C8" M[3] = "G8" M[4] = "G8" M[5] = "A8" M[6] = "A8" M[7] = "G4" M[8] = "F8" M[9] = "F8" M[10] = "E8" M[11] = "E8" M[12] = "D8" M[13] = "D8" M[14] = "C4" EndSub 'ScreenInit Sub ColourInit C[1] = "White" C[2] = "Gray" C[3] = "Yellow" C[4] = "Orange" C[5] = "Red" C[6] = "Green" C[7] = "Violet" C[8] = "Blue" C[9] = "Black" EndSub 'ColourInit Sub BeforeOrAfter For i = 1 to 20 SH[i] = " " endfor For i = 1 To Text.GetLength(Titel) F = F + 1 If F > 9 Then F = 1 Else Sound.PlayClick() Program.Delay(100) EndIf GraphicsWindow.BrushColor = C[F] SH[i] = Shapes.AddText(Text.GetSubText(Titel,i,1)) Shapes.HideShape(SH[i]) Shapes.Zoom(sh[i], 4, 4) EndFor GraphicsWindow.BrushColor = "Steel Blue" sl = Array.GetItemCount(SH) For i = 1 To sl y = GraphicsWindow.Height / 2 - 100 x = i * 50 - 40 + MM Shapes.ShowShape(SH[i]) Shapes.Animate(SH[i], x, y, 1200) mi = mi + 1 Sound.PlayMusic(M[mi]) Program.Delay(200) EndFor program.Delay(300) For j = 1 to 2 For i = 1 To sl x = i * 50 - 40 + MM If Math.Remainder(i, 2) = 0 Then y = GraphicsWindow.Height / 2 - 100 + 30 Else y = GraphicsWindow.Height / 2 - 100 - 30 EndIf Shapes.Animate(SH[i], x, y, 700) EndFor Program.Delay(500) For i = 1 To sl x = i * 50 - 40 + MM If Math.Remainder(i, 2) = 0 Then y = GraphicsWindow.Height / 2 - 100 - 30 Else y = GraphicsWindow.Height / 2 - 100 + 30 EndIf Shapes.Animate(SH[i], x, y, 700) EndFor Program.Delay(500) EndFor For i = 1 To sl x = i * 50 - 40 + MM y = GraphicsWindow.Height / 2 - 100 Shapes.Animate(SH[i], x, y, 700) EndFor Program.Delay(200) For i = sl To 1 Step - 1 Shapes.HideShape(SH[i]) Program.Delay(100) EndFor EndSub ''BeforeOrAfter Sub Start GraphicsWindow.DrawText(170,100,"Please click the colour in the correct order!") GraphicsWindow.FontSize = 34 B[102] = Controls.AddButton(" Start ", 150,250) Controls.SetSize(B[102],300, 175) While A[an] <> B[102] EndWhile Controls.HideControl(B[102]) GraphicsWindow.FontSize = 12 GraphicsWindow.BrushColor = "Moccasin" GraphicsWindow.FillRectangle(0,0,500,500) GraphicsWindow.BrushColor = "SteelBlue" EndSub 'Start Sub Init an = 0 cp = cp + 1 If Math.Remainder(cp, 3) = 0 Then tp = tp - 10 If tp < 200 then tp = 200 EndIf ca = ca + 1 EndIf For i = 1 to 9 p = (i * 60) - 60 GraphicsWindow.BrushColor = C[i] GraphicsWindow.PenColor = "Black" GraphicsWindow.BackgroundColor = C[i] B[i] = Controls.AddButton(C[i], p,500) Controls.HideControl(B[i]) EndFor GraphicsWindow.BrushColor = "SteelBlue" GraphicsWindow.PenColor = "Black" GraphicsWindow.BackgroundColor = "Moccasin" GraphicsWindow.BrushColor = "SteelBlue" B[100] = Controls.AddButton(" CONTINUE ", 200,500) Controls.HideControl(B[100]) B[101] = Controls.AddButton(" E N D ", 300,500) Controls.HideControl(B[101]) GraphicsWindow.BrushColor = "Moccasin" GraphicsWindow.FillRectangle(0,580,500,20) GraphicsWindow.BrushColor = "SteelBlue" Zeig = "Points: " Zeig = Text.Append(zeig, points) GraphicsWindow.DrawText(0,580,zeig) EndSub 'Init Sub NewColour For i = 1 to ca RC[i] = Math.GetRandomNumber(9) If ca < 5 Then Controls.ShowControl(B[RC[i]]) EndIf EndFor If ca >= 5 Then For i = 1 to 9 Controls.ShowControl(B[i]) EndFor endif EndSub 'NewColour Sub ShowColour For i = 1 to ca GraphicsWindow.BrushColor = C[RC[i]] ShowIt() Program.Delay(tp) GraphicsWindow.BrushColor = "Moccasin" GraphicsWindow.FillRectangle(0,0,600,500) Program.Delay(tp) EndFor GraphicsWindow.BrushColor = "SteelBlue" EndSub 'ShowColour Sub ShowIt g = Math.GetRandomNumber(5) If g = 1 Then x1 = Math.GetRandomNumber(100) y1 = Math.GetRandomNumber(100) x2 = Math.GetRandomNumber(100) + 250 y2 = X2 MidleIt() GraphicsWindow.FillRectangle(x1,y1,x2,y2) ElseIf g = 2 Then x1 = Math.GetRandomNumber(100) y1 = Math.GetRandomNumber(100) x2 = Math.GetRandomNumber(100) + 250 y2 = Math.GetRandomNumber(100) + 250 MidleIt() GraphicsWindow.FillRectangle(x1,y1,x2,y2) ElseIf g = 3 Then x1 = Math.GetRandomNumber(100) y1 = Math.GetRandomNumber(100) x2 = Math.GetRandomNumber(100) + 250 y2 = x2 MidleIt() GraphicsWindow.FillEllipse(x1,y1,x2,y2) ElseIf g = 4 Then x1 = Math.GetRandomNumber(100) y1 = Math.GetRandomNumber(100) x2 = Math.GetRandomNumber(100) + 250 y2 = Math.GetRandomNumber(100) + 250 MidleIt() GraphicsWindow.FillEllipse(x1,y1,x2,y2) Else x1 = Math.GetRandomNumber(100) y1 = Math.GetRandomNumber(100) + 200 x2 = Math.GetRandomNumber(100) + 250 y2 = Math.GetRandomNumber(100) + 100 x3 = y2 y3 = x2 GraphicsWindow.FillTriangle(x1,y1,x2,y2,x3,y3) midleTri() EndIf EndSub 'ShowIt Sub MidleIt dif = (ww - x1 - x2 - 100) / 2 x1 = x1 + dif x2 = x2 + dif dif = (wh - y1 - y2 - 150) / 2 y1 = y1 + dif y2 = y2 + dif EndSub 'MidleIt Sub MidleTri If x1 > x2 Then If x1 > x3 Then If x2 > x3 Then difx = (ww - x1 -x2 - 100) / 2 Else difx = (ww - x1 - x3 - 100) / 2 EndIf Else difx = (ww - x1 - x3 - 100) / 2 EndIf Else difx = (ww - x2 - x3 - 100) / 2 Endif x1 = x1 + difx x2 = x2 + difx x3 = x3 + difx If y1 > y2 Then If y1 > y3 Then If y2 > y3 Then dify = (ww - y1 - y2 - 100) / 2 Else dify = (ww - y1 - y3 - 100) / 2 EndIf Else dify = (ww - y1 - y3 - 100) / 2 EndIf Else dify = (ww - y2 - y3 - 100) / 2 Endif y1 = y1 + dify y2 = y2 + dify y3 = y3 + dify EndSub 'MidleTri Sub Wait4Answer an = 0 While an < ca EndWhile EndSub 'Wait4Answer Sub ShowResult For i = 1 to 9 Controls.HideControl(B[i]) EndFor For i = 1 to ca Zeig = i Zeig = Text.Append(Zeig, ". ") Zeig = Text.Append(Zeig, C[RC[i]]) If B[RC[i]] = A[i] Then Zeig = Text.Append(Zeig, " correct ") points = points + 10 Else Zeig = Text.Append(Zeig, " incorrect ") points = points - 15 EndIf p = i * 24 GraphicsWindow.DrawText(1, p, Zeig) EndFor GraphicsWindow.BrushColor = "Moccasin" GraphicsWindow.FillRectangle(0,0,600,500) GraphicsWindow.BrushColor = "SteelBlue" Zeig = "Points: " Zeig = Text.Append(zeig, points) GraphicsWindow.DrawText(0,580,zeig) Controls.ShowControl(B[100]) Controls.ShowControl(B[101]) an = 0 While an = 0 EndWhile If A[an] = B[101] Then Program.End() EndIf Controls.HideControl (B[100]) Controls.HideControl (B[101]) GraphicsWindow.BrushColor = "Moccasin" GraphicsWindow.FillRectangle(0,0,600,500) GraphicsWindow.BrushColor = "SteelBlue" EndSub 'ShowResult Sub End Titel = points Titel = Text.Append(Titel, " Points") MM = 10 Sound.PlayMusic("O4 C8 F8 A8") Sound.PlayMusic("O5 C4") Sound.PlayMusic("O4 A8") Sound.PlayMusic("O5 C4.") Sound.PlayMusic("O4 C#8 F#8 A#8") Sound.PlayMusic("O5 C#4") Sound.PlayMusic("O4 A#8") Sound.PlayMusic("O5 C#4.") Sound.PlayMusic("O4 D8 G8 B8") Sound.PlayMusic("O5 D4") Sound.PlayMusic("O4 B8") Sound.PlayMusic("O5 D4.") BeforeOrAfter() Titel = "END" MM = 220 BeforeOrAfter() EndSub 'End End>GRH620.sb< Start>GRJ176.sb< ' SmallBasic Version 1.0 ' Funktion: CSV File Read ' Autor: NaochanON ' Herkunft: http://social.msdn.microsoft.com/Forums/en-US/94f756de-7d9d-477d-bc82-62bd9c1480e3/retrieving-data-from-csv-file ' ImportURL: http://smallbasic.com/program/? ' Extension: ' ' Kommentar: CSV file: username,password,firstname,secondname,street,city,postcode ' Check if the username matched the password ' Variablen: ' ' -------------------------------------------------------------------------------- CRLF= Text.GetCharacter(13)+Text.GetCharacter(10) NamePoint=0 TextWindow.WriteLine("Input username:") Name= TextWindow.Read() TextWindow.WriteLine("Input Password:") PW= TextWindow.Read() Path=Program.Directory+"\UserList.txt" ' The following line could be harmful and has been automatically commented. ' CSVData= File.ReadContents(Path) NamePoint= Text.GetIndexOf(CSVData,Name) If NamePoint<>0 Then Start= Text.GetSubTextToEnd(CSVData,NamePoint) CRpoint=Text.GetIndexOf(Start,CRLF) Target= Text.GetSubText(Start,1,CRpoint-1)+"," DelimPt1 = Text.GetIndexOf(Target,",") DelimPt2 = DelimPt1 + Text.GetIndexOf(Text.GetSubTextToEnd(Target,DelimPt1+1),",") Col1 = Text.GetSubText(Target,1,DelimPt1-1) Col2 = Text.GetSubText(Target,DelimPt1+1,DelimPt2-DelimPt1-1) 'TextWindow.WriteLine(DelimPt1) 'TextWindow.WriteLine(DelimPt2) 'TextWindow.WriteLine("|" + Col1 + "|") 'TextWindow.WriteLine("|" + Name + "|") 'TextWindow.WriteLine("|" + Col2 + "|") 'TextWindow.WriteLine("|" + PW + "|") If ((Col1=Name) And (Col2=PW)) Then TextWindow.WriteLine("Your password is correct.") DataList() Else TextWindow.WriteLine("' INCORRECT PASSWORD ") EndIf Else TextWindow.WriteLine("' INCORRECT username ") EndIf Sub DataList TextWindow.WriteLine(" ") LST="1=username;2=password;3=firstname;4=secondname;5=street;6=city;7=postcode" Len= Text.GetLength(Target) While Len>0 NN= NN+1 Cpoint= Text.GetIndexOf(Target,",") itsData= Text.GetSubText(Target,1,Cpoint-1) TextWindow.WriteLine(LST[NN]+" = "+itsData) Target=Text.GetSubTextToEnd(Target,Cpoint+1) Len= Text.GetLength(Target) EndWhile EndSub End>GRJ176.sb< Start>GRK700.sb< Rec = Shapes.AddRectangle(120,30) Shapes.Move(Rec,200,300) LDPhysics.AddMovingShape(Rec,0.5,0.5,0.5) Rec2 = Shapes.AddRectangle(120,30) Shapes.Move(Rec2,350,300) LDPhysics.AddMovingShape(Rec2,0.5,0.5,0.5) Ball = Shapes.AddEllipse(20,20) Shapes.Move(Ball,255,5) LDPhysics.AddMovingShape(Ball,0.5,0.5,7) Ball2 = Shapes.AddEllipse(20,20) Shapes.Move(Ball2,405,5) LDPhysics.AddMovingShape(Ball2,0.5,0.5,7) Anc = LDPhysics.AddFixedAnchor(255,10) Anc2 = LDPhysics.AddFixedAnchor(470,315) Joint = LDPhysics.AttachShapesWithJoint(Rec,Anc,"Prismatic_V","False","") Joint2 = LDPhysics.AttachShapesWithJoint(Anc2,Rec2,"Revolute","False","") GraphicsWindow.MouseDown = Mouse GraphicsWindow.MouseUp = MouseUp While 1 = 1 Program.Delay(10) LDPhysics.DoTimestep() Pos = LDPhysics.GetPosition(Rec) Vel = LDPhysics.GetVelocity(Rec) pjt = Pos[2] - 300 pjs = Vel[2] If (pjt * 100) + (pjs * 10) < 0 Then Sine = -1 Else Sine = 1 EndIf LDPhysics.SetJointMotor(Joint,1000*Sine,Math.abs((pjt * 100) + (pjs * 10))) rja = LDPhysics.GetAngle(Rec2) rjs = LDPhysics.GetRotation(Rec2) If (rja * 5000) + (rjs * 100) < 0 Then Sine = 1 Else Sine = -1 EndIf LDPhysics.SetJointMotor(Joint2,1000*Sine,Math.abs((rja * 5000) + (rjs * 100))) EndWhile Sub Mouse Shape = LDShapes.GetAllShapesAt(GraphicsWindow.MouseX,GraphicsWindow.MouseY) MJoint = LDPhysics.AttachShapesWithJoint(Shape[1],Shape[1],"Mouse","False","") EndSub Sub MouseUp LDPhysics.DetachJoint(MJoint) EndSub End>GRK700.sb< Start>GRM913.sb< ' Program by Yvan Leduc March 19th 2016 ' WITH helps collaboration and special thanks to : Litdev ' WITH helps collaboration and special thanks to : NaochanON ' special thanks to LitDev extension beta version ' without the Microsoft team small basic supports, my program would not have been improve to be faster and better build. ' thanks to you guys you are PRO !!!! ' it's important to know how much pixels (count) in the extreme Zone Scale. ' time processing : 7 secondes ' version du 19 mars program no: PRT766 image=ImageList.LoadImage("http://grin.hq.nasa.gov/IMAGES/SMALL/GPN-2000-001854.jpg") colors() width=499 height=640 GraphicsWindow.Title = "10 Zones Image Analyzer" GraphicsWindow.top= 0 GraphicsWindow.left= 0 GraphicsWindow.Height=768 GraphicsWindow.Width=1366 GraphicsWindow.BrushColor = "#FF0000FF" GraphicsWindow.FontSize = "30" GraphicsWindow.drawboundtext(700,50,500,"10 Zones Image Analyzer") GraphicsWindow.BrushColor = colors[8] GraphicsWindow.FontSize = "12" GraphicsWindow.DrawboundText(700, 500,450,"GRIN is a collection of over a thousand images of significant historical interest scanned at high-resolution in several sizes. This collection is intended for the media, publishers, and the general public looking for high-quality photographs") GraphicsWindow.DrawboundText(700, 575,450,"Apollo 12 Saturn V on Transporter at http://grin.hq.nasa.gov/IMAGES/SMALL/GPN-2000-001854.jpg") GraphicsWindow.BrushColor = colors[14] GraphicsWindow.drawboundtext(700,625,500,"Program by Yvan Leduc - March 2016 - with helps collaboration and special thanks to : Litdev and NaochanON ") GraphicsWindow.BrushColor = "#FF28315B" GraphicsWindow.FontSize = "14" GraphicsWindow.BackgroundColor="#FF000000" GraphicsWindow.DrawImage(image,0,0) Program.Delay(1000) ' to see the transit of the color image to grayscaling LDImage.EffectGray(image) GraphicsWindow.DrawresizedImage(image,0,0,width,height) buttonclicked = 0 LDImage.OpenWorkingImage(image) ' to convert the hex value of a color in decimal and the dvide in 20 differents Zones to be more precise than 10 Zones ZoneValue= ldmath.Base2Decimal("FFFFFF",16)/20 colors() For i = 1 To width For j = 1 To height pixel = text.GetSubTextToEnd(LDImage.GetWorkingImagePixel(image,i,j),4) Zone=math.Floor(ldmath.Base2Decimal(pixel,16)/ZoneValue) Zones_pixels_count() LDImage.SetWorkingImagePixel(image,i,j,colors[Zone]) EndFor EndFor LDImage.CloseWorkingImage(image) GraphicsWindow.Title = "10 Zones Image Analyzer" GraphicsWindow.DrawImage(image,0,0) GraphicsWindow.FontSize = 16 GraphicsWindow.BrushColor = "RED" button = Controls.AddButton("Pixels count (click here)", 1050, 325) Controls.ButtonClicked = Click Sub Click If Controls.LastClickedButton = button Then boxes_texts() buttonclicked = 1 EndIf EndSub ' une loop waiting for compute button press buttonloop: If buttonclicked = 0 Then Goto buttonloop Else buttonclicked = 0 EndIf Controls.SetTextBoxText(box1,zoneX) Controls.SetTextBoxText(box2,zoneIX) Controls.SetTextBoxText(box3,zoneVIII) Controls.SetTextBoxText(box4,zoneVII) Controls.SetTextBoxText(box5,zoneVI) Controls.SetTextBoxText(box6,zoneV) Controls.SetTextBoxText(box7,zoneIV) Controls.SetTextBoxText(box8,zoneIII) Controls.SetTextBoxText(box9,zoneII) Controls.SetTextBoxText(box10,zoneI) Controls.SetTextBoxText(box11,zoneO) ' ************************** end of PROGRAM *************************************************** Sub Zones_pixels_count ' zone X If Zone=20 then zoneX=zoneX+1 ElseIf Zone>15 then zoneIX=zoneIX+1 ElseIf Zone>12 then zoneVIII=zoneVIII+1 ElseIf Zone>9 then zoneVII=zoneVII+1 ElseIf Zone>8 then zoneVI=zoneVI+1 ElseIf Zone>5 then zoneV=zoneV+1 ElseIf Zone=4 then zoneIV=zoneIV+1 ElseIf Zone=3 then zoneIII=zoneIII+1 ElseIf Zone=2 then zoneII=zoneII+1 ElseIf Zone>0 then zoneI=zoneI+1 Else zoneO=zoneO+1 endif endsub ' **************************************************************************************************************** Sub colors colors[0]="#FF0000FF" ' blue Zone O 'Zone I colors[1]="#FF471B1B" colors[2]="#FF471B1B" colors[3]="#FF471B1B" 'Zone II colors[4]="#FF286036" colors[5]="#FF286036" 'Zone III colors[6]="#FF373360" colors[7]="#FF373360" 'Zone IV colors[8]="#FF406F71" colors[9]="#FF406F71" 'Zone V colors[10]="#FF7D7D7D" colors[11]="#FF7D7D7D" 'Zone VI colors[12]="#FFB4A37E" colors[13]="#FFB4A37E" 'Zone VII colors[14]="#FFB5DFBB" colors[15]="#FFB5DFBB" 'Zone VIII colors[16]="#FFF0F0C8" colors[17]="#FFF0F0C8" ' Zone IX colors[18]="#FFFFC8FA" colors[19]="#FFFFC8FA" 'Zone X colors[20]="#FFFF0000" ' red Zone X Endsub ' **************************************************************************************************************** Sub boxes_texts GraphicsWindow.FontSize = "14" GraphicsWindow.BrushColor = colors[20] box1 = Controls.AddTextBox(600, 150) GraphicsWindow.DrawBoundText (800,150,300," Zone X ") GraphicsWindow.BrushColor = colors[18] box2 = Controls.AddTextBox(600, 180) GraphicsWindow.DrawBoundText (800,180,300," Zone IX ") GraphicsWindow.BrushColor = colors[16] GraphicsWindow.DrawBoundText (800,210,300," Zone VIII") box3 = Controls.AddTextBox(600, 210) GraphicsWindow.BrushColor = colors[14] GraphicsWindow.DrawBoundText (800,240,300," Zone VII") box4 = Controls.AddTextBox(600, 240) GraphicsWindow.BrushColor = colors[12] GraphicsWindow.DrawBoundText (800,270,300," Zone VI") box5 = Controls.AddTextBox(600, 270) GraphicsWindow.BrushColor = colors[10] GraphicsWindow.DrawBoundText (800,300,500," Zone V the middle Gray 18% of reflectance") box6 = Controls.AddTextBox(600, 300) GraphicsWindow.BrushColor = colors[8] GraphicsWindow.DrawBoundText (800,330,300," Zone IV ") box7 = Controls.AddTextBox(600, 330) GraphicsWindow.BrushColor = colors[6] GraphicsWindow.DrawBoundText (800,360,300," Zone III ") box8 = Controls.AddTextBox(600, 360) GraphicsWindow.BrushColor = colors[4] GraphicsWindow.DrawBoundText (800,390,300," Zone II ") box9 = Controls.AddTextBox(600, 390) GraphicsWindow.BrushColor = colors[1] GraphicsWindow.DrawBoundText (800,420,300," Zone I ") box10 = Controls.AddTextBox(600, 420) GraphicsWindow.BrushColor = colors[0] GraphicsWindow.DrawBoundText (800,450,300," Zone O ") box11 = Controls.AddTextBox(600, 450) EndSub End>GRM913.sb< Start>GRN801.sb< P = 1 rm = "" ang = 0 anm = 0 zm = 0 opc = 0 GraphicsWindow.Title = "To help learners Small Basic(В помощь изучающим Small Basic) Akiva Toronto 22/XI/2015 " GraphicsWindow.BackgroundColor = GraphicsWindow.GetColorFromRGB(0,155,255) gw = 1465 gh = 855 GraphicsWindow.Width = gw GraphicsWindow.Height = gh LDScrollBars.Add(gw+0, gh+0) GraphicsWindow.Top = 100 GraphicsWindow.Left = 300 GraphicsWindow.CanResize = "true" GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 13 t1 = Controls.AddTextBox(441,835) Controls.SetSize(t1,80,25) LDDialogs.ToolTip(t1,"t1 ") t2 = Controls.AddTextBox(523,835) Controls.SetSize(t2,80,25) LDDialogs.ToolTip(t2,"t2 ") t3 = Controls.AddTextBox(605,835) Controls.SetSize(t3,80,25) LDDialogs.ToolTip(t3,"t3 ") t4 = Controls.AddTextBox(687,835) Controls.SetSize(t4,80,25) LDDialogs.ToolTip(t4,"t4 ") t5 = Controls.AddTextBox(30,835) Controls.SetSize(t5,409,25) LDDialogs.ToolTip(t5,"t5") t6 = Controls.AddTextBox(769,835) Controls.SetSize(t6,80,25) LDDialogs.ToolTip(t6,"t6") t7 = Controls.AddTextBox(851,835) Controls.SetSize(t7,80,25) LDDialogs.ToolTip(t7,"t7") t11 = Controls.AddTextBox(1000,2) Controls.SetSize(t11,80,25) LDDialogs.ToolTip(t11,"t11( X = ?") t12 = Controls.AddTextBox(1082,2) Controls.SetSize(t12,80,25) LDDialogs.ToolTip(t12,"t12( Y = ?") t14 = Controls.AddTextBox(1300,2) Controls.SetSize(t14,80,25) t15 = Controls.AddTextBox(1382,2) Controls.SetSize(t15,80,25) GraphicsWindow.BrushColor = "Blue" t17 = LDControls.AddRichTextBox(462,730) Controls.Move(t17,1000,28) LDDialogs.ToolTip(t17,"t17()Корректируем, копируем и выводим в редактор SB") GraphicsWindow.BrushColor = "Red" ts2 = Controls.AddTextBox(655,765) Controls.SetSize(ts2,45,25) GraphicsWindow.BrushColor = "Green" ts3 = Controls.AddTextBox(855,765) Controls.SetSize(ts3,45,25) GraphicsWindow.BrushColor = "Blue" ts4 = Controls.AddTextBox(1055,765) Controls.SetSize(ts4,45,25) GraphicsWindow.BrushColor = "Black" ts5 = Controls.AddTextBox(30,800) Controls.SetSize(ts5,45,25) ts6 = Controls.AddTextBox(235,800) Controls.SetSize(ts6,45,25) ts7 = Controls.AddTextBox(435,800) Controls.SetSize(ts7,45,25) ts8 = Controls.AddTextBox(633,800) Controls.SetSize(ts8,45,25) ts9 = Controls.AddTextBox(835,800) Controls.SetSize(ts9,45,25) ts10 = Controls.AddTextBox(1037,800) Controls.SetSize(ts10,45,25) ts12 = Controls.AddTextBox(1255,765) Controls.SetSize(ts12,45,25) ts11 = Controls.AddTextBox(1235,800) Controls.SetSize(ts11,45,25) GraphicsWindow.FontSize = 12 b1 = Controls.AddButton("Help",30 ,765) Controls.SetSize(b1,80,25) b2 = Controls.AddButton("Flickr",112 ,765) Controls.SetSize(b2,80,25) b3 = Controls.AddButton("Clear ",194 ,765) Controls.SetSize(b3,80,25) b4 = Controls.AddButton("GradientFm",276 ,765) Controls.SetSize(b4,80,25) LDDialogs.ToolTip(b4,"in t1 - H or V or DD or DU") b5 = Controls.AddButton("Grid",357,765) Controls.SetSize(b5,80,25) b7 = Controls.AddButton("Animate",30 ,738) Controls.SetSize(b7,80,25) b8 = Controls.AddButton("Rotate",112 ,738) Controls.SetSize(b8,80,25) b9 = Controls.AddButton("Opacity",194 ,738) Controls.SetSize(b9,80,25) b10 = Controls.AddButton("Zoom",276 ,738) Controls.SetSize(b10,80,25) b11 = Controls.AddButton("TurtleUp",358 ,738) Controls.SetSize(b11 ,80,25) b12 = Controls.AddButton("TurtleDown",440 ,738) Controls.SetSize(b12 ,80,25) b13 = Controls.AddButton("TurtleAngle ",522 ,738) Controls.SetSize(b13 ,80,25) b14 = Controls.AddButton("API-LitDev ",440 ,765) Controls.SetSize(b14 ,80,25) b15 = Controls.AddButton("Remote",522 ,765) Controls.SetSize(b15 ,80,25) b6 = Controls.AddButton("ClearCode?",1186,2) Controls.SetSize(b6,80,25) LDDialogs.ToolTip(b6,"Очистить?!") GraphicsWindow.FontSize = 14 sl2 = LDControls.AddSlider(150, 35, "H") LDControls.SliderValue(sl2, 0) Shapes.Move(sl2, 700, 765) sl3 = LDControls.AddSlider(150, 35, "H") Shapes.Move(sl3, 900, 765) LDControls.SliderValue(sl3, 0) sl4 = LDControls.AddSlider(150, 35, "H") Shapes.Move(sl4, 1100, 765) LDControls.SliderValue(sl4, 1) sl5 = LDControls.AddSlider(150, 35, "H") Shapes.Move(sl5, 76, 800) LDControls.SliderValue(sl5, 0) sl6 = LDControls.AddSlider(150, 35, "H") Shapes.Move(sl6, 280, 800) LDControls.SliderValue(sl6, 0) sl7 = LDControls.AddSlider(150, 35, "H") Shapes.Move(sl7, 481, 800) LDControls.SliderValue(sl7, 0) sl8 = LDControls.AddSlider(150, 35, "H") Shapes.Move(sl8, 679, 800) LDControls.SliderValue(sl8, 0) sl9 = LDControls.AddSlider(150, 35, "H") Shapes.Move(sl9, 880, 800) LDControls.SliderValue(sl9, 0) sl10 = LDControls.AddSlider(150, 35, "H") Shapes.Move(sl10, 1082, 800) LDControls.SliderValue(sl10, 0) sl11 = LDControls.AddSlider(150, 35, "H") Shapes.Move(sl11, 1280, 800) LDControls.SliderValue(sl11, 0) sl12 = LDControls.AddSlider(150, 35, "H") Shapes.Move(sl12, 1300, 765) LDControls.SliderValue(sl12, 0) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 13 cb[1] = "GraphicsWindow()" cb[2] = "Controls.AddButton " cb[3] = "Shapes.AddImage " cb[4] = "Controls.AddTextBox" cb[5] = "Controls.AddMultiLineTextBox" cb[6] = "LDControls.AddRadioButton" cb[7] = "LDControls.AddCheckBox" cb[8] = "LDControls.AddSlider" cb[9] = "LDControls.AddBrowser" cb[10] = "Grid()" cb[11] = "LDControls.AddListBox" cb[12] = "LDControls.AddProgressBar" cb[13] = "Shapes.AddText" cb[14] = "Flickr.GetRandomPicture()" cb[15] = "Turtle.Show()" cb[16] = "Turtle.Up()" cb[17] = "Turtle.Down()" cb[18] = "Turtle.Angle() " cb[19] = "Shapes.remove" cb[20] = "Turtle.Hide()" cb[21] = "Sub Click()" cb[22] = "Sub Gradient Forms()" cb[23] = "For/EndFor" cb[24] = "While/EndWhile" cb[25] = "Controls.GetTextBoxText()" cb[26] = "Controls.SetTextBoxText( , )" cb[27] = "OnSlider()" cb[28] = "OnMouseMove()" cb[29] = "OnMouseDown()" cb[30] = "ArrayButtons()" cb[31] = "ArrayAddTextBox()" cb[32] = "ColorAndPen()" cb[33] = "OnListBox()" cb[34] = "GraphicsWindow.ShowMessage" cb[35] = "GraphicsWindow.DrawResizedImage" cb[36] = "Shapes.Animate" cb[37] = "Shapes.Zoom" cb[38] = "Shapes.Rotate" cb[39] = "Shapes.Opacity" cb[40] = "LDControls.Star" cb[41] = "Shapes.AddEllipse" cb[42] = "Shapes.AddRectangle" cb[43] = "LDShapes.AddPolygon" cb[44] = "LDShapes.AddRegularPolygon" cb[45] = "Shapes.AddLine" cb[46] = "Sub Down()" cb[47] = "Sub OnMouseMove()" cb[48] = "GraphicsWindow.DrawRectangle" cb[49] = "GraphicsWindow.Ellipse" cb[50] = "LDControls.AddComboBox" cb[51] = "OnComboBox" cb[52] = "LDControls.AddPasswordBox" cb[53] = "LDControls.AddMenu" cb[54] = "GraphicsWindow.DrawLine" CobB = LDSort.ByValue(cb) ComboBox = LDControls.AddComboBox(CobB,310,700) Shapes.Move(ComboBox,680,2) LDDialogs.ToolTip(ComboBox,"Instruments,Turtle") OnComboBox() Controls.ButtonClicked = Click Sub Click If (Controls.LastClickedButton = b1) Then 'Help GraphicsWindow.BrushColor = "White" GraphicsWindow.FontSize = 13 tt[1] = "The sequence of execution of the program:(Последовательность выполнении программы:)" tt[2] = "1);;;;;;;<>" tt[3] = "2);;;;;<>" tt[4] = "3);;<>" tt[5] = "4);;;;;<>" tt[6] = "5);;;;;<>" tt[7] = "6);;;;;;<>" tt[8] = "7);;;;<> tt[9] = "8);;;;;<>" tt[10] = "9);;;;<>" tt[11] = "10);<>;;<>" tt[12] = "11);;;;;<>" tt[13] = "12);;;;;;<>" tt[14] = "13);;;;<>" tt[15] = "14);;;;<>" tt[16] = "15);<>" tt[17] = "16);;;<>" tt[18] = "17);;;;;<>" tt[19] = "18);<>'(Last set object)" tt[20] = "19);;;;;;;;<>" tt[21] = "20);;;;;<>" tt[22] = "21);;<>" tt[23] = "22);;;,<<.DrawResisedImage>> tt[24] = "23);;<>" tt[25] = "24);;<>" tt[26] = "25);<>" tt[27] = "26);<>" tt[28] = "27);;;;<>," tt[29] = "28);;;<>;" tt[30] = "29);;;<>;" tt[31] = "30);;<>;" tt[32] = "31);;;<>;" tt[33] = "32);;;<>" tt[34] = "33);;;<>" tt[35] = "34);;;<>" tt[36] = "35);;;;<>" tt[37] = "36);;;<>" tt[38] = " " tt[39] = "Good luck and prosperity(Удачи Вам и благополучие) Akiva 7/15/2016" For i = 1 To Array.GetItemCount(tt) GraphicsWindow.DrawBoundText(10,15*i,980,tt[i]) EndFor ElseIf (Controls.LastClickedButton = b2) Then 'Flickr pic = Flickr.GetRandomPicture(Controls.GetTextBoxText(t5)) GraphicsWindow.DrawResizedImage(pic,X1,Y1,w,h) rm = pic aa = 0 ElseIf (Controls.LastClickedButton = b3) Then 'Reset GraphicsWindow.BrushColor = GraphicsWindow.GetColorFromRGB(0,155,255) GraphicsWindow.FillRectangle(0,0,995,725) Controls.SetTextBoxText(t1," ") Controls.SetTextBoxText(t2," ") Controls.SetTextBoxText(t3," ") Controls.SetTextBoxText(t4," ") Controls.SetTextBoxText(t5," ") Controls.SetTextBoxText(t6," ") Controls.SetTextBoxText(t7," ") Controls.SetTextBoxText(t11," ") Controls.SetTextBoxText(t12," ") GraphicsWindow.PenWidth = 0 ElseIf (Controls.LastClickedButton = b4) Then gr11[1] = GraphicsWindow.GetRandomColor() gr11[2] = GraphicsWindow.GetRandomColor() ' для формы gr11[3] = GraphicsWindow.GetRandomColor() For i = 1 To 3 g = Controls.GetTextBoxText(t1) brush = LDShapes.BrushGradient(gr11,g) LDShapes.BrushGradientBackground(Brush) EndFor ElseIf (Controls.LastClickedButton = b5) Then 'Grid Grid() ElseIf (Controls.LastClickedButton = b6) Then 'Clear info LDControls.RichTextBoxClear(t17) ElseIf (Controls.LastClickedButton = b7) Then 'Animate Shapes.Animate(anm,x1,y1,Controls.GetTextBoxText(t2)) aa = 0 ElseIf (Controls.LastClickedButton = b8) Then 'Rotate Shapes.Rotate(ang,Controls.GetTextBoxText(t2)) ElseIf (Controls.LastClickedButton = b9) Then 'Opacity Shapes.SetOpacity(opc,Controls.GetTextBoxText(t2)) ElseIf (Controls.LastClickedButton = b10) Then 'Zoom Shapes.Zoom(zm,Controls.GetTextBoxText(t2),Controls.GetTextBoxText(t3)) ElseIf (Controls.LastClickedButton = b11) Then 'Turtle.Up Turtle.Speed = 9 Turtle.PenUp() Turtle.MoveTo(X1,Y1) aa = 0 ElseIf (Controls.LastClickedButton = b12) Then 'Turtle.Down Turtle.Speed = 9 ColorAndPen() Turtle.PenDown() Turtle.MoveTo(X1,Y1) aa = 0 ElseIf (Controls.LastClickedButton = b13) Then 'Turtle.Angle ColorAndPen() Turtle.Speed = 9 Turtle.X = 500 Turtle.Y = 360 Turtle.PenDown() ang = Controls.GetTextBoxText(t1) Turtle.Angle = ang mt = Controls.GetTextBoxText(t2) Turtle.Move(mt) aa = 0 ElseIf (Controls.LastClickedButton = b14) Then 'API LitDev bw1 = LDControls.AddBrowser(975,700,"http://litDev.org/") 'LitDev_LDMath.html") Shapes.Move(bw1, 10, 25) rm = bw1 ElseIf (Controls.LastClickedButton = b15) Then 'Remote Shapes.Remove(rm) EndIf GraphicsWindow.PenWidth = 0 EndSub GraphicsWindow.MouseMove = OnMouseMove Sub OnMouseMove Controls.SetTextBoxText(t11, "X=" + Math.Ceiling(GraphicsWindow.MouseX)) Controls.SetTextBoxText(t12, "Y=" + Math.Ceiling(GraphicsWindow.Mousey)) EndSub GraphicsWindow.MouseDown = OnDown1 Sub OnDown1 x = GraphicsWindow.MouseX y = Graphicswindow.MouseY aa = aa + 1 GraphicsWindow.FillRectangle(x, y, 2, 2) If aa = 1 Then xa = GraphicsWindow.MouseX X1 = Math.Ceiling(xa) Controls.SetTextBoxText(t14,"X1= "+ X1) ya = Graphicswindow.MouseY Y1 = Math.Ceiling(ya) Controls.SetTextBoxText(t15,"Y1= "+ Y1) aa = 0 EndIf Controls.SetTextBoxText(p,"") EndSub LDControls.SliderChanged = OnSlider Sub OnSlider sv2 = LDControls.SliderGetValue(sl2) R = Math.Ceiling(sv2 * 2.55) GraphicsWindow.BrushColor = GraphicsWindow.GetColorFromRGB(R,G,B) GraphicsWindow.FillEllipse(637,730,80,30) LDDialogs.ToolTip(ts2,"Red color") Controls.SetTextBoxText(ts2, R) sv3 = LDControls.SliderGetValue(sl3) G = Math.Ceiling(sv3 * 2.55) Controls.SetTextBoxText(ts3, G) LDDialogs.ToolTip(ts3,"Green color") sv4 = LDControls.SliderGetValue(sl4) B = Math.Ceiling(sv4 * 2.55) LDDialogs.ToolTip(ts4,"Blue color") Controls.SetTextBoxText(ts4, B) sv5 = LDControls.SliderGetValue(sl5) w = Math.Ceiling(sv5 * 10) LDDialogs.ToolTip(ts5,"Width") Controls.SetTextBoxText(ts5, w) sv6 = LDControls.SliderGetValue(sl6) h = Math.Ceiling(sv6 * 10) LDDialogs.ToolTip(ts6,"Height") Controls.SetTextBoxText(ts6, h) sv7 = LDControls.SliderGetValue(sl7) lf = Math.Ceiling(sv7 * 5.5) LDDialogs.ToolTip(ts7,"lf (Left)") Controls.SetTextBoxText(ts7, lf) sv8 = LDControls.SliderGetValue(sl8) tp = Math.Ceiling(sv8 * 5.5) LDDialogs.ToolTip(ts8,"tp(Top)") Controls.SetTextBoxText(ts8, tp) sv9 = LDControls.SliderGetValue(sl9) n = Math.Ceiling(sv9 * 3.6) LDDialogs.ToolTip(ts9, " ") Controls.SetTextBoxText(ts9, n) sv10 = LDControls.SliderGetValue(sl10) mm = Math.Ceiling(sv10 * 3.6) LDDialogs.ToolTip(ts10," ") Controls.SetTextBoxText(ts10, mm) sv11 = LDControls.SliderGetValue(sl11) ng = Math.Ceiling(sv11 * 0.5) LDDialogs.ToolTip(ts11,"(gr)Grid") Controls.SetTextBoxText(ts11, ng ) sv12 = LDControls.SliderGetValue(sl12) p = Math.Ceiling(sv12 * 1) LDDialogs.ToolTip(ts12,"PenWidth") Controls.SetTextBoxText(ts12, p ) EndSub GraphicsWindow.CanResize = 12 GraphicsWindow.BrushColor = "Blue" LDControls.ComboBoxItemChanged = OnComboBox Sub OnComboBox If CobB[LDControls.LastComboBoxIndex] = cb[1] Then 'GraphicsWindow LDControls.RichTextBoxSetText(t17,"GraphicsWindow.Title = "+Controls.GetTextBoxText(t5)+"","true") LDControls.RichTextBoxSetText(t17,"cw = GraphicsWindow.GetColorFromRGB("+R+","+G+","+B+")","true") LDControls.RichTextBoxSetText(t17,"GraphicsWindow.BackgroundColor = cw","true") LDControls.RichTextBoxSetText(t17,"GW = "+w+"","True") LDControls.RichTextBoxSetText(t17,"GH = "+h+"","True") LDControls.RichTextBoxSetText(t17,"GraphicsWindow.Width = GW","true") LDControls.RichTextBoxSetText(t17,"GraphicsWindow.Height = GH","true") LDControls.RichTextBoxSetText(t17,"GraphicsWindow.Top = "+(tp)+"","true") LDControls.RichTextBoxSetText(t17,"GraphicsWindow.Left = "+(lf)+"","true") LDControls.RichTextBoxSetText(t17,"LDScrollBars.Add(gw+0, gh+0)","true") LDControls.RichTextBoxSetText(t17,"GraphicsWindow.CanResize = "+Controls.GetTextBoxText(t2)+"","true") ColorAndPen() GraphicsWindow.DrawRectangle(0,0,w,h) ElseIf CobB[LDControls.LastComboBoxIndex] = cb[2] Then 'Button ColorAndPen() c = Controls.GetTextBoxText(t5) b1 = Controls.AddButton(c,x1,y1) Controls.SetSize(b1,w,h) LDControls.RichTextBoxSetText(t17,"b1 = Controls.AddButton("+c+","+X1+","+Y1+")","true") LDControls.RichTextBoxSetText(t17,"Controls.SetSize(b1,"+w+","+h+")","true") aa = 0 rm = b1 anm = b1 ElseIf CobB[LDControls.LastComboBoxIndex] = cb[3] Then 'Image imm = Controls.GetTextBoxText(t1) a = LDDialogs.OpenFile(imm,Controls.GetTextBoxText(t5)) im = Shapes.AddImage(a) Shapes.Move(im, X1,Y1) aa = 0 LDControls.RichTextBoxSetText(t17,"a = LDDialogs.OpenFile("+imm+","+Controls.GetTextBoxText(t5)+")","true") LDControls.RichTextBoxSetText(t17,"im = Shapes.AddImage(a))","true") LDControls.RichTextBoxSetText(t17,"Shapes.Move(im,"+X1+","+Y1+")","true") rm = im ang = im anm = im zm = im opc = im ElseIf CobB[LDControls.LastComboBoxIndex] = cb[4] Then '.AddTextBox ColorAndPen() t1 = Controls.AddTextBox(X1,Y1) Controls.SetSize(t1,w,h) aa = 0 LDControls.RichTextBoxSetText(t17," t1 = Controls.AddTextBox("+X1+","+Y1+")","true") LDControls.RichTextBoxSetText(t17,"Controls.SetSize(t1,"+w+","+h+")","true") rm = t1 anm = t1 ElseIf CobB[LDControls.LastComboBoxIndex] = cb[5] Then '.AddMultiLineTextBox ColorAndPen() t2 = Controls.AddMultiLineTextBox(X1,Y1) Controls.SetSize(t2,w,h) LDControls.RichTextBoxSetText(t17,"ColorAndPen()","true") LDControls.RichTextBoxSetText(t17," t2 = Controls.AddMultilineTextBox("+X1+","+Y1+")","true") LDControls.RichTextBoxSetText(t17,"Controls.SetSize(t2,"+w+","+h+")","true") aa = 0 rm = t2 anm = t2 ElseIf CobB[LDControls.LastComboBoxIndex] = cb[6] Then '.AddRadioButton lrb = LDControls.LastRadioButton ColorAndPen() cr6[1] = LDControls.AddRadioButton(Controls.GetTextBoxText(t1),"c6") cr6[2] = LDControls.AddRadioButton(Controls.GetTextBoxText(t2),"c6") cr6[3] = LDControls.AddRadioButton(Controls.GetTextBoxText(t3),"c6") For i = 1 To 3 Shapes.Move(cr6[i],X1,Y1 + (21 * (i))) EndFor LDControls.RadioButtonSet(cr6[3]) aa = 0 anm = cr6 LDControls.RichTextBoxSetText(t17,"ColorAndPen()","true") LDControls.RichTextBoxSetText(t17,"lrb = LDControls.LastRadioButton ","true") LDControls.RichTextBoxSetText(t17,"cr6[1] = LDControls.AddRadioButton(Controls.GetTextBoxText(t1),'c6')","true") LDControls.RichTextBoxSetText(t17,"cr6[2] = LDControls.AddRadioButton(Controls.GetTextBoxText(t2),'c6')","true") LDControls.RichTextBoxSetText(t17,"cr6[3] = LDControls.AddRadioButton(Controls.GetTextBoxText(t3),'c6')","true") LDControls.RichTextBoxSetText(t17," For i = 1 To 3","true") LDControls.RichTextBoxSetText(t17,"Shapes.Move(cr6[i],"+X1+","+Y1+" + (21 * (i)))","true") LDControls.RichTextBoxSetText(t17," EndFor","true") LDControls.RichTextBoxSetText(t17,"LDControls.RadioButtonSet(cr6[3])","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[7] Then 'LDControls.AddCheckBox ColorAndPen() ch = LDControls.AddCheckBox(Controls.GetTextBoxText(t5)) Controls.Move(ch,X1,Y1) aa = 0 LDControls.RichTextBoxSetText(t17,"ch = LDControls.AddCheckBox("+Controls.GetTextBoxText(t5)+")","true") LDControls.RichTextBoxSetText(t17,"Controls.Move(ch,"+X1+","+Y1+")","true") rm = ch anm = ch ElseIf CobB[LDControls.LastComboBoxIndex] = cb[8] Then '.AddSlider sl1a = LDControls.AddSlider(w,lf,Controls.GetTextBoxText(t1)) Shapes.Move(sl1a,X1,Y1) LDControls.SliderValue(sl1a,Controls.GetTextBoxText(t2)) 'OnSlider() aa = 0 LDControls.RichTextBoxSetText(t17,"LDControls.SliderValue(sl1a,"+Controls.GetTextBoxText(t2)+")","true") LDControls.RichTextBoxSetText(t17,"sl1a = LDControls.AddSlider("+w+","+lf+","+Controls.GetTextBoxText(t1)+")","true") LDControls.RichTextBoxSetText(t17,"Shapes.Move(sl1a,"+X1+","+Y1+")","true") LDControls.RichTextBoxSetText(t17,"OnSlider()","true") rm = sl1a ElseIf CobB[LDControls.LastComboBoxIndex] = cb[9] Then '.LDControls.AddBrowser bw = LDControls.AddBrowser(w,h,Controls.GetTextBoxText(t5)) Shapes.Move(bw, x1, y1) aa = 0 LDControls.RichTextBoxSetText(t17,"bw = LDControls.AddBrowser("+w+","+h+","+Controls.GetTextBoxText(t5)+")","true") LDControls.RichTextBoxSetText(t17,"Shapes.Move(bw,"+X1+","+Y1+")","true") rm = bw anm = bw ElseIf CobB[LDControls.LastComboBoxIndex] = cb[10] Then 'Grid(Сетка) LDControls.RichTextBoxSetText(t17,"Sub Grid","true") LDControls.RichTextBoxSetText(t17,"GraphicsWindow.PenWidth = 0.1","true") LDControls.RichTextBoxSetText(t17,"GraphicsWindow.PenColor = 'White' ","true") LDControls.RichTextBoxSetText(t17,"For gg = 1 To 245 Step ng","true") LDControls.RichTextBoxSetText(t17,"GraphicsWindow.DrawLine(4 * gg,4,4 * gg,725)","true") LDControls.RichTextBoxSetText(t17,"EndFor","true") LDControls.RichTextBoxSetText(t17,"For vv = 1 To 180 Step ng","true") LDControls.RichTextBoxSetText(t17,"GraphicsWindow.DrawLine(4,4 * vv,960,4 * vv)","true") LDControls.RichTextBoxSetText(t17,"EndFor","true") LDControls.RichTextBoxSetText(t17,"EndSub","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[11] Then ' LDControls.AddListBox ColorAndPen() ls[1] = "H" ls[2] = "V" ls[3] = "DD" list = LDSort.ByValue(ls) listBox = LDControls.AddListBox(list,w,h) Shapes.Move(listBox,X1,Y1) aa = 0 rm = listBox anm = listBox LDControls.RichTextBoxSetText(t17,"ColorAndPen()","True") LDControls.RichTextBoxSetText(t17,"ls[1] = 'H'","True") LDControls.RichTextBoxSetText(t17,"ls[2] = 'V'","True") LDControls.RichTextBoxSetText(t17,"ls[3] = 'DD' ","True") LDControls.RichTextBoxSetText(t17,"list = LDSort.ByValue(ls1)","True") LDControls.RichTextBoxSetText(t17,"listBox = LDControls.AddListBox(list,"+w+","+lf+")","True") LDControls.RichTextBoxSetText(t17,"Shapes.Move(listBox,"+x1+","+y1+")","True") LDControls.RichTextBoxSetText(t17,"OnListBox()","True") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[12] Then 'LDControls.AddProgressBar ColorAndPen() pgb = LDControls.AddProgressBar(w, lf, Controls.GetTextBoxText(t1) ) LDControls.ProgressBarValue(pgb,Controls.GetTextBoxText(t2)) Shapes.Move(pgb,X1,Y1) aa = 0 LDControls.RichTextBoxSetText(t17,"pgb = LDControls.AddProgressBar("+w+","+lf+","+Controls.GetTextBoxText(t1)+")","true") LDControls.RichTextBoxSetText(t17,"LDControls.ProgressBarValue(pgb,"+Controls.GetTextBoxText(t2)+")","true") LDControls.RichTextBoxSetText(t17,"Shapes.Move(pgb,"+X1+","+Y1+")","true") rm = pgb anm = pgb ElseIf CobB[LDControls.LastComboBoxIndex] = cb[13] Then 'Shapes.AddText ColorAndPen() l1 = Shapes.AddText(Controls.GetTextBoxText(t5)) Shapes.Move(l1,X1,Y1) rm = l1 anm = l1 ang = l1 opc = l1 zm = l1 aa = 0 LDControls.RichTextBoxSetText(t17,"l1 = Shapes.AddText("+Controls.GetTextBoxText(t5)+")","true") LDControls.RichTextBoxSetText(t17,"Shapes.Move(l1,"+X1+","+Y1+")","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[14] Then 'Flickr.GetRandomPicture pic = Flickr.GetRandomPicture(Controls.GetTextBoxText(t5)) GraphicsWindow.DrawResizedImage(pic,X1,Y1,w,h) rm = pic anm = pic opc = pic zm = pic aa = 0 LDControls.RichTextBoxSetText(t17,"pic = Flickr.GetRandomPicture("+Controls.GetTextBoxText(t5)+")","true") LDControls.RichTextBoxSetText(t17,"GraphicsWindow.DrawResizedImage(pic,"+X1+","+Y1+","+w+","+h+")","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[15] Then 'Turtle.Show Turtle.X = x1 Turtle.Y = y1 Turtle.Show() LDControls.RichTextBoxSetText(t17,"Turtle.X = x1","true") LDControls.RichTextBoxSetText(t17,"Turtle.Y = y1","true") LDControls.RichTextBoxSetText(t17,"Turtle.Show() ","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[16] Then 'Turtle.Up LDControls.RichTextBoxSetText(t17,"Turtle.Speed = 9","true") LDControls.RichTextBoxSetText(t17,"Turtle.PenUp()","true") LDControls.RichTextBoxSetText(t17,"Turtle.MoveTo("+X1+","+Y1+")","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[17] Then 'Turtle.Down LDControls.RichTextBoxSetText(t17,"Turtle.Speed = 9","true") LDControls.RichTextBoxSetText(t17,"ColorAndPen()","true") LDControls.RichTextBoxSetText(t17,"Turtle.PenDown()","true") LDControls.RichTextBoxSetText(t17,"Turtle.MoveTo("+X1+","+y1+")","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[18] Then 'Turtle.Angle LDControls.RichTextBoxSetText(t17,"ColorAndPen()","true") LDControls.RichTextBoxSetText(t17,"Turtle.X = x1","true") LDControls.RichTextBoxSetText(t17,"Turtle.Y = y1 ","true") LDControls.RichTextBoxSetText(t17,"Turtle.Speed = ","true") LDControls.RichTextBoxSetText(t17,"Turtle.PenDown("+P+")","true") LDControls.RichTextBoxSetText(t17,"ang = Controls.GetTextBoxText(t1)","true") LDControls.RichTextBoxSetText(t17,"Turtle.Angle = "+ang+"","true") LDControls.RichTextBoxSetText(t17,"mt = Controls.GetTextBoxText(t2)","true") LDControls.RichTextBoxSetText(t17,"Turtle.Move("+mt+")","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[19] Then 'Shapes.Remove Shapes.Remove(rm) LDControls.RichTextBoxSetText(t17,"Shapes.Remove(rm)","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[20] Then 'Turtle.Hide() Turtle.Hide() LDControls.RichTextBoxSetText(t17,"Turtle.Hide()","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[21] Then 'Sub Click() LDControls.RichTextBoxSetText(t17,"Controls.ButtonClicked = Click","true") LDControls.RichTextBoxSetText(t17,"Sub Click","true") LDControls.RichTextBoxSetText(t17,"If (Controls.LastClickedButton = b1) Then","true") LDControls.RichTextBoxSetText(t17,"'If (Controls.LastClickedButton = b[1]) Then","true") LDControls.RichTextBoxSetText(t17,"ElseIf (Controls.LastClickedButton = b2) Then","true") LDControls.RichTextBoxSetText(t17,"Else","true") LDControls.RichTextBoxSetText(t17,"EndIf","true") LDControls.RichTextBoxSetText(t17,"EndSub","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[22] Then 'Gradient Forms LDControls.RichTextBoxSetText(t17,"Sub GradientForms","true") LDControls.RichTextBoxSetText(t17,"gr1[1] = LDDialogs.Colour()","true") LDControls.RichTextBoxSetText(t17,"gr1[2] = LDDialogs.Colour()","true") LDControls.RichTextBoxSetText(t17,"gr1[3] = LDDialogs.Colour()","true") LDControls.RichTextBoxSetText(t17,"For i = 1 To 3","true") LDControls.RichTextBoxSetText(t17,"brush = LDShapes.BrushGradient(gr1,Controls.GetTextBoxText(t1))","true") LDControls.RichTextBoxSetText(t17,"LDShapes.BrushGradientBackground(brush)","true") LDControls.RichTextBoxSetText(t17,"EndFor","true") LDControls.RichTextBoxSetText(t17,"EndIf","true") LDControls.RichTextBoxSetText(t17,"EndSub","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[23] Then ' For/EndFor LDControls.RichTextBoxSetText(t17,"For i = To Step","true") LDControls.RichTextBoxSetText(t17,"EndFor","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[24] Then 'While/EndWhile LDControls.RichTextBoxSetText(t17,"While '(X <= X2)","true") LDControls.RichTextBoxSetText(t17,"EndWhile","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[25] Then LDControls.RichTextBoxSetText(t17," = Controls.GetTextBoxText()","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[26] Then LDControls.RichTextBoxSetText(t17,"Controls.SetTextBoxText( , )","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[27] Then 'OnSlider() LDControls.RichTextBoxSetText(t17,"LDControls.SliderChanged = OnSlider","true") LDControls.RichTextBoxSetText(t17,"Sub OnSlider","true") LDControls.RichTextBoxSetText(t17,"sv1 = LDControls.SliderGetValue(sl1)","true") LDControls.RichTextBoxSetText(t17,"Rr = Math.Ceiling(sv1 * 2.55)","true") LDControls.RichTextBoxSetText(t17,"Controls.SetTextBoxText(t1,Rr)","true") LDControls.RichTextBoxSetText(t17,"EndSub","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[28] Then 'OnMouseMove() LDControls.RichTextBoxSetText(t17,"GraphicsWindow.MouseMove = OnMouseMove","true") LDControls.RichTextBoxSetText(t17,"Sub OnMouseMove","true") LDControls.RichTextBoxSetText(t17,"Controls.SetTextBoxText(t11, X= + Math.Ceiling(GraphicsWindow.MouseX))","true") LDControls.RichTextBoxSetText(t17,"Controls.SetTextBoxText(t12, Y= + Math.Ceiling(GraphicsWindow.Mousey))","true") LDControls.RichTextBoxSetText(t17,"EndSub","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[29] Then 'OnDown() LDControls.RichTextBoxSetText(t17,"GraphicsWindow.MouseDown = OnDown","true") LDControls.RichTextBoxSetText(t17,"Sub OnDown","true") LDControls.RichTextBoxSetText(t17,"x = GraphicsWindow.MouseX","true") LDControls.RichTextBoxSetText(t17,"y = Graphicswindow.MouseY","true") LDControls.RichTextBoxSetText(t17,"aa = aa + 1","true") LDControls.RichTextBoxSetText(t17,"GraphicsWindow.FillRectangle(x, y, 3, 3)","true") LDControls.RichTextBoxSetText(t17,"If aa = 1 Then","true") LDControls.RichTextBoxSetText(t17," xa = GraphicsWindow.MouseX","true") LDControls.RichTextBoxSetText(t17," X1 = Math.Ceiling(xa)","true") LDControls.RichTextBoxSetText(t17,"Controls.SetTextBoxText(t14,'X1= '+ X1)","true") LDControls.RichTextBoxSetText(t17,"ya = Graphicswindow.MouseY","true") LDControls.RichTextBoxSetText(t17,"Y1 = Math.Ceiling(ya)","true") LDControls.RichTextBoxSetText(t17,"Controls.SetTextBoxText(t15,'Y1= '+ Y1)","true") LDControls.RichTextBoxSetText(t17,"aa = 0","true") LDControls.RichTextBoxSetText(t17,"EndIf","true") LDControls.RichTextBoxSetText(t17,"EndSub","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[30] Then 'ArrayButtons() ColorAndPen() b[1] = Controls.GetTextBoxText(t1) b[2] = Controls.GetTextBoxText(t2) b[3] = Controls.GetTextBoxText(t3) nButton = Array.GetItemCount(b) For i = 1 To nButton b1[i] = Controls.AddButton(b[i],x1,((h+2)*(i))-(h+2)+y1) Controls.SetSize(b1[i],w,h) EndFor rm = nButton anm = nButton aa = 0 LDControls.RichTextBoxSetText(t17,"ColorAndPen()","true") LDControls.RichTextBoxSetText(t17,"b[1] = "+Controls.GetTextBoxText(t1)+"","true") LDControls.RichTextBoxSetText(t17,"b[2] = "+Controls.GetTextBoxText(t2)+"","true") LDControls.RichTextBoxSetText(t17,"b[3] = "+Controls.GetTextBoxText(t3)+"","true") LDControls.RichTextBoxSetText(t17,"nButton = Array.GetItemCount(b)","true") LDControls.RichTextBoxSetText(t17,"For i = 1 To nButton","true") LDControls.RichTextBoxSetText(t17,"b1[i] = Controls.AddButton(b[i],"+x1+",(("+(h+1)+")*(i))-"+h+"+"+y1+")","True") LDControls.RichTextBoxSetText(t17,"Controls.SetSize(b1[i],"+w+","+h+")","true") LDControls.RichTextBoxSetText(t17,"EndFor","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[31] Then 'ArrayAddTextBox() ColorAndPen() tx = Controls.GetTextBoxText(t1) For i = 1 To tx t1[i] = Controls.AddTextBox(x1,(h+2)*(i)+y1-(h+2)) Controls.SetSize(t1[i],w,h) rm = t1[i] EndFor aa = 0 LDControls.RichTextBoxSetText(t17,"ColorAndPen()","true") LDControls.RichTextBoxSetText(t17,"tx = Controls.GetTextBoxText(t1)","true") LDControls.RichTextBoxSetText(t17,"For i = 1 To "+ tx+" ","true") LDControls.RichTextBoxSetText(t17,"t1[i] = Controls.AddTextBox("+X1+","+"("+(h+2)+"*(i)+"+Y1+"-"+(h+2)+"))","true") LDControls.RichTextBoxSetText(t17,"Controls.SetSize(t1[i],"+w+","+h+")","true") LDControls.RichTextBoxSetText(t17,"EndFor","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[32] Then 'ColorAndPen LDControls.RichTextBoxSetText(t17,"Sub ColorAndPen","true") LDControls.RichTextBoxSetText(t17,"GraphicsWindow.PenColor = GraphicsWindow.GetColorFromRGB(R,G,B)","true") LDControls.RichTextBoxSetText(t17,"GraphicsWindow.PenWidth = P","true") LDControls.RichTextBoxSetText(t17,"EndSub","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[33] Then ' OnListBox LDControls.RichTextBoxSetText(t17,"LDControls.ListBoxItemChanged = OnListBox","true") LDControls.RichTextBoxSetText(t17,"Sub OnListBox","true") LDControls.RichTextBoxSetText(t17,"If list[LDControls.LastListBoxIndex] = ls[1] Then","true") LDControls.RichTextBoxSetText(t17,"ElseIf list[LDControls.LastListBoxIndex] = ls[2] Then","true") LDControls.RichTextBoxSetText(t17,"EndIf","true") LDControls.RichTextBoxSetText(t17,"EndSub","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[34] Then 'ShowMessagw txt = Controls.GetTextBoxText(t5) ogl = Controls.GetTextBoxText(t1) GraphicsWindow.ShowMessage(txt,ogl) LDControls.RichTextBoxSetText(t17,"txt = Controls.GetTextBoxText(t5)","true") LDControls.RichTextBoxSetText(t17,"ogl = Controls.GetTextBoxText(t1)","true") LDControls.RichTextBoxSetText(t17,"GraphicsWindow.ShowMessage(txt,ogl)","true") LDControls.RichTextBoxSetText(t17,"EndIf","true") LDControls.RichTextBoxSetText(t17,"EndSub","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[35] Then 'DrawResisedImage ar = LDDialogs.OpenFile(Controls.GetTextBoxText(t1),Controls.GetTextBoxText(t5)) GraphicsWindow.DrawResizedImage(ar,x1,y1,w,h) aa = 0 LDControls.RichTextBoxSetText(t17,"ar = LDDialogs.OpenFile('Gif',Controls.GetTextBoxText(t5))","true") LDControls.RichTextBoxSetText(t17,"GraphicsWindow.DrawResizedImage(ar,"+x1+","+y1+","+w+","+h+")","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[36] Then 'Animate LDControls.RichTextBoxSetText(t17,"anm = 0)","true") LDControls.RichTextBoxSetText(t17,"Shapes.Animate(anm"+","+x1+","+y1+","+Controls.GetTextBoxText(t2)+")","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[37] Then 'Zoom LDControls.RichTextBoxSetText(t17,"zm = 0","true") LDControls.RichTextBoxSetText(t17,"Shapes.Zoom(zm,"+Controls.GetTextBoxText(t2)+","+Controls.GetTextBoxText(t3)+")","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[38] Then 'Rotate LDControls.RichTextBoxSetText(t17,"rt = 0)","true") LDControls.RichTextBoxSetText(t17,"Shapes.Rotate(rtm,"+Controls.GetTextBoxText(t2)+")","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[39] Then 'Opacity LDControls.RichTextBoxSetText(t17,"op = 0)","true") LDControls.RichTextBoxSetText(t17,"Shapes.SetOpacity(opc,"+Controls.GetTextBoxText(t2)+")","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[40] Then 'Star Grad() OnDown() g = Controls.GetTextBoxText(t1) For i = 1 To 1 st = LDShapes.AddStar(Controls.GetTextBoxText(t2), w, h) Shapes.Move(st, x1, y1) LDShapes.BrushGradientShape(st, LDShapes.BrushGradient(gr2, g)) EndFor rm = st anm = st ang = st opc = st zm = st aa = 0 LDControls.RichTextBoxSetText(t17,"g = Controls.GetTextBoxText(t1)","true") LDControls.RichTextBoxSetText(t17,"For i = 1 To 1","true") LDControls.RichTextBoxSetText(t17,"st = LDShapes.AddStar("+Controls.GetTextBoxText(t2)+","+w+","+h+")","true") LDControls.RichTextBoxSetText(t17,"Shapes.Move(st,"+x1+","+y1+")","true") LDControls.RichTextBoxSetText(t17,"LDShapes.BrushGradientShape(st, LDShapes.BrushGradient(gr2,"+g+"))","true") LDControls.RichTextBoxSetText(t17,"EndFor","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[41] Then 'AddEllipse Grad() OnDown() g = Controls.GetTextBoxText(t1) For i = 1 To 1 el = Shapes.AddEllipse(w,h) Shapes.Move(el,X1,Y1) LDShapes.BrushGradientShape(el, LDShapes.BrushGradient(gr2,g)) EndFor rm = el anm = el ang = el zm = el opc = el aa = 0 LDControls.RichTextBoxSetText(t17,"LDShapes.BrushGradientShape(st, LDShapes.BrushGradient(gr2,"+g+"))","true") LDControls.RichTextBoxSetText(t17,"For i = 1 To 1","true") LDControls.RichTextBoxSetText(t17,"el = Shapes.AddEllipse("+w+","+h+")","true") LDControls.RichTextBoxSetText(t17,"Shapes.Move(el,"+x1+","+y1+")","true") LDControls.RichTextBoxSetText(t17,"EndFor","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[42] Then 'AddRectangle Grad() OnDown() g = Controls.GetTextBoxText(t1) For i = 1 To 1 rc = Shapes.AddRectangle(w,h) Shapes.Move(rc, X1,Y1) LDShapes.BrushGradientShape(rc, LDShapes.BrushGradient(gr2,g)) EndFor rm = rc anm = rc ang = rc zm = rc opc = rc aa = 0 LDControls.RichTextBoxSetText(t17,"LDShapes.BrushGradientShape(st, LDShapes.BrushGradient(gr2,"+g+"))","true") LDControls.RichTextBoxSetText(t17,"For i = 1 To 1","true") LDControls.RichTextBoxSetText(t17,"rc = Shapes.AddRectangle("+w+","+h+")","true") LDControls.RichTextBoxSetText(t17,"Shapes.Move(rc,"+x1+","+y1+")","true") LDControls.RichTextBoxSetText(t17,"EndFor","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[43] Then 'AddPolygon Grad() OnDown() g = Controls.GetTextBoxText(t1) For i = 1 To 1 pl = LDShapes.AddPolygon(plg) LDShapes.BrushGradientShape(pl, LDShapes.BrushGradient(gr2, g)) EndFor rm = pl anm = pl ang = pl zm = pl opc = pl aa = 0 LDControls.RichTextBoxSetText(t17,"g = Controls.GetTextBoxText(t1)","true") LDControls.RichTextBoxSetText(t17,"For i = 1 To 1","true") LDControls.RichTextBoxSetText(t17,"pl = LDShapes.AddPolygon(plg)","true") LDControls.RichTextBoxSetText(t17,"LDShapes.BrushGradientShape(pl, LDShapes.BrushGradient(gr2,"+g+"))","true") LDControls.RichTextBoxSetText(t17,"EndFor","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[44] Then 'AddRegularPolygon Grad() OnDown() g = Controls.GetTextBoxText(t1) For i = 1 To 1 rp = LDShapes.AddRegularPolygon(Controls.GetTextBoxText(t2), w) Shapes.Move(rp, X1, Y1) LDShapes.BrushGradientShape(rp, LDShapes.BrushGradient(gr2, g)) EndFor rm = rp opc = rp anm = rp ang = rp zm = rp aa = 0 LDControls.RichTextBoxSetText(t17,"g = Controls.GetTextBoxText(t1)","true") LDControls.RichTextBoxSetText(t17,"For i = 1 To 1","true") LDControls.RichTextBoxSetText(t17,"rp = LDShapes.AddRegularPolygon("+Controls.GetTextBoxText(t2)+","+w+")","true") LDControls.RichTextBoxSetText(t17,"Shapes.Move(rp,"+X1+","+Y1+")","true") LDControls.RichTextBoxSetText(t17,"LDShapes.BrushGradientShape(rp, LDShapes.BrushGradient(gr2,"+g+"))","true") LDControls.RichTextBoxSetText(t17,"EndFor","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[45] Then 'AddLine ColorAndPen() OnDown() ln = Shapes.addLine(X1,Y1,X2,Y2) rm = ln opc = ln anm = ln ang = ln zm = ln GraphicsWindow.PenWidth = 0 aa = 0 LDControls.RichTextBoxSetText(t17,"ColorAndPen()","true") LDControls.RichTextBoxSetText(t17,"ln = Shapes.addLine("+X1+","+Y1+","+X2+","+Y2+")","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[46] Then 'Sub Down() LDControls.RichTextBoxSetText(t17,"GraphicsWindow.MouseDown = Down","true") LDControls.RichTextBoxSetText(t17,"Sub Down","true") LDControls.RichTextBoxSetText(t17,"x = GraphicsWindow.MouseX","true") LDControls.RichTextBoxSetText(t17,"y = Graphicswindow.MouseY","true") LDControls.RichTextBoxSetText(t17,"aa = aa + 1","true") LDControls.RichTextBoxSetText(t17,"GraphicsWindow.FillRectangle(x, y, 2, 2)","true") LDControls.RichTextBoxSetText(t17,"If aa = 1 Then","true") LDControls.RichTextBoxSetText(t17,"X1 = x","true") LDControls.RichTextBoxSetText(t17,"Controls.SetTextBoxText(t14,X)","true") LDControls.RichTextBoxSetText(t17,"Y1 = y","true") LDControls.RichTextBoxSetText(t17,"Controls.SetTextBoxText(t15,Y)","true") LDControls.RichTextBoxSetText(t17,"plg[0][' X '] = x","true") LDControls.RichTextBoxSetText(t17,"plg[0][' Y '] = y","true") LDControls.RichTextBoxSetText(t17,"ElseIf aa = 2 Then","true") LDControls.RichTextBoxSetText(t17,"X2 = x","true") LDControls.RichTextBoxSetText(t17,"Controls.SetTextBoxText(t14,X)","true") LDControls.RichTextBoxSetText(t17,"Y2 = y","true") LDControls.RichTextBoxSetText(t17,"Controls.SetTextBoxText(t15,Y)","true") LDControls.RichTextBoxSetText(t17,"plg[1][' X '] = x","true") LDControls.RichTextBoxSetText(t17,"plg[1][' Y '] = y","true") LDControls.RichTextBoxSetText(t17,"aa = 0","true") LDControls.RichTextBoxSetText(t17,"EndIf","true") LDControls.RichTextBoxSetText(t17,"EndSub","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[47] Then 'Sub OnMouseMove LDControls.RichTextBoxSetText(t17,"GraphicsWindow.MouseMove = OnMouseMove","true") LDControls.RichTextBoxSetText(t17,"Sub OnMouseMove","true") LDControls.RichTextBoxSetText(t17,"Controls.SetTextBoxText(t11, 'X=" + Math.Ceiling(GraphicsWindow.MouseX)+")","true") LDControls.RichTextBoxSetText(t17,"Controls.SetTextBoxText(t12, 'Y=" + Math.Ceiling(GraphicsWindow.Mousey)+")","true") LDControls.RichTextBoxSetText(t17,"EndSub","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[48] Then 'GraphicsWindow.DrawRectangle ColorAndPen() OnDown() GraphicsWindow.DrawRectangle(x1,y1,w,h) aa = 0 LDControls.RichTextBoxSetText(t17,"ColorAndPen()","true") LDControls.RichTextBoxSetText(t17,"GraphicsWindow.Rectangle("+x1+","+y1+","+w+","+h+")","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[49] Then 'GraphicsWindow.DrawEllips ColorAndPen() OnDown() GraphicsWindow.DrawEllipse(x1,y1,w,h) aa = 0 LDControls.RichTextBoxSetText(t17,"ColorAndPen()","true") LDControls.RichTextBoxSetText(t17,"GraphicsWindow.DrawEllipse("+x1+","+y1+","+w+","+h+")","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[50] Then 'ComboBox LDControls.RichTextBoxSetText(t17,"ColorAndPen()","True") LDControls.RichTextBoxSetText(t17,"cb[1] = 'H'","True") LDControls.RichTextBoxSetText(t17,"cb[2] = 'V'","True") LDControls.RichTextBoxSetText(t17,"cb[3] = 'DD' ","True") LDControls.RichTextBoxSetText(t17,"cb1 = LDSort.ByValue(cb)","True") LDControls.RichTextBoxSetText(t17,"CBox = LDControls.AddComboBox(cb1,"+w+","+lf+")","True") LDControls.RichTextBoxSetText(t17,"Shapes.Move(CBox,"+x1+","+y1+")","True") LDControls.RichTextBoxSetText(t17,"OnCoboBox()","True") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[51] Then 'OnComboBox LDControls.RichTextBoxSetText(t17,"LDControls.ComboBoxItemChanged = OnComboBox","true") LDControls.RichTextBoxSetText(t17,"Sub OnComboBox","true") LDControls.RichTextBoxSetText(t17,"If CBox[LDControls.LastComboBoxIndex] = cb[1] Then","true") LDControls.RichTextBoxSetText(t17,"ElseIf CBox[LDControls.LastComboBoxIndex] = cb[2] Then","true") LDControls.RichTextBoxSetText(t17,"EndIf","true") LDControls.RichTextBoxSetText(t17,"EndSub","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[52] Then 'LDPasswordBox OnDown() pss = LDControls.AddPasswordBox(w,h,Controls.GetTextBoxText(t1)) Shapes.Move(pss,X1,Y1) rm = pss aa = 0 LDControls.RichTextBoxSetText(t17,"pss = LDControls.AddPasswordBox("+w+","+h+","+Controls.GetTextBoxText(t1)+")","true") LDControls.RichTextBoxSetText(t17,"Shapes.Move(pss,"+X1+","+Y1+")","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[53] Then 'LDControlsaddMenu ml["File"] = "Main" ml["Open"] = "File" ml["Save"] = "File" ml["Exit"] = "file" ml["Show Help"] = "Main" ml["Help"] = "Show Help" LDControls.AddMenu(w,h,ml,"","false") LDControls.RichTextBoxSetText(t17,"ml['File'] = 'Main'","true") LDControls.RichTextBoxSetText(t17,"ml['Open'] = 'File'","true") LDControls.RichTextBoxSetText(t17,"ml['Save'] = 'File'","true") LDControls.RichTextBoxSetText(t17," ml['Exit'] = 'file'","true") LDControls.RichTextBoxSetText(t17,"ml['Show Help'] = 'Main","true") LDControls.RichTextBoxSetText(t17,"ml['Help'] = 'Show Help","true") LDControls.RichTextBoxSetText(t17,"LDControls.AddMenu(w,h,ml,'false', "")","true") ElseIf CobB[LDControls.LastComboBoxIndex] = cb[54] Then ' GraphicsWindow.DrawLine OnDown() ColorAndPen() GraphicsWindow.DrawLine(X1,Y1,X2,Y2) aa = 0 LDControls.RichTextBoxSetText(t17,"ColorAndPen()","true") LDControls.RichTextBoxSetText(t17,"GraphicsWindow.DrawLine("+X1+","+Y1+","+X2+","+Y2+")","true") EndIf GraphicsWindow.PenWidth = 0 EndSub Sub ColorAndPen GraphicsWindow.PenColor = GraphicsWindow.GetColorFromRGB(R,G,B) ' Для контура фигур GraphicsWindow.FontSize = P GraphicsWindow.PenWidth = P EndSub Sub Grid GraphicsWindow.PenWidth = 0.1 GraphicsWindow.PenColor = "White" For gg = 1 To 245 Step ng GraphicsWindow.DrawLine(4 * gg,4,4 * gg,725) 'gorizontal EndFor For vv = 1 To 180 Step ng GraphicsWindow.DrawLine(4,4 * vv,960,4 * vv) 'vertical EndFor EndSub LDControls.ListBoxItemChanged = OnListBox Sub OnListBox If list[LDControls.LastListBoxIndex] = ls[1] Then ElseIf list[LDControls.LastListBoxIndex] = ls[2] Then EndIf EndSub Sub Grad gr2[1] = LDDialogs.Colour() gr2[2] = LDDialogs.Colour() gr2[3] = LDDialogs.Colour() EndSub GraphicsWindow.MouseDown = OnDown Sub OnDown x = GraphicsWindow.MouseX y = Graphicswindow.MouseY aa = aa + 1 GraphicsWindow.FillRectangle(x, y, 2, 2) If aa = 1 Then X1 = x Controls.SetTextBoxText(t14,X) Y1 = y Controls.SetTextBoxText(t15,Y) plg[0][" X "] = x plg[0][" Y "] = y ElseIf aa = 2 Then X2 = x Controls.SetTextBoxText(t14,X) Y2 = y Controls.SetTextBoxText(t15,Y) plg[1][" X "] = x plg[1][" Y "] = y ElseIf aa = 3 Then plg[2][" X "] = x Controls.SetTextBoxText(t14,X) plg[2][" Y "] = y Controls.SetTextBoxText(t15,Y) ElseIf aa = 4 Then plg[3][" X "] = x Controls.SetTextBoxText(t14,X) plg[3][" Y "] = y Controls.SetTextBoxText(t15,Y) ElseIf aa = 5 Then plg[4][" X "] = x Controls.SetTextBoxText(t11,X) plg[4][" Y "] = y Controls.SetTextBoxText(t12,Y) aa = 0 EndIf EndSub End>GRN801.sb< Start>GRR537.sb< array[1] = "YouTube" array[2] = "Programming" array[3] = "You" array[4] = "Professional" array[5] = "Life" len = Array.GetItemCount(array) 'bubble sort For i = 1 To len For j = i+1 To len str1 = array[i] str2 = array[j] Compare() If (result = 2) Then 'swap array[i] = str2 array[j] = str1 EndIf EndFor TextWindow.WriteLine(array[i]) EndFor 'Subroutine to compare 2 strings lexically 'Input: 2 strings are held in variables called str1 and str2 'Output: result = 1 or 2 indicating the first lexical string, 0 if they are identical Sub Compare 'Assume shortest string comes first by default, in case one is an identical substring If (Text.GetLength(str1) < Text.GetLength(str2)) Then result = 1 ElseIf (Text.GetLength(str2) < Text.GetLength(str1)) Then result = 2 Else 'If all checks fail to find a difference they are identical result = 0 EndIf 'Check characters looking for a difference For k = 1 To Math.Min(Text.GetLength(str1),Text.GetLength(str2)) char1 = Text.GetSubText(str1,k,1) char2 = Text.GetSubText(str2,k,1) 'Lower case comparison code1 = Text.GetCharacterCode(Text.ConvertToLowerCase(char1)) code2 = Text.GetCharacterCode(Text.ConvertToLowerCase(char2)) If (code1 < code2) Then result = 1 Goto finished ElseIf (code2 < code1) Then result = 2 Goto finished Else 'Check case (capitals first) if case invariant check finds identical values code1 = Text.GetCharacterCode(char1) code2 = Text.GetCharacterCode(char2) If (code1 < code2) Then result = 1 Goto finished ElseIf (code2 < code1) Then result = 2 Goto finished EndIf EndIf EndFor finished: EndSub End>GRR537.sb< Start>GRR992.sb< GraphicsWindow.Hide() GraphicsWindow.Width = 200 GraphicsWindow.Height = 330 GraphicsWindow.Title = "Calculator" GraphicsWindow.Show() GraphicsWindow.BackgroundColor = "DarkSlateGray" GraphicsWindow.KeyDown = OnKeyDown holder = "" intdivon = "False" GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle(10, 10, GraphicsWindow.Width - 20, 40) GraphicsWindow.FontSize = 36 GraphicsWindow.BrushColor = "Black" numbers = Shapes.AddText("0") Shapes.Move(numbers, 20, 10) btn7 = FCControls.AddButton(30, 30, "7") FCControls.Move(btn7, 22, 100) FCControls.RegisterMouseDownEvent(btn7, "n7") btn8 = FCControls.AddButton(30, 30, "8") FCControls.Move(btn8, 54, 100) FCControls.RegisterMouseDownEvent(btn8, "n8") btn9 = FCControls.AddButton(30, 30, "9") FCControls.Move(btn9, 86, 100) FCControls.RegisterMouseDownEvent(btn9, "n9") btn4 = FCControls.AddButton(30, 30, "4") FCControls.Move(btn4, 22, 132) FCControls.RegisterMouseDownEvent(btn4, "n4") btn5 = FCControls.AddButton(30, 30, "5") FCControls.Move(btn5, 54, 132) FCControls.RegisterMouseDownEvent(btn5, "n5") btn6 = FCControls.AddButton(30, 30, "6") FCControls.Move(btn6, 86, 132) FCControls.RegisterMouseDownEvent(btn6, "n6") btn1 = FCControls.AddButton(30, 30, "1") FCControls.Move(btn1, 22, 164) FCControls.RegisterMouseDownEvent(btn1, "n1") btn2 = FCControls.AddButton(30, 30, "2") FCControls.Move(btn2, 54, 164) FCControls.RegisterMouseDownEvent(btn2, "n2") btn3 = FCControls.AddButton(30, 30, "3") FCControls.Move(btn3, 86, 164) FCControls.RegisterMouseDownEvent(btn3, "n3") btnbck = FCControls.AddButton(30, 30, "←") FCControls.Move(btnbck, 22, 67) FCControls.RegisterMouseDownEvent(btnbck, "bck") ent = FCControls.AddButton(30, 94, "=") FCControls.Move(ent, 152, 132) FCControls.RegisterMouseDownEvent(ent, "calculate") btnbck = FCControls.AddButton(30, 30, "←") FCControls.Move(btnbck, 22, 67) FCControls.RegisterMouseDownEvent(btnbck, "bck") clear = FCControls.AddButton(30, 30, "C") FCControls.Move(clear, 54, 67) FCControls.RegisterMouseDownEvent(clear, "c") plus = FCControls.AddButton(30, 30, "+") FCControls.Move(plus, 86, 67) FCControls.RegisterMouseDownEvent(plus, "add") minus = FCControls.AddButton(30, 30, "-") FCControls.Move(minus, 119, 100) FCControls.RegisterMouseDownEvent(minus, "subtract") divide = FCControls.AddButton(30, 30, "÷") FCControls.Move(divide, 119, 132) FCControls.RegisterMouseDownEvent(divide, "slash") multiply = FCControls.AddButton(30, 30, "*") FCControls.Move(multiply, 119, 164) FCControls.RegisterMouseDownEvent(multiply, "mult") btn0 = FCControls.AddButton(94, 30, "0") FCControls.Move(btn0, 22, 196) FCControls.RegisterMouseDownEvent(btn0, "n0") btndot = FCControls.AddButton(30, 30, ".") FCControls.Move(btndot, 119, 196) FCControls.RegisterMouseDownEvent(btndot, "ndot") btnper = FCControls.AddButton(30, 30, "%") FCControls.Move(btnper, 152, 67) FCControls.RegisterMouseDownEvent(btnper, "nper") btnsqrt = FCControls.AddButton(30, 30, "√") FCControls.Move(btnsqrt, 119, 67) FCControls.RegisterMouseDownEvent(btnsqrt, "nsqrt") btnpwr = FCControls.AddButton(30, 30, "^") FCControls.Move(btnpwr, 152, 100) FCControls.RegisterMouseDownEvent(btnpwr, "npwr") btnintdiv = FCControls.AddButton(30, 30, "Int÷") FCControls.Move(btnintdiv, 22, 228) FCControls.RegisterMouseDownEvent(btnintdiv, "nintdiv") btnmemadd = FCControls.AddButton(30, 30, "M+") FCControls.Move(btnmemadd, 54, 228) FCControls.RegisterMouseDownEvent(btnmemadd, "memadd") btnmemm = FCControls.AddButton(30, 30, "M-") FCControls.Move(btnmemm, 86, 228) FCControls.RegisterMouseDownEvent(btnmemm, "memm") btnmemmr = FCControls.AddButton(30, 30, "MR") FCControls.Move(btnmemmr, 119, 228) FCControls.RegisterMouseDownEvent(btnmemmr, "memmr") btnsin = FCControls.AddButton(30, 30, "sin") FCControls.Move(btnsin, 152, 228) FCControls.RegisterMouseDownEvent(btnsin, "sin") btncos = FCControls.AddButton(30, 30, "cos") FCControls.Move(btncos, 22, 260) FCControls.RegisterMouseDownEvent(btncos, "cos") btntan = FCControls.AddButton(30, 30, "tan") FCControls.Move(btntan, 54, 260) FCControls.RegisterMouseDownEvent(btntan, "tan") btnlog = FCControls.AddButton(30, 30, "log") FCControls.Move(btnlog, 86, 260) FCControls.RegisterMouseDownEvent(btnlog, "LOG") btncosh = FCControls.AddButton(30, 30, "cosh") FCControls.Move(btncosh, 119, 260) FCControls.RegisterMouseDownEvent(btncosh, "cosh") btnsinh = FCControls.AddButton(30, 30, "sinh") FCControls.Move(btnsinh, 152, 260) FCControls.RegisterMouseDownEvent(btnsinh, "sinh") btnrnd = FCControls.AddButton(30, 30, "RND") FCControls.Move(btnrnd, 22, 292) FCControls.RegisterMouseDownEvent(btnrnd, "rnd") btnmax = FCControls.AddButton(30, 30, "↑/↓") FCControls.Move(btnmax, 22, 292) FCControls.RegisterMouseDownEvent(btnmax, "maxmin") Sub n1 holder = TextPlus.Append(holder, 1) draw() EndSub Sub n2 holder = TextPlus.Append(holder, 2) draw() EndSub Sub n3 holder = TextPlus.Append(holder, 3) draw() EndSub Sub n4 holder = TextPlus.Append(holder, 4) draw() EndSub Sub n5 holder = TextPlus.Append(holder, 5) draw() EndSub Sub n6 holder = TextPlus.Append(holder, 6) draw() EndSub Sub n7 holder = TextPlus.Append(holder, 7) draw() EndSub Sub n8 holder = TextPlus.Append(holder, 8) draw() EndSub Sub n9 holder = TextPlus.Append(holder, 9) draw() EndSub Sub n0 holder = TextPlus.Append(holder, 0) draw() EndSub Sub draw GraphicsWindow.FontSize = 36 GraphicsWindow.BrushColor = "Black" Shapes.Remove(numbers) numbers = Shapes.AddText(holder) Shapes.Move(numbers, 20, 10) If maxfinderon = "True" then holder3 = FCControls.GetText(numbers) EndIf EndSub Sub bck holder = TextPlus.RemoveSubText(holder, TextPlus.GetLength(holder)-1, 1) draw() EndSub Sub c holder = "" output = "" draw() Shapes.Remove(numbers) EndSub Sub calculate GraphicsWindow.FontSize = 36 'Check if Operation is Add If Text.GetIndexOf(holder, "+") <> 0 Then operationindex = Text.GetIndexOf(holder, "+") textbeforoperation = Text.GetSubText(holder, 1, operationindex - 1) textafteroperation = Text.GetSubTextToEnd(holder, operationindex + 1) output = textbeforoperation + textafteroperation If output > 10000000 then showaserror() else showonscreen() endif EndIf 'Check if Operation is Subtract If Text.GetIndexOf(holder, "-") <> 0 Then operationindex = Text.GetIndexOf(holder, "-") textbeforoperation = Text.GetSubText(holder, 1, operationindex - 1) textafteroperation = Text.GetSubTextToEnd(holder, operationindex + 1) output = textbeforoperation - textafteroperation If output > 10000000 then showaserror() else showonscreen() endif EndIf 'Check if Operation is Multiply If Text.GetIndexOf(holder, "*") <> 0 Then operationindex = Text.GetIndexOf(holder, "*") textbeforoperation = Text.GetSubText(holder, 1, operationindex - 1) textafteroperation = Text.GetSubTextToEnd(holder, operationindex + 1) output = textbeforoperation * textafteroperation If output > 10000000 then showaserror() else showonscreen() endif EndIf 'Check if Operation is Divide If Text.GetIndexOf(holder, "÷") <> 0 Then operationindex = Text.GetIndexOf(holder, "÷") textbeforoperation = Text.GetSubText(holder, 1, operationindex - 1) textafteroperation = Text.GetSubTextToEnd(holder, operationindex + 1) output = textbeforoperation / textafteroperation If output > 10000000 then showaserror() else showonscreen() endif EndIf If pwron = "True" then textbeforoperation = TextPlus.GetSubText(holder, 1, TextPlus.GetIndexOf(holder, "^") - 1) textafteroperation = TextPlus.GetSubTextToEnd(holder, TextPlus.GetIndexOf(holder, "^") + 1) output = MathPlus.Power(textbeforoperation, textafteroperation) pwron = "False" If output > 10000000 then showaserror() else showonscreen() endif EndIf If intdivon = "True" then textbeforoperation = TextPlus.GetSubText(holder, 1, TextPlus.GetIndexOf(holder, "÷R") - 1) textafteroperation = TextPlus.GetSubTextToEnd(holder, TextPlus.GetIndexOf(holder, "÷R") + 2) remainder = MathPlus.Remainder(textbeforoperation, textafteroperation) outputmain = textbeforoperation / textafteroperation intoutput = MathPlus.Round(outputmain) output = intoutput + "R " + remainder intdivon = "False" showonscreen() EndIf If Text.GetIndexOf(holder, "÷") = 0 and Text.GetIndexOf(holder, "+") = 0 and Text.GetIndexOf(holder, "-") = 0 and Text.GetIndexOf(holder, "÷R") = 0 and Text.GetIndexOf(holder, "^") = 0 and Text.GetIndexOf(holder, "*") = 0 then GraphicsWindow.FontSize = 20 output = "Syntax Error" holder = "" showonscreen() EndIf If maxfinderon = "True" then themax = Math.Max(holder2, holder3) themin = Math.Min(holder2, holder3) Shapes.Remove(smallnumbers) output = "MAX" + themax + ";MIN" + themin showonscreen() maxfinderon = "False" EndIf EndSub Sub showonscreen GraphicsWindow.BrushColor = "Black" Shapes.Remove(numbers) numbers = Shapes.AddText(output) Shapes.Move(numbers, 20, 10) EndSub Sub add holder = TextPlus.Append(holder, "+") draw() EndSub Sub subtract holder = TextPlus.Append(holder, "-") draw() EndSub Sub slash holder = TextPlus.Append(holder, "÷") draw() EndSub Sub mult holder = TextPlus.Append(holder, "*") draw() EndSub Sub ndot holder = TextPlus.Append(holder, ".") draw() EndSub Sub nsqrt holder = MathPlus.SquareRoot(holder) draw() EndSub Sub nper percentconvert = holder * 100 holder = percentconvert + "%" draw() EndSub Sub npwr holder = TextPlus.Append(holder, "^") pwron = "True" draw() EndSub Sub nintdiv holder = TextPlus.Append(holder, "÷R") intdivon = "True" draw() EndSub Sub memadd GraphicsWindow.BrushColor = "Black" memory = holder If holder = "" Then memory = "0" EndIf GraphicsWindow.FontSize = 10 Shapes.Remove(showmem) showmem = Shapes.AddText(memory) Shapes.Move(showmem, GraphicsWindow.Width - 25, 38) EndSub Sub memm Shapes.Remove(showmem) memory = "" EndSub Sub memmr holder = memory draw() EndSub Sub sin holder = Math.Sin(holder) draw() EndSub Sub cos holder = Math.Sin(holder) draw() EndSub Sub tan holder = Math.Tan(holder) draw() EndSub Sub log holder = Math.Log(holder) draw() EndSub Sub cosh holder = MathPlus.Cosh(holder) draw() EndSub Sub sinh holder = MathPlus.Sinh(holder) draw() EndSub Sub rnd holder = Math.Round(holder) draw() EndSub Sub maxmin Shapes.Remove(numbers) GraphicsWindow.FontSize = 10 GraphicsWindow.BrushColor = "Black" Shapes.Remove(smallnumbers) If holder <> "" then smallnumbers = Shapes.AddText("NUM1=" + holder) maxfinderon = "True" draw() else GraphicsWindow.FontSize = 20 GraphicsWindow.BrushColor = "Black" Shapes.Remove(numbers) numbers = Shapes.AddText("Syntax Error") Shapes.Move(numbers, 20, 10) maxfinderon = "False" Endif Shapes.Move(smallnumbers, 140, 15) holder2 = holder holder = "" EndSub Sub showaserror GraphicsWindow.FontSize = 20 GraphicsWindow.BrushColor = "Black" Shapes.Remove(numbers) numbers = Shapes.AddText("Overflow Error") Shapes.Move(numbers, 20, 10) EndSub Sub OnKeyDown If GraphicsWindow.LastKey = "D0" Then n0() ElseIf GraphicsWindow.LastKey = "D1" Then n1() ElseIf GraphicsWindow.LastKey = "D2" Then n2() ElseIf GraphicsWindow.LastKey = "D3" Then n3() ElseIf GraphicsWindow.LastKey = "D4" Then n4() ElseIf GraphicsWindow.LastKey = "D5" Then n5() ElseIf GraphicsWindow.LastKey = "D6" Then n6() ElseIf GraphicsWindow.LastKey = "D7" Then n7() ElseIf GraphicsWindow.LastKey = "D8" Then n8() ElseIf GraphicsWindow.LastKey = "D9" Then n9() ElseIf GraphicsWindow.LastKey = "Tab" Then calculate() ElseIf GraphicsWindow.LastKey = "Back" Then bck() ElseIf GraphicsWindow.LastKey = "NumPad1" Then n1() ElseIf GraphicsWindow.LastKey = "NumPad2" Then n2() ElseIf GraphicsWindow.LastKey = "NumPad3" Then n3() ElseIf GraphicsWindow.LastKey = "NumPad4" Then n4() ElseIf GraphicsWindow.LastKey = "NumPad5" Then n5() ElseIf GraphicsWindow.LastKey = "NumPad6" Then n6() ElseIf GraphicsWindow.LastKey = "NumPad7" Then n7() ElseIf GraphicsWindow.LastKey = "NumPad8" Then n8() ElseIf GraphicsWindow.LastKey = "NumPad9" Then n9() ElseIf GraphicsWindow.LastKey = "NumPad0" Then n0() ElseIf GraphicsWindow.LastKey = "Decimal" Then ndot() ElseIf GraphicsWindow.LastKey = "Add" Then add() ElseIf GraphicsWindow.LastKey = "Subtract" Then subtract() ElseIf GraphicsWindow.LastKey = "Multiply" Then mult() ElseIf GraphicsWindow.LastKey = "Divide" Then slash() ElseIf GraphicsWindow.LastKey = "Clear" Then c() ElseIf GraphicsWindow.LastKey = "C" Then c() ElseIf Keyboard.CtrlDown Then memadd() ElseIf Keyboard.AltDown Then memm() ElseIf Keyboard.ShiftDown Then nintdiv() EndIf EndSub End>GRR992.sb< Start>GRS792.sb< divisor = 10 num = 1 i = 1 While num > 0 num = num / divisor TextWindow.WriteLine(divisor + "^(-" + i + ")=" + num) i = i + 1 EndWhile End>GRS792.sb< Start>GRT732-0.sb< ' Bowling Anime ' Version 0.21 ' Copyright © 2017 Nonki Takahashi. The MIT License. ' Program ID GRT732-0 GraphicsWindow.Title = "Bowling Anime 0.21 - Hit arrow keys." Init() path = "http://www.nonkit.com/smallbasic.files/Ball.png" GraphicsWindow.KeyDown = OnKeyDown While "True" x = gw / 2 y = gh + 120 a = 120 DrawBall() positioning = "True" While positioning If keyDown Then If GraphicsWindow.LastKey = "Up" Then positioning = "False" ElseIf GraphicsWindow.LastKey = "Left" Then If 0 <= x - 10 Then x = x - 10 DrawBall() EndIf ElseIf GraphicsWindow.LastKey = "Right" Then If x + 10 <= gw Then x = x + 10 DrawBall() EndIf EndIf keyDown = "False" EndIf EndWhile x0 = x For y = gh - 1 To 212 Step -1 x = (gw / 2) * (1 - y / gh) + x0 * y / gh a = a - 2 DrawBall() Program.Delay(10) EndFor Program.Delay(1000) EndWhile Sub DrawBall scale = y / 212 If shadow = "" Then shadow = Shapes.AddEllipse(78, 20) Shapes.SetOpacity(shadow, 50) EndIf Shapes.Move(shadow, x - 39, y - 10) Shapes.Zoom(shadow, scale, scale) If ball = "" Then ball = Shapes.AddImage(path) EndIf Shapes.Move(ball, x - 39, y - 33 * scale - 39) Shapes.Zoom(ball, scale, scale) Shapes.Rotate(ball, a) EndSub Sub Init gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BackgroundColor = "LightGray" ' draw gutter GraphicsWindow.BrushColor = "SaddleBrown" color = GraphicsWindow.BrushColor rate = 0.5 Color_Blacken() GraphicsWindow.BrushColor = color GraphicsWindow.FillTriangle(gw / 2, 0, -70, gh, gw + 70, gh) ' draw lane GraphicsWindow.BrushColor = "SaddleBrown" GraphicsWindow.FillTriangle(gw / 2, 0, 0, gh, gw, gh) GraphicsWindow.BrushColor = "LightGray" GraphicsWindow.FillRectangle(0, 0, gw, 140) ' draw wall GraphicsWindow.BrushColor = "GreenYellow" GraphicsWindow.FillRectangle(0, 0, gw, 52) GraphicsWindow.FillRectangle(0, 52, 116, 160) GraphicsWindow.FillRectangle(gw - 116, 52, 149, 160) path = "http://www.nonkit.com/smallbasic.files/Pin.png" i = 0 GraphicsWindow.BrushColor = "Black" For row = 4 To 1 Step -1 y = 100 - row * 10 For col = 1 To row i = i + 1 pin[i] = Shapes.AddImage(path) x = 249 + col * 60 - row * 30 Shapes.Move(pin[i], x, y) EndFor shadow = Shapes.AddRectangle(366, 160) Shapes.SetOpacity(shadow, 10) Shapes.Move(shadow, 116, 52) EndFor shadow = "" EndSub Sub OnKeyDown keyDown = "True" EndSub Sub Color_Blacken ' Color | Blacken given color ' param color - given color ' param rate - 0..1 ' return color - color blackened Color_NameToColor() Color_ColorToRGB() r = Math.Floor(r * (1 - rate)) g = Math.Floor(g * (1 - rate)) b = Math.Floor(b * (1 - rate)) color = GraphicsWindow.GetColorFromRGB(r, g, b) EndSub Sub Color_ColorToRGB ' Color | Convert color to RGB values ' param color - "#rrggbb" (hexadecimal values) ' return r, g, b - RGB values 0..255 sR = Text.GetSubText(color, 2, 2) sG = Text.GetSubText(color, 4, 2) sB = Text.GetSubText(color, 6, 2) hex = sR Math_Hex2Dec() r = dec hex = sG Math_Hex2Dec() g = dec hex = sB Math_Hex2Dec() b = dec EndSub Sub Color_NameToColor ' Color | Convert color name to color ' param color - color name ' returns color -"#rrggbb" If Text.StartsWith(color, "#") Then color = Text.ConvertToUpperCase(color) Else color = Text.ConvertToLowerCase(color) color = colors[color] EndIf EndSub Sub Colors_Init colors["aliceblue"]="#F0F8FF" colors["antiquewhite"]="#FAEBD7" colors["aqua"]="#00FFFF" colors["aquamarine"]="#7FFFD4" colors["azure"]="#F0FFFF" colors["beige"]="#F5F5DC" colors["bisque"]="#FFE4C4" colors["black"]="#000000" colors["blanchedalmond"]="#FFEBCD" colors["blue"]="#0000FF" colors["blueviolet"]="#8A2BE2" colors["brown"]="#A52A2A" colors["burlywood"]="#DEB887" colors["cadetblue"]="#5F9EA0" colors["chartreuse"]="#7FFF00" colors["chocolate"]="#D2691E" colors["coral"]="#FF7F50" colors["cornflowerblue"]="#6495ED" colors["cornsilk"]="#FFF8DC" colors["crimson"]="#DC143C" colors["cyan"]="#00FFFF" colors["darkblue"]="#00008B" colors["darkcyan"]="#008B8B" colors["darkgoldenrod"]="#B8860B" colors["darkgray"]="#A9A9A9" colors["darkgreen"]="#006400" colors["darkkhaki"]="#BDB76B" colors["darkmagenta"]="#8B008B" colors["darkolivegreen"]="#556B2F" colors["darkorange"]="#FF8C00" colors["darkorchid"]="#9932CC" colors["darkred"]="#8B0000" colors["darksalmon"]="#E9967A" colors["darkseagreen"]="#8FBC8F" colors["darkslateblue"]="#483D8B" colors["darkslategray"]="#2F4F4F" colors["darkturquoise"]="#00CED1" colors["darkviolet"]="#9400D3" colors["deeppink"]="#FF1493" colors["deepskyblue"]="#00BFFF" colors["dimgray"]="#696969" colors["dodgerblue"]="#1E90FF" colors["firebrick"]="#B22222" colors["floralwhite"]="#FFFAF0" colors["forestgreen"]="#228B22" colors["fuchsia"]="#FF00FF" colors["gainsboro"]="#DCDCDC" colors["ghostwhite"]="#F8F8FF" colors["gold"]="#FFD700" colors["goldenrod"]="#DAA520" colors["gray"]="#808080" colors["green"]="#008000" colors["greenyellow"]="#ADFF2F" colors["honeydew"]="#F0FFF0" colors["hotpink"]="#FF69B4" colors["indianred"]="#CD5C5C" colors["indigo"]="#4B0082" colors["ivory"]="#FFFFF0" colors["khaki"]="#F0E68C" colors["lavender"]="#E6E6FA" colors["lavenderblush"]="#FFF0F5" colors["lawngreen"]="#7CFC00" colors["lemonchiffon"]="#FFFACD" colors["lightblue"]="#ADD8E6" colors["lightcoral"]="#F08080" colors["lightcyan"]="#E0FFFF" colors["lightgoldenrodyellow"]="#FAFAD2" colors["lightgray"]="#D3D3D3" colors["lightgreen"]="#90EE90" colors["lightpink"]="#FFB6C1" colors["lightsalmon"]="#FFA07A" colors["lightseagreen"]="#20B2AA" colors["lightskyblue"]="#87CEFA" colors["lightslategray"]="#778899" colors["lightsteelblue"]="#B0C4DE" colors["lightyellow"]="#FFFFE0" colors["lime"]="#00FF00" colors["limegreen"]="#32CD32" colors["linen"]="#FAF0E6" colors["magenta"]="#FF00FF" colors["maroon"]="#800000" colors["mediumaquamarine"]="#66CDAA" colors["mediumblue"]="#0000CD" colors["mediumorchid"]="#BA55D3" colors["mediumpurple"]="#9370DB" colors["mediumseagreen"]="#3CB371" colors["mediumslateblue"]="#7B68EE" colors["mediumspringgreen"]="#00FA9A" colors["mediumturquoise"]="#48D1CC" colors["mediumvioletred"]="#C71585" colors["midnightblue"]="#191970" colors["mintcream"]="#F5FFFA" colors["mistyrose"]="#FFE4E1" colors["moccasin"]="#FFE4B5" colors["navajowhite"]="#FFDEAD" colors["navy"]="#000080" colors["oldlace"]="#FDF5E6" colors["olive"]="#808000" colors["olivedrab"]="#6B8E23" colors["orange"]="#FFA500" colors["orangered"]="#FF4500" colors["orchid"]="#DA70D6" colors["palegoldenrod"]="#EEE8AA" colors["palegreen"]="#98FB98" colors["paleturquoise"]="#AFEEEE" colors["palevioletred"]="#DB7093" colors["papayawhip"]="#FFEFD5" colors["peachpuff"]="#FFDAB9" colors["peru"]="#CD853F" colors["pink"]="#FFC0CB" colors["plum"]="#DDA0DD" colors["powderblue"]="#B0E0E6" colors["purple"]="#800080" colors["red"]="#FF0000" colors["rosybrown"]="#BC8F8F" colors["royalblue"]="#4169E1" colors["saddlebrown"]="#8B4513" colors["salmon"]="#FA8072" colors["sandybrown"]="#F4A460" colors["seagreen"]="#2E8B57" colors["seashell"]="#FFF5EE" colors["sienna"]="#A0522D" colors["silver"]="#C0C0C0" colors["skyblue"]="#87CEEB" colors["slateblue"]="#6A5ACD" colors["slategray"]="#708090" colors["snow"]="#FFFAFA" colors["springgreen"]="#00FF7F" colors["steelblue"]="#4682B4" colors["tan"]="#D2B48C" colors["teal"]="#008080" colors["thistle"]="#D8BFD8" colors["tomato"]="#FF6347" colors["turquoise"]="#40E0D0" colors["violet"]="#EE82EE" colors["wheat"]="#F5DEB3" colors["white"]="#FFFFFF" colors["whitesmoke"]="#F5F5F5" colors["yellow"]="#FFFF00" colors["yellowgreen"]="#9ACD32" EndSub Sub Math_Hex2Dec ' Math | Convert hexadecimal to decimal ' param hex ' return dec dec = 0 len = Text.GetLength(hex) For ptr = 1 To len dec = dec * 16 + Text.GetIndexOf("123456789ABCDEF", Text.GetSubText(hex, ptr, 1)) EndFor EndSub End>GRT732-0.sb< Start>GRT732-1.sb< ' Bowling Anime ' Version 0.3 ' Copyright © 2017 Nonki Takahashi. The MIT License. ' Last update 2017-03-08 ' Program ID GRT732-1 GraphicsWindow.Title = "Bowling Anime 0.3 - Hit arrow keys." Init() path = "http://www.nonkit.com/smallbasic.files/Ball.png" GraphicsWindow.KeyDown = OnKeyDown While "True" x = gw / 2 y = gh + 120 a = 120 DrawBall() positioning = "True" While positioning If keyDown Then If GraphicsWindow.LastKey = "Up" Then positioning = "False" ElseIf GraphicsWindow.LastKey = "Left" Then If 0 <= x - 10 Then x = x - 10 DrawBall() EndIf ElseIf GraphicsWindow.LastKey = "Right" Then If x + 10 <= gw Then x = x + 10 DrawBall() EndIf EndIf keyDown = "False" EndIf EndWhile x0 = x For y = gh - 1 To 212 Step -1 x = (gw / 2) * (1 - y / gh) + x0 * y / gh a = a - 2 DrawBall() Program.Delay(10) EndFor For i = 1 To 10 If Math.Remainder(Math.GetRandomNumber(2), 2) = 0 Then fell[i] = "True" Else fell[i] = "False" EndIf y0[i] = Shapes.GetTop(pin[i]) x0[i] = Shapes.GetLeft(pin[i]) x[i] = x0[i] y[i] = y0[i] a[i] = 0 EndFor For t = 0 To 1000 Step 20 For i = 1 To 10 If fell[i] Then x[i] = x[i] + dx[i] y[i] = y[i] - 5 a[i] = a[i] + da[i] Shapes.Move(pin[i], x[i], y[i]) Shapes.Rotate(pin[i], a[i]) EndIf EndFor Shapes.HideShape(pin[i]) Program.Delay(20) EndFor For i = 1 To 10 If fell[i] Then Shapes.ShowShape(pin[i]) Shapes.Move(pin[i], x0[i], y0[i]) Shapes.Rotate(pin[i], 0) EndIf EndFor EndWhile Sub DrawBall scale = y / 212 If shadow = "" Then GraphicsWindow.BrushColor = "Black" shadow = Shapes.AddEllipse(78, 20) Shapes.SetOpacity(shadow, 50) EndIf Shapes.Move(shadow, x - 39, y - 10) Shapes.Zoom(shadow, scale, scale) If ball = "" Then ball = Shapes.AddImage(path) EndIf Shapes.Move(ball, x - 39, y - 33 * scale - 39) Shapes.Zoom(ball, scale, scale) Shapes.Rotate(ball, a) EndSub Sub Init gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh da = "1=-10;2=-8;3=8;4=-6;5=-6;6=6;7=-4;8=-4;9=4;10=4;" dx = "1=-3;2=-4;3=4;4=-5;5=-3;6=5;7=-5;8=-4;9=4;10=5;" GraphicsWindow.BackgroundColor = "LightGray" ' draw gutter GraphicsWindow.BrushColor = "SaddleBrown" color = GraphicsWindow.BrushColor rate = 0.5 Color_Blacken() GraphicsWindow.BrushColor = color GraphicsWindow.FillTriangle(gw / 2, 0, -70, gh, gw + 70, gh) ' draw lane GraphicsWindow.BrushColor = "SaddleBrown" GraphicsWindow.FillTriangle(gw / 2, 0, 0, gh, gw, gh) GraphicsWindow.BrushColor = "LightGray" GraphicsWindow.FillRectangle(0, 0, gw, 140) GraphicsWindow.BrushColor = "Black" path = "http://www.nonkit.com/smallbasic.files/Pin.png" i = 6 d = 3 For row = 4 To 1 Step -1 y = 100 - row * 10 For col = 1 To row i = i + 1 pin[i] = Shapes.AddImage(path) x = 249 + col * 60 - row * 30 Shapes.Move(pin[i], x, y) EndFor i = i - row - d d = d - 1 shadow = Shapes.AddRectangle(366, 160) Shapes.SetOpacity(shadow, 15) Shapes.Move(shadow, 116, 52) EndFor shadow = "" ' draw wall GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "GreenYellow" wall = Shapes.AddRectangle(gw, 52) Shapes.Move(wall, 0, 0) wall = Shapes.AddRectangle(116,160) Shapes.Move(wall, 0, 52) wall = Shapes.AddRectangle(149, 160) Shapes.Move(wall, gw - 116, 52) EndSub Sub OnKeyDown keyDown = "True" EndSub Sub Color_Blacken ' Color | Blacken given color ' param color - given color ' param rate - 0..1 ' return color - color blackened Color_NameToColor() Color_ColorToRGB() r = Math.Floor(r * (1 - rate)) g = Math.Floor(g * (1 - rate)) b = Math.Floor(b * (1 - rate)) color = GraphicsWindow.GetColorFromRGB(r, g, b) EndSub Sub Color_ColorToRGB ' Color | Convert color to RGB values ' param color - "#rrggbb" (hexadecimal values) ' return r, g, b - RGB values 0..255 sR = Text.GetSubText(color, 2, 2) sG = Text.GetSubText(color, 4, 2) sB = Text.GetSubText(color, 6, 2) hex = sR Math_Hex2Dec() r = dec hex = sG Math_Hex2Dec() g = dec hex = sB Math_Hex2Dec() b = dec EndSub Sub Color_NameToColor ' Color | Convert color name to color ' param color - color name ' returns color -"#rrggbb" If Text.StartsWith(color, "#") Then color = Text.ConvertToUpperCase(color) Else color = Text.ConvertToLowerCase(color) color = colors[color] EndIf EndSub Sub Colors_Init colors["aliceblue"]="#F0F8FF" colors["antiquewhite"]="#FAEBD7" colors["aqua"]="#00FFFF" colors["aquamarine"]="#7FFFD4" colors["azure"]="#F0FFFF" colors["beige"]="#F5F5DC" colors["bisque"]="#FFE4C4" colors["black"]="#000000" colors["blanchedalmond"]="#FFEBCD" colors["blue"]="#0000FF" colors["blueviolet"]="#8A2BE2" colors["brown"]="#A52A2A" colors["burlywood"]="#DEB887" colors["cadetblue"]="#5F9EA0" colors["chartreuse"]="#7FFF00" colors["chocolate"]="#D2691E" colors["coral"]="#FF7F50" colors["cornflowerblue"]="#6495ED" colors["cornsilk"]="#FFF8DC" colors["crimson"]="#DC143C" colors["cyan"]="#00FFFF" colors["darkblue"]="#00008B" colors["darkcyan"]="#008B8B" colors["darkgoldenrod"]="#B8860B" colors["darkgray"]="#A9A9A9" colors["darkgreen"]="#006400" colors["darkkhaki"]="#BDB76B" colors["darkmagenta"]="#8B008B" colors["darkolivegreen"]="#556B2F" colors["darkorange"]="#FF8C00" colors["darkorchid"]="#9932CC" colors["darkred"]="#8B0000" colors["darksalmon"]="#E9967A" colors["darkseagreen"]="#8FBC8F" colors["darkslateblue"]="#483D8B" colors["darkslategray"]="#2F4F4F" colors["darkturquoise"]="#00CED1" colors["darkviolet"]="#9400D3" colors["deeppink"]="#FF1493" colors["deepskyblue"]="#00BFFF" colors["dimgray"]="#696969" colors["dodgerblue"]="#1E90FF" colors["firebrick"]="#B22222" colors["floralwhite"]="#FFFAF0" colors["forestgreen"]="#228B22" colors["fuchsia"]="#FF00FF" colors["gainsboro"]="#DCDCDC" colors["ghostwhite"]="#F8F8FF" colors["gold"]="#FFD700" colors["goldenrod"]="#DAA520" colors["gray"]="#808080" colors["green"]="#008000" colors["greenyellow"]="#ADFF2F" colors["honeydew"]="#F0FFF0" colors["hotpink"]="#FF69B4" colors["indianred"]="#CD5C5C" colors["indigo"]="#4B0082" colors["ivory"]="#FFFFF0" colors["khaki"]="#F0E68C" colors["lavender"]="#E6E6FA" colors["lavenderblush"]="#FFF0F5" colors["lawngreen"]="#7CFC00" colors["lemonchiffon"]="#FFFACD" colors["lightblue"]="#ADD8E6" colors["lightcoral"]="#F08080" colors["lightcyan"]="#E0FFFF" colors["lightgoldenrodyellow"]="#FAFAD2" colors["lightgray"]="#D3D3D3" colors["lightgreen"]="#90EE90" colors["lightpink"]="#FFB6C1" colors["lightsalmon"]="#FFA07A" colors["lightseagreen"]="#20B2AA" colors["lightskyblue"]="#87CEFA" colors["lightslategray"]="#778899" colors["lightsteelblue"]="#B0C4DE" colors["lightyellow"]="#FFFFE0" colors["lime"]="#00FF00" colors["limegreen"]="#32CD32" colors["linen"]="#FAF0E6" colors["magenta"]="#FF00FF" colors["maroon"]="#800000" colors["mediumaquamarine"]="#66CDAA" colors["mediumblue"]="#0000CD" colors["mediumorchid"]="#BA55D3" colors["mediumpurple"]="#9370DB" colors["mediumseagreen"]="#3CB371" colors["mediumslateblue"]="#7B68EE" colors["mediumspringgreen"]="#00FA9A" colors["mediumturquoise"]="#48D1CC" colors["mediumvioletred"]="#C71585" colors["midnightblue"]="#191970" colors["mintcream"]="#F5FFFA" colors["mistyrose"]="#FFE4E1" colors["moccasin"]="#FFE4B5" colors["navajowhite"]="#FFDEAD" colors["navy"]="#000080" colors["oldlace"]="#FDF5E6" colors["olive"]="#808000" colors["olivedrab"]="#6B8E23" colors["orange"]="#FFA500" colors["orangered"]="#FF4500" colors["orchid"]="#DA70D6" colors["palegoldenrod"]="#EEE8AA" colors["palegreen"]="#98FB98" colors["paleturquoise"]="#AFEEEE" colors["palevioletred"]="#DB7093" colors["papayawhip"]="#FFEFD5" colors["peachpuff"]="#FFDAB9" colors["peru"]="#CD853F" colors["pink"]="#FFC0CB" colors["plum"]="#DDA0DD" colors["powderblue"]="#B0E0E6" colors["purple"]="#800080" colors["red"]="#FF0000" colors["rosybrown"]="#BC8F8F" colors["royalblue"]="#4169E1" colors["saddlebrown"]="#8B4513" colors["salmon"]="#FA8072" colors["sandybrown"]="#F4A460" colors["seagreen"]="#2E8B57" colors["seashell"]="#FFF5EE" colors["sienna"]="#A0522D" colors["silver"]="#C0C0C0" colors["skyblue"]="#87CEEB" colors["slateblue"]="#6A5ACD" colors["slategray"]="#708090" colors["snow"]="#FFFAFA" colors["springgreen"]="#00FF7F" colors["steelblue"]="#4682B4" colors["tan"]="#D2B48C" colors["teal"]="#008080" colors["thistle"]="#D8BFD8" colors["tomato"]="#FF6347" colors["turquoise"]="#40E0D0" colors["violet"]="#EE82EE" colors["wheat"]="#F5DEB3" colors["white"]="#FFFFFF" colors["whitesmoke"]="#F5F5F5" colors["yellow"]="#FFFF00" colors["yellowgreen"]="#9ACD32" EndSub Sub Math_Hex2Dec ' Math | Convert hexadecimal to decimal ' param hex ' return dec dec = 0 len = Text.GetLength(hex) For ptr = 1 To len dec = dec * 16 + Text.GetIndexOf("123456789ABCDEF", Text.GetSubText(hex, ptr, 1)) EndFor EndSub End>GRT732-1.sb< Start>GRT732-2.sb< ' Bowling Game ' Version 0.4a ' Copyright © 2017 Nonki Takahashi. The MIT License. ' Last update 2017-03-10 ' Program ID GRT732-2 GraphicsWindow.Title = "Bowling Game 0.4a - Hit arrow keys." Init() GraphicsWindow.KeyDown = OnKeyDown While "True" InitBall() Position() ' for the first throwing ThrowBall() SelectPins() ' to blow BlowPins() InitBall() Position() ' for the second throwing ThrowBall() SelectPins() ' to blow BlowPins() InitPins() EndWhile Sub BlowPins For t = 0 To 1000 Step delay For i = 1 To 10 If fell[i] Then x[i] = x[i] + dx[i] y[i] = y[i] - 5 a[i] = a[i] + da[i] Shapes.Move(pin[i], x[i], y[i]) Shapes.Rotate(pin[i], a[i]) EndIf EndFor If ye <= yb Then MoveBall() yb = yb - 2 EndIf Program.Delay(delay) EndFor Shapes.HideShape(ball) For i = 1 To 10 If fell[i] Then Shapes.HideShape(pin[i]) EndIf EndFor EndSub Sub DrawBall ' param xb, yb - ball position ' param ab - ball angle scale = yb / 212 If shadow = "" Then GraphicsWindow.BrushColor = "Black" shadow = Shapes.AddEllipse(78, 20) Shapes.SetOpacity(shadow, 50) EndIf Shapes.Move(shadow, xb - 39, yb - 10) Shapes.Zoom(shadow, scale, scale) If ball = "" Then path = "http://www.nonkit.com/smallbasic.files/Ball.png" ball = Shapes.AddImage(path) EndIf Shapes.Move(ball, xb - 39, yb - 33 * scale - 39) Shapes.Zoom(ball, scale, scale) Shapes.Rotate(ball, ab) EndSub Sub Init gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh da = "1=-10;2=-8;3=8;4=-6;5=-6;6=6;7=-4;8=-4;9=4;10=4;" dx = "1=-3;2=-4;3=4;4=-5;5=-3;6=5;7=-5;8=-4;9=4;10=5;" GraphicsWindow.BackgroundColor = "LightGray" ' draw gutter GraphicsWindow.BrushColor = "SaddleBrown" color = GraphicsWindow.BrushColor rate = 0.5 Colors_Init() Color_Blacken() GraphicsWindow.BrushColor = color GraphicsWindow.FillTriangle(gw / 2, 0, -70, gh, gw + 70, gh) ' draw lane ye = 170 GraphicsWindow.BrushColor = "SaddleBrown" GraphicsWindow.FillTriangle(gw / 2, 0, 0, gh, gw, gh) GraphicsWindow.BrushColor = "LightGray" GraphicsWindow.FillRectangle(0, 0, gw, ye) GraphicsWindow.BrushColor = "Black" path = "http://www.nonkit.com/smallbasic.files/Pin.png" i = 6 d = 3 For row = 4 To 1 Step -1 y = 100 - row * 10 For col = 1 To row i = i + 1 pin[i] = Shapes.AddImage(path) x = 249 + col * 60 - row * 30 Shapes.Move(pin[i], x, y) EndFor i = i - row - d d = d - 1 shadow = Shapes.AddRectangle(366, 160) Shapes.SetOpacity(shadow, 15) Shapes.Move(shadow, 116, 52) EndFor shadow = "" ' draw wall GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "GreenYellow" wall = Shapes.AddRectangle(gw, 52) Shapes.Move(wall, 0, 0) wall = Shapes.AddRectangle(116,160) Shapes.Move(wall, 0, 52) wall = Shapes.AddRectangle(149, 160) Shapes.Move(wall, gw - 116, 52) delay = 10 ' [ms] EndSub Sub InitBall xb = gw / 2 ' ball position yb = gh + 120 ab = 120 ' ball angle DrawBall() EndSub Sub InitPins For i = 1 To 10 Shapes.Move(pin[i], x0[i], y0[i]) Shapes.Rotate(pin[i], 0) Shapes.ShowShape(pin[i]) EndFor EndSub Sub MoveBall ' param xs - ball start x position xb = (gw / 2) * (1 - yb / gh) + xs * yb / gh ab = ab - 4 DrawBall() Program.Delay(delay) EndSub Sub OnKeyDown keyDown = "True" EndSub Sub Position Shapes.ShowShape(ball) positioning = "True" While positioning If keyDown Then If GraphicsWindow.LastKey = "Up" Then positioning = "False" ElseIf GraphicsWindow.LastKey = "Left" Then If 0 <= xb - 10 Then xb = xb - 10 DrawBall() EndIf ElseIf GraphicsWindow.LastKey = "Right" Then If xb + 10 <= gw Then xb = xb + 10 DrawBall() EndIf EndIf keyDown = "False" EndIf EndWhile EndSub Sub SelectPins For i = 1 To 10 If Math.Remainder(Math.GetRandomNumber(2), 2) = 0 Then fell[i] = "True" Else fell[i] = "False" EndIf If x0[i] = "" Then x0[i] = Shapes.GetLeft(pin[i]) EndIf If y0[i] = "" Then y0[i] = Shapes.GetTop(pin[i]) EndIf x[i] = x0[i] y[i] = y0[i] a[i] = 0 EndFor EndSub Sub ThrowBall Shapes.ShowShape(shadow) xs = xb For yb = gh - 1 To 208 Step -2 MoveBall() EndFor Shapes.HideShape(shadow) EndSub Sub Color_Blacken ' Color | Blacken given color ' param color - given color ' param rate - 0..1 ' return color - color blackened Color_NameToColor() Color_ColorToRGB() r = Math.Floor(r * (1 - rate)) g = Math.Floor(g * (1 - rate)) b = Math.Floor(b * (1 - rate)) color = GraphicsWindow.GetColorFromRGB(r, g, b) EndSub Sub Color_ColorToRGB ' Color | Convert color to RGB values ' param color - "#rrggbb" (hexadecimal values) ' return r, g, b - RGB values 0..255 sR = Text.GetSubText(color, 2, 2) sG = Text.GetSubText(color, 4, 2) sB = Text.GetSubText(color, 6, 2) hex = sR Math_Hex2Dec() r = dec hex = sG Math_Hex2Dec() g = dec hex = sB Math_Hex2Dec() b = dec EndSub Sub Color_NameToColor ' Color | Convert color name to color ' param color - color name ' return color -"#rrggbb" If Text.StartsWith(color, "#") Then color = Text.ConvertToUpperCase(color) Else color = Text.ConvertToLowerCase(color) color = colors[color] EndIf EndSub Sub Colors_Init ' Colors | Initialize 140 colors array txt = "aliceblue,antiquewhite,aqua,aquamarine," txt = txt + "azure,beige,bisque,black,blanchedalmond," txt = txt + "blue,blueviolet,brown,burlywood," txt = txt + "cadetblue,chartreuse,chocolate,coral," txt = txt + "cornflowerblue,cornsilk,crimson," txt = txt + "cyan,darkblue,darkcyan,darkgoldenrod," txt = txt + "darkgray,darkgreen,darkkhaki," txt = txt + "darkmagenta,darkolivegreen,darkorange," txt = txt + "darkorchid,darkred,darksalmon,darkseagreen," txt = txt + "darkslateblue,darkslategray," txt = txt + "darkturquoise,darkviolet,deeppink," txt = txt + "deepskyblue,dimgray,dodgerblue," txt = txt + "firebrick,floralwhite,forestgreen," txt = txt + "fuchsia,gainsboro,ghostwhite,gold," txt = txt + "goldenrod,gray,green,greenyellow," txt = txt + "honeydew,hotpink,indianred,indigo," txt = txt + "ivory,khaki,lavender,lavenderblush," txt = txt + "lawngreen,lemonchiffon,lightblue," txt = txt + "lightcoral,lightcyan,lightgoldenrodyellow," txt = txt + "lightgray,lightgreen,lightpink," txt = txt + "lightsalmon,lightseagreen,lightskyblue," txt = txt + "lightslategray,lightsteelblue," txt = txt + "lightyellow,lime,limegreen,linen," txt = txt + "magenta,maroon,mediumaquamarine,mediumblue," txt = txt + "mediumorchid,mediumpurple,mediumseagreen," txt = txt + "mediumslateblue,mediumspringgreen," txt = txt + "mediumturquoise,mediumvioletred,midnightblue," txt = txt + "mintcream,mistyrose,moccasin,navajowhite," txt = txt + "navy,oldlace,olive,olivedrab,orange," txt = txt + "orangered,orchid,palegoldenrod,palegreen," txt = txt + "paleturquoise,palevioletred,papayawhip," txt = txt + "peachpuff,peru,pink,plum,powderblue," txt = txt + "purple,red,rosybrown,royalblue,saddlebrown," txt = txt + "salmon,sandybrown,seagreen,seashell," txt = txt + "sienna,silver,skyblue,slateblue,slategray," txt = txt + "snow,springgreen,steelblue," txt = txt + "tan,teal,thistle,tomato,turquoise,violet," txt = txt + "wheat,white,whitesmoke,yellow,yellowgreen" delim = "," Text_Split() saved = GraphicsWindow.PenColor n = Array.GetItemCount(arry) For i = 1 To n GraphicsWindow.PenColor = arry[i] c = GraphicsWindow.PenColor colors[arry[i]] = c EndFor GraphicsWindow.PenColor = saved EndSub Sub Math_Hex2Dec ' Math | Convert hexadecimal to decimal ' param hex ' return dec dec = 0 len = Text.GetLength(hex) For ptr = 1 To len dec = dec * 16 + Text.GetIndexOf("123456789ABCDEF", Text.GetSubText(hex, ptr, 1)) EndFor EndSub Sub Text_Split ' Text | Split text to array by delimiter ' param txt - to split ' param delim - delimiter ' return arry - splitted len = Text.GetLength(txt) p = 1 n = 0 d = Text.GetIndexOf(Text.GetSubTextToEnd(txt, p), delim) While (0 < d) And (p <= len) n = n + 1 arry[n] = Text.GetSubText(txt, p, d - 1) p = p + d d = Text.GetIndexOf(Text.GetSubTextToEnd(txt, p), delim) EndWhile n = n + 1 arry[n] = Text.GetSubTextToEnd(txt, p) EndSub End>GRT732-2.sb< Start>GRT732-3.sb< ' Bowling Game ' Version 0.5b ' Copyright © 2017 Nonki Takahashi. The MIT License. ' Last update 2017-03-12 ' Program ID GRT732-3 title = "Bowling Game 0.5b" GraphicsWindow.Title = title + " - Hit arrow key." Init() Form() GraphicsWindow.KeyDown = OnKeyDown While "True" subtotal = "" For frame = 1 To 10 InitPins() InitBall() Position() ' for the first throwing ThrowBall() SelectPins() ' to blow BlowPins() throw = 1 DrawScore() If Array.ContainsValue(fell, "False") Then InitBall() Position() ' for the second throwing ThrowBall() prevPoint = point SelectPins() ' to blow BlowPins() throw = 2 point = point - prevPoint DrawScore() EndIf If (frame = 10) And (subtotal[iPerson][frame] = 10) Then InitPins() InitBall() Position() ' for the third throwing ThrowBall() SelectPins() ' to blow BlowPins() throw = 3 DrawScore() EndIf If frame = 10 Then DrawTotal() EndIf EndFor DrawTotal() KeyInput() ClearScore() EndWhile Sub BlowPins For t = 0 To 1000 Step delay For i = 1 To 10 If fell[i] Then x[i] = x[i] + dx[i] y[i] = y[i] - 5 a[i] = a[i] + da[i] Shapes.Move(pin[i], x[i], y[i]) Shapes.Rotate(pin[i], a[i]) EndIf EndFor If ye <= yb Then MoveBall() yb = yb - 2 EndIf Program.Delay(delay) EndFor Shapes.HideShape(ball) For i = 1 To 10 If fell[i] Then Shapes.HideShape(pin[i]) EndIf EndFor EndSub Sub ClearScore For i = 1 To nObj Shapes.Remove(obj[i]) EndFor nObj = 0 EndSub Sub DrawBall ' param xb, yb - ball position ' param ab - ball angle scale = yb / 212 If shadow = "" Then GraphicsWindow.BrushColor = "Black" shadow = Shapes.AddEllipse(78, 20) Shapes.SetOpacity(shadow, 50) EndIf Shapes.Move(shadow, xb - 39, yb - 10) Shapes.Zoom(shadow, scale, scale) If ball = "" Then path = "http://www.nonkit.com/smallbasic.files/Ball.png" ball = Shapes.AddImage(path) EndIf Shapes.Move(ball, xb - 39, yb - 33 * scale - 39) Shapes.Zoom(ball, scale, scale) Shapes.Rotate(ball, ab) EndSub Sub DrawPoint ' param x, y - left top of the cursor ' param point - point ' param throw ' param frame ' param prevPoint ' return nObj nObj = nObj + 1 GraphicsWindow.BrushColor = "Black" If 0 < point Then obj[nObj] = Shapes.AddText(point) Else If frame < 10 Then If throw = 1 Then obj[nObj] = Shapes.AddText("G") Else obj[nObj] = Shapes.AddText("-") EndIf Else If (prevPoint = 0) Or (prevPoint = 10) Then obj[nObj] = Shapes.AddText("G") Else obj[nObj] = Shapes.AddText("-") EndIf EndIf EndIf Shapes.Move(obj[nObj], x + 2, y) EndSub Sub DrawScore ' param point - point ' param throw ' param frame ' param prevPoint ' return nObj If frame < 10 Then x = xo + pw + (frame - 1) * fw + (throw - 1) * fw / 2 Else x = xo + pw + (frame - 1) * fw + (throw - 1) * fw / 3 EndIf y = yo + hh + (iPerson - 1) * fh If frame < 10 Then If 10 < point + subtotal[iPerson][frame] Then point = 10 - subtotal[iPerson][frame] EndIf Else If (1 < throw) And (prevPoint < 10) Then If 10 < point + prevPoint Then point = 10 - prevPoint EndIf EndIf EndIf subtotal[iPerson][frame] = subtotal[iPerson][frame] + point If (1 < frame) And (0 < spare[iPerson][frame - 1]) Then subtotal[iPerson][frame - 1] = subtotal[iPerson][frame - 1] + point spare[iPerson][frame - 1] = spare[iPerson][frame - 1] - 1 If spare[iPerson][frame - 1] = 0 Then frame = frame - 1 DrawTotal() frame = frame + 1 EndIf EndIf If (2 < frame) And (0 < spare[iPerson][frame - 2]) Then subtotal[iPerson][frame - 2] = subtotal[iPerson][frame - 2] + point spare[iPerson][frame - 2] = spare[iPerson][frame - 2] - 1 If spare[iPerson][frame - 2] = 0 Then frame = frame - 2 DrawTotal() frame = frame + 2 EndIf EndIf isSpare = "False" If (frame < 10) And (subtotal[iPerson][frame] = 10) Then isSpare = "True" ElseIf (frame = 10) And (point <> 10) And (1 < throw) And (spare[iPerson][frame][throw - 1] = 0) And (prevPoint + point = 10) Then isSpare = "True" EndIf If point = 10 Then ' strike If frame < 10 Then spare[iPerson][frame] = 2 Else spare[iPerson][frame][throw] = 2 EndIf DrawStrike() ElseIf isSpare Then If frame < 10 Then spare[iPerson][frame] = 1 Else spare[iPerson][frame][throw] = 1 EndIf DrawSpare() Else DrawPoint() If throw = 2 And frame < 10 Then DrawTotal() EndIf EndIf EndSub Sub DrawSpare ' param x, y - left top of the cursor If frame < 10 Then sw = fw / 2 Else sw = fw / 3 EndIf GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "Black" nObj = nObj + 1 obj[nObj] = Shapes.AddTriangle(x, y + fh / 2, x + sw, y, x + sw, y + fh / 2) EndSub Sub DrawStrike ' param x, y - left top of the cursor If frame < 10 Then dx = fw / 2 sw = fw / 2 Else dx = 0 sw = fw / 3 EndIf GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "Black" nObj = nObj + 1 obj[nObj] = Shapes.AddTriangle(x + dx, y, x + dx, y + fh / 2, x + dx + sw / 2, y + fh / 4) nObj = nObj + 1 obj[nObj] = Shapes.AddTriangle(x + dx + sw / 2, y + fh / 4, x + dx + sw, y, x + dx + sw, y + fh / 2) EndSub Sub DrawTotal ' param frame ' param iPerson GraphicsWindow.BrushColor = "Black" _x = xo + pw + (frame - 1) * fw _y = yo + hh + (iPerson - 0.5) * fh total = 0 For _i = 1 To frame total = total + subtotal[iPerson][_i] EndFor nObj = nObj + 1 obj[nObj] = Shapes.AddText(total) Shapes.Move(obj[nObj], _x + 2, _y) If frame = 10 Then _x = xo + pw + frame * fw _y = yo + hh + (iPerson - 1) * fh nObj = nObj + 1 obj[nObj] = Shapes.AddText(total) Shapes.Move(obj[nObj], _x + 2, _y) EndIf EndSub Sub Form GraphicsWindow.PenWidth = 2 GraphicsWindow.PenColor = "GreenYellow" maxPerson = 1 hh = 22 pw = 100 fw = 44 fh = 44 bh = 26 xo = (gw - pw - fw * 11) / 2 yo = 8 GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "White" rect = Shapes.AddRectangle(pw - 2, hh - 2) Shapes.Move(rect, xo + 1, yo + 1) GraphicsWindow.BrushColor = "Black" txt = Shapes.AddText("NAME") Shapes.Move(txt, xo + 2, yo) For iFrame = 1 To 11 x = xo + pw + (iFrame - 1) * fw GraphicsWindow.BrushColor = "White" rect = Shapes.AddRectangle(fw - 2, hh - 2) Shapes.Move(rect, x + 1, yo + 1) GraphicsWindow.BrushColor = "Black" If iFrame = 11 Then txt = Shapes.AddText("TOTAL") Else txt = Shapes.AddText(iFrame) EndIf Shapes.Move(txt, x + 2, yo) EndFor For iPerson = 1 To maxPerson y = yo + hh + (iPerson - 1) * fh GraphicsWindow.BrushColor = "White" rect = Shapes.AddRectangle(pw - 2, fh - 2) Shapes.Move(rect, xo + 1, y + 1) GraphicsWindow.BrushColor = "Black" txt = Shapes.AddText("PLAYER") Shapes.Move(txt, xo + 2, y) For iFrame = 1 To 11 x = xo + pw + (iFrame - 1) * fw GraphicsWindow.BrushColor = "White" rect = Shapes.AddRectangle(fw - 2, fh - 2) Shapes.Move(rect, x + 1, y + 1) GraphicsWindow.PenWidth = 2 GraphicsWindow.BrushColor = "Transparent" If iFrame < 10 Then rect = Shapes.AddRectangle(fw / 2, fh / 2) Shapes.Move(rect, x + fw / 2, y) spare[iPerson][iFrame] = 0 ElseIf iFrame = 10 Then rect = Shapes.AddRectangle(fw / 3, fh / 2) Shapes.Move(rect, x, y) rect = Shapes.AddRectangle(fw / 3, fh / 2) Shapes.Move(rect, x + fw / 3, y) rect = Shapes.AddRectangle(fw / 3, fh / 2) Shapes.Move(rect, x + fw * 2 / 3, y) spare[iPerson][iFrame][1] = 0 spare[iPerson][iFrame][2] = 0 spare[iPerson][iFrame][3] = 0 EndIf GraphicsWindow.PenWidth = 0 EndFor EndFor y = yo + hh + maxPerson * fh + 4 iPerson = 1 EndSub Sub Init Not = "False=True;True=False;" gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh range = "1=7;2=47;3=2478;4=12458;5=123589;6=13569;7=369A;8=6A;9=A;" beyond = "1=23;2=45;3=56;4=78;5=89;6=9A;" da = "1=-10;2=-8;3=8;4=-6;5=-6;6=6;7=-4;8=-4;9=4;10=4;" dx = "1=-3;2=-4;3=4;4=-5;5=-3;6=5;7=-5;8=-4;9=4;10=5;" GraphicsWindow.BackgroundColor = "LightGray" ' draw gutter GraphicsWindow.BrushColor = "SaddleBrown" color = GraphicsWindow.BrushColor rate = 0.5 Colors_Init() Color_Blacken() GraphicsWindow.BrushColor = color GraphicsWindow.FillTriangle(gw / 2, 60, -70, gh, gw + 70, gh) ' draw lane ye = 200 GraphicsWindow.BrushColor = "SaddleBrown" GraphicsWindow.FillTriangle(gw / 2, 60, 0, gh, gw, gh) GraphicsWindow.BrushColor = "LightGray" GraphicsWindow.FillRectangle(0, 0, gw, ye) GraphicsWindow.BrushColor = "Black" path = "http://www.nonkit.com/smallbasic.files/Pin.png" i = 6 d = 3 For row = 4 To 1 Step -1 y = 130 - row * 10 For col = 1 To row i = i + 1 pin[i] = Shapes.AddImage(path) x = 249 + col * 60 - row * 30 Shapes.Move(pin[i], x, y) x0[i] = x y0[i] = y EndFor i = i - row - d d = d - 1 shadow = Shapes.AddRectangle(366, 160) Shapes.SetOpacity(shadow, 15) Shapes.Move(shadow, 116, 82) EndFor shadow = "" ' draw wall GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "GreenYellow" wall = Shapes.AddRectangle(gw, 82) Shapes.Move(wall, 0, 0) wall = Shapes.AddRectangle(116,160) Shapes.Move(wall, 0, 82) wall = Shapes.AddRectangle(149, 160) Shapes.Move(wall, gw - 116, 82) delay = 10 ' [ms] EndSub Sub InitBall xb = gw / 2 ' ball position yb = gh + 120 ab = 120 ' ball angle DrawBall() EndSub Sub InitPins For i = 1 To 10 Shapes.Move(pin[i], x0[i], y0[i]) Shapes.Rotate(pin[i], 0) Shapes.ShowShape(pin[i]) fell[i] = "False" EndFor EndSub Sub KeyInput GraphicsWindow.Title = title + " - Hit any key." While Not[keyDown] Program.Delay(500) EndWhile keyDown = "False" GraphicsWindow.Title = title + " - Hit arrow key." EndSub Sub MoveBall ' param xs - ball start x position xb = (gw / 2) * (1 - yb / gh) + xs * yb / gh ab = ab - 4 DrawBall() Program.Delay(delay) EndSub Sub OnKeyDown keyDown = "True" EndSub Sub Position Shapes.ShowShape(ball) positioning = "True" While positioning If keyDown Then If GraphicsWindow.LastKey = "Up" Then positioning = "False" ElseIf GraphicsWindow.LastKey = "Left" Then If 0 <= xb - 10 Then xb = xb - 10 DrawBall() EndIf ElseIf GraphicsWindow.LastKey = "Right" Then If xb + 10 <= gw Then xb = xb + 10 DrawBall() EndIf EndIf keyDown = "False" EndIf EndWhile EndSub Sub SelectPins ' param xb - ball position ' return point point = 0 r = Math.Floor(xb / (gw / 9)) + 1 For i = 1 To 10 c = i If c = 10 Then c = "A" EndIf If Text.IsSubText(range[r], c) Then fell[i] = "True" n = i While n <> "" l = Text.GetLength(beyond[n]) If 0 < l Then n = Text.GetSubText(beyond[n], Math.GetRandomNumber(l), 1) If n = "A" Then n = 10 EndIf fell[n] = "True" Else n = "" EndIf EndWhile EndIf If fell[i] Then point = point + 1 EndIf x[i] = x0[i] y[i] = y0[i] a[i] = 0 EndFor EndSub Sub ThrowBall Shapes.ShowShape(shadow) xs = xb For yb = gh - 1 To 208 Step -2 MoveBall() EndFor Shapes.HideShape(shadow) EndSub Sub Color_Blacken ' Color | Blacken given color ' param color - given color ' param rate - 0..1 ' return color - color blackened Color_NameToColor() Color_ColorToRGB() r = Math.Floor(r * (1 - rate)) g = Math.Floor(g * (1 - rate)) b = Math.Floor(b * (1 - rate)) color = GraphicsWindow.GetColorFromRGB(r, g, b) EndSub Sub Color_ColorToRGB ' Color | Convert color to RGB values ' param color - "#rrggbb" (hexadecimal values) ' return r, g, b - RGB values 0..255 sR = Text.GetSubText(color, 2, 2) sG = Text.GetSubText(color, 4, 2) sB = Text.GetSubText(color, 6, 2) hex = sR Math_Hex2Dec() r = dec hex = sG Math_Hex2Dec() g = dec hex = sB Math_Hex2Dec() b = dec EndSub Sub Color_NameToColor ' Color | Convert color name to color ' param color - color name ' return color -"#rrggbb" If Text.StartsWith(color, "#") Then color = Text.ConvertToUpperCase(color) Else color = Text.ConvertToLowerCase(color) color = colors[color] EndIf EndSub Sub Colors_Init ' Colors | Initialize 140 colors array txt = "aliceblue,antiquewhite,aqua,aquamarine," txt = txt + "azure,beige,bisque,black,blanchedalmond," txt = txt + "blue,blueviolet,brown,burlywood," txt = txt + "cadetblue,chartreuse,chocolate,coral," txt = txt + "cornflowerblue,cornsilk,crimson," txt = txt + "cyan,darkblue,darkcyan,darkgoldenrod," txt = txt + "darkgray,darkgreen,darkkhaki," txt = txt + "darkmagenta,darkolivegreen,darkorange," txt = txt + "darkorchid,darkred,darksalmon,darkseagreen," txt = txt + "darkslateblue,darkslategray," txt = txt + "darkturquoise,darkviolet,deeppink," txt = txt + "deepskyblue,dimgray,dodgerblue," txt = txt + "firebrick,floralwhite,forestgreen," txt = txt + "fuchsia,gainsboro,ghostwhite,gold," txt = txt + "goldenrod,gray,green,greenyellow," txt = txt + "honeydew,hotpink,indianred,indigo," txt = txt + "ivory,khaki,lavender,lavenderblush," txt = txt + "lawngreen,lemonchiffon,lightblue," txt = txt + "lightcoral,lightcyan,lightgoldenrodyellow," txt = txt + "lightgray,lightgreen,lightpink," txt = txt + "lightsalmon,lightseagreen,lightskyblue," txt = txt + "lightslategray,lightsteelblue," txt = txt + "lightyellow,lime,limegreen,linen," txt = txt + "magenta,maroon,mediumaquamarine,mediumblue," txt = txt + "mediumorchid,mediumpurple,mediumseagreen," txt = txt + "mediumslateblue,mediumspringgreen," txt = txt + "mediumturquoise,mediumvioletred,midnightblue," txt = txt + "mintcream,mistyrose,moccasin,navajowhite," txt = txt + "navy,oldlace,olive,olivedrab,orange," txt = txt + "orangered,orchid,palegoldenrod,palegreen," txt = txt + "paleturquoise,palevioletred,papayawhip," txt = txt + "peachpuff,peru,pink,plum,powderblue," txt = txt + "purple,red,rosybrown,royalblue,saddlebrown," txt = txt + "salmon,sandybrown,seagreen,seashell," txt = txt + "sienna,silver,skyblue,slateblue,slategray," txt = txt + "snow,springgreen,steelblue," txt = txt + "tan,teal,thistle,tomato,turquoise,violet," txt = txt + "wheat,white,whitesmoke,yellow,yellowgreen" delim = "," Text_Split() saved = GraphicsWindow.PenColor n = Array.GetItemCount(arry) For i = 1 To n GraphicsWindow.PenColor = arry[i] c = GraphicsWindow.PenColor colors[arry[i]] = c EndFor GraphicsWindow.PenColor = saved EndSub Sub Math_Hex2Dec ' Math | Convert hexadecimal to decimal ' param hex ' return dec dec = 0 len = Text.GetLength(hex) For ptr = 1 To len dec = dec * 16 + Text.GetIndexOf("123456789ABCDEF", Text.GetSubText(hex, ptr, 1)) EndFor EndSub Sub Text_Split ' Text | Split text to array by delimiter ' param txt - to split ' param delim - delimiter ' return arry - splitted len = Text.GetLength(txt) p = 1 n = 0 d = Text.GetIndexOf(Text.GetSubTextToEnd(txt, p), delim) While (0 < d) And (p <= len) n = n + 1 arry[n] = Text.GetSubText(txt, p, d - 1) p = p + d d = Text.GetIndexOf(Text.GetSubTextToEnd(txt, p), delim) EndWhile n = n + 1 arry[n] = Text.GetSubTextToEnd(txt, p) EndSub End>GRT732-3.sb< Start>GRT732.sb< ' Bowling Graphics ' Copyright © 2017 Nonki Takahashi. The MIT License. GraphicsWindow.Title = "Bowling Graphics" Init() Sub Init gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BackgroundColor = "LightGray" GraphicsWindow.BrushColor = "SaddleBrown" GraphicsWindow.FillTriangle(gw / 2, 0, 0, gh, gw, gh) GraphicsWindow.BrushColor = "LightGray" GraphicsWindow.FillRectangle(0, 0, gw, 140) GraphicsWindow.BrushColor = "GreenYellow" GraphicsWindow.FillRectangle(0, 0, gw, 52) GraphicsWindow.FillRectangle(0, 52, 149, 160) GraphicsWindow.FillRectangle(gw - 149, 52, 149, 160) path = "http://www.nonkit.com/smallbasic.files/Pin.png" i = 0 GraphicsWindow.BrushColor = "Black" For row = 4 To 1 Step -1 y = 100 - row * 10 For col = 1 To row i = i + 1 pin[i] = Shapes.AddImage(path) x = 249 + col * 60 - row * 30 Shapes.Move(pin[i], x, y) EndFor shadow = Shapes.AddRectangle(300, 160) Shapes.SetOpacity(shadow, 10) Shapes.Move(shadow, 149, 52) EndFor EndSub End>GRT732.sb< Start>GRX244.sb< GraphicsWindow.KeyDown = KeyDownEvent KeyDownEvent = 0 'arry t with sound tracks t[1] = "C:\Users\Public\Music\ALLE TITEL\Queen - We will rock you.mp3" t[2] = "C:\Users\Public\Music\ALLE TITEL\Pink Floyd - Another Brick In The Wall.mp3" t[3] ="C:\Users\Public\Music\ALLE TITEL\Slade - Far, Far Away.mp3" 'array tl with title length tl[1] = 120000 tl[2] = 120000 tl[3] = 120000 Index = 0 playing = 0 PauseStatus = 0 IC = Array.GetItemCount(t) DoLoop() Program.End() '****************************************************************************** '*** SUBROUTINES *** '****************************************************************************** Sub DoLoop While (IC >= Index) If (playing = 0) Then PlaySong() EndIf Program.Delay(100) If (PauseStatus = 1) Then Sound.Pause(t[Index]) Else Sound.Play(t[Index]) EndIf playTime = (Clock.ElapsedMilliseconds-start) If (playTime >= tl[Index]) Then playing = 0 EndIf If (KeyDownEvent = 1) Then LK = GraphicsWindow.LastKey KeyDownEvent = 0 EndIf If LK = "P" Then PauseStatus = PauseStatus + 1 If PauseStatus = 1 Then timePlayed = Clock.ElapsedMilliseconds-start start = Clock.ElapsedMilliseconds-timePlayed PauseStatus = 1 Else PauseStatus = 0 EndIf ElseIf LK = "N" Then playing = 0 EndIf LK = "" bc = GraphicsWindow.BackgroundColor GraphicsWindow.BrushColor = bc GraphicsWindow.FillRectangle(0,0,400,120) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(0,0,t[index]) GraphicsWindow.DrawText(0,20,tl[Index]) GraphicsWindow.DrawText(0,40,playTime) GraphicsWindow.DrawText(0,60,LK) GraphicsWindow.DrawText(0,80,playing) GraphicsWindow.DrawText(0,100,PauseStatus) EndWhile EndSub 'DoLoop Sub PlaySong Sound.Stop(t[Index]) Index = Index + 1 If (Index > IC) then Index = 1 Endif If (PauseStatus = 0) then PlayLength = tl[Index] playing = 1 start = Clock.ElapsedMilliseconds Sound.Play(t[Index]) EndIf EndSub 'PlaySong Sub KeyDownEvent KeyDownEvent = 1 'Status set that key is pressing EndSub 'KeyDownEvent End>GRX244.sb< Start>GSD620.sb< ' mahreen miangul JuLy 2017 ' HalloWeen Blinking ' Moon Opcity Zoom ' Stars Blinkig Shoot GraphicsWindow.Left = 0.1 * (Desktop.Width - GraphicsWindow.Width) GraphicsWindow.Top = 0 * (Desktop.Height - GraphicsWindow.Height) GraphicsWindow.Title = "mahreen miangul" GraphicsWindow.BackgroundColor="navy" GraphicsWindow.Width = "1080" GraphicsWindow.Height = "420" ' HalloWeen MakeImage() ' TEXT CRLF= Text.GetCharacter(13)+Text.GetCharacter(10) '<------------- line feed GraphicsWindow.brushColor = "snow" GraphicsWindow.FontSize = 33 msg=Shapes.AddText("H E L L O!"+CRLF+"from"+CRLF+"mahreen "+CRLF+"miangul!") '<------------- Shapes.Move(msg,40,240) '<------------- ' MOON GraphicsWindow.BrushColor = "yellow" GraphicsWindow.PenWidth=0 '<------------- moon= Shapes.AddEllipse(20,20) '<------------- Shapes.Move(moon,50,50) '<------------- GraphicsWindow.BrushColor = "midnightblue" shadow= Shapes.AddEllipse(20,20) '<------------- Shapes.Move(shadow,60,45) '<------------- ' STARS GraphicsWindow.BrushColor = "yellow" For i = 0 To 80 GraphicsWindow.FontSize = 5+ Math.GetRandomNumber(30) x = Math.GetRandomNumber(GraphicsWindow.Width) y = Math.GetRandomNumber(GraphicsWindow.height/2.6) star[i]=Shapes.AddText("★") '<------------- Shapes.Move(star[i],x,y) '<------------- Program.Delay(10) EndFor ' HalloWeen Sub MakeImage scale = 1.4 x0 = 420 * scale y0 = 240 * scale GraphicsWindow.PenWidth = 0 ' Base Point GraphicsWindow.BrushColor = "darkslategray" oBody = Shapes.AddEllipse(88 * scale, 22 * scale) Shapes.Move(oBody, x0 - 24 * scale, y0 + 40 * scale) ' Body GraphicsWindow.BrushColor = "#D76E18" GraphicsWindow.PenColor = "Darkslategray" oFace1 = Shapes.AddEllipse(22 * scale, 60 * scale) Shapes.Move(oFace1, x0 - 35 + scale, y0 - 20) 'GraphicsWindow.PenWidth = 0 oFace2 = Shapes.AddEllipse(28 * scale, 65 * scale) Shapes.Move(oFace2, x0 - 60 + 44, y0 - 25) Shapes.Rotate(oFace2, 0) oFace3 = Shapes.AddEllipse(37 * scale, 65 * scale) Shapes.Move(oFace3, x0 - 30 + 33, y0 - 25) Shapes.Rotate(oFace3, 0) oFace4 = Shapes.AddEllipse(28 * scale, 65 * scale) Shapes.Move(oFace4, x0 + -40 + 77, y0 - 25) Shapes.Rotate(oFace4, 0) oFace5 = Shapes.AddEllipse(22 * scale, 60 * scale) Shapes.Move(oFace5, x0 + 60 + scale, y0 - 20) ' Eyes GraphicsWindow.BrushColor = "darkslategray" GraphicsWindow.PenColor = "red"'"DimGray" GraphicsWindow.PenWidth = 2 oEyeLeft = Shapes.AddEllipse(22 * scale, 12 * scale) Shapes.Move(oEyeLeft, x0 - 10 * scale, y0 + 5 * scale) Shapes.Rotate(oEyeLeft, -80) oEyeRight = Shapes.AddEllipse(22 * scale, 12 * scale) Shapes.Move(oEyeRight, x0 + 33 * scale, y0 + 5 * scale) Shapes.Rotate(oEyeRight, 80) GraphicsWindow.PenWidth = 2 GraphicsWindow.BrushColor = "snow" GraphicsWindow.PenColor = "red"'"DimGray" GraphicsWindow.PenWidth = 2 oEyeLeft2 = Shapes.AddEllipse(8 * scale, 14 * scale) Shapes.Move(oEyeLeft2, x0 - 5 * scale, y0 + 1 * scale) Shapes.Rotate(oEyeLeft2, 20) oEyeRight2 = Shapes.AddEllipse(8 * scale, 14 * scale) Shapes.Move(oEyeRight2, x0 + 37 * scale, y0 + 1 * scale) Shapes.Rotate(oEyeright2, -5) ' Mouth GraphicsWindow.PenColor = "darkslategray" GraphicsWindow.PenWidth = 2 oMouthLeft = Shapes.AddLine(-5, 6 * scale, 6 * scale, 3) Shapes.Move(oMouthLeft, x0 + 14 * scale, y0 + 31.5 * scale) Shapes.Rotate(oMouthLeft, -8) oMouthRight = Shapes.AddLine(0, 0, 10 * scale, 0.5 * scale) Shapes.Move(oMouthRight, x0 + 22.5 * scale, y0 + 28.5 * scale + 9) Shapes.Rotate(oMouthRight, 20) oMouth = Shapes.AddLine(-11, -3, 3 * scale, 1.2 * scale) Shapes.Move(oMouth, x0 + 24 * scale, y0 + 38.5 * scale) Shapes.Rotate(oMouth, -22) oELLeft = Shapes.AddLine(-10, -18.5 * scale, 15 * scale, -10) Shapes.Move(oELLeft, x0 + 2 * scale, y0 + 2.7 * scale) Shapes.Rotate(oELLeft, -45)'------------------------Eye Lash oELRight = Shapes.AddLine(30, 0, 0 * scale, 4 * scale) Shapes.Move(oELRight, x0 + 36 * scale, y0 - 5 * scale) Shapes.Rotate(oELright, 30) ' Nosy GraphicsWindow.BrushColor = "darkslategray" GraphicsWindow.penColor = "firebrick" GraphicsWindow.penwidth = 2 oNose = Shapes.Addrectangle( 12 * scale, 10 * scale) Shapes.Move(oNose, x0 + 16 * scale, y0 + 11 * scale) oNose2 = Shapes.Addrectangle( 3 * scale, 14 * scale) Shapes.Move(oNose2, x0 + 20 * scale, y0 + 20 * scale) ' mahreen miangul GraphicsWindow.BrushColor = "green" '"#2D5C32" GraphicsWindow.penColor = "darkslategray" GraphicsWindow.penwidth = 2 oRect = Shapes.Addrectangle( 5 * scale, 16 * scale) Shapes.Move(oRect, 300 * scale, 393 * scale) Shapes.Rotate(oRect, 15) o1tri = Shapes.Addtriangle( 290, 210, 300, 205, 305, 210) Shapes.Move(o1tri, 145, 330) Shapes.Rotate(o1tri, 14) o2tri = Shapes.Addtriangle( 305, 200, 304, 208, 310, 200) Shapes.Move(o2tri, 140, 338) Shapes.Rotate(o2tri, 15) o3tri = Shapes.Addtriangle( 290, 200, 305, 203, 290, 205) Shapes.Move(o3tri, 164, 340) Shapes.Rotate(o3tri, 14) o4tri = Shapes.Addtriangle( 310, 210, 325, 210, 310, 215) Shapes.Move(o4tri, 225, 290) Shapes.Rotate(o4tri, 44) endsub zm=1 ' Blink start While "True" Program.Delay(2900) Shapes.HideShape(oEyeLeft2) Shapes.HideShape(oEyeRight2) Program.Delay(100) Shapes.ShowShape(oEyeLeft2) Shapes.ShowShape(oEyeRight2) EndWhile ' star blinking program While zm<6 NMB= Math.GetRandomNumber(80) ' blinking star number _op=Shapes.GetOpacity(star[NMB]) ' opacity ... brightness If _op>50 Then Shapes.SetOpacity(star[NMB],Math.GetRandomNumber(49)) ' darker Else Shapes.SetOpacity(star[NMB],50+Math.GetRandomNumber(50)) ' brighter EndIf If NMB=50 Then Shapes.Move(star[0],400+Math.GetRandomNumber(700),-200) Shapes.Animate(star[0],Math.GetRandomNumber(500),2200,2000) 'shooting star Program.Delay(30) zm=zm+0.1 Shapes.Zoom(moon,zm,zm) ' moon becomes bigger Shapes.Zoom(shadow,zm,zm)' shadow becomes bigger Shapes.Move(moon,shapes.GetLeft(moon)+1,shapes.GetTop(moon)+1) Shapes.Move(shadow,shapes.GetLeft(shadow)+2,shapes.GetTop(shadow)+1) EndIf Program.Delay(20) endwhile End>GSD620.sb< Start>GSF791-0.sb< deff() GraphicsWindow.Title="ZX81-Cond Font GraphicsWindow.BackgroundColor="tan GraphicsWindow.BrushColor="darkblue GraphicsWindow.Height=600 GraphicsWindow.Width=1500 GraphicsWindow.Left=5 GraphicsWindow.Top=5 Sub mchh o10=10 For x=1 To 53*8*8 m=Text.GetSubText(aa x 1) px=Math.Remainder(x-1 8)*10+o10 py=Math.Floor((x-1)/8)*10+10-dy If m="1" Then GraphicsWindow.FillEllipse(px py 20 20) ElseIf m="2" Then GraphicsWindow.FillEllipse(px-10 py 20 20) ElseIf m="3" Then GraphicsWindow.FillEllipse(px py-10 20 20) ElseIf m="4" Then GraphicsWindow.FillEllipse(px-10 py-10 20 20) EndIf If py>480 Then dy=dy+480 o10=o10+80 EndIf EndFor DY=0 o10=10 For x=1 To 53*8*8 m=Text.GetSubText(aa x 1) px=Math.Remainder(x-1 8)*10+o10 py=Math.Floor((x-1)/8)*10+10-dy If m="#" Then GraphicsWindow.FillRectangle(px py 10 10) ElseIf m="|" Then GraphicsWindow.FillRectangle(px+5 py 5 10) ElseIf m="I" Then GraphicsWindow.FillRectangle(px py 5 10) ElseIf m="/" Then GraphicsWindow.FillTriangle(px py+10 px+10 py+10 px+10 py) ElseIf m="\" Then GraphicsWindow.FillTriangle(px py px py+10 px+10 py+10) ElseIf m="T" Then GraphicsWindow.FillTriangle(px py px+10 py px+10 py+10) ElseIf m="F" Then GraphicsWindow.FillTriangle(px py+10 px+10 py PX PY) ElseIf m="5" or m="6" or m="7" or m="8" Then GraphicsWindow.BrushColor="tan 'GraphicsWindow.FillTriangle(px py+10 px+10 py+10 px+10 py) GraphicsWindow.FillRectangle(px py 10 10) GraphicsWindow.BrushColor="darkblue EndIf If py>480 Then dy=dy+480 o10=o10+80 EndIf EndFor EndSub Sub DEFF aa= "........ aa=aa+".1###\ . aa=aa+".##\.#\. aa=aa+".##T\##. aa=aa+".## T##. aa=aa+".T# .##. aa=aa+". T###4. aa=aa+"........ aa=aa+"........ aa=aa+".. /##.. aa=aa+"../F##.. aa=aa+"....##.. aa=aa+"....##.. aa=aa+"....##.. aa=aa+"..1###2. aa=aa+"..55555. aa=aa+"........ aa=aa+".1####2. aa=aa+".##..##. aa=aa+".....##. aa=aa+".1####4. aa=aa+".##..... aa=aa+".######. aa=aa+"........ aa=aa+"........ aa=aa+".1####2. aa=aa+".##..##. aa=aa+"...|##4. aa=aa+".....#2. aa=aa+".##..##. aa=aa+".3####4. aa=aa+"........ aa=aa+"...../#. aa=aa+"..../##. aa=aa+".../F##. aa=aa+"../F.##. aa=aa+"./F..##. aa=aa+"/######I aa=aa+".....##. aa=aa+"........ aa=aa+"........ aa=aa+".######. aa=aa+".##..... aa=aa+".#####2. aa=aa+".....##. aa=aa+".##..##. aa=aa+".3####4. aa=aa+"........ aa=aa+"........ aa=aa+".1####.. aa=aa+".##..... aa=aa+".#####2. aa=aa+".##..##. aa=aa+".##..##. aa=aa+".3####4. aa=aa+"........ aa=aa+"........ aa=aa+".#####2. aa=aa+".....##. aa=aa+"..../#F. aa=aa+".../#F.. aa=aa+"../#F... aa=aa+"./##.... aa=aa+"........ aa=aa+"........ aa=aa+".1####2. aa=aa+".##..##. aa=aa+".3####4. aa=aa+".1#..#2. aa=aa+".##..##. aa=aa+".3####4. aa=aa+"........ aa=aa+"........ aa=aa+".1####2. aa=aa+".##..##. aa=aa+".##..##. aa=aa+".3#####. aa=aa+".66..##. aa=aa+".3####4. aa=aa+"........ aa=aa+"........ aa=aa+".. ## .. aa=aa+"../##\.. aa=aa+"./#FT#\. aa=aa+".######. aa=aa+".##..##. aa=aa+"|##I|##I aa=aa+"........ aa=aa+"........ aa=aa+"#####2 . aa=aa+".## ## . aa=aa+".#####2. aa=aa+".##..##. aa=aa+".##..##. aa=aa+"######4. aa=aa+"........ aa=aa+"........ aa=aa+".1####2. aa=aa+".##..34. aa=aa+".##..... aa=aa+".##..... aa=aa+".##..12. aa=aa+".3####4. aa=aa+"........ aa=aa+"........ aa=aa+"|####\.. aa=aa+".##..#\. aa=aa+".##..##. aa=aa+".##..##. aa=aa+".##..#F. aa=aa+"|####F.. aa=aa+"........ aa=aa+"........ aa=aa+"|######I aa=aa+".##...#I aa=aa+".#### .. aa=aa+".##..... aa=aa+".##...#I aa=aa+"|######I aa=aa+"........ aa=aa+"........ aa=aa+"|######I aa=aa+".##...#I aa=aa+".#### .. aa=aa+".##..... aa=aa+".##..... aa=aa+"1##2.... aa=aa+"5555.... aa=aa+"........ aa=aa+".1####2. aa=aa+".##.534. aa=aa+".##..... aa=aa+".##.1#2. aa=aa+".##.5##. aa=aa+".3####4. aa=aa+"........ aa=aa+"........ aa=aa+"|##I|##I aa=aa+".##..##. aa=aa+".######. aa=aa+".##..##. aa=aa+".##..##. aa=aa+"|##I|##I aa=aa+"........ aa=aa+".555555. aa=aa+".3####4. aa=aa+"...##... aa=aa+"...##... aa=aa+"...##... aa=aa+"...##... aa=aa+".1####2. aa=aa+".555555. aa=aa+".. 55... aa=aa+".. 3###I aa=aa+".....##. aa=aa+".....##. aa=aa+".12..##. aa=aa+".##..##. aa=aa+".3####4. aa=aa+"........ aa=aa+"........ aa=aa+"###I./#. aa=aa+" ##./F.. aa=aa+" ####... aa=aa+" ##T#\.. aa=aa+" ##.T#\. aa=aa+"####.T## aa=aa+" ....... aa=aa+"........ aa=aa+"####.... aa=aa+".##..... aa=aa+".##..... aa=aa+".##..... aa=aa+".##...#. aa=aa+"#######. aa=aa+"........ aa=aa+"........ aa=aa+"######2. aa=aa+"## |I5#. aa=aa+"## |I.#. aa=aa+"##.|I #. aa=aa+"##... #. aa=aa+"###..### aa=aa+"........ aa=aa+"........ aa=aa+"######2. aa=aa+".## .##. aa=aa+".## ##. aa=aa+".##. ##. aa=aa+".##..##. aa=aa+"|##I|##I aa=aa+"........ aa=aa+"........ aa=aa+".1####2. aa=aa+".##..##. aa=aa+".##..##. aa=aa+".##..##. aa=aa+".##..##. aa=aa+".3####4. aa=aa+"........ aa=aa+"........ aa=aa+"######2. aa=aa+".##..##. aa=aa+".##..##. aa=aa+".#####4. aa=aa+".##..... aa=aa+"|##I.... aa=aa+"........ aa=aa+"........ aa=aa+".1####2. aa=aa+".##..##. aa=aa+".## .##. aa=aa+".##T\##. aa=aa+".## T##. aa=aa+".3##2T#. aa=aa+"...55... aa=aa+"........ aa=aa+"|#####2. aa=aa+" ##..##. aa=aa+" ##..##. aa=aa+" #####4. aa=aa+" ## T#\. aa=aa+"|##I T#I aa=aa+"........ aa=aa+"........ aa=aa+".1####2. aa=aa+".##..55. aa=aa+".3####2. aa=aa+".....##. aa=aa+".#2..##. aa=aa+".3####4. aa=aa+"........ aa=aa+"........ aa=aa+"|######I aa=aa+"|#5##5#I aa=aa+"...##... aa=aa+"...##... aa=aa+"...##... aa=aa+"..1##2.. aa=aa+"..5555.. aa=aa+"........ aa=aa+"|##I|##I aa=aa+".##..##. aa=aa+".##..##. aa=aa+".##..##. aa=aa+".##..##. aa=aa+".3####4. aa=aa+"........ aa=aa+"........ aa=aa+"|#2..|#I aa=aa+" ##.. #. aa=aa+".##.. #. aa=aa+".##.. #. aa=aa+".T#../F. aa=aa+"..T##F.. aa=aa+"........ aa=aa+"........ aa=aa+"##I..|#I aa=aa+"##....#. aa=aa+"##....#. aa=aa+"##.|I.#. aa=aa+"##6|I6#. aa=aa+"3#####4. aa=aa+"........ aa=aa+"........ aa=aa+"##\../## aa=aa+".T#\/#F. aa=aa+"..T##F.. aa=aa+"../##\.. aa=aa+"./#FT#\. aa=aa+"##F..T## aa=aa+"........ aa=aa+"........ aa=aa+"|##I|##I aa=aa+".##..##. aa=aa+".##..##. aa=aa+".3####4. aa=aa+"...##... aa=aa+"..1##2.. aa=aa+"..5555 . aa=aa+".55..... aa=aa+".1#####. aa=aa+".34./#F. aa=aa+".../#F.. aa=aa+"../#F... aa=aa+"./#F.12. aa=aa+".#####4. aa=aa+"..... . aa=aa+"........ aa=aa+"..1####2 aa=aa+".5#I5634 aa=aa+".3###2.. aa=aa+".55555.. aa=aa+".3##2... aa=aa+".5#I5512 aa=aa+"..3####4 aa=aa+"........ aa=aa+"..1###2. aa=aa+"..#5.5#. aa=aa+"....1#4. aa=aa+"....#5.. aa=aa+"........ aa=aa+"....#... aa=aa+"........ aa=aa+"........ aa=aa+".. |I... aa=aa+".1####2. aa=aa+".##|I55. aa=aa+".3####2. aa=aa+".55|I##. aa=aa+".3####4. aa=aa+".. |I... aa=aa+"........ aa=aa+"........ aa=aa+"...12... aa=aa+"...34... aa=aa+"........ aa=aa+"...12... aa=aa+"...34... aa=aa+"........ aa=aa+"........ aa=aa+"...1##I. aa=aa+"...##5.. aa=aa+"...##... aa=aa+"...##... aa=aa+"...##5.. aa=aa+"...3##I. aa=aa+"........ aa=aa+"........ aa=aa+".|##2... aa=aa+"..5##... aa=aa+"...##... aa=aa+"...##... aa=aa+"..5##... aa=aa+".|##4... aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"...T\... aa=aa+"....T\.. aa=aa+".....#.. aa=aa+"..../F.. aa=aa+".../F... aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"..../F.. aa=aa+".../F... aa=aa+"...#.... aa=aa+"...T\... aa=aa+"....T\.. aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+".....55. aa=aa+". 1###4. aa=aa+"..55.55. aa=aa+"..1###4. aa=aa+"..55.... aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"...|I... aa=aa+"...|I... aa=aa+".######. aa=aa+"...|I... aa=aa+"...|I... aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"..#####. aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"...#.#.. aa=aa+"....#... aa=aa+"..#####. aa=aa+"....#... aa=aa+"...#.#.. aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"..../#F. aa=aa+".../#F.. aa=aa+"../#F... aa=aa+"./#F.... aa=aa+"/#F..... aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"...12... aa=aa+"...34... aa=aa+"........ aa=aa+"...12... aa=aa+"..5##... aa=aa+"..##4... aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"....12.. aa=aa+"...5##.. aa=aa+"...##4.. aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"...12... aa=aa+"...34... aa=aa+"........ aa=aa+"........ aa=aa+".51515.. aa=aa+".5#5#5.. aa=aa+".54545.. aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"........ EndSub zz=LDText.Split("# ? $ : ( ) > < = + - * / ` , . '" " ") Sub mc2 cc=LDGraphicsWindow.Capture("" "false") Program.Delay(777) LDImage.Crop(cc 10 10 480+240 480) ii=LDImage.Copy(cc) LDImage.ReplaceColour(cc "tan" "transparent" 10) LDImage.ReplaceColour(ii "darkblue" "transparent" 10) LDImage.ReplaceColour(ii "tan" "darkblue" 10) LDImage.SaveAs(cc,"e:\zxc1B.png") LDImage.SaveAs(ii,"e:\zxc11B.png") EndSub 'mchh()<--------------UNCOMMENT ON 1ST RUN! 'mc2()<--------------UNCOMMENT ON 1ST RUN! cc=Imagelist.LoadImage("e:\zxc1b.png") ii=ImageList.LoadImage("e:\zxc11b.png") chb=LDImage.SplitImage(cc 9 6) cib=LDImage.SplitImage(ii 9 6) cc=Imagelist.LoadImage("e:\zxc1.png") ii=ImageList.LoadImage("e:\zxc11.png") ch=LDImage.SplitImage(cc 9 6) ci=LDImage.SplitImage(ii 9 6) GraphicsWindow.Clear() For x=0 To 54 If x<10 Then chr["#"+text.GetCharacter( 48+x)]=cI [Math.Floor(x/6)+1][Math.Remainder(x 6)+1] chr["%"+text.GetCharacter( 48+x)]=chb [Math.Floor(x/6)+1][Math.Remainder(x 6)+1] chr[text.GetCharacter( 48+x)]=ch[Math.Floor(x/6)+1][Math.Remainder(x 6)+1] ElseIf x<36 Then chr["%"+text.GetCharacter( 55+x)]=chb[Math.Floor(x/6)+1][Math.Remainder(x 6)+1] chr["#"+text.GetCharacter( 55+x)]=ci[Math.Floor(x/6)+1][Math.Remainder(x 6)+1] chr[text.GetCharacter( 55+x)]=ch[Math.Floor(x/6)+1][Math.Remainder(x 6)+1] Else chr["%"+zz[x-35]]=chb[Math.Floor(x/6)+1][Math.Remainder(x 6)+1] chr["#"+zz[x-35]]=ci[Math.Floor(x/6)+1][Math.Remainder(x 6)+1] chr[zz[x-35]]=ch[Math.Floor(x/6)+1][Math.Remainder(x 6)+1] EndIf EndFor dx=0 x=1 dy=20 ss=" 1 @LET X$=`100CANNOT DOYOU WALK OPENED CLOSED A SWORD A KEY NOTHING A CHEST A DRAGON A CORPSE `~ 2 @PRINT TAB USR 3086+USR 3086;`YOU ARE IN A `;`CAVEPIT HALLLAKE`(VAL X$(1)*4-3 TO VAL X$(1)*4)~ 3 @INPUT U$~ 4 @LET M=2*(U$=`NORTH`)*(X$(1)<`3`)-2*(U$=`SOUTH`)*(X$(1)>`2`)+(X$(1)+U$=`2WEST`)-(X$(1)+U$=`3EAST`)~ 5 @LET A=(3+VAL X$(2)+2*(X$(3)=`2`))*(X$(1)+U$=`2LOOK CHEST`)+(11+(X$(3)=`2`))*(X$(1)+U$=`3KILL DRAGON`)+(M<>0)~ 6 @LET A=A+(5+VAL X$(1))*(U$=`LOOK`)+(6-VAL X$(3))*(U$=`INVENTORY`)+(6-(X$(3)=`0`))*(X$(1)+U$=`4LOOK CORPSE`)~ 7 @LET A=A+10*(X$( TO 3)+U$=`400GET KEY`)+2*(X$( TO 3)+U$=`201OPEN CHEST`)+10*(X$( TO 3)+U$=`211GET SWORD`)~ 8 @LET X$( TO 3)=STR$ (VAL X$(1)+M)+STR$ (VAL X$(2)+(A=2))+STR$ (VAL X$(3)+(A=10))~ 9 @PRINT TAB USR 3086;`> `;U$;TAB USR 3086;(X$+`TAKEN YOU DIED YOU WON. `)(A*9+4 TO A*9+12)~10 @GOTO 2+9*(A>10) ss=LDText.Replace(ss "`" "'") ss=LDText.Replace(ss ";" "`") ss=LDText.Replace(ss "VAL " "@val ") ss=LDText.Replace(ss "USR " "@usr ") ss=LDText.Replace(ss "TAB " "@tab ") ss=LDText.Replace(ss "STR$ " "@str$ ") ss=LDText.Replace(ss " TO " " @to ") s48=1495 dss=17 While x<=Text.GetLength(ss) While dx480 Then dy=dy+480 o10=o10+80 EndIf EndFor DY=0 o10=10 For x=1 To 53*8*8 m=Text.GetSubText(aa x 1) px=Math.Remainder(x-1 8)*10+o10 py=Math.Floor((x-1)/8)*10+10-dy If m="#" Then GraphicsWindow.FillRectangle(px py 10 10) ElseIf m="|" Then GraphicsWindow.FillRectangle(px+5 py 5 10) ElseIf m="I" Then GraphicsWindow.FillRectangle(px py 5 10) ElseIf m="/" Then GraphicsWindow.FillTriangle(px py+10 px+10 py+10 px+10 py) ElseIf m="\" Then GraphicsWindow.FillTriangle(px py px py+10 px+10 py+10) ElseIf m="T" Then GraphicsWindow.FillTriangle(px py px+10 py px+10 py+10) ElseIf m="F" Then GraphicsWindow.FillTriangle(px py+10 px+10 py PX PY) ElseIf m="5" or m="6" or m="7" or m="8" Then GraphicsWindow.BrushColor="tan 'GraphicsWindow.FillTriangle(px py+10 px+10 py+10 px+10 py) GraphicsWindow.FillRectangle(px py 10 10) GraphicsWindow.BrushColor="darkblue EndIf If py>480 Then dy=dy+480 o10=o10+80 EndIf EndFor EndSub Sub DEFF aa= "........ aa=aa+".1###\ . aa=aa+".##\.#\. aa=aa+".##T\##. aa=aa+".## T##. aa=aa+".T# .##. aa=aa+". T###4. aa=aa+"........ aa=aa+"........ aa=aa+".. /##.. aa=aa+"../F##.. aa=aa+"....##.. aa=aa+"....##.. aa=aa+"....##.. aa=aa+"..1###2. aa=aa+"..55555. aa=aa+"........ aa=aa+".1####2. aa=aa+".##..##. aa=aa+".....##. aa=aa+".1####4. aa=aa+".##..... aa=aa+".######. aa=aa+"........ aa=aa+"........ aa=aa+".1####2. aa=aa+".##..##. aa=aa+"...|##4. aa=aa+".....#2. aa=aa+".##..##. aa=aa+".3####4. aa=aa+"........ aa=aa+"...../#. aa=aa+"..../##. aa=aa+".../F##. aa=aa+"../F.##. aa=aa+"./F..##. aa=aa+"/######I aa=aa+".....##. aa=aa+"........ aa=aa+"........ aa=aa+".######. aa=aa+".##..... aa=aa+".#####2. aa=aa+".....##. aa=aa+".##..##. aa=aa+".3####4. aa=aa+"........ aa=aa+"........ aa=aa+".1####.. aa=aa+".##..... aa=aa+".#####2. aa=aa+".##..##. aa=aa+".##..##. aa=aa+".3####4. aa=aa+"........ aa=aa+"........ aa=aa+".#####2. aa=aa+".....##. aa=aa+"..../#F. aa=aa+".../#F.. aa=aa+"../#F... aa=aa+"./##.... aa=aa+"........ aa=aa+"........ aa=aa+".1####2. aa=aa+".##..##. aa=aa+".3####4. aa=aa+".1#..#2. aa=aa+".##..##. aa=aa+".3####4. aa=aa+"........ aa=aa+"........ aa=aa+".1####2. aa=aa+".##..##. aa=aa+".##..##. aa=aa+".3#####. aa=aa+".66..##. aa=aa+".3####4. aa=aa+"........ aa=aa+"........ aa=aa+".. ## .. aa=aa+"../##\.. aa=aa+"./#FT#\. aa=aa+".######. aa=aa+".##..##. aa=aa+"|##I|##I aa=aa+"........ aa=aa+"........ aa=aa+"#####2 . aa=aa+".## ## . aa=aa+".#####2. aa=aa+".##..##. aa=aa+".##..##. aa=aa+"######4. aa=aa+"........ aa=aa+"........ aa=aa+".1####2. aa=aa+".##..34. aa=aa+".##..... aa=aa+".##..... aa=aa+".##..12. aa=aa+".3####4. aa=aa+"........ aa=aa+"........ aa=aa+"|####\.. aa=aa+".##..#\. aa=aa+".##..##. aa=aa+".##..##. aa=aa+".##..#F. aa=aa+"|####F.. aa=aa+"........ aa=aa+"........ aa=aa+"|######I aa=aa+".##...#I aa=aa+".#### .. aa=aa+".##..... aa=aa+".##...#I aa=aa+"|######I aa=aa+"........ aa=aa+"........ aa=aa+"|######I aa=aa+".##...#I aa=aa+".#### .. aa=aa+".##..... aa=aa+".##..... aa=aa+"1##2.... aa=aa+"5555.... aa=aa+"........ aa=aa+".1####2. aa=aa+".##.534. aa=aa+".##..... aa=aa+".##.1#2. aa=aa+".##.5##. aa=aa+".3####4. aa=aa+"........ aa=aa+"........ aa=aa+"|##I|##I aa=aa+".##..##. aa=aa+".######. aa=aa+".##..##. aa=aa+".##..##. aa=aa+"|##I|##I aa=aa+"........ aa=aa+".555555. aa=aa+".3####4. aa=aa+"...##... aa=aa+"...##... aa=aa+"...##... aa=aa+"...##... aa=aa+".1####2. aa=aa+".555555. aa=aa+".. 55... aa=aa+".. 3###I aa=aa+".....##. aa=aa+".....##. aa=aa+".12..##. aa=aa+".##..##. aa=aa+".3####4. aa=aa+"........ aa=aa+"........ aa=aa+"###I./#. aa=aa+" ##./F.. aa=aa+" ####... aa=aa+" ##T#\.. aa=aa+" ##.T#\. aa=aa+"####.T## aa=aa+" ....... aa=aa+"........ aa=aa+"####.... aa=aa+".##..... aa=aa+".##..... aa=aa+".##..... aa=aa+".##...#. aa=aa+"#######. aa=aa+"........ aa=aa+"........ aa=aa+"######2. aa=aa+"## |I5#. aa=aa+"## |I.#. aa=aa+"##.|I #. aa=aa+"##... #. aa=aa+"###..### aa=aa+"........ aa=aa+"........ aa=aa+"######2. aa=aa+".## .##. aa=aa+".## ##. aa=aa+".##. ##. aa=aa+".##..##. aa=aa+"|##I|##I aa=aa+"........ aa=aa+"........ aa=aa+".1####2. aa=aa+".##..##. aa=aa+".##..##. aa=aa+".##..##. aa=aa+".##..##. aa=aa+".3####4. aa=aa+"........ aa=aa+"........ aa=aa+"######2. aa=aa+".##..##. aa=aa+".##..##. aa=aa+".#####4. aa=aa+".##..... aa=aa+"|##I.... aa=aa+"........ aa=aa+"........ aa=aa+".1####2. aa=aa+".##..##. aa=aa+".## .##. aa=aa+".##T\##. aa=aa+".## T##. aa=aa+".3##2T#. aa=aa+"...55... aa=aa+"........ aa=aa+"|#####2. aa=aa+" ##..##. aa=aa+" ##..##. aa=aa+" #####4. aa=aa+" ## T#\. aa=aa+"|##I T#I aa=aa+"........ aa=aa+"........ aa=aa+".1####2. aa=aa+".##..55. aa=aa+".3####2. aa=aa+".....##. aa=aa+".#2..##. aa=aa+".3####4. aa=aa+"........ aa=aa+"........ aa=aa+"|######I aa=aa+"|#5##5#I aa=aa+"...##... aa=aa+"...##... aa=aa+"...##... aa=aa+"..1##2.. aa=aa+"..5555.. aa=aa+"........ aa=aa+"|##I|##I aa=aa+".##..##. aa=aa+".##..##. aa=aa+".##..##. aa=aa+".##..##. aa=aa+".3####4. aa=aa+"........ aa=aa+"........ aa=aa+"|#2..|#I aa=aa+" ##.. #. aa=aa+".##.. #. aa=aa+".##.. #. aa=aa+".T#../F. aa=aa+"..T##F.. aa=aa+"........ aa=aa+"........ aa=aa+"##I..|#I aa=aa+"##....#. aa=aa+"##....#. aa=aa+"##.|I.#. aa=aa+"##6|I6#. aa=aa+"3#####4. aa=aa+"........ aa=aa+"........ aa=aa+"##\../## aa=aa+".T#\/#F. aa=aa+"..T##F.. aa=aa+"../##\.. aa=aa+"./#FT#\. aa=aa+"##F..T## aa=aa+"........ aa=aa+"........ aa=aa+"|##I|##I aa=aa+".##..##. aa=aa+".##..##. aa=aa+".3####4. aa=aa+"...##... aa=aa+"..1##2.. aa=aa+"..5555 . aa=aa+".55..... aa=aa+".1#####. aa=aa+".34./#F. aa=aa+".../#F.. aa=aa+"../#F... aa=aa+"./#F.12. aa=aa+".#####4. aa=aa+"..... . aa=aa+"........ aa=aa+"..1####2 aa=aa+".5#I5634 aa=aa+".3###2.. aa=aa+".55555.. aa=aa+".3##2... aa=aa+".5#I5512 aa=aa+"..3####4 aa=aa+"........ aa=aa+"..1###2. aa=aa+"..#5.5#. aa=aa+"....1#4. aa=aa+"....#5.. aa=aa+"........ aa=aa+"....#... aa=aa+"........ aa=aa+"........ aa=aa+".. |I... aa=aa+".1####2. aa=aa+".##|I55. aa=aa+".3####2. aa=aa+".55|I##. aa=aa+".3####4. aa=aa+".. |I... aa=aa+"........ aa=aa+"........ aa=aa+"...12... aa=aa+"...34... aa=aa+"........ aa=aa+"...12... aa=aa+"...34... aa=aa+"........ aa=aa+"........ aa=aa+"...1##I. aa=aa+"...##5.. aa=aa+"...##... aa=aa+"...##... aa=aa+"...##5.. aa=aa+"...3##I. aa=aa+"........ aa=aa+"........ aa=aa+".|##2... aa=aa+"..5##... aa=aa+"...##... aa=aa+"...##... aa=aa+"..5##... aa=aa+".|##4... aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"...T\... aa=aa+"....T\.. aa=aa+".....#.. aa=aa+"..../F.. aa=aa+".../F... aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"..../F.. aa=aa+".../F... aa=aa+"...#.... aa=aa+"...T\... aa=aa+"....T\.. aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+".....55. aa=aa+". 1###4. aa=aa+"..55.55. aa=aa+"..1###4. aa=aa+"..55.... aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"...|I... aa=aa+"...|I... aa=aa+".######. aa=aa+"...|I... aa=aa+"...|I... aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"..#####. aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"...#.#.. aa=aa+"....#... aa=aa+"..#####. aa=aa+"....#... aa=aa+"...#.#.. aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"..../#F. aa=aa+".../#F.. aa=aa+"../#F... aa=aa+"./#F.... aa=aa+"/#F..... aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"...12... aa=aa+"...34... aa=aa+"........ aa=aa+"...12... aa=aa+"..5##... aa=aa+"..##4... aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"....12.. aa=aa+"...5##.. aa=aa+"...##4.. aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"...12... aa=aa+"...34... aa=aa+"........ aa=aa+"........ aa=aa+".51515.. aa=aa+".5#5#5.. aa=aa+".54545.. aa=aa+"........ aa=aa+"........ aa=aa+"........ aa=aa+"........ EndSub zz=LDText.Split("# ? $ : [ ] > < = + - * / ` , . '" " ") Sub mc2 cc=LDGraphicsWindow.Capture("" "false") Program.Delay(777) LDImage.Crop(cc 10 10 480+240 480) ii=LDImage.Copy(cc) LDImage.ReplaceColour(cc "tan" "transparent" 10) LDImage.ReplaceColour(ii "darkblue" "transparent" 10) LDImage.ReplaceColour(ii "tan" "darkblue" 10) LDImage.SaveAs(cc,"e:\zxc1B.png") LDImage.SaveAs(ii,"e:\zxc11B.png") EndSub 'mchh()<--------------UNCOMMENT ON 1ST RUN! 'mc2()<--------------UNCOMMENT ON 1ST RUN! cc=Imagelist.LoadImage("e:\zxc1b.png") ii=ImageList.LoadImage("e:\zxc11b.png") chb=LDImage.SplitImage(cc 9 6) cib=LDImage.SplitImage(ii 9 6) cc=Imagelist.LoadImage("e:\zxc1.png") ii=ImageList.LoadImage("e:\zxc11.png") ch=LDImage.SplitImage(cc 9 6) ci=LDImage.SplitImage(ii 9 6) GraphicsWindow.Width=900 GraphicsWindow.Clear() For x=0 To 54 If x<10 Then chr["L"+text.GetCharacter( 48+x)]=cI [Math.Floor(x/6)+1][Math.Remainder(x 6)+1] chr["b"+text.GetCharacter( 48+x)]=chb [Math.Floor(x/6)+1][Math.Remainder(x 6)+1] chr[text.GetCharacter( 48+x)]=ch[Math.Floor(x/6)+1][Math.Remainder(x 6)+1] ElseIf x<36 Then chr["b"+text.GetCharacter( 55+x)]=chb[Math.Floor(x/6)+1][Math.Remainder(x 6)+1] chr["l"+text.GetCharacter( 55+x)]=ci[Math.Floor(x/6)+1][Math.Remainder(x 6)+1] chr[text.GetCharacter( 55+x)]=ch[Math.Floor(x/6)+1][Math.Remainder(x 6)+1] Else chr["b"+zz[x-35]]=chb[Math.Floor(x/6)+1][Math.Remainder(x 6)+1] chr["l"+zz[x-35]]=ci[Math.Floor(x/6)+1][Math.Remainder(x 6)+1] chr[zz[x-35]]=ch[Math.Floor(x/6)+1][Math.Remainder(x 6)+1] EndIf EndFor ss="@10 @input Q$~!20 @print '!abcde_fghij!klmno_678' ~@30 @for ! = 1 @to 10.2~!40 @print 'i#*+[5-4]/2:5`3,4'~@50 @next !i dx=0 x=1 dy=20 While x<=Text.GetLength(ss) While dx<32 cc=Text.GetSubText(ss x 1) If cc="!" Then pf="l" ElseIf cc=" " Then pf="" dx=dx+1 ElseIf cc="_" Then pf="" ElseIf cc="~" Then dx=32 Goto xxx ElseIf cc="@" Then pf="b Goto xxx Else dx=dx+1 EndIf GraphicsWindow.DrawResizedImage( chr[pf+cc] dx*30 dy 30 30) xxx: x=x+1 EndWhile dy=dy+30 dx=0 EndWhile End>GSF791.sb< Start>GSF897-0.sb< init() GraphicsWindow.MouseMove = onMove Sub init gww = GraphicsWindow.Width gwh = GraphicsWindow.Height numLenth = 24 For i = 1 To numLenth + 1 x1 = numLenth*i x2 = x1 GraphicsWindow.DrawLine(x1,gwh-50,x2,gwh-40) xPos[i] = x1 EndFor sLenth = Shapes.AddRectangle(20,20) Shapes.Move(sLenth,numLenth-10,gwh-55) Shapes.SetOpacity(sLenth,60) EndSub Sub onMove sTop = Shapes.GetTop(sLenth) sLeft = Shapes.GetLeft(sLenth) gX = GraphicsWindow.MouseX gY = GraphicsWindow.MouseY xMax = xPos[25] xMin = xPos[1] If gX > xMax Then gX = xMax ElseIf gX < xMin Then gX = xMin EndIf shiftn = gX If Mouse.IsLeftButtonDown Then shiftn = math.Floor(gx/numLenth)*numLenth Shapes.Move(sLenth,shiftn-10,gwh-55) EndIf EndSub End>GSF897-0.sb< Start>GSF897.sb< init() GraphicsWindow.MouseMove = onMove Sub init gww = GraphicsWindow.Width gwh = GraphicsWindow.Height numLenth = 24 For i = 1 To numLenth + 1 x1 = numLenth*i x2 = x1 GraphicsWindow.DrawLine(x1,gwh-50,x2,gwh-40) xPos[i] = x1 EndFor sLenth = Shapes.AddRectangle(20,20) Shapes.Move(sLenth,numLenth-10,gwh-55) Shapes.SetOpacity(sLenth,60) EndSub Sub onMove sTop = Shapes.GetTop(sLenth) sLeft = Shapes.GetLeft(sLenth) gX = GraphicsWindow.MouseX gY = GraphicsWindow.MouseY xMax = xPos[25] xMin = xPos[1] If gX > xMax Then gX = xMax ElseIf gX < xMin Then gX = xMin EndIf shiftn = gX If Mouse.IsLeftButtonDown Then If shiftn > xPos[1] And shiftn < xPos[3] Then shiftn = xPos[2] ElseIf shiftn > xPos[2] And shiftn < xPos[4] Then shiftn = xPos[3] ElseIf shiftn > xPos[3] And shiftn < xPos[5] Then shiftn = xPos[4] ElseIf shiftn > xPos[4] And shiftn < xPos[6] Then shiftn = xPos[5] ElseIf shiftn > xPos[5] And shiftn < xPos[7] Then shiftn = xPos[6] ElseIf shiftn > xPos[6] And shiftn < xPos[8] Then shiftn = xPos[7] ElseIf shiftn > xPos[7] And shiftn < xPos[9] Then shiftn = xPos[8] ElseIf shiftn > xPos[8] And shiftn < xPos[10] Then shiftn = xPos[9] ElseIf shiftn > xPos[9] And shiftn < xPos[11] Then shiftn = xPos[10] ElseIf shiftn > xPos[10] And shiftn < xPos[12] Then shiftn = xPos[11] ElseIf shiftn > xPos[11] And shiftn < xPos[13] Then shiftn = xPos[12] ElseIf shiftn > xPos[12] And shiftn < xPos[14] Then shiftn = xPos[13] ElseIf shiftn > xPos[13] And shiftn < xPos[15] Then shiftn = xPos[14] ElseIf shiftn > xPos[14] And shiftn < xPos[16] Then shiftn = xPos[15] ElseIf shiftn > xPos[15] And shiftn < xPos[17] Then shiftn = xPos[16] ElseIf shiftn > xPos[16] And shiftn < xPos[18] Then shiftn = xPos[17] ElseIf shiftn > xPos[17] And shiftn < xPos[19] Then shiftn = xPos[18] ElseIf shiftn > xPos[18] And shiftn < xPos[20] Then shiftn = xPos[19] ElseIf shiftn > xPos[19] And shiftn < xPos[21] Then shiftn = xPos[20] ElseIf shiftn > xPos[20] And shiftn < xPos[22] Then shiftn = xPos[21] ElseIf shiftn > xPos[21] And shiftn < xPos[23] Then shiftn = xPos[22] ElseIf shiftn > xPos[22] And shiftn < xPos[24] Then shiftn = xPos[23] ElseIf shiftn > xPos[23] And shiftn < xPos[25] Then shiftn = xPos[24] EndIf Shapes.Move(sLenth,shiftn-10,gwh-55) EndIf EndSub End>GSF897.sb< Start>GSJ128.sb< TextWindow.Title = "Student Scores" TextWindow.WriteLine("How many grades will be calculated?") numberOfStudents = TextWindow.ReadNumber() a = 1 While (a <= numberOfStudents) TextWindow.WriteLine("What is Student Percentage " + a) studentScorePercentage = TextWindow.ReadNumber() If studentScorePercentage > 75 Then TextWindow.WriteLine("A") ElseIf studentScorePercentage >= 60 then TextWindow.WriteLine("B") elseif studentScorePercentage >= 35 then TextWindow.WriteLine("C") else TextWindow.WriteLine("D") EndIf a = a + 1 EndWhile End>GSJ128.sb< Start>GSJ434.sb< GraphicsWindow.Title = "Flags" GraphicsWindow.Width = 600 GraphicsWindow.Height = 360 p4333=1220 GraphicsWindow.Left = (Desktop.Width - GraphicsWindow.Width) / 2 GraphicsWindow.Top = ((Desktop.Height - 75) - GraphicsWindow.Height) / 2 std ="Russia/White/Blue/Red Austria/Red/White/Red Armenia/Red/Blue/Orange std=std+"Bulgaria/White/Green/Red Estonia/Blue/Black/White Germany/Black/Red/Yellow Hungary/Red/White/Green std=std+"Luxembourg/Red/White/Cyan Lithuania/Orange/Green/Red Sierra_Leone/Green/White/Blue Gabon/Green/Yellow/Blue std=std+"Bahamas/Cyan/Yellow/Cyan/Black Bolivia/Red/Yellow/Green Azerbaijan/Cyan/red/green Belarus/Red/red/green/white Sudan/Red/White/Black/Green std=std+"Egipt&Iraq&Syria&Yemen/Red/White/Black Kuwait/Green/White/Red/Black std=std+"Venezuela/Yellow/Blue/Red Nicaragua/Blue/White/Blue Niger/Red/White/Green/Red Malavi/Black/Red/Green/Red Jordan/Black/White/Green/Red Netherlands/Red/White/Blue Croatia/Red/White/Blue stt=ldtext.Split (std " ") vrt="Vatican/Yellow/White/Gray France/Blue/White/Red Belgium/Black/Yellow/Red Chad/Blue/Yellow/Red Guinea/Red/Yellow/Green Ireland/Green/White/Orange Italy/Green/White/Red vrt=vrt+"Ivory_Coast/Orange/White/Green Mali/Green/Yellow/Red Nigeria/Green/White/Green Peru/Red/White/Red Romania/Blue/Yellow/Red Cameron/Green/Red/Yellow vrt=vrt+"Barbados/Blue/Yellow/Blue Andorra/Blue/yellow/red Senegal/green/yellow/red Guatemala/Cyan/White/Cyan stt2=ldtext.Split (vrt " ") st2="Ucraine/Blue/Yellow Poland/White/Red Czech_R./White/Red/Blue Phillippines/Blue/Red/White Chile/White/Red/Blue Benin/Yellow/Red/Green Monaco&Indonesia&Singapore/Red/White B.Faso/Red/Green Haiti/Blue/Red st2=st2+"Angola/Red/Black Panama/Red/Blue/White Madagaskar/Red/Green/White Lichtenstein/Blue/Red Djibouti/Cyan/Green/White/Red stt3=ldtext.Split (st2 " ") stc="Sweden/Cyan/Yellow Denmark/Red/White Finland/White/Blue Iceland/Blue/White/Red UK/Blue/White/Red Dominican_R./Blue/White/red Norway/Red/White/Black Latvia/Darkred/white Botswana/Cyan/White/Black Cuba/White/Blue/Red stt4=ldtext.Split (stc " ") stf="Mauritius/Red/Blue/Yellow/Green Comoros/Gold/White/Red/Blue/Green Cambodia/Blue/Red/Red/Blue Colombia&Ecuador/Yellow/Yellow/Blue/Red Laos/Red/Blue/Blue/Red Libya/Red/Black/Black/Green stf=stf+"Spain/Red/Yellow/Yellow/Red Lebanon/Red/White/White/Red Laos/Red/Blue/Blue/Red/White Lesotho/Blue/White/White/Green/Black Rwanda/Cyan/Cyan/Yellow/Green stt5=ldtext.Split (stf " ") stcc="Japan/White/red Bangladesh/Green/Red Palau/Cyan/Yellow Tunisia/Red/White stt6=ldtext.Split (stcc " ") While "true fc=1 For f=1 To Array.GetItemCount(stt4) clr=ldtext.Split (stt4[f] "/") doflg4() Program.Delay (p4333) EndFor For f=1 To Array.GetItemCount(stt) clr=ldtext.Split (stt[f] "/") doflg() Program.Delay (p4333) If Text.StartsWith (clr[1] "Cro") then GraphicsWindow.Clear () LDGraphicsWindow.Reposition (1 1, 0, 0 0) endif EndFor For f=1 To Array.GetItemCount(stt2) clr=ldtext.Split (stt2[f] "/") doflg2() Program.Delay (p4333) EndFor For f=1 To Array.GetItemCount(stt6) clr=ldtext.Split (stt6[f] "/") doflgcc() Program.Delay (p4333) Shapes.Remove (ee) EndFor For f=1 To Array.GetItemCount(stt3) clr=ldtext.Split (stt3[f] "/") doflg3() Program.Delay (p4333) EndFor For f=1 To Array.GetItemCount(stt5) clr=ldtext.Split (stt5[f] "/") doflg5() Program.Delay (p4333) EndFor endwhile Sub croflg GraphicsWindow.PenWidth=0 pp="U:198:526; d:207:526:215:525:223:524:231:523:239:521:247:519:255:516:262:513:270:510:277:506:284:502:290:498:297:493:303:488:309:483:315:478:320:472:325:466:330:460:335:453:339:447:343:440:347:433:350:426:353:418:356:410:358:403:360:395:361:387:362:378:363:370:363:362:363:166:34:166:34:362:34:370:35:378:36:387:37:395:39:403:41:410:44:418:47:426:50:433:54:440:58:447:62:453:67:460:71:466:77:472:82:478:88:483:94:488:100:493:107:498:113:502:120:506:127:510:134:513:142:516:150:519:157:521:165:523:173:524:182:525:190:526:198:526:198:526:; U:198:524; d:207:523:215:523:223:522:231:520:239:518:246:516:254:514:261:511:268:508:275:504:282:500:288:496:295:491:301:487:307:481:312:476:318:470:323:465:328:459:332:452:336:446:340:439:344:432:347:425:350:417:353:410:355:402:357:395:358:387:359:379:360:370:360:362:360:169:37:169:37:362:37:370:38:379:39:387:40:395:42:402:44:410:47:417:50:425:53:432:56:439:60:446:65:452:69:459:74:465:79:470:84:476:90:481:96:487:102:491:108:496:115:500:122:504:129:508:136:511:143:514:150:516:158:518:166:520:174:522:182:523:190:523:198:524:; U:358:166; d:397:77:367:28:318:46:284:7:239:32:198:0:158:32:113:7:79:46:30:28:0:77:39:166:48:162:57:158:67:155:76:151:86:148:96:145:106:143:116:140:126:138:136:137:146:135:156:134:167:133:177:132:188:132:198:131:209:132:219:132:230:133:240:134:251:135:261:137:271:138:281:140:291:143:301:145:311:148:320:151:330:155:339:158:348:162:358:166:; U:357:164; d:396:77:366:29:318:47:283:8:238:34:198:1:158:34:113:8:79:47:30:29:1:77:40:164:49:160:58:156:67:153:77:149:86:146:96:144:106:141:116:139:126:137:136:135:146:133:156:132:167:131:177:130:188:130:198:130:209:130:219:130:230:131:240:132:250:133:261:135:271:137:281:139:291:141:300:144:310:146:320:149:329:153:339:156:348:160:357:164:357:164:; U:355:160; d:392:77:365:33:317:51:294:139:310:143:325:148:340:154:355:160:355:160:; U:367:134; d:376:113:359:106:342:100:325:94:307:89:302:111:318:116:335:121:351:127:367:134:367:134:; U:159:38; d:159:38:114:13:80:51:102:139:118:135:134:132:150:130:166:128:159:38:; U:317:51; d:317:51:283:13:238:38:231:128:247:130:263:132:279:135:294:139:317:51:; U:80:51; d:80:51:32:33:5:77:15:101:41:160:56:154:71:148:87:143:102:139:80:51:; U:198:517; d:206:517:214:516:222:515:229:514:237:512:244:510:251:508:259:505:265:502:272:498:279:494:285:490:291:486:297:481:303:476:308:471:313:466:318:460:323:454:327:448:331:442:335:436:338:429:341:422:344:415:347:408:349:400:350:393:352:385:353:378:353:370:354:362:354:175:43:175:43:362:43:370:44:378:45:385:46:393:48:400:50:408:52:415:55:422:58:429:62:436:66:442:70:448:74:454:79:460:83:466:89:471:94:476:100:481:105:486:112:490:118:494:124:498:131:502:138:505:145:508:152:510:160:512:167:514:175:515:182:516:190:517:198:517:; U:105:175; d:43:175:43:244:105:244:105:175:; U:105:312; d:167:312:167:244:105:244:105:312:; U:43:362; d:43:371:44:380:105:380:105:312:43:312:43:362:43:362:; U:229:312; d:167:312:167:380:229:380:229:312:; U:229:448; d:291:448:291:380:229:380:229:448:; U:291:486; d:297:482:301:477:306:473:311:468:315:464:319:459:323:454:327:448:291:448:291:486:; U:105:448; d:167:448:167:380:105:380:105:448:; U:70:448; d:73:454:77:459:81:464:86:468:90:473:95:477:100:482:105:486:105:448:70:448:; U:209:517; d:219:515:229:514:229:448:167:448:167:514:177:515:187:517:198:517:209:517:; U:352:380; d:353:371:354:362:354:312:291:312:291:380:352:380:; U:229:312; d:291:312:291:244:229:244:229:312:; U:229:175; d:167:175:167:244:229:244:229:175:; U:354:244; d:354:175:291:175:291:244:354:244:; U:77:94; d:79:97:79:100:80:102:80:105:80:108:80:110:79:112:78:114:77:116:76:118:75:120:73:122:71:123:70:125:68:126:66:127:63:128:61:128:59:129:56:129:52:128:48:127:45:126:41:123:39:121:36:117:34:114:33:110:35:112:37:115:39:117:42:118:45:120:48:121:51:122:54:122:56:122:59:121:61:121:63:120:65:119:67:118:69:116:71:115:72:113:74:111:75:109:76:107:77:105:77:103:78:101:78:98:78:96:77:94:; U:97:117; d:113:113:130:110:147:108:164:106:162:83:144:85:126:88:109:91:91:95:97:117:; U:86:73; d:104:69:123:65:141:63:161:61:159:38:149:39:139:40:129:42:119:43:109:45:99:47:90:49:80:51:86:73:86:73:; U:302:111; d:318:116:335:121:351:127:367:134:364:139:349:133:333:127:316:122:300:117:302:111:; U:376:113; d:378:107:361:100:344:94:326:88:309:83:307:89:325:94:342:100:359:106:376:113:376:113:; U:40:59; d:41:59:47:65:55:62:56:62:56:62:54:71:61:76:61:76:60:77:52:79:51:88:51:88:50:88:44:82:36:85:35:85:35:85:37:76:30:71:30:70:31:70:39:68:40:59:; U:360:48; d:360:48:353:54:345:51:344:51:345:51:346:60:340:66:339:66:340:66:348:69:350:77:350:78:350:77:357:72:365:75:365:75:365:74:363:66:370:60:370:60:370:60:362:57:360:48:; U:238:38; d:238:38:198:6:159:38:166:128:182:127:198:127:215:127:231:128:238:38:238:38:; U:198:79; d:198:79:198:79:197:80:197:80:196:81:196:82:195:82:195:82:195:83:195:83:194:83:194:84:194:84:194:85:193:84:192:84:191:83:190:84:190:83:190:83:189:82:188:82:187:82:187:82:186:81:186:81:186:81:186:81:185:81:185:81:187:84:189:87:189:87:189:88:189:88:189:89:189:89:190:89:189:90:189:90:188:89:187:89:186:89:185:89:185:89:185:89:185:91:185:92:186:94:187:95:186:95:184:95:184:96:184:96:184:97:185:98:186:98:187:99:186:100:186:101:186:102:185:103:185:103:185:104:186:104:187:104:188:104:189:104:188:106:188:108:189:108:190:107:190:108:190:109:190:109:190:110:190:110:190:111:192:111:194:110:194:112:194:113:194:114:195:113:196:112:197:111:197:112:197:112:198:113:198:114:198:114:198:114:199:113:201:112:202:112:202:113:203:114:203:113:203:112:203:110:205:111:207:111:207:110:207:110:207:109:207:109:207:108:206:107:208:108:209:108:209:106:208:104:209:104:210:104:211:104:212:104:212:103:212:103:211:102:211:101:210:100:209:99:211:98:212:98:212:97:213:96:213:96:213:95:211:95:210:95:211:94:212:92:212:91:212:89:212:89:212:89:211:89:210:89:209:89:208:90:207:90:207:89:208:89:208:89:208:88:208:88:208:87:208:87:209:86:210:84:211:83:212:81:212:81:211:81:211:81:211:81:210:81:210:82:209:82:208:82:208:82:207:83:207:83:207:84:206:84:205:84:204:84:203:85:203:84:203:84:203:83:202:83:202:83:202:82:202:82:201:82:201:81:200:80:199:80:199:79:; U:180:38; d:180:38:180:38:179:39:179:40:178:41:177:42:177:42:177:42:177:43:177:43:176:43:176:44:176:44:176:45:175:44:174:43:173:43:172:44:172:43:172:43:171:42:170:42:169:42:169:42:168:42:168:42:168:41:168:41:167:41:167:42:169:44:171:47:171:47:171:48:171:48:171:49:172:49:172:49:172:50:172:50:172:50:172:50:170:50:169:49:168:49:167:49:167:49:167:49:167:51:168:53:169:54:170:55:168:56:167:56:167:56:167:56:167:57:168:58:169:59:170:59:169:60:169:61:169:63:168:63:168:64:168:64:169:64:170:64:171:64:172:64:171:66:171:68:172:68:174:67:173:68:173:69:173:69:173:70:173:70:173:70:175:71:177:70:177:72:177:73:178:73:178:73:179:72:180:71:180:71:181:72:181:72:181:73:181:73:182:74:183:73:184:71:185:72:186:73:186:73:186:73:187:71:186:70:188:70:190:70:190:69:190:69:190:68:190:68:190:67:189:67:191:67:192:67:192:65:191:63:192:63:193:63:194:63:195:62:195:62:195:62:194:61:194:60:193:59:192:58:193:57:194:57:195:56:195:55:195:54:195:54:194:54:192:54:193:53:194:51:194:50:194:48:194:47:194:48:193:48:192:48:191:48:190:49:190:48:190:48:190:48:190:47:190:47:190:46:190:46:191:45:192:43:193:42:193:40:193:40:193:40:193:40:192:40:192:40:192:41:191:41:190:41:190:42:189:42:189:42:189:43:188:43:187:43:186:43:185:44:185:44:185:43:185:43:184:43:184:42:184:42:184:41:183:41:182:41:182:40:181:39:180:38:180:38:180:38:180:38:; U:191:44; d:190:44:; U:217:38; d:217:38:217:38:218:39:218:40:219:41:219:42:220:42:220:42:220:43:220:43:221:43:221:44:221:44:221:45:222:44:223:43:224:43:225:44:225:43:225:43:226:42:227:42:228:42:228:42:229:42:229:42:229:41:229:41:230:41:230:42:228:44:226:47:226:47:226:48:226:48:225:49:225:49:225:49:225:50:225:50:225:50:225:50:227:50:228:49:229:49:230:49:230:49:230:49:230:51:229:53:228:54:227:55:229:56:230:56:230:56:230:56:230:57:229:58:228:59:227:59:228:60:228:61:228:63:229:63:229:64:229:64:228:64:227:64:226:64:225:64:226:66:226:68:225:68:223:67:223:68:223:69:223:69:224:70:224:70:224:70:222:71:220:70:220:72:219:73:219:73:219:73:218:72:217:71:217:71:216:72:216:72:215:73:215:73:215:74:214:73:213:71:212:72:211:73:211:73:210:73:210:71:210:70:209:70:207:70:206:69:207:69:207:68:207:68:207:67:207:67:206:67:205:67:205:65:206:63:205:63:204:63:203:63:202:62:202:62:202:62:203:61:203:60:204:59:205:58:203:57:203:57:202:56:201:55:201:54:202:54:203:54:205:54:204:53:203:51:203:50:203:48:203:47:203:48:203:48:204:48:206:48:207:49:207:49:207:48:207:48:207:48:207:47:207:47:206:46:206:46:206:45:205:43:204:42:203:40:203:40:204:40:204:40:204:40:205:40:205:41:206:41:207:41:207:42:208:42:208:42:208:43:209:43:210:43:211:43:212:44:212:44:212:43:212:43:213:43:213:42:213:42:213:41:214:41:214:41:215:40:216:39:217:38:217:38:217:38:; U:206:44; d:206:44:; U:247:57; d:248:57:249:57:250:57:252:57:252:58:253:58:254:58:255:57:257:56:258:55:261:54:263:54:266:53:268:53:270:54:272:55:274:56:276:56:278:57:279:58:282:59:285:59:286:59:287:59:288:59:288:59:288:59:288:60:286:61:284:61:282:61:280:61:278:61:277:60:275:59:273:59:275:60:277:62:280:64:283:66:286:67:290:67:291:67:292:67:293:67:293:67:293:68:293:68:290:69:288:70:286:69:284:69:281:68:279:67:276:65:273:63:270:61:268:60:265:60:263:61:263:61:264:61:265:62:267:62:268:62:268:62:267:63:267:63:266:64:265:64:264:65:264:65:263:65:262:65:261:65:261:64:261:65:260:66:260:66:260:66:261:67:261:68:261:68:261:68:261:69:262:70:262:70:262:70:263:71:263:71:264:72:265:74:266:74:266:75:267:75:267:76:270:76:272:76:274:77:275:78:276:78:277:78:278:78:280:78:282:77:284:78:285:78:286:79:287:79:287:80:288:80:289:79:290:79:291:79:292:79:293:79:294:79:295:79:296:78:297:78:298:78:298:79:298:79:298:80:298:80:298:80:297:81:297:81:296:82:295:82:295:82:295:83:295:84:295:85:294:85:293:85:293:86:292:86:292:86:291:87:291:87:291:88:292:89:291:89:291:89:290:89:290:91:290:92:291:92:291:93:291:93:290:94:291:95:291:95:290:96:289:97:289:98:289:99:288:99:288:99:289:100:289:101:288:101:288:101:288:101:288:102:288:102:287:102:286:103:285:104:284:104:284:104:283:106:281:108:281:109:279:110:279:110:279:111:279:112:279:112:278:113:277:114:276:114:275:114:274:114:273:114:273:113:273:112:273:112:272:112:272:112:272:111:272:111:272:111:273:111:274:110:275:110:275:109:275:109:276:108:276:107:277:107:278:106:280:105:280:104:280:104:281:103:281:102:281:102:281:101:280:101:280:100:279:100:278:99:278:99:278:99:277:99:277:100:276:100:275:101:274:102:273:102:271:103:270:105:270:106:269:106:269:108:268:108:268:108:268:108:268:108:267:108:268:109:267:110:267:110:266:110:264:110:263:110:262:109:262:109:261:108:261:108:262:108:262:107:263:107:263:107:265:106:266:105:267:104:268:104:268:102:269:101:269:101:270:100:270:100:270:100:270:100:270:100:269:99:269:98:269:97:269:97:268:97:267:97:267:97:267:96:266:97:266:97:265:97:265:96:264:97:263:97:262:97:261:97:261:98:261:98:260:99:260:101:259:102:258:103:258:104:258:104:258:106:257:106:257:107:257:107:257:108:257:108:257:108:257:108:257:109:256:110:256:110:255:111:254:111:253:111:252:110:252:110:252:110:251:110:251:110:251:109:251:109:251:109:251:109:251:108:252:108:252:107:253:107:253:107:254:106:254:105:255:104:256:103:256:102:256:102:256:102:256:101:256:101:256:101:256:100:256:99:257:97:257:96:257:95:257:94:256:94:256:94:256:94:255:94:255:95:254:95:254:97:253:98:253:99:253:100:253:101:252:102:252:102:251:102:251:103:251:103:252:104:251:105:250:105:249:106:248:105:247:105:246:105:246:104:245:104:245:103:245:103:246:102:248:101:249:100:249:99:250:98:250:98:250:97:251:96:251:95:252:94:252:93:251:92:251:92:251:91:252:91:252:91:251:90:251:90:251:89:251:89:251:89:250:89:250:89:250:88:250:88:251:88:250:87:250:87:250:87:250:86:250:85:250:84:250:84:249:83:248:83:248:83:249:82:249:81:250:81:250:80:250:79:250:79:250:78:251:78:252:77:252:77:252:76:251:76:251:76:251:75:252:75:252:74:252:74:251:74:250:74:250:73:251:72:250:72:250:71:251:71:252:70:252:69:252:69:251:69:250:70:249:70:248:70:248:69:248:69:247:68:247:68:246:68:246:67:246:67:246:66:247:65:247:65:248:63:250:62:250:61:250:61:249:61:249:60:248:60:248:59:247:59:247:59:247:58:247:57:247:57:; U:284:60; d:286:60:287:59:286:60:284:61:; U:314:106; d:315:105:316:106:317:105:318:105:318:105:319:105:319:105:319:104:319:104:318:104:317:103:317:101:316:101:316:101:315:101:315:101:315:101:315:101:313:100:312:100:312:100:311:99:311:99:311:99:311:99:311:98:311:98:311:97:312:97:312:97:313:97:314:97:315:97:316:96:316:96:316:96:316:96:316:95:316:95:316:95:317:95:317:96:319:96:320:97:321:98:322:98:321:99:321:99:321:100:321:100:321:100:322:101:323:102:325:102:327:102:329:103:332:105:335:106:339:107:339:107:340:107:340:107:340:107:340:107:340:107:344:107:347:107:350:108:352:110:355:110:356:111:358:111:359:112:361:112:364:113:366:114:368:115:368:116:369:116:368:117:368:117:367:118:366:118:366:118:365:118:363:117:361:116:359:115:357:114:356:113:354:113:354:113:353:113:353:113:353:113:354:114:354:114:354:115:354:115:354:116:354:116:354:117:355:118:356:118:357:118:357:119:357:119:358:121:358:122:358:122:359:123:359:123:359:124:359:124:358:124:357:125:356:126:355:126:355:125:354:125:354:125:353:124:354:124:354:124:356:124:356:124:356:123:356:123:356:122:356:122:356:122:354:121:354:120:352:119:350:118:348:118:346:117:345:117:345:117:344:117:343:117:343:117:342:117:342:117:341:117:341:117:340:117:340:118:339:118:338:118:337:118:337:118:337:118:336:118:336:118:335:117:335:117:334:117:334:116:334:116:334:116:334:115:336:116:337:116:338:116:339:115:339:115:339:115:340:115:340:114:338:114:337:114:335:113:334:113:333:113:332:113:331:113:331:113:330:113:330:113:329:113:327:113:326:113:324:113:323:114:322:113:322:113:321:113:320:112:320:112:320:112:319:112:319:111:319:111:320:110:321:111:322:111:322:111:323:111:323:111:324:111:325:111:325:111:326:111:326:110:326:110:326:110:326:110:325:110:325:109:323:109:322:108:321:108:320:108:320:108:319:108:318:108:317:108:316:108:315:107:314:108:313:108:313:107:312:107:311:107:311:106:311:106:311:106:311:106:311:105:312:105:313:106:313:106:314:106:314:106:; U:341:114; d:341:114:341:114:339:114:337:113:335:112:333:112:334:112:335:111:336:111:337:111:339:112:341:112:342:113:343:113:343:113:343:113:343:114:344:114:344:114:344:115:343:115:343:115:342:114:341:114:341:114 LDGraphicsWindow.PauseUpdates () LDUtilities.ShowNoShapeErrors ="false bx=200 by=50 ff=0 pl=ldtext.Split (pp,"; ") For x=1 To Array.GetItemCount (pl) If Text.StartsWith (pl[x],"U") Then zz=ldtext.Split (pl[x],":") If ff>0 then ii=ldShapes.AddPolygon(sx) LDShapes.SetShapeEvent (ii) If text.IsSubText("|9|31|5|","|"+ff+"|") then LDShapes.BrushColour (ii,"#0099dd") LDShapes.PenColour (ii,"#0099dd") elseIf text.IsSubText("|7|8|","|"+ff+"|") then LDShapes.BrushColour (ii,"darkblue") LDShapes.PenColour (ii,"darkblue") elseIf text.IsSubText("|27|28|","|"+ff+"|") then Goto xx ElseIf text.IsSubText("|24|29|30|32|33|35|37|","|"+ff+"|") then LDShapes.BrushColour (ii,"yellow") LDShapes.PenColour (ii,"black") elseif ff<>10 And ff>1 And ff<>3 And ff<>4 or text.IsSubText("|26|25|","|"+ff+"|") then LDShapes.BrushColour (ii,"red") LDShapes.PenColour (ii,"red") ElseIf ff=39 then LDShapes.BrushColour (ii,"brown") LDShapes.PenColour (ii,"black") ElseIf ff>23 then LDShapes.BrushColour (ii,"blue") LDShapes.PenColour (ii,"white") else xx: LDShapes.BrushColour (ii,"white") LDShapes.PenColour (ii,"white") endif sx=0 endif sx[1][1]=zz[2]+bx sx[1][2]=zz[3]+by w=2 ff=ff+1 Else zz=ldtext.Split (pl[x],":") For f=2 To Array.GetItemCount (zz) Step 2 sx[w][1]=zz[f]+bx sx[w][2]=zz[f+1]+by w=w+1 Endfor EndIf endfor LDGraphicsWindow.Reposition (.4 .4, -50, -340 0) LDGraphicsWindow.ResumeUpdates () EndSub Sub doflg GraphicsWindow.Title=fc+". "+clr[1] GraphicsWindow.BrushColor = clr[2] GraphicsWindow.FillRectangle(0, 0, 600, 120) GraphicsWindow.BrushColor = clr[3] GraphicsWindow.FillRectangle(0, 120, 600, 120) GraphicsWindow.BrushColor = clr[4] GraphicsWindow.FillRectangle(0, 240, 600, 120) If Text.StartsWith (clr[1] "Kuw") Then GraphicsWindow.BrushColor=clr[5] GraphicsWindow.FillTriangle (0 0 0 180 240 120) GraphicsWindow.FillTriangle (0 360 0 180 240 240) GraphicsWindow.FillRectangle (0 120 240 120) elseIf Text.StartsWith (clr[1] "Bah") Or Text.StartsWith (clr[1] "Sud") Or Text.StartsWith (clr[1] "Jor") Then GraphicsWindow.BrushColor=clr[5] GraphicsWindow.FillTriangle (0 0 0 360 311 180) ElseIf Text.StartsWith (clr[1] "Cro") then croflg () EndIf incfc() EndSub Sub doflg3 GraphicsWindow.Title=fc+". "+clr[1] GraphicsWindow.BrushColor = clr[2] GraphicsWindow.FillRectangle(0, 0, 600, 180) GraphicsWindow.BrushColor = clr[3] GraphicsWindow.FillRectangle(0, 180, 600, 180) If Text.StartsWith (clr[1] "Cze") Or Text.StartsWith (clr[1] "Phi") or Text.StartsWith (clr[1] "Dji") Then GraphicsWindow.BrushColor=clr[4] GraphicsWindow.FillTriangle (0 0 0 360 311 180) elseIf Text.StartsWith (clr[1] "Ben") or Text.StartsWith (clr[1] "Mad") Then GraphicsWindow.BrushColor=clr[4] GraphicsWindow.FillRectangle (0 0 180 360) elseIf Text.StartsWith (clr[1] "Chi") Then GraphicsWindow.BrushColor=clr[4] GraphicsWindow.FillRectangle (0 0 180 180) elseIf Text.StartsWith (clr[1] "Pan") Then GraphicsWindow.BrushColor=clr[4] GraphicsWindow.FillRectangle (0 0 300 180) GraphicsWindow.FillRectangle (300 180 300 180) EndIf incfc() EndSub Sub doflg5 GraphicsWindow.Title=fc+". "+clr[1] GraphicsWindow.BrushColor = clr[2] GraphicsWindow.FillRectangle(0, 0, 600, 90) GraphicsWindow.BrushColor = clr[3] GraphicsWindow.FillRectangle(0,90, 600, 90) GraphicsWindow.BrushColor = clr[4] GraphicsWindow.FillRectangle(0, 180, 600, 90) GraphicsWindow.BrushColor = clr[5] GraphicsWindow.FillRectangle(0, 270, 600, 90) If Text.StartsWith (clr[1] "Como") Then GraphicsWindow.BrushColor=clr[6] GraphicsWindow.FillTriangle (0 0 0 360 311 180) EndIf incfc() EndSub Sub doflg2 GraphicsWindow.Title=fc+". "+clr[1] GraphicsWindow.BrushColor = clr[2] GraphicsWindow.FillRectangle(0, 0, 200, 360) GraphicsWindow.BrushColor = clr[3] GraphicsWindow.FillRectangle(200 0 , 200, 360) GraphicsWindow.BrushColor = clr[4] GraphicsWindow.FillRectangle(400 0, 200, 360) incfc() EndSub sub doflg4 GraphicsWindow.Title=fc+". "+clr[1] GraphicsWindow.BrushColor = clr[2] GraphicsWindow.FillRectangle(0, 0, 600, 360) if clr[1]="UK" then GraphicsWindow.PenWidth =24 GraphicsWindow.PenColor="white GraphicsWindow.DrawLine (-20,-20 620 380) GraphicsWindow.DrawLine (-20 380 620,-20) GraphicsWindow.PenWidth =15 GraphicsWindow.PenColor="red GraphicsWindow.DrawLine (-20,-20 620 380) GraphicsWindow.DrawLine (-20 380 620,-20) endif GraphicsWindow.BrushColor = clr[3] GraphicsWindow.FillRectangle(0, 144, 600, 72) If Text.StartsWith (clr[1] "Dom") Then dd=264 elseif clr[1]="UK" then dd=264 Else dd=150 endif if Text.StartsWith (clr[1] "Lat") or Text.StartsWith (clr[1] "Bot") or Text.StartsWith (clr[1] "Cub") then else GraphicsWindow.FillRectangle(dd, 0, 72 360) endif If Text.StartsWith (clr[1] "Dom") Then LDGraphicsWindow.FloodFill ( 2 2 "red") LDGraphicsWindow.FloodFill ( 592 352 "red") EndIf If clr[1]="UK" or Text.StartsWith (clr[1] "Nor") or Text.StartsWith (clr[1] "Bot") or Text.StartsWith (clr[1] "Ice") Then GraphicsWindow.BrushColor = clr[4] GraphicsWindow.FillRectangle(0, 150, 600, 60) if Text.StartsWith (clr[1] "Bot") then else GraphicsWindow.FillRectangle(dd+6, 0, 60 360) endif EndIf If Text.StartsWith (clr[1] "Cub") Then GraphicsWindow.BrushColor = clr[3] GraphicsWindow.FillRectangle(0, 0, 600, 72) GraphicsWindow.FillRectangle(0, 360-72, 600, 72) GraphicsWindow.BrushColor=clr[4] GraphicsWindow.FillTriangle (0 0 0 360 311 180) EndIf incfc() EndSub Sub doflgcc GraphicsWindow.Title=fc+". "+clr[1] GraphicsWindow.BrushColor = clr[2] GraphicsWindow.FillRectangle(0, 0, 600, 360) GraphicsWindow.PenWidth=0 GraphicsWindow.BrushColor = clr[3] ee=Shapes.AddEllipse (170 170) If Text.StartsWith (clr[1] "Pal") Then LDShapes.Centre (ee 250 180) Else LDShapes.Centre (ee 300 180) EndIf fc=fc+1 EndSub Sub incfc If Text.IsSubText (clr[1] "&") Then tt=ldtext.Split (clr[1] "&") fc=fc+array.GetItemCount (tt) Else fc=fc+1 endif endsub End>GSJ434.sb< Start>GSK928.sb< GraphicsWindow.BackgroundColor ="#00bbcc GraphicsWindow.Width =900 GraphicsWindow.Height =600 GraphicsWindow.Left =10 GraphicsWindow.top=10 GraphicsWindow.PenWidth=0 dd=Shapes.AddRectangle (50 100) LDShapes.Centre (dd 450 420) LDShapes.BrushColour (dd "darkred") GraphicsWindow.Title ="DAYSCAPE ee=Shapes.AddEllipse (200 200) LDShapes.Centre (ee 450 300) LDShapes.BrushColour (ee "green") GraphicsWindow.BrushColor="darkgreen rr=shapes.AddRectangle (900 200) Shapes.Move(rr 0 430) ldShapes.ZIndex (rr, -1) ss=shapes.AddEllipse (40 40) LDShapes.BrushColour (ss "yellow") Shapes.Move(ss 20 420) ldShapes.ZIndex (ss, -2) For x=1 to 40 pp[1][1]=425 pp[1][2]=470 pp[2][1]=475 pp[2][2]=470 pp[3][1]=900-x*20 pp[3][2]=600 pp[4][1]=pp[3][1]-50 pp[4][2]=600 po[x]=LDShapes.AddPolygon (pp) LDShapes.BrushColour (po[x] "#aa000000") Shapes.HideShape (po[x]) EndFor pf=" AM" For f=1 To 15 dt[f]=(7+f-dc)+pf If f=5 Then dt[f]="NOON" pf=" PM" dc=12 EndIf EndFor Program.Delay (3000) For r=0 To 165 Step .25 LDShapes.RotateAbout (ss 450 500 r) si=math.Floor (r/4) Shapes.ShowShape (po[si]) If si>1 then Shapes.HideShape (po[si-1]) endif GraphicsWindow.BackgroundColor=LDColours.HSLtoRGB (220 .8 LDMath.Sin(r)/2+.3) Program.Delay (35) GraphicsWindow.Title=dt[math.Floor (r/20)+1] EndFor Shapes.Move(ss 20 420) ldShapes.ZIndex (ss, -2) LDShapes.BrushColour (ss "white") GraphicsWindow.BackgroundColor ="darkblue LDShapes.BrushColour (ee "#005544") LDShapes.BrushColour (rr "#333333") LDShapes.BrushColour (dd "black") For r=1 To 30 q=math.GetRandomNumber (3)+1 w=shapes.AddEllipse (q q) LDShapes.BrushColour (w LDColours.HSLtoRGB (0 0 (Math.GetRandomNumber (80)+20)/100)) Shapes.Move (w Math.GetRandomNumber (900) Math.GetRandomNumber (400)) LDShapes.ZIndex (w,-10) LDShapes.AnimateOpacity (w Math.GetRandomNumber (3000)+500 0) EndFor GraphicsWindow.Title ="EVENING For r=0 To 165 Step .25 LDShapes.RotateAbout (ss 450 500 r) si=math.Floor (r/4) Shapes.ShowShape (po[si]) If si>1 then Shapes.HideShape (po[si-1]) endif If r=80 Then GraphicsWindow.Title ="MIDNIGHT ElseIf r>90 then GraphicsWindow.Title ="NIGHTSCAPE endif Program.Delay (35) EndFor End>GSK928.sb< Start>GSL555.sb< GraphicsWindow.KeyUp = OnKeyUp Init() InitialSituation() While 1 = 1 If KU = 1 Then LK = GraphicsWindow.LastKey 'TextWindow.WriteLine(LK) KU = 0 EndIf NewPositionC3() NewPositionC2() NewPositionC1() DetctCollision() EndWhile Sub OnKeyUp KU = 1 EndSub 'OnKeyUp Sub InitialSituation C1X = 80 C1Y = 150 Shapes.Move(Circle1, C1X,C1Y) C2X = 340 C2Y = 150 Shapes.Move(Circle2, C2X,C2Y) C3X = 130 C3Y = 320 Shapes.Move(Circle3, C3X, C3Y) C3DX = Math.GetRandomNumber(2) - 1 C3DY = Math.GetRandomNumber(2) - 1 C1DX = 1 C1DY = 1 R1 = "Result left: " + RR1 Shapes.SetText(Result1, R1) R2 = "Result right: " + RR2 Shapes.SetText(Result2, R2) EndSub 'InitialSituation Sub NewPositionC3 X = Math.GetRandomNumber(3) Y = Math.GetRandomNumber(2) If C3DX = 0 Then C3X = C3X + X Else C3X = C3X - X EndIf If C3DY = 0 Then C3Y = C3Y + Y Else C3Y = C3Y - Y EndIf If C3X < -30 Then C3DX = 0 C3X = C3X + X + X ElseIf C3X > GWW -30 Then C3DX = 1 C3X = C3X - X - X EndIf If C3Y < -15 Then C3DY = 0 C3Y = C3Y + Y + Y ElseIf C3Y > GWH -15 Then C3DY = 1 C3Y = C3Y - Y - Y EndIf Shapes.Move(Circle3, C3X, C3Y) Program.Delay(10) EndSub 'NewPositionC3 Sub NewPositionC2 If LK = "Up" Then LK = "" C2Y = C2Y - 15 ElseIf LK = "Down" Then LK = "" C2Y = C2Y + 15 ElseIf LK = "Left" Then LK = "" C2X = C2X - 15 ElseIf LK = "Right" Then LK = "" C2X = C2X + 15 EndIf Shapes.Move(Circle2, C2X,C2Y) EndSub 'NewPositionC2 Sub NewPositionC1 XX = Math.GetRandomNumber(3) YY = Math.GetRandomNumber(2) If C1DX = 0 Then C1X = C1X + XX Else C1X = C1X - XX EndIf If C1DY = 0 Then C1Y = C1Y + YY Else C1Y = C1Y - YY EndIf If C1X < 0 Then C1DX = 0 C1X = C1X + XX + XX ElseIf C1X > GWW -75 Then C1DX = 1 C1X = C1X - XX - XX EndIf If C1Y < 0 Then C1DY = 0 C1Y = C1Y + YY + YY ElseIf C3Y > GWH -50 Then C1DY = 1 C1Y = C1Y - YY - YY EndIf Shapes.Move(Circle1, C1X,C1Y) EndSub 'NewPositionC1 Sub DetctCollision CC1 = LDShapes.Overlap(Circle3, Circle1) CC2 = LDShapes.Overlap(Circle3, Circle2) If CC1 = T Then RR2 = RR2 + 1 InitialSituation() ElseIf CC2 = T Then RR1 = RR1 + 1 InitialSituation() EndIf EndSub 'DetctCollision Sub Init GWW = 500 GWH = 500 GraphicsWindow.Width = GWW GraphicsWindow.Height = GWH GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.BackgroundColor = "Black" GraphicsWindow.FillEllipse(10,10,GraphicsWindow.Width - 20, GraphicsWindow.Height - 20) GraphicsWindow.BrushColor = "Steelblue" Circle1 = Shapes.AddEllipse(75,50) Circle2 = Shapes.AddEllipse(75,50) Circle3 = Shapes.AddEllipse(240,100) T = "True" RR1 = 0 RR2 = 0 R1 = "Result left: " + RR1 Result1 = Shapes.AddText(R1) Shapes.Move(Result1, 10, 10) R2 = "Result right: " + RR2 Result2 = Shapes.AddText(R2) Shapes.Move(Result2, 340, 10) C1DX = 1 C1DY = 1 EndSub 'Init End>GSL555.sb< Start>GSM120-0.sb< 'Create the main window with buttons to show other windows GraphicsWindow.Hide() numWin = 5 For i = 1 To numWin show[i] = Controls.AddButton("Show window "+i,20,20+40*(i-1)) EndFor GraphicsWindow.Show() LDGraphicsWindow.ExitOnClose = "False" LDGraphicsWindow.Closing = OnClosing 'Create some windows with a ball and close button and hide initially For i = 1 To numWin id[i] = LDWindows.Create() GraphicsWindow.Title = "Window "+i GraphicsWindow.Hide() ball[i] = Shapes.AddEllipse(20,20) hide[i] = Controls.AddButton("Close",20,20) GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseMove = OnMouseMove LDGraphicsWindow.ExitOnClose = "False" LDGraphicsWindow.Closing = OnClosing EndFor 'Set the main window as active iWin = 0 LDWindows.CurrentID = iWin LDWindows.Activated = OnActivated Controls.ButtonClicked = OnButtonClicked 'A main thread loop to handle all the event action 'Problems if we do it in the event subroutines While ("True") If (activated = 1) Then iWin = LDWindows.LastActivated setWin() activated = 0 EndIf If (clicked = 1) Then For i = 1 To numWin If (Controls.LastClickedButton = hide[i]) Then iWin = id[i] setWin() GraphicsWindow.Hide() iWin = 0 setWin() ElseIf (Controls.LastClickedButton = show[i]) Then iWin = id[i] setWin() GraphicsWindow.Show() GraphicsWindow.BackgroundColor = GraphicsWindow.GetRandomColor() EndIf EndFor clicked = 0 EndIf 'If a window was closed revert to main window If (closed = 1) Then iWin = 0 setWin() closed = 0 EndIf Program.Delay(20) EndWhile 'When a window gets focus switch to it Sub OnActivated activated = 1 EndSub 'Change background colour on current window (not main window since no event registered for this window) Sub OnMouseDown xM = GraphicsWindow.MouseX yM = GraphicsWindow.MouseY gw = GraphicsWindow.Width gh = GraphicsWindow.Height If (xM > 0 And xM < gw And yM > 0 And yM < gh) Then GraphicsWindow.BackgroundColor = GraphicsWindow.GetRandomColor() EndIf EndSub 'Handle X pressed Sub OnClosing result = LDDialogs.Confirm("Do you really want to close this window?","Warning") If (result = "Yes") Then If (iWin = 0) Then result = LDDialogs.Confirm("Closing this window will end the session?","Warning") If (result = "Yes") Then Program.End() Else LDGraphicsWindow.CancelClose = "True" EndIf Else LDGraphicsWindow.CancelClose = "False" closed = 1 EndIf Else LDGraphicsWindow.CancelClose = "True" EndIf EndSub 'Move the current window ball Sub OnMouseMove Shapes.Move(ball[iWin],GraphicsWindow.MouseX-10,GraphicsWindow.MouseY-10) EndSub 'Show and hide windows on button clicks Sub OnButtonClicked clicked = 1 EndSub 'Set the window and make it topmost when we change a window. Sub setWin LDWindows.CurrentID = iWin LDWindows.Active = iWin EndSub End>GSM120-0.sb< Start>GSM120.sb< 'Create the main window with buttons to show other windows numWin = 5 For i = 1 To numWin show[i] = Controls.AddButton("Show window "+i,20,20+40*(i-1)) EndFor LDGraphicsWindow.ExitOnClose = "False" LDGraphicsWindow.Closing = OnClosing 'Create some windows with a ball and close button and hide initially For i = 1 To numWin id[i] = LDWindows.Create() GraphicsWindow.Title = "Window "+i GraphicsWindow.Hide() ball[i] = Shapes.AddEllipse(20,20) hide[i] = Controls.AddButton("Close",20,20) GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseMove = OnMouseMove LDGraphicsWindow.ExitOnClose = "False" LDGraphicsWindow.Closing = OnClosing EndFor 'Set the main window as active iWin = 0 LDWindows.CurrentID = iWin LDWindows.Activated = OnActivated Controls.ButtonClicked = OnButtonClicked 'A main thread loop to handle all the event action 'Problems if we do it in the event subroutines While ("True") If (activated = 1) Then iWin = LDWindows.LastActivated setWin() activated = 0 EndIf If (clicked = 1) Then For i = 1 To numWin If (Controls.LastClickedButton = hide[i]) Then iWin = id[i] setWin() GraphicsWindow.Hide() iWin = 0 setWin() ElseIf (Controls.LastClickedButton = show[i]) Then iWin = id[i] setWin() GraphicsWindow.Show() GraphicsWindow.BackgroundColor = GraphicsWindow.GetRandomColor() EndIf EndFor clicked = 0 EndIf 'If a window was closed revert to main window If (closed = 1) Then iWin = 0 setWin() closed = 0 EndIf Program.Delay(20) EndWhile 'When a window gets focus switch to it Sub OnActivated activated = 1 EndSub 'Change background colour on current window (not main window since no event registered for this window) Sub OnMouseDown xM = GraphicsWindow.MouseX yM = GraphicsWindow.MouseY gw = GraphicsWindow.Width gh = GraphicsWindow.Height If (xM > 0 And xM < gw And yM > 0 And yM < gh) Then GraphicsWindow.BackgroundColor = GraphicsWindow.GetRandomColor() EndIf EndSub 'Handle X pressed Sub OnClosing result = LDDialogs.Confirm("Do you really want to close this window?","Warning") If (result = "Yes") Then If (iWin = 0) Then result = LDDialogs.Confirm("Closing this window will end the session?","Warning") If (result = "Yes") Then Program.End() Else LDGraphicsWindow.CancelClose = "True" EndIf Else LDGraphicsWindow.CancelClose = "False" closed = 1 EndIf Else LDGraphicsWindow.CancelClose = "True" EndIf EndSub 'Move the current window ball Sub OnMouseMove Shapes.Move(ball[iWin],GraphicsWindow.MouseX-10,GraphicsWindow.MouseY-10) EndSub 'Show and hide windows on button clicks Sub OnButtonClicked clicked = 1 EndSub 'Set the window and make it topmost when we change a window. Sub setWin LDWindows.CurrentID = iWin LDWindows.Active = iWin EndSub End>GSM120.sb< Start>GSM632.sb< 'In this game "Age Of Heroes" there are many places that one could think i have "slacked off a little" and not done as much as i could 'e.g.: not using a random number generator instead of an actual dice but as it states in the opening credits this is a DND simulator. 'my intentions in making this is to make the program simulate the dungeon master and the player dose what he would do in a real DND game 'like rolling one’s own dice. '(what you see here is my first attempt at a text adventure) I hope to update the quests regally on a monthly basis or so. 'so now I can introduce to you AGE OF HEROES (version 1.0) '//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// '::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 'Loading sequence game start TextWindow.ForegroundColor = "white" Sub loadC TextWindow.Clear() TextWindow.WriteLine("AGE OF HEROES") TextWindow.WriteLine("loading game") TextWindow.WriteLine(loadCin) Program.Delay(50) EndSub Sub load For _ = 100000 To Math.GetRandomNumber(200)+100000 loadC() loadCin = "/" loadC() loadCin = "-" loadC() loadCin = "\" loadC() EndFor TextWindow.Clear() TextWindow.WriteLine("Game loaded") TextWindow.PauseWithoutMessage() TextWindow.Clear() EndSub load() 'credits TextWindow.ForegroundColor = "green" TextWindow.WriteLine (" (T for complexity) ") TextWindow.PauseWithoutMessage() TextWindow.Clear() TextWindow.WriteLine ("EllisCorp presents...") TextWindow.PauseWithoutMessage() TextWindow.Clear() TextWindow.WriteLine (" A breath taking masterpiece... ") TextWindow.PauseWithoutMessage() TextWindow.Clear() TextWindow.WriteLine (" Inspired by the classic game dungeons and dragons...") TextWindow.PauseWithoutMessage() TextWindow.Clear() TextWindow.WriteLine (" AGE OF HEROES ") TextWindow.PauseWithoutMessage() TextWindow.Clear() TextWindow.WriteLine (" Enter... if you dare>>> ") TextWindow.PauseWithoutMessage() TextWindow.Clear() 'primary interface TextWindow.PauseWithoutMessage() Sound.Play(Program.Directory + "\mus.wma") TextWindow.Clear() TextWindow.ForegroundColor = "white" TextWindow.WriteLine ("have you already made a character") TextWindow.WriteLine ("yes") TextWindow.WriteLine ("no") TextWindow.ForegroundColor = "yellow" armac= TextWindow.Read() TextWindow.ForegroundColor = "white" 'armac = already made a character If armac = "yes" Then TextWindow.WriteLine("Do you wish to enter a save point code or star again") TextWindow.WriteLine("start again") 'load players progress in game TextWindow.WriteLine("load save") TextWindow.ForegroundColor = "yellow" loadornot = TextWindow.Read() TextWindow.ForegroundColor= "white" If loadornot = "load save" then TextWindow.WriteLine ("please enter your load save code") TextWindow.ForegroundColor = "yellow" loadsave = TextWindow.Read() TextWindow.ForegroundColor = "white" 'save variables If loadsave = "save001" Then Goto save1 ElseIf loadsave = "save002" then Goto save002 ElseIf loadsave = "save003" Then Goto save003 ElseIf loadsave = "save004" Then ElseIf loadsave = "save005" Then ElseIf loadsave = "save006" Then ElseIf loadsave = "save007" Then ElseIf loadsave = "save008" Then ElseIf loadsave = "save009" Then ElseIf loadsave = "save010" Then ElseIf loadornot = "start again" then Goto chapter1 If armac = "no" then Goto ccz EndIF EndIf EndIf EndIf 'ccz = character creation zone ccz: 'loading game Sub load2C TextWindow.Clear() TextWindow.WriteLine("AGE OF HEROES") TextWindow.WriteLine("loading game") TextWindow.WriteLine(load2Cin) Program.Delay(50) EndSub Sub load2 For _ = 100000 To Math.GetRandomNumber(200)+100000 load2Cin = "|" load2C() load2Cin = "/" load2C() load2Cin = "-" load2C() load2Cin = "\" load2C() EndFor TextWindow.Clear() TextWindow.WriteLine("Game loaded") TextWindow.Pause() TextWindow.Clear() EndSub 'loading character creation zone load2() TextWindow.PauseWithoutMessage() TextWindow.Clear() TextWindow.WriteLine (" Starting up character creation ") textWindow.PauseWithoutMessage() Sub load3C TextWindow.Clear() TextWindow.WriteLine("AGE OF HEROES") TextWindow.WriteLine("loading character creation") TextWindow.WriteLine(load3Cin) Program.Delay(50) EndSub Sub load3 For _ = 100000 To Math.GetRandomNumber(200)+100000 load3Cin = "|" load3C() load3Cin = "/" load3C() load3Cin = "-" load3C() load3Cin = "\" load3C() EndFor TextWindow.Clear() TextWindow.WriteLine("Character creation loaded") TextWindow.Pause() TextWindow.Clear() EndSub load3() ' character creation zone TextWindow.ForegroundColor = "white" TextWindow.WriteLine (" This is the AGE OF HEROES character creation zone.") TextWindow.WriteLine (" please insert your character name") TextWindow.ForegroundColor = "yellow" name = TextWindow.Read() TextWindow.ForegroundColor = "white" TextWindow.WriteLine (" Greetings " + name + " welcome to Age Of Heros ") TextWindow.WriteLine ("now " + name + " at this point you need to choose your faction") TextWindow.WriteLine (" ranger: is a stealthy and ranged fighter usually uses bows and arrows or crossbow and bolts. The ranger is quick on its feet but has the drawback of low armour rating and less attack power ") TextWindow.WriteLine (" guardian: specialises in shield and sword combat and uses thick armour with a high stamina rating but the drawback is you are slow and less stealthy ") TextWindow.WriteLine (" now that you know, do you wish to be a ranger or a guardian. ") TextWindow.ForegroundColor = "yellow" faction = TextWindow.Read() ' this section chooses players If faction = "ranger" Then TextWindow.ForegroundColor = "white" TextWindow.Write (" ah wise choice, a bow can save your life ") TextWindow.ForegroundColor = "yellow" TextWindow.Read() TextWindow.ForegroundColor = "white" goto gender If faction = "guardian" Then TextWindow.ForegroundColor = "white" TextWindow.Write (" A sword is a trusty weapon fights for you by day, at your side by night ") TextWindow.ForegroundColor = "yellow" faction = TextWindow.Read() TextWindow.ForegroundColor = "white" TextWindow.Read() Goto gender 'this section chooses players gender gender: TextWindow.WriteLine (" select your gender ") TextWindow.WriteLine ("male") TextWindow.WriteLine ("female") gender = TextWindow.Read() If gender = "male" then TextWindow.WriteLine (" you are strong but have a speed draw back") TextWindow.ForegroundColor = "white" TextWindow.WriteLine ("for this section of the character customisation you shall need a fair 6 sided dice") TextWindow.WriteLine ("this is how it shall work. the computer shall say a category (e.g. speed, inelegance...) then you shall roll a dice 3 times. the computer shall ask you for roll no.1, no.2 and no.3. insert them when told. ") TextWindow.WriteLine (" the highest you could get is 72 the lowest is 2 (NOT INCLUDING CHARECTOR BONUSES) ") TextWindow.Read() Goto sc ElseIf gender = "female" then TextWindow.WriteLine (" you are quick on your feet yet your drawback is your strength") TextWindow.ForegroundColor = "white" TextWindow.WriteLine ("for this section of the character customisation you shall need a fair 6 sided dice") TextWindow.WriteLine ("this is how it shall work. the computer shall say a category (e.g. speed, inelegance...) then you shall roll a dice 3 times. the computer shall ask you for roll no.1, no.2 and no.3. insert them when told. ") TextWindow.WriteLine (" the highest you could get is 72 the lowest is 2 (NOT INCLUDING CHARECTOR BONUSES) ") TextWindow.Read() Goto sc 'this section creates players statistic 'intelligence sc: TextWindow.WriteLine ("INTELAGANCE") TextWindow.WriteLine (" please insert dice roll no.1") TextWindow.ForegroundColor = "yellow" no1_ = TextWindow.Read() TextWindow.ForegroundColor = "white" TextWindow.WriteLine (" please insert dice roll no.2") TextWindow.ForegroundColor = "yellow" no2_ = TextWindow.Read() TextWindow.ForegroundColor = "white" TextWindow.WriteLine (" please insert dice roll no.3") TextWindow.ForegroundColor = "yellow" no3_ = TextWindow.Read() TextWindow.ForegroundColor = "white" INTELAGANCE = (( no1_ + no2_) * no3_) TextWindow.WriteLine (" your intelligence = ") TextWindow.Write ( INTELAGANCE) TextWindow.Read() 'strength TextWindow.WriteLine ("STRENGTH") TextWindow.WriteLine (" please insert dice roll no.1") TextWindow.ForegroundColor = "yellow" no1_ = TextWindow.Read() TextWindow.ForegroundColor = "white" TextWindow.WriteLine (" please insert dice roll no.2") TextWindow.ForegroundColor = "yellow" no2_ = TextWindow.Read() TextWindow.ForegroundColor = "white" TextWindow.WriteLine (" please insert dice roll no.3") TextWindow.ForegroundColor = "yellow" no3_ = TextWindow.Read() TextWindow.ForegroundColor = "white" STRENGHT = (( no1_ + no2_) * no3_) TextWindow.WriteLine (" your STRENGHT = ") TextWindow.Write ( STRENGHT) TextWindow.Read() 'speed TextWindow.WriteLine ("SPEED") TextWindow.WriteLine (" please insert dice roll no.1") TextWindow.ForegroundColor = "yellow" no1_ = TextWindow.Read() TextWindow.ForegroundColor = "white" TextWindow.WriteLine (" please insert dice roll no.2") TextWindow.ForegroundColor = "yellow" no2_ = TextWindow.Read() TextWindow.ForegroundColor = "white" TextWindow.WriteLine (" please insert dice roll no.3") TextWindow.ForegroundColor = "yellow" no3_ = TextWindow.Read() TextWindow.ForegroundColor = "white" SPEED = (( no1_ + no2_) * no3_) TextWindow.WriteLine (" your SPEED = ") TextWindow.Write ( SPEED) TextWindow.Read() 'overall skill (used for lock picking and combat scenarios and charm) TextWindow .WriteLine ("OVER ALL SKILL") TextWindow.WriteLine (" please insert dice roll no.1") TextWindow.ForegroundColor = "yellow" no1_ = TextWindow.Read() TextWindow.ForegroundColor = "white" TextWindow.WriteLine (" please insert dice roll no.2") TextWindow.ForegroundColor = "yellow" no2_ = TextWindow.Read() TextWindow.ForegroundColor = "white" TextWindow.WriteLine (" please insert dice roll no.3") TextWindow.ForegroundColor = "yellow" no3_ = TextWindow.Read() TextWindow.ForegroundColor = "white" SKILL = (( no1_ + no2_) * no3_) TextWindow.WriteLine (" your OVER ALL SKILL = ") TextWindow.Write ( SKILL) TextWindow.Read() TextWindow.WriteLine ("please wright these down - 1 speed if male +2 strength if male + 1 speed if female - 2 strength if female") TextWindow.WriteLine (" also if guardian -2 speed and + 2 strength and if ranger + 2 speed and -1 strength") TextWindow.Read() TextWindow.WriteLine (" if that is all then lets begin ") Goto chapter1 EndIf EndIf EndIf '////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 'this section is chapter 1 chapter1: TextWindow.Clear() TextWindow.WriteLine (" CHAPTER 1 ") TextWindow.ForegroundColor = "red" TextWindow.WriteLine("Greetings traveller") TextWindow.ForegroundColor = "white" TextWindow.WriteLine ("where am I?") TextWindow.ForegroundColor = "yellow" answer = TextWindow.Read() if answer = "where am I?" Then TextWindow.ForegroundColor = "red" TextWindow.WriteLine (" you don't remember. Ah you must have amnesia, not surprising you survived the fall at the battle of {12 stone pass} after the battle was over I brought you back here to the town of {Steadfast}. You have been asleep for 3 days. Are you sure you’re ok") TextWindow.ForegroundColor = "white" TextWindow.WriteLine ("yes") TextWindow.WriteLine ("no") TextWindow.ForegroundColor = "yellow" answer = TextWindow.Read() If answer = "yes" Then TextWindow.ForegroundColor = "red" TextWindow.WriteLine (" good I always had faith in you. tell you what tomorrow we can go to the blacksmith and see if we can get you some new weapons and armour. ") TextWindow.Read() Goto ifo elseIf answer = "no" Then TextWindow.ForegroundColor = "red" TextWindow.WriteLine (" well I’m sure you will feel beater in the morning. tell you what tomorrow we can go to the blacksmith and see if we can get you some new weapons and armour. ") TextWindow.Read() Goto ifo 'this section of chapter 1 allows the player to find out more about the world of "age of heroes" ifo: TextWindow.ForegroundColor = "red" TextWindow.WriteLine (" Is there anything you wish to know. ") TextWindow.ForegroundColor = "white" TextWindow.WriteLine ("12 stone pass") TextWindow.WriteLine ("Steadfast") TextWindow.ForegroundColor = "yellow" answer = TextWindow.Read() TSP: If answer = ("12 stone pass") Then TextWindow.ForegroundColor = "red" TextWindow.WriteLine (" The battle of the 12 stone pass started 3 years ago. You see it is called 12 stone pass because there are 12 stone statues of the great kings of {Iverstead} it is said that a great treasure of unforetold power lay dormant there amoxed the caverns and cavies of the mountain. Many a man went in search none returned. The true reasons for this battle are still un 'disclosed'. It is obvious the opposing sides (Iversted and the orks of the north) both wanted the untold power still dormant there. ") TextWindow.Read() Goto ate S: If answer = "Steadfast" then TextWindow.ForegroundColor = "red" TextWindow.WriteLine (" we are a small yet prosperous town. We have good trade roots meaning we always have the finest weapons and armour. We have good work here. Always work to be done somewhere. Especially after the war, the barracks are low on men and the blacksmith is working double time meet the damans of nabering cities.") TextWindow.Read() Goto ate ate: TextWindow.WriteLine ("anything else") TextWindow.WriteLine (" 12 stone pass ") TextWindow.WriteLine (" Iverstead ") TextWindow.WriteLine (" Steadfast ") TextWindow.WriteLine (" the iron ork ") TextWindow.WriteLine (" that’s all thank you ") TextWindow.ForegroundColor = "yellow" wn = TextWindow.Read() 'find out more "variables" If wn = "12 stone pass" Then Goto TSP elseIf wn = "Iverstead" Then Goto I elseIf wn = "Steadfast" Then Goto S elseIf wn = "the iron ork" Then Goto IO elseIf wn = "that’s all thank you" Then Goto TAT I: TextWindow.ForegroundColor = "red" TextWindow.WriteLine (" the once great kingdom of Iverstead had a mighty army but unfortunately so did the orks. At the battle of the 12 stone pass the last king of Iverstead Bellmore met his end at the hand of ko'seck the {iron ork}. after the battle was over the orks prevailed and made their final assault on Iverstead. un armed and with no leader they fled to the mountains all stragglers where left behind and subsequently ever killed or enslaved by the orks to rebuild their great walls and create monuments to their gods") TextWindow.Read() Goto ate IO: TextWindow.ForegroundColor = "red" TextWindow.WriteLine (" they call him the iron ork because of the great iron mines he builds and the mechanical body parts made of iron which are attached to him, which are: foot, left arm, right hand and skull. Some say he controlees these mechanical limbs by some week form of magic. We don't know for shore but he proseger which was done was by the necromancer Darek little is known about him") TextWindow.Read() Goto ate TAT: TextWindow.ForegroundColor = "red" TextWindow.WriteLine (" If that is all then I'm of to bed you should do the same. ") TextWindow.ForegroundColor = " yellow" TextWindow.Read() Goto chapter2 EndIf EndIf EndIf EndIf EndIf 'in this section the player can record there progress and coppy out their save code which can be entered in the load save section line "70" chapter2: TextWindow.WriteLine("your save code is {save001} ") TextWindow.Pause() TextWindow.Clear() Goto chapter2b save1: '////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ 'the following is chapter 2 chapter2b: TextWindow.ForegroundColor = "white" TextWindow.Clear() TextWindow.WriteLine (" CHAPTER 2 ") textWindow.Read() TextWindow.Clear() TextWindow.ForegroundColor = "white" 'the player earns the following and should record it on score sheet TextWindow.WriteLine (" congratulations you are now level (2). you gain:") TextWindow.PauseWithoutMessage() TextWindow.WriteLine ("set of wrags top and bottom peice") TextWindow.PauseWithoutMessage() TextWindow.WriteLine (" daggar (attack value d6 -2) sneek attacks only") TextWindow.PauseWithoutMessage() TextWindow.WriteLine ("leather belt (3 accsessory slots) and holster (for daggar)") TextWindow.PauseWithoutMessage() TextWindow.WriteLine ("pouch (15 slots)") TextWindow.PauseWithoutMessage() TextWindow.WriteLine (" your hp = 45 (not including armour) ") textwindow.PauseWithoutMessage() TextWindow.WriteLine (" It is advised you write these down.") TextWindow.PauseWithoutMessage() TextWindow.WriteLine (" ") TextWindow.PauseWithoutMessage() 'learning basic movement controls (theretical movement in game no keys "area spawn movement" or ASP) TextWindow.WriteLine (" Before we continue you need to know the basics of moving and disision making. for example if you wish to go to the black smiths of stead fast then you say 'Goto: black smiths of stedfast") TextWindow.WriteLine (" but you will still have aq multiple choise question though so you must choise from your list.") TextWindow.WriteLine (" where do you want to go ") TextWindow.WriteLine (" blacksmiths of steadfast ") TextWindow.ForegroundColor = "yellow" d = TextWindow.Read() 'first movement If d = "Goto: blacksmiths of steadfast" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine (" you arive at the blacksmiths of steadfast where you are greated by the elderly man you met last night, as you look around you notice that the blacksmith's shack is fairly new and made from decent matirials. it mesures about 10ft (length) by 15ft (width) by 10ft (hight). to the right you see an iron forge with a midleaged man (in his 30') hammering a newly forged sword. ") TextWindow.WriteLine (" what do you do ") TextWindow.WriteLine ("speak to old man") TextWindow.ForegroundColor = "yellow" c = TextWindow.Read() EndIf If c = "speak to old man" then TextWindow.ForegroundColor = "red" TextWindow.WriteLine (" hellow again so here we are at the magnificent blacksmiths of steadfast, now i promised you that new gear so go on and speek to the blacksmith ") TextWindow.ForegroundColor = "yellow" TextWindow.Read() Goto cs 'conversation with BLACKSMITH start cs: TextWindow.ForegroundColor = "white" TextWindow.WriteLine (" what do you say ") TextWindow.WriteLine ("nice forge you got there") TextWindow.WriteLine (" ") TextWindow.WriteLine ("/for the following option type (greatings) without the brackets to tell the blacksmith your name and your buisness here {to get weponds and armour}/ ") TextWindow.ForegroundColor = "yellow" cs = TextWindow.Read() If cs = "greatings" then TextWindow.ForegroundColor = "green" TextWindow.WriteLine (" greatings travelor I am charles the owner of this forge if it is weponds and armour you seek I pride myself in selling the best weponds in steadfast") TextWindow.ForegroundColor = "yellow" TextWindow.Read() Goto om ElseIf cs = "nice forge you got there" then TextWindow.ForegroundColor = "green" TextWindow.WriteLine (" Thankyou travelor, this forge was owned by my great grandfather's great grandfarther so it has been through a lot but it hangs in there since it was lit over 3 hundred years ago by the flame has never gone out as it was lit by a dragon who went by the name Salohcin. As the flame of this fire was lit by a dragon the quolity of the things I can make knows no bounderise and is not comparable to any other. So if it is weponds and armour you seek I pride myself in selling the best weponds in steadfast") TextWindow.ForegroundColor = "yellow" TextWindow.Read() Goto om EndIf EndIf om: TextWindow.ForegroundColor = "white" TextWindow.WriteLine (" the old man interupts ") TextWindow.PauseWithoutMessage() TextWindow.ForegroundColor = "red" TextWindow.WriteLine (" yes the travelor is, sorry to inturupt I am buying for this travelor") TextWindow.PauseWithoutMessage() TextWindow.ForegroundColor = "green" TextWindow.WriteLine (" oh is that right well what do you require ") TextWindow.PauseWithoutMessage() TextWindow.ForegroundColor = "white" TextWindow.WriteLine (" enter your faction") TextWindow.ForegroundColor = "white" TextWindow.WriteLine ("ranger") TextWindow.WriteLine ("guardian") TextWindow.ForegroundColor = "yellow" faction = TextWindow.Read() TextWindow.ForegroundColor = "white" 'start of GEAR PURCHASE If faction = "ranger" Then TextWindow.ForegroundColor = "green" TextWindow.WriteLine (" I think I'll have what you need... hmm it's around here somwhere") TextWindow.Read() TextWindow.ForegroundColor = "white" TextWindow.WriteLine ("The blacksmith gose into the cabin and rumages around a chest...") TextWindow.WriteLine (" 2 miniuts later ") TextWindow.WriteLine (" the blacksmith pulls out of a chest a long bow with many orkish inscriptians, and places them on a table then gose to a chest of draws and takes out leather armour (Chest plate, guntlets, helmet, and a pair of hide boots). ") TextWindow.ForegroundColor = "green" TextWindow.PauseWithoutMessage() TextWindow.WriteLine ("Ah these should do fine for a ranger like yourself.") TextWindow.PauseWithoutMessage() Goto op If faction = "guardian" Then TextWindow.ForegroundColor = "green" TextWindow.WriteLine (" I think I'll have what you need... hmm it's around here somwhere") TextWindow.Read() TextWindow.ForegroundColor = "white" TextWindow.WriteLine ("The blacksmith gose into the cabin and rumages around a chest...") TextWindow.WriteLine (" 2 miniuts later ") TextWindow.WriteLine (" the blacksmith pulls out of a chest a great sword, and place it on a table then gose to a second chest and takes out leather overalls and a set of iron armour (breast plate, guntlets, helmet, and a of iron boots). ") TextWindow.ForegroundColor = "green" TextWindow.PauseWithoutMessage() TextWindow.WriteLine ("Ah these should do fine for a guardian like yourself.") TextWindow.PauseWithoutMessage() Goto op op: TextWindow.ForegroundColor = "white" TextWindow.WriteLine ("review stats for ranger") TextWindow.WriteLine ("review stats for guardian") TextWindow.WriteLine ("continue to purchase") TextWindow.ForegroundColor = "yellow" response1 = TextWindow.Read() 'the following is GEAR PURCHASE and GEAR STATISTICS If response1 = "continue to purchase" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine ("the old man asks the blacksmith how much it costs in total. In response the blacksmith replys 15 gold. The old man gives the blacksmith the money") TextWindow.PauseWithoutMessage() Goto response1 'wepon stats for ranger if player mad choise was (continue to purchase) response1: TextWindow.WriteLine ("these are your wepon stats") TextWindow.WriteLine ("Orkis longbow ______________________________________ damage (with arrows only) = 1x d6 + 3, accuracy = 1x d6 -1 ") TextWindow.WriteLine ("orkish arrows (x25) ________________________________ damage = damage +1") TextWindow.WriteLine ("leather chest plate ________________________________ armour = 3, speed reduction = 2 ") TextWindow.WriteLine ("leather braces _____________________________________ armour = 1, speed reduction = 1 ") TextWindow.WriteLine ("enchanted hide boots of swiftness___________________ armour = 1, speed = speed +5") TextWindow.WriteLine ("enchanted hide helmet of swiftness__________________ armour = 1, speed = speed +5") TextWindow.PauseWithoutMessage() Goto convosationend TextWindow.WriteLine ("") TextWindow.WriteLine ("or if guardian") TextWindow.WriteLine ("") 'these are the wepon stats for guardian if player choise was (continue to purchase) TextWindow.WriteLine ("then these are your wepon stats if guadian") TextWindow.WriteLine ("steel great sword _______________ damage = 1x d6 + 6 ") TextWindow.WriteLine ("iron breast plate ____________________ armour = 5, speed reduction = 5 +1") TextWindow.WriteLine ("iron guantlets _______________________ armour = 2, speed reduction = 2 ") TextWindow.WriteLine ("iron boots ___________________________ armour = 2, speed = speed + 3 ") TextWindow.WriteLine ("leather overals ______________________ armour = 1, speed reduction = 0") TextWindow.PauseWithoutMessage() Goto convosationend 'the following is wepon stats for ranger If response1 = "review stats for ranger" Then TextWindow.WriteLine ("these are your wepon stats") TextWindow.WriteLine ("Orkis longbow ______________________________________ damage (with arrows only) = 1x d6 + 3, accuracy = 1x d6 -1 ") TextWindow.WriteLine("orkish arrows (x25) _________________________________ damage = damage +1") TextWindow.WriteLine ("leather chest plate ________________________________ armour = 3, speed reduction = 2 ") TextWindow.WriteLine ("leather braces _____________________________________ armour = 1, speed reduction = 1 ") TextWindow.WriteLine ("enchanted hide boots of swiftness___________________ armour = 1, speed = speed +5") TextWindow.WriteLine ("enchanted hide helmet of swiftness__________________ armour = 1, speed = speed +5") TextWindow.PauseWithoutMessage() Goto continue1 'thefollowing is wepon stats for guardian If response1 = "review stats for guardian" Then TextWindow.WriteLine ("these are your wepon stats") TextWindow.WriteLine ("steel great sword _______________ damage = 1x d6 + 6 ") TextWindow.WriteLine ("iron breast plate _______________ armour = 5, speed reduction = 5 +1") TextWindow.WriteLine ("iron guantlets __________________ armour = 2, speed reduction = 2 ") TextWindow.WriteLine ("iron boots ______________________ armour = 2, speed = speed + 3 ") TextWindow.WriteLine ("leather overals _________________ armour = 1, speed reduction = 0") TextWindow.PauseWithoutMessage() Goto continue1 continue1: textWindow.ForegroundColor = "white" TextWindow.WriteLine ("the old man asks the blacksmith how much it costs in total. In response the blacksmith replys 15 gold. The old man gives the blacksmith the money") TextWindow.PauseWithoutMessage() Goto convosationend EndIf EndIf EndIf EndIf EndIf convosationend: TextWindow.WriteLine("your save code is {save002} ") TextWindow.Pause() TextWindow.Clear() save002: '//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// '\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ TextWindow.ForegroundColor = "white" TextWindow.Read() TextWindow.Clear() TextWindow.WriteLine (" CHAPTER 3 ") textWindow.Read() TextWindow.Clear() TextWindow.ForegroundColor = "white" 'end of convosation with blacksmith TextWindow.ForegroundColor = "green" TextWindow.WriteLine ("thankyou for your purchase feel free to come back any time") TextWindow.PauseWithoutMessage() TextWindow.Clear() TextWindow.ForegroundColor = "white" 'START MISSION (1) THE ROUGE TRAINING DUMMY 'the training area discription TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" You leave the blacksmith fully kited out with your new gear and as you are walking back to the old man's house you see a training yard to the left of you. it is about 20ft by 20 ft and the grass there has been word down to bare earth. around the periminter there is a wooden fence. In the center there is 3 training dumbies. There are two men in there fighting the training dumbies one to the left one and the other man on the right one.") TextWindow.PauseWithoutMessage() TextWindow.ForegroundColor = "red" TextWindow.WriteLine (" you should go and battle one to") 'entering training area BRAWL START TextWindow.PauseWithoutMessage() TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" as you aproch you notice that all the trainign dumbies are enchanted to fight back. (they are not disighned to kill you, just fight)") TextWindow.WriteLine(" target hp = 20 ") TextWindow.WriteLine(" 4 armour all over in body sector 1, 2, 3, 4, 5 and 6.") TextWindow.WriteLine(" the dummies sword is a d6 + 1 ") TextWindow.WriteLine(" when the target runs out of hp there will be a blank line, in that line type type (target killed) if you run out of hp there will be a blank line there you must type (hp = 0) you will be able to type this after every attack onto you or the ennamy 4 ") 'the following goto is used to make a loop untill target "dummy" or player is killed battlecontunue: TextWindow.WriteLine(" what do you do ") TextWindow.WriteLine(" ") TextWindow.WriteLine("close range attack (only avalable at this point if guardian)") TextWindow.WriteLine("long range attack (only avalable at this point if ranger) ") TextWindow.ForegroundColor = "yellow" attack = TextWindow.Read() TextWindow.ForegroundColor = "white" If attack = "close range attack" Then Goto hits ElseIf attack = "long range attack" then Goto hits2 'battle sequnce for close range attack 'only avalable in this battle if guardian hits: TextWindow.WriteLine("role for where you hit") TextWindow.ForegroundColor = "yellow" hit = TextWindow.ReadNumber() TextWindow.ForegroundColor = "white" 'rfp = role fo penetration If hit = "1" Then TextWindow.WriteLine(" You hit the head ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy ElseIf hit = "2" Then TextWindow.WriteLine(" You hit the right arm ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy ElseIf hit = "3" Then TextWindow.WriteLine(" You hit the left arm ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy ElseIf hit = "4" Then textWindow.WriteLine("You hit the left leg ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy ElseIf hit = "5" Then TextWindow.WriteLine(" You hit the right leg ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy ElseIf hit = "6" then TextWindow.WriteLine(" You hit the heart ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy penetrationonesennamy: TextWindow.WriteLine("roll for penetration") TextWindow.WriteLine("4 or more = penetration") TextWindow.ForegroundColor= "yellow" pen = TextWindow.Read() TextWindow.ForegroundColor = "white" If pen = 1 or pen = 2 or pen = 3 then Goto next TextWindow.PauseWithoutMessage() TextWindow.ForegroundColor= "white" ElseIf pen = 4 or pen = 5 or pen = 6 then TextWindow.WriteLine(" you penetrated it's armour ") TextWindow.PauseWithoutMessage() Goto winbattlecontinue next: TextWindow.WriteLine(" You did not penetrate ") TextWindow.PauseWithoutMessage() Goto penetration penetration: textwindow.WriteLine("the dummy swngs his sword at you.") TextWindow.WriteLine("roll for where the dummy hits ") TextWindow.ForegroundColor = "yellow" dhit = TextWindow.Read() If dhit = "1" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your head ") TextWindow.PauseWithoutMessage() Goto rfpd ElseIf dhit = "2" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your right arm ") TextWindow.PauseWithoutMessage() Goto rfpd ElseIf dhit = "3" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your left arm ") TextWindow.PauseWithoutMessage() Goto rfpd ElseIf dhit = "4" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your left leg ") TextWindow.PauseWithoutMessage() Goto rfpd ElseIf dhit = "5" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your right leg ") TextWindow.PauseWithoutMessage() Goto rfpd ElseIf dhit = "6" then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your heart ") TextWindow.PauseWithoutMessage() Goto rfpd rfpd: TextWindow.PauseWithoutMessage() TextWindow.WriteLine("roll for penetration") TextWindow.ForegroundColor= "yellow" dpen1 = TextWindow.ReadNumber() TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" what dose the dummy need to penertrate you armour in the sector designated") TextWindow.ForegroundColor = "yellow" wdntopen = TextWindow.ReadNumber() TextWindow.ForegroundColor = "white" If dpen1 > wdntopen or dpen1 = wdntopen then TextWindow.PauseWithoutMessage() TextWindow.WriteLine(" It penetrated your armour ") Goto battlecontunue1 ElseIf dpen1 < wdntopen then TextWindow.WriteLine(" It did not penetrate your armour ") TextWindow.PauseWithoutMessage() Goto hits battlecontunue1: TextWindow.ForegroundColor = "white" textWindow.WriteLine("roll for damage") TextWindow.ForegroundColor = "yellow" damage = TextWindow.Read() TextWindow.ForegroundColor = "white" If damage = "1" then TextWindow.WriteLine(" you take 1/45 damage") attack = TextWindow.Read() Goto hits ElseIf damage = "2" then TextWindow.WriteLine(" you take 2/45 damage") attack = TextWindow.Read() Goto hits ElseIf damage = "3" then TextWindow.WriteLine(" you take 3/45 damage") attack = TextWindow.Read() Goto hits ElseIf damage = "4" then TextWindow.WriteLine(" you take 4/45 damage") attack = TextWindow.Read() Goto hits ElseIf damage = "5" then TextWindow.WriteLine("you take 5/45 damage") attack = TextWindow.Read() Goto hits ElseIf damage = "6" then TextWindow.WriteLine(" you take 6/45 damage") attack = TextWindow.Read() Goto hits ElseIf damage = "7" then TextWindow.WriteLine(" you take 7/45 damage") attack = TextWindow.Read() Goto hits winbattlecontinue: TextWindow.ForegroundColor = "white" TextWindow.WriteLine("roll for damage") TextWindow.ForegroundColor = "yellow" damage = TextWindow.Read() TextWindow.ForegroundColor = "white" If damage = "1" then TextWindow.WriteLine("the target takes 1/20 damage") attack = TextWindow.Read() ElseIf damage = "2" then TextWindow.WriteLine("the target takes 2/20 damage") attack = TextWindow.Read() ElseIf damage = "3" then TextWindow.WriteLine("the target takes 3/20 damage") attack = TextWindow.Read() ElseIf damage = "4" then TextWindow.WriteLine("the target takes 4/20 damage") attack = TextWindow.Read() ElseIf damage = "5" then TextWindow.WriteLine("the target takes 5/20 damage") attack = TextWindow.Read() ElseIf damage = "6" then TextWindow.WriteLine("the target takes 6/20 damage") attack = TextWindow.Read() ElseIf damage = "7" then TextWindow.WriteLine("the target takes 7/20 damage") attack = TextWindow.Read() ElseIf damage = "8" then TextWindow.WriteLine("the target takes 8/20 damage") attack = TextWindow.Read() ElseIf damage = "9" then TextWindow.WriteLine("the target takes 9/20 damage") attack = TextWindow.Read() ElseIf damage = "10" then TextWindow.WriteLine("the target takes 10/20 damage") attack = TextWindow.Read() ElseIf damage = "11" then TextWindow.WriteLine("the target takes 11/20 damage") attack = TextWindow.Read() ElseIf damage = "12" then TextWindow.WriteLine("the target takes 12/20 damage") attack = TextWindow.Read() TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits 'only avalable if ranger hits2: TextWindow.WriteLine("role for where you hit") TextWindow.ForegroundColor = "yellow" hit2 = TextWindow.ReadNumber() TextWindow.ForegroundColor = "white" 'rfp = role fo penetration If hit2 = "1" Then TextWindow.WriteLine(" You hit the head ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy ElseIf hit2 = "2" Then TextWindow.WriteLine(" You hit the right arm ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy ElseIf hit2 = "3" Then TextWindow.WriteLine(" You hit the left arm ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy ElseIf hit2 = "4" Then textWindow.WriteLine("You hit the left leg ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy ElseIf hit2 = "5" Then TextWindow.WriteLine(" You hit the right leg ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy ElseIf hit2 = "6" then TextWindow.WriteLine(" You hit the heart ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy2 penetrationonesennamy2: TextWindow.WriteLine("roll for penetration") TextWindow.WriteLine("4 or more = penetration") TextWindow.ForegroundColor= "yellow" pen2 = TextWindow.Read() TextWindow.ForegroundColor = "white" If pen2 = 1 or pen2 = 2 or pen2 = 3 then Goto next2 TextWindow.PauseWithoutMessage() TextWindow.ForegroundColor= "white" ElseIf pen2 = 4 or pen2 = 5 or pen2 = 6 then TextWindow.WriteLine(" you penetrated it's armour ") TextWindow.PauseWithoutMessage() Goto winbattlecontinue2 next2: TextWindow.WriteLine(" You did not penetrate ") TextWindow.PauseWithoutMessage() Goto penetration2 penetration2: textwindow.WriteLine("the dummy swngs his sword at you.") TextWindow.WriteLine("roll for where the dummy hits ") TextWindow.ForegroundColor = "yellow" dhit2 = TextWindow.Read() TextWindow.ForegroundColor = "white" If dhit2 = "1" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your head ") TextWindow.PauseWithoutMessage() Goto rfpd2 ElseIf dhit2 = "2" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your right arm ") TextWindow.PauseWithoutMessage() Goto rfpd2 ElseIf dhit2 = "3" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your left arm ") TextWindow.PauseWithoutMessage() Goto rfpd ElseIf dhit2 = "4" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your left leg ") TextWindow.PauseWithoutMessage() Goto rfpd2 ElseIf dhit2 = "5" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your right leg ") TextWindow.PauseWithoutMessage() Goto rfpd2 ElseIf dhit2 = "6" then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your heart ") TextWindow.PauseWithoutMessage() Goto rfpd2 rfpd2: TextWindow.PauseWithoutMessage() TextWindow.WriteLine("roll for penetration") TextWindow.ForegroundColor= "yellow" dpen2 = TextWindow.ReadNumber() TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" what dose the dummy need to penertrate you armour in the sector designated") TextWindow.ForegroundColor = "yellow" wdntopen2 = TextWindow.ReadNumber() TextWindow.ForegroundColor = "white" If dpen2 > wdntopen2 or dpen1 = wdntopen then TextWindow.PauseWithoutMessage() TextWindow.WriteLine(" It penetrated your armour ") Goto battlecontunue1 ElseIf dpen2 < wdntopen2 then TextWindow.WriteLine(" It did not penetrate your armour ") TextWindow.PauseWithoutMessage() Goto hits2 battlecontunue2: TextWindow.ForegroundColor = "white" textWindow.WriteLine("roll for damage") TextWindow.ForegroundColor = "yellow" damage2 = TextWindow.Read() TextWindow.ForegroundColor = "white" If damage2 = "1" then TextWindow.WriteLine(" you take 1/45 damage") attack = TextWindow.Read() ElseIf damage2 = "2" then TextWindow.WriteLine(" you take 2/45 damage") attack = TextWindow.Read() ElseIf damage2 = "3" then TextWindow.WriteLine(" you take 3/45 damage") attack = TextWindow.Read() ElseIf damage2 = "4" then TextWindow.WriteLine(" you take 4/45 damage") attack = TextWindow.Read() ElseIf damage2 = "5" then TextWindow.WriteLine("you take 5/45 damage") attack = TextWindow.Read() ElseIf damage2 = "6" then TextWindow.WriteLine(" you take 6/45 damage") attack = TextWindow.Read() ElseIf damage2 = "7" then TextWindow.WriteLine(" you take 7/45 damage") attack = TextWindow.Read() Goto hits2 winbattlecontinue2: TextWindow.ForegroundColor = "white" TextWindow.WriteLine("roll for damage") TextWindow.ForegroundColor = "yellow" damage2 = TextWindow.Read() TextWindow.ForegroundColor = "white" If damage2 = "1" then TextWindow.WriteLine("the target takes 1/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits2 attack = TextWindow.Read() ElseIf damage2 = "2" then TextWindow.WriteLine("the target takes 2/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits2 attack = TextWindow.Read() ElseIf damage2 = "3" then TextWindow.WriteLine("the target takes 3/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits2 attack = TextWindow.Read() ElseIf damage2 = "4" then TextWindow.WriteLine("the target takes 4/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits2 attack = TextWindow.Read() ElseIf damage2 = "5" then TextWindow.WriteLine("the target takes 5/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits2 attack = TextWindow.Read() ElseIf damage2 = "6" then TextWindow.WriteLine("the target takes 6/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits2 attack = TextWindow.Read() TextWindow.PauseWithoutMessage() ElseIf damage2 = "7" then TextWindow.WriteLine("the target takes 7/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits2 attack = TextWindow.Read() ElseIf damage2 = "8" then TextWindow.WriteLine("the target takes 8/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits2 attack = TextWindow.Read() ElseIf damage2 = "9" then TextWindow.WriteLine("the target takes 9/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits2 attack = TextWindow.Read() ElseIf damage2 = "10" then TextWindow.WriteLine("the target takes 10/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits2 attack = TextWindow.Read() ElseIf damage2 = "11" then TextWindow.WriteLine("the target takes 11/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits2 attack = TextWindow.Read() ElseIf damage2 = "12" then TextWindow.WriteLine("the target takes 12/20 damage") attack = TextWindow.Read() TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits2 If attack = "hp = 0" then TextWindow.WriteLine(" the old man steps in and pushes the dummy out of the way as it was about to deal the killing attack") TextWindow.WriteLine("the dummy runs of with his wepon with incredible speed jumping from building to building") TextWindow.WriteLine("The old man gives you a healing potion and tells you to get after him and he shall follow") TextWindow.PauseWithoutMessage() Goto chapter4 If attack = "target killed" then TextWindow.WriteLine(" the dummy falls down to the ground. when you lower your wepon and turn away it stands up again and puts it's sword around your neck from behind you. All the other trainers run off in fear") TextWindow.WriteLine("the dummy runs of with his wepon with incredible speed jumping from building to building") TextWindow.WriteLine("The old man gives you a healing potion and tells you to get after him and he shall follow") TextWindow.PauseWithoutMessage() Goto chapter4 EndIf Endif EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf TextWindow.ForegroundColor = "white" chapter4: TextWindow.Clear() TextWindow.WriteLine("your save code is save003") TextWindow.PauseWithoutMessage() save003: TextWindow.Clear() TextWindow.WriteLine(" Chapter 4 ") TextWindow.WriteLine("") TextWindow.PauseWithoutMessage() TextWindow.WriteLine("Final chapeter") TextWindow.PauseWithoutMessage() TextWindow.WriteLine("Of version 1.0") TextWindow.PauseWithoutMessage() TextWindow.Clear() TextWindow.WriteLine(".....................................................") TextWindow.WriteLine(" After about 10 miniuts of persute you find that the dummy has stopped by the lake side") TextWindow.WriteLine(" It turns around and draws It's wepon ") TextWindow.WriteLine(".....................................................") TextWindow.WriteLine("Suddenly a large burst of enery pourse out of him") TextWindow.WriteLine("A blast of yellow light so bright and hot you turn away") TextWindow.WriteLine("you must destroy this") TextWindow.WriteLine("somehow you know if it continues... the steadfast shall be eliminated") TextWindow.WriteLine("you think back to somthing the old man said to you just before you left") TextWindow.WriteLine("he said that not all training dummies will stop, as you have seen some carry on") TextWindow.WriteLine("it has only been roomerd to happen before, but it is said that a curse is placed on one by a trickster") TextWindow.WriteLine("you relate that to this situsation and realise that it can't be a mear trickster, this feels dark, and evil whatever it is.. it must be stoped") TextWindow.PauseWithoutMessage() TextWindow.WriteLine(" what do you do ") TextWindow.WriteLine("{due to the burst of energy the dummy's attack is now d6 = 4}") TextWindow.WriteLine(" ") TextWindow.WriteLine("close range attack (only avalable at this point if guardian)") TextWindow.WriteLine("long range attack (only avalable at this point if ranger) ") TextWindow.ForegroundColor = "yellow" attackagain = TextWindow.Read() TextWindow.ForegroundColor = "white" If attackagain = "close range attack" Then Goto hits3 ElseIf attackagain = "long range attack" then Goto hits4 'battle sequnce for close range attack 'only avalable in this battle if guardian hits3: TextWindow.WriteLine("role for where you hit") TextWindow.ForegroundColor = "yellow" hit3 = TextWindow.ReadNumber() TextWindow.ForegroundColor = "white" 'rfp = role fo penetration If hit3 = "1" Then TextWindow.WriteLine(" You hit the head ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy3 ElseIf hit3 = "2" Then TextWindow.WriteLine(" You hit the right arm ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy3 ElseIf hit3 = "3" Then TextWindow.WriteLine(" You hit the left arm ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy3 ElseIf hit3 = "4" Then textWindow.WriteLine("You hit the left leg ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy3 ElseIf hit3 = "5" Then TextWindow.WriteLine(" You hit the right leg ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy3 ElseIf hit3 = "6" then TextWindow.WriteLine(" You hit the heart ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy3 penetrationonesennamy3: TextWindow.WriteLine("roll for penetration") TextWindow.WriteLine("4 or more = penetration") TextWindow.ForegroundColor= "yellow" pen3 = TextWindow.Read() TextWindow.ForegroundColor = "white" If pen3 = 1 or pen3 = 2 or pen3 = 3 then Goto next3 TextWindow.PauseWithoutMessage() TextWindow.ForegroundColor= "white" ElseIf pen3 = 4 or pen3 = 5 or pen3 = 6 then TextWindow.WriteLine(" you penetrated it's armour ") TextWindow.PauseWithoutMessage() Goto winbattlecontinue3 next3: TextWindow.WriteLine(" You did not penetrate ") TextWindow.PauseWithoutMessage() Goto penetration3 penetration3: textwindow.WriteLine("the dummy swngs his sword at you.") TextWindow.WriteLine("roll for where the dummy hits ") TextWindow.ForegroundColor = "yellow" dhit3 = TextWindow.Read() If dhit3 = "1" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your head ") TextWindow.PauseWithoutMessage() Goto rfpd3 ElseIf dhit3 = "2" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your right arm ") TextWindow.PauseWithoutMessage() Goto rfpd3 ElseIf dhit3 = "3" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your left arm ") TextWindow.PauseWithoutMessage() Goto rfpd3 ElseIf dhit3 = "4" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your left leg ") TextWindow.PauseWithoutMessage() Goto rfpd3 ElseIf dhit3 = "5" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your right leg ") TextWindow.PauseWithoutMessage() Goto rfpd3 ElseIf dhit3 = "6" then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your heart ") TextWindow.PauseWithoutMessage() Goto rfpd3 rfpd3: TextWindow.PauseWithoutMessage() TextWindow.WriteLine("roll for penetration") TextWindow.ForegroundColor= "yellow" dpen3 = TextWindow.ReadNumber() TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" what dose the dummy need to penertrate you armour in the sector designated") TextWindow.ForegroundColor = "yellow" wdntopen3 = TextWindow.ReadNumber() TextWindow.ForegroundColor = "white" If dpen3 > wdntopen3 or dpen3 = wdntopen3 then TextWindow.PauseWithoutMessage() TextWindow.WriteLine(" It penetrated your armour ") Goto battlecontunue3 ElseIf dpen3 < wdntopen3 then TextWindow.WriteLine(" It did not penetrate your armour ") TextWindow.PauseWithoutMessage() Goto hits3 battlecontunue3: TextWindow.ForegroundColor = "white" textWindow.WriteLine("roll for damage") TextWindow.ForegroundColor = "yellow" damage3 = TextWindow.Read() TextWindow.ForegroundColor = "white" If damage3 = "1" then TextWindow.WriteLine(" you take 1/45 damage") attack3 = TextWindow.Read() Goto hits3 ElseIf damage3 = "2" then TextWindow.WriteLine(" you take 2/45 damage") attack3 = TextWindow.Read() Goto hits3 ElseIf damage3 = "3" then TextWindow.WriteLine(" you take 3/45 damage") attack3 = TextWindow.Read() Goto hits3 ElseIf damage3 = "4" then TextWindow.WriteLine(" you take 4/45 damage") attack3 = TextWindow.Read() Goto hits3 ElseIf damage3 = "5" then TextWindow.WriteLine("you take 5/45 damage") attack3 = TextWindow.Read() Goto hits3 ElseIf damage3 = "6" then TextWindow.WriteLine(" you take 6/45 damage") attack3 = TextWindow.Read() Goto hits3 ElseIf damage3 = "7" then TextWindow.WriteLine(" you take 7/45 damage") attack3 = TextWindow.Read() Goto hits3 winbattlecontinue3: TextWindow.ForegroundColor = "white" TextWindow.WriteLine("roll for damage") TextWindow.ForegroundColor = "yellow" damage3 = TextWindow.Read() TextWindow.ForegroundColor = "white" If damage3 = "1" then TextWindow.WriteLine("the target takes 1/20 damage") attack3 = TextWindow.Read() TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") Goto hits3 ElseIf damage3 = "2" then TextWindow.WriteLine("the target takes 2/20 damage") attack3 = TextWindow.Read() TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") Goto hits3 ElseIf damage3 = "3" then TextWindow.WriteLine("the target takes 3/20 damage") attack3 = TextWindow.Read() TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") Goto hits3 ElseIf damage3 = "4" then TextWindow.WriteLine("the target takes 4/20 damage") attack3 = TextWindow.Read() TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") Goto hits3 ElseIf damage3 = "5" then TextWindow.WriteLine("the target takes 5/20 damage") attack3 = TextWindow.Read() TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") Goto hits3 ElseIf damage3 = "6" then TextWindow.WriteLine("the target takes 6/20 damage") attack3 = TextWindow.Read() TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") Goto hits3 ElseIf damage3 = "7" then TextWindow.WriteLine("the target takes 7/20 damage") attack3 = TextWindow.Read() TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") Goto hits3 ElseIf damage3 = "8" then TextWindow.WriteLine("the target takes 8/20 damage") attack3 = TextWindow.Read() TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") Goto hits3 ElseIf damage3 = "9" then TextWindow.WriteLine("the target takes 9/20 damage") attack3 = TextWindow.Read() TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") Goto hits3 ElseIf damage3 = "10" then TextWindow.WriteLine("the target takes 10/20 damage") attack3 = TextWindow.Read() TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") Goto hits3 ElseIf damage3 = "11" then TextWindow.WriteLine("the target takes 11/20 damage") attack3 = TextWindow.Read() TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") Goto hits3 ElseIf damage3 = "12" then TextWindow.WriteLine("the target takes 12/20 damage") attack3 = TextWindow.Read() TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits3 'only avalable if ranger hits4: TextWindow.WriteLine("role for where you hit") TextWindow.ForegroundColor = "yellow" hit4 = TextWindow.ReadNumber() TextWindow.ForegroundColor = "white" 'rfp = role fo penetration If hit4 = "1" Then TextWindow.WriteLine(" You hit the head ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy4 ElseIf hit4 = "2" Then TextWindow.WriteLine(" You hit the right arm ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy4 ElseIf hit4 = "3" Then TextWindow.WriteLine(" You hit the left arm ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy4 ElseIf hit4 = "4" Then textWindow.WriteLine("You hit the left leg ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy4 ElseIf hit4 = "5" Then TextWindow.WriteLine(" You hit the right leg ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy4 ElseIf hit4 = "6" then TextWindow.WriteLine(" You hit the heart ") TextWindow.PauseWithoutMessage() Goto penetrationonesennamy4 penetrationonesennamy4: TextWindow.WriteLine("roll for penetration") TextWindow.WriteLine("4 or more = penetration") TextWindow.ForegroundColor= "yellow" pen4 = TextWindow.Read() TextWindow.ForegroundColor = "white" If pen4 = 1 or pen4 = 2 or pen4 = 3 then Goto next4 TextWindow.PauseWithoutMessage() TextWindow.ForegroundColor= "white" ElseIf pen4 = 4 or pen4 = 5 or pen4 = 6 then TextWindow.WriteLine(" you penetrated it's armour ") TextWindow.PauseWithoutMessage() Goto winbattlecontinue4 next4: TextWindow.WriteLine(" You did not penetrate ") TextWindow.PauseWithoutMessage() Goto penetration4 penetration4: textwindow.WriteLine("the dummy swngs his sword at you.") TextWindow.WriteLine("roll for where the dummy hits ") TextWindow.ForegroundColor = "yellow" dhit4 = TextWindow.Read() TextWindow.ForegroundColor = "white" If dhit4 = "1" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your head ") TextWindow.PauseWithoutMessage() Goto rfpd4 ElseIf dhit4 = "2" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your right arm ") TextWindow.PauseWithoutMessage() Goto rfpd4 ElseIf dhit4 = "3" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your left arm ") TextWindow.PauseWithoutMessage() Goto rfpd4 ElseIf dhit4 = "4" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your left leg ") TextWindow.PauseWithoutMessage() Goto rfpd4 ElseIf dhit4 = "5" Then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your right leg ") TextWindow.PauseWithoutMessage() Goto rfpd4 ElseIf dhit4 = "6" then TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" the dummy hit your heart ") TextWindow.PauseWithoutMessage() Goto rfpd4 rfpd4: TextWindow.PauseWithoutMessage() TextWindow.WriteLine("roll for penetration") TextWindow.ForegroundColor= "yellow" dpen4 = TextWindow.ReadNumber() TextWindow.ForegroundColor = "white" TextWindow.WriteLine(" what dose the dummy need to penertrate you armour in the sector designated") TextWindow.ForegroundColor = "yellow" wdntopen4 = TextWindow.ReadNumber() TextWindow.ForegroundColor = "white" If dpen4 > wdntopen4 or dpen4 = wdntopen4 then TextWindow.PauseWithoutMessage() TextWindow.WriteLine(" It penetrated your armour ") Goto battlecontunue4 ElseIf dpen4 < wdntopen4 then TextWindow.WriteLine(" It did not penetrate your armour ") TextWindow.PauseWithoutMessage() Goto hits4 battlecontunue4: TextWindow.ForegroundColor = "white" textWindow.WriteLine("roll for damage") TextWindow.ForegroundColor = "yellow" damage4 = TextWindow.Read() TextWindow.ForegroundColor = "white" If damage4 = "1" then TextWindow.WriteLine(" you take 1/45 damage") attack4 = TextWindow.Read() ElseIf damage4 = "2" then TextWindow.WriteLine(" you take 2/45 damage") attack = TextWindow.Read() ElseIf damage4 = "3" then TextWindow.WriteLine(" you take 3/45 damage") attack4 = TextWindow.Read() ElseIf damage4 = "4" then TextWindow.WriteLine(" you take 4/45 damage") attack4 = TextWindow.Read() ElseIf damage4 = "5" then TextWindow.WriteLine("you take 5/45 damage") attack4 = TextWindow.Read() ElseIf damage4 = "6" then TextWindow.WriteLine(" you take 6/45 damage") attack4 = TextWindow.Read() ElseIf damage4 = "7" then TextWindow.WriteLine(" you take 7/45 damage") attack3 = TextWindow.Read() Goto hits4 winbattlecontinue4: TextWindow.ForegroundColor = "white" TextWindow.WriteLine("roll for damage") TextWindow.ForegroundColor = "yellow" damage4 = TextWindow.Read() TextWindow.ForegroundColor = "white" If damage4 = "1" then TextWindow.WriteLine("the target takes 1/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits4 attack4 = TextWindow.Read() ElseIf damage4 = "2" then TextWindow.WriteLine("the target takes 2/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits4 attack4 = TextWindow.Read() ElseIf damage4 = "3" then TextWindow.WriteLine("the target takes 3/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits4 attack4 = TextWindow.Read() ElseIf damage4 = "4" then TextWindow.WriteLine("the target takes 4/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits4 attack4 = TextWindow.Read() ElseIf damage4 = "5" then TextWindow.WriteLine("the target takes 5/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits4 attack4 = TextWindow.Read() ElseIf damage4 = "6" then TextWindow.WriteLine("the target takes 6/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits4 attack4 = TextWindow.Read() TextWindow.PauseWithoutMessage() ElseIf damage4 = "7" then TextWindow.WriteLine("the target takes 7/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits4 attack4 = TextWindow.Read() ElseIf damage4 = "8" then TextWindow.WriteLine("the target takes 8/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() attack4 = TextWindow.Read() Goto hits4 ElseIf damage4 = "9" then TextWindow.WriteLine("the target takes 9/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() attack4 = TextWindow.Read() Goto hits4 ElseIf damage4 = "10" then TextWindow.WriteLine("the target takes 10/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits4 attack4 = TextWindow.Read() ElseIf damage4 = "11" then TextWindow.WriteLine("the target takes 11/20 damage") TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits4 attack4 = TextWindow.Read() ElseIf damage4 = "12" then TextWindow.WriteLine("the target takes 12/20 damage") attack4 = TextWindow.Read() TextWindow.WriteLine("On the table provided in the booklet given, write down the information in the corosponding catagories") TextWindow.PauseWithoutMessage() Goto hits4 If attack3 = "hp = 0" then Goto deathofahero If attack4 = "hp = 0" then Goto deathofahero If attack3 = "target killed" then Goto victory If attack4= "target killed" then Goto victory EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf deathofahero: TextWindow.WriteLine(" you fall to the ground on your knees and the cursed dummy takes up is sword and raises it above your neck") TextWindow.PauseWithoutMessage() TextWindow.ForegroundColor = "orange" TextWindow.WriteLine(" you are now mach for me ... know this as you die...") TextWindow.PauseWithoutMessage() TextWindow.WriteLine(" the iron ork shall return and he shall destroy all of this land, and you...") TextWindow.PauseWithoutMessage() TextWindow.WriteLine("") TextWindow.WriteLine(" have failed everyone ") TextWindow.ForegroundColor = "white" TextWindow.PauseWithoutMessage() TextWindow.WriteLine(".................................................................................................................................................................................................................................................") TextWindow.PauseWithoutMessage() TextWindow.Clear() TextWindow.ForegroundColor = "green" 'ending credits TextWindow.WriteLine("Ending credits") TextWindow.WriteLine("An EllisCorp game") TextWindow.WriteLine(" Many thanks to:") TextWindow.WriteLine("RedEspion") TextWindow.WriteLine("Joblet") TextWindow.WriteLine("who helped me with a few noob errors in my code") TextWindow.WriteLine("Another update shall be relased") TextWindow.WriteLine("Thankyou") TextWindow.WriteLine(".................") victory: textWindow.WriteLine(" the dummy falls the ground on it's knees and the you aim your wepon at it's head ") TextWindow.PauseWithoutMessage() TextWindow.ForegroundColor = "yellow" TextWindow.WriteLine(" you are now mach for me ... know this as you die...") TextWindow.PauseWithoutMessage() TextWindow.WriteLine("you, and your master... ") TextWindow.PauseWithoutMessage() TextWindow.WriteLine("") TextWindow.WriteLine(" are week ") TextWindow.ForegroundColor = "orange" TextWindow.WriteLine(" you are now mach for my master") TextWindow.PauseWithoutMessage() TextWindow.WriteLine(" the iron ork shall return and he shall destroy all of this land, and you") TextWindow.PauseWithoutMessage() TextWindow.ForegroundColor = "white" TextWindow.PauseWithoutMessage() TextWindow.WriteLine("you finnish him") TextWindow.PauseWithoutMessage() TextWindow.Clear() TextWindow.ForegroundColor = "green" 'ending credits TextWindow.WriteLine("Ending credits") TextWindow.WriteLine("An EllisCorp game") TextWindow.WriteLine(" Many thanks to:") TextWindow.WriteLine("RedEspion") TextWindow.WriteLine("Joblet") TextWindow.WriteLine("who helped me with a few noob errors in my code") TextWindow.WriteLine("Another update shall be relased") TextWindow.WriteLine("Thankyou") TextWindow.WriteLine(".................") EndIf EndIf EndIf EndIf End>GSM632.sb< Start>GSN866.sb< TextWindow.title="coin flip" begin: TextWindow.WriteLine("1 for heads 2 for tails") TextWindow.Write("") Des= TextWindow.Read() out=Math.GetRandomNumber(2) If des= "1" And out = "2" Or des="2" And out= "1" Then TextWindow.WriteLine("im sorry you lose") ElseIf des="2" and out="2" or des="1" and out="1" then TextWindow.WriteLine("you win") EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("would you like to try again y or n") TextWindow.Write("") ag= TextWindow.Read() If ag ="y" Or ag ="Y" Then goto begin endif End>GSN866.sb< Start>GSP815.sb< ' Shapes Editor 0.1 ' Copyright (c) 2012 Nonki Takahashi. All rights reserved. ' ' History : ' 0.1 2012/09/06 Created. ' title = "Shapes Editor 0.1" GraphicsWindow.Title = title pw = "1=2;2=4;3=8;4=16;5=0;6=1;" pen = 1 nPen = 6 pwidth = GraphicsWindow.PenWidth pcolor = GraphicsWindow.PenColor bcolor = GraphicsWindow.BrushColor DrawMenu() cont = "True" ' continue clicked = "False" GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseUp = DoNothing GraphicsWindow.MouseMove = OnMouseMove While cont If clicked Then SearchClickedObject() DoObject() clicked = "False" Else Program.Delay(100) EndIf EndWhile ' end of program Sub DrawMenu cx = 10 cy = 10 size = 40 nMenu = 8 x = cx For i = 1 To nMenu y = cy + (i - 1) * (size + 2) GraphicsWindow.BrushColor = "LightGray" GraphicsWindow.FillRectangle(x, y, size, size) menu[i]["x0"] = x menu[i]["y0"] = y menu[i]["x1"] = x + size menu[i]["y1"] = y + size DrawMenuItem() EndFor EndSub Sub DoObject ' param obj While Text.StartsWith(obj, "menu") i = Text.GetSubText(obj, 5, 1) obj = "" func = menu[i]["func"] select = "True" ItemSelect() If func = "rect" Then ' rectangle GetClickedPoint() SearchClickedObject() If obj = "" Then GetReleasedPoint() nShapes = nShapes + 1 shape[nShapes]["func"] = "rect" shape[nShapes]["bc"] = bcolor shape[nShapes]["pw"] = pwidth shape[nShapes]["pc"] = pcolor GraphicsWindow.BrushColor = bcolor GraphicsWindow.PenWidth = pwidth GraphicsWindow.PenColor = pcolor xmin = Math.Min(x0, x1) ymin = Math.Min(y0, y1) xmax = Math.Max(x0, x1) ymax = Math.Max(y0, y1) w = xmax - xmin h = ymax - ymin shape[nShapes]["x"] = xmin shape[nShapes]["y"] = ymin shape[nShapes]["width"] = w shape[nShapes]["height"] = h shape[nShapes]["oRect"] = Shapes.AddRectangle(w, h) Shapes.Move(shape[nShapes]["oRect"], xmin, ymin) EndIf ElseIf func = "ell" Then ' ellipse GetClickedPoint() SearchClickedObject() If obj = "" Then GetReleasedPoint() nShapes = nShapes + 1 shape[nShapes]["func"] = "ell" shape[nShapes]["bc"] = bcolor shape[nShapes]["pw"] = pwidth shape[nShapes]["pc"] = pcolor GraphicsWindow.BrushColor = bcolor GraphicsWindow.PenWidth = pwidth GraphicsWindow.PenColor = pcolor xmin = Math.Min(x0, x1) ymin = Math.Min(y0, y1) xmax = Math.Max(x0, x1) ymax = Math.Max(y0, y1) w = xmax - xmin h = ymax - ymin shape[nShapes]["x"] = xmin shape[nShapes]["y"] = ymin shape[nShapes]["width"] = w shape[nShapes]["height"] = h shape[nShapes]["oEll"] = Shapes.AddEllipse(w, h) Shapes.Move(shape[nShapes]["oEll"], xmin, ymin) EndIf ElseIf func = "tri" Then ' triangle GetClickedPoint() SearchClickedObject() If obj = "" Then GetReleasedPoint() nShapes = nShapes + 1 shape[nShapes]["func"] = "tri" shape[nShapes]["bc"] = bcolor shape[nShapes]["pw"] = pwidth shape[nShapes]["pc"] = pcolor GraphicsWindow.BrushColor = bcolor GraphicsWindow.PenWidth = pwidth GraphicsWindow.PenColor = pcolor xt = Math.Floor((x1 - x0) / 2) ' x top xr = x1 - x0 ' x right yb = y1 - y0 ' y bottom shape[nShapes]["x"] = x0 shape[nShapes]["y"] = y0 shape[nShapes]["x1"] = xt shape[nShapes]["y1"] = 0 shape[nShapes]["x2"] = 0 shape[nShapes]["y2"] = yb shape[nShapes]["x3"] = xr shape[nShapes]["y3"] = yb shape[nShapes]["oTri"] = Shapes.AddTriangle(xt, 0, 0, yb, xr, yb) Shapes.Move(shape[nShapes]["oTri"], x0, y0) EndIf ElseIf func = "line" Then ' line GetClickedPoint() SearchClickedObject() If obj = "" Then GetReleasedPoint() nShapes = nShapes + 1 shape[nShapes]["func"] = "line" shape[nShapes]["pw"] = pwidth shape[nShapes]["pc"] = pcolor GraphicsWindow.PenWidth = pwidth GraphicsWindow.PenColor = pcolor xmin = Math.Min(x0, x1) ymin = Math.Min(y0, y1) xmax = Math.Max(x0, x1) ymax = Math.Max(y0, y1) shape[nShapes]["x"] = xmin shape[nShapes]["y"] = ymin shape[nShapes]["x1"] = x0 - xmin shape[nShapes]["y1"] = y0 - ymin shape[nShapes]["x2"] = x1 - xmin shape[nShapes]["y2"] = y0 - ymin shape[nShapes]["oLine"] = Shapes.AddLine(x0 - xmin, y0 - ymin, x1 - xmin, y1 - ymin) Shapes.Move(shape[nShapes]["oLine"], xmin, ymin) EndIf ElseIf func = "pc" Then ' pen color color = pcolor Color_Slider() pcolor = color DrawMenuItem() GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseUp = DoNothing GraphicsWindow.MouseMove = OnMouseMove ElseIf func = "pw" Then ' pen width If pen = nPen Then pen = 1 Else pen = pen + 1 EndIf pwidth = pw[pen] x = menu[i]["x0"] y = menu[i]["y0"] size = menu[i]["x1"] - x GraphicsWindow.BrushColor = "LightGray" GraphicsWindow.FillRectangle(x, y, size, size) DrawMenuItem() ElseIf func = "bc" Then ' brush color color = bcolor Color_Slider() bcolor = color DrawMenuItem() GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseUp = DoNothing GraphicsWindow.MouseMove = OnMouseMove ElseIf func = "save" Then ' save shapes DumpShapes() EndIf select = "False" ItemSelect() EndWhile EndSub Sub DumpShapes Stack.PushValue("local", i) lastpw = "" lastpc = "" lastbc = "" TextWindow.WriteLine("' " + Clock.Date + " " + Clock.Time + " Generated") TextWindow.WriteLine("' by " + title) For i = 1 To nShapes pw = shape[i]["pw"] If lastpw <> pw Then TextWindow.WriteLine("GraphicsWindow.PenWidth = " + pw) lastpw = pw EndIf pc = shape[i]["pc"] If lastpc <> pc Then TextWindow.WriteLine("GraphicsWindow.PenColor = " + pc) lastpc = pc EndIf If shape[i]["func"] = "rect" Then bc = shape[i]["bc"] If lastbc <> bc Then TextWindow.WriteLine("GraphicsWindow.BrushColor = " + bc) lastbc = bc EndIf TextWindow.Write("oRect = Shapes.AddRectangle(") TextWindow.Write(shape[i]["width"] + ", ") TextWindow.WriteLine(shape[i]["height"] + ")") TextWindow.Write("Shapes.Move(oRect, ") TextWindow.Write(shape[i]["x"] + ", ") TextWindow.WriteLine(shape[i]["y"] + ")") ElseIf shape[i]["func"] = "ell" Then bc = shape[i]["bc"] If lastbc <> bc Then TextWindow.WriteLine("GraphicsWindow.BrushColor = " + bc) lastbc = bc EndIf TextWindow.Write("oEll = Shapes.AddEllipse(") TextWindow.Write(shape[i]["width"] + ", ") TextWindow.WriteLine(shape[i]["height"] + ")") TextWindow.Write("Shapes.Move(oEll, ") TextWindow.Write(shape[i]["x"] + ", ") TextWindow.WriteLine(shape[i]["y"] + ")") ElseIf shape[i]["func"] = "tri" Then bc = shape[i]["bc"] If lastbc <> bc Then TextWindow.WriteLine("GraphicsWindow.BrushColor = " + bc) lastbc = bc EndIf TextWindow.Write("oTri = Shapes.AddTriangle(") TextWindow.Write(shape[i]["x1"] + ", ") TextWindow.Write(shape[i]["y1"] + ", ") TextWindow.Write(shape[i]["x2"] + ", ") TextWindow.Write(shape[i]["y2"] + ", ") TextWindow.Write(shape[i]["x3"] + ", ") TextWindow.WriteLine(shape[i]["y3"] + ")") TextWindow.Write("Shapes.Move(oTri, ") TextWindow.Write(shape[i]["x"] + ", ") TextWindow.WriteLine(shape[i]["y"] + ")") ElseIf shape[i]["func"] = "line" Then bc = shape[i]["bc"] TextWindow.Write("oLine = Shapes.AddLine(") TextWindow.Write(shape[i]["x1"] + ", ") TextWindow.Write(shape[i]["y1"] + ", ") TextWindow.Write(shape[i]["x2"] + ", ") TextWindow.WriteLine(shape[i]["y2"] + ")") TextWindow.Write("Shapes.Move(oLine, ") TextWindow.Write(shape[i]["x"] + ", ") TextWindow.WriteLine(shape[i]["y"] + ")") EndIf EndFor TextWindow.WriteLine("") i = Stack.PopValue("local") EndSub Sub DrawMenuItem ' param i - item number ' param pwidth - pen width ' param pcolor - pen color ' param bcolor - brush color margin = 4 x = menu[i]["x0"] y = menu[i]["y0"] size = menu[i]["x1"] - x GraphicsWindow.PenColor = "Black" GraphicsWindow.PenWidth = 2 If i = 1 Then menu[i]["func"] = "rect" GraphicsWindow.DrawRectangle(x + margin, y + margin, size - margin * 2, size - margin * 2) ElseIf i = 2 Then menu[i]["func"] = "ell" GraphicsWindow.DrawEllipse(x + margin, y + margin, size - margin * 2, size - margin * 2) ElseIf i = 3 Then menu[i]["func"] = "tri" x1 = x + size / 2 y1 = y + margin x2 = x + margin y2 = y + size - margin x3 = x + size - margin y3 = y + size - margin GraphicsWindow.DrawTriangle(x1, y1, x2, y2, x3, y3) ElseIf i = 4 Then menu[i]["func"] = "line" x1 = x + margin y1 = y + margin x2 = x + size - margin y2 = y + size - margin GraphicsWindow.DrawLine(x1, y1, x2, y2) ElseIf i = 5 Then menu[i]["func"] = "pw" GraphicsWindow.PenWidth = pwidth x1 = x + margin y1 = y + size / 2 x2 = x + size - margin y2 = y + size / 2 GraphicsWindow.DrawLine(x1, y1, x2, y2) ElseIf i = 6 Then menu[i]["func"] = "pc" margin = 6 GraphicsWindow.PenWidth = 4 GraphicsWindow.PenColor = pcolor GraphicsWindow.DrawRectangle(x + margin, y + margin, size - margin * 2, size - margin * 2) ElseIf i = 7 Then menu[i]["func"] = "bc" GraphicsWindow.BrushColor = bcolor GraphicsWindow.FillRectangle(x + margin, y + margin, size - margin * 2, size - margin * 2) GraphicsWindow.PenColor = "Black" GraphicsWindow.PenWidth = 2 GraphicsWindow.DrawRectangle(x + margin, y + margin, size - margin * 2, size - margin * 2) ElseIf i = 8 Then menu[i]["func"] = "save" GraphicsWindow.BrushColor = "SteelBlue" GraphicsWindow.FillRectangle(x + margin, y + margin, size - margin * 2, size - margin * 2) GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle(x + margin + 4, y + margin, size - (margin + 4) * 2, (size - margin * 2) / 3) GraphicsWindow.BrushColor = "Gray" GraphicsWindow.FillRectangle(x + margin + 6, y + size - 15, size - (margin + 8) * 2, 15 - margin) EndIf EndSub Sub GetClickedPoint clicked = "False" GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseUp = DoNothing While clicked = "False" Program.Delay(100) EndWhile x0 = mx y0 = my x1 = mx y1 = my EndSub Sub GetReleasedPoint GraphicsWindow.PenWidth = 1 GraphicsWindow.PenColor = "Black" GraphicsWindow.BrushColor = "White" GraphicsWindow.MouseMove = OnMouseMove released = "False" While released = "False" If moved Then GraphicsWindow.MouseMove = DoNothing x1 = mx y1 = my If func = "rect" Then If oRect <> "" Then Shapes.Remove(oRect) EndIf xmin = Math.Min(x0, x1) ymin = Math.Min(y0, y1) xmax = Math.Max(x0, x1) ymax = Math.Max(y0, y1) oRect = Shapes.AddRectangle(xmax - xmin, ymax - ymin) Shapes.Move(oRect, xmin, ymin) Shapes.SetOpacity(oRect, 50) ElseIf func = "ell" Then If oEll <> "" Then Shapes.Remove(oEll) EndIf xmin = Math.Min(x0, x1) ymin = Math.Min(y0, y1) xmax = Math.Max(x0, x1) ymax = Math.Max(y0, y1) oEll = Shapes.AddEllipse(xmax - xmin, ymax - ymin) Shapes.Move(oEll, xmin, ymin) Shapes.SetOpacity(oEll, 50) ElseIf func = "tri" Then If oTri <> "" Then Shapes.Remove(oTri) EndIf oTri = Shapes.AddTriangle((x1 - x0) / 2, 0, 0, y1 - y0, x1 - x0, y1 - y0) Shapes.Move(oTri, x0, y0) Shapes.SetOpacity(oTri, 50) ElseIf func = "line" Then If oLine <> "" Then Shapes.Remove(oLine) EndIf oLine = Shapes.AddLine(x0, y0, x1, y1) Shapes.SetOpacity(oLine, 50) EndIf moved = "False" GraphicsWindow.MouseMove = OnMouseMove Else Program.Delay(100) EndIf EndWhile GraphicsWindow.MouseMove = DoNothing If oRect <> "" Then Shapes.Remove(oRect) EndIf If oEll <> "" Then Shapes.Remove(oEll) EndIf If oTri <> "" Then Shapes.Remove(oTri) EndIf If oLine <> "" Then Shapes.Remove(oLine) EndIf EndSub Sub ItemSelect ' i - menu index ' select - "True" if selected If select Then GraphicsWindow.PenColor = "Gray" Else GraphicsWindow.PenColor = "White" EndIf GraphicsWindow.PenWidth = 2 x = menu[i]["x0"] - 1 y = menu[i]["y0"] - 1 width = menu[i]["x1"] - x + 1 height = menu[i]["y1"] - y + 1 GraphicsWindow.DrawRectangle(x, y, width, height) EndSub Sub OnMouseDown mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY clicked = "True" GraphicsWindow.MouseUp = OnMouseUp EndSub Sub DoNothing EndSub Sub OnMouseMove mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY moved = "True" EndSub Sub OnMouseUp mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY released = "True" EndSub Sub SearchClickedObject ' return obj Stack.PushValue("local", i) obj = "" For i = 1 To nMenu If menu[i]["x0"] <= mx And mx <= menu[i]["x1"] And menu[i]["y0"] <= my And my <= menu[i]["y1"] Then obj = "menu" + i Goto sco_exit EndIf EndFor sco_exit: i = Stack.PopValue("local") EndSub Sub Color_ColorToRGB ' Color | Convert Color to RGB ' param sColor - "#rrggbb" ' return iR, iG, iB - [0, 255] sR = Text.GetSubText(sColor, 2, 2) sG = Text.GetSubText(sColor, 4, 2) sB = Text.GetSubText(sColor, 6, 2) sHex = sR Math_Hex2Dec() iR = iDec sHex = sG Math_Hex2Dec() iG = iDec sHex = sB Math_Hex2Dec() iB = iDec EndSub Sub Color_HSLtoRGB ' Color | Convert HSL to RGB ' param rHue - [0, 360) or UNDEFINED ' param rLightness - [0, 1] ' param rSaturation - [0, 1] ' return iR, iG, iB - RGB color ' return sColor - "#rrggbb" If rLightness <= 0.5 Then rN2 = rLightness * (1 + rSaturation) Else rN2 = rLightness + rSaturation - rLightness * rSaturation EndIf rN1 = 2 * rLightness - rN2 If rSaturation = 0 Then iR = Math.Round(rLightness * 255) iG = Math.Round(rLightness * 255) iB = Math.Round(rLightness * 255) Else rH = rHue + 120 Color_Value() iR = iValue rH = rHue Color_Value() iG = iValue rH = rHue - 120 Color_Value() iB = iValue EndIf sColor = GraphicsWindow.GetColorFromRGB(iR, iG, iB) EndSub Sub Color_RGBtoHSL ' Color | Convert RGB to HSL ' param sColor - "#rrggbb" ' return rHue - [0, 360) or UNDEFINED ' return rLightness - (0, 1) ' return rSaturation - (0, 1) Color_ColorToRGB() ' rR = iR / 255 ' occurs Math.Max() bug rR = Math.Round(iR / 255 * 10000) / 10000 ' rG = iG / 255 ' occurs Math.Max() bug rG = Math.Round(iG / 255 * 10000) / 10000 ' rB = iB / 255 ' occurs Math.Max() bug rB = Math.Round(iB / 255 * 10000) / 10000 rMax = Math.Max(rR, rG) rMax = Math.Max(rMax, rB) rMin = Math.Min(rR, rG) rMin = Math.Min(rMin, rB) rLightness = (rMax + rMin) / 2 If rMax = rMin Then ' rR = rG = rB rSaturation = 0 rHue = UNDEFINED Else If rLightness <= 0.5 Then rSaturation = (rMax - rMin) / (rMax + rMin) Else rSaturation = (rMax - rMin) / (2 - rMax - rMin) EndIf rRC = (rMax - rR) / (rMax - rMin) rGC = (rMax - rG) / (rMax - rMin) rBC = (rMax - rB) / (rMax - rMin) If rR = rMax Then ' between Yellow and Magenta rHue = rBC - rGC ElseIf rG = rMax Then ' between Cyan and Yellow rHue = 2 + rRC - rBC ElseIf rB = rMax Then ' between Magenta and Cyan rHue = 4 + rGC - rRC Else TextWindow.WriteLine("Error:") TextWindow.WriteLine("rMax=" + rMax) TextWindow.WriteLine("rR=" + rR + ",sR=" + sR) TextWindow.WriteLine("rG=" + rG + ",sG=" + sG) TextWindow.WriteLine("rB=" + rB + ",sB=" + sB) EndIf rHue = rHue * 60 If rHue < 0 Then rHue = rHue + 360 EndIf EndIf EndSub Sub Color_Slider ' param color - current color ' return color - new color ' define constant Stack.PushValue("local", cont) colorInit = color ' initial color TOPY = 80 ' top y LEFTX = 36 ' left x BORDERCOLOR = "#666666" BOXCOLOR = "LightGray" CAPTIONCOLOR = "White" DELTAY = 40 ' delta y SLITCOLOR = "#555555" TEXTCOLOR = "Black" UNDEFINED = "N/A" GraphicsWindow.PenWidth = 2 GraphicsWindow.PenColor = "Black" GraphicsWindow.BrushColor = "Black" oPopup = Shapes.AddRectangle(570, 310) Shapes.SetOpacity(oPopup, 64) Shapes.Move(oPopup, LEFTX - 10, TOPY - 10) oOK = Controls.AddButton("OK", LEFTX + 440, TOPY + 260) oCancel = Controls.AddButton("Cancel", LEFTX + 480, TOPY + 260) Controls.ButtonClicked = CS_OnButtonClicked CS_Init() Stack.PushValue("local", y) y = TOPY color = colorInit CS_DrawColorRect() oRectCurrent = oRect oRect = "" ' keep current color GraphicsWindow.SetPixel(0, 0, colorInit) color = GraphicsWindow.GetPixel(0, 0) GraphicsWindow.SetPixel(0, 0, "LightGray") GraphicsWindow.BrushColor = CAPTIONCOLOR oColor = Shapes.AddText(colorInit) Shapes.Move(oColor, x, y + height + 2) If color <> colorInit Then oColor2 = Shapes.AddText(color) Shapes.Move(oColor2, x, y + height + 14) EndIf y = Stack.PopValue("local") CS_SetColor() CS_DrawColorRect() CS_ShowColor() ' for copy of web color sliderMoved = "False" cont = "True" ' continue While cont If sliderMoved Then oSlider = oClicked Slider_GetMouseLevel() Slider_SetLevel() CS_AdjustSlider() CS_GetColor() CS_ShowColor() ' for copy of web color CS_DrawColorRect() sliderMoved = "False" Else Program.Delay(200) EndIf EndWhile If cancel Then color = colorInit EndIf CS_RemoveSliders() Shapes.Remove(oColor) Shapes.Remove(oColor2) Shapes.Remove(oNewColor) Shapes.Remove(oRectCurrent) Shapes.Remove(oRect) Controls.Remove(oOK) Controls.Remove(oCancel) Shapes.Remove(oPopup) cont = Stack.PopValue("local") EndSub Sub Color_Value ' Color | Function value ' param rN1, rN2 ' param rH - [-120, 480) ' return iValue - 0..255 If rH >= 360 Then rH = rH - 360 EndIF If rH < 0 Then rH = rH + 360 EndIF If rH < 60 Then rV = rN1 + (rN2 - rN1) * rH / 60 ElseIf rH < 180 Then rV = rN2 ElseIf rH < 240 Then rV = rN1 + (rN2 - rN1) * (240 - rH) / 60 Else rV = rN1 EndIf iValue = Math.Round(rV * 255) EndSub Sub CS_AdjustSlider ' param oClicked If oClicked = oHue Or oClicked = oLightness Or oClicked = oSaturation Then oSlider = oClicked If oClicked = oHue Then Slider_GetLevel() rHue = level ElseIf oClicked = oLightness Then Slider_GetLevel() rLightness = level / 100 Else Slider_GetLevel() rSaturation = level / 100 EndIf Color_HSLtoRGB() oSlider = oRed level = iR Slider_SetLevel() oSlider = oGreen level = iG Slider_SetLevel() oSlider = oBlue level = iB Slider_SetLevel() Else CS_GetColor() sColor = GraphicsWindow.GetColorFromRGB(red, green, blue) Color_RGBtoHSL() If rHue = UNDEFINED Then rHue = 0 EndIf level = Math.Floor(rHue) oSlider = oHue Slider_SetLevel() level = Math.Floor(rSaturation * 100) oSlider = oSaturation Slider_SetLevel() level = Math.Floor(rLightness * 100) oSlider = oLightness Slider_SetLevel() EndIf EndSub Sub CS_DrawColorRect ' param color - color of rectangle ' param x, y - position of rectangle ' param width, height - size of rectangle ' return oRect - rectangle object GraphicsWindow.BrushColor = color GraphicsWindow.PenColor = BORDERCOLOR If oRect <> "" Then Shapes.Remove(oRect) EndIf oRect = Shapes.AddRectangle(width, height) Shapes.Move(oRect, x, y) EndSub Sub CS_GetColor ' return color oSlider = oRed Slider_GetLevel() red = level oSlider = oGreen Slider_GetLevel() green = level oSlider = oBlue Slider_GetLevel() blue = level color = GraphicsWindow.GetColorFromRGB(red, green, blue) EndSub Sub CS_Init ' Initialize sliders width = 256 min = 0 max = 255 left = 200 ' add red slider top = TOPY caption = "R" Slider_Add() oRed = oSlider ' add green slider top = top + DELTAY caption = "G" Slider_Add() oGreen = oSlider ' add blue slider top = top + DELTAY caption = "B" Slider_Add() oBlue = oSlider ' add hue slider width = 360 top = top + DELTAY max = 360 caption = "H" Slider_Add() oHue = oSlider ' add saturation slider width = 100 top = top + DELTAY max = 100 caption = "S" Slider_Add() oSaturation = oSlider ' add lightness slider width = 100 top = top + DELTAY max = 100 caption = "L" Slider_Add() oLightness = oSlider CS_AdjustSlider() ' draw color rectangle CS_GetColor() CS_ShowColor() x = LEFTX y = TOPY + DELTAY * 4 width = 100 height = 100 CS_DrawColorRect() ' add text box GraphicsWindow.BrushColor = CAPTIONCOLOR top = y + height + 4 oNewColor = Shapes.AddText("") Shapes.Move(oNewColor, LEFTX, top) GraphicsWindow.MouseUp = Slider_OnMouseUp GraphicsWindow.MouseDown = Slider_OnMouseDown EndSub Sub CS_OnButtonClicked cont = "False" If Controls.LastClickedButton = oCancel Then cancel = "True" Else cancel = "False" EndIf EndSub Sub CS_RemoveSliders oSlider = oRed Slider_Remove() oSlider = oGreen Slider_Remove() oSlider = oBlue Slider_Remove() oSlider = oHue Slider_Remove() oSlider = oSaturation Slider_Remove() oSlider = oLightness Slider_Remove() EndSub Sub CS_SetColor ' param color sColor = color Color_ColorToRGB() oSlider = oRed level = iR Slider_SetLevel() oSlider = oGreen level = iG Slider_SetLevel() oSlider = oBlue level = iB Slider_SetLevel() CS_AdjustSlider() EndSub Sub CS_ShowColor ' param oColor ' param color Shapes.SetText(oNewColor, color) EndSub Sub Math_Hex2Dec ' Math | Convert hexadecimal to decimal ' param sHex ' return iDec iDec = 0 iLen = Text.GetLength(sHex) For iPtr = 1 To iLen iDec = iDec * 16 + Text.GetIndexOf("0123456789ABCDEF", Text.GetSubText(sHex, iPtr, 1)) - 1 EndFor EndSub Sub Slider_Add ' Slider | Add slider as shapes and property ' param width ' param caption ' param min, max ' param left, top ' return oSlider numSlider = numSlider + 1 oSlider = "Slider" + numSlider ' add shapes for slider GraphicsWindow.BrushColor = CAPTIONCOLOR len = Text.GetLength(caption) prop[oSlider + ".oCaption"] = Shapes.AddText(caption) Shapes.Move(prop[oSlider + ".oCaption"], left - (len * 5 + 10), top + 1) level = Math.Floor((min + max) / 2) prop[oSlider + ".level"] = level ' property prop[oSlider + ".min"] = min prop[oSlider + ".max"] = max GraphicsWindow.PenColor = BORDERCOLOR mag = (level - min) / (max - min) GraphicsWindow.BrushColor = SLITCOLOR prop[oSlider + ".oSlit"] = Shapes.AddRectangle(width, 10) GraphicsWindow.PenColor = BORDERCOLOR GraphicsWindow.BrushColor = BOXCOLOR prop[oSlider + ".oBox"] = Shapes.AddRectangle(10, 18) GraphicsWindow.BrushColor = CAPTIONCOLOR prop[oSlider + ".oLevel"] = Shapes.AddText(level) prop[oSlider + ".x0"] = left prop[oSlider + ".x1"] = left + width prop[oSlider + ".y0"] = top Shapes.Move(prop[oSlider + ".oLevel"], left + width + 5, top) ' move and zoom shapes for slider Shapes.Move(prop[oSlider + ".oSlit"], left, top + 4) Slider_SetLevel() EndSub Sub Slider_Remove ' param oSlider Shapes.Remove(prop[oSlider + ".oCaption"]) Shapes.Remove(prop[oSlider + ".oSlit"]) Shapes.Remove(prop[oSlider + ".oBox"]) Shapes.Remove(prop[oSlider + ".oLevel"]) EndSub Sub Slider_CheckClicked ' Slider | Check slider clicked ' param oSlider ' return oClicked - clicked slider x2 = prop[oSlider + ".x2"] x3 = prop[oSlider + ".x3"] y2 = prop[oSlider + ".y2"] y3 = prop[oSlider + ".y3"] If x2 <= xMouse And xMouse <= x3 And y2 <= yMouse And yMouse <= y3 Then GraphicsWindow.MouseMove = Slider_OnMouseMove oClicked = oSlider EndIf EndSub Sub Slider_GetLevel ' Slider | Get latest level of slider ' param oSlider ' return level level = prop[oSlider + ".level"] EndSub Sub Slider_GetMouseLevel ' Slider | Get mouse level of slider ' param oSlider ' return level x0 = prop[oSlider + ".x0"] x1 = prop[oSlider + ".x1"] max = prop[oSlider + ".max"] min = prop[oSlider + ".min"] level = min + Math.Floor((max - min) * (xMouse - x0) / (x1 - x0)) EndSub Sub Slider_OnMouseDown ' Slider | Event subroutine on mouse down ' return oClicked - clicked slider xMouse = GraphicsWindow.MouseX yMouse = GraphicsWindow.MouseY oClicked = "" Stack.PushValue("local", i) For i = 1 To numSlider oSlider = "Slider" + i Slider_CheckClicked() EndFor i = Stack.PopValue("local") EndSub Sub Slider_OnMouseMove ' Slider | Event subroutine on mouse move sliderMoved = "True" xMouse = GraphicsWindow.MouseX x0_ = prop[oClicked + ".x0"] x1_ = prop[oClicked + ".x1"] If xMouse < x0_ Then xMouse = x0_ EndIf If x1_ < xMouse Then xMouse = x1_ EndIf EndSub Sub Slider_OnMouseUp ' Slider | Event subroutine on mouse up GraphicsWindow.MouseMove = Slider_DoNothing EndSub Sub Slider_DoNothing ' Slider | Event subroutine on mouse move EndSub Sub Slider_SetLevel ' Slider | Set slider level and move slider box ' param oSlider ' param level Stack.PushValue("local", width) x0 = prop[oSlider + ".x0"] x1 = prop[oSlider + ".x1"] y0 = prop[oSlider + ".y0"] width = x1 - x0 prop[oSlider + ".level"] = level Shapes.SetText(prop[oSlider + ".oLevel"], level) ' move bar min = prop[oSlider + ".min"] max = prop[oSlider + ".max"] mag = (level - min) / (max - min) ' move box Shapes.Move(prop[oSlider + ".oBox"], x0 + Math.Floor(width * mag) - 5, y0) prop[oSlider + ".x2"] = x0 + Math.Floor(width * mag) - 5 prop[oSlider + ".x3"] = x0 + Math.Floor(width * mag) - 5 + 10 prop[oSlider + ".y2"] = y0 prop[oSlider + ".y3"] = y0 + 18 width = Stack.PopValue("local") EndSub End>GSP815.sb< Start>GSW909.sb< Menu() Sub Menu TextWindow.Title = "Jango" TextWindow.Clear() TextWindow.WriteLine(" | ") TextWindow.WriteLine(" |,---.,---.,---.,---.") TextWindow.WriteLine(" |,---|| || || |") TextWindow.WriteLine("`---'`---^` '`---|`---'") TextWindow.WriteLine(" `---' ") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("Peamenüü :") TextWindow.WriteLine("") TextWindow.Write("[") TextWindow.ForegroundColor = "Yellow" TextWindow.Write("1") TextWindow.ForegroundColor = "White" TextWindow.WriteLine("] Alusta mängu") TextWindow.Write("[") TextWindow.ForegroundColor = "Yellow" TextWindow.Write("2") TextWindow.ForegroundColor = "White" TextWindow.WriteLine("] Jätka mängu") TextWindow.Write("[") TextWindow.ForegroundColor = "Yellow" TextWindow.Write("3") TextWindow.ForegroundColor = "White" TextWindow.WriteLine("] Tiitrid") TextWindow.Write("[") TextWindow.ForegroundColor = "Yellow" TextWindow.Write("4") TextWindow.ForegroundColor = "White" TextWindow.WriteLine("] Välju") a = TextWindow.ReadKey() If a = 1 Then tutorial() ElseIf a = 2 then konami() elseif a = 3 then credits() elseif a = 4 then Program.End() EndIf Menu() EndSub Sub credits TextWindow.BackgroundColor = "White" TextWindow.ForegroundColor = "Green" TextWindow.Clear() TextWindow.WriteLine(" Programmerija :") TextWindow.ForegroundColor = "Blue" TextWindow.WriteLine(" Janar Velleste") TextWindow.WriteLine(" << Mis mu tsitaat küll võiks olla... >>") TextWindow.ReadKey() TextWindow.WriteLine("") TextWindow.ForegroundColor = "Green" TextWindow.WriteLine(" Disainer :") TextWindow.ForegroundColor = "Red" TextWindow.WriteLine(" Taago Terestal") TextWindow.WriteLine(" << Ma ei tea, pane midagi suvakat. >>") TextWindow.ReadKey() TextWindow.WriteLine("") TextWindow.ForegroundColor = "Green" TextWindow.WriteLine(" Juhendaja :") TextWindow.ForegroundColor = "Black" TextWindow.WriteLine(" Vilve Roosioks") TextWindow.WriteLine(" << ... >>") TextWindow.ReadKey() TextWindow.BackgroundColor = "Black" TextWindow.ForegroundColor = "White" TextWindow.Clear() Menu() EndSub Sub tutorial TextWindow.Clear() TextWindow.WriteLine("Tere tulemast õpetusse!") TextWindow.Readkey() TextWindow.WriteLine("") TextWindow.WriteLine("Menüü kasutamine :") TextWindow.Write("•Kui näed tekstis ") TextWindow.ForegroundColor = "Green" TextWindow.Write("►") TextWindow.ForegroundColor = "White" TextWindow.WriteLine(" märki, siis viib nupuvajutus sind edasi. ►") TextWindow.Readkey() TextWindow.WriteLine("") TextWindow.WriteLine("•Tekstis saab ka teha valikvastuseid.") TextWindow.WriteLine(" Kui näed valikuid siis vajuta vastavat esitähte/numbrit. ►") TextWindow.Readkey() Valik() TextWindow.WriteLine("•Vahetevahel on vaja vastus kirjutada sisse pikalt.") TextWindow.WriteLine(" Siis kirjuta vastus ja vajuta ENTER klahvi. ►") TextWindow.Readkey() Num() TextWindow.WriteLine("Oled õnnelikult läbinud õpetuse! ►") TextWindow.Readkey() TextWindow.WriteLine("Su laadimiskood on : UP LEFT DOWN RIGHT A A") TextWindow.WriteLine("") TextWindow.WriteLine("Jäta meelde ka üks lause :") TextWindow.WriteLine("") TextWindow.ForegroundColor = "Yellow" TextWindow.WriteLine("Kindlasti otsi nuppude abil minu imet.") TextWindow.ForegroundColor = "White" TextWindow.Readkey() TextWindow.Clear() Algus() EndSub Sub Valik TextWindow.Clear() TextWindow.WriteLine("Kas said aru?") TextWindow.ForegroundColor = "Green" TextWindow.WriteLine("JAH või EI") a = TextWindow.Readkey() TextWindow.ForegroundColor = "White" If a = "j" Then TextWindow.WriteLine("Tore!") TextWindow.Readkey() TextWindow.Clear() Else Valik() EndIf EndSub Sub Num TextWindow.Clear() TextWindow.WriteLine("Number on 268. Mis on number?") TextWindow.ForegroundColor = "Green" a = TextWindow.ReadNumber() TextWindow.ForegroundColor = "White" If a = "268" Then TextWindow.WriteLine("Hea töö!") TextWindow.Readkey() TextWindow.Clear() Else Num() EndIf EndSub Sub Algus TextWindow.ForegroundColor = "Yellow" TextWindow.WriteLine(" ▓▓▓ ▓ ▓▓▓ ▓▓▓ ▓▓▓ ▓▓▓▓ ▓ ▓ ▓ ▓ ▓▓ ▓▓▓▓▓ ▓ ▓ ▓▓▓") TextWindow.WriteLine(" ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓") TextWindow.WriteLine(" ▓▓▓ ▓ ▓▓▓ ▓▓▓ ▓▓ ▓ ▓ ▓ ▓▓▓ ▓▓▓▓ ▓ ▓ ▓ ▓▓▓") TextWindow.WriteLine(" ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓") TextWindow.WriteLine(" ▓▓▓ ▓ ▓▓▓ ▓▓▓ ▓▓▓ ▓▓ ▓▓ ▓ ▓ ▓ ▓ ▓ ▓▓ ▓▓▓") TextWindow.readkey() TextWindow.Clear() TextWindow.ForegroundColor = "White" TextWindow.WriteLine("...") TextWindow.Readkey() TextWindow.WriteLine("...") TextWindow.Readkey() TextWindow.WriteLine("Ärka üles!") TextWindow.Readkey() TextWindow.Clear() TextWindow.WriteLine(" __ ") TextWindow.WriteLine(" / \ see oli ühe vapra mehe maja... üks maja kuhu ") TextWindow.WriteLine(" |XX| sa ilma loata minna ei taha. ►") TextWindow.WriteLine("--==--") TextWindow.Readkey() TextWindow.Clear() TextWindow.WriteLine("Marten: Meil on sulle ülesanne!") TextWindow.WriteLine("Kas oled nõus? ►") TextWindow.readkey() TextWindow.ForegroundColor = "Green" TextWindow.WriteLine("JAH või EI?") TextWindow.ForegroundColor = "White" ValikJvE() TextWindow.Clear() TextWindow.WriteLine("Marten: Sinu nimi saab olema teada kõigile! ►") TextWindow.readkey() TextWindow.WriteLine("Oota... Mis su nimi üldse on?") TextWindow.WriteLine("") TextWindow.Write("Su nimi : ") Nimi = TextWindow.Read() TextWindow.BackgroundColor = "Blue" TextWindow.Clear() TextWindow.WriteLine("Te liigute lossi poole... ►") TextWindow.readkey() TextWindow.WriteLine("Valvur: Kes te olete? ►") TextWindow.readkey() TextWindow.WriteLine("Marten: Mina olen Marten ja tema on...") TextWindow.WriteLine(" ...Jaan vist. ►") TextWindow.Readkey() TextWindow.WriteLine("Sina: Tegelikult olen ma " + Nimi + ". ►") TextWindow.Readkey() TextWindow.WriteLine("Valvur: Huvitav nimi... " + Nimi + " " + Nimi + ". Kus ma seda kuulnud olen?") TextWindow.WriteLine(" Ära puutu midagi! Siin on kõik vana ja haruldane! ►") TextWindow.Readkey() TextWindow.ForegroundColor = "Black" TextWindow.BackgroundColor = "White" TextWindow.Clear() TextWindow.WriteLine("Kuninga juures:") TextWindow.WriteLine("Kuningas Peeter II: Kuidas käbar käib siis ka?!? ►") TextWindow.Readkey() TextWindow.WriteLine("Sina: Mida?") TextWindow.WriteLine("Kuningas: Aga mis siin ikka... meil on sulle ülesanne!") TextWindow.readkey() TextWindow.WriteLine(" Meilt rööviti Südamekristall!") TextWindow.WriteLine(" Tänu sellele oli meie elu tervislik!") TextWindow.WriteLine(" Üks valvuritest ütles, et varas tundus olevat Britteni moodi. ►") TextWindow.Readkey() TextWindow.BackgroundColor = "Black" TextWindow.ForegroundColor = "White" TextWindow.Clear() TextWindow.WriteLine("Kuningas: Me anname sulle ühe kristalli... ►") TextWindow.Readkey() TextWindow.WriteLine(" Mingi ennustaja ütles,et see päästab kellegi nimega") TextWindow.WriteLine(" " + Nimi + " ja ma usun selliseid kutte alati! ►") TextWindow.WriteLine("") TextWindow.WriteLine("Sinu laadimiskood on B A DOWN DOWN UP B.") TextWindow.Readkey() TextWindow.ForegroundColor = "Yellow" TextWindow.WriteLine(" ▓") TextWindow.WriteLine(" ▓▓▓") TextWindow.WriteLine(" ▓▓▓▓▓") TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓▓") TextWindow.WriteLine(" ▓▓▓▓▓▓▓") TextWindow.WriteLine(" ▓▓▓▓ ▓▓▓▓") TextWindow.WriteLine(" ▓▓▓ ▓▓▓") Sound.PlayChimeAndWait() star = 1 TextWindow.Readkey() TextWindow.ForegroundColor = "White" TextWindow.BackgroundColor = "Black" kodu() EndSub Sub ValikJvE a = TextWindow.readkey() If a = "j" Then TextWindow.WriteLine("Tore!") TextWindow.readkey() Else TextWindow.WriteLine("Kas tõesti? Mõtle ümber...") TextWindow.readkey() ValikJvE() EndIf EndSub Sub kodu TextWindow.Clear() TextWindow.WriteLine("Oled kodus.") TextWindow.WriteLine("[Vaata ringi] [Välju] [Puhka]") a = TextWindow.Read() If a = "Välju" Then TextWindow.WriteLine("Sa väljud majast ja tunned, et täht tõmbub kergelt purskkaevu poole.") ElseIf a = "Puhka" then TextWindow.WriteLine("Viskad end voodisse, aga tahe minna seiklusele on liiga suur.") elseIf a = "Vaata ringi" then TextWindow.WriteLine("Siin on üpris väike ja värsket õhku on puudu.") endif TextWindow.WriteLine("Sa liigud purskkaevu poole... ►") TextWindow.Readkey() TextWindow.WriteLine("Aga täht lendab su käest purskkaevu olevasse auku.") TextWindow.Readkey() TextWindow.Clear() TextWindow.WriteLine(" | ") TextWindow.WriteLine(" ▓ ") TextWindow.WriteLine(" ▓ ") TextWindow.WriteLine(" ▓▓▓▓▓ ") TextWindow.WriteLine(" ____▓▓▓____ ") TextWindow.Write("| ▓▓") TextWindow.ForegroundColor = "Yellow" TextWindow.Write("0") TextWindow.ForegroundColor = "White" TextWindow.Write("▓") If star >= 2 then TextWindow.ForegroundColor = "Green" TextWindow.Write("0") TextWindow.ForegroundColor = "White" Else TextWindow.Write("0") EndIf TextWindow.Write("▓") If star >= 3 Then TextWindow.ForegroundColor = "Blue" TextWindow.Write("0") TextWindow.ForegroundColor = "White" Else TextWindow.Write("0") EndIf TextWindow.WriteLine("▓▓ |") TextWindow.WriteLine("|___________|") TextWindow.readkey() If star = 1 Then PT1() EndIf If star = 2 Then PT2() EndIf If star = 3 Then Boss() EndIf EndSub Sub Kodu2 TextWindow.WriteLine("Oled kodus.") TextWindow.WriteLine("[Vaata ringi] [Välju] [Puhka]") TextWindow.Read() TextWindow.WriteLine("Sina: Oota nüüd sellega! Enne vehkis ta lihtsalt kätega...") TextWindow.WriteLine(" Aga nüüd pole mul enam tähti!!") Program.Delay(2000) TextWindow.WriteLine("Kuid seeeest on mul mu mälestused, mu telefon ja-") TextWindow.ForegroundColor = "Red" TextWindow.WriteLine("Britten: On ainult 1 viis neist lahti saamiseks!!! ►") TextWindow.Readkey() END() EndSub Sub PT1 TextWindow.WriteLine("Sa lähed tähte sealt eemaldama, aga see ei tule välja. ►") TextWindow.Readkey() TextWindow.WriteLine("Kaevust hakkab rohkem vett purskama!") TextWindow.WriteLine("Vett pritsib kõikjale! Sa ei näe midagi! ►") TextWindow.Readkey() TextWindow.WriteLine("Kui sa olid vee näost ära pühkinud,") TextWindow.WriteLine(" tundus maailm kuidagi teistmoodi. ►") TextWindow.Readkey() TextWindow.Clear() TextWindow.ForegroundColor = "Green" TextWindow.WriteLine(" ▓▓▓ ▓▓▓ ▓▓ ▓▓▓▓▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓▓") TextWindow.WriteLine(" ▓ ▓ ▓ ▓ ▓ ��� ▓ ▓ ▓ ▓ ▓ ▓") TextWindow.WriteLine(" ▓▓▓ ▓▓ ▓▓▓▓ ▓ ▓ ▓ ▓▓ ▓▓ ▓") TextWindow.WriteLine(" ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓") TextWindow.WriteLine(" ▓ ▓▓▓ ▓ ▓ ▓ ▓▓ ▓ ▓ ▓ ▓ ▓") TextWindow.Readkey() TextWindow.ForegroundColor = "White" TextWindow.WriteLine("Su laadimiskood on B RIGHT A LEFT UP B") TextWindow.Readkey() TextWindow.Clear() TextWindow.WriteLine("???: KUIDAS SA SIIA SAID?!?") TextWindow.WriteLine("Sina: Aga kuidas SINA siia tekkisid? ►") TextWindow.Readkey() TextWindow.WriteLine("???: Mõlemad küsimused on head.") TextWindow.WriteLine(" Kahju, et kumbki ei saa vastust. ►") TextWindow.Readkey() TextWindow.Clear() TextWindow.WriteLine("Niisiis.. Minu nimi on Marten Jr.Jr.Jr.Jr...(jne.).") TextWindow.WriteLine(" Aga mis on sinu nimi? ►") TextWindow.Readkey() TextWindow.WriteLine("Sina : " + Nimi + ".") TextWindow.WriteLine(" Kas sa saaksid öelda, mis kuupäev täna on? ►") TextWindow.Readkey() TextWindow.WriteLine("Marten Jr: Täna on 20. mai 2031.") TextWindow.WriteLine("Sina: Kas ma olen siis mitusada aastat tulevikus?!? ►") TextWindow.Readkey() TextWindow.Clear() TextWindow.WriteLine("Marten Jr: Ma ei usu seda, aga teeskleme, et see on nii...") TextWindow.ForegroundColor = "Green" TextWindow.WriteLine(" Mis telefon sul on?") TextWindow.Read() TextWindow.ForegroundColor = "White" TextWindow.WriteLine("MISASJA? Sellist vastust poleks ma küll oodanud!") TextWindow.WriteLine(" Me peame sulle uue telefoni ostma! ►") TextWindow.Readkey() TextWindow.BackgroundColor = "White" TextWindow.ForegroundColor = "Blue" TextWindow.Clear() TextWindow.WriteLine("Tere tulemast Soneerasse.") TextWindow.WriteLine("Marten Jr: Arvestades sinu niinimetatud ajareisi pole sul vist raha...") TextWindow.WriteLine(" Ma võin sulle paari sendi eest osta ülimalt vana telefoni. ►") TextWindow.Readkey() TextWindow.WriteLine(" •amsung Galaxy S 15") TextWindow.WriteLine(" •uawei C 84") TextWindow.WriteLine(" •okia Lumia 2050") TextWindow.WriteLine(" •g L 27 II") TextWindow.Readkey() TextWindow.WriteLine("Ega neil tegelikult vahet pole...") TextWindow.WriteLine(" Kõigil on sees 1 Gigaentsüklopeedia, infi-Aku 2.4,") TextWindow.WriteLine(" aga sellepärast vana ekraan ja klahvid. ►") TextWindow.Readkey() TextWindow.BackgroundColor = "Green" TextWindow.ForegroundColor = "Black" TextWindow.Clear() TextWindow.WriteLine("UUS VÕIME!") TextWindow.WriteLine("Vajuta nuppu, et aktiveerida Tark mees taskus! ►") a = TextWindow.Readkey() If a = ("t") Then TextWindow.BackgroundColor = "Blue" TextWindow.ForegroundColor = "White" TextWindow.WriteLine("Kuna sa ei saanud aru misasi see telefon on______") TextWindow.WriteLine(" või mis neil markidel vahet on, siis otsustasid") TextWindow.WriteLine("anda mulle hüüdnime Tark mees taskus. ►__________") TextWindow.Readkey() EndIf TextWindow.ForegroundColor = "White" TextWindow.BackgroundColor = "Black" TextWindow.Clear() TextWindow.WriteLine("Kuidas me nüüd selle kristalli leiame? ►") TextWindow.BackgroundColor = "Blue" TextWindow.Readkey() TextWindow.WriteLine("Minust võib olla kasu... ") TextWindow.WriteLine(" Mulle on sisse ehitatud kõigeradar,") TextWindow.WriteLine("aga selline soov nõuab turvakoodi! ►") TextWindow.Readkey() TextWindow.BackgroundColor = "Black" TextWindow.WriteLine("Marten Jr: Tänapäeval on kõik koodid matemaatilised tehted.") TextWindow.WriteLine(" Sest keegi ei kasuta enam matemaatikat. ►") TextWindow.Readkey() Algus = 0 Matem() EndSub Sub konami TextWindow.WriteLine(" UP") TextWindow.WriteLine(" LEFT RIGHT") TextWindow.WriteLine(" DOWN A B") konami = TextWindow.Read() If konami = ("UPUPDOWNDOWNLEFTRIGHTLEFTRIGHTBA") Then lvl() ElseIf konami = ("UP LEFT DOWN RIGHT A A") then TextWindow.Clear() Algus() ElseIf konami = ("B A DOWN DOWN UP B") then TextWindow.WriteLine("Nimi:") Nimi = TextWindow.Read() TextWindow.Clear() kodu() elseif konami = ("B RIGHT A LEFT UP B") then TextWindow.WriteLine("Nimi:") Nimi = TextWindow.Read() star = 1 TextWindow.Clear() PT1() elseif konami = ("DOWN RIGHT A B DOWN RIGHT") then TextWindow.WriteLine("Nimi:") Nimi = TextWindow.Read() TextWindow.Clear() Algus = 11 Matem() elseif konami = ("LEFT B UP UP A RIGHT") then TextWindow.WriteLine("Nimi:") Nimi = TextWindow.Read() TextWindow.Clear() star = 2 PT2() elseif konami = ("A A UP B LEFT LEFT") then TextWindow.WriteLine("Nimi:") Nimi = TextWindow.Read() TextWindow.Clear() star = 3 Boss() EndIf EndSub Sub lvl TextWindow.Write("Nimi: ") Nimi = TextWindow.Read() TextWindow.Write("Tutorial tehtud(1/0): ") a = TextWindow.ReadNumber() If a = 0 Then tutorial() EndIf TextWindow.Write("Algus Tehtud: ") a = TextWindow.ReadNumber() If a = 0 Then Algus() EndIf TextWindow.Write("Tähtede arv(1-3): ") star = TextWindow.ReadNumber() kodu() EndSub Sub Matem TextWindow.BackgroundColor = "Blue" TextWindow.ForegroundColor = "White" TextWindow.Clear() If Algus = 11 Then Goto Mat11 EndIf TextWindow.WriteLine("Kas oled valmis?") a = TextWindow.Readkey() If a = "j" Then TextWindow.WriteLine("ALUSTAME!") Else Matem() EndIf TextWindow.WriteLine("Esimesena lihtne värk") TextWindow.WriteLine("Kirjuta sisse vastus või et saada abi ►") TextWindow.Readkey() TextWindow.Clear() Mat1: TextWindow.Write("5+5 = ") a = TextWindow.Read() If a = "t" Then TextWindow.WriteLine("Liitmine on tegevus kus sa võtad") TextWindow.WriteLine("ühe koguse pulki ja teise koguse pulki") TextWindow.WriteLine("ning loed need üle!") Goto Mat1 ElseIf a = 10 then TextWindow.Clear() TextWindow.WriteLine("EDASI!") Else Goto Mat1 EndIf Mat2: TextWindow.Write("5-5 = ") a = TextWindow.Read() If a = "t" Then TextWindow.WriteLine("Võtad ühest pulkade hulgast") TextWindow.WriteLine("teise pulkade hulga") Goto Mat2 ElseIf a = 0 then TextWindow.Clear() Else Goto Mat2 EndIf Mat3: TextWindow.Write("7*6 = ") a = TextWindow.Read() If a = "t" Then TextWindow.WriteLine("Liidad A iseendaga B arv kordi.") TextWindow.WriteLine("N: 2*3 = 2+2+2 = 3+3 = 6") Goto Mat3 ElseIf a = 42 then TextWindow.Clear() Else Goto Mat3 EndIf Mat4: TextWindow.Write("54/9 = ") a = TextWindow.Read() If a = "t" Then TextWindow.WriteLine("Vaatad mitu korda 1 arv mahub teise.") Goto Mat4 ElseIf a = 6 then TextWindow.Clear() Else Goto Mat4 EndIf Mat5: TextWindow.Write("1² = ") a = TextWindow.Read() If a = "t" Then TextWindow.WriteLine("Ruutu võtmine = arv korrutatud iseendaga.") TextWindow.WriteLine("N: 1² = 1*1 , 2² = 2*2 , 3² = 3*3") Goto Mat5 ElseIf a = 1 then TextWindow.Clear() Else Goto Mat5 EndIf Mat6: TextWindow.Write("Ruutjuur 9 = ") a = TextWindow.Read() If a = "t" Then TextWindow.WriteLine("Ruutjuur: Leia mille ruut on arv.") TextWindow.WriteLine("N: Ruutjuur 4 = 2 kuna 2² = 4") Goto Mat6 ElseIf a = 3 then TextWindow.Clear() Else Goto Mat6 EndIf Mat7: TextWindow.Write("4² = ") a = TextWindow.ReadNumber() If a = 16 Then TextWindow.Clear() Else Goto Mat7 EndIf Mat8: TextWindow.Write("2³ = ") a = TextWindow.Read() If a = "t" Then TextWindow.WriteLine("Kuup : nagu ruut aga 3 korda.") TextWindow.WriteLine("N: 1³ = 1*1*1, 2³ = 2*2*2") Goto Mat8 ElseIf a = 8 then TextWindow.Clear() Else Goto Mat8 EndIf Mat9: TextWindow.Write("Ruutjuur 25 = ") a = TextWindow.ReadNumber() If a = 5 Then TextWindow.Clear() Else Goto Mat9 EndIf Mat10: TextWindow.Write("3³ = ") a = TextWindow.ReadNumber() If a = 27 Then TextWindow.Clear() TextWindow.WriteLine("10 tehtud, siin on laadimiskood:") TextWindow.WriteLine("DOWN RIGHT A B DOWN RIGHT") Else Goto Mat10 EndIf Mat11: TextWindow.Write("7² = ") a = TextWindow.ReadNumber() If a = 49 Then TextWindow.Clear() Else Goto Mat11 EndIf Mat12: TextWindow.Write("Ruutjuur 121 = ") a = TextWindow.ReadNumber() If a = 11 Then TextWindow.Clear() Else Goto Mat12 EndIf Mat13: TextWindow.Write("5³ = ") a = TextWindow.ReadNumber() If a = 125 Then TextWindow.Clear() TextWindow.WriteLine("LÕPUSIRGE!") Else Goto Mat13 EndIf Mat14: TextWindow.Write("1*2 = ") a = TextWindow.ReadNumber() If a = 2 Then Sound.PlayChimes() Else Goto Mat14 EndIf Mat15: TextWindow.Write("2*2 = ") a = TextWindow.ReadNumber() If a = 4 Then Sound.PlayChimes() Else Goto Mat15 EndIf Mat16: TextWindow.Write("4*2 = ") a = TextWindow.ReadNumber() If a = 8 Then Sound.PlayChimes() Else Goto Mat16 EndIf Mat17: TextWindow.Write("8*2 = ") a = TextWindow.ReadNumber() If a = 16 Then Sound.PlayChimes() Else Goto Mat17 EndIf Mat18: TextWindow.Write("16*2 = ") a = TextWindow.ReadNumber() If a = 32 Then Sound.PlayChimes() Else Goto Mat18 EndIf Mat19: TextWindow.Write("32*2 = ") a = TextWindow.ReadNumber() If a = 64 Then Sound.PlayChimes() Else Goto Mat19 EndIf Mat20: TextWindow.Write("64*2 = ") a = TextWindow.ReadNumber() If a = 128 Then Sound.PlayChimes() Else Goto Mat20 EndIf Mat21: TextWindow.Write("128*2 = ") a = TextWindow.ReadNumber() If a = 256 Then Sound.PlayChimes() Else Goto Mat21 EndIf Mat22: TextWindow.Write("256*2 = ") a = TextWindow.ReadNumber() If a = 512 Then Sound.PlayChimes() Else Goto Mat22 EndIf Mat23: TextWindow.Write("512*2 =") a = TextWindow.ReadNumber() If a = 1024 Then Sound.PlayChimes() Else Goto Mat23 EndIf Mat24: TextWindow.Write("1024*2 = ") a = TextWindow.ReadNumber() If a = 2048 Then Sound.PlayChimes() Else Goto Mat24 EndIf Mat25: TextWindow.Write("2048*2 = ") a = TextWindow.ReadNumber() If a = 4096 Then Sound.PlayChimes() TextWindow.WriteLine("Lukk lahti! Otsin tähte...") Algus = 0 T2() Else Goto Mat25 EndIf EndSub Sub T2 If Algus = 1 Then Goto Kuju EndIf Program.Delay(500) TextWindow.BackgroundColor = "White" TextWindow.ForegroundColor = "Black" TextWindow.Clear() TextWindow.BackgroundColor = "Blue" TextWindow.ForegroundColor = "White" TextWindow.WriteLine("Täht on purskkaevu lähedal kuju sees.") TextWindow.ForegroundColor = "Black" TextWindow.BackgroundColor = "White" TextWindow.WriteLine("Marten Jr. Mul juhtumisi hea haamer kaasas.") TextWindow.WriteLine("Vajuta suvalisi nuppe, et lõhkuda kuju! ►") TextWindow.Readkey() a = 0 Algus = 1 Kuju: If a > 49 Then TextWindow.WriteLine("Seal see on!") TextWindow.Readkey() TextWindow.Readkey() TextWindow.ForegroundColor = "Green" TextWindow.WriteLine(" ▓") TextWindow.WriteLine(" ▓▓▓") TextWindow.WriteLine(" ▓▓▓▓▓") TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓▓") TextWindow.WriteLine(" ▓▓▓▓▓▓▓") TextWindow.WriteLine(" ▓▓▓▓ ▓▓▓▓") TextWindow.WriteLine(" ▓▓▓ ▓▓▓") Sound.PlayChimeAndWait() TextWindow.BackgroundColor = "Black" TextWindow.ForegroundColor = "White" star = 2 TextWindow.Readkey() kodu() ElseIf a >= 40 then TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.WriteLine(" ▓") TextWindow.WriteLine(" ▓ ▓") TextWindow.WriteLine(" ▓▓▓▓") Hit() elseif a >= 30 then TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.WriteLine(" ▓") TextWindow.WriteLine(" ▓▓") TextWindow.WriteLine(" ▓") TextWindow.WriteLine(" ▓ ▓") TextWindow.WriteLine(" ▓ ▓") TextWindow.WriteLine("▓ ▓▓▓▓▓") Hit() elseif a >= 20 then TextWindow.WriteLine("") TextWindow.WriteLine(" ▓") TextWindow.WriteLine(" ▓▓") TextWindow.WriteLine(" ▓▓") TextWindow.WriteLine(" ▓▓▓") TextWindow.WriteLine(" ▓ ▓") TextWindow.WriteLine(" ▓ ▓") TextWindow.WriteLine(" ▓ ▓ ▓") TextWindow.WriteLine("▓ ▓▓▓▓▓ ▓") Hit() elseif a >= 10 then TextWindow.WriteLine("") TextWindow.WriteLine(" ▓▓") TextWindow.WriteLine("▓▓▓▓▓▓") TextWindow.WriteLine("▓ ▓▓▓") TextWindow.WriteLine("▓ ▓▓▓") TextWindow.WriteLine(" ▓ ▓") TextWindow.WriteLine(" ▓ ▓") TextWindow.WriteLine(" ▓ ▓ ▓") TextWindow.WriteLine(" ▓▓▓▓▓ ▓") Hit() Else TextWindow.WriteLine(" ▓▓▓") TextWindow.WriteLine(" ▓▓▓") TextWindow.WriteLine("▓▓▓▓▓▓▓▓▓") TextWindow.WriteLine("▓ ▓▓▓ ▓") TextWindow.WriteLine("▓ ▓▓▓ ▓") TextWindow.WriteLine(" ▓ ▓") TextWindow.WriteLine(" ▓ ▓") TextWindow.WriteLine(" ▓ ▓") TextWindow.WriteLine(" ▓▓▓▓▓") Hit() EndIf EndSub Sub Hit TextWindow.Readkey() TextWindow.Clear() Sound.PlayClick() a = a + 1 T2() EndSub ' Ma jõudsin arusaamani, et proovisime teha Action-mängu tekstiga... Sub PT2 TextWindow.WriteLine("Vesi näkku jälle...") TextWindow.WriteLine("Seekord siis minevik... ►") TextWindow.Readkey() TextWindow.Clear() TextWindow.ForegroundColor = "Blue" TextWindow.WriteLine(" ▓▓▓ ▓▓▓ ▓▓ ▓▓▓▓▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓▓▓") TextWindow.WriteLine(" ▓ ▓ ▓ ▓ ��� ▓ ▓ ▓ ▓ ▓ ▓ ▓") TextWindow.WriteLine(" ▓▓▓ ▓▓ ▓▓▓▓ ▓ ▓ ▓ ▓▓ ▓▓ ▓") TextWindow.WriteLine(" ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓") TextWindow.WriteLine(" ▓ ▓▓▓ ▓ ▓ ▓ ▓▓ ▓ ▓ ▓ ▓ ▓▓▓▓▓") TextWindow.Readkey() TextWindow.ForegroundColor = "White" TextWindow.WriteLine("Su laadimiskood on LEFT B UP UP A RIGHT") TextWindow.Readkey() TextWindow.Clear() TextWindow.WriteLine("Martenus: KUIDAS SA SIIA SAID?!?") TextWindow.WriteLine(" SA OLED VIST JUMAL!") TextWindow.WriteLine(" VÕTA MU SUURIM AARE! ►") TextWindow.Readkey() TextWindow.Clear() TextWindow.ForegroundColor = "Blue" TextWindow.WriteLine(" ▓") TextWindow.WriteLine(" ▓▓▓") TextWindow.WriteLine(" ▓▓▓▓▓") TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓▓") TextWindow.WriteLine(" ▓▓▓▓▓▓▓") TextWindow.WriteLine(" ▓▓▓▓ ▓▓▓▓") TextWindow.WriteLine(" ▓▓▓ ▓▓▓") Sound.PlayChimeAndWait() TextWindow.ForegroundColor = "White" star = 3 TextWindow.Readkey() kodu() EndSub Sub Boss TextWindow.WriteLine("Viimast korda seda purskkaevu kasutada.") TextWindow.WriteLine("Hoia alt Britten. Siit ma tulen! ►") TextWindow.Readkey() TextWindow.BackgroundColor = "White" TextWindow.ForegroundColor = "Red" TextWindow.Clear() TextWindow.WriteLine(" ▓ ▓▓▓▓ ▓▓▓ ▓▓▓ ▓▓▓▓▓ ▓ ▓ ▓▓▓") TextWindow.WriteLine(" ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓") TextWindow.WriteLine(" ▓ ▓▓▓▓ ▓▓▓ ▓▓ ▓ ▓ ▓ ▓▓▓") TextWindow.WriteLine(" ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓") TextWindow.WriteLine(" ▓▓▓ ▓▓▓▓ ▓ ▓▓▓ ▓ ▓▓ ▓▓▓") TextWindow.Readkey() TextWindow.ForegroundColor = "Black" TextWindow.WriteLine("Su laadimiskood on A A UP B LEFT LEFT") TextWindow.Readkey() TextWindow.Clear() TextWindow.WriteLine("Britten: Siin sa oled! Kümne minutiga siin... kiire.") TextWindow.WriteLine(" Aga miks sa mu kuju lõhkusid? ►") TextWindow.Readkey() TextWindow.WriteLine("Sina: See polnudki mingi mehe kuju?") TextWindow.Write("Britten: KAS ") Program.Delay(800) TextWindow.ForegroundColor = "Blue" TextWindow.Write("SA JUST ") Program.Delay(800) TextWindow.ForegroundColor = "Green" TextWindow.Write("SOLVASID") Program.Delay(800) TextWindow.ForegroundColor = "Red" TextWindow.WriteLine(" MIND?!? ►") TextWindow.ForegroundColor = "Black" TextWindow.Readkey() TextWindow.WriteLine(" Ma veel näitan sulle oma võimeid! Vaata pealkirja!") TextWindow.WriteLine("Sina: Millest sa räägid? ►") TextWindow.Readkey() TextWindow.Title = "Jango*" klikk() TextWindow.Title = "Jango**" klikk() TextWindow.Title = "Jango** *" klikk() TextWindow.Title = "Jango** **" klikk() TextWindow.Title = "Jango** ** *" klikk() TextWindow.Title = "Jango** ** **" klikk() TextWindow.Title = "Jango** ** ***" klikk() TextWindow.Title = "Jango** ** ****" klikk() TextWindow.Title = "Jango** ** *****" klikk() TextWindow.Title = "jangO** ** ***I*" klikk() TextWindow.Title = "jANgO** *N ***I*" klikk() TextWindow.Title = "jANgo** *n *A*i*" klikk() TextWindow.Title = "jaNGo*N *n *A*i*" klikk() TextWindow.Title = "JanGo*N *n Pa*I*" klikk() TextWindow.Title = "jango*N ON Pa*I*" klikk() TextWindow.Title = "jangoEn oN pA*i*" klikk() TextWindow.Title = "BangOEn on pa*i*" klikk() TextWindow.Title = "BAIgOEn on pA*I*" klikk() TextWindow.Title = "BAIgTeN On PA*I*" klikk() TextWindow.Title = "BaIgTen ON PARI*" klikk() TextWindow.Title = "bRiGTen ON PaRi*" klikk() TextWindow.Title = "bRiGTEN oN pARiM" klikk() TextWindow.Title = "BRITTEN ON PARIM" TextWindow.WriteLine(" Kas midagi juhtus?") TextWindow.WriteLine("Britten: Küll sa näed... ►") TextWindow.Readkey() TextWindow.BackgroundColor = "Black" TextWindow.ForegroundColor = "White" kilk() TextWindow.BackgroundColor = "Green" kilk() TextWindow.BackgroundColor = "Blue" kilk() TextWindow.BackgroundColor = "Red" kilk() TextWindow.WriteLine("Tahad veel näha? ►") TextWindow.Readkey() TextWindow.WriteLine("Sina: Sa oled ju lihtsalt kätega vehkinud...") TextWindow.WriteLine("Britten: Ma ei suuda sind enam võtta!") TextWindow.WriteLine(" Ainult üks trikk veel ja siis oled läinud. ►") TextWindow.Readkey() Desktop.SetWallPaper("http://www.electrum.ee/ul/Viimsi_kool.JPG") TextWindow.BackgroundColor = "Black" TextWindow.ForegroundColor = "White" TextWindow.Clear() Kodu2() EndSub Sub klikk Sound.PlayClick() Program.Delay(200) EndSub Sub kilk Sound.PlayBellRing() TextWindow.Clear() TextWindow.WriteLine("MUHAHAHA!") Program.Delay(500) EndSub Sub END TextWindow.Title = "CRASH" TextWindow.BackgroundColor = "Blue" TextWindow.ForegroundColor = "White" TextWindow.Clear() TextWindow.WriteLine("A problem has been detected and Windows has been shut down to prevent damage") TextWindow.WriteLine("to your computer") TextWindow.WriteLine("") TextWindow.WriteLine("MANUALLY_INITIATED_CRASH") TextWindow.WriteLine("") TextWindow.WriteLine("If this is the first time you've seen this Stop error screen,") TextWindow.WriteLine("restart your computer. If this screen appears again, follow") TextWindow.WriteLine("these steps:") TextWindow.WriteLine("") TextWindow.WriteLine("Check to make sure any new hardware or software is properly installed.") TextWindow.WriteLine("If this is a new installation, ask your hardware or software manufacturer") TextWindow.WriteLine("for any Windows updates you might need.") TextWindow.WriteLine("") TextWindow.WriteLine("If problems continue, disable or remove any newly installed hardware") TextWindow.WriteLine("or software. Disable BIOS memory options such as caching or shadowing.") TextWindow.WriteLine("If you need to use Safe Mode to remove or disable components, restart") TextWindow.WriteLine("your computer, press F8 to select Advanced Startup Options, and then") TextWindow.WriteLine("select Safe Mode.") TextWindow.WriteLine("") TextWindow.WriteLine("Technical information:") TextWindow.WriteLine("") TextWindow.WriteLine("*** STOP: 0x000000E2 (0x00000000,0x00000000,0x00000000,0x00000000)") TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.Write("Collecting data for crash dump .") Program.Delay(500) TextWindow.Write(".") Program.Delay(500) TextWindow.WriteLine(".") Program.Delay(500) TextWindow.Write("Initializing disk for crash dump .") Program.Delay(500) TextWindow.Write(".") Program.Delay(500) TextWindow.WriteLine(".") Program.Delay(500) TextWindow.WriteLine("Physical memory dump complete.") TextWindow.WriteLine("Contact your system admin or technical support group for further assistance.") TextWindow.Readkey() TextWindow.Title = "Jango" TextWindow.BackgroundColor = "Black" TextWindow.ForegroundColor = "Red" TextWindow.Clear() TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.WriteLine(" ▓▓▓▓▓") TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓") TextWindow.Write(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Green" TextWindow.WriteLine(" ▓") TextWindow.ForegroundColor = "Red" TextWindow.Write(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Green" TextWindow.WriteLine(" ▓▓") TextWindow.ForegroundColor = "Red" TextWindow.Write(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Green" TextWindow.WriteLine(" ▓ ▓▓▓") TextWindow.ForegroundColor = "Red" TextWindow.Write(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Green" TextWindow.WriteLine(" ▓▓▓ ▓▓▓▓▓") TextWindow.ForegroundColor = "Red" TextWindow.Write(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Green" TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Red" TextWindow.Write(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Green" TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓▓���▓▓▓") TextWindow.ForegroundColor = "Red" TextWindow.Write(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Green" TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Red" TextWindow.Write(" ▓▓▓▓ ▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Green" TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Red" TextWindow.Write(" ▓▓") TextWindow.ForegroundColor = "Blue" TextWindow.Write(" ▓▓▓▓▓") TextWindow.ForegroundColor = "Red" TextWindow.Write(" ▓▓▓▓") TextWindow.ForegroundColor = "Green" TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Red" TextWindow.Write(" ▓") TextWindow.ForegroundColor = "Blue" TextWindow.Write(" ▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Red" TextWindow.Write(" ▓") TextWindow.ForegroundColor = "Green" TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Blue" TextWindow.Write(" ▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Green" TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Blue" TextWindow.Write(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Yellow" TextWindow.Write(" ▓") TextWindow.ForegroundColor = "Green" TextWindow.Write(" ▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Yellow" TextWindow.WriteLine(" ▓") TextWindow.ForegroundColor = "Blue" TextWindow.Write(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Yellow" TextWindow.Write(" ▓▓▓") TextWindow.ForegroundColor = "Green" TextWindow.Write(" ▓▓▓▓") TextWindow.ForegroundColor = "Yellow" TextWindow.WriteLine(" ▓▓") TextWindow.ForegroundColor = "Blue" TextWindow.Write(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Yellow" TextWindow.WriteLine(" ▓▓▓▓▓▓ ▓▓▓") TextWindow.ForegroundColor = "Blue" TextWindow.Write(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Yellow" TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Blue" TextWindow.Write(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Yellow" TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Blue" TextWindow.Write(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Yellow" TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Blue" TextWindow.Write(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Yellow" TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Blue" TextWindow.Write(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Yellow" TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Blue" TextWindow.Write(" ▓▓▓▓▓▓▓ ▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Yellow" TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Blue" TextWindow.Write(" ▓▓▓▓ ▓▓▓▓") TextWindow.ForegroundColor = "Yellow" TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Blue" TextWindow.Write(" ▓▓ ▓▓") TextWindow.ForegroundColor = "Yellow" TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Blue" TextWindow.Write(" ▓") TextWindow.ForegroundColor = "Yellow" TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "Yellow TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓▓▓▓▓") TextWindow.WriteLine(" ▓▓▓▓▓▓▓▓▓▓") TextWindow.ForegroundColor = "White" TextWindow.Write(" Microsoft®") TextWindow.ForegroundColor = "Yellow" TextWindow.WriteLine(" ▓▓▓▓▓") TextWindow.ForegroundColor = "White" TextWindow.Write(" __ ___ _ ") TextWindow.ForegroundColor = "Red" TextWindow.WriteLine("XP") TextWindow.ForegroundColor = "White" TextWindow.WriteLine(" \ \ / (_)_ _ __| |_____ __ _____") TextWindow.WriteLine(" \ \/\/ /| | ' \/ _` / _ \ V V (_-<") TextWindow.WriteLine(" \_/\_/ |_|_||_\__,_\___/\_/\_//__/") TextWindow.Readkey() TextWindow.Clear() Algus() EndSub End>GSW909.sb<