SB_Fileset> Start>LBC178.sb< 'Product by Thaelmann-Pioniere GraphicsWindow.Title="South Africa" GraphicsWindow.BackgroundColor="#FFFFFF" GraphicsWindow.Width=625 GraphicsWindow.Height=415 GraphicsWindow.CanResize="False" GraphicsWindow.BrushColor="#007749" GraphicsWindow.FillTriangle(77,0,397,214,77,427) GraphicsWindow.FillRectangle(0,0,77.5,427) GraphicsWindow.FillRectangle(332,170,384,86) GraphicsWindow.BrushColor="#FFB81C" GraphicsWindow.FillTriangle(0,52,242,213,0,374) GraphicsWindow.BrushColor="#000000" GraphicsWindow.FillTriangle(0,85,191,213,0,341) GraphicsWindow.BrushColor="#E03C31" GraphicsWindow.FillTriangle(128,0,341,142,341,0) GraphicsWindow.FillRectangle(340,0,299,142) GraphicsWindow.BrushColor="#001489" GraphicsWindow.FillTriangle(341,284,128,427,341,427) GraphicsWindow.FillRectangle(340,284,299,143) End>LBC178.sb< Start>LBD553.sb< LDShapes.ShapeEvent=onshapeclick LDControls.ListBoxItemChanged = OnListBoxItemChanged ldControls.MenuClicked=Onbtnclick GraphicsWindow.MouseDown=Onmousedown GraphicsWindow.MouseMove=Onmousemove GraphicsWindow.MouseUp=Onup GUI() GraphicsWindow.Title="Shapes Editor GraphicsWindow.BackgroundColor="tan f200=150 Sub add_Points ' Prp["Points"] --> Points[i][1],Points[i][2] minx=1000 miny=1000 points="" _pt= LDText.Split(Prp["Points"]," ") ' _pt= 10,30 20,25 40,50 For j=1 To Array.GetItemCount(_pt) points[j]= LDText.Split(_pt[j],",") minx=math.Min(minx,points[j][1]) miny=math.Min(miny,points[j][2]) EndFor For i=1 To Array.GetItemCount(points) points[i][1]= Math.Round(points[i][1]-minx) points[i][2]= Math.Round(points[i][2]-miny) EndFor EndSub Sub addshape ' add base shapes .... Ellipse Rectangle Triangle Line and Text points="" If _nmb=1 Then ' Ellipse (Polygon) ElseIf 1<_nmb and _nmb<5 Then ' Rectangle Triangle Line (Polygon ) ' Prp["Points"]= dt[_nmb] add_Points() shp=LDShapes.Addpolygon(points) ElseIf _nmb=5 Then ' Text GraphicsWindow.FontSize=20 shp=Shapes.AddText(" ") EndIf EndSub Sub AllClear _serial=Serial_nm cp= Text.GetIndexOf(_Serial,",") While cp>0 NN=NN+1 sname= Text.GetSubText(_serial,1,cp-1) _serial=text.GetSubTextToEnd(_serial,cp+1) Shapes.Remove(sname) cp= Text.GetIndexOf(_Serial,",") EndWhile angle="" zoom="" _msg="" _path="" _img="" _sop="" Serial_nm="" shape="" sname="" points="" EndSub Sub get_Prp Prp=LDShapes.GetProperties(sname) ' gets Ell&Rec=Width,Height, Tri=Points, _type=text.GetSubText(Prp["Name"],1,3) cx=Prp["ActualWidth"]/2 cy=Prp["ActualHeight"]/2 _pt=Prp["Points"] _spt= LDText.Split(Prp["Points"]," ") _pts=ldtext.Split(ldtext.Replace(_pt," ",","),",") _XY="X="+(LDShapes.GetLeft(sname))+";Y="+(LDShapes.Gettop(sname)) edit="True" _bc=Prp["Fill"] _pc=Prp["Stroke"] _pw=Prp["StrokeThickness"] _sop=Prp["Opacity"]*100 GraphicsWindow.Title=LDShapes.LastEventShape+" : X= "+_XY["X"]+" , Y= "+_XY["Y"]+" , W= "+2*cx*zoom[sname]["w"]+" , H= "+2*cy*zoom[sname]["h"]+" ,"+_pts+" , angle= "+angle[sname]+" ,pw= "+_pw+" ,Zoom= "+zoom[sname]["h"] EndSub Sub GUI CRLF= Text.GetCharacter(13)+Text.GetCharacter(10) DQ=Text.GetCharacter(34) Name="Pol=4;Tex=5;Ima=6;" _backCLR="#FFFFFF" GraphicsWindow.top=10 GraphicsWindow.Left=10 GraphicsWindow.Width=1100 GraphicsWindow.Height=650 ' GraphicsWindow.BrushColor="#98D98E" ' GraphicsWindow.FillRectangle(0,0,1300,80) GraphicsWindow.BrushColor="Navy" bt="Load SBfile,file;=Save To SBfile,file;=Add WebImg/Txt,file;=Add PC-Img,file;=BackGrndClr,Edit;=BgHalftone,Edit;=BgImg,Edit;=All_Clear,edit;=Capture,edit;=ReView,edit;=AddPoly,Shapes;=Ellipse,Shapes;=Rect,Shapes;=Triang,Shapes;=Line,Shapes;=SetPoly,Shapes;=----,Shapes;=Shadow,Shapes;=Info,Shapes;=About,Help;=---,File;=Exit,File _btn=LDText.Split(bt ";=") mm["File"] = "Main" mm["Edit"] = "Main" mm["Shapes"] = "Main" mm["Colors"]="Main mm["Help"]="Main For i=1 To Array.GetItemCount(_btn) arr=LDText.Split(_btn[i],",") ' btn[i]= Controls.AddButton(_arr[1],_arr[2],_arr[3]) mm[arr[1]]=arr[2] EndFor cll=LDText.Split("Red Green Blue White Gray LightGray DarkGray Orange Salmon Gold Brown Cyan Magenta Yellow Teal Tan MidnightBlue Black" " ") For i=1 To Array.GetItemCount(cll) mm["$"+cll[i]]="Colors" EndFor LDControls.AddMenu(GraphicsWindow.Width 20 mm "" "") GraphicsWindow.FontSize=11 items = "0=Hide this ListBox;1=Width zoom -0.5;2=Width zoom -0.1;3=Width zoom +0.1;4=Width zoom +0.5;5=**** ;6=Height zoom -0.5;7=Height zoom -0.1;8=Height zoom +0.1;9=Height zoom +0.5;10=**** ;11=Rotate Left -45;" items = items+ "12=Rotate Left -2;13=Rotate Right +2;14=Rotate Right +45;15=PW Narrower -1;16=PW Wider +1;17=Opacity -5;18=Opacity -2;19=Opacity +2;20=Opacity +5;21=Z_Index Top;22=Z_Index Bottom;23=Change BrushColor;" items = items+ "24=Change PenColor;25=Copy it;26=**** ;27=Remove it;28=Edit_Poly;29=Reshape_Poly;" listBox = LDControls.AddListBox(items,150,550) Shapes.Move(listBox,1500,80) GraphicsWindow.FontSize=12 _pwstart=1 Serial_nm="" _sall=LDShapes.GetAllShapes() start= Array.GetItemCount(_sall) ' controls and shapes number added _sz="1w=-0.5;1h=0;2w=-0.1;2h=0;3w=0.1;3h=0;4w=0.5;4h=0;6w=0;6h=-0.5;7w=0;7h=-0.1;8w=0;8h=0.1;9w=0;9h=0.5;11=-45;12=-2;13=2;14=45;15=-1;16=1;17=-5;18=-2;19=2;20=5;21=1;22=-1;" ' change size data _op="17=-5;18=-2;19=2;20=5" addppolygon="False" EndSub Sub initial_anglezoom zoom[shp]["w"]=1 ' initial zoom width=1 zoom[shp]["h"]=1 ' initial zoom height=1 angle[shp]=0 ' initial angle=0 sop[shp]=100 ' set opacity bc[shp]="#BED3CA" ' initial Brush color pc[shp]="#1E50A2" ' initial Pen color pw[shp]=1 ' initial Pen Width fsz[shp]=20 ' initial Fontsize EndSub Sub Load_addshape For i = 1 To Array.GetItemCount(shape) If shape[i]["fn"] = "Tex" Then ' Text message shape shp = Shapes.Addtext( shape[i]["msg"]) LDShapes.penColour(shp , shape[i]["bc"]) _msg[shp]=shape[i]["msg"] ElseIf shape[i]["fn"] = "Img" Then ' Image shape shp = Shapes.AddImage(Imagelist.LoadImage( shape[i]["Src"] )) _path[shp]= Ldtext.Replace(shape[i]["Src"],"\","\\") _img[shp]=Imagelist.LoadImage( shape[i]["Src"] ) ElseIf shape[i]["fn"] = "Pol" Then ' Polygon shape _pt= LDText.Split(shape[i]["pts"]," ") points="" For j=1 To Array.GetItemCount(_pt) points[j]=LDText.Split(_pt[j],",") EndFor shp = Ldshapes.AddPolygon(points) LDShapes.BrushColour(shp , shape[i]["bc"]) LDShapes.PenColour(shp , shape[i]["pc"]) LDShapes.Penwidth(shp , shape[i]["pw"]) EndIf Shapes.Move(shp, shape[i]["x"], shape[i]["y"]) If Text.IsSubText("Tex:Img:",shape[i]["fn"]) Then Shapes.Zoom(shp,shape[i]["zmw"],shape[i]["zmh"]) zoom[shp]["w"]=shape[i]["zmw"] zoom[shp]["h"]=shape[i]["zmh"] EndIf Shapes.Rotate(shp, shape[i]["ang"]) ' rotation after zooming Shapes.SetOpacity(shp,shape[i]["op"]) sop[shp]=shape[i]["op"] angle[shp]=shape[i]["ang"] serialdata() EndFor EndSub Sub LoadSB RD= Text.GetSubTextToEnd(RD,Text.GetIndexOf(RD,"shape[1]=")) RD= Text.GetSubText(RD,1,Text.GetIndexOf(RD,"EndSub")-1) crp= Text.GetIndexOf(RD,CRLF) NN=0 While crp>0 _this= Text.GetSubText(RD,1,crp-1) _this= text.GetSubTextToEnd(_this,text.GetIndexOf(_this,"=")+1) NN=NN+1 shape[NN]= ldText.Replace(_this,DQ,"") ' set shape parameter RD= Text.GetSubTextToEnd(RD,crp+1) crp= Text.GetIndexOf(RD,CRLF) EndWhile Load_addshape() EndSub Sub Onbtnclick '=============================================================MENU------------------------------- nm= LDControls.LastMenuItem If text.IsSubText(nm,"Save") Then ' save To SB shape[] array data savetoSB() path=LDDialogs.SaveFile("sb","C:\") ' or Program.Directory+"\Sample.sb" ' The following line could be harmful and has been automatically commented. ' File.WriteContents(path,conts) ElseIf text.IsSubText(nm,"Load") Then ' Load SB file ( gets shape[] array ) ' The following line could be harmful and has been automatically commented. ' RD=File.ReadContents(LDDialogs.OpenFile("sb","C:\")) LoadSB() ElseIf text.IsSubText(nm,"Clear") Then ' Clear all shapes ww=LDDialogs.Confirm ("Sure To clear all?" "Warning!") If ww="Yes" Then AllClear() EndIf ElseIf text.IsSubText(nm,"Exit") Then ' Clear all shapes ww=LDDialogs.Confirm ("Sure To clear all and exit?" "Warning!") If ww="Yes" Then Program.End() EndIf ElseIf text.IsSubText(nm,"Capture") Then ' capture graphics window // working area img=LDGraphicsWindow.Capture("","False") LDImage.Crop(img,0,21,1150,570) path=LDDialogs.SaveFile("jpg","E:\") ' or Program.Directory+"\Sample.jpg" LDImage.SaveAs(img,path) ElseIf text.IsSubText(nm,"ReView") Then ' save tempfile Then clear reload Re_View() ElseIf nm="About" Then mss=LDText.Replace("Shapes V2.0;;;Created by NaoChan;;Updated by Tryhest" ";" CRLF) GraphicsWindow.ShowMessage(mss "Shapes Editor") ElseIf text.IsSubText(nm,"Shadow") Then LDEffect.DropShadow(shp "") ElseIf text.IsSubText(nm,"Web") Then txx=FCDialogs.AskForTextLine("Txt:") If Text.StartsWith(txx "#") Then _txt=Controls.GetTextBoxText(Text.GetSubTextToEnd(txx 2)) If Text.IsSubText(_txt,"http://") Then ipath=_txt shp= shapes.AddImage(imagelist.LoadImage(_txt))' Web Image Else ipath=Flickr.GetRandomPicture(_txt) shp= shapes.AddImage(imagelist.LoadImage(ipath))' Flicker Image EndIf _img[shp]=ImageList.LoadImage(ipath) _path[shp]=ipath shapeadd_btnhide() Else GraphicsWindow.BrushColor="Navy" GraphicsWindow.FontSize=20 shp= Shapes.AddText(txx) _msg[shp]=txx shapeadd_btnhide() GraphicsWindow.BrushColor="#BED3CA" EndIf ElseIf text.IsSubText(nm,"PC-Img") Then ipath= Ldtext.Replace(LDDialogs.OpenFile("*.*","C:\"),"\","\\") shp= shapes.AddImage(ImageList.LoadImage(ipath)) ' Image in your PC _img[shp]=ImageList.LoadImage(ipath) _path[shp]=ipath shapeadd_btnhide() ElseIf text.IsSubText(nm,"Rect") Then points=0 points[1][1]=0 points[1][2]=0 points[2][1]=50 points[2][2]=0 points[3][1]=50 points[3][2]=50 points[4][1]=0 points[4][2]=50 shp=LDShapes.AddPolygon(points) Shapes.Move(shp,180+(_nmb-1)*50+10*math.GetRandomNumber(5),100+_nmb*50+15*math.GetRandomNumber(5)) LDShapes.BrushColour(shp,"#BED3CA" ) LDShapes.PenColour(shp,"#1E50A2") LDShapes.PenWidth(shp,_pwstart) initial_anglezoom() serialdata() ElseIf text.IsSubText(nm,"Trian") Then points=0 points[1][1]=0 points[1][2]=50 points[2][1]=100 points[2][2]=50 points[3][1]=50 points[3][2]=0 shp=LDShapes.AddPolygon(points) Shapes.Move(shp,180+(_nmb-1)*50+10*math.GetRandomNumber(5),100+_nmb*50+15*math.GetRandomNumber(5)) LDShapes.BrushColour(shp,"#BED3CA" ) LDShapes.PenColour(shp,"#1E50A2") LDShapes.PenWidth(shp,_pwstart) initial_anglezoom() serialdata() ElseIf text.IsSubText(nm,"BgHalf") Then cl=LDDialogs.Colour() LDGraphicsWindow.BackgroundBrush( LDShapes.BrushGradient("1="+cl+";2=black" "DD")) ElseIf text.IsSubText(nm,"BgImg") Then cl=FCDialogs.AskForTextLine("File or #flickr") if Text.StartsWith(cl "#") Then ii=imagelist.LoadImage( Flickr.GetRandomPicture(Text.GetSubTextToEnd(cl 2))) Else ii=ImageList.LoadImage(cl) EndIf LDGraphicsWindow.BackgroundBrush(LDShapes.BrushImage(ii)) ElseIf text.IsSubText(nm,"Ellipse") Then DR=35 NN=20 points=0 For i=1 To NN points[i][1]=math.Round(DR*(1+Math.Sin((i-1)/NN*math.pi*2))*10)/10 points[i][2]=math.Round(DR*(1+Math.cos((i-1)/NN*math.pi*2))*10)/10 EndFor shp=LDShapes.AddPolygon(points) Shapes.Move(shp,180+(_nmb-1)*50+10*math.GetRandomNumber(5),100+_nmb*50+15*math.GetRandomNumber(5)) LDShapes.BrushColour(shp,"#BED3CA" ) LDShapes.PenColour(shp,"#1E50A2") LDShapes.PenWidth(shp,_pwstart) initial_anglezoom() serialdata() ElseIf text.IsSubText(nm,"Back") Then ' change BackgroundColor _backCLR= FCDialogs.AskForColor() GraphicsWindow.BackgroundColor=_backCLR ElseIf text.IsSubText(nm,"AddPoly") Then ' add a unique polygon addppolygon="True" points="" cnt=0 ldr=1000 minx=1000 miny=1000 _cx=0 _cy=0 GraphicsWindow.Title="Shapes Editor * POLY mode... ' Controls.SetButtonCaption(btn[11],"SetPolygon") ElseIf text.StartsWith(nm,"$") Then LDShapes.BrushColour(shp Text.GetSubTextToEnd(nm 2)) ElseIf addppolygon and text.IsSubText(nm,"SetPoly") Then ' set the polygon GraphicsWindow.Title="Shapes Editor setresetpolygon() shp= LDShapes.AddPolygon(points) Shapes.Animate(shp,minx,miny,300) LDShapes.BrushColour(shp,"#BED3CA") LDShapes.PenWidth(shp,2) addppolygon="False" ' Controls.SetButtonCaption(btn[11],"AddPolygon") serialdata() EndIf EndSub Sub OnListBoxItemChanged If sname<>"" Then get_Prp() _LNMB=LDControls.LastListBoxIndex If (_LNMB = 0) Then GraphicsWindow.Width=1100 ' narrowen GraphicsWindow.Width Shapes.move(listBox,1500,80) ' Hide Listbox ElseIf (0<_LNMB And _LNMB<15) Then For k=1 To 14 PM[k]=0 EndFor PM[_LNMB]=1 _zmw=zoom[sname]["w"]+_sz[_LNMB+"w"]*PM[_LNMB] _zmh=zoom[sname]["h"]+_sz[_LNMB+"h"]*PM[_LNMB] zoom[sname]["w"]=math.Min(Math.Max(0.1,_zmw),20) ' get 0.1 To 20 zoom[sname]["h"]=math.Min(Math.Max(0.1,_zmh),20) Shapes.Zoom(sname,zoom[sname]["w"],zoom[sname]["h"]) _pw=math.Max(0,math.Min(zoom[sname]["w"]*_pwstart*PM[_LNMB],_pw)) angle[sname]= angle[sname]+_sz[_LNMB]*PM[_LNMB] ' change angle Shapes.Rotate(sname,angle[sname]) ElseIf (_LNMB = 15 or _LNMB=16) Then _pw=Math.max(0,prp["StrokeThickness"]+_sz[_LNMB]) ' change penwidth LDShapes.PenWidth (sname,_pw) ElseIf (16<_LNMB and _LNMB<21) Then ' Set Opacity = 0 --- 100 _sop=math.Min(Math.Max(0,Prp["Opacity"]*100+_op[_LNMB]),100) shapes.SetOpacity(sname,_sop) ElseIf (_LNMB = 21 or _LNMB=22) Then LDShapes.ZIndex(sname,_sz[_LNMB]) ' change Z-index If _LNMB = 21 Then ' To Top Serial_nm=LDText.Replace(Serial_nm,sname+",","")+sname+"," ElseIf _LNMB = 22 Then ' To Bottom Serial_nm=sname+","+LDText.Replace(Serial_nm,sname+",","") EndIf ElseIf (_LNMB=23) Then _clr= Lddialogs.Colour() ' ********** If not stable , use FCdialogs.AskForColor() ******** If _type="Tex" Then LDShapes.SetProperty(sname,"Foreground",_clr) Else LDShapes.BrushColour(sname,_clr) ' change brushcolor EndIf ElseIf (_LNMB=24) Then _clr= Lddialogs.Colour() ' ********** If not stable , use FCdialogs.AskForColor() ******** LDShapes.PenColour(sname,_clr) ' change pencolor ElseIf (_LNMB = 25) Then ' copy its shape If text.IsSubText("Pol",_type) Then _nmb=Name[_type] _pt= LDText.Split(Prp["Points"]," ") add_Points() shp = Ldshapes.AddPolygon(points) LDShapes.BrushColour(shp,_bc) ' Brushcolor LDShapes.PenColour(shp,_pc) ' Pencolor LDShapes.PenWidth(shp,_pw) ' Penwidth shapes.Move(shp,500,250) serialdata() ElseIf _type="Tex" Then _nmb=5 addshape() Shapes.SetText(shp,Prp["Text"]) LDShapes.PenColour(shp,_pc) ' change pencolor _msg[shp]=Prp["Text"] ElseIf _type="Ima" Then shp=Shapes.AddImage( LDImage.Copy(_img[sname])) _path[shp]=_path[sname] shapeadd_btnhide() EndIf sop[sname]=_sop ' opacity set_data() ' zoom, angle,Opacity ElseIf (_LNMB = 27) Then ' Remove a shape If Text.IsSubText(Serial_nm,sname) Then removedata() EndIf ElseIf (_LNMB = 28) Then ' Edit Polygon pell="" edit="true emm="true cnt=Array.GetItemCount(_spt) ddy=0.0000000001 drs=Math.GetRadians( angle[sname]) cx2=cx*zoom[sname]["w"] cy2=cy*zoom[sname]["h"] For j=1 To cnt pell[j]=shapes.AddEllipse(10,10) _XY2=LDText.Split(_spt[j],",") _x=_XY2[1]*zoom[sname]["w"] _y=_XY2[2]*zoom[sname]["h"] r=math.SquareRoot((_x-cx2)*(_x-cx2)+(_y-cy2)*(_y-cy2)) ' Length from shapes center If (_y-cy2)<0 Then s=math.ArcTan((_x-cx2)/(_y-cy2+ddy)) Else s=math.ArcTan((_x-cx2)/(_y-cy2+ddy))-Math.pi EndIf _x2=_xy["X"]+cx-r*math.sin(s-drs)'' _y2=_xy["Y"]+cy-r*math.cos(s-drs)'' Shapes.Move(pell[j],_x2-5,_y2-5) LDShapes.SetShapeEvent(pell[j]) EndFor _sname=sname ElseIf emm and (_LNMB = 29) Then ' Reset Polygon (after Edit) setresetpolygon() oshp=shp emm="false shp= LDShapes.AddPolygon(points) Shapes.Animate(shp,minx,miny,30) serialdata() sname=_sname get_Prp() LDShapes.BrushColour(shp,_bc) '<---- same color as before LDShapes.PenColour(shp,_pc) ' <---- LDShapes.PenWidth(shp,_pw) addppolygon="False" edit="False" points="" Shapes.Remove(oshp) EndIf If (_LNMB < 27) Then get_Prp() EndIf EndIf GraphicsWindow.Title=LDShapes.LastEventShape+" : X= "+_XY["X"]+" , Y= "+_XY["Y"]+" , W= "+2*cx*zoom[sname]["w"]+" , H= "+2*cy*zoom[sname]["h"]+" ,"+_pts+" , angle= "+angle[sname]+" ,pw= "+_pw+" ,Zoom= "+zoom[sname] EndSub Sub Onmousedown MX= GraphicsWindow.MouseX MY= GraphicsWindow.MouseY If 580 and mx80 and mx0 Then GraphicsWindow.PenColor="Navy" ' other's color EndIf cnt=cnt+1 pell[cnt]=shapes.AddEllipse(8,8) Shapes.Move(pell[cnt],MX-4,MY-4) EndIf EndSub Sub Onmousemove MVX= GraphicsWindow.MouseX MVY= GraphicsWindow.MouseY If Mouse.IsLeftButtonDown and TF and mvx0 NN=NN+1 sname= Text.GetSubText(_serial,1,cp-1) _serial=text.GetSubTextToEnd(_serial,cp+1) get_Prp() _zmw=zoom[sname]["w"] ' zoom["w"] _zmh=zoom[sname]["h"] ' zoom["h"] _xp=math.round(LDShapes.GetLeft(sname)+cx*(1-_zmw))' X _yp=math.round(LDShapes.Gettop(sname)+cy*(1-_zmh)) ' Y _bc=(text.GetSubTextToEnd(Prp["Fill"],4)) ' bc _pc=(text.GetSubTextToEnd(Prp["Stroke"],4)) ' pc _pw=(Prp["StrokeThickness"]*_zmh) ' pw If _type="Pol" Then ' Polygon Resize_polygon() conts=conts+"shape["+(NN)+"]="+DQ+"fn=Pol;x="+_xp+";y="+_yp+";pts="+_newpt+";zmw=1;zmh=1;ang="+(angle[sname])+";op="+(Prp["Opacity"]*100)+";bc=#"+_bc+";pc=#"+_pc+";pw="+_pw+";"+DQ+CRLF ElseIf _type="Tex" Then ' Text conts=conts+"shape["+(NN)+"]="+DQ+"fn=Tex;x="+Math.round(LDShapes.GetLeft(sname))+";y="+ Math.round(LDShapes.Gettop(sname))+";op="+(Prp["Opacity"]*100)+ ";" conts=conts+"zmw="+(_zmw)+";zmh="+(_zmh)+";fsz="+Prp["FontSize"]+";msg="+ _msg[sname]+";ang="+(angle[sname])+";bc=#"+(text.GetSubTextToEnd(Prp["Foreground"],4))+";pc=;pw=;"+DQ+CRLF ElseIf _type="Ima" Then ' Image conts=conts+"shape["+(NN)+"]="+DQ+"fn=Img;x="+Math.round(LDShapes.GetLeft(sname))+";y="+ Math.round(LDShapes.Gettop(sname))+";op="+(Prp["Opacity"]*100)+";" conts=conts+"zmw="+(_zmw)+";zmh="+(_zmh)+";Src="+(_path[sname])+";ang="+(angle[sname])+";bc=;pc=;pw=;"+DQ+CRLF EndIf cp= Text.GetIndexOf(_Serial,",") EndWhile conts=conts+"EndSub" EndSub Sub serialdata If zoom[shp]="" Then zoom[shp]="w=1;h=1" ' zoom =W=1,H=1 EndIf LDShapes.SetShapeEvent(shp) angle[shp]=0 Serial_nm=Serial_nm+shp+"," ' serial name EndSub Sub set_data zoom[shp]=zoom[sname] Shapes.Zoom(shp,zoom[sname]["w"],zoom[sname]["h"]) angle[shp]=angle[sname] Shapes.Rotate(shp,angle[shp]) ' change angle sop[shp]=sop[sname] EndSub Sub setresetpolygon minx=1000 miny=1000 points="" For i=1 To cnt minx=math.Min(minx,Shapes.GetLeft(pell[i])) miny=math.Min(miny,Shapes.Gettop(pell[i])) EndFor For i=1 To cnt points[i][1]= Math.Round(Shapes.GetLeft(pell[i])-minx)+4 points[i][2]= Math.Round(Shapes.Gettop(pell[i])-miny)+4 Shapes.Remove(pell[i]) EndFor EndSub Sub shapeadd_btnhide Shapes.Move(shp,180+(_nmb-1)*50+10*math.GetRandomNumber(5),100+_nmb*50+15*math.GetRandomNumber(5)) 'LDShapes.BrushColour(shp,"#BED3CA" ) LDShapes.PenColour(shp,"#1E50A2") LDShapes.PenWidth(shp,_pwstart) initial_anglezoom() serialdata() EndSub ' 1) add default shapes ; click Ellipse, Rectangle, Triangle, Line Shapes(they are Polygon) in the heading. ' 2) modify it ; click mouse on a shape, Listbox appears. Select below items ( click). ' Width zoom -0.5 ,Width zoom -0.1 ,Width zoom +0.1, Width zoom +0.5, Height zoom -0.5, Height zoom -0.1, Height zoom +0.1, Height zoom +0.5 ' Rotate Left -45, Rotate Left -2, Rotate Right +2, Rotate Right +45, Penwidth Narrower -1, Penwidth Wider +1, Z_Index most Top, Z_Index most Bottom ' SetOpacity -5,-2 +2,+5 Change BrushColor( Text color), Change PenColor, Copy it , Remove it, Hide Listbox , Add text , ' Click "EditPolygon" ;you can edit points of the polygon// Click "ResetPolygon ; add the edited polygon ' Click "AddPolygon" ; Click points To add a polygon shape // Click "SetPolygon" ; a polygon shape will be added ' 3) Add an image and a text ( Flicker Image, Web image , Text ) // image and text can be copied. ' 4) Add an image which is in your PC ' 5) Load a SBfile (get shape[N] data and add its shapes. ) ' 6) save To a SBfile ; click [Save To SBfile] button . ' 7) Clear All Shapes ; click [All_Clear] button. ' 8) Capture GraphicsWindow (working area) ; click [Capture] ' 9) Click [ReView]; Save shapes data To Temp.sb , clear graphics and Then reload shapes. ' If you want To add Init.sb , it is available from IDNo : STD116 ' End>LBD553.sb< Start>LBD742-4.sb< ' Pendulum Clock 0.24 ' Copyright (c) 2013 Nonki Takahashi. All rights reserved. ' ' History: ' 0.24 2013/02/15 Bug fixed. (LBD742-4) ' 0.2 2013/02/14 Changed for Silverlight. (LBD742-0) ' 0.1 2013/02/14 Created. (LBD742) ' 0.0 2013/02/14 14:37:20 Shapes generated by Shapes 1.5 ' GraphicsWindow.Title = "Pendulum Clock 0.24" gw = 569 gh = 426 GraphicsWindow.Width = gw GraphicsWindow.Height = gh color = GraphicsWindow.GetPixel(0, 0) If Text.GetLength(color) > 7 Then silverlight = "True" Else silverlight = "False" EndIf ' initialize shapes Shapes_Init() cx = shX + 92 cy = shY + 92 ' add shapes scale = 1 Shapes_Add() GraphicsWindow.FontName = "Consolas" GraphicsWindow.FontSize = 12 GraphicsWindow.BrushColor = "Black" Timer.Interval = 250 Timer.Tick = OnTick Sub OnTick tick = Math.Remainder(tick + 1, 8) If tick = 0 Then If Clock.Minute = 0 And Clock.Second = 0 Then times = Math.Remainder(Clock.Hour, 12) EndIf ShowClock() If times > 0 Then Sound.PlayBellRing() times = times - 1 Else Sound.PlayClick() EndIf angle = 10 ElseIf tick = 1 Then angle = 9 ElseIf tick = 2 Then angle = 7 ElseIf tick = 3 Then angle = -2 ElseIf tick = 4 Then If Clock.Minute = 0 And Clock.Second = 0 Then times = Math.Remainder(Clock.Hour, 12) EndIf ShowClock() If times > 0 Then Sound.PlayBellRing() times = times - 1 Else Sound.PlayClick() EndIf angle = -10 ElseIf tick = 5 Then angle = -9 ElseIf tick = 6 Then angle = -7 ElseIf tick = 7 Then angle = 2 EndIf ShowPendulum() EndSub Sub ShowClock r = 15 angle = Math.Remainder(Clock.Hour, 12) * 30 + Clock.Minute / 2 x = r * Math.Sin(Math.GetRadians(angle)) + cx y = -r * Math.Cos(Math.GetRadians(angle)) + cy Shapes.Move(shape[38]["obj"], x - 2, y - r) ' hour hand Shapes.Rotate(shape[38]["obj"], angle) r = 30 angle = Clock.Minute * 6 + Clock.Second / 10 x = r * Math.Sin(Math.GetRadians(angle)) + cx y = -r * Math.Cos(Math.GetRadians(angle)) + cy Shapes.Move(shape[39]["obj"], x - 1, y - r) ' minute hand Shapes.Rotate(shape[39]["obj"], angle) angle = Clock.Second * 6 x = r * Math.Sin(Math.GetRadians(angle)) + cx y = -r * Math.Cos(Math.GetRadians(angle)) + cy Shapes.Move(shape[40]["obj"], x, y - r) ' second hand Shapes.Rotate(shape[40]["obj"], angle) EndSub Sub ShowPendulum ' param angle r = 56 x = -r * Math.Sin(Math.GetRadians(angle)) + cx y = r * Math.Cos(Math.GetRadians(angle)) + shY + 170 Shapes.Move(shape[4]["obj"], x - 4, y - 60) ' pendulum rod Shapes.Rotate(shape[4]["obj"], angle) r = 81 x = -r * Math.Sin(Math.GetRadians(angle)) + cx y = r * Math.Cos(Math.GetRadians(angle)) + shY + 170 Shapes.Move(shape[5]["obj"], x - 29, y - 29) ' pendulum weight EndSub Sub Shapes_Init ' Shapes | Initialize shapes data ' return shX, shY - current position of shapes ' return shape - array of shapes shX = 200 ' x offset shY = 55 ' y offset shape = "" shape[1] = "func=tri;x=28;y=287;x1=64;y1=0;x2=0;y2=39;x3=129;y3=39;angle=180;bc=#1A0500;pw=0;" shape[2] = "func=rect;x=28;y=157;width=129;height=130;bc=#000000;pw=0;" shape[3] = "func=tri;x=56;y=287;x1=36;y1=0;x2=0;y2=20;x3=73;y3=20;angle=180;bc=#000000;pw=0;" shape[4] = "func=rect;x=87;y=165;width=9;height=121;bc=#BF8D3D;pc=#E6B870;pw=2;" ' pendulum rod shape[5] = "func=ell;x=62;y=222;width=59;height=59;bc=#BF8D3D;pc=#E6B870;pw=4;" ' pendulum weight shape[6] = "func=rect;x=28;y=157;width=28;height=130;bc=#1A0500;pw=0;" shape[7] = "func=rect;x=129;y=157;width=28;height=130;bc=#1A0500;pw=0;" shape[8] = "func=line;x=59;y=190;x1=0;y1=0;x2=0;y2=91;pc=#E6B870;pw=2;" shape[9] = "func=line;x=126;y=190;x1=0;y1=0;x2=0;y2=91;pc=#E6B870;pw=2;" shape[10] = "func=line;x=59;y=190;x1=0;y1=0;x2=67;y2=0;pc=#E6B870;pw=2;" shape[11] = "func=line;x=59;y=280;x1=0;y1=0;x2=34;y2=19;pc=#E6B870;pw=2;" shape[12] = "func=line;x=92;y=280;x1=0;y1=19;x2=34;y2=0;pc=#E6B870;pw=2;" shape[13] = "func=tri;x=54;y=92;x1=38;y1=0;x2=0;y2=92;x3=77;y3=92;bc=#1A0500;pw=0;" shape[14] = "func=tri;x=22;y=78;x1=38;y1=0;x2=0;y2=92;x3=77;y3=92;angle=45;bc=#1A0500;pw=0;" shape[15] = "func=tri;x=8;y=46;x1=38;y1=0;x2=0;y2=92;x3=77;y3=92;angle=90;bc=#1A0500;pw=0;" shape[16] = "func=tri;x=22;y=13;x1=38;y1=0;x2=0;y2=92;x3=77;y3=92;angle=135;bc=#1A0500;pw=0;" shape[17] = "func=tri;x=54;y=0;x1=38;y1=0;x2=0;y2=92;x3=77;y3=92;angle=180;bc=#1A0500;pw=0;" shape[18] = "func=tri;x=87;y=13;x1=38;y1=0;x2=0;y2=92;x3=77;y3=92;angle=225;bc=#1A0500;pw=0;" shape[19] = "func=tri;x=100;y=45;x1=38;y1=0;x2=0;y2=92;x3=77;y3=92;angle=270;bc=#1A0500;pw=0;" shape[20] = "func=tri;x=87;y=78;x1=38;y1=0;x2=0;y2=92;x3=77;y3=92;angle=315;bc=#1A0500;pw=0;" shape[21] = "func=ell;x=11;y=11;width=163;height=163;bc=#DFA549;pc=#E6B870;pw=4;" shape[22] = "func=ell;x=22;y=22;width=141;height=141;bc=#FFFFFF;pc=#E6B870;pw=4;" ' dial plate shape[23] = "func=text;x=113;y=34;text= I;angle=30;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[24] = "func=text;x=132;y=53;text=II;angle=60;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[25] = "func=text;x=137;y=80;text=III;angle=90;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[26] = "func=text;x=126;y=107;text=IIII;angle=120;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[27] = "func=text;x=116;y=127;text=V;angle=150;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[28] = "func=text;x=86;y=134;text=VI;angle=180;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[29] = "func=text;x=56;y=127;text=VII;angle=210;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[30] = "func=text;x=33;y=108;text=VIII;angle=240;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[31] = "func=text;x=32;y=81;text=IX;angle=270;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[32] = "func=text;x=39;y=54;text= X;angle=300;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[33] = "func=text;x=58;y=34;text=XI;angle=330;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[34] = "func=text;x=82;y=26;text=XII;bc=#000000;fs=20;fn=Coulier New;" ' hour numeral shape[35] = "func=text;x=76;y=60;text=NONKI;bc=#000000;fs=10;fn=Coulier New;" shape[36] = "func=ell;x=67;y=110;width=9;height=9;bc=#C0C0C0;pc=#000000;pw=2;" shape[37] = "func=ell;x=107;y=110;width=9;height=9;bc=#C0C0C0;pc=#000000;pw=2;" shape[38] = "func=rect;x=90;y=92;width=5;height=30;bc=#333333;pw=0;" ' hour hand shape[39] = "func=rect;x=91;y=92;width=3;height=60;bc=#000000;pw=0;" ' minute hand shape[40] = "func=rect;x=92;y=92;width=1;height=60;bc=#000000;pw=0;" ' second hand shape[41] = "func=ell;x=86;y=86;width=13;height=13;bc=#DFA549;pc=#E6B870;pw=4;" ' center EndSub Sub Shapes_Add ' Shapes | Add shapes as shapes data ' param shape - array of shapes ' param scale - to zoom ' return nShapes - number of shapes ' return shAngle - current angle of shapes Stack.PushValue("local", i) nShapes = Array.GetItemCount(shape) index = Array.GetAllIndices(shape) s = scale For j = 1 To nShapes i = index[j] 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 shape[i]["rx"] = shape[i]["x"] shape[i]["ry"] = shape[i]["y"] EndFor shAngle = 0 i = Stack.PopValue("local") EndSub End>LBD742-4.sb< Start>LBD742.sb< ' Pendulum Clock 0.1 ' Copyright (c) 2013 Nonki Takahashi. All rights reserved. ' ' History: ' 0.1 2013/02/14 Created. ' 0.0 2013/02/14 14:37:20 Shapes generated by Shapes 1.5 ' GraphicsWindow.Title = "Pendulum Clock 0.1" ' initialize shapes Shapes_Init() cx = shX + 92 cy = shY + 92 gw = GraphicsWindow.Width gh = GraphicsWindow.Height ' add shapes scale = 1 Shapes_Add() GraphicsWindow.FontName = "Consolas" GraphicsWindow.FontSize = 12 GraphicsWindow.BrushColor = "Black" Timer.Interval = 250 Timer.Tick = OnTick Sub OnTick tick = Math.Remainder(tick + 1, 8) If tick = 0 Then If Clock.Minute = 0 And Clock.Second = 0 Then times = Math.Remainder(Clock.Hour, 12) EndIf ShowClock() If times > 0 Then Sound.PlayBellRing() times = times - 1 Else Sound.PlayClick() EndIf angle = 10 ElseIf tick = 1 Then angle = 9 ElseIf tick = 2 Then angle = 7 ElseIf tick = 3 Then angle = -2 ElseIf tick = 4 Then If Clock.Minute = 0 And Clock.Second = 0 Then times = Math.Remainder(Clock.Hour, 12) EndIf ShowClock() If times > 0 Then Sound.PlayBellRing() times = times - 1 Else Sound.PlayClick() EndIf angle = -10 ElseIf tick = 5 Then angle = -9 ElseIf tick = 6 Then angle = -7 ElseIf tick = 7 Then angle = 2 EndIf ShowPendulum() EndSub Sub ShowClock r = 15 angle = Math.Remainder(Clock.Hour, 12) * 30 + Clock.Minute / 2 x = r * Math.Sin(Math.GetRadians(angle)) + cx y = -r * Math.Cos(Math.GetRadians(angle)) + cy Shapes.Move(shape[38]["obj"], x - 2, y - r) ' hour hand Shapes.Rotate(shape[38]["obj"], angle) r = 30 angle = Clock.Minute * 6 + Clock.Second / 10 x = r * Math.Sin(Math.GetRadians(angle)) + cx y = -r * Math.Cos(Math.GetRadians(angle)) + cy Shapes.Move(shape[39]["obj"], x - 1, y - r) ' minute hand Shapes.Rotate(shape[39]["obj"], angle) angle = Clock.Second * 6 x = r * Math.Sin(Math.GetRadians(angle)) + cx y = -r * Math.Cos(Math.GetRadians(angle)) + cy Shapes.Move(shape[40]["obj"], x, y - r) ' second hand Shapes.Rotate(shape[40]["obj"], angle) EndSub Sub ShowPendulum ' param angle r = 56 x = -r * Math.Sin(Math.GetRadians(angle)) + cx y = r * Math.Cos(Math.GetRadians(angle)) + shY + 170 Shapes.Move(shape[4]["obj"], x - 4, y - 60) ' pendulum rod Shapes.Rotate(shape[4]["obj"], angle) r = 81 x = -r * Math.Sin(Math.GetRadians(angle)) + cx y = r * Math.Cos(Math.GetRadians(angle)) + shY + 170 Shapes.Move(shape[5]["obj"], x - 29, y - 29) ' pendulum weight EndSub Sub Shapes_Init ' Shapes | Initialize shapes data ' return shX, shY - current position of shapes ' return shape - array of shapes shX = 230 ' x offset shY = 70 ' y offset shape = "" shape[1] = "func=tri;x=28;y=287;x1=64;y1=0;x2=0;y2=39;x3=129;y3=39;angle=180;bc=#1A0500;pw=0;" shape[2] = "func=rect;x=28;y=157;width=129;height=130;bc=#000000;pw=0;" shape[3] = "func=tri;x=56;y=287;x1=36;y1=0;x2=0;y2=20;x3=73;y3=20;angle=180;bc=#000000;pw=0;" shape[4] = "func=rect;x=87;y=165;width=9;height=121;bc=#BF8D3D;pc=#E6B870;pw=2;" ' pendulum rod shape[5] = "func=ell;x=62;y=222;width=59;height=59;bc=#BF8D3D;pc=#E6B870;pw=4;" ' pendulum weight shape[6] = "func=rect;x=28;y=157;width=28;height=130;bc=#1A0500;pw=0;" shape[7] = "func=rect;x=129;y=157;width=28;height=130;bc=#1A0500;pw=0;" shape[8] = "func=line;x=59;y=190;x1=0;y1=0;x2=0;y2=91;pc=#E6B870;pw=2;" shape[9] = "func=line;x=126;y=190;x1=0;y1=0;x2=0;y2=91;pc=#E6B870;pw=2;" shape[10] = "func=line;x=59;y=190;x1=0;y1=0;x2=67;y2=0;pc=#E6B870;pw=2;" shape[11] = "func=line;x=59;y=280;x1=0;y1=0;x2=34;y2=19;pc=#E6B870;pw=2;" shape[12] = "func=line;x=92;y=280;x1=0;y1=19;x2=34;y2=0;pc=#E6B870;pw=2;" shape[13] = "func=tri;x=54;y=92;x1=38;y1=0;x2=0;y2=92;x3=77;y3=92;bc=#1A0500;pw=0;" shape[14] = "func=tri;x=22;y=78;x1=38;y1=0;x2=0;y2=92;x3=77;y3=92;angle=45;bc=#1A0500;pw=0;" shape[15] = "func=tri;x=8;y=46;x1=38;y1=0;x2=0;y2=92;x3=77;y3=92;angle=90;bc=#1A0500;pw=0;" shape[16] = "func=tri;x=22;y=13;x1=38;y1=0;x2=0;y2=92;x3=77;y3=92;angle=135;bc=#1A0500;pw=0;" shape[17] = "func=tri;x=54;y=0;x1=38;y1=0;x2=0;y2=92;x3=77;y3=92;angle=180;bc=#1A0500;pw=0;" shape[18] = "func=tri;x=87;y=13;x1=38;y1=0;x2=0;y2=92;x3=77;y3=92;angle=225;bc=#1A0500;pw=0;" shape[19] = "func=tri;x=100;y=45;x1=38;y1=0;x2=0;y2=92;x3=77;y3=92;angle=270;bc=#1A0500;pw=0;" shape[20] = "func=tri;x=87;y=78;x1=38;y1=0;x2=0;y2=92;x3=77;y3=92;angle=315;bc=#1A0500;pw=0;" shape[21] = "func=ell;x=11;y=11;width=163;height=163;bc=#DFA549;pc=#E6B870;pw=4;" shape[22] = "func=ell;x=22;y=22;width=141;height=141;bc=#FFFFFF;pc=#E6B870;pw=4;" ' dial plate shape[23] = "func=text;x=113;y=34;text= I;angle=30;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[24] = "func=text;x=132;y=53;text=II;angle=60;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[25] = "func=text;x=137;y=80;text=III;angle=90;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[26] = "func=text;x=126;y=107;text=IIII;angle=120;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[27] = "func=text;x=116;y=127;text=V;angle=150;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[28] = "func=text;x=86;y=134;text=VI;angle=180;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[29] = "func=text;x=56;y=127;text=VII;angle=210;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[30] = "func=text;x=33;y=108;text=VIII;angle=240;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[31] = "func=text;x=32;y=81;text=IX;angle=270;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[32] = "func=text;x=39;y=54;text= X;angle=300;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[33] = "func=text;x=58;y=34;text=XI;angle=330;bc=#000000;fs=18;fn=Coulier New;" ' hour numeral shape[34] = "func=text;x=82;y=26;text=XII;bc=#000000;fs=20;fn=Coulier New;" ' hour numeral shape[35] = "func=text;x=76;y=60;text=NONKI;bc=#000000;fs=10;fn=Coulier New;" shape[36] = "func=ell;x=67;y=110;width=9;height=9;bc=#C0C0C0;pc=#000000;pw=2;" shape[37] = "func=ell;x=107;y=110;width=9;height=9;bc=#C0C0C0;pc=#000000;pw=2;" shape[38] = "func=rect;x=90;y=92;width=5;height=30;bc=#333333;pw=0;" ' hour hand shape[39] = "func=rect;x=91;y=92;width=3;height=60;bc=#000000;pw=0;" ' minute hand shape[40] = "func=rect;x=92;y=92;width=1;height=60;bc=#000000;pw=0;" ' second hand shape[41] = "func=ell;x=86;y=86;width=13;height=13;bc=#DFA549;pc=#E6B870;pw=4;" ' center EndSub Sub Shapes_Add ' Shapes | Add shapes as shapes data ' param shape - array of shapes ' param scale - to zoom ' return nShapes - number of shapes ' return shAngle - current angle of shapes Stack.PushValue("local", i) nShapes = Array.GetItemCount(shape) index = Array.GetAllIndices(shape) s = scale For j = 1 To nShapes i = index[j] 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 GraphicsWindow.FontSize = shape[i]["fs"] * s GraphicsWindow.FontName = shape[i]["fn"] shape[i]["obj"] = Shapes.AddText(shape[i]["text"]) EndIf Shapes.Move(shape[i]["obj"], shX + shape[i]["x"] * s, shY + shape[i]["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 shape[i]["rx"] = shape[i]["x"] shape[i]["ry"] = shape[i]["y"] EndFor shAngle = 0 i = Stack.PopValue("local") EndSub End>LBD742.sb< Start>LBJ259.sb< ' SmallBasic Version 1.2 ' Program: SBSnake Game ' Changelog: ' Author: Pappa Lapub ' Website: https://social.msdn.microsoft.com/Forums/en-US/a7044ab9-4c12-4e71-ac27-bb42767efc65/how-to-move-more-than-one-of-a-shapes-array-to-a-certain-area ' ImportURL: http://smallbasic.com/program/? ' Extension: --- ' Comment: ' ' Variables: arr field-properties: 0 .. default, 1 .. border/snake, -dLen .. food (default: -2) ' ToDo: d*(X-1) -> d*X - d (personal maxScore: 74) ' wooden style ' increase speed (intv -10 ... bis 100 ?) '=============================================================================== '' Konstanten d = 20 ' 10 w = 40 'Breite Spielfeld h = 30 'Höhe Spielfeld maxLen = 200 dLen = 2 cBG = "#232323" ' "Yellow" ' (Abdeckung) cBorder = "Blue" cHead = "DarkViolet" ' "DarkRed" cSnake = "#EE204D" ' "Red" cFruit = "Lime" ' "DeepPink" ' fruit/candy lf = Text.GetCharacter(10) snk = Text.GetCharacter(55357) + Text.GetCharacter(56333) bDbg = "" ' "True" ' DbgView with P-Pause '' Variablen ResetVariables() BuildGUI() Timer.Interval = 200 '150 Timer.Tick = OnTimerTick GraphicsWindow.KeyDown = OnKeyDown ' ////////// EVENTs \\\\\\\\\\ Sub OnTimerTick If dx <> 0 Or dy <> 0 Then If bReady Then bReady = "" If foodGone Then ' offer food fx = Math.GetRandomNumber(w - 2) + 1 fy = Math.GetRandomNumber(h - 2) + 1 If arr[fx][fy] = 0 Then arr[fx][fy] = -dLen ' -2, -nutritional value, eg. -5 -> snake grows 5 limbs longer / fruit GraphicsWindow.BrushColor = cFruit GraphicsWindow.FillEllipse(d*(fx-1),d*(fy-1), d,d) foodGone = "" EndIf EndIf EndIf If iHead > 0 Then GraphicsWindow.BrushColor = cSnake GraphicsWindow.FillEllipse(d*(x-1),d*(y-1), d,d) EndIf ' move x = x + dx y = y + dy If arr[x][y] = 1 Then ' position already ocupied by snake itself or wall/border -> End Timer.Pause() GraphicsWindow.ShowMessage("Fehler!"+ lf +"Schade, das war's.", "SBSnake") 'Program.End() ' OR ... ResetVariables() ' .. start over ResetGUI() ' .. start over ElseIf arr[x][y] < 0 Then ' food at head position wait = wait - arr[x][y] ' hold tail for some moves foodGone = "True" EndIf ' draw head GraphicsWindow.BrushColor = cHead GraphicsWindow.FillEllipse(d*(x-1),d*(y-1), d,d) arr[x][y] = 1 ' draw tail/snake iHead = iHead + 1 sx[iHead] = x sy[iHead] = y If wait <= 0 Then ' keep length & remove last limb (tail) iTail = iTail + 1 len = len + 1 GraphicsWindow.BrushColor = cBG GraphicsWindow.FillRectangle(d*(sx[iTail]-1),d*(sy[iTail]-1), d,d) arr[sx[iTail]][sy[iTail]] = 0 Else ' temporary holding tail -> snake grows longer (at the beginning) wait = wait - 1 pts = pts + 1 GraphicsWindow.Title = "SBSnake "+ pts EndIf If len >= maxLen Then TrimLeft() EndIf EndIf bReady = "True" EndSub Sub OnKeyDown lastKey = GraphicsWindow.LastKey If lastKey = "Escape" Then Program.End() ElseIf lastKey = "Left" Then dx = -1 dy = 0 ElseIf lastKey = "Right" Then dx = 1 dy = 0 ElseIf lastKey = "Up" Then dx = 0 dy = -1 ElseIf lastKey = "Down" Then dx = 0 dy = 1 ElseIf lastKey = "P" Then If paused Then Shapes.HideShape(shp) TextWindow.Hide() paused = "" Timer.Resume() Else paused = "True" Timer.Pause() Shapes.ShowShape(shp) If bDbg Then DbgInfo() EndIf EndIf EndIf EndSub ' ////////// SUBs \\\\\\\\\\ Sub BuildGUI GraphicsWindow.Top = 0 GraphicsWindow.Left = (Desktop.Width - w*d) / 2 GraphicsWindow.CanResize = "" GraphicsWindow.Height= h * d GraphicsWindow.Width = w * d GraphicsWindow.BackgroundColor = cBG LDGraphicsWindow.Icon = "C:\Program Files (x86)\Microsoft\Small Basic\Projects\Icons\SBSnake.ico" ' Randbalken (gefüllt mit 1) + Nummerierung GraphicsWindow.FontBold = "" For i = 1 To w arr[i][1] = 1 arr[i][h] = 1 GraphicsWindow.BrushColor = cBorder GraphicsWindow.FillRectangle(d*(i-1),0, d,d) ' oberer Rand GraphicsWindow.FillRectangle(d*(i-1),d*(h-1), d,d) ' unterer Rand GraphicsWindow.BrushColor = "Black" ' Spalten # oben GraphicsWindow.DrawText(d*(i-1),2, i) EndFor For i = 2 To h arr[1][i] = 1 arr[w][i] = 1 GraphicsWindow.BrushColor = cBorder GraphicsWindow.FillRectangle(0,d*(i-1), d,d) ' linker Rand GraphicsWindow.FillRectangle(d*(w-1),d*(i-1), d,d) ' rechter Rand GraphicsWindow.BrushColor = "Black" ' Zeilen # links GraphicsWindow.DrawText(2,d*(i-1), i) EndFor '' Pause-Shape GraphicsWindow.FontSize = 72 shp = Shapes.AddText(snk + " PAUSE ('P' continue)") Shapes.Move(shp, 30,230) Shapes.HideShape(shp) GraphicsWindow.ShowMessage("Start mit Pfeiltasten."+ lf +"P .... Pause"+ lf +"Esc .. Ende", "SBSnake") EndSub Sub ResetVariables pts = 0 dx = 0 dy = 0 bReady = "True" foodGone = "True" ' Startposition/Head in center x = w / 2 y = h / 2 wait = 10 len = 0 iHead = 0 iTail = iHead sx = "" sy = "" sx[iTail] = x sy[iTail] = y For i = 2 To w-1 For j = 2 To h-1 arr[i][j] = 0 ' arr füllen mit 0 (nur Spielfeld, nicht Rand) EndFor EndFor EndSub Sub ResetGUI ' nicht Rand GraphicsWindow.BrushColor = cBG GraphicsWindow.FillRectangle(d,d, d*(w-2),d*(h-2)) Timer.Resume() EndSub Sub TrimLeft ' arrays sx,sy -> current right ends only iMax = maxLen * Math.Floor(iTail / maxLen) sx = Text.GetSubTextToEnd(sx, Text.GetIndexOf(sx, ";"+ iMax +"=")+1) sy = Text.GetSubTextToEnd(sy, Text.GetIndexOf(sy, ";"+ iMax +"=")+1) len = 0 EndSub Sub DbgInfo TextWindow.WriteLine("") TextWindow.WriteLine("x: " +x) TextWindow.WriteLine("y: " +y) TextWindow.WriteLine("iHead: " +iHead) TextWindow.WriteLine("iTail: " +iTail) TextWindow.WriteLine("len: " +len) TextWindow.WriteLine("wait: " +wait) TextWindow.WriteLine("pts: " +pts) TextWindow.WriteLine("sx: " +sx) TextWindow.WriteLine("sy: " +sy) TextWindow.WriteLine("") EndSub End>LBJ259.sb< Start>LBK843.sb< ' mahreen miangul SeptEMber 2018 ' Helped by Nonki Takahashi ' Doggy Blinking GraphicsWindow.Left = 0.05 * (Desktop.Width - GraphicsWindow.Width) GraphicsWindow.Top = 0 * (Desktop.Height - GraphicsWindow.Height) GraphicsWindow.Title = "mahreen miangul" GraphicsWindow.BackgroundColor="midnightblue" GraphicsWindow.Width = "1288" GraphicsWindow.Height = "666" ' =======================mahreen miangul--Game//FRAM==================== GraphicsWindow.BrushColor = "green GraphicsWindow.penColor = "lime GraphicsWindow.penwidth = 8 graphicsWindow.drawrectangle(0, 0, 750, 410) graphicsWindow.fillrectangle(0, 0, 750, 410) ' ===================mahreen miangul--Text//A Brief Guide to Genonics============ CRLF= Text.GetCharacter(13)+Text.GetCharacter(10) '<------------- line feed 'GraphicsWindow.brushColor = GraphicsWindow.GetRandomColor() 'GraphicsWindow.brushColor = GraphicsWindow.getcolorfromrgb(175, 75, 125) ' ============================== TEXT ============================== CRLF= Text.GetCharacter(13)+Text.GetCharacter(10) GraphicsWindow.brushColor = "yellow GraphicsWindow.FontSize = 22 msg=Shapes.AddText("A Brief Guide to Genonics!"+CRLF+"from"+CRLF+"mahreen "+CRLF+"miangul!") Shapes.Move(msg,770,0) ' =====================mahreen miangul--Text//Batting Practice================= GraphicsWindow.brushColor = "Yellow graphicswindow.FontSize = 55 haroon2= Shapes.AddText("Batting Practice!") Shapes.Move(haroon2, 1080, 670) Shapes.Animate(haroon2, 80, 20, 2000) Shapes.Rotate(haroon2, 0) GH = 330 GW = 420 GraphicsWindow.PenColor = "Brown" GraphicsWindow.PenWidth = "2" Lin = 850 LinH: For i = 1 to (GW/10) Lin = Lin + 10 Program.Delay(10) Shapes.AddLine(Lin, 120, Lin, GH) Endfor Lint = 110 For i = 1 to (GH/15) Lint = Lint + 10 Program.Delay(10) Shapes.AddLine(1270, Lint, GW + 438, Lint) Endfor Program.Delay(10) ' mahreen miangul--2 GraphicsWindow.brushColor = "Orange graphicswindow.FontSize = 55 haroon2= Shapes.AddText("The Grid!") Shapes.Move(haroon2, 0, 0) Shapes.Animate(haroon2, 950, 140, 2000) Shapes.Rotate(haroon2, 0) 'Makesprite() SPRITE_init() ' <--------- all shape data is input here!! add_shapes() ' <--------- all shapes are added here!! GraphicsWindow.FontSize = 17 GH = 450 GW = 700 H = 0 r = 173 g = 255 b = 47 He = GraphicsWindow.GetColorFromRGB(r, g, b) 'GraphicsWindow.PenWidth = 1'--Man 'GraphicsWindow.PenColor = "Black"'--Man 'GraphicsWindow.BrushColor = "Black"'--Man '-------------------------------------------------->GraphicsWindow.BackgroundColor = "Green"<--------------------------------------------------- 'Foot2 = Shapes.AddRectangle(30, 15)'--Man 'GraphicsWindow.PenColor = "LightGray"'--Man 'GraphicsWindow.BrushColor = "LightGray"'--Man 'Shapes.Move(Foot2, 130, (GH - 50))'--Man 'LegF = Shapes.AddRectangle(21, 50)'--Man 'Shapes.Move(LegF, 130, (GH - 100))'--Man 'LegF2 = Shapes.AddRectangle(45, 21)'--Man 'Shapes.Move(LegF2, 100, (GH - 100))'--Man 'Mid = Shapes.AddRectangle(42, 35)'--Man 'Shapes.Move(Mid, 85, (GH - 114))'--Man 'GraphicsWindow.PenWidth = 21'--Man 'Shapes.AddLine(35, (GH - 45), 92, (GH - 89))'--Man 'GraphicsWindow.PenColor = "Black"'--Man 'GraphicsWindow.BrushColor = "Black"'--Man 'Foot1 = Shapes.AddRectangle(30, 15)'--Man 'Shapes.Move(Foot1, 30, (GH - 50))'--Man GraphicsWindow.PenColor = "DarkRed"'--Lower Boader GraphicsWindow.BrushColor = "DarkRed"'--Lower Boader Ground = Shapes.AddRectangle(GW - 98, 50)'--Lower Boader Shapes.Move(Ground, 1, (GH + 166))'--Lower Boader 'GraphicsWindow.PenColor = "Blue"'--Man 'GraphicsWindow.BrushColor = "Blue"'Man 'Body = Shapes.AddRectangle(42, 65)'--Man 'Shapes.Move(Body, 85, (GH - 175))'--Man 'Arm1 = Shapes.AddRectangle(20, 16)'--Man 'Shapes.Move(Arm1, 127, (GH - 149))'Man 'GraphicsWindow.PenWidth = "1"'--Man 'GraphicsWindow.PenColor = "DarkRed"'--Man 'GraphicsWindow.BrushColor = "Tan"'--Man 'Hand = Shapes.AddRectangle(16, 16)''Man 'Shapes.Move(Hand, 148, (GH - 149))'--Man 'GraphicsWindow.PenWidth = "2"'--Man 'GraphicsWindow.PenColor = "White"'--Man 'Shapes.addline(147, (GH - 149), 147, (GH - 133))'--Man 'GraphicsWindow.PenColor = "Darkred"'--Man 'GraphicsWindow.PenWidth = "1"'--Man 'Head = Shapes.AddEllipse(50, 50)'--Man 'Shapes.Move(Head, 80, 230)'--Man GraphicsWindow.BrushColor = "Gray"'--Shoot Table GraphicsWindow.PenColor = "Gray"'--Shoot Table Base = Shapes.AddRectangle(100, 50)'--Shoot Table Shapes.Move(Base, (GW - 110), (GH - 110))'--Shoot Table Leg1 = Shapes.AddRectangle(10, 20)'--Shoot Table Shapes.Move(Leg1, (GW - 110), (GH - 60))'--Shoot Table Leg2 = Shapes.AddRectangle(10, 20)'--Shoot Table Shapes.Move(Leg2, (GW - 20), (GH - 60))'--Shoot Table GraphicsWindow.BrushColor = "Gray"'--Shoot Table GraphicsWindow.PenColor = "Gray"'--Shoot Table GraphicsWindow.PenWidth = 4 '--Shoot Table Shapes.AddLine((GW - 85), (GH - 135), (GW - 85), (GH - 165))'--Shoot Table Shapes.AddLine((GW - 25), (GH - 110), (GW - 25), (GH - 165))'--Shoot Table GraphicsWindow.PenWidth = "1"'--ShootBall GraphicsWindow.PenColor = "Red"'--ShootBall GraphicsWindow.BrushColor = He'--Shoot Ball Ball1 = Shapes.AddEllipse(20, 20)'--Shoot Ball Shapes.Move(Ball1, (GW - 45), 320)'--Shoot Ball Ball1 = Shapes.AddEllipse(20, 20)'--Shoot Ball Shapes.Move(Ball1, (GW - 65), 320)'--Shoot Ball Ball1 = Shapes.AddEllipse(20, 20)'--Shoot Ball Shapes.Move(Ball1, (GW - 85), 320)'--Shoot Ball Ball1 = Shapes.AddEllipse(20, 20)'--Shoot Ball Shapes.Move(Ball1, (GW - 45), 300)'--Shoot Ball Ball1 = Shapes.AddEllipse(20, 20)'--Shoot Ball Shapes.Move(Ball1, (GW - 65), 300)'--Shoot Ball Ball1 = Shapes.AddEllipse(20, 20)'--Shoot Ball Shapes.Move(Ball1, (GW - 85), 300)'--Shoot Ball Ball1 = Shapes.AddEllipse(20, 20)'--Shoot Ball Shapes.Move(Ball1, (GW - 45), 280)'--Shoot Ball Ball1 = Shapes.AddEllipse(20, 20)'--Shoot Ball Shapes.Move(Ball1, (GW - 65), 280)'--Shoot Ball Ball1 = Shapes.AddEllipse(20, 20)'--Shoot Ball Shapes.Move(Ball1, (GW - 85), 280)'--Shoot Ball Barrel = Shapes.AddRectangle(75, 25)'--Shoot Barrel Shapes.Move(Barrel, (GW - 140), (GH - 135))'--Shoot Barrel GraphicsWindow.PenColor = "Black"'--Cannon GraphicsWindow.BrushColor = "Black"'--Cannon Power = Shapes.AddEllipse(50, 50)'--Cannon Shapes.Move(Power, (GW - 95), (GH - 135))'--Cannon GraphicsWindow.BrushColor = "Red"'--1 Stp = Controls.AddButton("Quit", 750, (GH + 158))'--1 GraphicsWindow.BrushColor = "Blue"'--2 Mut = Controls.AddButton("Mute", 795, (GH + 158))'--2 GraphicsWindow.BrushColor = "Blue"'--3 Snd = Controls.AddButton("Music", 845, (GH + 158))'--3 GraphicsWindow.BrushColor = "Green"'--4 Hlp = Controls.AddButton("Help", 899, (GH + 158))'--4 GraphicsWindow.BrushColor = "Red" Ins = Controls.AddMultiLineTextBox((GW - (GW/7.4 - 100)), (GH + 186)) Controls.SetSize(Ins, 300, 25) BC = "Brown" Pen = "Black" 'GraphicsWindow.PenColor = "DarkRed"'--Man 'GraphicsWindow.BrushColor = "Black"'--Man 'ear1 = Shapes.AddEllipse(15, 15)'--Man 'Shapes.Move(ear1, 90, 247)'--Man 'GraphicsWindow.BrushColor = "Tan"'--Man 'ear2 = Shapes.AddEllipse(6, 6)'--Man 'shapes.move(ear2, 95, 252)'--Man 'GraphicsWindow.BrushColor = "Black"'--Man 'Shapes.AddTriangle(79, 250, 95, 248, 95, 230)'--Man 'Shapes.AddTriangle(131, 250, 115, 248, 115, 230)'--Man 'cap = Shapes.AddRectangle(20, 18)'--Man 'Shapes.Move(cap, 95, 230)'--Man 'vishat = Shapes.AddEllipse(60, 5)'--Man 'Shapes.Move(vishat, 78, 245)'--Man GraphicsWindow.brushColor = "Green" Controls.SetTextBoxText(Ins, "Wood Bat! (" + H + " Pts)") Sound.PlayChimeAndWait() UT = 1 F = 0 Spd = 500 UT1 = 0 UT2 = 0 UT3 = 0 UT4 = 0 UT5 = 0 UT6 = 0 UT7 = 0 Begin: Stuf = Controls.GetTextBoxText(Ins) If (Stuf = "#") Then GraphicsWindow.CanResize = "True" GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(0, 500, "To Set # of Points: Enter 'Px' into textbox, where x = # of Points, and press 'Mute'") GraphicsWindow.DrawText(0, 550, "To Set # of Level: Enter 'Lx' into textbox, where x = # of Level, and press 'Mute'") GraphicsWindow.DrawText(0, 600, "To cancel a 'Speed Round': Enter 'CS' into textbox, and press 'Mute'") ElseIf (Text.StartsWith(Stuf, "L")) then Num = Text.GetSubTextToEnd(Stuf, 2) H = Num*5 ElseIf (Text.StartsWith(Stuf, "P")) then Num = Text.GetSubTextToEnd(Stuf, 2) H = Num ElseIf (Text.StartsWith(Stuf, "CS")) then Spd = 500 Endif Rd = Math.GetRandomNumber(5) Controls.ButtonClicked = Button Sub Button Bilbo = Controls.LastClickedButton If (Bilbo = Stp) Then Sound.PlayClick() GraphicsWindow.ShowMessage("Please wait", "CLOSING...") Program.Delay(1500) Program.End() ElseIf (Bilbo = Hlp) Then Sound.PlayClick() GraphicsWindow.BrushColor = "Black" GraphicsWindow.ShowMessage("In 'Batting Practice', the player presses the space bar to swing the bat. For every Home Run, one point is gained. For every foul, one point is lost. Fouls are given if the ball is hit incorrectly, or if the player swings at a Ball (when the ball is out of the strike zone). For every five points gained, the player's bat is upgraded. For every three strikes in a row, the player loses all of their points. There are random 'Speed Rounds' on every fourth bat upgrade. If the player reaches 40 points, the game ends.", "") Controls.Remove(Hlp) GraphicsWindow.BrushColor = "Green" Hlp = Controls.AddButton("Help", 144, (GH - 33)) Elseif (Bilbo = Mut) Then Sound.PlayClick() GraphicsWindow.BrushColor = "Black" Sound.Stop("C:\Users\Cody\Downloads\Take Me Out To The Ballgame.mp3") Controls.Remove(Mut) GraphicsWindow.BrushColor = "Blue" Mut = Controls.AddButton("Mute", 50, (GH - 33)) GraphicsWindow.BrushColor = "Blue" Elseif (Bilbo = Snd) Then Sound.PlayClick() Sound.Stop("C:\Users\Cody\Downloads\Take Me Out To The Ballgame.mp3") GraphicsWindow.BrushColor = "Black" GraphicsWindow.ShowMessage("Please wait.", "LOADING MUSIC...") Sound.Play("C:\Users\Cody\Downloads\Take Me Out To The Ballgame.mp3") Controls.Remove(Snd) GraphicsWindow.BrushColor = "Blue" Snd = Controls.AddButton("Music", 95, (GH - 33)) GraphicsWindow.BrushColor = "Green" EndIf Endsub If(H = 5) and (UT1 = 0) Then BC = "Black" Pen = "LightGray" UT1 = 1 Spd = 500 GraphicsWindow.BrushColor = "Green" Controls.SetTextBoxText(Ins, "Upgrade to Aluminum bat! (" + H + " Pts)") Sound.PlayChimeAndWait() Elseif (H = 10) and (UT2 = 0) Then BC = "Red" Pen = "Black" UT2 = 1 Spd = 500 GraphicsWindow.BrushColor = "Green" Controls.SetTextBoxText(Ins, "Upgrade to Red bat! (" + H + " Pts)") Sound.PlayChimeAndWait() Elseif (H = 15) and (UT3 = 0)Then BC = "Green" Pen = "Orange" UT3 = 1 Spd = 500 GraphicsWindow.BrushColor = "Green" Controls.SetTextBoxText(Ins, "Upgrade to Green bat! (" + H + " Pts)") Sound.PlayChimeAndWait() Elseif (H = 20) and (UT4 = 0) Then BC = "Purple" Pen = "Yellow" UT4 = 1 Spd = 500 GraphicsWindow.BrushColor = "Green" Controls.SetTextBoxText(Ins, "Upgrade to Magic Bat! (" + H + " Pts)") Sound.PlayChimeAndWait() If (Rd < 5) Then Spd = 250 GraphicsWindow.BrushColor = "Orange" Controls.SetTextBoxText(Ins, "Speed Round! (" + H + " Pts)") Sound.PlayChimeAndWait() Endif Elseif (H = 25) and (UT5 = 0) Then BC = "Orange" Pen = "DarkRed" UT5 = 1 Spd = 500 GraphicsWindow.BrushColor = "Green" Controls.SetTextBoxText(Ins, "Upgrade to Fire Bat! (" + H + " Pts)") Sound.PlayChimeAndWait() Elseif (H = 30) and (UT6 = 0) Then BC = "LightGrey" Pen = "White" UT6 = 1 Spd = 500 GraphicsWindow.BrushColor = "Green" Controls.SetTextBoxText(Ins, "Upgrade to Silver Bat! (" + H + " Pts)") Sound.PlayChimeAndWait() Elseif (H = 35) and (UT7 = 0) Then BC = "Yellow" Pen = "Orange" UT7 = 1 Spd = 500 GraphicsWindow.BrushColor = "Green" Controls.SetTextBoxText(Ins, "Upgrade to Gold Bat! (" + H + " Pts)") Sound.PlayChimeAndWait() If (Rd < 3) Then Spd = 250 GraphicsWindow.BrushColor = "Orange" Controls.SetTextBoxText(Ins,"Speed Round!") Sound.PlayChimeAndWait() Endif ElseIf ((H = 0) or (H = 4)) and (UT1 = 1) Then BC = "Brown" Pen = "Black" Spd = 500 UT1 = 0 GraphicsWindow.BrushColor = "Red" Controls.SetTextBoxText(Ins, "Downgrade to Wood Bat! (" + H + " Pts)") Sound.PlayChimeAndWait() Elseif(H = 9) and (UT2 = 1) Then BC = "Black" Pen = "LightGray" UT2 = 0 Spd = 500 GraphicsWindow.BrushColor = "Red" Controls.SetTextBoxText(Ins, "Downgrade to Aluminum bat! (" + H + " Pts)") Sound.PlayChimeAndWait() Elseif (H = 14) and (UT3 = 1) Then BC = "Red" Pen = "Black" UT3 = 0 Spd = 500 GraphicsWindow.BrushColor = "Red" Controls.SetTextBoxText(Ins, "Downgrade to Red bat! (" + H + " Pts)") Sound.PlayChimeAndWait() Elseif (H = 19) and (UT4 = 1)Then BC = "Green" Pen = "Orange" UT4 = 0 Spd = 500 GraphicsWindow.BrushColor = "Red" Controls.SetTextBoxText(Ins, "Downgrade to Green bat! (" + H + " Pts)") Sound.PlayChimeAndWait() Elseif (H = 24) and (UT5 = 1) Then BC = "Purple" Pen = "Yellow" UT5 = 0 Spd = 500 GraphicsWindow.BrushColor = "Red" Controls.SetTextBoxText(Ins, "Downgrade to Magic Bat! (" + H + " Pts)") Sound.PlayChimeAndWait() Elseif (H = 29) and (UT6 = 1) Then BC = "Orange" Pen = "DarkRed" UT6 = 0 Spd = 500 GraphicsWindow.BrushColor = "Red" Controls.SetTextBoxText(Ins, "Downgrade to Fire Bat! (" + H + " Pts)") Sound.PlayChimeAndWait() Elseif (H = 34) and (UT7 = 1) Then BC = "LightGray" Pen = "White" UT7 = 0 Spd = 500 GraphicsWindow.BrushColor = "Red" Controls.SetTextBoxText(Ins, "Downgrade to Silver Bat! (" + H + " Pts)") Sound.PlayChimeAndWait() ElseIf (H > 39) Then Shapes.Remove(Bat) Shapes.Remove(Bat2) GraphicsWindow.BrushColor = "Red" Controls.SetTextBoxText(Ins, "Hurray, you finished the game!") Sound.PlayChimeAndWait() Program.Delay(1500) Program.end() Endif GraphicsWindow.PenColor = Pen GraphicsWindow.BrushColor = BC Bat = Shapes.AddRectangle(14, 65) Shapes.HideShape(Bat) Shapes.Move(Bat, 149, (GH - 213)) Shapes.ShowShape(Bat) Bat2 = Shapes.AddRectangle(14, 8) Shapes.HideShape(Bat2) Shapes.Move(Bat2, 149, (GH - 135)) Shapes.ShowShape(Bat2) GraphicsWindow.KeyDown = KeyDown GraphicsWindow.PenColor = "Red" GraphicsWindow.BrushColor = He Ball = Shapes.AddEllipse(20, 20) Shapes.HideShape(Ball) Shapes.Move(Ball, (GW - 90), 319) Shapes.ShowShape(Ball) GraphicsWindow.PenColor = "Gray" GraphicsWindow.BrushColor = "LightGray" Barrel = Shapes.AddRectangle(80, 25) Shapes.SetOpacity(Barrel, 75) Shapes.Move(Barrel, (GW - 140), (GH - 135)) GraphicsWindow.PenColor = "LightGray" GraphicsWindow.BrushColor = "Black" Power = Shapes.AddEllipse(50, 50) Shapes.Move(Power, (GW - 95), (GH - 135)) Shapes.SetOpacity(Power, 75) D = Spd Program.Delay(1000) Chance = Math.GetRandomNumber(5) If (Chance = 2) Then Y = 100 ElseIf (Chance = 1) Then Y = (GH - 50) Else Y = (GH - 185) Endif If (Chance < 3) Then X = -100 Else X = 165 EndIf Shapes.Animate(Ball, (GW - 155), 319, 200) Program.Delay(200) Shapes.Animate(Ball, X, Y, D) T = 0 Timer.Interval = Spd/4 Timer.Tick = Tick Sub Tick T = T + 1 EndSub K = 0 Sub Keydown K = 1 Shapes.Remove(Bat2) Shapes.Remove(Bat) GraphicsWindow.BrushColor = BC GraphicsWindow.PenColor = Pen Bat = Shapes.AddRectangle(66, 14) Shapes.Move(Bat, 163, (GH - 148)) If (T > 4) Then Shapes.Remove(Ball) F = 0 GraphicsWindow.BrushColor = "Orange" Controls.SetTextBoxText(Ins, "Too Late! (" + H + " Pts)") Goto Again Endif If (Chance > 2) Then Shapes.Remove(Ball) GraphicsWindow.BrushColor = "Red" GraphicsWindow.PenColor = He Ball = Shapes.AddEllipse(20, 20) If (T < 3)Then Shapes.Remove(Ball) F = 0 GraphicsWindow.BrushColor = "Orange" Controls.SetTextBoxText(Ins, "Too soon! (" + H + " Pts)") Goto Again ElseIf (T = 3) Then Sound.PlayClick() Shapes.Move(Ball, X, Y) Shapes.Animate(Ball, GW, (GH - 50), Spd + 300) H = H - 1 F = F + 1 If (F = 3) Then F = 0 GraphicsWindow.BrushColor = "Red" Controls.SetTextBoxText(Ins, "STRIKE 3! Lose all points! (0 Pts)") H = 0 Goto Again Endif If (H < 0) Then H = 0 Endif GraphicsWindow.BrushColor = "Red" Controls.SetTextBoxText(Ins, "Foul! STRIKE " + F + "! -1Pt (" + H + " Pts)") Goto Again ElseIf (T = 4) Then Sound.PlayClick() Shapes.Move(Ball, X, Y) Shapes.Animate(Ball, (GW + 100), 0, Spd) H = H + 1 F = 0 If (H < 0) Then H = 0 Endif GraphicsWindow.BrushColor = "Green" Controls.SetTextBoxText(Ins, "Home Run! +1Pt (" + H + " Pts)") Goto Again EndIf Elseif (Chance < 3) and (T < 5) and (T > 2) Then Program.Delay(300) H = H - 1 F = F + 1 If (F = 3) Then F = 0 H = 0 GraphicsWindow.BrushColor = "Red" Controls.SetTextBoxText(Ins, "STRIKE 3! Lose all points! (0 Pts)") Goto Again Endif If (H < 0) Then H = 0 Endif GraphicsWindow.BrushColor = "Red" Controls.SetTextBoxText(Ins, "Foul! STRIKE " + F + "! -1Pt (" + H + " Pts)") Goto Again Endif EndSub ' Add Sprites Sub add_shapes For M=1 to Array.GetItemCount(s) ' 5 types shapes // Doggy, trees , House , Apple , Aircraft For N=1 to Array.GetItemCount(s[M]) ' repeat number //Doggy=1 , trees =12 , House=1 , Apple=16 , Aircraft=1 ss=s[M][N] ' scale _shx=shx[M][N] ' base point _X _shY=shY[M][N] ' base point _Y _shape=shape[M] ' temporary shape data NMB=M+":"+N ' shape index for i=1 To Array.GetItemCount(_shape) GraphicsWindow.PenWidth = _shape[i]["pw"] GraphicsWindow.BrushColor = _shape[i]["bc"] GraphicsWindow.penColor = _shape[i]["pc"] If _shape[i]["func"]="ell" Then shp[NMB][i] = Shapes.AddEllipse(_shape[i]["width"]*ss, _shape[i]["height"]*ss) ElseIf _shape[i]["func"]="rect" Then shp[NMB][i] = Shapes.AddRectangle(_shape[i]["width"]*ss, _shape[i]["height"]*ss) ElseIf _shape[i]["func"]="tri" Then shp[NMB][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[NMB][i] = Shapes.Addline(_shape[i]["x1"]*ss, _shape[i]["y1"]*ss,_shape[i]["x2"]*ss, _shape[i]["y2"]*ss) EndIf Shapes.Animate(shp[NMB][i], _shape[i]["x"]*ss+_shX, _shape[i]["y"]*ss+_shY, 500) Shapes.Rotate(shp[NMB][i], _Shape[i]["angle"]) EndFor endfor endfor EndSub Sound.PlayClick() Program.Delay(Spd) Sound.PlayClick() Shapes.Move(Ball, X, Y) Shapes.Animate(Ball, GW, (GH - 50), 800) Program.Delay(D*4) Shapes.Remove(Ball) Shapes.Remove(Bat) Goto Begin Again: Shapes.Remove(Ball) Shapes.Remove(Bat) Program.Delay(D*4) Goto Begin Sub SPRITE_init ' 14 Trees s[1]="1=0.8;2=0.8;3=0.8;4=0.8;5=0.8;6=0.8;7=0.8;8=0.8;9=0.8;10=0.8;11=0.8;12=0.8;13=0.8;14=0.8" shX[1]="1=20;2=60;3=100;4=140;5=180;6=220;7=260;8=300;9=340;10=380;11=420;12=460;13=500;14=540" shY[1]="1=330;2=330;3=330;4=330;5=330;6=330;7=330;8=330;9=330;10=330;11=330;12=330;13=330;14=330" 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" ' 18 Apples s[2] ="1=0.2;2=0.2;3=0.2;4=0.2;5=0.2;6=0.2;7=0.2;8=0.2;9=0.2;10=0.2;11=0.2;12=0.2;13=0.2;14=0.2;15=0.2;16=0.2;17=.2;18=.2;18=.2" shX[2] ="1=-40;2=-20;3=0;4=20;5=40;6=60;7=80;8=100;9=120;10=140;11=160;12=180;13=200;14=220;15=240;16=260;17=280;18=300" shY[2] ="1=420;2=420;3=420;4=420;5=420;6=420;7=420;8=420;9=420;10=460;11=460;12=460;13=460;14=460;15=460;16=460;17=460;18=460" shape[2][1] = "func=rect;x=626;y=110;width=20;height=60;angle=30;bc=yellowgreen;pw=0;" shape[2][2] = "func=ell;x=511;y=148;width=150;height=150;bc=crimson;pw=0;" shape[2][3] = "func=ell;x=603;y=148;width=150;height=150;bc=crimson;pw=0;" shape[2][4] = "func=ell;x=594;y=188;width=40;height=40;bc=snow;pw=0;" shape[2][5] = "func=ell;x=633;y=188;width=40;height=40;bc=snow;pw=0;" shape[2][6] = "func=ell;x=614;y=196;width=15;height=15;bc=darkslategray;pw=0;" shape[2][7] = "func=ell;x=635;y=196;width=15;height=15;angle=7;bc=darkslategray;pw=0;" shape[2][8] = "func=rect;x=600;y=250;width=80;height=20;angle=-5;bc=purple;pw=0;" ' mahreen miangul--1 s[3] ="1=0.6" shX[3] ="1=600" shY[3] ="1=420" ' mahreen miangul--2 s[4] = "1=0" shX[4]= "1=0" shY[4]= "1=0" ' mahreen miangul--3 s[5] = "1=0" shX[5]= "1=0" shY[5]= "1=0" ' mahreen miangul--2 s[6] = "1=0" shX[6]= "1=0" shY[6]= "1=0" ' Tree s[7]="1=0.8;2=.8;3=.8;4=.8;" shX[7]="1=1000;2=1100;3=1000;4=1100" shY[7]="1=230;2=230;3=330;4=330" ' 5,6,13,14 shape[7]=shape[1] 'Apple s[8] ="1=0.2;2=0.2;3=0.2;4=0.2;5=0.2;6=0.2;7=.2;8=.2;" shX[8] ="1=900;2=940;3=980;4=1020;5=900;6=940;7=980;8=1020" shY[8] ="1=400;2=400;3=400;4=400;5=420;6=420;7=420;8=420" shape[8]=shape[2] EndSub End>LBK843.sb< Start>LBP169.sb< ' Peach, Plum, Cherry ' Copyright © 2016 Nonki Takahashi. The MIT License. ' GraphicsWindow.Title = "Peach, Plum, Cherry" GraphicsWindow.BackgroundColor = "SkyBlue" GraphicsWindow.PenWidth = 0 Turtle.PenUp() Turtle.Speed = 8 edge = 50 size = 50 half = size / 2 x = 140 y = 220 type = "peach" Flower() x = 340 y = 220 type = "plum" Flower() x = 540 y = 220 type = "cherry" Flower() Sub Flower Turtle.MoveTo(x, y) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(x - 45, y + 50, type) Turtle.Angle = 270 For i = 0 To 4 x = Turtle.X y = Turtle.Y GraphicsWindow.BrushColor = "Pink" ell = Shapes.AddEllipse(size, size) Shapes.Move(ell, x - half, y - half) If type <> "plum" Then Turtle.Turn(-126) If type = "peach" Then Turtle.Move(edge / 1.414) x = Turtle.X y = Turtle.Y a = Turtle.Angle GraphicsWindow.BrushColor = "Pink" tri = Shapes.AddTriangle(0, 0, -half, 0, 0, -half) Shapes.Move(tri, x, y) Shapes.Rotate(tri, a - 135) Turtle.Turn(180) Turtle.Move(edge / 1.414) Else Turtle.Move(edge) x = Turtle.X y = Turtle.Y a = Turtle.Angle GraphicsWindow.BrushColor = "SkyBlue" tri = Shapes.AddTriangle(-half, -half, -half, 0, 0, -half) Shapes.Move(tri, x, y) Shapes.Rotate(tri, a - 135) Turtle.Turn(180) Turtle.Move(edge) EndIf Turtle.Turn(-54) EndIf Turtle.Move(edge) Turtle.Turn(72) EndFor EndSub Turtle.Hide() End>LBP169.sb< Start>LBQ108.sb< GraphicsWindow.BrushColor="darkblue tb=Controls.AddMultiLineTextBox (800,10) 'Controls.ButtonClicked=bcc ct=" #include ||VGAX vga;||void setup() {| vga.begin();| vga.clear(11);| for (int y=0; y!=VGAX_HEIGHT; y++) {| for (int x=0; x!=VGAX_BWIDTH; x++) {| vga.putpixel4(x, y, y%2 ? 27 : 228);| }| }|}|void loop() {|} ct=ct+"||resistors:| R1 = R4 = 68 Ω | R2 = R3 = 470 Ω nl=Text.GetCharacter (13)+Text.GetCharacter(10) tt=ldtext.Replace (ct "|" nl) Controls.SetTextBoxText (tb tt) 'Controls.AddButton ("Run" 10 10) Controls.SetSize (tb 300 600) GraphicsWindow.BackgroundColor="teal GraphicsWindow.Title = "Arduino VGA Init() InitBreadboard() Draw() DrawBreadboardHoles() InitBoard() Draw() orx =0 param = "points=108.5 72.5 93 72.5 93 83 59 83 59 75;pw=1;pc=Black DrawWire() orx =550 param = "points= -20 15 0 15 0 72.5 ;pw=1;pc=Black DrawWire() args=0 Sub drawrr '----------------------------draws resistance orx =args[1] ox=-2 param = "points= 0:"+ (22+args[2])+":0:"+(35+args[2])+";pw=1;pc=gold DrawWire() shape="" shape[1] = "func=rect;x=0;y="+args[2]+";width=4;height=9;bc=gold shape[2] = "func=text;x=0;y="+(args[2]+2)+";text=R"+args[3]+";fn=Arial;fs=4.2;bc=black Draw() Shapes.Rotate(txt, -90) EndSub For q=0 to 3 LDCall.Function3("drawrr" 437+q*22 21 q+1) endfor ox=10 orx=6*2.5*scale param = "points=59 26 59 22 72 22 72 66.5 94 66.5;pw=1;pc=cyan DrawWire() param = "points=51.5 26 51.5 20 73.5 20 73.5 64.5 99.5 64.5;pw=1;pc=orange DrawWire() param = "points=49 26 49 18 75 18 75 62.5 105 62.5;pw=1;pc=lime DrawWire() param = "points=42.5 26 42.5 16 76.5 16 76.5 60.5 110.5 60.5;pw=1;pc=magenta DrawWire() param = "points=94 35.5 93.5 22.5;pw=1;pc=cyan DrawWire() param = "points=110.5 35.5 97 22.5;pw=1;pc=magenta DrawWire() param = "points=105 42 120 42 120 6 89 6 89 9 ;pw=1;pc=lime DrawWire() param = "points=99.5 39 118 39 118 3 86 3 86 9 ;pw=1;pc=orange DrawWire() GraphicsWindow.Width =1100 run="false LDShapes.ZIndex (tb 1000) LDEvents.MouseWheel=mww GraphicsWindow.MouseMove=mmv GraphicsWindow.MouseDown=mdd Sub mww If GraphicsWindow.LastKey="Space" Then zr=zr+LDEvents.LastMouseWheelDelta*5 else zz=zz+ LDEvents.LastMouseWheelDelta /10 If zz>2 Then zz=2 ElseIf zz<.5 then zz=.5 EndIf GraphicsWindow.Title =zz endif LDGraphicsWindow.Reposition (zz zz 100 200 zr) EndSub Sub mdd sx= GraphicsWindow.MouseX sy= GraphicsWindow.MouseY EndSub Sub mmv If Mouse.IsLeftButtonDown Then ddx= GraphicsWindow.MouseX -sx ddy= GraphicsWindow.MouseY - sy gw= GraphicsWindow.Width gh= GraphicsWindow.Height gwX = (ddx+wx)*zz + gw*(1-zz)/2 gwY = (ddy+wy)*zz + gh*(1-zz)/2 wx=wx+ddx wy=wy+ddy LDGraphicsWindow.Reposition (zz zz gwx gwy zr) endif endsub For r=0 to 4 GraphicsWindow.PenWidth=0 If r=0 Then GraphicsWindow.BrushColor="red ElseIf r=1 then GraphicsWindow.BrushColor="lime ElseIf r=2 then GraphicsWindow.BrushColor="blue ElseIf r=4 then GraphicsWindow.BrushColor="black else GraphicsWindow.BrushColor="lightgray endif shapes.Move(Shapes.AddEllipse (5 5) r*15+400 40) endfor For r=0 to 4 GraphicsWindow.PenWidth=0 If r=3 Then GraphicsWindow.BrushColor="lightgray Else GraphicsWindow.BrushColor="black endif shapes.Move(Shapes.AddEllipse (5 5) r*15+393 60) endfor For r=0 to 4 If r=2 Then GraphicsWindow.BrushColor="cyan ElseIf r=3 then GraphicsWindow.BrushColor="magenta else GraphicsWindow.BrushColor="lightgray endif shapes.Move(Shapes.AddEllipse (5 5) r*15+400 80) endfor shape="" shape[1] = "func=text;x=380;y=30;text=1 5;fn=Courier New;fs=4;bc=white shape[2] = "func=text;x=375;y=75;text=11 15;fn=Courier New;fs=4;bc=white Drawtx() While "true Program.Delay (2) endwhile Sub Drawtx n = Array.GetItemCount(shape) For i = 1 To n shp = shape[i] x = shp["x"] y = shp["y"] txt = shp["text"] GraphicsWindow.FontName = shp["fn"] GraphicsWindow.FontSize = shp["fs"] * scale GraphicsWindow.FontItalic = shp["fi"] shapes.Move(shapes.addText( txt) x, y) EndFor endsub Sub Draw GraphicsWindow.FontName = "OCRB" GraphicsWindow.FontSize = 8 GraphicsWindow.FontBold = "False" n = Array.GetItemCount(shape) For i = 1 To n GraphicsWindow.PenWidth =0 shp = shape[i] x = (ox + shp["x"]) * scale y = (oy + shp["y"]) * scale width = shp["width"] * scale height = shp["height"] * scale GraphicsWindow.BrushColor = shp["bc"] If shp["func"] = "rect" Then shapes.Move(shapes.AddRectangle ( width, height) x+orx, y) DrawHoles() ElseIf shp["func"] = "ell" Then GraphicsWindow.PenWidth=-0 ee=Shapes.AddEllipse(width, height) Controls.Move (ee x+orx y) ElseIf shp["func"] = "line" Then GraphicsWindow.PenColor = shp["pc"] GraphicsWindow.PenWidth = shp["pw"] * scale x1 = (ox + shp["x1"]) * scale+orx y1 = (oy + shp["y1"]) * scale x2 = (ox + shp["x2"]) * scale+orx y2 = (oy + shp["y2"]) * scale shapes.addLine(x1, y1, x2, y2) ElseIf shp["func"] = "tri" Then x1 = (ox + shp["x1"]) * scale y1 = (oy + shp["y1"]) * scale x2 = (ox + shp["x2"]) * scale y2 = (oy + shp["y2"]) * scale x3 = (ox + shp["x3"]) * scale y3 = (oy + shp["y3"]) * scale shapes.addTriangle(x1, y1, x2, y2, x3, y3) ElseIf shp["func"] = "text" Then tx = shp["text"] GraphicsWindow.FontName = shp["fn"] GraphicsWindow.FontSize = shp["fs"] * scale GraphicsWindow.FontItalic = shp["fi"] txt=shapes.addText( tx) shapes.Move(txt x+orx-2, y) EndIf EndFor EndSub Sub DrawBreadboardHoles GraphicsWindow.PenWidth =0 GraphicsWindow.BrushColor = "brown size = 1 width = size * scale height = size * scale dx = 2.8 * scale dy = 2.8 * scale For row = 1 To 18 y = (oy + 3) * scale + (row - 1) * dy If row = 3 Or row = 9 Or row = 10 Or row = 16 Then Else For col = 1 To 43 If row = 1 Or row = 2 Or row = 17 Or row = 18 Then If 3 <= col And col <= 61 And Math.Remainder(col, 6) <> 2 Then skip = "False" Else skip = "True" EndIf Else skip = "False" EndIf If skip Then else x = (ox + 3) * scale + (col - 1) * dx shapes.Move(Shapes.AddRectangle ( width, height) x, y) EndIf EndFor EndIf EndFor EndSub Sub DrawHoles If i = 11 Then holes = 10 s = symbol[1] ElseIf i = 12 Then holes = 8 s = symbol[2] ElseIf i = 13 Then holes = 8 s = symbol[3] ElseIf i = 14 Then holes = 6 s = symbol[4] Else holes = 0 EndIf If 0 < holes Then x = (ox + shp["x"]) * scale y = (oy + shp["y"]) * scale width = shp["width"] * scale height = shp["height"] * scale hw = (width - (holes + 1) * 3) / holes hy = y + 3 hh = height - 6 pin = 0 For hx = x + 3 To x + width - hw - 2 Step hw + 3 GraphicsWindow.BrushColor = "Black" shapes.Move(Shapes.AddRectangle( hw, hh) hx, hy) pin = pin + 1 GraphicsWindow.BrushColor = "White" len = Text.GetLength(s[pin]) txt = Shapes.AddText(s[pin]) If i < 13 Then Shapes.Move(txt, hx + (1.8 - len) * 2.8 - 2, hy + len * 2.4 + 8) Else Shapes.Move(txt, hx + (1.8 - len) * 2.8 - 2, hy - len * 2.4 - 10) EndIf Shapes.Rotate(txt, -90) EndFor EndIf EndSub Sub DrawWire size = param["pw"] * scale GraphicsWindow.PenWidth = size GraphicsWindow.PenColor = param["pc"] GraphicsWindow.BrushColor = param["pc"] p = 1 ps = ldtext.Split (ldtext.Replace (param["points"] ":" " ") " ") 'GraphicsWindow.FillEllipse(ps[1]*scale - size / 2+orx, ps[2]*scale - size / 2, size, size) For i = 3 To Array.GetItemCount (ps) Step 2 shapes.addLine(ps[i - 2]*scale+orx , ps[i - 1]*scale, ps[i]*scale+orx, ps[i+1]*scale) el=shapes.AddEllipse ( size, size) Shapes.Move(el ps[i]*scale - size / 2+orx, ps[i+1]*scale - size / 2) EndFor EndSub Sub Init Not = "False=True;True=False gw = 500 gh = 500 GraphicsWindow.Width = gw GraphicsWindow.Height = gh x = 0 y = 0 scale = 0.135 EndSub Sub InitBoard scale = 4 ox = 10 oy = 24 shape = "" shape[1] = "func=rect;x=7;y=0;width=65;height=53;bc=#003366 shape[2] = "func=tri;x1=72;y1=0;x2=72;y2=1;x3=73;y3=1;bc=#003366 shape[3] = "func=rect;x=72;y=1;width=1;height=52;bc=#003366 shape[4] = "func=tri;x1=73;y1=13;x2=73;y2=16;x3=76;y3=16;bc=#003366 shape[5] = "func=rect;x=73;y=16;width=3;height=32;bc=#003366 shape[6] = "func=tri;x1=73;y1=48;x2=73;y2=51;x3=76;y3=48;bc=#003366 shape[7] = "func=rect;x=0;y=9;width=16;height=12;bc=Silver shape[8] = "func=rect;x=10;y=1;width=6;height=6;bc=Silver shape[9] = "func=ell;x=11.75;y=2.75;width=2.5;height=2.5;bc=Red shape[10] = "func=rect;x=5;y=40;width=14;height=9;bc=#333333 shape[11] = "func=rect;x=25;y=1;width=26;height=3;bc=#333333 shape[12] = "func=rect;x=52;y=1;width=21;height=3;bc=#333333 shape[13] = "func=rect;x=35;y=49;width=21;height=3;bc=#333333 shape[14] = "func=rect;x=57;y=49;width=16;height=3;bc=#333333 shape[15] = "func=rect;x=37;y=32;width=36;height=10;bc=#333333 shape[16] = "func=text;x=38;y=12;text=Arduino;fn=Impact;fs=4;fi=True;bc=White shape[17] = "func=text;x=53.5;y=12;text=UNO;fn=Arial;fs=4.2;bc=White shape[18] = "func=ell;x=21;y=1;width=3.2;height=3.2;bc=White shape[19] = "func=ell;x=20;y=49;width=3.2;height=3.2;bc=White shape[20] = "func=ell;x=71.5;y=16;width=3.2;height=3.2;bc=White shape[21] = "func=ell;x=71.5;y=44;width=3.2;height=3.2;bc=White symbol[1] = "3=AREF;4=GND;5=D13;6=D12;7=D11;8=D10;9=D9;10=D8 symbol[2] = "1=D7;2=D6;3=D5;4=D4;5=D3;6=D2;7=D1;8=D0 symbol[3] = "2=IOREF;3=RESET;4=3.3V;5=5V;6=GND;7=GND;8=Vin symbol[4] = "1=A0;2=A1;3=A2;4=A3;5=A4;6=A5 EndSub Sub InitBreadboard scale = 4 ox = 100 oy = 24 shape = "" shape[1] = "func=rect;x=0;y=0;width=166;height=54;bc=#F8FFCC shape[2] = "func=rect;x=0;y=26;width=166;height=2;bc=#E8EEBB shape[3] = "func=text;x=3;y=0;text=-;fn=Courier New;fs=4;bc=DodgerBlue shape[4] = "func=rect;x=6;y=1;width=152;height=0.8;bc=DodgerBlue shape[5] = "func=text;x=3;y=5;text=+;fn=Courier New;fs=4;bc=Red shape[6] = "func=rect;x=6;y=7.6;width=152;height=0.8;bc=Red shape[7] = "func=text;x=3;y=44.8;text=-;fn=Courier New;fs=4;bc=DodgerBlue shape[8] = "func=rect;x=6;y=45.8;width=152;height=0.8;bc=DodgerBlue shape[9] = "func=text;x=3;y=49.4;text=+;fn=Courier New;fs=4;bc=Red shape[10] = "func=rect;x=6;y=52.2;width=152;height=0.8;bc=Red EndSub End>LBQ108.sb< Start>LBR609.sb< GraphicsWindow.Height = 500 GraphicsWindow.Width = 1000 buttonclicked = 0 inputdone = 0 m = 200 n = 0 doingreset = 0 firstinput = 1 GraphicsWindow.Title = "story maker by jonathan durbs" 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 String:") textbox3 = Controls.AddTextBox(665, 50) GraphicsWindow.DrawBoundText(680, 20, 150, "Background Colour:") button = Controls.AddButton("Submit", 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 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 EndFor Turtle.PenUp() Turtle.MoveTo(901, 1) doingreset = 1 Default() Controls.Remove(textbox2) Controls.Remove(textbox3) firstinput = 0 Goto buttonloop 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 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 'submit' 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("The accepted colours are: 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 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>LBR609.sb< Start>LBR803-0.sb< GraphicsWindow.Show() LDIOWarrior.Initialise() Wert = 255 Prog1() Prog2() CBChange() Ereigniss() GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawBoundText(530,60,50,"Zeit in s") Start1 = Controls.AddButton("Start 1",310,200) Start2 = Controls.AddButton("Start 2",400,200) For P = 1 To 2 GraphicsWindow.DrawBoundText(20,50*P+25,50,"Prog " + P) EndFor For S = 1 To 8 GraphicsWindow.DrawBoundText(50*S+65,60,250,"Rel " + S) EndFor 'Controls.ButtonClicked = Start LDControls.CheckBoxChanged = CBChange Sub Prog1 TextWindow.WriteLine("Prog1") For N = 1 To 8 pro[N] = LDControls.AddCheckBox("") Controls.Move(pro[N],50*N + 70,80) EndFor Zeitbox = Controls.AddTextBox(530,80) Controls.SetSize(Zeitbox, 35,20) EndSub Sub Prog2 TextWindow.WriteLine("Prog1") For N = 1 To 8 pro[N] = LDControls.AddCheckBox("") Controls.Move(pro[N],50*N + 70,120) EndFor Zeitbox = Controls.AddTextBox(530,120) Controls.SetSize(Zeitbox, 35,20) EndSub Sub CBChange CBNam = LDControls.LastCheckBox For N = 1 To 8 If pro[N] = CBNam Then If LDControls.LastCheckBoxState = "True" Then Wert = Wert - Math.Power(2,N-1) Else Wert = Wert + Math.Power(2,N-1) EndIf EndIf EndFor EndSub Sub Ereigniss Controls.ButtonClicked = Button Timer.Tick = Zeit EndSub Sub Zeit Timer.Pause() Ausschalten() EndSub Sub Ausschalten LDIOWarrior.GetReportSize(0) r[1] = 0 r[2] = 255 r[3] = 255 LDIOWarrior.Write(1,0,r) EndSub Sub Start LDIOWarrior.GetReportSize(0) N[1] = 0 N[2] = Wert N[3] = 255 LDIOWarrior.Write(1,0,N) ZeitSek = Controls.GetTextBoxText(Zeitbox) ZeitMil = ZeitSek*1000 Timer.Interval = ZeitMil EndSub Sub Button LCB = Controls.LastClickedButton If LCB = Start1 Then Prog1() Start() ElseIf LCB = Start2 Then Prog2() Start() EndIf EndSub End>LBR803-0.sb< Start>LBR803-1.sb< GraphicsWindow.Show() LDIOWarrior.Initialise() Wert = 255 Prog1() Prog2() CBChange() Ereigniss() GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawBoundText(530,60,50,"Zeit in s") Start1 = Controls.AddButton("Start 1",310,200) Start2 = Controls.AddButton("Start 2",400,200) For P = 1 To 2 GraphicsWindow.DrawBoundText(20,50*P+25,50,"Prog " + P) EndFor For S = 1 To 8 GraphicsWindow.DrawBoundText(50*S+65,60,250,"Rel " + S) EndFor 'Controls.ButtonClicked = Start LDControls.CheckBoxChanged = CBChange Sub Prog1 TextWindow.WriteLine("Prog1") For N = 1 To 8 pro[N] = LDControls.AddCheckBox("") Controls.Move(pro[N],50*N + 70,80) EndFor Zeitbox = Controls.AddTextBox(530,80) Controls.SetSize(Zeitbox, 35,20) EndSub Sub Prog2 TextWindow.WriteLine("Prog2") For N = 1 To 8 pro[N] = LDControls.AddCheckBox("") Controls.Move(pro[N],50*N + 70,120) EndFor Zeitbox = Controls.AddTextBox(530,120) Controls.SetSize(Zeitbox, 35,20) EndSub Sub CBChange CBNam = LDControls.LastCheckBox For N = 1 To 8 If pro[N] = CBNam Then If LDControls.LastCheckBoxState = "True" Then Wert = Wert - Math.Power(2,N-1) Else Wert = Wert + Math.Power(2,N-1) EndIf EndIf EndFor EndSub Sub Ereigniss Controls.ButtonClicked = Button Timer.Tick = Zeit EndSub Sub Zeit Timer.Pause() Ausschalten() EndSub Sub Ausschalten LDIOWarrior.GetReportSize(0) r[1] = 0 r[2] = 255 r[3] = 255 LDIOWarrior.Write(1,0,r) EndSub Sub Start LDIOWarrior.GetReportSize(0) N[1] = 0 N[2] = Wert N[3] = 255 LDIOWarrior.Write(1,0,N) ZeitSek = Controls.GetTextBoxText(Zeitbox) ZeitMil = ZeitSek*1000 Timer.Interval = ZeitMil EndSub Sub Button LCB = Controls.LastClickedButton If LCB = Start1 Then Prog1() Start() ElseIf LCB = Start2 Then Prog2() Start() EndIf EndSub End>LBR803-1.sb< Start>LBR803.sb< GraphicsWindow.Show() LDIOWarrior.Initialise() Prog1() Prog2() CBChange() Ereigniss() GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawBoundText(530,60,50,"Zeit in s") Start1 = Controls.AddButton("Start 1",310,200) Start2 = Controls.AddButton("Start 2",400,200) For P = 1 To 2 GraphicsWindow.DrawBoundText(20,50*P+25,50,"Prog " + P) EndFor For S = 1 To 8 GraphicsWindow.DrawBoundText(50*S+65,60,250,"Rel " + S) EndFor Sub Prog1 For N = 1 To 8 pro[N] = LDControls.AddCheckBox("") Controls.Move(pro[N],50*N + 70,80) EndFor Zeitbox = Controls.AddTextBox(530,80) Controls.SetSize(Zeitbox, 35,20) EndSub Sub Prog2 For N = 1 To 8 pro[N] = LDControls.AddCheckBox("") Controls.Move(pro[N],50*N + 70,120) EndFor Zeitbox = Controls.AddTextBox(530,120) Controls.SetSize(Zeitbox, 35,20) EndSub Wert = 255 LDControls.CheckBoxChanged = CBChange Sub CBChange CBNam = LDControls.LastCheckBox For N = 1 To 8 If pro[N] = CBNam Then If LDControls.LastCheckBoxState = "True" Then Wert = Wert - Math.Power(2,N-1) Else Wert = Wert + Math.Power(2,N-1) EndIf EndIf EndFor EndSub Sub Ereigniss Controls.ButtonClicked = Button Timer.Tick = Zeit EndSub Sub Zeit Timer.Pause() Ausschalten() EndSub Sub Ausschalten LDIOWarrior.GetReportSize(0) r[1] = 0 r[2] = 255 r[3] = 255 LDIOWarrior.Write(1,0,r) EndSub Controls.ButtonClicked = Start Sub Start LDIOWarrior.GetReportSize(0) N[1] = 0 N[2] = Wert N[3] = 255 LDIOWarrior.Write(1,0,N) ZeitSek = Controls.GetTextBoxText(Zeitbox) ZeitMil = ZeitSek*1000 Timer.Interval = ZeitMil EndSub Sub Button LCB = Controls.LastClickedButton If LCB = Start1 Then Prog1() Start() ElseIf LCB = Start2 Then Prog2() Start() EndIf EndSub End>LBR803.sb< Start>LBT052.sb< 'Startup graphicswindow sequence' roundCount = 0 round = 1 score = 0 max = 40 count = 0 startupProc() '####### REPEATOR####### newquestion: roundCount = roundCount + 1 'TextWindow.WriteLine(roundCount) If roundCount = 10 then round = round + 1 elseif roundCount = 20 then round = round + 1 elseif roundCount = 30 then round = round + 1 elseif roundCount = 40 then winScore() endif WaitingForAnswer = "True" ClockTimer = 0 TimerExpired = "False" GraphicsWindow.BackgroundColor = "#542437" bgColour = GraphicsWindow.BackgroundColor GraphicsWindow.Clear() GraphicsWindow.BrushColor = "#C02942" brushColour = GraphicsWindow.BrushColor GraphicsWindow.PenColor = "#ECD078" penColour = GraphicsWindow.PenColor GraphicsWindow.Title = "Educational Game - Quiz Wiz!" GraphicsWindow.Height = "350" GraphicsWindow.Width = "600" GraphicsWindow.FontName = "Calibri" GraphicsWindow.FontSize = 28 GraphicsWindow.DrawText(2, 2, "Score: " + score + "/" + count) 'count = 0 random = 0 'end startup' 'button processes and settings buttonWidth = 160 buttonHeight = 100 'while max >= count '###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 'submitButtonX = GraphicsWindow.Width - 380 'submission button 'submitButtonY = GraphicsWindow.Height - 115 'submission button '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 'answer/question settings 'answerOne = '###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) 'submission button 'GraphicsWindow.FillRectangle(submitButtonX, submitButtonY, buttonWidth, buttonHeight) 'GraphicsWindow.DrawRectangle(submitButtonX, submitButtonY, buttonWidth, buttonHeight) '###drawing text### GraphicsWindow.BrushColor = "#ECD078" 'submit button 'GraphicsWindow.DrawText(submitButtonX + 30, submitButtonY + 30,"Submit") 'changing font for appropriate sizing for different types of questions ... not implemented yet 'bla bla font 'button 1 GraphicsWindow.DrawText(buttonOneX + 25, buttonOneY + 30, "") 'answer 1 goes here 'button 2 GraphicsWindow.DrawText(buttonTwoX + 25, buttonTwoY + 30,"") 'answer 2 would go here 'button 3 GraphicsWindow.DrawText(buttonThreeX + 25, buttonThreeY + 30,"")'answer 3 would go here GraphicsWindow.MouseDown = handleClick 'GraphicsWindow.DrawText(30, 50, "SmallBasic Quiz Game") needs to be done with images 'GraphicsWindow.DrawText(500, 20, "Section 1 - Addition") needs to be done with images 'questions GraphicsWindow.FontSize = 48 'doesnt seem to work GraphicsWindow.BrushColor = "#D95B43" 'GraphicsWindow.DrawText(questionOneX, questionOneY, "45") 'imageList.LoadImage 'temporary question generation maths-style 'GraphicsWindow.DrawText(10, 10, correctAnswer) spaceSize = 40 symbolMax = round symbol = Math.GetRandomNumber(symbolMax) If round = 1 and symbol = 1 then oneMaxObjective = 99 twoMaxObjective = 99 elseif round = 2 and symbol = 1 then oneMaxObjective = 500 twoMaxObjective = 499 elseif round = 3 and symbol = 1 then oneMaxObjective = 1000 twoMaxObjective = 1000 elseif round = 4 and symbol = 1 then oneMaxObjective = 10000 twoMaxObjective = 10000 'elseif round = 5 and symbol = 1 then ' oneMaxObjective = 1000000 ' twoMaxObjective = 1000000 elseif round = 2 and symbol = 2 then oneMaxObjective = 700 twoMaxObjective = 599 elseif round = 3 and symbol = 2 then oneMaxObjective = 1000 twoMaxObjective = 1000 elseif round = 4 and symbol = 2 then oneMaxObjective = 10000 twoMaxObjective = 10000 elseif round = 3 and symbol = 3 then oneMaxObjective = 150 twoMaxObjective = 8 elseif round = 4 and symbol = 3 then oneMaxObjective = 500 twoMaxObjective = 25 Elseif round = 4 and symbol = 4 then oneMaxObjective = 150 twoMaxObjective = 30 endif oneMax = oneMaxObjective twoMax = twoMaxObjective questionCoordsStart = 250 questionSymbolCoords = questionCoordsStart + spaceSize integerOne = Math.GetRandomNumber(oneMax) If integerOne >= 10 and integerOne <= 99 then 'spaceSize = 40 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" 'symbolDirect = * ' If correctAnswer = 1 and round = 1 then ' If randomizationSymbol = 1 then ' answerOne = answerOne - Math.GetRandomNumber(25) ' If randomizationSymbolTwo = 1 then ' answerTwo = answerTwo - Math.GetRandomNumber(25) ' ElseIf randomizationSymbolTwo = 2 then ' answerTwo = answerTwo + Math.GetRandomNumber(25) ' endif ' ElseIf randomizationSymbol = 2 then ' If randomizationSymbolTwo = 1 then ' answerTwo = answerTwo - Math.GetRandomNumber(25) ' ElseIf randomizationSymbolTwo = 2 then ' answerTwo = answerTwo + Math.GetRandomNumber(25) ' endIf ' EndIf ' endif 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 regen: If symbol = 1 then symbolVerbal = "+" 'symbolDirect = + If correctAnswer = 1 then answerOne = integerOne + integerTwo answerTwo = integerOne + integerTwo - Math.GetRandomNumber(randomLevel) answerThree = integerOne + integerTwo + 10 'Math.GetRandomNumber(randomLevel) correctAnswerValue = answerOne elseIf correctAnswer = 2 then answerOne = integerOne + integerTwo + Math.GetRandomNumber(randomLevel) answerTwo = integerOne + integerTwo answerThree = integerOne + integerTwo + 10 'Math.GetRandomNumber(randomLevel) correctAnswerValue = answerTwo elseIf correctAnswer = 3 then answerOne = integerOne + integerTwo + Math.GetRandomNumber(randomLevel) answerTwo = integerOne + integerTwo - Math.GetRandomNumber(randomLevel) answerThree = integerOne + integerTwo correctAnswerValue = answerThree endif elseIf symbol = 2 then symbolVerbal = "-" 'symbolDirect = - If correctAnswer = 1 then answerOne = integerOne - integerTwo answerTwo = integerOne - integerTwo + Math.GetRandomNumber(randomLevel) answerThree = integerOne - integerTwo - 10 'Math.GetRandomNumber(randomLevel) correctAnswerValue = answerOne elseIf correctAnswer = 2 then answerOne = integerOne - integerTwo - Math.GetRandomNumber(randomLevel) answerTwo = integerOne - integerTwo answerThree = integerOne - integerTwo - Math.GetRandomNumber(randomLevel) correctAnswerValue = answerTwo elseIf correctAnswer = 3 then answerOne = integerOne - integerTwo - Math.GetRandomNumber(randomLevel) answerTwo = integerOne - integerTwo + Math.GetRandomNumber(randomLevel) answerThree = integerOne - integerTwo correctAnswerValue = answerThree endif elseIf symbol = 3 then symbolVerbal = "x" 'symbolDirect = * If correctAnswer = 1 then answerOne = integerOne * integerTwo answerTwo = integerOne * integerTwo + Math.GetRandomNumber(randomLevel) answerThree = integerOne * integerTwo - Math.GetRandomNumber(randomLevel) correctAnswerValue = answerOne elseIf correctAnswer = 2 then answerOne = integerOne * integerTwo - Math.GetRandomNumber(randomLevel) answerTwo = integerOne * integerTwo answerThree = integerOne * integerTwo + Math.GetRandomNumber(randomLevel) correctAnswerValue = answerTwo elseIf correctAnswer = 3 then answerOne = integerOne * integerTwo - Math.GetRandomNumber(randomLevel) answerTwo = integerOne * integerTwo - Math.GetRandomNumber(randomLevel) answerThree = integerOne * integerTwo correctAnswerValue = answerThree endif elseIf symbol = 4 then symbolVerbal = "÷" 'symbolDirect = / 'correctAnswerValue = If correctAnswer = 1 then answerOne = integerOne / integerTwo answerOne = Math.Round(answerOne) answerTwo = integerOne / integerTwo + Math.GetRandomNumber(randomLevel) answerTwo = math.Round(answerTwo) answerThree = integerOne / integerTwo - Math.GetRandomNumber(randomLevel) answerThree = Math.Round(answerthree) correctAnswerValue = answerOne elseIf correctAnswer = 2 then answerOne = integerOne / integerTwo - Math.GetRandomNumber(randomLevel) answerOne = Math.Round(answerOne) answerTwo = integerOne / integerTwo answerTwo = math.Round(answerTwo) answerThree = integerOne / integerTwo + Math.GetRandomNumber(randomLevel) answerThree = Math.Round(answerthree) correctAnswerValue = answerTwo elseIf correctAnswer = 3 then answerOne = integerOne / integerTwo - Math.GetRandomNumber(randomLevel) answerOne = Math.Round(answerOne) answerTwo = integerOne / integerTwo - Math.GetRandomNumber(randomLevel) answerTwo = math.Round(answerTwo) answerThree = integerOne / integerTwo answerThree = Math.Round(answerthree) correctAnswerValue = answerThree endif endif 'If answerOne <= 0 and if symbol = 2 then 'Goto regen '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 = 20 'elseIf answerOne >= -1000 And answerOne <= -9999 then ' answerSpacing = 30 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 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 'GraphicsWindow.clear() 'count = count + 1 'EndWhile '###handles button clicks### 'function for handling a click on the button' 'score = 0 countdown = ImageList.LoadImage("G:/Basic/Time.jpg") arrow = ImageList.LoadImage("G:/Basic/Arrow2.jpg") GraphicsWindow.DrawImage(countdown, 215, 115) GraphicsWindow.FillRectangle(buttonTwoX - 20, 150, 200, 30) GraphicsWindow.BrushColor = "#F02942" timeCount = 0 While (WaitingForAnswer = "True") ClockTimer = ClockTimer + 1 Program.Delay(100) GraphicsWindow.FillRectangle((buttonTwoX - 20) + (timeCount * 2) , 150, 2, 30) timeCount = timeCount + 1 If (ClockTimer > 100) Then WaitingForAnswer = "False" TimerExpired = "True" count = count + 1 textwindow.WriteLine("Times up! Your score is " + score + "/" + count + ".") handleClick() Endif EndWhile TimerExpired = "False" Goto newquestion 'GraphicsWindow.FontSize = 10 'GraphicsWindow.DrawText(20, 20, "answer one = " + answerOne + " answer two = " + answerTwo + "answer 3 = " + answerThree) Sub handleClick WaitingForAnswer = "False" xpos = GraphicsWindow.MouseX ypos = GraphicsWindow.MouseY 'checks if you clicked inside the button 'button one check If(xpos > buttonOneX And xpos < (buttonOneX + buttonWidth)) and (ypos > buttonOneY And ypos < (buttonOneY + buttonHeight)) Then 'do whatever If correctAnswer = 1 Then score = score + 1 count = count + 1 TextWindow.WriteLine("Correct, your score is " + score + "/" + count + ".") 'button two check Else count = count + 1 TextWindow.WriteLine("Incorrect, your score is " + score + "/" + count + ". The correct answer was number " + correctAnswer +": " + correctAnswerValue + ".") if correctAnswer = 2 then 'the correct answer was 2 'GraphicsWindow.DrawImage(arrow, 26, 480) elseif correctAnswer = 3 then 'the correct answer was 3 EndIf endif ElseIf(xpos > buttonTwoX And xpos < (buttonTwoX + buttonWidth)) and (ypos > buttonTwoY And ypos < (buttonTwoY + buttonHeight)) Then 'do whatever If correctAnswer = 2 Then score = score + 1 count = count + 1 TextWindow.WriteLine("Correct, your score is " + score + "/" + count + ".") 'button two check Else count = count + 1 TextWindow.WriteLine("Incorrect, your score is " + score + "/" + count + ". The correct answer was number " + correctAnswer +": " + correctAnswerValue + ".") if correctAnswer = 1 then 'the correct answer was 1 elseif correctAnswer = 3 then 'the correct answer was 3 EndIf endif ElseIf(xpos > buttonThreeX And xpos < (buttonThreeX + buttonWidth)) and (ypos > buttonThreeY And ypos < (buttonThreeY + buttonHeight)) Then 'do whatever If correctAnswer = 3 Then score = score + 1 count = count + 1 TextWindow.WriteLine("Correct, your score is " + score + "/" + count + ".") 'button two check else count = count + 1 TextWindow.WriteLine("Incorrect, your score is " + score + "/" + count + ". The correct answer was number " + correctAnswer +": " + correctAnswerValue + ".") if correctAnswer = 1 then 'the correct answer was 1 elseif correctAnswer = 2 then 'the correct answer was 2 EndIf endif 'submit button check 'ElseIf(xpos > submitButtonX And xpos < (submitButtonX + buttonWidth)) and (ypos > submitButtonY And ypos < (submitButtonY + buttonHeight)) Then ' 'do whatever ' GraphicsWindow.ShowMessage("submit button pressed", "nunzio") EndIf EndSub '25 220 415 480 Sub startupProc WaitingForAnswer = "False" TextWindow.WriteLine("###########-WELCOME TO QUIZ WIZ-##########") GraphicsWindow.Show() GraphicsWindow.BackgroundColor = "black" quizSplash = ImageList.LoadImage("G:/Basic/Quiz.jpg") GraphicsWindow.DrawImage(quizSplash, 15, 76) Program.Delay(2500) EndSub Sub winScore WaitingForAnswer = "False" 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 endif TextWindow.WriteLine("Your score was below average, good luck next time") TextWindow.WriteLine("###################################") 'TextWindow.WriteLine("WIN") endsub End>LBT052.sb< Start>LBV905.sb< ' Kinect Piezo Player ' Version 0.1 ' Copyright © 2016 Nonki Takahashi. The MIT License. GraphicsWindow.Title = "Kinect Piezo Player" Init() tracking = "True" While tracking Loop() EndWhile Sub Init LF = Text.GetCharacter(10) WQ = Text.GetCharacter(34) gw = 300 gh = 600 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BackgroundColor = "Black" GraphicsWindow.BrushColor = "White" GraphicsWindow.FontName = "Trebuchet MS" GraphicsWindow.FontSize = 18 txt1 = Shapes.AddText("") Shapes.Move(txt1, 10, 10) txt2 = Shapes.AddText("") Shapes.Move(txt2, 10, 30) txt3 = Shapes.AddText("") Shapes.Move(txt3, 10, 50) ell = Shapes.AddEllipse(20, 20) Shapes.Move(ell, gw / 2 - 10, gh / 2 - 10) Shapes.SetOpacity(ell, 20) status = LDCommPort.OpenPort("COM3",9600) LDCommPort.SetEncoding("Ascii") KinectBodyList.BodiesChanged = OnBodiesChanged KinectBodyList.StartTracking() EndSub Sub Loop If bodiesChanged Then count = KinectBodyList.Count For index = 1 To count isTracked = KinectBodyList.IsTracked(index) If isTracked Then state = KinectBodyList.GetHandState(index, "right") pos = KinectBodyList.GetJointPosition(index, "HandRight") freq = Math.Round(pos["Y"] * 500 + 440) Shapes.SetText(txt1, "state = " + state) Shapes.SetText(txt2, "pos[Y] = " + (Math.Round(pos["Y"] * 1000) / 1000)) Shapes.SetText(txt3, "freq = " + freq) Shapes.Move(ell, gw / 2 - 10, gh / 2 - (freq - 440)) If state = "Open" Then LDCommPort.TXString(freq + LF) Shapes.SetOpacity(ell, 100) ElseIf state = "Closed" Then LDCommPort.TXString(0 + LF) Shapes.SetOpacity(ell, 20) EndIf Program.Delay(200) EndIf EndFor EndIf EndSub Sub OnBodiesChanged bodiesChanged = "True" EndSub End>LBV905.sb< Start>LBW090.sb< GraphicsWindow.Hide() GraphicsWindow.CanResize = "False" GraphicsWindow.Show() GraphicsWindow.Width = 840 GraphicsWindow.Height = 360 GraphicsWindow.Title = "Game" GraphicsWindow.BackgroundColor = "Blue" GraphicsWindow.BrushColor = "Orange" GraphicsWindow.FillRectangle(0,300,860,60) GraphicsWindow.BrushColor = "red" GraphicsWindow.KeyDown = KeyDown GraphicsWindow.KeyUp = KeyUp character = Shapes.AddEllipse(50,50) Shapes.Move(character, 0, GraphicsWindow.Height - 110) GraphicsWindow.BrushColor = "Black" blocks_passed = Shapes.AddText("Blocks Passed: 0") getnewblock() x = 35 y = 250 space = 0 left = 0 speedrate = 1 Sub KeyDown key = GraphicsWindow.LastKey If key = "Space" Or key = "Up" Or key = "W" Then space = 1 EndIf If key = "Right" Or key = "D" Then right = 1 EndIf If key = "Left" Or key = "A" Then left2 = 1 EndIf If key = "Down" Or key = "S" Then shrink() EndIf If key = "Escape" Then space = 0 isindown = "False" isinmidjump = "False" Shapes.Move(character, left, GraphicsWindow.Height - 110) charposY = GraphicsWindow.Height - 110 EndIf EndSub Sub KeyUp key2 = GraphicsWindow.LastKey If key2 = "Left" Or key2 = "A" Then left2 = 0 EndIf If key2 = "Right" Or key2 = "D" Then right = 0 EndIf If key2 = "Down" Or key2 = "S" Then unshrink() EndIf EndSub blockpos = GraphicsWindow.Width + 75 charposY = Shapes.GetTop(character) isindown = "False" While "True" If space = 1 then isinmidjump = "True" space = 0 EndIf If left2 = 1 Then moveleft() EndIf If right = 1 Then moveright() EndIf If isindown Then movecharacterdown() EndIf If isinmidjump Then begincounting = "True" movecharacter() EndIf moverectangle() blockpos = blockpos - speedrate If blockpos < -75 Then blocktype = blocktype + 1 If blocktype = 4 Then blocktype = 1 EndIf blockpos = GraphicsWindow.Width + 75 Shapes.Remove(block) getnewblock() Shapes.Move(block, blockpos, blockypos) passed = passed + 1 Shapes.SetText(blocks_passed, "Blocks Passed: " + passed) getspeedrate() EndIf getifhitblock() Program.Delay(5) EndWhile Sub moverectangle Shapes.Move(block, blockpos, blockypos) EndSub Sub movecharacter getisatend() count = count + 1 If isatend = "False" Then charposY = charposY - 2.5 Else charposY = charposY - 2 EndIf If isshrunk Then charposY2 = charposY + 20 Else charposY2 = charposY EndIf Shapes.Move(character, left, charposY2) If charposY < GraphicsWindow.Height - 290 Then isinmidjump = "False" isindown = "True" EndIf EndSub Sub movecharacterdown getisatend() count = count + 1 If isatend = "False" Then charposY = charposY + 3 Else charposY = charposY + 2 EndIf If isshrunk Then charposY2 = charposY + 20 Else charposY2 = charposY EndIf Shapes.Move(character, left, charposY2) If charposY > GraphicsWindow.Height - 112 Then isindown = "False" EndIf If count > 154 Then Shapes.Move(character, left, charposY2) EndIf EndSub Sub getisatend If Shapes.GetTop(character) < GraphicsWindow.Height - 210 Then isatend = "True" Else isatend = "False" EndIf EndSub Sub moveright If left < GraphicsWindow.Width - 50 Then left = left + 2 EndIf If isshrunk Then charposY2 = charposY + 20 Else charposY2 = charposY EndIf Shapes.Move(character, left, charposY2) EndSub Sub moveleft If left > 0 Then left = left - 2 EndIf If isshrunk Then charposY2 = charposY + 20 Else charposY2 = charposY EndIf Shapes.Move(character, left, charposY2) EndSub Sub shrink isshrunk = "True" Shapes.Remove(character) GraphicsWindow.BrushColor = "Red" character = Shapes.AddEllipse(50, 30) Shapes.Move(character, left, charposY + 20) EndSub Sub unshrink isshrunk = "False" Shapes.Remove(character) character = Shapes.AddEllipse(50, 50) Shapes.Move(character, left, charposY) EndSub Sub getifhitblock getleft = Shapes.GetLeft(character) getright = getleft + 50 gettop = Shapes.GetTop(character) getbottom = gettop + 50 l = Shapes.GetLeft(block) r = l + randomW t = Shapes.GetTop(block) b = t + randomY If (getright > l) And (getleft < r) And (getbottom > t) And (gettop < b) Then Program.End() EndIf EndSub Sub getnewblock GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor() randomW = 0 randomY = 0 While randomW < 10 randomW = Math.GetRandomNumber(250) EndWhile While randomy < 50 randomY = Math.GetRandomNumber(200) EndWhile randomy2 = Math.GetRandomNumber(GraphicsWindow.Height - (randomY+60)) blockypos = randomy2 block = Shapes.AddRectangle(randomW, randomY) EndSub Sub getspeedrate If passed < 5 Then speedrate = 1 ElseIf passed < 10 and passed > 4 Then speedrate = 2 ElseIf passed < 15 and passed > 9 Then speedrate = 3 ElseIf passed < 20 and passed > 14 Then speedrate = 4 ElseIf passed < 25 and passed > 19 Then speedrate = 5 EndIf EndSub End>LBW090.sb< Start>LBW566.sb< Init() While (Draw = 1) 'To be in progress If Clock.ElapsedMilliseconds - Start > MiSec Then ShowInProgress() Start = Clock.ElapsedMilliseconds EndIf 'Show Shape Reticle with random position Speed = Math.GetRandomNumber(250) + 100 x2 = Math.GetRandomNumber(gw) y1 = Math.GetRandomNumber(gh) Shapes.Animate(drop1,x1,y1,Speed) Shapes.Animate(drop2,x2,y2,Speed) Program.Delay(speed*1.5) ' Random object If (i = 0) Then a = Math.GetRandomNumber(5) EndIf 'Draw objects If (a = 1 Or a = 2) Then DrawEorR() ElseIf (a = 3) Then DrawTriangle() Speed = Speed / 2 ElseIf (a > 3) Then DrawLine() EndIf EndWhile 'At end Shapes.HideShape(drop1) Shapes.HideShape(drop2) GraphicsWindow.BrushColor = CBack GraphicsWindow.FillRectangle(10,h-25,w-20,15) Program.Delay(3000) '*************************************************************************** Sub Init gw = 600 gh = 400 w = gw h = gh + 30 GraphicsWindow.Width = w GraphicsWindow.Height = h GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 GraphicsWindow.BackgroundColor = "LightYellow" CBrush = GraphicsWindow.BrushColor CBack = GraphicsWindow.BackgroundColor FSB = (w-20) / 100 L = 0 P = 0 Start = Clock.ElapsedMilliseconds MiSec = 200 Draw = 1 i = 0 x1 = 0 y1 = 0 xx1 = gw yy1 = 0 drop1 = Shapes.AddLine(x1,y1,xx1,yy1) Shapes.ShowShape(drop1) x2 = 0 y2 = 0 xx2 = 0 yy2 = gw drop2 = Shapes.AddLine(x2,y2,xx2 ,yy2) Shapes.ShowShape(drop2) Col = GraphicsWindow.GetRandomColor() EndSub ' Init Sub DrawEorR i = i + 1 If (i = 1) Then px1 = x2 py1 = y1 Else i = 0 px2 = x2 py2 = y1 If (px1 > px2) then pxx = px1 px1 = px2 px2 = pxx pyy = py1 py1 = py2 py2 = pyy EndIf If (py1 > py2) then pyy = py1 py1 = py2 py2 = pyy EndIf px2 = px2 - px1 py2 = py2 - py1 setColour() GraphicsWindow.BrushColor = Col If (a = 1) Then GraphicsWindow.FillRectangle(px1,py1,px2,py2) Else GraphicsWindow.FillEllipse(px1,py1,px2,py2) EndIf EndIf EndSub 'DrawEorR Sub DrawTriangle i = i + 1 If i = 1 Then px1 = x2 py1 = y1 ElseIf i = 2 Then px2 = x2 py2 = y1 ElseIf i = 3 Then i = 0 px3 = x2 py3 = y1 setColour() GraphicsWindow.FillTriangle(px1,py1,px2,py2,px3,py3) EndIf EndSub 'DrawTriangle Sub DrawLine i = i + 1 If i = 1 Then px1 = x2 py1 = y1 Else i = 0 px2 = x2 py2 = y1 setColour() GraphicsWindow.DrawLine(px1,py1,px2,py2) EndIf EndSub 'DrawLine Sub setColour OldCol = Col While (Col = OldCol And Col <> "#000000000") Col = GraphicsWindow.GetRandomColor() GraphicsWindow.BrushColor = Col GraphicsWindow.PenColor = Col EndWhile EndSub 'setColour Sub ShowInProgress If L < w-20 Then L = L + FSB P = 10 GraphicsWindow.BrushColor = "DarkBlue" GraphicsWindow.FillRectangle(10,h-25,L,15) Else FT = FT + 1 If FT = 1 Then MiSec = MiSec * 4 EndIf P = P + (FSB*4) If P >= w-20-(3*FSB) Then P = 10 + (3*FSB) Draw = 0 'End EndIf GraphicsWindow.BrushColor = "DarkBlue" GraphicsWindow.FillRectangle(10,h-25,w-20,15) GraphicsWindow.BrushColor = "LightGray" GraphicsWindow.FillRectangle(P, h-25, FSB, 15) GraphicsWindow.BrushColor = "Gray" GraphicsWindow.FillRectangle(P+FSB, h-25, (FSB*2), 15) GraphicsWindow.BrushColor = "LightGray" GraphicsWindow.FillRectangle(P+(3*FSB), h-25, FSB, 15) EndIf EndSub 'Fortschrittsbalken End>LBW566.sb< Start>LBW762-1.sb< ' Tic-tac-toe v1.2 - Copyright (c) 2011 Nonki Takahashi ' ' History ' v1.0 2011/01/18 Created, can play HUMAN vs HUMAN only (419 lines LBW762) ' v1.1 2011/01/18 Added cross reference (505 lines LBW762-0) ' v1.2 2011/01/19 Shaws game tree (419 lines LBW762-1) ' ' Reference ' [1] en.wikipedia.org/wiki/Tic-tac-toe ' [2] 森田, 国枝, 津田: "思考ゲームプログラミング" 1986, アスキー ' (Morita, Kunieda, Tsuda: "Shikou Game Programming" 1986, ASCII) ' ' Naming convention ' class Xxx_ ' label lXxx ' constant XXX ' variable type integer iXxx ' variable type real rXxx ' variable type string sXxx ' variable type char cXxx ' variable type boolean bXxx ' ' Constant ' SPACE = 0 ' for Board CROSS = 1 ' X for Board NOUGHT = 2 ' O for Board DRAW = 3 ' for Winner UPPERA = Text.GetCharacterCode("A") ' for Parse UPPERZ = Text.GetCharacterCode("Z") ' for Parse LETTER0 = Text.GetCharacterCode("0") ' for Parse LETTER9 = Text.GetCharacterCode("9") ' for Parse REPLAY = "4" ' Webdings replay mark SAVE = "=" ' Windings save mark ' ' Main ' GraphicsWindow.BackgroundColor = "LightGray" GraphicsWindow.Title = "Tic-tac-toe v1.2" Board_Clear() Console_Init() Console_bShowResult = "False" Console_bSound = "False" Controls.HideControl(Console_oReplay) Controls.HideControl(Console_oSave) Player_Sequential() ' Sub Player_Sequential Stack.PushValue("nextmove", iX) Stack.PushValue("nextmove", iY) For iY = 1 To Board_iRo For iX = 1 To Board_iRo Game_IsPossibleMove() If Game_bIsPossibleMove Then Board_Move() GameRecord_Move() Lamp_iOn = 3 - iTurn Lamp_Draw() GameRecord_Write() Game_Judge() If Game_iWinner = SPACE Then Player_Sequential() EndIf Board_Unmove() GameRecord_Unmove() EndIf EndFor EndFor iY = Stack.PopValue("nextmove") iX = Stack.PopValue("nextmove") EndSub ' Sub Game_IsPossibleMove If Board_iCell[iX][iY] = SPACE Then Game_bIsPossibleMove = "True" Else Game_bIsPossibleMove = "False" EndIf EndSub ' Sub Game_Judge If Console_bShowResult Then GraphicsWindow.PenColor = "Magenta" GraphicsWindow.PenWidth = 5 EndIf Game_iWinner = SPACE iTurn = Board_iCell[1][1] ' \ If iTurn = SPACE Then Goto lLine2 EndIf For i = 2 To Board_iRo If Board_iCell[i][i] <> iTurn Then Goto lLine2 EndIf EndFor If Console_bShowResult Then GraphicsWindow.DrawLine(Board_iX0, Board_iY0, Board_iX1, Board_iY1) EndIf Game_iWinner = iTurn lLine2: iTurn = Board_iCell[Board_iRo][1] ' / If iTurn = SPACE Then Goto lLine3 EndIf For i = 2 To Board_iRo If Board_iCell[Board_iRo + 1 - i][i] <> iTurn Then Goto lLine3 EndIf EndFor If Console_bShowResult Then GraphicsWindow.DrawLine(Board_iX1, Board_iY0, Board_iX0, Board_iY1) EndIf Game_iWinner = iTurn lLine3: For iY = 1 To Board_iRo iTurn = Board_iCell[1][iY] If iTurn = SPACE Then Goto lLine4 EndIf For iX = 2 To Board_iRo If Board_iCell[iX][iY] <> iTurn Then Goto lLine4 EndIf EndFor If Console_bShowResult Then GraphicsWindow.DrawLine(Board_iX0, Board_iY0 + (iY - 1 / 2) * Board_idY, Board_iX1, Board_iY0 + (iY - 1 / 2) * Board_idY) EndIf Game_iWinner = iTurn lLine4: EndFor For iX = 1 To Board_iRo iTurn = Board_iCell[iX][1] If iTurn = SPACE Then Goto lLine5 EndIf For iY = 2 To Board_iRo If Board_iCell[iX][iY] <> iTurn Then Goto lLine5 EndIf EndFor If Console_bShowResult Then GraphicsWindow.DrawLine(Board_iX0 + (iX - 1 / 2) * Board_idX, Board_iY0, Board_iX0 + (iX - 1 / 2) * Board_idX, Board_iY1) EndIf Game_iWinner = iTurn lLine5: EndFor If Board_iMove = 9 And Game_iWinner = SPACE Then Game_iWinner = DRAW EndIf If Console_bShowResult And Game_iWinner <> SPACE Then Console_ShowWinner() EndIf EndSub ' Sub Console_OnButtonClicked If Controls.LastClickedButton = Console_oReplay Then Console_bReplay = "True" Else Console_bReplay = "False" EndIf If Controls.LastClickedButton = Console_oSave Then Console_bSave = "True" Else Console_bSave = "False" EndIf If Console_bReplay Or Console_bSave Then Console_bButtonClicked = "True" Else Console_bButtonClicked = "False" EndIf EndSub ' Sub Board_Clear Board_iRo = 3 Board_iMove = 0 For iY = 1 To Board_iRo For iX = 1 To Board_iRo Board_iCell[iX][iY] = SPACE EndFor EndFor Board_idX = 90 Board_idY = 90 Board_isX = 20 Board_isY = 20 Board_iX0 = 65 Board_iY0 = 60 Board_iX1 = Board_iX0 + Board_idX * Board_iRo Board_iY1 = Board_iY0 + Board_idY * Board_iRo Board_cX[1] = "A" Board_cX[2] = "B" Board_cX[3] = "C" Board_cY[1] = "1" Board_cY[2] = "2" Board_cY[3] = "3" Board_Draw() If Console_bShowResult Then Console_HideWinner() EndIf EndSub ' Sub Board_Draw GraphicsWindow.BrushColor = "DarkGreen" GraphicsWindow.FillRectangle(Board_iX0 - Board_isX, Board_iY0 - Board_isY, Board_iRo * Board_idX + 2 * Board_isX, Board_iRo * Board_idY + 2 * Board_isY) GraphicsWindow.PenColor = "Khaki" GraphicsWindow.PenWidth = 5 For i = 1 To Board_iRo - 1 iX = Board_iX0 + Board_idX * i iY = Board_iY0 + Board_idY * i GraphicsWindow.DrawLine(Board_iX0, iY, Board_iX1, iY) GraphicsWindow.DrawLine(iX, Board_iY0, iX, Board_iY1) EndFor GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 20 For i = 1 To Board_iRo iX = Board_iX0 + Board_idX * (i - 1) + Board_idX / 2 GraphicsWindow.DrawText(iX, Board_iY0 - 2.5 * Board_isY, Board_cX[i]) iY = Board_iY0 + Board_idY * (i - 1) + Board_idY / 2 GraphicsWindow.DrawText(Board_iX0 - 2.5 * Board_isX, iY, Board_cY[i]) EndFor EndSub ' Sub Board_Move Game_IsPossibleMove() If Game_bIsPossibleMove Then Board_iMove = Board_iMove + 1 iTurn = Math.Remainder((Board_iMove - 1), 2) + 1 Board_iCell[iX][iY] = iTurn GraphicsWindow.PenColor = "White" GraphicsWindow.PenWidth = 10 If iTurn = CROSS Then GraphicsWindow.DrawLine(Board_iX0 + (iX - 1) * Board_idX + Board_isX, Board_iY0 + (iY - 1) * Board_idY + Board_isY, Board_iX0 + iX * Board_idX - Board_isX, Board_iY0 + iY * Board_idY - Board_isY) GraphicsWindow.DrawLine(Board_iX0 + iX * Board_idX - Board_isX, Board_iY0 + (iY - 1) * Board_idY + Board_isY, Board_iX0 + (iX - 1) * Board_idX + Board_isX, Board_iY0 + iY * Board_idY - Board_isY) ElseIf iTurn = NOUGHT Then GraphicsWindow.DrawEllipse(Board_iX0 + (iX - 1) * Board_idX + Board_isX, Board_iY0 + (iY - 1) * Board_idY + Board_isY, Board_idX - 2 * Board_isX, Board_idY - 2 * Board_isY) EndIf GraphicsWindow.BrushColor = "Khaki" GraphicsWindow.DrawText(Board_iX0 + (iX - 1) * Board_idX + Board_isX / 3, Board_iY0 + (iY - 1) * Board_idY + Board_isY / 3, Board_iMove) If Console_bSound Then Sound.PlayClickAndWait() EndIf EndIf EndSub ' Sub Board_Unmove iX = GameRecord_iX[GameRecord_iMove] iY = GameRecord_iY[GameRecord_iMove] If Board_iCell[iX][iY] <> SPACE Then Board_iCell[iX][iY] = SPACE GraphicsWindow.BrushColor = "DarkGreen" GraphicsWindow.FillRectangle(Board_iX0 + (iX - 1) * Board_idX + 3, Board_iY0 + (iY - 1) * Board_idY + 3, Board_idX - 6, Board_idY - 6) Board_iMove = Board_iMove - 1 iTurn = Math.Remainder(Board_iMove - 1, 2) + 1 EndIf EndSub ' Sub Console_Init GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 20 GraphicsWindow.DrawText(Board_iX1 + Board_isX * 2, Board_iY0, "X (CROSS)") GraphicsWindow.DrawText(Board_iX1 + Board_isX * 2, Board_iY0 + Board_iRo * Board_idY / 3, "O (NOUGHT)") Lamp_iCount = 2 Lamp_iX[CROSS] = Board_iX1 + Board_idX * 2 Lamp_iY[CROSS] = Board_iY0 Lamp_iX[NOUGHT] = Board_iX1 + Board_idX * 2 Lamp_iY[NOUGHT] = Board_iY0 + Board_iRo * Board_idY / 3 Lamp_iOn = CROSS Lamp_Draw() Console_oCross = Controls.AddTextBox(Board_iX1 + Board_isX * 2 + 70, Board_iY0 + 30) Controls.SetTextBoxText(Console_oCross, "SEQUENTIAL") Console_oNought = Controls.AddTextBox(Board_iX1 + Board_isX * 2 + 70, Board_iY0 + Board_iRo * Board_idY / 3 + 30) Controls.SetTextBoxText(Console_oNought, "SEQUENTIAL") GraphicsWindow.DrawText(Board_iX0 - Board_isX * 2.5, Board_iY1 + Board_isY * 3, "GAME RECORD") Console_oScore = Controls.AddTextBox(Board_iX0 - Board_isX * 2 + 150, Board_iY1 + Board_isY * 3) Controls.SetSize(Console_oScore, 12 * 27, 30) sFontName = GraphicsWindow.FontName GraphicsWindow.FontName = "Webdings" Console_oReplay = Controls.AddButton(REPLAY, Board_iX0 + 12 * 37, Board_iY1 + Board_isY * 3) Console_bReplay = "False" GraphicsWindow.BrushColor = "Red" Console_oSave = Controls.AddButton(SAVE, Board_iX0 + 12 * 40, Board_iY1 + Board_isY * 3) Console_bSave = "False" GraphicsWindow.FontName = sFontName EndSub ' Sub Console_ShowWinner iX = Board_iX1 + Board_isX * 2 iY = Board_iY0 + 30 GraphicsWindow.BrushColor = "Black" If Game_iWinner = CROSS Then GraphicsWindow.DrawText(iX, iY, "WIN") ElseIf Game_iWinner = NOUGHT Then GraphicsWindow.DrawText(iX, iY, "LOSE") ElseIf Game_iWinner = DRAW Then GraphicsWindow.DrawText(iX, iY, "DRAW") EndIf iY = iY + Board_iRo * Board_idY / 3 If Game_iWinner = NOUGHT Then GraphicsWindow.DrawText(iX, iY, "WIN") ElseIf Game_iWinner = CROSS Then GraphicsWindow.DrawText(iX, iY, "LOSE") ElseIf Game_iWinner = DRAW Then GraphicsWindow.DrawText(iX, iY, "DRAW") EndIf EndSub ' Sub Console_HideWinner iX = Board_iX1 + Board_isX * 2 iY = Board_iY0 + 30 GraphicsWindow.BrushColor = "LightGray" GraphicsWindow.FillRectangle(iX, iY, 80, 30) iY = iY + Board_iRo * Board_idY / 3 GraphicsWindow.FillRectangle(iX, iY, 80, 30) EndSub ' Sub Lamp_Draw For Lamp_iIndex = 1 To Lamp_iCount GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle(Lamp_iX[Lamp_iIndex] + 1, Lamp_iY[Lamp_iIndex] + 1, 21, 7) GraphicsWindow.BrushColor = "DimGray" GraphicsWindow.FillRectangle(Lamp_iX[Lamp_iIndex] - 2, Lamp_iY[Lamp_iIndex] - 2, 21, 7) If Lamp_iIndex = Lamp_iOn Then GraphicsWindow.BrushColor = "Lime" Else GraphicsWindow.BrushColor = "Black" EndIf GraphicsWindow.FillRectangle(Lamp_iX[Lamp_iIndex], Lamp_iY[Lamp_iIndex], 20, 6) EndFor EndSub ' Sub GameRecord_Clear GameRecord_iMove = 0 Controls.SetTextBoxText(Console_oScore, "") EndSub ' Sub GameRecord_Replay For iMove = 1 To GameRecord_iMove iX = GameRecord_iX[iMove] iY = GameRecord_iY[iMove] iTurn = GameRecord_iTurn[iMove] Lamp_iOn = iTurn Lamp_Draw() Board_Move() Game_Judge() EndFor EndSub ' Sub GameRecord_Read ' from textbox Console_oScore GameRecord_iMove = 0 Parse_sBuf = Controls.GetTextBoxText(Console_oScore) Parse_iBufPtr = 1 Parse_iBufLen = Text.GetLength(Parse_sBuf) While Parse_iBufPtr <= Parse_iBufLen Parse_Move() If Parse_bError Then Parse_iBufPtr = Parse_iBufPtr + 1 EndIf EndWhile EndSub ' Sub GameRecord_Write ' to textbox Console_oScore GameRecord_sBuf = "" For iMove = 1 To GameRecord_iMove GameRecord_sBuf = GameRecord_sBuf + Text.GetSubText("ABCD", GameRecord_iX[iMove], 1) GameRecord_sBuf = GameRecord_sBuf + Text.GetSubText("1234", GameRecord_iY[iMove], 1) If iMove < GameRecord_iMove Then GameRecord_sBuf = GameRecord_sBuf + " " EndIf EndFor Controls.SetTextBoxText(Console_oScore, GameRecord_sBuf) EndSub ' Sub GameRecord_Move GameRecord_iMove = GameRecord_iMove + 1 iTurn = Math.Remainder(GameRecord_iMove - 1, 2) + 1 GameRecord_iTurn[GameRecord_iMove] = iTurn GameRecord_iX[GameRecord_iMove] = iX GameRecord_iY[GameRecord_iMove] = iY EndSub ' Sub GameRecord_Unmove If GameRecord_iMove > 0 Then GameRecord_iMove = GameRecord_iMove - 1 iTurn = Math.Remainder(GameRecord_iMove - 1, 2) + 1 EndIf EndSub ' Sub Parse_Move Parse_Upper() If Parse_bError = "False" Then iX = Text.GetIndexOf("ABCD", Parse_c) Parse_Digit() If Parse_bError = "False" Then iY = Text.GetIndexOf("1234", Parse_c) GameRecord_Move() EndIf EndIf EndSub ' Sub Parse_Upper Parse_c = Text.GetSubText(Parse_sBuf,Parse_iBufPtr, 1) iCode = Text.GetCharacterCode(Parse_c) If iCode >= UPPERA And iCode <= UPPERZ Then Parse_bError = "False" Parse_iBufPtr = Parse_iBufPtr + 1 Else Parse_bError = "True" EndIf EndSub ' Sub Parse_Digit Parse_c = Text.GetSubText(Parse_sBuf,Parse_iBufPtr, 1) iCode = Text.GetCharacterCode(Parse_c) If iCode >= LETTER0 And iCode <= LETTER9 Then Parse_bError = "False" Parse_iBufPtr = Parse_iBufPtr + 1 Else Parse_bError = "True" EndIf EndSub End>LBW762-1.sb< Start>LBW762-3.sb< ' Tic-tac-toe v1.4 - Copyright (c) 2011 Nonki Takahashi ' ' History ' v1.0 2011/01/18 Created, can play HUMAN vs HUMAN only (419 lines LBW762) ' v1.1 2011/01/18 Added cross reference (505 lines LBW762-0) ' v1.2 2011/01/19 Shaws game tree (419 lines LBW762-1) ' v1.3 2011/01/21 can play RANDOM vs HUMAN (579 lines LBW762-2) ' v1.4 2011/01/24 can play MINIMAX vs HUMAN (678 lines LBW762-3) ' ' Reference ' [1] en.wikipedia.org/wiki/Tic-tac-toe ' [2] 森田, 国枝, 津田: "思考ゲームプログラミング" 1986, アスキー ' (Morita, Kunieda, Tsuda: "Shikou Game Programming" 1986, ASCII) ' ' Naming convention ' class Xxx_ ' label lXxx ' constant XXX ' variable type integer iXxx ' variable type real rXxx ' variable type string sXxx ' variable type char cXxx ' variable type boolean bXxx ' ' Constant SPACE = 0 ' for Board CROSS = 1 ' X for Board NOUGHT = 2 ' O for Board DRAW = 3 ' for Winner UPPERA = Text.GetCharacterCode("A") ' for Parse UPPERZ = Text.GetCharacterCode("Z") ' for Parse LETTER0 = Text.GetCharacterCode("0") ' for Parse LETTER9 = Text.GetCharacterCode("9") ' for Parse REPLAY = "4" ' Webdings replay mark for replay button SAVE = "=" ' Windings save mark save button NEW = "NEW" ' String for new button VERSION = "v1.4" ' Program version LEVEL = 5 ' Max depth level for minimax method ' ' Main bPreset = "True" Game_Init() While "True" Game_New() If bPreset Then GameRecord_sBuf = "A1" Controls.SetTextBoxText(Console_oGameRecord, GameRecord_sBuf) GameRecord_Read() GameRecord_Replay() EndIf While Game_iWinner = SPACE iTurn = Math.Remainder(Board_iMove, 2) + 1 If iTurn = NOUGHT Then Lamp_iOn = iTurn Lamp_Draw() Goto lTurnO EndIf ' Turn X (CROSS) Player_iScore = 0 Player_iLevel = LEVEL Console_bShow = "False" Console_bShowResult = "False" Player_MiniMax() Console_bShow = "True" Console_bShowResult = "True" Board_Move() Lamp_iOn = 3 - iTurn Lamp_Draw() GameRecord_Move() GameRecord_Write() Game_Judge() If Game_iWinner <> SPACE Then Goto lGameEnd EndIf lTurnO: ' Turn O (NOUGHT) Player_Human() Board_Move() Lamp_iOn = 3 - iTurn Lamp_Draw() GameRecord_Move() GameRecord_Write() Game_Judge() EndWhile lGameEnd: Controls.ShowControl(Console_oReplay) Controls.ShowControl(Console_oNew) Console_bNew = "False" Controls.ButtonClicked = Console_OnButtonClicked While Console_bNew = "False" ' Wait replay or new button While Console_bButtonClicked = "False" Program.Delay(100) EndWhile Console_bButtonClicked = "False" ' Replay game record If Console_bReplay Then Board_New() GameRecord_Read() GameRecord_Replay() EndIf EndWhile Controls.ButtonClicked = Console_DoNothing EndWhile ' ' Player MINIMAX | Next move ' in: Player_iLevel - depth level ' out: iX, iY - next move position when Player_iLevel = LEVEL ' out: iScore - evaluated score Sub Player_MiniMax Stack.PushValue("nextmove", iX) Stack.PushValue("nextmove", iY) Stack.PushValue("nextmove", iTurn) Stack.PushValue("nextmove", iMaxScore) Stack.PushValue("nextmove", bMax) iTurn = Math.Remainder(Board_iMove, 2) + 1 If iTurn = CROSS Then iMaxScore = -2 ' Minimum ElseIf iTurn = NOUGHT Then iMaxScore = 2 ' Maximum EndIf bMax = "True" For iY = 1 To Board_iRo For iX = 1 To Board_iRo Game_IsPossibleMove() If Game_bIsPossibleMove Then If bMax = "False" Then iXC = iX iXY = iY EndIf Board_Move() GameRecord_Move() Game_Judge() If Game_iWinner = CROSS Then iScore = 1 ElseIf Game_iWinner = NOUGHT Then iScore = -1 ElseIf Game_iWinner = DRAW Then iScore = 0 ElseIf Player_iLevel > 1 Then Player_iLevel = Player_iLevel - 1 Player_MiniMax() Player_iLevel = Player_iLevel + 1 Else iScore = 0 EndIf If iTurn = CROSS And iScore >= iMaxScore Then ' Max level iMaxScore = iScore If Player_iLevel = LEVEL Then bMax = "True" iXC = iX iYC = iY EndIf ElseIf iTurn = NOUGHT And iScore <= iMaxScore Then ' Minimum level iMaxScore = iScore EndIf Board_Unmove() GameRecord_Unmove() EndIf EndFor EndFor bMax = Stack.PopValue("nextmove") iScore = iMaxScore iMaxScore = Stack.PopValue("nextmove") iTurn = Stack.PopValue("nextmove") iY = Stack.PopValue("nextmove") iX = Stack.PopValue("nextmove") If Player_iLevel = LEVEL Then iX = iXC ' Next move candidate iY = iYC ' Next move candidate EndIf EndSub ' ' Player HUMAN | Next move ' out: iX, iY - next move position Sub Player_Human GraphicsWindow.MouseDown = Player_OnMouseDown While "True" Player_bOutOfBoard = "True" While Player_bOutOfBoard Player_bNotClicked = "True" While Player_bNotClicked Program.Delay(200) EndWhile Player_GetPosition() EndWhile Game_IsPossibleMove() If Game_bIsPossibleMove Then Goto lPossibleMove Else Sound.PlayChimeAndWait() EndIf EndWhile lPossibleMove: GraphicsWindow.MouseDown = Player_DoNothing iTurn = Math.Remainder((Board_iMove - 1), 2) + 1 EndSub ' ' Player HUMAN | Get mouse position ' out: Player_iMX, Player_iMY - clicked mouse position ' out: Player_bNotClicked - flag Sub Player_OnMouseDown Player_iMX = GraphicsWindow.MouseX Player_iMY = GraphicsWindow.MouseY Player_bNotClicked = "False" EndSub ' Sub Player_DoNothing EndSub ' ' Player HUMAN | Get board position from mouse position ' out: iX, iY - next move position Sub Player_GetPosition iX = Math.Floor((Player_iMX - Board_iX0) / Board_idX) + 1 iY = Math.Floor((Player_iMY - Board_iY0) / Board_idY) + 1 If iX < 1 Or iX > Board_iRo Or iY < 1 Or iY > Board_iRo Then Player_bOutOfBoard = "True" Else Player_bOutOfBoard = "False" EndIf EndSub ' ' Game | Get possible moves list ' in: Board_iCell[][] - board ' out: iPossible - entry count of possible moves ' out: iPX[], iPY[] - possible moves ' work: iNP - instead of x, y for Board_iCell[][] Sub Game_GetPossibleMoves iPossible = 0 For iNP = 0 To 8 If Board_iCell[Math.Remainder(iNP, 3) + 1][Math.Floor(iNP / 3) + 1] = SPACE Then iPossible = iPossible + 1 iPX[iPossible] = Math.Remainder(iNP, 3) + 1 iPY[iPossible] = Math.Floor(iNP / 3) + 1 EndIf EndFor EndSub ' ' Game | Initialization Sub Game_Init GraphicsWindow.BackgroundColor = "LightGray" GraphicsWindow.Title = "Tic-tac-toe " + VERSION Console_bShowResult = "True" Console_bSound = "True" Board_Init() Console_Init() EndSub ' ' Game | Set game properties for new game Sub Game_New Board_New() Console_New() GameRecord_New() Controls.HideControl(Console_oReplay) Controls.HideControl(Console_oNew) Game_iWinner = SPACE EndSub ' ' Game | Is possible move? ' in: iX, iY - next move Sub Game_IsPossibleMove If Board_iCell[iX][iY] = SPACE Then Game_bIsPossibleMove = "True" Else Game_bIsPossibleMove = "False" EndIf EndSub ' ' Game | Judge Sub Game_Judge Stack.PushValue("judge", iX) Stack.PushValue("judge", iY) Stack.PushValue("judge", iTurn) If Console_bShowResult Then GraphicsWindow.PenColor = "Magenta" GraphicsWindow.PenWidth = 5 EndIf Game_iWinner = SPACE iTurn = Board_iCell[1][1] ' \ If iTurn = SPACE Then Goto lLine2 EndIf For i = 2 To Board_iRo If Board_iCell[i][i] <> iTurn Then Goto lLine2 EndIf EndFor If Console_bShowResult Then GraphicsWindow.DrawLine(Board_iX0, Board_iY0, Board_iX1, Board_iY1) EndIf Game_iWinner = iTurn lLine2: iTurn = Board_iCell[Board_iRo][1] ' / If iTurn = SPACE Then Goto lLine3 EndIf For i = 2 To Board_iRo If Board_iCell[Board_iRo + 1 - i][i] <> iTurn Then Goto lLine3 EndIf EndFor If Console_bShowResult Then GraphicsWindow.DrawLine(Board_iX1, Board_iY0, Board_iX0, Board_iY1) EndIf Game_iWinner = iTurn lLine3: For iY = 1 To Board_iRo iTurn = Board_iCell[1][iY] If iTurn = SPACE Then Goto lLine4 EndIf For iX = 2 To Board_iRo If Board_iCell[iX][iY] <> iTurn Then Goto lLine4 EndIf EndFor If Console_bShowResult Then GraphicsWindow.DrawLine(Board_iX0, Board_iY0 + (iY - 1 / 2) * Board_idY, Board_iX1, Board_iY0 + (iY - 1 / 2) * Board_idY) EndIf Game_iWinner = iTurn lLine4: EndFor For iX = 1 To Board_iRo iTurn = Board_iCell[iX][1] If iTurn = SPACE Then Goto lLine5 EndIf For iY = 2 To Board_iRo If Board_iCell[iX][iY] <> iTurn Then Goto lLine5 EndIf EndFor If Console_bShowResult Then GraphicsWindow.DrawLine(Board_iX0 + (iX - 1 / 2) * Board_idX, Board_iY0, Board_iX0 + (iX - 1 / 2) * Board_idX, Board_iY1) EndIf Game_iWinner = iTurn lLine5: EndFor If Board_iMove = 9 And Game_iWinner = SPACE Then Game_iWinner = DRAW EndIf If Game_iWinner = CROSS Then Game_iScore = 1 ElseIf Game_iWinner = NOUGHT Then Game_iScore = -1 Else Game_iScore = 0 EndIf If Console_bShowResult And Game_iWinner <> SPACE Then Console_ShowWinner() EndIf iTurn = Stack.PopValue("judge") iY = Stack.PopValue("judge") iX = Stack.PopValue("judge") EndSub ' ' Game console | Do nothing Sub Console_DoNothing EndSub ' ' Game console | Set flags about clicked buttons ' out: Console_bReplay, Console_bNew, Console_bButtonClicked Sub Console_OnButtonClicked If Controls.LastClickedButton = Console_oReplay Then Console_bReplay = "True" Else Console_bReplay = "False" EndIf If Controls.LastClickedButton = Console_oNew Then Console_bNew = "True" Else Console_bNew = "False" EndIf If Console_bReplay Or Console_bNew Then Console_bButtonClicked = "True" Else Console_bButtonClicked = "False" EndIf EndSub ' ' Game console | Initialization Sub Console_Init GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 20 GraphicsWindow.DrawText(Board_iX1 + Board_isX * 2, Board_iY0, "X (CROSS)") GraphicsWindow.DrawText(Board_iX1 + Board_isX * 2, Board_iY0 + Board_iRo * Board_idY / 3, "O (NOUGHT)") Lamp_iCount = 2 Lamp_iX[CROSS] = Board_iX1 + Board_idX * 2 Lamp_iY[CROSS] = Board_iY0 Lamp_iX[NOUGHT] = Board_iX1 + Board_idX * 2 Lamp_iY[NOUGHT] = Board_iY0 + Board_iRo * Board_idY / 3 Console_oCross = Controls.AddTextBox(Board_iX1 + Board_isX * 2 + 70, Board_iY0 + 30) Controls.SetTextBoxText(Console_oCross, "MINIMAX") Console_oNought = Controls.AddTextBox(Board_iX1 + Board_isX * 2 + 70, Board_iY0 + Board_iRo * Board_idY / 3 + 30) Controls.SetTextBoxText(Console_oNought, "HUMAN") GraphicsWindow.DrawText(Board_iX0 - Board_isX * 2.5, Board_iY1 + Board_isY * 3, "GAME RECORD") Console_oGameRecord = Controls.AddTextBox(Board_iX0 - Board_isX * 2 + 150, Board_iY1 + Board_isY * 3) Controls.SetSize(Console_oGameRecord, 12 * 27, 30) sFontName = GraphicsWindow.FontName GraphicsWindow.FontName = "Webdings" Console_oReplay = Controls.AddButton(REPLAY, Board_iX0 + 12 * 37, Board_iY1 + Board_isY * 3) GraphicsWindow.FontName = sFontName iFontSize = GraphicsWindow.FontSize GraphicsWindow.FontSize = 17 Console_oNew = Controls.AddButton(NEW, Board_iX0 + 12 * 40, Board_iY1 + Board_isY * 3) GraphicsWindow.FontSize = iFontSize GameRecord_sBuf = "" Console_New() EndSub ' ' Game console | Set console for new game Sub Console_New Lamp_iOn = CROSS Lamp_Draw() Console_bReplay = "False" Console_bNew = "False" Controls.SetTextBoxText(Console_oGameRecord, GameRecord_sBuf) GameRecord_Write() EndSub ' ' Game console | Show winner to console Sub Console_ShowWinner iX = Board_iX1 + Board_isX * 2 iY = Board_iY0 + 30 GraphicsWindow.BrushColor = "Black" If Game_iWinner = CROSS Then GraphicsWindow.DrawText(iX, iY, "WIN") ElseIf Game_iWinner = NOUGHT Then GraphicsWindow.DrawText(iX, iY, "LOSE") ElseIf Game_iWinner = DRAW Then GraphicsWindow.DrawText(iX, iY, "DRAW") EndIf iY = iY + Board_iRo * Board_idY / 3 If Game_iWinner = NOUGHT Then GraphicsWindow.DrawText(iX, iY, "WIN") ElseIf Game_iWinner = CROSS Then GraphicsWindow.DrawText(iX, iY, "LOSE") ElseIf Game_iWinner = DRAW Then GraphicsWindow.DrawText(iX, iY, "DRAW") EndIf EndSub ' ' Game console | Hide winner from console Sub Console_HideWinner iX = Board_iX1 + Board_isX * 2 iY = Board_iY0 + 30 GraphicsWindow.BrushColor = "LightGray" GraphicsWindow.FillRectangle(iX, iY, 80, 30) iY = iY + Board_iRo * Board_idY / 3 GraphicsWindow.FillRectangle(iX, iY, 80, 30) EndSub ' ' Select lamp | Draw select lamps ' in: Lamp_iOn - index of lamp selected ' in: Lamp_iCount - number of lamps Sub Lamp_Draw For Lamp_iIndex = 1 To Lamp_iCount GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle(Lamp_iX[Lamp_iIndex] + 1, Lamp_iY[Lamp_iIndex] + 1, 21, 7) GraphicsWindow.BrushColor = "DimGray" GraphicsWindow.FillRectangle(Lamp_iX[Lamp_iIndex] - 2, Lamp_iY[Lamp_iIndex] - 2, 21, 7) If Lamp_iIndex = Lamp_iOn Then GraphicsWindow.BrushColor = "Lime" Else GraphicsWindow.BrushColor = "Black" EndIf GraphicsWindow.FillRectangle(Lamp_iX[Lamp_iIndex], Lamp_iY[Lamp_iIndex], 20, 6) EndFor EndSub ' ' Tic-tac-toe board | Initialization Sub Board_Init Board_iRo = 3 Board_idX = 90 Board_idY = 90 Board_isX = 20 Board_isY = 20 Board_iX0 = 65 Board_iY0 = 60 Board_iX1 = Board_iX0 + Board_idX * Board_iRo Board_iY1 = Board_iY0 + Board_idY * Board_iRo Board_cX[1] = "A" Board_cX[2] = "B" Board_cX[3] = "C" Board_cY[1] = "1" Board_cY[2] = "2" Board_cY[3] = "3" Console_bShow = "True" Board_New() EndSub ' ' Tic-tac-toe board | Set board for new game Sub Board_New Board_iMove = 0 For iY = 1 To Board_iRo For iX = 1 To Board_iRo Board_iCell[iX][iY] = SPACE EndFor EndFor Board_Draw() If Console_bShowResult Then Console_HideWinner() EndIf EndSub ' ' Tic-tac-toe board | Draw board Sub Board_Draw GraphicsWindow.BrushColor = "DarkGreen" GraphicsWindow.FillRectangle(Board_iX0 - Board_isX, Board_iY0 - Board_isY, Board_iRo * Board_idX + 2 * Board_isX, Board_iRo * Board_idY + 2 * Board_isY) GraphicsWindow.PenColor = "Khaki" GraphicsWindow.PenWidth = 5 For i = 1 To Board_iRo - 1 iX = Board_iX0 + Board_idX * i iY = Board_iY0 + Board_idY * i GraphicsWindow.DrawLine(Board_iX0, iY, Board_iX1, iY) GraphicsWindow.DrawLine(iX, Board_iY0, iX, Board_iY1) EndFor GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 20 For i = 1 To Board_iRo iX = Board_iX0 + Board_idX * (i - 1) + Board_idX / 2 GraphicsWindow.DrawText(iX, Board_iY0 - 2.5 * Board_isY, Board_cX[i]) iY = Board_iY0 + Board_idY * (i - 1) + Board_idY / 2 GraphicsWindow.DrawText(Board_iX0 - 2.5 * Board_isX, iY, Board_cY[i]) EndFor EndSub ' ' Tic-tac-toe board | set next move to board and draw the move ' in: iX, iY - next move Sub Board_Move Game_IsPossibleMove() If Game_bIsPossibleMove Then Board_iMove = Board_iMove + 1 iTurn = Math.Remainder((Board_iMove - 1), 2) + 1 Board_iCell[iX][iY] = iTurn If Console_bShow Then GraphicsWindow.PenColor = "White" GraphicsWindow.PenWidth = 10 If iTurn = CROSS Then GraphicsWindow.DrawLine(Board_iX0 + (iX - 1) * Board_idX + Board_isX, Board_iY0 + (iY - 1) * Board_idY + Board_isY, Board_iX0 + iX * Board_idX - Board_isX, Board_iY0 + iY * Board_idY - Board_isY) GraphicsWindow.DrawLine(Board_iX0 + iX * Board_idX - Board_isX, Board_iY0 + (iY - 1) * Board_idY + Board_isY, Board_iX0 + (iX - 1) * Board_idX + Board_isX, Board_iY0 + iY * Board_idY - Board_isY) ElseIf iTurn = NOUGHT Then GraphicsWindow.DrawEllipse(Board_iX0 + (iX - 1) * Board_idX + Board_isX, Board_iY0 + (iY - 1) * Board_idY + Board_isY, Board_idX - 2 * Board_isX, Board_idY - 2 * Board_isY) EndIf GraphicsWindow.BrushColor = "Khaki" GraphicsWindow.DrawText(Board_iX0 + (iX - 1) * Board_idX + Board_isX / 3, Board_iY0 + (iY - 1) * Board_idY + Board_isY / 3, Board_iMove) If Console_bSound Then Sound.PlayClickAndWait() EndIf EndIf Else TextWindow.Write("ERROR: Board_Move(") Debug_DumpXY() EndIf EndSub ' ' Tic-tac-toe board | Undo last move ' in: GameRecord_iX[], GameRecord_iY[] - last moves ' out: iX, iY - last move Sub Board_Unmove iX = GameRecord_iX[GameRecord_iMove] iY = GameRecord_iY[GameRecord_iMove] If Board_iCell[iX][iY] <> SPACE Then Board_iCell[iX][iY] = SPACE If Console_bShow Then GraphicsWindow.BrushColor = "DarkGreen" GraphicsWindow.FillRectangle(Board_iX0 + (iX - 1) * Board_idX + 3, Board_iY0 + (iY - 1) * Board_idY + 3, Board_idX - 6, Board_idY - 6) EndIf Board_iMove = Board_iMove - 1 iTurn = Math.Remainder(Board_iMove - 1, 2) + 1 EndIf EndSub ' ' Game record | Set game record to new game Sub GameRecord_New GameRecord_iMove = 0 Controls.SetTextBoxText(Console_oGameRecord, "") EndSub ' ' Game record | Replay game record Sub GameRecord_Replay For iMove = 1 To GameRecord_iMove iX = GameRecord_iX[iMove] iY = GameRecord_iY[iMove] iTurn = GameRecord_iTurn[iMove] Lamp_iOn = iTurn Lamp_Draw() Board_Move() Game_Judge() EndFor EndSub ' ' Game record | Read game record from textbox Sub GameRecord_Read GameRecord_iMove = 0 Parse_sBuf = Controls.GetTextBoxText(Console_oGameRecord) Parse_iBufPtr = 1 Parse_iBufLen = Text.GetLength(Parse_sBuf) While Parse_iBufPtr <= Parse_iBufLen Parse_Move() If Parse_bError Then Parse_iBufPtr = Parse_iBufPtr + 1 EndIf EndWhile EndSub ' ' Game record | Write game record to textbox Sub GameRecord_Write GameRecord_sBuf = "" For iMove = 1 To GameRecord_iMove GameRecord_sBuf = GameRecord_sBuf + Text.GetSubText("ABCD", GameRecord_iX[iMove], 1) GameRecord_sBuf = GameRecord_sBuf + Text.GetSubText("1234", GameRecord_iY[iMove], 1) If iMove < GameRecord_iMove Then GameRecord_sBuf = GameRecord_sBuf + " " EndIf EndFor Controls.SetTextBoxText(Console_oGameRecord, GameRecord_sBuf) EndSub ' ' Game record | Record next move Sub GameRecord_Move GameRecord_iMove = GameRecord_iMove + 1 iTurn = Math.Remainder(GameRecord_iMove - 1, 2) + 1 GameRecord_iTurn[GameRecord_iMove] = iTurn GameRecord_iX[GameRecord_iMove] = iX GameRecord_iY[GameRecord_iMove] = iY EndSub ' ' Game record | Undo last move in game recode Sub GameRecord_Unmove If GameRecord_iMove > 0 Then GameRecord_iMove = GameRecord_iMove - 1 iTurn = Math.Remainder(GameRecord_iMove - 1, 2) + 1 EndIf EndSub ' ' Game record parse | Parse move in textbox Sub Parse_Move Parse_Upper() If Parse_bError = "False" Then iX = Text.GetIndexOf("ABCD", Parse_c) Parse_Digit() If Parse_bError = "False" Then iY = Text.GetIndexOf("1234", Parse_c) GameRecord_Move() EndIf EndIf EndSub ' ' Game record parse | Parse upper case char in textbox Sub Parse_Upper Parse_c = Text.GetSubText(Parse_sBuf,Parse_iBufPtr, 1) iCode = Text.GetCharacterCode(Parse_c) If iCode >= UPPERA And iCode <= UPPERZ Then Parse_bError = "False" Parse_iBufPtr = Parse_iBufPtr + 1 Else Parse_bError = "True" EndIf EndSub ' ' Game record parse | Parse digit in textbox Sub Parse_Digit Parse_c = Text.GetSubText(Parse_sBuf,Parse_iBufPtr, 1) iCode = Text.GetCharacterCode(Parse_c) If iCode >= LETTER0 And iCode <= LETTER9 Then Parse_bError = "False" Parse_iBufPtr = Parse_iBufPtr + 1 Else Parse_bError = "True" EndIf EndSub ' ' Debug | Dump iX iY ' in: iX, iY Sub Debug_DumpXY TextWindow.WriteLine("iX = " + iX + ", iY= " + iY) EndSub End>LBW762-3.sb< Start>LBX119-0.sb< ' Draw Smile ' Version 0.2 ' Copyright © 2016 Nonki Takahashi. The MIT License. ' Program ID LBX119 GraphicsWindow.Title = "Smile" DrawGrid() ' face GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.FillEllipse(315 - 200, 10, 400, 400) ' mouth GraphicsWindow.PenWidth = 10 GraphicsWindow.PenColor = "Black" GraphicsWindow.BrushColor = "Black" param = "x=315;y=200;r=150;a1=20;a2=160;da=5;ct=Round" DrawArc() ' eyes d = 30 eye[1] = Shapes.AddEllipse(d, 3.6 * d) Shapes.Move(eye[1], 250 - d / 2, 160 - 1.8 * d) eye[2] = Shapes.AddEllipse(d, 3.6 * d) Shapes.Move(eye[2], 380 - d / 2, 160 - 1.8 * d) ' blink While "True" Program.Delay(5000) Shapes.HideShape(eye[1]) Shapes.HideShape(eye[2]) Program.Delay(100) Shapes.ShowShape(eye[1]) Shapes.ShowShape(eye[2]) EndWhile Sub DrawArc ' param["x"] - center x coordinate [px] ' param["y"] - center y coordinate [px] ' param["r"] - radius [px] ' param["a1"] - start angle [°] ' param["a2"] - end angle [°] ' param["da"] - delta (step) angle [°] ' param["ct"] - cap type ("Round" for round, otherwise for flat) Stack.PushValue("local", local) Stack.PushValue("local", a) local["pw"] = GraphicsWindow.PenWidth local["bc"] = GraphicsWindow.BrushColor GraphicsWindow.BrushColor = GraphicsWindow.PenColor For a = param["a1"] To param["a2"] Step param["da"] local["rad"] = Math.GetRadians(a) local["x2"] = param["x"] + param["r"] * Math.Cos(local["rad"]) local["y2"] = param["y"] + param["r"] * Math.Sin(local["rad"]) If param["a1"] < a Then GraphicsWindow.DrawLine(local["x1"], local["y1"], local["x2"], local["y2"]) EndIf If ((param ["a1"] < a) And (a < param["a2"])) Or Text.ConvertToLowerCase(param["ct"]) = "round" Then GraphicsWindow.PenWidth = 0 GraphicsWindow.FillEllipse(local["x2"] - local["pw"] / 2, local["y2"] - local["pw"] / 2, local["pw"], local["pw"]) GraphicsWindow.PenWidth = local["pw"] EndIf local["x1"] = local["x2"] local["y1"] = local["y2"] EndFor GraphicsWindow.BrushColor = local["bc"] a = Stack.PopValue("local") local = Stack.PopValue("local") EndSub Sub DrawGrid gw = GraphicsWindow.Width gh = GraphicsWindow.Height GraphicsWindow.PenWidth = 2 GraphicsWindow.PenColor = "Gray" For y = 0 To gh Step 50 GraphicsWindow.DrawLine(0, y, gw, y) EndFor For x = 0 To gw Step 50 GraphicsWindow.DrawLine(x, 0, x, gh) EndFor EndSub End>LBX119-0.sb< Start>LBX119.sb< ' Draw Smile ' Version 0.1 ' Copyright © 2016 Nonki Takahashi. The MIT License. ' GraphicsWindow.Title = "Smile" DrawGrid() ' face GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.FillEllipse(315 - 200, 10, 400, 400) ' mouth GraphicsWindow.PenWidth = 10 GraphicsWindow.PenColor = "Black" GraphicsWindow.BrushColor = "Black" param = "x=315;y=200;r=150;a1=0;a2=180;da=5;ct=Round" DrawArc() ' eyes d = 30 GraphicsWindow.FillEllipse(250 - d / 2, 160 - 2 * d, d, 4 * d) GraphicsWindow.FillEllipse(380 - d / 2, 160 - 2 * d, d, 4 * d) Sub DrawArc ' param["x"] - center x coordinate [px] ' param["y"] - center y coordinate [px] ' param["r"] - radius [px] ' param["a1"] - start angle [°] ' param["a2"] - end angle [°] ' param["da"] - delta (step) angle [°] ' param["ct"] - cap type ("Round" for round, otherwise for flat) Stack.PushValue("local", local) Stack.PushValue("local", a) local["pw"] = GraphicsWindow.PenWidth local["bc"] = GraphicsWindow.BrushColor GraphicsWindow.BrushColor = GraphicsWindow.PenColor For a = param["a1"] To param["a2"] Step param["da"] local["rad"] = Math.GetRadians(a) local["x2"] = param["x"] + param["r"] * Math.Cos(local["rad"]) local["y2"] = param["y"] + param["r"] * Math.Sin(local["rad"]) If param["a1"] < a Then GraphicsWindow.DrawLine(local["x1"], local["y1"], local["x2"], local["y2"]) EndIf If ((param ["a1"] < a) And (a < param["a2"])) Or Text.ConvertToLowerCase(param["ct"]) = "round" Then GraphicsWindow.PenWidth = 0 GraphicsWindow.FillEllipse(local["x2"] - local["pw"] / 2, local["y2"] - local["pw"] / 2, local["pw"], local["pw"]) GraphicsWindow.PenWidth = local["pw"] EndIf local["x1"] = local["x2"] local["y1"] = local["y2"] EndFor GraphicsWindow.BrushColor = local["bc"] a = Stack.PopValue("local") local = Stack.PopValue("local") EndSub Sub DrawGrid gw = GraphicsWindow.Width gh = GraphicsWindow.Height GraphicsWindow.PenWidth = 2 GraphicsWindow.PenColor = "Gray" For y = 0 To gh Step 50 GraphicsWindow.DrawLine(0, y, gw, y) EndFor For x = 0 To gw Step 50 GraphicsWindow.DrawLine(x, 0, x, gh) EndFor EndSub End>LBX119.sb< Start>LBX637.sb< ' Not Used Subroutines 0.1 ' Copyright (c) 2014 Nonki Takahashi. The MIT License. ' ' Usage: ' Filename? input.sb ' ' History: ' 0.1 2014-08-29 Created from Comment In 0.2. () ' Not = "False=True;True=False;" WQ = Text.GetCharacter(34) FCHAR = "_abcdefghijklmnopqrstuvwxyz" TCHAR = FCHAR + "0123456789" error = "True" While error TextWindow.Write("Filename? ") buf = TextWindow.Read() ParseArgs() If args[1] <> "" Then args["stdin"] = args[1] error = "False" Else TextWindow.WriteLine("Usage: Filename? input.sb") EndIf EndWhile eof = "False" nLine = 0 nChar = 0 If args["stdin"] <> "" Then max = 0 ' dummy for remote ' The following line could be harmful and has been automatically commented. ' max = Text.GetLength(File.ReadContents(args["stdin"])) EndIf While Not[eof] ReadLine() If Not[eof] Then LineToBuf() GetSub() p = 1 GetCaller() EndIf EndWhile ListNotUsedSubs() Sub GetSub ' param buf - command line ' return matched - "True" if matched ' return subs - array of subroutine names SkipSpace() kw = "Sub" GetKeyword() If matched And p <= l Then SkipSpace() GetName() EndIf If matched And p <= l Then SkipSpace() kw = "'" GetKeyword() EndIf If matched Then defs[name] = 1 ' reference count EndIf EndSub Sub GetCaller ' param buf - command line SkipSpace() GetName() If matched Then SkipSpace() kw = "(" GetKeyword() EndIf If matched Then SkipSpace() kw = ")" GetKeyword() EndIf If matched And p <= l Then SkipSpace() EndIf If matched And p <= l Then kw = "'" GetKeyword() EndIf If matched Then subs[name] = subs[name] + 1 ' reference count EndIf EndSub Sub GetKeyword ' param buf - command line ' param kw - keyword ' param l - length of buf ' param p - pointer in buf ' return p - pointer to not space in buf ' return matched - "True" if matched matched = "False" lKW = Text.GetLength(kw) If p + lKW - 1 <= l Then subtxt = Text.GetSubText(buf, p, lKW) If Text.ConvertToLowerCase(kw) = Text.ConvertToLowerCase(subtxt) Then matched = "True" p = p + lKW EndIf EndIf EndSub Sub GetName ' param buf - command line ' param l - length of buf ' param p - pointer in buf ' return p - pointer to not space in buf ' return name - got name ' return matched - "True" if matched matched = "False" name = "" If p <= l Then c = Text.GetSubText(buf, p, 1) If Text.IsSubText(FCHAR, Text.ConvertToLowerCase(c)) Then name = Text.Append(name, c) matched = "True" p = p + 1 EndIf EndIf While matched And p <= l c = Text.GetSubText(buf, p, 1) If Text.IsSubText(TCHAR, Text.ConvertToLowerCase(c)) Then name = Text.Append(name, c) p = p + 1 Else matched = "False" EndIf EndWhile If name <> "" Then matched = "True" EndIf EndSub Sub ListNotUsedSubs index = Array.GetAllIndices(defs) nSubs = Array.GetItemCount(defs) For i = 1 To nSubs If subs[index[i]] < 1 Then TextWindow.WriteLine(index[i]) EndIf EndFor EndSub Sub LineToBuf buf = line l = Text.GetLength(buf) p = 1 EndSub Sub ReadLine ' return line - text of a line ' return eof - "True" if end of file If args["stdin"] = "" Then line = TextWindow.Read() If line = "" Then eof = "True" EndIf Else If nChar < max Then nLine = nLine + 1 ' The following line could be harmful and has been automatically commented. ' line = File.ReadLine(args["stdin"], nLine) nChar = nChar + Text.GetLength(line) + 2 ' 2 for CR and LF Else eof = "True" EndIf EndIf EndSub Sub WriteLine ' param line - text of a line If args["stdout"] = "" Then TextWindow.WriteLine(line) Else ' The following line could be harmful and has been automatically commented. ' File.WriteLine(args["stdout"], nLine, line) EndIf EndSub Sub ParseArgs ' param buf - command line ' return args[] - array of arguments p = 1 l = Text.GetLength(buf) n = 1 While p <= l SkipSpace() GetToken() EndWhile EndSub Sub SkipSpace ' param buf - command line ' param l - length of buf ' param p - pointer in buf ' return p - pointer to not space in buf isSpace = "True" While p <= l And isSpace c = Text.GetSubText(buf, p, 1) If c = " " Then p = p + 1 Else isSpace = "False" EndIf EndWhile EndSub Sub GetToken ' param buf - command line ' param l - length of buf ' param p - pointer in buf ' return args[] - array of arguments ' return p - pointer to not space in buf isDelim = "False" s = p ' p at start n = Array.GetItemCount(args) While p <= l And Not[isDelim] c = Text.GetSubText(buf, p, 1) If c = " " Then isDelim = "True" ElseIf c = "<" Or c = ">" Then isDelim = "True" d = c ' save delimiter If p = s Then p = p + 1 SkipSpace() GetToken() If d = "<" Then args["stdin"] = args[n + 1] ElseIf d = ">" Then args["stdout"] = args[n + 1] EndIf args[n + 1] = "" EndIf ElseIf c = WQ Then p2 = Text.GetIndexOf(Text.GetSubTextToEnd(buf, p + 1), WQ) If 0 < p2 Then args[n + 1] = Text.Append(args[n + 1], Text.GetSubText(buf, p + 1, p2 - 1)) p = p + p2 + 1 Else TextWindow.WriteLine("Error: Missing quote") EndIf Else args[n + 1] = Text.Append(args[n + 1], c) p = p + 1 EndIf EndWhile EndSub End>LBX637.sb< Start>LBX755.sb< TextWindow.WriteLine("This is Math.GetRandomNumber method ........") textwindow.WriteLine(Clock.Date+" : "+Clock.Time+ "... "+Clock.ElapsedMilliseconds) For m=1 To 10 randam="" N=0 While N<2000 N=N+1 rnd=math.GetRandomNumber(10)-1 randam[rnd]=randam[rnd]+1 sum[rnd]=sum[rnd]+1 EndWhile For i=0 To 9 TextWindow.Write(i+"="+randam[i]+";") EndFor TextWindow.WriteLine(" ") EndFor TextWindow.WriteLine(" ") For i=0 To 9 TextWindow.Write(i+"="+sum[i]+";") EndFor TextWindow.WriteLine(" ") End>LBX755.sb< Start>LBZ128.sb< TextWindow.WriteLine( "The Vial of Doom Copyright (c) 1983 by Roger M. Wilcox Rev. n. 3") TextWindow.WriteLine("I know the verbs STICK, SWING, and PLUCK.") L30: data() For X=1 To 6 Dss[X]=dtt[x] EndFor ii=7 For X=1 To 21 PLACEss[X]=dtt[ii] ii=ii+1 For Y=1 To 6 PLACE[X][Y]=dtt[ii] ii=ii+1 EndFor EndFor For X=1 To 40 OBss[X]=dtt[ii] ii=ii+1 ob[X]=dtt[ii] ii=ii+1 EndFor CP=1 Qss=Text.GetCharacter(34) L40: START=0 Y=960 'CALL OFFSET(START,Y) 'LOCATE 1 If Text.StartsWith( PLACEss[CP] "*") Then TextWindow.Write( Text.GetSubTextToEnd(PLACEss[CP],2)) Else TextWindow.Write("You are in "+PLACEss[CP]) EndIf L50: TextWindow.Write(". ") If CP=1 OR CP=17 Then ob[6]=CP EndIf L60: Y=1 For X=1 To 40 If ob[X]<>CP Then Goto L90 ElseIf Y Then TextWindow.WriteLine("Visible items:") TextWindow.WriteLine("") Y=0 EndIf L70: If TextWindow.CursorLeft+Text.GetLength(OBss[X])>78 Then TextWindow.WriteLine("") TextWindow.Write( OBss[X]+". ") EndIf l90: EndFor Y=1 For X=1 To 6 If PLACE[CP][X]=0 Then Goto L110 ElseIf Y Then TextWindow.Write("") TextWindow.Write("") TextWindow.Write("Obvious exits: ") Y=0 TextWindow.Write(" "+Dss[X]) EndIf L110: EndFor TextWindow.WriteLine("") '?TextWindow.Write( STRINGss(80,220) L120: If CP>4 Then If ob[5]=23 AND ob[4]<>23 OR WV Then Goto L1220 EndIf EndIf L130: 'LOCATE 13 START=1920 Y=79 'CALL OFFSET(START,Y) A=0 B=0 Ass="" Bss="" TextWindow.Write(" ------> Cmd: ") ass=TextWindow.Read() If Ass="" Then Goto l130 Else START=2080 EndIf Y=880 'CALL OFFSET(START,Y) X=2 L140: If Text.GetSubText(Ass,X,1)="" Then Goto l170 ElseIf Text.GetSubText(Ass,X,1)<>" " Then X=X+1 Goto L140 EndIf L150: Bss=Text.GetSubTextToEnd(Ass,X+1) Ass=text.ConvertToUpperCase( Text.GetSubText(Ass,1 X-1)) Bss=LDText.Trim(bss) l170: A1ss=Text.GetSubText(Ass,1 4) B1ss=Text.GetSubText(Bss, 1 4) For X=1 To 55 If A1ss=VERBss[X] Then A=X EndIf EndFor If A=0 Then TextWindow.WriteLine("I don't know how to "+Qss+Ass+Qss+" something.") Goto L130 ElseIf Bss="" OR B1ss="GAME" Then Goto L200 Else For X=1 To 48 If B1ss=NOUNss[X] Then B=X EndIf EndFor EndIf If B=0 Then TextWindow.WriteLine("I don't know what "+Qss+Bss+Qss+" is.") Goto L130 EndIf L200: If TR>0 Then TR=TR-1 TextWindow.WriteLine("You have"+TR+"seconds!") If TR=0 Then Goto L1130 EndIf EndIf If a=1 Then Goto L220 ElseIf a=2 Then Goto L230 ElseIf a=3 Then Goto L220 ElseIf a=4 Then Goto L230 ElseIf a=5 Then Goto L220 ElseIf a=6 Then Goto L230 ElseIf a=7 Then Goto L220 ElseIf a=8 Then Goto L230 ElseIf a=9 Then Goto L220 ElseIf a=10 Then Goto L230 ElseIf a=11 Then Goto L220 ElseIf a=12 Then Goto L230 ElseIf a=13 Then Goto L750 ElseIf a=14 Then Goto L750 ElseIf a=15 Then Goto L750 ElseIf a=16 Then Goto L990 ElseIf a=17 Then Goto L990 ElseIf a=18 Then Goto L240 ElseIf a=19 Then Goto L240 ElseIf a=20 Then Goto L290 ElseIf a=21 Then Goto L290 ElseIf a=22 Then Goto L330 ElseIf a=23 Then Goto L370 ElseIf a=24 Then Goto L370 ElseIf a=25 Then Goto L390 ElseIf a=26 Then Goto L410 ElseIf a=27 Then Goto L420 ElseIf a=28 Then Goto L430 ElseIf a=29 Then Goto L460 ElseIf a=30 Then Goto L500 ElseIf a=31 Then Goto L520 ElseIf a=32 Then Goto L550 ElseIf a=33 Then Goto L590 ElseIf a=34 Then Goto L590 ElseIf a=35 Then Goto L600 ElseIf a=36 Then Goto L240 ElseIf a=37 Then Goto L620 ElseIf a=38 Then Goto L630 ElseIf a=39 Then Goto L640 ElseIf a=40 Then Goto L660 ElseIf a=41 Then Goto L670 ElseIf a=42 Then Goto L680 ElseIf a=43 Then Goto L700 ElseIf a=44 Then Goto L730 ElseIf a=45 Then Goto L680 ElseIf a=46 Then Goto L420 ElseIf a=47 Then Goto L1000 ElseIf a=48 Then Goto L1160 ElseIf a=49 Then Goto L1170 ElseIf a=50 Then Goto L1180 ElseIf a=51 Then Goto L1190 ElseIf a=52 Then Goto L1190 ElseIf a=53 Then Goto L990 ElseIf a=54 Then Goto L1010 ElseIf a=55 Then Goto L740 EndIf L220: D=(A+1)/2 Goto L1020 L230: D=A/2 Goto L1020 L240: If B=0 Then Goto L40 ElseIf B=2 OR B=3 Then If ob[2]<>CP AND ob[2]<23 Then Goto L1210 Else TextWindow.WriteLine("The portal has a golden inscription.") Goto L130 EndIf EndIf L250: If B=15 Then If ob[14]<>CP Then Goto L1250 Else TextWindow.WriteLine("Try frisking him.") Goto L40 EndIf ElseIf B=7 AND ob[5]<23 Then Goto L1230 EndIf L260: If B=7 Then TextWindow.WriteLine("The vial is in the shape of an octagonal, highly polished cone with a thick,") TextWindow.Write("glasslike shell containing a scintillating red liquid. The chain will easily fitaround your neck, but attempting this seems deadly.") Goto L120 EndIf L270: If B=8 Then If ob[6]<>CP Then Goto l1210 Else TextWindow.WriteLine("There is something big at the bottom of it.") Goto L120 EndIf EndIf L280: If B=5 OR B=6 Then Goto L390 ElseIf B=30 Then If ob[30]=CP Then Goto L1250 ElseIf ob[28]<>CP Then Goto L1210 Else TextWindow.WriteLine("Zap! You have just been turned to stone!!") Goto L1050 EndIf Else Goto L1250 EndIf L290: TextWindow.Write("You are currently holding the following:") Ass="Nothing at all" For X=1 To 37 If ob[X]<23 Then Goto L310 Else Ass="" EndIf If TextWindow.CursorLeft+Text.GetLength(OBss[X])>77 Then TextWindow.WriteLine("") EndIf TextWindow.Write( OBss[X]+". ") L310: EndFor TextWindow.Write( Ass) If WV Then TextWindow.Write("(You're wearing the vial)") Goto L120 EndIf L330: If ob[1]<23 Then TextWindow.WriteLine("You have nothing to dig with.") Goto L120 ElseIf CP=1 AND ob[35]=0 Then TextWindow.WriteLine("Crash!! You fall through the sand, and it piles back on top of you.") CP=3 Goto L40 EndIf L340: If CP=3 Then If WV=0 Then TextWindow.WriteLine("You don't have the strength to get back out.") Goto L120 Else TextWindow.WriteLine("ROWWWWR! With a surge of greath strength, you get back to the sand dune!!") CP=1 Goto L40 EndIf EndIf If CP=1 Then PLACE[CP][6]=3 CP=3 PLACE[CP][5]=1 TextWindow.WriteLine("You've made a tunnel right through the sand dune! That's Incredible!!") Goto L40 EndIf L360: TextWindow.WriteLine("You found nothing.") Goto L120 L370: If B=0 Then Goto L1240 ElseIf B<>3 Then Goto L450 ElseIf OB[2]<>CP Then Goto L1210 EndIf L380: TextWindow.Write("The portal dematerializes with a "+qss+"Whoosh!"+qss+". Evidently the pyramid was sealed in") TextWindow.Write("a vacuum. You scurry through the portal just before the outside materializes") TextWindow.WriteLine("again.") CP=4 Goto L40 L390: If B=0 Then Goto L1240 ElseIf B<>5 AND B<>6 AND B<>21 Then TextWindow.WriteLine("It can't be opened.") Goto L120 ElseIf B=5 OR B=6 Then If ob[4]<23 Then Goto L1230 ElseIf ob[5]>0 Then Goto L1250 Else TextWindow.WriteLine("It has a "+OBss[5]+" in it.") ob[5]=23 Goto L1060 EndIf EndIf L400: If ob[17]<>CP Then Goto L1210 Else TextWindow.Write("With what:") Ass=TextWindow.Read() If Ass<>"VIAL" Then TextWindow.WriteLine("Sorry, no go.") Goto L120 ElseIf ob[5]<23 Then Goto L1230 Else TextWindow.WriteLine("Creeeek!") ob[17]=0 PLACE[CP][3]=20 Goto L40 EndIf EndIf L410: If B=0 Then Goto L1240 ElseIf B<>7 Then TextWindow.WriteLine("You can't wear a "+Bss+".") Goto L120 ElseIf OB[5]<23 Then Goto L1230 Else TextWindow.WriteLine("Ok.") WV=1 Goto L120 EndIf L420: If B=0 Then Goto L1240 ElseIf B<>7 Then Goto L450 ElseIf OB[5]<23 Then Goto L1230 ElseIf OB[8]<>CP Then Goto L450 Else TextWindow.WriteLine("The clerk is now hypnotized.") ob[9]=CP ob[8]=0 Goto L40 EndIf L430: If B=0 Then Goto L1240 ElseIf B=45 Then Goto L1220 ElseIf B=47 Then TextWindow.WriteLine( "Sorry. That Adventure takes place:") TextWindow.Write( Qss+"A long time ago, in a galaxy far, far away...."+Qss) Goto L120 ElseIf B<>44 Then TextWindow.WriteLine("Nothing happens.") Goto L120 EndIf L440: If CP<5 OR CP=8 Then If ob[35]>0 Then TextWindow.WriteLine("That's already being done....") Goto L120 Else TextWindow.WriteLine("Sorry. There seems to be some Chaotic interference in this area.") Goto L120 EndIf EndIf L450: LAW=1 If ob[12]=CP Then TextWindow.WriteLine("The guard is off-guard!") ob[12]=0 ob[33]=CP Goto L40 ElseIf ob[24]=CP Then TextWindow.WriteLine("The gate attendant seems friendlier already!") Goto L120 Else TextWindow.WriteLine("Ok") Goto L120 EndIf L460: If B=0 Then Goto L1240 ElseIf B=8 Then If ob[6]<>CP Then Goto L1210 ElseIf ob[28]=CP Then TextWindow.WriteLine("Basilisk won't let you.") Goto L120 ElseIf LAW=0 Then TextWindow.WriteLine("You would drown! What do you think you are, a god?") Goto L120 Else CP=7 Goto L40 EndIf EndIf L470: If B=22 Then If ob[18]<>CP Then Goto L1210 Else CP=21 Goto L40 EndIf ElseIf B=26 OR B=27 Then If ob[25]<>CP AND ob[38]<>CP Then Goto L1210 Else TextWindow.WriteLine("Ok. You fly through the air, and land somewhere else.") EndIf If CP=13 Then CP=12 Goto L40 Else CP=13 Goto L40 EndIf EndIf L480: If B=28 Then If ob[26]<>CP AND ob[39]<>CP Then Goto L1210 Else TextWindow.WriteLine("Ok. You ride for a while, then get off somewhere else.") EndIf EndIf If CP=14 Then CP=15 Goto L40 Else CP=14 Goto L40 EndIf L490: If B>34 AND B<41 Then D=B-34 Goto L1020 Else TextWindow.WriteLine("You can't go to a "+Bss+".") Goto L120 EndIf L500: If B=0 Then Goto L1240 ElseIf B<>23 Then TextWindow.WriteLine("It didn't stick.") Goto L120 ElseIf ob[20]=CP Then TextWindow.WriteLine("Are you crazy? One bite and you're dead!") Goto L120 ElseIf ob[19]<>CP Then Goto L1210 Else TextWindow.Write("Into where (one word)") Ass=TextWindow.Read() Ass=Text.GetSubText(Ass,1 4) EndIf If Ass<>"CONT" Then TextWindow.WriteLine("Sorry, no go.") Goto L120 ElseIf ob[5]<23 Then Goto L1230 Else TextWindow.WriteLine("Squirtt! The container fills with venom, and just as quickly, the cobra awakes!") ob[3]=0 ob[21]=23 ob[19]=0 ob[20]=CP Goto L40 EndIf L520: If B=0 Then Goto L1240 ElseIf B=9 OR B=42 Then TextWindow.WriteLine("Be more specific.") Goto L120 ElseIf ob[10]<23 Then TextWindow.WriteLine("You have nothing to kill with!") Goto L120 ElseIf B=30 Then TextWindow.WriteLine("Sorry -- too tough!") Goto L120 EndIf L530: If B<>23 Then TextWindow.WriteLine("I cannot allow you to do that, Frodo.") Goto L120 ElseIf ob[19]=CP Then TextWindow.WriteLine("The venom needs to be from a live cobra to work. If you were to kill this one, it would be useless.") Goto L120 ElseIf ob[20]<>CP Then Goto L1210 EndIf L540: If LAW=0 Then TextWindow.WriteLine("The cobra withstands your blows!") Goto L120 Else TextWindow.WriteLine("Sparrrk! The cobra vanishes in a cloud of electrical smoke!!") ob[20]=0 Goto L40 EndIf L550: If B=39 Then TextWindow.WriteLine("Barf!") Goto L120 ElseIf B=16 Then If ob[33]<>CP Then Goto L990 ElseIf ob[13]<23 Then Goto L1230 Else TextWindow.WriteLine("The pill lands in the guard's Thermos, he drinks, and promptly falls asleep.") ob[33]=0 ob[14]=CP ob[13]=0 Goto L40 EndIf EndIf L560: If B=11 OR B=12 Then If ob[10]<23 Then Goto L1230 ElseIf ob[7]<>CP Then TextWindow.WriteLine("Ok") ob[10]=CP Goto L120 Else TextWindow.WriteLine("Arrg! The dagger lodges into the octopus, and allows you to escape north!") ob[10]=0 CP=1 Goto L1080 EndIf EndIf L570: If B<>2 Then Goto L990 ElseIf ob[2]<23 Then Goto L1230 ElseIf CP>1 OR ob[35]=0 Then TextWindow.WriteLine("Ok") ob[2]=CP Goto L120 EndIf L580: TextWindow.WriteLine("Whump! Chaos is down! Law wins the fight, and says:") TextWindow.WriteLine( Qss+"Make the mixture here!"+qss+" P.S.Why not look at the debris of the pyramid?") ob[2]=0 ob[31]=8 ob[35]=0 ob[40]=8 Goto L120 L590: If B=0 Then Goto L1240 ElseIf B<>15 Then TextWindow.WriteLine("Sorry, no can do.") Goto L120 ElseIf ob[33]=CP OR ob[12]=CP Then TextWindow.WriteLine("Guard won't let you.") Goto L120 ElseIf ob[14]<>CP Then Goto L1210 Else TextWindow.WriteLine("A "+OBss[15]+" fell out.") ob[15]=CP Goto L40 EndIf L600: If B=0 Then Goto L1240 ElseIf B<>29 Then TextWindow.WriteLine("Unshowable.") Goto L120 ElseIf ob[27]<23 Then Goto L1230 ElseIf ob[28]<>CP Then Goto L450 EndIf L610: TextWindow.WriteLine("Zap! The "+qss+"mirror"+qss+" has just transformed the basilisk to stone via its own gaze!") ob[28]=0 ob[30]=CP Goto L40 L620: If ob[22]<23 Then TextWindow.WriteLine("You have nothing to suck with.") Goto L120 ElseIf ob[34]<>CP Then TextWindow.WriteLine("There is nothing here to suck.") Goto L120 Else TextWindow.WriteLine("Whooosh! The octopus woke up!!") ob[22]=0 ob[23]=23 ob[34]=0 ob[7]=CP Goto L40 EndIf L630: TextWindow.Write("Not YET!!!") Goto L120 L640: If ob[32]<>CP AND ob[32]<>23 Then Goto L1260 EndIf L650: TextWindow.Write("In a soundless concussion of darkness, you find yourself on the far side of the mountain! The victory is yours -- and the galaxy's.") Goto L1050 L660: If B=0 Then Goto L1240 ElseIf B<>34 Then TextWindow.Write("Huh?") Goto L120 Else Goto L640 EndIf L670: If ob[28]<>CP Then Goto L1260 ElseIf ob[29]>0 Then TextWindow.Write("Already been done.") Goto L120 Else TextWindow.Write("Pook! One of its eyes pops out in your hand, but instantly grows back!") TextWindow.Write("It's mad, now!!") ob[29]=23 Goto L120 EndIf L680: If ob[15]<23 Then TextWindow.Write("You have nothing to "+Ass+" with.") Goto L120 ElseIf B<>0 AND B<>15 Then TextWindow.Write("That wouldn't do any good anyway.") Goto L120 ElseIf ob[12]<>CP Then TextWindow.Write("How?") Goto L120 EndIf L690: TextWindow.Write("He says, "+qss+"Thanks!"+qss+", goes into the store, and gives you a fire opal. He") TextWindow.Write("promptly "+qss+"forgets"+qss+" you and goes back on duty.") ob[15]=0 ob[16]=23 Goto L40 L700: If ob[35]=1 Then TextWindow.Write("Hit Chaos with something.") Goto L120 ElseIf ob[8]=CP Then TextWindow.Write("Try hypnotizing him.") Goto L120 ElseIf CP=1 AND ob[1]=2 Then TextWindow.Write("Go west.") Goto L120 EndIf L710: If CP<5 OR ob[5]=0 Then TextWindow.Write("Sorry, I can't.") Goto L120 EndIf L720: TextWindow.Write("If you find that you're in trouble, why not use the power of Law to your") TextWindow.Write("advantage? After all, Law is on your side!") Goto L120 L730: TextWindow.Write("Coward!") Goto L1050 L740: If B=0 Then Goto L1240 ElseIf B<>10 Then TextWindow.Write("You can't.") Goto L120 Else TextWindow.Write("Be more specific as to how.") Goto L120 EndIf L750: If B=0 Then Goto L1240 ElseIf B=46 Then Goto L290 ElseIf B=3 OR B>7 AND B<11 OR B=15 OR B>20 AND B<24 OR B>24 AND B<29 OR B=30 OR B=41 OR B=42 OR B>43 Then TextWindow.Write("It's beyond your power to do that.") Goto L120 EndIf L760: If B>34 AND B<40 Then TextWindow.Write("I don't get it.") Goto L120 ElseIf B=40 Then TextWindow.Write("...and boogie!") Goto L120 Else NA=CP EndIf NB=23 Y=0 For X=1 To 32 If ob[X]=23 Then Y=Y+1 EndIf EndFor If ob[37]=23 Then Y=Y+1 EndIf If Y>6 Then TextWindow.Write("You are currently holding too much. Try: TAKE INVENTORY") Goto L120 Else Goto L800 EndIf L790: If NA=CP Then Goto L1210 Else Goto L1230 EndIf L800: If ob[8]=CP AND B>10 AND B<17 Then TextWindow.Write("The clerk says you'll have to pay cash.") Goto L120 EndIf L810: '?ON B Goto 820,830, ,850,860,860,870, , , ,880,880,890,890, ,900,910,910,920,920, , , ,930, , , , ,940, ,950,960,970,970 If b=1 Then Goto L820 ElseIf b=2 Then Goto L830 ElseIf b=4 Then Goto L850 ElseIf b=5 or b=6 Then Goto L860 ElseIf b=7 Then Goto L870 ElseIf b=11 or b=12 Then Goto L880 ElseIf b=13 or b=14 Then Goto L890 ElseIf b=16 Then Goto L900 ElseIf b=17 or b=18 Then Goto L910 ElseIf b=19 or b=20 Then Goto L920 ElseIf b=24 Then Goto L930 ElseIf b=29 Then Goto L940 ElseIf b=31 Then Goto L950 ElseIf b=32 Then Goto L960 ElseIf b=33 or b=34 Then Goto L970 EndIf Goto L980 L820: If ob[1]<>NA Then Goto L790 Else TextWindow.Write("Ok") ob[1]=NB Goto L40 EndIf L830: If ob[2]<>NA Then Goto L790 ElseIf ob[35]>0 Then ob[2]=NB If NA=CP Then TextWindow.Write("With a great warring strength, you lift the pyramid!") Goto L40 Else TextWindow.Write("Ok") Goto L40 EndIf ElseIf WV=1 Then TextWindow.Write("Your Chaotic strength can budge it, but not lift it.") Goto L120 EndIf L840: TextWindow.Write("Too big!") Goto L120 L850: If ob[3]=NA Then TextWindow.Write("Ok") ob[3]=NB Goto L40 ElseIf ob[21]<>NA Then Goto L790 Else TextWindow.Write("Ok") ob[21]=NB Goto L1100 EndIf L860: If ob[4]<>NA Then Goto L790 Else TextWindow.Write("Ok") ob[4]=NB EndIf If ob[36]<>4 AND ob[37]<>4 Then TextWindow.Write("A mummy has come to life!") ob[36]=CP Goto L40 Else Goto L40 EndIf L870: If ob[5]<>NA Then Goto L790 Else TextWindow.Write("Ok") ob[5]="NF WV=0 EndIf If CP=1 AND NB=CP AND GLOW Then Goto L1140 Else Goto L40 EndIf L880: If ob[10]<>NA Then Goto L790 Else TextWindow.Write("Ok") ob[10]=NB Goto L40 EndIf L890: If ob[11]<>NA Then Goto L790 Else TextWindow.Write("Ok") ob[11]=NB Goto L1100 EndIf L900: If ob[13]<>NA Then Goto L790 Else TextWindow.Write("Ok") ob[13]=NB Goto L40 EndIf L910: If ob[15]<>NA Then Goto L790 Else TextWindow.Write("Ok") ob[15]=NB If ob[14]=CP Then Goto L1090 Else Goto L40 EndIf EndIf L920: If ob[16]<>NA Then Goto L790 Else TextWindow.Write("Ok") ob[16]=NB Goto L1100 EndIf L930: If ob[22]=NA Then TextWindow.Write("Ok") ob[22]=NB Goto L40 ElseIf ob[23]<>NA Then Goto L790 Else TextWindow.Write("Ok") ob[23]=NB Goto L1100 EndIf L940: If ob[27]<>NA Then Goto L790 Else TextWindow.Write("Ok") ob[27]=NB Goto L40 EndIf L950: If ob[29]<>NA Then Goto L790 Else TextWindow.Write("Ok") ob[29]=NB Goto L1100 EndIf L960: If ob[31]<>NA Then Goto L790 Else TextWindow.Write("Ok") ob[31]=NB Goto L1100 EndIf L970: If ob[32]<>NA Then Goto L790 Else TextWindow.Write("Ok") ob[32]=NB Goto L40 EndIf L980: If ob[37]<>NA Then Goto L790 Else TextWindow.Write("Ok") ob[37]=NB Goto L40 EndIf L990: If B=0 Then Goto L1240 ElseIf B=3 OR B>7 AND B<11 OR B=15 OR B>20 AND B<>24 AND B<29 OR B=30 OR B>30 AND B<41 OR B>43 Then Goto L1230 Else NA=23 NB=CP Goto L810 EndIf L1000: If B=0 Then Goto L1240 ElseIf B<>7 OR WV=0 Then TextWindow.Write("You're not wearing it.") Goto L120 Else TextWindow.Write("Ok") WV=0 Goto L120 EndIf L1010: If B=0 Then Program.End() ElseIf B<>7 Then TextWindow.Write("There's no reason to go around breaking "+Bss+"S.") Goto L120 Else TextWindow.Write("Sorry, the vial of Chaos is indestructable.") Goto L120 EndIf L1020: If PLACE[CP][D]=0 Then TextWindow.Write("There is no way to go in that direction.") Goto L120 ElseIf ob[7]=CP Then TextWindow.Write("The octopus has you in a tight bind with its tentacles!") Goto L120 EndIf L1030: If D=2 AND CP=11 AND LAW=0 Then TextWindow.Write("The gate attendant won't let you through without a ticket.") Goto L120 ElseIf ob[20]=CP Then TextWindow.Write("The cobra won't let you leave!") Goto L120 ElseIf ob[36]=CP Then TextWindow.Write("The mummy won't let you leave!") Goto L120 EndIf L1040: LAW=0 If CP=4 Then CP=ob[2] Goto L40 Else CP=PLACE[CP][D] Goto L40 EndIf L1050: TextWindow.WriteLine("=========The adventure has ended.===========") Program.Delay(5555) Program.End() L1060: TextWindow.Write(" Suddenly, the spirit of "+qss+"Law"+qss+" appears, and says:") TextWindow.Write("The vial is controlled by "+qss+"Chaos,"+qss+" the bad guy. To destroy the vial (although") TextWindow.Write("it may give you a little strength to escape), you must get the following") TextWindow.WriteLine("ingredients: ") TextWindow.Write(" Turquois gem, fire opal, cobra venom, basilisk eye, and octopus ink. Combine these by an alabaster bowl, then put the vial in, and *RUN*!!") Goto L120 L1080: TextWindow.Write(" Suddenly, Law and Chaos appear to the west and east respectively in the formsof giants. They start battling it out with lightning, but quickly reach a stale-mate. In the confusion, Law gives you great strength.") ob[35]=1 Goto L40 L1090: TextWindow.WriteLine("The guard instantly wakes up, and says he'll give you anything if you ") TextWindow.WriteLine("(1) -- don't tell his boss he was sleeping on the job, and") TextWindow.WriteLine("(2) -- bribe him.") ob[14]=0 ob[12]=CP Goto L40 L1100: If NB=23 Then GLOW=0 Goto L40 EndIf L1110: If ob[11]=1 AND ob[16]=1 AND ob[21]=1 AND ob[23]=1 AND ob[29]=1 AND ob[31]=1 Then TextWindow.Write("The mixture has begun to glow deep red.") GLOW=1 Goto L40 EndIf L1130: TextWindow.Write("****** B O O M ! ! ! ******") TextWindow.Write("Your efforts weren't in vain, but you failed to save your own life! You're dead!") Goto L1050 L1140: ob[5]=CP TextWindow.Write("The vial vibrates, getting ready to explode. Oh, by the way --") TextWindow.WriteLine("** YET ** !!") TextWindow.Write("---> ") Ass=TextWindow.Read() Ass=Text.GetSubText(Ass,1 3) If Ass<>"RUN" Then Goto L1130 EndIf L1150: CP=18 TextWindow.Write("The vial goes off in a red, Chaotic mushroom cloud.") TextWindow.Write("You have only six (6) seconds until the fireball reaches you!") TR=6 Goto L40 L1160: 'OPEN "O",1,"VIAL.DAT") For X=1 To 40 ' TextWindow.Write(#1,ob[X) EndFor 'TextWindow.Write(#1,WV,LAW,PLACE(10,3),CP,TR,GLOW 'CLOSE TextWindow.Write("Ok") Goto L120 L1170: 'OPEN "I",1,"VIAL.DAT") For X=1 To 40 ' INPUT #1,ob[X) EndFor 'INPUT #1,WV,LAW,PLACE(10,3),CP,TR,GLOW 'CLOSE Goto L40 L1180: If B=0 Then Goto L1240 ElseIf B<>41 AND B<>3 Then TextWindow.Write("There is nothing written on a "+Bss+".") Goto L120 ElseIf ob[2]<>CP AND ob[2]<>23 Then Goto L1210 Else TextWindow.Write("It translates into, "+qss+"Touch and go."+Qss) Goto L120 EndIf L1190: If B=0 Then Goto L1240 ElseIf B=45 Then TextWindow.Write("You can't hit Chaos directly. Try another approach.") Goto L120 ElseIf B<>42 OR WV=0 Then TextWindow.Write("Nothing happens.") Goto L120 EndIf L1200: If ob[36]=CP Then TextWindow.Write("Baam! You made it fly apart!") ob[36]=0 ob[37]=CP Goto L40 EndIf L1210: TextWindow.Write("You don't see it here.") Goto L120 L1220: TextWindow.Write("The powers of the vial have taken over your body! You're posessed by Chaos!!!") Goto L1050 L1230: TextWindow.Write("You don't have it.") Goto L120 l1240: TextWindow.Write( Ass+" what?") Goto L120 l1250: TextWindow.Write("You see nothing special.") Goto L120 l1260: TextWindow.Write("You can't do that...yet!") Goto L120 Sub data dat="north,south,east,west,up,down, dat=dat+"*You're on a sand dune, , ,8,2, , , dat=dat+"a desert, , ,1, , , , dat=dat+"*You're at the bottom of a sandy hole, , , , , , , dat=dat+"a tomb chamber, , , ,3, , , dat=dat+"the city,6, ,9,8, , , dat=dat+"a pawn shop, ,5, , , , , dat=dat+"a mysterious inky lake,1,17, , , , , dat=dat+"*You're on top of a mountain, , ,5,1, , , dat=dat+"front of a jewelry store, ,10, ,5, , , dat=dat+"*You're at the foot of a large zoo gateway,9,11, , , , , dat=dat+"the entrance to an airport,10,12, , , , , dat=dat+"an airport,11, , , , , , dat=dat+"an airport,14, , , , , , dat=dat+"a bus terminal,13, , , , , , dat=dat+"a bus terminal,16, , , , , , dat=dat+"a forest,17,15, , , , , dat=dat+"a forest, ,16, , , , , dat=dat+"*You're on the side of a mountain, , , , ,19, , dat=dat+"*You're on the side of a mountain, , , , ,19,18, dat=dat+"a zoo, , , ,10, , , dat=dat+"the cobra's cage, , , , ,20, , dat=dat+"Shovel,2,Pyramid with a stone portal,3,Tiny plastic container,4,Lead box,4,Twinkling vial with thin chain attached, ,Mysterious-looking lake,1,>Deadly giant octopus<, ,Store clerk,6,Hypnotized clerk, ,Large dagger,6,Turquois gem,6, dat=dat+"Guard with a Thermos of coffee,9,Sleeping pill,6,Sleeping guard, ,Wad of money, ,Fire opal, ,Closed zoo gate,10,Cobra's cage,20,Sleeping cobra,21,>Deadly cobra<, ,Container full of venom, ,Empty liquid sucker,11, dat=dat+"Sucker full of octopus ink, ,Gate attendant,11,Big airplane,12,Large bus,14,Flat'reflective stone,16,Basilisk,17,Basilisk eye, ,Stone basilisk, ,Bowl made of alabaster, ,Wishing rock,18,Distracted guard, , dat=dat+"Sleeping giant octopus,7,Law and Chaos are still in battle, ,Animated mummy, ,Unwound ace bandages, ,Big airplane,13,Large bus,15,Pyramid rubble, VERBss=LDText.Split("NORT,N,SOUT,S,EAST,E,WEST,W,UP,U,DOWN,D,GET,TAKE,.,DROP,PUT,LOOK,L,INVE,I,DIG,TOUC,FEEL,OPEN,WEAR,WAVE,USE,GO,STIC,KILL,THRO,FRIS,SEAR,SHOW,EXAM,SUCK,RUN,WISH,MAKE,PLUC,PAY,HELP,QUIT,BRIB,SWIN,REMO,SAVE,LOAD,READ,HIT,PUNC,P,BREA,HYPN" ",") NOUNss=LDText.Split("SHOV,PYRA,PORT,CONT,LEAD,BOX,VIAL,LAKE,OCTO,CLER,DAGG,KNIF,TURQ,GEM,GUAR,PILL,WAD,MONE,FIRE,OPAL,GATE,CAGE,COBR,SUCK,ATTE,AIRP,PLAN,BUS,STON,BASI,EYE,BOWL,ROCK,WISH,NORT,SOUT,EAST,WEST,UP,DOWN,INSC,MUMM,BAND,LAW,CHAO,INVE,FORC,RUBB" ",") dtt=LDText.Split(dat ",") EndSub End>LBZ128.sb< Start>LCC411.sb< GraphicsWindow.BackgroundColor = "DarkBlue" TextThing = Shapes.AddText(0) Ball = Shapes.AddEllipse(16, 16) GraphicsWindow.MouseMove = OnMouseMove Sub OnMouseMove Shapes.SetText(TextThing, "X=" + (GraphicsWindow.MouseX) + " Y=" + (GraphicsWindow.MouseY)) Shapes.Move(Ball, GraphicsWindow.MouseX - 8 , GraphicsWindow.MouseY - 8) EndSub End>LCC411.sb< Start>LCC976.sb< dw=800 dh=dw GraphicsWindow.Height =dw GraphicsWindow.Title ="Roman Amphitheatre Model view3D = LD3DView.AddView(dw,dh,"True") GraphicsWindow.BackgroundColor ="darkblue LD3DView.AddAmbientLight (view3D "#50777777") LD3DView.AddDirectionalLight(view3D,"white",-1,-1,-1) ff="e:\sttn.jpg 'icc=ld3dview.AddIcosahedron(view3D 1 "#99ffffee" "D") zf=1.4 For z=0 to 2 For x=0 To 360 Step 6.67 cb= LD3DView.AddCone (view3D .1 .1 1 20 "red" "D") LD3DView.AddImage(view3D,cb,"",ff,"D") xx= LDMath.Cos(x)*5 yy= LDMath.sin(x)*3.5 LD3DView.TranslateGeometry (view3D cb xx z*zf yy) cc= LD3DView.AddCube (view3D .2 "green" "D") LD3DView.AddImage(view3D,cc,"",ff,"D") LD3DView.TranslateGeometry (view3D cc xx 1.1+z*zf yy) LD3DView.RotateGeometry2 (view3D cc 0 1 0, -x) EndFor For x=0 To 360 Step 6.67/3 xx= LDMath.Cos(x)*5 yy= LDMath.sin(x)*3.5 cc= LD3DView.AddCube (view3D .2 "green" "D") LD3DView.AddImage(view3D,cc,"",ff,"D") LD3DView.TranslateGeometry (view3D cc xx 1.3+z*zf yy) LD3DView.RotateGeometry2 (view3D cc 0 1 0, -x-.1) EndFor endfor 'LD3DView.AutoControl ("true" "true" ,-1 .3) LDEvents .MouseWheel =mww ww=15 yy=15 f50=50 Sub mww If FCKeyboard.IsControlPressed Then f50=f50- LDEvents.LastMouseWheelDelta*2 ElseIf FCKeyboard.IsShiftPressed then yy=yy+LDEvents.LastMouseWheelDelta*.2 elseif FCKeyboard.IsAltPressed then dd=dd+LDEvents.LastMouseWheelDelta*2 else ww=ww+LDEvents.LastMouseWheelDelta*5 EndIf w1=ldmath.Sin (ww) w2=ldmath.cos (ww) LD3DView.ResetCamera(view3D,w1*f50+dd, yy ,w2*f50+dd, -w1*5, 0, -w2*5, "","","") EndSub While "true i=i+1 ' LD3DView.RotateGeometry2 (view3D,icc 1 1 1 i) Program.Delay (6) endwhile End>LCC976.sb< Start>LCG789.sb< site = Network.GetWebPageContents("http://www.smallbasic.com") firstElement = "

" lastElement = "

" start = Text.GetIndexOf(site,firstElement) start = (start + Text.GetLength(firstElement)) finish = Text.GetIndexOf(site,lastElement) length = finish - start textWindow.WriteLine(Text.GetSubText(site,start, length)) End>LCG789.sb< Start>LCH657.sb< ' mahreen miangul Geometric Figures ' Animation SeptEmber 2017 GraphicsWindow.backgroundcolor = GraphicsWindow.GetRandomColor()'"mediumslateblue"'"darkslategray" GraphicsWindow.width = 1111 GraphicsWindow.height = 555 GraphicsWindow.penwidth = 4 GraphicsWindow.penColor = "mediumslateblue" GraphicsWindow.BrushColor = "darkslategray" rotateshapeT = Shapes.Addtriangle(20, 550, 140, 420, 260, 550) GraphicsWindow.penColor = "darkslategray" GraphicsWindow.BrushColor = "mediumslateblue" rotateshapeE = Shapes.AddRectangle(200, 130) Shapes.Move(rotateshapeE, 880, 420) ' Ellipses Drawing GraphicsWindow.PenColor = "darkcyan" GraphicsWindow.BrushColor = "powderblue" ellipse1 = Shapes.Addellipse(100, 100) Shapes.Move(ellipse1, 200, 60) ellipse2 = Shapes.Addellipse(60, 60) Shapes.Move(ellipse2, 312, 80) ellipse3 = Shapes.Addellipse(40, 40) Shapes.Move(ellipse3, 378, 60) ellipse4 = Shapes.Addellipse(30, 30) Shapes.Move(ellipse4, 420, 94) ellipse5 = Shapes.Addellipse(20, 20) Shapes.Move(ellipse5, 445, 130) GraphicsWindow.PenColor = "chocolate" GraphicsWindow.BrushColor = "sandybrown" ellipse6 = Shapes.Addellipse(180, 50) Shapes.Move(ellipse6, 180, 330) ellipse7 = Shapes.Addellipse(100, 30) Shapes.Move(ellipse7, 240, 180) GraphicsWindow.penColor = "darkgreen" GraphicsWindow.brushColor = "palegreen" ellipse8 = Shapes.Addellipse(30, 60) Shapes.Move(ellipse8, 200, 200) ellipse9 = Shapes.Addellipse(60, 30) Shapes.Move(ellipse9, 210, 280) ellipse10 = Shapes.Addellipse(45, 80) Shapes.Move(ellipse10, 280, 230) ellipse11 = Shapes.Addellipse(70, 120) Shapes.Move(ellipse11, 340, 210) GraphicsWindow.penColor = "crimson" GraphicsWindow.brushColor = "hotpink" ellipse12 = Shapes.Addellipse(20, 20) Shapes.Move(ellipse12, 350, 380) ellipse13 = Shapes.Addellipse(60, 70) Shapes.Move(ellipse13, 420, 270) ' Triangles Drawing GraphicsWindow.penColor = "maroon" GraphicsWindow.BrushColor = "rosybrown" triangle1 = Shapes.Addtriangle(500, 60, 500, 130, 540, 60) Shapes.Move(triangle1, 0, 0) GraphicsWindow.penColor = "darkkhaki" GraphicsWindow.BrushColor = "yellow" triangle2 = Shapes.Addtriangle(530, 160, 560, 80, 650, 150) Shapes.Move(triangle2, 0, 0) triangle3 = Shapes.Addtriangle(595, 90, 610, 50, 650, 85) Shapes.Move(triangle3, 0, 0) triangle4 = Shapes.Addtriangle(660, 140, 700, 80, 740, 150) Shapes.Move(triangle4, 0, 0) triangle5 = Shapes.Addtriangle(555, 210, 620, 170, 600, 245) Shapes.Move(triangle5, 0, 0) GraphicsWindow.penColor = "blue" GraphicsWindow.brushColor = "dodgerblue" triangle6 = Shapes.Addtriangle(640, 220, 700, 170, 710, 250) Shapes.Move(triangle6, 0, 0) triangle7 = Shapes.Addtriangle(430, 180, 450, 200, 460, 175) Shapes.Move(triangle7, 0, 0) GraphicsWindow.penColor = "crimson" GraphicsWindow.brushColor = "lightsalmon" triangle8 = Shapes.Addtriangle(480, 200, 490, 220, 540, 185) Shapes.Move(triangle8, 0, 0) ' Ellipses Animation For i = 1 To 4 Program.Delay(1000) Shapes.Zoom(ellipse1, i * 0.4, i * 0.4) Shapes.SetOpacity(ellipse1, i * 5) Endfor For i = 1 To 4 Program.Delay(1000) Shapes.Zoom(ellipse2, i * 0.4, i * 0.4) Shapes.SetOpacity(ellipse2, i * 5) Endfor For i = 1 To 4 Program.Delay(1000) Shapes.Zoom(ellipse3, i * 0.4, i * 0.4) Shapes.SetOpacity(ellipse3, i * 5) Endfor For i = 1 To 4 Program.Delay(1000) Shapes.Zoom(ellipse4, i * 0.4, i * 0.4) Shapes.SetOpacity(ellipse4, i * 5) Endfor For i = 1 To 4 Program.Delay(1000) Shapes.Zoom(ellipse5, i * 0.4, i * 0.4) Shapes.SetOpacity(ellipse5, i * 5) Endfor For i = 1 To 4 Program.Delay(1000) Shapes.Zoom(ellipse6, i * 0.4, i * 0.4) Shapes.SetOpacity(ellipse6, i * 5) EndFor For i = 1 To 4 Program.Delay(1000) Shapes.Zoom(ellipse7, i * 0.4, i * 0.4) Shapes.SetOpacity(ellipse7, i * 5) EndFor For i = 1 To 4 Program.Delay(1000) Shapes.Zoom(ellipse8, i * 0.4, i * 0.4) Shapes.SetOpacity(ellipse8, i * 5) EndFor For i = 1 To 4 Program.Delay(1000) Shapes.Zoom(ellipse9, i * 0.4, i * 0.4) Shapes.SetOpacity(ellipse9, i * 5) EndFor For i = 1 To 4 Program.Delay(1000) Shapes.Zoom(ellipse10, i * 0.4, i * 0.4) Shapes.SetOpacity(ellipse10, i * 5) EndFor For i = 1 To 4 Program.Delay(1000) Shapes.Zoom(ellipse11, i * 0.4, i * 0.4) Shapes.SetOpacity(ellipse11, i * 5) EndFor For i = 1 To 4 Program.Delay(1000) Shapes.Zoom(ellipse12, i * 0.4, i * 0.4) Shapes.SetOpacity(ellipse12, i * 5) EndFor For i = 1 To 4 Program.Delay(1000) Shapes.Zoom(ellipse13, i * 0.4, i * 0.4) Shapes.SetOpacity(ellipse13, i * 5) EndFor ' Triangles Animation For i = 1 To 4 Program.Delay(1000) Shapes.Zoom(triangle1, i * 0.4, i * 0.4) Shapes.SetOpacity(triangle1, i * 5) EndFor For i = 1 To 4 Program.Delay(1000) Shapes.Zoom(triangle2, i * 0.4, i * 0.4) Shapes.SetOpacity(triangle2, i * 5) EndFor For i = 1 To 4 Program.Delay(1000) Shapes.Zoom(triangle3, i * 0.4, i * 0.4) Shapes.SetOpacity(triangle3, i * 5) EndFor For i = 1 To 4 Program.Delay(1000) Shapes.Zoom(triangle4, i * 0.4, i * 0.4) Shapes.SetOpacity(triangle4, i * 5) EndFor For i = 1 To 4 Program.Delay(1000) Shapes.Zoom(triangle5, i * 0.4, i * 0.4) Shapes.SetOpacity(triangle5, i * 5) EndFor For i = 1 To 4 Program.Delay(1000) Shapes.Zoom(triangle6, i * 0.4, i * 0.4) Shapes.SetOpacity(triangle6, i * 5) EndFor For i = 1 To 4 Program.Delay(1000) Shapes.Zoom(triangle7, i * 0.4, i * 0.4) Shapes.SetOpacity(triangle7, i * 5) EndFor For i = 1 To 4 Program.Delay(1000) Shapes.Zoom(triangle8, i * 0.4, i * 0.4) Shapes.SetOpacity(triangle8, i * 5) EndFor ' Rectangles Add Rotate GraphicsWindow.Title = "Exploring Shapes" 'GraphicsWindow.penwidth = 4 GraphicsWindow.penColor = "darkgreen" GraphicsWindow.BrushColor = "deepskyblue" rotateshape1 = Shapes.AddRectangle(35, 35) Shapes.Move(rotateshape1, 420, 370) rotateshape2 = Shapes.AddRectangle(35, 35) Shapes.Move(rotateshape2, 540, 310) rotateshape3 = Shapes.AddRectangle(50, 50) Shapes.Move(rotateshape3, 660, 280) GraphicsWindow.penColor = "firebrick" GraphicsWindow.BrushColor = "violet" rotateshape4 = Shapes.AddRectangle(70, 30) Shapes.Move(rotateshape4, 550, 380) rotateshape5 = Shapes.AddRectangle(70, 30) Shapes.Move(rotateshape5, 500, 260) GraphicsWindow.penColor = "mediumslateblue" GraphicsWindow.BrushColor = "Tan" rotateshape6 = Shapes.AddRectangle(25, 60) Shapes.Move(rotateshape6, 500, 350) GraphicsWindow.penColor = "DarkSlateGray" GraphicsWindow.BrushColor = "DarkGray" rotateshape7 = Shapes.AddRectangle(80, 25) Shapes.Move(rotateshape7, 600, 343) ' Rectangles Rotation For i = 0 To 12 Shapes.Rotate(rotateshape1, 30 * i) Program.Delay(1000) 'EndFor 'For i = 0 To 12 Shapes.Rotate(rotateshape2, 30 * i) Program.Delay(1000) 'EndFor 'For i = 0 To 12 Shapes.Rotate(rotateshape3, 30 * i) Program.Delay(1000) 'EndFor 'For i = 0 To 12 Shapes.Rotate(rotateshape4, 30 * i) Program.Delay(1000) 'EndFor 'For i = 0 To 12 Shapes.Rotate(rotateshape5, 30 * i) Program.Delay(1000) 'EndFor 'For i = 0 To 12 Shapes.Rotate(rotateshape6, 30 * i) Program.Delay(1000) 'For i = 0 To 12 Shapes.Rotate(rotateshape7, 30 * i) Program.Delay(1000) 'EndFor 'EndFor endfor End>LCH657.sb< Start>LCM180-1.sb< 'Address List LCM180-1 by NaochanON GUI() Controls.ButtonClicked=OnClicked Sub OnClicked Cap= Controls.GetButtonCaption(Controls.LastClickedButton) If Cap= "Enter" Then NUMBER=Controls.GetTextBoxText(TBOX[1]) ' get Number Rawdata="" For i=2 To 4 cust[Number][MSG[i]]=Controls.GetTextBoxText(TBOX[i]) ' data is stored here Rawdata=Rawdata+MSG[i]+"= "+cust[Number][MSG[i]]+CRLF ' connect data Controls.SetTextBoxText(TBOX[i],"") ' erase each data EndFor Rawdata="Number= "+Number+CRLF+Rawdata LST=LST+Rawdata+CRLF ' List up data Shapes.SetText(Showdata,Rawdata) ' show last data Controls.SetTextBoxText(TBOX[1],"") ' erase data ' The following line could be harmful and has been automatically commented. ' File.WriteContents(path,LST) ' save data ElseIf Cap= "Confirm" then ' The following line could be harmful and has been automatically commented. ' LST=File.ReadContents(path) ' load last data Controls.SetTextBoxText(MBOX,LST) ' recall all data elseif Cap= "Resave" then LST= Controls.GetTextBoxText(MBOX) ' recall all data ' The following line could be harmful and has been automatically commented. ' File.WriteContents(path,LST) ' save data EndIf EndSub Sub GUI GraphicsWindow.Width=930 GraphicsWindow.Height=600 GraphicsWindow.BackgroundColor="Darkgreen" GraphicsWindow.BrushColor="Red" GraphicsWindow.FontSize=20 MSG="1=Number;2=Name;3=Phone;4=Email" For i=1 to 4 GraphicsWindow.BrushColor="Yellow" GraphicsWindow.DrawText(15,5+60*i,MSG[i]) GraphicsWindow.BrushColor="Navy" TBOX[i]= Controls.AddTextBox(150,60*i) ' make text boxes Controls.SetSize(TBOX[i],300,45) EndFor Controls.SetSize(TBOX[1],50,45) Controls.AddButton("Enter",250,60) ' Enter button MBOX= Controls.AddMultiLineTextBox(500,60) ' MultiLineTextBox for recalled data Controls.SetSize(MBOX,400,500) Controls.AddButton("Confirm",550,10) ' Recall button CRLF= Text.GetCharacter(13)+Text.GetCharacter(10) ' carriage return & line feed Controls.AddButton("Resave",700,10) ' Resave button GraphicsWindow.BrushColor="Yellow" Showdata= Shapes.AddText("Here data is shown ") ' shape text Shapes.Move(Showdata,100,350) Path= Program.Directory+"\address.txt" ' file path ' The following line could be harmful and has been automatically commented. ' LST=File.ReadContents(path) ' load last data Controls.SetTextBoxText(MBOX,LST) ' recall all data EndSub End>LCM180-1.sb< Start>LCN897-0.sb< '============================================================================== 'Simple Flappy Birds game - mainly just the game-engine, no levels basic graphics, sound etc 'Uses LitDev extension for web high score - easily commented out or altered to store in a local file etc 'By LitDev 2014 '============================================================================== 'Customisations gravity = 0.1 'Gravity down (0.1 to 0.3) flapPower = 3 '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() While "True" 'Repeat game Initialise() '============================================================================== 'GAME LOOP '============================================================================== While (playing) start = Clock.ElapsedMilliseconds 'Gradually increase speed to make it challenging 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 'Max speed 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 'Move bird Shapes.Move(bird,birdX-birdRadius,birdY-birdRadius) 'Move tube barriers and check for collision (end of game) - also update score for each barrier passed 'passing is true while overlapping barrier - once past barrier and passing is true (we get a point) For i = 1 To numTube tubeX[i] = tubeX[i]-tubeSpeed*speedup If (tubeX[i] < -birdRadius) Then 'Reset barrier off to right tubeX[i] = tubeX[i]+gw+2*birdRadius SetTubeGap() 'Gap size and Y position EndIf 'A little bit of leaway since rectangle overlap is a bit harsh If (birdX-birdRadius+leaway < tubeX[i]+birdRadius And birdX+birdRadius-leaway > tubeX[i]-birdRadius) Then passing[i] = "True" If (birdY-birdRadius+leaway < tubeY[i] Or birdY+birdRadius-leaway > tubeY[i]+tubeGap[i]) Then Sound.PlayChime() playing = "False" EndIf ElseIf (passing[i]) Then Sound.PlayClick() score = score+1 passing[i] = "False" EndIf Shapes.Move(tubeTop[i],tubeX[i]-birdRadius,tubeY[i]-gh) Shapes.Move(tubeBottom[i],tubeX[i]-birdRadius,tubeY[i]+tubeGap[i]) EndFor 'Move Clouds For i = 1 To numCloud cloudX[i] = cloudX[i]-tubeSpeed*speedup If (cloudX[i] < -cloudRadius) Then 'Reset cloud off to right cloudX[i] = cloudX[i]+gw+2*cloudRadius SetCloudY() EndIf Shapes.Move(cloud[i],cloudX[i]-cloudRadius,cloudY[i]-cloudRadius/2) EndFor GraphicsWindow.Title = "Small Basic Flappy Birds : HighScore = "+highScore+" ("+highScorePlayer+") : Score = "+score delay = 20 - (Clock.ElapsedMilliseconds-start) If (delay > 0) Then Program.Delay(delay) EndIf EndWhile Lose() EndWhile '============================================================================== 'SUBROUTINES '============================================================================== Sub Intro 'Create and size window gw = 1200 gh = 600 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Left = (Desktop.Width-gw)/2 GraphicsWindow.Top = (Desktop.Height-gh)/2 GraphicsWindow.Title = "Small Basic Flappy Birds" Mouse.HideCursor() 'Intro message GraphicsWindow.BackgroundColor = "lightBlue" GraphicsWindow.BrushColor = "Orange" GraphicsWindow.FontSize = 50 GraphicsWindow.DrawBoundText(0.1*gw,0.2*gh,0.8*gw,"Use any key or mouse to flap") GraphicsWindow.DrawBoundText(0.1*gw,0.3*gh,0.8*gw,"Any key to restart when you lose") GraphicsWindow.DrawBoundText(0.1*gw,0.4*gh,0.8*gw,"Escape to quit") GraphicsWindow.DrawBoundText(0.1*gw,0.6*gh,0.8*gw,"Any key to start") 'Get images - (if they don't exist basic shapes will be used) - 48*48 png for bird and 48 * gh png for tubes birdImage = ImageList.LoadImage("http://litdev.hostoi.com/game_images/flappyBird.png") tubeTopImage = ImageList.LoadImage("http://litdev.hostoi.com/game_images/tubeTop.png") tubeBottomImage = ImageList.LoadImage("http://litdev.hostoi.com/game_images/tubeBottom.png") cloudImage = ImageList.LoadImage("http://litdev.hostoi.com/game_images/cloud.png") 'High Score using LitDev Extension highScore = 0 ' highScores = LDNetwork.HighScore("FlappyBirds","No-one",highScore) highScores[1] = 0 highScorePlayer = HighScores[1] highScore = HighScores[2] 'Press a key to start While (GraphicsWindow.LastKey = "None" And Mouse.IsLeftButtonDown = "False") Program.Delay(100) EndWhile EndSub '============================================================================== Sub Initialise 'Basic Setup GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "lightBlue" GraphicsWindow.PenWidth = 0 score = 0 speedup = 1 birdRadius = 24 tubeSpeed = 2 leaway = (Math.SquareRoot(2)-1)*birdRadius 'for collision detection (a buffer) 'Shapes are added in Z order (back ones first) 'Clouds GraphicsWindow.BrushColor = "White" numCloud = 7 cloudRadius = 80 For i = 1 To numCloud If (ImageList.GetWidthOfImage(cloudImage) > 0) Then cloud[i] = Shapes.AddImage(cloudImage) Else cloud[i] = Shapes.AddEllipse(2*cloudRadius,cloudRadius) EndIf cloudX[i] = i*(gw+2*cloudRadius)/numCloud+Math.GetRandomNumber(cloudRadius)-cloudRadius/2 SetCloudY() Shapes.Move(cloud[i],cloudX[i]-cloudRadius,cloudY[i]-cloudRadius/2) EndFor 'Barriers GraphicsWindow.BrushColor = "DimGray" numTube = 4 For i = 1 To numTube passing[i] = "False" If (ImageList.GetWidthOfImage(tubeTopImage) > 0 And ImageList.GetWidthOfImage(tubeBottomImage) > 0) Then tubeTop[i] = Shapes.AddImage(tubeTopImage) tubeBottom[i] = Shapes.AddImage(tubeBottomImage) Else tubeTop[i] = Shapes.AddRectangle(2*birdRadius,gh) tubeBottom[i] = Shapes.AddRectangle(2*birdRadius,gh) EndIf tubeX[i] = gw*3/4+((i-1)*(gw+2*birdRadius)/numTube) SetTubeGap() 'Gap size and Y position Shapes.Move(tubeTop[i],tubeX[i]-birdRadius,tubeY[i]-gh) Shapes.Move(tubeBottom[i],tubeX[i]-birdRadius,tubeY[i]+tubeGap[i]) EndFor 'Bird GraphicsWindow.BrushColor = "Brown" birdX = gw/3 birdY = gh /2 'Try to get image, otherwise use circle If (ImageList.GetWidthOfImage(birdImage) > 0) Then bird = Shapes.AddImage(birdImage) Else bird = Shapes.AddEllipse(2*birdRadius,2*birdRadius) EndIf 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.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp GraphicsWindow.MouseDown = OnKeyDown GraphicsWindow.MouseUp = OnKeyUp EndSub '============================================================================== Sub Lose GraphicsWindow.BrushColor = "Orange" If (Score > highScore) Then Mouse.ShowCursor() highScoreTB = Controls.AddTextBox(gw/2-200,0.4*gh) Controls.SetSize(highScoreTB,400,1.5*GraphicsWindow.FontSize) Controls.SetTextBoxText(highScoreTB,"Winner's Name") highScoreButton = Controls.AddButton("Enter",gw/2-100,0.6*gh) Controls.SetSize(highScoreButton,200,1.5*GraphicsWindow.FontSize) While (Controls.LastClickedButton <> highScoreButton) Program.Delay(100) EndWhile Mouse.HideCursor() 'High Score using LitDev Extension ' highScores = LDNetwork.HighScore("FlappyBirds",Controls.GetTextBoxText(highScoreTB),Score) highScorePlayer = HighScores[1] highScore = HighScores[2] Else 'Display lose message and wait till key is pressed Shapes.Remove(loseText) loseText = Shapes.AddText("You Lose") Shapes.Move(loseText,0.4*gw,0.4*gh) While (keyDown = "False") Program.Delay(100) EndWhile EndIf EndSub '============================================================================== Sub SetTubeGap 'Create gap for barrier i - a subroutine so we don't repeat code we may change tubeGap[i] = (minGap+Math.GetRandomNumber(30)/10)*birdRadius'Gap between tubes tubeY[i] = 2*birdRadius+Math.GetRandomNumber(gh-4*birdRadius-tubeGap[i]) 'Bottom of top tube 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 '============================================================================== 'EVENT SUBROUTINES '============================================================================== 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>LCN897-0.sb< Start>LCN897.sb< '============================================================================== 'Simple Flappy Birds game - mainly just the game-engine, no levels basic graphics, sound etc 'Uses LitDev extension for web high score - easily commented out or altered to store in a local file etc 'By LitDev 2014 '============================================================================== 'Customisations gravity = 0.1 'Gravity down (0.1 to 0.3) flapPower = 3 '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() While "True" 'Repeat game Initialise() '============================================================================== 'GAME LOOP '============================================================================== While (playing) start = Clock.ElapsedMilliseconds 'Gradually increase speed to make it challenging 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 'Max speed 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 'Move bird Shapes.Move(bird,birdX-birdRadius,birdY-birdRadius) 'Move tube barriers and check for collision (end of game) - also update score for each barrier passed 'passing is true while overlapping barrier - once past barrier and passing is true (we get a point) For i = 1 To numTube tubeX[i] = tubeX[i]-tubeSpeed*speedup If (tubeX[i] < -birdRadius) Then 'Reset barrier off to right tubeX[i] = tubeX[i]+gw+2*birdRadius SetTubeGap() 'Gap size and Y position EndIf 'A little bit of leaway since rectangle overlap is a bit harsh If (birdX-birdRadius+leaway < tubeX[i]+birdRadius And birdX+birdRadius-leaway > tubeX[i]-birdRadius) Then passing[i] = "True" If (birdY-birdRadius+leaway < tubeY[i] Or birdY+birdRadius-leaway > tubeY[i]+tubeGap[i]) Then Sound.PlayChime() playing = "False" EndIf ElseIf (passing[i]) Then Sound.PlayClick() score = score+1 passing[i] = "False" EndIf Shapes.Move(tubeTop[i],tubeX[i]-birdRadius,tubeY[i]-gh) Shapes.Move(tubeBottom[i],tubeX[i]-birdRadius,tubeY[i]+tubeGap[i]) EndFor 'Move Clouds For i = 1 To numCloud cloudX[i] = cloudX[i]-tubeSpeed*speedup If (cloudX[i] < -cloudRadius) Then 'Reset cloud off to right cloudX[i] = cloudX[i]+gw+2*cloudRadius SetCloudY() EndIf Shapes.Move(cloud[i],cloudX[i]-cloudRadius,cloudY[i]-cloudRadius/2) EndFor GraphicsWindow.Title = "Small Basic Flappy Birds : HighScore = "+highScore+" ("+highScorePlayer+") : Score = "+score delay = 20 - (Clock.ElapsedMilliseconds-start) If (delay > 0) Then Program.Delay(delay) EndIf EndWhile Lose() EndWhile '============================================================================== 'SUBROUTINES '============================================================================== Sub Intro 'Create and size window gw = 1200 gh = 600 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Left = (Desktop.Width-gw)/2 GraphicsWindow.Top = (Desktop.Height-gh)/2 GraphicsWindow.Title = "Small Basic Flappy Birds" Mouse.HideCursor() 'Intro message GraphicsWindow.BackgroundColor = "lightBlue" GraphicsWindow.BrushColor = "Orange" GraphicsWindow.FontSize = 50 GraphicsWindow.DrawBoundText(0.1*gw,0.2*gh,0.8*gw,"Use any key or mouse to flap") GraphicsWindow.DrawBoundText(0.1*gw,0.3*gh,0.8*gw,"Any key to restart when you lose") GraphicsWindow.DrawBoundText(0.1*gw,0.4*gh,0.8*gw,"Escape to quit") GraphicsWindow.DrawBoundText(0.1*gw,0.6*gh,0.8*gw,"Any key to start") 'Get images - (if they don't exist basic shapes will be used) - 48*48 png for bird and 48 * gh png for tubes birdImage = ImageList.LoadImage("http://litdev.hostoi.com/game_images/flappyBird.png") tubeTopImage = ImageList.LoadImage("http://litdev.hostoi.com/game_images/tubeTop.png") tubeBottomImage = ImageList.LoadImage("http://litdev.hostoi.com/game_images/tubeBottom.png") cloudImage = ImageList.LoadImage("http://litdev.hostoi.com/game_images/cloud.png") 'High Score using LitDev Extension highScore = 0 highScores = LDNetwork.HighScore("FlappyBirds","No-one",highScore) highScorePlayer = HighScores[1] highScore = HighScores[2] 'Press a key to start While (GraphicsWindow.LastKey = "None" And Mouse.IsLeftButtonDown = "False") Program.Delay(100) EndWhile EndSub '============================================================================== Sub Initialise 'Basic Setup GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "lightBlue" GraphicsWindow.PenWidth = 0 score = 0 speedup = 1 birdRadius = 24 tubeSpeed = 2 leaway = (Math.SquareRoot(2)-1)*birdRadius 'for collision detection (a buffer) 'Shapes are added in Z order (back ones first) 'Clouds GraphicsWindow.BrushColor = "White" numCloud = 7 cloudRadius = 80 For i = 1 To numCloud If (ImageList.GetWidthOfImage(cloudImage) > 0) Then cloud[i] = Shapes.AddImage(cloudImage) Else cloud[i] = Shapes.AddEllipse(2*cloudRadius,cloudRadius) EndIf cloudX[i] = i*(gw+2*cloudRadius)/numCloud+Math.GetRandomNumber(cloudRadius)-cloudRadius/2 SetCloudY() Shapes.Move(cloud[i],cloudX[i]-cloudRadius,cloudY[i]-cloudRadius/2) EndFor 'Barriers GraphicsWindow.BrushColor = "DimGray" numTube = 4 For i = 1 To numTube passing[i] = "False" If (ImageList.GetWidthOfImage(tubeTopImage) > 0 And ImageList.GetWidthOfImage(tubeBottomImage) > 0) Then tubeTop[i] = Shapes.AddImage(tubeTopImage) tubeBottom[i] = Shapes.AddImage(tubeBottomImage) Else tubeTop[i] = Shapes.AddRectangle(2*birdRadius,gh) tubeBottom[i] = Shapes.AddRectangle(2*birdRadius,gh) EndIf tubeX[i] = gw*3/4+((i-1)*(gw+2*birdRadius)/numTube) SetTubeGap() 'Gap size and Y position Shapes.Move(tubeTop[i],tubeX[i]-birdRadius,tubeY[i]-gh) Shapes.Move(tubeBottom[i],tubeX[i]-birdRadius,tubeY[i]+tubeGap[i]) EndFor 'Bird GraphicsWindow.BrushColor = "Brown" birdX = gw/3 birdY = gh /2 'Try to get image, otherwise use circle If (ImageList.GetWidthOfImage(birdImage) > 0) Then bird = Shapes.AddImage(birdImage) Else bird = Shapes.AddEllipse(2*birdRadius,2*birdRadius) EndIf 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.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp GraphicsWindow.MouseDown = OnKeyDown GraphicsWindow.MouseUp = OnKeyUp EndSub '============================================================================== Sub Lose GraphicsWindow.BrushColor = "Orange" If (Score > highScore) Then Mouse.ShowCursor() highScoreTB = Controls.AddTextBox(gw/2-200,0.4*gh) Controls.SetSize(highScoreTB,400,1.5*GraphicsWindow.FontSize) Controls.SetTextBoxText(highScoreTB,"Winner's Name") highScoreButton = Controls.AddButton("Enter",gw/2-100,0.6*gh) Controls.SetSize(highScoreButton,200,1.5*GraphicsWindow.FontSize) While (Controls.LastClickedButton <> highScoreButton) Program.Delay(100) EndWhile Mouse.HideCursor() 'High Score using LitDev Extension highScores = LDNetwork.HighScore("FlappyBirds",Controls.GetTextBoxText(highScoreTB),Score) highScorePlayer = HighScores[1] highScore = HighScores[2] Else 'Display lose message and wait till key is pressed Shapes.Remove(loseText) loseText = Shapes.AddText("You Lose") Shapes.Move(loseText,0.4*gw,0.4*gh) While (keyDown = "False") Program.Delay(100) EndWhile EndIf EndSub '============================================================================== Sub SetTubeGap 'Create gap for barrier i - a subroutine so we don't repeat code we may change tubeGap[i] = (minGap+Math.GetRandomNumber(30)/10)*birdRadius'Gap between tubes tubeY[i] = 2*birdRadius+Math.GetRandomNumber(gh-4*birdRadius-tubeGap[i]) 'Bottom of top tube 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 '============================================================================== 'EVENT SUBROUTINES '============================================================================== 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>LCN897.sb< Start>LCP287-1.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.AddAmbientLight(view3D "#77777777") LD3DView.AddSpotLight (view3D,"white",1 1 1, -1,-1,1 30, 10) LD3DView.AddDirectionalLight (view3D,"#bbaaaaaa" ,-1,-7,-1) LD3DView.AutoControl2 ( 5 1) GraphicsWindow.Title="3D-Bottle yy= LDText.Split(".3 .35 .4 .7 .9 1 1 1 1 1 1 1 .9 .8 .9 1 1 1 1 1 1 1 1 1 1 1 .8 .5" " ") For qq=1 To 27 pp=pp+((qq)/4)+":"+yy[28-qq]+":" EndFor pp=pp+27/4+":"+0.0001 mm=LD3DView.AddRevolute(view3D pp 30 "#7700ffff" "D") ii=ImageList.LoadImage("e:/rbb.png") LDImage.MakeTransparent(ii "red") LD3DView.AddImage(view3D mm "" ii "D") LD3DView.TranslateGeometry(view3D mm 10 0 10) LD3DView.AnimateRotation(view3D mm 0 1 0 0 360 5, -1) mm=LD3DView.AddCone (view3D .4 .6 1.5 30 "cyan" "D") LD3DView.TranslateGeometry(view3D mm 10 0 14) col="0=brown;1=orange For rr=0 To 7 For m=0 To 7 cc=col[Math.Remainder(m+rr 2)] dd=LD3DView.AddCube(view3D 3.2,cc "d") LD3DView.TranslateGeometry(view3D dd rr*3.2, -1.55 m*3.2) ' dd=LD3DView.AddCube(view3D 3.2,cc "d") 'LD3DView.TranslateGeometry(view3D dd rr*3.2, m*3.2 0) EndFor EndFor End>LCP287-1.sb< Start>LCP287.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.AddAmbientLight(view3D "#77777777") LD3DView.AddSpotLight (view3D,"white",1 1 1, -1,-1,1 30, 10) LD3DView.AddDirectionalLight (view3D,"#bbaaaaaa" ,-1,-7,-1) LD3DView.AutoControl2 (1 1) GraphicsWindow.Title="3D-Bottle yy= LDText.Split(".3 .35 .4 .7 .9 1 1 1 1 1 1 1 .9 .8 .9 1 1 1 1 1 1 1 1 1 1 1 .8 .5" " ") For qq=1 To 27 pp=pp+((qq)/4)+":"+yy[28-qq]+":" EndFor pp=pp+27/4+":"+0.0001 mm=LD3DView.AddRevolute(view3D pp 30 "#7700ffff" "D") LD3DView.TranslateGeometry(view3D mm 10 0 10) mm=LD3DView.AddRevolute(view3D pp 30 "#00ffff" "S") LD3DView.TranslateGeometry(view3D mm 14 0 10) col="0=brown;1=orange For rr=0 To 7 For m=0 To 7 cc=col[Math.Remainder(m+rr 2)] dd=LD3DView.AddCube(view3D 3.2,cc "d") LD3DView.TranslateGeometry(view3D dd rr*3.2, -1.55 m*3.2) dd=LD3DView.AddCube(view3D 3.2,cc "d") LD3DView.TranslateGeometry(view3D dd rr*3.2, m*3.2 0) EndFor EndFor End>LCP287.sb< Start>LCQ579.sb< TextWindow.ForegroundColor="White" TextWindow.WriteLine("***********************************") TextWindow.WriteLine("*********How Many Letters?*********") TextWindow.WriteLine("***********************************") start: TextWindow.ForegroundColor="Yellow" TextWindow.WriteLine("") TextWindow.WriteLine("Write The Word Here:") TextWindow.ForegroundColor="White" read=TextWindow.Read() lgt=Text.GetLength(read) spc=Text.GetIndexOf(read," ") If Text.IsSubText(read," ") Then lgt=lgt-1 EndIf TextWindow.ForegroundColor="Yellow" TextWindow.Write("The Word have ") TextWindow.ForegroundColor="Red" TextWindow.Write(lgt) TextWindow.ForegroundColor="Yellow" TextWindow.WriteLine(" letters.") Goto start End>LCQ579.sb< Start>LCR633.sb< args=0 GraphicsWindow.Title = "BrickDraw3D" GraphicsWindow.PenWidth=0 Init() GraphicsWindow.BrushColor="darkgray GraphicsWindow.FillRectangle (0,gh/3 gw gh) rx=1 For dt=1 to 6 For x=1 to 20 For y=1 To 20 ca[dt][x][y]="x" EndFor endfor endfor pdef() For w=0 to 5 dt=w+1 caa=ca[dt] 'TextWindow.WriteLine (caa) s1=1 If w=0 Or w=5 Then s1=12 EndIf For qy=12 To s1 Step -1 For qx=1 to 15 If caa[qx][qy]="x" then 'nixx elseIf caa[qx][qy]="K" then param="y="+qx*35+";z="+(13-qy)*35+";x="+w*35+";color=#aa0000;edge=30 Drawramp () s35=17 param="x="+qx*s35+";z="+(13-qy)*s35+";y="+(w-15)*s35+";color=#aa0000;edge=15 Drawramp1 () s35=17 param="x="+(qx+17)*s35+";z="+(13-qy)*s35+";y="+(w-15)*s35+";color=#aa0000;edge=15 Drawramp1 () else param="y="+qx*35+";z="+(13-qy)*35+";x="+w*35+";color="+caa[qx][qy]+";edge=30 DrawCube () s35=17 param="x="+qx*s35+";z="+(13-qy)*s35+";y="+(w-15)*s35+";color="+caa[qx][qy]+";edge=15 DrawCube () param="x="+(qx+17)*s35+";z="+(13-qy)*s35+";y="+(w-15)*s35+";color="+caa[qx][qy]+";edge=15 DrawCube () endif EndFor endfor endfor Sub Do cmdd=ldtext.Split( args[1]," ") For f=1 To Array.GetItemCount (cmdd) cmd=cmdd[f] x = T_X y = T_Y If Text.StartsWith(cmd, "R:") Then GetOperand() T_x=x + operand * size t_y=y If df=1 then dfll() EndIf elseIf Text.StartsWith(cmd, "R.") Then t_x=x + size t_y=y ElseIf Text.StartsWith(cmd, "L.") Then T_x=x - size t_y= y elseIf Text.StartsWith(cmd, "L:") Then GetOperand() T_x=x - operand * size t_y=y If df=1 then dfll() EndIf ElseIf Text.StartsWith(cmd, "U.") Then t_x=x t_y= y - size ElseIf Text.StartsWith(cmd, "U:") Then GetOperand () t_x=x t_y= y - operand * size If df=1 then dfll() EndIf ElseIf Text.StartsWith(cmd, "D.") Then t_x=x t_y= y + size ElseIf Text.StartsWith(cmd, "D:") Then GetOperand () t_x=x t_y= y + operand * size If df=1 then dfll() EndIf ElseIf Text.StartsWith(cmd, "F") or Text.StartsWith(cmd, "K") Then If Text.IsSubText (cmd,"/") then c1=LDText.Split(cmd,"/") cmd=c1[1] GetOperand() GraphicsWindow.BrushColor = operand cmd=c1[2] GetOperand() op=operand df=1 For t=1 to op LDCall.Function ("do",cm0+":1") EndFor df=0 else if Text.StartsWith(cmd, "K") Then ca[dt][x][y]="K" else GetOperand() If operand = "" Then operand = "Black" EndIf GraphicsWindow.BrushColor = operand dfll() endif EndIf endif EndFor EndSub Sub dfll ca[dt][x][y]=GraphicsWindow.BrushColor EndSub Sub GetOperand sp = ldText.Split(cmd, ":") cm0=sp[1] operand = sp[2] EndSub Sub Init size = 1 gw = 1000 gh = 800 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BackgroundColor = LDColours.HSLtoRGB (220 1 0.8) EndSub Sub Conv3Dto2D cx = gw / 2 - Math.SquareRoot(1 / 2) * param["x"] cx = cx + Math.SquareRoot(1 / 2) * param["y"] cy = gh / 2 + Math.SquareRoot(1 / 6) * param["x"] cy = cy + Math.SquareRoot(1 / 6) * param["y"] cy = cy - Math.SquareRoot(2 / 3) * param["z"] EndSub Sub Color_RGBtoHSL rHue=LDColours.GetHue (sColor) rLightness=LDColours.GetLightness(sColor ) rSaturation=LDColours.GetSaturation (sColor ) EndSub Sub DrawCube Conv3Dto2D() edge = Math.SquareRoot(2 / 3) * param["edge"] x1 = math.Round (cx) y1 = math.Round (cy) sColor = param["color"] color[1] = sColor Color_RGBtoHSL () savedLightness = rLightness rLightness = Math.Min(savedLightness * 1.2, 1) scolor=lDColours.HSLtoRGB (rHue,rSaturation ,rLightness ) color[2] = sColor rLightness = Math.Max(savedLightness * 0.8, 0) scolor=lDColours.HSLtoRGB (rHue,rSaturation ,rLightness ) color[3] = sColor 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 GraphicsWindow.PenColor =color[(a-60) / 120] po=LDShapes.AddPolygon (ppp) LDShapes.BrushColour(po,color[(a-60)/120]) EndIf x4 = x3 y4 = y3 x3 = x2 y3 = y2 EndFor EndSub Sub Drawramp Conv3Dto2D() edge = Math.SquareRoot(2 / 3) * param["edge"] x1 = math.Round (cx) y1 = math.Round (cy) color = param["color"] GraphicsWindow.PenWidth =0 x3=0 y3=0 cc=1 For a = 0 To 240 Step 60 x2[cc] = math.Round (cx - edge * ldMath.Sin(a)) y2[cc] = math.Round (cy - edge * ldMath.Cos(a)) If a>0 then ppp=0 ppp[1][1]=x1+50 ppp[1][2]=y1-30 ppp[2][1]=x2[cc]+50 ppp[2][2]=y2[cc]-30 ppp[3][1]=x3+50 ppp[3][2]=y3-30 po=LDShapes.AddPolygon (ppp) LDShapes.BrushColour (po,color) endif x3 = x2[cc] y3 = y2[cc] cc=cc+1 EndFor ppp=0 ppp[1][1]=x2[1]+50 ppp[1][2]=y2[1]-30 ppp[2][1]=x2[2]+50 ppp[2][2]=y2[2]-30 ppp[3][1]=x2[4]+50 ppp[3][2]=y2[4]-30 ppp[4][1]=x2[5]+50 ppp[4][2]=y2[5]-30 po=LDShapes.AddPolygon (ppp) LDShapes.BrushColour (po,"red") EndSub Sub Drawramp1 Conv3Dto2D() edge = Math.SquareRoot(2 / 3) * param["edge"] x1 = math.Round (cx) y1 = math.Round (cy) color = param["color"] GraphicsWindow.PenWidth =0 x3=0 y3=0 cc=1 For a = 120 To 360 Step 60 x2[cc] = math.Round (cx - edge * ldMath.Sin(a)) y2[cc] = math.Round (cy - edge * ldMath.Cos(a)) If a>180 then ppp=0 ppp[1][1]=x1+50 ppp[1][2]=y1-30 ppp[2][1]=x2[cc]+50 ppp[2][2]=y2[cc]-30 ppp[3][1]=x3+50 ppp[3][2]=y3-30 po=LDShapes.AddPolygon (ppp) LDShapes.BrushColour (po,color) endif x3 = x2[cc] y3 = y2[cc] cc=cc+1 EndFor ppp=0 ppp[1][1]=x2[1]+50 ppp[1][2]=y2[1]-30 ppp[2][1]=x2[2]+50 ppp[2][2]=y2[2]-30 ppp[3][1]=x2[4]+50 ppp[3][2]=y2[4]-30 ppp[4][1]=x2[5]+50 ppp[4][2]=y2[5]-30 po=LDShapes.AddPolygon (ppp) LDShapes.BrushColour (po,"red") EndSub Sub pdef For dt=1 To 6 T_X = 1 T_Y = 1 LDCall.Function("do","R:5") For row = 1 To 5 LDCall.Function ("do","F:Red D. L.") EndFor LDCall.Function ("do","R:6 U:4") For row = 1 To 4 LDCall.Function ("do","K. D. R.") If row=2 and dt=3 Then txx=t_x tyy=t_y LDCall.Function ("do","F:Red/U:4") t_x=txx t_y=tyy endif EndFor LDCall.Function ("do","L:5 U:4") ll=1 l1=0 For row = 1 To 2 LDCall.Function ("do","F:Beige/R:"+ll) ll=ll+2 LDCall.Function ("do","D. R:"+l1) LDCall.Function ("do","F:Beige/L:"+ll) ll=ll+2 LDCall.Function ("do","D. L:"+l1) EndFor LDCall.Function ("do","R.") For row = 1 To 3 LDCall.Function ("do","F:Beige/R:7") LDCall.Function ("do","D. L.") LDCall.Function ("do","F:Beige/L:7") LDCall.Function ("do","D. R.") EndFor LDCall.Function ("do","R:1 U:6") For col = 1 To 3 LDCall.Function ("do","F:Blue/D:2") LDCall.Function ("do","D.") If col=2 Then ' Draw door LDCall.Function ("do","F:Black/D:3") LDCall.Function ("do","R:2 U:6") Else LDCall.Function ("do","F:Blue/D:2") If col<3 then LDCall.Function ("do","R:2 U:5") EndIf EndIf EndFor 'Draw ground LDCall.Function ("do","L:7 D.") LDCall.Function ("do","F:DarkGreen/R:16") ' Draw tree LDCall.Function ("do","L:5 U:6") LDCall.Function ("do","F:Green/R:3") LDCall.Function ("do","D. L:4") LDCall.Function ("do","F:Green/R:5") LDCall.Function ("do","D. L.") LDCall.Function ("do","F:Green/L:5") LDCall.Function ("do","D. R.") LDCall.Function ("do","F:Green/R:5") LDCall.Function ("do","D. L:2") LDCall.Function ("do","F:Green/L:3") LDCall.Function ("do","R:2 Up") LDCall.Function ("do","F:SaddleBrown/D:3") endfor EndSub End>LCR633.sb< Start>LCR911.sb< Key_Letter() ' 2 4 6 8 10 2 4 6 8 20 Ds="B C D F G H J K L M N P Q R S T V W X Z dm=ldtext.Split (Ds " ") For c2=1 to 20 c3=1 If c2=0 Then c3=11 EndIf while c3 <= 20 c31=1 If c3=0 And c2=3 Then c31=154 EndIf For L=c31 To 999 Key_code=text.Append("B"+dm[c2]+dm[c3] text.GetSubTextToEnd(1000+L,2)) main() EndFor c3=c3+1 EndWhile endfor Sub main url="http://smallbasic.com/program/?"+Key_code RD= Network.GetWebPageContents(url) TextWindow.Title=nnn+"= "+math.Round (tl*Math.Power (nnn, -1))+": "+Key_code If Text.IsSubText(RD,errmesg) then ' TextWindow.WriteLine(Key_code+"--None--") Else nnn=nnn+1 rd=ldtext.trim(rd) ll=Text.GetLength (rd) TextWindow.Title= TextWindow.Title+"/"+ll If ll>45000 then rr=text.GetIndexOf (RD "") rd=text.GetSubTextToEnd (RD rr+24) rr=text.GetIndexOf (RD "
150 Then ddt="!!!rp: "+array.GetItemCount (rp) ElseIf Text.IsSubText (RD "Tetris") then ddt="!~tt3ss ElseIf Text.IsSubText (RD "SOkoCUTE") then ddt="!~skkCt ElseIf Text.IsSubText (RD "Bouncing balls with realist") then ddt="!~bllzz ElseIf Text.IsSubText (RD "Snake") then ddt="!~~~snkk ElseIf Text.IsSubText (RD "Array.SetValue(island_Array,1,Shapes.AddImage") then ddt="!~~1942 else ddt="" EndIf TextWindow.WriteLine(Key_code+":"+ll+"= "+Array.GetItemCount (dd)+"; "+ddt) ' The following line could be harmful and has been automatically commented. ' File.AppendContents ("e:\ff.txt" Key_code+":"+ll+"= "+Array.GetItemCount (dd)+"; "+ddt+Text.GetCharacter(13)+Text.GetCharacter (10) ) For f=1 To 5 'TextWindow.WriteLine (f+":"+Text.GetSubTextToEnd (dd[f] 1)) If Text.StartsWith (dd[f] "") then TextWindow.WriteLine(Text.GetSubText (dd[f] 23 Text.GetLength (dd[f])-29 )) EndIf EndFor aa=LDText.FindAll(RD "' The following line could be") If Array.GetItemCount(aa)>0 then TextWindow.WriteLine( "### autorem: "+array.GetItemCount (aa)) EndIf ' The following line could be harmful and has been automatically commented. ' ' File.WriteLine(Program.Directory+"\KeyCodeList.txt",nnn,Key_code) Else tl=tl+ll endif endif Endsub Sub Key_Letter DQ=text.GetCharacter(34) errmesg="
error" EndSub End>LCR911.sb< Start>LCT830.sb< ' mahreen miangul ' Triangles randLoc 3///Lines Rectangles ' OctoBer 2018 GraphicsWindow.Title = "mahreen miangul ' Animation GraphicsWindow.brushcolor = "yellow haroon2= Shapes.Addellipse(20, 20) Shapes.Move(haroon2, 0, 0) Shapes.Animate(haroon2, 470, 140, 2000) GraphicsWindow.brushcolor = "red haroon2= Shapes.Addellipse(30, 30) Shapes.Move(haroon2, 0, 600) Shapes.Animate(haroon2, 420, 130, 2000) GraphicsWindow.brushcolor = "Blue haroon2= Shapes.Addellipse(40, 40) Shapes.Move(haroon2, 1080, 0) Shapes.Animate(haroon2, 520, 110, 2000) 'Shapes.Zoom(haroon2, 0, 0) GraphicsWindow.brushcolor = "springGreen haroon2= Shapes.Addellipse(60, 60) Shapes.Move(haroon2, 1080, 0) Shapes.Animate(haroon2, 520, 180, 2000) GraphicsWindow.brushcolor = "darkslategray haroon2= Shapes.AddTriangle(60, 100, 60, 30, 170, 100) Shapes.Move(haroon2, 1080, 0) Shapes.Animate(haroon2, 330, 190, 2000) GraphicsWindow.pencolor = "blue GraphicsWindow.PenWidth = 2 haroon2= Shapes.Addline(0, 0, 0, 100) Shapes.Move(haroon2, 1080, 600) Shapes.Animate(haroon2, 420, 330, 2000) 'Shapes.Rotate(haroon2, 50) 'Shapes.SetOpacity(haroon2, 50) 'Shapes.Zoom(haroon2, 5, 3) GraphicsWindow.brushcolor = GraphicsWindow.GetRandomColor() GraphicsWindow.pencolor = GraphicsWindow.GetColorFromRGB(150, 50, 100) GraphicsWindow.PenWidth = 5 haroon2= Shapes.Addrectangle(40, 80) Shapes.Move(haroon2, 0, 0) Shapes.Animate(haroon2, 600, 200, 2000) 'Shapes.Rotate(haroon2, 50) 'Shapes.SetOpacity(haroon2, 50) 'Shapes.Zoom(haroon2, 5, 3) GraphicsWindow.Width = 1080 GraphicsWindow.Height = 660 ' Gradation Windows For H = 0 To 1080 S = 1 L = 0.5 HSL2RGB() GraphicsWIndow.PenColor = GraphicsWindow.GetColorFromRGB(R,G,B) GraphicsWindow.DrawLine(H,0,H,660) EndFor Sub HSL2RGB 'Check Limits While (H < 0) H = H+1080 EndWhile While (H >= 1080) H = H-1080 EndWhile S = Math.Max(0,Math.Min(1,S)) L = Math.Max(0,Math.Min(1,L)) C = (1-Math.Abs(2*L-1))*S H2 = H/180 X = C*(1-Math.Abs(Math.Remainder(H2,2)-1)) If (H2 >= 0 And H2 < 1) Then R = C G = X B = 0 ElseIf (H2 >= 1 And H2 < 2) Then R = X G = C B = 0 ElseIf (H2 >= 2 And H2 < 3) Then R = 0 G = C B = X ElseIf (H2 >= 3 And H2 < 4) Then R = 0 G = X B = C ElseIf (H2 >= 4 And H2 < 5) Then R = X G = 0 B = C ElseIf (H2 >= 5 And H2 < 6) Then R = C G = 0 B = X Else R = 0 G = 0 B = 0 EndIf M = L-C/2 R = 255*(R+M) G = 255*(G+M) B = 255*(B+M) EndSub End>LCT830.sb< Start>LCW456.sb< r = 5 ' Number of rows For i=0 To r-1 For j=0 To r-1 Pyramid[i][j]=0 EndFor EndFor Pyramid[0][0]=151 Pyramid[2][0]=40 Pyramid[4][1]=11 Pyramid[4][3]=4 inp=Pyramid ' Calculate Y a = Pyramid[r-1][1] b = Pyramid[r-1][3] c = Pyramid[0][0] y = (c - (4*a) - (4*b))/7 Pyramid[r-1][2] = y Pyramid_Copy=Pyramid n = 0 ' solution counter For x = 0 To y For z = 0 To y If( (x+z) = y) Then Pyramid[r-1][0] = x Pyramid[r-1][r-1] = z ' Recalculate Pyramid values i = r-1 While i > 0 For j = 0 To i-1 Pyramid[i-1][j] = Pyramid[i][j]+Pyramid[i][j+1] EndFor i=i-1 EndWhile ' Compare Pyramid values solved = "true For i = 0 To r-2 For j = 0 To i If(Pyramid_Copy[i][j]>0) Then If(Pyramid[i][j] <> Pyramid_Copy[i][j]) Then solved = "false i = r Goto break EndIf EndIf EndFor break: EndFor If solved Then n=n+1 wprt() EndIf Pyramid=Pyramid_Copy EndIf EndFor EndFor If n=0 Then TextWindow.WriteLine("Unsolvable!") EndIf Sub wprt For i=0 To r-1 For q=1 To 2-i/2 TextWindow.Write( Text.GetCharacter(9)) EndFor If Math.Remainder(i 2)=1 Then ss=" " Else ss="" EndIf For j=0 To r-1 If Pyramid[i][j]>0 Then If Pyramid[i][j]=inp[i][j] Then TextWindow.ForegroundColor="red Else TextWindow.ForegroundColor="cyan EndIf TextWindow.Write( ss+Pyramid[i][j]+Text.GetCharacter(9)) EndIf EndFor TextWindow.WriteLine("") EndFor EndSub End>LCW456.sb< Start>LCX215.sb< ' multi calculation method by NaochanON graphic version gui() Controls.ButtonClicked=Onbutton Sub Onbutton 'cal="123.55/7654 - 87.12 - 1082/762*12.12" ' Calculating formula //answer = - 104.3136 'cal="-4*0.17 - 3*8 +6*3/2*9 + 9 -15/5+ 11.55" ' answer = 73.87 cal= Controls.GetTextBoxText(box1) ChartoVal() Multidevide() TWresult() Plusminus() Controls.SetTextBoxText(box2,NewCal+" =" +res) endsub Sub ChartoVal NN=0 MM=0 VL="" Mark="+-*/" Len= Text.GetLength(cal) For i=1 To Len V= Text.GetSubText(cal,i,1) If Text.IsSubText(Mark,V)="False" And V<>" " Then Vl=text.Append(Vl,V) ElseIf Text.IsSubText(Mark,V)="True" then NN=NN+1 Val[NN]=VL VL="" MM=MM+1 Function[MM]=V endif EndFor NN=NN+1 Val[NN]=VL ' last value EndSub Sub Multidevide For k=1 To MM If Function[k]="/" Then res=Val[K]/Val[K+1] ' A / B Val[K+1]=res Val[K]="" Function[k]="" ElseIf Function[k]="*" Then res=Val[K]*Val[K+1] ' C*D Val[K+1]=res Val[K]="" Function[k]="" endif EndFor endsub Sub TWresult NewCal="" For L=1 To NN Newcal=Newcal+Val[L]+Function[L] EndFor endsub Sub Plusminus Len= Text.GetLength(Newcal) NN=0 MM=0 VL="" For i=1 To Len V= Text.GetSubText(Newcal,i,1) If Text.IsSubText("+-",V)="False" Then Vl=text.Append(Vl,V) ElseIf Text.IsSubText("+-",V)="True" then NN=NN+1 NewVal[NN]=VL ' if start mark is "-" then NewVal[1]="" , NewFunction[1]="-" VL="" MM=MM+1 NewFunction[MM]=V endif EndFor NN=NN+1 NewVal[NN]=VL ' last value '---------------------------------------------------------------------------------------- res=0 NewFunction[0]="+" ' if start function is NULL For j=MM To 0 Step -1 If NewFunction[j]="+" Then res=res+newval[j+1] ElseIf NewFunction[j]="-" Then res=res-newval[j+1] EndIf EndFor EndSub Sub gui GraphicsWindow.BackgroundColor="DarkGreen" GraphicsWindow.Width=700 GraphicsWindow.Height=200 GraphicsWindow.FontSize=18 GraphicsWindow.BrushColor="Yellow" GraphicsWindow.DrawText(10,40,"Formula") GraphicsWindow.DrawText(10,120,"Result") GraphicsWindow.BrushColor="Navy" box1= Controls.AddMultiLineTextBox(100,20) Controls.SetSize(box1,550,50) GraphicsWindow.BrushColor="Red" box2= Controls.AddMultiLineTextBox(100,100) Controls.SetSize(box2,550,50) btn= Controls.AddButton("Calc",100,160) EndSub End>LCX215.sb< Start>LCZ397-0.sb< start: TextWindow.ForegroundColor = "Red" TextWindow.WriteLine("Enter A String") string = TextWindow.Read() TextWindow.ForegroundColor = "Yellow" For firsttolast = 0 To Text.GetLength(string) Step 1 TextWindow.Write(string + " - ") string = Text.Append(Text.GetSubTextToEnd(string, 2), Text.GetSubText(string, 1,1)) EndFor start2: TextWindow.WriteLine("") TextWindow.WriteLine("Do You Want To Try Again (YES or No)") answer = TextWindow.Read() answer = Text.ConvertToUpperCase(answer) If answer = "YES" Then Goto start ElseIf answer = "NO" Then Else TextWindow.WriteLine("You Have Typed Something Else") Goto start2 EndIf End>LCZ397-0.sb< Start>LCZ397.sb< TextWindow.ForegroundColor = "Red" TextWindow.WriteLine("Enter A String") string = TextWindow.Read() TextWindow.ForegroundColor = "Yellow" For firsttolast = 0 To Text.GetLength(string) Step 1 TextWindow.Write(string + " - ") string = Text.Append(Text.GetSubTextToEnd(string, 2), Text.GetSubText(string, 1,1)) EndFor End>LCZ397.sb< Start>LDB044.sb< 'If line segment x1,y1 to x2,y2 is vertical 'will cause a divide by zero error when 'calculating the slope, so swap the 'points around to avoid the error. x1=100 y1=100 x2=150 y2=150 x3=200 y3=100 GraphicsWindow.BackgroundColor="teal GraphicsWindow.PenColor ="white GraphicsWindow.BrushColor ="orange GraphicsWindow.PenWidth =0 s1=Shapes.AddEllipse (14 14) s2=Shapes.AddEllipse (14 14) s3=Shapes.AddEllipse (14 14) LDShapes .SetShapeEvent (s1) LDShapes .SetShapeEvent (s2) LDShapes .SetShapeEvent (s3) LDShapes.ShapeEvent =see ssh=s1 LDShapes.BrushColour (ssh "red") GraphicsWindow.MouseDown =mdd LDShapes.move(s1 30 30) LDShapes.move(s2 60 30) LDShapes.move (s3 90 30) GraphicsWindow.PenWidth =1 GraphicsWindow.KeyDown =kkk Sub kkk If GraphicsWindow.LastKey="F1" Then x1= Shapes.GetLeft (s1)+7 y1= Shapes.GetTop (s1)+7 x2= Shapes.GetLeft (s2)+7 y2= Shapes.GetTop (s2)+7 x3= Shapes.GetLeft (s3)+7 y3= Shapes.GetTop (s3)+7 drawcc() EndIf EndSub Sub mdd LDShapes.move (ssh GraphicsWindow.MouseX-7 GraphicsWindow.MouseY-7 ) EndSub Sub see ls= LDShapes.LastEventShape lt= LDShapes.LastEventType If lt="MouseDown" Then ssh=ls LDShapes.BrushColour (s1 "orange") LDShapes.BrushColour (s2 "orange") LDShapes.BrushColour (s3 "orange") LDShapes.BrushColour (ssh "red") EndIf EndSub Sub drawcc GraphicsWindow.Title ="Circ" If x1 = x2 Then temp = x2 x2 = x3 x3 = temp temp = y2 y2 = y3 y3 = temp EndIf 'Same goes for these points If x2 = x3 Then temp = x1 x1 = x3 x3 = temp temp = y1 y1 = y3 y3 = temp EndIf 'ma and mb are the slopes of the lines for by x1,y1 to x2,y2 'and x2,y2 to x3,y3 (respectively) ma = (y2-y1)/(x2-x1) mb = (y3-y2)/(x3-x2) If mb - ma = 0.0 Then 'If all three points are on the same line, can't draw circle GraphicsWindow.Title ="Points are coincident, no circle exists!" Else 'Local constants: pi2 =2*Math.Pi stepSize = pi2/128.0 'Find center X coord using this formula cX = ( (ma*mb*(y1-y3)) + (mb*(x1+x2)) - (ma*(x2+x3)) ) / (2 * (mb-ma)) 'Find center Y coord using this formula cY = (-1.0/ma) * (cX-(x1+x2)/2.0) + ((y1+y2)/2.0) radius = Math.SquareRoot ( (cX-x1)*(cX-x1) + (cY-y1)*(cY-y1) ) oy=cy ox=radius +cx For i = stepSize To pi2 Step stepSize nX = math.Cos(i)*radius + cX nY = math.Sin(i)*radius + cY '#g,"Goto ";nX;" ";nY GraphicsWindow.DrawLine(ox oy nx ny) ox=nx oy=ny EndFor endif endsub End>LDB044.sb< Start>LDD298-1.sb< 'embedded line drawing content[1] = "152,17,164,17,151,18,166,18,148,19,167,19,145,20,168,20,144,21,169,21,142,22,169,22,141,23,169,23,139,24,169,24,138,25,169,25,137,26,168,26,136,27,166,27,135,28,163,28,134,29,161,29,134,30,160,30,133,31,158,31,132,32,156,32,132,33,154,33,132,34,152,34,131,35,151,35,131,36,149,36,130,37,147,37,175,37,175,37,177,37,182,37,130,38,146,38,175,38,183,38,130,39,145,39,174,39,183,39,130,40,143,40,174,40,184,40,129,41,142,41,174,41,184,41,129,42,141,42,173,42,184,42,129,43,139,43,171,43,184,43,129,44,138,44,170,44,183,44,129,45,137,45,170,45,182,45,129,46,136,46,169,46,181,46,130,47,135,47,168,47,180,47,130,48,134,48,167,48,179,48,130,49,133,49,166,49,178,49,131,50,132,50,165,50,177,50,165,51,176,51,164,52,174,52,162,53,173,53,162,54,172,54,160,55,171,55,159,56,170,56,156,57,169,57,147,58,168,58,139,59,140,59,143,59,166,59,139,60,165,60,138,61,163,61,137,62,162,62,136,63,160,63,135,64,157,64,134,65,153,65,134,66,151,66,133,67,149,67,132,68,148,68,133,69,146,69,133,70,144,70,134,71,141,71,180,97,180,97,187,97,194,97,184,98,195,98,161,99,161,99,178,99,178,99,181,99,197,99,205,99,209,99,161,100,161,100,170,100,176,100,180,100,198,100,203,100,210,100,160,101,164,101,171,101,174,101,179,101,183,101,189,101,196,101,198,101,211,101,159,102,166,102,178,102,183,102,190,102,196,102,203,102,211,102,158,103,167,103,177,103,183,103,189,103,196,103,202,103,212,103,158,104,168,104,176,104,184,104,188,104,196,104,202,104,212,104,157,105,172,105,176,105,196,105,201,105,213,105,156,106,196,106,200,106,213,106,156,107,169,107,174,107,195,107,200,107,214,107,155,108,168,108,175,108,214,108,155,109,168,109,176,109,215,109,155,110,168,110,177,110,194,110,200,110,215,110,154,111,168,111,177,111,193,111,201,111,215,111,154,112,167,112,178,112,191,112,201,112,215,112,154,113,166,113,179,113,189,113,202,113,215,113,154,114,166,114,169,114,170,114,181,114,187,114,203,114,214,114,154,115,165,115,168,115,168,115,204,115,214,115,154,116,163,116,167,116,168,116,205,116,213,116,154,117,161,117,206,117,212,117,154,118,160,118,208,118,212,118,154,119,155,119,211,119,211,119,154,120,155,120,174,120,175,120,194,120,195,120,210,120,210,120,245,303,249,303,244,304,247,304,249,304,249,304,242,305,247,305,240,306,246,306,249,306,249,306,238,307,246,307,237,308,247,308,235,309,247,309,234,310,243,310,248,310,248,310,233,311,242,311,232,312,241,312,231,313,239,313,250,313,251,313,253,313,253,313,230,314,237,314,251,314,251,314,253,314,253,314,230,315,237,315,247,315,254,315,229,316,236,316,245,316,255,316,125,317,128,317,227,317,235,317,244,317,256,317,124,318,130,318,227,318,234,318,243,318,257,318,124,319,131,319,226,319,234,319,242,319,258,319,124,320,132,320,225,320,233,320,241,320,259,320,125,321,133,321,225,321,233,321,240,321,252,321,258,321,260,321,127,322,134,322,225,322,232,322,239,322,251,322,259,322,262,322,128,323,135,323,224,323,232,323,238,323,250,323,259,323,262,323,129,324,135,324,224,324,232,324,238,324,249,324,258,324,262,324,120,325,122,325,130,325,136,325,227,325,231,325,237,325,248,325,257,325,262,325,117,326,123,326,131,326,136,326,225,326,225,326,228,326,231,326,237,326,248,326,256,326,262,326,116,327,124,327,132,327,137,327,229,327,231,327,237,327,247,327,255,327,262,327,114,328,125,328,132,328,137,328,230,328,231,328,236,328,246,328,254,328,260,328,113,329,126,329,133,329,138,329,228,329,232,329,236,329,245,329,253,329,259,329,113,330,127,330,133,330,138,330,231,330,233,330,236,330,245,330,253,330,259,330,113,331,127,331,134,331,138,331,233,331,234,331,236,331,245,331,252,331,258,331,116,332,128,332,134,332,138,332,234,332,244,332,252,332,258,332,118,333,129,333,134,333,138,333,235,333,244,333,251,333,258,333,119,334,129,334,134,334,138,334,236,334,243,334,251,334,258,334,118,335,130,335,134,335,138,335,237,335,243,335,250,335,258,335,114,336,114,336,119,336,130,336,134,336,134,336,138,336,138,336,238,336,243,336,249,336,258,336,120,337,130,337,134,337,134,337,138,337,138,337,239,337,243,337,249,337,258,337,121,338,130,338,137,338,137,338,240,338,243,338,248,338,258,338,122,339,130,339,241,339,243,339,248,339,259,339,122,340,131,340,242,340,244,340,248,340,256,340,258,340,258,340,122,341,130,341,243,341,245,341,248,341,255,341,122,342,130,342,244,342,245,342,247,342,254,342,122,343,130,343,245,343,253,343,122,344,129,344,246,344,252,344,122,345,128,345,246,345,252,345,258,345,259,345,115,346,115,346,122,346,127,346,247,346,252,346,114,347,116,347,122,347,127,347,248,347,251,347,114,348,117,348,122,348,126,348,249,348,251,348,113,349,118,349,122,349,125,349,249,349,251,349,112,350,118,350,122,350,124,350,113,351,119,351,122,351,124,351,113,352,119,352,122,352,123,352,114,353,119,353,122,353,122,353,115,354,119,354,121,354,121,354,115,355,121,355,115,356,120,356,115,357,120,357,115,358,119,358,116,359,119,359,116,360,118,360,116,361,118,361,116,362,118,362,116,363,117,363,116,364,117,364," content[2] = "156,80,158,80,162,80,163,80,210,80,210,80,152,81,152,81,154,81,163,81,209,81,217,81,142,82,142,82,145,82,163,82,209,82,218,82,135,83,162,83,209,83,219,83,131,84,162,84,209,84,225,84,130,85,162,85,209,85,231,85,130,86,162,86,209,86,232,86,130,87,162,87,208,87,232,87,130,88,162,88,208,88,237,88,130,89,162,89,208,89,239,89,130,90,161,90,208,90,240,90,129,91,161,91,208,91,240,91,129,92,161,92,208,92,240,92,129,93,161,93,208,93,239,93,128,94,161,94,208,94,238,94,128,95,160,95,208,95,238,95,128,96,160,96,207,96,240,96,128,97,161,97,207,97,240,97,127,98,161,98,207,98,240,98,127,99,161,99,207,99,240,99,127,100,161,100,208,100,239,100,128,101,162,101,208,101,240,101,129,102,160,102,210,102,241,102,131,103,158,103,212,103,240,103,131,104,157,104,212,104,239,104,134,105,156,105,213,105,239,105,135,106,156,106,213,106,240,106,135,107,155,107,213,107,239,107,137,108,155,108,214,108,238,108,137,109,154,109,214,109,237,109,138,110,154,110,214,110,236,110,140,111,154,111,214,111,236,111,142,112,154,112,213,112,236,112,143,113,154,113,213,113,235,113,146,114,154,114,213,114,234,114,147,115,154,115,213,115,233,115,149,116,154,116,212,116,233,116,154,117,155,117,210,117,232,117,210,118,229,118,212,119,227,119,211,120,222,120,210,121,221,121,209,122,217,122,209,123,216,123,208,124,214,124,207,125,213,125,206,126,212,126,206,127,211,127,207,128,209,128,179,218,198,218,163,219,214,219,156,220,218,220,149,221,218,221,144,222,218,222,141,223,218,223,137,224,219,224,228,224,231,224,137,225,220,225,227,225,234,225,137,226,220,226,227,226,236,226,135,227,220,227,229,227,239,227,124,228,124,228,132,228,219,228,230,228,241,228,123,229,124,229,133,229,219,229,231,229,243,229,122,230,124,230,126,230,126,230,136,230,218,230,231,230,245,230,120,231,125,231,137,231,218,231,232,231,246,231,118,232,125,232,138,232,218,232,233,232,247,232,116,233,124,233,139,233,218,233,221,233,221,233,233,233,248,233,115,234,123,234,139,234,218,234,234,234,250,234,114,235,122,235,139,235,218,235,234,235,251,235,113,236,121,236,139,236,218,236,234,236,252,236,111,237,120,237,138,237,217,237,234,237,253,237,110,238,120,238,125,238,125,238,138,238,217,238,235,238,254,238,109,239,119,239,125,239,125,239,138,239,217,239,221,239,221,239,235,239,255,239,108,240,118,240,137,240,218,240,235,240,255,240,107,241,118,241,137,241,218,241,235,241,256,241,106,242,118,242,137,242,218,242,235,242,256,242,105,243,118,243,136,243,218,243,235,243,256,243,104,244,117,244,135,244,218,244,235,244,256,244,104,245,117,245,135,245,218,245,228,245,228,245,235,245,256,245,103,246,117,246,134,246,219,246,227,246,228,246,235,246,256,246,102,247,117,247,120,247,120,247,133,247,219,247,226,247,227,247,234,247,256,247,102,248,118,248,121,248,121,248,132,248,220,248,234,248,256,248,102,249,118,249,130,249,221,249,233,249,256,249,101,250,118,250,129,250,222,250,232,250,255,250,101,251,119,251,127,251,224,251,231,251,255,251,101,252,255,252,102,253,254,253,102,254,254,254,102,255,254,255,103,256,253,256,103,257,253,257,104,258,253,258,104,259,252,259,104,260,252,260,105,261,252,261,105,262,251,262,105,263,251,263,106,264,250,264,106,265,250,265,106,266,249,266,107,267,249,267,107,268,248,268,107,269,248,269,108,270,247,270,108,271,247,271,108,272,246,272,109,273,246,273,110,274,246,274,110,275,245,275,111,276,245,276,111,277,245,277,112,278,245,278,113,279,244,279,113,280,244,280,114,281,243,281,115,282,243,282,115,283,242,283,116,284,242,284,117,285,242,285,118,286,241,286,119,287,137,287,148,287,241,287,120,288,136,288,141,288,144,288,151,288,241,288,121,289,135,289,138,289,241,289,122,290,240,290,124,291,240,291,125,292,240,292,126,293,240,293,128,294,241,294,129,295,242,295,132,296,243,296,132,297,244,297,131,298,245,298,131,299,248,299,130,300,249,300,130,301,250,301,129,302,253,302,129,303,252,303,128,304,252,304,127,305,242,305,245,305,251,305,127,306,240,306,246,306,246,306,249,306,251,306,125,307,238,307,126,308,237,308,125,309,235,309,124,310,234,310,123,311,233,311,122,312,176,312,187,312,232,312,121,313,173,313,191,313,231,313,120,314,171,314,198,314,230,314,119,315,169,315,200,315,230,315,248,315,249,315,118,316,167,316,202,316,229,316,117,317,166,317,204,317,228,317,116,318,124,318,128,318,164,318,206,318,228,318,116,319,123,319,129,319,163,319,208,319,227,319,123,320,124,320,131,320,161,320,209,320,226,320,132,321,160,321,211,321,226,321,129,322,129,322,133,322,159,322,213,322,225,322,134,323,157,323,214,323,225,323,135,324,156,324,215,324,226,324,135,325,155,325,217,325,226,325,136,326,154,326,218,326,225,326,137,327,153,327,219,327,225,327,137,328,152,328,220,328,225,328,137,329,151,329,221,329,225,329,133,330,133,330,137,330,150,330,222,330,225,330,139,331,148,331,139,332,147,332,139,333,146,333,139,334,145,334,139,335,144,335,139,336,143,336,139,337,142,337,139,338,140,338,139,339,139,339," content[3] = "208,2,212,2,209,3,213,3,223,3,225,3,209,4,213,4,222,4,226,4,209,5,214,5,221,5,227,5,209,6,214,6,220,6,227,6,209,7,214,7,219,7,227,7,209,8,214,8,219,8,227,8,209,9,214,9,218,9,226,9,209,10,214,10,218,10,226,10,210,11,214,11,217,11,225,11,210,12,215,12,217,12,225,12,211,13,230,13,212,14,229,14,207,15,207,15,212,15,229,15,206,16,229,16,208,17,229,17,206,18,228,18,205,19,227,19,205,20,225,20,204,21,224,21,204,22,221,22,204,23,208,23,210,23,221,23,204,24,206,24,210,24,222,24,210,25,222,25,210,26,222,26,209,27,215,27,217,27,223,27,209,28,214,28,217,28,223,28,209,29,214,29,217,29,223,29,209,30,213,30,217,30,222,30,210,31,212,31,218,31,221,31,210,32,211,32,219,32,220,32," content[4] = "280,130,283,130,280,131,283,131,278,132,284,132,274,133,285,133,271,134,286,134,268,135,287,135,266,136,288,136,264,137,288,137,262,138,289,138,74,139,75,139,256,139,290,139,72,140,79,140,252,140,290,140,71,141,82,141,249,141,291,141,70,142,90,142,245,142,292,142,69,143,98,143,242,143,292,143,69,144,126,144,213,144,213,144,237,144,292,144,68,145,147,145,213,145,214,145,232,145,293,145,67,146,147,146,213,146,214,146,227,146,293,146,67,147,147,147,213,147,214,147,223,147,293,147,66,148,147,148,213,148,214,148,218,148,283,148,288,148,290,148,293,148,293,148,66,149,147,149,213,149,281,149,65,150,147,150,213,150,278,150,65,151,147,151,213,151,275,151,64,152,147,152,213,152,273,152,64,153,147,153,213,153,270,153,64,154,147,154,213,154,267,154,64,155,147,155,213,155,265,155,64,156,147,156,213,156,262,156,67,157,70,157,75,157,147,157,213,157,260,157,82,158,146,158,213,158,257,158,86,159,145,159,214,159,255,159,93,160,144,160,214,160,252,160,97,161,144,161,214,161,251,161,101,162,144,162,171,162,186,162,211,162,211,162,214,162,249,162,104,163,143,163,169,163,187,163,189,163,190,163,211,163,211,163,215,163,246,163,106,164,143,164,170,164,191,164,215,164,245,164,110,165,143,165,168,165,192,165,215,165,243,165,115,166,143,166,167,166,193,166,215,166,242,166,119,167,142,167,166,167,193,167,216,167,240,167,120,168,142,168,165,168,195,168,216,168,239,168,123,169,142,169,147,169,147,169,164,169,192,169,194,169,203,169,210,169,210,169,217,169,237,169,126,170,141,170,162,170,192,170,196,170,210,170,217,170,235,170,128,171,141,171,159,171,193,171,198,171,205,171,208,171,210,171,217,171,234,171,131,172,141,172,148,172,152,172,156,172,194,172,197,172,210,172,217,172,233,172,133,173,140,173,147,173,159,173,163,173,180,173,183,173,194,173,196,173,210,173,218,173,231,173,135,174,140,174,147,174,160,174,163,174,177,174,186,174,194,174,196,174,211,174,218,174,230,174,136,175,140,175,146,175,175,175,187,175,211,175,218,175,228,175,138,176,139,176,146,176,174,176,188,176,211,176,218,176,227,176,146,177,173,177,188,177,212,177,219,177,226,177,146,178,172,178,188,178,212,178,219,178,224,178,146,179,171,179,181,179,181,179,188,179,212,179,219,179,223,179,146,180,171,180,181,180,181,180,188,180,212,180,219,180,222,180,147,181,170,181,180,181,181,181,188,181,212,181,219,181,221,181,146,182,170,182,180,182,181,182,187,182,213,182,146,183,170,183,187,183,213,183,145,184,170,184,186,184,213,184,147,185,171,185,186,185,213,185,147,186,172,186,184,186,213,186,148,187,174,187,182,187,214,187,148,188,214,188,148,189,214,189,148,190,214,190,148,191,214,191,148,192,214,192,148,193,214,193,148,194,214,194,148,195,214,195,148,196,214,196,148,197,214,197,148,198,178,198,184,198,214,198,148,199,176,199,186,199,214,199,148,200,174,200,189,200,214,200,148,201,173,201,190,201,214,201,148,202,172,202,191,202,214,202,147,203,171,203,190,203,213,203,147,204,170,204,190,204,213,204,147,205,170,205,189,205,213,205,147,206,170,206,188,206,213,206,147,207,172,207,186,207,213,207,146,208,174,208,184,208,213,208,146,209,213,209,146,210,213,210,146,211,213,211,146,212,213,212,145,213,213,213,145,214,213,214,145,215,213,215,145,216,213,216,145,217,214,217,145,218,214,218,145,219,214,219,145,220,165,220,198,220,214,220,145,221,159,221,209,221,214,221,145,222,153,222,214,222,214,222,145,223,149,223,145,224,145,224," content[5] = "151,148,151,148,150,150,150,150,209,152,209,152,147,153,148,153,210,153,210,153,147,154,148,154,146,155,148,155,213,155,214,155,146,156,148,156,213,156,214,156,146,157,148,157,212,157,214,157,145,158,148,158,212,158,214,158,145,159,148,159,211,159,214,159,145,160,148,160,211,160,215,160,144,161,148,161,211,161,215,161,144,162,148,162,210,162,215,162,143,163,148,163,210,163,216,163,143,164,148,164,210,164,216,164,143,165,149,165,209,165,216,165,142,166,150,166,209,166,217,166,141,167,148,167,208,167,217,167,140,168,148,168,209,168,217,168,140,169,148,169,209,169,217,169,140,170,148,170,209,170,218,170,140,171,149,171,208,171,218,171,140,172,149,172,207,172,218,172,139,173,150,173,207,173,208,173,210,173,219,173,139,174,147,174,149,174,150,174,210,174,219,174,138,175,147,175,150,175,150,175,211,175,219,175,138,176,147,176,211,176,219,176,139,177,147,177,211,177,220,177,139,178,147,178,211,178,220,178,138,179,146,179,211,179,220,179,138,180,146,180,212,180,221,180,138,181,146,181,212,181,221,181,137,182,146,182,212,182,221,182,137,183,146,183,212,183,220,183,137,184,144,184,147,184,147,184,212,184,220,184,136,185,144,185,147,185,148,185,212,185,220,185,136,186,144,186,147,186,148,186,213,186,220,186,136,187,143,187,147,187,148,187,213,187,220,187,136,188,143,188,213,188,221,188,135,189,143,189,213,189,221,189,135,190,142,190,213,190,221,190,135,191,142,191,213,191,221,191,135,192,142,192,212,192,221,192,134,193,142,193,212,193,221,193,134,194,142,194,212,194,222,194,134,195,142,195,212,195,222,195,134,196,142,196,212,196,222,196,133,197,141,197,213,197,222,197,133,198,141,198,213,198,222,198,133,199,141,199,213,199,223,199,133,200,141,200,213,200,223,200,133,201,140,201,212,201,223,201,132,202,140,202,212,202,224,202,132,203,140,203,213,203,213,203,215,203,224,203,132,204,139,204,213,204,213,204,215,204,224,204,132,205,139,205,212,205,213,205,215,205,224,205,131,206,139,206,212,206,213,206,215,206,224,206,131,207,139,207,212,207,213,207,215,207,225,207,131,208,139,208,213,208,213,208,216,208,225,208,131,209,139,209,213,209,213,209,216,209,225,209,130,210,139,210,212,210,213,210,216,210,225,210,130,211,138,211,212,211,213,211,216,211,225,211,130,212,138,212,212,212,213,212,216,212,225,212,129,213,138,213,213,213,213,213,216,213,226,213,129,214,138,214,216,214,226,214,128,215,138,215,217,215,226,215,128,216,138,216,217,216,226,216,128,217,137,217,217,217,227,217,128,218,137,218,145,218,145,218,217,218,227,218,127,219,137,219,217,219,227,219,127,220,137,220,217,220,227,220,127,221,137,221,216,221,228,221,127,222,136,222,216,222,228,222,126,223,136,223,218,223,228,223,126,224,138,224,218,224,231,224,125,225,137,225,218,225,221,225,225,225,229,225,125,226,136,226,218,226,220,226,227,226,229,226,125,227,135,227,218,227,220,227,124,228,135,228,218,228,219,228,123,229,130,229,133,229,136,229,218,229,219,229,123,230,128,230,136,230,136,230,123,231,127,231,123,232,125,232,123,233,124,233,123,234,123,234,128,236,128,236,275,301,275,301,267,303,268,303,268,304,269,304,267,305,269,305,267,306,271,306,267,307,272,307,274,307,274,307,267,308,275,308,267,309,275,309,267,310,275,310,267,311,275,311,267,312,275,312,267,313,275,313,267,314,275,314,266,315,275,315,112,316,112,316,265,316,275,316,109,317,113,317,265,317,275,317,108,318,112,318,265,318,275,318,104,319,112,319,265,319,275,319,103,320,112,320,265,320,275,320,102,321,112,321,265,321,275,321,102,322,111,322,265,322,275,322,102,323,111,323,263,323,263,323,265,323,275,323,101,324,110,324,262,324,275,324,101,325,111,325,261,325,275,325,101,326,111,326,260,326,275,326,100,327,111,327,259,327,275,327,100,328,111,328,258,328,275,328,100,329,110,329,258,329,275,329,100,330,112,330,258,330,274,330,100,331,112,331,258,331,274,331,100,332,111,332,257,332,274,332,276,332,276,332,100,333,110,333,257,333,274,333,276,333,276,333,100,334,110,334,257,334,274,334,276,334,276,334,100,335,113,335,118,335,118,335,258,335,274,335,276,335,276,335,100,336,114,336,258,336,273,336,100,337,114,337,257,337,273,337,100,338,115,338,256,338,273,338,100,339,115,339,256,339,273,339,275,339,276,339,100,340,115,340,256,340,256,340,258,340,273,340,275,340,276,340,100,341,115,341,259,341,273,341,275,341,275,341,100,342,115,342,254,342,254,342,260,342,272,342,100,343,115,343,253,343,253,343,260,343,272,343,101,344,115,344,259,344,272,344,274,344,275,344,101,345,115,345,259,345,272,345,274,345,275,345,101,346,115,346,258,346,272,346,274,346,275,346,101,347,114,347,116,347,116,347,257,347,271,347,274,347,274,347,102,348,113,348,256,348,271,348,273,348,273,348,101,349,112,349,251,349,251,349,255,349,270,349,273,349,273,349,101,350,112,350,251,350,252,350,254,350,270,350,272,350,273,350,102,351,113,351,252,351,269,351,272,351,274,351,102,352,113,352,252,352,268,352,273,352,273,352,103,353,114,353,252,353,268,353,103,354,114,354,252,354,267,354,104,355,114,355,252,355,267,355,270,355,271,355,105,356,114,356,252,356,266,356,269,356,269,356,106,357,115,357,252,357,265,357,268,357,268,357,107,358,115,358,252,358,264,358,107,359,115,359,253,359,263,359,267,359,267,359,108,360,115,360,253,360,263,360,107,361,115,361,117,361,118,361,253,361,262,361,107,362,117,362,254,362,262,362,109,363,117,363,254,363,261,363,109,364,117,364,255,364,261,364,109,365,117,365,255,365,260,365,264,365,264,365,109,366,117,366,255,366,260,366,263,366,263,366,109,367,117,367,257,367,259,367,262,367,262,367,109,368,116,368,258,368,259,368,109,369,116,369,259,369,260,369,109,370,115,370,109,371,114,371,109,372,113,372,109,373,112,373,109,374,110,374,100,382,102,382," content[6] = "215,14,219,14,215,15,219,15,214,16,219,16,214,17,219,17,214,18,219,18,214,19,219,19,213,20,219,20,215,21,217,21,169,23,174,23,169,24,174,24,168,25,174,25,166,26,174,26,164,27,174,27,162,28,174,28,160,29,174,29,158,30,174,30,156,31,174,31,154,32,174,32,153,33,174,33,151,34,174,34,150,35,176,35,147,36,176,36,147,37,176,37,145,38,176,38,144,39,176,39,142,40,176,40,141,41,175,41,139,42,174,42,138,43,173,43,137,44,173,44,137,45,172,45,136,46,171,46,135,47,169,47,134,48,169,48,133,49,168,49,132,50,167,50,132,51,165,51,132,52,164,52,132,53,163,53,133,54,162,54,134,55,161,55,135,56,160,56,136,57,159,57,137,58,156,58,138,59,152,59,139,60,145,60,138,61,140,61,153,105,157,105,168,105,173,105,167,106,175,106,169,107,176,107,195,107,195,107,200,107,201,107,169,108,176,108,194,108,201,108,168,109,177,109,193,109,201,109,168,110,177,110,192,110,201,110,168,111,178,111,191,111,202,111,167,112,180,112,189,112,203,112,166,113,203,113,165,114,204,114,164,115,167,115,169,115,203,115,162,116,166,116,170,116,198,116,200,116,204,116,158,117,168,117,171,117,197,117,201,117,205,117,207,117,212,117,156,118,169,118,172,118,196,118,199,118,212,118,155,119,169,119,174,119,194,119,199,119,211,119,155,120,170,120,173,120,195,120,198,120,210,120,156,121,171,121,175,121,193,121,197,121,209,121,156,122,171,122,173,122,173,122,177,122,191,122,197,122,209,122,156,123,171,123,179,123,189,123,194,123,194,123,197,123,208,123,210,123,210,123,157,124,172,124,182,124,187,124,196,124,207,124,158,125,172,125,196,125,207,125,159,126,172,126,195,126,206,126,159,127,172,127,190,127,190,127,195,127,207,127,160,128,173,128,194,128,205,128,207,128,207,128,163,129,173,129,193,129,204,129,165,130,173,130,191,130,191,130,193,130,203,130,166,131,174,131,176,131,176,131,191,131,202,131,167,132,176,132,190,132,201,132,168,133,177,133,190,133,201,133,166,134,166,134,169,134,178,134,189,134,200,134,170,135,179,135,186,135,199,135,170,136,180,136,184,136,198,136,171,137,197,137,171,138,197,138,170,139,195,139,170,140,195,140,197,140,197,140,170,141,194,141,170,142,194,142,170,143,194,143,197,143,198,143,148,144,153,144,161,144,161,144,170,144,194,144,199,144,199,144,211,144,213,144,147,145,153,145,170,145,194,145,200,145,203,145,212,145,213,145,147,146,153,146,157,146,157,146,170,146,194,146,206,146,206,146,211,146,214,146,147,147,153,147,166,147,166,147,168,147,168,147,171,147,193,147,206,147,206,147,210,147,214,147,147,148,152,148,167,148,168,148,171,148,193,148,200,148,206,148,209,148,214,148,147,149,151,149,167,149,168,149,171,149,192,149,200,149,206,149,209,149,215,149,147,150,150,150,165,150,166,150,172,150,191,150,200,150,206,150,209,150,215,150,147,151,147,151,163,151,167,151,173,151,191,151,200,151,205,151,209,151,215,151,147,152,147,152,163,152,168,152,174,152,189,152,193,152,195,152,200,152,204,152,209,152,215,152,148,153,148,153,154,153,159,153,163,153,169,153,175,153,188,153,192,153,196,153,210,153,215,153,153,154,160,154,163,154,170,154,178,154,186,154,190,154,196,154,212,154,214,154,153,155,160,155,163,155,170,155,175,155,175,155,188,155,195,155,212,155,213,155,152,156,160,156,163,156,169,156,175,156,175,156,177,156,179,156,183,156,184,156,188,156,195,156,199,156,201,156,212,156,212,156,152,157,160,157,164,157,168,157,173,157,174,157,177,157,179,157,187,157,194,157,197,157,203,157,212,157,212,157,152,158,159,158,171,158,174,158,177,158,179,158,186,158,186,158,188,158,193,158,197,158,203,158,212,158,212,158,154,159,159,159,171,159,174,159,197,159,204,159,208,159,212,159,154,160,158,160,170,160,174,160,176,160,176,160,181,160,181,160,196,160,203,160,206,160,211,160,155,161,157,161,162,161,165,161,170,161,174,161,176,161,176,161,196,161,202,161,206,161,211,161,161,162,166,162,169,162,173,162,180,162,182,162,186,162,186,162,192,162,194,162,197,162,201,162,205,162,211,162,160,163,166,163,170,163,172,163,190,163,195,163,205,163,211,163,158,164,166,164,170,164,172,164,178,164,178,164,188,164,196,164,205,164,211,164,149,165,149,165,158,165,166,165,169,165,170,165,189,165,196,165,205,165,210,165,149,166,151,166,158,166,169,166,190,166,196,166,200,166,203,166,206,166,210,166,149,167,152,167,159,167,167,167,190,167,196,167,199,167,203,167,207,167,210,167,149,168,153,168,159,168,166,168,191,168,191,168,194,168,205,168,209,168,209,168,149,169,154,169,160,169,166,169,191,169,192,169,196,169,204,169,149,170,154,170,160,170,165,170,192,170,192,170,198,170,205,170,149,171,154,171,161,171,161,171,164,171,165,171,198,171,205,171,149,172,153,172,164,172,165,172,179,172,184,172,192,172,192,172,199,172,206,172,150,173,152,173,155,173,155,173,177,173,187,173,204,173,206,173,149,174,154,174,175,174,187,174,193,174,193,174,150,175,152,175,173,175,188,175,150,176,152,176,173,176,189,176,173,177,189,177,172,178,189,178,171,179,189,179,171,180,189,180,170,181,189,181,170,182,188,182,170,183,188,183,170,184,187,184,171,185,186,185,172,186,185,186,173,187,184,187,174,188,182,188,177,189,181,189,180,197,182,197,178,198,188,198,176,199,189,199,174,200,190,200,173,201,191,201,172,202,191,202,171,203,191,203,170,204,191,204,170,205,191,205,170,206,190,206,171,207,189,207,172,208,188,208,175,209,186,209,177,210,184,210,220,223,228,223,220,224,228,224,220,225,229,225,219,226,230,226,131,227,135,227,217,227,231,227,129,228,136,228,217,228,231,228,127,229,137,229,217,229,232,229,126,230,138,230,217,230,233,230,124,231,139,231,217,231,233,231,123,232,139,232,217,232,234,232,122,233,139,233,217,233,234,233,121,234,140,234,217,234,235,234,120,235,140,235,217,235,235,235,120,236,140,236,217,236,235,236,120,237,139,237,217,237,236,237,119,238,139,238,217,238,236,238,119,239,139,239,217,239,236,239,118,240,139,240,217,240,236,240,117,241,138,241,217,241,236,241,117,242,130,242,132,242,137,242,217,242,236,242,117,243,129,243,132,243,137,243,217,243,236,243,117,244,129,244,131,244,136,244,217,244,236,244,117,245,136,245,217,245,223,245,225,245,236,245,117,246,119,246,121,246,135,246,217,246,226,246,228,246,236,246,117,247,119,247,121,247,134,247,218,247,224,247,228,247,236,247,117,248,120,248,124,248,134,248,218,248,235,248,117,249,133,249,218,249,235,249,117,250,132,250,220,250,234,250,117,251,130,251,221,251,234,251,117,252,129,252,222,252,233,252,118,253,127,253,223,253,231,253,121,254,124,254,224,254,224,254,228,254,230,254," content[7] = "153,143,154,143,154,144,159,144,206,144,213,144,155,145,161,145,205,145,213,145,155,146,163,146,194,146,196,146,205,146,214,146,154,147,165,147,194,147,198,147,204,147,213,147,152,148,165,148,193,148,200,148,206,148,210,148,213,148,213,148,147,149,147,149,150,149,166,149,193,149,199,149,206,149,209,149,213,149,213,149,147,150,165,150,167,150,167,150,193,150,199,150,205,150,209,150,213,150,213,150,147,151,163,151,168,151,172,151,192,151,199,151,204,151,209,151,213,151,213,151,147,152,163,152,169,152,173,152,192,152,192,152,195,152,210,152,213,152,214,152,147,153,163,153,170,153,175,153,190,153,191,153,195,153,214,153,147,154,154,154,159,154,163,154,170,154,180,154,184,154,185,154,187,154,190,154,195,154,214,154,147,155,153,155,159,155,163,155,170,155,188,155,195,155,214,155,148,156,153,156,159,156,164,156,169,156,176,156,179,156,188,156,194,156,214,156,149,157,153,157,159,157,176,157,179,157,188,157,193,157,198,157,202,157,214,157,149,158,153,158,159,158,197,158,203,158,214,158,150,159,153,159,159,159,171,159,175,159,197,159,203,159,212,159,214,159,214,159,149,160,155,160,158,160,171,160,175,160,196,160,203,160,208,160,211,160,211,160,149,161,170,161,175,161,197,161,202,161,207,161,149,162,161,162,165,162,170,162,174,162,179,162,183,162,206,162,210,162,210,162,149,163,160,163,165,163,171,163,173,163,206,163,149,164,159,164,166,164,172,164,178,164,184,164,186,164,191,164,195,164,205,164,149,165,159,165,166,165,170,165,189,165,192,165,196,165,206,165,209,165,209,165,149,166,159,166,166,166,169,166,190,166,191,166,196,166,210,166,151,167,159,167,165,167,168,167,190,167,190,167,194,167,200,167,202,167,210,167,153,168,160,168,165,168,167,168,191,168,191,168,194,168,199,168,204,168,210,168,154,169,162,169,165,169,167,169,191,169,192,169,196,169,199,169,204,169,210,169,154,170,162,170,165,170,166,170,192,170,192,170,198,170,201,170,205,170,210,170,154,171,161,171,164,171,165,171,192,171,193,171,198,171,200,171,202,171,210,171,153,172,159,172,164,172,164,172,192,172,192,172,198,172,199,172,202,172,210,172,152,173,159,173,205,173,208,173,210,173,210,173,152,174,157,174,159,174,159,174,152,175,154,175,211,175,211,175,211,177,211,177,219,177,219,177," h_content = "213,0,213,0,209,1,212,1,208,2,212,2,221,2,223,2,208,3,208,3,225,3,226,3,208,4,208,4,227,4,227,4,207,6,207,6,207,9,207,9,207,11,209,11,210,12,210,12,210,13,211,13,214,13,214,13,211,14,212,14,215,14,216,14,193,15,208,15,210,15,216,15,184,16,215,16,179,17,193,17,206,17,211,17,213,17,214,17,218,17,219,17,176,18,185,18,205,18,207,18,213,18,214,18,218,18,219,18,174,19,182,19,202,19,202,19,204,19,205,19,168,20,169,20,171,20,179,20,202,20,204,20,169,21,177,21,202,21,204,21,170,22,175,22,202,22,203,22,170,23,174,23,202,23,203,23,170,24,172,24,202,24,203,24,169,25,173,25,167,26,168,26,171,26,173,26,172,27,173,27,174,28,174,28,214,28,214,28,174,29,174,29,214,29,214,29,216,33,216,33,222,33,222,33,171,54,171,54,184,64,194,64,181,65,197,65,178,66,183,66,194,66,199,66,176,67,180,67,197,67,201,67,175,68,178,68,199,68,203,68,173,69,176,69,201,69,205,69,170,70,174,70,202,70,205,70,170,71,173,71,204,71,206,71,169,72,172,72,205,72,207,72,168,73,170,73,207,73,208,73,167,74,169,74,207,74,208,74,167,75,168,75,174,75,176,75,207,75,209,75,166,76,167,76,172,76,176,76,208,76,209,76,165,77,166,77,171,77,175,77,198,77,203,77,208,77,210,77,165,78,165,78,170,78,173,78,199,78,205,78,209,78,210,78,164,79,164,79,169,79,171,79,206,79,206,79,209,79,210,79,162,80,164,80,209,80,211,80,161,81,164,81,209,81,212,81,161,82,163,82,174,82,179,82,209,82,211,82,160,83,163,83,172,83,180,83,199,83,202,83,209,83,210,83,160,84,162,84,170,84,173,84,180,84,181,84,196,84,205,84,209,84,210,84,162,85,162,85,169,85,172,85,181,85,182,85,194,85,198,85,203,85,206,85,209,85,211,85,162,86,162,86,169,86,170,86,181,86,183,86,194,86,196,86,205,86,207,86,209,86,210,86,162,87,162,87,168,87,169,87,182,87,183,87,193,87,195,87,207,87,210,87,162,88,162,88,167,88,169,88,175,88,178,88,182,88,183,88,192,88,194,88,207,88,210,88,162,89,162,89,167,89,168,89,175,89,179,89,183,89,183,89,192,89,194,89,207,89,210,89,162,90,162,90,166,90,167,90,174,90,180,90,183,90,183,90,192,90,194,90,196,90,199,90,207,90,210,90,223,90,223,90,166,91,167,91,174,91,180,91,183,91,183,91,192,91,193,91,195,91,201,91,207,91,210,91,223,91,223,91,161,92,161,92,165,92,166,92,175,92,179,92,182,92,183,92,192,92,193,92,195,92,201,92,207,92,210,92,161,93,161,93,165,93,166,93,176,93,179,93,182,93,183,93,192,93,193,93,195,93,201,93,207,93,210,93,303,93,308,93,161,94,161,94,165,94,166,94,182,94,182,94,192,94,193,94,196,94,200,94,207,94,210,94,302,94,304,94,307,94,310,94,161,95,161,95,166,95,167,95,181,95,182,95,192,95,193,95,197,95,199,95,207,95,210,95,301,95,302,95,308,95,310,95,161,96,161,96,166,96,167,96,179,96,182,96,192,96,194,96,207,96,209,96,300,96,302,96,309,96,310,96,161,97,161,97,166,97,168,97,178,97,181,97,187,97,194,97,207,97,209,97,300,97,301,97,310,97,311,97,161,98,161,98,167,98,168,98,177,98,180,98,184,98,195,98,206,98,209,98,300,98,300,98,311,98,312,98,161,99,161,99,168,99,169,99,175,99,184,99,193,99,198,99,204,99,209,99,300,99,300,99,311,99,313,99,160,100,161,100,169,100,180,100,186,100,186,100,194,100,210,100,300,100,301,100,312,100,313,100,159,101,161,101,170,101,175,101,178,101,180,101,195,101,211,101,301,101,301,101,312,101,313,101,158,102,160,102,165,102,166,102,177,102,179,102,196,102,199,102,201,102,207,102,210,102,211,102,301,102,302,102,312,102,314,102,158,103,158,103,166,103,166,103,177,103,178,103,189,103,189,103,196,103,204,103,212,103,212,103,302,103,303,103,312,103,313,103,157,104,157,104,168,104,168,104,176,104,177,104,196,104,202,104,212,104,212,104,302,104,303,104,312,104,313,104,168,105,173,105,175,105,177,105,196,105,202,105,213,105,213,105,302,105,304,105,312,105,313,105,156,106,156,106,168,106,176,106,195,106,201,106,213,106,213,106,302,106,304,106,312,106,313,106,155,107,155,107,168,107,169,107,174,107,176,107,195,107,201,107,213,107,214,107,302,107,304,107,312,107,313,107,155,108,155,108,168,108,168,108,175,108,176,108,194,108,201,108,214,108,214,108,302,108,303,108,311,108,313,108,339,108,345,108,168,109,168,109,176,109,177,109,194,109,201,109,214,109,215,109,301,109,303,109,311,109,313,109,337,109,346,109,154,110,154,110,168,110,168,110,177,110,177,110,192,110,194,110,200,110,201,110,214,110,215,110,301,110,302,110,311,110,312,110,333,110,337,110,345,110,346,110,154,111,154,111,167,111,168,111,177,111,178,111,191,111,193,111,201,111,202,111,214,111,215,111,300,111,301,111,311,111,312,111,329,111,333,111,345,111,347,111,55,112,59,112,153,112,153,112,166,112,167,112,178,112,180,112,189,112,191,112,201,112,203,112,214,112,215,112,299,112,300,112,310,112,311,112,327,112,331,112,345,112,346,112,51,113,61,113,63,113,63,113,153,113,153,113,165,113,166,113,179,113,182,113,187,113,189,113,202,113,203,113,214,113,215,113,297,113,299,113,310,113,311,113,325,113,329,113,345,113,346,113,49,114,51,114,60,114,63,114,153,114,154,114,164,114,166,114,169,114,170,114,181,114,187,114,203,114,204,114,213,114,214,114,296,114,298,114,310,114,311,114,323,114,326,114,345,114,346,114,47,115,49,115,63,115,63,115,153,115,153,115,163,115,165,115,168,115,168,115,197,115,198,115,213,115,214,115,295,115,297,115,310,115,312,115,321,115,323,115,344,115,345,115,46,116,48,116,61,116,63,116,151,116,154,116,162,116,163,116,167,116,169,116,198,116,199,116,213,116,213,116,294,116,296,116,310,116,313,116,319,116,321,116,343,116,344,116,44,117,45,117,60,117,63,117,151,117,155,117,158,117,161,117,169,117,170,117,198,117,200,117,207,117,212,117,294,117,295,117,310,117,320,117,342,117,343,117,43,118,44,118,59,118,60,118,151,118,160,118,170,118,171,118,197,118,198,118,200,118,200,118,208,118,212,118,293,118,294,118,311,118,317,118,340,118,342,118,42,119,43,119,57,119,59,119,153,119,155,119,170,119,173,119,195,119,198,119,211,119,211,119,293,119,294,119,311,119,312,119,338,119,341,119,41,120,42,120,56,120,57,120,153,120,155,120,171,120,175,120,194,120,197,120,210,120,210,120,293,120,293,120,311,120,312,120,337,120,339,120,40,121,41,121,55,121,56,121,154,121,156,121,172,121,172,121,175,121,177,121,193,121,193,121,196,121,197,121,209,121,209,121,293,121,293,121,311,121,311,121,332,121,337,121,40,122,41,122,54,122,55,122,154,122,157,122,172,122,173,122,177,122,179,122,189,122,191,122,195,122,196,122,208,122,209,122,293,122,294,122,310,122,311,122,328,122,336,122,39,123,40,123,53,123,54,123,155,123,158,123,172,123,173,123,179,123,184,123,187,123,189,123,194,123,196,123,208,123,208,123,210,123,210,123,293,123,294,123,309,123,310,123,325,123,332,123,39,124,40,124,52,124,53,124,155,124,159,124,172,124,173,124,182,124,187,124,194,124,196,124,207,124,207,124,293,124,294,124,308,124,309,124,323,124,329,124,39,125,40,125,52,125,54,125,156,125,157,125,159,125,160,125,173,125,174,125,193,125,195,125,206,125,207,125,291,125,295,125,308,125,308,125,322,125,326,125,39,126,40,126,52,126,53,126,157,126,157,126,159,126,161,126,173,126,175,126,192,126,195,126,205,126,206,126,288,126,295,126,321,126,342,126,39,127,40,127,51,127,52,127,157,127,161,127,173,127,177,127,190,127,194,127,205,127,207,127,209,127,209,127,284,127,289,127,293,127,294,127,339,127,345,127,39,128,40,128,52,128,52,128,157,128,162,128,173,128,179,128,189,128,193,128,204,128,208,128,284,128,287,128,293,128,295,128,343,128,346,128,39,129,40,129,52,129,53,129,159,129,163,129,174,129,192,129,203,129,205,129,207,129,207,129,281,129,285,129,294,129,296,129,345,129,347,129,13,130,21,130,38,130,40,130,52,130,53,130,162,130,164,130,174,130,192,130,202,130,205,130,280,130,282,130,296,130,297,130,347,130,348,130,10,131,24,131,39,131,40,131,53,131,54,131,163,131,165,131,175,131,176,131,178,131,188,131,191,131,191,131,201,131,205,131,279,131,283,131,296,131,297,131,347,131,348,131,10,132,11,132,22,132,27,132,39,132,41,132,54,132,56,132,163,132,166,132,175,132,176,132,180,132,184,132,190,132,191,132,200,132,203,132,278,132,284,132,296,132,298,132,348,132,349,132,9,133,10,133,26,133,31,133,39,133,41,133,55,133,57,133,163,133,167,133,176,133,176,133,190,133,191,133,199,133,203,133,278,133,278,133,283,133,285,133,297,133,298,133,348,133,349,133,9,134,9,134,31,134,42,134,57,134,58,134,164,134,168,134,176,134,177,134,189,134,190,134,198,134,200,134,285,134,286,134,298,134,299,134,348,134,349,134,9,135,9,135,41,135,42,135,58,135,64,135,164,135,168,135,177,135,179,135,186,135,189,135,198,135,200,135,286,135,287,135,298,135,299,135,327,135,330,135,348,135,349,135,9,136,9,136,41,136,42,136,59,136,72,136,164,136,168,136,178,136,180,136,185,136,188,136,197,136,199,136,287,136,287,136,299,136,299,136,324,136,336,136,346,136,349,136,9,137,9,137,41,137,42,137,58,137,75,137,164,137,169,137,180,137,183,137,197,137,198,137,287,137,288,137,299,137,300,137,325,137,348,137,9,138,11,138,42,138,42,138,58,138,59,138,73,138,76,138,164,138,169,138,196,138,197,138,199,138,199,138,288,138,289,138,300,138,300,138,326,138,332,138,338,138,344,138,10,139,12,139,42,139,43,139,57,139,58,139,72,139,76,139,165,139,169,139,196,139,197,139,288,139,290,139,300,139,301,139,329,139,331,139,11,140,14,140,43,140,44,140,56,140,57,140,71,140,79,140,165,140,169,140,196,140,197,140,289,140,290,140,300,140,301,140,331,140,332,140,13,141,21,141,44,141,48,141,55,141,56,141,70,141,77,141,161,141,169,141,195,141,200,141,289,141,291,141,301,141,301,141,332,141,335,141,17,142,24,142,30,142,30,142,54,142,55,142,70,142,70,142,160,142,169,142,195,142,201,142,290,142,292,142,301,142,302,142,305,142,311,142,333,142,337,142,21,143,31,143,54,143,54,143,69,143,69,143,154,143,155,143,158,143,169,143,195,143,204,143,291,143,292,143,301,143,315,143,336,143,337,143,11,144,27,144,53,144,53,144,68,144,69,144,154,144,169,144,195,144,207,144,291,144,292,144,301,144,302,144,314,144,320,144,337,144,339,144,10,145,19,145,43,145,44,145,52,145,53,145,67,145,68,145,154,145,169,145,195,145,207,145,291,145,292,145,301,145,302,145,319,145,322,145,338,145,339,145,6,146,7,146,41,146,43,146,51,146,52,146,67,146,67,146,154,146,154,146,157,146,169,146,194,146,205,146,287,146,293,146,301,146,303,146,322,146,324,146,338,146,340,146,41,147,42,147,51,147,52,147,66,147,67,147,153,147,153,147,160,147,170,147,194,147,206,147,287,147,293,147,302,147,303,147,323,147,327,147,339,147,340,147,3,148,3,148,50,148,51,148,65,148,66,148,152,148,152,148,162,148,170,148,193,148,200,148,287,148,294,148,302,148,303,148,325,148,329,148,339,148,341,148,2,149,2,149,50,149,50,149,65,149,66,149,150,149,151,149,164,149,170,149,193,149,199,149,288,149,294,149,302,149,303,149,328,149,331,149,339,149,341,149,2,150,2,150,50,150,50,150,64,150,66,150,149,150,150,150,164,150,165,150,167,150,171,150,192,150,194,150,198,150,199,150,289,150,294,150,297,150,300,150,302,150,303,150,329,150,333,150,340,150,341,150,2,151,2,151,33,151,33,151,49,151,50,151,64,151,65,151,168,151,172,151,191,151,194,151,199,151,199,151,289,151,295,151,297,151,297,151,300,151,300,151,302,151,304,151,331,151,340,151,2,152,4,152,31,152,32,152,49,152,49,152,63,152,65,152,169,152,173,152,190,152,192,152,195,152,195,152,290,152,295,152,297,152,297,152,303,152,304,152,334,152,340,152,3,153,5,153,29,153,31,153,49,153,49,153,63,153,64,153,170,153,175,153,188,153,191,153,195,153,195,153,290,153,295,153,297,153,298,153,300,153,300,153,303,153,304,153,4,154,7,154,26,154,29,154,48,154,49,154,62,154,66,154,171,154,171,154,174,154,180,154,184,154,190,154,291,154,295,154,297,154,300,154,303,154,304,154,8,155,11,155,24,155,27,155,45,155,48,155,62,155,74,155,170,155,170,155,175,155,188,155,291,155,295,155,302,155,304,155,11,156,25,156,43,156,48,156,61,156,75,156,152,156,152,156,176,156,176,156,180,156,180,156,183,156,188,156,292,156,295,156,300,156,304,156,20,157,24,157,40,157,43,157,47,157,48,157,61,157,71,157,73,157,75,157,152,157,152,157,179,157,179,157,185,157,188,157,292,157,295,157,297,157,301,157,19,158,20,158,38,158,41,158,47,158,47,158,60,158,69,158,152,158,152,158,203,158,203,158,293,158,300,158,17,159,19,159,37,159,40,159,46,159,47,159,60,159,68,159,293,159,298,159,15,160,17,160,35,160,38,160,46,160,47,160,59,160,68,160,14,161,15,161,34,161,37,161,45,161,47,161,59,161,67,161,164,161,164,161,170,161,170,161,12,162,13,162,33,162,35,162,45,162,47,162,59,162,66,162,10,163,12,163,31,163,34,163,45,163,46,163,51,163,52,163,58,163,65,163,10,164,10,164,29,164,32,164,45,164,46,164,49,164,53,164,58,164,65,164,8,165,9,165,27,165,30,165,44,165,46,165,49,165,49,165,53,165,53,165,58,165,63,165,7,166,8,166,25,166,29,166,44,166,45,166,48,166,49,166,52,166,53,166,57,166,63,166,7,167,7,167,22,167,26,167,43,167,45,167,48,167,51,167,57,167,62,167,7,168,7,168,18,168,24,168,43,168,44,168,57,168,61,168,7,169,20,169,43,169,44,169,57,169,60,169,8,170,18,170,42,170,43,170,57,170,59,170,11,171,13,171,42,171,45,171,56,171,59,171,43,172,49,172,56,172,58,172,47,173,58,173,52,174,57,174,278,271,286,271,277,272,289,272,276,273,276,273,287,273,291,273,273,274,273,274,290,274,294,274,272,275,272,275,289,275,297,275,271,276,271,276,287,276,299,276,269,277,270,277,287,277,292,277,297,277,300,277,269,278,270,278,286,278,291,278,298,278,300,278,268,279,269,279,285,279,290,279,299,279,301,279,268,280,268,280,284,280,289,280,299,280,301,280,267,281,268,281,284,281,288,281,300,281,301,281,94,282,99,282,266,282,267,282,283,282,287,282,300,282,301,282,93,283,100,283,266,283,267,283,282,283,286,283,301,283,302,283,92,284,93,284,99,284,101,284,266,284,267,284,282,284,286,284,301,284,302,284,91,285,91,285,100,285,104,285,265,285,266,285,281,285,285,285,301,285,302,285,90,286,90,286,101,286,108,286,265,286,266,286,281,286,284,286,301,286,302,286,89,287,90,287,101,287,104,287,106,287,110,287,116,287,119,287,265,287,266,287,280,287,281,287,283,287,284,287,302,287,302,287,88,288,89,288,102,288,104,288,108,288,111,288,118,288,120,288,265,288,266,288,280,288,281,288,283,288,283,288,302,288,302,288,87,289,88,289,102,289,105,289,110,289,112,289,119,289,120,289,265,289,266,289,279,289,280,289,283,289,283,289,302,289,302,289,87,290,88,290,102,290,103,290,105,290,105,290,111,290,113,290,120,290,121,290,265,290,265,290,279,290,280,290,282,290,282,290,302,290,302,290,86,291,87,291,102,291,103,291,105,291,105,291,112,291,114,291,121,291,121,291,265,291,265,291,278,291,279,291,282,291,282,291,302,291,302,291,85,292,86,292,103,292,103,292,105,292,105,292,113,292,115,292,120,292,125,292,265,292,265,292,278,292,279,292,282,292,282,292,302,292,302,292,85,293,86,293,103,293,103,293,105,293,105,293,114,293,115,293,124,293,127,293,265,293,265,293,278,293,279,293,281,293,282,293,302,293,302,293,85,294,85,294,103,294,103,294,105,294,105,294,114,294,116,294,127,294,127,294,265,294,265,294,277,294,278,294,281,294,282,294,302,294,302,294,84,295,84,295,103,295,103,295,105,295,105,295,115,295,117,295,265,295,265,295,277,295,278,295,281,295,282,295,84,296,84,296,103,296,103,296,105,296,105,296,115,296,118,296,265,296,266,296,277,296,278,296,280,296,282,296,83,297,83,297,102,297,103,297,105,297,105,297,116,297,118,297,265,297,266,297,277,297,277,297,280,297,282,297,83,298,83,298,102,298,103,298,105,298,105,298,117,298,118,298,265,298,266,298,276,298,277,298,280,298,281,298,294,298,294,298,82,299,82,299,102,299,103,299,105,299,105,299,117,299,118,299,265,299,266,299,276,299,276,299,280,299,281,299,295,299,295,299,81,300,82,300,102,300,103,300,105,300,105,300,117,300,119,300,265,300,266,300,275,300,276,300,280,300,281,300,295,300,295,300,302,300,302,300,81,301,82,301,102,301,103,301,105,301,105,301,118,301,119,301,249,301,252,301,275,301,276,301,280,301,281,301,292,301,292,301,295,301,295,301,302,301,302,301,81,302,81,302,102,302,103,302,105,302,105,302,118,302,119,302,250,302,254,302,266,302,266,302,275,302,276,302,280,302,281,302,293,302,293,302,295,302,295,302,302,302,302,302,80,303,81,303,102,303,103,303,105,303,105,303,118,303,119,303,246,303,255,303,275,303,276,303,279,303,280,303,290,303,290,303,293,303,293,303,295,303,295,303,302,303,302,303,80,304,81,304,101,304,102,304,105,304,105,304,118,304,119,304,244,304,255,304,266,304,266,304,268,304,269,304,275,304,276,304,279,304,280,304,289,304,289,304,293,304,293,304,295,304,295,304,302,304,302,304,80,305,80,305,101,305,102,305,105,305,105,305,118,305,119,305,242,305,243,305,245,305,255,305,268,305,269,305,274,305,275,305,279,305,280,305,289,305,289,305,293,305,293,305,295,305,295,305,302,305,302,305,79,306,80,306,101,306,102,306,105,306,105,306,118,306,118,306,240,306,240,306,246,306,255,306,265,306,266,306,274,306,275,306,278,306,280,306,289,306,289,306,292,306,293,306,295,306,295,306,302,306,302,306,79,307,79,307,101,307,102,307,105,307,105,307,118,307,118,307,238,307,238,307,247,307,255,307,265,307,266,307,271,307,272,307,274,307,275,307,278,307,280,307,292,307,292,307,301,307,302,307,79,308,79,308,101,308,102,308,105,308,105,308,117,308,118,308,236,308,237,308,247,308,254,308,265,308,266,308,272,308,272,308,274,308,275,308,278,308,280,308,288,308,288,308,301,308,302,308,79,309,79,309,101,309,102,309,105,309,105,309,117,309,117,309,235,309,236,309,243,309,254,309,265,309,265,309,274,309,275,309,278,309,279,309,288,309,288,309,294,309,294,309,301,309,302,309,101,310,101,310,104,310,105,310,116,310,117,310,234,310,235,310,242,310,243,310,248,310,254,310,265,310,265,310,274,310,275,310,278,310,279,310,288,310,288,310,294,310,294,310,301,310,303,310,101,311,101,311,104,311,105,311,116,311,117,311,233,311,234,311,241,311,242,311,249,311,253,311,265,311,266,311,274,311,274,311,278,311,279,311,289,311,289,311,293,311,293,311,301,311,302,311,100,312,101,312,104,312,105,312,115,312,116,312,120,312,120,312,232,312,233,312,239,312,240,312,250,312,253,312,265,312,266,312,274,312,274,312,278,312,279,312,289,312,289,312,293,312,293,312,301,312,302,312,100,313,100,313,104,313,104,313,114,313,115,313,120,313,121,313,231,313,232,313,238,313,239,313,250,313,254,313,265,313,266,313,274,313,274,313,278,313,279,313,289,313,289,313,291,313,292,313,300,313,301,313,100,314,100,314,114,314,115,314,119,314,120,314,230,314,231,314,237,314,237,314,251,314,254,314,264,314,266,314,274,314,274,314,278,314,279,314,300,314,301,314,99,315,100,315,113,315,114,315,118,315,119,315,194,315,194,315,229,315,230,315,236,315,237,315,248,315,255,315,266,315,267,315,274,315,274,315,278,315,279,315,300,315,301,315,99,316,100,316,112,316,113,316,117,316,118,316,228,316,229,316,235,316,236,316,245,316,249,316,253,316,256,316,267,316,267,316,274,316,274,316,278,316,278,316,299,316,300,316,77,317,77,317,98,317,99,317,111,317,112,317,116,317,124,317,127,317,128,317,228,317,228,317,235,317,235,317,244,317,245,317,255,317,258,317,268,317,268,317,274,317,274,317,278,317,278,317,299,317,300,317,77,318,77,318,98,318,99,318,111,318,112,318,115,318,123,318,128,318,130,318,227,318,228,318,234,318,234,318,243,318,244,318,256,318,258,318,274,318,274,318,278,318,278,318,299,318,300,318,77,319,77,319,98,319,99,319,102,319,102,319,111,319,112,319,115,319,123,319,130,319,131,319,226,319,227,319,233,319,234,319,242,319,242,319,255,319,259,319,269,319,269,319,274,319,274,319,278,319,278,319,298,319,299,319,98,320,99,320,102,320,102,320,104,320,105,320,111,320,112,320,115,320,122,320,132,320,132,320,226,320,226,320,233,320,233,320,241,320,241,320,253,320,260,320,274,320,274,320,277,320,278,320,298,320,299,320,97,321,99,321,102,321,102,321,111,321,112,321,115,321,122,321,126,321,126,321,133,321,133,321,225,321,226,321,232,321,233,321,240,321,240,321,252,321,252,321,258,321,261,321,264,321,264,321,274,321,274,321,277,321,278,321,298,321,298,321,76,322,76,322,97,322,98,322,102,322,102,322,111,322,111,322,115,322,121,322,128,322,128,322,133,322,134,322,225,322,225,322,231,322,232,322,240,322,240,322,251,322,251,322,259,322,264,322,274,322,274,322,277,322,278,322,297,322,298,322,76,323,76,323,97,323,98,323,102,323,102,323,111,323,111,323,115,323,120,323,128,323,129,323,135,323,135,323,224,323,225,323,231,323,232,323,239,323,239,323,249,323,250,323,259,323,264,323,274,323,274,323,277,323,278,323,297,323,298,323,76,324,76,324,97,324,98,324,110,324,110,324,115,324,118,324,129,324,130,324,135,324,135,324,224,324,226,324,231,324,232,324,238,324,238,324,248,324,249,324,258,324,265,324,274,324,274,324,277,324,278,324,296,324,297,324,76,325,76,325,96,325,97,325,101,325,101,325,110,325,111,325,115,325,118,325,130,325,130,325,136,325,136,325,224,325,227,325,231,325,231,325,237,325,237,325,247,325,248,325,257,325,265,325,274,325,274,325,277,325,278,325,296,325,297,325,76,326,76,326,96,326,97,326,101,326,101,326,109,326,109,326,111,326,111,326,115,326,116,326,136,326,136,326,223,326,228,326,231,326,231,326,237,326,237,326,247,326,248,326,256,326,257,326,259,326,264,326,274,326,274,326,277,326,278,326,295,326,296,326,76,327,76,327,96,327,97,327,111,327,111,327,115,327,115,327,123,327,123,327,137,327,137,327,221,327,221,327,223,327,229,327,231,327,231,327,237,327,237,327,246,327,247,327,255,327,256,327,259,327,261,327,263,327,263,327,273,327,274,327,277,327,278,327,295,327,296,327,76,328,76,328,96,328,97,328,106,328,106,328,137,328,137,328,221,328,231,328,236,328,236,328,246,328,246,328,254,328,255,328,258,328,260,328,273,328,274,328,277,328,277,328,294,328,295,328,76,329,76,329,95,329,97,329,105,329,105,329,133,329,133,329,137,329,138,329,149,329,149,329,221,329,232,329,236,329,236,329,245,329,245,329,254,329,254,329,258,329,259,329,273,329,274,329,277,329,277,329,294,329,295,329,76,330,77,330,95,330,97,330,100,330,100,330,113,330,113,330,138,330,138,330,148,330,148,330,220,330,228,330,230,330,233,330,236,330,236,330,245,330,245,330,253,330,253,330,258,330,259,330,263,330,263,330,267,330,267,330,273,330,274,330,277,330,277,330,293,330,294,330,76,331,77,331,95,331,96,331,100,331,100,331,110,331,111,331,138,331,138,331,147,331,147,331,223,331,224,331,232,331,234,331,236,331,236,331,244,331,244,331,252,331,253,331,258,331,258,331,263,331,263,331,273,331,274,331,277,331,277,331,292,331,294,331,76,332,77,332,95,332,96,332,100,332,100,332,134,332,134,332,138,332,138,332,233,332,237,332,244,332,244,332,252,332,252,332,258,332,258,332,263,332,263,332,273,332,274,332,277,332,277,332,292,332,293,332,77,333,77,333,95,333,96,333,100,333,100,333,109,333,109,333,134,333,134,333,138,333,138,333,234,333,237,333,243,333,244,333,251,333,251,333,257,333,258,333,263,333,263,333,273,333,274,333,276,333,277,333,291,333,292,333,77,334,78,334,95,334,96,334,100,334,100,334,109,334,109,334,118,334,118,334,129,334,129,334,134,334,134,334,138,334,138,334,235,334,237,334,243,334,243,334,251,334,251,334,257,334,258,334,263,334,263,334,273,334,274,334,276,334,277,334,290,334,292,334,78,335,78,335,95,335,96,335,100,335,100,335,108,335,113,335,129,335,130,335,134,335,134,335,138,335,138,335,237,335,238,335,243,335,243,335,250,335,250,335,258,335,258,335,273,335,274,335,276,335,277,335,290,335,291,335,78,336,79,336,95,336,96,336,110,336,110,336,112,336,114,336,129,336,130,336,134,336,138,336,238,336,239,336,243,336,243,336,249,336,250,336,258,336,258,336,273,336,273,336,276,336,277,336,289,336,290,336,79,337,80,337,95,337,96,337,113,337,114,337,129,337,130,337,134,337,138,337,140,337,141,337,239,337,240,337,243,337,243,337,249,337,250,337,258,337,258,337,273,337,273,337,276,337,277,337,288,337,290,337,80,338,81,338,95,338,96,338,114,338,114,338,129,338,130,338,134,338,141,338,240,338,243,338,249,338,249,338,256,338,258,338,276,338,277,338,288,338,289,338,80,339,81,339,95,339,96,339,109,339,109,339,129,339,130,339,133,339,141,339,241,339,243,339,248,339,249,339,256,339,256,339,275,339,277,339,287,339,288,339,80,340,82,340,95,340,96,340,115,340,115,340,129,340,141,340,241,340,244,340,248,340,249,340,255,340,256,340,259,340,259,340,272,340,272,340,275,340,276,340,286,340,288,340,81,341,83,341,95,341,97,341,115,341,115,341,129,341,137,341,242,341,244,341,248,341,249,341,254,341,254,341,272,341,272,341,275,341,276,341,286,341,287,341,83,342,84,342,96,342,97,342,115,342,115,342,130,342,135,342,243,342,245,342,248,342,248,342,254,342,254,342,260,342,260,342,272,342,272,342,275,342,276,342,285,342,286,342,83,343,85,343,96,343,97,343,100,343,100,343,115,343,115,343,129,343,130,343,244,343,248,343,253,343,253,343,260,343,260,343,271,343,272,343,275,343,276,343,284,343,286,343,84,344,86,344,96,344,97,344,100,344,100,344,115,344,115,344,122,344,122,344,130,344,130,344,245,344,248,344,259,344,260,344,271,344,272,344,274,344,276,344,284,344,285,344,86,345,87,345,96,345,98,345,100,345,100,345,115,345,115,345,122,345,122,345,129,345,129,345,246,345,248,345,252,345,252,345,259,345,259,345,271,345,272,345,274,345,275,345,283,345,284,345,87,346,89,346,97,346,98,346,114,346,115,346,128,346,128,346,246,346,249,346,251,346,252,346,270,346,272,346,274,346,275,346,283,346,285,346,88,347,90,347,97,347,98,347,101,347,101,347,126,347,126,347,245,347,245,347,247,347,251,347,257,347,258,347,270,347,271,347,274,347,275,347,282,347,285,347,89,348,91,348,97,348,98,348,101,348,101,348,128,348,128,348,248,348,251,348,256,348,257,348,270,348,271,348,273,348,274,348,281,348,287,348,91,349,92,349,98,349,99,349,101,349,102,349,126,349,126,349,249,349,251,349,255,349,256,349,269,349,270,349,273,349,289,349,92,350,92,350,98,350,99,350,101,350,102,350,112,350,112,350,124,350,125,350,127,350,127,350,250,350,250,350,254,350,255,350,269,350,270,350,272,350,277,350,281,350,289,350,92,351,93,351,98,351,99,351,102,351,102,351,112,351,112,351,123,351,124,351,251,351,251,351,253,351,254,351,268,351,269,351,272,351,288,351,92,352,94,352,99,352,100,352,102,352,103,352,113,352,113,352,253,352,253,352,268,352,268,352,273,352,279,352,284,352,287,352,91,353,95,353,99,353,100,353,113,353,113,353,119,353,119,353,123,353,123,353,253,353,253,353,273,353,277,353,284,353,286,353,90,354,91,354,94,354,95,354,100,354,101,354,104,354,104,354,114,354,114,354,119,354,119,354,122,354,122,354,267,354,267,354,272,354,275,354,283,354,285,354,89,355,90,355,96,355,97,355,100,355,101,355,104,355,105,355,114,355,114,355,266,355,267,355,270,355,272,355,283,355,284,355,89,356,90,356,97,356,98,356,101,356,102,356,105,356,105,356,114,356,114,356,120,356,121,356,265,356,266,356,269,356,271,356,282,356,283,356,90,357,91,357,98,357,99,357,101,357,102,357,105,357,106,357,114,357,114,357,119,357,120,357,264,357,265,357,268,357,270,357,281,357,282,357,90,358,90,358,93,358,93,358,99,358,103,358,106,358,106,358,115,358,115,358,119,358,120,358,263,358,264,358,268,358,269,358,280,358,282,358,90,359,90,359,94,359,95,359,101,359,103,359,106,359,107,359,115,359,115,359,252,359,253,359,263,359,263,359,268,359,268,359,279,359,281,359,95,360,97,360,102,360,104,360,107,360,107,360,118,360,119,360,252,360,253,360,262,360,263,360,267,360,267,360,279,360,280,360,97,361,97,361,104,361,105,361,107,361,108,361,119,361,119,361,253,361,254,361,266,361,266,361,278,361,280,361,99,362,99,362,103,362,105,362,108,362,108,362,117,362,117,362,253,362,254,362,261,362,261,362,265,362,266,362,277,362,279,362,100,363,105,363,108,363,108,363,116,363,118,363,265,363,265,363,276,363,278,363,100,364,102,364,108,364,109,364,116,364,119,364,254,364,255,364,260,364,260,364,265,364,265,364,275,364,277,364,91,365,91,365,100,365,101,365,108,365,109,365,116,365,117,365,259,365,260,365,264,365,264,365,274,365,277,365,91,366,91,366,101,366,101,366,109,366,109,366,116,366,117,366,256,366,256,366,259,366,260,366,263,366,264,366,273,366,276,366,91,367,91,367,101,367,102,367,109,367,109,367,116,367,117,367,255,367,256,367,258,367,259,367,262,367,263,367,273,367,275,367,91,368,91,368,101,368,102,368,109,368,109,368,116,368,117,368,257,368,259,368,262,368,263,368,272,368,274,368,92,369,92,369,102,369,102,369,109,369,109,369,117,369,117,369,258,369,260,369,262,369,263,369,269,369,272,369,92,370,92,370,102,370,103,370,109,370,109,370,116,370,116,370,259,370,263,370,267,370,271,370,92,371,93,371,102,371,103,371,109,371,109,371,115,371,115,371,260,371,269,371,92,372,93,372,103,372,103,372,109,372,109,372,112,372,112,372,114,372,114,372,262,372,267,372,93,373,94,373,103,373,103,373,109,373,110,373,113,373,113,373,94,374,94,374,103,374,103,374,109,374,111,374,94,375,94,375,103,375,103,375,109,375,110,375,95,376,95,376,103,376,104,376,108,376,109,376,95,377,96,377,103,377,104,377,106,377,109,377,96,378,97,378,103,378,108,378,96,379,98,379,103,379,106,379,97,380,99,380,102,380,105,380,98,381,103,381,99,382,102,382," Timer.Interval = 100 Timer.Tick = CallHyperThread color = "1=red;2=lime;3=purple;4=cyan;5=brown;6=yellow;7=magenta" For i = 1 To Array.GetItemCount(color) j = 0 While content[i] <> "" j = j + 1 comma = Text.GetIndexOf(content[i], ",") x_1[j] = Text.GetSubText(content[i], 1, comma - 1) content[i] = Text.GetSubTextToEnd(content[i], comma + 1) comma = Text.GetIndexOf(content[i], ",") y_1[j] = Text.GetSubText(content[i], 1, comma - 1) content[i] = Text.GetSubTextToEnd(content[i], comma + 1) comma = Text.GetIndexOf(content[i], ",") x_2[j] = Text.GetSubText(content[i], 1, comma - 1) content[i] = Text.GetSubTextToEnd(content[i], comma + 1) comma = Text.GetIndexOf(content[i], ",") y_2[j] = Text.GetSubText(content[i], 1, comma - 1) content[i] = Text.GetSubTextToEnd(content[i], comma + 1) EndWhile GraphicsWindow.PenWidth = 1 GraphicsWindow.PenColor = color[i] For k = 1 To Array.GetItemCount(x_1) GraphicsWindow.DrawLine(x_1[k], y_1[k], x_2[k], y_2[k]) EndFor x_1 = "" y_1 = "" x_2 = "" y_2 = "" EndFor uiAvailable = "True" message = Shapes.AddText("") While uiAvailable <> "True" Or hyperComplete <> "True" Shapes.SetText(message, "Wait for black! " + percentComplete + "% completed.") Program.Delay(15) EndWhile If hyperComplete And uiAvailable Then GraphicsWindow.PenColor = "black" For k = 1 To Array.GetItemCount(h_x_1) GraphicsWindow.DrawLine(h_x_1[k], h_y_1[k], h_x_2[k], h_y_2[k]) EndFor Shapes.HideShape(message) EndIf Sub CallHyperThread Timer.Pause() totalContent = Text.GetLength(h_content) h_j = 0 While h_content <> "" h_j = h_j + 1 h_comma = Text.GetIndexOf(h_content, ",") h_x_1[h_j] = Text.GetSubText(h_content, 1, h_comma - 1) h_content = Text.GetSubTextToEnd(h_content, h_comma + 1) h_comma = Text.GetIndexOf(h_content, ",") h_y_1[h_j] = Text.GetSubText(h_content, 1, h_comma - 1) h_content = Text.GetSubTextToEnd(h_content, h_comma + 1) h_comma = Text.GetIndexOf(h_content, ",") h_x_2[h_j] = Text.GetSubText(h_content, 1, h_comma - 1) h_content = Text.GetSubTextToEnd(h_content, h_comma + 1) h_comma = Text.GetIndexOf(h_content, ",") h_y_2[h_j] = Text.GetSubText(h_content, 1, h_comma - 1) h_content = Text.GetSubTextToEnd(h_content, h_comma + 1) percentComplete = Math.Round((totalContent - Text.GetLength(h_content)) / totalContent * 100) EndWhile hyperComplete = "True" EndSub End>LDD298-1.sb< Start>LDD643.sb< GraphicsWindow.BackgroundColor="teal GraphicsWindow.Title = "Truncated Icosahedron" Init() cli=0 clr="0=darkblue;1=white GraphicsWindow.MouseDown=mmm r = 2 dx = 35 dy = 100 For i = 1 To 60 point = points[i] x = point["x"] + dx y = point["y"] + dy If i <= 40 Then color = "Black" Else color = "transparent" EndIf GraphicsWindow.BrushColor = color EndFor n = Array.GetItemCount(edges) For j = n To 1 Step -1 edge = edges[j] h = Text.GetIndexOf(edge, "-") ' hyphen i1 = Text.GetSubText(edge, 1, h - 1) i2 = Text.GetSubTextToEnd(edge, h + 1) point = points[i1] x1 = point["x"] + dx y1 = point["y"] + dy point = points[i2] x2 = point["x"] + dx y2 = point["y"] + dy If i1 <= 40 And i2 <= 40 Then GraphicsWindow.PenColor = "Black" Else GraphicsWindow.PenColor = "transparent" EndIf GraphicsWindow.DrawLine(x1, y1, x2, y2) EndFor point = points[1] xo = point["x"] For i = 60 To 1 Step -1 point = points[i] If xo <= point["x"] Then color = "Black" Else color = "SkyBlue" EndIf x = point["z"] + gw / 2 + dx y = point["y"] + dy GraphicsWindow.BrushColor = color EndFor GraphicsWindow.PenColor = "Black" For j = 1 To n edge = edges[j] h = Text.GetIndexOf(edge, "-") ' hyphen i1 = Text.GetSubText(edge, 1, h - 1) i2 = Text.GetSubTextToEnd(edge, h + 1) point = points[i1] x1 = point["x"] y1 = point["y"] + dy z1 = point["z"] + gw / 2 + dx point = points[i2] x2 = point["x"] y2 = point["y"] + dy z2 = point["z"] + gw / 2 + dx If xo <= x1 And xo <= x2 Then GraphicsWindow.DrawLine(z1, y1, z2, y2) Program.Delay(55) EndIf EndFor Sub mmm If Mouse.IsRightButtonDown Then cli=1-cli Else LDGraphicsWindow.FloodFill(GraphicsWindow.MouseX GraphicsWindow.MouseY clr[cli]) EndIf EndSub Sub Init gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh po="x=113.90;y=72.21;z=0.00;|x=151.87;y=99.80;z=0.00;|x=137.37;y=144.43;z=0.00;|x=90.44;y=144.43;z=0.00;|x=75.94;y=99.80;z=0.00;|x=113.90;y=32.29;z=24.67;|x=189.84;y=87.46;z=24.67;|x=160.83;y=176.73;z=24.67;|x=66.97;y=176.73;z=24.67;|x=37.97;y=87.46;z=24.67;|x=151.87;y=19.96;z=49.35;|x=189.84;y=47.54;z=49.35;|x=213.30;y=119.76;z=49.35;|x=198.80;y=164.39;z=49.35;|x=137.37;y=209.03;z=49.35;|x=90.44;y=209.03;z=49.35;|x=29.00;y=164.39;z=49.35;|x=14.50;y=119.76;z=49.35;|x=37.97;y=47.54;z=49.35;|x=75.94;y=19.96;z=49.35;|x=137.37;y=0.00;z=89.27;|x=160.83;y=7.62;z=129.19;|x=198.80;y=35.20;z=129.19;|x=213.30;y=55.16;z=89.27;|x=227.80;y=99.80;z=89.27;|x=227.80;y=124.47;z=129.19;|x=213.30;y=169.10;z=129.19;|x=198.80;y=189.07;z=89.27;|x=160.83;y=216.65;z=89.27;|x=137.37;y=224.27;z=129.19;|x=90.44;y=224.27;z=129.19;|x=66.97;y=216.65;z=89.27;|x=29.00;y=189.07;z=89.27;|x=14.50;y=169.10;z=129.19;|x=0.00;y=124.47;z=129.19;|x=0.00;y=99.80;z=89.27;|x=14.50;y=55.16;z=89.27;|x=29.00;y=35.20;z=129.19;|x=66.97;y=7.62;z=129.19;|x=90.44;y=0.00;z=89.27;|x=137.37;y=15.24;z=169.11;|x=198.80;y=59.88;z=169.11;|x=213.30;y=104.51;z=169.11;|x=189.84;y=176.73;z=169.11;|x=151.87;y=204.31;z=169.11;|x=75.94;y=204.31;z=169.11;|x=37.97;y=176.73;z=169.11;|x=14.50;y=104.51;z=169.11;|x=29.00;y=59.88;z=169.11;|x=90.44;y=15.24;z=169.11;|x=160.83;y=47.54;z=193.78;|x=189.84;y=136.33;z=193.92;|x=113.90;y=191.98;z=193.78;|x=37.97;y=136.33;z=193.92;|x=66.97;y=47.54;z=193.78;|x=137.37;y=79.84;z=218.46;|x=151.87;y=124.48;z=218.55;|x=113.90;y=151.62;z=218.61;|x=75.94;y=124.48;z=218.55;|x=90.44;y=79.84;z=218.46 points=LDText.Split(po "|") edges = "1=1-2;2=2-3;3=3-4;4=4-5;5=5-1;6=1-6;7=2-7;8=3-8;9=4-9;10=5-10;11=6-11;12=7-12;13=7-13;14=8-14;15=8-15;16=9-16;17=9-17;18=10-18;19=10-19;20=6-20;21=11-12;22=13-14;23=15-16;24=17-18;25=19-20;26=11-21;27=12-24;28=13-25;29=14-28;30=15-29;31=16-32;32=17-33;33=18-36;34=19-37;35=20-40;36=21-22;37=22-23;38=23-24;39=24-25;40=25-26;41=26-27;42=27-28;43=28-29;44=29-30;45=30-31;46=31-32;47=32-33;48=33-34;49=34-35;50=35-36;51=36-37;52=37-38;53=38-39;54=39-40;55=40-21;56=22-41;57=23-42;58=26-43;59=27-44;60=30-45;61=31-46;62=34-47;63=35-48;64=38-49;65=39-50;66=42-43;67=44-45;68=46-47;69=48-49;70=50-41;71=41-51;72=42-51;73=43-52;74=44-52;75=45-53;76=46-53;77=47-54;78=48-54;79=49-55;80=50-55;81=51-56;82=52-57;83=53-58;84=54-59;85=55-60;86=56-57;87=57-58;88=58-59;89=59-60;90=60-56; EndSub End>LDD643.sb< Start>LDH017.sb< ' Castle ' Version 0.2 ' Copyright © 2015 Nonki Takahashi. The MIT License. ' Last update 2015-07-07 ' GraphicsWindow.BackgroundColor = "#FFFFFF" GraphicsWindow.PenWidth = 0 gw = GraphicsWindow.Width gh = GraphicsWindow.Height Physics_Init() default = "f=0.03;r=0.5;d=1;a=0;c=#999999;w=50;h=50;s=r;o=50;" s[1] = "r=0.8;d=10;x=300;y=100;a=0;c=#666666;w=20;h=20;s=e;" s[2] = "x=300;y=200;a=1;" s[3] = "x=300;y="+(gh-175)+";" s[4] = "x=300;y="+(gh-125)+";" s[5] = "x=300;y="+(gh-75)+";" s[6] = "x=300;y="+(gh-25)+";" For i = 7 To 11 s[i] = s[i-5] s[i]["x"] = 400 EndFor For i = 12 To 16 s[i] = s[i-5] s[i]["x"] = 500 EndFor s[i] = s[i-5] s[i]["w"] = 250 s[i]["h"] = 20 s[i]["x"] = 400 s[i]["y"] = 150 n = i For i = 1 To n CheckDefault() AddShape() EndFor s[i] = "r=0.9;x=0;y=200;c=#FF9900;w=15;h=15;s=e;ix=300;iy=-300;" Timer.Interval = 500 Timer.Tick = OnTick While ("True") t = Clock.ElapsedMilliseconds Physics_DoTimestep() If tick Then GraphicsWindow.Title = i s[i] = s[18] CheckDefault() AddShape() i = i + 1 tick = "False" EndIf dt = _dt * 1000 - (Clock.ElapsedMilliseconds - t) If 0 < dt Then Program.Delay(dt) EndIf EndWhile Sub OnTick tick = "True" EndSub Sub CheckDefault ' param i - index for shape array nDefault = Array.GetItemCount(default) index = Array.GetAllIndices(default) For j = 1 To nDefault If s[i][index[j]] = "" Then s[i][index[j]] = default[index[j]] EndIf EndFor EndSub Sub AddShape ' c - color GraphicsWindow.BrushColor = s[i]["c"] param = s[i] Physics_AddMovingShape() s[i]["id"] = id param = s[i] Physics_SetPositions() ' o - opacity Shapes.SetOpacity(s[i]["id"], s[i]["o"]) If s[i]["ix"] <> "" Then Physics_SetImpulse() EndIf EndSub Sub Physics_AddMovingShape ' param["f"] - friction 0 to 1 ' param["r"] - restitusion 0 to 1 ' param["d"] - density (default 1) ' param["s"] - shape "r", "e" or "t" ' param["w"] - width ' param["h "]- height ' return id - shape id If param["s"] = "r" Then id = Shapes.AddRectangle(param["w"], param["h"]) _m = param["d"] * param["w"] * param["h"] / 100 ElseIf s[i]["s"] = "e" Then id = Shapes.AddEllipse(param["w"], param["h"]) _m = param["d"] * param["w"] * param["h"] * Math.Pi / 400 ElseIf s[i]["s"] = "t" Then id = Shapes.AddTriangle(0, param["h"], param["w"]/2, 0, param["w"], param["h"]) _m = param["d"] * param["w"] * param["h"] / 200 EndIf _s[id] = param _s[id]["m"] = _m EndSub Sub Physics_SetPositions ' param["id"] - shape id ' param["x"] - position (x co-ordinate) ' param["y"] - position (y co-ordinate) _id = param["id"] _s[_id]["x"] = param["x"] _s[_id]["y"] = param["y"] _x = param["x"] - _s[_id]["w"] / 2 _y = param["y"] - _s[_id]["h"] / 2 Shapes.Move(_id, _x, _y) EndSub Sub Physics_SetImpulse ' param["id"] - shape id ' param["ix"] - x component of the impulse ' param["iy"] - y component of the impulse _id = param["id"] _s[_id]["ix"] = param["ix"] _s[_id]["iy"] = param["iy"] EndSub Sub Physics_DoTimestep _n = Array.GetItemCount(_s) _index = Array.GetAllIndices(_s) For _i = 1 To _n _id = _index[_i] _vx = _s[_id]["vx"] _vy = _s[_id]["vy"] _ax = _s[_id]["ix"] / _s[id]["m"] _ay = _s[_id]["iy"] / _s[id]["m"] _s[_id]["vx"] = _vx + _gx * _dt + _ax _s[_id]["vy"] = _vy + _gy * _dt + _ay _s[_id]["ix"] = 0 _s[_id]["iy"] = 0 _x = _s[_id]["x"] + (_s[_id]["vx"] + _vx) * _dt / 2 _y = _s[_id]["y"] + (_s[_id]["vy"] + _vy) * _dt / 2 ' corrision detect with walls If (_x - _s[id]["w"] / 2) <= 0 Then _x = _x - 2 * (_x - _s[id]["w"] / 2) _s[_id]["vx"] = -_s[_id]["vx"] * _s[_id]["r"] ElseIf gw <= (_x + _s[id]["w"] / 2) Then _x = _x - 2 * (_x + _s[id]["w"] / 2 - gw) _s[_id]["vx"] = -_s[_id]["vx"] * _s[_id]["r"] EndIf If (_y - _s[id]["h"] / 2) <= 0 Then _y = _y - 2 * (_y - _s[id]["h"] / 2) _s[_id]["vy"] = -_s[_id]["vy"] * _s[_id]["r"] ElseIf gh <= (_y + _s[id]["h"] / 2) Then _y = _y - 2 * (_y + _s[id]["h"] / 2 - gh) _s[_id]["vy"] = -_s[_id]["vy"] * _s[_id]["r"] EndIf ' corrision detect with other shapes For _j = _i + 1 To _n _idJ = index[_j] _dx = _s[_idJ]["x"] - _x _dy = _s[_idJ]["y"] - _y _d2 = _dx * _dx + _dy * _dy _r2 = Math.Power(_s[_id]["w"] + _s[_idJ]["w"], 2) + Math.Power(_s[_id]["h"] + _s[_idJ]["h"], 2) If _d2 <= _r2 Then _e = _s[_idJ]["r"] * _s[_id]["r"] _vx = _e * (_s[_idJ]["vx"] - _s[_id]["vx"]) _vy = _e * (_s[_idJ]["vy"] - _s[_id]["vy"]) EndIf EndFor param["id"] = _id param["x"] = _x param["y"] = _y Physics_SetPositions() EndFor EndSub Sub Physics_Init _dt = 0.025 ' [s] _gx = 0 _gy = 100 EndSub End>LDH017.sb< Start>LDJ823.sb< Sub InitStarsgm ' Initialize stars in Gemini star[78] = "name=Pollux;ra=07 45 19.36;dec=+28 01 34.7;mag=1.16;" star[66] = "name=Castor A;ra=07 34 36.00;dec=+31 53 19.1;mag=1.90;" star[24] = "name=γ Gem;ra=06 37 42.70;dec=+16 23 57.9;mag=1.93;" star[13] = "name=μ Gem;ra=06 22 57.59;dec=+22 30 49.9;mag=2.87;" star[27] = "name=ε Gem;ra=06 43 55.93;dec=+25 07 52.2;mag=3.06;" star[7] = "name=η Gem;ra=06 14 52.70;dec=+22 30 24.6;mag=3.31;" star[31] = "name=ξ Gem;ra=06 45 17.43;dec=+12 53 45.8;mag=3.35;" star[55] = "name=δ Gem;ra=07 20 07.39;dec=+21 58 56.4;mag=3.50;" star[77] = "name=κ Gem;ra=07 44 26.87;dec=+24 23 53.3;mag=3.57;" star[54] = "name=λ Gem;ra=07 18 05.61;dec=+16 32 25.7;mag=3.58;" star[34] = "name=θ Gem;ra=06 52 47.34;dec=+33 57 40.9;mag=3.60;" star[60] = "name=ι Gem;ra=07 25 43.68;dec=+27 47 53.8;mag=3.78;" star[43] = "name=ζ Gem;ra=07 04 06.54;dec=+20 34 13.1;mag=4.01;" star[69] = "name=υ Gem;ra=07 35 55.37;dec=+26 53 45.6;mag=4.06;" star[18] = "name=ν Gem A;ra=06 28 57.79;dec=+20 12 43.8;mag=4.13;" star[1] = "name=1 Gem;ra=06 04 07.22;dec=+23 15 49.1;mag=4.16;" star[62] = "name=ρ Gem;ra=07 29 06.61;dec=+31 47 02.7;mag=4.16;" star[75] = "name=σ Gem;ra=07 43 18.69;dec=+28 53 02.7;mag=4.23;" star[46] = "name=τ Gem;ra=07 11 08.39;dec=+30 14 43.0;mag=4.41;" star[30] = "name=30 Gem;ra=06 43 59.29;dec=+13 13 41.3;mag=4.49;" star[38] = "name=38 Gem;ra=06 54 38.59;dec=+13 10 40.9;mag=4.71;" star[71] = "name=ο Gem;ra=07 39 09.96;dec=+34 35 04.7;mag=4.89;" star[81] = "name=81 Gem;ra=07 46 07.49;dec=+18 30 36.6;mag=4.89;" star[83] = "name=φ Gem;ra=07 53 29.84;dec=+26 45 57.1;mag=4.97;" star[65] = "name=65 Gem;ra=07 29 48.78;dec=+27 54 58.3;mag=5.01;" star[57] = "name=57 Gem;ra=07 23 28.55;dec=+25 03 02.2;mag=5.04;" star[74] = "name=74 Gem;ra=07 39 28.59;dec=+17 40 28.3;mag=5.04;" star[51] = "name=51 Gem;ra=07 13 22.27;dec=+16 09 32.6;mag=5.07;" star[64] = "name=64 Gem;ra=07 29 20.46;dec=+28 07 06.3;mag=5.07;" star[56] = "name=56 Gem;ra=07 21 56.90;dec=+20 26 37.4;mag=5.09;" star[80] = "name=π Gem;ra=07 47 30.34;dec=+33 24 56.8;mag=5.14;" star[26] = "name=26 Gem;ra=06 42 24.32;dec=+17 38 43.9;mag=5.20;" star[42] = "name=ω Gem;ra=07 02 24.78;dec=+24 12 55.6;mag=5.20;" star[63] = "name=63 Gem;ra=07 27 44.39;dec=+21 26 44.0;mag=5.20;" star[68] = "name=68 Gem;ra=07 33 36.50;dec=+15 49 36.1;mag=5.27;" star[36] = "name=36 Gem;ra=06 51 33.05;dec=+21 45 40.4;mag=5.28;" star[76] = "name=76 Gem;ra=07 44 06.92;dec=+25 47 03.2;mag=5.30;" star[85] = "name=85 Gem;ra=07 55 39.90;dec=+19 53 02.6;mag=5.38;" star[28] = "name=28 Gem;ra=06 44 45.46;dec=+28 58 15.6;mag=5.42;" star[45] = "name=45 Gem;ra=07 08 22.04;dec=+15 55 51.3;mag=5.47;" star[70] = "name=70 Gem;ra=07 38 32.84;dec=+35 02 54.5;mag=5.58;" star[35] = "name=35 Gem;ra=06 50 25.50;dec=+13 24 47.5;mag=5.68;" star[41] = "name=41 Gem;ra=07 00 15.82;dec=+16 04 44.4;mag=5.73;" star[37] = "name=37 Gem;ra=06 55 18.69;dec=+25 22 32.3;mag=5.73;" star[3] = "name=3 Gem;ra=06 09 43.99;dec=+23 06 48.5;mag=5.75;" star[47] = "name=47 Gem;ra=07 11 23.08;dec=+26 51 24.0;mag=5.75;" star[53] = "name=53 Gem;ra=07 15 57.18;dec=+27 53 50.7;mag=5.75;" star[59] = "name=59 Gem;ra=07 24 33.44;dec=+27 38 16.1;mag=5.77;" star[5] = "name=5 Gem;ra=06 11 32.31;dec=+24 25 13.4;mag=5.83;" star[52] = "name=52 Gem;ra=07 14 41.94;dec=+24 53 06.7;mag=5.84;" star[48] = "name=48 Gem;ra=07 12 26.39;dec=+24 07 43.3;mag=5.85;" star[33] = "name=33 Gem;ra=06 49 49.85;dec=+16 12 10.5;mag=5.85;" star[61] = "name=61 Gem;ra=07 26 56.33;dec=+20 15 27.3;mag=5.94;" star[44] = "name=44 Gem;ra=07 05 18.37;dec=+22 38 14.9;mag=6.00;" star[8] = "name=8 Gem;ra=06 16 19.05;dec=+23 58 12.2;mag=6.09;" star[58] = "name=58 Gem;ra=07 23 28.15;dec=+22 56 43.6;mag=6.17;" star[82] = "name=82 Gem;ra=07 48 33.65;dec=+23 08 27.5;mag=6.18;" star[39] = "name=39 Gem;ra=06 58 47.52;dec=+26 04 51.1;mag=6.20;" star[16] = "name=16 Gem;ra=06 27 56.69;dec=+20 29 46.6;mag=6.22;" star[9] = "name=9 Gem;ra=06 16 58.71;dec=+23 44 27.3;mag=6.24;" star[20] = "name=20 Gem;ra=06 32 18.52;dec=+17 47 03.4;mag=6.26;" star[141] = "name=141 Tau;ra=06 01 41.63;dec=+22 24 03.8;mag=6.36;" star[19] = "name=19 Gem;ra=06 31 37.44;dec=+15 54 12.7;mag=6.38;" star[40] = "name=40 Gem;ra=06 59 27.94;dec=+25 54 51.1;mag=6.40;" star[25] = "name=25 Gem;ra=06 41 20.90;dec=+28 11 47.9;mag=6.45;" star[50] = "name=50 Gem;ra=07 12 49.08;dec=+27 13 30.2;mag=6.46;" star[32] = "name=32 Gem;ra=06 45 54.20;dec=+12 41 36.8;mag=6.47;" star[6] = "name=6 Gem;ra=06 12 19.10;dec=+22 54 30.7;mag=6.51;" star[79] = "name=79 Gem;ra=07 45 09.34;dec=+20 18 57.8;mag=6.53;" star[15] = "name=15 Gem A;ra=06 27 46.58;dec=+20 47 22.6;mag=6.54;" star[10] = "name=10 Gem;ra=06 18 54.43;dec=+23 36 11.9;mag=6.58;" star[2] = "name=2 Gem;ra=06 06 48.66;dec=+23 38 19.0;mag=6.67;" star[23] = "name=23 Gem;ra=06 36 02.12;dec=+16 47 49.5;mag=6.73;" star[4] = "name=4 Gem;ra=06 10 29.94;dec=+22 59 52.4;mag=6.88;" star[11] = "name=11 Gem;ra=06 19 19.30;dec=+23 28 09.9;mag=6.91;" star[12] = "name=12 Gem;ra=06 19 22.52;dec=+23 16 28.2;mag=6.95;" star[49] = "name=49 Gem;ra=07 12 49.38;dec=+25 44 55.3;mag=7.05;" star[18] = "name=ν Gem B;ra=06 28 53.70;dec=+20 14 20.0;mag=8.00;" star[15] = "name=15 Gem B;ra=06 27 45.94;dec=+20 46 59.6;mag=8.59;" edge = "1=66-46;2=46-27;3=27-13;4=13-7;5=66-78;6=78-55;7=55-43;" edge = edge + "8=43-24;" EndSub Sub Shapes_Initgmm shX = -840 ' x offset shY = -11 ' y offset shape = "" shape[1] = "func=ell;x=34;y=69;width=54;height=52;bc=#A4825B;pw=0;" shape[2] = "func=ell;x=0;y=117;width=54;height=52;bc=#A4825B;pw=0;" shape[3] = "func=ell;x=30;y=144;width=41;height=61;angle=33;bc=#A4825B;pw=0;" shape[4] = "func=rect;x=109;y=201;width=44;height=21;bc=#A4825B;pw=0;" shape[5] = "func=rect;x=91;y=224;width=44;height=21;angle=4;bc=#A4825B;pw=0;" shape[6] = "func=rect;x=138;y=221;width=67;height=20;angle=43;bc=#A4825B;pw=0;" shape[7] = "func=rect;x=118;y=244;width=67;height=20;angle=43;bc=#A4825B;pw=0;" shape[8] = "func=rect;x=141;y=164;width=61;height=23;angle=335;bc=#A4825B;pw=0;" shape[9] = "func=rect;x=172;y=143;width=44;height=21;angle=335;bc=#A4825B;pw=0;" shape[10] = "func=rect;x=196;y=156;width=67;height=20;angle=43;bc=#A4825B;pw=0;" shape[11] = "func=rect;x=177;y=180;width=67;height=20;angle=57;bc=#A4825B;pw=0;" shape[12] = "func=ell;x=245;y=179;width=41;height=16;angle=333;bc=#A4825B;pw=0;" shape[13] = "func=ell;x=218;y=210;width=41;height=16;angle=349;bc=#A4825B;pw=0;" shape[14] = "func=ell;x=187;y=246;width=41;height=16;angle=349;bc=#A4825B;pw=0;" shape[15] = "func=ell;x=161;y=269;width=41;height=20;angle=7;bc=#A4825B;pw=0;" shape[16] = "func=rect;x=77;y=121;width=101;height=50;angle=39;bc=#A4825B;pw=0;" shape[17] = "func=rect;x=34;y=169;width=85;height=53;angle=38;bc=#A4825B;pw=0;" shape[18] = "func=rect;x=106;y=86;width=53;height=22;angle=348;bc=#A4825B;pw=0;" shape[19] = "func=rect;x=148;y=69;width=51;height=20;angle=325;bc=#A4825B;pw=0;" shape[20] = "func=tri;x=133;y=0;x1=11;y1=0;x2=0;y2=42;x3=23;y3=42;angle=305;bc=#624E37;pw=0;" shape[21] = "func=line;x=156;y=28;x1=0;y1=0;x2=89;y2=60;pc=#624E37;pw=4;" shape[22] = "func=tri;x=230;y=74;x1=12;y1=0;x2=0;y2=20;x3=24;y3=20;angle=307;bc=#624E37;pw=0;" shape[23] = "func=rect;x=248;y=84;width=25;height=28;angle=304;bc=#624E37;pw=0;" shape[24] = "func=tri;x=252;y=94;x1=15;y1=0;x2=0;y2=18;x3=30;y3=18;angle=307;bc=#000000;pw=0;" shape[25] = "func=rect;x=91;y=174;width=51;height=19;angle=358;bc=#A4825B;pc=#000000;pw=2;" shape[26] = "func=ell;x=130;y=169;width=29;height=25;bc=#A4825B;pw=0;" shape[27] = "func=rect;x=32;y=189;width=20;height=48;angle=350;bc=#A4825B;pw=0;" shape[28] = "func=rect;x=36;y=222;width=46;height=18;bc=#A4825B;pw=0;" shape[29] = "func=rect;x=64;y=241;width=9;height=0;bc=#A4825B;pw=0;" shape[30] = "func=rect;x=55;y=136;width=44;height=20;angle=324;bc=#A4825B;pw=0;" shape[31] = "func=rect;x=62;y=151;width=56;height=22;angle=74;bc=#A4825B;pc=#000000;pw=2;" shape[32] = "func=ell;x=86;y=169;width=23;height=23;angle=347;bc=#A4825B;pw=0;" shape[33] = "func=ell;x=77;y=87;width=42;height=63;angle=44;bc=#A4825B;pw=0;" shape[34] = "func=ell;x=73;y=221;width=27;height=23;angle=13;bc=#A4825B;pw=0;" shape[35] = "func=ell;x=103;y=116;width=61;height=64;angle=316;bc=#624E37;pw=0;" shape[36] = "func=ell;x=111;y=128;width=40;height=34;angle=313;bc=#A4825B;pw=0;" shape[37] = "func=rect;x=104;y=120;width=25;height=23;angle=315;bc=#A4825B;pw=0;" shape[38] = "func=ell;x=93;y=117;width=19;height=30;angle=318;bc=#624E37;pw=0;" shape[39] = "func=ell;x=108;y=102;width=19;height=30;angle=318;bc=#624E37;pw=0;" shape[40] = "func=line;x=118;y=134;x1=0;y1=0;x2=29;y2=27;pc=#624E37;pw=2;" shape[41] = "func=line;x=111;y=135;x1=0;y1=0;x2=29;y2=29;pc=#624E37;pw=2;" shape[42] = "func=line;x=121;y=128;x1=0;y1=0;x2=28;y2=27;pc=#624E37;pw=2;" shape[43] = "func=ell;x=89;y=119;width=15;height=29;angle=340;bc=#A4825B;pw=0;" shape[44] = "func=ell;x=113;y=95;width=15;height=29;angle=291;bc=#A4825B;pw=0;" shape[45] = "func=ell;x=184;y=40;width=26;height=33;angle=352;bc=#A4825B;pw=0;" shape[46] = "func=rect;x=107;y=130;width=22;height=9;angle=313;bc=#624E37;pw=0;" shape[47] = "func=rect;x=131;y=152;width=22;height=9;angle=315;bc=#624E37;pw=0;" shape[48] = "func=tri;x=126;y=106;x1=6;y1=0;x2=0;y2=10;x3=12;y3=10;angle=294;bc=#000000;pw=0;" shape[49] = "func=ell;x=68;y=74;width=26;height=19;angle=39;bc=#A4825B;pw=0;" shape[50] = "func=ell;x=2;y=152;width=26;height=19;angle=231;bc=#A4825B;pw=0;" shape[51] = "func=ell;x=60;y=84;width=13;height=13;bc=#000000;pw=0;" shape[52] = "func=ell;x=48;y=99;width=13;height=13;bc=#000000;pw=0;" shape[53] = "func=ell;x=32;y=122;width=13;height=13;bc=#000000;pw=0;" shape[54] = "func=ell;x=20;y=137;width=13;height=13;bc=#000000;pw=0;" EndSub Sub Shapes_Init_tau shX = -500 ' x offset shY = 64 ' y offset shape = "" shape[1] = "func=ell;x=75;y=49;width=86;height=134;angle=24;bc=#000055;pc=#66411F;pw=16;" shape[2] = "func=rect;x=56;y=71;width=67;height=57;angle=24;bc=#000055;pw=0;" shape[3] = "func=ell;x=71;y=29;width=52;height=53;bc=#66411F;pw=0;" shape[4] = "func=ell;x=34;y=105;width=52;height=53;bc=#66411F;pw=0;" shape[5] = "func=ell;x=58;y=0;width=70;height=68;bc=#000055;pw=0;" shape[6] = "func=ell;x=0;y=107;width=73;height=75;bc=#000055;pw=0;" shape[7] = "func=ell;x=240;y=111;width=148;height=154;bc=#66411F;pw=0;" shape[8] = "func=rect;x=213;y=213;width=104;height=37;angle=334;bc=#66411F;pw=0;" shape[9] = "func=rect;x=202;y=265;width=105;height=29;angle=33;bc=#66411F;pw=0;" shape[10] = "func=rect;x=148;y=190;width=104;height=37;angle=358;bc=#66411F;pw=0;" shape[11] = "func=rect;x=113;y=245;width=105;height=29;angle=76;bc=#66411F;pw=0;" shape[12] = "func=ell;x=132;y=187;width=48;height=46;bc=#66411F;pw=0;" shape[13] = "func=ell;x=194;y=228;width=48;height=46;bc=#66411F;pw=0;" shape[14] = "func=ell;x=200;y=119;width=3;height=1;bc=#66411F;pw=0;" shape[15] = "func=rect;x=199;y=78;width=178;height=88;angle=351;bc=#66411F;pw=0;" shape[16] = "func=ell;x=117;y=83;width=105;height=120;angle=34;bc=#66411F;pc=#000055;pw=4;" shape[17] = "func=ell;x=183;y=123;width=23;height=24;bc=#000055;pw=0;" shape[18] = "func=ell;x=171;y=50;width=23;height=54;angle=42;bc=#66411F;pw=0;" shape[19] = "func=ell;x=108;y=163;width=23;height=54;angle=20;bc=#66411F;pw=0;" shape[20] = "func=ell;x=166;y=150;width=85;height=67;angle=315;bc=#66411F;pc=#000055;pw=4;" shape[21] = "func=ell;x=217;y=173;width=12;height=15;bc=#000055;pw=0;" shape[22] = "func=ell;x=193;y=197;width=11;height=16;angle=260;bc=#000055;pw=0;" shape[23] = "func=ell;x=179;y=136;width=30;height=68;angle=46;bc=#66411F;pw=0;" shape[24] = "func=tri;x=135;y=311;x1=34;y1=0;x2=0;y2=25;x3=68;y3=25;angle=270;bc=#66411F;pw=0;" shape[25] = "func=tri;x=157;y=306;x1=34;y1=0;x2=0;y2=25;x3=68;y3=25;angle=69;bc=#66411F;pw=0;" shape[26] = "func=tri;x=260;y=311;x1=34;y1=0;x2=0;y2=25;x3=68;y3=25;angle=233;bc=#66411F;pw=0;" shape[27] = "func=tri;x=272;y=293;x1=34;y1=0;x2=0;y2=25;x3=68;y3=25;angle=32;bc=#66411F;pw=0;" shape[28] = "func=ell;x=321;y=44;width=73;height=67;bc=#000055;pw=0;" shape[29] = "func=ell;x=329;y=104;width=73;height=67;bc=#000055;pw=0;" shape[30] = "func=ell;x=325;y=155;width=74;height=70;bc=#000055;pw=0;" shape[31] = "func=ell;x=325;y=211;width=74;height=70;bc=#000055;pw=0;" EndSub Sub InitStars_tau star[87] = "name=Aldebaran;ra=04 35 55.20;dec=+16 30 35.1;mag=0.87;" star[112] = "name=β Tau;ra=05 26 17.50;dec=+28 36 28.3;mag=1.65;" star[25] = "name=Alcyone A;ra=03 47 29.06;dec=+24 06 18.9;mag=2.85;" star[123] = "name=ζ Tau;ra=05 37 38.68;dec=+21 08 33.3;mag=2.97;" star[78] = "name=θ2 Tau;ra=04 28 39.67;dec=+15 52 15.4;mag=3.40;" star[35] = "name=λ Tau;ra=04 00 40.82;dec=+12 29 25.4;mag=3.41;" star[74] = "name=ε Tau;ra=04 28 36.93;dec=+19 10 49.9;mag=3.53;" star[1] = "name=ο Tau;ra=03 24 48.84;dec=+09 01 44.6;mag=3.61;" star[27] = "name=Atlas A;ra=03 49 09.73;dec=+24 03 12.7;mag=3.62;" star[54] = "name=γ Tau;ra=04 19 47.53;dec=+15 37 39.7;mag=3.65;" star[17] = "name=Electra;ra=03 44 52.52;dec=+24 06 48.4;mag=3.72;" star[2] = "name=ξ Tau;ra=03 27 10.12;dec=+09 43 58.0;mag=3.73;" star[61] = "name=δ1 Tau;ra=04 22 56.03;dec=+17 32 33.3;mag=3.77;" star[77] = "name=θ1 Tau;ra=04 28 34.43;dec=+15 57 44.0;mag=3.84;" star[20] = "name=Maia;ra=03 45 49.59;dec=+24 22 04.3;mag=3.87;" star[38] = "name=ν Tau;ra=04 03 09.38;dec=+05 59 21.5;mag=3.91;" star[5] = "name=5 Tau;ra=03 30 52.37;dec=+12 56 12.1;mag=4.14;" star[23] = "name=Merope;ra=03 46 19.56;dec=+23 56 54.5;mag=4.14;" star[65] = "name=κ1 Tau;ra=04 25 22.10;dec=+22 17 38.3;mag=4.21;" star[88] = "name=88 Tau;ra=04 35 39.23;dec=+10 09 39.3;mag=4.25;" star[49] = "name=μ Tau;ra=04 15 32.05;dec=+08 53 32.7;mag=4.27;" star[90] = "name=90 Tau;ra=04 38 09.40;dec=+12 30 39.1;mag=4.27;" star[94] = "name=τ Tau;ra=04 42 14.70;dec=+22 57 25.1;mag=4.27;" star[69] = "name=υ Tau;ra=04 26 18.39;dec=+22 48 49.3;mag=4.28;" star[10] = "name=10 Tau;ra=03 36 52.52;dec=+00 24 10.2;mag=4.29;" star[19] = "name=Taygeta;ra=03 45 12.48;dec=+24 28 02.6;mag=4.30;" star[68] = "name=68 Tau;ra=04 25 29.32;dec=+17 55 40.8;mag=4.30;" star[119] = "name=119 Tau;ra=05 32 12.75;dec=+18 35 39.3;mag=4.32;" star[37] = "name=37 Tau;ra=04 04 41.66;dec=+22 04 55.4;mag=4.36;" star[71] = "name=71 Tau;ra=04 26 20.67;dec=+15 37 06.0;mag=4.48;" star[136] = "name=136 Tau;ra=05 53 19.64;dec=+27 36 44.2;mag=4.56;" star[102] = "name=ι Tau;ra=05 03 05.70;dec=+21 35 24.2;mag=4.62;" star[86] = "name=ρ Tau;ra=04 33 50.86;dec=+14 50 40.2;mag=4.65;" star[92] = "name=σ2 Tau;ra=04 39 16.45;dec=+15 55 04.9;mag=4.67;" star[73] = "name=�� Tau;ra=04 26 36.38;dec=+14 42 49.9;mag=4.69;" star[64] = "name=64 Tau;ra=04 24 05.69;dec=+17 26 39.2;mag=4.80;" star[139] = "name=139 Tau;ra=05 57 59.66;dec=+25 57 14.1;mag=4.81;" star[47] = "name=47 Tau;ra=04 13 56.39;dec=+09 15 50.0;mag=4.84;" star[126] = "name=126 Tau;ra=05 41 17.72;dec=+16 32 03.1;mag=4.84;" star[114] = "name=114 Tau;ra=05 27 38.08;dec=+21 56 13.1;mag=4.88;" star[132] = "name=132 Tau;ra=05 49 00.96;dec=+24 34 03.2;mag=4.88;" star[134] = "name=134 Tau;ra=05 49 32.94;dec=+12 39 04.9;mag=4.89;" star[104] = "name=104 Tau;ra=05 07 26.68;dec=+18 38 42.0;mag=4.91;" star[50] = "name=ω2 Tau;ra=04 17 15.69;dec=+20 34 43.5;mag=4.93;" star[75] = "name=75 Tau;ra=04 28 26.37;dec=+16 21 34.7;mag=4.96;" star[109] = "name=109 Tau;ra=05 19 16.59;dec=+22 05 48.1;mag=4.96;" star[52] = "name=φ Tau;ra=04 20 21.23;dec=+27 21 03.4;mag=4.97;" star[111] = "name=111 Tau;ra=05 24 25.31;dec=+17 23 00.8;mag=5.00;" star[79] = "name=79 Tau;ra=04 28 50.10;dec=+13 02 51.5;mag=5.02;" star[28] = "name=Pleione;ra=03 49 11.20;dec=+24 08 12.6;mag=5.05;" star[30] = "name=30 Tau;ra=03 48 16.25;dec=+11 08 36.1;mag=5.08;" star[91] = "name=σ1 Tau;ra=04 39 09.20;dec=+15 48 00.1;mag=5.08;" star[97] = "name=97 Tau;ra=04 51 22.41;dec=+18 50 23.8;mag=5.08;" star[66] = "name=66 Tau;ra=04 23 51.84;dec=+09 27 39.5;mag=5.10;" star[4] = "name=4 Tau;ra=03 30 24.48;dec=+11 20 11.3;mag=5.14;" star[41] = "name=41 Tau;ra=04 06 36.40;dec=+27 36 00.1;mag=5.18;" star[125] = "name=125 Tau;ra=05 39 44.19;dec=+25 53 49.7;mag=5.18;" star[42] = "name=ψ Tau;ra=04 07 00.52;dec=+29 00 04.6;mag=5.21;" star[58] = "name=58 Tau;ra=04 20 36.24;dec=+15 05 43.8;mag=5.26;" star[67] = "name=κ2 Tau;ra=04 25 24.94;dec=+22 12 00.4;mag=5.27;" star[106] = "name=l Tau;ra=05 07 48.43;dec=+20 25 06.4;mag=5.28;" star[133] = "name=133 Tau;ra=05 47 42.90;dec=+13 53 58.7;mag=5.28;" star[46] = "name=46 Tau;ra=04 13 33.11;dec=+07 42 57.7;mag=5.29;" star[40] = "name=40 Tau;ra=04 03 44.60;dec=+05 26 08.3;mag=5.32;" star[29] = "name=29 Tau;ra=03 45 40.43;dec=+06 03 00.1;mag=5.34;" star[56] = "name=56 Tau;ra=04 19 36.69;dec=+21 46 24.9;mag=5.34;" star[121] = "name=121 Tau;ra=05 35 27.12;dec=+24 02 22.7;mag=5.37;" star[59] = "name=χ Tau;ra=04 22 34.93;dec=+25 37 45.7;mag=5.38;" star[44] = "name=44 Tau;ra=04 10 49.88;dec=+26 28 51.7;mag=5.39;" star[83] = "name=83 Tau;ra=04 30 37.30;dec=+13 43 28.0;mag=5.40;" star[115] = "name=115 Tau;ra=05 27 10.09;dec=+17 57 44.2;mag=5.40;" star[16] = "name=Celaeno;ra=03 44 48.20;dec=+24 17 22.5;mag=5.45;" star[93] = "name=93 Tau;ra=04 40 03.42;dec=+12 11 51.5;mag=5.45;" star[36] = "name=36 Tau;ra=04 04 21.67;dec=+24 06 21.7;mag=5.46;" star[81] = "name=81 Tau;ra=04 30 38.83;dec=+15 41 31.0;mag=5.47;" star[118] = "name=118 Tau;ra=05 29 16.49;dec=+25 09 01.1;mag=5.47;" star[130] = "name=130 Tau;ra=05 47 26.20;dec=+17 43 44.9;mag=5.47;" star[53] = "name=53 Tau;ra=04 19 26.08;dec=+21 08 32.7;mag=5.50;" star[103] = "name=103 Tau;ra=05 08 06.62;dec=+24 15 54.7;mag=5.50;" star[43] = "name=ω1 Tau;ra=04 09 09.90;dec=+19 36 33.5;mag=5.51;" star[116] = "name=116 Tau;ra=05 27 45.61;dec=+15 52 26.8;mag=5.52;" star[72] = "name=72 Tau;ra=04 27 17.45;dec=+22 59 46.9;mag=5.53;" star[(44)] = "name=44 Eri;ra=04 28 32.11;dec=+01 22 51.1;mag=5.53;" star[122] = "name=122 Tau;ra=05 37 03.71;dec=+17 02 25.5;mag=5.53;" star[135] = "name=135 Tau;ra=05 50 28.90;dec=+14 18 20.5;mag=5.54;" star[12] = "name=12 Tau;ra=03 39 51.14;dec=+03 03 24.6;mag=5.55;" star[57] = "name=57 Tau;ra=04 19 57.63;dec=+14 02 06.9;mag=5.58;" star[80] = "name=80 Tau;ra=04 30 08.53;dec=+15 38 16.4;mag=5.58;" star[137] = "name=137 Tau;ra=05 52 22.30;dec=+14 10 18.5;mag=5.60;" star[32] = "name=32 Tau;ra=03 56 52.03;dec=+22 28 41.7;mag=5.62;" star[51] = "name=51 Tau;ra=04 18 23.14;dec=+21 34 45.8;mag=5.64;" star[63] = "name=63 Tau;ra=04 23 25.00;dec=+16 46 38.4;mag=5.64;" star[18] = "name=18 Tau;ra=03 45 09.73;dec=+24 50 21.7;mag=5.66;" star[31] = "name=31 Tau;ra=03 52 00.22;dec=+06 32 05.7;mag=5.66;" star[120] = "name=120 Tau;ra=05 33 31.63;dec=+18 32 24.8;mag=5.67;" star[13] = "name=13 Tau;ra=03 42 18.94;dec=+19 42 01.0;mag=5.68;" star[45] = "name=45 Tau;ra=04 11 20.20;dec=+05 31 22.9;mag=5.71;" star[60] = "name=60 Tau;ra=04 22 03.45;dec=+14 04 38.1;mag=5.72;" star[131] = "name=131 Tau;ra=05 47 13.15;dec=+14 29 18.3;mag=5.72;" star[6] = "name=6 Tau;ra=03 32 35.93;dec=+09 22 24.8;mag=5.76;" star[21] = "name=Sterope I;ra=03 45 54.46;dec=+24 33 16.6;mag=5.76;" star[117] = "name=117 Tau;ra=05 28 01.60;dec=+17 14 21.3;mag=5.77;" star[89] = "name=89 Tau;ra=04 38 09.38;dec=+16 02 00.2;mag=5.78;" star[99] = "name=99 Tau;ra=04 57 48.65;dec=+23 56 54.9;mag=5.79;" star[98] = "name=98 Tau;ra=04 58 09.38;dec=+25 03 01.9;mag=5.79;" star[105] = "name=105 Tau;ra=05 07 55.43;dec=+21 42 17.4;mag=5.84;" star[39] = "name=39 Tau;ra=04 05 20.15;dec=+22 00 33.2;mag=5.90;" star[76] = "name=76 Tau;ra=04 28 23.34;dec=+14 44 27.7;mag=5.90;" star[7] = "name=7 Tau;ra=03 34 26.62;dec=+24 27 52.1;mag=5.95;" star[129] = "name=129 Tau;ra=05 46 45.49;dec=+15 49 21.0;mag=6.00;" star[85] = "name=85 Tau;ra=04 31 51.69;dec=+15 51 05.9;mag=6.01;" star[33] = "name=33 Tau;ra=03 57 03.80;dec=+23 10 32.1;mag=6.05;" star[96] = "name=96 Tau;ra=04 49 44.08;dec=+15 54 15.3;mag=6.09;" star[110] = "name=110 Tau;ra=05 23 37.72;dec=+16 41 57.7;mag=6.09;" star[11] = "name=11 Tau;ra=03 40 46.30;dec=+25 19 46.3;mag=6.11;" star[14] = "name=14 Tau;ra=03 43 47.14;dec=+19 39 54.6;mag=6.13;" star[95] = "name=95 Tau;ra=04 43 13.75;dec=+24 05 20.3;mag=6.18;" star[113] = "name=113 Tau;ra=05 26 05.72;dec=+16 42 00.6;mag=6.23;" star[108] = "name=108 Tau;ra=05 15 27.66;dec=+22 17 05.5;mag=6.26;" star[24] = "name=24 Tau;ra=03 47 20.90;dec=+24 06 58.0;mag=6.28;" star[84] = "name=84 Tau;ra=04 31 07.16;dec=+15 06 18.6;mag=6.28;" star[48] = "name=48 Tau;ra=04 15 46.21;dec=+15 24 02.7;mag=6.31;" star[62] = "name=62 Tau;ra=04 23 59.76;dec=+24 18 03.7;mag=6.34;" star[22] = "name=Sterope II;ra=03 46 02.89;dec=+24 31 40.8;mag=6.43;" star[70] = "name=70 Tau;ra=04 25 37.25;dec=+15 56 27.9;mag=6.44;" star[26] = "name=26 Tau;ra=03 48 56.91;dec=+23 51 26.2;mag=6.47;" star[9] = "name=9 Tau;ra=03 36 58.03;dec=+23 12 40.0;mag=6.72;" star[101] = "name=101 Tau;ra=04 59 44.27;dec=+15 55 00.5;mag=6.75;" star[55] = "name=55 Tau;ra=04 19 54.78;dec=+16 31 21.6;mag=6.85;" edge = "1=112-74;2=74-68;3=68-54;4=123-87;5=87-78;6=78-54;7=54-49;" edge = edge + "8=54-35;9=25-35;10=35-2;" EndSub End>LDJ823.sb< Start>LDJ923.sb< ' Program by YLed, Small Basic December challenge ' Dec 18 th 2016 ' music arrangement by Yvan Leduc ' original title song: Jesu, Joy of Man's Desiring ' original song by : Johann Sebastian Bach ' final version: image=imagelist.LoadImage( "https://upload.wikimedia.org/wikipedia/commons/6/6a/Johann_Sebastian_Bach.jpg") H=ImageList.GetHeightOfImage(image) W=ImageList.GetWIDTHOfImage(image) GraphicsWindow.Top =0 GraphicsWindow.left =0 GraphicsWindow.Height=H GraphicsWindow.Width=W GraphicsWindow.BackgroundColor="#DDAA55" LDImage.EffectOilPaint(image,7,20) LDImage.EffectContrast(image,0.7) LDImage.EffectSepia(image,15) GraphicsWindow.DrawImage(image,0,0) GraphicsWindow.fontname="AR Decode" GraphicsWindow.FontSize=30 GraphicsWindow.brushColor="#AA5522" GraphicsWindow.DrawboundText(250,250,200,"Jesu,Joy of Man's Desiring") GraphicsWindow.FontSize=50 GraphicsWindow.DrawboundText(50,400,500,"Johann Sebastian Bach") ' KEY SIGNATURE 9/8 For M = 1 To 25 Read_Measure() For T = 1 TO 9 sound.PlayMusic (b[t]+a[t]+n[t]) b[t]="" a[t]="" n[t]="" pianissimo() ENDFOR ENDFOR ' les F sont # ' bass o2 suelement les sol la si , le reste c est o3 SUB Read_Measure If (M=1) then ' measure 1 n[1]="" a[1]="O2L4 g" n[2]="O5L4 g" n[3]="O5L4 a" b[4]="O2L64 g" a[4]="O5L64 g" n[4]="O5L4 b" n[5]="O6L4 d" a[6]="O5L64 f#" n[6]="O6L4 c" b[7]="O3L64 e" a[7]="O5L64 g" n[7]="O6L4 c" n[8]="O6L4 e" a[9]="O5L64 a" n[9]="O6L4 d" ElseIf (M=2) then ' measure 2 a[1]="O3L64 b"+"O5L64 b" n[1]="O6L4 d" n[2]="O6L4 g" a[3]="O5L64 a" n[3]="O6L4 f#" a[4]="O4L64 e"+"O5L64 b" n[4]="O6L4 g" n[5]="O6L4 d" a[6]="O5L64 g" n[6]="O5L4 b" b[7]="O2L64 e" a[7]="O5L64 e" n[7]="O5L4 g" n[8]="O5L4 a" a[9]="O5L64 b" n[9]="O5L4 d" ElseIf (M=3) then b[1]="O3L64 a" a[1]="O5L64 e" n[1]="O6L4 c" n[2]="O6L4 d" a[3]="O5L64 f#" n[3]="O6L4 e" a[4]="O4L64 b"+"O5L64 g" n[4]="O6L4 d" n[5]="O6L4 c" a[6]="O5L64 d" n[6]="O5L4 b" b[7]="O3L64 c" a[7]="O5L64 e" n[7]="O5L4 a" n[8]="O5L4 b" a[9]="O4L64 b" n[9]="O5L4 g" ElseIf (M=4) then a[1]="O4L64 d"+"O4L64 a" n[1]="O5L4 f#" n[2]="O5L4 g" n[3]="O5L4 a" a[4]="O4L64 f#" n[4]="O5L4 d" n[5]="O5L4 f#" n[6]="O5L4 a" b[7]="O3L64 d" a[7]="O4L64 a" n[7]="O6L4 c" n[8]="O5L4 b" a[9]="O4L64 f#" n[9]="O5L4 a" ElseIf (M=5) then a[1]="O2L64 g"+"O5L64 d" n[1]="O5L4 b" n[2]="O5L4 g" a[3]="O5L64 a" n[3]="O5L4 f#" a[4]="O4L64 e"+"O5L64 g" n[4]="O5L4 b" n[5]="O6L4 d" a[6]="O5L64 f#" n[6]="O6L4 c" b[7]="O3L64 c" a[7]="O5L64 g" n[7]="O6L4 c" n[8]="O6L4 e" a[9]="O5L64 a" n[9]="O6L4 d" ElseIf (M=6) then b[1]="O2L64 b" a[1]="O5L64 b" n[1]="O6L4 d" n[2]="O6L4 g" a[3]="O5L64 a" n[3]="O6L4 f#" a[4]="O4L64 e"+"O5L64 b" n[4]="O6L4 g" n[5]="O6L4 d" a[6]="O5L64 g" n[6]="O5L4 b" b[7]="O3L64 d" a[7]="O5L64 e" n[7]="O5L4 g" n[8]="O5L4 a" a[9]="O5L64 g" n[9]="O5L4 b" ElseIf (M=7) then a[1]="O3L64 c"+"O4L64 a" n[1]="O5L4 e" n[2]="O6L4 d" a[3]="O4L64 f#" n[3]="O6L4 c" b[4]="O3L64 c#" a[4]="O4L64 g" n[4]="O5L4 b" n[5]="O5L4 a" a[6]="O5L64 e" n[6]="O5L4 g" ' pianissmo b[7]="O3L64 d" a[7]="O4L64 a" n[7]="O5L4 d" n[8]="O5L4 g a[9]="O5L64 c" n[9]="O5L4 f#" ElseIf (M=8) then a[1]="O3L64 g"+"O3L64 b" n[1]="O5L4 g" n[2]="O5L4 b" n[3]="O6L4 d" n[4]="O6L4 g" n[5]="O6L4 d" a[6]="O3L64 g" n[6]="O5L4 b" b[7]="O3L64 d" a[7]="O4L64 d" n[7]="O5L4 g" n[8]="O5L4 b" a[9]="O2L64 b" n[9]="O6L4 d" ElseIf (M=9) then a[1]="O2L64 g"+"O4L64 g" n[1]="O6L4 g" n[2]="O5L4 g" n[3]="O5L4 g" b[4]="O3L64 f#" a[4]="O4L64 d" n[4]="O5L4 b" n[5]="O4L4 d" n[6]="O5L4 b" b[7]="O4L64 e" a[7]="O5L64 e" n[7]="O6L4 c" n[8]="O4L4 e" n[9]="O5L4 c" ElseIf (M=10) then a[1]="O3L64 f#"+"O4L64 a" n[1]="O6L4 d" n[2]="O4L4 d" n[3]="O5L4 a" a[4]="O4L64 e" n[4]="O5L4 g" n[5]="O4L4 e" n[6]="O5L4 g" b[7]="O4L64 d" a[7]="O3L64 b" n[7]="O6L4 d" n[8]="O4L4 d" n[9]="O5L4 b" ElseIf (M=11) then a[1]="O3L64 e"+"O4L64 b" n[1]="O6L4 c" n[2]="O4L4 b" n[3]="O5L4 c" b[4]="O3L64 f#" a[4]="O3L64 a" n[4]="O5L4 d" n[5]="O4L4 a" n[6]="O5L4 d" b[7]="O3L64 g" n[7]="O5L4 b" n[8]="O4L4 g" n[9]="O5L4 b" ElseIf (M=12) then a[1]="O3L64 d"+"O3L64 f#" n[1]="O5L4 a" n[2]="O5L4 d" n[3]="O5L4 e" a[4]="O5L64 d" n[4]="O5L4 f#" n[5]="O5L4 a" a[6]="O3L64 d"+"O5L64 e" n[6]="O5L4 g" b[7]="O3L64 d" a[7]="O5L64 f#" n[7]="O5L4 a" n[8]="O6L4 c" a[9]="O3L64 d"+"O5L64 g" n[9]="O5L4 b" ElseIf (M=13) then a[1]="O2L64 d"+"O5L64 f#" n[1]="O6L4 c" n[2]="O5L4 a" n[3]="O5L4 f#" n[4]="O5L4 d" n[5]="O5L4 f#" a[6]="O3L64 d"+"O5L64 e" n[6]="O5L4 a" b[7]="O3L64 d" a[7]="O5L64 a" n[7]="O6L4 c" n[8]="O5L4 b" a[9]="O3L64 d"+"O5L64 f#" n[9]="O5L4 a" ElseIf (M=14) then a[1]="O3L64 g"+"O5L64 d" ' un sol o2 en l entends pas trop basse frequence n[1]="O5L4 b" n[2]="O5L4 g" n[3]="O5L4 a" b[4]="O3L64 f#" a[4]="O5L64 g" n[4]="O5L4 b" n[5]="O6L4 d" a[6]="O5L64 f#" n[6]="O5L4 c" b[7]="O3L64 e" a[7]="O5L64 g" n[7]="O6L4 c" n[8]="O6L4 e" a[9]="O5L64 a" n[9]="O5L4 d" ' les F sont # ' bass o2 suelement les sol la si , le reste c est o3 ElseIf (M=15) then a[1]="O3L64 a"+"O5L64 b" n[1]="O5L4 d" n[2]="O6L4 g" a[3]="O5L64 a" n[3]="O6L4 f#" b[4]="O2L64 b" a[4]="O5L64 a" n[4]="O6L4 g" n[5]="O6L4 d" a[6]="O5L64 f#" n[6]="O5L4 b" b[7]="O3L64 e" a[7]="O5L64 e" n[7]="O5L4 g" n[8]="O5L4 a" a[9]="O5L64 g" n[9]="O5L4 b" ElseIf (M=16) then ' la mesure 16 est difficle la clé de fa a des noirs pointés donc 1 1/2 temps a[1]="O3L64 c"+"O4L64 c" n[1]="O5L4 e" a[2]="O3L64 a" n[2]="O6L4 d" a[3]="O5L64 g" n[3]="O6L4 c" b[4]="O3L64 d" a[4]="O5L64 f#" n[4]="O5L4 b" n[5]="O5L4 a" ' pianissimo n[6]="O5L4 g" a[7]="O3L64 d"+"O4L64 c" n[7]="O5L4 d" n[8]="O5L4 g" n[9]="O5L4 f#" ElseIf (M=17) then b[1]="O2L64 g" a[1]="O3L64 g"+"O4L64 b" n[1]="O5L4 g" n[2]="O5L4 b" a[3]="O5L64 d" n[3]="O5L4 a" a[4]="O5L64 b" n[4]="O5L4 g" n[5]="O6L4 d" a[6]="O5L64 f#" n[6]="O6L4 c" b[7]="O2L64 g" a[7]="O5L64 g" n[7]="O6L4 c" n[8]="O6L4 e" a[9]="O5L64 a" n[9]="O6L4 d" ElseIf (M=18) then b[1]="O2L64 b" a[1]="O5L64 b" n[1]="O6L4 d" n[2]="O6L4 g" a[3]="O5L64 a" n[3]="O6L4 f#" b[4]="O3L64 e" a[4]="O5L64 b" n[4]="O6L4 g" n[5]="O6L4 d" a[6]="O5L64 b" n[6]="O5L4 g" b[7]="O2L64 e" a[7]="O5L64 e" n[7]="O5L4 g" n[8]="O5L4 a" a[9]="O5L64 d" n[9]="O5L4 b" ElseIf (M=19) then b[1]="O2L64 a" a[1]="O5L64 e" n[1]="O6L4 c" n[2]="O6L4 d" a[3]="O5L64 f#" n[3]="O6L4 e" b[4]="O2L64 b" a[4]="O5L64 g" n[4]="O6L4 d" n[5]="O6L4 c" a[6]="O5L64 b" n[6]="O5L4 d" b[7]="O3L64 c" a[7]="O5L64 a" n[7]="O5L4 e" n[8]="O5L4 b" a[9]="O4L64 b" n[9]="O5L4 g" ElseIf (M=20) then a[1]="O4L64 d"+"O4L64 a" n[1]="O5L4 f#" n[2]="O5L4 g" n[3]="O5L4 a" a[4]="O4L64 f#" n[4]="O5L4 d" n[5]="O5L4 f#" n[6]="O5L4 a" b[7]="O3L64 d" a[7]="O4L64 a" n[7]="O6L4 c" n[8]="O5L4 b" a[9]="O4L64 f#" n[9]="O5L4 a" ElseIf (M=21) then a[1]="O2L64 g"+"O5L64 d" n[1]="O5L4 b" n[2]="O5L4 g" a[3]="O5L64 a" n[3]="O5L4 f#" a[4]="O4L64 e"+"O5L64 g" n[4]="O5L4 b" n[5]="O6L4 d" a[6]="O5L64 f#" n[6]="O6L4 c" b[7]="O3L64 c" a[7]="O5L64 g" n[7]="O6L4 c" n[8]="O6L4 e" a[9]="O5L64 a" n[9]="O6L4 d" ElseIf (M=22) then b[1]="O2L64 b" a[1]="O5L64 b" n[1]="O6L4 d" n[2]="O6L4 g" a[3]="O5L64 a" n[3]="O6L4 f#" a[4]="O4L64 e"+"O5L64 b" n[4]="O6L4 g" n[5]="O6L4 d" a[6]="O5L64 g" n[6]="O5L4 b" b[7]="O3L64 d" a[7]="O5L64 e" n[7]="O5L4 g" n[8]="O5L4 a" a[9]="O5L64 g" n[9]="O5L4 b" ElseIf (M=23) then a[1]="O3L64 c"+"O4L64 a" n[1]="O5L4 e" n[2]="O6L4 d" a[3]="O4L64 f#" n[3]="O6L4 c" b[4]="O3L64 c#" a[4]="O4L64 g" n[4]="O5L4 b" n[5]="O5L4 a" a[6]="O5L64 e" n[6]="O5L4 g" ' pianissmo b[7]="O3L64 d" a[7]="O4L64 a" n[7]="O5L4 d" n[8]="O5L4 g a[9]="O5L64 c" n[9]="O5L4 f#" ElseIf (M=24) then a[1]="O3L64 g"+"O3L64 b" n[1]="O5L4 g" EndIf EndSub Sub pianissimo if m=7 and t=5 then Program.Delay(40) ' hf elseif m=7 and t=6 then Program.Delay(50) ' hf ' une note 3.5 aulieu de 4 elseif m=7 and t=7 then Program.Delay(60) ' hf elseif m=7 and t=8 then Program.Delay(50) ' hf elseif m=7 and t=9 then Program.Delay(50) ' hf elseif m=8 and t=1 then Program.Delay(40) ' enchainement lent a la 2e partie elseif m=16 and t=6 then Program.Delay(50) ' hf ' note 3.5 aulieu de 4 elseif m=16 and t=7 then Program.Delay(60) ' hf elseif m=16 and t=8 then Program.Delay(50) ' hf elseif m=16 and t=9 then Program.Delay(50) ' hf elseif m=17 and t=1 then Program.Delay(40) ' enchainement lent elseif m=17 and t=2 then Program.Delay(40) ' enchainement lent ' final pianissimo elseif m=23 and t=5 then Program.Delay(40) ' hf elseif m=23 and t=6 then Program.Delay(60) ' hf elseif m=23 and t=7 then Program.Delay(80) ' hf elseif m=23 and t=8 then Program.Delay(100) ' hf elseif m=23 and t=9 then Program.Delay(120) ' hf elseif m=24 and t=1 then Program.Delay(140) ' final ralentisement EndIf EndSub End>LDJ923.sb< Start>LDL046.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.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" '------------------------------------------------------------ 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) '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ '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) '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ '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" '--------------------------------------------------------------------- '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 nt GraphicsWindow.FontSize = 18 Sound.PlayMusic("O8 c32 d32e64") GraphicsWindow.FontSize = 20 GraphicsWindow.BrushColor ="Red" GraphicsWindow.FillRectangle(1100,25,200,28) GraphicsWindow.BrushColor ="Black" NT[10]= Shapes.AddText(NT[10]) Shapes.Move(NT[10], 1120, 25) Sound.PlayMusic("O8 c32 d32e64") EndSub End>LDL046.sb< Start>LDM107.sb< game["grid"]["show grid"] = "False" game["grid"]["highlight"]["style"] = 2 init_program() Sub init_program 'Setup Default Values: ship["type"][1] = "LT" ship["type"][2] = "LC" ship["type"][3] = "LS" ship["type"][4] = "ST" ship["type"][5] = "SC" ship["type"][6] = "SS" ship["stats"]["LT"]["class name"] = "Heavy Weaver" ship["stats"]["LT"]["move range"] = 8 ship["stats"]["LT"]["attack range"] = 2 ship["stats"]["LT"]["damage per shot"] = 3 ship["stats"]["LT"]["shots"] = 3 ship["stats"]["LT"]["hp"] = 12 ship["stats"]["LC"]["class name"] = "Heavy Spiker" ship["stats"]["LC"]["move range"] = 4 ship["stats"]["LC"]["attack range"] = 3 ship["stats"]["LC"]["damage per shot"] = 5 ship["stats"]["LC"]["shots"] = 2 ship["stats"]["LC"]["hp"] = 16 ship["stats"]["LS"]["class name"] = "Heavy Tank" ship["stats"]["LS"]["move range"] = 2 ship["stats"]["LS"]["attack range"] = 4 ship["stats"]["LS"]["damage per shot"] = 8 ship["stats"]["LS"]["shots"] = 2 ship["stats"]["LS"]["hp"] = 20 ship["stats"]["ST"]["class name"] = "Light Weaver" ship["stats"]["ST"]["move range"] = 12 ship["stats"]["ST"]["attack range"] = 2 ship["stats"]["ST"]["damage per shot"] = 3 ship["stats"]["ST"]["shots"] = 4 ship["stats"]["ST"]["hp"] = 4 ship["stats"]["SC"]["class name"] = "Light Spiker" ship["stats"]["SC"]["move range"] = 6 ship["stats"]["SC"]["attack range"] = 2 ship["stats"]["SC"]["damage per shot"] = 3 ship["stats"]["SC"]["shots"] = 2 ship["stats"]["SC"]["hp"] = 8 ship["stats"]["SS"]["class name"] = "Light Tank" ship["stats"]["SS"]["move range"] = 3 ship["stats"]["SS"]["attack range"] = 3 ship["stats"]["SS"]["damage per shot"] = 4 ship["stats"]["SS"]["shots"] = 1 ship["stats"]["SS"]["hp"] = 12 game["ship"]["init"]["LT"] = 1 game["ship"]["init"]["LC"] = 1 game["ship"]["init"]["LS"] = 1 game["ship"]["init"]["ST"] = 2 game["ship"]["init"]["SC"] = 2 game["ship"]["init"]["SS"] = 2 game["grid"]["init"]["width"] = 15 game["grid"]["init"]["height"] = 11 game["grid"]["init"]["moves"] = 5 game["grid"]["init"]["attacks"] = 5 game["grid"]["init"]["terrain"] = 5 game["grid"]["init"]["multi move"] =0 home_init() EndSub 'Init Sub home_init 'Buttons home_init_button["list"][0] = "Play" home_init_button["list"][1] = "Options" home_init_button["list"][2] = "Quit" GraphicsWindow.Width = 1000 GraphicsWindow.Height = 600 GraphicsWindow.BackgroundColor = "Black" GraphicsWindow.Top = (Desktop.Height/2)-(GraphicsWindow.Height/2) GraphicsWindow.Left = (Desktop.Width/2)-(GraphicsWindow.Width/2) GraphicsWindow.Show() home_button_draw() Controls.ButtonClicked = home_button_clicked GraphicsWindow.MouseDown = null GraphicsWindow.MouseUp = null GraphicsWindow.MouseMove = null EndSub Sub home_button_draw home_init_button["count"] = Array.GetItemCount(home_init_button["list"]) home_init_button["height"] = 60 home_init_button["width"] = 200 home_init_button["padding"] = 40 GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontName = "Century" GraphicsWindow.FontSize = home_init_button["height"]/3 GraphicsWindow.FontBold = "true" GraphicsWindow.FontItalic = "true" For i = 0 To (home_init_button["count"] - 1) home_init_button["button"][i] = Controls.AddButton(home_init_button["list"][i],(GraphicsWindow.Width/2)-(home_init_button["width"]/2),(GraphicsWindow.height/2)-((((home_init_button["height"]+home_init_button["padding"])*home_init_button["count"])-home_init_button["padding"])/2)+((home_init_button["height"]+home_init_button["padding"])*i)) Controls.SetSize(home_init_button["button"][i],home_init_button["width"],home_init_button["height"]) EndFor EndSub Sub home_button_clicked home_init_button["last clicked"] = Controls.LastClickedButton If home_init_button["last clicked"] = home_init_button["button"][0] Then 'Play home_clear() play_init() ElseIf home_init_button["last clicked"] = home_init_button["button"][1] Then 'Options home_clear() option_init() ElseIf home_init_button["last clicked"] = home_init_button["button"][2] Then 'Exit Program.End() EndIf EndSub Sub home_clear 'Clear Buttons For i = 0 To (home_init_button["count"] - 1) Controls.Remove(home_init_button["button"][i]) EndFor EndSub 'Ship classes 'Class: Heavy Weaver 'Shape: Large Triangle 'Move Range: 6 'Attack Range: 2 'Damage/shot: 3 'Shots: 4 'HP: 12 'Class: Light Weaver 'Shape: Small Triangle 'Move Range: 9 'Attack Range: 1 'Damage/shot: 1 'Shots: 3 'HP: 4 'Class: Heavy Spiker 'Shape: Large Circle 'Move Range: 4 'Attack Range: 3 'Damage/shot: 5 'Shots: 3 'HP: 16 'Class: Light Spiker 'Shape: Small Circle 'Move Range: 6 'Attack Range: 2 'Damage/shot: 3 'Shots: 2 'HP: 8 'Class: Heavy Tank 'Shape: Large Square 'Move Range: 2 'Attack Range: 4 'Damage/shot: 8 'Shots: 2 'HP: 20 'Class: Light Tank 'Shape: Small Square 'Move Range: 3 'Attack Range: 3 'Damage/shot: 4 'Shots: 1 'HP: 12 'Option Section Sub option_init column[1] = 10 column[2] = 150 column[3] = 340 column[4] = 480 column[5] = 670 column[6] = 810 GraphicsWindow.FontSize = 28 GraphicsWindow.BrushColor = "White" GraphicsWindow.FontBold = "True" GraphicsWindow.FontItalic = "True" GraphicsWindow.DrawText(column[1],10,"Options") GraphicsWindow.FontSize = 18 GraphicsWindow.DrawText(column[1],50,"Ships") GraphicsWindow.FontItalic = "False" GraphicsWindow.FontSize = 12 GraphicsWindow.FontBold = "True" GraphicsWindow.DrawText(10,80,"Large Triangle") GraphicsWindow.FontBold = "False" GraphicsWindow.DrawText(column[1],100,"Class name:") GraphicsWindow.DrawText(column[1],125,"Move Range:") GraphicsWindow.DrawText(column[1],150,"Attack Range:") GraphicsWindow.DrawText(column[1],175,"Damage per shot:") GraphicsWindow.DrawText(column[1],200,"Shots:") GraphicsWindow.DrawText(column[1],225,"HP:") GraphicsWindow.BrushColor = "Black" options_text_box["LT"]["class name"] = Controls.AddTextBox(column[2],100) options_text_box["LT"]["move range"] = Controls.AddTextBox(column[2],125) options_text_box["LT"]["attack range"] = Controls.AddTextBox(column[2],150) options_text_box["LT"]["damage per shot"] = Controls.AddTextBox(column[2],175) options_text_box["LT"]["shots"] = Controls.AddTextBox(column[2],200) options_text_box["LT"]["hp"] = Controls.AddTextBox(column[2],225) GraphicsWindow.BrushColor = "White" GraphicsWindow.FontBold = "True" GraphicsWindow.DrawText(column[1],250,"Large Circle") GraphicsWindow.FontBold = "False" GraphicsWindow.DrawText(column[1],270,"Class name:") GraphicsWindow.DrawText(column[1],295,"Move Range:") GraphicsWindow.DrawText(column[1],320,"Attack Range:") GraphicsWindow.DrawText(column[1],345,"Damage per shot:") GraphicsWindow.DrawText(column[1],370,"Shots:") GraphicsWindow.DrawText(column[1],395,"HP:") GraphicsWindow.BrushColor = "Black" options_text_box["LC"]["class name"] = Controls.AddTextBox(column[2],270) options_text_box["LC"]["move range"] = Controls.AddTextBox(column[2],295) options_text_box["LC"]["attack range"] = Controls.AddTextBox(column[2],320) options_text_box["LC"]["damage per shot"] = Controls.AddTextBox(column[2],345) options_text_box["LC"]["shots"] = Controls.AddTextBox(column[2],370) options_text_box["LC"]["hp"] = Controls.AddTextBox(column[2],395) GraphicsWindow.BrushColor = "White" GraphicsWindow.FontBold = "True" GraphicsWindow.DrawText(column[1],420,"Large Square") GraphicsWindow.FontBold = "False" GraphicsWindow.DrawText(column[1],440,"Class name:") GraphicsWindow.DrawText(column[1],465,"Move Range:") GraphicsWindow.DrawText(column[1],490,"Attack Range:") GraphicsWindow.DrawText(column[1],515,"Damage per shot:") GraphicsWindow.DrawText(column[1],540,"Shots:") GraphicsWindow.DrawText(column[1],565,"HP:") GraphicsWindow.BrushColor = "Black" options_text_box["LS"]["class name"] = Controls.AddTextBox(column[2],440) options_text_box["LS"]["move range"] = Controls.AddTextBox(column[2],465) options_text_box["LS"]["attack range"] = Controls.AddTextBox(column[2],490) options_text_box["LS"]["damage per shot"] = Controls.AddTextBox(column[2],515) options_text_box["LS"]["shots"] = Controls.AddTextBox(column[2],540) options_text_box["LS"]["hp"] = Controls.AddTextBox(column[2],565) GraphicsWindow.BrushColor = "White" GraphicsWindow.FontBold = "True" GraphicsWindow.DrawText(column[3],80,"Small Triangle") GraphicsWindow.FontBold = "False" GraphicsWindow.DrawText(column[3],100,"Class name:") GraphicsWindow.DrawText(column[3],125,"Move Range:") GraphicsWindow.DrawText(column[3],150,"Attack Range:") GraphicsWindow.DrawText(column[3],175,"Damage per shot:") GraphicsWindow.DrawText(column[3],200,"Shots:") GraphicsWindow.DrawText(column[3],225,"Shots:") GraphicsWindow.BrushColor = "Black" options_text_box["ST"]["class name"] = Controls.AddTextBox(column[4],100) options_text_box["ST"]["move range"] = Controls.AddTextBox(column[4],125) options_text_box["ST"]["attack range"] = Controls.AddTextBox(column[4],150) options_text_box["ST"]["damage per shot"] = Controls.AddTextBox(column[4],175) options_text_box["ST"]["shots"] = Controls.AddTextBox(column[4],200) options_text_box["ST"]["hp"] = Controls.AddTextBox(column[4],225) GraphicsWindow.BrushColor = "White" GraphicsWindow.FontBold = "True" GraphicsWindow.DrawText(column[3],250,"Small Circle") GraphicsWindow.FontBold = "False" GraphicsWindow.DrawText(column[3],270,"Class name:") GraphicsWindow.DrawText(column[3],295,"Move Range:") GraphicsWindow.DrawText(column[3],320,"Attack Range:") GraphicsWindow.DrawText(column[3],345,"Damage per shot:") GraphicsWindow.DrawText(column[3],370,"Shots:") GraphicsWindow.DrawText(column[3],395,"HP:") GraphicsWindow.BrushColor = "Black" options_text_box["SC"]["class name"] = Controls.AddTextBox(column[4],270) options_text_box["SC"]["move range"] = Controls.AddTextBox(column[4],295) options_text_box["SC"]["attack range"] = Controls.AddTextBox(column[4],320) options_text_box["SC"]["damage per shot"] = Controls.AddTextBox(column[4],345) options_text_box["SC"]["shots"] = Controls.AddTextBox(column[4],370) options_text_box["SC"]["hp"] = Controls.AddTextBox(column[4],395) GraphicsWindow.BrushColor = "White" GraphicsWindow.FontBold = "True" GraphicsWindow.DrawText(column[3],420,"Small Square") GraphicsWindow.FontBold = "False" GraphicsWindow.DrawText(column[3],440,"Class name:") GraphicsWindow.DrawText(column[3],465,"Move Range:") GraphicsWindow.DrawText(column[3],490,"Attack Range:") GraphicsWindow.DrawText(column[3],515,"Damage per shot:") GraphicsWindow.DrawText(column[3],540,"Shots:") GraphicsWindow.DrawText(column[3],565,"HP:") GraphicsWindow.BrushColor = "Black" options_text_box["SS"]["class name"] = Controls.AddTextBox(column[4],440) options_text_box["SS"]["move range"] = Controls.AddTextBox(column[4],465) options_text_box["SS"]["attack range"] = Controls.AddTextBox(column[4],490) options_text_box["SS"]["damage per shot"] = Controls.AddTextBox(column[4],515) options_text_box["SS"]["shots"] = Controls.AddTextBox(column[4],540) options_text_box["SS"]["hp"] = Controls.AddTextBox(column[4],565) GraphicsWindow.BrushColor = "White" GraphicsWindow.FontSize = 18 GraphicsWindow.FontItalic = "True" GraphicsWindow.FontBold = "True" GraphicsWindow.DrawText(column[5],50,"Game Options") GraphicsWindow.FontItalic = "False" GraphicsWindow.FontSize = 14 GraphicsWindow.DrawText(column[5],80,"Fleet Size") GraphicsWindow.FontBold = "False" GraphicsWindow.DrawText(column[5],100,"Large Triangles:") GraphicsWindow.DrawText(column[5],130,"Large Cirlces:") GraphicsWindow.DrawText(column[5],160,"Large Squares:") GraphicsWindow.DrawText(column[5],190,"Small Triangles:") GraphicsWindow.DrawText(column[5],220,"Small Circles:") GraphicsWindow.DrawText(column[5],250,"Small Squares:") GraphicsWindow.BrushColor = "Black" options_text_box["Game"]["LT"] = Controls.AddTextBox(column[6],100) options_text_box["Game"]["LC"] = Controls.AddTextBox(column[6],130) options_text_box["Game"]["LS"] = Controls.AddTextBox(column[6],160) options_text_box["Game"]["ST"] = Controls.AddTextBox(column[6],190) options_text_box["Game"]["SC"] = Controls.AddTextBox(column[6],220) options_text_box["Game"]["SS"] = Controls.AddTextBox(column[6],250) GraphicsWindow.BrushColor = "White" GraphicsWindow.FontBold = "True" GraphicsWindow.DrawText(column[5],280,"Game Options") GraphicsWindow.FontBold = "False" GraphicsWindow.DrawText(column[5],300,"Grid Width:") GraphicsWindow.DrawText(column[5],330,"Grid Height:") GraphicsWindow.DrawText(column[5],360,"Moves per Turn:") GraphicsWindow.DrawText(column[5],390,"Attacks per Turn:") GraphicsWindow.DrawText(column[5],420,"Terrain Level (0-10):") GraphicsWindow.DrawText(column[5],450,"Can multi-move (1/0):") GraphicsWindow.BrushColor = "Black" options_text_box["Game"]["width"] = Controls.AddTextBox(column[6],300) options_text_box["Game"]["height"] = Controls.AddTextBox(column[6],330) options_text_box["Game"]["moves"] = Controls.AddTextBox(column[6],360) options_text_box["Game"]["attacks"] = Controls.AddTextBox(column[6],390) options_text_box["Game"]["terrain"] = Controls.AddTextBox(column[6],420) options_text_box["Game"]["multi move"] = Controls.AddTextBox(column[6],450) For i = 1 To 6 'Each Ship's Stats: Controls.SetTextBoxText(options_text_box[ship["type"][i]]["class name"],ship["stats"][ship["type"][i]]["class name"]) Controls.SetTextBoxText(options_text_box[ship["type"][i]]["move range"],ship["stats"][ship["type"][i]]["move range"]) Controls.SetTextBoxText(options_text_box[ship["type"][i]]["attack range"],ship["stats"][ship["type"][i]]["attack range"]) Controls.SetTextBoxText(options_text_box[ship["type"][i]]["damage per shot"],ship["stats"][ship["type"][i]]["damage per shot"]) Controls.SetTextBoxText(options_text_box[ship["type"][i]]["shots"],ship["stats"][ship["type"][i]]["shots"]) Controls.SetTextBoxText(options_text_box[ship["type"][i]]["hp"],ship["stats"][ship["type"][i]]["hp"]) Controls.SetTextBoxText(options_text_box["Game"][ship["type"][i]],game["ship"]["init"][ship["type"][i]]) EndFor Controls.SetTextBoxText(options_text_box["Game"]["width"],game["grid"]["init"]["width"]) Controls.SetTextBoxText(options_text_box["Game"]["height"],game["grid"]["init"]["height"]) Controls.SetTextBoxText(options_text_box["Game"]["moves"],game["grid"]["init"]["moves"]) Controls.SetTextBoxText(options_text_box["Game"]["attacks"],game["grid"]["init"]["attacks"]) Controls.SetTextBoxText(options_text_box["Game"]["terrain"],game["grid"]["init"]["terrain"]) Controls.SetTextBoxText(options_text_box["Game"]["multi move"],game["grid"]["init"]["multi move"]) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontBold = "True" GraphicsWindow.FontItalic = "False" GraphicsWindow.FontSize = 20 options_button["spacing"] = 30 options_button["left"] = column[5] options_button["right"] = column[6] + 160 options_button["height"] = 35 options_button["width"] = ((options_button["right"] - options_button["left"])/2) - (options_button["spacing"]/2) options_button["save"] = Controls.AddButton("Save",options_button["left"],550) Controls.SetSize(options_button["save"],options_button["width"], options_button["height"]) options_button["return"] = Controls.AddButton("Return",options_button["right"] - options_button["width"],550) Controls.SetSize(options_button["return"],options_button["width"], options_button["height"]) Controls.ButtonClicked = option_event EndSub Sub option_event last_button_clicked = Controls.LastClickedButton If last_button_clicked = options_button["save"] Then option_save() GraphicsWindow.ShowMessage("Options Saved!","Options") ElseIf last_button_clicked = options_button["return"] Then option_clear() home_init() EndIf EndSub Sub option_clear GraphicsWindow.Clear() Controls.Remove(options_button["save"]) Controls.Remove(options_button["return"]) For i = 1 To 6 Controls.Remove(options_text_box[ship["type"][i]]["class name"]) Controls.Remove(options_text_box[ship["type"][i]]["move range"]) Controls.Remove(options_text_box[ship["type"][i]]["attack range"]) Controls.Remove(options_text_box[ship["type"][i]]["damage per shot"]) Controls.Remove(options_text_box[ship["type"][i]]["shots"]) Controls.Remove(options_text_box[ship["type"][i]]["hp"]) Controls.Remove(options_text_box["Game"][ship["type"][i]]) EndFor Controls.Remove(options_text_box["Game"]["width"]) Controls.Remove(options_text_box["Game"]["height"]) Controls.Remove(options_text_box["Game"]["moves"]) Controls.Remove(options_text_box["Game"]["attacks"]) Controls.Remove(options_text_box["Game"]["terrain"]) Controls.Remove(options_text_box["Game"]["multi move"]) EndSub Sub option_save For i = 1 To 6 'Each Ship's Stats: ship["stats"][ship["type"][i]]["class name"] = Controls.GetTextBoxText(options_text_box[ship["type"][i]]["class name"]) ship["stats"][ship["type"][i]]["move range"] = Controls.GetTextBoxText(options_text_box[ship["type"][i]]["move range"]) ship["stats"][ship["type"][i]]["attack range"] = Controls.GetTextBoxText(options_text_box[ship["type"][i]]["attack range"]) ship["stats"][ship["type"][i]]["damage per shot"] = Controls.GetTextBoxText(options_text_box[ship["type"][i]]["damage per shot"]) ship["stats"][ship["type"][i]]["shots"] = Controls.GetTextBoxText(options_text_box[ship["type"][i]]["shots"]) ship["stats"][ship["type"][i]]["hp"] = Controls.GetTextBoxText(options_text_box[ship["type"][i]]["hp"]) game["ship"]["init"][ship["type"][i]] = Controls.GetTextBoxText(options_text_box["Game"][ship["type"][i]]) EndFor game["grid"]["init"]["width"] = Controls.GetTextBoxText(options_text_box["Game"]["width"]) game["grid"]["init"]["height"] = Controls.GetTextBoxText(options_text_box["Game"]["height"]) game["grid"]["init"]["moves"] = Controls.GetTextBoxText(options_text_box["Game"]["moves"]) game["grid"]["init"]["attacks"] = Controls.GetTextBoxText(options_text_box["Game"]["attacks"]) game["grid"]["init"]["terrain"] = Controls.GetTextBoxText(options_text_box["Game"]["terrain"]) game["grid"]["init"]["multi move"] = Controls.GetTextBoxText(options_text_box["Game"]["multi move"]) EndSub 'Play Section Sub play_init game["grid"]["padding"] = 25 game["grid"]["max height"] = GraphicsWindow.Height - (2*game["grid"]["padding"]) game["grid"]["max width"] = 800 - (2*game["grid"]["padding"]) game["grid"]["proposed cell size"]["by height"] = game["grid"]["max height"]/game["grid"]["init"]["height"] game["grid"]["proposed cell size"]["by width"] = game["grid"]["max width"]/game["grid"]["init"]["width"] game["grid"]["cell size"] = Math.Min(game["grid"]["proposed cell size"]["by height"],game["grid"]["proposed cell size"]["by width"]) game["grid"]["width px"] = game["grid"]["cell size"]*game["grid"]["init"]["width"] game["grid"]["height px"] = game["grid"]["cell size"]*game["grid"]["init"]["height"] game["grid"]["center"]["x"] = 400 game["grid"]["center"]["y"] = GraphicsWindow.Height/2 game["grid"]["left"] = game["grid"]["center"]["x"] - (game["grid"]["width px"]/2) game["grid"]["top"] = game["grid"]["center"]["y"] - (game["grid"]["height px"]/2) game["grid"]["columns"] = game["grid"]["init"]["width"] game["grid"]["rows"] = game["grid"]["init"]["height"] game["ship"]["init"]["total per side"] = 0 For i = 1 To 6 game["ship"]["init"]["total per side"] = game["ship"]["init"]["total per side"] + game["ship"]["init"][ship["type"][i]] EndFor game["grid"]["base size"] = Math.Ceiling(Math.SquareRoot((2*game["ship"]["init"]["total per side"]) + (1/4))-(1/2)) GraphicsWindow.Title = "Left: " + game["grid"]["left"] + ", Top: " + game["grid"]["top"] + ", Cell size: " + game["grid"]["cell size"] + ", Base size: " + game["grid"]["base size"] 'Draw Bases: 'Blue - bottom left 'Purple - top right GraphicsWindow.BrushColor = "Blue" GraphicsWindow.PenColor = "Blue" GraphicsWindow.PenWidth = 0 blue_team["base"] = Shapes.AddTriangle(game["grid"]["left"],game["grid"]["top"]+game["grid"]["height px"],game["grid"]["left"],game["grid"]["top"]+game["grid"]["height px"]-(game["grid"]["cell size"]*((1/2)+game["grid"]["base size"])),game["grid"]["left"]+(game["grid"]["cell size"]*((1/2)+game["grid"]["base size"])),game["grid"]["top"]+game["grid"]["height px"]) Shapes.SetOpacity(blue_team["base"],40) GraphicsWindow.BrushColor = "Purple" GraphicsWindow.PenColor = "Purple" GraphicsWindow.PenWidth = 0 purple_team["base"] = Shapes.AddTriangle(game["grid"]["left"]+game["grid"]["width px"],game["grid"]["top"],game["grid"]["left"]+game["grid"]["width px"]-(game["grid"]["cell size"]*((1/2)+game["grid"]["base size"])),game["grid"]["top"],game["grid"]["left"]+game["grid"]["width px"],game["grid"]["top"]+(game["grid"]["cell size"]*((1/2)+game["grid"]["base size"]))) Shapes.SetOpacity(purple_team["base"],40) If game["grid"]["highlight"]["style"] = 1 Then play_highlight_style_1_draw() ElseIf game["grid"]["highlight"]["style"] = 2 Then play_highlight_style_2_draw() EndIf If game["grid"]["show grid"] = "True" Then play_show_grid() EndIf game["grid"]["l size"] = game["grid"]["cell size"]*(80/100) game["grid"]["l padding"] = (game["grid"]["cell size"] - game["grid"]["l size"])/2 game["grid"]["s size"] = game["grid"]["cell size"]*(40/100) game["grid"]["s padding"] = (game["grid"]["cell size"] - game["grid"]["s size"])/2 'Team Blue ships 'ships["blue"][ ][ / / x / y / hp /dps / attack range / move range ] ship["attribute"][1] = "class name" ship["attribute"][2] = "move range" ship["attribute"][3] = "attack range" ship["attribute"][4] = "damage per shot" ship["attribute"][5] = "shots" ship["attribute"][6] = "hp" For i = 1 To game["grid"]["columns"] For j = 1 To game["grid"]["rows"] game["grid"][i][j]["blue"] = 0 game["grid"][i][j]["purple"] = 0 game["grid"][i][j]["terrain"] = 0 EndFor EndFor ship["color"][1] = "blue" ship["color"][2] = "purple" For color = 1 To 2 If color = 1 Then GraphicsWindow.BrushColor = "Blue" GraphicsWindow.PenColor = "White" GraphicsWindow.PenWidth = 2 current_id = 1 current_x = 1 current_y = game["grid"]["rows"] current_y_max = game["grid"]["rows"] current_y_min = game["grid"]["rows"] current_x_min = 1 Else GraphicsWindow.BrushColor = "Purple" GraphicsWindow.PenColor = "White" GraphicsWindow.PenWidth = 2 current_id = 1 current_x = game["grid"]["columns"] current_y = 1 current_x_max = game["grid"]["columns"] current_y_min = 1 current_y_max = 1 EndIf For i = 1 To 6 'Ship types If game["ship"]["init"][ship["type"][i]] > 0 Then For j = 1 To game["ship"]["init"][ship["type"][i]] If ship["type"][i] = "LT" Then ship[ship["color"][color]][current_id]["padding"] = game["grid"]["l padding"] x[1] = game["grid"]["left"]+((current_x-(1/2))*game["grid"]["cell size"]) y[1] = game["grid"]["top"]+((current_y-1)*game["grid"]["cell size"])+game["grid"]["l padding"] x[2] = game["grid"]["left"]+((current_x-1)*game["grid"]["cell size"])+game["grid"]["l padding"] y[2] = game["grid"]["top"]+(current_y*game["grid"]["cell size"])-game["grid"]["l padding"] x[3] = game["grid"]["left"]+(current_x*game["grid"]["cell size"])-game["grid"]["l padding"] y[3] = game["grid"]["top"]+(current_y*game["grid"]["cell size"])-game["grid"]["l padding"] ship[ship["color"][color]][current_id]["padding"]["x"] = game["grid"]["l padding"]-x[2] ship[ship["color"][color]][current_id]["padding"]["y"] = game["grid"]["l padding"]-y[1] ship[ship["color"][color]][current_id]["shape"] = Shapes.AddTriangle(x[1],y[1],x[2],y[2],x[3],y[3]) ElseIf ship["type"][i] = "ST" Then x[1] = game["grid"]["left"]+((current_x-(1/2))*game["grid"]["cell size"]) y[1] = game["grid"]["top"]+((current_y-1)*game["grid"]["cell size"])+game["grid"]["s padding"] x[2] = game["grid"]["left"]+((current_x-1)*game["grid"]["cell size"])+game["grid"]["s padding"] y[2] = game["grid"]["top"]+(current_y*game["grid"]["cell size"])-game["grid"]["s padding"] x[3] = game["grid"]["left"]+(current_x*game["grid"]["cell size"])-game["grid"]["s padding"] y[3] = game["grid"]["top"]+(current_y*game["grid"]["cell size"])-game["grid"]["s padding"] ship[ship["color"][color]][current_id]["padding"]["x"] = game["grid"]["s padding"]-x[2] ship[ship["color"][color]][current_id]["padding"]["y"] = game["grid"]["s padding"]-y[1] ship[ship["color"][color]][current_id]["shape"] = Shapes.AddTriangle(x[1],y[1],x[2],y[2],x[3],y[3]) ElseIf ship["type"][i] = "LC" Then ship[ship["color"][color]][current_id]["shape"] = Shapes.AddEllipse(game["grid"]["l size"],game["grid"]["l size"]) ship[ship["color"][color]][current_id]["padding"]["x"] = game["grid"]["l padding"] ship[ship["color"][color]][current_id]["padding"]["y"] = game["grid"]["l padding"] x[1] = game["grid"]["left"]+((current_x-1)*game["grid"]["cell size"])+game["grid"]["l padding"] y[1] = game["grid"]["top"]+((current_y-1)*game["grid"]["cell size"])+game["grid"]["l padding"] Shapes.Move(ship[ship["color"][color]][current_id]["shape"],x[1],y[1]) ElseIf ship["type"][i] = "SC" Then ship[ship["color"][color]][current_id]["shape"] = Shapes.AddEllipse(game["grid"]["s size"],game["grid"]["s size"]) ship[ship["color"][color]][current_id]["padding"]["x"] = game["grid"]["s padding"] ship[ship["color"][color]][current_id]["padding"]["y"] = game["grid"]["s padding"] x[1] = game["grid"]["left"]+((current_x-1)*game["grid"]["cell size"])+game["grid"]["s padding"] y[1] = game["grid"]["top"]+((current_y-1)*game["grid"]["cell size"])+game["grid"]["s padding"] Shapes.Move(ship[ship["color"][color]][current_id]["shape"],x[1],y[1]) ElseIf ship["type"][i] = "LS" Then ship[ship["color"][color]][current_id]["shape"] = Shapes.AddRectangle(game["grid"]["l size"],game["grid"]["l size"]) ship[ship["color"][color]][current_id]["padding"]["x"] = game["grid"]["l padding"] ship[ship["color"][color]][current_id]["padding"]["y"] = game["grid"]["l padding"] x[1] = game["grid"]["left"]+((current_x-1)*game["grid"]["cell size"])+game["grid"]["l padding"] y[1] = game["grid"]["top"]+((current_y-1)*game["grid"]["cell size"])+game["grid"]["l padding"] Shapes.Move(ship[ship["color"][color]][current_id]["shape"],x[1],y[1]) ElseIf ship["type"][i] = "SS" Then ship[ship["color"][color]][current_id]["shape"] = Shapes.AddRectangle(game["grid"]["s size"],game["grid"]["s size"]) ship[ship["color"][color]][current_id]["padding"]["x"] = game["grid"]["s padding"] ship[ship["color"][color]][current_id]["padding"]["y"] = game["grid"]["s padding"] x[1] = game["grid"]["left"]+((current_x-1)*game["grid"]["cell size"])+game["grid"]["s padding"] y[1] = game["grid"]["top"]+((current_y-1)*game["grid"]["cell size"])+game["grid"]["s padding"] Shapes.Move(ship[ship["color"][color]][current_id]["shape"],x[1],y[1]) EndIf For k = 1 to 6 'Attributes ship[ship["color"][color]][current_id][ship["attribute"][k]] = ship["stats"][ship["type"][i]][ship["attribute"][k]] EndFor game["grid"][current_x][current_y][ship["color"][color]] = current_id ship[ship["color"][color]][current_id]["x"] = current_x ship[ship["color"][color]][current_id]["y"] = current_y ship[ship["color"][color]][current_id]["permission"]["move"] = 1 ship[ship["color"][color]][current_id]["permission"]["attack"] = 1 ship[ship["color"][color]][current_id]["is dead"] = 0 ship[ship["color"][color]][current_id]["type"] = ship["type"][i] If color = 1 Then current_id = current_id + 1 If current_y = current_y_max Then current_x = current_x_min current_y_min = current_y_min - 1 current_y = current_y_min Else current_x = current_x + 1 current_y = current_y + 1 EndIf Else current_id = current_id + 1 If current_y = current_y_min Then current_x = current_x_max current_y_max = current_y_max + 1 current_y = current_y_max Else current_x = current_x - 1 current_y = current_y - 1 EndIf EndIf EndFor EndIf EndFor EndFor 'Side Bar: game["side bar"]["padding"] = 25 game["side bar"]["left"] = 800 game["side bar"]["width"] = GraphicsWindow.Width - game["side bar"]["left"] game["side bar"]["height"] = GraphicsWindow.Height - (300) game["side bar"]["top"] = (GraphicsWindow.Height/2)-(game["side bar"]["height"]/2) GraphicsWindow.BrushColor = "White" GraphicsWindow.PenWidth = 0 game["side bar"]["shape shadow"] = Shapes.AddRectangle(game["side bar"]["width"] - game["side bar"]["padding"] ,game["side bar"]["height"]-game["side bar"]["padding"]) Shapes.Move(game["side bar"]["shape shadow"],game["side bar"]["left"]+(game["side bar"]["padding"]/2)-(game["side bar"]["padding"]/2),game["side bar"]["top"]+(game["side bar"]["padding"]/2)-(game["side bar"]["padding"]/2)) Shapes.SetOpacity(game["side bar"]["shape shadow"],40) game["side bar"]["shape"] = Shapes.AddRectangle(game["side bar"]["width"] - game["side bar"]["padding"] ,game["side bar"]["height"]-game["side bar"]["padding"]) Shapes.Move(game["side bar"]["shape"],game["side bar"]["left"]+(game["side bar"]["padding"]/2),game["side bar"]["top"]+(game["side bar"]["padding"])/2) player[1] = "Blue" player[2] = "Purple" game["turn player"] = 1 game["attacks remaining"] = game["grid"]["init"]["attacks"] game["moves remaining"] = game["grid"]["init"]["moves"] GraphicsWindow.FontBold = "True" GraphicsWindow.FontItalic = "False" GraphicsWindow.FontSize = 20 GraphicsWindow.BrushColor = "Blue" game["side bar"]["text"]["turn"]["Blue"] = Shapes.AddText("Blue's Turn") GraphicsWindow.BrushColor = "Purple" game["side bar"]["text"]["turn"]["Purple"] = Shapes.AddText("Purple's Turn") Shapes.Move(game["side bar"]["text"]["turn"]["Blue"], game["side bar"]["left"] + game["side bar"]["padding"],game["side bar"]["top"]+game["side bar"]["padding"]) Shapes.Move(game["side bar"]["text"]["turn"]["Purple"], game["side bar"]["left"] + game["side bar"]["padding"],game["side bar"]["top"]+game["side bar"]["padding"]) Shapes.HideShape(game["side bar"]["text"]["turn"]["Blue"]) Shapes.HideShape(game["side bar"]["text"]["turn"]["Purple"]) Shapes.ShowShape(game["side bar"]["text"]["turn"][player[game["turn player"]]]) GraphicsWindow.FontBold = "False" GraphicsWindow.FontItalic = "False" GraphicsWindow.FontSize = 16 GraphicsWindow.BrushColor = "Black" game["side bar"]["text"]["moves"] = Shapes.AddText("Moves Remaining: " + game["moves remaining"]) game["side bar"]["text"]["attacks"] = Shapes.AddText("Attacks Remaining: " + game["attacks remaining"]) Shapes.Move(game["side bar"]["text"]["moves"], game["side bar"]["left"] + game["side bar"]["padding"], game["side bar"]["top"]+game["side bar"]["padding"] + 50) Shapes.Move(game["side bar"]["text"]["attacks"], game["side bar"]["left"] + game["side bar"]["padding"], game["side bar"]["top"]+game["side bar"]["padding"] + 80) game["side bar"]["button"]["end turn"] = Controls.AddButton("End Turn",game["side bar"]["left"] + game["side bar"]["padding"], game["side bar"]["top"]+game["side bar"]["height"]-(game["side bar"]["padding"]+60)) Controls.SetSize(game["side bar"]["button"]["end turn"],150,60) game["side bar"]["button"]["resign"] = Controls.AddButton("Resign",game["side bar"]["left"] + game["side bar"]["padding"], game["side bar"]["top"]+game["side bar"]["height"]-(2*game["side bar"]["padding"]+100)) Controls.SetSize(game["side bar"]["button"]["resign"],150,40) 'Terrain: GraphicsWindow.BrushColor = "Brown" If game["grid"]["init"]["terrain"] <> 0 Then game["grid"]["init"]["terrain scaling"] = (1/30) game["grid"]["init"]["terrain tries"] = Math.Floor(game["grid"]["init"]["terrain scaling"]*game["grid"]["init"]["terrain"]*game["grid"]["rows"]*game["grid"]["columns"]) For i = 1 To game["grid"]["init"]["terrain tries"] x["terrain"] = Math.GetRandomNumber(game["grid"]["columns"]) y["terrain"] = Math.GetRandomNumber(game["grid"]["rows"]) If y["terrain"] < (game["grid"]["rows"]-game["grid"]["base size"]+x["terrain"]-1) And x["terrain"] < (game["grid"]["columns"]-game["grid"]["base size"]+y["terrain"]-1) Then If game["grid"][x["terrain"]][y["terrain"]]["terrain"] = 0 Then 'Types of terrain game["grid"][x["terrain"]][y["terrain"]]["terrain"] = 1 x[1] = game["grid"]["left"]+(x["terrain"]-1)*game["grid"]["cell size"] y[1] = game["grid"]["top"]+(y["terrain"]-1)*game["grid"]["cell size"] GraphicsWindow.FillRectangle(x[1],y[1],game["grid"]["cell size"],game["grid"]["cell size"]) game["grid"][game["grid"]["columns"]-x["terrain"]+1][game["grid"]["rows"]-y["terrain"]+1]["terrain"] = 1 x[2] = game["grid"]["left"]+(game["grid"]["columns"]-x["terrain"])*game["grid"]["cell size"] y[2] = game["grid"]["top"]+(game["grid"]["rows"]-y["terrain"])*game["grid"]["cell size"] GraphicsWindow.FillRectangle(x[2],y[2],game["grid"]["cell size"],game["grid"]["cell size"]) EndIf EndIf EndFor EndIf 'Mini Menu game["mini menu"]["padding"] = 5 game["mini menu"]["text size"] = 18 game["mini menu"]["width"] = 220 game["mini menu"]["height"] = (12*game["mini menu"]["text size"])+(13*game["mini menu"]["padding"]) GraphicsWindow.BrushColor = "White" GraphicsWindow.PenColor = "Gray" GraphicsWindow.PenWidth = 2 game["mini menu"]["shape"]["background"] = Shapes.AddRectangle(game["mini menu"]["width"],game["mini menu"]["height"]) GraphicsWindow.BrushColor = "Black" game["mini menu"]["shape"]["highlight"] = Shapes.AddRectangle(game["mini menu"]["width"],game["mini menu"]["text size"]+2) Shapes.SetOpacity(game["mini menu"]["shape"]["highlight"],20) Shapes.HideShape(game["mini menu"]["shape"]["background"]) Shapes.HideShape(game["mini menu"]["shape"]["highlight"]) GraphicsWindow.FontSize = game["mini menu"]["text size"] GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontBold = "True" game["mini menu"]["text"]["class name"] = Shapes.AddText("Name") GraphicsWindow.FontBold = "False" game["mini menu"]["text"]["hp"] = Shapes.AddText("HP: ") game["mini menu"]["text"]["move range"] = Shapes.AddText("Move Range: ") game["mini menu"]["text"]["attack range"] = Shapes.AddText("Attack Range: ") game["mini menu"]["text"]["damage per shot"] = Shapes.AddText("Damage per Shot: ") game["mini menu"]["text"]["shots"] = Shapes.AddText("Shots: ") game["mini menu"]["text"]["can attack"] = Shapes.AddText("Can Attack: ") game["mini menu"]["text"]["can move"] = Shapes.AddText("Can Move: ") GraphicsWindow.FontBold = "True" game["mini menu"]["text"]["options"] = Shapes.AddText("Options:") GraphicsWindow.FontBold = "False" game["mini menu"]["text"]["attack"] = Shapes.AddText("Attack") game["mini menu"]["text"]["move"] = Shapes.AddText("Move") game["mini menu"]["text"]["cancel"] = Shapes.AddText("Cancel") Shapes.HideShape(game["mini menu"]["text"]["class name"]) Shapes.HideShape(game["mini menu"]["text"]["hp"]) Shapes.HideShape(game["mini menu"]["text"]["move range"]) Shapes.HideShape(game["mini menu"]["text"]["attack range"]) Shapes.HideShape(game["mini menu"]["text"]["damage per shot"]) Shapes.HideShape(game["mini menu"]["text"]["shots"]) Shapes.HideShape(game["mini menu"]["text"]["can attack"]) Shapes.HideShape(game["mini menu"]["text"]["can move"]) Shapes.HideShape(game["mini menu"]["text"]["options"]) Shapes.HideShape(game["mini menu"]["text"]["attack"]) Shapes.HideShape(game["mini menu"]["text"]["move"]) Shapes.HideShape(game["mini menu"]["text"]["cancel"]) game["mini menu"]["display"] = "False" game["mini menu"]["top"] = 0 game["mini menu"]["left"] = 0 game["mini menu"]["current option"] = 0 'Events play_assign_event_handler() EndSub Sub play_assign_event_handler GraphicsWindow.MouseMove = play_mouse_move GraphicsWindow.MouseUp = play_mouse_up GraphicsWindow.MouseDown = play_mouse_down Controls.ButtonClicked = play_button_clicked play_mouse_move() EndSub Sub play_show_grid GraphicsWindow.PenColor = "White" GraphicsWindow.PenWidth = "2" For i = 0 To game["grid"]["rows"] GraphicsWindow.DrawLine(game["grid"]["left"],game["grid"]["top"]+(i*game["grid"]["cell size"]),game["grid"]["left"]+game["grid"]["width px"],game["grid"]["top"]+(i*game["grid"]["cell size"])) EndFor For i = 0 To game["grid"]["columns"] GraphicsWindow.DrawLine(game["grid"]["left"]+(i*game["grid"]["cell size"]),game["grid"]["top"],game["grid"]["left"]+(i*game["grid"]["cell size"]),game["grid"]["top"]+game["grid"]["height px"]) EndFor EndSub Sub play_button_clicked 'Clear Sub-menus play_assign_event_handler() play_mini_menu_hide() Shapes.HideShape(game["move"]["highlight"]["shape"]) Shapes.HideShape(game["move"]["area"]["shape"]) Shapes.HideShape(game["attack"]["highlight"]["shape"]) Shapes.HideShape(game["attack"]["area"]["shape"]) last_button_clicked = Controls.LastClickedButton If last_button_clicked = game["side bar"]["button"]["resign"] Then GraphicsWindow.Clear() home_init() ElseIf last_button_clicked = game["side bar"]["button"]["end turn"] Then If game["turn player"] <> 0 Then play_new_turn() EndIf EndIf EndSub Sub play_new_turn Shapes.HideShape(game["side bar"]["text"]["turn"][player[game["turn player"]]]) game["turn player"] = Math.Remainder(game["turn player"],2)+1 Shapes.ShowShape(game["side bar"]["text"]["turn"][player[game["turn player"]]]) For current_id = 1 To game["ship"]["init"]["total per side"] ship[ship["color"][game["turn player"]]][current_id]["shots"] = ship["stats"][ship[ship["color"][game["turn player"]]][current_id]["type"]]["shots"] ship[ship["color"][game["turn player"]]][current_id]["permission"]["move"] = 1 ship[ship["color"][game["turn player"]]][current_id]["permission"]["attack"] = 1 EndFor game["moves remaining"] = game["grid"]["init"]["moves"] game["attacks remaining"] = game["grid"]["init"]["attacks"] Shapes.SetText(game["side bar"]["text"]["moves"],"Moves Remaining: " + game["moves remaining"]) Shapes.SetText(game["side bar"]["text"]["attacks"],"Attacks Remaining: " + game["attacks remaining"]) EndSub Sub play_mouse_move play_update_mouse_pos() If current_cell["x"] >= 1 And current_cell["x"] <= game["grid"]["columns"] And current_cell["y"] >= 1 And current_cell["y"] <= game["grid"]["rows"] Then 'Mouse.HideCursor() If game["grid"]["highlight"]["style"] = 1 Then play_highlight_style_1_show_and_update() ElseIf game["grid"]["highlight"]["style"] = 2 Then play_highlight_style_2_show_and_update() EndIf Else 'Mouse.ShowCursor() If game["grid"]["highlight"]["style"] = 1 Then play_highlight_style_1_hide() ElseIf game["grid"]["highlight"]["style"] = 2 Then play_highlight_style_2_hide() EndIf EndIf EndSub Sub play_highlight_style_1_draw 'Highlighting GraphicsWindow.PenColor = "White" GraphicsWindow.BrushColor = "White" GraphicsWindow.PenWidth = 2 game["grid"]["highlight"]["row"][1] = Shapes.AddLine(0,0,game["grid"]["cell size"]*3,0) game["grid"]["highlight"]["row"][2] = Shapes.AddLine(0,0,game["grid"]["cell size"]*4,0) game["grid"]["highlight"]["row"][3] = Shapes.AddLine(0,0,game["grid"]["cell size"]*3,0) game["grid"]["highlight"]["column"][1] = Shapes.AddLine(0,0,0,game["grid"]["cell size"]*3) game["grid"]["highlight"]["column"][2] = Shapes.AddLine(0,0,0,game["grid"]["cell size"]*4) game["grid"]["highlight"]["column"][3] = Shapes.AddLine(0,0,0,game["grid"]["cell size"]*3) play_highlight_style_1_hide() 'Blackout around grid GraphicsWindow.BrushColor = "Black" GraphicsWindow.PenColor = "Black" Shapes.AddRectangle(GraphicsWindow.Width, game["grid"]["top"]) Shapes.AddRectangle(game["grid"]["left"],GraphicsWindow.Height) blackout_bottom = Shapes.AddRectangle(GraphicsWindow.Width, game["grid"]["top"]) Shapes.Move(blackout_bottom,0, game["grid"]["top"]+game["grid"]["height px"]) blackout_right = Shapes.AddRectangle(GraphicsWindow.Width-(game["grid"]["padding"]+game["grid"]["width px"]),GraphicsWindow.Height) Shapes.Move(blackout_right,game["grid"]["width px"] + game["grid"]["padding"],0) EndSub Sub play_highlight_style_1_show_and_update Shapes.ShowShape(game["grid"]["highlight"]["row"][1]) Shapes.ShowShape(game["grid"]["highlight"]["row"][2]) Shapes.ShowShape(game["grid"]["highlight"]["row"][3]) Shapes.ShowShape(game["grid"]["highlight"]["column"][1]) Shapes.ShowShape(game["grid"]["highlight"]["column"][2]) Shapes.ShowShape(game["grid"]["highlight"]["column"][3]) Shapes.Move(game["grid"]["highlight"]["row"][1],game["grid"]["left"]+((current_cell["x"]-2)*game["grid"]["cell size"])+current_cell["mod x"],game["grid"]["top"]+((current_cell["y"]-(3/2))*game["grid"]["cell size"])) Shapes.Move(game["grid"]["highlight"]["row"][2],game["grid"]["left"]+((current_cell["x"]-(5/2))*game["grid"]["cell size"])+current_cell["mod x"],game["grid"]["top"]+((current_cell["y"]-(1/2))*game["grid"]["cell size"])) Shapes.Move(game["grid"]["highlight"]["row"][3],game["grid"]["left"]+((current_cell["x"]-2)*game["grid"]["cell size"])+current_cell["mod x"],game["grid"]["top"]+((current_cell["y"]+(1/2))*game["grid"]["cell size"])) Shapes.Move(game["grid"]["highlight"]["column"][1],game["grid"]["left"]+((current_cell["x"]-(3/2))*game["grid"]["cell size"]),game["grid"]["top"]+((current_cell["y"]-2)*game["grid"]["cell size"])+current_cell["mod y"]) Shapes.Move(game["grid"]["highlight"]["column"][2],game["grid"]["left"]+((current_cell["x"]-(1/2))*game["grid"]["cell size"]),game["grid"]["top"]+((current_cell["y"]-(5/2))*game["grid"]["cell size"])+current_cell["mod y"]) Shapes.Move(game["grid"]["highlight"]["column"][3],game["grid"]["left"]+((current_cell["x"]+(1/2))*game["grid"]["cell size"]),game["grid"]["top"]+((current_cell["y"]-2)*game["grid"]["cell size"])+current_cell["mod y"]) EndSub Sub play_highlight_style_1_hide Shapes.HideShape(game["grid"]["highlight"]["row"][1]) Shapes.HideShape(game["grid"]["highlight"]["row"][2]) Shapes.HideShape(game["grid"]["highlight"]["row"][3]) Shapes.HideShape(game["grid"]["highlight"]["column"][1]) Shapes.HideShape(game["grid"]["highlight"]["column"][2]) Shapes.HideShape(game["grid"]["highlight"]["column"][3]) EndSub Sub play_highlight_style_2_draw GraphicsWindow.BrushColor = "White" GraphicsWindow.PenWidth = 0 game["grid"]["highlight"]["square"] = Shapes.AddRectangle(game["grid"]["cell size"],game["grid"]["cell size"]) Shapes.SetOpacity(game["grid"]["highlight"]["square"],50) play_highlight_style_2_hide() EndSub Sub play_highlight_style_2_show_and_update Shapes.ShowShape(game["grid"]["highlight"]["square"]) Shapes.Move(game["grid"]["highlight"]["square"],game["grid"]["left"]+((current_cell["x"]-1)*game["grid"]["cell size"]),game["grid"]["top"]+((current_cell["y"]-1)*game["grid"]["cell size"])) EndSub Sub play_highlight_style_2_hide Shapes.HideShape(game["grid"]["highlight"]["square"]) EndSub Sub play_update_mouse_pos m["x"] = GraphicsWindow.MouseX m["y"] = GraphicsWindow.MouseY current_cell["x"] = Math.Floor((m["x"] - game["grid"]["left"])/game["grid"]["cell size"])+1 current_cell["y"] = Math.Floor((m["y"] - game["grid"]["top"])/game["grid"]["cell size"])+1 current_cell["mod x"] = Math.Remainder(m["x"] - game["grid"]["left"],game["grid"]["cell size"]) current_cell["mod y"] = Math.Remainder(m["y"] - game["grid"]["top"],game["grid"]["cell size"]) current_cell["mod x"] = 0 current_cell["mod y"] = 0 EndSub Sub play_mouse_up EndSub Sub play_mouse_down play_update_mouse_pos() If current_cell["x"] >= 1 And current_cell["x"] <= game["grid"]["columns"] And current_cell["y"] >= 1 And current_cell["y"] <= game["grid"]["rows"] Then If game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][1]] <> 0 Or game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][2]] <> 0 Then If game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][1]] <> 0 Then color = 1 Else color = 2 EndIf 'Decide where Top, Left goes If m["x"]>(GraphicsWindow.Width-game["mini menu"]["width"]) Then game["mini menu"]["left"] = m["x"] - game["mini menu"]["width"] Else game["mini menu"]["left"] = m["x"] EndIf If m["y"]>(GraphicsWindow.Height-game["mini menu"]["height"]) Then game["mini menu"]["top"] = m["y"] - game["mini menu"]["height"] Else game["mini menu"]["top"] = m["y"] EndIf 'Draw BG Shapes.Move(game["mini menu"]["shape"]["background"],game["mini menu"]["left"],game["mini menu"]["top"]) Shapes.ShowShape(game["mini menu"]["shape"]["background"]) Shapes.SetText(game["mini menu"]["text"]["class name"],ship[ship["color"][color]][game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][color]]]["class name"]+" ("+ship["color"][color]+")") Shapes.SetText(game["mini menu"]["text"]["hp"],"HP: "+ship[ship["color"][color]][game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][color]]]["hp"]) Shapes.SetText(game["mini menu"]["text"]["move range"],"Move Range: "+ship[ship["color"][color]][game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][color]]]["move range"]) Shapes.SetText(game["mini menu"]["text"]["attack range"],"Attack Range: "+ship[ship["color"][color]][game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][color]]]["attack range"]) Shapes.SetText(game["mini menu"]["text"]["damage per shot"],"Damage per Shot: "+ship[ship["color"][color]][game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][color]]]["damage per shot"]) Shapes.SetText(game["mini menu"]["text"]["shots"],"Shots: "+ship[ship["color"][color]][game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][color]]]["shots"]) If ship[ship["color"][color]][game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][color]]]["permission"]["move"] = 1 Then Shapes.SetText(game["mini menu"]["text"]["can move"],"Can Move: Yes") Else Shapes.SetText(game["mini menu"]["text"]["can move"],"Can Move: No") EndIf If ship[ship["color"][color]][game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][color]]]["permission"]["attack"] = 1 Then Shapes.SetText(game["mini menu"]["text"]["can attack"],"Can Attack: Yes") Else Shapes.SetText(game["mini menu"]["text"]["can attack"],"Can Attack: No") EndIf Shapes.Move(game["mini menu"]["text"]["class name"],game["mini menu"]["left"]+game["mini menu"]["padding"],game["mini menu"]["top"]+game["mini menu"]["padding"]) Shapes.Move(game["mini menu"]["text"]["hp"],game["mini menu"]["left"]+game["mini menu"]["padding"],game["mini menu"]["top"]+(2*game["mini menu"]["padding"])+(game["mini menu"]["text size"])) Shapes.Move(game["mini menu"]["text"]["move range"],game["mini menu"]["left"]+game["mini menu"]["padding"],game["mini menu"]["top"]+(3*game["mini menu"]["padding"])+(2*game["mini menu"]["text size"])) Shapes.Move(game["mini menu"]["text"]["attack range"],game["mini menu"]["left"]+game["mini menu"]["padding"],game["mini menu"]["top"]+(4*game["mini menu"]["padding"])+(3*game["mini menu"]["text size"])) Shapes.Move(game["mini menu"]["text"]["damage per shot"],game["mini menu"]["left"]+game["mini menu"]["padding"],game["mini menu"]["top"]+(5*game["mini menu"]["padding"])+(4*game["mini menu"]["text size"])) Shapes.Move(game["mini menu"]["text"]["shots"],game["mini menu"]["left"]+game["mini menu"]["padding"],game["mini menu"]["top"]+(6*game["mini menu"]["padding"])+(5*game["mini menu"]["text size"])) Shapes.Move(game["mini menu"]["text"]["can move"],game["mini menu"]["left"]+game["mini menu"]["padding"],game["mini menu"]["top"]+(7*game["mini menu"]["padding"])+(6*game["mini menu"]["text size"])) Shapes.Move(game["mini menu"]["text"]["can attack"],game["mini menu"]["left"]+game["mini menu"]["padding"],game["mini menu"]["top"]+(8*game["mini menu"]["padding"])+(7*game["mini menu"]["text size"])) Shapes.Move(game["mini menu"]["text"]["options"],game["mini menu"]["left"]+game["mini menu"]["padding"],game["mini menu"]["top"]+(9*game["mini menu"]["padding"])+(8*game["mini menu"]["text size"])) Shapes.Move(game["mini menu"]["text"]["move"],game["mini menu"]["left"]+game["mini menu"]["padding"],game["mini menu"]["top"]+(10*game["mini menu"]["padding"])+(9*game["mini menu"]["text size"])) Shapes.Move(game["mini menu"]["text"]["attack"],game["mini menu"]["left"]+game["mini menu"]["padding"],game["mini menu"]["top"]+(11*game["mini menu"]["padding"])+(10*game["mini menu"]["text size"])) Shapes.Move(game["mini menu"]["text"]["cancel"],game["mini menu"]["left"]+game["mini menu"]["padding"],game["mini menu"]["top"]+(12*game["mini menu"]["padding"])+(11*game["mini menu"]["text size"])) Shapes.ShowShape(game["mini menu"]["text"]["class name"]) Shapes.ShowShape(game["mini menu"]["text"]["hp"]) Shapes.ShowShape(game["mini menu"]["text"]["move range"]) Shapes.ShowShape(game["mini menu"]["text"]["attack range"]) Shapes.ShowShape(game["mini menu"]["text"]["damage per shot"]) Shapes.ShowShape(game["mini menu"]["text"]["shots"]) Shapes.ShowShape(game["mini menu"]["text"]["can move"]) Shapes.ShowShape(game["mini menu"]["text"]["can attack"]) Shapes.ShowShape(game["mini menu"]["text"]["options"]) Shapes.ShowShape(game["mini menu"]["text"]["move"]) Shapes.ShowShape(game["mini menu"]["text"]["attack"]) Shapes.ShowShape(game["mini menu"]["text"]["cancel"]) GraphicsWindow.MouseDown = play_mini_menu_mouse_down GraphicsWindow.MouseMove = play_mini_menu_mouse_move EndIf EndIf EndSub Sub play_mini_menu_mouse_move play_mini_menu_update_mouse_pos() GraphicsWindow.Title = ship[ship["color"][color]][game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][color]]]["permission"]["attack"] If m["x"] >= game["mini menu"]["left"] And m["x"] <= (game["mini menu"]["left"]+game["mini menu"]["width"]) Then If m["y"] >= (game["mini menu"]["top"]+(10*game["mini menu"]["padding"])+(9*game["mini menu"]["text size"])) And m["y"] <= (game["mini menu"]["top"]+(10*game["mini menu"]["padding"])+(10*game["mini menu"]["text size"])) And game["turn player"] = color And ship[ship["color"][color]][game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][color]]]["permission"]["move"]=1 And game["moves remaining"]>0 Then game["mini menu"]["current option"] = "move" Shapes.ShowShape(game["mini menu"]["shape"]["highlight"]) Shapes.Move(game["mini menu"]["shape"]["highlight"],game["mini menu"]["left"],game["mini menu"]["top"]+(10*game["mini menu"]["padding"])+(9*game["mini menu"]["text size"])) ElseIf m["y"] >= (game["mini menu"]["top"]+(11*game["mini menu"]["padding"])+(10*game["mini menu"]["text size"])) And m["y"] <= (game["mini menu"]["top"]+(11*game["mini menu"]["padding"])+(11*game["mini menu"]["text size"])) And game["turn player"] = color And ship[ship["color"][color]][game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][color]]]["permission"]["attack"]=1 And game["attacks remaining"]>0 And ship[ship["color"][color]][game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][color]]]["shots"]>0 Then game["mini menu"]["current option"] = "attack" Shapes.ShowShape(game["mini menu"]["shape"]["highlight"]) Shapes.Move(game["mini menu"]["shape"]["highlight"],game["mini menu"]["left"],game["mini menu"]["top"]+(11*game["mini menu"]["padding"])+(10*game["mini menu"]["text size"])) ElseIf m["y"] >= (game["mini menu"]["top"]+(12*game["mini menu"]["padding"])+(11*game["mini menu"]["text size"])) And m["y"] <= (game["mini menu"]["top"]+(12*game["mini menu"]["padding"])+(12*game["mini menu"]["text size"])) Then game["mini menu"]["current option"] = "cancel" Shapes.ShowShape(game["mini menu"]["shape"]["highlight"]) Shapes.Move(game["mini menu"]["shape"]["highlight"],game["mini menu"]["left"],game["mini menu"]["top"]+(12*game["mini menu"]["padding"])+(11*game["mini menu"]["text size"])) Else Shapes.HideShape(game["mini menu"]["shape"]["highlight"]) game["mini menu"]["current option"] = 0 EndIf Else Shapes.HideShape(game["mini menu"]["shape"]["highlight"]) game["mini menu"]["current option"] = 0 EndIf EndSub Sub play_mini_menu_mouse_down If game["mini menu"]["current option"] = 0 Or game["mini menu"]["current option"] = "cancel" Then play_mini_menu_hide() play_assign_event_handler() ElseIf game["mini menu"]["current option"] = "move" Then play_move_init() play_mini_menu_hide() ElseIf game["mini menu"]["current option"] = "attack" Then play_attack_init() play_mini_menu_hide() EndIf EndSub Sub play_mini_menu_hide Shapes.HideShape(game["mini menu"]["text"]["class name"]) Shapes.HideShape(game["mini menu"]["text"]["hp"]) Shapes.HideShape(game["mini menu"]["text"]["move range"]) Shapes.HideShape(game["mini menu"]["text"]["attack range"]) Shapes.HideShape(game["mini menu"]["text"]["damage per shot"]) Shapes.HideShape(game["mini menu"]["text"]["shots"]) Shapes.HideShape(game["mini menu"]["text"]["can attack"]) Shapes.HideShape(game["mini menu"]["text"]["can move"]) Shapes.HideShape(game["mini menu"]["text"]["options"]) Shapes.HideShape(game["mini menu"]["text"]["attack"]) Shapes.HideShape(game["mini menu"]["text"]["move"]) Shapes.HideShape(game["mini menu"]["text"]["cancel"]) Shapes.HideShape(game["mini menu"]["shape"]["highlight"]) Shapes.HideShape(game["mini menu"]["shape"]["background"]) EndSub Sub play_mini_menu_update_mouse_pos m["x"] = GraphicsWindow.MouseX m["y"] = GraphicsWindow.MouseY EndSub Sub play_move_init ship["current"]["move range"] = ship[ship["color"][color]][game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][color]]]["move range"] GraphicsWindow.BrushColor = "Black" GraphicsWindow.PenColor = "Green" GraphicsWindow.PenWidth = game["grid"]["cell size"]*(3/50) game["move"]["area"]["radius"] = (game["grid"]["cell size"]*((2*ship["current"]["move range"])+1))/2 game["move"]["area"]["shape"] = Shapes.AddEllipse(game["move"]["area"]["radius"]*2,game["move"]["area"]["radius"]*2) Shapes.SetOpacity(game["move"]["area"]["shape"],50) Shapes.Move(game["move"]["area"]["shape"],game["grid"]["left"]+((current_cell["x"]-(1/2))*game["grid"]["cell size"])-game["move"]["area"]["radius"],game["grid"]["top"]+((current_cell["y"]-(1/2))*game["grid"]["cell size"])-game["move"]["area"]["radius"]) GraphicsWindow.BrushColor = "White" GraphicsWindow.PenWidth = 0 game["move"]["highlight"]["shape"] = Shapes.AddRectangle(game["grid"]["cell size"],game["grid"]["cell size"]) Shapes.SetOpacity(game["move"]["highlight"]["shape"],30) Shapes.HideShape(game["move"]["highlight"]["shape"]) GraphicsWindow.MouseDown = play_move_mouse_down GraphicsWindow.MouseMove = play_move_mouse_move EndSub Sub play_move_mouse_move m["x"] = GraphicsWindow.MouseX m["y"] = GraphicsWindow.MouseY game["move"]["current cell"]["x"] = Math.Floor((m["x"] - game["grid"]["left"])/game["grid"]["cell size"])+1 game["move"]["current cell"]["y"] = Math.Floor((m["y"] - game["grid"]["top"])/game["grid"]["cell size"])+1 If game["move"]["current cell"]["x"] >= 1 And game["move"]["current cell"]["x"] <= game["grid"]["columns"] And game["move"]["current cell"]["y"] >= 1 And game["move"]["current cell"]["y"] <= game["grid"]["rows"] Then d["x"] = current_cell["x"]-game["move"]["current cell"]["x"] d["y"] = current_cell["y"]-game["move"]["current cell"]["y"] d["distance"] = Math.SquareRoot((d["x"]*d["x"])+(d["y"]*d["y"])) If Math.Round(d["distance"]) <= ship["current"]["move range"] And game["grid"][game["move"]["current cell"]["x"]][game["move"]["current cell"]["y"]]["blue"]=0 And game["grid"][game["move"]["current cell"]["x"]][game["move"]["current cell"]["y"]]["purple"]=0 And game["grid"][game["move"]["current cell"]["x"]][game["move"]["current cell"]["y"]]["terrain"]=0 Then Shapes.Move(game["move"]["highlight"]["shape"],game["grid"]["left"]+((game["move"]["current cell"]["x"]-1)*game["grid"]["cell size"]),game["grid"]["top"]+((game["move"]["current cell"]["y"]-1)*game["grid"]["cell size"])) Shapes.ShowShape(game["move"]["highlight"]["shape"]) Else Shapes.HideShape(game["move"]["highlight"]["shape"]) game["move"]["current cell"]["x"] = 0 game["move"]["current cell"]["y"] = 0 EndIf Else Shapes.HideShape(game["move"]["highlight"]["shape"]) game["move"]["current cell"]["x"] = 0 game["move"]["current cell"]["y"] = 0 EndIf EndSub Sub play_move_mouse_down play_move_mouse_move() If game["move"]["current cell"]["x"] = 0 And game["move"]["current cell"]["y"] = 0 Then Shapes.HideShape(game["move"]["highlight"]["shape"]) Shapes.HideShape(game["move"]["area"]["shape"]) play_assign_event_handler() Else 'Move the ship there game["grid"][game["move"]["current cell"]["x"]][game["move"]["current cell"]["y"]][ship["color"][color]] = game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][color]] game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][color]] = 0 ship[ship["color"][color]][game["grid"][game["move"]["current cell"]["x"]][game["move"]["current cell"]["y"]][ship["color"][color]]]["x"] = game["move"]["current cell"]["x"] ship[ship["color"][color]][game["grid"][game["move"]["current cell"]["x"]][game["move"]["current cell"]["y"]][ship["color"][color]]]["y"] = game["move"]["current cell"]["y"] If game["grid"]["init"]["multi move"] = 0 Then ship[ship["color"][color]][game["grid"][game["move"]["current cell"]["x"]][game["move"]["current cell"]["y"]][ship["color"][color]]]["permission"]["move"]=0 EndIf x[1] = game["grid"]["left"]+((game["move"]["current cell"]["x"]-1)*game["grid"]["cell size"])+ship[ship["color"][color]][game["grid"][game["move"]["current cell"]["x"]][game["move"]["current cell"]["y"]][ship["color"][color]]]["padding"]["x"] y[1] = game["grid"]["top"]+((game["move"]["current cell"]["y"]-1)*game["grid"]["cell size"])+ship[ship["color"][color]][game["grid"][game["move"]["current cell"]["x"]][game["move"]["current cell"]["y"]][ship["color"][color]]]["padding"]["y"] x[1] = Math.Floor(x[1]) y[1] = Math.Floor(y[1]) Shapes.Move(ship[ship["color"][color]][game["grid"][game["move"]["current cell"]["x"]][game["move"]["current cell"]["y"]][ship["color"][color]]]["shape"],x[1],y[1]) game["moves remaining"] = game["moves remaining"] - 1 Shapes.SetText(game["side bar"]["text"]["moves"],"Moves Remaining: " + game["moves remaining"]) Shapes.HideShape(game["move"]["highlight"]["shape"]) Shapes.HideShape(game["move"]["area"]["shape"]) play_assign_event_handler() EndIf EndSub Sub play_attack_init ship["current"]["attack range"] = ship[ship["color"][color]][game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][color]]]["attack range"] GraphicsWindow.BrushColor = "Black" GraphicsWindow.PenColor = "Red" GraphicsWindow.PenWidth = game["grid"]["cell size"]*(3/50) game["attack"]["area"]["radius"] = (game["grid"]["cell size"]*((2*ship["current"]["attack range"])+1))/2 game["attack"]["area"]["shape"] = Shapes.AddEllipse(game["attack"]["area"]["radius"]*2,game["attack"]["area"]["radius"]*2) Shapes.SetOpacity(game["attack"]["area"]["shape"],50) Shapes.Move(game["attack"]["area"]["shape"],game["grid"]["left"]+((current_cell["x"]-(1/2))*game["grid"]["cell size"])-game["attack"]["area"]["radius"],game["grid"]["top"]+((current_cell["y"]-(1/2))*game["grid"]["cell size"])-game["attack"]["area"]["radius"]) GraphicsWindow.BrushColor = "White" GraphicsWindow.PenWidth = 0 game["attack"]["highlight"]["shape"] = Shapes.AddRectangle(game["grid"]["cell size"],game["grid"]["cell size"]) Shapes.SetOpacity(game["attack"]["highlight"]["shape"],30) Shapes.HideShape(game["attack"]["highlight"]["shape"]) GraphicsWindow.MouseDown = play_attack_mouse_down GraphicsWindow.MouseMove = play_attack_mouse_move EndSub Sub play_attack_mouse_move m["x"] = GraphicsWindow.MouseX m["y"] = GraphicsWindow.MouseY game["attack"]["current cell"]["x"] = Math.Floor((m["x"] - game["grid"]["left"])/game["grid"]["cell size"])+1 game["attack"]["current cell"]["y"] = Math.Floor((m["y"] - game["grid"]["top"])/game["grid"]["cell size"])+1 If game["attack"]["current cell"]["x"] >= 1 And game["attack"]["current cell"]["x"] <= game["grid"]["columns"] And game["attack"]["current cell"]["y"] >= 1 And game["attack"]["current cell"]["y"] <= game["grid"]["rows"] Then d["x"] = current_cell["x"]-game["attack"]["current cell"]["x"] d["y"] = current_cell["y"]-game["attack"]["current cell"]["y"] d["distance"] = Math.SquareRoot((d["x"]*d["x"])+(d["y"]*d["y"])) If Math.Round(d["distance"]) <= ship["current"]["attack range"] And game["grid"][game["attack"]["current cell"]["x"]][game["attack"]["current cell"]["y"]][ship["color"][Math.Remainder(color,2)+1]]>0 Then Shapes.Move(game["attack"]["highlight"]["shape"],game["grid"]["left"]+((game["attack"]["current cell"]["x"]-1)*game["grid"]["cell size"]),game["grid"]["top"]+((game["attack"]["current cell"]["y"]-1)*game["grid"]["cell size"])) Shapes.ShowShape(game["attack"]["highlight"]["shape"]) Else Shapes.HideShape(game["attack"]["highlight"]["shape"]) game["attack"]["current cell"]["x"] = 0 game["attack"]["current cell"]["y"] = 0 EndIf Else Shapes.HideShape(game["attack"]["highlight"]["shape"]) game["attack"]["current cell"]["x"] = 0 game["attack"]["current cell"]["y"] = 0 EndIf EndSub Sub play_attack_mouse_down play_attack_mouse_move() If game["attack"]["current cell"]["x"] = 0 And game["attack"]["current cell"]["y"] = 0 Then Shapes.HideShape(game["attack"]["highlight"]["shape"]) Shapes.HideShape(game["attack"]["area"]["shape"]) play_assign_event_handler() Else 'Attack the ship there ship[ship["color"][color]][game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][color]]]["shots"] = ship[ship["color"][color]][game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][color]]]["shots"] - 1 ship[ship["color"][Math.Remainder(color,2)+1]][game["grid"][game["attack"]["current cell"]["x"]][game["attack"]["current cell"]["y"]][ship["color"][Math.Remainder(color,2)+1]]]["hp"] = ship[ship["color"][Math.Remainder(color,2)+1]][game["grid"][game["attack"]["current cell"]["x"]][game["attack"]["current cell"]["y"]][ship["color"][Math.Remainder(color,2)+1]]]["hp"] - ship[ship["color"][color]][game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][color]]]["damage per shot"] If ship[ship["color"][color]][game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][color]]]["shots"] = 0 Then ship[ship["color"][color]][game["grid"][current_cell["x"]][current_cell["y"]][ship["color"][color]]]["permission"]["attack"] = 0 EndIf If ship[ship["color"][Math.Remainder(color,2)+1]][game["grid"][game["attack"]["current cell"]["x"]][game["attack"]["current cell"]["y"]][ship["color"][Math.Remainder(color,2)+1]]]["hp"] <= 0 Then 'Kill ship ship[ship["color"][Math.Remainder(color,2)+1]][game["grid"][game["attack"]["current cell"]["x"]][game["attack"]["current cell"]["y"]][ship["color"][Math.Remainder(color,2)+1]]]["is dead"] = 1 ship[ship["color"][Math.Remainder(color,2)+1]][game["grid"][game["attack"]["current cell"]["x"]][game["attack"]["current cell"]["y"]][ship["color"][Math.Remainder(color,2)+1]]]["x"] = 0 ship[ship["color"][Math.Remainder(color,2)+1]][game["grid"][game["attack"]["current cell"]["x"]][game["attack"]["current cell"]["y"]][ship["color"][Math.Remainder(color,2)+1]]]["y"] = 0 Shapes.HideShape(ship[ship["color"][Math.Remainder(color,2)+1]][game["grid"][game["attack"]["current cell"]["x"]][game["attack"]["current cell"]["y"]][ship["color"][Math.Remainder(color,2)+1]]]["shape"]) game["grid"][game["attack"]["current cell"]["x"]][game["attack"]["current cell"]["y"]][ship["color"][Math.Remainder(color,2)+1]] = 0 play_check_winner() EndIf game["attacks remaining"] = game["attacks remaining"] - 1 Shapes.SetText(game["side bar"]["text"]["attacks"],"Attacks Remaining: " + game["attacks remaining"]) Shapes.HideShape(game["attack"]["highlight"]["shape"]) Shapes.HideShape(game["attack"]["area"]["shape"]) play_assign_event_handler() EndIf EndSub Sub play_check_winner game["winner"][1] = game["ship"]["init"]["total per side"] game["winner"][2] = game["ship"]["init"]["total per side"] For current_id = 1 To game["ship"]["init"]["total per side"] game["winner"][1] = game["winner"][1] - ship["blue"][current_id]["is dead"] game["winner"][2] = game["winner"][2] - ship["purple"][current_id]["is dead"] EndFor If game["winner"][1] = 0 Then GraphicsWindow.ShowMessage(player[2]+" Wins!","Game Over") game["turn player"] = 0 ElseIf game["winner"][2] = 0 Then GraphicsWindow.ShowMessage(player[1]+" Wins!","Game Over") game["turn player"] = 0 EndIf EndSub Sub null EndSub End>LDM107.sb< Start>LDR972.sb< GraphicsWindow.BackgroundColor="tan GraphicsWindow.BrushColor="darkred ic="💤 💭 ❓🍼 🍔 🍟 🍰 🍜" ic=ic+" 💩 🎂 😄 😃 😀 😊 😎️ 👍 😪 😥 😰 😓 😩 😫 😡 😱" ic=ic+" ❌ 💀 👽 😇" GraphicsWindow.FontSize=66 GraphicsWindow.FontBold="false GraphicsWindow.DrawBoundText(5 5 500 ic) End>LDR972.sb< Start>LDS658.sb< ' SmallBasic Version 1.1 ' Program: SteganoImage Make (Black) ' Changelog: 15.3, 15.4 ' Author: Pappa Lapub ' Website: https://social.msdn.microsoft.com/Forums/en-US/3b975ffc-cbfd-407c-ab95-74912e57c65d/challenge-of-the-month-april-2015 ' ImportURL: http://smallbasic.com/program/? ' Extension: LitDev ' Comment: BlackImage: BG #000000; Message #010000 (red <> 00) ; FloodProtection #000001 ' WhiteImage: BG #FFFFFF (from GW) ; Message #FEFFFF (red <> FF); FloodProtection #FFFFFE ' Font 'Digital Readout' https://duckduckgo.com/html/?q=download%20font%20digital%20readout ' in deactivated line: GraphicsWindow.FontName = "Digital Readout Upright" ' Variables: ' ToDo: ' ================================================================================ saveTo = Program.Directory + "\SteganoImage_Black.png" ' define path to save the image txt = " Happy coding" ' hidden text message w = 380 ' desired width and height of image h = 200 d = 20 ' circle diameters in 'flood protection' '' Autorename filepath to protect from overwriting if image already exists ' The following line could be harmful and has been automatically commented. ' If LDFile.Exists(saveTo) Then AutoFilePath() EndIf GraphicsWindow.Title = saveTo GraphicsWindow.BrushColor = "Black" ' make a pure black background ... GraphicsWindow.FillRectangle(0,0, w,h) ' ... in the desired size 'FloodProtection() '' With or withot 'FloodProtection' ? '' Write the message text GraphicsWindow.BrushColor = "#010000" ' select a color (almost black) with small diff (+/- 1) in red (or ev. green/blue) GraphicsWindow.FontSize = 72 'GraphicsWindow.FontName = "Digital Readout Upright" ' breaks in letters and numbers, makes filling a bit harder GraphicsWindow.FontBold = "" ' not too fat, offers less surface to reveal GraphicsWindow.DrawBoundText(40,30,300, txt) ' draw the desired base text ... GraphicsWindow.FontName = "Wingdings" GraphicsWindow.DrawText(270,100, "J") ' ... and a smiley 'Goto End '' to deactivate saving to file, remove leading comment '' Save the image file (.png) gwShot = LDGraphicsWindow.Capture("","") ' photograph the full GW to ImageList, ... LDImage.Crop(gwShot, 0,0, w,h) ' ... crop it there to desired size ... LDImage.SaveAs(gwShot, saveTo) ' ... and save into desired picture path (best as .bmp or .png). '' Clean up GW and load the saved picture again to view (if all went OK) GraphicsWindow.Clear() Program.Delay(500) GraphicsWindow.DrawImage(saveTo, 0,0) End: ' ////////// SUBs \\\\\\\\\\ Sub FloodProtection GraphicsWindow.PenWidth = 1 GraphicsWindow.PenColor = "#000001" ' near black but different to message color and BG, or #020000 etc. For ellY = 0 To h-d Step d For ellX = 0 To w-d Step d GraphicsWindow.DrawEllipse(ellX,ellY, d,d) EndFor EndFor EndSub Sub AutoFilePath ' The following line could be harmful and has been automatically commented. ' basePath = LDFile.GetFolder(saveTo) +"\"+ LDFile.GetFile(saveTo) ' The following line could be harmful and has been automatically commented. ' ext = LDFile.GetExtension(saveTo) num = 0 ' The following line could be harmful and has been automatically commented. ' While LDFile.Exists(saveTo) num = num+1 saveTo = basePath +"_"+ num + "."+ ext EndWhile EndSub End>LDS658.sb< Start>LDS920-3.sb< 'Returns the Simplest Fraction. LDS920-1 'by Jibba Jabba, Nov 2013 runProgram = "y" '***************************************************************** 'Main Program '***************************************************************** While runProgram = "y" UserInput() Initialise() GetHighestCommonFactor() 'Two-level Subroutine WriteResult() ContinuePrompt() EndWhile Program.End() '****************************************************************** 'First-order Subroutines '****************************************************************** Sub UserInput TextWindow.Write("Enter fraction a/b: ") fraction = TextWindow.Read() start = Clock.ElapsedMilliseconds 'calculation Speed slashIndex = Text.GetIndexOf(fraction, "/") numerator = Text.GetSubText(fraction, 1, slashIndex - 1) denominator = Text.GetSubTextToEnd(fraction, slashIndex + 1) EndSub Sub Initialise nextValue = 2 prime = 2 isHighestCommonFactor = "False" EndSub Sub GetHighestCommonFactor While isHighestCommonFactor = "False" If Math.Remainder(numerator, prime) = 0 And Math.Remainder(denominator, prime) = 0 Then numerator = numerator / prime denominator = denominator / prime Else GetNextPrime() 'Second-order Subroutine minimumValue = Math.Abs(Math.Min(numerator, denominator)) maximumValue = Math.Abs(Math.Max(numerator, denominator)) If prime = minimumValue And Math.Remainder(minimumValue, prime) <> 0 Or prime > minimumValue Then isHighestCommonFactor = "True" EndIf If prime = minimumValue And Math.Remainder(maximumValue, prime) <> 0 Then isHighestCommonFactor = "True" EndIf EndIf EndWhile EndSub Sub WriteResult TextWindow.Write("Simplest fraction: " + numerator) TextWindow.WriteLine("/" + denominator) TextWindow.WriteLine("time taken s: " + (Clock.ElapsedMilliseconds - start) / 1000) EndSub Sub ContinuePrompt TextWindow.Write("Enter Another y/n: ") runProgram = Text.ConvertToLowerCase(TextWindow.ReadKey()) TextWindow.Clear() EndSub '********************************************************************************** 'Second-order Subroutine '********************************************************************************** Sub GetNextPrime While prime <= nextValue nextValue = nextValue + 1 isPrime = "True" If (Math.Remainder(nextValue, Math.SquareRoot(nextValue)) = 0) Then isPrime = "False" EndIf If isPrime Then prime = nextValue Goto break EndIf EndWhile break: EndSub End>LDS920-3.sb< Start>LDZ295.sb< '----------------------------------------------------------------------------------------------------------- '--------------------------Armored Assault--------------------------------------------------------------- '--------------------------Developed By ---------------------------------------------------------------- '--------------------------Sean Sullivan----------------------------------------------------------------- '===========Copyright DOSMANN INC.================================= '-----------------------Started Jan, 2014---------------------------------------------------------------- '------------------------------------------------------------------------------------------------------------ '------------------------------------------------------------------------------------------------------------ ' The following line could be harmful and has been automatically commented. ' ThisUsername = LDEncryption.AESDecrypt(File.ReadLine(Program.Directory + "/Settings.txt",1),"TankWars") LDNetwork.SetGameData("TankWars" + IOTCPClient.IP,ThisUsername) DataStuff = LDNetwork.GetGameData("TankWarsBeta") NumofServers = LDNetwork.GetGameData("TankWarsBetaNum") GraphicsWindow.DrawResizedImage(Program.Directory + "/Background.jpg",0,0,GraphicsWindow.Width,GraphicsWindow.Height) GraphicsWindow.BrushColor = "White" GraphicsWindow.Title = "Armored Assault" LDUtilities.Icon = Program.Directory + "/Icon.ico" ServerListings = Shapes.AddImage(Program.Directory + "/ServerListing.png") Shapes.Move(ServerListings,5,5) Shapes.SetOpacity(ServerListings,50) Shapes.Move(Shapes.AddText("Name IP Port")15,13) DrawServers() GraphicsWindow.BrushColor = "Black" BRefresh = Controls.AddButton("Refresh list",500,400) GraphicsWindow.BrushColor = "White" Controls.ButtonClicked = OnButtonClicked LDUtilities.ExitOnClose = "False" LDUtilities.GWClosing = OnGWClose IOTCPClient.OnMessageRecieved = OnMessageRecieved GraphicsWindow.BrushColor = "Black" While CanStartGame <> "Yes" Program.Delay(50) EndWhile Username[ThisPC] = ThisUsername IOTCPClient.SendMessage("type=init;username=" + Username[ThisPC] + ";client=" + ThisPC) GraphicsWindow.Width = 781 GraphicsWindow.Height = 600 GraphicsWindow.MouseMove = OnMouseMove GraphicsWindow.MouseDown = TankSelection LDUtilities.ShowErrors = "False" LDShapes.AnimationInterval = 40 Img = ImageList.LoadImage(Program.Directory + "/Sand.png") For i10 = 1 to 2000 Step 1000 For i11 = 1 To 2000 Step 500 ' Shapes.Move(Shapes.AddImage(Img),i10,i11) GraphicsWindow.DrawImage(Img,i10,i11) EndFor EndFor GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp 'GraphicsWindow.KeyDown = OnKeyDown SetupLevel() ClientKey = "" NumOfPlayers = ThisPC Mouse.HideCursor() MouseCursorDir = Program.Directory + "\crosshair.png" MouseCursor = Shapes.AddImage(MouseCursorDir) Progdir = Program.Directory + "\" TankWeapon = LDNetwork.GetGameData("TankWarsWeapons") '<-- this get a array of the availible weapons. eg. 'TankWeapon[2]["Name"] = "Level 1 Laser" 'TankWeapon[2]["Animation"] = "Animations/Anim.png" '<--- hit wall animation 'TankWeapon[2]["AnimCountx"] = 4 'TankWeapon[2]["AnimCounty"] = 4 'TankWeapon[2]["Projectile"] = "weapons/Lazer.png" 'TankWeapon[2]["ProjectileAnix"] = 1 'TankWeapon[2]["ProjectileAniy"] = 1 'TankWeapon[2]["Damage"] = 10 'TankWeapon[2]["Velocity"] = 50 'TankWeapon[2]["ROF"] = 100 'TankWeapon[2]["Homeing"] = "False" 'TankWeapon[2]["Icon"] = "weapons/Lazer.png" SpawnTime = 5 MaxSpeed = 15 AccelerationInc = 0.020 DecelerationInc = 0.020 TurningSpeed = 3 BallCount = 10 Delta = 1 power = 100 Gravity = 0 '<--- Change this to 1500 to use it well PlayerNum = 1 wkey = 0 dkey = 0 skey = 0 akey = 0 Firelast = Clock.ElapsedMilliseconds SecectorCircle = Shapes.AddImage(Progdir + "Select.png") Shapes.Move(SecectorCircle,5000,5000) For q = 1 To NumOfPlayers Tankx[q] = TankInitPos[q]["x"] Tanky[q] = TankInitPos[q]["y"] TankExp[q] = LDShapes.AddAnimatedImage(Program.Directory + "/Animations/anim1.png","False",8,6) LDShapes.AnimationSet(TankExp[q],48) UsernameText[q] = Shapes.AddText(Username[q]) Var = LDNetwork.GetGameData("TankWars" + Username[q]) '<--- this gets the current weapon of the user CurrentProj[q] = Var["weapon"] Tank[q] = Shapes.AddImage(Program.Directory + "/Tank.png") Turret[q] = Shapes.AddImage(Program.Directory + "/" + TankWeapon[CurrentProj[q]]["Turret"]) Endfor For w = 1 to BallCount For dd = 1 to NumOfPlayers Exp[dd][w] = LDShapes.AddAnimatedImage(Progdir + TankWeapon[CurrentProj[dd]]["Animation"],"False",TankWeapon[CurrentProj[dd]]["AnimCountx"],TankWeapon[CurrentProj[dd]]["AnimCounty"]) LDShapes.AnimationSet(Exp[dd][w],16) EndFor EndFor LDScrollBars.Add(1680,1200) LDScrollBars.Visibility = "False" 'Timer.Tick = MainLoop 'Timer.Interval = 10 While 1 = 1 Program.Delay(20) If Tanky[ThisPC] < 4000 Then LDScrollBars.VerticalScroll = Tanky[ThisPC] - 300 LDScrollBars.HorizontalScroll = Tankx[ThisPC] - 400 EndIf For q = 1 To NumOfPlayers Shapes.Move(UsernameText[q],Tankx[q],Tanky[q] - 15) If TankDead[q] = "True" Then If (Clock.ElapsedMilliseconds - TankDieat) > (SpawnTime *1000) Then TankDead[q] = "False" Tankx[q] = TankInitPos[q]["x"] Tanky[q] = TankInitPos[q]["y"] ' TankHealth[q] = TankHealthInit EndIf EndIf If TankDead[ThisPC] = "True" Then If q = ThisPC Then Shapes.Move(Tank[q],Tankx[q],Tanky[q]) Shapes.Move(Turret[q],Tankx[q] + 6,Tanky[q] - 28) CheckBulletColision() MoveBalls() Goto Skip EndIf EndIf If SelectedTank <> "" Then Shapes.Move(SecectorCircle,Tankx[SelectedTank] - 15,Tanky[SelectedTank] - 10) Endif Shapes.Move(Tank[q],Tankx[q],Tanky[q]) Shapes.Move(Turret[q],Tankx[q] + 6,Tanky[q] - 28) Shapes.Rotate(Tank[q],Angle[q] + 90) MoveBalls() GetTurretAngle() RotateTurret() SetTime() GetAngle() GetTankpos() CheckColision() CheckBulletColision() Skip: EndFor If Mouse.IsLeftButtonDown Then OnMouseDown() EndIf EndWhile '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ '++++++++++++++++++++++SUBROUTINES+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Sub SetTime Time = Time + Dtime[q] If q = ThisPC Then If LDUtilities.KeyDown("w") Then If Dtime[q] < .002 Then Dtime[q] = Dtime[q] + AccelerationInc EndIf EndIf If LDUtilities.KeyDown("w") <> "True" Then If Dtime[q] > 0 Then Dtime[q] = Dtime[q] - DecelerationInc EndIf EndIf If LDUtilities.KeyDown("s") Then If Dtime[q] > -0.001 Then Dtime[q] = Dtime[q] - (AccelerationInc / 2) EndIf EndIf If LDUtilities.KeyDown("s") <> "True" Then If Dtime[q] < 0 Then Dtime[q] = Dtime[q] + DecelerationInc EndIf EndIf Else '<------------------------------------------------------^ If ClientKey[q]["w"] = "Down" Then If Dtime[q] < .002 Then Dtime[q] = Dtime[q] + AccelerationInc EndIf EndIf If ClientKey[q]["w"] = "Up" Then If Dtime[q] > 0 Then Dtime[q] = Dtime[q] - DecelerationInc EndIf EndIf If ClientKey[q]["s"] = "Down" Then If Dtime[q] > -0.001 Then Dtime[q] = Dtime[q] - (AccelerationInc / 2) EndIf EndIf If ClientKey[q]["s"] = "Up" Then If Dtime[q] < 0 Then Dtime[q] = Dtime[q] + DecelerationInc EndIf EndIf EndIf EndSub '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Sub OnMouseMove Mx = GraphicsWindow.MouseX My = GraphicsWindow.Mousey Shapes.Move(MouseCursor,Mx - 15,My - 15) '<-- No Idea why it is 15 not 30, but it works EndSub '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Sub SetupLevel LevelPath = Program.Directory + "/Levels/" + CurrentMap + ".txt" For ly = 1 To 40 ' The following line could be harmful and has been automatically commented. ' Level[1][ly] = File.ReadLine(LevelPath,ly) EndFor For Levx = 1 To Text.GetLength(Level[1][1]) For Levy = 1 To 40 If Text.GetSubText(Level[1][Levy],Levx,1) = "p" Then Shapes.Move(Shapes.AddImage(Program.Directory + "/Brick.Png"),Levx * 30 - 30,Levy * 30 - 30) EndIf If LDUtilities.IsNumber(Text.GetSubText(Level[1][Levy],Levx,1)) Then TankInitPos[Text.GetSubText(Level[1][Levy],Levx,1)]["x"] = Levx * 30 - 30 TankInitPos[Text.GetSubText(Level[1][Levy],Levx,1)]["y"] = Levy * 30 - 30 EndIf EndFor EndFor EndSub '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Sub GetAngle If q = ThisPC Then If LDUtilities.KeyDown("a") Then Angle[q] = Angle[q] - TurningSpeed ElseIf LDUtilities.KeyDown("d") Then Angle[q] = Angle[q] + TurningSpeed EndIf Else If ClientKey[q]["a"] = "Down" Then Angle[q] = Angle[q] - TurningSpeed ElseIf ClientKey[q]["d"] = "Down" Then Angle[q] = Angle[q] + TurningSpeed EndIf EndIf If Angle[q] >= 360 Then Angle[q] = 0 EndIf If Angle[q] < 0 Then Angle[q] = 359 - Angle[q] EndIf EndSub '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Sub CheckColision RealDtime[q] = Dtime[q] RealAngle = Angle[q] Time = Time + Dtime[q] If q = ThisPC Then If LDUtilities.KeyDown("w") Then If Dtime[q] < .002 Then Dtime[q] = Dtime[q] + AccelerationInc EndIf EndIf If LDUtilities.KeyDown("w") <> "True" Then If Dtime[q] > 0 Then Dtime[q] = Dtime[q] - DecelerationInc EndIf EndIf Else If ClientKey[q]["w"] = "Down" Then If Dtime[q] < .002 Then Dtime[q] = Dtime[q] + AccelerationInc EndIf EndIf If clientKey[q]["w"] = "Up" Then If Dtime[q] > 0 Then Dtime[q] = Dtime[q] - DecelerationInc EndIf EndIf EndIf Array2 = Zock77Math.Fire(Tankx[q],Tanky[q],0,Time,MaxSpeed,Angle[q]) TankxCheck[q] = Array2["x"] TankyCheck[q] = Array2["y"] TankRoundx = Math.Round((TankxCheck[q] - 15) / 30 + 1) TankRoundy = Math.Round((TankyCheck[q] - 15) / 30 + 1) TankxCheck2[q] = Array2["x"] + 35 TankyCheck2[q] = Array2["y"] + 35 TankRoundx2 = Math.Round((TankxCheck2[q] - 15) / 30 + 1) TankRoundy2 = Math.Round((TankyCheck2[q] - 15) / 30 + 1) Result = Text.GetSubText(Level[1][TankRoundy],TankRoundx,1) Result2 = Text.GetSubText(Level[1][TankRoundy2],TankRoundx2,1) If Result = "p" Or Result2 = "p" Then Angle[q] = Zock77Math.RoundtoNearest(Angle[q],90) Dtime[q] = 0 Else Dtime[q] = RealDtime[q] EndIf Time = 0 EndSub ' '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Sub Fire ShotsFired[FiringTank] = ShotsFired[FiringTank] + Delta If Ball[FiringTank][ShotsFired[FiringTank]] = "" Then '<--- If it has not already spawned, then add it If TankWeapon[CurrentProj[FiringTank]]["ProjectileAnix"] = 1 And TankWeapon[CurrentProj[FiringTank]]["ProjectileAniy"] =1 Then Ball[FiringTank][ShotsFired[FiringTank]] = Shapes.AddImage(Progdir + TankWeapon[CurrentProj[FiringTank]]["Projectile"]) Else Ball[FiringTank][ShotsFired[FiringTank]] = LDShapes.AddAnimatedImage(Progdir + TankWeapon[CurrentProj[FiringTank]]["Projectile"],"True",TankWeapon[CurrentProj[FiringTank]]["ProjectileAnix"],TankWeapon[CurrentProj[FiringTank]]["ProjectileAniy"]) EndIf EndIf If ShotsFired[FiringTank] > BallCount Then '<--- If the number of shots fired is more than the number of balls that can possible be on the screen, Then set it to One ShotsFired[FiringTank] = 1 EndIf Missile_Dead[FiringTank][ShotsFired[FiringTank]] = "False" If TankWeapon[CurrentProj[FiringTank]]["Homeing"] = "True" Then vx[FiringTank][ShotsFired[FiringTank]] = Math.GetDegrees(Math.Cos(Math.GetRadians(TurretAngle[FiringTank] - 90))) * (TankWeapon[CurrentProj[FiringTank]]["Velocity"] / 750) vy[FiringTank][ShotsFired[FiringTank]] = Math.GetDegrees(Math.Sin(Math.GetRadians(TurretAngle[FiringTank] - 90))) * (TankWeapon[CurrentProj[FiringTank]]["Velocity"] / 750) Missilex[FiringTank][ShotsFired[FiringTank]]=FireTankx Missiley[FiringTank][ShotsFired[FiringTank]]=FireTanky Tankat[FiringTank][ShotsFired[FiringTank]]=TankSelected[FiringTank] ' TextWindow.WriteLine("Tankat = " + Tankat[FiringTank][ShotsFired[FiringTank]]) Else Startx[FiringTank][ShotsFired[FiringTank]] = FireTankx Starty[FiringTank][ShotsFired[FiringTank]] = FireTanky AngleFire[FiringTank][ShotsFired[FiringTank]] = TurretAngle[FiringTank]'<--- Set the Firing Angle TimeStart[FiringTank][ShotsFired[FiringTank]] = Clock.ElapsedMilliseconds / 1000 EndIf EndSub '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Sub GetTurretAngle AngleRad = Math.ArcTan((GraphicsWindow.MouseY - Tanky[ThisPC]) / (GraphicsWindow.MouseX - TankX[ThisPC])) TurretAngle[ThisPC] = Math.GetDegrees(AngleRad) + 90 If (GraphicsWindow.MouseX - TankX[ThisPC]) = 0 or (GraphicsWindow.MouseX - TankX[ThisPC]) < 0 Then TurretAngle[ThisPC] = TurretAngle[ThisPC] - 180 EndIf EndSub '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Sub MoveBalls For i = 1 To BallCount If Missile_Dead[q][i] = "True" Then Shapes.Move(ball[q][i],6000,6000) TimeStart[q][i] = TimeStart[q][i] - 500 '<--- Fixes non-homing Missilex[q][i]= 6000 '<--- Fixes homing Missiley[q][i]=6000 '<--- Fixes homing Else If TankWeapon[CurrentProj[q]]["Homeing"] = "True" Then '=================================================================HOMEING STUFF Missile_speed = TankWeapon[CurrentProj[q]]["Velocity"] / 10 If Tankat[q][i] <> "" And Tankx[Tankat[q][i]] < GraphicsWindow.Width And Tanky[Tankat[q][i]] < GraphicsWindow.Height Then Missile_turning = TankWeapon[CurrentProj[q]]["TurnRate"] Targetx =Tankx[Tankat[q][i]] Targety = Tanky[Tankat[q][i]] dx[q][i]=Targetx-Missilex[q][i] dy[q][i]=Targety-Missiley[q][i] distance[q][i]=Math.SquareRoot((dx[q][i]*dx[q][i])+(dy[q][i]*dy[q][i])) dx[q][i]=dx[q][i]/distance[q][i] dy[q][i]=dy[q][i]/distance[q][i] vx[q][i]=vx[q][i]+(dx[q][i]*Missile_turning) vy[q][i]=vy[q][i]+(dy[q][i]*Missile_turning) velocity[q][i]=Math.SquareRoot((vx[q][i]*vx[q][i])+(vy[q][i]*vy[q][i])) if (velocity[q][i]>Missile_speed) Then vx[q][i]=(vx[q][i]*Missile_speed)/velocity[q][i] vy[q][i]=(vy[q][i]*Missile_speed)/velocity[q][i] EndIf EndIf Missilex[q][i]=Missilex[q][i]+vx[q][i] Missiley[q][i]=Missiley[q][i]+vy[q][i] Offsety = TankWeapon[CurrentProj[q]]["ProjectileOffsety"] Offsetx = TankWeapon[CurrentProj[q]]["ProjectileOffsetx"] Shapes.Move(ball[q][i],Missilex[q][i] + Offsetx,Missiley[q][i] + Offsety) Xchange = Missilex[q][i] - OldX[q][i] Ychange = Missiley[q][i] - OldY[q][i] If Xchange < 0 Then Rot = Math.GetDegrees(Math.ArcTan(Ychange/Xchange)) - 180 Else Rot = Math.GetDegrees(Math.ArcTan(Ychange/Xchange)) EndIf Shapes.Rotate(Ball[q][i],rot) OldY[q][i] = Missiley[q][i] OldX[q][i] = Missilex[q][i] Else '<-----------------------------------------------------------------V---Not homeing TimeFire[q][i] = (Clock.ElapsedMilliseconds / 1000) - TimeStart[q][i] Firestart = Zock77Math.GetCircle(25,Startx[q][i] + 12,Starty[q][i] + 20,AngleFire[q][i] - 90) xyArray = Zock77Math.Fire(Firestart["x"],Firestart["y"],Gravity,TimeFire[q][i],TankWeapon[CurrentProj[q]]["Velocity"],AngleFire[q][i] - 90) Offsety = TankWeapon[CurrentProj[q]]["ProjectileOffsety"] Offsetx = TankWeapon[CurrentProj[q]]["ProjectileOffsetx"] Shapes.Move(Ball[q][i],xyArray["x"]+ Offsetx,xyArray["y"] + Offsety) Xchange = xyArray["x"] - OldX[q][i] Ychange = xyArray["y"] - OldY[q][i] If Xchange < 0 Then Rot = Math.GetDegrees(Math.ArcTan(Ychange/Xchange)) - 180 Else Rot = Math.GetDegrees(Math.ArcTan(Ychange/Xchange)) EndIf Shapes.Rotate(Ball[q][i],rot) OldY[q][i] = xyArray["y"] OldX[q][i] = xyArray["x"] EndIf EndIf EndFor EndSub '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Sub RotateTurret Shapes.Rotate(Turret[q], TurretAngle[q]) EndSub '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Sub GetTankpos Array = Zock77Math.Fire(Tankx[q],Tanky[q],0,Time,MaxSpeed,Angle[q]) Tankx[q] = Array["x"] Tanky[q] = Array["y"] Time = 0 EndSub '++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Sub OnKeyDown Key = GraphicsWindow.LastKey If Key <> OldKey Then Info = "KEYDO " + Key SendInfo() EndIf OldKey = Key KeyUp = "" EndSub ' -------------------------------------------------------------------------------------------------------------------------------------------------------- Sub OnKeyUp If GraphicsWindow.LastKey <> KeyUp Then KeyUp = GraphicsWindow.LastKey OldKey = "" Info = "KEYUP " + KeyUp SendInfo() EndIf EndSub ' -------------------------------------------------------------------------------------------------------------------------------------------------------- Sub SendInfo '1 W is down '2W is Up '3 D is down '4 D is up '5 S is down '6 S is up '7 A is down '8 A is Up If Info = "KEYDO W" Then wkey = 1 ElseIf Info = "KEYUP W" Then wkey = 0 ElseIf Info = "KEYDO D" Then dkey = 1 ElseIf Info = "KEYUP D" Then dkey = 0 ElseIf Info = "KEYDO S" Then skey = 1 ElseIf Info = "KEYUP S" Then skey = 0 ElseIf Info = "KEYDO A" Then akey = 1 ElseIf Info = "KEYUP A" Then akey = 0 EndIf ' 'TextWindow.WriteLine(Info) DatatoSend = Text.Append(wkey,dkey) DatatoSend = Text.Append(DatatoSend,skey) DatatoSend = Text.Append(DatatoSend,akey) Var = "type=pos;x=" + Math.Round(Tankx[ThisPC]) + ";y=" + Math.Round(Tanky[ThisPC]) + ";ang=" + Math.Round(Angle[ThisPC]) + ";key=" + DatatoSend + ";client=" + ThisPC + ";dtime=" + Dtime[ThisPC] IOTCPClient.SendMessage(Var) EndSub ' -------------------------------------------------------------------------------------------------------------------------------------------------------- Sub OnMessageRecieved NumOfMesRec = NumOfMesRec + 1 If NumOfMesRec = 1 Then If Text.GetSubText(IOTCPClient.LastMessageData,1,21) = "You are client number" Then CanStartGame = "Yes" ThisPC = Text.GetSubText(IOTCPClient.LastMessageData,23,1) Var = Text.GetSubTextToEnd(IOTCPClient.LastMessageData,25) CurrentMap = Var["level"] For i = 1 To ThisPC - 1 Username[i] = Var["username" + i] EndFor EndIf Else Data = IOTCPClient.LastMessageData If Text.GetSubText(Data,1,1) = ThisPC Then 'Do Nothing Else DoStuff() EndIf If Text.GetSubText(IOTCPClient.LastMessageData,1,15) = "Client Connect " Then Occ() EndIf EndIf 'TextWindow.WriteLine(IOTCPClient.LastMessageData) EndSub ' -------------------------------------------------------------------------------------------------------------------------------------------------------- Sub Occ NumClients = NumClients + 1 Var2 = Text.GetSubTextToEnd(IOTCPClient.LastMessageData,16) ClientNum[Var2] = NumClients ClientIP[NumClients] = Var2 Username[NumOfPlayers] = LDNetwork.GetGameData("TankWars" + ClientIP[NumClients]) DataUser = LDNetwork.GetGameData("TankWars" + Username[NumOfPlayers]) ' Username[NumClients] = Var2["usr"] 'TextWindow.WriteLine(ClientIP[NumClients]) 'TextWindow.WriteLine("Client number " + NumClients + " Joined") NumOfPlayers = NumOfPlayers + 1 CurrentProj[NumOfPlayers] = DataUser["weapon"] Nop = NumOfPlayers Tankx[Nop] = TankInitPos[Nop]["x"] Tanky[Nop] = TankInitPos[Nop]["y"] UsernameText[Nop] = Shapes.AddText(Username[Nop]) Tank[Nop] = Shapes.AddImage(Program.Directory + "/Tank.png") Turret[Nop] = Shapes.AddImage(Program.Directory + "/" + TankWeapon[CurrentProj[Nop]]["Turret"]) TankExp[Nop] = LDShapes.AddAnimatedImage(Program.Directory + "/Animations/anim1.png","False",8,6) LDShapes.AnimationSet(TankExp[Nop],48) For w22 = 1 to BallCount Exp[nop][w22] = LDShapes.AddAnimatedImage(Progdir + TankWeapon[CurrentProj[Nop]]["Animation"],"False",TankWeapon[CurrentProj[Nop]]["AnimCountx"],TankWeapon[CurrentProj[Nop]]["AnimCounty"]) LDShapes.AnimationSet(Exp[Nop][w22],16) EndFor EndSub ' -------------------------------------------------------------------------------------------------------------------------------------------------------- Sub DoStuff VarTemp = IOTCPClient.LastMessageData 'LDtext can't handle = and ; Varnew =Text.Replace(Vartemp,";","w") '<--- so I convert ; to w Varnew =Text.Replace(Varnew,"=","q") '<--- and = to q Varnew = LDText.Split(Varnew,"type") 'then I split it For i9 = 1 To Array.GetItemCount(Varnew) Var = "type" + Text.Replace(Text.Replace(Varnew[i9],"w",";"),"q","=") '<--- then, once they are split, I convert them back. If TankDead[Var["client"]] <> "True" Then If Var["type"] = "pos" Then k = Var["client"] KeyClient = Var["key"] Tankx[k] = Var["x"] Tanky[k] = Var["y"] Angle[k] = Var["ang"] Dtime[k] = Var["dtime"] Array1 = "0=Up;1=Down;" Array2 = "1=w;2=d;3=s;4=a;" For i4 = 1 To 4 KeyVar[Array2[i4]] = Array1[Text.GetSubText(KeyClient,i4,1)] ClientKey[k][Array2[i4]] = KeyVar[Array2[i4]] EndFor EndIf If Var["type"] = "death" Then TankDead[Var["client"]] = "True" StartSpawncount() Shapes.Move(TankExp[Var["client"]],Tankx[Var["client"]]-49,Tanky[Var["client"]]-49) Shapes.Rotate(TankExp[Var["client"]], Angle[Var["client"]] + 90) LDShapes.AnimationSet(TankExp[Var["client"]],1) GraphicsWindow.DrawImage(Program.Directory + "/scorch_mark" + Math.Round(Math.GetRandomNumber(2)) +".png",Tankx[Var["client"]]-49,Tanky[Var["client"]]-49) Tankx[Var["client"]] = 5000 Tanky[Var["client"]] = 5000 EndIf If Var["type"] = "init" Then Username[Var["client"]] = Var["username"] DataUser = LDNetwork.GetGameData("TankWars" + Username[Var["client"]]) CurrentProj[Var["client"]] = DataUser["weapon"] EndIf If Var["client"] <> ThisPC Then If Var["type"] = "fire" Then FiringTank = Var["client"] FireTankx = Var["x"] FireTanky = Var["y"] TurretAngle[FiringTank] = Var["ang"] TankSelected[FiringTank] = Var["ts"] Distx = Math.Abs(Tankx[Var["client"]] - FireTankx) Disty = Math.Abs(Tanky[Var["client"]] - FireTanky) ' If the tank is too far off, then fix its position If Distx > 25 Then Tankx[Var["client"]] = FireTankx EndIf If Disty > 25 Then Tanky[Var["client"]] = FireTanky EndIf Fire() EndIf EndIf EndIf EndFor EndSub ' -------------------------------------------------------------------------------------------------------------------------------------------------------- Sub OnButtonClicked If Controls.LastClickedButton <> BRefresh Then For i8 = 1 To NumofServers If Controls.LastClickedButton = "Button" + i8 Then Connect = IOTCPClient.Connect(DataStuff[i8]["IP"],DataStuff[i8]["Port"]) If Connect = "SUCCESS" Then GraphicsWindow.Clear() GraphicsWindow.ShowMessage("Successfully connected!!","") Else GraphicsWindow.ShowMessage("Connection Failed.","") EndIf EndIf EndFor Else DrawServers() EndIf EndSub Sub OnGWClose LDProcess.Start(Program.Directory + "/Armored Assault.exe","") Program.End() EndSub Sub OnMouseDown If Clock.ElapsedMilliseconds - Firelast > TankWeapon[CurrentProj[ThisPC]]["ROF"] Then FiringTank = ThisPC FireTankx = Tankx[ThisPC] FireTanky = Tanky[ThisPC] TankSelected[ThisPC] = SelectedTank Fire() Var = "type=fire;x=" + Math.Round(Tankx[ThisPC]) + ";y=" + Math.Round(Tanky[ThisPC]) + ";ang=" + Math.Round(TurretAngle[ThisPC]) + ";client=" + ThisPC + ";ts=" + SelectedTank IOTCPClient.SendMessage(Var) Firelast = Clock.ElapsedMilliseconds EndIf EndSub Sub CheckBulletColision For i = 1 To BallCount If TankWeapon[CurrentProj[q]]["Homeing"] = "True" Then tempX = Missilex[q][i] tempY = Missiley[q][i] TankRoundx = Math.Round((tempX - 15) / 30 + 1) TankRoundy = Math.Round((tempY - 15) / 30 + 1) Result = Text.GetSubText(Level[1][TankRoundy],TankRoundx,1) Else TimeFire[q][i] = (Clock.ElapsedMilliseconds / 1000) - TimeStart[q][i] Firestart = Zock77Math.GetCircle(25,Startx[q][i] + 12,Starty[q][i] + 20,AngleFire[q][i] - 90) xyArray5 = Zock77Math.Fire(Firestart["x"],Firestart["y"],Gravity,TimeFire[q][i],TankWeapon[CurrentProj[q]]["Velocity"],AngleFire[q][i] - 90) TankRoundx = Math.Round((xyArray5["x"] - 15) / 30 + 1) TankRoundy = Math.Round((xyArray5["y"] - 15) / 30 + 1) Result = Text.GetSubText(Level[1][TankRoundy],TankRoundx,1) tempX = xyArray5["x"] tempY = xyArray5["y"] EndIf For t1 = 1 To NumOfPlayers If q <> t1 Then '<--- q is who owns the bullet. t1 is who its checking. So as long as the owner isn't being checked, we are good. If tempX > Tankx[t1] And tempX < Tankx[t1] + 30 And tempY > Tanky[t1] And tempY < TankY[t1] + 30 Then Missile_Dead[q][i] = "True" EndIf EndIf EndFor If Result = "p" Then Missile_Dead[q][i] = "True" Shapes.Move(Exp[q][i], tempX - 34,tempY - 32) LDShapes.AnimationSet(Exp[q][i],1) EndIf EndFor EndSub Sub TankSelection If Mouse.IsRightButtonDown Then Mx = GraphicsWindow.MouseX My = GraphicsWindow.MouseY For u2 = 1 To NumOfPlayers Var = LDShapes.GetAllShapesAt(Mx,My) For u3 = 1 to Array.GetItemCount(Var) If Var[u3] = Tank[u2] Then SelectedTank = u2 u2 = NumOfPlayers '<-- exit the For statement EndIf EndFor EndFor EndIf EndSub Sub StartSpawncount TankDieat = Clock.ElapsedMilliseconds EndSub Sub DrawServers Servers = LDNetwork.GetGameData("TankWarsServers") pos = 0 For i8 = 1 to 20 For z = 1 To 3 Shapes.Remove(Text[i8][z]) EndFor Shapes.Remove(Button[i8]) EndFor For i7 = 1 To 20 If Servers[i7] = "closed" Then pos = pos + 1 GraphicsWindow.BrushColor = "White" ' GraphicsWindow.DrawBoundText(10,10 + pos*30,75,DataStuff[i7]["Server"]) ' GraphicsWindow.DrawText(100,10 + pos*30,DataStuff[i7]["IP"]) Text[i7][1] = Shapes.AddText(DataStuff[i7]["Server"]) Text[i7][2] = Shapes.AddText(DataStuff[i7]["IP"]) Text[i7][3] = Shapes.AddText(DataStuff[i7]["Port"]) Shapes.Move(Text[i7][1],15,10 + pos*30) Shapes.Move(Text[i7][2],100,10 + pos*30) Shapes.Move(Text[i7][3],210,10 + pos*30) ' GraphicsWindow.DrawText(210,10 + pos*30,DataStuff[i7]["Port"]) GraphicsWindow.BrushColor = "Black" Button[i7] = Controls.AddButton("Join",300,(pos*30) + 4) Controls.SetSize(Button[i7],50,30) EndIf EndFor EndSub End>LDZ295.sb< Start>LDZ981.sb< 'Nearest stars to our sun rendered in 3D 'distance out to approx 16 light-years 'Zeven Provincien May 2010 ' 'Star data taken from a version of the Gliese star catalog 'that I found at this address: 'http://cc.joensuu.fi/~tniemi/starmaps/TN_Gliese3simplified.dat ' '3D rendering code adapted from code originally published 'by rdohmen and modified by litdev and Oskariok 'on the Small Basic forum, 'Rotating Cube' thread ' 'Use a,s,d,f keys to rotate 'Use x&c keys to zoom 'Use arrow keys to slide up/down, left/right 'Use mouse-click to set view in rotation 'Hover over a star to show its name and distance from our sun in light-years GraphicsWindow.BackgroundColor = "Black" StarX="1= 0;2= 2.93;3= 3.12;4= 4.98;5= -1.9;" StarX=StarX+"6= -3.4;7= -2.1;8= -5.75;9= 9.22;10= -3.38;" StarX=StarX+"11= -6.86;12= 0.01;13= 4.12;14= -4.79;15= 6.91;" StarX=StarX+"16= 1.51;17= 0.13;18= -3.23;19= -9.24;20= 4.67;" StarX=StarX+"21= -9.54;22= -2.05;23= -10.25;24= 9;25= -3.42;" StarX=StarX+"26= -3.29;27= 12.18;28= -11.24;29= -2.63;30= 1.45;" StarX=StarX+"31= -4.01;32= -9.41;33= -8.47;34= 4.58;35= 3.44;" StarX=StarX+"36= -1.74;37= 14.09;38= 6.53;39= 10.28;40= -9.09;" StarY="1= 0;2= -3.04;3= -3.04;4= 2.98;5= -3.9;" StarY=StarY+"6= -0.3;7= 0.17;8= -6.21;9= 1.84;10= 9.29;" StarY=StarY+"11= -1.95;12= -5.48;13= 4.42;14= 9.55;15= -3.04;" StarY=StarY+"16= 11.13;17= 10.39;18= 0.39;19= -6.17;20= 0.42;" StarY=StarY+"21= -2.92;22= 1.2;23= -6.48;24= 0.62;25= -9.61;" StarY=StarY+"26= 12.52;27= 0.72;28= -7.28;29= -8.02;30= -4.24;" StarY=StarY+"31= 6.45;32= -7.95;33= 5.37;34= -13.89;35= -1;" StarY=StarY+"36= -10.94;37= -4.3;38= -13.39;39= -1.96;40= 2.29;" StarZ="1= 0;2= -0.14;3= -0.05;4= 1.45;5= 6.48;" StarZ=StarZ+"6= 7.46;7= -8.3;8= -1.32;9= -1.7;10= -3.01;" StarZ=StarZ+"11= -7.93;12= 9.34;13= -9.29;14= -3.56;15= -8.39;" StarZ=StarZ+"16= -1.14;17= 4.67;18= -10.93;19= 2.57;20= -10.46;" StarZ=StarZ+"21= 6.34;22= -11.96;23= 2.22;24= -8.8;25= -7.43;" StarZ=StarZ+"26= 0;27= 5.35;28= -1.45;29= -11.16;30= 13.31;" StarZ=StarZ+"31= -11.9;32= 7.74;33= -10.56;34= -0.51;35= -14.25;" StarZ=StarZ+"36= 9.74;37= -1.75;38= -0.74;39= -10.97;40= 12.08;" Star["Class"]="1=G5;2=M5;3=G5;4=M5;5=M5;6=M5;7=M5;8=A5;9=M5;10=M5;" Star["Class"]=Star["Class"]+"11=K5;12=M5;13=M5;14=M5;15=K5;16=K5;17=M5;" Star["Class"]=Star["Class"]+"18=G5;19=F4;20=M5;21=M5;22=M5;23=M5;24=M5;25=M5;" Star["Class"]=Star["Class"]+"26=M5;27=M5;28=M5;29=M5;30=M5;31=DZ;32=K5;" Star["Class"]=Star["Class"]+"33=M5;34=M5;35=M5;36=M5;37=M5;38=DQ;39=M5;40=K5;" Star["Name"]="1=Sol;2=Proxima Centauri;3=Alpha Centauri;4=Barnard's Star;" Star["Name"]=Star["Name"]+"5=Wolf 359;6=LHS 37;7=UV Ceti;8=Sirius;9=Ross 154;" Star["Name"]=Star["Name"]+"10=Ross 248;11=Epsilon Eridani;12=Ross 128;" Star["Name"]=Star["Name"]+"13=LHS 68;14=GX Andromedae;15=Epsilon Indi;16=61 Cygni;" Star["Name"]=Star["Name"]+"17=LHS 58;18=Tau Ceti;19=LHS 233;20=LHS 70;" Star["Name"]=Star["Name"]+"21=LHS 248;22=L 725-32;23=LHS 33;24=LHS 66;25=Kapteyn's Star;" Star["Name"]=Star["Name"]+"26=DO Cephei;27=LHS 419;28=577 Monocerotis;29=LFT 295;30=FL Virginis;" Star["Name"]=Star["Name"]+"31=Van Maanen's Star;32=LHS 6;33=LHS 11;34=LHS 288;35=LHS 1;" Star["Name"]=Star["Name"]+"36=LHS 292;37=LHS 449;38=LHS 43;39=L 354-89;40=LHS 280;" i = 0 'While (Line[i] <> "EOF") And (i < 40) While i < 40 i = i + 1 ' The following line could be harmful and has been automatically commented. ' 'Line[i] = File.ReadLine("C:\users\Craig\Documents\SmallBasic\gliese_catalog_3.txt", i) 'TextWindow.WriteLine(Line[i]) 'Star["Gliese"][i] = Text.GetSubText(Line[i],1,8) 'Star["X"][i] = Text.GetSubText(Line[i],18,7) 'Star["Y"][i] = Text.GetSubText(Line[i],26,7) 'Star["Z"][i] = Text.GetSubText(Line[i],34,7) 'Star["dist"][i] = Text.GetSubText(Line[i],43,6) 'Star["Class"][i] = Text.GetSubText(Line[i],57,2) 'Star["Name"][i] = Text.GetSubText(Line[i],73,20) If Text.StartsWith(Star["Class"][i], "O") Then GraphicsWindow.BrushColor = "Blue" ElseIf Text.StartsWith(Star["Class"][i], "B") Then GraphicsWindow.BrushColor = "CornflowerBlue" ElseIf Text.StartsWith(Star["Class"][i], "A") Then GraphicsWindow.BrushColor = "White" ElseIf Text.StartsWith(Star["Class"][i], "F") Then GraphicsWindow.BrushColor = "LightYellow" ElseIf Text.StartsWith(Star["Class"][i], "G") Then GraphicsWindow.BrushColor = "Yellow" ElseIf Text.StartsWith(Star["Class"][i], "K") Then GraphicsWindow.BrushColor = "Orange" Else GraphicsWindow.BrushColor = "Red" 'M class star EndIf StarShape[i] = Shapes.AddEllipse(7,7) distsq = StarX[i]*StarX[i]+StarY[i]*StarY[i]+StarZ[i]*StarZ[i] Star["dist"][i] = Math.SquareRoot(distsq) Star["dist"][i] = Math.Round(Star["dist"][i]*100)/100 EndWhile 'TextWindow.WriteLine(Star["Gliese"]) ' The following line could be harmful and has been automatically commented. ' 'File.WriteContents("C:\users\Craig\Documents\SmallBasic\test.txt",Star["Class"]) StarNo = i 'add coordinate system as last three points Star["Gliese"][StarNo+1] = "" StarX[StarNo+1] = 25 StarY[StarNo+1] = 0 StarZ[StarNo+1] = 0 Star["dist"][StarNo+1] = 25 Star["Class"][StarNo+1] = "" Star["Name"][StarNo+1] = "Galactic X coordinate" Star["Gliese"][StarNo+2] = "" StarX[StarNo+2] = 0 StarY[StarNo+2] = 25 StarZ[StarNo+2] = 0 Star["dist"][StarNo+2] = 25 Star["Class"][StarNo+2] = "" Star["Name"][StarNo+2] = "Galactic Y coordinate" Star["Gliese"][StarNo+3] = "" StarX[StarNo+3] = 0 StarY[StarNo+3] = 0 StarZ[StarNo+3] = 25 Star["dist"][StarNo+3] = 25 Star["Class"][StarNo+3] = "" Star["Name"][StarNo+3] = "Galactic Z coordinate" GraphicsWindow.BrushColor = "Yellow" IDStatus = "No" M = 0.5 R = Math.GetRadians(0.5) S = 0.5 CubeX = 500 CubeY = 400 CubeSize = 20 Info = "False" 'Event handling GraphicsWindow.KeyDown=OnKeyDown GraphicsWindow.KeyUp = OnKeyUp 'GraphicsWindow.MouseMove = OnMouseMove GraphicsWindow.MouseDown = OnMouseDown Timer.Tick=OnTimer Timer.Interval=20 CreateProgram() While Run = "True" If MovingDown = "True" Then CubeY = CubeY + M NeedToDraw = "True" EndIf If MovingUp = "True" Then CubeY = CubeY - M NeedToDraw = "True" EndIf If MovingRight = "True" Then CubeX = CubeX + M NeedToDraw = "True" EndIf If MovingLeft = "True" Then CubeX = CubeX - M NeedToDraw = "True" EndIf If RotatingDown = "True" Then angleV=angleV-R NeedToDraw = "True" EndIf If RotatingUp = "True" Then angleV=angleV+R NeedToDraw = "True" EndIf If RotatingRight = "True" Then angleH=angleH-R NeedToDraw = "True" EndIf If RotatingLeft = "True" Then angleH=angleH+R NeedToDraw = "True" EndIf If ZoomingPlus = "True" Then CubeSize=CubeSize+S NeedToDraw = "True" EndIf If ZoomingMinus = "True" Then CubeSize=CubeSize-S NeedToDraw = "True" If CubeSize < 1 Then CubeSize = 1 EndIf EndIf If NeedToDraw = "True" Then Draw() EndIf EndWhile Sub CreateProgram angleH=30*math.Pi/180 angleV=30*math.Pi/180 NeedToDraw = "False" Run = "True" GraphicsWindow.Show() GraphicsWindow.Title = "Our sun and its neighbours" GraphicsWindow.Width = 1000 GraphicsWindow.Height = 800 GraphicsWindow.Left = Desktop.Width/2-GraphicsWindow.Width/2 GraphicsWindow.Top = Desktop.Height/2-GraphicsWindow.Height/2 If Info = "True" Then TextWindow.Show() TextWindow.Title = "3D info" TextWindow.Left = Desktop.Width/2-330 TextWindow.Top = Desktop.Height/2+330 EndIf RotatingLeft = "False" RotatingRight = "False" RotatingUp = "False" RotatingDown = "False" MovingLeft = "False" MovingRight = "False" MovingUp = "False" MovingDown = "False" ZoomingPlus = "False" ZoomingMinus = "False" Draw() EndSub Sub OnKeyDown K = GraphicsWindow.LastKey If K = "A" Then RotatingLeft = "True" EndIF If K = "S" Then RotatingRight = "True" EndIF If K = "W" Then RotatingUp = "True" EndIf If K = "Z" Then RotatingDown = "True" EndIf If K = "Up" Then MovingUp = "True" EndIf If K = "Down" Then MovingDown = "True" EndIf If K = "Right" Then MovingRight = "True" EndIf If K = "Left" Then MovingLeft = "True" EndIf If K = "X" Then ZoomingPlus = "True" EndIf If K = "C" Then ZoomingMinus = "True" EndIf EndSub Sub OnKeyUp K = GraphicsWindow.LastKey If K = "A" Then RotatingLeft = "False" EndIF If K = "S" Then RotatingRight = "False" EndIF If K = "W" Then RotatingUp = "False" EndIf If K = "Z" Then RotatingDown = "False" EndIf If K = "Up" Then MovingUp = "False" EndIf If K = "Down" Then MovingDown = "False" EndIf If K = "Right" Then MovingRight = "False" EndIf If K = "Left" Then MovingLeft = "False" EndIf If K = "X" Then ZoomingPlus = "False" EndIf If K = "C" Then ZoomingMinus = "False" EndIf EndSub Sub calcPoints For i=1 To StarNo+3 ' draai in horizontale richting 'x' = x*cos q - y*sin q Starx1[i]=StarX[i]*math.cos(angleH)-StarY[i]*math.sin(angleH) 'y' = x*sin q + y*cos q Stary1[i]=StarX[i]*math.sin(angleH)+StarY[i]*math.cos(angleH) 'z' = z Starz1[i]=StarZ[i] ' draai in verticale richting 'y' = x*cos q - y*sin q Stary2[i]=Stary1[i]*math.cos(angleV)-Starz1[i]*math.sin(angleV) 'z' = x*sin q + y*cos q Starz2[i]=Stary1[i]*math.sin(angleV)+Starz1[i]*math.cos(angleV) 'x' = x Starx2[i]=Starx1[i] 'Calculate X And Y Starx2[i] = Starx2[i]*CubeSize Stary2[i] = Stary2[i]*CubeSize Starx2[i] = Starx2[i]+CubeX Stary2[i] = Stary2[i]+CubeY endfor endsub Sub Draw 'Draw Info If Info = "True" Then ShowInfo() EndIf 'erase old coordinate lines GraphicsWindow.PenColor = "Black" GraphicsWindow.BrushColor = "Black" GraphicsWindow.PenWidth = 4 For i = (StarNo+1) to (StarNo+3) GraphicsWindow.DrawLine(Starx2[1],Stary2[1],Starx2[i],Stary2[i]) GraphicsWindow.FillRectangle(Starx2[i]+10,Stary2[i], 140, 20) EndFor 'Calculate Points calcPoints() 'Delete Old Cube 'GraphicsWindow.Clear() For i = 1 to StarNo 'GraphicsWindow.DrawEllipse(Star["x2"][i],Star["y2"][i],5,5) 'GraphicsWindow.SetPixel(Star["x2"][i],Star["y2"][i],"black") Shapes.Move(StarShape[i],Starx2[i],Stary2[i]) EndFor ' Redraw The Coordinate system GraphicsWindow.PenColor = "Gray" GraphicsWindow.BrushColor = "Gray" GraphicsWindow.PenWidth = 1 For i = (StarNo+1) to (StarNo+3) GraphicsWindow.DrawLine(Starx2[1],Stary2[1],Starx2[i],Stary2[i]) GraphicsWindow.DrawText(Starx2[i]+10,Stary2[i], Star["Name"][i]) EndFor 'Set NeedToDrawFalse NeedToDraw = "False" EndSub Sub ShowInfo TextWindow.Clear() TextWindow.WriteLine("3D info") TextWindow.WriteLine("CubeX = "+CubeX) TextWindow.WriteLine("CubeY = "+CubeY) TextWindow.WriteLine("Cube Size = "+CubeSize) TextWindow.WriteLine("Cube Horizontal Angle = "+angleH) TextWindow.WriteLine("Cube Vertical Angle = "+angleV) EndSub Sub OnTimer If IDStatus = "No" then For loop = 1 To StarNo If Math.Abs(GraphicsWindow.MouseX-Starx2[loop]) < 10 And Math.Abs(GraphicsWindow.MouseY-Stary2[loop]) < 10 Then StarIdent = loop IDStatus = "Yes" Xpos = Starx2[loop] Ypos = Stary2[loop] Stardist = Star["dist"][loop] IDStar() Endif EndFor Elseif IDStatus = "Yes" then If Math.Abs(GraphicsWindow.MouseX-Starx2[StarIdent]) > 10 Or Math.Abs(GraphicsWindow.MouseY-Stary2[StarIdent]) > 10 Then IDStatus = "No" GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(Xpos+10, Ypos, 120, 50) StarIdent = 0 Endif Endif EndSub Sub IDStar GraphicsWindow.BrushColor = "Yellow" 'GraphicsWindow.DrawText(Star["x2"][StarIdent]+10,Star["y2"][StarIdent],Star["Name"][StarIdent]) GraphicsWindow.DrawText(Xpos+10, Ypos, Star["Name"][StarIdent]) GraphicsWindow.DrawText(Xpos+10,Ypos+20, Stardist + " LY") EndSub Sub OnMouseDown If RotatingLeft = "False" Then RotatingLeft = "True" Else RotatingLeft = "False" EndIf EndSub End>LDZ981.sb< Start>LDZ987.sb< 'And here’s an example of an OPTION BOX event: w = 350 h = 290 GraphicsWindow.CanResize = "False" GraphicsWindow.Width = w GraphicsWindow.Height = h GraphicsWindow.Top = (Desktop.Height-h) / 2 GraphicsWindow.Left = (Desktop.Width-w) / 2 GraphicsWindow.FontSize = 15 'xxxxxxxxxxxxxx MAIN PROGRAM xxxxxxxxxxxxxxx CreateGUI() Controls.ButtonClicked = ButtonDown 'waiting for input and executing and will call each time ButtonDown 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Sub CreateGUI Number=1 TextWindow.WriteLine("Option = "+ Number) Counter = Controls.AddButton(Number, 20, 210) 'put in place the button Controls.SetSize(Counter, 40, 40) EndSub 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Sub ButtonDown operator = Controls.GetButtonCaption(Controls.LastClickedButton) If operator = 5 Then number = 1 TextWindow.WriteLine("Option = "+ Number ) controls.setbuttoncaption(counter,Number) Else number = number + 1 TextWindow.WriteLine("Option = "+ Number ) controls.setbuttoncaption(counter,number) endif EndSub 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx End>LDZ987.sb< Start>LFC592.sb< '-------------------------------------------step 1----------------------------------------------------------------------- GraphicsWindow.Hide() 'hide the window till the shapes are hidden otherwise they flash gw = 910 gh = 610 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Top = 10 GraphicsWindow.Left = (Desktop.Width - gw) / 2 'centres window in the middle of the screen GraphicsWindow.Title = "Show What You Know - Curriculum 3.4: Events & Interactivity" GraphicsWindow.CanResize = "false" GraphicsWindow.PenWidth = 3 GraphicsWindow.DrawRectangle(5, 5, gw-10, gh - 150) GraphicsWindow.DrawRectangle(5, gh-137, 225, 133) GraphicsWindow.DrawRectangle(5+8+225, gh-137, 225, 133) GraphicsWindow.DrawRectangle(5+(8*2)+(225*2), gh-137, 225, 133) GraphicsWindow.DrawRectangle(5+(8*3)+(225*3), gh-137, 200, 133) '-------------------------------------------step 2------------------------------------------------------------------------ 'caption is an Array caption = "1=Triangle;2=Rectangle;3=Circle;4=Rotate;5=Zoom;6=Draw;7=Clear;8=Exit" For i = 1 To 3 button[i] = Controls.AddButton(caption[i], (225-180)/2, (gh-133)+((i-1)*43)) Controls.SetSize(button[i], 180, 38) EndFor posX = "1=253;2=363;3=488;4=598;5=763" 'I just set these using trial & error For i = 4 To 8 button[i] = Controls.AddButton(caption[i], posX[i-3], gh-105) Controls.SetSize(button[i], 80, 80) EndFor '----------------------------------------------step 3 & 8--------------------------------------------------------------------- Controls.ButtonClicked = ButtonClicked GraphicsWindow.MouseMove = MouseDrag '-------------------------------------------------step 4------------------------------------------------------------------ shp[1] = Shapes.AddTriangle(0,0, 50,0, 25,40) shp[2] = Shapes.AddRectangle(50, 60) shp[3] = Shapes.AddEllipse(50, 50) HideShapes() GraphicsWindow.Show() 'show the window after the shapes are hidden otherwise they flash '-------------------------------------------------step 5, 6 & 7------------------------------------------------------------------ Sub ButtonClicked If Controls.GetButtonCaption(Controls.LastClickedButton) = "Triangle" Then Shapes.ShowShape(shp[1]) j = 1 InitAngleAndZoom() ElseIf Controls.GetButtonCaption(Controls.LastClickedButton) = "Rectangle" Then Shapes.ShowShape(shp[2]) j = 2 InitAngleAndZoom() ElseIf Controls.GetButtonCaption(Controls.LastClickedButton) = "Circle" Then Shapes.ShowShape(shp[3]) j = 3 InitAngleAndZoom() ElseIf Controls.GetButtonCaption(Controls.LastClickedButton) = "Rotate" Then angle = angle + 25 Shapes.Rotate(shp[j], angle) ElseIf Controls.GetButtonCaption(Controls.LastClickedButton) = "Zoom" Then zoom = zoom + 0.1 Shapes.Zoom(shp[j], zoom, zoom) ElseIf Controls.GetButtonCaption(Controls.LastClickedButton) = "Draw" Then 'step 8 startDrag = "yes" ElseIf Controls.GetButtonCaption(Controls.LastClickedButton) = "Clear" Then HideShapes() ElseIf Controls.GetButtonCaption(Controls.LastClickedButton) = "Exit" Then Program.End() EndIf EndSub '-------------------------------Subroutines---------------------------------------------------------------------- Sub MouseDrag If startDrag = "yes" Then x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY If y < gh-150+3 And y > 5 And x > 5 And x < gw-10+3 Then If Mouse.IsLeftButtonDown = "true" Then GraphicsWindow.DrawLine(OrgX, OrgY, x, y) Endif OrgX = x OrgY = y EndIf EndIf EndSub Sub HideShapes posX = "1=150;2=350;3=600" For i = 1 To Array.GetItemCount(shp) Shapes.Move(shp[i], posX[i], 200) Shapes.HideShape(shp[i]) EndFor EndSub Sub InitAngleAndZoom angle = 0 zoom = 1 EndSub End>LFC592.sb< Start>LFD194.sb< ' Array and Stack ' Copyright (c) 2014 Nonki Takahashi. The MIT License. ' WQ = Text.GetCharacter(34) gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Title = "Array and Stack" GraphicsWindow.BrushColor = "Gray" GraphicsWindow.FontName = "Courier New" op = Shapes.AddText("") x = gw / 2 y = gh / 2 Shapes.Move(op, x, y) GraphicsWindow.PenWidth = 0 n = 5 AddColors() InitStack() While "True" PushColors() PopColors() EndWhile Sub AddColors For ia = 1 To n c[ia] = GraphicsWindow.GetRandomColor() Shapes.SetText(op, "a[" + ia + "] = " + c[ia]) GraphicsWindow.BrushColor = c[ia] a[ia] = Shapes.AddRectangle(50, 10) x = 50 + (ia - 1) * 60 y = 50 Shapes.Animate(a[ia], x, y, 1000) GraphicsWindow.BrushColor = "Gray" GraphicsWindow.DrawText(x + 10, y - 20, "a[" + ia + "]") Program.Delay(1000) GraphicsWindow.BrushColor = c[ia] GraphicsWindow.FillRectangle(x, y, 50, 10) EndFor Program.Delay(1000) EndSub Sub InitStack x = 50 y = gh - 50 GraphicsWindow.BrushColor = "Gray" GraphicsWindow.DrawText(x + 20, y, "s") EndSub Sub PushColors x = 50 For ia = 1 To n Shapes.SetText(op, "Stack.PushValue(" + WQ + "s" + WQ + ", a[" + ia + "])") Stack.PushValue("s", a[ia]) Stack.PushValue("c", c[ia]) is = Stack.GetCount("s") y = gh - 60 - (6 - 1) * 15 Shapes.Animate(a[ia], x, y, 1000) Program.Delay(1000) y = gh - 60 - (is - 1) * 15 Shapes.Animate(a[ia], x, y, 1000) EndFor Program.Delay(1000) EndSub Sub PopColors For ia = 1 To n Shapes.SetText(op, "a[" + ia + "] = Stack.PopValue(" + WQ + "s" + WQ + ")") c[ia] = Stack.PopValue("c") a[ia] = Stack.PopValue("s") x = 50 y = gh - 60 - (6 - 1) * 15 Shapes.Animate(a[ia], x, y, 500) Program.Delay(500) x = 50 + (ia - 1) * 60 y = 50 Shapes.Animate(a[ia], x, y, 1000) Program.Delay(1000) GraphicsWindow.BrushColor = c[ia] GraphicsWindow.FillRectangle(x, y, 50, 10) EndFor EndSub End>LFD194.sb< Start>LFD261.sb< GraphicsWindow.Title = "Crystal Structure of Salt scale = 0.47 args=0 GraphicsWindow.BackgroundColor="darkblue Init() mol = "NaCl" DrawMolecularName() distance = (atom["Na"]["+"] + atom["Cl"]["-"]) * scale cols = 5 rows = 5 For row = 1 To rows For col = 1 To cols If Math.Remainder(row - col, 2) = 0 Then ' draw Na ion = "+" a = "Na" Else '---------------- draw Cl ion = "-" a = "Cl" EndIf ox = cx - (col - (cols + 1) / 2) * distance oy = cy - (row - (rows + 1) / 2) * distance bc = "#55eeeeee" opt = "" size = atom[a][ion] * 2 * scale ldcall.Function2 ("FillCircle" 3500 0) opt = ion bc = atom[a]["color"] size = atom[a]["size"] * scale FillCircle() EndFor EndFor Sub DrawMolecularName GraphicsWindow.FontName = "calibri" GraphicsWindow.FontItalic="true GraphicsWindow.BrushColor = "white" GraphicsWindow.FontSize = 30 GraphicsWindow.FontBold="true tt=Shapes.AddText(mol) Shapes.Move(tt 15 15) LDEffect.DropShadow(tt "") GraphicsWindow.FontBold="false GraphicsWindow.FontSize=22 tt=Shapes.AddText("(natrii chloridum)") Shapes.Move(tt 90 22) LDEffect.DropShadow(tt "") EndSub Sub FillCircle a1=args[1] a2=args[2] GraphicsWindow.PenWidth=0 GraphicsWindow.BrushColor = bc ee=Shapes.AddEllipse(size size) Shapes.Move(ee ox - size / 2, oy - size / 2) LDShapes.AnimateOpacity(ee a1 a2) Program.Delay(55) If opt <> "" Then GraphicsWindow.FontSize = 35 GraphicsWindow.BrushColor = pc GraphicsWindow.DrawText(ox + size / 2, oy - size / 2 - 35 * 0.5, opt) EndIf EndSub Sub Init pc = "DimGray atom["Na"] = "color=MediumOrchid;size=113.5;1=155;2=160;+=102 atom["Cl"] = "color=LimeGreen;size=87.5;1=99;2=95;3=93;-=181 root2 = Math.SquareRoot(2) root3 = Math.SquareRoot(3) gw = GraphicsWindow.Width gh = GraphicsWindow.Height cx = gw / 2 cy = gh / 2 n = 1 x1 = 0 y1 = 0 x2 = 0 y2 = 0 EndSub End>LFD261.sb< Start>LFD463.sb< ' Database v0.1 ' Copyright (c) 2012 Nonki Takahashi NL = Text.GetCharacter(13) + Text.GetCharacter(10) HELPTEXT = ".= - set data" + NL HELPTEXT = HELPTEXT + "help - shows this" + NL HELPTEXT = HELPTEXT + "quit - end program" + NL HELPTEXT = HELPTEXT + "? - show all data" PROMPT = ">" TextWindow.WriteLine("Database v0.1") ShowHelp() continue = "True" ' The following line could be harmful and has been automatically commented. ' File.CopyFile("db.txt", "db.bak") ' The following line could be harmful and has been automatically commented. ' db = File.ReadContents("db.txt") While continue TextWindow.WriteLine("") TextWindow.Write(PROMPT) cmd = TextWindow.Read() ParseCommand() If match = "False" Then ShowHelp() EndIf EndWhile ' The following line could be harmful and has been automatically commented. ' File.WriteContents("db.txt", db) TextWindow.WriteLine("") ' end program Sub ParseCommand ' param cmd - command line cmdptr = 1 ParseQuit() If match Then Goto pcexit EndIf ParseHelp() If match Then Goto pcexit EndIf ParseSet() If match Then Goto pcexit EndIf ParseQuery() pcexit: EndSub Sub ShowHelp ' const HELPTEXT - help text TextWindow.WriteLine(HELPTEXT) EndSub Sub ParseSet ' param cmd - command line ' param cmdptr - command pointer ' return match - "True" if cmd is set ptrsaved = cmdptr ParseId() If match Then c = "." LexChar() Else cmdptr = ptrsaved Goto psexit EndIf If match Then ParseProperty() Else cmdptr = ptrsaved Goto psexit EndIf If match Then c = "=" LexChar() Else cmdptr = ptrsaved Goto psexit EndIf If match Then ParseData() Else cmdptr = ptrsaved Goto psexit EndIf db[id][property] = data match = "True" psexit: EndSub Sub ParseHelp ' param cmd - command line ' param cmdptr - command pointer ' return match - "True" if cmd is help match = "False" If Text.GetSubText(cmd, cmdptr, 4) = "help" Then ShowHelp() match = "True" EndIf EndSub Sub ParseQuit ' param cmd - command line ' param cmdptr - command pointer ' return match - "True" if cmd is quit ' return continue - "False" if cmd is quit match = "False" If Text.GetSubText(cmd, cmdptr, 4) = "quit" Then match = "True" continue = "False" EndIf EndSub Sub ParseID ' param cmd - command line ' param cmdptr - command pointer ' return match - "True" if cmd is quit ' return id - input id match = "False" ptr = Text.GetIndexOf(cmd, ".") If ptr > 0 Then id = Text.GetSubText(cmd, cmdptr, ptr - cmdptr) cmdptr = ptr match = "True" EndIf EndSub Sub ParseProperty ' param cmd - command line ' param cmdptr - command pointer ' return match - "True" if cmd is quit ' return property - input property match = "False" ptr = Text.GetIndexOf(cmd, "=") If ptr > 0 Then property = Text.GetSubText(cmd, cmdptr, ptr - cmdptr) cmdptr = ptr match = "True" EndIf EndSub Sub ParseData ' param cmd - command line ' param cmdptr - command pointer ' return match - "True" if cmd is quit ' return data - input data match = "True" data = Text.GetSubTextToEnd(cmd, cmdptr) cmdptr = cmdptr + Text.GetLength(data) EndSub Sub LexChar ' param cmd - command line ' param cmdptr - command pointer ' param c - character ' return match - "True" if cmd is quit match = "False" If Text.GetSubText(cmd, cmdptr, 1) = c Then cmdptr = cmdptr + 1 match = "True" EndIf EndSub Sub ParseQuery ' param cmd - command line ' param cmdptr - command pointer ' param c - character ' return match - "True" if cmd is quit c = "?" LexChar() If match Then nid = Array.GetItemCount(db) ix = Array.GetAllIndices(db) For i = 1 To nid nprop = Array.GetItemCount(db[ix[i]]) jx = Array.GetAllIndices(db[ix[i]]) TextWindow.WriteLine(ix[i]) For j = 1 To nprop TextWindow.WriteLine("." + jx[j] + "=" + db[ix[i]][jx[j]]) EndFor EndFor EndIf EndSub End>LFD463.sb< Start>LFG463.sb< 'Fun with Variables 'Now that we can store information, we can use that idea to store some really 'interesting information -- like shapes, and pictures 'importCode: 'Open the GraphicsWindow and display the message GraphicsWindow.Show() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(210,200,"One moment while the images load") 'Load in a random background picture 'An image that matches the theme of the program 'Pictures from flickr can be very big, this may take a few seconds. address = Flickr.GetRandomPicture("night sky") pic = ImageList.LoadImage(address) GraphicsWindow.Show() GraphicsWindow.DrawResizedImage(pic, 0, 0, 640, 480) 'Load in the space ship 'Images can be loaded from the local hard drive, network drives, or the internet 'Images on the internet can take a long time to load i1 = Shapes.AddImage("http://i1113.photobucket.com/albums/k518/MVAPhotos/FlyingSaucer.png") GraphicsWindow.FontItalic = "true" GraphicsWindow.FontSize = 50 GraphicsWindow.BrushColor = "red" t1 = Shapes.AddText("The Aliens Attack!!!!") Shapes.Move(t1,50,100) Program.Delay(1000) 'delays are needed to wait for loading and animation 'Move the ship to the far right of the screen, take 5 seconds (5000 milliseconds) to get there Shapes.Animate(i1,620,175,5000) Program.Delay(5000) 'Wait for animation to complete 'Move ship to bottom left of screen, take half a second (500 milliseconds) to get there Shapes.Animate(i1,0,375,500) Program.Delay(500) 'Wait for animation to complete Shapes.HideShape(i1) 'Hide the ship when we get there 'simulate an explosion by adding an orange rectangle GraphicsWindow.BrushColor = "orange" r1 = Shapes.AddRectangle(50,50) Shapes.Move(r1,0,375) Program.Delay(100) 'Rotate and zoom the rectangle every tenth of a second (100 milliseconds) Shapes.Zoom(r1,1.5,1.5) Shapes.Rotate(r1,22) Program.Delay(100) Shapes.Zoom(r1,2,2) Shapes.Rotate(r1,45) Program.Delay(100) Shapes.Zoom(r1,2.5,2.5) Shapes.Rotate(r1,66) Program.Delay(100) Shapes.Zoom(r1,1.5,1.5) Shapes.Rotate(r1,90) Program.Delay(100) Shapes.HideShape(r1) End>LFG463.sb< Start>LFJ338.sb< GraphicsWindow.BackgroundColor="darkblue GraphicsWindow.Title ="Chain reaction dominos dw=765 dh=desktop.Height-40 GraphicsWindow.width=1600 GraphicsWindow.Height=dh GraphicsWindow.Top=0 GraphicsWindow.Left=0 GraphicsWindow.PenWidth=0 cx=380 cy=dh/2 LDPhysics.Reset() dx=750 sset() dx=790 sset1() Sub sset For n= 1 To 6 GraphicsWindow.BrushColor="red" platform[n]=shapes.AddRectangle(665,5) LDPhysics.AddfixedShape(platform[n],10,0) LDPhysics.SetPosition(platform[n],dx+cx,n*110,0) GraphicsWindow.BrushColor="blue" For m=0 To 13 domino = Shapes.AddRectangle(10,100) LDPhysics.AddMovingShape(domino,0.5,0,0) LDPhysics.SetPosition(domino,dx+55+m*50,n*110-55,0) EndFor EndFor anchor = LDPhysics.AddFixedAnchor(dx+22,530) ball = Shapes.AddEllipse(20,20) LDPhysics.AddMovingShape(ball,0,0,0) LDPhysics.SetPosition(ball,dx+22,582,0) LDPhysics.AddChain(ball,anchor) GraphicsWindow.KeyDown = start GraphicsWindow.BrushColor="green" anc1 = LDPhysics.AddFixedAnchor(dx+dw-45,110) lever1 = Shapes.AddRectangle(5,100) LDPhysics.AddMovingShape(lever1,0,0,0) LDPhysics.SetPosition(lever1,dx+dw-45,110,0) LDPhysics.AttachShapesWithRotation(anc1,lever1) anc1 = LDPhysics.AddFixedAnchor(dx+45,220) lever1 = Shapes.AddRectangle(5,100) LDPhysics.AddMovingShape(lever1,0,0,0) LDPhysics.SetPosition(lever1,dx+42,220,0) LDPhysics.AttachShapesWithRotation(anc1,lever1) anc1 = LDPhysics.AddFixedAnchor(dx+dw-45,330) lever1 = Shapes.AddRectangle(5,100) LDPhysics.AddMovingShape(lever1,0,0,0) LDPhysics.SetPosition(lever1,dx+dw-45,330,0) LDPhysics.AttachShapesWithRotation(anc1,lever1) anc1 = LDPhysics.AddFixedAnchor(dx+45,440) lever1 = Shapes.AddRectangle(5,100) LDPhysics.AddMovingShape(lever1,0,0,0) LDPhysics.SetPosition(lever1,dx+42,440,0) LDPhysics.AttachShapesWithRotation(anc1,lever1) anc1 = LDPhysics.AddFixedAnchor(dx+dw-45,550) lever1 = Shapes.AddRectangle(5,100) LDPhysics.AddMovingShape(lever1,0,0,0) LDPhysics.SetPosition(lever1,dx+dw-45,550,0) LDPhysics.AttachShapesWithRotation(anc1,lever1) endsub GraphicsWindow.BrushColor="gray" text = Shapes.AddText("Press any key to start...") LDShapes.Font(text,"",40,0,0) Shapes.Move(text,350,dh-110) While 1=1 LDPhysics.DoTimestep() If a =1 Then LDPhysics.SetImpulse(ball,2000,0) a=0 endif Program.Delay(1) EndWhile Sub start a=1 EndSub Sub sset1 For n= 1 To 6 GraphicsWindow.BrushColor="red" platform[n]=shapes.AddRectangle(665,5) LDPhysics.AddfixedShape(platform[n],10,0) LDPhysics.SetPosition(platform[n],dx-cx,n*110,0) GraphicsWindow.BrushColor="blue" For m=0 To 13 domino = Shapes.AddRectangle(10,100) LDPhysics.AddMovingShape(domino,0.5,0,0) LDPhysics.SetPosition(domino,dx-(55+m*50),n*110-55,0) EndFor EndFor GraphicsWindow.BrushColor="green" lever1 = Shapes.AddRectangle(5,100) LDPhysics.AddFixedShape (lever1,0,0) LDPhysics.SetPosition(lever1,dx-45,570,0) anc1 = LDPhysics.AddFixedAnchor(dx-(dw-45),110) lever1 = Shapes.AddRectangle(5,100) LDPhysics.AddMovingShape(lever1,0,0,0) LDPhysics.SetPosition(lever1,dx-(dw-45),110,0) LDPhysics.AttachShapesWithRotation(anc1,lever1) anc1 = LDPhysics.AddFixedAnchor(dx-45,220) lever1 = Shapes.AddRectangle(5,100) LDPhysics.AddMovingShape(lever1,0,0,0) LDPhysics.SetPosition(lever1,dx-42,220,0) LDPhysics.AttachShapesWithRotation(anc1,lever1) anc1 = LDPhysics.AddFixedAnchor(dx-(dw-45),330) lever1 = Shapes.AddRectangle(5,100) LDPhysics.AddMovingShape(lever1,0,0,0) LDPhysics.SetPosition(lever1,dx-(dw-45),330,0) LDPhysics.AttachShapesWithRotation(anc1,lever1) anc1 = LDPhysics.AddFixedAnchor(dx-45,440) lever1 = Shapes.AddRectangle(5,100) LDPhysics.AddMovingShape(lever1,0,0,0) LDPhysics.SetPosition(lever1,dx-42,440,0) LDPhysics.AttachShapesWithRotation(anc1,lever1) anc1 = LDPhysics.AddFixedAnchor(dx-(dw-45),550) lever1 = Shapes.AddRectangle(5,100) LDPhysics.AddMovingShape(lever1,0,0,0) LDPhysics.SetPosition(lever1,dx-(dw-45),550,0) LDPhysics.AttachShapesWithRotation(anc1,lever1) endsub End>LFJ338.sb< Start>LFJ422.sb< GraphicsWindow.Show() size = 500 half = 250 GraphicsWindow.BackgroundColor="#000044 GraphicsWindow.Width = size * 1.5 GraphicsWindow.Height = size GraphicsWindow.Title = "Mandelbrot" For f=27 To 12 Step -1.5 GraphicsWindow.Clear() ii=LDGraphicsWindow.Capture("" "false") LDImage.OpenWorkingImage(ii) q=255/f For px = 1 To size * 1.5 Step 2 GraphicsWindow.Title=px x_0 = px/half - 2 For py = 1 To size Step 2 y_0 = py/half - 1 x = x_0 y = y_0 i = 0 While(c <= 2 AND i<100) x_1 = Math.Power(x, 2) - Math.Power(y, 2) + x_0 y_1 = 2 * x * y + y_0 c = Math.Power(Math.Power(x_1, 2) + Math.Power(y_1, 2), 0.5) x = x_1 y = y_1 i = i + 1 EndWhile If i < 99 Then LDImage.SetWorkingImagePixel(ii px, py, GraphicsWindow.GetColorFromRGB(q*i, q*i, q*i)) LDImage.SetWorkingImagePixel(ii px+1, py, GraphicsWindow.GetColorFromRGB(q*i, q*i, q*i)) EndIf c=0 EndFor EndFor LDImage.CloseWorkingImage(ii) GraphicsWindow.DrawImage(ii 0 1) jj=ldGraphicsWindow.Capture("" "false") GraphicsWindow.DrawImage(LDImage.AddImages(ii jj) 0 0) fi=fi+1 ji[fi]=ldGraphicsWindow.Capture("" "false") EndFor While 1=1 For q=1 To fi GraphicsWindow.DrawImage(ji[q] 0 0) Program.Delay(35) EndFor For q=fi-1 To 2 step -1 GraphicsWindow.DrawImage(ji[q] 0 0) Program.Delay(35) EndFor EndWhile End>LFJ422.sb< Start>LFP800.sb< ' Shapes 1.42 ' Copyright (c) 2012 Nonki Takahashi. All rights reserved. ' ' History : ' 1.42 2012/10/16 Minor bug fixed - open message remains. (TLW744-2) ' 1.41 2012/10/16 Minor bug fixed - line rotated. (TLW744-1) ' 1.4 2012/10/16 Supported cursor keys and new UI for shapes menu. (XFZ657-14) ' 1.31 2012/09/20 Minor bug fixed - pinches removed at consecutive shapes addition. (TLW744-0) ' 1.3 2012/09/20 Supported palette loading , consecutive shapes addition and (2). (XFZ657-13) ' 1.2 2012/09/20 Bug fixed (1) and supported short cut keys. (XFZ657-12) ' 1.12 2012/09/18 Bug fixed (select line from file). (XFZ657-11) ' 1.1 2012/09/18 Supported file input. (TLW744) ' 1.0 2012/09/15 Supported copy and paste. (XFZ657-10) ' ' Bug fix : ' (1) No rotation frame after paste ' (2) Pinches came under a shape after pen or brush color change ' title = "Shapes 1.42" GraphicsWindow.Title = title debug = "False" WQ = Text.GetCharacter(34) CRLF = Text.GetCharacter(13) + Text.GetCharacter(10) CS_InitPalette() ' initialize palette for color slider DrawMenu() shape = "" nShapes = 0 cont = "True" ' continue Mouse_Init() KB_Init() param = "down=True;move=False;up=True;" ' wait to click Mouse_SetHandler() While cont If clicked Then ' mouse clicked DetectClickedObject() DoObject() param = "down=True;move=False;up=True;" Mouse_SetHandler() ElseIf in > out Then ' key input buffer is not empty 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() ' removes pinches EndIf ElseIf c = "LEFT" Or c = "RIGHT" Or c = "UP" Or c="DOWN" Then If selectedshape <> "" Then i = selectedshape _x = shape[i]["x"] + arrow_dx[c] _y = shape[i]["y"] + arrow_dy[c] MoveShape() EndIf EndIf param = "down=True;move=False;up=True;" Mouse_SetHandler() Else Program.Delay(100) EndIf EndWhile ' end of program Sub CalcDetectBorder ' param i - index of shapes If shape[i]["func"] = "line" Then ' line x = shape[i]["x2"] - shape[i]["x1"] y = shape[i]["y2"] - shape[i]["y1"] Math_CartesianToPolar() If a >= 180 Then a = a - 180 EndIf shape[i]["angle"] = a cx = shape[i]["x"] + Math.Abs(x) / 2 cy = shape[i]["y"] + Math.Abs(y) / 2 len = Math.SquareRoot(x * x + y * y) shape[i]["_x0"] = Math.Floor(cx - len / 2) shape[i]["_x1"] = Math.Floor(cx + len / 2) shape[i]["_y0"] = cy - 4 shape[i]["_y1"] = cy + 4 Else ' rectangle, ellipse or triangle If shape[i]["func"] = "tri" Then ' triangle shape[i]["width"] = shape[i]["x3"] shape[i]["height"] = shape[i]["y2"] EndIf shape[i]["_x0"] = shape[i]["x"] shape[i]["_y0"] = shape[i]["y"] shape[i]["_x1"] = shape[i]["x"] + shape[i]["width"] shape[i]["_y1"] = shape[i]["y"] + shape[i]["height"] EndIf EndSub Sub CalcPinchPos ' param i - shape index ' return mxM, myM - center of pinch _x = shape[i]["x"] _y = shape[i]["y"] width = shape[i]["width"] height = shape[i]["height"] angle = shape[i]["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 ' param i - pinch index ' param angle - angle of a shape ' param selectedshape - parent shape index of pinch ' param shape[] - shape data ' return mxM, myM - free vertex ' return mxD, myD - fixed vertex If shape[selectedshape]["func"] = "line" Then If i = 1 Then mxM = shape[selectedshape]["x"] + shape[selectedshape]["x1"] myM = shape[selectedshape]["y"] + shape[selectedshape]["y1"] mxD = shape[selectedshape]["x"] + shape[selectedshape]["x2"] myD = shape[selectedshape]["y"] + shape[selectedshape]["y2"] ElseIf i = 2 Then mxM = shape[selectedshape]["x"] + shape[selectedshape]["x2"] myM = shape[selectedshape]["y"] + shape[selectedshape]["y2"] mxD = shape[selectedshape]["x"] + shape[selectedshape]["x1"] myD = shape[selectedshape]["y"] + shape[selectedshape]["y1"] EndIf Else mxM = shape[selectedshape]["x"] myM = shape[selectedshape]["y"] mxD = mxM myD = myM If i = 1 Or i = 3 Then mxD = mxD + shape[selectedshape]["width"] EndIf If i = 1 Or i = 2 Then myD = myD + shape[selectedshape]["height"] EndIf If i = 2 Or i = 4 Then mxM = mxM + shape[selectedshape]["width"] EndIf If i = 3 Or i = 4 Then myM = myM + shape[selectedshape]["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 ' param selectedshape Shapes.Remove(shape[selectedshape]["obj"]) nShapes = nShapes - 1 For _i = selectedshape To nShapes shape[_i] = shape[_i + 1] EndFor shape[nShapes + 1] = "" selectedshape = "" EndSub Sub DetectClickedObject ' mxD, myD - clicked position ' return obj - name of object (menu, shape or pinch) Stack.PushValue("local", i) obj = "" For i = 1 To nPinch If pinch[i]["_x0"] <= mxD And mxD <= pinch[i]["_x1"] And pinch[i]["_y0"] <= myD And myD <= pinch[i]["_y1"] Then obj = "pinch" + i Goto dco_exit EndIf EndFor For i = nShapes To 1 Step -1 param = "x=" + mxD + ";y=" + myD + ";width=0;height=0;" param["cx"] = (shape[i]["_x0"] + shape[i]["_x1"]) / 2 param["cy"] = (shape[i]["_y0"] + shape[i]["_y1"]) / 2 param["angle"] = -shape[i]["angle"] Shapes_CalcRotatePos() If shape[i]["_x0"] <= x And x <= shape[i]["_x1"] And shape[i]["_y0"] <= y And y <= shape[i]["_y1"] Then If shape[i]["func"] = "rect" Or shape[i]["func"] = "line" Then obj = "shape" + i Goto dco_exit ElseIf shape[i]["func"] = "ell" Then x = (x - param["cx"]) / shape[i]["width"] * 2 y = (y - param["cy"]) / shape[i]["height"] * 2 r = Math.SquareRoot(x * x + y * y) If r <= 1 Then obj = "shape" + i Goto dco_exit EndIf ElseIf shape[i]["func"] = "tri" Then x = (x - param["cx"]) / shape[i]["width"] * 2 y = (y - shape[i]["_y1"]) / shape[i]["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 If menu[i]["func"] <> "" And menu[i]["_x0"] <= mxD And mxD <= menu[i]["_x1"] And menu[i]["_y0"] <= myD And myD <= menu[i]["_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 a menu item clicked do the funciton If Text.StartsWith(obj, "menu") Then param = "down=False;move=False;up=False;" ' wait button pushed Mouse_SetHandler() i = Text.GetSubTextToEnd(obj, 5) obj = "" func = menu[i]["func"] select = "True" ItemSelect() ' shows menu item frame 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() ' removes pinches if a shape selected If func = "cut" Then selectedshape = i EndIf EndIf If func = "open" Then ' open shapes from file ReadShapes() ElseIf func = "save" Then ' save shapes to file 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 ' rectangle, ellipse or triangle While "True" WaitToClick() ' to get mxD, myD DetectClickedObject() If Text.StartsWith(obj, "menu") Then Goto dm_exit ' cancel to register shape EndIf obj = "" mxM = mxD myM = myD angle = 0 WaitToReleaseS() ' to get mxU, myU resize = "False" nShapes = nShapes + 1 i = nShapes ' to set shape[nShapes] RegisterShapeData() If w = 0 And h = 0 Then shape[i] = "" nShapes = nShapes - 1 Goto dm_exit ' cansel to register zero sized shape EndIf GraphicsWindow.BrushColor = bcolor GraphicsWindow.PenWidth = pwidth If pwidth > 0 Then GraphicsWindow.PenColor = pcolor EndIf If func = "rect" Then shape[nShapes]["obj"] = Shapes.AddRectangle(w, h) ElseIf func = "ell" Then shape[nShapes]["obj"] = Shapes.AddEllipse(w, h) ElseIf func = "tri" Then shape[nShapes]["obj"] = Shapes.AddTriangle(xt, 0, 0, h, w, h) EndIf Shapes.Move(shape[nShapes]["obj"], xmin, ymin) If mode = "single" Then Goto dm_exit EndIf EndWhile ElseIf func = "line" Then ' line While "True" WaitToClick() ' to get mxD, myD DetectClickedObject() If Text.StartsWith(obj, "menu") Then Goto dm_exit ' cancel to register line EndIf obj = "" mxM = mxD myM = myD WaitToReleaseS() ' to get mxU, myU nShapes = nShapes + 1 i = nShapes ' to set shape[nShapes] RegisterShapeData() If x1 = x2 And y1 = y2 Then shape[i] = "" nShapes = nShapes - 1 Goto dm_exit ' cansel to register zero sized line EndIf GraphicsWindow.BrushColor = bcolor GraphicsWindow.PenWidth = pwidth If pwidth > 0 Then GraphicsWindow.PenColor = pcolor EndIf shape[nShapes]["obj"] = Shapes.AddLine(x1, y1, x2, y2) Shapes.Move(shape[nShapes]["obj"], xmin, ymin) If mode = "single" Then Goto dm_exit EndIf EndWhile 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 = "#EEEEEE" GraphicsWindow.FillRectangle(x, y, size, size) DrawMenuItem() ElseIf func = "pc" Then ' pen color color = pcolor CS_ShowPopup() pcolor = color DrawMenuItem() ElseIf func = "bc" Then ' brush color color = bcolor CS_ShowPopup() bcolor = color DrawMenuItem() 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() If func = "pw" Then shape[i]["pw"] = pwidth ElseIf func = "pc" Then shape[i]["pc"] = pcolor ElseIf func = "bc" Then shape[i]["bc"] = color EndIf iMin = i ' to re-size Shapes iMax = nShapes ' to keep z-order of Shapes Shapes_Remove() scale = 1 shX = 0 shY = 0 Shapes_Add() select = "True" ShapeSelect() EndIf dm_exit: i = selecteditem select = "False" ItemSelect() ' removes menu item frame If Text.IsSubText("rect|ell|tri|line", func) Then Shapes.HideShape(repeat[func]) EndIf EndIf EndSub Sub DoObject ' param obj - clicked object While obj <> "" fromMenu = "False" DoMenu() If obj <> "" Then DoShape() EndIf If obj <> "" Then DoPinch() EndIf EndWhile EndSub Sub DoPinch ' if a pinch clicked then rotate or re-size a shape ' param obj - clicked object ' param selectedshape - parent shape index of the pinch If Text.StartsWith(obj, "pinch") Then i = Text.GetSubTextToEnd(obj, 6) obj = "" If i = 5 Then ' rotate a shape i = selectedshape WaitToReleaseR() ' to get angle Shapes.Rotate(shape[i]["obj"], angle) shape[i]["angle"] = Math.Floor(angle) select = "False" ShapeSelect() ' remove pinches select = "True" ShapeSelect() ' show pinches Else ' re-size a shape angle = shape[selectedshape]["angle"] CalcVertexes() ' to get mxM, myM, mxD, myD func = shape[selectedshape]["func"] WaitToReleaseS() ' to get mxU, myU i = selectedshape select = "False" ShapeSelect() ' remove pinches ' selectedshape is broken in ShapeSelect() so use i instead RegisterShapeMetrics() ' re-size shape[i] iMin = i ' to re-size Shapes iMax = nShapes ' to keep z-order of Shapes Shapes_Remove() scale = 1 shX = 0 shY = 0 Shapes_Add() select = "True" ShapeSelect() ' show pinches EndIf EndIf EndSub Sub DoShape ' if a shape clicked then move it If Text.StartsWith(obj, "shape") Then If selectedshape <> "" Then ' if other shape selected i = selectedshape select = "False" ShapeSelect() ' removes pinches EndIf i = Text.GetSubTextToEnd(obj, 6) ' shape index select = "True" ShapeSelect() ' shows pinches Mouse_SetHandler() WaitToReleaseM() ' for moving a shape clicked = "False" obj = "" EndIf EndSub Sub DrawMenu ' return menu[] - array of menu data pwidth = GraphicsWindow.PenWidth cxMenu = 6 cyMenu = 6 sizeMenu = 40 nMenu = 12 GraphicsWindow.BrushColor = "#EEEEEE" GraphicsWindow.FillRectangle(0, 0, GraphicsWindow.Width, 20 + sizeMenu) pw = "1=2;2=4;3=8;4=16;5=0;6=1;" ' pen width pen = 1 ' pen width index nPen = 6 ' number of pen width 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) menu[i]["_x0"] = xMenu menu[i]["_y0"] = yMenu menu[i]["_x1"] = xMenu + sizeMenu menu[i]["_y1"] = yMenu + sizeMenu DrawMenuItem() EndFor nMenu = nMenu + 1 imenubar = nMenu menu[i]["_x0"] = 0 menu[i]["_y0"] = 0 menu[i]["_x1"] = GraphicsWindow.Width menu[i]["_y1"] = 20 + sizeMenu menu[i]["func"] = "menubar" 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 GraphicsWindow.FontBold = "False" GraphicsWindow.FontSize = 8 url = "http://www.nonkit.com/smallbasic.files/" If i = 1 Then menu[i]["func"] = "open" GraphicsWindow.DrawImage(url + "open.png", x, y) itemname[i] = "Open" ElseIf i = 2 Then menu[i]["func"] = "save" GraphicsWindow.DrawImage(url + "save.png", x, y) itemname[i] = "Save" ElseIf i = 3 Then icut = i ' for short cut key menu[i]["func"] = "cut" ' initialize shapes Scissors_Init() nShapes = Array.GetItemCount(shape) ' add shapes scale = 0.11 iMin = 1 iMax = nShapes Shapes_Add() x = x + 14 Shapes_Move() x = x - 14 nShapes = 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 ' for short cut key menu[i]["func"] = "copy" GraphicsWindow.DrawImage(url + "copy.png", x, y) itemname[i] = "Copy" ElseIf i = 5 Then ipaste = i ' for short cut key menu[i]["func"] = "paste" GraphicsWindow.DrawImage(url + "paste.png", x, y) itemname[i] = "Paste" ElseIf i = 6 Then menu[i]["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) ' for consecutive shapes addition Shapes.HideShape(repeat["rect"]) ElseIf i = 7 Then menu[i]["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) ' for consecutive shapes addition Shapes.HideShape(repeat["ell"]) ElseIf i = 8 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) itemname[i] = "Triangle" repeat["tri"] = Shapes.AddImage(url + "repeat.png") Shapes.Move(repeat["tri"], x, y) ' for consecutive shapes addition Shapes.HideShape(repeat["tri"]) ElseIf i = 9 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) itemname[i] = "Line" repeat["line"] = Shapes.AddImage(url + "repeat.png") Shapes.Move(repeat["line"], x, y) ' for consecutive shapes addition Shapes.HideShape(repeat["line"]) ElseIf i = 10 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) itemname[i] = "Pen Width" ElseIf i = 11 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) itemname[i] = "Pen Color" ElseIf i = 12 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) itemname[i] = "Brush Color" EndIf 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 ItemSelect ' i - menu index ' select - "True" if selected If i <> imenubar Then If select Then GraphicsWindow.PenColor = "Gray" Else GraphicsWindow.PenColor = "#EEEEEE" 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) EndIf EndSub Sub NormalizePos ' param mxD, myD - fixed vertex of a shape rotated ' param mxM, myM - opposite vertex of a shape rotated ' param angle - angle of a shape ' return _mxD, _myD - fixed vertex of a shape not rotated ' return _mxM, _myM - opposite vertex of a shape not rotated 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() ' Parse "shX = ..." ptr = Text.GetIndexOf(buf, "shX = ") If ptr = 0 Then Goto rs_exit EndIf shX = "" ptr = ptr + 6 c = Text.GetSubText(buf, ptr, 1) While Text.GetIndexOf("0123456789", c) > 0 shX = Text.Append(shX, c) ptr = ptr + 1 c = Text.GetSubText(buf, ptr, 1) EndWhile ' Parse "shY = ..." _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 ' Parse "shape[i] = ..." 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) 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"] < shape[i]["y1"]) Then shape[i]["y2"] = shape[i]["y1"] shape[i]["y1"] = shape[i]["y3"] shape[i]["y3"] = shape[i]["y2"] shape[i]["angle"] = shape[i]["angle"] + 180 If shape[i]["angle"] >= 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 Shapes_Add() EndSub Sub RegisterShapeData ' param i - index of shapes ' param func - "rect", "ell", "tri" or "line" ' return shape[i] - shape data shape[i]["func"] = func RegisterShapeStyle() RegisterShapeMetrics() EndSub Sub RegisterShapeMetrics ' param i - index of shapes ' param func - "rect", "ell", "tri" or "line" ' param mxD, myD - fixed vertex ' param mxU, myU - opposite vertex ' return shape[i] - shape data ' return xmin, ymin, w, h - shape position and size ' return xt - top position for triangle ' return x1, y1, x2, y2 - line position If func = "line" Then ' line 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 shape[i]["x1"] = x1 shape[i]["y1"] = y1 shape[i]["x2"] = x2 shape[i]["y2"] = y2 Else ' rectangle, ellipse or triangle mxM = mxU myM = myU angle = shape[i]["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 shape[i]["width"] = w shape[i]["height"] = h EndIf shape[i]["x"] = xmin shape[i]["y"] = ymin If func = "tri" Then ' triangle xt = Math.Floor((xmax - xmin) / 2) ' x top shape[i]["x1"] = xt shape[i]["y1"] = 0 shape[i]["x2"] = 0 shape[i]["y2"] = h shape[i]["x3"] = w shape[i]["y3"] = h EndIf CalcDetectBorder() EndSub Sub RegisterShapeStyle ' param i - index of shapes ' param pwidth - pen width ' param pcolor - pen color ' param bcolor - brush color ' return shape[i] - shape data shape[i]["pw"] = pwidth If pwidth > 0 Then shape[i]["pc"] = pcolor Else shape[i]["pc"] = "" EndIf If func <> "line" Then ' rectangle, ellipse or triangle shape[i]["bc"] = bcolor EndIf EndSub Sub ShapeSelect ' Show or remove pinches for a selected shape ' param i - shape index ' param select - "True" if selected ' return selectedshape - selected shape index If select Then Stack.PushValue("local", x) Stack.PushValue("local", y) GraphicsWindow.PenColor = "Black" GraphicsWindow.PenWidth = 1 sizePinch = 10 selectedshape = i shX = shape[i]["x"] shY = shape[i]["y"] GraphicsWindow.BrushColor = "Lime" If shape[i]["func"] = "line" Then nPinch = 2 For _i = 1 To nPinch pinch[_i]["obj"] = Shapes.AddEllipse(sizePinch, sizePinch) x = shX + shape[i]["x" + _i] - sizePinch / 2 y = shY + shape[i]["y" + _i] - sizePinch / 2 Shapes.Move(pinch[_i]["obj"], x, y) pinch[_i]["_x0"] = x pinch[_i]["_y0"] = y pinch[_i]["_x1"] = x + sizePinch pinch[_i]["_y1"] = y + sizePinch EndFor Else pinch[5]["obj"] = Shapes.AddEllipse(sizePinch, sizePinch) shWidth = shape[i]["width"] shHeight = shape[i]["height"] param["cx"] = shX + shWidth / 2 param["cy"] = shY + shHeight / 2 param["angle"] = shape[i]["angle"] param["x"] = shX + shWidth / 2 - sizePinch / 2 param["y"] = shY - 30 - sizePinch / 2 param["width"] = sizePinch param["height"] = sizePinch Shapes_CalcRotatePos() Shapes.Move(pinch[5]["obj"], x, y) pinch[5]["_x0"] = x pinch[5]["_y0"] = y pinch[5]["_x1"] = x + sizePinch pinch[5]["_y1"] = y + sizePinch 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 pinch[_i]["obj"] = Shapes.AddEllipse(sizePinch, sizePinch) param["x"] = shX + xPinch[_i] - sizePinch / 2 param["y"] = shY + yPinch[_i] - sizePinch / 2 Shapes_CalcRotatePos() Shapes.Move(pinch[_i]["obj"], x, y) pinch[_i]["_x0"] = x pinch[_i]["_y0"] = y pinch[_i]["_x1"] = x + sizePinch pinch[_i]["_y1"] = y + sizePinch EndFor EndIf y = Stack.PopValue("local") x = Stack.PopValue("local") Else selectedshape = "" For _i = 1 To nPinch Shapes.Remove(pinch[_i]["obj"]) EndFor nPinch = 0 EndIf EndSub Sub WaitToClick ' return mxD, myD - clicked point param = "down=True;move=False;up=False;" ' wait to click Mouse_SetHandler() While clicked = "False" Program.Delay(100) EndWhile EndSub Sub WaitToReleaseM ' for moving a shape ' param i - shape index ' param mxD, myD - fixed vertex of a shape ' return mxU, myU - opposite vertex of a shape GraphicsWindow.PenWidth = 1 GraphicsWindow.PenColor = "Black" GraphicsWindow.BrushColor = "White" param = "down=False;move=True;" ' for moving a shape Mouse_SetHandler() func = shape[i]["func"] _x = shape[i]["x"] _y = shape[i]["y"] shAngle = shape[i]["angle"] mxM = mxD myM = myD moved = "True" While released = "False" If moved Then param = "move=False;" ' while moving a shape Mouse_SetHandler() _x = shape[i]["x"] + mxM - mxD _y = shape[i]["y"] + myM - myD If oFrame[func] = "" Then If func = "rect" Then oFrame[func] = Shapes.AddRectangle(shape[i]["width"], shape[i]["height"]) ElseIf func = "ell" Then oFrame[func] = Shapes.AddEllipse(shape[i]["width"], shape[i]["height"]) ElseIf func = "tri" Then _x1 = shape[i]["x1"] _y1 = shape[i]["y1"] _x2 = shape[i]["x2"] _y2 = shape[i]["y2"] _x3 = shape[i]["x3"] _y3 = shape[i]["y3"] oFrame[func] = Shapes.AddTriangle(_x1, _y1, _x2, _y2, _x3, _y3) ElseIf func = "line" Then _x1 = shape[i]["x1"] _y1 = shape[i]["y1"] _x2 = shape[i]["x2"] _y2 = shape[i]["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;" ' for next moving a shape Mouse_SetHandler() Else Program.Delay(100) EndIf EndWhile param = "move=False;up=False;" ' mouse released Mouse_SetHandler() MoveShape() If oFrame[func] <> "" Then Shapes.Remove(oFrame[func]) oFrame[func] = "" EndIf EndSub Sub MoveShape ' param i - shape index ' param _x, _y - new position of the shape dx = _x - shape[i]["x"] dy = _y - shape[i]["y"] shape[i]["x"] = _x shape[i]["y"] = _y shape[i]["_x0"] = shape[i]["_x0"] + dx shape[i]["_x1"] = shape[i]["_x1"] + dx shape[i]["_y0"] = shape[i]["_y0"] + dy shape[i]["_y1"] = shape[i]["_y1"] + dy Shapes.Move(shape[i]["obj"], _x, _y) If shape[i]["func"] = "line" Then _iMax = 2 Else _iMax = 5 EndIf For _i = 1 To _iMax pinch[_i]["_x0"] = pinch[_i]["_x0"] + dx pinch[_i]["_x1"] = pinch[_i]["_x1"] + dx pinch[_i]["_y0"] = pinch[_i]["_y0"] + dy pinch[_i]["_y1"] = pinch[_i]["_y1"] + dy Shapes.Move(pinch[_i]["obj"], pinch[_i]["_x0"], pinch[_i]["_y0"]) EndFor EndSub Sub WaitToReleaseR ' for rotating a shape ' param i - shape index ' return angle - angle for rotation GraphicsWindow.PenWidth = 1 GraphicsWindow.PenColor = "Black" GraphicsWindow.BrushColor = "White" param = "down=False;move=True;up=True;" ' for rotating a shape / wait to release Mouse_SetHandler() CalcPinchPos() ' into mxM, myM cx = param["cx"] cy = param["cy"] func = shape[i]["func"] If func = "tri" Then x1 = shape[i]["x1"] y1 = shape[i]["y1"] x2 = shape[i]["x2"] y2 = shape[i]["y2"] x3 = shape[i]["x3"] y3 = shape[i]["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;" ' while sizing a shape 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;" ' for next sizing a shape Mouse_SetHandler() Else Program.Delay(100) EndIf EndWhile param = "move=False;up=False;" ' mouse released Mouse_SetHandler() If oFrame[func] <> "" Then Shapes.Remove(oFrame[func]) oFrame[func] = "" EndIf EndSub Sub WaitToReleaseS ' for sizing a shape ' param func - "rect", "ell", "tri" or "line" because shape index may not decided ' param mxD, myD - fixed vertex of a shape ' param mxM, myM - opposite vertex of a shape ' param angle - angle of a shape ' return mxU, myU - opposite vertex of a shape GraphicsWindow.PenWidth = 1 GraphicsWindow.PenColor = "Black" GraphicsWindow.BrushColor = "White" param = "down=False;move=True;up=True;" ' for sizing a shape / wait to release Mouse_SetHandler() moved = "True" While released = "False" If moved Then param = "move=False;" ' while sizing a shape 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;" ' for next sizing a shape Mouse_SetHandler() Else Program.Delay(100) EndIf EndWhile param = "move=False;up=False;" ' mouse released Mouse_SetHandler() If oFrame[func] <> "" Then Shapes.Remove(oFrame[func]) oFrame[func] = "" EndIf EndSub Sub WriteShapes Stack.PushValue("local", i) buf = "' " + Clock.Date + " " + Clock.Time + " Generated" buf = buf + " by " + title + CRLF buf = buf + "'" + CRLF buf = buf + "' initialize shapes" + CRLF buf = buf + "Shapes_Init()" + CRLF buf = buf + "' add shapes" + CRLF buf = buf + "scale = 1" + CRLF buf = buf + "Shapes_Add()" + CRLF buf = buf + "angle = 0" + CRLF + CRLF buf = buf + "Sub Shapes_Init" + CRLF buf = buf + " ' Shapes | Initialize shapes data" + CRLF buf = buf + " ' return shX, shY - current position of shapes" + CRLF buf = buf + " ' return shape - array of shapes" + CRLF 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"] < xmin Then xmin = shape[i]["x"] EndIf If shape[i]["y"] < ymin Then ymin = shape[i]["y"] EndIf If xmax < shape[i]["x"] Then xmax = shape[i]["x"] EndIf If ymax < shape[i]["y"] Then ymax = shape[i]["y"] EndIf EndFor buf = buf + " shX = " + xmin + " ' x offset" + CRLF buf = buf + " shY = " + ymin + " ' y offset" + CRLF buf = buf + " shape = " + WQ + WQ + CRLF For i = 1 To nShapes If shape[i]["func"] = "rect" Or shape[i]["func"] = "ell" Then buf = buf + " shape[" + i + "] = " + WQ + "func=" + shape[i]["func"] + ";" buf = buf + "x=" + (shape[i]["x"] - xmin) + ";" buf = buf + "y=" + (shape[i]["y"] - ymin) + ";" buf = buf + "width=" + shape[i]["width"] + ";" buf = buf + "height=" + shape[i]["height"] + ";" 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"] = "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 + CRLF EndFor buf = buf + "EndSub" + CRLF buf = buf + CRLF buf = buf + "Sub Shapes_Add" + CRLF buf = buf + " ' Shapes | Add shapes as shapes data" + CRLF buf = buf + " ' param shape - array of shapes" + CRLF buf = buf + " ' param scale - to zoom" + CRLF buf = buf + " ' return nShapes - number of shapes" + CRLF buf = buf + " ' return shAngle - current angle of shapes" + CRLF buf = buf + " Stack.PushValue(" + WQ + "local" + WQ + ", i)" + CRLF buf = buf + " nShapes = Array.GetItemCount(shape)" + CRLF buf = buf + " s = scale" + CRLF buf = buf + " For i = 1 To nShapes" + CRLF buf = buf + " GraphicsWindow.PenWidth = shape[i][" + WQ + "pw" + WQ + "] * s" + CRLF buf = buf + " If shape[i][" + WQ + "pw" + WQ + "] > 0 Then" + CRLF buf = buf + " GraphicsWindow.PenColor = shape[i][" + WQ + "pc" + WQ + "]" + CRLF buf = buf + " EndIf" + CRLF buf = buf + " If shape[i][" + WQ + "func" + WQ + "] = " + WQ + "rect" + WQ + " Then" + CRLF buf = buf + " GraphicsWindow.BrushColor = shape[i][" + WQ + "bc" + WQ + "]" + CRLF buf = buf + " shape[i][" + WQ + "obj" + WQ + "] = Shapes.AddRectangle(shape[i][" + WQ + "width" + WQ + "]* s, shape[i][" + WQ + "height" + WQ + "] * s)" + CRLF buf = buf + " ElseIf shape[i][" + WQ + "func" + WQ + "] = " + WQ + "ell" + WQ + " Then" + CRLF buf = buf + " GraphicsWindow.BrushColor = shape[i][" + WQ + "bc" + WQ + "]" + CRLF buf = buf + " shape[i][" + WQ + "obj" + WQ + "] = Shapes.AddEllipse(shape[i][" + WQ + "width" + WQ + "]* s, shape[i][" + WQ + "height" + WQ + "] * s)" + CRLF buf = buf + " ElseIf shape[i][" + WQ + "func" + WQ + "] = " + WQ + "tri" + WQ + " Then" + CRLF buf = buf + " GraphicsWindow.BrushColor = shape[i][" + WQ + "bc" + WQ + "]" + CRLF buf = buf + " shape[i][" + WQ + "obj" + WQ + "] = Shapes.AddTriangle(shape[i][" + WQ + "x1" + WQ + "] * s, shape[i][" + WQ + "y1" + WQ + "] * s, shape[i][" + WQ + "x2" + WQ + "] * s, shape[i][" + WQ + "y2" + WQ + "] * s, shape[i][" + WQ + "x3" + WQ + "] * s, shape[i][" + WQ + "y3" + WQ + "] * s)" + CRLF buf = buf + " ElseIf shape[i][" + WQ + "func" + WQ + "] = " + WQ + "line" + WQ + " Then" + CRLF buf = buf + " shape[i][" + WQ + "obj" + WQ + "] = Shapes.AddLine(shape[i][" + WQ + "x1" + WQ + "] * s, shape[i][" + WQ + "y1" + WQ + "] * s, shape[i][" + WQ + "x2" + WQ + "] * s, shape[i][" + WQ + "y2" + WQ + "] * s)" + CRLF buf = buf + " EndIf" + CRLF buf = buf + " Shapes.Move(shape[i][" + WQ + "obj" + WQ + "], shX + shape[i][" + WQ + "x" + WQ + "] * s, shY + shape[i][" + WQ + "y" + WQ + "] * s)" + CRLF buf = buf + " If Text.IsSubText(" + WQ + "rect|ell|tri" + WQ + ", shape[i][" + WQ + "func" + WQ + "]) And shape[i][" + WQ + "angle" + WQ + "] <> 0 Then" + CRLF buf = buf + " Shapes.Rotate(shape[i][" + WQ + "obj" + WQ + "], shape[i][" + WQ + "angle" + WQ + "])" + CRLF buf = buf + " EndIf" + CRLF buf = buf + " shape[i][" + WQ + "rx" + WQ + "] = shape[i][" + WQ + "x" + WQ + "]" + CRLF buf = buf + " shape[i][" + WQ + "ry" + WQ + "] = shape[i][" + WQ + "y" + WQ + "]" + CRLF buf = buf + " EndFor" + CRLF buf = buf + " shAngle = 0" + CRLF buf = buf + " i = Stack.PopValue(" + WQ + "local" + WQ + ")" + CRLF buf = buf + "EndSub" + CRLF ' Import GTV460-0 and insert here if you need move and rotation in output program. File_Save() 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_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_AddColorToPalette ' Color Selector | Add color to palette ' param color - color to set ' param maxPalette ' param nPalette ' param palette ' param tPalette - target palette Stack.PushValue("local", i) For i = 1 To nPalette If color = palette[i]["color"] Then Goto csactp_not_new_color EndIf EndFor palette[tPalette]["color"] = color If nPalette < maxPalette Then nPalette = nPalette + 1 EndIf tPalette = tPalette + 1 If maxPalette < tPalette Then tPalette = 1 EndIf csactp_not_new_color: i = Stack.PopValue("local") EndSub Sub CS_AdjustSlider ' Color Selector | Adjust slider ' param iSlider - moved slider Stack.PushValue("local", iSlider) If iSlider = iHue Or iSlider = iLightness Or iSlider = iSaturation Then If iSlider = iHue Then Slider_GetLevel() rHue = level ElseIf iSlider = iLightness Then Slider_GetLevel() rLightness = level / 100 Else Slider_GetLevel() rSaturation = level / 100 EndIf Color_HSLtoRGB() iSlider = iRed level = iR Slider_SetLevel() iSlider = iGreen level = iG Slider_SetLevel() iSlider = iBlue level = iB Slider_SetLevel() Else CS_GetColorFromSlider() sColor = GraphicsWindow.GetColorFromRGB(red, green, blue) Color_RGBtoHSL() If rHue = UNDEFINED Then rHue = 0 EndIf iSlider = iHue level = Math.Floor(rHue) Slider_SetLevel() iSlider = iSaturation level = Math.Floor(rSaturation * 100) Slider_SetLevel() iSlider = iLightness level = Math.Floor(rLightness * 100) Slider_SetLevel() EndIf iSlider = Stack.PopValue("local") EndSub Sub CS_DoObject ' Color Selector | Do object ' param - obj While obj <> "" CS_DoSlider() If obj <> "" Then CS_DoPalette() EndIf EndWhile EndSub Sub CS_DoPalette ' Color Selector | Do palette ' param obj - clicked object If Text.StartsWith(obj, "palette") Then iPalette = Text.GetSubTextToEnd(obj, 8) color = palette[iPalette]["color"] CS_SetColorToSlider() ' set color to slider CS_ShowNewColor() ' show new color name CS_DrawColorRect() ' draw new color rectangle obj = "" param = "down=True;move=False;up=False;" ' wait to click Mouse_SetHandler() EndIf EndSub Sub CS_DoSlider ' Color Selector | Do slider ' param obj - clicked object ' param iSlider - index of slider If Text.StartsWith(obj, "slider") Then Slider_WaitToRelease() obj = "" param = "down=True;move=False;up=False;" ' wait to click Mouse_SetHandler() EndIf EndSub Sub CS_DrawColorRect ' Color Selector | Draw color rectangle ' param color - color of rectangle ' param x, y, width, height - position and 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_DrawPalette ' Color Selector | Draw palette ' param palette[] - color palette ' param nPalette - number of color in palette ' param x, y, width, height - position and size of rectangle ' return oPalette[] - palette object array Stack.PushValue("local", i) GraphicsWindow.PenColor = BORDERCOLOR For i = 1 To nPalette GraphicsWindow.BrushColor = palette[i]["color"] palette[i]["oCell"] = Shapes.AddRectangle(width, height) dx = Math.Remainder((i - 1), 8) * (width + 4) dy = Math.Floor((i - 1) / 8) * (height + 4) Shapes.Move(palette[i]["oCell"], x + dx, y + dy) palette[i]["x"] = x + dx palette[i]["y"] = y + dy palette[i]["width"] = width palette[i]["height"] = height EndFor i = Stack.PopValue("local") EndSub Sub CS_GetColorFromSlider ' Color Selector | get color from slider ' return color Stack.PushValue("local", iSlider) iSlider = iRed ' slider index Slider_GetLevel() red = level iSlider = iGreen ' slider index Slider_GetLevel() green = level iSlider = iBlue ' slider index Slider_GetLevel() blue = level color = GraphicsWindow.GetColorFromRGB(red, green, blue) iSlider = Stack.PopValue("local") EndSub Sub CS_Init ' Color Selector | Initialize sliders width = 256 min = 0 max = 255 left = 190 ' add red slider top = TOPY caption = "R" Slider_Add() iRed = iSlider ' index of slider ' add green slider top = top + DELTAY caption = "G" Slider_Add() iGreen = iSlider ' index of slider ' add blue slider top = top + DELTAY caption = "B" Slider_Add() iBlue = iSlider ' index of slider ' add hue slider width = 360 top = top + DELTAY max = 360 caption = "H" Slider_Add() iHue = iSlider ' index of slider ' add saturation slider width = 100 top = top + DELTAY max = 100 caption = "S" Slider_Add() iSaturation = iSlider ' index of slider ' add lightness slider width = 100 top = top + DELTAY max = 100 caption = "L" Slider_Add() iLightness = iSlider ' index of slider ' draw color rectangle CS_GetColorFromSlider() CS_ShowNewColor() 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) EndSub Sub CS_DumpSlider ' Color Selector | Dump slider for debug For i = 1 To numSlider TextWindow.WriteLine("slider" + i) TextWindow.WriteLine(slider[i]) EndFor EndSub Sub CS_InitPalette ' Color Selector | Initialize palette ' This subroutine should be called before CS_ShowPopup(). pcolor = GraphicsWindow.PenColor bcolor = GraphicsWindow.BrushColor maxPalette = 16 ' max cell number of palette nPalette = 2 ' number of palette in use tPalette = 3 ' index of update target cell palette[1]["color"] = pcolor palette[2]["color"] = bcolor EndSub Sub CS_RemovePalette ' Color Selector | Remove palette ' param nPalette - number of color in palette ' return oPalette[] - palette object array Stack.PushValue("local", i) For i = 1 To nPalette oPalette = "Palette" + i Shapes.Remove(palette[i]["oCell"]) EndFor i = Stack.PopValue("local") EndSub Sub CS_RemoveSliders ' Color Selector | Remove sliders For iSlider = 1 To numSlider Slider_Remove() EndFor numSlider = 0 EndSub Sub CS_SearchClickedObject ' Color Selector | Check slider clicked ' param mxD, myD - clicked point ' return obj - clicked slider or palette ' return iSlider - index if obj is slider ' return iPalette - index if obj is palette Stack.PushValue("local", i) For iSlider = 1 To numSlider obj = "slider" + iSlider x2 = slider[iSlider]["x2"] y2 = slider[iSlider]["y2"] x3 = slider[iSlider]["x3"] y3 = slider[iSlider]["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 x2 = palette[iPalette]["x"] y2 = palette[iPalette]["y"] x3 = palette[iPalette]["x"] + palette[iPalette]["width"] y3 = palette[iPalette]["y"] + palette[iPalette]["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 ' Color Selector | Set color to slider ' param color 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 ' Color Selector | Show new color ' param oColor ' param color Shapes.SetText(oNewColor, color) EndSub Sub CS_ShowPopup ' Color Selector | Show popup ' 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 = 36 ' delta y SLITCOLOR = "#555555" TEXTCOLOR = "Black" UNDEFINED = "N/A" POPUPCOLOR = "Black" GraphicsWindow.PenWidth = 2 GraphicsWindow.PenColor = POPUPCOLOR GraphicsWindow.BrushColor = POPUPCOLOR 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() ' original color 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_SetColorToSlider() CS_DrawColorRect() ' draw new color rectangle CS_ShowNewColor() ' show new color name 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" ' continue param = "down=True;move=False;up=False;" ' wait click 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(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 CS_OnButtonClicked ' Color Selector | Event handler on button clicked cont = "False" If Controls.LastClickedButton = oCancel Then cancel = "True" Else cancel = "False" EndIf EndSub Sub File_Open ' File | Show output program to save Stack.PushValue("local", cont) TOPY = 80 ' top y LEFTX = 36 ' left x CAPTIONCOLOR = "White" POPUPCOLOR = "Black" TEXTCOLOR = "Black" GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = POPUPCOLOR oPopup = Shapes.AddRectangle(570, 310) Shapes.SetOpacity(oPopup, 64) Shapes.Move(oPopup, LEFTX - 10, TOPY - 10) GraphicsWindow.BrushColor = CAPTIONCOLOR oCaption = Shapes.AddText("Filename") Shapes.Move(oCaption, LEFTX, TOPY + 2) GraphicsWindow.BrushColor = TEXTCOLOR oFilename = Controls.AddTextBox(LEFTX + 80, TOPY) Controls.SetSize(oFilename, 300, 24) oText = Controls.AddTextBox(LEFTX, TOPY + 30) Controls.SetSize(oText, 550, 210) oOK = Controls.AddButton("OK", LEFTX + 500, TOPY + 260) Controls.ButtonClicked = File_OnButtonClicked Controls.TextTyped = File_OnTextTyped subname = "Shapes_Init" fo_retry: typed = "False" cont = "True" ' continue While cont If typed Then filename = Controls.GetTextBoxText(oFilename) SB_GetSub() typed = "False" Else Program.Delay(200) EndIf EndWhile Controls.Remove(oFilename) Controls.Remove(oText) Controls.Remove(oOK) Controls.Remove(oPopup) cont = Stack.PopValue("local") EndSub Sub File_OnTextTyped ' File | Textbox event handler typed = "True" EndSub Sub File_Save ' File | Show output program to save ' param buf - program buffer ' define constant Stack.PushValue("local", cont) TOPY = 80 ' top y LEFTX = 36 ' left x POPUPCOLOR = "Black" TEXTCOLOR = "Black" CAPTIONCOLOR = "White" GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = POPUPCOLOR oPopup = Shapes.AddRectangle(570, 310) Shapes.SetOpacity(oPopup, 64) Shapes.Move(oPopup, LEFTX - 10, TOPY - 10) GraphicsWindow.BrushColor = TEXTCOLOR oText = Controls.AddTextBox(LEFTX, TOPY) Controls.SetSize(oText, 550, 240) Controls.SetTextBoxText(oText, buf) oOK = Controls.AddButton("OK", LEFTX + 500, TOPY + 260) GraphicsWindow.BrushColor = CAPTIONCOLOR oMsg = Shapes.AddText("Click textbox above, push Ctrl+A, Ctrl+C to copy and save to your editor") Shapes.Move(oMsg, LEFTX, TOPY + 260) cont = "True" ' continue Controls.ButtonClicked = File_OnButtonClicked While cont Program.Delay(500) EndWhile Controls.Remove(oText) Controls.Remove(oMsg) Controls.Remove(oOK) Controls.Remove(oPopup) cont = Stack.PopValue("local") EndSub Sub File_OnButtonClicked ' File | Button event handler cont = "False" EndSub Sub KB_FlushFIFO ' Keyborad | Flush keyboard buffer (FIFO) For out = out + 1 To in fifok[out] = "" fifos[out] = "" fifoc[out] = "" EndFor EndSub Sub KB_InKey ' Keyboard | In key ' return c - input key 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 ' Keyboard | Initialization for Shapes (use only ^x, ^c, ^v, del and arrow keys) 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 ' Keyboard | Key down event handler 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 ' Keyboard | Key up event handler key = GraphicsWindow.LastKey If key = "LeftShift" Or key = "RightShift" Then shift = "" ElseIf key = "LeftCtrl" Or key = "RightCtrl" Then ctrl = "" EndIf 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 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 Mouse_Init ' Mouse | Initialize for common event handler clicked = "False" moved = "False" released = "False" If debug Then Timer.Interval = 200 Timer.Tick = Mouse_OnTick EndIf EndSub Sub Mouse_SetHandler ' Mouse | Set or reset common event handler ' param["down"] - "True" if set, "False" if reset ' param["move"] - "True" if set, "False" if reset ' param["up"] - - "True" if set, "False" if reset ' return clicked - "False" if set MouseDown ' return moved - "False" if set MouseMove ' return released - "False" if set MouseUp ' return dmu - which handlers are set for debug 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 ' Mouse | Common event handler on mouse down ' return mxD, myD - position on mouse down mxD = GraphicsWindow.MouseX myD = GraphicsWindow.MouseY clicked = "True" released = "False" If debug Then smrc = " clicked " + mxD + "," + myD EndIf EndSub Sub Mouse_DoNothing ' Mouse | Common event handler to do nothing EndSub Sub Mouse_OnMove ' Mouse | Common event handler on mouse move ' return mxM, myM - position on mouse move mxM = GraphicsWindow.MouseX myM = GraphicsWindow.MouseY moved = "True" If debug Then smrc = " moved " + mxM + "," + myM EndIf EndSub Sub Mouse_OnTick ' Mouse | debug routine 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 ' Mouse | Common event handler on mouse up ' return mxU, myU - position on mouse up mxU = GraphicsWindow.MouseX myU = GraphicsWindow.MouseY released = "True" If debug Then smrc = " released " + mxU + "," + myU EndIf EndSub Sub SB_GetSub ' Small Basic | Get subroutine from Small Basic source file ' param filename - file name ' param subname - subroutine name ' return buf - subroutine buffer len = Text.GetLength(subname) ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' buf = File.ReadContents(filename) ptr = 1 notFound = "True" While notFound _ptr = Text.GetIndexOf(Text.GetSubTextToEnd(buf, ptr), "Sub") If _ptr = 0 Then buf = "" Goto sbgs_exit EndIf ptrSub = ptr + _ptr - 1 ptr = ptrSub + 3 While Text.GetSubText(buf, ptr, 1) = " " ptr = ptr + 1 EndWhile If Text.GetSubText(buf, ptr, len) = subname Then notFound = "False" EndIf EndWhile _ptr = Text.GetIndexOf(Text.GetSubTextToEnd(buf, ptr), "EndSub") If _ptr = 0 Then buf = "" Goto sbgs_exit EndIf ptrEndSub = ptr + _ptr - 1 ptr = ptrEndSub + 6 len = ptr - ptrSub buf = Text.GetSubText(buf, ptrSub, len) sbgs_exit: Controls.SetTextBoxText(oText, buf) EndSub Sub Scissors_Init ' Scissors | Initialize shapes data for menu icon ' return shX, shY - current position of shapes ' return shape - array of shapes shX = 230 ' x offset shY = 30 ' y offset 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=#EEEEEE;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=#EEEEEE;pc=#0C95BB;pw=16;" EndSub Sub Shapes_Add ' Shapes | add shapes as shapes data ' param shape - array of shapes ' param iMin, iMax - shape indices to add ' 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 shape[i]["func"] = "rect" Then GraphicsWindow.BrushColor = shape[i]["bc"] shape[i]["obj"] = Shapes.AddRectangle(shape[i]["width"]* s, shape[i]["height"] * s) ElseIf shape[i]["func"] = "ell" Then GraphicsWindow.BrushColor = shape[i]["bc"] shape[i]["obj"] = Shapes.AddEllipse(shape[i]["width"]* s, shape[i]["height"] * s) ElseIf shape[i]["func"] = "tri" Then GraphicsWindow.BrushColor = shape[i]["bc"] 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) EndIf Shapes.Move(shape[i]["obj"], shX + shape[i]["x"] * s, shY + shape[i]["y"] * s) If Text.IsSubText("rect|ell|tri", shape[i]["func"]) And shape[i]["angle"] <> 0 Then Shapes.Rotate(shape[i]["obj"], shape[i]["angle"]) EndIf shape[i]["rx"] = shape[i]["x"] shape[i]["ry"] = shape[i]["y"] EndFor shAngle = 0 i = Stack.PopValue("local") EndSub Sub Shapes_CalcWidthAndHeight ' Shapes | Calculate total width and height of shapes ' param iMin, iMax - shape indices to add ' return nShapes - number of shapes ' 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_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_Move ' Shapes | Move shapes ' param shape - array of shapes ' param scale ' param x, y - position to move ' return shX, shY - new position of shapes Stack.PushValue("local", i) shX = x shY = y For i = 1 To nShapes _x = shape[i]["x"] _y = shape[i]["y"] 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 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 = 1 To nShapes param["x"] = shape[i]["x"] param["y"] = shape[i]["y"] param["width"] = shape[i]["width"] param["height"] = shape[i]["height"] Shapes_CalcRotatePos() Shapes.Move(shape[i]["obj"], shX + x * s, shY + y * s) Shapes.Rotate(shape[i]["obj"], angle) EndFor y = Stack.PopValue("local") x = Stack.PopValue("local") i = Stack.PopValue("local") EndSub Sub Slider_Add ' Slider | Add slider as shapes and property ' param width ' param caption ' param min, max ' param left, top ' return slider[] - property of slider ' return iSlider - added slider index numSlider = numSlider + 1 iSlider = numSlider ' add shapes for slider GraphicsWindow.BrushColor = CAPTIONCOLOR len = Text.GetLength(caption) slider[iSlider]["oCaption"] = Shapes.AddText(caption) Shapes.Move(slider[iSlider]["oCaption"], left - (len * 5 + 10), top + 1) level = Math.Floor((min + max) / 2) slider[iSlider]["level"] = level ' property slider[iSlider]["min"] = min slider[iSlider]["max"] = max GraphicsWindow.PenColor = BORDERCOLOR mag = (level - min) / (max - min) GraphicsWindow.BrushColor = SLITCOLOR slider[iSlider]["oSlit"] = Shapes.AddRectangle(width, 10) GraphicsWindow.PenColor = BORDERCOLOR GraphicsWindow.BrushColor = BOXCOLOR slider[iSlider]["oBox"] = Shapes.AddRectangle(10, 18) GraphicsWindow.BrushColor = CAPTIONCOLOR slider[iSlider]["oLevel"] = Shapes.AddText(level) slider[iSlider]["x0"] = left slider[iSlider]["x1"] = left + width slider[iSlider]["y0"] = top Shapes.Move(slider[iSlider]["oLevel"], left + width + 5, top) ' move and zoom shapes for slider Shapes.Move(slider[iSlider]["oSlit"], left, top + 4) Slider_SetLevel() EndSub Sub Slider_CallBack ' Slider | Call back ' param iSlider - changed slider CS_AdjustSlider() CS_GetColorFromSlider() CS_ShowNewColor() ' show new color name CS_DrawColorRect() ' draw new color rectangle EndSub Sub Slider_GetLevel ' Slider | Get latest level of slider ' param iSlider ' return level level = slider[iSlider]["level"] EndSub Sub Slider_GetMouseLevel ' Slider | Get mouse level of slider ' param iSlider ' return level x0 = slider[iSlider]["x0"] x1 = slider[iSlider]["x1"] max = slider[iSlider]["max"] min = slider[iSlider]["min"] level = min + Math.Floor((max - min) * (mxM - x0) / (x1 - x0)) EndSub Sub Slider_WaitToRelease ' Slider | Get released point for slider moving ' param iSlider param = "down=False;move=True;up=True;" ' for slider moving / wait to release Mouse_SetHandler() While released = "False" If moved Then param = "move=False;" ' while slider moving Mouse_SetHandler() x0_ = slider[iSlider]["x0"] x1_ = slider[iSlider]["x1"] If mxM < x0_ Then mxM = x0_ EndIf If x1_ < mxM Then mxM = x1_ EndIf Slider_GetMouseLevel() ' get mouse level of slider Slider_SetLevel() ' set slider level and move slider box Slider_CallBack() param = "move=True;" ' for next slider moving Mouse_SetHandler() Else Program.Delay(100) EndIf EndWhile param = "move=False;up=False;" ' mouse released Mouse_SetHandler() EndSub Sub Slider_Remove ' Slider | Remove a slider ' param iSlider Shapes.Remove(slider[iSlider]["oCaption"]) Shapes.Remove(slider[iSlider]["oSlit"]) Shapes.Remove(slider[iSlider]["oBox"]) Shapes.Remove(slider[iSlider]["oLevel"]) EndSub Sub Slider_SetLevel ' Slider | Set slider level and move slider box ' param iSlider ' param level Stack.PushValue("local", width) x0 = slider[iSlider]["x0"] x1 = slider[iSlider]["x1"] y0 = slider[iSlider]["y0"] width = x1 - x0 slider[iSlider]["level"] = level Shapes.SetText(slider[iSlider]["oLevel"], level) ' move bar min = slider[iSlider]["min"] max = slider[iSlider]["max"] mag = (level - min) / (max - min) ' move box Shapes.Move(slider[iSlider]["oBox"], x0 + Math.Floor(width * mag) - 5, y0) slider[iSlider]["x2"] = x0 + Math.Floor(width * mag) - 5 slider[iSlider]["x3"] = x0 + Math.Floor(width * mag) - 5 + 10 slider[iSlider]["y2"] = y0 slider[iSlider]["y3"] = y0 + 18 width = Stack.PopValue("local") EndSub End>LFP800.sb< Start>LFQ353.sb< GraphicsWindow.Width = "640" GraphicsWindow.Height = "480" GraphicsWindow.CanResize = "false" Turtle.Show() GraphicsWindow.Show() tuAngle = 0 TextWindow.WriteLine("Enter the amount of pixels you want Turtle to move.") start: moveAmount = Text.ConvertToLowerCase(TextWindow.Read()) If (moveAmount = "left") Then tuAngle = tuAngle + 45 Turtle.Angle = tuAngle ElseIf (moveAmount = "right") Then tuAngle = tuAngle - 45 Turtle.Angle = tuAngle Else Turtle.Move(moveAmount) EndIf If (Turtle.Y >= 480) Then Turtle.Y = 40 ElseIf (Turtle.Y <= 0) Then Turtle.Y = 480 ElseIf (Turtle.X >= 640) Then Turtle.X = 40 ElseIf (Turtle.X <= 0) Then Turtle.X = 640 EndIf Goto start End>LFQ353.sb< Start>LFR240.sb< LDGraphicsWindow.TransparentGW() mm["File"]="Main mm["New"]="File mm["Open"]="File mm["Save"]="File mm["-"]="File mm["Exit"]="File mm["Edit"]="Main mm["Replace"]="Edit GraphicsWindow.Left=5 GraphicsWindow.top=5 LDGraphicsWindow.TopMost="true Timer.Interval=250 Timer.Tick=ttt TextWindow.Left=5 TextWindow.Top=5 ms=LDControls.AddMenu(500 30 mm "" "") LDShapes.BrushColour(ms "SandyBrown") LDShapes.PenColour(ms "black") LDControls.MenuClicked=mcc LDControls.MenuBackground(ms "gold") TextWindow.BackgroundColor="darkblue TextWindow.Clear() TextWindow.Title="QBasic Editor LDTextWindow.SetColour(7 "#aaaaaa") TextWindow.ForegroundColor=7 TextWindow.WriteLine("Edit:") LDTextWindow.KeyDown=kkk LDTextWindow.Keyup=kuu not="false=true;true=false cps="false args=0 mem=LDFastArray.add() For wy=1 To 200 For wx=1 To 160 LDFastArray.set2D(mem wx wy " ") EndFor EndFor While 1=1 EndWhile Sub arrmk arr="" For wy=1 To 200 al="" For wx=1 To 158 al=Text.Append(al LDFastArray.get2D(mem wx wy)) EndFor arr=Text.Append(arr al+Text.GetCharacter(13)+Text.GetCharacter(10)) EndFor EndSub Sub arr2mm in=0 For wy=1 To 200 For wx=1 To 158 in=in+1 LDFastArray.set2D(mem wx wy text.GetSubText(arr in 1)) EndFor while text.GetCharacterCode(text.GetSubText(arr in 1))>31 in=in+1 EndWhile in=in+1 EndFor EndSub Sub twrt px=TextWindow.CursorLeft+1 py=TextWindow.CursorTop+1 txx=args[1] For rw=1 To Text.GetLength(txx) LDFastArray.Set2D(mem px+rw-1 py Text.GetSubText(txx rw 1)) EndFor TextWindow.Write(txx) EndSub Sub mcc ii=text.ConvertToLowerCase( LDControls.LastMenuItem) If ii="new" Then TextWindow.Clear() ElseIf ii="replace" Then indd="true tf=FCDialogs.AskForTextLine("text to fnd:") If tf="" Then Else tr=FCDialogs.AskForTextLine("text to replace:") arrmk() arr=LDText.Replace(arr tf tr) ' GraphicsWindow.ShowMessage(arr "") arr2mm() TextWindow.Clear() mwrt() EndIf indd="false ElseIf ii="save" Then indd="true ff=LDDialogs.saveFile("1=txt;2=bas;3=sb;4=itt" "e:\") mw=LDFastArray.ToArray(mem) ' The following line could be harmful and has been automatically commented. ' File.WriteContents(ff mw) indd="false ElseIf ii="open" Then indd="true ff=LDDialogs.OpenFile("1=txt;2=bas;3=sb;4=itt" "e:\") ' The following line could be harmful and has been automatically commented. ' If LDFile.Exists(ff) Then ' The following line could be harmful and has been automatically commented. ' cc=File.ReadContents(ff) TextWindow.Clear() If Text.IsSubText(ff ".itt") Then mem=LDFastArray.CreateFromValues(cc) mwrt() Else TextWindow.WriteLine(cc) EndIf TextWindow.Title=ff EndIf indd="False EndIf 'TextWindow.Title=ii EndSub Sub mwrt For wy=1 To 200 For wx=1 To 160 TextWindow.CursorLeft=wx-1 TextWindow.CursorTop=wy-1 TextWindow.Write(LDFastArray.Get2D(mem wx wy)) EndFor EndFor TextWindow.CursorLeft=0 TextWindow.CursorTop=0 EndSub Sub ttt GraphicsWindow.Left=TextWindow.Left/1.25 GraphicsWindow.Top=TextWindow.Top/1.25 EndSub Sub kuu lky=text.ConvertToLowerCase( LDTextWindow.LastKey) If Text.EndsWith(lky "iftkey") and not[cps] Then shh="false EndIf EndSub Sub kkk If indd Then Else lk=text.ConvertToLowerCase( LDTextWindow.LastKey) ' TextWindow.Title=lk If lk="return" Then 'TextWindow.WriteLine("") TextWindow.CursorLeft=0 TextWindow.CursorTop=TextWindow.CursorTop+1 ElseIf lk="left" Then If TextWindow.CursorLeft>0 Then TextWindow.CursorLeft=TextWindow.CursorLeft-1 EndIf ElseIf lk="down" Then TextWindow.CursorTop=TextWindow.CursorTop+1 ElseIf lk="up" Then If TextWindow.CursorTop>0 Then TextWindow.CursorTop=TextWindow.CursorTop-1 EndIf ElseIf lk="right" Then TextWindow.CursorLeft=TextWindow.CursorLeft+1 ElseIf Text.EndsWith(lk "iftkey") Then shh="true ElseIf Text.EndsWith(lk "pital") Then cps=not[cps] If CPS Then shh="true Else shh="false EndIf ElseIf lk="space" Then ldcall.function("twrt" " ") 'TextWindow.CursorLeft=TextWindow.CursorLeft-1 ElseIf lk="add" Then ldcall.function("twrt" "+") ElseIf lk="subtract" Then ldcall.function("twrt" "-") ElseIf lk="multiply" Then ldcall.function("twrt" "*") ElseIf lk="divide" Then ldcall.function("twrt" "/") ElseIf lk="back" Then If TextWindow.CursorLeft>0 Then TextWindow.CursorLeft=TextWindow.CursorLeft-1 ldcall.function("twrt" " ") TextWindow.CursorLeft=TextWindow.CursorLeft-1 EndIf Else If shh Then ldcall.function("twrt" text.ConvertToUpperCase( Text.GetSubTextToEnd(lk Text.GetLength(lk)))) Else ldcall.function("twrt" Text.GetSubTextToEnd(lk Text.GetLength(lk))) EndIf ' ldcall.function("twrt" "<") ' TextWindow.CursorLeft=TextWindow.CursorLeft-1 EndIf EndIf EndSub End>LFR240.sb< Start>LFT235.sb< GraphicsWindow.Show() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.Height = 600 GraphicsWindow.Width = 500 GraphicsWindow.CanResize = "no" GraphicsWindow.PenColor = "red" GraphicsWindow.PenWidth = 5 GraphicsWindow.Brushcolor = "red" Player = Shapes.AddRectangle(30,30) Shapes.Move(Player, 0,580) GraphicsWindow.PenColor = "white" GraphicsWindow.BrushColor = "black" Spikecount = 0 Prob = 75 Timer.Interval = 100 Timer.Tick = Spikes GraphicsWindow.KeyDown = Move Sub Move K = GraphicsWindow.LastKey If K = "Up" Then Shapes.Move(Player, Shapes.GetLeft(Player),shapes.GetTop(Player)-30) Endif If K = "Down" Then If Shapes.GetTop(Player) < 580 Then Shapes.Move(Player, Shapes.GetLeft(Player), Shapes.GetTop(Player)+30) EndIf Endif If K = "Left" Then If Shapes.GetLeft(Player) > 0 Then Shapes.Move(Player, Shapes.GetLeft(Player)-30, Shapes.GetTop(Player)) EndIf Endif If k = "Right" Then If Shapes.GetLeft(Player) < 480 Then Shapes.Move(Player, Shapes.GetLeft(Player)+30, Shapes.GetTop(Player)) EndIf Endif Endsub Sub Spikes For i = 1 To Spikecount Shapes.Move(Spikes[i],Shapes.GetLeft(Spikes[i]),Shapes.GetTop(Spikes[i])+10) EndFor num = Math.GetRandomNumber(100) If num <= Prob Then Spikecount = Spikecount + 1 X1 = Math.GetRandomNumber(670) X2 = X1 + 30 X3 = X1 + 15 Y1 = 0 Y2 = 0 Y3 = 50 Spikes[Spikecount] = Shapes.AddTriangle(X1,Y1,X2,Y2,X3,Y3) For i = 1 To Spikecount Shapes.Move(Spikes[i],Shapes.GetLeft(Spikes[i]),Shapes.GetTop(Spikes[i])+20) If Shapes.GetTop(Spikes[i]) > 600 Then Shapes.Remove(Spikes[i]) EndIf ST = Shapes.GetTop(Spikes[i])-50 PT = Shapes.GetTop(Player)-5 SL = Shapes.GetLeft(Spikes[i]) PL = Shapes.GetLeft(Player) If ST > PT And ST < PT + 40 And SL > PL And SL < PL + 40 Then Program.End() EndIf EndFor EndIf Endsub End>LFT235.sb< Start>LFT956.sb< 'Example with ideas from Dudeson creating smoke 'Use the mose to rotate (right mouse button), move and emit smoke with a left button press 'Create GraphicsWindow and TextWindow for debug output next to it gh = 600 gw = 600 GraphicsWindow.Height = gh GraphicsWindow.Width = gw TextWindow.Left = GraphicsWindow.Left + 615 TextWindow.Top = GraphicsWindow.Top Mouse.HideCursor() 'Create a circuler target for the smoke in the centre radius = 25 circle = Shapes.AddEllipse(2*radius,2*radius) circleX = gw/2 circleY = gh/2 Shapes.Move(circle,circleX-radius,circleY-radius) 'Load smoke image Steam_Skin = ImageList.LoadImage(Program.Directory + "\images\smoke1.png") Pi = Math.Pi Smoke_EmitAngle = Pi*(Emitter_Angle/180-0.5) 'Create triangular smoke emitter GraphicsWindow.BrushColor = "Black" Emitter = Shapes.AddTriangle(0,0,70,0,35,70) GraphicsWindow.PenWidth=1 While "True" TimeStart = Clock.ElapsedMilliseconds Mouse_X=GraphicsWindow.mouseX Mouse_Y=GraphicsWindow.mouseY Shapes.Move(Emitter,Mouse_X-35,Mouse_Y-35) If Mouse.IsRightButtonDown Then Emitter_Angle = Emitter_Angle+5 Smoke_EmitAngle = Pi*(Emitter_Angle/180-0.5) Shapes.Rotate(Emitter,Emitter_Angle) EndIF If Mouse.IsLeftButtonDown Then Steam_EmitDelay = Steam_EmitDelay + 1 If Steam_EmitDelay = 2 Then SteamEmitter() Steam_EmitDelay = 0 endif endif SteamCode() TextWindow.Clear() TextWindow.WriteLine("Steam Sprites: " + (Steam_New-Steam_Old)) TextWindow.WriteLine("Steam_New: " + Steam_New) TextWindow.WriteLine("Steam_Old: " + Steam_Old) 'Even spaced fps delay TimeEnd = Clock.ElapsedMilliseconds PassedTime = TimeEnd - TimeStart TextWindow.WriteLine("PassedTime: " + PassedTime) PerfectDelay = 30-PassedTime If PerfectDelay > 0 Then Program.Delay(PerfectDelay) endif endwhile Sub SteamEmitter Steam_New = Steam_New + 1 Steam[Steam_New] = Shapes.AddImage(Steam_Skin) Shapes.Move(Steam[Steam_New],-1000,-1000) Smoke_Velocity = 10+Math.GetRandomNumber(20) Steam_X[Steam_New] = Mouse_X+35*Math.Cos(Smoke_EmitAngle) Steam_Y[Steam_New] = Mouse_Y+35*Math.Sin(Smoke_EmitAngle) Steam_WX[Steam_New] = Math.Cos(Smoke_EmitAngle + (Math.GetRandomNumber(11)-6)*0.03) * Smoke_Velocity Steam_WY[Steam_New] = Math.Sin(Smoke_EmitAngle + (Math.GetRandomNumber(11)-6)*0.03) * Smoke_Velocity Steam_Opacity[Steam_New] = 100 Steam_Angle[Steam_New] = Math.GetRandomNumber(360)-180 Steam_Zoom[Steam_New] = Math.GetRandomNumber(5) * 0.1 + 0.8 endsub Sub SteamCode For s = Steam_Old+1 To Steam_New Steam_WX[s] = Steam_WX[s] * 0.95 Steam_WY[s] = Steam_WY[s] * 0.95 Steam_X[s] = Steam_X[s] + Steam_WX[s] Steam_Y[s] = Steam_Y[s] + Steam_WY[s] Steam_Angle[s] = Steam_Angle[s] + Steam_Angle[s] * 0.006 Steam_Distance[s] = math.SquareRoot((CircleX-Steam_X[s])*(CircleX-Steam_X[s])+(CircleY-Steam_Y[s])*(CircleY-Steam_Y[s])) If Steam_Distance[s] <= radius Then Collision() endif Steam_Zoom[s] = Steam_Zoom[s] + 0.1 Steam_Opacity[s] = Steam_Opacity[s] - 2 If Steam_Opacity[s] <= 0 And s = Steam_Old+1 Then RemoveSteam() endif Shapes.SetOpacity(Steam[s],Steam_Opacity[s]) Shapes.Zoom(Steam[s],Steam_Zoom[s],Steam_Zoom[s]) Shapes.Rotate(Steam[s],Steam_Angle[s]) Shapes.Move(Steam[s],Steam_X[s]-35,Steam_Y[s]-35) endfor endsub Sub RemoveSteam Shapes.Remove(Steam[s]) Steam[s] = "" Steam_X[s] = "" Steam_Y[s] = "" Steam_WX[s] = "" Steam_WY[s] = "" Steam_Opacity[s] = "" Steam_Angle[s] = "" Steam_Zoom[s] = "" Steam_Old = Steam_Old + 1 endsub sub Collision 'Make sure the starting point is outside the circle xP = Steam_X[s]-100*Steam_WX[s] yP = Steam_Y[s]-100*Steam_WY[s] 'get incedence angle (theta) from veolcity If (Steam_WX[s] = 0) Then theta = Math.Pi/2 Else theta = Math.ArcTan(Steam_WY[s]/Steam_WX[s]) EndIf If (Steam_WX[s] < 0) Then theta = theta + Math.Pi EndIf 'Get point of contact and reflection angle A = 1 B = 2*(xP-circleX)*Math.Cos(theta) + 2*(yP-circleY)*Math.Sin(theta) C = (xP-circleX)*(xP-circleX)+(yP-circleY)*(yP-circleY)-radius*radius root = B*B-4*A*C dist2 = (xP-circleX)*(xP-circleX)+(yP-circleY)*(yP-circleY)-radius*radius If (root > 0 And dist2 > 0) Then r1 = (-B+Math.SquareRoot(root))/(2*A) r2 = (-B-Math.SquareRoot(root))/(2*A) If (Math.Abs(r1) < Math.Abs(r2)) Then r = r1 Else r = r2 EndIf If (r > 0) Then ' Only do collision if moving towards circle (-r is moving away) xC = xP+r*Math.Cos(theta) yC = yP+r*Math.Sin(theta) dx = circleX-xC dy = circleY-yC If (dx = 0) Then phi = pi/2 Else phi = Math.ArcTan(dy/dx) EndIf If (dx < 0) Then phi = phi+pi EndIf psi = 2*phi-theta 'The angle psi is already correct in radians emergentangle = psi 'Don't plot the direction lines 'xR = xC-1000*Math.Cos(psi) 'yR = yC-1000*Math.Sin(psi) 'GraphicsWindow.DrawLine(xP,yP,xC,yC) 'GraphicsWindow.DrawLine(xC,yC,xR,yR) 'Reverse smoke direction using current velocity Smoke_Velocity = Math.SquareRoot(Steam_WX[s]*Steam_WX[s]+Steam_WY[s]*Steam_WY[s]) Steam_WX[s] = -Math.Cos(emergentangle) * Smoke_Velocity Steam_WY[s] = -Math.Sin(emergentangle) * Smoke_Velocity EndIf EndIf endsub End>LFT956.sb< Start>LFV355-0.sb< GraphicsWindow.Width = 600 GraphicsWindow.Height = 700 GraphicsWindow.Top = 20 GraphicsWindow.Left = Desktop.Width / 4 tag = "puppies" isAlready = 1 loadflick = 1 Timer.Interval = 1000 Timer.Tick = loadingtick Timer.Pause() getnewphotos() buttonClickedEvent = "False" mousseUpEvent = "False" Controls.ButtonClicked = butclicked GraphicsWindow.MouseUp = mouseUp While ("True") If (buttonClickedEvent) Then buttonClickedEvent = "False" buttonClickedWork() EndIf If (mousseUpEvent) Then mousseUpEvent = "False" mouseUpWork() EndIf Program.Delay(10) EndWhile Sub getgui GraphicsWindow.PenWidth = 3 GraphicsWindow.PenColor = "Red" GraphicsWindow.DrawLine(199, 0, 199, 600) GraphicsWindow.DrawLine(0, 199, 600, 199) GraphicsWindow.DrawLine(401, 0, 401, 600) GraphicsWindow.DrawLine(0, 401, 600, 401) GraphicsWindow.DrawLine(0, 601, 600, 601) pupButton = Controls.AddButton("Get new puppy pics", 5, 665) Controls.SetSize(pupButton, 160, 30) christmasButton = Controls.AddButton("Get new christmas pics", 435, 665) Controls.SetSize(christmasButton, 160, 30) GraphicsWindow.DrawBoundText(175, 665, 250, "Click a thumbnail picture to enlarge it. Click again to minimize.") EndSub Sub butclicked buttonClickedEvent = "True" EndSub Sub buttonClickedWork loadflick = 1 butclickedX = GraphicsWindow.MouseX butclickedY = GraphicsWindow.MouseY If butclickedY > 664 And butclickedY < 696 Then If butclickedX > 4 And butclickedX < 166 Then tag = "puppies" getnewphotos() ElseIf butclickedX > 434 And butclickedX < 696 Then tag = "christmas" getnewphotos() EndIf EndIf EndSub Sub mouseUp mouseUpEvent = "True" EndSub Sub mouseUpWork loadflick = 2 mouseX = GraphicsWindow.MouseX mouseY = GraphicsWindow.MouseY xLeft = 29 xRight = 81 isAlready = isAlready + 1 If Math.Remainder(isAlready, 2) = 0 Then If mouseY > 609 And mouseY < 661 Then For i = 1 To 9 If mouseX > xLeft And mouseX < xRight Then GraphicsWindow.DrawResizedImage(newpicks[i], 0, 0, 600, 600) EndIf xLeft = xLeft + 60 xRight = xRight + 60 EndFor EndIf ElseIf Math.Remainder(isAlready, 2) = 1 Then getnewphotos() EndIf EndSub Sub getnewphotos txt = "Loading Images" GraphicsWindow.Clear() getgui() If loadflick = 1 Then loading = Shapes.AddText(txt) Shapes.Move(loading, 240, 290) LDUtilities.PauseUpdates() LDUtilities.ResumeUpdates() Timer.Resume() For i = 1 To 9 image = Flickr.GetRandomPicture(tag) newpicks[i] = ImageList.LoadImage(image) EndFor Shapes.Remove(loading) Timer.Pause() EndIf r = 1 p = 3 y = 0 smallX = 30 For z = 1 To 3 x = 0 w = 198 h = 198 For i = r To p GraphicsWindow.DrawResizedImage(newpicks[i], x, y, w, h) x = (x + w) + 3 EndFor y = y + 201 r = r + 3 p = p + 3 EndFor For i = 1 To 9 GraphicsWindow.DrawResizedImage(newpicks[i], smallX, 610, 50, 50) smallX = smallX + 60 EndFor EndSub Sub loadingtick If txt = "Loading Images..." Then txt = "Loading Images" Shapes.SetText(loading, txt) Else txt = txt + "." Shapes.SetText(loading, txt) EndIf EndSub End>LFV355-0.sb< Start>LFV355.sb< GraphicsWindow.Width = 600 GraphicsWindow.Height = 700 GraphicsWindow.Top = 20 GraphicsWindow.Left = Desktop.Width / 4 tag = "puppies" isAlready = 1 loadflick = 1 Timer.Interval = 1000 Timer.Tick = loadingtick Timer.Pause() Sub getgui GraphicsWindow.PenWidth = 3 GraphicsWindow.PenColor = "Red" GraphicsWindow.DrawLine(199, 0, 199, 600) GraphicsWindow.DrawLine(0, 199, 600, 199) GraphicsWindow.DrawLine(401, 0, 401, 600) GraphicsWindow.DrawLine(0, 401, 600, 401) GraphicsWindow.DrawLine(0, 601, 600, 601) pupButton = Controls.AddButton("Get new puppy pics", 5, 665) Controls.SetSize(pupButton, 160, 30) christmasButton = Controls.AddButton("Get new christmas pics", 435, 665) Controls.SetSize(christmasButton, 160, 30) GraphicsWindow.DrawBoundText(175, 665, 250, "Click a thumbnail picture to enlarge it. Click again to minimize.") EndSub getnewphotos() Controls.ButtonClicked = butclicked GraphicsWindow.MouseUp = mouseUp Sub butclicked loadflick = 1 butclickedX = GraphicsWindow.MouseX butclickedY = GraphicsWindow.MouseY If butclickedY > 664 And butclickedY < 696 Then If butclickedX > 4 And butclickedX < 166 Then tag = "puppies" getnewphotos() ElseIf butclickedX > 434 And butclickedX < 696 Then tag = "christmas" getnewphotos() EndIf EndIf EndSub Sub mouseUp loadflick = 2 mouseX = GraphicsWindow.MouseX mouseY = GraphicsWindow.MouseY xLeft = 29 xRight = 81 isAlready = isAlready + 1 If Math.Remainder(isAlready, 2) = 0 Then If mouseY > 609 And mouseY < 661 Then For i = 1 To 9 If mouseX > xLeft And mouseX < xRight Then GraphicsWindow.DrawResizedImage(newpicks[i], 0, 0, 600, 600) EndIf xLeft = xLeft + 60 xRight = xRight + 60 EndFor EndIf ElseIf Math.Remainder(isAlready, 2) = 1 Then getnewphotos() EndIf EndSub Sub getnewphotos text = "Loading Images" GraphicsWindow.Clear() getgui() If loadflick = 1 Then loading = Shapes.AddText(text) Shapes.Move(loading, 240, 290) Timer.Resume() For i = 1 To 9 newpicks[i] = ImageList.LoadImage(Flickr.GetRandomPicture(tag)) EndFor Shapes.Remove(loading) Timer.Pause() EndIf r = 1 p = 3 y = 0 smallX = 30 For z = 1 To 3 x = 0 w = 198 h = 198 For i = r To p GraphicsWindow.DrawResizedImage(newpicks[i], x, y, w, h) x = (x + w) + 3 EndFor y = y + 201 r = r + 3 p = p + 3 EndFor For i = 1 To 9 GraphicsWindow.DrawResizedImage(newpicks[i], smallX, 610, 50, 50) smallX = smallX + 60 EndFor EndSub Sub loadingtick If text = "Loading Images..." Then text = "Loading Images" Shapes.SetText(loading, text) Else text = text + "." Shapes.SetText(loading, text) EndIf EndSub End>LFV355.sb< Start>LFW944.sb< GameInit() Intro() Options() PlayGame() GameOverSub() '--------------------------------------------------------------------------- Sub GameInit 'setup the key and mouse subroutines GraphicsWindow.KeyDown = KeyDownEvent GraphicsWindow.MouseDown = MouseDownEvent GraphicsWindow.MouseUp = MouseUpEvent 'if the user has sound files, they should be stored in the same directory as the exe file Path = Program.Directory 'set the screen size and title bar GraphicsWindow.Width = 700 GraphicsWindow.Height = 500 ScreenX = GraphicsWindow.Width ScreenY = GraphicsWindow.Height GraphicsWindow.Title = "Small Basic Gorillas version 2.0" ScreenCenter = GraphicsWindow.Width / 2 'X and Y are used to draw text and set the position of other things X = 0 Y = 0 'a switch to allow certain actions only at the desired times ScreenType = "Intro" 'can be Intro, Options, Round, GameOver 'using text.getsubtext, we can easily convert decimal to hex. usually to set a color Hex = "0123456789ABCDEF" 'see fadetoblack subroutine for use 'total number of rounds to play NumberRounds = 3 'a switch to toggle the sound on and off SoundOnOff = "Off" 'the banana is effected by gravity which can be set on the options screen GravityArray[1]["Text"] = "1/16x" GravityArray[1]["Value"] = 0.6125 GravityArray[2]["Text"] = "1/8x" GravityArray[2]["Value"] = 1.225 GravityArray[3]["Text"] = "1/4x" GravityArray[3]["Value"] = 2.45 GravityArray[4]["Text"] = "1/2x" GravityArray[4]["Value"] = 4.9 GravityArray[5]["Text"] = "1x" GravityArray[5]["Value"] = 9.8 GravityArray[6]["Text"] = "2x" GravityArray[6]["Value"] = 19.6 GravityArray[7]["Text"] = "3x" GravityArray[7]["Value"] = 29.4 GravityArray[8]["Text"] = "4x" GravityArray[8]["Value"] = 39.2 'start with gravity at 9.8 meters per second squared (gravity near earth's surface) GravityLevel = 5 Gravity = GravityArray[GravityLevel]["Value"] 'used to place the building and other objects GroundLevel = GraphicsWindow.Height - 20 'by sliding the city buildings to the left a little, the edges of the city match better CityOffset = 20 'how large a radius the explosion will be ExplosionSize = 24 'each building has 5 to 20 floors, the number of floors is multiplied by floor height to calculate the height of the building FloorHeight = 15 'the building sizes are 40, 50 and 60; we add 10, 20 or 30 to the defaultwidth to set the width BuildingDefaultWidth = 30 WindowWidth = 4 WindowHeight = 6 WindowWidthOffset = 3 WindowHeightOffset = 4 'get images from the internet 'because the speed of intenet connections vary, we give them a message of what is happening GraphicsWindow.FontSize = 24 GraphicsWindow.BrushColor = "#000000" GraphicsWindow.DrawText(ScreenX / 2 - 175, ScreenY / 3, "Please wait while images are") GraphicsWindow.DrawText(ScreenX / 2 - 195, ScreenY / 3 + 30, "downloaded from the Internet...") GorillaArmsDown = ImageList.LoadImage("http://smallbasic.com/drop/gorilla/GorillaArmsDown.bmp") GorillaLeftUp = ImageList.LoadImage("http://smallbasic.com/drop/gorilla/GorillaLeftUp.bmp") GorillaRightUp = ImageList.LoadImage("http://smallbasic.com/drop/gorilla/GorillaRightUp.bmp") GorillaVictory = ImageList.LoadImage("http://smallbasic.com/drop/gorilla/GorillaVictory.bmp") 'if you have the images downloaded, you can comment the above lines and use these instead 'GorillaArmsDown = ImageList.LoadImage(Path + "\GorillaArmsDown.bmp") 'GorillaLeftUp = ImageList.LoadImage(Path + "\GorillaLeftUp.bmp") 'GorillaRightUp = ImageList.LoadImage(Path + "\GorillaRightUp.bmp") 'GorillaVictory = ImageList.LoadImage(Path + "\GorillaVictory.bmp") 'prepare for the next screen FadeToBlack() 'set up both gorillas For I = 1 To 2 GorillaArray[I]["Name"] = "Gorilla " + I GorillaArray[I]["Image"] = GorillaArmsDown If (I = 1) Then GorillaArray[I]["ThrowImage"] = GorillaRightUp Else GorillaArray[I]["ThrowImage"] = GorillaLeftUp EndIf GorillaArray[I]["Angle"] = 0 GorillaArray[I]["Velocity"] = 0 GorillaArray[I]["X"] = 0 GorillaArray[I]["Y"] = 0 GorillaArray[I]["Score"] = 0 EndFor GorillaWidth = ImageList.GetWidthOfImage(GorillaArray[1]["Image"]) GorillaHeight = ImageList.GetHeightOfImage(GorillaArray[1]["Image"]) 'there are four animations drawn to rotate the banana Banana["Frame"] = 1 Banana["X"] = 0 Banana["Y"] = 0 BananaSize = 4 SunMouth = "Smile" 'smile or 'O' face EndSub '--------------------------------------------------------------------------- Sub Intro GraphicsWindow.BackgroundColor = "#000000" GraphicsWindow.FontSize = 16 GraphicsWindow.BrushColor = "#FFFFFF" GraphicsWindow.DrawText(ScreenCenter - 100, Y + 30, "Small Basic G O R I L L A S") GraphicsWindow.DrawText(ScreenCenter - 220, Y + 60, "Your mission is to hit your opponent with the exploding") GraphicsWindow.DrawText(ScreenCenter - 238, Y + 80, "banana by varing the angle and power of your throw, taking") GraphicsWindow.DrawText(ScreenCenter - 215, Y + 100, "into account wind speed, gravity, and the city skyline.") GraphicsWindow.DrawText(ScreenCenter - 245, Y + 120, "The wind speed is shown by a directional arrow at the bottom") GraphicsWindow.DrawText(ScreenCenter - 210, Y + 140, "of the playing field, its length relative to its strength.") GraphicsWindow.DrawText(ScreenCenter - 106, Y + 180, "To skip intro, press any key") BuildingInit() DrawCity() WaitForKeypress() FadeToBlack() EndSub '--------------------------------------------------------------------------- Sub Options ScreenType = "Options" OptionThrowing = "False" GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "#000000" GraphicsWindow.FontSize = 24 GraphicsWindow.BrushColor = "#FFFFFF" GraphicsWindow.DrawText(ScreenCenter - 50, Y + 30, "Options") GraphicsWindow.FontSize = 16 GraphicsWindow.BrushColor = "#4169E1" GraphicsWindow.DrawText(ScreenCenter - 110, Y + 65, "Press any key to continue.") 'gravity box GraphicsWindow.FontSize = 24 GraphicsWindow.BrushColor = "#4169E1" GraphicsWindow.DrawText(100, 118, "Gravity") GraphicsWindow.BrushColor = "#0000FF" GraphicsWindow.PenColor = "#4169E1" GraphicsWindow.FillRectangle(100, 150, 200, 240) GraphicsWindow.DrawRectangle(99, 149, 202, 242) GraphicsWindow.DrawLine(100, 348, 300, 348) For I = 1 To 8 GraphicsWindow.DrawRectangle(20, I * 30 + 120, 79, 30) EndFor UpdateGravity() 'create a small area of the screen and test the gravity by letting the gorilla throw the banana Thrower = 1 GorillaArray[Thrower]["X"] = 105 GorillaArray[Thrower]["Y"] = 347 - GorillaHeight GorillaArray[Thrower]["Angle"] = 45 GorillaArray[Thrower]["Velocity"] = 45 Banana["X"] = GorillaArray[Thrower]["X"] Banana["Y"] = GorillaArray[Thrower]["Y"] Wind = 0 GraphicsWindow.DrawImage(GorillaArray[Thrower]["Image"],GorillaArray[Thrower]["X"],GorillaArray[Thrower]["Y"]) 'there is a problem when calling throwbanana subroutine while in the waitingforkeypress loop 'until a work-around is found, only throw the banana once 'GraphicsWindow.BrushColor = "#FFFFFF" 'GraphicsWindow.PenColor = "#4169E1" 'GraphicsWindow.FillRectangle(151, 351, 146, 36) 'GraphicsWindow.DrawRectangle(151, 351, 146, 36) 'GraphicsWindow.BrushColor = "#4169E1" 'GraphicsWindow.FontSize = 16 'GraphicsWindow.DrawText(175, 360, "Test gravity") 'sound GraphicsWindow.FontSize = 24 GraphicsWindow.DrawRectangle(525, 150, 150, 100) GraphicsWindow.DrawText(560, 155, "Sound") 'draw boxes around 'on' and 'off' GraphicsWindow.DrawRectangle(537, 200, 50, 40) GraphicsWindow.DrawRectangle(613, 200, 50, 40) DrawSoundButtons() 'round GraphicsWindow.BrushColor = "#4169E1" GraphicsWindow.FontSize = 16 GraphicsWindow.DrawRectangle(525, 300, 150, 100) GraphicsWindow.DrawText(555, 305, "Number of") GraphicsWindow.DrawText(545, 325, "rounds to play") 'draw two rectangles to create three boxes GraphicsWindow.DrawRectangle(535, 350, 130, 40) GraphicsWindow.DrawRectangle(575, 350, 50, 40) 'draw left and right triangle GraphicsWindow.DrawTriangle(565, 360, 565, 380, 545, 370) GraphicsWindow.DrawTriangle(635, 360, 635, 380, 655, 370) DrawNumberRounds() 'gorilla names GraphicsWindow.FontSize = 16 GraphicsWindow.BrushColor = "#4169E1" 'we were going to allow the user to change the names, but problems arose and until, fixed comment out 'GraphicsWindow.DrawText(345, 250, "Click the gorilla's") 'GraphicsWindow.DrawText(348, 270, "name to change") DrawNames() 'throw the banana one time ThrowBanana() EraseBanana() 'allow mouseclicks until user presses a key WaitForKeypress() 'we didn't set thrower in gameinit because it would have messed up options screen, but now we can set it 'don't always let player 1 throw first Thrower = Math.GetRandomNumber(2) EndSub '--------------------------------------------------------------------------- Sub PlayGame ScreenType = "Round" For NR = 1 to NumberRounds 'draw a new screen and city FadeToBlue() BuildingInit() DrawCity() 'reset all images SunMouth = "Smile" DrawSun() PlaceGorillas() DrawGorillas() UpdateScore() 'continue a round until a gorilla is hit with a banana GorillaHit = "False" While (GorillaHit = "False") 'since 3 - 1 = 2 and 3 - 2 = 1, this will swap the thrower and target Thrower = 3 - Thrower TargetGorilla = 3 - Thrower AimBanana() ThrowBanana() 'if the sun was hit on the previous shot reset to smile If (SunMouth = "O") Then SunMouth = "Smile" SunHit = "False" DrawSun() EndIf EndWhile EndFor 'wait a second before we clear the screen (in gameoversub) Program.Delay(1000) GameOverSub() EndSub '--------------------------------------------------------------------------- Sub GameOverSub ScreenType = "GameOver" FadeToBlue() If (Key <> "Y" And SoundOnOff = "On") Then Sound.Play(Path + "\multi_ending.wav") EndIf BuildingInit() DrawCity() 'place gorillas GorillaArray[1]["X"] = ScreenCenter - 100 GorillaArray[1]["Y"] = ScreenY / 2 + 5 GorillaArray[2]["X"] = ScreenCenter + 100 GorillaArray[2]["Y"] = ScreenY / 2 + 5 DrawGorillas() 'announce a winner GraphicsWindow.FontSize = 16 GraphicsWindow.BrushColor = "#FFFFFF" GraphicsWindow.DrawText(ScreenCenter - 60, ScreenY / 2 - 100, "And the Winner is...") Program.Delay(1500) If (GorillaArray[1]["Score"] > GorillaArray[2]["Score"]) Then GraphicsWindow.DrawText(ScreenCenter - 35, ScreenY / 2 - 75, "Player One!") GorillaArray[1]["Image"] = GorillaVictory ElseIf (GorillaArray[1]["Score"] < GorillaArray[2]["Score"]) Then GraphicsWindow.DrawText(ScreenCenter - 34, ScreenY / 2 - 80, "Player Two!") GorillaArray[2]["Image"] = GorillaVictory ElseIf (GorillaArray[1]["Score"] = GorillaArray[2]["Score"]) Then GraphicsWindow.DrawText(ScreenCenter - 30, ScreenY / 2 - 80, "Its a Tie!!") GorillaArray[1]["Image"] = GorillaLeftUp GorillaArray[2]["Image"] = GorillaRightUp EndIf 'draw the victorious gorilla DrawGorillas() If (SoundOnOff = "On") Then Program.Delay(2000) Sound.Stop(Path + "\multi_ending.wav") Sound.Play(Path + "\monkey2.wav") EndIf Program.Delay(1500) GraphicsWindow.DrawText(ScreenCenter - 34, ScreenY / 2 - 40, "Game Over") Program.Delay(1500) GraphicsWindow.DrawText(ScreenCenter - 75, ScreenY / 2 - 20, "Press any key to exit") Sound.Stop(Path + "\monkey2.wav") WaitForKeypress() Program.End() EndSub '--------------------------------------------------------------------------- Sub BuildingInit 'I seperated the BuildingInit from RoundInit() to add a nice graphic to Intro() 'CitySize is a counter of the number of pixels used to draw the screen 'if CitySize is greater than the screensize then screen is full CitySize = 0 'how many buildings were we able to fit on the screen 'used also to place gorilla 2 Building = 0 While (CitySize <= ScreenX - 10) Building = Building + 1 'if the game is over, make a row of buildings to announce winner If (ScreenType = "GameOver") Then CityArray[Building]["Height"] = 13 * FloorHeight Else 'there are 15 different heights, pick one and multipy it by size of each floor CityArray[Building]["Height"] = (Math.GetRandomNumber(15)+5) * FloorHeight EndIf 'this varies the size of the buildings from sizes 40, 50, 60 CityArray[Building]["Width"] = (Math.GetRandomNumber(3) * 10) + BuildingDefaultWidth 'store the left hand side of the building in X, placing the gorillas will be easier CityArray[Building]["X"] = CitySize 'the extra 2 is a offset so the buildings are not so close together CitySize = CitySize + 2 + CityArray[Building]["Width"] EndWhile 'setup the lights, some are on and some are off 'The maximum number of windows per building is 20 floors * 6 windows per floor = 120 For I = 1 To 121 LightArray[I] = Math.GetRandomNumber(2) If (LightArray[I] = 2) Then LightArray[I] = "#F0E68C" Else LightArray[I] = "#808080" EndIf EndFor EndSub '--------------------------------------------------------------------------- Sub PlaceGorillas 'place gorillas on either side of the screen BuildingNumber = Math.GetRandomNumber(3) + 1 GorillaArray[1]["X"] = CityArray[BuildingNumber]["X"] + (CityArray[BuildingNumber]["Width"] / 2) - (GorillaWidth / 2) - CityOffset + 5 GorillaArray[1]["Y"] = GroundLevel - CityArray[BuildingNumber]["Height"] - GorillaHeight - 1 BuildingNumber = Building - 1 - Math.GetRandomNumber(2) GorillaArray[2]["X"] = CityArray[BuildingNumber]["X"] + (CityArray[BuildingNumber]["Width"] / 2) - (GorillaWidth / 2) GorillaArray[2]["Y"] = GroundLevel - CityArray[BuildingNumber]["Height"] - GorillaHeight - 1 EndSub '--------------------------------------------------------------------------- Sub AimBanana GraphicsWindow.FontSize = 16 GraphicsWindow.BrushColor = "#000000" GraphicsWindow.PenColor = "#4169E1" If (Thrower = 1) Then GraphicsWindow.FillRectangle(10, 15, 120, 72) GraphicsWindow.DrawRectangle(10, 15, 120, 72) Else GraphicsWindow.FillRectangle(ScreenX - 130, 15, 120, 72) GraphicsWindow.DrawRectangle(ScreenX - 130, 15, 120, 72) EndIf GraphicsWindow.BrushColor = "#FFFFFF" If (Thrower = 1) Then GraphicsWindow.DrawText(16, 20, GorillaArray[Thrower]["Name"]) GraphicsWindow.DrawText(16, 40, "Angle:") GetNumberVariable = "Angle" GetNumber() GraphicsWindow.DrawText(70, 40, GorillaArray[Thrower]["Angle"]) GraphicsWindow.DrawText(16, 60, "Velocity:") GetNumberVariable = "Velocity" GetNumber() GraphicsWindow.DrawText(90, 60, GorillaArray[Thrower]["Velocity"]) Else GraphicsWindow.DrawText(ScreenX - 124, 20, GorillaArray[Thrower]["Name"]) GraphicsWindow.DrawText(ScreenX - 124, 40, "Angle:") GetNumberVariable = "Angle" GetNumber() GraphicsWindow.DrawText(ScreenX - 70, 40, GorillaArray[Thrower]["Angle"]) GraphicsWindow.DrawText(ScreenX - 124, 60, "Velocity:") GetNumberVariable = "Velocity" GetNumber() GraphicsWindow.DrawText(ScreenX - 50, 60, GorillaArray[Thrower]["Velocity"]) EndIf Program.Delay(500) GraphicsWindow.BrushColor = "#0000FF" If (Thrower = 1) Then GraphicsWindow.FillRectangle(9, 14, 122, 74) Else GraphicsWindow.FillRectangle(ScreenX - 131, 14, 122, 74) EndIf Program.Delay(500) EndSub '--------------------------------------------------------------------------- Sub ThrowBanana 'mirror gorilla2's angle, so it throws in the correct direction If (Thrower = 2) Then GorillaArray[2]["Angle"] = 90 + (90 - GorillaArray[2]["Angle"]) EndIf BananaStartX = GorillaArray[Thrower]["X"] + GorillaWidth / 2 BananaStartY = GorillaArray[Thrower]["Y"] - GorillaHeight - 15 Banana["Frame"] = 1 'draw gorilla throwing banana GraphicsWindow.DrawImage(GorillaArray[Thrower]["ThrowImage"],GorillaArray[Thrower]["X"],GorillaArray[Thrower]["Y"]) Program.Delay(500) GraphicsWindow.DrawImage(GorillaArray[Thrower]["Image"],GorillaArray[Thrower]["X"],GorillaArray[Thrower]["Y"]) 'loop until we hit something OnScreen = "True" WhatWasHit = "Nothing" T = 0.0 While (WhatWasHit = "Nothing") 'erase old banana If (OnScreen = "True" And Banana["Y"] > 5 And T > 0) Then EraseBanana() EndIf 'advance time T = T + 0.1 'Move banana to new position MoveBanana() If (ScreenType = "Options") Then If (Banana["X"] <= 110 Or Banana["Y"] <= 200 Or Banana["X"] >= 290 Or Banana["Y"] >= 390) Then WhatWasHit = "OptionScreenBounds" EraseBanana() Goto ContactMade EndIf DrawBanana() Program.Delay(30) 'skip down to bottom of loop to avoid unneeded collision checking Goto ContactMade EndIf 'check for off screen left right or is the banana too low If (Banana["X"] <= 5 Or Banana["X"] >= (ScreenX - 5) Or Banana["Y"] > GroundLevel) Then WhatWasHit = "OutOfBounds" OnScreen = "False" Goto ContactMade EndIf 'is the banana to high to see, but still between left and right margins If (Banana["Y"] < 5) Then OnScreen = "False" Else OnScreen = "True" EndIf 'if the banana is not to high, draw it If (OnScreen = "True" And Banana["Y"] > 10) Then DrawBanana() EndIf Program.Delay(15) 'to avoid targetinvocation errors, check if banana is onscreen, goto offscreen label if it is not If (OnScreen = "False") Then Goto OffScreen EndIf 'check for collisions 'did we hit the sun BananaUnderSun = "False" If (Banana["X"] >= SunX - 21 And Banana["X"] <= SunX + 21 And Banana["Y"] >= SunY - 21 And Banana["Y"] <= SunY + 21) Then If (SunMouth = "Smile" And SoundOnOff = "On") Then Sound.Play(Path + "\ouch.wav") Endif 'the sun is shocked it got hit SunMouth = "O" 'DoSun() 'Sun is redrawn in erasebanana subroutine SunHit = "True" BananaUnderSun = "True" 'contact made, but continue 'Goto ContactMade EndIf For I = 1 To 2 If (Banana["X"] + BananaSize >= GorillaArray[I]["X"] And Banana["X"] - BananaSize <= GorillaArray[I]["X"] + GorillaWidth And Banana["Y"] + BananaSize >= GorillaArray[I]["Y"] And Banana["Y"] - BananaSize <= GorillaArray[I]["Y"] + GorillaHeight) Then 'if g2 hit g1 or g1 hit itself - g2 scores point WhatWasHit = "Gorilla" GorillaHit = "True" Dancer = 3 - I EraseBanana() 'center the explosion on the gorilla Banana["X"] = GorillaArray[I]["X"] + GorillaWidth / 3 - 1 Banana["Y"] = GorillaArray[I]["Y"] + GorillaHeight / 2 DoExplosion() GorillaArray[Dancer]["Score"] = GorillaArray[Dancer]["Score"] + 1 VictoryDance() Goto ContactMade EndIf EndFor 'did we hit anything else - building If (Banana["Frame"] = 1) Then BananaPX1 = 0 BananaPY1 = -4 BananaPX2 = 5 BananaPY2 = 7 EndIf If (Banana["Frame"] = 2) Then BananaPX1 = -4 BananaPY1 = 0 BananaPX2 = 7 BananaPY2 = -5 EndIf If (Banana["Frame"] = 3) Then BananaPX1 = -2 BananaPY1 = -4 BananaPX2 = 3 BananaPY2 = 7 EndIf If (Banana["Frame"] = 4) Then BananaPX1 = -4 BananaPY1 = -2 BananaPX2 = 7 BananaPY2 = 3 EndIf For GUY = Banana["Y"] + BananaPY1 To Banana["Y"] + BananaPY2 For GUX = Banana["X"] + BananaPX1 To Banana["X"] + BananaPX2 CheckColor = GraphicsWindow.GetPixel(GUX, GUY) If (CheckColor = "#00FFFF" Or CheckColor = "#CD5C5C" Or CheckColor = "#00FF7F" Or CheckColor = "#4169E1" Or CheckColor = "#F0E68C" Or CheckColor = "#808080") Then WhatWasHit = "Object" EraseBanana() DoMiniExplosion() If (CheckColor = "#F0E68C" Or CheckColor = "#808080") Then 'shatter glass ShatterGlass = "True" EndIf Goto ContactMade EndIf EndFor EndFor OffScreen: ContactMade: EndWhile Sound.Stop(Path + "\ouch.wav") EndSub '--------------------------------------------------------------------------- Sub MoveBanana RadianAngle = Math.GetRadians(GorillaArray[Thrower]["Angle"]) InitXVel = Math.Round(Math.Cos(RadianAngle) * GorillaArray[Thrower]["Velocity"]) InitYVel = Math.Round(Math.Sin(RadianAngle) * GorillaArray[Thrower]["Velocity"]) Banana["X"] = Math.Round(BananaStartX + (InitXVel * T) + (0.5 * (Wind / 5) * (T * T))) If (ScreenType = "Options") Then 'the ground level is different on the options screen Banana["Y"] = Math.Round(BananaStartY + ((-1 * (InitYVel * T)) + (0.5 * Gravity * (T * T)) + (250 / 35))) Else Banana["Y"] = Math.Round(BananaStartY + ((-1 * (InitYVel * T)) + (0.5 * Gravity * (T * T)) + (GroundLevel / 35 ))) EndIf If (Banana["Y"] < 1) Then Banana["Y"] = 1 EndIf EndSub '--------------------------------------------------------------------------- Sub DrawCity 'CitySize is now just used as a counter to draw the actual landscape 'I offset it by -20 so both sides of the screen would look similar CitySize = 0 - CityOffset For BC = 1 To Building BW = CityArray[BC]["Width"] BH = CityArray[BC]["Height"] WBH = Math.Round(BH / 15 - 1) WBW = Math.Round(BW / 10) 'add a little color so everything doesn't look the same BuildingColor = Math.GetRandomNumber(3) If (BuildingColor = 1) Then GraphicsWindow.BrushColor = "#CD5C5C" ElseIf (BuildingColor = 2) Then GraphicsWindow.BrushColor = "#00FF7F" ElseIf (BuildingColor = 3) Then GraphicsWindow.BrushColor = "#00FFFF" EndIf If (ScreenType = "Intro") Then 'make the color a little transparent GraphicsWindow.BrushColor = "#44" + Text.GetSubTextToEnd(GraphicsWindow.BrushColor, 2) 'Draw the building GraphicsWindow.FillRectangle(CitySize, GroundLevel - BH, BW, BH) 'I added an outline to make the buildings look better GraphicsWindow.PenColor = "#444169E1" Else 'Draw the building GraphicsWindow.FillRectangle(CitySize, GroundLevel - BH, BW, BH) 'I added an outline to make the buildings look better GraphicsWindow.PenColor = "#4169E1" Endif GraphicsWindow.DrawRectangle(CitySize, GroundLevel - BH, BW, BH) 'as we draw each building we also draw the windows 'the size of the building determines how many windows it has For WH = 1 To WBH For WW = 1 To WBW GraphicsWindow.BrushColor = LightArray[WH * WW] If (ScreenType = "Intro") Then 'make the color a little transparent GraphicsWindow.BrushColor = "#44" + Text.GetSubTextToEnd(GraphicsWindow.BrushColor, 2) Endif 'draw the window GraphicsWindow.FillRectangle(CitySize - 5 + (WW * WindowWidthOffset * 3), GroundLevel - 4 - (FloorHeight * WH), WindowWidth, WindowHeight) EndFor EndFor CitySize = CitySize + 4 + CityArray[BC]["Width"] EndFor SetWind() EndSub '--------------------------------------------------------------------------- Sub SetWind 'this code is very similar to the original 'create wind Wind = Math.GetRandomNumber(10) - 5 If (Math.GetRandomNumber(3) = 2) Then If (Wind > 0) Then Wind = Wind + Math.GetRandomNumber(10) Else Wind = Wind - Math.GetRandomNumber(10) EndIf EndIf 'draw wind speed arrow below the city GraphicsWindow.PenColor = "#FF0000" If (Wind <> 0) Then WindLine = Wind * 3 * (ScreenX / 320) GraphicsWindow.DrawLine(ScreenCenter, ScreenY - 10, ScreenCenter + WindLine, ScreenY - 10) If (Wind > 0) Then ArrowDir = -4 Else ArrowDir = 4 EndIf GraphicsWindow.DrawLine(ScreenCenter + WindLine, ScreenY - 10, ScreenCenter + WindLine + ArrowDir, ScreenY - 10 - 4) GraphicsWindow.DrawLine(ScreenCenter + WindLine, ScreenY - 10, ScreenCenter + WindLine + ArrowDir, ScreenY - 10 + 4) Else 'if there's no wind tell them GraphicsWindow.FontSize = 12 GraphicsWindow.BrushColor = "#FF0000" GraphicsWindow.DrawText(ScreenCenter - 24, ScreenY - 18, "No Wind") EndIf EndSub '--------------------------------------------------------------------------- Sub DrawSun 'set position of sun SunX = ScreenCenter SunY = 60 'clear old sun GraphicsWindow.BrushColor = "#0000FF" GraphicsWindow.FillRectangle(SunX - 20, SunY - 20, 40, 40) 'draw new sun 'body GraphicsWindow.BrushColor = "#FFFF00" GraphicsWindow.FillEllipse(SunX -15, SunY -15, 30, 30) 'rays GraphicsWindow.PenColor = "#FFFF00" GraphicsWindow.DrawLine(SunX, SunY - 20, SunX, SunY + 20) GraphicsWindow.DrawLine(SunX - 20, SunY, SunX + 20, SunY) GraphicsWindow.DrawLine(SunX - 14, SunY - 14, SunX + 14, SunY + 14) GraphicsWindow.DrawLine(SunX - 14, SunY + 14, SunX + 14 , SunY - 14) GraphicsWindow.DrawLine(SunX - 8, SunY - 18, SunX + 8, SunY + 18) GraphicsWindow.DrawLine(SunX - 8, SunY + 18, SunX + 8 , SunY - 18) GraphicsWindow.DrawLine(SunX - 18, SunY - 8, SunX + 18, SunY + 8) GraphicsWindow.DrawLine(SunX - 18, SunY + 8, SunX + 18 , SunY - 8) 'mouth If (SunMouth = "Smile") Then GraphicsWindow.PenColor = "#000000" GraphicsWindow.DrawLine(SunX -6, SunY +4, SunX -5, SunY +7) GraphicsWindow.DrawLine(SunX -4, SunY +7, SunX +4, SunY +7) GraphicsWindow.DrawLine(SunX +5, SunY +7, SunX +6, SunY +4) Else 'O mouth GraphicsWindow.BrushColor = "#000000" GraphicsWindow.FillEllipse(SunX -3, SunY + 3, 6, 6) EndIf 'eyes GraphicsWindow.BrushColor = "#000000" GraphicsWindow.FillEllipse(SunX -6, SunY -5, 3, 3) GraphicsWindow.FillEllipse(SunX +4, SunY -5, 3, 3) EndSub '--------------------------------------------------------------------------- Sub DrawGorillas GraphicsWindow.DrawImage(GorillaArray[1]["Image"], GorillaArray[1]["X"], GorillaArray[1]["Y"]) GraphicsWindow.DrawImage(GorillaArray[2]["Image"], GorillaArray[2]["X"], GorillaArray[2]["Y"]) EndSub '--------------------------------------------------------------------------- Sub DrawBanana 'draw Banana - yellow color GraphicsWindow.BrushColor = "#FFFF00" If (Banana["Frame"] = 1) Then GraphicsWindow.FillRectangle(Banana["X"], Banana["Y"], 2, 4) GraphicsWindow.FillRectangle(Banana["X"] + 2, Banana["Y"] - 2, 2, 8) GraphicsWindow.FillRectangle(Banana["X"] + 4, Banana["Y"] - 4, 2, 4) GraphicsWindow.FillRectangle(Banana["X"] + 4, Banana["Y"] + 4, 2, 4) EndIf 'upward pointing ^ banana If (Banana["Frame"] = 2) Then 'rotate the banana the right way If (Thrower = 1) Then GraphicsWindow.FillRectangle(Banana["X"] - 4, Banana["Y"] + 4, 4, 2) GraphicsWindow.FillRectangle(Banana["X"] - 2, Banana["Y"] + 2, 8, 2) GraphicsWindow.FillRectangle(Banana["X"], Banana["Y"], 4, 2) GraphicsWindow.FillRectangle(Banana["X"] + 4, Banana["Y"] + 4, 4, 2) Else GraphicsWindow.FillRectangle(Banana["X"] - 4, Banana["Y"] - 2, 4, 2) GraphicsWindow.FillRectangle(Banana["X"] + 4, Banana["Y"] - 2, 4, 2) GraphicsWindow.FillRectangle(Banana["X"] - 2, Banana["Y"], 8, 2) GraphicsWindow.FillRectangle(Banana["X"], Banana["Y"] + 2, 4, 2) EndIf EndIf 'right pointing ) banana If (Banana["Frame"] = 3) Then GraphicsWindow.FillRectangle(Banana["X"] - 2, Banana["Y"] - 4, 2, 4) GraphicsWindow.FillRectangle(Banana["X"], Banana["Y"] - 2, 2, 8) GraphicsWindow.FillRectangle(Banana["X"] + 2, Banana["Y"], 2, 4) GraphicsWindow.FillRectangle(Banana["X"] - 2, Banana["Y"] + 4, 2, 4) EndIf 'downward pointing V banana If (Banana["Frame"] = 4) Then 'rotate the banana the right way If (Thrower = 1) Then GraphicsWindow.FillRectangle(Banana["X"] - 4, Banana["Y"] - 2, 4, 2) GraphicsWindow.FillRectangle(Banana["X"] + 4, Banana["Y"] - 2, 4, 2) GraphicsWindow.FillRectangle(Banana["X"] - 2, Banana["Y"], 8, 2) GraphicsWindow.FillRectangle(Banana["X"], Banana["Y"] + 2, 4, 2) Else GraphicsWindow.FillRectangle(Banana["X"] - 4, Banana["Y"] + 4, 4, 2) GraphicsWindow.FillRectangle(Banana["X"] - 2, Banana["Y"] + 2, 8, 2) GraphicsWindow.FillRectangle(Banana["X"], Banana["Y"], 4, 2) GraphicsWindow.FillRectangle(Banana["X"] + 4, Banana["Y"] + 4, 4, 2) EndIf EndIf EndSub '--------------------------------------------------------------------------- Sub EraseBanana 'erase banana - blue color GraphicsWindow.BrushColor = "#0000FF" If (Banana["Frame"] = 1) Then GraphicsWindow.FillRectangle(Banana["X"], Banana["Y"], 2, 4) GraphicsWindow.FillRectangle(Banana["X"] + 2, Banana["Y"] - 2, 2, 8) GraphicsWindow.FillRectangle(Banana["X"] + 4, Banana["Y"] - 4, 2, 4) GraphicsWindow.FillRectangle(Banana["X"] + 4, Banana["Y"] + 4, 2, 4) EndIf 'upward pointing ^ banana If (Banana["Frame"] = 2) Then 'rotate the banana the right way If (Thrower = 1) Then GraphicsWindow.FillRectangle(Banana["X"] - 4, Banana["Y"] + 4, 4, 2) GraphicsWindow.FillRectangle(Banana["X"] - 2, Banana["Y"] + 2, 8, 2) GraphicsWindow.FillRectangle(Banana["X"], Banana["Y"], 4, 2) GraphicsWindow.FillRectangle(Banana["X"] + 4, Banana["Y"] + 4, 4, 2) Else GraphicsWindow.FillRectangle(Banana["X"] - 4, Banana["Y"] - 2, 4, 2) GraphicsWindow.FillRectangle(Banana["X"] + 4, Banana["Y"] - 2, 4, 2) GraphicsWindow.FillRectangle(Banana["X"] - 2, Banana["Y"], 8, 2) GraphicsWindow.FillRectangle(Banana["X"], Banana["Y"] + 2, 4, 2) EndIf EndIf 'right pointing ) banana If (Banana["Frame"] = 3) Then GraphicsWindow.FillRectangle(Banana["X"] - 2, Banana["Y"] - 4, 2, 4) GraphicsWindow.FillRectangle(Banana["X"], Banana["Y"] - 2, 2, 8) GraphicsWindow.FillRectangle(Banana["X"] + 2, Banana["Y"], 2, 4) GraphicsWindow.FillRectangle(Banana["X"] - 2, Banana["Y"] + 4, 2, 4) EndIf 'downward pointing V banana If (Banana["Frame"] = 4) Then 'rotate the banana the right way If (Thrower = 1) Then GraphicsWindow.FillRectangle(Banana["X"] - 4, Banana["Y"] - 2, 4, 2) GraphicsWindow.FillRectangle(Banana["X"] + 4, Banana["Y"] - 2, 4, 2) GraphicsWindow.FillRectangle(Banana["X"] - 2, Banana["Y"], 8, 2) GraphicsWindow.FillRectangle(Banana["X"], Banana["Y"] + 2, 4, 2) Else GraphicsWindow.FillRectangle(Banana["X"] - 4, Banana["Y"] + 4, 4, 2) GraphicsWindow.FillRectangle(Banana["X"] - 2, Banana["Y"] + 2, 8, 2) GraphicsWindow.FillRectangle(Banana["X"], Banana["Y"], 4, 2) GraphicsWindow.FillRectangle(Banana["X"] + 4, Banana["Y"] + 4, 4, 2) EndIf EndIf 'goto the next frame in the animation Banana["Frame"] = Banana["Frame"] + 1 'if at the last animation frame, reset If (Banana["Frame"] > 4) then Banana["Frame"] = 1 EndIf 'redraw sun if banana is near If (BananaUnderSun = "True") Then DrawSun() EndIf EndSub '--------------------------------------------------------------------------- Sub DoMiniExplosion 'if the banana hits something other than the gorilla, just make a small explosion If (SoundOnOff = "On") Then Sound.Play(Path + "\Explo Classic.wav") EndIf 'erase the Banana EraseBanana() GraphicsWindow.BrushColor = "#B22222" For C = 1 To ExplosionSize - 5 GraphicsWindow.FillEllipse(Banana["X"] - C / 4, Banana["Y"] - C / 4, C , C) Program.Delay(25) EndFor GraphicsWindow.BrushColor = "#0000FF" 'add 1 to cleanup explosion For C = 1 To ExplosionSize - 4 GraphicsWindow.FillEllipse(Banana["X"] - C / 4, Banana["Y"] - C / 4, C, C) Program.Delay(25) EndFor Sound.Stop(Path + "\Explo Classic.wav") If (ShatterGlass = "True" And SoundOnOff = "On") Then Sound.Play(Path + "\glass_shatter_c.wav") Program.Delay(1100) Sound.Stop(Path + "\glass_shatter_c.wav") ShatterGlass = "False" EndIf EndSub '--------------------------------------------------------------------------- Sub DoExplosion If (SoundOnOff = "On") Then Sound.Play(Path + "\bigboom.wav") EndIf GraphicsWindow.BrushColor = "#B22222" For C = 1 To ExplosionSize GraphicsWindow.FillEllipse(Banana["X"] - C , Banana["Y"] - C , C * 3 , C * 2) Program.Delay(25) EndFor GraphicsWindow.BrushColor = "#0000FF" 'add 1 to cleanup explosion For C = 1 To ExplosionSize + 1 GraphicsWindow.FillEllipse(Banana["X"] - C , Banana["Y"] - C , C * 3 , C * 2) Program.Delay(25) EndFor Sound.Stop(Path + "\bigboom.wav") EndSub '--------------------------------------------------------------------------- Sub VictoryDance 'Dancer = who does victory dance If (Dancer = 1) Then VX = GorillaArray[1]["X"] VY = GorillaArray[1]["Y"] Else VX = GorillaArray[2]["X"] VY = GorillaArray[2]["Y"] EndIf If (SoundOnOff = "On") Then Sound.Play(Path + "\monkey2.wav") EndIf For VD = 1 To 6 GraphicsWindow.DrawImage(GorillaLeftUp, VX, VY) Program.Delay(200) GraphicsWindow.DrawImage(GorillaRightUp, VX, VY) Program.Delay(200) EndFor Sound.Stop(Path + "\monkey2.wav") UpdateScore() EndSub '--------------------------------------------------------------------------- Sub UpdateScore 'write players names GraphicsWindow.FontSize = 12 GraphicsWindow.BrushColor = "#FFFFFF" GraphicsWindow.DrawText(20, ScreenY - 17, GorillaArray[1]["Name"]) GraphicsWindow.DrawText(ScreenX - 90, ScreenY - 17, GorillaArray[2]["Name"]) 'drawtext score GraphicsWindow.FontSize = 16 GraphicsWindow.BrushColor = "#0000FF" GraphicsWindow.FillRectangle(ScreenCenter - 55, ScreenY - 60, 125, 20) GraphicsWindow.PenColor = "#4169E1" GraphicsWindow.DrawRectangle(ScreenCenter - 55, ScreenY - 60, 125, 20) GraphicsWindow.BrushColor = "#FFFFFF" ScoreLength = Text.GetLength(GorillaArray[1]["Score"] + "> Score <" + GorillaArray[2]["Score"]) GraphicsWindow.DrawText(ScreenCenter - (ScoreLength * 4.5) + 5, ScreenY - 60, GorillaArray[1]["Score"] + "> Score <" + GorillaArray[2]["Score"]) EndSub '--------------------------------------------------------------------------- Sub UpdateAngleVelocity If (Thrower = 1) Then If (GetNumberVariable = "Angle") Then GraphicsWindow.BrushColor = "#000000" GraphicsWindow.FillRectangle(70, 40, 55, 20) GraphicsWindow.BrushColor = "#FFFFFF" GraphicsWindow.DrawText(70, 40, UserNumber) Else GraphicsWindow.BrushColor = "#000000" GraphicsWindow.FillRectangle(90, 60, 35, 20) GraphicsWindow.BrushColor = "#FFFFFF" GraphicsWindow.DrawText(90, 60, UserNumber) EndIf Else If (GetNumberVariable = "Angle") Then GraphicsWindow.BrushColor = "#000000" GraphicsWindow.FillRectangle(ScreenX - 70, 40, 55, 20) GraphicsWindow.BrushColor = "#FFFFFF" GraphicsWindow.DrawText(ScreenX - 70, 40, UserNumber) Else GraphicsWindow.BrushColor = "#000000" GraphicsWindow.FillRectangle(ScreenX - 50, 60, 35, 20) GraphicsWindow.BrushColor = "#FFFFFF" GraphicsWindow.DrawText(ScreenX - 50, 60, UserNumber) EndIf EndIf EndSub '--------------------------------------------------------------------------- Sub UpdateGravity GraphicsWindow.FontSize = 16 For I = 1 To 8 GraphicsWindow.BrushColor = "#000000" GraphicsWindow.DrawText(85 - Text.GetLength(GravityArray[I]["Text"])*10, I * 30 + 125, GravityArray[I]["Text"]) If (GravityLevel = I) Then GraphicsWindow.BrushColor = "#00FF00" Gravity = GravityArray[I]["Value"] Else GraphicsWindow.BrushColor = "#4169E1" EndIf GraphicsWindow.DrawText(85 - Text.GetLength(GravityArray[I]["Text"])*10, I * 30 + 125, GravityArray[I]["Text"]) EndFor EndSub '--------------------------------------------------------------------------- Sub DrawSoundButtons GraphicsWindow.FontSize = 24 If (SoundOnOff = "On") Then GraphicsWindow.BrushColor = "#00FF00" Else GraphicsWindow.BrushColor = "#4169E1" EndIf GraphicsWindow.DrawText(545, 205, "On") If (SoundOnOff = "Off") Then GraphicsWindow.BrushColor = "#00FF00" Else GraphicsWindow.BrushColor = "#4169E1" EndIf GraphicsWindow.DrawText(618, 205, "Off") EndSub '--------------------------------------------------------------------------- Sub DrawNumberRounds DrawingNumberRounds = "True" Program.Delay(100) For I = 12 To 32 Step 2 GraphicsWindow.BrushColor = "#000000" GraphicsWindow.FillRectangle(576, 351, 48, 38) GraphicsWindow.FontSize = I GraphicsWindow.BrushColor = "#FFFFFF" If (Text.GetLength(NumberRounds) = 1) Then GraphicsWindow.DrawText(600 - (I * 0.3125), 370 - (I * 0.625), NumberRounds) Else GraphicsWindow.DrawText(600 - (I * 0.625), 370 - (I * 0.625), NumberRounds) EndIf Program.Delay(50) EndFor DrawingNumberRounds = "False" EndSub '--------------------------------------------------------------------------- Sub DrawNames GraphicsWindow.BrushColor = "#FFFFFF" For I = 1 to 2 If (GorillaArray[I]["Name"] <> Text.Append("Gorilla ", I)) Then GraphicsWindow.DrawText(413 - Text.GetLength(GorillaArray[I]["Name"]) * 5, I * 113 + (I * I * 25) + 30, GorillaArray[I]["Name"]) EndIf GraphicsWindow.BrushColor = "#000000" GraphicsWindow.FillRectangle(326, I * 120 + 70 + 1, 173, 38) GraphicsWindow.BrushColor = "#FFFFFF" GraphicsWindow.DrawRectangle(325, I * 120 + 70, 175, 40) GraphicsWindow.DrawText(413 - Text.GetLength(GorillaArray[I]["Name"]) * 5, I * 120 + 80, GorillaArray[I]["Name"]) EndFor EndSub '--------------------------------------------------------------------------- 'Sub UpdateNewName 'EndSub '--------------------------------------------------------------------------- Sub FadeToBlack 'fade to black For I = 1 to 10 Step 0.5 HexText = Text.GetSubText(Hex, Math.Round(I), 1) GraphicsWindow.BrushColor = "#" + HexText + HexText + "000000" GraphicsWindow.FillRectangle(0,0,GraphicsWindow.Width, GraphicsWindow.Height) EndFor EndSub '--------------------------------------------------------------------------- Sub FadeToBlue 'fade to blue For I = 1 to 10 Step 0.5 HexText = Text.GetSubText(Hex, Math.Round(I), 1) GraphicsWindow.BrushColor = "#" + HexText + HexText + "0000FF" GraphicsWindow.FillRectangle(0,0,GraphicsWindow.Width, GraphicsWindow.Height) EndFor EndSub '--------------------------------------------------------------------------- Sub ConfirmQuit 'ask user to confirm they want to quit 'display question just under sun so we don't mess up any other graphics GraphicsWindow.BrushColor = "#000000" GraphicsWindow.PenColor = "#4169E1" GraphicsWindow.FillRectangle(ScreenCenter - 100, 80, 200, 40) GraphicsWindow.DrawRectangle(ScreenCenter - 100, 80, 200, 40) GraphicsWindow.BrushColor = "#FFFFFF" GraphicsWindow.DrawText(ScreenCenter - 20, 80, "Quit") GraphicsWindow.DrawText(ScreenCenter - 75, 100, "Are you sure? Y/N") If (SoundOnOff = "On") Then Sound.Play(Path + "\homerquit.wav") EndIf WaitForKeypress() If (Key = "Y") Then GameOverSub() Else 'erase box and continue playing GraphicsWindow.BrushColor = "#0000FF" 'make a box slightly bigger to erase question GraphicsWindow.FillRectangle(ScreenCenter - 101, 79, 202, 42) EndIf Sound.Stop(Path + "\homerquit.wav") EndSub '--------------------------------------------------------------------------- 'Sub GetName 'EndSub '--------------------------------------------------------------------------- Sub GetNumber Key = "" 'reset key. if last key pressed was return, the user will not be able to enter data UserNumber = 0 While (Key <> "RETURN") WaitForKeypress() 'match keypresses to actions If (Key = "ESCAPE") Then ConfirmQuit() ElseIf (Key = "BACK") Then UserNumber = Math.Floor(UserNumber / 10) UpdateAngleVelocity() Else 'convert numbers (D1 or Numpad1 become 1), stored in keytonumber KeyToNumber = Text.GetSubTextToEnd(Key, Text.GetLength(Key)) For I = 0 to 9 If (KeyToNumber = I) Then UserNumber = UserNumber * 10 + KeyToNumber UpdateAngleVelocity() Endif EndFor EndIf EndWhile If (GetNumberVariable = "Angle") Then GorillaArray[Thrower]["Angle"] = UserNumber ElseIf (GetNumberVariable = "Velocity") Then GorillaArray[Thrower]["Velocity"] = UserNumber EndIf EndSub '--------------------------------------------------------------------------- Sub WaitForKeypress WaitingForKey = "True" While (WaitingForKey = "True") 'the keydownevent will change waitingforkey, so nothing needs to be done here EndWhile EndSub '--------------------------------------------------------------------------- Sub MouseDownEvent 'store MouseX and MouseY MX = GraphicsWindow.MouseX MY = GraphicsWindow.MouseY 'TextWindow.WriteLine("Mouse: " + MX + ":" + MY) EndSub '--------------------------------------------------------------------------- Sub MouseUpEvent If (ScreenType = "Options") Then If (OptionThrowing = "False") Then 'test gravity button If (MX >= 151 And MY >= 351 And MX <= 299 And MY <= 389) Then 'an error occurs when we call this routine. until it is fixed, comment it out 'throw banana again 'ThrowBanana() 'EraseBanana() EndIf EndIf 'let the user choose between eight different settings for gravity If (OptionThrowing = "False") Then For I = 1 To 8 If (MX >= 20 And MY >= I * 30 + 120 And MX <= 100 And MY <= I * 30 + 150) Then GravityLevel = I UpdateGravity() EndIf EndFor EndIf 'sound buttons If (MX >= 537 And MY >= 200 And MX <= 587 And MY <= 240) Then If (SoundOnOff = "Off") Then SoundOnOff = "On" DrawSoundButtons() EndIf ElseIf (MX >= 613 And MY >= 200 And MX <= 663 And MY <= 240) Then If (SoundOnOff = "On") Then SoundOnOff = "Off" DrawSoundButtons() EndIf EndIf 'number rounds button If (DrawingNumberRounds = "False") Then If (MX >= 535 And MY >= 350 And MX <= 575 And MY <= 390) Then If (NumberRounds > 2) Then NumberRounds = NumberRounds - 1 Endif DrawNumberRounds() ElseIf (MX >= 625 And MY >= 350 And MX <= 665 And MY <= 390) Then If (NumberRounds < 17) Then NumberRounds = NumberRounds + 1 Endif DrawNumberRounds() EndIf EndIf 'name buttons If (MX >= 325 And MY >= 190 And MX <= 500 And MY <= 230) Then 'change gorilla 1 name Thrower = 1 'we were going to allow the user to change the names, but problems arose and until, fixed comment out 'GetName() ElseIf (MX >= 325 And MY >= 310 And MX <= 500 And MY <= 350) Then 'change gorilla 2 name Thrower = 2 'we were going to allow the user to change the names, but problems arose and until, fixed comment out 'GetName() EndIf EndIf EndSub '--------------------------------------------------------------------------- Sub KeyDownEvent 'the user pressed something, so set waitingforkey to false, but allow user to change gorilla names in options screen WaitingForKey = "False" 'get the key that was pressed and convert to uppercase Key = Text.ConvertToUpperCase(GraphicsWindow.LastKey) 'allow the user to turn the sound on/off at any time If (Key = "S") Then If (SoundOnOff = "On") Then SoundOnOff = "Off" Else SoundOnOff = "On" EndIf EndIf 'skip intro screen If (ScreenType = "Intro") Then 'set BC to building so we stop drawing the city, which is slow at the beginning but speeds up later 'also set WH to WBH BC = Building WH = WBH WW = WBW 'wait a bit to catch up to waitingforkeypress Program.Delay(600) 'set waiting to false so we goto options WaitingForKey = "False" EndIf 'skip options screen If (ScreenType = "Options") Then 'skip options EraseBanana() WhatWasHit = "Keypress" 'wait a bit to catch up to waitingforkeypress Program.Delay(600) 'set waiting to false so we goto options WaitingForKey = "False" EndIf EndSub End>LFW944.sb< Start>LFZ195.sb< GraphicsWindow.BackgroundColor="teal GraphicsWindow.PenColor="teal GraphicsWindow.BrushColor="white GraphicsWindow.Width=1600 GraphicsWindow.Height=660 GraphicsWindow.Title="La linea walking..." GraphicsWindow.Left=0 GraphicsWindow.PenWidth=0 shapes.Move(Shapes.AddRectangle (1760 15) 460 460) shapes.Move(Shapes.AddRectangle (1500 15), -1250 460) pnn=1222 ff[1]=";475,425;478,419;483,413;485,407;488,400;491,394;493,387;495,381;497,374;498,367;499,360;499,353;499,346;498,339;497,332;496,325;495,318;494,311;493,305;491,298;493,291;498,286;505,284;512,283;518,281;524,277;529,272;534,267;538,261;541,255;544,248;546,242;547,235;548,228;547,221;547,214;545,207;543,200;541,193;538,188;535,181;531,175;527,170;522,165;517,160;512,155;506,150;501,146;495,143;488,140;482,136;476,133;470,130;463,128;456,125;450,123;443,121;436,120;430,118;423,117;416,116;409,115;402,114;395,114;388,114;381,114;374,114;367,115;360,116;353,117;346,119;340,121;333,123;326,125;320,128;314,131;308,135;301,138;296,142;291,147;287,153;284,160;282,166;282,173;284,180;287,187;291,192;296,197;301,201;307,205;314,207;321,209;327,210;334,211;341,212;347,216;350,222;353,229;352,235;348,241;342,244;337,249;333,255;329,261;326,267;323,273;320,279;316,286;314,292;310,298;307,305;304,311;301,317;298,324;296,330;293,336;291,343;287,349;285,356;282,362;279,369;277,375;273,381;270,388;268,394;265,401;263,407;261,414;258,421;256,427;254,434;252,440;250,447;246,453;241,457;235,461;229,465;224,470;218,473;212,477;207,482;203,488;200,494;197,500;194,507;191,513;189,520;185,526;179,529;172,529;166,525;159,522;153,520;146,519;139,518;133,522;131,529;132,536;134,542;138,548;141,554;145,560;149,566;154,571;155,578;153,585;148,589;141,591;135,589;130,583;125,578;119,575;112,574;105,573;98,573;91,573;84,573;77,573;70,573;63,573;56,573;49,573;42,575;38,580;35,587;35,594;39,599;45,603;52,604;59,605;66,605;73,605;80,605;87,605;94,605;101,605;108,605;115,605;122,605;129,605;136,605;143,606;150,607;157,607;164,608;171,608;178,608;185,608;192,608;199,608;206,608;213,608;218,603;217,596;215,590;210,584;205,579;200,574;196,569;191,564;186,559;184,552;185,546;190,541;197,539;204,540;211,539;216,535;221,530;224,524;227,517;230,511;232,505;236,499;242,495;248,491;254,488;260,484;266,481;272,477;277,472;280,466;283,459;285,452;287,446;289,439;292,433;294,426;296,419;299,413;301,406;303,400;306,393;309,387;311,380;314,374;316,367;319,361;321,354;323,347;326,341;329,334;331,328;335,322;337,315;340,309;342,302;345,296;348,289;351,283;353,277;356,270;359,264;362,258;368,254;375,254;382,253;389,251;396,249;402,247;408,244;415,240;421,237;426,232;431,228;436,223;441,217;446,212;450,207;453,200;456,194;456,187;450,185;443,186;437,189;431,192;425,197;419,200;413,204;407,207;400,210;394,211;387,212;380,209;376,204;375,197;372,191;366,187;359,186;352,185;345,185;338,185;331,184;324,182;318,180;312,176;309,170;309,163;312,157;319,154;326,153;333,152;340,152;346,150;353,150;360,149;367,149;374,149;381,149;388,149;395,149;402,149;409,151;416,151;423,152;430,154;437,156;443,157;450,159;457,162;463,165;469,168;475,171;481,175;487,179;492,183;498,188;503,192;508,198;512,203;515,209;518,216;519,223;519,230;518,237;515,243;511,249;507,255;502,259;496,264;490,267;484,270;478,273;472,277;468,283;466,290;466,297;466,304;466,311;467,318;468,325;468,332;469,339;469,346;469,353;470,360;469,366;467,373;465,380;462,386;459,392;456,399;453,405;450,412;447,418;444,424;441,431;438,437;436,444;436,451;436,458;436,465;436,472;437,478;438,485;438,492;439,499;440,506;441,513;442,520;444,527;448,532;454,537;460,540;467,542;473,544;480,546;487,547;494,550;498,555;503,560;507,566;511,571;515,577;518,583;522,589;526,595;530,601;535,605;542,608;549,609;555,610;562,610;569,610;576,610;583,609;590,609;597,608;604,608;611,608;618,608;625,608;632,609;639,607;643,601;646,595;647,588;642,582;636,579;630,577;623,576;616,576;609,576;602,576;595,575;588,575;581,575;574,575;567,575;560,574;554,569;551,563;547,557;543,552;539,546;535,540;531,534;528,528;523,523;517,519;510,517;503,516;497,514;490,513;483,511;478,507;475,500;474,493;473,486;472,480;470,473;469,466;469,459;470,452;472,445;475,439;477,433 ff[2]=";473,425;476,419;482,415;487,410;490,404;493,397;496,391;498,384;499,377;499,370;499,363;499,356;499,349;499,342;498,335;497,328;496,321;496,314;494,307;493,300;492,294;491,287;490,280;489,273;490,266;492,259;494,252;495,245;497,239;496,232;492,226;491,219;493,213;496,206;501,202;507,199;514,198;521,197;528,195;535,194;541,192;547,188;553,184;557,178;561,172;563,166;563,159;561,152;559,145;555,139;551,134;545,129;540,125;534,121;528,117;522,114;515,112;509,109;502,108;495,106;488,105;481,103;474,103;467,103;460,103;453,104;446,104;439,104;432,105;425,106;419,108;412,110;405,112;399,115;392,117;386,120;380,124;373,126;367,129;361,133;356,137;350,141;344,146;339,150;334,156;330,161;325,166;321,172;317,178;314,184;311,190;308,197;306,203;305,210;304,217;304,224;304,231;305,238;306,245;308,252;311,258;314,264;318,270;320,277;318,284;315,290;312,296;309,303;306,309;303,315;301,322;298,328;295,335;292,341;289,347;286,354;284,360;282,367;279,374;277,380;275,387;273,393;271,400;267,406;265,413;263,420;261,426;259,433;257,440;255,446;254,453;252,460;248,466;243,470;237,474;230,477;225,481;218,485;213,488;206,492;201,496;197,502;195,509;192,515;190,522;187,528;185,535;183,542;180,548;174,552;167,553;161,550;154,548;148,546;141,544;134,543;128,547;127,554;128,561;130,567;134,573;138,579;142,585;146,590;150,596;151,603;148,609;143,614;136,614;129,611;125,606;119,602;112,600;106,599;99,599;92,599;85,599;78,599;71,599;64,599;57,599;50,599;43,600;38,606;36,612;35,619;40,625;46,628;53,629;60,630;67,630;74,631;81,631;88,631;95,630;102,630;109,631;116,631;123,631;130,631;137,631;144,631;151,631;158,631;165,631;172,632;179,632;186,632;193,632;200,632;207,631;213,628;214,621;212,614;209,608;205,603;200,597;196,592;191,587;189,580;191,573;196,569;203,567;208,563;212,557;215,550;217,544;220,537;222,531;224,524;228,518;234,514;240,511;246,507;252,504;258,500;264,497;270,493;275,488;279,482;282,476;284,469;285,462;288,456;289,449;291,442;293,435;294,428;297,422;299,415;302,409;304,402;306,395;308,389;310,382;312,375;314,369;317,362;320,356;322,349;325,343;328,336;330,330;333,324;336,317;338,311;342,304;344,298;347,291;350,285;353,279;353,272;350,265;346,260;342,254;338,248;335,242;332,235;332,228;333,222;334,215;336,208;339,202;342,196;346,190;351,184;356,179;361,175;367,171;373,168;379,165;386,162;392,159;398,155;405,153;411,150;418,148;425,146;432,145;438,143;445,142;452,141;459,140;466,140;473,138;480,138;487,137;494,138;501,139;508,140;515,141;521,144;527,148;532,152;535,159;536,166;532,172;526,176;519,176;512,176;505,177;498,177;491,176;484,176;478,174;471,172;464,171;457,169;451,167;444,166;441,173;443,180;446,186;451,191;456,196;461,201;463,207;462,214;458,220;452,223;445,222;439,219;436,212;436,205;433,199;429,194;423,190;417,185;412,181;406,177;401,172;394,174;391,180;391,187;393,194;396,201;399,207;403,212;408,218;413,222;419,227;424,231;431,234;437,237;443,239;450,241;457,242;463,246;467,252;467,259;464,265;462,272;462,279;462,285;463,292;463,299;463,306;463,313;464,320;464,327;465,334;466,341;466,348;466,355;467,362;466,369;465,376;463,383;461,390;459,396;456,403;453,409;450,415;447,422;444,428;441,434;438,441;435,447;432,453;431,460;430,467;430,474;430,481;430,488;431,495;432,502;432,509;433,516;434,523;435,530;436,537;437,544;440,550;444,555;450,560;456,563;462,566;468,569;475,572;482,574;488,576;494,580;499,584;504,589;509,595;513,600;517,606;521,612;524,618;528,624;534,628;541,630;548,631;555,632;562,632;569,632;575,632;582,632;589,632;596,632;603,632;610,632;617,632;624,632;631,632;638,632;645,632;652,632;659,632;666,633;673,633;680,633;687,631;691,625;694,619;694,612;690,606;684,603;677,601;670,600;663,600;656,600;649,600;642,600;635,600;628,600;621,600;614,600;607,600;600,600;593,600;586,600;579,600;572,600;565,599;558,599;553,595;549,589;545,584;540,578;536,573;531,567;527,562;521,557;516,552;511,548;505,545;498,543;491,541;484,540;478,537;472,533;470,527;467,520;467,513;465,506;464,499;463,492;463,485;461,479 ff[3]=";310,425;307,419;303,413;297,409;295,402;293,395;291,389;290,382;289,375;287,368;287,361;289,354;292,348;295,342;298,336;302,330;305,323;308,317;312,311;315,305;318,298;320,292;322,285;323,278;323,271;322,264;321,258;319,251;317,244;316,237;314,231;316,224;322,221;328,217;334,213;339,208;343,202;346,196;348,189;349,182;349,175;349,168;346,162;344,155;340,150;336,144;331,138;326,134;320,130;314,126;308,123;302,119;296,116;289,114;282,112;276,110;269,108;262,106;255,105;248,104;241,104;235,104;228,104;221,104;214,104;207,104;200,104;193,106;186,108;180,111;173,114;167,117;162,122;158,128;155,134;154,141;155,148;159,154;164,159;169,163;176,165;183,167;190,168;194,174;199,179;200,185;196,191;193,197;189,204;187,210;184,217;181,223;178,229;176,236;174,243;172,249;170,256;168,263;166,269;164,276;163,283;161,290;160,297;159,304;158,311;158,318;157,325;158,332;157,339;155,345;151,351;147,357;143,362;138,368;136,374;136,381;139,388;142,394;146,399;151,404;157,409;161,414;166,420;170,425;174,431;175,438;170,443;164,445;157,442;151,440;144,438;137,438;130,438;123,438;116,438;109,438;102,438;95,438;88,438;81,438;74,438;67,438;60,438;53,438;46,438;40,442;37,448;40,454;45,458;52,460;59,461;66,461;73,462;80,463;87,463;94,463;101,463;108,463;115,463;122,463;129,463;136,463;143,463;150,463;157,463;164,463;171,463;178,463;185,463;192,463;198,459;201,453;202,446;202,439;202,432;202,425;199,419;195,413;190,407;185,403;181,397;176,392;170,388;166,383;165,376;168,369;173,364;177,358;179,352;180,345;181,338;181,331;182,324;183,317;183,310;184,303;185,296;186,289;188,282;189,276;191,269;193,262;195,255;197,249;199,242;201,235;204,229;206,222;208,216;212,209;215,203;222,201;229,201;236,200;242,198;249,195;255,193;261,188;266,183;270,178;274,172;278,166;273,161;266,160;259,161;253,163;246,165;239,166;232,166;227,162;223,156;217,152;211,150;204,149;197,149;190,149;183,147;177,144;174,138;176,131;182,127;189,128;195,129;202,129;209,129;216,129;223,130;230,130;237,131;244,132;251,133;258,134;265,135;272,137;278,139;285,141;292,143;298,147;304,150;310,154;316,158;320,163;324,169;326,176;326,183;323,189;319,195;314,200;308,203;302,207;296,210;292,216;291,223;290,230;291,237;292,244;293,251;295,258;295,265;296,272;295,279;294,285;291,292;288,298;285,305;282,311;280,317;276,324;273,330;270,336;266,342;264,349;263,355;262,362;263,369;264,376;265,383;267,390;267,397;268,404;270,411;274,417;278,422;279,429;280,436;281,442;283,449;285,456;290,460;297,463;304,464;311,464;318,464;325,464;332,464;339,464;346,464;353,464;360,464;367,464;374,464;381,464;388,464;395,464;402,465;409,465;416,466;423,466;430,466;437,466;444,466;451,465;456,460;455,453;451,448;445,444;438,443;431,442;424,441;417,441;410,441;403,441;396,441;389,441;382,440;375,440;368,440;361,440;354,440;347,440;340,440;333,439;326,439;319,439;312,438 For f=1 To 3 mm=ldtext.Replace (ff[f] ";" "|1=") mm=ldtext.Replace (mm "," ";2=") m1=ldtext.Split(text.GetSubTextToEnd (mm 2) "|") pp=LDShapes.AddPolygon (m1) If f<3 then Shapes.Zoom (pp .5 .5) Else Shapes.Zoom (pp .66 .68) Shapes.Move (pp 139 85) EndIf If f=1 Then Shapes.Move (pp 10 20) Endif Shapes.HideShape (pp) pi[f]=pp endfor ss="1 3 1 3 1 3 1 3 1 3 2 3 For r=1 To 10 ss=ss+ss EndFor as=ldtext.Split (ss " ") 'anim sequence cc=255 st=2.5 For f=1 To Array.GetItemCount (as) GraphicsWindow.BackgroundColor=LDColours.HSLtoRGB (cc 1 .3) cc=cc-st If cc<90 Or cc>255 Then st=-st endif For t=1 To 3 If t=as[f] Then Shapes.ShowShape (pi[t]) Else Shapes.hideShape (pi[t]) EndIf endfor Program.Delay (155) LDGraphicsWindow.Reposition (1 1 pnn 0 LDMath.Sin(an)*10 ) an=an+1 pnn=pnn-48 if pnn< -555 Then pnn=1222 endif endfor End>LFZ195.sb< Start>LGB100.sb< intro() Sub space TextWindow.WriteLine(" ") EndSub Sub intro For i = 1 To 2 lol[i] = 1 EndFor lol[i] = 1 x = 0 comguess = 10 TextWindow.WriteLine("Guessing Game") space() space() TextWindow.WriteLine("1. Start") TextWindow.WriteLine("2. Exit") space() intro = TextWindow.Readkey() If intro = 1 Then TextWindow.Clear() instructions() elseif intro = 2 then Program.End() else TextWindow.Clear() intro() EndIf EndSub Sub instructions TextWindow.WriteLine("Computer: You are to guess a number between 1 and 20.") space() TextWindow.Pause() TextWindow.Clear() game() EndSub Sub game TextWindow.WriteLine(" Computer Guess: " + x) space() space() TextWindow.WriteLine("Computer: I guess number " + comguess + ".") guess() EndSub sub guess space() TextWindow.WriteLine("Computer: Is it your number?") space() TextWindow.WriteLine("1. Yes") TextWindow.WriteLine("2. No") space() guess = TextWindow.Readkey() If guess = 1 Then TextWindow.Clear() intro() ElseIf guess = 2 then highlow() Else TextWindow.Clear() game() EndIf EndSub Sub highlow space() x = x + 1 TextWindow.WriteLine("1. Computer: Is the number " + comguess +" too high?") TextWindow.WriteLine("2. Computer: Is the number " + comguess + " too low?") space() highlow = TextWindow.Readkey() If highlow = 1 Then dontlie() high() ElseIf highlow = 2 then dontlie() low() Else TextWindow.Clear() highlow() EndIf TextWindow.Clear() game() EndSub Sub high If comguess = 10 Then comguess = 5 elseIf comguess = 5 then comguess = 3 elseif comguess = 3 then comguess = 1 elseif comguess = 7 then comguess = 6 elseif comguess = 9 then comguess = 8 elseIf comguess = 13 then comguess = 11 elseif comguess = 15 then comguess = 13 elseif comguess = 17 then comguess = 16 elseif comguess = 19 then comguess = 18 EndIf EndSub sub low If comguess = 10 Then comguess = 15 elseIf comguess = 11 then comguess = 12 elseIf comguess = 15 then comguess = 17 elseif comguess = 19 then comguess = 20 elseif comguess = 1 then comguess = 2 elseif comguess = 3 then comguess = 4 elseif comguess = 5 then comguess = 7 elseif comguess = 7 then comguess = 9 elseif comguess = 13 then comguess = 14 elseif comguess = 17 then comguess = 19 EndIf EndSub Sub dontlie space() If comguess = 2 or comguess = 4 or comguess = 6 or comguess = 8 or comguess = 12 or comguess = 14 or comguess = 16 or comguess = 18 or comguess = 20 Then TextWindow.WriteLine("Computer: I know I guessed your number... you just made a human error!") space() TextWindow.Pause() TextWindow.Clear() intro() EndIf EndSub End>LGB100.sb< Start>LGC490.sb< Sub Shapes_Initary shX = -200 ' x offset shY = 133 ' y offset shape = "" ssi="fn=ell;x=62;y=33;width=99;height=97;bc=#5E5E5E;pw=0|fn=ell;x=0;y=59;width=67;height=37;angle=348;bc=#5E5E5E;pw=0|fn=ell;x=45;y=80;width=2;height=0;bc=#5E5E5E;pw=0|fn=ell;x=222;y=0;width=47;height=48;bc=#000000;pc=#5E5E5E;pw=16|fn=ell;x=186;y=58;width=99;height=97;bc=#5E5E5E;pw=0|fn=rect;x=107;y=44;width=127;height=98;angle=11;bc=#5E5E5E;pw=0|fn=rect;x=68;y=139;width=103;height=17;angle=28;bc=#5E5E5E;pw=0|fn=rect;x=196;y=147;width=70;height=16;angle=27;bc=#5E5E5E;pw=0|fn=rect;x=192;y=164;width=70;height=16;angle=356;bc=#5E5E5E;pw=0|fn=rect;x=218;y=141;width=70;height=16;angle=9;bc=#5E5E5E;pw=0|fn=rect;x=238;y=172;width=70;height=16;angle=292;bc=#5E5E5E;pw=0|fn=ell;x=218;y=36;width=37;height=54;angle=34;bc=#5E5E5E;pc=#000000;pw=4|fn=ell;x=229;y=11;width=78;height=78;bc=#5E5E5E;pw=0|fn=ell;x=255;y=51;width=20;height=20;bc=#000000;pw=0|fn=line;x=218;y=71;x1=0;y1=4;x2=11;y2=0;pc=#000000;pw=4|fn=tri;x=238;y=76;x1=40;y1=0;x2=0;y2=25;x3=80;y3=25;angle=288;bc=#5E5E5E;pw=0|fn=ell;x=287;y=27;width=47;height=48;bc=#000000;pc=#5E5E5E;pw=16|fn=line;x=284;y=49;x1=0;y1=0;x2=26;y2=9;pc=#000000;pw=4|fn=line;x=284;y=49;x1=18;y1=32;x2=0;y2=0;pc=#000000;pw=4|fn=tri;x=165;y=161;x1=6;y1=0;x2=0;y2=28;x3=13;y3=28;angle=133;bc=#5E5E5E;pw=0|fn=tri;x=162;y=168;x1=6;y1=0;x2=0;y2=28;x3=13;y3=28;angle=133;bc=#5E5E5E;pw=0|fn=tri;x=252;y=205;x1=6;y1=0;x2=0;y2=28;x3=13;y3=28;angle=210;bc=#5E5E5E;pw=0|fn=tri;x=246;y=203;x1=7;y1=0;x2=0;y2=27;x3=15;y3=27;angle=214;bc=#5E5E5E;pw=0|fn=tri;x=179;y=160;x1=6;y1=0;x2=0;y2=28;x3=13;y3=28;angle=294;bc=#5E5E5E;pw=0|fn=tri;x=182;y=153;x1=6;y1=0;x2=0;y2=28;x3=13;y3=28;angle=294;bc=#5E5E5E;pw=0|fn=rect;x=97;y=127;width=103;height=17;angle=12;bc=#5E5E5E;pw=0|fn=tri;x=196;y=140;x1=6;y1=0;x2=0;y2=28;x3=13;y3=28;angle=133;bc=#5E5E5E;pw=0 shape=ldtext.Split (ssi "|") EndSub Sub initscnc star[17]="ra=08 16 30.95;dec=+09 11 08.4;mag=3.53 star[47]="ra=08 44 41.11;dec=+18 09 17.5;mag=3.94 star[48]="ra=08 46 41.83;dec=+28 45 36.0;mag=4.03 star[65]="ra=08 58 29.20;dec=+11 51 28.0;mag=4.26 star[43]="ra=08 43 17.21;dec=+21 28 06.9;mag=4.66 star[16]="ra=08 12 12.71;dec=+17 38 53.3;mag=4.67 star[8] ="ra=08 05 04.51;dec=+13 07 06.1;mag=5.14 star[18]="ra=08 20 03.87;dec=+27 13 07.0;mag=5.14 star[77]="ra=09 09 21.53;dec=+22 02 43.6;mag=5.16 star[62]="ra=08 57 14.91;dec=+15 19 21.8;mag=5.22 star[58]="ra=08 55 39.69;dec=+27 55 39.2;mag=5.23 star[64]="ra=08 59 32.68;dec=+32 25 07.1;mag=5.23 star[76]="ra=09 07 44.82;dec=+10 40 05.6;mag=5.23 star[10]="ra=08 07 45.84;dec=+21 34 55.1;mag=5.30 star[31]="ra=08 31 35.77;dec=+18 05 40.4;mag=5.33 star[33]="ra=08 32 42.52;dec=+20 26 28.6;mag=5.33 star[82]="ra=09 15 13.88;dec=+14 56 29.5;mag=5.36 star[57]="ra=08 54 14.70;dec=+30 34 45.0;mag=5.40 star[72]="ra=09 08 00.07;dec=+29 39 15.2;mag=5.42 star[60]="ra=08 55 55.56;dec=+11 37 33.8;mag=5.44 star[59]="ra=08 56 56.63;dec=+32 54 38.1;mag=5.44 star[69]="ra=09 02 44.27;dec=+24 27 10.6;mag=5.45 star[27]="ra=08 26 43.95;dec=+12 39 17.5;mag=5.56 star[22]="ra=08 26 27.73;dec=+27 53 37.9;mag=5.58 star[3] ="ra=08 00 47.31;dec=+17 18 31.4;mag=5.60 star[15]="ra=08 13 08.87;dec=+29 39 23.7;mag=5.62 star[45]="ra=08 43 12.34;dec=+12 40 51.1;mag=5.62 star[49]="ra=08 44 45.04;dec=+10 04 54.2;mag=5.63 star[51]="ra=08 52 34.62;dec=+32 28 26.8;mag=5.67 star[63]="ra=08 57 35.16;dec=+15 34 52.4;mag=5.68 star[30]="ra=08 31 30.57;dec=+24 04 52.4;mag=5.71 star[14]="ra=08 10 27.23;dec=+25 30 29.4;mag=5.73 star[1] ="ra=07 56 59.47;dec=+15 47 25.4;mag=5.80 star[2] ="ra=08 00 55.87;dec=+25 23 34.2;mag=5.87 star[50]="ra=08 46 56.06;dec=+12 06 36.3;mag=5.89 star[66]="ra=09 01 24.13;dec=+32 15 08.3;mag=5.89 star[19]="ra=08 20 32.15;dec=+24 01 20.5;mag=5.92 star[36]="ra=08 37 05.79;dec=+09 39 20.1;mag=5.92 star[20]="ra=08 23 21.87;dec=+18 19 56.2;mag=5.94 star[29]="ra=08 28 37.35;dec=+14 12 39.1;mag=5.94 star[75]="ra=09 08 47.42;dec=+26 37 48.0;mag=5.95 star[1] ="ra=08 38 19.00;dec=+32 48 07.3;mag=5.96 star[55]="ra=08 52 36.13;dec=+28 19 53.0;mag=5.96 star[9] ="ra=08 06 18.40;dec=+22 38 07.8;mag=5.97 star[5] ="ra=08 01 30.29;dec=+16 27 19.2;mag=5.99 star[79]="ra=09 10 20.86;dec=+21 59 47.1;mag=6.04 star[28]="ra=08 28 36.80;dec=+24 08 42.2;mag=6.05 star[67]="ra=09 01 48.88;dec=+27 54 10.0;mag=6.07 star[21]="ra=08 23 55.21;dec=+10 37 55.6;mag=6.11 edge = "1=48-43;2=43-47;3=47-65;4=47-17 EndSub Sub shpcnc shX = -1040 ' x offset shY = 77 ' y offset shape = "" ssi="fn=ell;x=60;y=44;width=126;height=181;bc=#661F1F;pc=#000055;pw=2|fn=ell;x=54;y=99;width=21;height=21;bc=#661F1F;pc=#000055;pw=2|fn=ell;x=56;y=145;width=21;height=21;bc=#661F1F;pc=#000055;pw=2|fn=rect;x=73;y=22;width=27;height=23;angle=12;bc=#661F1F;pc=#000055;pw=2|fn=rect;x=96;y=30;width=24;height=22;angle=21;bc=#661F1F;pc=#000055;pw=2|fn=rect;x=49;y=209;width=29;height=22;bc=#661F1F;pc=#000055;pw=2|fn=rect;x=70;y=207;width=24;height=19;angle=327;bc=#661F1F;pc=#000055;pw=2|fn=tri;x=107;y=15;x1=7;y1=0;x2=0;y2=37;x3=14;y3=37;angle=332;bc=#661F1F;pc=#000055;pw=2|fn=tri;x=131;y=12;x1=7;y1=0;x2=0;y2=37;x3=14;y3=37;angle=338;bc=#661F1F;pc=#000055;pw=2|fn=tri;x=152;y=21;x1=7;y1=0;x2=0;y2=37;x3=14;y3=37;angle=346;bc=#661F1F;pc=#000055;pw=2|fn=tri;x=170;y=34;x1=7;y1=0;x2=0;y2=37;x3=14;y3=37;angle=351;bc=#661F1F;pc=#000055;pw=2|fn=tri;x=103;y=218;x1=7;y1=0;x2=0;y2=37;x3=14;y3=37;angle=214;bc=#661F1F;pc=#000055;pw=2|fn=tri;x=127;y=217;x1=7;y1=0;x2=0;y2=37;x3=14;y3=37;angle=214;bc=#661F1F;pc=#000055;pw=2|fn=tri;x=142;y=219;x1=7;y1=0;x2=0;y2=37;x3=14;y3=37;angle=214;bc=#661F1F;pc=#000055;pw=2|fn=tri;x=161;y=206;x1=7;y1=0;x2=0;y2=37;x3=14;y3=37;angle=214;bc=#661F1F;pc=#000055;pw=2|fn=tri;x=49;y=102;x1=7;y1=0;x2=0;y2=37;x3=14;y3=37;angle=290;bc=#661F1F;pc=#000055;pw=2|fn=tri;x=49;y=122;x1=7;y1=0;x2=0;y2=36;x3=14;y3=36;angle=264;bc=#661F1F;pc=#000055;pw=2|fn=rect;x=127;y=77;width=14;height=33;angle=351;bc=#661F1F;pc=#000055;pw=2|fn=rect;x=141;y=74;width=14;height=33;bc=#661F1F;pc=#000055;pw=2|fn=rect;x=158;y=84;width=14;height=33;bc=#661F1F;pc=#000055;pw=2|fn=rect;x=169;y=96;width=14;height=33;angle=10;bc=#661F1F;pc=#000055;pw=2|fn=rect;x=122;y=161;width=14;height=33;angle=7;bc=#661F1F;pc=#000055;pw=2|fn=rect;x=136;y=162;width=14;height=33;bc=#661F1F;pc=#000055;pw=2|fn=rect;x=153;y=160;width=14;height=33;angle=352;bc=#661F1F;pc=#000055;pw=2|fn=rect;x=167;y=150;width=14;height=33;angle=351;bc=#661F1F;pc=#000055;pw=2|fn=rect;x=120;y=48;width=14;height=33;angle=338;bc=#661F1F;pc=#000055;pw=2|fn=rect;x=139;y=46;width=14;height=33;angle=351;bc=#661F1F;pc=#000055;pw=2|fn=rect;x=158;y=55;width=14;height=33;bc=#661F1F;pc=#000055;pw=2|fn=rect;x=173;y=67;width=14;height=33;bc=#661F1F;pc=#000055;pw=2|fn=rect;x=117;y=191;width=14;height=33;angle=12;bc=#661F1F;pc=#000055;pw=2|fn=rect;x=136;y=194;width=14;height=33;bc=#661F1F;pc=#000055;pw=2|fn=rect;x=154;y=192;width=14;height=33;angle=7;bc=#661F1F;pc=#000055;pw=2|fn=rect;x=170;y=181;width=14;height=33;bc=#661F1F;pc=#000055;pw=2|fn=ell;x=70;y=99;width=114;height=68;bc=#661F1F;pc=#000055;pw=2|fn=ell;x=14;y=0;width=50;height=102;angle=45;bc=#661F1F;pc=#000055;pw=2|fn=ell;x=0;y=132;width=49;height=105;angle=342;bc=#661F1F;pc=#000055;pw=2|fn=tri;x=16;y=34;x1=18;y1=0;x2=0;y2=66;x3=36;y3=66;angle=30;bc=#000055;pw=0|fn=tri;x=13;y=130;x1=11;y1=0;x2=0;y2=73;x3=23;y3=73;angle=168;bc=#000055;pw=0|fn=ell;x=54;y=99;width=21;height=21;bc=#33000000;pc=#000055;pw=2|fn=ell;x=56;y=145;width=21;height=21;bc=#33000000;pc=#000055;pw=2 shape=ldtext.Split (ssi "|") EndSub Sub InitStarsgm ' Initialize stars in Gemini star[78]="ra=07 45 19.36;dec=+28 01 34.7;mag=1.16 star[66]="ra=07 34 36.00;dec=+31 53 19.1;mag=1.90 star[24]="ra=06 37 42.70;dec=+16 23 57.9;mag=1.93 star[13]="ra=06 22 57.59;dec=+22 30 49.9;mag=2.87 star[27]="ra=06 43 55.93;dec=+25 07 52.2;mag=3.06 star[7]= "ra=06 14 52.70;dec=+22 30 24.6;mag=3.31 star[31]="ra=06 45 17.43;dec=+12 53 45.8;mag=3.35 star[55]="ra=07 20 07.39;dec=+21 58 56.4;mag=3.50 star[77]="ra=07 44 26.87;dec=+24 23 53.3;mag=3.57 star[54]="ra=07 18 05.61;dec=+16 32 25.7;mag=3.58 star[34]="ra=06 52 47.34;dec=+33 57 40.9;mag=3.60 star[60]="ra=07 25 43.68;dec=+27 47 53.8;mag=3.78 star[43]="ra=07 04 06.54;dec=+20 34 13.1;mag=4.01 star[69]="ra=07 35 55.37;dec=+26 53 45.6;mag=4.06 star[18]="ra=06 28 57.79;dec=+20 12 43.8;mag=4.13 star[1]= "ra=06 04 07.22;dec=+23 15 49.1;mag=4.16 star[62]="ra=07 29 06.61;dec=+31 47 02.7;mag=4.16 star[75]="ra=07 43 18.69;dec=+28 53 02.7;mag=4.23 star[46]="ra=07 11 08.39;dec=+30 14 43.0;mag=4.41 star[30]="ra=06 43 59.29;dec=+13 13 41.3;mag=4.49 star[38]="ra=06 54 38.59;dec=+13 10 40.9;mag=4.71 star[71]="ra=07 39 09.96;dec=+34 35 04.7;mag=4.89 star[81]="ra=07 46 07.49;dec=+18 30 36.6;mag=4.89 star[83]="ra=07 53 29.84;dec=+26 45 57.1;mag=4.97 star[65]="ra=07 29 48.78;dec=+27 54 58.3;mag=5.01 star[57]="ra=07 23 28.55;dec=+25 03 02.2;mag=5.04 star[74]="ra=07 39 28.59;dec=+17 40 28.3;mag=5.04 star[51]="ra=07 13 22.27;dec=+16 09 32.6;mag=5.07 star[64]="ra=07 29 20.46;dec=+28 07 06.3;mag=5.07 star[56]="ra=07 21 56.90;dec=+20 26 37.4;mag=5.09 star[80]="ra=07 47 30.34;dec=+33 24 56.8;mag=5.14 star[26]="ra=06 42 24.32;dec=+17 38 43.9;mag=5.20 star[42]="ra=07 02 24.78;dec=+24 12 55.6;mag=5.20 star[63]="ra=07 27 44.39;dec=+21 26 44.0;mag=5.20 star[68]="ra=07 33 36.50;dec=+15 49 36.1;mag=5.27 star[36]="ra=06 51 33.05;dec=+21 45 40.4;mag=5.28 star[76]="ra=07 44 06.92;dec=+25 47 03.2;mag=5.30 star[85]="ra=07 55 39.90;dec=+19 53 02.6;mag=5.38 star[28]="ra=06 44 45.46;dec=+28 58 15.6;mag=5.42 star[45]="ra=07 08 22.04;dec=+15 55 51.3;mag=5.47 star[70]="ra=07 38 32.84;dec=+35 02 54.5;mag=5.58 star[35]="ra=06 50 25.50;dec=+13 24 47.5;mag=5.68 star[41]="ra=07 00 15.82;dec=+16 04 44.4;mag=5.73 star[37]="ra=06 55 18.69;dec=+25 22 32.3;mag=5.73 star[3]= "ra=06 09 43.99;dec=+23 06 48.5;mag=5.75 star[47]="ra=07 11 23.08;dec=+26 51 24.0;mag=5.75 star[53]="ra=07 15 57.18;dec=+27 53 50.7;mag=5.75 star[59]="ra=07 24 33.44;dec=+27 38 16.1;mag=5.77 star[5]= "ra=06 11 32.31;dec=+24 25 13.4;mag=5.83 star[52]="ra=07 14 41.94;dec=+24 53 06.7;mag=5.84 star[48]="ra=07 12 26.39;dec=+24 07 43.3;mag=5.85 star[33]="ra=06 49 49.85;dec=+16 12 10.5;mag=5.85 star[61]="ra=07 26 56.33;dec=+20 15 27.3;mag=5.94 star[44]="ra=07 05 18.37;dec=+22 38 14.9;mag=6.00 star[8] ="ra=06 16 19.05;dec=+23 58 12.2;mag=6.09 edge = "1=66-46;2=46-27;3=27-13;4=13-7;5=66-78;6=78-55;7=55-43;8=43-24 EndSub Sub Shapes_Initgmm shX = -840 ' x offset shY = -11 ' y offset ssi="fn=ell;x=34;y=69;width=54;height=52;bc=#A4825B;pw=0|fn=ell;x=0;y=117;width=54;height=52;bc=#A4825B;pw=0|fn=ell;x=30;y=144;width=41;height=61;angle=33;bc=#A4825B;pw=0|fn=rect;x=109;y=201;width=44;height=21;bc=#A4825B;pw=0|fn=rect;x=91;y=224;width=44;height=21;angle=4;bc=#A4825B;pw=0|fn=rect;x=138;y=221;width=67;height=20;angle=43;bc=#A4825B;pw=0|fn=rect;x=118;y=244;width=67;height=20;angle=43;bc=#A4825B;pw=0|fn=rect;x=141;y=164;width=61;height=23;angle=335;bc=#A4825B;pw=0|fn=rect;x=172;y=143;width=44;height=21;angle=335;bc=#A4825B;pw=0|fn=rect;x=196;y=156;width=67;height=20;angle=43;bc=#A4825B;pw=0|fn=rect;x=177;y=180;width=67;height=20;angle=57;bc=#A4825B;pw=0|fn=ell;x=245;y=179;width=41;height=16;angle=333;bc=#A4825B;pw=0|fn=ell;x=218;y=210;width=41;height=16;angle=349;bc=#A4825B;pw=0|fn=ell;x=187;y=246;width=41;height=16;angle=349;bc=#A4825B;pw=0|fn=ell;x=161;y=269;width=41;height=20;angle=7;bc=#A4825B;pw=0|fn=rect;x=77;y=121;width=101;height=50;angle=39;bc=#A4825B;pw=0|fn=rect;x=34;y=169;width=85;height=53;angle=38;bc=#A4825B;pw=0|fn=rect;x=106;y=86;width=53;height=22;angle=348;bc=#A4825B;pw=0|fn=rect;x=148;y=69;width=51;height=20;angle=325;bc=#A4825B;pw=0|fn=tri;x=133;y=0;x1=11;y1=0;x2=0;y2=42;x3=23;y3=42;angle=305;bc=#624E37;pw=0|fn=line;x=156;y=28;x1=0;y1=0;x2=89;y2=60;pc=#624E37;pw=4|fn=tri;x=230;y=74;x1=12;y1=0;x2=0;y2=20;x3=24;y3=20;angle=307;bc=#624E37;pw=0|fn=rect;x=248;y=84;width=25;height=28;angle=304;bc=#624E37;pw=0|fn=tri;x=252;y=94;x1=15;y1=0;x2=0;y2=18;x3=30;y3=18;angle=307;bc=#000000;pw=0|fn=rect;x=91;y=174;width=51;height=19;angle=358;bc=#A4825B;pc=#000000;pw=2|fn=ell;x=130;y=169;width=29;height=25;bc=#A4825B;pw=0|fn=rect;x=32;y=189;width=20;height=48;angle=350;bc=#A4825B;pw=0|fn=rect;x=36;y=222;width=46;height=18;bc=#A4825B;pw=0|fn=rect;x=64;y=241;width=9;height=0;bc=#A4825B;pw=0|fn=rect;x=55;y=136;width=44;height=20;angle=324;bc=#A4825B;pw=0|fn=rect;x=62;y=151;width=56;height=22;angle=74;bc=#A4825B;pc=#000000;pw=2|fn=ell;x=86;y=169;width=23;height=23;angle=347;bc=#A4825B;pw=0|fn=ell;x=77;y=87;width=42;height=63;angle=44;bc=#A4825B;pw=0|fn=ell;x=73;y=221;width=27;height=23;angle=13;bc=#A4825B;pw=0|fn=ell;x=103;y=116;width=61;height=64;angle=316;bc=#624E37;pw=0|fn=ell;x=111;y=128;width=40;height=34;angle=313;bc=#A4825B;pw=0|fn=rect;x=104;y=120;width=25;height=23;angle=315;bc=#A4825B;pw=0|fn=ell;x=93;y=117;width=19;height=30;angle=318;bc=#624E37;pw=0|fn=ell;x=108;y=102;width=19;height=30;angle=318;bc=#624E37;pw=0|fn=line;x=118;y=134;x1=0;y1=0;x2=29;y2=27;pc=#624E37;pw=2|fn=line;x=111;y=135;x1=0;y1=0;x2=29;y2=29;pc=#624E37;pw=2|fn=line;x=121;y=128;x1=0;y1=0;x2=28;y2=27;pc=#624E37;pw=2|fn=ell;x=89;y=119;width=15;height=29;angle=340;bc=#A4825B;pw=0|fn=ell;x=113;y=95;width=15;height=29;angle=291;bc=#A4825B;pw=0|fn=ell;x=184;y=40;width=26;height=33;angle=352;bc=#A4825B;pw=0|fn=rect;x=107;y=130;width=22;height=9;angle=313;bc=#624E37;pw=0|fn=rect;x=131;y=152;width=22;height=9;angle=315;bc=#624E37;pw=0|fn=tri;x=126;y=106;x1=6;y1=0;x2=0;y2=10;x3=12;y3=10;angle=294;bc=#000000;pw=0|fn=ell;x=68;y=74;width=26;height=19;angle=39;bc=#A4825B;pw=0|fn=ell;x=2;y=152;width=26;height=19;angle=231;bc=#A4825B;pw=0|fn=ell;x=60;y=84;width=13;height=13;bc=#000000;pw=0|fn=ell;x=48;y=99;width=13;height=13;bc=#000000;pw=0|fn=ell;x=32;y=122;width=13;height=13;bc=#000000;pw=0|fn=ell;x=20;y=137;width=13;height=13;bc=#000000;pw=0 shape=ldtext.Split (ssi "|") EndSub Sub Shapes_Init_tau shX = -500 ' x offset shY = 64 ' y offset shape = "" ssi="fn=ell;x=75;y=49;width=86;height=134;angle=24;bc=#000055;pc=#66411F;pw=16|fn=rect;x=56;y=71;width=67;height=57;angle=24;bc=#000055;pw=0|fn=ell;x=71;y=29;width=52;height=53;bc=#66411F;pw=0|fn=ell;x=34;y=105;width=52;height=53;bc=#66411F;pw=0|fn=ell;x=58;y=0;width=70;height=68;bc=#000055;pw=0|fn=ell;x=0;y=107;width=73;height=75;bc=#000055;pw=0|fn=ell;x=240;y=111;width=148;height=154;bc=#66411F;pw=0|fn=rect;x=213;y=213;width=104;height=37;angle=334;bc=#66411F;pw=0|fn=rect;x=202;y=265;width=105;height=29;angle=33;bc=#66411F;pw=0|fn=rect;x=148;y=190;width=104;height=37;angle=358;bc=#66411F;pw=0|fn=rect;x=113;y=245;width=105;height=29;angle=76;bc=#66411F;pw=0|fn=ell;x=132;y=187;width=48;height=46;bc=#66411F;pw=0|fn=ell;x=194;y=228;width=48;height=46;bc=#66411F;pw=0|fn=ell;x=200;y=119;width=3;height=1;bc=#66411F;pw=0|fn=rect;x=199;y=78;width=178;height=88;angle=351;bc=#66411F;pw=0|fn=ell;x=117;y=83;width=105;height=120;angle=34;bc=#66411F;pc=#000055;pw=4|fn=ell;x=183;y=123;width=23;height=24;bc=#000055;pw=0|fn=ell;x=171;y=50;width=23;height=54;angle=42;bc=#66411F;pw=0|fn=ell;x=108;y=163;width=23;height=54;angle=20;bc=#66411F;pw=0|fn=ell;x=166;y=150;width=85;height=67;angle=315;bc=#66411F;pc=#000055;pw=4|fn=ell;x=217;y=173;width=12;height=15;bc=#000055;pw=0|fn=ell;x=193;y=197;width=11;height=16;angle=260;bc=#000055;pw=0|fn=ell;x=179;y=136;width=30;height=68;angle=46;bc=#66411F;pw=0|fn=tri;x=135;y=311;x1=34;y1=0;x2=0;y2=25;x3=68;y3=25;angle=270;bc=#66411F;pw=0|fn=tri;x=157;y=306;x1=34;y1=0;x2=0;y2=25;x3=68;y3=25;angle=69;bc=#66411F;pw=0|fn=tri;x=260;y=311;x1=34;y1=0;x2=0;y2=25;x3=68;y3=25;angle=233;bc=#66411F;pw=0|fn=tri;x=272;y=293;x1=34;y1=0;x2=0;y2=25;x3=68;y3=25;angle=32;bc=#66411F;pw=0|fn=ell;x=321;y=44;width=73;height=67;bc=#000055;pw=0|fn=ell;x=329;y=104;width=73;height=67;bc=#000055;pw=0|fn=ell;x=325;y=155;width=74;height=70;bc=#000055;pw=0|fn=ell;x=325;y=211;width=74;height=70;bc=#000055;pw=0 shape=ldtext.Split (ssi "|") EndSub Sub InitStars_tau star[87]="ra=04 35 55.20;dec=+16 30 35.1;mag=0.87 star[112]="ra=05 26 17.50;dec=+28 36 28.3;mag=1.65 star[25]="ra=03 47 29.06;dec=+24 06 18.9;mag=2.85 star[123]="ra=05 37 38.68;dec=+21 08 33.3;mag=2.97 star[78]="ra=04 28 39.67;dec=+15 52 15.4;mag=3.40 star[35]="ra=04 00 40.82;dec=+12 29 25.4;mag=3.41 star[74]="ra=04 28 36.93;dec=+19 10 49.9;mag=3.53 star[1] ="ra=03 24 48.84;dec=+09 01 44.6;mag=3.61 star[27]="ra=03 49 09.73;dec=+24 03 12.7;mag=3.62 star[54]="ra=04 19 47.53;dec=+15 37 39.7;mag=3.65 star[17]="ra=03 44 52.52;dec=+24 06 48.4;mag=3.72 star[2] ="ra=03 27 10.12;dec=+09 43 58.0;mag=3.73 star[61]="ra=04 22 56.03;dec=+17 32 33.3;mag=3.77 star[77]="ra=04 28 34.43;dec=+15 57 44.0;mag=3.84 star[20]="ra=03 45 49.59;dec=+24 22 04.3;mag=3.87 star[38]="ra=04 03 09.38;dec=+05 59 21.5;mag=3.91 star[5] ="ra=03 30 52.37;dec=+12 56 12.1;mag=4.14 star[23]="ra=03 46 19.56;dec=+23 56 54.5;mag=4.14 star[65]="ra=04 25 22.10;dec=+22 17 38.3;mag=4.21 star[88]="ra=04 35 39.23;dec=+10 09 39.3;mag=4.25 star[49]="ra=04 15 32.05;dec=+08 53 32.7;mag=4.27 star[90]="ra=04 38 09.40;dec=+12 30 39.1;mag=4.27 star[94]="ra=04 42 14.70;dec=+22 57 25.1;mag=4.27 star[69]="ra=04 26 18.39;dec=+22 48 49.3;mag=4.28 star[10]="ra=03 36 52.52;dec=+00 24 10.2;mag=4.29 star[19]="ra=03 45 12.48;dec=+24 28 02.6;mag=4.30 star[68]="ra=04 25 29.32;dec=+17 55 40.8;mag=4.30 star[119]="ra=05 32 12.75;dec=+18 35 39.3;mag=4.32 star[37]="ra=04 04 41.66;dec=+22 04 55.4;mag=4.36 star[71]="ra=04 26 20.67;dec=+15 37 06.0;mag=4.48 star[136]="ra=05 53 19.64;dec=+27 36 44.2;mag=4.56 star[102]="ra=05 03 05.70;dec=+21 35 24.2;mag=4.62 star[86]="ra=04 33 50.86;dec=+14 50 40.2;mag=4.65 star[92]="ra=04 39 16.45;dec=+15 55 04.9;mag=4.67 star[73]="ra=04 26 36.38;dec=+14 42 49.9;mag=4.69 star[64]="ra=04 24 05.69;dec=+17 26 39.2;mag=4.80 star[139]="ra=05 57 59.66;dec=+25 57 14.1;mag=4.81 star[47]="ra=04 13 56.39;dec=+09 15 50.0;mag=4.84 star[126]="ra=05 41 17.72;dec=+16 32 03.1;mag=4.84 star[114]="ra=05 27 38.08;dec=+21 56 13.1;mag=4.88 star[132]="ra=05 49 00.96;dec=+24 34 03.2;mag=4.88 star[134]="ra=05 49 32.94;dec=+12 39 04.9;mag=4.89 star[104]="ra=05 07 26.68;dec=+18 38 42.0;mag=4.91 star[50]="ra=04 17 15.69;dec=+20 34 43.5;mag=4.93 star[75]="ra=04 28 26.37;dec=+16 21 34.7;mag=4.96 star[109]="ra=05 19 16.59;dec=+22 05 48.1;mag=4.96 star[52]="ra=04 20 21.23;dec=+27 21 03.4;mag=4.97 star[111]="ra=05 24 25.31;dec=+17 23 00.8;mag=5.00 star[79]="ra=04 28 50.10;dec=+13 02 51.5;mag=5.02 star[28]="ra=03 49 11.20;dec=+24 08 12.6;mag=5.05 star[30]="ra=03 48 16.25;dec=+11 08 36.1;mag=5.08 star[91]="ra=04 39 09.20;dec=+15 48 00.1;mag=5.08 star[97]="ra=04 51 22.41;dec=+18 50 23.8;mag=5.08 edge = "1=112-74;2=74-68;3=68-54;4=123-87;5=87-78;6=78-54;7=54-49; edge = edge + "8=54-35;9=25-35;10=35-2 EndSub Sub InitStarsVr wrap="false star["Spica"]="ra=13 25 11.60;dec=-11 09 40.5;mag=0.98;fd=67 star["γ Vir A"]="ra=12 41 40.00;dec=-01 26 58.3;mag=2.74;fd=29 star["ε Vir"]="ra=13 02 10.76;dec=+10 57 32.8;mag=2.85;fd=47 star["ζ Vir"]="ra=13 34 41.75;dec=-00 35 45.4;mag=3.38;fd=79 star["δ Vir"]="ra=12 55 36.48;dec=+03 23 51.4;mag=3.39;fd=43 star["β Vir"]="ra=11 50 41.29;dec=+01 45 55.4;mag=3.59;fd=5 star["γ Vir B"]="ra=12 41 39.60;dec=-01 26 58.0;mag=3.68;fd=29 star["109 Vir"]="ra=14 46 14.99;dec=+01 53 34.6;mag=3.73;fd=109 star["μ Vir"]="ra=14 43 03.56;dec=-05 39 26.7;mag=3.87;fd=107 star["η Vir"]="ra=12 19 54.39;dec=-00 40 00.3;mag=3.89;fd=15 star["ν Vir"]="ra=11 45 51.57;dec=+06 31 47.3;mag=4.04;fd=3 star["ι Vir"]="ra=14 16 00.88;dec=-05 59 58.3;mag=4.07;fd=99 star["ο Vir"]="ra=12 05 12.67;dec=+08 43 58.2;mag=4.12;fd=9 star["κ Vir"]="ra=14 12 53.74;dec=-10 16 26.6;mag=4.18;fd=98 star["τ Vir"]="ra=14 01 38.78;dec=+01 32 40.5;mag=4.23;fd=93 star["θ Vir"]="ra=13 09 57.01;dec=-05 32 20.1;mag=4.38;fd=51 star["110 Vir"]="ra=15 02 54.07;dec=+02 05 28.6;mag=4.39;fd=110 star["λ Vir"]="ra=14 19 06.60;dec=-13 22 16.2;mag=4.52;fd=100 star["π Vir"]="ra=12 00 52.39;dec=+06 36 51.8;mag=4.65;fd=8 star["χ Vir"]="ra=12 39 14.81;dec=-07 59 43.8;mag=4.66;fd=26 star["74 Vir"]="ra=13 31 57.95;dec=-06 15 20.6;mag=4.68;fd=74 star["61 Vir"]="ra=13 18 24.97;dec=-18 18 31.0;mag=4.74;fd=61 star["69 Vir"]="ra=13 27 27.24;dec=-15 58 25.1;mag=4.76;fd=69 star["ψ Vir"]="ra=12 54 21.17;dec=-09 32 20.2;mag=4.77;fd=40 star["σ Vir"]="ra=13 17 36.29;dec=+05 28 11.4;mag=4.78;fd=60 star["φ Vir"]="ra=14 28 12.22;dec=-02 13 40.6;mag=4.81;fd=105 star["ξ Vir"]="ra=11 45 17.00;dec=+08 15 29.4;mag=4.84;fd=2 star["ρ Vir"]="ra=12 41 53.01;dec=+10 14 09.0;mag=4.88;fd=30 star["78 Vir"]="ra=13 34 07.91;dec=+03 39 32.5;mag=4.92;fd=78 star["ET Vir"]="ra=14 10 50.48;dec=-16 18 07.2;mag=4.93 star["89 Vir"]="ra=13 49 52.34;dec=-18 08 02.7;mag=4.96;fd=89 star["16 Vir"]="ra=12 20 21.15;dec=+03 18 45.8;mag=4.97;fd=16 star["70 Vir"]="ra=13 28 25.95;dec=+13 46 48.7;mag=4.97;fd=70 star["CU Vir"]="ra=14 12 15.83;dec=+02 24 34.2;mag=4.99 star["82 Vir"]="ra=13 41 36.83;dec=-08 42 11.1;mag=5.03;fd=82 star["53 Vir"]="ra=13 12 03.48;dec=-16 11 52.5;mag=5.04;fd=53 star["244 G. Vir"]="ra=14 24 11.39;dec=+05 49 12.4;mag=5.10 star["υ Vir"]="ra=14 19 32.55;dec=-02 15 55.2;mag=5.14;fd=102 star["49 Vir"]="ra=13 07 53.80;dec=-10 44 25.4;mag=5.15;fd=49 star["90 Vir"]="ra=13 54 42.20;dec=-01 30 11.1;mag=5.16;fd=90 star["59 Vir"]="ra=13 16 46.71;dec=+09 25 25.3;mag=5.19;fd=59 star["57 Vir"]="ra=13 15 58.58;dec=-19 56 34.2;mag=5.21;fd=57 star["76 Vir"]="ra=13 32 58.09;dec=-10 09 53.7;mag=5.21;fd=76 star["d2 Vir"]="ra=12 45 37.12;dec=+07 40 23.9;mag=5.22;fd=32 star["ω Vir"]="ra=11 38 27.61;dec=+08 08 03.4;mag=5.24;fd=1 star["68 Vir"]="ra=13 26 43.24;dec=-12 42 27.4;mag=5.27;fd=68 edge = "1=β Vir-η Vir;2=η Vir-γ Vir A;3=γ Vir A-δ Vir;4=δ Vir-ε Vir;5=γ Vir A-θ Vir; edge = edge + "6=θ Vir-Spica;7=Spica-ζ Vir EndSub Sub Shapes_InitVrg shX = -1870 ' x offset shY = 300 ' y offset shape = "" ssi="fn=tri;x=191;y=17;x1=58;y1=0;x2=0;y2=247;x3=117;y3=247;angle=77;bc=#BFB9EA;pw=0|fn=rect;x=37;y=151;width=78;height=19;angle=347;bc=#E5B3A9;pw=0|fn=rect;x=52;y=195;width=77;height=20;angle=346;bc=#E5B3A9;pw=0|fn=tri;x=135;y=33;x1=58;y1=0;x2=0;y2=247;x3=117;y3=247;angle=77;bc=#BFB9EA;pw=0|fn=ell;x=0;y=159;width=57;height=21;angle=2;bc=#E5B3A9;pw=0|fn=ell;x=16;y=210;width=57;height=21;angle=322;bc=#E5B3A9;pw=0|fn=ell;x=184;y=198;width=30;height=22;angle=324;bc=#E5B3A9;pw=0|fn=rect;x=204;y=179;width=83;height=17;angle=341;bc=#E5B3A9;pw=0|fn=rect;x=278;y=148;width=85;height=23;angle=336;bc=#BFB9EA;pw=0|fn=rect;x=258;y=87;width=83;height=17;angle=20;bc=#E5B3A9;pw=0|fn=rect;x=275;y=88;width=76;height=65;angle=347;bc=#BFB9EA;pw=0|fn=line;x=193;y=173;x1=14;y1=0;x2=0;y2=68;pc=#AD8834;pw=2|fn=tri;x=243;y=0;x1=58;y1=0;x2=0;y2=247;x3=117;y3=247;angle=77;bc=#BFB9EA;pw=0|fn=rect;x=373;y=90;width=34;height=24;angle=345;bc=#E5B3A9;pw=0|fn=ell;x=196;y=213;width=12;height=7;angle=53;bc=#AD8834;pw=0|fn=ell;x=185;y=221;width=14;height=9;angle=322;bc=#AD8834;pw=0|fn=ell;x=182;y=234;width=12;height=8;angle=322;bc=#AD8834;pw=0|fn=ell;x=187;y=210;width=13;height=9;angle=322;bc=#AD8834;pw=0|fn=ell;x=195;y=227;width=12;height=7;angle=53;bc=#AD8834;pw=0|fn=ell;x=192;y=238;width=12;height=7;angle=53;bc=#AD8834;pw=0|fn=ell;x=240;y=70;width=30;height=22;angle=355;bc=#E5B3A9;pw=0|fn=ell;x=416;y=55;width=43;height=59;angle=342;bc=#AD8834;pw=0|fn=ell;x=410;y=109;width=22;height=18;bc=#AD8834;pw=0|fn=ell;x=391;y=62;width=22;height=18;angle=338;bc=#AD8834;pw=0|fn=ell;x=375;y=73;width=24;height=18;angle=332;bc=#AD8834;pw=0|fn=rect;x=348;y=82;width=39;height=54;angle=348;bc=#E5B3A9;pw=0|fn=rect;x=323;y=74;width=60;height=21;angle=340;bc=#BFB9EA;pw=0|fn=rect;x=336;y=125;width=60;height=21;angle=353;bc=#BFB9EA;pw=0|fn=ell;x=388;y=109;width=23;height=18;bc=#AD8834;pw=0|fn=ell;x=391;y=68;width=58;height=48;angle=345;bc=#EDCBC4;pw=0|fn=ell;x=409;y=54;width=36;height=20;bc=#AD8834;pw=0|fn=ell;x=425;y=95;width=36;height=20;angle=320;bc=#AD8834;pw=0|fn=ell;x=374;y=108;width=19;height=19;bc=#AD8834;pw=0|fn=ell;x=360;y=109;width=19;height=19;bc=#AD8834;pw=0|fn=ell;x=344;y=114;width=19;height=14;bc=#AD8834;pw=0|fn=ell;x=329;y=113;width=19;height=14;bc=#AD8834;pw=0|fn=ell;x=317;y=115;width=19;height=14;angle=343;bc=#AD8834;pw=0|fn=ell;x=413;y=75;width=7;height=12;angle=343;bc=#FFFFFF;pw=0|fn=ell;x=421;y=95;width=7;height=12;angle=343;bc=#FFFFFF;pw=0|fn=ell;x=412;y=74;width=9;height=9;angle=343;bc=#2B4D8D;pw=0|fn=ell;x=420;y=94;width=9;height=9;angle=343;bc=#2B4D8D;pw=0|fn=tri;x=397;y=95;x1=7;y1=0;x2=0;y2=5;x3=14;y3=5;angle=247;bc=#820808;pw=0|fn=ell;x=195;y=123;width=38;height=12;angle=343;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=216;y=110;width=38;height=12;angle=336;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=221;y=117;width=38;height=12;angle=336;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=239;y=111;width=38;height=12;angle=345;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=234;y=107;width=38;height=12;angle=342;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=235;y=99;width=38;height=12;angle=332;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=270;y=105;width=38;height=12;angle=345;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=267;y=101;width=38;height=12;angle=345;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=260;y=93;width=38;height=12;angle=339;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=258;y=84;width=38;height=12;angle=334;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=298;y=97;width=38;height=12;angle=345;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=282;y=91;width=38;height=12;angle=345;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=275;y=83;width=38;height=12;angle=345;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=321;y=87;width=38;height=12;angle=345;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=303;y=87;width=38;height=12;angle=345;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=296;y=82;width=38;height=12;angle=345;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=290;y=74;width=38;height=12;angle=338;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=278;y=70;width=38;height=12;angle=338;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=335;y=79;width=38;height=12;angle=338;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=328;y=74;width=38;height=12;angle=338;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=314;y=71;width=38;height=12;angle=338;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=306;y=66;width=38;height=12;angle=338;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=303;y=60;width=38;height=12;angle=338;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=353;y=67;width=38;height=12;angle=327;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=347;y=64;width=38;height=12;angle=327;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=335;y=62;width=38;height=12;angle=334;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=329;y=58;width=38;height=12;angle=342;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=334;y=50;width=38;height=12;angle=345;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=361;y=60;width=26;height=13;angle=345;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=364;y=53;width=26;height=13;angle=345;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=360;y=48;width=26;height=13;angle=356;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=216;y=163;width=38;height=12;angle=351;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=242;y=164;width=38;height=12;angle=351;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=239;y=155;width=38;height=12;angle=351;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=273;y=163;width=38;height=12;angle=351;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=266;y=156;width=38;height=12;angle=351;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=266;y=147;width=38;height=12;angle=351;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=304;y=163;width=38;height=12;angle=351;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=297;y=155;width=38;height=12;angle=351;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=294;y=149;width=38;height=12;angle=351;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=290;y=140;width=38;height=12;angle=351;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=333;y=163;width=38;height=12;angle=351;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=329;y=156;width=38;height=12;angle=351;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=324;y=148;width=38;height=12;angle=351;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=320;y=139;width=38;height=12;angle=351;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=317;y=132;width=38;height=12;angle=351;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=363;y=155;width=38;height=12;angle=343;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=357;y=151;width=38;height=12;angle=346;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=354;y=144;width=38;height=12;angle=352;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=349;y=139;width=38;height=12;angle=352;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=348;y=131;width=38;height=12;angle=355;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=347;y=127;width=38;height=12;angle=355;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=385;y=145;width=32;height=12;angle=328;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=382;y=140;width=32;height=12;angle=340;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=380;y=133;width=32;height=12;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=377;y=128;width=32;height=12;angle=5;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=395;y=138;width=24;height=13;angle=326;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=394;y=135;width=24;height=13;angle=343;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=ell;x=393;y=131;width=24;height=13;angle=3;bc=#B8B8B8;pc=#7D7D7D;pw=1|fn=line;x=217;y=80;x1=0;y1=6;x2=30;y2=0;pc=#17480F;pw=4|fn=line;x=268;y=61;x1=42;y1=0;x2=0;y2=13;pc=#17480F;pw=4|fn=line;x=310;y=44;x1=0;y1=17;x2=40;y2=0;pc=#17480F;pw=4|fn=line;x=350;y=33;x1=0;y1=11;x2=23;y2=0;pc=#17480F;pw=4|fn=ell;x=268;y=48;width=64;height=7;angle=319;bc=#17480F;pw=0|fn=ell;x=287;y=42;width=64;height=7;angle=319;bc=#17480F;pw=0|fn=ell;x=308;y=35;width=64;height=7;angle=319;bc=#17480F;pw=0|fn=ell;x=333;y=25;width=64;height=7;angle=319;bc=#17480F;pw=0|fn=ell;x=358;y=14;width=64;height=7;angle=319;bc=#17480F;pw=0 shape=ldtext.Split (ssi "|") EndSub Sub InitStarsLbr ' Initialize stars in Libra star["β Lib"]="ra=15 17 00.47;dec=-09 22 58.3;mag=2.61;fd=27 star["α2 Lib"]="ra=14 50 52.78;dec=-16 02 29.8;mag=2.75;fd=9 star["σ Lib"]="ra=15 04 04.26;dec=-25 16 54.7;mag=3.25;fd=20 star["υ Lib"]="ra=15 37 01.46;dec=-28 08 06.3;mag=3.60;fd=39 star["τ Lib"]="ra=15 38 39.38;dec=-29 46 39.7;mag=3.66;fd=40 star["γ Lib"]="ra=15 35 31.54;dec=-14 47 22.4;mag=3.91;fd=38 star["θ Lib"]="ra=15 53 49.48;dec=-16 43 46.6;mag=4.13;fd=46 star["16 Lib"]="ra=14 57 11.06;dec=-04 20 45.9;mag=4.47;fd=16 star["ι1 Lib"]="ra=15 12 13.31;dec=-19 47 29.9;mag=4.54;fd=24 star["37 Lib"]="ra=15 34 10.52;dec=-10 03 50.3;mag=4.61;fd=37 star["κ Lib"]="ra=15 41 56.82;dec=-19 40 42.9;mag=4.75;fd=43 star["δ Lib"]="ra=15 00 58.39;dec=-08 31 08.2;mag=4.91;fd=19 star["ε Lib"]="ra=15 24 11.93;dec=-10 19 18.8;mag=4.92;fd=31 star["11 Lib"]="ra=14 51 01.02;dec=-02 17 55.9;mag=4.93;fd=11 star["48 Lib"]="ra=15 58 11.38;dec=-14 16 45.5;mag=4.95;fd=48 star["42 Lib"]="ra=15 40 16.91;dec=-23 49 05.0;mag=4.97;fd=42 star["λ Lib"]="ra=15 53 20.06;dec=-20 10 01.2;mag=5.03;fd=45 star["36 Lib"]="ra=15 34 37.31;dec=-28 02 48.9;mag=5.13;fd=36 star["α1 Lib"]="ra=14 50 41.26;dec=-15 59 49.5;mag=5.15;fd=8 star["HR 5780"]="ra=15 34 26.53;dec=-09 11 00.1;mag=5.16 star["ν Lib"]="ra=15 06 37.62;dec=-16 15 24.3;mag=5.19;fd=21 star["12 Lib"]="ra=14 54 20.14;dec=-24 38 31.7;mag=5.27;fd=12 star["μ Lib"]="ra=14 49 19.09;dec=-14 08 56.3;mag=5.32;fd=7 star["HD 126218"]="ra=14 24 48.66;dec=-24 48 22.6;mag=5.34 star["41 Lib"]="ra=15 38 54.51;dec=-19 18 06.2;mag=5.36;fd=41 star["η Lib"]="ra=15 44 04.42;dec=-15 40 21.6;mag=5.41;fd=44 star["49 Lib"]="ra=16 00 19.98;dec=-16 31 56.6;mag=5.47;fd=49 star["ξ2 Lib"]="ra=14 56 46.11;dec=-11 24 35.0;mag=5.48;fd=15 star["HD 138413"]="ra=15 32 36.71;dec=-19 40 13.3;mag=5.50 star["HD 132833"]="ra=15 01 19.81;dec=-02 45 17.5;mag=5.52 star["HD 135534"]="ra=15 16 23.03;dec=-22 23 57.9;mag=5.52 star["ζ4 Lib"]="ra=15 32 55.23;dec=-16 51 10.1;mag=5.53;fd=35 star["30 Ser"]="ra=15 48 56.81;dec=-03 49 06.7;mag=5.53;fd=(30) star["50 Lib"]="ra=16 00 47.64;dec=-08 24 40.8;mag=5.53;fd=50 star["HD 136479"]="ra=15 21 07.64;dec=-05 49 29.4;mag=5.54 star["ζ1 Lib"]="ra=15 28 15.40;dec=-16 42 59.1;mag=5.64;fd=32 star["HD 130529"]="ra=14 49 18.76;dec=-24 15 05.3;mag=5.68 star["4 Lib"]="ra=14 43 13.57;dec=-24 59 51.8;mag=5.70;fd=4 star["Gliese 570"]="ra=14 57 27.35;dec=-21 24 55.7;mag=5.72 star["HD 136956"]="ra=15 23 52.26;dec=-12 22 09.9;mag=5.72 star["HD 134373"]="ra=15 10 18.65;dec=-26 19 57.4;mag=5.75 star["ξ1 Lib"]="ra=14 54 22.91;dec=-11 53 54.0;mag=5.78;fd=13 star["HD 139254"]="ra=15 37 48.06;dec=-23 08 29.5;mag=5.79 star["HD 129944"]="ra=14 46 06.75;dec=-23 09 10.3;mag=5.80 star["ζ3 Lib"]="ra=15 30 40.39;dec=-16 36 34.0;mag=5.82;fd=34 star["HD 139329"]="ra=15 38 16.24;dec=-21 00 58.2;mag=5.82 star["HD 135051"]="ra=15 13 53.32;dec=-26 11 36.8;mag=5.84 star["18 Lib"]="ra=14 58 53.64;dec=-11 08 37.9;mag=5.88;fd=18 star["47 Lib"]="ra=15 55 00.37;dec=-19 22 58.4;mag=5.95;fd=47 edge = "1=θ Lib-γ Lib;2=γ Lib-β Lib;3=β Lib-α2 Lib;4=α2 Lib-σ Lib EndSub Sub Shapes_InitLbr shX = -2234+167 ' x offset shY = 292+167 ' y offset shape = "" ssi="fn=ell;x=0;y=82;width=140;height=71;angle=342;bc=#919191;pw=0|fn=ell;x=13;y=97;width=127;height=73;angle=342;bc=#737373;pw=0|fn=ell;x=7;y=91;width=133;height=70;angle=342;bc=#B8B8B8;pw=0|fn=ell;x=1;y=79;width=141;height=84;angle=342;bc=Transparent;pc=#B8B8B8;pw=4|fn=ell;x=47;y=185;width=127;height=73;angle=342;bc=#737373;pw=0|fn=ell;x=34;y=172;width=140;height=71;angle=342;bc=#919191;pw=0|fn=ell;x=40;y=179;width=133;height=70;angle=342;bc=#B8B8B8;pw=0|fn=ell;x=34;y=168;width=141;height=84;angle=342;bc=Transparent;pc=#B8B8B8;pw=4|fn=rect;x=74;y=52;width=190;height=12;angle=34;bc=#62300F;pw=0|fn=rect;x=154;y=31;width=15;height=61;angle=34;bc=#8A8A8A;pw=0|fn=ell;x=172;y=12;width=27;height=27;angle=359;bc=Transparent;pc=#8A8A8A;pw=4|fn=ell;x=129;y=84;width=21;height=20;angle=359;bc=Transparent;pc=#8A8A8A;pw=4|fn=rect;x=118;y=100;width=32;height=10;angle=34;bc=#8A8A8A;pw=0|fn=tri;x=113;y=106;x1=11;y1=0;x2=0;y2=12;x3=23;y3=12;angle=211;bc=#8A8A8A;pc=#8A8A8A;pw=4|fn=line;x=81;y=0;x1=18;y1=0;x2=0;y2=26;pc=#735412;pw=4|fn=line;x=233;y=99;x1=11;y1=0;x2=0;y2=21;pc=#735412;pw=4|fn=line;x=205;y=119;x1=28;y1=0;x2=0;y2=36;pc=#735412;pw=4|fn=line;x=179;y=116;x1=55;y1=0;x2=0;y2=26;pc=#735412;pw=4|fn=line;x=175;y=120;x1=53;y1=0;x2=0;y2=44;pc=#735412;pw=4|fn=line;x=48;y=24;x1=33;y1=0;x2=0;y2=27;pc=#735412;pw=4|fn=line;x=58;y=25;x1=25;y1=0;x2=0;y2=34;pc=#735412;pw=4|fn=line;x=79;y=25;x1=1;y1=0;x2=0;y2=29;pc=#735412;pw=4|fn=line;x=58;y=57;x1=2;y1=0;x2=0;y2=33;pc=#735412;pw=4|fn=line;x=58;y=88;x1=0;y1=0;x2=7;y2=28;pc=#735412;pw=4|fn=line;x=62;y=114;x1=3;y1=0;x2=0;y2=17;pc=#735412;pw=4|fn=line;x=49;y=131;x1=13;y1=0;x2=0;y2=9;pc=#735412;pw=4|fn=line;x=29;y=139;x1=22;y1=0;x2=0;y2=8;pc=#735412;pw=4|fn=line;x=20;y=147;x1=10;y1=0;x2=0;y2=9;pc=#735412;pw=4|fn=line;x=174;y=156;x1=0;y1=19;x2=32;y2=0;pc=#735412;pw=4|fn=line;x=130;y=173;x1=46;y1=0;x2=0;y2=19;pc=#735412;pw=4|fn=line;x=113;y=192;x1=17;y1=0;x2=0;y2=17;pc=#735412;pw=4|fn=line;x=113;y=209;x1=2;y1=11;x2=0;y2=0;pc=#735412;pw=4|fn=line;x=115;y=219;x1=0;y1=0;x2=19;y2=7;pc=#735412;pw=4|fn=line;x=132;y=220;x1=0;y1=5;x2=31;y2=0;pc=#735412;pw=4|fn=line;x=79;y=52;x1=0;y1=0;x2=1;y2=29;pc=#735412;pw=4|fn=line;x=76;y=81;x1=4;y1=0;x2=0;y2=29;pc=#735412;pw=4|fn=line;x=71;y=111;x1=5;y1=0;x2=0;y2=21;pc=#735412;pw=4|fn=line;x=64;y=129;x1=8;y1=0;x2=0;y2=15;pc=#735412;pw=4|fn=line;x=64;y=144;x1=0;y1=0;x2=2;y2=5;pc=#735412;pw=4|fn=line;x=66;y=149;x1=0;y1=0;x2=12;y2=3;pc=#735412;pw=4|fn=line;x=78;y=148;x1=0;y1=4;x2=19;y2=0;pc=#735412;pw=4|fn=line;x=96;y=148;x1=0;y1=0;x2=10;y2=0;pc=#735412;pw=4|fn=line;x=34;y=51;x1=14;y1=0;x2=0;y2=23;pc=#735412;pw=4|fn=line;x=30;y=74;x1=4;y1=0;x2=0;y2=26;pc=#735412;pw=4|fn=line;x=29;y=101;x1=8;y1=15;x2=0;y2=0;pc=#735412;pw=4|fn=line;x=37;y=116;x1=0;y1=0;x2=15;y2=4;pc=#735412;pw=4|fn=line;x=51;y=112;x1=31;y1=0;x2=0;y2=8;pc=#735412;pw=4|fn=line;x=82;y=94;x1=0;y1=18;x2=2;y2=0;pc=#735412;pw=4|fn=line;x=69;y=79;x1=15;y1=15;x2=0;y2=0;pc=#735412;pw=4|fn=line;x=140;y=163;x1=36;y1=0;x2=0;y2=11;pc=#735412;pw=4|fn=line;x=107;y=174;x1=33;y1=0;x2=0;y2=23;pc=#735412;pw=4|fn=line;x=87;y=197;x1=20;y1=0;x2=0;y2=24;pc=#735412;pw=4|fn=line;x=83;y=220;x1=4;y1=0;x2=0;y2=15;pc=#735412;pw=4|fn=line;x=75;y=235;x1=8;y1=0;x2=0;y2=12;pc=#735412;pw=4|fn=line;x=59;y=247;x1=16;y1=0;x2=0;y2=4;pc=#735412;pw=4|fn=line;x=139;y=140;x1=40;y1=0;x2=0;y2=22;pc=#735412;pw=4|fn=line;x=114;y=162;x1=25;y1=0;x2=0;y2=20;pc=#735412;pw=4|fn=line;x=103;y=183;x1=11;y1=0;x2=0;y2=29;pc=#735412;pw=4|fn=line;x=91;y=211;x1=11;y1=0;x2=0;y2=8;pc=#735412;pw=4|fn=line;x=80;y=220;x1=0;y1=1;x2=10;y2=0;pc=#735412;pw=4|fn=line;x=72;y=203;x1=9;y1=16;x2=0;y2=0;pc=#735412;pw=4|fn=line;x=72;y=190;x1=0;y1=13;x2=6;y2=0;pc=#735412;pw=4|fn=line;x=77;y=171;x1=0;y1=19;x2=19;y2=0;pc=#735412;pw=4 shape=ldtext.Split (ssi "|") EndSub Sub InitStarsLn ' Initialize stars in Leo star["Regulus"]="ra=10 08 22.46;dec=+11 58 01.9;mag=1.36;fd=32 star["γ1 Leo"]="ra=10 19 58.16;dec=+19 50 30.7;mag=2.01;fd=41 star["Denebola"]="ra=11 49 03.88;dec=+14 34 20.4;mag=2.14;fd=94 star["δ Leo"]="ra=11 14 06.41;dec=+20 31 26.5;mag=2.56;fd=68 star["ε Leo"]="ra=09 45 51.10;dec=+23 46 27.4;mag=2.97;fd=17 star["θ Leo"]="ra=11 14 14.44;dec=+15 25 47.1;mag=3.33;fd=70 star["ζ Leo"]="ra=10 16 41.40;dec=+23 25 02.4;mag=3.43;fd=36 star["η Leo"]="ra=10 07 19.95;dec=+16 45 45.6;mag=3.48;fd=30 star["ο Leo A"]="ra=09 41 09.12;dec=+09 53 32.6;mag=3.52;fd=14 star["ο Leo B"]="ra=09 41 13.40;dec=+09 54 35.0;mag=3.70;fd=14 star["γ2 Leo"]="ra=10 19 58.60;dec=+19 50 26.0;mag=3.80;fd=41 star["ρ Leo"]="ra=10 32 48.68;dec=+09 18 23.7;mag=3.84;fd=47 star["μ Leo"]="ra=09 52 45.96;dec=+26 00 25.5;mag=3.88;fd=24 star["ι Leo"]="ra=11 23 55.37;dec=+10 31 46.9;mag=4.00;fd=78 star["σ Leo"]="ra=11 21 08.25;dec=+06 01 45.7;mag=4.05;fd=77 star["54 Leo"]="ra=10 55 36.85;dec=+24 44 59.1;mag=4.30;fd=54 star["υ Leo"]="ra=11 36 56.93;dec=-00 49 25.9;mag=4.30;fd=91 star["λ Leo"]="ra=09 31 43.24;dec=+22 58 05.0;mag=4.32;fd=4 star["31 Leo"]="ra=10 07 54.32;dec=+09 59 51.6;mag=4.39;fd=31 star["60 Leo"]="ra=11 02 19.78;dec=+20 10 47.1;mag=4.42;fd=60 star["φ Leo"]="ra=11 16 39.76;dec=-03 39 05.5;mag=4.45;fd=74 star["κ Leo"]="ra=09 24 39.28;dec=+26 10 56.8;mag=4.47;fd=1 star["93 Leo"]="ra=11 47 59.23;dec=+20 13 08.2;mag=4.50;fd=93 star["72 Leo"]="ra=11 15 12.24;dec=+23 05 43.9;mag=4.56;fd=72 star["χ Leo"]="ra=11 05 01.23;dec=+07 20 10.0;mag=4.62;fd=63 star["π Leo"]="ra=10 00 12.82;dec=+08 02 39.4;mag=4.68;fd=29 star["61 Leo"]="ra=11 01 49.67;dec=-02 29 04.2;mag=4.73;fd=61 star["87 Leo"]="ra=11 30 18.88;dec=-03 00 12.5;mag=4.77;fd=87 star["40 Leo"]="ra=10 19 44.31;dec=+19 28 17.2;mag=4.78;fd=40 star["58 Leo"]="ra=11 00 33.64;dec=+03 37 03.1;mag=4.84;fd=58 star["τ Leo"]="ra=11 27 56.23;dec=+02 51 22.6;mag=4.95;fd=84 star["59 Leo"]="ra=11 00 44.83;dec=+06 06 05.4;mag=4.98;fd=59 star["ξ Leo"]="ra=09 31 56.79;dec=+11 18 00.1;mag=4.99;fd=5 star["10 Leo"]="ra=09 37 12.71;dec=+06 50 08.8;mag=5.00;fd=10 star["6 Leo"]="ra=09 31 57.58;dec=+09 42 56.9;mag=5.07;fd=6 star["48 Leo"]="ra=10 34 48.07;dec=+06 57 13.0;mag=5.07;fd=48 star["75 Leo"]="ra=11 17 17.37;dec=+02 00 39.3;mag=5.18;fd=75 star["ν Leo"]="ra=09 58 13.39;dec=+12 26 41.4;mag=5.26;fd=27 star["92 Leo"]="ra=11 40 47.11;dec=+21 21 10.2;mag=5.26;fd=92 star["22 Leo"]="ra=09 51 53.02;dec=+24 23 44.9;mag=5.29;fd=22 star["73 Leo"]="ra=11 15 51.90;dec=+13 18 27.3;mag=5.31;fd=73 star["53 Leo"]="ra=10 49 15.43;dec=+10 32 42.9;mag=5.32;fd=53 star["ψ Leo"]="ra=09 43 43.90;dec=+14 01 18.1;mag=5.36;fd=16 star["79 Leo"]="ra=11 24 02.34;dec=+01 24 27.9;mag=5.39;fd=79 star["ω Leo"]="ra=09 28 27.38;dec=+09 03 24.4;mag=5.40;fd=2 star["69 Leo"]="ra=11 13 45.58;dec=-00 04 10.2;mag=5.40;fd=69 star["37 Leo"]="ra=10 16 40.75;dec=+13 43 42.1;mag=5.42;fd=37 star["46 Leo"]="ra=10 32 11.80;dec=+14 08 14.0;mag=5.43;fd=46 star["HD 94402"]="ra=10 53 43.76;dec=-02 07 45.3;mag=5.45 star["52 Leo"]="ra=10 46 25.35;dec=+14 11 41.3;mag=5.49;fd=52 star["51 Leo"]="ra=10 46 24.49;dec=+18 53 29.8;mag=5.50;fd=51 star["65 Leo"]="ra=11 06 54.43;dec=+01 57 20.6;mag=5.52;fd=65 star["95 Leo"]="ra=11 55 40.53;dec=+15 38 48.5;mag=5.53;fd=95 star["86 Leo"]="ra=11 30 29.08;dec=+18 24 35.1;mag=5.54;fd=86 star["81 Leo"]="ra=11 25 36.46;dec=+16 27 23.6;mag=5.58;fd=81 star["44 Leo"]="ra=10 25 15.19;dec=+08 47 05.8;mag=5.61;fd=44 star["15 Leo"]="ra=09 43 33.27;dec=+29 58 29.0;mag=5.64;fd=15 star["18 Leo"]="ra=09 46 23.34;dec=+11 48 36.0;mag=5.67;fd=18 star["49 Leo"]="ra=10 35 02.19;dec=+08 39 01.6;mag=5.67;fd=49 star["EO Leo"]="ra=10 02 48.96;dec=+21 56 57.4;mag=5.68 star["67 Leo"]="ra=11 08 49.08;dec=+24 39 30.4;mag=5.70;fd=67 edge = "1=μ Leo-κ Leo;2=κ Leo-λ Leo;3=λ Leo-ε Leo;4=ε Leo-μ Leo;5=μ Leo-ζ Leo; edge = edge + "6=ζ Leo-γ1 Leo;7=γ1 Leo-60 Leo;8=60 Leo-δ Leo;9=δ Leo-Denebola; edge = edge + "10=Denebola-θ Leo;11=θ Leo-δ Leo;12=θ Leo-ι Leo;13=ι Leo-σ Leo; edge = edge + "14=θ Leo-η Leo;15=η Leo-Regulus;16=Regulus-ρ Leo;17=ρ Leo-ο Leo A; edge = edge + "18=η Leo-γ1 Leo EndSub Sub Shapes_InitLn shX = -1500 ' x offset shY = 80 ' y offset shape = "" ssi="fn=ell;x=346;y=92;width=28;height=61;angle=21;bc=#6E4021;pw=0|fn=tri;x=332;y=140;x1=10;y1=0;x2=0;y2=27;x3=20;y3=27;angle=204;bc=#6E4021;pw=0|fn=ell;x=56;y=84;width=135;height=117;bc=#B48637;pw=0|fn=rect;x=388;y=58;width=46;height=31;angle=7;bc=#B48637;pw=0|fn=rect;x=377;y=102;width=47;height=20;angle=16;bc=#B48637;pw=0|fn=rect;x=265;y=160;width=75;height=53;angle=344;bc=#916C2C;pw=0|fn=ell;x=167;y=94;width=169;height=101;bc=#B48637;pw=0|fn=rect;x=275;y=184;width=143;height=29;angle=354;bc=#916C2C;pw=0|fn=rect;x=255;y=211;width=143;height=29;angle=354;bc=#B48637;pw=0|fn=rect;x=249;y=170;width=75;height=53;angle=344;bc=#B48637;pw=0|fn=rect;x=400;y=189;width=53;height=31;angle=36;bc=#916C2C;pw=0|fn=rect;x=379;y=216;width=53;height=31;angle=36;bc=#B48637;pw=0|fn=rect;x=122;y=310;width=53;height=33;angle=21;bc=#916C2C;pw=0|fn=rect;x=101;y=220;width=103;height=32;angle=324;bc=#916C2C;pw=0|fn=rect;x=74;y=280;width=100;height=30;angle=66;bc=#916C2C;pw=0|fn=rect;x=122;y=324;width=53;height=33;angle=21;bc=#B48637;pw=0|fn=rect;x=61;y=279;width=100;height=30;angle=66;bc=#B48637;pw=0|fn=rect;x=132;y=168;width=67;height=71;angle=324;bc=#916C2C;pw=0|fn=rect;x=88;y=218;width=103;height=32;angle=324;bc=#B48637;pw=0|fn=rect;x=94;y=154;width=67;height=71;angle=324;bc=#B48637;pw=0|fn=rect;x=142;y=90;width=96;height=88;angle=359;bc=#B48637;pw=0|fn=tri;x=419;y=61;x1=9;y1=0;x2=0;y2=12;x3=19;y3=12;angle=279;bc=#816027;pw=0|fn=ell;x=280;y=50;width=35;height=68;angle=17;bc=#94572D;pw=0|fn=ell;x=229;y=76;width=61;height=28;angle=348;bc=#94572D;pw=0|fn=ell;x=326;y=62;width=25;height=43;angle=355;bc=#94572D;pw=0|fn=ell;x=308;y=11;width=35;height=54;angle=32;bc=#94572D;pw=0|fn=ell;x=380;y=10;width=35;height=35;bc=#94572D;pw=0|fn=ell;x=309;y=26;width=43;height=30;angle=28;bc=#B48637;pw=0|fn=ell;x=325;y=20;width=92;height=94;bc=#B48637;pw=0|fn=ell;x=389;y=88;width=39;height=18;angle=5;bc=#000000;pw=0|fn=tri;x=421;y=85;x1=4;y1=0;x2=0;y2=17;x3=9;y3=17;angle=180;bc=#B48637;pw=0|fn=tri;x=414;y=94;x1=4;y1=0;x2=0;y2=17;x3=9;y3=17;bc=#B48637;pw=0|fn=tri;x=405;y=85;x1=4;y1=0;x2=0;y2=17;x3=9;y3=17;angle=180;bc=#B48637;pw=0|fn=tri;x=397;y=92;x1=5;y1=0;x2=0;y2=19;x3=10;y3=19;bc=#B48637;pw=0|fn=tri;x=390;y=43;x1=7;y1=0;x2=0;y2=18;x3=14;y3=18;angle=304;bc=#000000;pw=0|fn=ell;x=365;y=1;width=39;height=22;bc=#94572D;pw=0|fn=ell;x=336;y=0;width=43;height=38;bc=#94572D;pw=0|fn=ell;x=302;y=54;width=41;height=70;bc=#94572D;pw=0|fn=ell;x=323;y=84;width=28;height=61;angle=355;bc=#94572D;pw=0|fn=ell;x=325;y=27;width=29;height=44;angle=21;bc=#94572D;pw=0|fn=tri;x=374;y=17;x1=10;y1=0;x2=0;y2=27;x3=20;y3=27;angle=193;bc=#94572D;pw=0|fn=tri;x=348;y=32;x1=10;y1=0;x2=0;y2=27;x3=20;y3=27;angle=165;bc=#94572D;pw=0|fn=tri;x=338;y=58;x1=10;y1=0;x2=0;y2=27;x3=20;y3=27;angle=156;bc=#94572D;pw=0|fn=tri;x=326;y=132;x1=10;y1=0;x2=0;y2=27;x3=20;y3=27;angle=190;bc=#94572D;pw=0|fn=tri;x=308;y=111;x1=10;y1=0;x2=0;y2=27;x3=20;y3=27;angle=190;bc=#94572D;pw=0|fn=tri;x=289;y=100;x1=10;y1=0;x2=0;y2=27;x3=20;y3=27;angle=190;bc=#94572D;pw=0|fn=tri;x=262;y=89;x1=10;y1=0;x2=0;y2=27;x3=20;y3=27;angle=215;bc=#94572D;pw=0|fn=tri;x=220;y=81;x1=10;y1=0;x2=0;y2=27;x3=20;y3=27;angle=257;bc=#94572D;pw=0|fn=ell;x=14.97;y=166.34;width=12.13;height=12.13;bc=#916C2C;pw=0|fn=ell;x=15.02;y=160.89;width=12.26;height=12.26;bc=#926C2C;pw=0|fn=ell;x=15.18;y=155.65;width=12.4;height=12.4;bc=#926D2C;pw=0|fn=ell;x=15.43;y=150.59;width=12.53;height=12.53;bc=#936D2C;pw=0|fn=ell;x=15.8;y=145.71;width=12.66;height=12.66;bc=#936E2C;pw=0|fn=ell;x=16.3;y=140.99;width=12.8;height=12.8;bc=#946E2D;pw=0|fn=ell;x=16.92;y=136.41;width=12.93;height=12.93;bc=#956F2D;pw=0|fn=ell;x=17.69;y=131.97;width=13.06;height=13.06;bc=#956F2D;pw=0|fn=ell;x=18.62;y=127.66;width=13.2;height=13.2;bc=#966F2D;pw=0|fn=ell;x=19.7;y=123.45;width=13.33;height=13.33;bc=#96702D;pw=0|fn=ell;x=20.96;y=119.35;width=13.46;height=13.46;bc=#97702E;pw=0|fn=ell;x=22.4;y=115.32;width=13.6;height=13.6;bc=#98712E;pw=0|fn=ell;x=24.04;y=111.37;width=13.73;height=13.73;bc=#98712E;pw=0|fn=ell;x=25.87;y=107.48;width=13.86;height=13.86;bc=#99722E;pw=0|fn=ell;x=27.92;y=103.64;width=14;height=14;bc=#99722E;pw=0|fn=ell;x=30.18;y=99.82;width=14.13;height=14.13;bc=#9A722E;pw=0|fn=ell;x=32.68;y=96.03;width=14.26;height=14.26;bc=#9A732F;pw=0|fn=ell;x=35.42;y=92.25;width=14.4;height=14.4;bc=#9B732F;pw=0|fn=ell;x=38.41;y=88.47;width=14.53;height=14.53;bc=#9C742F;pw=0|fn=ell;x=41.66;y=84.66;width=14.66;height=14.66;bc=#9C742F;pw=0|fn=ell;x=45.82;y=80.25;width=14.8;height=14.8;bc=#9D752F;pw=0|fn=ell;x=48.87;y=75.89;width=14.93;height=14.93;bc=#9D7530;pw=0|fn=ell;x=50.86;y=71.64;width=15.06;height=15.06;bc=#9E7530;pw=0|fn=ell;x=51.86;y=67.58;width=15.2;height=15.2;bc=#9F7630;pw=0|fn=ell;x=51.92;y=63.77;width=15.33;height=15.33;bc=#9F7630;pw=0|fn=ell;x=51.11;y=60.27;width=15.46;height=15.46;bc=#A07730;pw=0|fn=ell;x=49.47;y=57.15;width=15.6;height=15.6;bc=#A07730;pw=0|fn=ell;x=47.08;y=54.48;width=15.73;height=15.73;bc=#A17831;pw=0|fn=ell;x=43.98;y=52.32;width=15.86;height=15.86;bc=#A17831;pw=0|fn=ell;x=40.25;y=50.75;width=16;height=16;bc=#A27931;pw=0|fn=ell;x=35.92;y=49.81;width=16.13;height=16.13;bc=#A37931;pw=0|fn=ell;x=31.07;y=49.59;width=16.26;height=16.26;bc=#A37931;pw=0|fn=ell;x=25.75;y=50.14;width=16.4;height=16.4;bc=#A47A32;pw=0|fn=ell;x=20.02;y=51.54;width=16.53;height=16.53;bc=#A47A32;pw=0|fn=ell;x=13.94;y=53.85;width=16.66;height=16.66;bc=#A57B32;pw=0|fn=ell;x=7.57;y=57.13;width=16.8;height=16.8;bc=#A67B32;pw=0|fn=ell;x=0.97;y=61.45;width=16.93;height=16.93;bc=#A67C32;pw=0|fn=ell;x=-5.82;y=66.88;width=17.06;height=17.06;bc=#A77C32;pw=0|fn=ell;x=-12.71;y=73.49;width=17.2;height=17.2;bc=#A77C33;pw=0|fn=ell;x=-19.67;y=81.33;width=17.33;height=17.33;bc=#A87D33;pw=0|fn=ell;x=-23.18;y=86.57;width=17.46;height=17.46;bc=#A87D33;pw=0|fn=ell;x=-25.81;y=91.89;width=17.6;height=17.6;bc=#A97E33;pw=0|fn=ell;x=-27.56;y=97.18;width=17.73;height=17.73;bc=#AA7E33;pw=0|fn=ell;x=-28.47;y=102.38;width=17.86;height=17.86;bc=#AA7F34;pw=0|fn=ell;x=-28.55;y=107.4;width=18;height=18;bc=#AB7F34;pw=0|fn=ell;x=-27.84;y=112.16;width=18.13;height=18.13;bc=#AB7F34;pw=0|fn=ell;x=-26.35;y=116.57;width=18.26;height=18.26;bc=#AC8034;pw=0|fn=ell;x=-24.11;y=120.56;width=18.4;height=18.4;bc=#AD8034;pw=0|fn=ell;x=-21.14;y=124.03;width=18.53;height=18.53;bc=#AD8134;pw=0|fn=ell;x=-17.46;y=126.91;width=18.66;height=18.66;bc=#AE8135;pw=0|fn=ell;x=-13.11;y=129.12;width=18.8;height=18.8;bc=#AE8235;pw=0|fn=ell;x=-8.09;y=130.57;width=18.93;height=18.93;bc=#AF8235;pw=0|fn=ell;x=-2.43;y=131.18;width=19.06;height=19.06;bc=#AF8235;pw=0|fn=ell;x=3.83;y=130.87;width=19.2;height=19.2;bc=#B08335;pw=0|fn=ell;x=10.69;y=129.55;width=19.33;height=19.33;bc=#B18336;pw=0|fn=ell;x=18.11;y=127.14;width=19.46;height=19.46;bc=#B18436;pw=0|fn=ell;x=26.07;y=123.57;width=19.6;height=19.6;bc=#B28436;pw=0|fn=ell;x=34.56;y=118.74;width=19.73;height=19.73;bc=#B28536;pw=0|fn=ell;x=43.54;y=112.58;width=19.86;height=19.86;bc=#B38536;pw=0|fn=ell;x=53;y=105;width=20;height=20;bc=#B48637;pw=0|fn=ell;x=422;y=241;width=18;height=27;angle=342;bc=#B48637;pw=0|fn=ell;x=410;y=245;width=17;height=27;angle=344;bc=#B48637;pw=0|fn=ell;x=445;y=207;width=19;height=24;angle=334;bc=#916C2C;pw=0|fn=ell;x=443;y=214;width=18;height=27;angle=342;bc=#916C2C;pw=0|fn=ell;x=435;y=220;width=17;height=27;angle=344;bc=#916C2C;pw=0|fn=ell;x=425;y=234;width=19;height=24;angle=334;bc=#B48637;pw=0|fn=ell;x=172;y=318;width=18;height=27;angle=319;bc=#916C2C;pw=0|fn=ell;x=170;y=332;width=18;height=27;angle=342;bc=#916C2C;pw=0|fn=ell;x=167;y=327;width=19;height=30;angle=305;bc=#B48637;pw=0|fn=ell;x=171;y=341;width=18;height=27;angle=319;bc=#B48637;pw=0|fn=ell;x=160;y=346;width=18;height=27;angle=319;bc=#B48637;pw=0|fn=ell;x=3;y=173;width=26;height=49;angle=12;bc=#94572D;pw=0|fn=tri;x=8;y=206;x1=8;y1=0;x2=0;y2=26;x3=17;y3=26;angle=190;bc=#94572D;pw=0|fn=tri;x=0;y=199;x1=6;y1=0;x2=0;y2=25;x3=12;y3=25;angle=197;bc=#94572D;pw=0|fn=tri;x=2;y=206;x1=8;y1=0;x2=0;y2=33;x3=16;y3=33;angle=193;bc=#94572D;pw=0|fn=tri;x=346;y=136;x1=7;y1=0;x2=0;y2=31;x3=15;y3=31;angle=197;bc=#6E4021;pw=0 shape=ldtext.Split (ssi "|") EndSub Sub InitStars wrap="true For g=1 To 113 star[g]=" " EndFor star[99]="ra=01 31 28.99;dec=+15 20 45.0;mag=3.62 star[6] ="ra=23 17 09.49;dec=+03 16 56.1;mag=3.70 star[28]="ra=23 59 18.60;dec=+06 51 48.9;mag=4.03 star[17]="ra=23 39 56.82;dec=+05 37 38.5;mag=4.13 star[110]="ra=01 45 23.59;dec=+09 09 27.5;mag=4.26 star[71]="ra=01 02 56.66;dec=+07 53 24.3;mag=4.27 star[10]="ra=23 27 58.17;dec=+06 22 44.8;mag=4.27 star[113]="ra=02 02 02.80;dec=+02 45 49.5;mag=4.33 star[30]="ra=00 01 57.59;dec=−06 00 50.3;mag=4.37 star[63]="ra=00 48 40.90;dec=+07 35 06.7;mag=4.44 star[106]="ra=01 41 25.91;dec=+05 29 15.4;mag=4.45 star[4] ="ra=23 03 52.61;dec=+03 49 12.3;mag=4.48 star[18]="ra=23 42 02.88;dec=+01 46 49.5;mag=4.49 star[83]="ra=01 11 39.59;dec=+30 05 23.0;mag=4.51 star[33]="ra=00 05 20.15;dec=−05 42 28.2;mag=4.61 star[111]="ra=01 53 33.34;dec=+03 11 14.9;mag=4.61 star[84]="ra=01 11 27.19;dec=+21 02 04.8;mag=4.66 star[85]="ra=01 13 44.94;dec=+24 35 01.6;mag=4.67 star[90]="ra=01 19 27.98;dec=+27 15 50.7;mag=4.74 star[98]="ra=01 30 10.94;dec=+06 08 38.2;mag=4.84 star[27]="ra=23 58 40.41;dec=−03 33 20.9;mag=4.88 star[8] ="ra=23 26 55.91;dec=+01 15 21.0;mag=4.95 star[19]="ra=23 46 23.54;dec=+03 29 12.7;mag=4.95 star[47]="ra=00 28 02.84;dec=+17 53 35.1;mag=5.01 star[7] ="ra=23 20 20.54;dec=+05 22 53.2;mag=5.05 star[64]="ra=00 48 58.71;dec=+16 56 28.1;mag=5.07 star[29]="ra=00 01 49.44;dec=−03 01 38.9;mag=5.13 star[89]="ra=01 17 47.98;dec=+03 36 52.3;mag=5.13 star[82]="ra=01 11 06.77;dec=+31 25 29.2;mag=5.15 star[86]="ra=01 13 43.80;dec=+07 34 31.8;mag=5.21 star[113]="ra=02 02 02.80;dec=+02 45 49.0;mag=5.23 star[91]="ra=01 21 07.35;dec=+28 44 18.2;mag=5.23 star[107]="ra=01 42 29.95;dec=+20 16 12.5;mag=5.24 star[93]="ra=01 26 15.28;dec=+19 10 20.4;mag=5.35 star[55]="ra=00 39 55.55;dec=+21 26 18.8;mag=5.36 star[57]="ra=00 46 32.98;dec=+15 28 32.2;mag=5.36 star[41]="ra=00 20 35.86;dec=+08 11 24.9;mag=5.38 star[52]="ra=00 32 35.40;dec=+20 17 40.0;mag=5.38 star[5] ="ra=23 08 40.84;dec=+02 07 39.4;mag=5.42 star[2] ="ra=22 59 27.40;dec=+00 57 47.1;mag=5.43 star[68]="ra=00 57 50.15;dec=+28 59 32.0;mag=5.44 star[20]="ra=23 47 56.49;dec=−02 45 41.8;mag=5.49 star[69]="ra=01 02 49.09;dec=+31 48 15.6;mag=5.50 star[94]="ra=01 26 41.65;dec=+19 14 26.0;mag=5.50 star[58]="ra=00 47 01.43;dec=+11 58 26.2;mag=5.51 star[80]="ra=01 08 22.34;dec=+05 39 00.8;mag=5.51 star[34]="ra=00 10 02.18;dec=+11 08 44.9;mag=5.54 star[102]="ra=01 37 05.96;dec=+12 08 29.4;mag=5.54 star[74]="ra=01 05 41.68;dec=+21 27 55.7;mag=5.55 star[79]="ra=01 07 57.11;dec=+20 44 21.6;mag=5.56 star[81]="ra=01 09 49.20;dec=+19 39 30.2;mag=5.57 star[22]="ra=23 51 57.83;dec=+02 55 49.5;mag=5.59 star[72]="ra=01 05 05.35;dec=+14 56 45.6;mag=5.64 star[16]="ra=23 36 23.35;dec=+02 06 07.5;mag=5.68 star[51]="ra=00 32 23.75;dec=+06 57 19.6;mag=5.69 star[32]="ra=00 02 29.76;dec=+08 29 08.1;mag=5.70 star[44]="ra=00 25 24.22;dec=+01 56 23.0;mag=5.77 star[21]="ra=23 49 27.48;dec=+01 04 34.3;mag=5.77 star[66]="ra=00 54 35.22;dec=+19 11 18.4;mag=5.80 edge = "1=69-83;2=83-90;3=90-85;4=85-74;5=74-84;6=84-99;7=99-110; edge = edge + "8=110-113;9=113-106;10=106-71;11=71-63;12=63-28; edge = edge + "13=28-10;14=10-6;15=6-8;16=8-18 EndSub End>LGC490.sb< Start>LGD567.sb< GraphicsWindow.KeyDown=kkk Shapes.AddEllipse(10,10) GraphicsWindow.Width =1500 GraphicsWindow.Height =900 gg=LDShapes.BrushGradient ("1=#00aaaa;2=#008080;3=#000080","DD") LDGraphicsWindow.BackgroundBrushGradient(gg) t_x=30 t_y=700 Turtle.Speed=10 Turtle.PenUp () flmd=1 t_Angle =75 t_PenDown () penn="True aa=30 tc=0 ctx=0 cty=0 dd=0 vmir=0 xmr=0 ss=-0.5 ii=10 sm="False par["a90r"]="15;6" par["a180r"]="30;6" par["b90r"]="9;10" par["b180r"]="18;10 par["a90l"]="-15;6" par["a180l"]="-30;6" par["b90l"]="-9;10" par["b180l"]="-18;10" par["f5"]="0;5" par["f9"]="0;9" par["f3"]="0;2" par["f1"]="0;1" par["f10"]="0;10" par["f11"]="0;11" par["f15"]="0;15" par["f14"]="0;14" par["f40"]="0;40" par["f20"]="0;20" par["f21"]="0;21 par["f30"]="0;30" par["f31"]="0;31" par["f27"]="0;26 def["E"]="f15|b90r|f11|a180r|f10|a90l|f1|a90l|f9|a180r|f9|a90l|f1|a90l|f10|a180r|f11|b90r" def["C"]="f15|b90r|f11|a180r|f10|a90l|f14|a90l|f10|a180r|f11|b90r" def["L"]="f20|a180r|f20|a90l|f10|a180r|f11|b90r" def["I"]="f27|a180r|f27|a180r" def["T"]="f20|a90l|f5|a180r|f21|a180r|f5|a90l|f20|a180r def["F"]="f20|a180r|f20|a90l|f10|a180r|f11|b90r" spd["L"][1]=140 spd["L"][2]=0 spd["C"][1]=140 spd["C"][2]=0 spd["E"][1]=140 spd["E"][2]=0 spd["I"][1]=90 spd["I"][2]=-28 spd["T"][1]=150 spd["T"][2]=-28 GraphicsWindow.PenWidth=3 'c1=LDDialogs.Colour() args=0 sc=0 t_x=30 t_y=190 Bang =75'default angle for 0 gr. chars dang=0 t_Angle =dang+Bang cc="" txx0="CELTIC.TILT i-bcefghijklmnopxlorem.ipsum.dolor.sit.ament.quick.brown.fox.jumps.over'lazydog" '"EXPO2015;MILANO#fiORi;1_5_._1_1Q_2Q15_" txx0=text.ConvertToUpperCase (txx0) For z=0 to 5 dang=0 t_Angle =dang+Bang t_x=30 t_y=190 ca=z*3 txx= Text.GetSubTextToEnd (txx0,1) For ff=1 To 12 cc= Text.GetSubText (txx,ff,1) If cc="." then ctx=90 cty=0 ctpos() else LDCall.Function ("drwch",ca) endif xxx: endfor Program.Delay(4333) GraphicsWindow.Clear () endfor Sub drwch '------------------------------draws chars spa=args[1] dang=dang+spa oa=dang t_Angle=dang+bang ox=t_x oy=t_y spp=0 ctx=0 cty=spd[cc][2] ctpos () td=ldtext.Split(def[cc],"|") t_pendown () For xi=1 to Array.GetItemCount (td) cm=par[td[xi]] ' TextWindow.WriteLine (xi+"> "+td[xi]+": "+cm) tw=ldtext.Split(cm,";") dd=tw[1] LDCall.Function ("sewto",tw[2]) endfor t_penup () spp=spd[cc][1] t_Angle = oa Turtle.Angle =dang+90 Turtle.x=ox Turtle.y=oy Turtle.Move(spp) dang=dang+spa t_x= Turtle.X t_y= Turtle.Y t_Angle=Turtle.Angle Endsub Sub ctpos Turtle.Angle=dang Turtle.x=t_x Turtle.y=t_y Turtle.Move(cty) Turtle.TurnRight () Turtle.Move(ctx) t_x=Turtle.X t_y=turtle.y endsub Sub kkk lk = GraphicsWindow.LastKey If lk="Left" Then dd=dd-0.1 elseIf lk="Right" Then dd=dd+0.1 elseif lk="Space" then dd=0 endif GraphicsWindow.Title=dd EndSub Sub sewto fff=args[1] For x=1 To math.Abs(fff) If ii<6 Then t_PenUp () Else t_PenDown () endif GraphicsWindow.PenColor=LDColours.HSLtoRGB(sc,1,0.8) sc=sc+2 ldcall.function("t_Move",10) ldcall.function("t_Turn",-180+aa+dd) GraphicsWindow.PenColor="Black ldcall.function("t_Move",ii) ldcall.function("t_Turn",180-aa) If sm then ii=ii+ss If Math.Remainder(x,2)=0 Then ii=ii+ss/3 endif If (ss<0) And (ii<1) Then ss=-ss ii=1 endif If (ss>0 And ii>10) Then ss=-ss ii=10 endif endif GraphicsWindow.title=x 'GraphicsWindow.title="Done%:"+Math.Round ((x/1600)*100) endfor EndSub Sub ang1 dd=-15 LDCall.Function ("sewto",6) dd=0 EndSub Sub ang2 dd=15 LDCall.Function ("sewto",6) dd=0 EndSub Sub ang3 dd=15 LDCall.Function ("sewto",12) dd=0 EndSub Sub ang4 dd=15 LDCall.Function ("sewto",4) dd=0 EndSub Sub t_Turn t_Angle =t_Angle +args[1] EndSub sub t_Move ds=args[1] mm=LDMath.Convert2Cartesian (t_x,t_y,ds, t_Angle-90 ) If penn then If vmir=1 Then GraphicsWindow.DrawLine (xmr -math.Round(t_x),math.Round(t_y),xmr-math.Round (mm[1]),math.Round (mm[2])) Else GraphicsWindow.DrawLine (math.Round(t_x),math.Round(t_y),math.Round (mm[1]),math.Round (mm[2])) endif t_x= (mm[1]) t_y= (mm[2]) mi=mi+1 If vmir=1 Then pmm[mi][1]=xmr - t_x Else pmm[mi][1]= t_x EndIf pmm[mi][2]=t_y endif EndSub Sub t_TurnRight t_Angle =t_Angle +90 EndSub Sub t_TurnLeft t_Angle =t_Angle -90 EndSub Sub t_pendown penn="True EndSub Sub t_penup penn="Fale EndSub Sub pshw rc1= LDColours.HSLtoRGB(Math.GetRandomNumber(60),1,0.8) bcc= LDText.Split(Rc1+" Yellow Orange"," ") bgp= LDShapes.BrushGradient (bcc,"DD") If flmd=1 then LDShapes.BrushGradientPolygon(bgp,pmm) endif EndSub End>LGD567.sb< Start>LGF321.sb< ' Import ID - combinations ' Copyright © 2017 Nonki Takahashi. The MIT License. TextWindow.Title = "Import ID - combinations" TextWindow.WriteLine("Possible number of Small Basic Import ID combinations") alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" digit = "0123456789" TextWindow.WriteLine("(full alphabet)") PrintCombinations() alpha = "BCDFGHJKLMNPQRSTVWXZ" ' except AEIOUY TextWindow.WriteLine("(except AEIOUY)") PrintCombinations() Sub PrintCombinations na = Text.GetLength(alpha) nd = Text.GetLength(digit) nid = na * na * na * nd * nd * nd TextWindow.WriteLine("= " + na + "^3 * " + nd + "^3 = " + nid) TextWindow.WriteLine("") EndSub End>LGF321.sb< Start>LGK382-0.sb< GameWindow.Show() For i = 1 to 200 lines[i] = i*Math.GetRandomNumber(100000) EndFor scrollbar = GameControls.AddButton("=",GameWindow.Width-20,0,20,50) GameMouse.MouseMove = move GameMouse.MouseDown = click GameMouse.MouseUp = up isMouseover = 0 updateingscrollbar = 0 drawlist() GameControls.SetEnabled(scrollbar,"False") Sub click x = GameMouse.MouseX If x > GameControls.GetX(scrollbar) And x < GameControls.GetX(scrollbar)+20 Then isMouseover = 1 EndIf EndSub Sub up isMouseover = 0 EndSub Sub move y = GameMouse.MouseY If GameMouse.IsLeftButtonDown Then If isMouseover = 1 Then If (updateingscrollbar = 0) Then updateingscrollbar = 1 If y < 25 Then y = 25 EndIf If y > GameWindow.Height-25 Then y = GameWindow.Height-25 EndIf GameControls.Move(scrollbar,GameWindow.Width-20,y-25,0) id = GameControls.GetY(scrollbar) updatelist() updateingscrollbar = 0 EndIf EndIf EndIf EndSub Sub drawlist For i = 1 To 10 linesT[i] = GameControls.AddText(lines[i],20,20*i,"Arial",12,"False","False") EndFor EndSub Sub updatelist For i = 1 To 10 GameControls.SetText(linesT[i],lines[i+id]) EndFor EndSub End>LGK382-0.sb< Start>LGK382.sb< GameWindow.Show() lines = FilePlus.ReadFileToArray("test.txt") scrollbar = GameControls.AddButton("=",GameWindow.Width-20,0,20,50) GameControls.RegisterMouseMoveEvent(scrollbar,"move") updateingscrollbar = 0 drawlist() Sub move If (updateingscrollbar = 0) Then updateingscrollbar = 1 y = GameMouse.MouseY If y < 25 Then y = 25 EndIf If y > GameWindow.Height-25 Then y = GameWindow.Height-25 EndIf GameControls.Move(scrollbar,GameWindow.Width-20,y-25,0) updatelist() updateingscrollbar = 0 EndIf EndSub Sub drawlist For i = 1 To 10 linesT[i] = GameControls.AddText(lines[i],20,20*i,"Arial",12,"False","False") EndFor EndSub Sub updatelist For i = 1 To 10 GameControls.SetText(linesT[i],lines[i+y]) EndFor EndSub End>LGK382.sb< Start>LGL627.sb< GraphicsWindow.PenWidth=1.5 GraphicsWindow.BackgroundColor="darkblue GraphicsWindow.PenColor="white GraphicsWindow.Title="Shapes GraphicsWindow.Width=1200 GraphicsWindow.Height=800 sx=10 sy=-10 For hh=GraphicsWindow.Height To 100 Step -160 For ff=1 To 5 sx=(ff-1)*230 drr() EndFor EndFor Sub drr args=0 lx=32 ly=32 GraphicsWindow.PenWidth=math.GetRandomNumber(4) GraphicsWindow.PenColor=LDColours.HSLtoRGB(math.GetRandomNumber(24)*15 1 .7) ldcall.function4("pdrw" LX LY, 0,39 ) ldcall.function4("pdrw" LX LY, 39,0) ldcall.function4("pdrw" LX LY, 0,-39) ldcall.function4("pdrw" LX LY, -39 0) '----- Shape B lx=48 ly=88 varr() GraphicsWindow.PenWidth=math.GetRandomNumber(4) GraphicsWindow.PenColor=LDColours.HSLtoRGB(math.GetRandomNumber(24)*15 1 .7) ldcall.function4("pdrw" LX LY, 23,71) ldcall.function4("pdrw" LX LY, 24,-63) ldcall.function4("pdrw" LX LY, -47,-8) '----- Shape C lx= 120 ly=152 varr() GraphicsWindow.PenWidth=math.GetRandomNumber(4) GraphicsWindow.PenColor=LDColours.HSLtoRGB(math.GetRandomNumber(24)*15 1 .7) ldcall.function4("pdrw" LX LY, 15,15) ldcall.function4("pdrw" LX LY, 80,-72) ldcall.function4("pdrw" LX LY, -15,-15) ldcall.function4("pdrw" LX LY, -80,72) '----- Shape D lx= 96 ly=24 varr() GraphicsWindow.PenWidth=math.GetRandomNumber(4) GraphicsWindow.PenColor=LDColours.HSLtoRGB(math.GetRandomNumber(24)*15 1 .7) ldcall.function4("pdrw" LX LY, 0,47) ldcall.function4("pdrw" LX LY, 31,32) ldcall.function4("pdrw" LX LY, 48,-32) ldcall.function4("pdrw" LX LY, 0,-47) ldcall.function4("pdrw" LX LY, -79,0) '----- Shape E GraphicsWindow.PenWidth=math.GetRandomNumber(4) GraphicsWindow.PenColor=LDColours.HSLtoRGB(math.GetRandomNumber(24)*15 1 .7) varr() ldcall.function4("pdrw" 192 39 0,17) ldcall.function4("pdrw" LX LY, 15,15) ldcall.function4("pdrw" LX LY, 17,0) ldcall.function4("pdrw" LX LY, 15,-15) ldcall.function4("pdrw" LX LY, 0,-17) ldcall.function4("pdrw" LX LY, -15,-15) ldcall.function4("pdrw" LX LY, -17,0) ldcall.function4("pdrw" LX LY, -15,15) EndSub sub varr sx=sx+Math.GetRandomNumber(16)-8 sy=sy+math.GetRandomNumber(6)-3 EndSub Sub pdrw lx=args[1]+args[3] ly=args[2]+args[4] GraphicsWindow.drawLine(sx+args[1] sy+hh-(args[2]) sx+lx sy+hh-ly) EndSub End>LGL627.sb< Start>LGM094.sb< re: TextWindow.WriteLine("enter dealer or player hand to analyze") jugadadealer=TextWindow.Read() TextWindow.WriteLine("enter limit 17 for the house strategy 12 for the no bust ideal startegy") tope=TextWindow.Read() TextWindow.WriteLine("enter ace flag, 1 if the hand has an ace 0 if no ace") dflag=textwindow.Read() If jugadadealer=1 then jugadadealer=11 dflag=1 Else dflag=0 endif TextWindow.WriteLine("enter player 1st card to analize score after a single hit(double down)") firstcard=TextWindow.Read() TextWindow.WriteLine("enter player 2nd card") secondcard=TextWindow.Read() jugadaplayer=firstcard+secondcard If firstcard=1 or secondcard=1 then jugadaplayer=jugadaplayer+10 pflag=1 Else pflag=0 endif dealer() player() Goto re Sub dealer total=0 For i=0 To 1000 hand=jugadadealer flag=dflag While hand10 Then card=10 EndIf If card=1 Then card=11 flag=1 EndIf hand=hand+card rep: EndWhile If hand>21 Then If flag=1 Then hand=hand-10 flag=0 Goto rep EndIf hand=0 EndIf total=total+hand endfor TextWindow.WriteLine("dealer or player average score"+total/i) EndSub Sub player total=0 For i=0 To 1000 hand= jugadaplayer flag=pflag card=Math.GetRandomNumber(13) If card>10 Then card=10 EndIf If card=1 Then flag=1 card=11 EndIf hand=hand+card If hand>21 Then If flag=1 then hand=hand-10 flag=0 Goto skip EndIf hand=0 EndIf skip: total=total+hand EndFor TextWindow.WriteLine("average player score after a single hit "+total/i) EndSub End>LGM094.sb< Start>LGM557-0.sb< graphicwindow() player() bunker() Createmissiles() createinvader() 'missile shooting loop While shoot = 0 invadermove() If (spaceDown) Then FireMissile() spaceDown = "False" EndIf Updatemissiles() delay = 20 If (delay > 0) Then Program.Delay(delay) EndIf invadermove() processKey() Shapes.Move(player,playerX-25,playerY-25) EndWhile 'Graphic Window Sub graphicwindow GraphicsWindow.Title = "V-Space Invader" gw = 700 gh = 600 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp keyLeft = 0 keyRight = 0 key = 0 shoot = 0 'GraphicsWindow.BackgroundColor = "black" 'TitleLogo = Shapes.AddImage("http://i61.tinypic.com/14w4r5k.png") 'Shapes.Move(TitleLogo,gw - 468,gh - 400) 'GraphicsWindow.DrawText(10, gh - 20, "Loading...") 'Program.Delay(5000) 'Shapes.Remove(TitleLogo) GraphicsWindow.DrawImage("http://i58.tinypic.com/21afh2o.png",0,0) 'Space EndSub 'Player Sub player player = Shapes.AddImage("http://i62.tinypic.com/2nhkowg.png") 'player ship playerX = 300 'player starting x coordinates playerY = 550 'player starting y coordinates Lives = 3 Score = 0 speed = 7 'speed at which player moves HP = 100 blank = 0 'since IDK know how to remove a draw.text this covers the old one invnum = 5 'starting number of invaders Shapes.Move(player,playerX,playerY) 'ship starts in the mid bottom of the map For y = 1 To 1 writeText[y] = Shapes.AddText("Lives: "+Lives+" Score: "+Score) Shapes.Move(writeText[y], 30,gh-590) EndFor EndSub 'Bunkers Sub bunker bb = 100 For i = 1 To 3 Bunker[i] = Shapes.AddImage("http://i58.tinypic.com/egz90o.png") Shapes.Move(Bunker[i],bb,410) bb = bb + 200 EndFor For x = 1 To 3 writeText[x] = Shapes.AddText("HP: " + HP) Shapes.Move(writeText[x], 120 + ((x-1)*200), 415) EndFor EndSub Sub collision_check For j=1 To invnum If (invaderX[j]<=missileData["Xpos"]+10 And missileData["Xpos"]+10 < invaderX[j]+70) and (invaderY[j]<=missileData["Ypos"] And missileData["Ypos"] < invaderY[j]+54) then 'when missile hits an invader, the invader disappears Shapes.Remove(invader[j]) ' Note missile width=20 // missile center=10 invader width= 70 height=54 j=invnum Hits="True" EndIf EndFor EndSub 'Invader Sub invadermove ' If (missileData["Ypos"] >= invaderX[i]) And (missileData["Ypos"] < invaderX[i]) then 'when missile hits an invader, the invader disappears ' For i = 1 To invnum ' Shapes.Remove(invader[i]) ' EndFor ' EndIf If pos >= 1800 then 'if a invader hits the bottom they disappear and you lose 1 life For i = 1 To invnum Shapes.Remove(invader[i]) EndFor invnum = invnum + 1 'adds 1 invader after each wave createinvader() 'creates the new wave Lives = Lives - 1 'life lost since an invader hitted Earth blank = 1 'removes blank black image that cover old Shapes.AddText("Lives: "+Lives+" Score: "+Score) If blank = 1 then Shapes.Remove("http://i57.tinypic.com/5k4p6h.png") EndIf Shapes.AddImage("http://i57.tinypic.com/5k4p6h.png") 'cover old Shapes.AddText("Lives: "+Lives+" Score: "+Score) since IDK how to remove it Shapes.Move("http://i57.tinypic.com/5k4p6h.png",0,0) writeText[y] = Shapes.AddText("Lives: "+Lives+" Score: "+Score) 'writes out new score and lives Shapes.Move(writeText[y], 30,gh-590) If Lives = 0 Then 'when you have no lives its game over Program.End() EndIf EndIf pos = pos + 1 'when pos >= 1800 invaders are at the bottom For i = 1 To invnum invaderX[i] = Shapes.GetLeft(invader[i]) ' Invader's new position -X ddy[i]=0 ' speed Y is usually zero If (invaderX[i]<-100 Or gw. -3 , -3 --> +3 ) ddy[i]=ddxy[i]["Y"] ' speed Y changes to +50 ( 0 --> +50) EndIf Shapes.Move(invader[i],Shapes.GetLeft(invader[i])+ddxy[i]["X"],Shapes.GetTop(invader[i])+ddy[i]) ' invader moved invaderX[i] = Shapes.GetLeft(invader[i]) '<-----------Invader's new position -X invaderY[i]= Shapes.Gettop(invader[i]) '<-----------Invader's new position -Y EndFor EndSub Sub createinvader For i = 1 To invnum pos = 0 invader[i] = Shapes.AddImage("http://i59.tinypic.com/2v2v1pz.png") Shapes.Move(invader[i],i*80,10) ddxy[i]="X=3;Y=50" ' invader's speed // x-direction=3 Y-dirction =50 EndFor EndSub Sub Createmissiles missileImage = ImageList.LoadImage("http://i61.tinypic.com/vxn1xy.png") 'missile dimensions we use the half width and height missileWidth = ImageList.GetWidthOfImage(missileImage)/2 missileHeight = ImageList.GetHeightOfImage(missileImage)/2 nummissile = 5 For i = 1 To nummissile missileData["image"] = Shapes.AddImage(missileImage) missileData["Xpos"] = missileWidth + Math.GetRandomNumber(gw-2*missileWidth) missileData["Ypos"] = gh-missileHeight missileData["Xvel"] = 0 missileData["Yvel"] = -5 missileData["Status"] = 0 Shapes.HideShape(missileData["image"]) missiles[i] = missileData EndFor Hits="False" ' <-------------- Initial = "False" EndSub Sub Updatemissiles For i = 1 To nummissile missileData = missiles[i] 'get current missile array If (missileData["Status"] = 1) Then 'Reposition missile center missileData["Xpos"] = missileData["Xpos"] + missileData["Xvel"] missileData["Ypos"] = missileData["Ypos"] + missileData["Yvel"] 'Move missile center Shapes.Move(missileData["image"],missileData["Xpos"]-missileWidth,missileData["Ypos"]-missileHeight) 'missile finished with collision_check() ' <-------------- If (missileData["Ypos"] < -missileHeight) or Hits="True" Then missileData["Status"] = 0 Shapes.HideShape(missileData["image"]) Hits="False" ' <-------------- EndIf missiles[i] = missileData 'save updated missile array (it may have been modified) EndIf EndFor EndSub Sub FireMissile NN=NN+1 ' increment missile number missileData = missiles[NN] ' get NN'th missile array If (missileData["Status"] = 0) Then missileData["Status"] = 1 Shapes.ShowShape(missileData["image"]) missileData["Xpos"] = playerX + 6 missileData["Ypos"] = playerY + 10 missiles[NN] = missileData 'save updated missile array (it may have been modified) EndIf If NN=nummissile Then NN=0 ' to recycle EndIf EndSub Sub OnKeyDown lastkey = GraphicsWindow.LastKey If lastkey = "Space" then shoot = 0 spaceDown = "True" EndIf If (lastKey = "Left") Then keyLeft = 1 ElseIf (lastKey = "Right") Then keyRight = 1 EndIf If lastkey = "Escape" Then Program.End() EndIf EndSub Sub OnKeyUp lastKey = GraphicsWindow.LastKey If (lastKey = "Left") Then keyLeft = 0 ElseIf (lastKey = "Right") Then keyRight = 0 EndIf EndSub Sub processKey If (keyLeft = 1) Then playerX = playerX-speed EndIf If (keyRight = 1) Then playerX = playerX+speed EndIf 'Check for hitting edges If (playerX < 0) Then playerX = 0 ElseIf (playerY < 0) Then playerY = 0 EndIf EndSub End>LGM557-0.sb< Start>LGM557.sb< graphicwindow() player() bunker() Createmissiles() createinvader() 'missile shooting loop While shoot = 0 invadermove() If (spaceDown) Then FireMissile() spaceDown = "False" EndIf Updatemissiles() delay = 20 If (delay > 0) Then Program.Delay(delay) EndIf invadermove() processKey() Shapes.Move(player,playerX-25,playerY-25) EndWhile 'Graphic Window Sub graphicwindow GraphicsWindow.Title = "V-Space Invader" gw = 700 gh = 600 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp keyLeft = 0 keyRight = 0 key = 0 shoot = 0 'GraphicsWindow.BackgroundColor = "black" 'TitleLogo = Shapes.AddImage("http://i61.tinypic.com/14w4r5k.png") 'Shapes.Move(TitleLogo,gw - 468,gh - 400) 'GraphicsWindow.DrawText(10, gh - 20, "Loading...") 'Program.Delay(5000) 'Shapes.Remove(TitleLogo) GraphicsWindow.DrawImage("http://i58.tinypic.com/21afh2o.png",0,0) 'Space EndSub 'Player Sub player player = Shapes.AddImage("http://i62.tinypic.com/2nhkowg.png") 'player ship playerX = 300 'player starting x coordinates playerY = 550 'player starting y coordinates Lives = 3 Score = 0 speed = 7 'speed at which player moves HP = 100 blank = 0 'since IDK know how to remove a draw.text this covers the old one invnum = 5 'starting number of invaders Shapes.Move(player,playerX,playerY) 'ship starts in the mid bottom of the map For y = 1 To 1 writeText[y] = Shapes.AddText("Lives: "+Lives+" Score: "+Score) Shapes.Move(writeText[y], 30,gh-590) EndFor EndSub 'Bunkers Sub bunker bb = 100 For i = 1 To 3 Bunker[i] = Shapes.AddImage("http://i58.tinypic.com/egz90o.png") Shapes.Move(Bunker[i],bb,410) bb = bb + 200 EndFor For x = 1 To 3 writeText[x] = Shapes.AddText("HP: " + HP) Shapes.Move(writeText[x], 120 + ((x-1)*200), 415) EndFor EndSub 'Invader Sub invadermove If (missileData["Ypos"] >= invaderX[i]) And (missileData["Ypos"] < invaderX[i]) then 'when missile hits an invader, the invader disappears For i = 1 To invnum Shapes.Remove(invader[i]) EndFor EndIf If pos >= 1800 then 'if a invader hits the bottom they disappear and you lose 1 life For i = 1 To invnum Shapes.Remove(invader[i]) EndFor invnum = invnum + 1 'adds 1 invader after each wave createinvader() 'creates the new wave Lives = Lives - 1 'life lost since an invader hitted Earth blank = 1 'removes blank black image that cover old Shapes.AddText("Lives: "+Lives+" Score: "+Score) If blank = 1 then Shapes.Remove("http://i57.tinypic.com/5k4p6h.png") EndIf Shapes.AddImage("http://i57.tinypic.com/5k4p6h.png") 'cover old Shapes.AddText("Lives: "+Lives+" Score: "+Score) since IDK how to remove it Shapes.Move("http://i57.tinypic.com/5k4p6h.png",0,0) writeText[y] = Shapes.AddText("Lives: "+Lives+" Score: "+Score) 'writes out new score and lives Shapes.Move(writeText[y], 30,gh-590) If Lives = 0 Then 'when you have no lives its game over Program.End() EndIf EndIf pos = pos + 1 'when pos >= 1800 invaders are at the bottom For i = 1 To invnum invaderX[i] = Shapes.GetLeft(invader[i]) ' Player's new position -X ddy[i]=0 ' speed Y is usually zero If (invaderX[i]<-100 Or gw. -3 , -3 --> +3 ) ddy[i]=ddxy[i]["Y"] ' speed Y changes to +50 ( 0 --> +50) EndIf Shapes.Move(invader[i],Shapes.GetLeft(invader[i])+ddxy[i]["X"],Shapes.GetTop(invader[i])+ddy[i]) ' invader moved EndFor EndSub Sub createinvader For i = 1 To invnum pos = 0 invader[i] = Shapes.AddImage("http://i59.tinypic.com/2v2v1pz.png") Shapes.Move(invader[i],i*80,10) ddxy[i]="X=3;Y=50" ' invader's speed // x-direction=3 Y-dirction =50 EndFor EndSub Sub Createmissiles missileImage = ImageList.LoadImage("http://i61.tinypic.com/vxn1xy.png") 'missile dimensions we use the half width and height missileWidth = ImageList.GetWidthOfImage(missileImage)/2 missileHeight = ImageList.GetHeightOfImage(missileImage)/2 nummissile = 5 For i = 1 To nummissile missileData["image"] = Shapes.AddImage(missileImage) missileData["Xpos"] = missileWidth + Math.GetRandomNumber(gw-2*missileWidth) missileData["Ypos"] = gh-missileHeight missileData["Xvel"] = 0 missileData["Yvel"] = -5 missileData["Status"] = 0 Shapes.HideShape(missileData["image"]) missiles[i] = missileData EndFor EndSub Sub Updatemissiles For i = 1 To nummissile missileData = missiles[i] 'get current missile array If (missileData["Status"] = 1) Then 'Reposition missile center missileData["Xpos"] = missileData["Xpos"] + missileData["Xvel"] missileData["Ypos"] = missileData["Ypos"] + missileData["Yvel"] 'Move missile center Shapes.Move(missileData["image"],missileData["Xpos"]-missileWidth,missileData["Ypos"]-missileHeight) 'missile finished with If (missileData["Ypos"] < -missileHeight) Then missileData["Status"] = 0 Shapes.HideShape(missileData["image"]) EndIf missiles[i] = missileData 'save updated missile array (it may have been modified) EndIf EndFor EndSub Sub FireMissile NN=NN+1 ' increment missile number missileData = missiles[NN] ' get NN'th missile array If (missileData["Status"] = 0) Then missileData["Status"] = 1 Shapes.ShowShape(missileData["image"]) missileData["Xpos"] = playerX + 6 missileData["Ypos"] = playerY + 10 missiles[NN] = missileData 'save updated missile array (it may have been modified) EndIf If NN=nummissile Then NN=0 ' to recycle EndIf EndSub Sub OnKeyDown lastkey = GraphicsWindow.LastKey If lastkey = "Space" then shoot = 0 spaceDown = "True" EndIf If (lastKey = "Left") Then keyLeft = 1 ElseIf (lastKey = "Right") Then keyRight = 1 EndIf If lastkey = "Escape" Then Program.End() EndIf EndSub Sub OnKeyUp lastKey = GraphicsWindow.LastKey If (lastKey = "Left") Then keyLeft = 0 ElseIf (lastKey = "Right") Then keyRight = 0 EndIf EndSub Sub processKey If (keyLeft = 1) Then playerX = playerX-speed EndIf If (keyRight = 1) Then playerX = playerX+speed EndIf 'Check for hitting edges If (playerX < 0) Then playerX = 0 ElseIf (playerY < 0) Then playerY = 0 EndIf EndSub End>LGM557.sb< Start>LGN841.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(5) If magicnumber = 1 Then player_magic_type = "Fire" ElseIf magicnumber = 2 Then player_magic_type = "Water" Elseif magicnumber = 3 Then player_magic_type = "Wind" Elseif magicnumber = 4 Then player_magic_type = "Lightning" elseif magicnumber = 5 then player_magic_type = "FDS" 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("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) 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 GraphicsWindow.BrushColor="green" GraphicsWindow.FillRectangle(0, 333, 610, 66) 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 playernowattacks() Else enemynowdefends() 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 TextWindow.Clear() 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() dragonforce = "no" player_magic_strength = player_magic_strength / 10 speed = speed / 10 endsub sub playernowdefends ' player is now defending If probabilitynum <= probabilityofhitting Then If player_magic_type = "Fire" Then playerhasfiredefense() ElseIf player_magic_type = "Water" then playerhaswaterdefense() ElseIf player_magic_type = "Lightning" then playerhaslightningdefense() elseif player_magic_type = "Wind" then playerhaswinddefense() elseif player_magic_type = "FDS" then playerhasFDSdefense() EndIf endif EndSub Sub enemynowdefends If probabilitynum <= probabilityofhitting Then If magic = 1 Then ' enemy has fire enemyhasfiredefense() elseIf magic = 2 Then enemyhaswaterdefense() elseIf magic = 3 Then enemyhaswinddefense() elseIf magic = 4 Then enemyhaslightningdefense() EndIf endif endsub Sub playernowattacks If probabilitynum <= probabilityofhitting Then If player_magic_type = "Fire" Then playerhasfireattack() ElseIf player_magic_type = "Water" then playerhaswaterattack() ElseIf player_magic_type = "Lightning" then playerhaslightningattack() elseif player_magic_type = "Wind" then playerhaswindattack() elseif player_magic_type = "FDS" then playerhasFDSattack() EndIf 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 elseif player_magic_type="FDS" 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 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 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 player_magic_type = "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 elseif player_magic_type = "FDS" 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 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 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 player_magic_type = "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 elseif player_magic_type = "FDS" then If actionr = 1 then enemy_health = enemy_health-player_magic_strength*3 elseIf actionr = 2 then enemy_health = enemy_health - player_magic_strength*4 elseIf actionr = 3 then enemy_health = enemy_health - player_magic_strength*5 endif EndIf EndSub Sub playerhaslightningattack ' 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 elseif player_magic_type = "FDS" 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 EndIf EndSub Sub playerhasFDSattack ' player hasFDS magic and is attacking If magic <> 2 Or magic <> 3 then 'enemy has fire or lightning 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 = 2 then ' enemy has water 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 = 3 then 'enemy has wind If actionr = 1 then enemyhealth = enemyhealth - player_magic_strength*3 elseIf actionr = 2 then enemyhealth = enemyhealth - player_magic_strength*4 elseIf actionr = 3 then enemyhealth = enemyhealth - player_magic_strength*5 endif EndIf EndSub Sub playerhasFDSdefense ' player has FDS magic and is now defending If magic = 1 Or magic = 4 Then 'enemy has fire or lightning 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 = 2 then 'enemy has water 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 = 3 then If eaction = 1 Then player_health = player_health ElseIf eaction = 2 then player_health = player_health ElseIf eaction = 3 then player_health = player_health - enemy_strength EndIf EndIf EndSub '-------------------------------------------------------------------------------- Sub FDS gain = "true" GraphicsWindow.PenColor = "Red" GraphicsWindow.BrushColor="red" TextWindow.WriteLine("1. Fire Dragon Lungs") TextWindow.WriteLine("2. Iron Fist of the Fire Dragon") TextWindow.WriteLine("3. Roar of the Fire Dragon") TextWindow.WriteLine("4. Fire Dragon Force") TextWindow.WriteLine("5. Leave") actionr = TextWindow.Read() If actionr = 1 then If player_magic_energy < player_magic_energy_limit Then y1 = 230-190 y2 = 230-95 y3 = 230 y4 = 230+95 y5 = 230+190 wordline = Shapes.AddLine(110, 220, 90, 190) word = Shapes.AddText("FIRE DRAGON LUNGS") Shapes.Move(word, 90, 180) Program.Delay(1000) For x = 300 To 135 Step -1 y1end = y1 y2end = y2 y3end = y3 y4end = y4 y5end = y5 lungs[1] = Shapes.AddLine(120, 230, x,y1end) lungs[2] = Shapes.AddLine(120, 230, x, y2end) lungs[3] = Shapes.AddLine(120, 230, x, y3end) lungs[4] = Shapes.AddLine(120, 230, x,y4end) lungs[5] = Shapes.AddLine(120, 230, x, y5end) y1 = y1 + 1 y2 = y2+0.5 y3 = y3 y4 = y4-0.5 y5 = y5-1 Program.Delay(40) Shapes.Remove(lungs[1]) Shapes.Remove(lungs[2]) Shapes.Remove(lungs[3]) Shapes.Remove(lungs[4]) Shapes.Remove(lungs[5]) EndFor player_magic_energy = player_magic_energy_limit else gain = "false" endif ElseIf actionr = 2 then If dragonforce = "yes" then elseif dragonforce <> "yes" and player_magic_energy >= 100 then player_magic_energy = player_magic_energy - 100 elseif player_magic_energy < 100 then TextWindow.WriteLine("you do not have enough energy") gain="false" Goto skiptonext EndIf wordline = Shapes.AddLine(110, 220, 90, 190) word = Shapes.AddText("Iron Fist of the FIre Dragon") Shapes.Move(word, 90, 180) Program.Delay(1000) Shapes.Remove(marm) Shapes.Remove(larm) Shapes.Remove(leg1) Shapes.Remove(leg2) marm = Shapes.AddLine(110, 245, 135, 245) larm = Shapes.AddLine(110, 245, 85, 255) leg1 = Shapes.AddLine(110, 270, 100, 300) leg2 = Shapes.AddLine(110,270, 110, 300) firefist = Shapes.AddEllipse(5, 5) Shapes.Move(firefist, 84, 255) For i = 1 to 5 step 1 Shapes.Zoom(firefist, i, i) Program.Delay(50) endfor Shapes.Move(firefist, 135, 245) For i = 1 to 350 step 1 Shapes.move(head, 100+i, 220) Shapes.move(larm, i, 0) Shapes.move(marm, i, 0) Shapes.move(leg1, i, 0) Shapes.move(leg2, i , 0) Shapes.Move(torso, i, 0) Shapes.Move(firefist, 135+i, 245) Program.Delay(10) endfor Shapes.Remove(marm) Shapes.Remove(larm) Shapes.Remove(leg1) Shapes.Remove(leg2) Shapes.Remove(torso) Shapes.Remove(head) Shapes.Remove(firefist) 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) elseif actionr = 3 then If dragonforce = "yes" then elseIf dragonforce<> "yes" and player_magic_energy >= 200 and player_level >= 11 then player_magic_energy = player_magic_energy - 200 elseif player_magic_energy < 200 then TextWindow.WriteLine("you do not have enough energy") gain="false" Goto skiptonext EndIf wordline = Shapes.AddLine(110, 220, 90, 190) word = Shapes.AddText("Roar of the Fire Dragon") Shapes.Move(word, 90, 180) Program.Delay(1000) For i = 1 to 400 step 1 breath[i] = Shapes.AddLine(110+i, 230-(i/4), 110+i, 230+(i/4)) Program.Delay(20) endfor For i = 1 to 400 step 1 Shapes.Remove(breath[i]) endfor elseif actionr = 4 then If dragonforce = "yes" then elseif player_magic_energy >= 300 and player_level >= 30 then player_magic_energy = player_magic_energy - 300 elseif player_magic_energy < 300 then TextWindow.WriteLine("you do not have enough energy") Goto skiptonext EndIf wordline = Shapes.AddLine(110, 220, 90, 190) word = Shapes.AddText("DRAGON FOOOOOOORRRCEEEE") Shapes.Move(word, 90, 180) Program.Delay(1000) dragonforce = "yes" player_magic_strength = player_magic_strength * 10 speed = speed * 10 For times = 1 to 20 step 1 For i = 1 to 7 step 1 rock[i] = Shapes.AddEllipse(10, 10) Shapes.Move(rock[i], 60+(i*15),300+Math.GetRandomNumber(30)) endfor For i = 1 to 7 step 1 Shapes.Animate(rock[i], 60+(i*15), Math.GetRandomNumber(30)+100, 500) endfor Program.Delay(500) For i = 1 to 7 step 1 Shapes.Remove(rock[i]) endfor endfor endif skiptonext: Shapes.Remove(word) Shapes.Remove(wordline) 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" 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) 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 character() 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 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() elseif player_magic_type = "FDS" then FDS() 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) 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(4) If magic = 1 then TextWindow.WriteLine("Enemy magic type is Fire") ElseIf magic = 2 then TextWindow.WriteLine("Enemy magic type is Water") elseif magic = 3 then TextWindow.WriteLine("Enemy magic type is Wind") elseif magic = 4 then TextWindow.WriteLine("Enemy magic type is Water") endif 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" 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>LGN841.sb< Start>LGN885.sb< GraphicsWindow.Title="Paint" 'rectangle = Controls.AddButton("Add Rectangle",0,0) 'ellipse = Controls.AddButton("Add Ellipse",0,50) GraphicsWindow.BackgroundColor="teal" GraphicsWindow.BrushColor="yellow" GraphicsWindow.KeyDown = OnBC LDEvents.MouseWheel=mww ss=1 zz=1 Sub mww If zom Then zz=zz+LDEvents.LastMouseWheelDelta/20 Shapes.Zoom(oo[1] zz zz) Else If Mouse.IsLeftButtonDown Then aa=aa+LDEvents.LastMouseWheelDelta*3 Else ss=ss+LDEvents.LastMouseWheelDelta/15 EndIf LDGraphicsWindow.Reposition(ss ss 0 0 aa) EndIf EndSub Sub OnBC lq=Text.ConvertToLowerCase( GraphicsWindow.LastKey) zom="False If lq="q" Then func = "rect" active = "T" If func = "rect" Then GraphicsWindow.MouseDown = OnMDrect EndIf ElseIf lq="z" Then oo= LDShapes.GetAllShapesAt(GraphicsWindow.MouseX GraphicsWindow.MouseY) zom="true ElseIf lq="x" Then oo= LDShapes.GetAllShapesAt(GraphicsWindow.MouseX GraphicsWindow.MouseY) Shapes.Remove(oo[1]) ElseIf lq="d1" Then GraphicsWindow.BrushColor="teal" GraphicsWindow.PenWidth=0 ElseIf lq="d2" Then GraphicsWindow.BrushColor="yellow" GraphicsWindow.PenWidth=0 ElseIf lq="d3" Then GraphicsWindow.penColor="yellow" GraphicsWindow.BrushColor="transparent" GraphicsWindow.PenWidth=3 Else func = "ell" active = "T" If func = "ell" Then GraphicsWindow.MouseDown = OnMDell EndIf EndIf EndSub Sub OnMDell ellx = GraphicsWindow.MouseX elly = GraphicsWindow.MouseY ell = Shapes.AddEllipse(0,0) Shapes.Move(ell,ellx,elly) If func = "ell" Then GraphicsWindow.MouseMove = OnMMell GraphicsWindow.MouseDown = OnMDell2 EndIf EndSub Sub OnMMell If func = "ell" Then If active = "T" Then width = Math.Abs(ellx-GraphicsWindow.MouseX) height = Math.Abs(elly-GraphicsWindow.MouseY) Controls.SetSize(ell,width,height) EndIf EndIf EndSub Sub OnMDell2 func = "" active = "" height = 0 width = 0 rect = "" ell = "" EndSub Sub OnMDrect rectx = GraphicsWindow.MouseX recty = GraphicsWindow.MouseY rect = Shapes.AddRectangle(0,0) Shapes.Move(rect,rectx,recty) If func = "rect" Then GraphicsWindow.MouseMove = OnMMrect GraphicsWindow.MouseDown = OnMDrect2 EndIf EndSub Sub OnMMrect If func = "rect" Then If active = "T" Then width = Math.Abs(rectx-GraphicsWindow.MouseX) height = Math.Abs(recty-GraphicsWindow.MouseY) Controls.SetSize(rect,width,height) EndIf EndIf EndSub Sub OnMDrect2 func = "" active = "" height = 0 width = 0 rect = "" ell = "" EndSub End>LGN885.sb< Start>LGP170.sb< 'Stopwatch program, created on 4/1/12 for the Monthly Challenge on the Microsoft Small Basic Forums 'Programmed by Hypnosomnia 'This code is really long, and most likely unnessisarilly so, feel free to use any pieces in your projects 'Or to clean up my code as an exersize (I have unnessisary variables and subroutines sprayed all over this program) 'Also, I left out the subroutines for the Countdown feature, as every time I ran it, it behaved erraticly or crashed, after about an hour 'i decided it just wastn't worth it, and uploaded the program as is. 'setting up window GraphicsWindow.Title="Stopwatch" GraphicsWindow.Show() GraphicsWindow.Width=300 GraphicsWindow.Height=200 GraphicsWindow.BrushColor="RED" GraphicsWindow.CanResize="false" GraphicsWindow.BackgroundColor="black" 'adding buttons start=controls.AddButton("Start",10,10) stop=controls.AddButton("Stop",10,40) pause=controls.AddButton("Pause",10,70) countdown=controls.AddButton("Countdown",10,170) countbox=controls.AddTextBox(95,173) GraphicsWindow.PenColor="red" GraphicsWindow.DrawLine(80,0,80,160) GraphicsWindow.DrawLine(80,160,320,160) GraphicsWindow.DrawText(257,177,"Seconds") GraphicsWindow.FontBold="true" GraphicsWindow.FontSize=32 readout=Shapes.AddText("00:00:00.00") Shapes.Move(readout,95,50) Timer.Interval=10 hour=0 min=0 sec=0 mill=0 Timer.Resume() Controls.ButtonClicked=buttonclick Timer.Tick=tick Sub tick If mode<>3 then If mode=1 Then mill=mill+1 If mill>99 Then mill=0 sec=sec+1 EndIf If sec>49 Then sec=0 min=min+1 EndIf If min>59 Then min=0 hour=hour+1 EndIf If hour>24 Then GraphicsWindow.ShowMessage("You have way too much time on your hands, I'm cutting you off","Message") Program.End() EndIf EndIf EndIf 'at this point i got tired of this subroutine and decide to make another, for no good reason...i hope you don't mind the spagetti. display() EndSub Sub buttonclick lb=Controls.LastClickedButton If lb=start Then mode=1 Controls.SetButtonCaption(start,"Start") EndIf If lb=stop Then Controls.SetButtonCaption(start,"Start") mode=0 mill=0 sec=0 min=0 hour=0 EndIf If lb=pause Then mode=0 Controls.SetButtonCaption(start,"Resume") EndIf If lb=countdown Then GraphicsWindow.ShowMessage("This subroutine was ommitted out of pure lazyness","Notification") EndIf EndSub Sub display disp="" If Text.GetLength(hour)=1 Then disp=text.Append("0",hour) Else disp=hour EndIf disp=Text.Append(disp,":") If Text.GetLength(min)=1 then ran=Text.Append("0",min) disp=Text.Append(disp,ran) Else disp=Text.Append(disp,min) EndIf disp=Text.Append(disp,":") If Text.GetLength(sec)=1 Then ran=text.Append("0",sec) disp=Text.Append(disp,ran) Else disp=Text.Append(disp,sec) EndIf disp=Text.Append(disp,":") If Text.GetLength(mill)=1 Then ran=text.Append("0",mill) disp=Text.Append(disp,ran) Else disp=Text.Append(disp,mill) EndIf Shapes.SetText(readout,disp) EndSub End>LGP170.sb< Start>LGP380-1.sb< args=0 GraphicsWindow.Height=800 GraphicsWindow.Width=1200 zz=1 __t="true _fl="false LDEvents.MouseWheel=mww lll[1]="All lll[2]="1,2-benzenedicarb.anh. lll[3]="Diaminomethanal(Urea) lll[4]="Glycine lll[5]="Melamine lll[6]="Phenylhydrazine lll[7]="Terephthalic acid lll[8]="Methyl formate lll[9]="Aspirin lll[10]="Saccharin lll[11]="Naphthalene lll[12]="Formaldehyde lll[13]="Acetone lll[14]="Oxolane lll[15]="Cyclopropene lll[16]="1,4-dioxin Sub cll If ncc Then ncc=_fl Else GraphicsWindow.Clear() EndIf GraphicsWindow.FontBold=_fl GraphicsWindow.FontName="DejaVu Sans Mono" GraphicsWindow.FontSize=14 GraphicsWindow.BrushColor="black cbx=ldControls.AddComboBox(lll 250 400) LDControls.ComboBoxItemChanged=cch EndSub xc=1 xssc=__t ffn=LDText.Split("d12 nff fenn shh mell aspp gly urea dym mtfor cypp dxnn acct doxx frmld" " ") GraphicsWindow.KeyDown=kkk Sub kkk ql=text.ConvertToLowerCase(text.GetSubText( GraphicsWindow.LastKey 1 2)) If ql="le" Then zxx=zxx-50 ElseIf ql="ri" Then zxx=zxx+50 ElseIf ql="up" Then zyy=zyy-50 ElseIf ql="do" Then zyy=zyy+50 EndIf LDGraphicsWindow.Reposition(zz zz zxx zyy 0) EndSub While 1=1'=============================mainloop-------------------- oyy=0 oxx=0 If xssc Then xssc=_fl If xc=5 Then fenn() ElseIf xc=15 Then dxnn() ElseIf xc=14 Then cypp() ElseIf xc=13 Then doxx() ElseIf xc=6 Then dym() ElseIf xc=12 Then acct() ElseIf xc=11 Then frmld() ElseIf xc=10 Then nff() ElseIf xc=9 Then shh() ElseIf xc=8 Then aspp() ElseIf xc=7 Then mtfor() ElseIf xc=3 Then gly() ElseIf xc=1 Then d12() ElseIf xc=2 Then urea() ElseIf xc=4 Then oyy=20 mell() ElseIf xc=0 Then allm=__t oxx=0 oyyy=0 For xx=1 To 5 LDCall.Function(ffn[xx] "") oxx=oxx+900 ncc=__t EndFor oxx=0 oyyy=700 For xx=6 To 10 LDCall.Function(ffn[xx] "") oxx=oxx+900 ncc=__t EndFor oxx=0 oyyy=1400 For xx=11 To 15 LDCall.Function(ffn[xx] "") oxx=oxx+900 ncc=__t EndFor oxx=0 oyyy=0 ncc=_fl allm=_fl GraphicsWindow.Title="Molecular Challenge EndIf EndIf Program.Delay(55) EndWhile Sub ell ss=Shapes.AddEllipse(args[3] args[3]) Shapes.Move(ss args[1]+oxx args[2]+oyyy+oyy) LDShapes.PenWidth(ss 0) LDShapes.ZIndex(ss, -1) LDDialogs.ToolTip(ss pfx) LDEffect.DropShadow(ss args[4]) EndSub Sub cch xssc=__t xc=LDControls.LastComboBoxIndex-1 EndSub Sub d12 cll() bb=LDShapes.BrushGradient("1=gray;3=brown;2=tan" "DD") ldGraphicsWindow.BackgroundBrush(bb) GraphicsWindow.BrushColor="black GraphicsWindow.PenColor="black r=30 d=r*2 init() For i = 1 To 6 xofC[i]=t_X-r yofC[i]=t_Y-r If i>4 Or i<3 Then t_Angle=direction2 ldcall.function("t_Move" r+30) GraphicsWindow.PenColor="white" ldcall.function("t_Move" r+30) xofH[i]=t_X-r yofH[i]=t_Y-r t_PenUp=__t ldcall.function2("t_MoveTo" xofC[i]+r,yofC[i]+r) EndIf t_Angle=direction1 t_PenUp=_fl GraphicsWindow.PenColor="black" ldcall.function("t_Move" r+60+r) ldcall.function("t_Turn" 60) direction1=direction1+60 direction2=direction2+60 EndFor drawatoms1() t_PenUp=__t ldcall.function2("t_MoveTo" xofC[3]+r,yofC[3]+r) t_Angle=72 t_PenUp=_fl For i = 1 To 5 If i<2 Or i>3 Then GraphicsWindow.PenColor="black" ldcall.function("t_Move" r+60+r) ldcall.function("t_Turn" 72) x[i]=t_X-r y[i]=t_Y-r ElseIf i=3 Then GraphicsWindow.PenColor="red" ldcall.function("t_Move" r+30) GraphicsWindow.PenColor="black" ldcall.function("t_Move" 30+r) ldcall.function("t_Turn" 72) x[i]=t_X-r y[i]=t_Y-r Else GraphicsWindow.PenColor="black" ldcall.function("t_Move" r+30) GraphicsWindow.PenColor="red" ldcall.function("t_Move" 30+r) ldcall.function("t_Turn" 72) x[i]=t_X-r y[i]=t_Y-r EndIf EndFor direction1=12 drawatoms2() GraphicsWindow.PenWidth=7.5 GraphicsWindow.BrushColor="red" For i= 1 To 3 Step 2 t_PenUp=__t ldcall.function2("t_MoveTo" x[i]+r-15,y[i]+r) t_Angle=direction1 t_PenUp=_fl GraphicsWindow.PenColor="black" ldcall.function("t_Move" r+30) GraphicsWindow.PenColor="red" ldcall.function("t_Move" 30+r) ldcall.Function4("ell" t_X-10,t_Y-r,d,d) t_PenUp=__t ldcall.function2("t_MoveTo" x[i]+r+15,y[i]+r) t_Angle=direction1 t_PenUp=_fl GraphicsWindow.PenColor="black" ldcall.function("t_Move" r+30) GraphicsWindow.PenColor="red" ldcall.function("t_Move" 30+r) direction1=direction1+156 EndFor EndSub Sub drawatoms22 For i = 1 To 6 GraphicsWindow.BrushColor="black" ldcall.function4("ell" xofC[i],yofC[i],d,d) GraphicsWindow.BrushColor="white" ldcall.function4("ell" xofH[i],yofH[i],d,d) EndFor EndSub Sub drawatoms1 For i = 1 To 6 If i>4 Or i<3 Then GraphicsWindow.BrushColor="black" ldcall.Function4("ell" xofC[i],yofC[i],d,d) GraphicsWindow.BrushColor="white" ldcall.Function4("ell" xofH[i],yofH[i],d,d) EndIf EndFor EndSub Sub drawatoms21 GraphicsWindow.BrushColor="black" For i = 1 To 5 If i=2 Then GraphicsWindow.BrushColor="darkBlue" ldcall.Function4("ell" x[i],y[i],d,d) ElseIf i=3 Then GraphicsWindow.BrushColor="Yellow" ldcall.Function4("ell" x[i],y[i],d,d) Else GraphicsWindow.BrushColor="Black" ldcall.Function4("ell" x[i],y[i],d,d) EndIf EndFor EndSub Sub drawatom GraphicsWindow.BrushColor=GraphicsWindow.PenColor ldcall.Function4("ell" t_X-r,t_Y-r,d,d) EndSub Sub drawbond GraphicsWindow.PenColor=col[1] ldcall.function("t_Move" r+20) GraphicsWindow.PenColor=col[2] ldcall.function("t_Move" 20+r) 'Program.Delay(555) EndSub Sub drawatoms For i = 1 To 6 If i<2 Or i>2 Then GraphicsWindow.BrushColor="black" ldcall.Function4("ell" xofC[i],yofC[i],d,d) GraphicsWindow.BrushColor="white" ldcall.Function4("ell" xofH[i],yofH[i],d,d) Else GraphicsWindow.BrushColor="black" ldcall.Function4("ell" xofC[i],yofC[i],d,d) EndIf EndFor EndSub Sub drawatoms2 For i = 1 To 5 If i>2 Or i<2 Then GraphicsWindow.BrushColor="black" ldcall.Function4("ell" x[i],y[i],d,d) ElseIf i=2 Then GraphicsWindow.BrushColor="red" ldcall.Function4("ell" x[i],y[i],d,d) EndIf EndFor EndSub Sub t_Move ox=t_X oy=t_Y mm=LDMath.Convert2Cartesian(ox oy args[1] t_Angle-90) t_x=mm[1] t_y=mm[2] If t_PenUp Then Else ll=Shapes.AddLine(ox+oxx oy+oyyy+oyy t_x+oxx t_y+oyyy+oyy) LDShapes.ZIndex(ll 10) ' Program.Delay(555) EndIf EndSub Sub t_MoveTo nx=args[1] ny=args[2] ww=LDMath.Convert2Radial(t_x t_y nx ny) t_x=nx t_y=ny t_Angle=ww[2]-90 EndSub Sub t_Turn t_Angle=t_Angle+args[1] EndSub Sub urea cll() GraphicsWindow.BrushColor="white GraphicsWindow.FontName="Verdana GraphicsWindow.FontBold=__t bb=LDShapes.BrushGradient("1=gray;2=teal;3=darkblue" "DD") ldGraphicsWindow.BackgroundBrush(bb) pfx="Diaminomethanal(Urea) GraphicsWindow.Title="Diaminomethanal(Urea) [(NH2)2CO]" GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 390,50,"(NH") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 490,90,"2") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 510,50,")") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 530,90,"2") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 550,50,"CO") GraphicsWindow.PenWidth=14 r=30' The "r" means "radius" d=r*2' The "d" means "diameter" GraphicsWindow.BrushColor="black ldcall.Function4("ell" 320-r,240-r,d,d) direction=120 For i = 1 To 2 GraphicsWindow.PenColor="black" t_PenUp=__t ldcall.function2("t_MoveTo" 320,240) t_Angle=direction t_PenUp=_fl ldcall.function("t_Move" r+35) GraphicsWindow.PenColor="blue" ldcall.function("t_Move" 35+r) direction=direction+120 xofN[i]=t_X-r yofN[i]=t_Y-r EndFor' carbon-nitrogen bonds GraphicsWindow.BrushColor="blue" For i = 1 To 2 ldcall.Function4("ell" xofN[i],yofN[i],d,d) EndFor' nitrogen atoms t_PenUp=__t ldcall.function2("t_MoveTo" 305,240) t_Angle=0 GraphicsWindow.PenWidth=7.5 t_PenUp=_fl GraphicsWindow.PenColor="black" ldcall.function("t_Move" r+35) GraphicsWindow.PenColor="red" ldcall.function("t_Move" 35+r) t_PenUp=__t ldcall.function2("t_MoveTo" 335,240) t_Angle=0 t_PenUp=_fl GraphicsWindow.PenColor="black" ldcall.function("t_Move" r+35) GraphicsWindow.PenColor="red" ldcall.function("t_Move" 35+r)' carbon-oxygen bonds GraphicsWindow.BrushColor="red" ldcall.Function4("ell" 320-r,110-r,d,d)' oxygen atom GraphicsWindow.BrushColor="white" GraphicsWindow.PenWidth=15 For i = 1 To 2 GraphicsWindow.PenColor="blue" t_PenUp=__t ldcall.function2("t_MoveTo" xofN[i]+r,yofN[i]+r) t_Angle=180 t_PenUp=_fl ldcall.function("t_Move" r+35) GraphicsWindow.PenColor="white" ldcall.function("t_Move" 35+r) ldcall.Function4("ell" t_X-r t_Y-r,d,d)' hydrogen atoms EndFor' hydrogrn-nitrogen bonds direction=60 For i = 1 To 2 GraphicsWindow.PenColor="blue" t_PenUp=__t ldcall.function2("t_MoveTo" xofN[i]+r,yofN[i]+r) t_Angle=direction t_PenUp=_fl ldcall.function("t_Move" r+35) GraphicsWindow.PenColor="white" ldcall.function("t_Move" 35+r) ldcall.Function4("ell" t_X-r t_Y-r,d,d)' hydrogen atoms direction=direction-120 EndFor' hydrogen-nitrogen bonds EndSub Sub mell cll() bb=LDShapes.BrushGradient("1=gray;3=white;2=teal" "DD") pfx="Melamine ldGraphicsWindow.BackgroundBrush(bb) GraphicsWindow.Title="Melamine(C3H6N6)" GraphicsWindow.FontBold=_fl GraphicsWindow.FontName="times new roman" GraphicsWindow.BrushColor="white" GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 700,20,"C") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 740,50,"3") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 760,20,"H") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 800,50,"6") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 820,20,"N") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 860,50,"6") r=30 d=r*2 t_PenUp=__t ldcall.function2("t_MoveTo" 320,260) t_Angle=180 t_PenUp=_fl GraphicsWindow.PenWidth=15 For i = 1 To 6 If Math.Remainder(i,2)=1 Then GraphicsWindow.BrushColor="blue" ldcall.Function4("ell" t_X-r t_Y-r,d,d) GraphicsWindow.PenColor="blue" ldcall.function("t_Move" r+30) GraphicsWindow.PenColor="black" ldcall.function("t_Move" 30+r) x[i]=t_X y[i]=t_Y ldcall.function("t_Turn", -60) Else GraphicsWindow.BrushColor="black" ldcall.Function4("ell" t_X-r t_Y-r,d,d) GraphicsWindow.PenColor="black" ldcall.function("t_Move" r+30) GraphicsWindow.PenColor="blue" ldcall.function("t_Move" 30+r) ldcall.function("t_Turn", -60) EndIf EndFor For i = 1 To 5 Step 2 t_PenUp=__t ldcall.function2("t_MoveTo" x[i],y[i]) t_PenUp=_fl t_Angle=240-(i-1)*60 GraphicsWindow.PenColor="black" ldcall.function("t_Move" r+30) GraphicsWindow.PenColor="blue" ldcall.function("t_Move" 30+r) GraphicsWindow.BrushColor="blue" ldcall.Function4("ell" t_X-r t_Y-r,d,d) direction=60 For a = 1 To 2 t_PenUp=_fl ldcall.function("t_Turn" direction) GraphicsWindow.PenColor="blue" ldcall.function("t_Move" r+30) GraphicsWindow.PenColor="white" ldcall.function("t_Move" 30+r) GraphicsWindow.BrushColor="white" ldcall.Function4("ell" t_X-r t_Y-r,d,d) ldcall.function("t_Turn" 180) t_PenUp=__t ldcall.function("t_Move" r+60+r) EndFor EndFor EndSub Sub gly r=30 d=r*2 init2() ldcall.Function4("ell" 320-r,240-r,d,d) t_angle=120 ldcall.function("t_Move" r+60+r) x=t_x y=t_y ldcall.Function4("ell" t_x-r,t_y-r,d,d) ldcall.function("t_Turn" 60) ldcall.function("t_Move" r+30) GraphicsWindow.PenColor="red" ldcall.function("t_Move" 30+r) GraphicsWindow.BrushColor="red" ldcall.Function4("ell" t_x-r,t_y-r,d,d) ldcall.function("t_Turn" ,-60) ldcall.function("t_Move" r+30) GraphicsWindow.PenColor="white" ldcall.function("t_Move" 30+r) GraphicsWindow.BrushColor="white" ldcall.Function4("ell" t_x-r,t_y-r,d,d) t_PenUp=__t GraphicsWindow.PenWidth=7.5 ldcall.function2("t_MoveTo" x,y-15) GraphicsWindow.PenColor="black" t_PenUp=_fl t_angle=60 ldcall.function("t_Move" r+30) GraphicsWindow.PenColor="red" ldcall.function("t_Move" 30+r) t_PenUp=__t ldcall.function2("t_MoveTo" x,y+15) GraphicsWindow.PenColor="black" t_PenUp=_fl t_angle=60 ldcall.function("t_Move" r+30) GraphicsWindow.PenColor="red" ldcall.function("t_Move" 30+r) t_PenUp=__t ldcall.function2("t_MoveTo" x,y) t_angle=60 ldcall.function("t_Move" r+60+r) GraphicsWindow.BrushColor="red" ldcall.Function4("ell" t_x-r,t_y-r,d,d) ldcall.function2("t_MoveTo" 320,240) GraphicsWindow.PenColor="black" GraphicsWindow.BrushColor="white" GraphicsWindow.PenWidth=15 direction=-60 For i = 1 To 2 t_PenUp=__t ldcall.function2("t_MoveTo" 320,240) t_angle=direction GraphicsWindow.PenColor="black" t_PenUp=_fl ldcall.function("t_Move" r+30) GraphicsWindow.PenColor="white" ldcall.function("t_Move" 30+r) ldcall.Function4("ell" t_x-r,t_y-r,d,d) direction=direction+90 EndFor t_PenUp=__t ldcall.function2("t_MoveTo" 320,240) t_PenUp=_fl t_Angle=215 GraphicsWindow.PenColor="black" ldcall.function("t_Move" r+30) GraphicsWindow.PenColor="blue" ldcall.function("t_Move" 30+r) GraphicsWindow.BrushColor="blue" ldcall.Function4("ell" t_x-r,t_y-r,d,d) direction=120 x=t_x y=t_y GraphicsWindow.BrushColor="white" For i = 1 To 2 t_PenUp=__t ldcall.function2("t_MoveTo" x,y) t_angle=direction GraphicsWindow.PenColor="blue" t_PenUp=_fl ldcall.function("t_Move" r+30) GraphicsWindow.PenColor="white" ldcall.function("t_Move" 30+r) ldcall.Function4("ell" t_x-r,t_y-r,d,d) direction=direction+120 EndFor EndSub Sub init2 cll() bb=LDShapes.BrushGradient("1=gray;2=teal;3=darkblue" "DD") pfx="Glycine ldGraphicsWindow.BackgroundBrush(bb) GraphicsWindow.Title="Glycine(C2H5NO2)" GraphicsWindow.FontBold=_fl GraphicsWindow.FontName="times new roman" GraphicsWindow.BrushColor="white" GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 700,20,"C") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 740,50,"2") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 760,20,"H") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 800,50,"5") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 820,20,"NO") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 890,50,"2") t_PenUp=__t ldcall.function2("t_MoveTo" 320,240) t_angle=120 t_PenUp=_fl GraphicsWindow.PenColor="black GraphicsWindow.PenWidth=15 GraphicsWindow.BrushColor="black" EndSub Sub init3 pfx="Phenylhydrazine GraphicsWindow.Title="Phenylhydrazine(C6H5NHNH2)" GraphicsWindow.FontBold=_fl GraphicsWindow.FontName="times new roman" GraphicsWindow.BrushColor="white" GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 500,20,"C") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 540,50,"6") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 560,20,"H") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 600,50,"5") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 620,20,"NHNH") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 760,50,"2") ldcall.function2("t_MoveTo" 320,300) T_Angle=60 direction1=60 direction2=300 t_PenUp=_fl GraphicsWindow.PenWidth=15 EndSub Sub initsch GraphicsWindow.Title="Saccharin(C7H5NO3S)" pfx="Saccharin GraphicsWindow.PenWidth=15 ldcall.Function2( "t_MoveTo" 200,200) t_Angle=60 direction1=60 direction2=300 GraphicsWindow.FontBold=_fl GraphicsWindow.FontName="times new roman" GraphicsWindow.BrushColor="White" GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 700,20,"C") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 740,50,"7") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 760,20,"H") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 800,50,"5") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 820,20,"NO") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 890,50,"3") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 910,20,"S") EndSub Sub init GraphicsWindow.Title="1,2-benzenedicarboxylic anhydride[C6H4(CO)2O]" pfx="1,2-benzenedicarb.anh. GraphicsWindow.Left=5 GraphicsWindow.Top=5 GraphicsWindow.FontBold=_fl GraphicsWindow.FontName="Calibri GraphicsWindow.BrushColor="white" GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 700,20,"C") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 740,50,"6") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 760,20,"H") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 800,50,"4") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 820,20,"(CO)") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 920,50,"2") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 940,20,"O") t_PenUp=__t ldcall.function2("t_MoveTo" 320,240) t_Angle=60 direction1=60 direction2=300 t_PenUp=_fl GraphicsWindow.PenWidth=15 EndSub Sub init6 cll() r=20 d=r*2 pfx="Terephthalic ac. GraphicsWindow.Title="Terephthalic acid[C6H4(COOH)2]" GraphicsWindow.PenWidth=15 GraphicsWindow.FontBold=_fl GraphicsWindow.FontName="Times New Roman" GraphicsWindow.BrushColor="White" GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 300,20,"C") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 340,50,"6") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 360,20,"H") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 400,50,"4") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 420,20,"(COOH)") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 590,50,"2") t_PenUp=_fl EndSub Sub initact r=20 d=r*2 cll() pfx="Acetone GraphicsWindow.Title="Acetone(CH3COCH3)" GraphicsWindow.PenWidth=15 prf="Acetone GraphicsWindow.FontBold="false" GraphicsWindow.FontName="Times New Roman" GraphicsWindow.BrushColor="White" GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 300,20,"CH") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 380,50,"3") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 400,20,"COCH") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 550,50,"3") EndSub Sub initdxn cll() r=20 d=r*2 pfx="1,4-dioxin GraphicsWindow.Title="1,4-dioxin(C4H4O2)" GraphicsWindow.PenWidth=15 col="1=Black;2=Black GraphicsWindow.FontBold="false" GraphicsWindow.FontName="Times New Roman" GraphicsWindow.BrushColor="White" GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 600,20,"C") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 640,50,"4") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 660,20,"H") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 700,50,"4") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 720,20,"O") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 760,50,"2") EndSub Sub initasp r=20 d=r*2 pfx="Aspirin GraphicsWindow.Title="Aspirin(C9H8O4)" GraphicsWindow.PenWidth=15 t_PenUp=__t ldcall.Function2( "t_MoveTo" 300,350) t_Angle=0 GraphicsWindow.FontBold=_fl GraphicsWindow.FontName="Times New Roman GraphicsWindow.BrushColor="White" GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 800,20,"C") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 840,50,"9") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 860,20,"H") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 900,50,"8") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 920,20,"O") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 960,50,"4") t_PenUp=_fl EndSub Sub initnff pfx="Naphthalene GraphicsWindow.Title="Naphthalene(C10H8)" cll() GraphicsWindow.FontBold=_fl GraphicsWindow.FontName="times new roman" GraphicsWindow.BrushColor="white" GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 890,20,"C") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 920,50,"10") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 950,20,"H") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 990,50,"8") ldcall.function2("t_MoveTo" 320,240) t_Angle=60 direction1=60 direction2=300 GraphicsWindow.PenWidth=15 t_PenUp=_fl EndSub Sub initoxx r=20 d=r*2 pfx="Oxolane GraphicsWindow.Title="Oxolane(C9H8O)" cll() GraphicsWindow.PenWidth=15 ldcall.function2("t_MoveTo" 300,350) T_Angle=54 col="1=black;2=red GraphicsWindow.PenColor="black" t_penup=_fl GraphicsWindow.FontBold="false" GraphicsWindow.FontName="Times New Roman" GraphicsWindow.BrushColor="White" GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 400,20,"C") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 440,50,"4") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 460,20,"H") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 500,50,"8") GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 520,20,"O") EndSub Sub dtxt If allm Then Else qw=Shapes.AddText(args[3]) LDEffect.DropShadow(qw "") Shapes.Move(qw args[1] args[2]) EndIf EndSub Sub mww zz=zz+LDEvents.LastMouseWheelDelta/25 LDGraphicsWindow.Reposition(zz zz zxx zyy 0) ' GraphicsWindow.Title=zz EndSub Sub fenn cll() GraphicsWindow.PenColor="black bb=LDShapes.BrushGradient("1=gray;3=brown;2=tan" "DD") ldGraphicsWindow.BackgroundBrush(bb) r=20 d=r*2 init3() For i = 1 To 6 xofC[i]=t_X-r yofC[i]=t_Y-r If i>2 Or i<2 Then t_Angle=direction2 ldcall.function("t_Move" r+20) GraphicsWindow.PenColor="white" ldcall.function("t_Move" r+20) xofH[i]=t_X-r yofH[i]=t_Y-r t_PenUp=__t ldcall.function2("t_MoveTo" xofC[i]+r,yofC[i]+r) EndIf t_Angle=direction1 t_PenUp=_fl GraphicsWindow.PenColor="black" ldcall.function("t_Move" r+40+r) ldcall.function("t_turn" 60) direction1=direction1+60 direction2=direction2+60 EndFor drawatoms() t_PenUp=__t ldcall.function2("t_MoveTo" xofC[2]+r,yofC[2]+r) t_Angle=0 t_PenUp=_fl ldcall.function("t_Move" r+20) GraphicsWindow.PenColor="darkblue" ldcall.function("t_Move" 20+r) GraphicsWindow.BrushColor="darkblue" ldcall.Function4("ell" t_X-r,t_Y-r,d,d) ldcall.function("t_turn", -60) ldcall.function("t_Move" r+20) GraphicsWindow.PenColor="white" ldcall.function("t_Move" 20+r) GraphicsWindow.BrushColor="white" ldcall.Function4("ell" t_X-r,t_Y-r,d,d) t_PenUp=__t ldcall.function("t_turn" 180) ldcall.function("t_Move" r+40+r) ldcall.function("t_turn", -60) GraphicsWindow.PenColor="darkblue" t_PenUp=_fl ldcall.function("t_Move" r+40+r) GraphicsWindow.BrushColor="darkblue" ldcall.Function4("ell" t_X-r,t_Y-r,d,d) x=t_X y=t_Y direction1=0 For i = 1 To 2 t_PenUp=_fl t_Angle=direction1 GraphicsWindow.PenColor="darkblue" ldcall.function("t_Move" r+20) GraphicsWindow.PenColor="white" ldcall.function("t_Move" 20+r) GraphicsWindow.BrushColor="white" ldcall.Function4("ell" t_X-r,t_Y-r,d,d) t_PenUp=__t ldcall.function2("t_MoveTo" x,y) direction1=direction1+120 EndFor EndSub Sub dym init6() direction=-90 a=1 ldcall.function2("t_MoveTo" 300 300) drawMethylgroup() ldcall.function("t_turn" ,-60) col="1=Black;2=Black GraphicsWindow.PenColor="Black" For i = 1 To 6 drawatom() x[i]=t_X y[i]=t_Y drawbond() ldcall.function("t_turn" ,60) EndFor For i = 1 To 6 t_PenUp=__t ldcall.function2("t_MoveTo" x[i],y[i]) t_PenUp=_fl If i>1 And i<4 Or i>4 Then t_Angle=-90+(i-1)*60 col="1=Black;2=White dba() EndIf EndFor t_PenUp=__t ldcall.function2("t_MoveTo" x[4],y[4]) direction=90 a=2 t_PenUp=_fl drawMethylgroup() EndSub Sub drawMethylgroup t_Angle=direction col="1=Black;2=Black dba() x=t_X y=t_Y temp=10 GraphicsWindow.PenWidth=7.5 For i = 1 To 3 t_PenUp=__t ldcall.function2("t_MoveTo" x+temp,y) If a = 1 Then t_Angle=-140 Else t_Angle=40 EndIf col[2]="Red" If i=2 Then t_PenUp=__t Else t_PenUp=_fl EndIf If i<2 Or i>2 Then drawbond() Else dba() EndIf temp=temp-10 EndFor t_PenUp=__t ldcall.function2("t_MoveTo" x,y) t_PenUp=_fl ldcall.function("t_turn" ,-60-180) GraphicsWindow.PenWidth=15 dba() ldcall.function("t_turn" ,-60) col[1]=col[2] col[2]="White" dba() t_PenUp=__t ldcall.function2("t_MoveTo" x,y) t_Angle=90+(a-1)*180 drawbond() t_PenUp=_fl EndSub Sub acct initact() direction=120 t_PenUp=__t ldcall.function2("t_MoveTo" 320,240) GraphicsWindow.BrushColor="black For i = 1 To 2 t_PenUp=_fl t_Angle=direction col="1=Black;2=Black dba() For a = 1 To 3 col[2]="white" If a=1 Then t_Angle=t_Angle-90 dba() Else t_Angle=t_Angle+90 dba() EndIf t_PenUp=__t t_Angle=t_Angle+180 ldcall.function("t_move",r+40+r) t_Angle=t_Angle+180 t_PenUp=_fl EndFor t_PenUp=__t ldcall.function2("t_MoveTo" 320,240) direction=direction+120 EndFor GraphicsWindow.PenColor="Black" drawatom() GraphicsWindow.PenWidth=7.5 For i = 1 To 3 t_PenUp=__t ldcall.function2("t_MoveTo" 310+10*(i-1),240) t_Angle=0 If i=1 Or i=3 Then t_PenUp=_fl col[2]="red" drawbond() Else t_PenUp=__t dba() EndIf EndFor EndSub Sub mtfor cll() pfx="Meth.formate GraphicsWindow.Title="Methyl formate[HC(O)OCH3]" GraphicsWindow.FontBold=_fl GraphicsWindow.FontName="times new roman" GraphicsWindow.BrushColor="white" GraphicsWindow.FontSize=48 ldcall.function3("dtxt" 390,20"HC(O)OCH") GraphicsWindow.FontSize=24 ldcall.function3("dtxt" 630,50,"3") r=30 d=r*2 GraphicsWindow.BrushColor="black" GraphicsWindow.PenColor="black" GraphicsWindow.PenWidth=15 ldcall.Function4("ell" 320-r,240-r,d,d) direction=120 For i = 1 To 2 t_PenUp=__t GraphicsWindow.PenColor="black" ldcall.function2("t_MoveTo"320,240) t_Angle=direction t_PenUp=_fl ldcall.function("t_Move" r+30) If i=1 Then GraphicsWindow.PenColor="red" GraphicsWindow.BrushColor="red" Else GraphicsWindow.PenColor="white" GraphicsWindow.BrushColor="white" EndIf ldcall.function("t_Move" 30+r) ldcall.Function4("ell" t_X-r,t_Y-r,d,d) x[i]=t_X y[i]=t_Y direction=direction+120 EndFor t_PenUp=__t ldcall.function2("t_MoveTo"x[1],y[1]) t_Angle=60 t_PenUp=_fl GraphicsWindow.PenColor="red" ldcall.function("t_Move" r+30) GraphicsWindow.PenColor="black" ldcall.function("t_Move" 30+r) GraphicsWindow.BrushColor="black" ldcall.Function4("ell" t_X-r,t_Y-r,d,d) direction=330 For i = 1 To 3 t_PenUp=_fl t_Angle=direction GraphicsWindow.PenColor="black" ldcall.function("t_Move" 30+r) GraphicsWindow.PenColor="white" ldcall.function("t_Move" r+30) GraphicsWindow.BrushColor="white" ldcall.Function4("ell" t_X-r,t_Y-r,d,d) t_PenUp=__t ldcall.Function("t_Turn" 180) ldcall.function("t_Move" 30+r+r+30) direction=direction+90 EndFor GraphicsWindow.PenWidth=7.5 For i = 1 To 2 t_PenUp=__t If i=1 Then ldcall.function2("t_MoveTo" 305,240) Else ldcall.function2("t_MoveTo" 335,240) EndIf t_Angle=0 t_PenUp=_fl GraphicsWindow.PenColor="black" ldcall.function("t_Move" r+30) GraphicsWindow.PenColor="red" ldcall.function("t_Move" 30+r) GraphicsWindow.BrushColor="red" ldcall.Function4("ell" 320-r,240-r-30-30-r-r,d,d) EndFor EndSub Sub doxx initoxx() For i = 1 To 5 If i>2 Then col="1=Black;2=Black ElseIf i=2 Then col[1]=col[2] col[2]="Black" EndIf drawatom() x[i]=t_X y[i]=t_Y drawbond() t_Angle=t_Angle+(72) EndFor t_Angle=0 For i = 1 To 5 If i<2 Or i>2 Then t_PenUp=__t ldcall.function2("t_MoveTo" x[i],y[i]) t_PenUp=_fl For i2 = 1 To 2 t_PenUp=_fl If i2=1 Then t_Angle=72*i-90 Else t_Angle=72*i+180 EndIf col="1=Black;2=White dba() t_Angle=t_Angle-180 t_PenUp=__t drawbond() EndFor EndIf EndFor EndSub Sub aspp cll() oyy=-50 initasp() col="1=Black;2=Black For i = 1 To 6 t_PenUp=_fl ldcall.function("t_turn" 60) drawbond() x[i]=t_X y[i]=t_Y drawatom() EndFor col[2]="White" For i = 1 To 6 t_PenUp=__t ldcall.function2("t_MoveTo" x[i],y[i]) t_Angle=(i-1)*60 t_PenUp=_fl If i = 1 Then col[2]="Black" x[i]=t_X y[i]=t_Y ElseIf i = 2 Then col[2]="Red" x[i]=t_X y[i]=t_Y Else col[2]="White" EndIf dba() EndFor For i = 1 To 2 t_PenUp=__t ldcall.function2("t_MoveTo" x[i],y[i]) If i=1 Then t_Angle=0 ldcall.function("t_move" r+40+r) x[3]=t_X y[3]=t_Y t_Angle=60 col[2]="Red" t_PenUp=_fl dba() ldcall.function("t_turn", -60) col[1]=col[2] col[2]="White" dba() For i = 1 To 3 t_PenUp=__t ldcall.function2("t_MoveTo" x[3],y[3]-20+i*10) t_Angle=-60 col="1=Black;2=Red If i=1 Or i=3 Then GraphicsWindow.PenWidth=7.5 t_PenUp=_fl drawbond() ElseIf i=2 Then t_PenUp=__t dba() EndIf EndFor EndIf EndFor t_PenUp=__t ldcall.function2("t_MoveTo" x[2],y[2]) t_Angle=60 drawbond() col="1=Red;2=Black GraphicsWindow.PenWidth=15 t_PenUp=_fl ldcall.function("t_turn", -30) dba() GraphicsWindow.PenWidth=7.5 x[4]=t_X y[4]=t_Y GraphicsWindow.PenWidth=7.5 For i = 1 To 3 t_PenUp=__t ldcall.function2("t_MoveTo" x[4],y[4]-20+i*10) t_Angle=-60 col="1=Black;2=Red If i=1 Or i=3 Then t_PenUp=_fl drawbond() ElseIf i=2 Then t_PenUp=__t dba() EndIf EndFor GraphicsWindow.PenWidth=15 t_PenUp=__t ldcall.function2("t_MoveTo" x[4],y[4]) ldcall.function("t_turn", -30+180) col="1=Black;2=Black t_PenUp=_fl dba() x[5]=t_X y[5]=t_Y ldcall.function("t_turn", -60) direction=t_Angle For i = 1 To 2 t_PenUp=_fl t_Angle=direction col[2]="White" dba() direction=direction-60 t_PenUp=__t ldcall.function2("t_MoveTo" x[5],y[5]) EndFor t_PenUp=_fl ldcall.function("t_turn" 30+180) dba() EndSub Sub cypp cll() oyy=0 pfx="Cyclopropene GraphicsWindow.Title="Cyclopropene(C3H4)" GraphicsWindow.BrushColor="white" GraphicsWindow.FontSize=72 GraphicsWindow.FontName="Verdana ldcall.function3("dtxt" 600,50,"C") GraphicsWindow.FontSize=28 ldcall.function3("dtxt" 650,90,"3") GraphicsWindow.FontSize=72 ldcall.function3("dtxt" 670,50,"H") GraphicsWindow.FontSize=28 ldcall.function3("dtxt" 725,90,"4") ldcall.function2("t_MoveTo" 250,150) t_Angle=90 t_PenUp=__t For i = 1 To 3 ldcall.function("t_move", 200) T_angle=t_angle+ 120 locatex[i]=t_X locatey[i]=t_Y EndFor GraphicsWindow.BrushColor="black" rofC=30 dofC=rofC*2 For i = 1 To 3 ldcall.function4("ell" locatex[i],locatey[i],dofC,dofC) EndFor GraphicsWindow.PenColor="black" GraphicsWindow.PenWidth=6 shapes.addline(locatex[1]+rofC,locatey[1]+rofC-12.5+oyyy,locatex[3]+rofC,locatey[3]+oyyy+rofC-12.5) shapes.addline(locatex[1]+rofC,locatey[1]+rofC+12.5+oyyy,locatex[3]+rofC,locatey[3]+oyyy+rofC+12.5) GraphicsWindow.PenWidth=10 shapes.addline(locatex[2]+rofC,locatey[2]+rofC+oyyy,locatex[3]+rofC,locatey[3]+oyyy+rofC) shapes.addline(locatex[1]+rofC,locatey[1]+rofC+oyyy,locatex[2]+rofC,locatey[2]+oyyy+rofC) degree=30 rofH=10 dofH=rofH*2 For i = 1 To 3 Step 2 GraphicsWindow.PenColor="black" ldcall.function2("t_MoveTo" locatex[i]+rofC,locatey[i]+rofC) t_Angle=degree t_PenUp=_fl ldcall.function("t_move", rofC+50) GraphicsWindow.PenColor="white" ldcall.function("t_move", 50) xofH[i]=t_X-rofH yofH[i]=t_Y-rofH degree=degree-60 t_PenUp=__t EndFor GraphicsWindow.BrushColor="white" For i = 1 To 3 Step 2 ldcall.function4("ell" xofH[i],yofH[i],dofH,dofH) EndFor degree=150 For i = 1 To 2 t_PenUp=__t ldcall.function2("t_MoveTo" locatex[2]+rofC,locatey[2]+rofC) t_Angle=degree GraphicsWindow.PenColor="black" t_PenUp=_fl ldcall.function("t_move", rofC+50) GraphicsWindow.PenColor="white" ldcall.function("t_move", 50) xofH[i]=t_X-rofH yofH[i]=t_Y-rofH degree=degree-300 EndFor For i = 1 To 2 ldcall.function4("ell" xofH[i],yofH[i],dofH,dofH) EndFor EndSub Sub dxnn initdxn() t_Angle=-120 col[2]="White" dba() t_angle=t_angle+180 t_PenUp=__t drawbond() t_Angle=0 t_PenUp=_fl GraphicsWindow.PenColor="Black" drawatom() draw_double_carbon_bond() drawatom() GraphicsWindow.PenWidth=15 col[2]="White" t_Angle=-60 dba() t_angle=t_angle+180 t_PenUp=__t GraphicsWindow.PenColor="Black" drawbond() t_PenUp=_fl t_Angle=60 col[2]="Red" dba() t_Angle=120 col[1]=col[2] col[2]="Black" dba() t_Angle=60 col="1=Black;2=White dba() t_angle=t_angle+180 t_PenUp=__t drawbond() t_PenUp=_fl t_Angle=180 draw_double_carbon_bond2() drawatom() t_Angle=120 GraphicsWindow.PenWidth=15 col="1=Black;2=White dba() t_angle=t_angle+180 t_PenUp=__t drawbond() t_PenUp=_fl t_Angle=-120 GraphicsWindow.PenWidth=15 col="1=Black;2=red dba() t_Angle=-60 col[1]=col[2] col[2]="Black" drawbond() EndSub Sub draw_double_carbon_bond GraphicsWindow.PenColor="Black" GraphicsWindow.PenWidth=7.5 t_X=t_X+10 For i = 1 To 3 ldcall.function("t_move",r+40+r) t_angle=t_angle-90 ldcall.function("t_move",20) t_angle=t_angle-90 EndFor t_angle=t_angle-90 ldcall.function("t_move",10) t_angle=t_angle-90 EndSub Sub draw_double_carbon_bond2 GraphicsWindow.PenColor="Black" GraphicsWindow.PenWidth=7.5 t_X=t_X-10 For i = 1 To 3 ldcall.function("t_move",r+40+r) t_angle=t_angle-90 ldcall.function("t_move",20) t_angle=t_angle-90 EndFor t_angle=t_angle-90 ldcall.function("t_move",10) t_angle=t_angle-90 EndSub Sub dba drawbond() drawatom() EndSub Sub nff r=30 d=r*2 initnff() GraphicsWindow.PenColor="black For i = 1 To 6 xofC[i]=t_X-r yofC[i]=t_Y-r If i>4 Or i<3 Then t_Angle=direction2 ldcall.function("t_move", r+30) GraphicsWindow.PenColor="white" ldcall.function("t_move", r+30) xofH[i]=t_X-r yofH[i]=t_Y-r t_PenUp=__t ldcall.function2("t_MoveTo" xofC[i]+r,yofC[i]+r) EndIf t_Angle=direction1 t_PenUp=_fl GraphicsWindow.PenColor="black" ldcall.function("t_move", r+60+r) ldcall.function("t_turn" 60) direction1=direction1+60 direction2=direction2+60 EndFor drawatoms1() t_PenUp=__t ldcall.function2("t_MoveTo" xofC[3]+r,yofC[3]+r) t_Angle=60 t_PenUp=_fl For i = 1 To 6 xofC[i]=t_X-r yofC[i]=t_Y-r If i>1 And i<6 Then t_Angle=direction2 ldcall.function("t_move", r+30) GraphicsWindow.PenColor="white" ldcall.function("t_move", r+30) xofH[i]=t_X-r yofH[i]=t_Y-r t_PenUp=__t ldcall.function2("t_MoveTo" xofC[i]+r,yofC[i]+r) EndIf t_Angle=direction1 t_PenUp=_fl GraphicsWindow.PenColor="black" ldcall.function("t_move", r+60+r) ldcall.function("t_turn" 60) direction1=direction1+60 direction2=direction2+60 EndFor drawatoms22() EndSub Sub frmld cll() pfx="Formaldehyde GraphicsWindow.Title="Formaldehyde(HCHO)" GraphicsWindow.BrushColor="white" GraphicsWindow.FontSize=44 GraphicsWindow.FontName="Times New Roman ldcall.function3("dtxt" 500,100,"HCHO") GraphicsWindow.BrushColor="black" rofC=30 dofC=rofC*2' rofH=10 dofH=rofH*2 rofO=40 dofO=rofO*2 ldcall.function4("ell" 320-rofC,240-rofC,dofC,dofC)' the carbon atom GraphicsWindow.PenWidth=6 direction=120 For i = 1 To 2 GraphicsWindow.PenColor="black" t_PenUp="true ldcall.function2("t_MoveTo" 320,240) t_Angle=direction t_PenUp=_fl ldcall.function("t_move", rofC+50) GraphicsWindow.PenColor="white" ldcall.function("t_move", 50) xofH[i]=t_X-rofH yofH[i]=t_Y-rofH direction=direction+120' EndFor' The carbon-hydrogen bonds GraphicsWindow.BrushColor="white" For i = 1 To 2 ldcall.function4("ell" xofH[i],yofH[i],dofH,dofH) EndFor' the hydrogen atoms t_PenUp=__t ldcall.function2("t_MoveTo" 305,240) GraphicsWindow.PenColor="black" t_PenUp=_fl t_Angle=0 ldcall.function("t_move", rofC+50) GraphicsWindow.PenColor="red" ldcall.function("t_move", 50) t_PenUp=__t ldcall.function2("t_MoveTo" 335,240) GraphicsWindow.PenColor="black" t_PenUp=_fl t_Angle=0 ldcall.function("t_move", rofC+50) GraphicsWindow.PenColor="red" ldcall.function("t_move", 50)' the carbon-hydrogen bond GraphicsWindow.BrushColor="red" ldcall.function4("ell" 320-rofO,240-130-rofO,dofO,dofO)' the oxygen atom EndSub Sub shh r=30 d=r*2 cll() initsch() t_PenUp=_fl GraphicsWindow.PenColor="black For i = 1 To 6 xofC[i]=t_X-r yofC[i]=t_Y-r If i>4 Or i<3 Then t_Angle=direction2 ldcall.function("t_move" r+20) GraphicsWindow.PenColor="white" ldcall.function("t_move" r+20) xofH[i]=t_X-r yofH[i]=t_Y-r t_PenUp=__t ldcall.function2("t_MoveTo" xofC[i]+r,yofC[i]+r) EndIf t_Angle=direction1 t_PenUp=_fl GraphicsWindow.PenColor="black" ldcall.function("t_move" r+40+r) ldcall.function("t_turn"60) direction1=direction1+60 direction2=direction2+60 EndFor' the benzene drawatoms1() t_PenUp=__t ldcall.function2("t_MoveTo" xofC[3]+r,yofC[3]+r) t_Angle=72 t_PenUp=_fl For i = 1 To 5 If i=2 Then GraphicsWindow.PenColor="black" ldcall.function("t_move" r+20) GraphicsWindow.PenColor="darkblue" ldcall.function("t_move" 20+r) x[i]=t_X-r y[i]=t_Y-r ldcall.function("t_turn"72) ElseIf i=3 Then GraphicsWindow.PenColor="darkblue" ldcall.function("t_move" r+20) GraphicsWindow.PenColor="yellow" ldcall.function("t_move" 20+r) x[i]=t_X-r y[i]=t_Y-r ldcall.function("t_turn"72) ElseIf i=4 Then GraphicsWindow.PenColor="yellow" ldcall.function("t_move" r+20) GraphicsWindow.PenColor="black" ldcall.function("t_move" 20+r) x[i]=t_X-r y[i]=t_Y-r ldcall.function("t_turn"72) Else GraphicsWindow.PenColor="black" ldcall.function("t_move" r+40+r) x[i]=t_X-r y[i]=t_Y-r ldcall.function("t_turn"72) EndIf EndFor' drawatoms21() GraphicsWindow.PenWidth=7.5 For i = 1 To 3 t_PenUp=__t If i=1 Then ldcall.function2("t_MoveTo" x[1]+r-10,y[1]+r) t_PenUp=_fl ElseIf i=2 Then ldcall.function2("t_MoveTo" x[1]+r+10,y[1]+r) t_PenUp=_fl Else ldcall.function2("t_MoveTo" x[1]+r,y[1]+r) EndIf t_Angle=12 GraphicsWindow.PenColor="Black" ldcall.function("t_move" r+20) GraphicsWindow.PenColor="Red" ldcall.function("t_move" 20+r) If i=3 Then GraphicsWindow.BrushColor="Red" ldcall.function4("ell" t_X-r,t_Y-r,d,d) EndIf EndFor' the double bonds t_PenUp=__t ldcall.function2("t_MoveTo" x[2]+r,y[2]+r) t_Angle=84 t_PenUp=_fl GraphicsWindow.PenWidth=15 GraphicsWindow.PenColor="darkBlue" ldcall.function("t_move" r+20) GraphicsWindow.PenColor="White" ldcall.function("t_move" 20+r) GraphicsWindow.BrushColor="White" ldcall.function4("ell" t_X-r,t_Y-r,d,d) t_PenUp=__t ldcall.function2("t_MoveTo" x[3]+r,y[3]+r)' the nitrogen & hydrogen direction1=156 For i = 1 To 2 t_Angle=direction1 GraphicsWindow.PenColor="Yellow" t_PenUp=_fl ldcall.function("t_move" r+20) GraphicsWindow.PenColor="red" ldcall.function("t_move" 20+r) GraphicsWindow.BrushColor="red" ldcall.function4("ell" t_X-r,t_Y-r,d,d) t_PenUp=__t ldcall.function2("t_MoveTo" x[3]+r,y[3]+r) direction1=direction1+60 EndFor' the two S-O EndSub End>LGP380-1.sb< Start>LGP699.sb< gw = 500 gh = 500 GraphicsWindow.Width = gw GraphicsWindow.Height = gh radius = 10 count = 100 proximity = 50 LDPhysics.SetBoundaries(0,gw,0,gh) LDPhysics.SetGravity(0,0) For i = 1 To count GraphicsWindow.BrushColor = "Blue" ball = Shapes.AddEllipse(2*radius,2*radius) LDPhysics.AddMovingShape(ball,0.3,0.8,1) LDPhysics.SetPosition(ball,radius+Math.GetRandomNumber(gw-2*radius),radius+Math.GetRandomNumber(gh-2*radius),0) EndFor GraphicsWindow.BrushColor = "Red" ball = Shapes.AddEllipse(2*radius,2*radius) LDPhysics.AddMovingShape(ball,0.3,0.8,1) LDPhysics.SetPosition(ball,gw/2,gh/2,0) GraphicsWindow.BrushColor = LDColours.Transparent halo = Shapes.AddEllipse(2*proximity,2*proximity) While ("True") start = Clock.ElapsedMilliseconds LDPhysics.DoTimestep() For angle = 10 To 360 Step 10 contacts = LDPhysics.RayCast(ball,angle,proximity) indices = Array.GetAllIndices(contacts) For i = 1 To Array.GetItemCount(indices) Shapes.SetOpacity(indices[i],25) EndFor EndFor Pos = LDPhysics.GetPosition(ball) Shapes.Move(halo,Pos[1]-proximity,Pos[2]-proximity) If (LDUtilities.KeyDown("left")) Then LDPhysics.SetImpulse(ball,-100,0) EndIf If (LDUtilities.KeyDown("Right")) Then LDPhysics.SetImpulse(ball,100,0) EndIf If (LDUtilities.KeyDown("Up")) Then LDPhysics.SetImpulse(ball,0,-100) EndIf If (LDUtilities.KeyDown("Down")) Then LDPhysics.SetImpulse(ball,0,100) EndIf delay = 25-(Clock.ElapsedMilliseconds-start) If (delay > 0) Then Program.Delay(delay) EndIf EndWhile End>LGP699.sb< Start>LGQ405.sb< GraphicsWindow.Width =1200 GraphicsWindow.Height=900 GraphicsWindow.Title ="3D tubes GraphicsWindow.BackgroundColor="darkblue For z=2 To 0 Step -1 r=200 For y=100 To 700 For rw=0 To 2 x=ldmath.Sin (y-100)*200+300+rw*250 cc=math.Remainder (y/3+200+math.Remainder (rw 2)*40 360) GraphicsWindow.BrushColor = LDColours.HSLtoRGB (cc 1 .13+y/2200) GraphicsWindow.FillEllipse (x y-55+z*180 r r) EndFor r=r-.2 EndFor EndFor End>LGQ405.sb< Start>LGQ874.sb< pp=LDCommPort.OpenPort ("COM9" 115200) TextWindow.WriteLine (pp) nn=text.GetCharacter (10) mm[1][1]=LDText.Split ("1 - - - 1 - - -" " ") mm[1][2]=LDText.Split ("1 - 1 - 1 - 1 -" " ") mm[1][3]=LDText.Split ("1 - - - 1 - 1 -" " ") mm[1][4]=LDText.Split ("1 - 1 - 1 - 1 -" " ") mm[1][5]=LDText.Split ("1 - - - 1 - - -" " ") mm[2][1]=LDText.Split ("1 - - - 1 - - -" " ") mm[2][2]=LDText.Split ("1 1 1 - 1 1 1 -" " ") mm[2][3]=LDText.Split ("1 - - - 1 - - -" " ") mm[2][4]=LDText.Split ("1 1 1 - 1 - 1 1" " ") mm[2][5]=LDText.Split ("1 - - - 1 - - -" " ") mm[3][1]=LDText.Split ("1 1 - 1 1 1 - -" " ") mm[3][2]=LDText.Split ("1 - - 1 1 - 1 1" " ") mm[3][3]=LDText.Split ("1 1 - 1 1 - - 1" " ") mm[3][4]=LDText.Split ("1 1 - 1 1 - 1 -" " ") mm[3][5]=LDText.Split ("1 - - - 1 1 - 1" " ") mm[4][1]=LDText.Split ("1 - - - 1 - - -" " ") mm[4][2]=LDText.Split ("1 - 1 - 1 - 1 1" " ") mm[4][3]=LDText.Split ("1 - - - 1 - - -" " ") mm[4][4]=LDText.Split ("1 1 1 - 1 1 1 -" " ") mm[4][5]=LDText.Split ("1 - - - 1 - - -" " ") mm[5][1]=LDText.Split ("1 1 - 1 1 - - -" " ") mm[5][2]=LDText.Split ("1 - 1 1 1 1 1 -" " ") mm[5][3]=LDText.Split ("1 - - - 1 1 1 -" " ") mm[5][4]=LDText.Split ("1 1 - 1 1 1 - 1" " ") mm[5][5]=LDText.Split ("1 1 - 1 1 - 1 1" " ") Timer.Interval=1000 Timer.Tick=ttt Sub ttt s1=s While s1=s s1=math.GetRandomNumber (5) EndWhile s=s1 endsub s=1 ff=3 'lamp brightness factor While "true For t=0 To 17 For x=0 To 39 co=text.Append(x+" " math.Abs(math.floor(ldmath.Sin(t*10)*10*ff)))+" "+Text.Append (15*ff-Math.floor(x/3) " "+Math.floor(x/3)*ff) If mm[s][Math.floor(x/8)+1] [Math.Remainder (x 8)+1]="1" Then co=text.Append(x+" " "0 0 0") endif rr=LDCommPort.TXString (co+nn) Program.Delay (2) endfor Program.Delay (15) endfor EndWhile End>LGQ874.sb< Start>LGR225.sb< GraphicsWindow.Width=800 GraphicsWindow.Title="Text Sensing tt="A.u.t.u.m.n. .l.e.a.v.e.s. .f.a.l.l.i.n.g. .d.o.w.n. .t.o. .s.t.r.e.e.t" t1="D.o.g.s. .b.a.r.k.i.n.g. .a.t. .t.h.e. .p.a.s.s.e.r.s.-.b.y. .l.o.u.d.l.y cc[1]=LDText.Split (tt ".") cc[2]=LDText.Split (t1 ".") ww[1]= Array.GetItemCount (cc[1]) ww[2]= Array.GetItemCount (cc[2]) GraphicsWindow.FontName="Calibri GraphicsWindow.FontSize=22 GraphicsWindow.BrushColor=LDColours.HSLtoRGB (30 .8 .2) GraphicsWindow.FillRectangle (0 0 1200 1000) GraphicsWindow.BrushColor="black ee=Shapes.AddEllipse (200 300) Shapes.Move (ee 300 70) ii=LDGraphicsWindow.Capture ("" "false") Shapes.zoom (ee .8 .8) Shapes.Move (ee 306 78) LDEffect.DropShaddow (ee "") ff=.9 px=30 For i=1 to 2 For r=1 To ww[i] c[i][r]=ldtext.GetWidth(cc[i][r]) Program.Delay (5) EndFor EndFor gw= 1000 GraphicsWindow.BrushColor="white For y=1 To 10 px=170 ci=math.Remainder (y-1 2)+1 For r=1 To ww[ci] ll=LDImage.GetPixel (ii px y*40) while ll="#FF000000" And pxLGR225.sb< Start>LGR919-0.sb< ' Sample Code for KinectFaceList Object ' Program ID LGR919-0 title = "KinectFaceList Sample" GraphicsWindow.Title = title Init() KinectWindow.Show("Color") KinectFaceList.FacesChanged = OnFacesChanged KinectFaceList.IsAvailableChanged = OnIsAvailableChanged KinectFaceList.StartTracking() While "True" If facesChanged Then 'KinectFaceList.StopTracking("False") CheckFaceList() facesChanged = "False" 'KinectFaceList.StartTracking() EndIf EndWhile Sub Init CRLF = Text.GetCharacter(13) + Text.GetCharacter(10) gw = 598 gh = 500 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BackgroundColor = "LightGray" GraphicsWindow.BrushColor = "Black" tbox = Controls.AddMultiLineTextBox(10, 10) Controls.SetSize(tbox, (gw / 2) - 10, gh - 20) pos = "1=Left;2=Top;3=Right;4=Bottom;" iPos = Array.GetAllIndices(pos) nPos = Array.GetItemCount(pos) pointType = "1=EyeLeft;2=EyeRight;3=Nose;4=MouthCornerLeft;" pointType = pointType + "5=MouthCornerRight;" iPnt = Array.GetAllIndices(pointType) nPnt = Array.GetItemCount(pointType) faceProperty = "1=Happy;2=Engaged;3=WearingGlasses;4=LeftEyeClosed;" faceProperty = faceProperty + "5=RightEyeClosed;6=MouthOpen;" faceProperty = faceProperty + "7=MouthMoved;8=LookingAway;" iProp = Array.GetAllIndices(faceProperty) nProp = Array.GetItemCount(faceProperty) EndSub Sub CheckFaceList buf = "" cnt = KinectFaceList.Count For index = 1 To cnt If KinectFaceList.IsTracked(index) Then buf = buf + "index=" + index + CRLF buf = buf + CRLF + "GetBoundingBoxInColorSpace:" + CRLF box = KinectFaceList.GetBoundingBoxInColorSpace(index) For j = 1 To nPos buf = buf + " " + pos[iPos[j]] + "=" + box[pos[iPos[j]]] + CRLF EndFor ShowFace() buf = buf + CRLF + "GetBoundingBoxInInfraredSpace:" + CRLF box = KinectFaceList.GetBoundingBoxInInfraredSpace(index) For j = 1 To nPos buf = buf + " " + pos[iPos[j]] + "=" + box[pos[iPos[j]]] + CRLF EndFor buf = buf + CRLF + "GetFacePointInColorSpace:" + CRLF For j = 1 To nPnt point = KinectFaceList.GetFacePointInColorSpace(index, pointType[iPnt[j]]) buf = buf + " " + pointType[iPnt[j]] + "=" + point["x"] + "," + point["y"] + CRLF p[pointType[iPnt[j]]] = point EndFor ShowFacePoint() buf = buf + CRLF + "GetFaceProperty:" + CRLF For j = 1 To nProp ans = KinectFaceList.GetFaceProperty(index, faceProperty[iProp[j]]) buf = buf + " " + faceProperty[iProp[j]] + "=" + ans + CRLF EndFor buf = buf + CRLF + "GetFeatures:" + CRLF features = KinectFaceList.GetFeatures(index) iFeat = Array.GetAllIndices(features) nFeat = Array.GetItemCount(features) For j = 1 To nFeat buf = buf + " " + iFeat[j] + "=" + features[iFeat[j]] + CRLF EndFor buf = buf + CRLF + "GetRotationQuaternion:" + CRLF rotation = KinectFaceList.GetRotationQuaternion(index) iRot = Array.GetAllIndices(rotation) nRot = Array.GetItemCount(rotation) For j = 1 To nRot buf = buf + " " + iRot[j] + "=" + rotation[iRot[j]] + CRLF EndFor buf = buf + CRLF + "GetTrackingId:" + CRLF id = KinectFaceList.GetTrackingId(index) buf = buf + " id=" + id + CRLF EndIf EndFor If buf <> "" Then Controls.SetTextBoxText(tbox, buf) EndIf EndSub Sub OnFacesChanged facesChanged = "True" EndSub Sub OnIsAvailableChanged If KinectFaceList.IsAvailable Then GraphicsWindow.Title = title + " - Ready" Else GraphicsWindow.Title = title + " - Not Ready" EndIf EndSub Sub ShowFace ' param box - face bounding box scaleX = 0.5 scaleY = 0.5 x = box["Left"] y = box["Top"] width = box["Right"] - x height = box["Bottom"] - y If face <> "" Then Shapes.Remove(face) EndIf GraphicsWindow.BrushColor = "White" face = Shapes.AddEllipse(width * scaleX, height * scaleY) Shapes.Move(face, x * scaleX, y * scaleY) EndSub Sub ShowFacePoint ' param p - face point array size = height / 10 x = p["EyeLeft"]["x"] y = p["EyeLeft"]["y"] If eyeLeft <> "" Then Shapes.Remove(eyeLeft) EndIf GraphicsWindow.BrushColor = "Black" eyeLeft = Shapes.AddEllipse(size * scaleX, size * scaleY) Shapes.Move(eyeLeft, x * scaleX, y * scaleY) x = p["EyeRight"]["x"] y = p["EyeRight"]["y"] If eyeRight <> "" Then Shapes.Remove(eyeRight) EndIf GraphicsWindow.BrushColor = "Black" eyeRight = Shapes.AddEllipse(size * scaleX, size * scaleY) Shapes.Move(eyeRight, x * scaleX, y * scaleY) x = p["Nose"]["x"] y = p["Nose"]["y"] If nose <> "" Then Shapes.Remove(nose) EndIf GraphicsWindow.BrushColor = "Pink" nose = Shapes.AddTriangle(0, size * scaleX, size * scaleX / 2, 0, size * scaleY, size * scaleY) Shapes.Move(nose, x * scaleX, y * scaleY) x1 = p["MouthCornerLeft"]["x"] y1 = p["MouthCornerLeft"]["y"] x2 = p["MouthCornerRight"]["x"] y2 = p["MouthCornerRight"]["y"] If mouth <> "" Then Shapes.Remove(mouth) EndIf GraphicsWindow.PenColor = "Red" mouth = Shapes.AddLine(x1 * scaleX, y1 * scaleY, x2 * scaleX, y2 * scaleY) GraphicsWindow.PenColor = "Black" EndSub End>LGR919-0.sb< Start>LGR919.sb< ' Sample Code for KinectFaceList Object title = "KinectFaceList Sample" GraphicsWindow.Title = title Init() KinectWindow.Show("Color") KinectFaceList.FacesChanged = OnFacesChanged KinectFaceList.IsAvailableChanged = OnIsAvailableChanged KinectFaceList.StartTracking() While "True" If facesChanged Then 'KinectFaceList.StopTracking("False") CheckFaceList() facesChanged = "False" 'KinectFaceList.StartTracking() EndIf EndWhile Sub Init CRLF = Text.GetCharacter(13) + Text.GetCharacter(10) gw = 598 gh = 500 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BackgroundColor = "LightGray" GraphicsWindow.BrushColor = "Black" tbox = Controls.AddMultiLineTextBox(10, 10) Controls.SetSize(tbox, (gw / 2) - 10, gh - 20) pos = "1=Left;2=Top;3=Right;4=Bottom;" iPos = Array.GetAllIndices(pos) nPos = Array.GetItemCount(pos) pointType = "1=EyeLeft;2=EyeRight;3=Nose;4=MouthCornerLeft;" pointType = pointType + "5=MouthCornerRight;" iPnt = Array.GetAllIndices(pointType) nPnt = Array.GetItemCount(pointType) faceProperty = "1=Happy;2=Engaged;3=WearingGlasses;4=LeftEyeClosed;" faceProperty = faceProperty + "5=RightEyeClosed;6=MouthOpen;" faceProperty = faceProperty + "7=MouthMoved;8=LookingAway;" iProp = Array.GetAllIndices(faceProperty) nProp = Array.GetItemCount(faceProperty) EndSub Sub CheckFaceList buf = "" cnt = KinectFaceList.Count For index = 1 To cnt If KinectFaceList.IsTracked(index) Then buf = buf + "index=" + index + CRLF buf = buf + CRLF + "GetBoundingBoxInColorSpace:" + CRLF box = KinectFaceList.GetBoundingBoxInColorSpace(index) For j = 1 To nPos buf = buf + " " + pos[iPos[j]] + "=" + box[pos[iPos[j]]] + CRLF EndFor ShowFace() buf = buf + CRLF + "GetBoundingBoxInInfraredSpace:" + CRLF box = KinectFaceList.GetBoundingBoxInInfraredSpace(index) For j = 1 To nPos buf = buf + " " + pos[iPos[j]] + "=" + box[pos[iPos[j]]] + CRLF EndFor buf = buf + CRLF + "GetFacePointInColorSpace:" + CRLF For j = 1 To nPnt point = KinectFaceList.GetFacePointInColorSpace(index, pointType[iPnt[j]]) buf = buf + " " + pointType[iPnt[j]] + "=" + point["x"] + "," + point["y"] + CRLF p[pointType[iPnt[j]]] = point EndFor ShowFacePoint() buf = buf + CRLF + "GetFaceProperty:" + CRLF For j = 1 To nProp ans = KinectFaceList.GetFaceProperty(index, faceProperty[iProp[j]]) buf = buf + " " + faceProperty[iProp[j]] + "=" + ans + CRLF EndFor buf = buf + CRLF + "GetFaceProperty:" + CRLF features = KinectFaceList.GetFeatures(index) iFeat = Array.GetAllIndices(features) nFeat = Array.GetItemCount(features) For j = 1 To nFeat buf = buf + " " + iFeat[j] + "=" + features[iFeat[j]] + CRLF EndFor buf = buf + CRLF + "GetRotationQuaternion:" + CRLF rotation = KinectFaceList.GetRotationQuaternion(index) iRot = Array.GetAllIndices(rotation) nRot = Array.GetItemCount(rotation) For j = 1 To nRot buf = buf + " " + iRot[j] + "=" + rotation[iRot[j]] + CRLF EndFor buf = buf + CRLF + "GetTrackingId:" + CRLF id = KinectFaceList.GetTrackingId(index) buf = buf + " id=" + id + CRLF EndIf EndFor If buf <> "" Then Controls.SetTextBoxText(tbox, buf) EndIf EndSub Sub OnFacesChanged facesChanged = "True" EndSub Sub OnIsAvailableChanged If KinectFaceList.IsAvailable Then GraphicsWindow.Title = title + " - Ready" Else GraphicsWindow.Title = title + " - Not Ready" EndIf EndSub Sub ShowFace ' param box - face bounding box scaleX = 0.5 scaleY = 0.5 x = box["Left"] y = box["Top"] width = box["Right"] - x height = box["Bottom"] - y If face <> "" Then Shapes.Remove(face) EndIf GraphicsWindow.BrushColor = "White" face = Shapes.AddEllipse(width * scaleX, height * scaleY) Shapes.Move(face, x * scaleX, y * scaleY) EndSub Sub ShowFacePoint ' param p - face point array size = height / 10 x = p["EyeLeft"]["x"] y = p["EyeLeft"]["y"] If eyeLeft <> "" Then Shapes.Remove(eyeLeft) EndIf GraphicsWindow.BrushColor = "Black" eyeLeft = Shapes.AddEllipse(size * scaleX, size * scaleY) Shapes.Move(eyeLeft, x * scaleX, y * scaleY) x = p["EyeRight"]["x"] y = p["EyeRight"]["y"] If eyeRight <> "" Then Shapes.Remove(eyeRight) EndIf GraphicsWindow.BrushColor = "Black" eyeRight = Shapes.AddEllipse(size * scaleX, size * scaleY) Shapes.Move(eyeRight, x * scaleX, y * scaleY) x = p["Nose"]["x"] y = p["Nose"]["y"] If nose <> "" Then Shapes.Remove(nose) EndIf GraphicsWindow.BrushColor = "Pink" nose = Shapes.AddTriangle(0, size * scaleX, size * scaleX / 2, 0, size * scaleY, size * scaleY) Shapes.Move(nose, x * scaleX, y * scaleY) x1 = p["MouthCornerLeft"]["x"] y1 = p["MouthCornerLeft"]["y"] x2 = p["MouthCornerRight"]["x"] y2 = p["MouthCornerRight"]["y"] If mouth <> "" Then Shapes.Remove(mouth) EndIf GraphicsWindow.PenColor = "Red" mouth = Shapes.AddLine(x1 * scaleX, y1 * scaleY, x2 * scaleX, y2 * scaleY) GraphicsWindow.PenColor = "Black" EndSub End>LGR919.sb< Start>LGS922.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 kb=0 BUF=20 kont=0' kontrola 1 0 1 0 kop=0 kk=0 kontrolarot=0 ruka=0 VEL=1 proz=100 zrec=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" image100=Shapes.AddImage(imagepath) Shapes.Move(image100, 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("B R I S I KVAD ",1250,430 ) 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) GraphicsWindow.BrushColor ="Magenta" button1740 = Controls.AddButton("UKLONI boje ",1250,206 ) Controls.SetSize(button1740, 95, 30) GraphicsWindow.BrushColor ="Black" button1750 = Controls.AddButton("__________ ", 1250,238 ) Controls.SetSize(button1750, 95, 30) button1760 = Controls.AddButton("DRAW kvad ", 1250,270 ) Controls.SetSize(button1760, 95, 30) button1770 = Controls.AddButton(" Z O O M ", 1250,302 ) Controls.SetSize(button1770, 95, 30) button1780 = Controls.AddButton("O P A C I T Y", 1250,334 ) Controls.SetSize(button1780, 95, 30) GraphicsWindow.BrushColor ="Magenta" button1790 = Controls.AddButton("DODAJ BOJE", 1250,366 ) Controls.SetSize(button1790, 95, 30) GraphicsWindow.BrushColor ="Black" button1800 = Controls.AddButton("FILL kvad", 1250,398 ) Controls.SetSize(button1800, 95, 30) GraphicsWindow.BrushColor ="Red" button44 = Controls.AddButton(" DODAJ EL", 1250, 463) Controls.SetSize(button44, 95, 30) GraphicsWindow.BrushColor ="Red" button1801 = Controls.AddButton(" KOPIRAJ EL", 1250, 496) Controls.SetSize(button1801, 95, 30) GraphicsWindow.BrushColor ="Red" button1810 = Controls.AddButton(" E X T", 1250,692 ) Controls.SetSize(button1810, 95, 30) GraphicsWindow.BrushColor ="Black" '------------------------------------------------------------------------------------------------------------- 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" '----------------------------------------------------------------------------------------------- E 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(" -- 220 v -- ", 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" 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 = 20 GraphicsWindow.BrushColor = "white" GraphicsWindow.BrushColor = "White" Program.Delay(1000) Shapes.Remove(PRIKA) PRIKA = Shapes.AddText( (Clock.Time) ) Shapes.Move(PRIKA, 1250, 110) GraphicsWindow.FontSize = 20 GraphicsWindow.BrushColor = "White" '=============== 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" ' POZICIJA ELEMENTA Shapes.Remove(NT[10]) imgpx=Shapes.GetLeft(image) imgpy=Shapes.GetTop(image[s]) Shapes.Remove(NT[10]) NT[10]=(imgpx) nt() 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 '-------------- K V A D R A T ------------------------------------ If Controls.LastClickedButton = button1800 Then proz=100'= NEPROVIDAN zrec=1' ORIGINAL POCETNA VELICINA If prevx34 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" ) kopija[kb]=Shapes.AddImage(image[s]) image=Shapes.AddImage(image[s]) Shapes.Move(image,120,120) brisi=1000 Program.Delay(100) OB[1]="EL - IZBOR" ElseIf Controls.LastClickedButton = button1801 Then kopija() '++++++++++++++++++++++++++++++++++++++++++++ '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) '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ '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) 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 ]="Red" po=0 For gh = 11 To 143 GraphicsWindow.brushcolor=boja[gh] po=po+8.5 GraphicsWindow.FillRectangle(86+po,100,20,20) 'GraphicsWindow.PenWidth=0 'boja[gh]=Shapes.AddRectangle(20,20) ' Shapes.move( boja[gh],100+po,100,) Endfor EndSub '********************************************************** 'BRIAE LINIJU BOJA Sub brb bo=0 For gh = 11 To 144 GraphicsWindow.brushcolor=" " bo=bo+8.5 GraphicsWindow.FillRectangle(86+bo,100,20,23) 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 EndSub Sub nt GraphicsWindow.FontSize = 20 GraphicsWindow.BrushColor ="Red" GraphicsWindow.FillRectangle(1100,25,240,28) GraphicsWindow.BrushColor ="White" NT[10]= Shapes.AddText(NT[10]) Shapes.Move(NT[10], 1110, 25) EndSub Sub kopija kk=kk+1 Shapes.AddImage(kopija[kb]) kopija[kk]=(kopija[kb]) Shapes.AddImage(kopija[kk]) Shapes.Move(kopija[kk],QX,QY) kk=kk+1 EndSub End>LGS922.sb< Start>LGX971.sb< 'Done so far: 'got almost all mobs and bosses + bonus monsters/bosses 'got health pots and mana pots 'got/need skills 'got saving and loading, THINK SO! :D 'Need ASAP: 'equipment (add moar items!) + MEGA EPIC ITEMS! xD 'questgiver (HOW!?!?!) + daily quests 'town (NAME ? or more than one?) 'map (BUT HOOOOW) player() variables() Menu() Sub variables path = Program.Directory + "\Diablo.txt" ' The following line could be harmful and has been automatically commented. ' '' variables=File.ReadContents(path) x = 0 y = 0 EndSub Sub Save_game path = Program.Directory + "\Diablo.txt" variables[1] = x variables[2] = y variables[3] = level variables[4] = playerhp variables[5] = playerstr variables[6] = playerdef variables[7] = playergold variables[8] = playerxp variables[9] = totalplayerhp variables[10] = sp variables[11] = totalplayermp variables[12] = playermp variables[13] = hppot variables[14] = mppot variables[15] = playervitinc variables[16] = playerintinc variables[17] = playervit variables[18] = playerint variables[19] = activatevls variables[20] = activatelbs variables[21] = activatescm variables[22] = activateepa variables[23] = activatesk variables[24] = activatezh variables[25] = activatedg variables[26] = rjpot ' The following line could be harmful and has been automatically commented. ' ' ' File.WriteContents(path, variables) EndSub Sub load_game path = Program.Directory + "\Diablo.txt" x = variables[1] y = variables [2] level = variables[3] playerhp = variables[4] playerstr = variables[5] playerdef = variables[6] playergold = variables[7] playerxp = variables[8] totalplayerhp = variables[9] sp = variables[10] totalplayermp = variables[11] playermp = variables[12] hppot =variables[13] mppot = variables[14] playervitinc = variables[15] playerintinc = variables[16] playervit = variables[17] playerint = variables[18] activatevls = variables[19] activatelbs = variables[20] activatescm = variables[21] activateepa = variables[22] activatesk = variables[23] activatezh =variables[24] activatedg= variables[25] rjpot = variables[26] EndSub Sub player sp = 0 weapon = "Sword" level = 1 totalplayerhp = 100 + playervitinc playerhp = 100 + playervitinc playerstr = 10 - enemydef playerdef = 10 playergold = 0 playerxp = 0 playermp = 30 + playerintinc totalplayermp = 30 + playerintinc hppot = 10 mppot = 10 playervitinc = 0 playerintinc = 0 playervit = 10 playerint = 10 activatevls = 0 activatelbs = 0 activatescm = 0 activateepa = 0 activatedg = 0 activatesk = 0 activatezh = 0 EndSub 'Listing monsters Sub skeleton enemyname = "Skeleton" enemyhp = 10 totalenemyhp = 10 enemystr = 12 - playerdef enemydef = 1 xpdrop = 5 golddrop = 3 EndSub Sub zombie enemyname = "Zombie" enemyhp = 20 totalenemyhp = 20 enemystr = 14 - playerdef enemydef = 2 xpdrop = 10 golddrop = 6 EndSub Sub hordeofzombies enemyname = "Horde of Zombies" enemyhp = 80 totalenemyhp = 80 enemystr = 10 - playerdef enemydef = 2 xpdrop = 13 golddrop = 7 EndSub Sub demon enemyname = "Demon" enemyhp = 30 totalenemyhp = 30 enemystr = 16- playerdef enemydef = 3 xpdrop = 15 golddrop = 9 EndSub 'Listing Bosses Sub skeletonking enemyname = "Leoric, the Skeleton King" enemyhp = 250 totalenemyhp = 250 enemystr = 25- playerdef enemydef = 15 xpdrop = 25 golddrop = 45 EndSub Sub andariel enemyname = "Andariel, the Maiden of Angush" enemyhp = 300 totalenemyhp = 300 enemystr = 30- playerdef enemydef = 20 xpdrop = 30 golddrop = 50 EndSub Sub azmodan enemyname = "Azmodan, Lord of Sin" enemyhp = 500 totalenemyhp = 500 enemystr = 35- playerdef enemydef = 25 xpdrop = 40 golddrop = 60 EndSub Sub Mephisto eneyname = "Mephisto, Lord of Hatred (Prime Evil)" enemyhp = 850 totalenemyhp = 850 enemystr = 50- playerdef enemydef = 40 xpdrop = 40 goldrop = 80 EndSub Sub Diablo enemyname = "Diablo, Lord of Terror (the Prime Evil)" enemyhp = 1000 totalenemyhp = 1000 enemystr = 60- playerdef enemydef = 50 xpdrop = 50 golddrop = 100 EndSub 'Starting menu Sub Menu TextWindow.WriteLine(" Diablo") space() TextWindow.WriteLine(" ALPHA TEST") For i =1 To 5 space() EndFor TextWindow.WriteLine(" 1. New Game") TextWindow.WriteLine(" 2. Load Game") TextWindow.WriteLine(" 3. Exit") For i =1 To 10 space() EndFor TextWindow.WriteLine("All trademarks referenced herein are the properties of their respective owners.") TextWindow.WriteLine(" ©2015 Blizzard Entertainment, Inc. All rights reserved.") space() menu1 = TextWindow.ReadKey() If menu1 = 1 Then TextWindow.Clear() intro() ElseIf menu1 = 2 then TextWindow.Clear() ' The following line could be harmful and has been automatically commented. ' ' ' variables = File.ReadContents(path) load_game() selectlocation() elseif menu1 = 3 then Program.End() Else wrongoption() Menu() EndIf EndSub Sub space TextWindow.WriteLine(" ") endsub Sub enter TextWindow.WriteLine("Press Enter") TextWindow.PauseWithoutMessage() TextWindow.Clear() endsub Sub wrongoption TextWindow.Clear() TextWindow.WriteLine("You can only select the options listed.") space() enter() EndSub Sub intro TextWindow.WriteLine("Story: You need to save Sanctuary from the Prime Evils!") TextWindow.WriteLine("Diablo roams the streets of the human world once again.") TextWindow.WriteLine("Kill Diablo before the Prime Evils empower him.") space() enter() selectlocation() EndSub Sub leveling If (50 <= playerxp) And (playerxp <= 99 * 50) And (Math.Remainder(playerxp, 50) = 0) Then sp = sp + 1 level = level + 1 EndIf EndSub Sub town If x = 1 And y = 1 then TextWindow.Clear() selectlocation() EndIf If x = 4 And y = 60 then TextWindow.Clear() selectlocation() EndIf If x = 1 And (2 <= y And y <= 6) Then TownRandom() endif If x = 4 And (61 <= y And y <= 66) Then TownRandom() endif EndSub Sub townshopname If x = 1 And y = 1 then TextWindow.WriteLine("8. Enter Tristram") space() EndIf If x = 4 And y = 20 then TextWindow.WriteLine("8. Enter the Burning Hells") space() EndIf EndSub Sub townshopname2 If x = 1 And y = 1 then TextWindow.Write("Tristram ") EndIf If x = 4 And y = 20 then TextWindow.Write("Burning Hells ") EndIf EndSub Sub townshopenter if selectlocation1 = 8 then TextWindow.Clear() shop() EndIf EndSub Sub townname If x = 1 And y = 1 then TextWindow.WriteLine("Tristram") space() EndIf If x = 1 And (2 <= y And y <= 6) Then TextWindow.WriteLine("Tristram") space() endif If x =4 And y = 20 then TextWindow.WriteLine("Burning Hells merchant") space() EndIf If x = 4 And (61 <= y And y <= 66) Then TextWindow.WriteLine("Burning Hells") space() endif EndSub sub townrandom randomencounter1 = Math.GetRandomNumber(100) If randomencounter1 < 3then TextWindow.Clear() TextWindow.WriteLine("You have found a Health Potion.") space() enter() hppot = hppot + 1 selectlocation() elseIf randomencounter1 < 6 then TextWindow.Clear() TextWindow.WriteLine("You have found a Mana Potion.") space() enter() mppot = mppot + 1 selectlocation() Else selectlocation() EndIf EndSub Sub selectlocation leveling() townname() TextWindow.WriteLine("Coordinates: " + "(" + x + "," + y + ")") space() TextWindow.WriteLine("Level: " + level + " Stat Point: " + sp) space() TextWindow.WriteLine("Exp: " + playerxp + " Gold: " + playergold) space() TextWindow.WriteLine("Nephalem Health: " + playerhp + "/" + totalplayerhp + " Nephalem Mana: " + playermp + "/" + totalplayermp) space() TextWindow.WriteLine("1. North (" + x + "," + (y + 1) + ")") TextWindow.WriteLine("2. East (" + (x + 1) + "," + y + ")") TextWindow.WriteLine("3. West (" + (x - 1) + "," + y + ")") TextWindow.WriteLine("4. South (" + x + "," + (y - 1) + ")") space() TextWindow.WriteLine("5. Inventory") TextWindow.WriteLine("6. Statistics") TextWindow.WriteLine("7. Journal") space() townshopname() TextWindow.WriteLine("9. Miscellaneous") space() selectlocation1 = TextWindow.ReadKey() townshopenter() If selectlocation1 = 1 Then TextWindow.Clear() y = y + 1 randomencounter() ElseIf selectlocation1 = 2 then TextWindow.Clear() x = x + 1 randomencounter() elseif selectlocation1 = 3 then TextWindow.Clear() x = x-1 randomencounter() elseif selectlocation1 = 4 then TextWindow.Clear() y = y-1 randomencounter() elseif selectlocation1 = 5 then TextWindow.Clear() selectlocationinventory() elseif selectlocation1 = 6 then TextWindow.Clear() stats() elseif selectlocation1 = 7 then TextWindow.Clear() journal() elseIf selectlocation1 = 9 Then misc() Else wrongoption() selectlocation() EndIf EndSub 'Journal menu/listing stuff Sub journal TextWindow.WriteLine("Journal") space() TextWindow.WriteLine("Table of Contents") space() space() TextWindow.WriteLine("1. Monsters") TextWindow.WriteLine("2. Bosses") TextWindow.WriteLine("3. Weapons") TextWindow.WriteLine("4. Armors") TextWindow.WriteLine("5. Potions") TextWindow.WriteLine("6. Towns") TextWindow.WriteLine("7. Shops") space() TextWindow.WriteLine("8. Return") space() journal1 =TextWindow.ReadKey() If journal1 = 1 then TextWindow.Clear() monsterjournal() elseIf journal1 = 2 then TextWindow.Clear() bossjournal() elseIf journal1 = 3 then TextWindow.Clear() weaponjournal() elseIf journal1 = 4 then TextWindow.Clear() armorjournal() elseIf journal1 = 5 then TextWindow.Clear() potionjournal() elseIf journal1 = 6 then TextWindow.Clear() townjournal() elseIf journal1 = 7 then TextWindow.Clear() shopjournal() elseIf journal1 = 8 Then TextWindow.Clear() selectLocation() Else TextWindow.Clear() wrongoption() TextWindow.Clear() journal() EndIf endsub 'Listing monsters (adding lore later maybe?) Sub monsterjournal3 TextWindow.WriteLine(" Monsters") space() TextWindow.WriteLine(" Corrupted Angel") TextWindow.WriteLine("Health: 35 Defence: 3") TextWindow.WriteLine("Strenght: 15 Gold drop: 10") TextWindow.WriteLine("Experience: 15") space() TextWindow.WriteLine(" Exorcist") TextWindow.WriteLine("Health: 38 Defence: 2") TextWindow.WriteLine("Strenght: 17 Gold drop: 10") TextWindow.WriteLine("Experience: 16") space() space() TextWindow.WriteLine("1.Return to Journal 2.Previous Page 3.Next Page (soon!)") space() space() journal3 =TextWindow.ReadKey() If journal3 = 1 Then TextWindow.Clear() journal() ElseIf journal2 = 2 then TextWindow.Clear() monsterjournal2() Else TextWindow.Clear() wrongoption() TextWindow.Clear() monsterjournal3() endif EndSub Sub monsterjournal2 TextWindow.WriteLine(" Monsters") space() TextWindow.WriteLine(" Horde Of Zombies") TextWindow.WriteLine("Health: 80 Defence: 3") TextWindow.WriteLine("Strenght: 10 Gold drop: 8") TextWindow.WriteLine("Experience: 14") space() TextWindow.WriteLine(" Demon") TextWindow.WriteLine("Health: 30 Defence: 3") TextWindow.WriteLine("Strenght: 16 Gold drop: 9") TextWindow.WriteLine("Experience: 15") space() TextWindow.WriteLine(" Succubus") TextWindow.WriteLine("Health: 33 Defence: 3") TextWindow.WriteLine("Strenght: 15 Gold drop: 9") TextWindow.WriteLine("Experience: 15") space() space() TextWindow.WriteLine("1.Return to Journal 2.Previous Page 3.Next Page") space() space() journal2 =TextWindow.ReadKey() If journal2 = 1 Then TextWindow.Clear() journal() ElseIf journal2 = 2 then TextWindow.Clear() monsterjournal() Elseif journal2 = 3 then TextWindow.Clear() monsterjournal3() Else TextWindow.Clear() wrongoption() TextWindow.Clear() monsterjournal2() endif EndSub Sub monsterjournal TextWindow.WriteLine(" Monsters") space() TextWindow.WriteLine(" Skeleton") TextWindow.WriteLine("Health: 10 Defence: 1") TextWindow.WriteLine("Strenght: 12 Gold drop: 3") TextWindow.WriteLine("Experience: 5") space() TextWindow.WriteLine(" Zombie") TextWindow.WriteLine("Health: 20 Defence: 2") TextWindow.WriteLine("Strenght: 14 Gold drop: 6") TextWindow.WriteLine("Experience: 10") space() TextWindow.WriteLine(" Zombie Spawner") TextWindow.WriteLine("Health: 40 Defence: 2") TextWindow.WriteLine("Strenght: 10 Gold drop: 7") TextWindow.WriteLine("Experience: 13") space() space() TextWindow.WriteLine("1.Return 2.Next Page") space() space() journal1 =TextWindow.ReadKey() If journal1 = 1 Then TextWindow.Clear() journal() ElseIf journal1 = 2 then TextWindow.Clear() monsterjournal2() Else TextWindow.Clear() wrongoption() TextWindow.Clear() monsterjournal() endif EndSub 'listing bosses Sub bossjournal TextWindow.WriteLine(" Bosses") space() space() TextWindow.WriteLine(" Leoric, the Skeleton King") TextWindow.WriteLine("Health: 250 Strenght: 25 Defence: 15 Experience: 25 Gold drop: 45") TextWindow.WriteLine("Appears on (9,66)") space() TextWindow.WriteLine(" Andariel, Maiden of Angush") TextWindow.WriteLine("Health: 300 Strength: 30 Defence: 20 Experience: 30 Gold drop: 50") TextWindow.WriteLine("Appears on (3,66)") space() TextWindow.WriteLine(" Azmodan, Lord of Sin") TextWindow.WriteLine("Health: 500 Strenght: 35 Defence: 25 Experience: 40 Gold drop: 60") TextWindow.WriteLine("Appears on (6,46)") space() TextWindow.WriteLine(" Diablo, Lord of Terror") TextWindow.WriteLine("Health: 1000 Strength: 60 Defence: 50 Experience: 50 Gold drop: 100") TextWindow.WriteLine("Appears on (6,66) and when all previous bosses are defeated.") space() space() TextWindow.WriteLine("1. Return") space() space() journal1 =TextWindow.ReadKey() If journal1 = 1 Then TextWindow.Clear() journal() Else TextWindow.Clear() wrongoption() TextWindow.Clear() bossjournal() endif EndSub 'Listing weapons Sub weaponjournal TextWindow.WriteLine("Weapons") space() space() TextWindow.WriteLine("Bloodletter: Has a 40% chance to siphon the enemy hp and add it to yours") space() TextWindow.WriteLine("Thunderfury, Blessed Blade of the Windseeker: Has a 30% chance to stun the enemy for 1 turn") space() space() TextWindow.WriteLine("1. Return") space() space() journal1 =TextWindow.ReadKey() If journal1 = 1 Then TextWindow.Clear() journal() Else TextWindow.Clear() wrongoption() TextWindow.Clear() weaponjournal() endif EndSub 'Listing armors Sub armorjournal TextWindow.WriteLine("Armor") space() space() TextWindow.WriteLine("Gold Skin: Increases gold drop.") space() TextWindow.WriteLine("Chainmail: Deals damage every turn to the enemy.") space() TextWindow.WriteLine("Tyriel's Might: Has a 30% chance to stun the enemey for 1 turn.") space() TextWindow.WriteLine("Heart of Iron: Adds X amount of HP to the Nephalem.") space() TextWindow.WriteLine("Chaingmail: Heals when the combat is over.") space() space() TextWindow.WriteLine("1. Return") space() space() journal1 =TextWindow.ReadKey() If journal1 = 1 Then TextWindow.Clear() journal() Else TextWindow.Clear() wrongoption() TextWindow.Clear() armorjournal() endif EndSub 'Listing potions Sub potionjournal TextWindow.WriteLine("Potions") space() space() TextWindow.WriteLine("Health Potion: Heals for 15 health points.") space() TextWindow.WriteLine("Mana Potion: Gives 15 mana points.") space() TextWindow.WriteLine("!SOON! Rejuvenation Potion: Heals for 15 health and gives 15 mana points.") space() TextWindow.WriteLine("!SOON! Invulnerability Potion: Gives immunity for X rounds.") space() space() TextWindow.WriteLine("1. Return") space() space() journal1 =TextWindow.ReadKey() If journal1 = 1 Then TextWindow.Clear() journal() Else TextWindow.Clear() wrongoption() TextWindow.Clear() potionjournal() endif EndSub 'Listing shops & merchants Sub shopjournal TextWindow.WriteLine("Shop and merchants") space() space() TextWindow.WriteLine("A place of commerce where you can buy and sell goods.") TextWindow.WriteLine("You will meet merchants around the world randomly.") space() space() TextWindow.WriteLine("Tristram: Appears on (1,1)") space() TextWindow.WriteLine("Burning Hells: Appears on (4,20)") space() space() TextWindow.WriteLine("1. Return") space() space() journal1 =TextWindow.ReadKey() If journal1 = 1 Then TextWindow.Clear() journal() Else TextWindow.Clear() wrongoption() TextWindow.Clear() shopjournal() endif EndSub 'Listing towns Sub townjournal TextWindow.WriteLine("Town") space() space() TextWindow.WriteLine("In safe zones you will randomly find potions.") TextWindow.WriteLine("Towns will always have one or two merchants. ") space() space() TextWindow.WriteLine("Tristram: Appears on (1,2),(1,3),(1,4),(1,5),(1,6)") space() TextWindow.WriteLine("Burning Hells: Appears on (4,21),(4,22),(4,23),(4,24),(4,25),(4,26)") space() space() TextWindow.WriteLine("1. Return") space() space() journal1 =TextWindow.ReadKey() If journal1 = 1 Then TextWindow.Clear() journal() Else TextWindow.Clear() wrongoption() TextWindow.Clear() townjournal() endif EndSub 'Listing stats Sub stats TextWindow.WriteLine("Level: " + level + " Stat Point: " + sp) space() TextWindow.WriteLine("Exp: " + playerxp + " Gold: " + playergold) space() TextWindow.WriteLine("Nephalem Health: " + playerhp + "/" + totalplayerhp + " Nephalem Mana: " + playermp + "/" + totalplayermp) space() space() TextWindow.WriteLine("1. Strength: " + playerstr + " Gives 1 damage per point") TextWindow.WriteLine("2. Vitality: " + playervit + " Gives 5 health per point") TextWindow.WriteLine("3. Armor: " + playerdef + " Reduces 1 damage per point") TextWindow.WriteLine("4. Intelligence: " + playerint + " Gives 3 mana points per point") TextWindow.WriteLine(" ") TextWindow.WriteLine("5. Return") space() staat = TextWindow.ReadKey() If staat = 1 then spiszero() sp = sp - 1 playerstr = playerstr + 1 TextWindow.Clear() stats() elseif staat = 2 then spiszero() sp = sp - 1 playervit = playervit + 1 playervitinc = playervitinc + 5 TextWindow.Clear() stats() elseif staat = 3 then spiszero() sp = sp - 1 playerdef = playerdef + 1 TextWindow.Clear() stats() elseif staat = 4 then spiszero() sp = sp - 1 playerint = playerint +1 playerintinc = playerintinc + 3 TextWindow.Clear() stats() elseIf staat = 5 Then TextWindow.Clear() selectLocation() Else TextWindow.Clear() wrongoption() stats() EndIf endsub Sub spiszero If sp = 0 Then TextWindow.Clear() stats() EndIf EndSub Sub randomencounter town() randomencounter1 = Math.GetRandomNumber(100) If randomencounter1 < 5 then TextWindow.Clear() TextWindow.WriteLine("You have found a Health Potion.") space() enter() hppot = hppot + 1 selectlocation() elseIf randomencounter1 < 10 then TextWindow.Clear() TextWindow.WriteLine("You have found a Mana Potion.") space() enter() mppot = mppot + 1 selectlocation() elseIf randomencounter1 < 30 then TextWindow.Clear() shop() else enemy() EndIf EndSub Sub shop TextWindow.Clear() townshopname2() TextWindow.WriteLine("Shop") space() TextWindow.WriteLine("Gold: " + playergold) space() TextWindow.WriteLine("1. Weapon") TextWindow.WriteLine("2. Armor") TextWindow.WriteLine("3. Potion") space() TextWindow.WriteLine("4. Return") space() shop = TextWindow.ReadKey() if shop = 1 Then TextWindow.Clear() weapons() ElseIf shop = 2 then TextWindow.Clear() armors() elseif shop = 3 Then TextWindow.Clear() potions() elseif shop = 4 then TextWindow.Clear() selectlocation() Else wrongoption() shop() EndIf EndSub Sub potions TextWindow.WriteLine("Health Pot: x" + hppot + " Mana Pot: x" + mppot) space() TextWindow.WriteLine("Gold: " + playergold) space() TextWindow.WriteLine("1. Buy 1 Health Pot for 10 gold") TextWindow.WriteLine("2. Buy 1 Mana Pot for 10 gold") space() TextWindow.WriteLine("3. Sell 1 Health Pot for 5 gold") TextWindow.WriteLine("4. Sell 1 Mana Pot for 5 gold") space() TextWindow.WriteLine("5. Return") space() potion1 = TextWindow.ReadKey() If potion1= 1 Then If playergold < 10 Then TextWindow.Clear() potions() EndIf hppot = hppot + 1 playergold = playergold - 10 TextWindow.Clear() potions() ElseIf potion1= 2 then If playergold < 10 Then TextWindow.Clear() potions() EndIf mppot = mppot + 1 playergold = playergold - 10 TextWindow.Clear() potions() elseif potion1= 3 then If hppot <= 0 then TextWindow.Clear() potions() EndIf playergold = playergold + 5 hppot = hppot - 1 TextWindow.Clear() potions() elseif potion1= 4 then If mppot <= 0 then TextWindow.Clear() potions() EndIf playergold = playergold + 5 mppot = mppot - 1 TextWindow.Clear() potions() elseif potion1 = 5 then TextWindow.Clear() shop() Else wrongoption() potions() EndIf EndSub Sub weapons TextWindow.WriteLine("Gold: " + playergold) space() TextWindow.WriteLine("1. Buy Bloodletter x" + activatevls + " Cost: 50 gold") TextWindow.WriteLine("2. Buy Thunderfury, Blessed Blade of the Windseeker x" + activatelbs + " Cost: 50 gold") ''TextWindow.WriteLine(" . Buy Grandfather x" + FUNCTION + " Cost: 80 gold") ''TextWindow.WriteLine(" . Buy Windforce x" + FUNCTION + " Cost: 90 gold") ''TextWindow.WriteLine(" . Buy Oculus x" + FUNCTION + " Cost: 100 gold") ''TextWindow.WriteLine(" . Buy Tyrael's Might x" + FUNCTION + " Cost: 100 gold") ''TextWindow.WriteLine(" . Buy Monster Hunter x" + FUNCTION + " Cost: 100 gold") ''TextWindow.WriteLine(" . Buy Wildwood x" + FUNCTION + " Cost: 100 gold") ''TextWindow.WriteLine(" . Buy Doombringer x" + FUNCTION + " Cost: 100 gold") space() TextWindow.WriteLine("3. Return") space() weapon1 = TextWindow.ReadKey() If weapon1= 1 Then If activatevls =1 Then TextWindow.Clear() weapons() EndIf If playergold < 50 Then TextWindow.Clear() weapons() EndIf TextWindow.Clear() TextWindow.WriteLine("You bought the Bloodletter!") activatevls = 1 activatelbs = 0 playergold = playergold - 50 TextWindow.Clear() weapons() elseIf weapon1= 2 Then If activatelbs = 1 Then TextWindow.Clear() weapons() EndIf If playergold < 50 Then TextWindow.Clear() weapons() EndIf TextWindow.Clear() TextWindow.WriteLine("You bought Thunderfury, Blessed Blade of the Windseeker!") activatelbs = 1 activatevls = 0 playergold = playergold - 50 TextWindow.Clear() weapons() elseif weapon1 = 3 then TextWindow.Clear() shop() Else wrongoption() weapons() EndIf EndSub Sub bloodletter If activatevls = 1 then vlschance = Math.GetRandomNumber(100) If vlschance <40 Then vlssiphon = enemyhp/10 weapon = "Bloodletter" enemyhp = enemyhp - vlssiphon playerhp = playerhp + vlssiphon space() TextWindow.WriteLine("Bloodletter siphons " + vlssiphon + " Health Points") Else endif playerhpormpoverhun() endif EndSub Sub playerhpormpoverhun If playerhp > 100 Then playerhp = totalplayerhp EndIf If playermp > 30 Then playermp = totalplayermp endif EndSub Sub thunderfury If activatelbs = 1 then lbschance = Math.GetRandomNumber(100) lbsstun() EndIf EndSub Sub lbsstun stun = 0 If lbschance <30 Then weapon = "Thunderfury, Blessed Blade of the Windseeker" stun = stun + 1 Else EndIf if stun > 0 then stun = stun - 1 playerattackstun() If enemyhp <= 0 Then TextWindow.Clear() EndIf Else EndIf EndSub sub playerattackstun space() TextWindow.WriteLine(enemyname + " is stuned for 1 turn.") chainmail() enemyhp = enemyhp - playerstr space() enter() battle() endsub sub spellfreeze space() TextWindow.WriteLine(enemyname + " is frozen for 1 turn.") chainmail() enemyhp = enemyhp - playerstr space() enter() battle() endsub 'Menu armor (need to filter them by name!) Sub armors TextWindow.WriteLine("Gold: " + playergold) space() TextWindow.WriteLine("1. Chain Mail x" + activatescm + " Cost: 50 gold") space() TextWindow.WriteLine("2. Tyriel's Might x" + activateepa + " Cost: 50 gold") space() TextWindow.WriteLine("Soon. Gold Skin Cost: X gold") space() TextWindow.WriteLine("Soon. Cindercoat Cost: X gold") space() TextWindow.WriteLine("Soon. Heart of Iron Cost: X gold") space() TextWindow.WriteLine("Soon. Chaingmail Cost: X gold") space() space() TextWindow.WriteLine("3. Return") space() armor1 = TextWindow.ReadKey() If armor1= 1 Then If activatescm =1 Then TextWindow.Clear() armors() EndIf If playergold < 50 Then TextWindow.Clear() armors() EndIf TextWindow.Clear() TextWindow.WriteLine("You bought Chain Mail for 50 gold.") activatescm = 1 activateepa = 0 playergold = playergold - 50 TextWindow.Clear() armors() elseIf armor1= 2 Then If activateepa =1 Then TextWindow.Clear() armors() EndIf If playergold < 50 Then TextWindow.Clear() armors() EndIf TextWindow.Clear() TextWindow.WriteLine("You bought Tyriel's Might for 50 gold.") activateepa = 1 activatescm = 0 playergold = playergold - 50 TextWindow.Clear() armors() elseif armor1 = 3 then TextWindow.Clear() shop() Else wrongoption() armors() EndIf EndSub Sub chainmail If activatescm = 1 then chainmaildmg = totalenemyhp/25 space() TextWindow.WriteLine(armor + " deals " + chainmaildmg + " dmg.") enemyhp = enemyhp - chainmaildmg Else endif endsub Sub tyrielsmight If activateepa = 1 then epachance = Math.GetRandomNumber(100) epastun() EndIf EndSub Sub epastun stun = 0 If epachance <30 Then armor = "Tyriel's Might" stun = stun + 1 Else EndIf if stun > 0 then stun = stun - 1 epaarmorstun() If enemyhp <= 0 Then TextWindow.Clear() EndIf Else EndIf EndSub sub epaarmorstun space() enemyhp = enemyhp - playerstr TextWindow.WriteLine(enemyname + " is stuned for 1 turn.") space() enter() battle() endsub Sub weaponname If activatevls = 1 then weapon = "Bloodletter" EndIf If activatelbs = 1 then weapon = "Thunderfury, Blessed Blade of the Windseeker" endif EndSub Sub armorname If activatescm = 1 then armor = "Chain Mail" EndIf If activateepa = 1 then armor = "Tyriel's Might" EndIf EndSub Sub selectlocationinventory playerhpormpoverhun() If hppot < 1 Then TextWindow.Clear() selectlocationinventory() ElseIf mppot < 1 then TextWindow.Clear() selectlocationinventory() EndIf TextWindow.WriteLine("Nephalem Health: " + playerhp + "/" + totalplayerhp+ " Nephalem Mana: " + playermp + "/" + totalplayermp) space() TextWindow.WriteLine("1. Use Health Potion x" + hppot) TextWindow.WriteLine("2. Use Mana Potion x" +mppot) TextWindow.WriteLine("Soon. Use Rejuvenation Potion x" +rjpot) space() TextWindow.WriteLine("3. Return") space() inventory1 = TextWindow.ReadKey() If inventory1 = 1 Then If playerhp = 100 Then TextWindow.Clear() selectlocationinventory() endif space() TextWindow.WriteLine("You gained 15 Health Points") space() playerhp = playerhp + 15 hppot = hppot - 1 enter() selectlocationinventory() elseIf inventory1 = 2 Then If playermp = 30 Then TextWindow.Clear() selectlocationinventory() endif space() TextWindow.WriteLine("You gained 15 Mana Points") space() playermp = playermp + 15 mppot = mppot - 1 enter() selectlocationinventory() elseif inventory1 = 3 then TextWindow.Clear() selectlocation() EndIf EndSub Sub misc TextWindow.Clear() TextWindow.WriteLine("1. Save") TextWindow.WriteLine("2. Load") TextWindow.WriteLine("3. Return") TextWindow.WriteLine("4. Exit") space() misc1 = TextWindow.ReadKey() If misc1 = 1 Then Save_game() TextWindow.Clear() TextWindow.WriteLine("Your game has been saved.") space() enter() Program.End() ElseIf misc1 = 2 then TextWindow.Clear() ' The following line could be harmful and has been automatically commented. ' ' ' variables = File.ReadContents(path) load_game() selectlocation() elseif misc1 = 4 then Program.End() ElseIf misc1 = 3 then TextWindow.Clear() selectlocation() Else wrongoption() misc() EndIf EndSub Sub enemy TextWindow.Clear() If x = 6 And y = 66 and activatedg = 1 And activatesk = 1 And activatezh = 1 Then Diablo() TextWindow.WriteLine("You encountered " + enemyname +".") space() enter() battle() ElseIf x = 6 and y = 46 then azmodan() TextWindow.WriteLine("You encountered " + enemyname +".") space() enter() battle() elseif x = 3 and y = 66 then andariel() TextWindow.WriteLine("You encountered " + enemyname +".") space() enter() battle() elseif x = 9 and y = 66 then skeletonking() battle() endif enemy1 = Math.GetRandomNumber(100) If enemy1 < 40 Then skeleton() TextWindow.WriteLine("You encountered a " + enemyname +".") space() enter() battle() ElseIf enemy1 <70 then zombie() TextWindow.WriteLine("You encountered a " + enemyname +".") space() enter() battle() elseif enemy1 <100 then demon() TextWindow.WriteLine("You encountered a " + enemyname +".") space() enter() battle() EndIf EndSub Sub battle If playerhp<=0Then defeat() EndIf If enemyhp <= 0 Then mobwin() EndIf TextWindow.Clear() weaponname() armorname() TextWindow.WriteLine(enemyname ) space() TextWindow.WriteLine("Nephalem Helth: " + playerhp + "/" + totalplayerhp+ " Nephalem Mana: " + playermp + "/" + totalplayermp) space() TextWindow.WriteLine(enemyname + ": " + enemyhp +"/" + totalenemyhp) space() TextWindow.WriteLine("1. Use your " + weapon) TextWindow.WriteLine("2. Inventory") TextWindow.WriteLine("3. Skills") TextWindow.WriteLine("4. Run Away") TextWindow.WriteLine("5. Do Nothing(Skip Turn)") space() battle1 = TextWindow.ReadKey() If battle1 = 1 Then playerattack() ElseIf battle1 = 2 then TextWindow.Clear() inventory() elseif battle1 = 3 then TextWindow.Clear() skill() elseif battle1 = 4 then runaway1 = Math.GetRandomNumber(2) If runaway1 =1 then space() TextWindow.WriteLine(enemyname + " attacked your back and dealt " + enemystr+".") playerhp = playerhp - enemystr space() enter() battle() Else TextWindow.Clear() selectlocation() EndIf elseif battle1 = 5 then TextWindow.WriteLine(enemyname + " attacked and dealt " + enemystr+".") playerhp = playerhp - enemystr space() enter() battle() Else wrongoption() battle() endif EndSub Sub inventory playerhpormpoverhun() If hppot < 1 Then TextWindow.Clear() selectlocationinventory() ElseIf mppot < 1 then TextWindow.Clear() selectlocationinventory() EndIf TextWindow.WriteLine("Nephalem Health: " + playerhp + "/" + totalplayerhp+ " Nephalem Mana: " + playermp + "/" + totalplayermp) space() TextWindow.WriteLine("1. Use Health Potion x" + hppot) TextWindow.WriteLine("2. Use Mana Potion x" + mppot) TextWindow.WriteLine("Soon. Use Rejuvenation Potion x" + rjpot) space() TextWindow.WriteLine("3. Return") space() inventory1 = TextWindow.ReadKey() If inventory1 = 1 Then If playerhp = 100 Then TextWindow.Clear() inventory() endif space() TextWindow.WriteLine("You gained 15 Health Points.") space() TextWindow.WriteLine(enemyname + " attacked and dealt " + enemystr+".") playerhp = playerhp - enemystr playerhp = playerhp + 15 hppot = hppot -1 enter() inventory() elseIf inventory1 = 2 Then If playermp = 30 Then TextWindow.Clear() inventory() endif space() TextWindow.WriteLine("You gained 15 Mana Points.") space() TextWindow.WriteLine(enemyname + " attacked and dealt " + enemystr+".") playerhp = playerhp - enemystr playermp = playermp + 15 mppot = mppot - 1 enter() inventory() elseif inventory1 = 3 then TextWindow.Clear() battle() EndIf EndSub Sub skill If playerhp<=0Then defeat() EndIf If enemyhp <= 0 Then mobwin() EndIf If playermp <= 0 Then TextWindow.Clear() battle() EndIf TextWindow.WriteLine("Nephalem Health: " + playerhp + "/" + totalplayerhp+ " Nephalem Mana: " + playermp + "/" + totalplayermp) TextWindow.WriteLine(enemyname + ": " + enemyhp +"/" + totalenemyhp) space() TextWindow.WriteLine("1. Instant Critical strike Cost: 5 Mana") TextWindow.WriteLine("2. Heal Cost: 5 Mana") TextWindow.WriteLine("3. Cast a powerfull spell| NEED SUB MENU/FUNCTIONS!") space() TextWindow.WriteLine("3. Return") space() skill1 = TextWindow.ReadKey() space() If skill1 = 1 Then TextWindow.WriteLine("You dealt " + (playerstr *1.5)) space() TextWindow.WriteLine(enemyname + " attacked and dealt " + enemystr+".") space() playerhp = playerhp - enemystr enemyhp = enemyhp - (playerstr*1.5) playermp = playermp - 5 enter() skill() ElseIf skill1 = 2 then TextWindow.WriteLine("You healed yourself for 50 health points.") space() TextWindow.WriteLine(enemyname + " attacked and dealt " + enemystr+".") space() playerhp = playerhp - enemystr enter() playerhp = playerhp + 50 playermp = playermp - 5 playerhpormpoverhun() skill() elseif skill1 = 3 then TextWindow.Clear() battle() Else wrongoption() EndIf EndSub sub playerattack space() TextWindow.WriteLine("You attacked and dealt " +playerstr + " dmg.") bloodletter() thunderfury() chainmail() tyrielsmight() space() TextWindow.WriteLine(enemyname + " attacked and dealt " + enemystr+" dmg.") enemyhp = enemyhp - playerstr playerhp = playerhp - enemystr space() enter() battle() endsub Sub diabloactivate If x = 6 and y = 46 then activatedg = 1 elseif x = 3 and y = 66 then activatezh = 1 elseif x = 9 and y = 66 then activatesk = 1 EndIf EndSub sub mobwin TextWindow.Clear() diabloactivate() TextWindow.WriteLine("You have defeated " + enemyname + ", mortal.") space() TextWindow.WriteLine("You gained " + xpdrop + " experience.") TextWindow.WriteLine("You gained " + golddrop + " gold.") playerxp = playerxp + xpdrop playergold = playergold + golddrop space() enter() selectlocation() EndSub Sub defeat TextWindow.Clear() TextWindow.WriteLine("You have been defeated by " + enemyname + ".") TextWindow.WriteLine("Your deeds of valor shall be remembered.") enter() Program.End() EndSub End>LGX971.sb< Start>LHD627.sb< rey: number="" numero="" rem=1 number2="" count="" TextWindow.WriteLine("enter decimal number") number= TextWindow.ReadNumber() dectobin() number=numero reverse() number=numero mix1() number=numero trimix() number=numero reverse() number=numero quintodec() number=numero TextWindow.WriteLine("compressed number is "+ number) TextWindow.WriteLine("remainder is"+ remainder) TextWindow.WriteLine("enter compressed number") number=TextWindow.ReadNumber() TextWindow.WriteLine("enter remanent") remainder= TextWindow.ReadNumber() dectoquin() number=numero reverse() number=numero number=numero detrimix() number=numero demix1() number=numero reverse() number=numero bintodec() number=numero Goto rey 'decimal a trinario Sub dectotrin trinario="" decimal=number While decimal>0 trin= Math.Remainder(decimal,3) trinario= Text.Append(trin,trinario) decimal=Math.Floor (decimal/3) EndWhile TextWindow.WriteLine("trinario "+trinario) numero=trinario EndSub 'trinario a decimal Sub trintodec decimal="" trinario=number l= Text.GetLength(trinario) For i=1 To l dec=Text.GetSubText(trinario,i,1) decimal=decimal*3+dec EndFor numero= decimal EndSub 'cuatrinario a decimal Sub cuatrintodec decimal="" cuatrinario=number l= Text.GetLength(cuatrinario) For i=1 To l dec=Text.GetSubText(cuatrinario,i,1) decimal=decimal*4+dec EndFor TextWindow.WriteLine("decimal "+decimal) numero= decimal EndSub 'decimal a cuatrinario Sub dectocuatrin cuatrinario="" decimal=number While decimal>0 cuatrin= Math.Remainder(decimal,4) cuatrinario= Text.Append(cuatrin,cuatrinario) decimal=Math.Floor (decimal/4) EndWhile TextWindow.WriteLine("cuatrinario "+cuatrinario) numero=trinario numero=decimal EndSub 'decimal a binario Sub dectobin decimal= number binario="" While decimal>0 bin= Math.Remainder(decimal,2) binario= Text.Append(bin,binario) decimal=Math.Floor (decimal/2) EndWhile TextWindow.WriteLine("binarioafterdecimal "+binario) numero=binario EndSub Sub bintodec 'binario a decimal binario=number decimal="" l= Text.GetLength(binario) For i=1 To l dec=Text.GetSubText(binario,i,1) decimal=decimal*2+dec EndFor TextWindow.WriteLine("decimal "+decimal) numero=decimal EndSub Sub mix0 'mixed 0 a=number i=0 c="" re: If Text.GetSubText(a,i,1)=1 Then b=Text.GetSubText(a,i,2) i=i+2 Else b=Text.GetSubText(a,i,1) i=i+1 EndIf If b=0 Then c=Text.Append(c,"0") EndIf If b=10 Then c=Text.Append(c,"1") EndIf If b=11 Then c=Text.Append(c,"2") EndIf If i>1000 Then Goto finish EndIf Goto re finish: TextWindow.WriteLine("mixed0 "+c) numero=c EndSub 'trimix Sub trimix a=number i=0 c="" l= Text.GetLength(number) rex: If Text.GetSubText(a,i,1)="1" Then b=Text.GetSubText(a,i,2) i=i+2 Else b=Text.GetSubText(a,i,1) i=i+1 EndIf If b="0" Then count=count+1 c=Text.Append(c,"0") Goto skipy EndIf If b="10" Then count=count+2 c=Text.Append(c,"4") Goto skipy EndIf If b="11" Then count=count+2 c=Text.Append(c,"1") Goto skipy EndIf If b=12 Then count=count+2 c=Text.Append(c,"3") Goto skipy EndIf If b="2" Then count=count+1 c=Text.Append(c,"2") Goto skipy EndIf skipy: If i>1000 Then Goto finishx EndIf Goto rex finishx: TextWindow.WriteLine("trimixed "+c) numero=c If count< l Then remainder=1 Else remainder=0 EndIf TextWindow.WriteLine("remainder "+remainder) EndSub 'detrimix Sub detrimix trinario=number dem="" l= Text.GetLength(trinario) For i=1 To l x=Text.GetSubText(trinario,i,1) If x="0" Then dem= Text.Append(dem,"0") EndIf If x=4 Then dem= Text.Append(dem,"10") EndIf If x=1 Then dem= Text.Append(dem,"11") EndIf If x=3 Then dem= Text.Append(dem,"12") EndIf If x=2 Then dem= Text.Append(dem,"2") EndIf EndFor If remainder=1 Then dem= Text.Append(dem,"1") EndIf numero=dem TextWindow.WriteLine("detrimix"+dem) EndSub 'mixed 1 Sub mix1 i=1 c="" a=number l= Text.GetLength(a) a33="" For i=1 To l a3=Text.GetSubText(a,i,1) If a3=0 Then a3=3 EndIf a33= Text.Append(a33,a3) EndFor TextWindow.WriteLine("tres"+a33) i=1 a=a33 re1: If Text.GetSubText(a,i,1)=3 Then b=Text.GetSubText(a,i,2) i=i+2 Else b=Text.GetSubText(a,i,1) i=i+1 EndIf If b=1 Then c=Text.Append(c,"1") EndIf If b=31 Then c=Text.Append(c,"2") EndIf If b=33 Then c=Text.Append(c,"0") EndIf If i>1000 Then Goto finish1 EndIf Goto re1 finish1: TextWindow.WriteLine("mixed1 "+c) numero=c EndSub Sub demix0 'demixer 0 cuatrinario=number dem="" For i=1 To 1000 x=Text.GetSubText(trinario,i,1) If x=0 Then dem= Text.Append(dem,"00") EndIf If x=1 Then dem= Text.Append(dem,"01") EndIf If x=2 Then dem= Text.Append(dem,"02") EndIf If x=3 Then dem= Text.Append(dem,"1") EndIf If x=4 Then dem= Text.Append(dem,"2") EndIf EndFor l= Text.GetLength(dem) demix= Text.GetSubText(dem,1,l-1) TextWindow.WriteLine("demix0"+dem) numero=dem EndSub 'demixer 1 Sub demix1 trinario=number dem="" For i=1 To 1000 x=Text.GetSubText(trinario,i,1) If x=0 Then dem= Text.Append(dem,"33") EndIf If x=1 Then dem= Text.Append(dem,"1") EndIf If x=2 Then dem= Text.Append(dem,"31") EndIf EndFor a=dem l= Text.GetLength(a) a33="" For i=1 To l a3=Text.GetSubText(a,i,1) If a3=3 Then a3=0 EndIf a33= Text.Append(a33,a3) EndFor a=a33 TextWindow.WriteLine("demix1"+a) numero=a EndSub 'reverse Sub reverse number2="" l= Text.GetLength(number) For i=l To 1 Step -1 temp=Text.GetSubText(number,i,1) number2=Text.Append(number2,temp) EndFor numero=number2 TextWindow.WriteLine("reverse"+numero) EndSub 'negative Sub negative number2="" l= Text.GetLength(number) For i=1 To l temp=Text.GetSubText(number,i,1) If temp=1 Then temp=0 Goto skip endif If temp=0 Then temp=1 endif skip: number2=Text.Append(number2,temp) EndFor numero=number2 TextWindow.WriteLine("negative"+numero) EndSub 'decimal a quintrinario Sub dectoquin quintrinario="" decimal=number While decimal>0 trin= Math.Remainder(decimal,5) quintrinario= Text.Append(trin,quintrinario) decimal=Math.Floor (decimal/5) EndWhile TextWindow.WriteLine("quintrinario "+quintrinario) numero=quintrinario EndSub 'quintrinario a decimal Sub quintodec decimal="" quintrinario=number l= Text.GetLength(quintrinario) For i=1 To l dec=Text.GetSubText(quintrinario,i,1) decimal=decimal*5+dec EndFor numero= decimal TextWindow.WriteLine("decimal "+decimal) EndSub End>LHD627.sb< Start>LHF779.sb< GraphicsWindow.KeyDown = OnKeyDown GameOver = "False" Alien["Size"] = 50 ResetAlien() 'setup player GraphicsWindow.BrushColor = "Green" Player["X"] = GraphicsWindow.Width / 2 Player["Y"] = GraphicsWindow.Height - 100 Player["Size"] = 50 Player["Speed"] = 2 Player1 = Shapes.AddTriangle(Player["Size"] / 2, 0, 0, Player["Size"], Player["Size"], Player["Size"]) Shapes.Move(Player1, Player["X"], Player["Y"]) 'setup bullet Bullet["X"] = 0 Bullet["Y"] = 0 Bullet["Size"] = 5 Bullet["Speed"] = 5 Bullet1 = Shapes.AddRectangle(Bullet["Size"], Bullet["Size"] * 2) Shapes.Move(Bullet1, -50, -50) 'main game loop While (Input <> "Escape" And GameOver <> "True") If (BulletAlive = "True") Then MoveBullet() EndIf MoveAlien() Program.Delay(20) EndWhile GraphicsWindow.ShowMessage("GoodBye", "") Program.End() '-------------------------------------------------- Sub ResetAlien GraphicsWindow.BrushColor = "Gray" Alien["X"] = 50 Alien["Y"] = 20 Alien["Size"] = Alien["Size"] * 0.9 ' 90 percent of original If (Alien["Size"] < 10) Then Alien["Size"] = 10 EndIf 'remove old Shapes.Remove(Alien1) 'make a UFO shape Alien1 = Shapes.AddEllipse(Alien["Size"], Alien["Size"] / 3) Shapes.Move(Alien1, Alien["X"], Alien["Y"]) Alien["Direction"] = 2 EndSub '-------------------------------------------------- Sub MoveAlien Alien["X"] = Alien["X"] + Alien["Direction"] 'add a jerky effect to UFO 'Alien["Y"] = Alien["Y"] + Math.GetRandomNumber(4) - 2 'if alien at either end of the screen, reverse direction and move closer to bottom If (Alien["X"] < 0 Or Alien["X"] > (GraphicsWindow.Width - Alien["Size"])) Then Alien["Y"] = Alien["Y"] + Alien["Size"] Alien["Direction"] = Alien["Direction"] * -1 If (Alien["Y"] > GraphicsWindow.Height - 100) Then GameOver = "True" EndIf EndIf Shapes.Move(Alien1, Alien["X"], Alien["Y"]) EndSub '-------------------------------------------------- Sub MoveBullet Bullet["Y"] = Bullet["Y"] - Bullet["Speed"] If (Bullet["Y"] <= Bullet["Size"]) Then BulletAlive = "False" Bullet["X"] = -50 EndIf If (BulletAlive = "True") Then Shapes.Move(Bullet1, Bullet["X"], Bullet["Y"]) EndIf 'if the bullet is too low or too high, don't bother checking for a collision If (Bullet["Y"] > Alien["Y"] And Bullet["Y"] < Alien["Y"] + Alien["Size"]) Then If (Bullet["X"] >= Alien["X"] And Bullet["X"] <= Alien["X"] + Alien["Size"]) Then 'collision detected 'move bullet out of view Bullet["X"] = -50 Shapes.Move(Bullet1, Bullet["X"], 50) ResetAlien() EndIf EndIf EndSub '-------------------------------------------------- Sub OnKeyDown Input = GraphicsWindow.LastKey If (Input = "Space") Then BulletAlive = "True" Bullet["X"] = Player["X"] Bullet["Y"] = Player["Y"] ElseIf (Input = "Left") Then If (OldInput = "Left") Then Player["Speed"] = Player["Speed"] + 2 Else Player["Speed"] = 2 EndIf If (Player["X"] - Player["Speed"] > 0) Then Player["X"] = Player["X"] - Player["Speed"] Shapes.Move(Player1, Player["X"], Player["Y"]) EndIf ElseIf (Input = "Right") Then If (OldInput = "Right") Then Player["Speed"] = Player["Speed"] + 2 Else Player["Speed"] = 2 EndIf If (Player["X"] + Player["Speed"] < GraphicsWindow.Width - Player["Size"] / 2) Then Player["X"] = Player["X"] + Player["Speed"] Shapes.Move(Player1, Player["X"], Player["Y"]) EndIf EndIf OldInput = Input EndSub End>LHF779.sb< Start>LHF935.sb< 'Taylor polynom COS analysis fc[1]=1 For f=2 To 26 fc[f]=fc[f-1]*f EndFor For x=.3 To 3 Step .3 ' cx=1-x*x/2 'cos cx=x For n=2 To 13 ' cx=cx+Math.Power(-1 n)*Math.Power(x n*2)/fc[2*n] 'cos cx=cx+Math.Power(-1 n+1)*Math.Power(x n*2-1)/fc[2*n-1] EndFor cx1=LDMath.FixDecimal(cx 16) TextWindow.WriteLine(x+":") TextWindow.WriteLine("Tay: "+cx) TextWindow.WriteLine("TyF: "+cx1) TextWindow.WriteLine("Sin: "+LDMath.FixDecimal(Math.Sin(x) 16)) TextWindow.WriteLine("Err: "+(cx-Math.Sin(x))) TextWindow.WriteLine("") EndFor End>LHF935.sb< Start>LHG358.sb< '*************************************************** ' Small Basic Chomper (SBC) v 1.0 ' Build# 1.2.26.2013 ' Prototype for a Pacman-style game. ' Software designed & written in BASIC by Anthony Yarrell ' Designed for Microsoft Small Basic 1.0 ' February - March 2013 '*************************************************** '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: False = 0 True = 1 mazeScale = 8 'Size of maze (don't change this!) '********************************** 'Game loop '*********************************** While (gameState <> GAME_OVER) KeyboardHandler() If (gameState = BRAND_NEW_GAME) Then gameSpeed = 4 '<--change this if the game runs too fast. gameScore = 0 gameLevel = 0 pelletScore = 10 energizerScore = 20 ghostScore = 25 initialCountDownTime = 70 keyPressed = "" InitializeLookupTables() LoadImageArray() InitializeSprites() SpriteArray[SBC][Lives] = 3 DisplayStartupSplash() gameState = ADVANCE_LEVEL ElseIf (gameState = ADVANCE_LEVEL) Then SmallDelay() SetupGraphicsWindow() ClearSpritesFromMaze() UpdateLevelState() LoadMaze() DrawMaze() InitializeSprites() ClearSpritesFromMaze() PositionSpritesInMaze() SmallDelay() splashText = "L E V E L : "+ gameLevel DisplayLevelSplash() gameState = PLAY_LEVEL ElseIf (gameState = PLAY_LEVEL) Then LeaveMonsterPenOneByOne() For Sprites = firstSprite to lastSprite Ctr = SpriteArray[Sprites][Counter] SPDfac=(mazeScale * SpriteArray[Sprites][TravelDistance]) IF Ctr = SPDfac Then 'ResetTickCounters() SpriteArray[Sprites][Counter]=0 If (Sprites = SBC) Then MoveSBC() DisplayScore() SpriteArray[SBC][TravelDistance]=1 Else SetupMonsterTargets() MoveMonstersTowardTarget() CollisionDetect() If SpriteArray[Sprites][State]=FRIGHT then SpriteArray[Sprites][TravelDistance]=2 Else SpriteArray[Sprites][TravelDistance]=1 EndIf EndIf ELSE SetupAnimationSequence() DrawSprites() CollisionDetect() 'DecrementTickCounters() SpriteArray[Sprites][counter] = SpriteArray[Sprites][counter] + 1 ENDIF Endfor ElseIf (gameState = REPLAY_LEVEL) Then SmallDelay() SmallDelay() SpriteArray[sbc][Lives] = SpriteArray[sbc][Lives] - 1 DisplayLives() If (SpriteArray[SBC][Lives] > 0) Then SpriteArray[SBC][State] = NORMAL InitializeSprites() ClearSpritesFromMaze() PositionSpritesInMaze() gameState = PLAY_LEVEL Else gameState = GAME_OVER GraphicsWindow.BrushColor = "white" GraphicsWindow.PenColor = "white" GraphicsWindow.FontSize = 14 GraphicsWindow.DrawText(80,205,"Game Over") Endif ElseIf (gameState = GAME_OVER) then 'EndGame() Endif Program.Delay(gameSpeed) 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 '- initialCountDownTime: amount of time that monsters stay afraid Sub UpdateLevelState If math.Remainder(gameLevel,4) = 1 Then mazeBorderColor = "Pink" ElseIf math.Remainder(gameLevel,4) = 2 then mazeBorderColor = "Red" Elseif math.Remainder(gameLevel,4) = 3 then mazeBorderColor = "blue" Elseif math.Remainder(gameLevel,4) = 0 then mazeBorderColor = "skyblue" EndIf gameLevel = gameLevel + 1 gameSpeed = gameSpeed-1 If gameSpeed <= 0 Then gameSpeed = 0 EndIf initialCountDownTime=initialCountDownTime-5 EndSub '******************************************************************************************* 'Dsplays a splash screen at the start of each level: Sub DisplayLevelSplash SmallDelay() GraphicsWindow.FontSize=14 GraphicsWindow.BrushColor="white" l=Shapes.AddText(splashText) Shapes.Move(l,-80,205) SmallDelay() SmallDelay() Shapes.Move(l,80,205) SmallDelay() Shapes.Move(l,-80,205) EndSub '******************************************************************************************* 'Displays a splash screen when the game first starts: Sub DisplayStartupSplash EndSub '******************************************************************************************* 'The variables L, U, R, D are used as indexes into the XMOD and YMOD lookup tables. For example, 'XMOD[L] & YMOD[L] produces -1 and 0 respectively. When added to XY or RC values this will cause 'the sprite to go left, etc: Sub KeyboardHandler keyPressed = GraphicsWindow.LastKey L = 1 U = 2 R = 3 D = 4 If (keyPressed = "Left") Then sbcDir = L Elseif (keyPressed = "Right") Then sbcDir = R Elseif (keyPressed = "Up") Then sbcDir = U Elseif (keyPressed = "Down") Then sbcDir = D Elseif (keyPressed = "Escape") Then gameState = GAME_OVER Endif EndSub '******************************************************************************************* '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: Sub MoveSBC canMoveInOldDirection = False canMoveInNewDirection = False 'Get maze data ahead of SBC: aheadDirX = SpriteArray[SBC][MX] + SpriteArray[SBC][DX] aheadDirY = SpriteArray[SBC][MY] + SpriteArray[SBC][DY] aheadDirData = Maze[aheadDirY][aheadDirX] 'Get maze data at location based on arrow key press: newDirX = SpriteArray[SBC][MX] + XMOD[SbcDir] newDirY = SpriteArray[SBC][MY] + YMOD[SbcDir] 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] = XMOD[sbcdir] SpriteArray[SBC][DY] = YMOD[sbcDir] 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][MX] = SpriteArray[SBC][MX] + SpriteArray[SBC][DX] SpriteArray[SBC][MY] = SpriteArray[SBC][MY] + SpriteArray[SBC][DY] EatPellet() EndSub '******************************************************************************************* 'This routine moves the monsters toward a target while allowing them to navigate around the maze 'borders. LL is a temporary array: Sub MoveMonstersTowardTarget INVALID = 9999 If (Sprites <> SBC) Then For a = 1 To 4 'step through XY/RC modifier table: SourceX = SpriteArray[Sprites][MX] + XMOD[a] SourceY = SpriteArray[Sprites][MY] + YMOD[a] TargetX = SpriteArray[Sprites][TX] TargetY = SpriteArray[Sprites][TY] 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-TargetX)+(SourceY-TargetY)... If mazeTokens[b]=Maze[SpriteArray[Sprites][MY] + YMOD[a]][SpriteArray[Sprites][MX]+ XMOD[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][MX] + XMOD[c] = SpriteArray[Sprites][VX] Then If SpriteArray[Sprites][MY] + YMOD[c] = SpriteArray[Sprites][VY] Then LL[c] = INVALID EndIf EndIf EndFor SpriteArray[Sprites][VX] = SpriteArray[Sprites][MX] SpriteArray[Sprites][VY] = SpriteArray[Sprites][MY] '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 XMOD/YMOD lookup tables eliminate the need for If/Then tests here: SpriteArray[Sprites][DX] = XMOD[elementfound] SpriteArray[Sprites][DY] = YMOD[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][Mx] = (SpriteArray[Sprites][Mx] + SpriteArray[Sprites][dx]) SpriteArray[Sprites][My] = (SpriteArray[Sprites][My] + 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 If SpriteArray[sbc][mx] = SpriteArray[Sprites][mx] Then If SpriteArray[sbc][my] = SpriteArray[Sprites][my] Then 'Monster dies if touching SBC while fightened and then monster returns to the monster pen: If SpriteArray[Sprites][State] = FRIGHT then SmallDelay() SpriteArray[Sprites][State] = DIE 'SBC dies if touching monster when energizer is not active: ElseIf SpriteArray[Sprites][State] = CHASE then SpriteArray[SBC][State] = DIE gameState = REPLAY_LEVEL EndIf EndIf EndIf 'When monster reaches monster pen, get body back and leave: If SpriteArray[Sprites][mx] = MonsterPenX Then If SpriteArray[Sprites][my] = MonsterPenY Then If SpriteArray[Sprites][State] = DIE then SpriteArray[Sprites][State] = EMERGE EndIf EndIf EndIf 'When monster has left monster pen, go back to chasing SBC: If SpriteArray[Sprites][mx] = emergeX Then If SpriteArray[Sprites][my] = emergeY Then If SpriteArray[Sprites][State] = EMERGE then SpriteArray[Sprites][State] = CHASE EndIf EndIf EndIf EndIf 'When sprites reach the left or right tunnels, they come out the other end: '***BUG here that needs to be corrected. Screen alignment goes haywire. Left tunnel doesn't work. If SpriteArray[Sprites][mx] = rightTunnelX Then If SpriteArray[Sprites][my] = rightTunnelY Then SpriteArray[Sprites][mx] = leftTunnelX SpriteArray[Sprites][my] = leftTunnelY AdjustScreenCoords() EndIf EndIf If SpriteArray[Sprites][mx] = leftTunnelX Then If SpriteArray[Sprites][my] = leftTunnelY Then SpriteArray[Sprites][mx] = rightTunnelX SpriteArray[Sprites][my] = rightTunnelY AdjustScreenCoords() EndIf EndIf EndSub '******************************************************************************************* 'Sets the targets that the monsters will follow: Sub SetupMonsterTargets CloseDoors() 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][TY] = math.GetRandomNumber(mazeRows) SpriteArray[Sprites][TX] = math.GetRandomNumber(mazeCols) 'CloseDoors() '<--no sprite ac enter the monster pen '--> TO DO: Implement Pacman-ghost SCATTER behavior & CHASE-SCATTER-REPEAT cycle 'Sends the monsters back to monster pen after being eaten by SBC: ElseIf SpriteArray[Sprites][State] = DIE Then SpriteArray[Sprites][TX] = MonsterPenX SpriteArray[Sprites][TY] = MonsterPenY OpenLeftDoor() OpenRightDoor() OpenTopDoor() 'Makes the monsters leave home base: ElseIf SpriteArray[Sprites][State] = EMERGE Then SpriteArray[Sprites][TX] = emergeX SpriteArray[Sprites][TY] = emergeY OpenLeftDoor() OpenRightDoor() OpenTopDoor() Elseif SpriteArray[Sprites][State] = CHASE Then CloseDoors() '<- monsters cannot enter monster pen in this mode. If Sprites = RedMonster Then 'Red monster pursues directly: SpriteArray[RedMonster][TX] = SpriteArray[SBC][MX] SpriteArray[RedMonster][TY] = SpriteArray[SBC][MY] ElseIf Sprites = PinkMonster Then 'Pink monster tries to ambush (TO DO: needs to be fixed): SpriteArray[PinkMonster][TX] = SpriteArray[SBC][MX]+ (SpriteArray[SBC][DX]-1) SpriteArray[PinkMonster][TY] = SpriteArray[SBC][MY]+ (SpriteArray[SBC][DY]-1) ElseIf Sprites = OrangeMonster Then 'Orange monster wanders around SpriteArray[OrangeMonster][TX] = math.GetRandomNumber(mazeCols) SpriteArray[OrangeMonster][TY] = math.GetRandomNumber(mazeRows) ElseIf Sprites = BlueMonster Then 'Blue monster considers red monster's coordinates and SBC's coordinates wheb determining how to move: SpriteArray[BlueMonster][TX] = math.abs(SpriteArray[SBC][MX]+ SpriteArray[RedMonster][MX]) SpriteArray[BlueMonster][TY] = math.abs(SpriteArray[SBC][My]+ SpriteArray[RedMonster][My]) EndIf EndIf ENDIF EndSub '******************************************************************************************* 'Animation manager. The animation frames are stored in the SpriteSheet 2D array. This routines 'sets the indexes into that array. FrameCtr + Offset is used as the index into SpriteSheet. '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). During testing & debugging regular shapes are being used as stand ins for the actual bitmaps. 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 EndSub '******************************************************************************************* Sub EatPellet erasePelletFromScreen = FALSE mazeData = Maze[(SpriteArray[SBC][My])][(SpriteArray[SBC][Mx])] 'Pellet = mazeToken[1]. 'Energizer = mazeToken[2]: If (mazeData = mazeTokens[1] Or mazeData = mazeTokens[2]) Then Maze[(SpriteArray[SBC][My])][(SpriteArray[SBC][Mx])]=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 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( ) normall restricts the monsters to forward-only movements: Sub SetMonstersToFrightState For ee =firstMonster to lastMonster if SpriteArray[ee][State] <> DIE then SpriteArray[ee][State] = FRIGHT 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 MakeMonstersChase() Endif Endif EndSub '******************************************************************************************* 'Dispatch routine for erasing pellets/energizers from the screen: Sub ErasePellet pelletColor = "black" pelletX = SpriteArray[SBC][SX] + sWidth -8 pelletY = SpriteArray[SBC][Sy] + sHeight -8 DrawEnergizer() EndSub '******************************************************************************************* 'Draws/erases an energizer Sub DrawEnergizer pelletSize = 8 xOffset = -4 yOffset = -4 DP() Endsub '******************************************************************************************* 'Draws/erases a pellet Sub DrawPellet pelletSize = 2 xOffset = -2 yOffset = -2 DP() EndSub '******************************************************************************************* Sub DP GraphicsWindow.BrushColor = pelletColor GraphicsWindow.FillRectangle(pelletX+xOffset, pelletY+yOffset, pelletSize, pelletSize) EndSub '******************************************************************************************* 'Removes sprites from the maze Sub ClearSpritesFromMaze For r=firstSprite To lastSprite Shapes.move(SpriteSheet[r][(SpriteArray[r][FrameCtr])],-100,-100) EndFor EndSub '******************************************************************************************* 'Draws sprites on screen while advancing through the animation sequence setup by SetupAnimationSequence(). 'Sprite movement speed is adjusted via TravelDistance varable: Sub DrawSprites 'Only draw/update when result is zero: If Math.Remainder(SpriteArray[Sprites][counter],SpriteArray[Sprites][TravelDistance]) = 0 Then '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][SX]= SpriteArray[Sprites][SX]+ SpriteArray[Sprites][DX] * 1 SpriteArray[Sprites][SY]= SpriteArray[Sprites][SY]+ SpriteArray[Sprites][DY] * 1.5 'Finally, hide previous frame and show new animation fram: newFrameCtr=SpriteArray[Sprites][frameCtr] shapes.Move(SpriteSheet[Sprites][oldFrameCtr],-20,-20) Shapes.Move(SpriteSheet[Sprites][newFrameCtr], SpriteArray[Sprites][SX], SpriteArray[Sprites][SY]) EndIf EndIf If erasePelletFromScreen = True Then ErasePellet() EndIf EndSub '******************************************************************************************* 'This routine intializes general purpose global lookup tables. The XMOD & YMOD arrays are used 'to modify the XY screen coordinates and RC maze coordinates. Sub InitializeLookupTables XMOD[0] = 0 'Stop moving XMOD[1] =-1 'Move Left (when added to X) XMOD[2] = 0 ' XMOD[3] = 1 'Move Right (when added to X) XMOD[4] = 0 YMOD[0] = 0 'Stop moving YMOD[1] = 0 ' YMOD[2] =-1 'Move Up (when added to Y) YMOD[3] = 0 ' YMOD[4] = 1 'Move Down (when added to Y) 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 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: SX = 1 'screen x coordinate SY = 2 'screen y coordinate MX = 3 'maze col MY = 4 'maze row DX = 5 'x/col modifier DY = 6 'y/row modifier TX = 7 'maze target col TY = 8 'maze target row VX = 9 'visited maze col VY = 10 'visited maze row State = 11 Lives = 12 FrameCtr = 13 'Index into SpriteSheet[ ][ ] Offset = 14 FirstFrame = 15 LastFrame = 16 location = 17 '??? counter = 18 '<--- Rename this to tickCounter TravelDistance = 19 '<--- Rename this to spriteSpeed 'Initialize: For spriteCtr = firstSprite To lastSprite SpriteArray[spriteCtr][FirstFrame] = 1 SpriteArray[spriteCtr][LastFrame] = 4 SpriteArray[spriteCtr][FrameCtr] = 4 SpriteSheet[spriteCtr][offset] = 4 SpriteArray[spriteCtr][DX] = 0 SpriteArray[spriteCtr][DY] = 0 SpriteArray[spriteCtr][VX] = 0 SpriteArray[spriteCtr][VY] = 0 SpriteArray[spriteCtr][TX] = 0 SpriteArray[spriteCtr][TY] = 0 SpriteArray[spriteCtr][State] = CHASE SpriteArray[spriteCtr][TravelDistance] = 1 SpriteArray[spriteCtr][counter] = 0 Endfor SpriteArray[SBC][State] = NORMAL InitialEmergeTimer = 300 EndSub '******************************************************************************************* Sub PositionSpritesInMaze 'Used for alignment hacks: xxOffset= 0 yyOffset= 0 'Position SBC two tiles underneath Monster pen: SpriteArray[SBC][MX] = 15 SpriteArray[SBC][MY] = 24 'Position Red Monster outside & above Monster pen: SpriteArray[RedMonster][MX] = 12 SpriteArray[RedMonster][MY] = 12 'Blue, Orange and Pink Monsters inside Monster pen: SpriteArray[BlueMonster][MX] = 12 SpriteArray[BlueMonster][MY] = 16 SpriteArray[OrangeMonster][MX] = 17 SpriteArray[OrangeMonster][MY] = 16 SpriteArray[PinkMonster][MX] = 14 SpriteArray[PinkMonster][MY] = 15 'Set correct screen positions: For Sprites = firstSprite to lastSprite AdjustScreenCoords() EndFor EndSub '******************************************************************************************* 'Using maze RC values, calculate screen XYs: Sub AdjustScreenCoords SpriteArray[Sprites][SX] = (SpriteArray[Sprites][MX]) * mazeScale -8 SpriteArray[Sprites][SY] = (SpriteArray[Sprites][MY]) * 1.5* mazeScale -8 EndSub '******************************************************************************************* Sub LoadImageArray '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 'SpriteSheet 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: For s=1 to 4 Graphicswindow.brushcolor="yellow" SpriteSheet[1][s]=shapes.AddEllipse(sWidth, sHeight) Graphicswindow.brushcolor="red" SpriteSheet[2][s]=shapes.addrectangle(sWidth, sHeight) Graphicswindow.brushcolor="blue" SpriteSheet[3][s]=shapes.addrectangle(sWidth, sHeight) Graphicswindow.brushcolor="orange" SpriteSheet[4][s]=shapes.addrectangle(sWidth, sHeight) Graphicswindow.brushcolor="pink" SpriteSheet[5][s]=shapes.addrectangle(sWidth, sHeight) Endfor For s= 1 to 5 'Load bitmaps for FRIGHT Mode: GraphicsWindow.PenColor="white" GraphicsWindow.PenWidth=1 Graphicswindow.brushcolor="purple SpriteSheet[s][5]=shapes.AddRectangle(sWidth, sHeight) 'Load bitmaps for DIE mode: Graphicswindow.brushcolor="gray" GraphicsWindow.PenColor="White" GraphicsWindow.PenWidth=1 SpriteSheet[s][6]=shapes.addrectangle(sWidth, sHeight) Shapes.SetOpacity(SpriteSheet[s][6],50) Endfor 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] = "L++.+++++E++++++++++++++.++R" M[13] = "--\./---\+/AAAAAA\+/---\./--" M[14] = "++|.|/--)+|ZB+C+o|+(--\|.|++" M[15] = "++|.||++++|+o+o+o|++++||.|++" M[16] = "++|.||+/\+|+o+o+o|+/\+||.|++" M[17] = "oo|.()+||+(------)+||+().|oo" M[18] = "++|.+++||++++++++++||+++.|++" M[19] = "oo|./--)(--\+/\+/--)(--\.|oo" M[20] = "++|.(------)+||+(------).|++" M[21] = "++|.......+++||+++.......|++" M[22] = "++|./---\./--)(--\./---\.|++" M[23] = "/-).(---).(------).(---).(-\" M[24] = "|..........................|" M[25] = "|./--\./---\./\./---\./--\.|" M[26] = "|.|oo|.|/--).||.(--\|.|oo|.|" M[27] = "|.|oo|.||....||....||.|oo|.|" M[28] = "|*|oo|.||./--)(--\.||.|oo|*|" M[29] = "|.(--).().(------).().(--).|" M[30] = "|..........................|" M[31] = "(--------------------------)" mazeRows = Array.GetItemCount(M) mazeCols = 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 mazeRows For cols = 1 To mazeCols 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]="Z" Then 'Monster Pen tile Maze[rows][cols] = mazeTokens[0] monsterpenX = cols monsterpeny = rows ElseIf Maze[rows][cols]="E" Then 'Emerge from Monster Pen 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 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 mazeRows tempMMYrows = MMY*rows For cols = 1 To mazeCols mazeData = Maze[rows][cols] GraphicsWindow.PenColor = mazeBorderColor GraphicsWindow.PenWidth = 1 ' Upper Left corner: if mazeData = "/" then GraphicsWindow.DrawLine(MMX*cols,TempMMYrows, MMX+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) ' '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 mazeTokens[3]="" 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 InitialEmergeTimer > 0 Then InitialEmergeTimer= InitialEmergeTimer - 0.5 EndIf If InitialEmergeTimer = 200 then SpriteArray[BlueMonster][state] = EMERGE ElseIf InitialEmergeTimer = 100 Then SpriteArray[PinkMonster][state] = EMERGE Elseif InitialEmergeTimer = 1 Then SpriteArray[OrangeMonster][state] = EMERGE EndIf EndSub '******************************************************************************************* sub SetupGraphicsWindow GraphicsWindow.Width=240 GraphicsWindow.Height=425 GraphicsWindow.BrushColor="white" GraphicsWindow.FontSize = 10 GraphicsWindow.FontBold = "False" GraphicsWindow.DrawText(20,0,"SCORE: ") GraphicsWindow.DrawText(180,0,"LIVES: ") scoreShape=Shapes.AddText(gameScore) livesShape=Shapes.AddText(SpriteArray[sbc][Lives]) Shapes.Move(scoreShape,60,0) Shapes.Move(livesShape,220,0) endsub '******************************************************************************************* Sub DisplayScore Shapes.SetText(scoreShape,gamescore) EndSub '~~~ Sub DisplayLives Shapes.SetText(livesShape,SpriteArray[sbc][lives]) EndSub End>LHG358.sb< Start>LHJ742.sb< 'Set graphics window gw=800'Desktop.Width gh=600'Desktop.Height GraphicsWindow.Width=gw GraphicsWindow.Height=gh GraphicsWindow.CanResize="false" GraphicsWindow.BackgroundColor="LightBlue" GraphicsWindow.MouseMove = OnMouseMove GraphicsWindow.PenColor="Black" For i=1 To 500 x=gw/2+gw*Math.Cos(2*3.142*i/500) y=gh/2+gh*Math.Sin(2*3.142*i/500) GraphicsWindow.DrawLine(x,y,gw/2,gh/2) EndFor 'Set balls array nball = 100 Smin=10 Smax=80 Zmin=0.3 Zmax=10 Vmax=.1 For i=1 To nball size=Smin+i/nball*(Smax-Smin) GraphicsWindow.BrushColor=GraphicsWindow.GetColorFromRGB(254*i/nball,0,0) ball=shapes.AddEllipse(size,size) Array.SetValue("balls",i,ball) Array.SetValue("X",i,gw/8+Math.GetRandomNumber(gw/4)) 'Array.SetValue("Y",i,gh/8+Math.GetRandomNumber(gh/2)) Array.SetValue("Y",i,Array.GetValue("X",i)) Array.SetValue("S",i,size) Array.SetValue("Z",i,Zmin+(Zmax-Zmin)*(1-i/nball)) Array.SetValue("A",i,Math.GetRandomNumber(2*3.14)) area=(Array.GetValue("X",i)-gw/2)/(gw/2)*(Array.GetValue("Y",i)-gh/2)/(gh/2) Array.SetValue("V",i,Vmax*Math.Abs(area)) EndFor 'Move balls t=0 While("true") For i=1 To nball x=gw/2+array.GetValue("X",i)*Math.Cos(array.GetValue("A",i)+t*array.GetValue("V",i)) y=gh/2+array.GetValue("Y",i)*Math.Sin(array.GetValue("A",i)+t*array.GetValue("V",i)) ball=array.GetValue("balls",i) xS=x-array.GetValue("S",i)/2-Xeye/Array.GetValue("Z",i) yS=y-array.GetValue("S",i)/2-Yeye/Array.GetValue("Z",i) Shapes.Move(ball,xS,yS) EndFor Program.Delay(5) t=t+1 EndWhile Sub OnMouseMove Xeye=GraphicsWindow.MouseX-gw/2 Yeye=GraphicsWindow.MouseY-gh/2 EndSub End>LHJ742.sb< Start>LHK882.sb< TextWindow.Write("Enter the no:") No = TextWindow.ReadNumber() Flag = 0 ' Chech for even numbers first - this halves the number of checks in the main loop If (Math.Remainder(No,2) = 0) Then TextWindow.WriteLine(No + " is divisible by " + 2) Flag = 1 Goto Finished ' End as soon as we find a divisor EndIf ' Max divisor is square root of number For i = 3 To Math.Ceiling(Math.SquareRoot(No)) Step 2 Remainder = Math.Remainder(No,i) If (Remainder = 0) Then TextWindow.WriteLine(No + " is divisible by " + i) Flag = 1 Goto Finished ' End as soon as we find a divisor EndIf EndFor Finished: If Flag = 1 Then TextWindow.WriteLine(No + " is not a prime no.") Else TextWindow.WriteLine(No + " is a prime no.") EndIf End>LHK882.sb< Start>LHL658.sb< 'Poker 'Mark Mossien 'For convenience, all subs can be found sorted into categories as you scroll down. 'Go to line 860 if you want to stack the deck. InitializeGame() SetVariables() Controls.ButtonClicked = buttonClicked Sub buttonClicked lastButton = Controls.LastClickedButton If lastButton = TitleScreenPlayButton Then 'When user hits play, turnCounter = turnCounter + 1 roundCounter = roundCounter + 1 CreateGameAppearance() ShuffleCards() 'Initializes the first round. DealCards() DisplayCards() ApplyAnte() ElseIf lastButton = TitleScreenExitButton Then 'Ends the program if user hits exit. Program.End() EndIf If roundTurn = "Player" Then If lastButton = playerRaiseButton Then 'If player hits raise, PlayerRaiseOutcome() 'Checks to see if it is valid and then displays it. If roundTurn = "Computer" Then 'If the raise was valid, turnCounter = turnCounter + 1 ComputerTurn() 'It will be the computer's turn. EndIf ElseIf lastButton = playerFoldButton Then 'If player hits fold, textDisplayMessage = textDisplayMessage + "Player folds!" + enter 'Display so. roundWinner = "Computer" DisplayComputerCards() RoundEndMoneyUpdate() 'End the round and set up the next one. RoundEndMessageDisplay() If gameWinner = "None" Then AddDealButton() 'Keeps the game circulating while there is no winner. Else AddFinishButton() EndIf ElseIf lastButton = playerCallButton Then 'If player hits call and it is not the first turn.. If turnCounter > 1 Then playerRaiseAmount = computerRaiseAmount textDisplayMessage = textDisplayMessage + "Player calls!" + enter 'Player raises what the computer raised. If playerRaiseAmount <> 0 Then textDisplayMessage = textDisplayMessage + "Player contributes $" + playerRaiseAmount + " to " + enter + "the pot." + enter EndIf textDisplayMessage = textDisplayMessage + "Reveal cards!" + enter Controls.SetTextBoxText(textDisplayBox,textDisplayMessage) 'Cards are revealed, winner is announced, UpdateDisplayPot() SubtractRaiseAmount() DisplayComputerCards() EvaluateHand() 'and the round ends. CompareHands() RoundEndMoneyUpdate() RoundEndMessageDisplay() If gameWinner = "None" Then AddDealButton() Else AddFinishButton() EndIf Else 'The switchs seen here prevent the textbox from repeating messages. If callSwitch = "False" Then textDisplayMessage = textDisplayMessage + "On first turn, Player may " + enter + "only check or raise." + enter Controls.SetTextBoxText(textDisplayBox,textDisplayMessage) 'For when player tries to call on the first turn. callSwitch = "True" EndIf EndIf ElseIf lastButton = playerCheckButton Then 'If player hits check and it is the first turn.. If turnCounter = 1 Then turnCounter = turnCounter + 1 textDisplayMessage = textDisplayMessage + "Player checks!" + enter 'Displays so and goes to the computer's turn. Controls.SetTextBoxText(textDisplayBox,textDisplayMessage) roundTurn = "Computer" ComputerTurn() Else If checkSwitch = "False" Then textDisplayMessage = textDisplayMessage + "Player can only check on " + enter + "the first turn." + enter Controls.SetTextBoxText(textDisplayBox,textDisplayMessage) 'For when player tries to check after the first turn. checkSwitch = "True" EndIf EndIf ElseIf lastButton = playerFinishButton Then 'For the end of the game. EndOfGameDisplay() EndIf Else If turnSwitch = "False" Then 'For when the player tries to use buttons when it is computer's turn. If roundTurn = "Computer" Then textDisplayMessage = textDisplayMessage + "It is currently the " + enter + "computer's turn." + enter Controls.SetTextBoxText(textDisplayBox,textDisplayMessage) turnSwitch = "True" EndIf EndIf EndIf If lastButton = playerDealButton Then 'If player hits the deal button.. roundCounter = roundCounter + 1 DealButtonPress() 'Begins the next round. If Math.Remainder(roundCounter,10) = 0 Then CreateGameAppearance() 'Clears the board every ten rounds to prevent lag. DisplayCards() For i = 1 To 5 DrawCardFace() EndFor EndIf EndIf EndSub '========================================================================================== '========================================================================================== 'APPEARANCE AND INITIALIZATION '========================================================================================== '========================================================================================== Sub CreateGameAppearance GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "DarkGreen" gh = 600 gw = 1200 GraphicsWindow.Top = (Desktop.Height - gh) / 2 - 25 GraphicsWindow.Left = (Desktop.Width - gw) / 2 GraphicsWindow.Height = gh GraphicsWindow.Width = gw GraphicsWindow.BrushColor = "Maroon" GraphicsWindow.PenColor = "Black" GraphicsWindow.PenWidth = 5 cardPositionX = 140 For i = 1 To 5 GraphicsWindow.FillRectangle(cardPositionX,25,125,175) GraphicsWindow.FillRectangle(cardPositionX,400,125,175) 'Creates the appearance of the game display. GraphicsWindow.DrawRectangle(cardPositionX,25,125,175) GraphicsWindow.DrawRectangle(cardPositionX,400,125,175) playerCardSlotX[i] = cardPositionX 'Sets variables for later use. playerCardSlotY[i] = 400 computerCardSlotX[i] = cardPositionX computerCardSlotY[i] = 25 cardPositionX = cardPositionX + 150 EndFor GraphicsWindow.PenWidth = 3 GraphicsWindow.PenColor = "Black" GraphicsWindow.BrushColor = "MidnightBlue" GraphicsWindow.FillRectangle(895,540,73,37) GraphicsWindow.DrawRectangle(895,540,73,37) GraphicsWindow.BrushColor = "Red" GraphicsWindow.FillRectangle(9,10,110,37) GraphicsWindow.DrawRectangle(9,10,110,37) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 20 GraphicsWindow.DrawBoundText(900,545,200,"Player") GraphicsWindow.DrawBoundText(14,15,200,"Computer") GraphicsWindow.DrawRectangle(5,395,120,37) GraphicsWindow.BrushColor = "MidnightBlue" GraphicsWindow.FillRectangle(5,395,120,37) GraphicsWindow.FontSize = 14 GraphicsWindow.FontName = "Abadi MT Condensed Light" GraphicsWindow.BrushColor = "DarkRed" playerRaiseButton = Controls.AddButton("Raise",10,400) 'Makes buttons, creates display. Controls.SetSize(playerRaiseButton,50,27) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawRectangle(10,400,50,27) GraphicsWindow.BrushColor = "MidnightBlue" playerRaiseBox = Controls.AddTextBox(70,400) Controls.SetSize(playerRaiseBox,50,27) GraphicsWindow.DrawRectangle(70,400,50,27) GraphicsWindow.DrawRectangle(5,461,120,37) GraphicsWindow.BrushColor = "MidnightBlue" GraphicsWindow.FillRectangle(5,461,120,37) GraphicsWindow.BrushColor = "DarkRed" playerCallButton = Controls.AddButton("Call",10,465) Controls.SetSize(playerCallButton,50,27) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawRectangle(10,465,50,27) GraphicsWindow.BrushColor = "DarkRed" playerCheckButton = Controls.AddButton("Check",68,465) Controls.SetSize(playerCheckButton,51,27) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawRectangle(68,465,51,27) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawRectangle(34,528,62,42) GraphicsWindow.BrushColor = "MidnightBlue" GraphicsWindow.FillRectangle(34,528,62,42) GraphicsWindow.DrawRectangle(40,534,50,30) GraphicsWindow.BrushColor = "DarkRed" playerFoldButton = Controls.AddButton(" Fold ",40,534) Controls.SetSize(playerFoldButton,50,30) GraphicsWindow.BrushColor = "DarkRed" GraphicsWindow.FillRectangle(885,400,94,48) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 35 GraphicsWindow.DrawBoundText(890,403,300,"Bank") GraphicsWindow.DrawRectangle(885,400,94,48) GraphicsWindow.FontSize = 25 playerBankDisplayX = 894 playerBankDisplayY = 465 playerBankDisplay = Shapes.AddText("$" + playerBank) Shapes.Move(playerBankDisplay,playerBankDisplayX,playerBankDisplayY) GraphicsWindow.BrushColor = "DarkRed" GraphicsWindow.FillRectangle(15,150,94,48) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 35 GraphicsWindow.DrawBoundText(20,155,300,"Bank") GraphicsWindow.DrawRectangle(15,150,94,48) GraphicsWindow.FontSize = 25 computerBankDisplayX = 25 computerBankDisplayY = 105 'Stores more variables along the way for later use. computerBankDisplay = Shapes.AddText("$" + computerBank) Shapes.Move(computerBankDisplay,computerBankDisplayX,computerBankDisplayY) GraphicsWindow.PenWidth = 4 GraphicsWindow.BrushColor = "DarkRed" GraphicsWindow.FillRectangle(455,227,95,52) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawRectangle(455,227,95,52) GraphicsWindow.FontSize = 50 GraphicsWindow.DrawBoundText(460,225,300,"Pot") GraphicsWindow.FontSize = 15 GraphicsWindow.BrushColor = "NavajoWhite" GraphicsWindow.PenWidth = 5 GraphicsWindow.FillRectangle(1000,1,200,600) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawRectangle(1000,1,198,598) textDisplayBox = Controls.AddMultiLineTextBox(1000,1) Controls.SetSize(textDisplayBox,200,600) GraphicsWindow.FontSize = 50 potLocationX = 450 potLocationY = 285 potAmountDisplay = Shapes.AddText("$" + potAmount) Shapes.Move(potAmountDisplay,potLocationX,potLocationY) EndSub Sub SetVariables playerBank = 1000 computerBank = 1000 potAmount = 0 ante = 20 'Important variables initialized for later use. roundTurn = "Player" playerRaiseAmount = 0 computerRaiseAmount = 0 validRaise = "True" turnSwitch = "False" callSwitch = "False" checkSwitch = "False" turnCounter = 0 roundCounter = 0 EndSub Sub InitializeGame GetDeck() GetCardNames() 'Creates important card arrays. GetCardRanks() CreateHands() gh = 600 gw = 800 backOfCardImage = Program.Directory + "\BackOfCard.jpg" enter = Text.GetCharacter(10) GraphicsWindow.CanResize = "False" GraphicsWindow.BackgroundColor = "Maroon" 'Maroon? GraphicsWindow.Top = (Desktop.Height - gh) / 2 - 25 GraphicsWindow.Left = (Desktop.Width - gw) / 2 GraphicsWindow.Height = gh GraphicsWindow.Width = gw GraphicsWindow.FontSize = 25 GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawBoundText(360,80,300,"Five Card") GraphicsWindow.FontSize = 80 GraphicsWindow.BrushColor = "MidnightBlue" 'Creates the main menu. GraphicsWindow.DrawBoundText(300,100,400,"Poker") GraphicsWindow.PenColor = "Black" GraphicsWindow.FontSize = 30 TitleScreenPlayButton = Controls.AddButton("Play",375,250) TitleScreenExitButton = Controls.AddButton("Exit",378,350) GraphicsWindow.PenWidth = 5 GraphicsWindow.DrawRectangle(375,250,77,48) GraphicsWindow.DrawRectangle(378,350,71,48) backOfCard1 = Shapes.AddImage(backOfCardImage) Shapes.Move(backOfCard1,62,180) GraphicsWindow.DrawRectangle(62,180,153,250) backOfCard2 = Shapes.AddImage(backOfCardImage) Shapes.Move(backOfCard2,588,180) GraphicsWindow.DrawRectangle(588,180,153,250) EndSub '========================================================================================== '========================================================================================== 'CREATION OF DECK AND GENERAL CARD-RELATED ARRAYS '========================================================================================== '========================================================================================== Sub GetDeck For i = 1 To 52 deck[i] = i 'Creates the deck with 52 slots EndFor EndSub Sub GetCardNames hearts = Text.GetCharacter(9829) diamonds = Text.GetCharacter(9830) clubs = Text.GetCharacter(9827) spades = Text.GetCharacter(9824) 'Stores each of the four suits as a variable for use. displaySuits[1] = hearts displaySuits[2] = diamonds displaySuits[3] = clubs displaySuits[4] = spades For i = 0 To 3 'Looks more complicated than it is... For j = 1 To 10 If j < 10 Then cardName[(i * 13) + j] = Text.Append(j + 1,displaySuits[i + 1]) 'The algorithm in the cardName brackets just keeps a constant counter going from 1 to 52 while the Else 'other numbers are being manipulated. cardName[(i * 13) + j] = Text.Append("J",displaySuits[i + 1]) cardName[(i * 13) + 1 + j] = Text.Append("Q",displaySuits[i + 1]) 'j < 10 is for the numbered cards. These four lines are for the face cards. cardName[(i * 13) + 2 + j] = Text.Append("K",displaySuits[i + 1]) cardName[(i * 13) + 3 + j] = Text.Append("A",displaySuits[i + 1]) EndIf EndFor EndFor EndSub Sub GetCardRanks For i = 0 To 3 For j = 2 To 14 cardRank[(i * 13) - 1 + j] = j 'Gets the ranks (2-14) of the cards in each suit. EndFor 'Like before, the algorithm in the cardRank brackets just keeps a counter going while j is 2-14 at all times. EndFor 'Hooray for efficiency! (until you realize how long the program is) EndSub Sub CreateHands pokerHand[1] = "High Card" pokerHand[2] = "One Pair" pokerHand[3] = "Two Pair" pokerHand[4] = "Three of a Kind" 'Stores the possible hands for reference purposes. pokerHand[5] = "Straight" pokerHand[6] = "Flush" pokerHand[7] = "Full House" pokerHand[8] = "Four of a Kind" pokerHand[9] = "Straight Flush" For i = 1 To 52 If i <= 13 Then suits[i] = hearts ElseIf i <= 26 Then suits[i] = diamonds 'Stores the suits corresponding to 4 sets of 13. ElseIf i <= 39 Then suits[i] = clubs Else suits[i] = spades EndIf EndFor EndSub '========================================================================================== '========================================================================================== 'EVALUATION, COMPARISON, MANIPULATION OF HANDS '========================================================================================== '========================================================================================== Sub EvaluateHand For i = 1 To 5 playerHandRank[i] = cardRank[playerHand[i]] 'Gets the ranks of the player's cards. EndFor SortHand() 'Organizes these ranks from smallest to largest. playerHandValue = 1 playerHasHand = "False" 'Control switch. If playerHandSuit[1] = playerHandSuit[2] And playerHandSuit[2] = playerHandSuit[3] Then 'If player has a flush... If Text.IsSubText(cardName[playerHand[5]],"A") = "False" Then If playerHandSuit[3] = playerHandSuit[4] And playerHandSuit[4] = playerHandSuit[5] Then 'Checks for straight flush If playerHandRank[1] = playerHandRank[2] - 1 And playerHandRank[2] = playerHandRank[3] - 1 Then If playerHandRank[3] = playerHandRank[4] - 1 And playerHandRank[4] = playerHandRank[5] - 1 Then 'If player has a straight.. playerHandValue = 9 playerStraightFlushRank = playerHandRank[5] 'Player has a straight flush. playerHasHand = "True" EndIf EndIf EndIf Else If playerHandRank[1] = playerHandRank[2] - 1 And playerHandRank[2] = playerHandRank[3] - 1 Then If playerHandRank[3] = playerHandRank[4] - 1 Then 'Special case for the Ace card. playerHandValue = 9 playerStraightFlushHighCard = playerHandRank[5] playerHasHand = "True" EndIf EndIf EndIf EndIf If playerHasHand = "False" Then For i = 1 To 2 If playerHandRank[i] = playerHandRank[i + 3] Then 'Checks for four of a kind playerHandValue = 8 'i + 3 is used because the ranks are sorted, so if there is a FOAK then playerFourOfKindRank = playerHandRank[i] 'i and i + 3 will be equal. playerHasHand = "True" EndIf EndFor EndIf If playerHasHand = "False" Then 'Check for full house If playerHandRank[1] = playerHandRank[2] Then 'If player has a pair and a TOAK.. (pos. 1) If playerHandRank[3] = playerHandRank[4] And playerHandRank[4] = playerHandRank[5] Then playerHandValue = 7 'Full house! playerFullHouseRank2 = playerHandRank[1] 'Stores the ranks of the pair and TOAK playerFullHouseRank3 = playerHandRank[3] playerHasHand = "True" ElseIf playerHandRank[1] = playerHandRank[2] And playerHandRank[2] = playerHandRank[3] Then If playerHandRank[4] = playerHandRank[5] Then 'If player has a pair and a TOAK.. (pos. 2) playerHandValue = 7 'Full house! playerFullHouseRank2 = playerHandRank[4] 'Stores the ranks of the pair and TOAK playerFullHouseRank3 = playerHandRank[1] playerHasHand = "True" EndIf EndIf EndIf EndIf If playerHasHand = "False" Then If playerHandSuit[1] = playerHandSuit[2] And playerHandSuit[2] = playerHandSuit[3] Then 'Checks for flush If playerHandSuit[3] = playerHandSuit[4] And playerHandSuit[4] = playerHandSuit[5] Then 'If all of the suits are equal.. playerHandValue = 6 'You have a flush. playerFlushHighCard = playerHandRank[5] playerHasHand = "True" EndIf EndIf EndIf If playerHasHand = "False" Then If Text.IsSubText(cardName[playerHand[5]],"A") = "False" Then 'Checks for straight If playerHandRank[1] = playerHandRank[2] - 1 And playerHandRank[2] = playerHandRank[3] - 1 Then If playerHandRank[3] = playerHandRank[4] - 1 And playerHandRank[4] = playerHandRank[5] - 1 Then 'If the ranks of the player's hand are consecutive.. playerHandValue = 5 playerStraightHighCardRank = playerHandRank[5] 'You have a straight. playerHasHand = "True" EndIf EndIf Else If playerHandRank[1] = playerHandRank[2] - 1 And playerHandRank[2] = playerHandRank[3] - 1 Then If playerHandRank[3] = playerHandRank[4] - 1 Then playerHandValue = 5 'Again, special case for Ace. playerStraightHighCard = playerHandRank[5] playerHasHand = "True" EndIf EndIf EndIf EndIf If playerHasHand = "False" Then 'Checks for three of a kind For i = 1 To 3 If playerHandRank[i] = playerHandRank[i + 2] Then 'Because the ranks are sorted, i and i + 3 are used playerHandValue = 4 'If three are equal, then i and i + 3 will be as well. playerThreeOfKindRank = playerHandRank[i] playerHasHand = "True" EndIf EndFor EndIf If playerHasHand = "False" Then 'Checks for two pair If playerHandRank[1] = playerHandRank[2] And playerHandRank[3] = playerHandRank[4] Then playerHandValue = 3 playerPairOneRank = playerHandRank[1] playerPairTwoRank = playerHandRank[3] 'Checks if any two pairs of cards are equal, in every possible way. playerHasHand = "True" ElseIf playerHandRank[1] = playerHandRank[2] And playerHandRank[4] = playerHandRank[5] Then playerHandValue = 3 playerPairOneRank = playerHandRank[1] playerPairTwoRank = playerHandRank[4] playerHasHand = "True" ElseIf playerHandRank[2] = playerHandRank[3] And playerHandRank[4] = playerHandRank[5] Then playerHandValue = 3 playerPairOneRank = playerHandRank[2] playerPairTwoRank = playerHandRank[4] playerHasHand = "True" EndIf EndIf If playerHasHand = "False" Then For i = 1 To 4 If playerHandRank[i] = playerHandRank[i + 1] Then playerHandValue = 2 'Checks for one pair playerOnePairRank = playerHandRank[i] 'Checks if any two cards are equal. playerOnePairPosition = i EndIf EndFor EndIf If playerHandValue = 1 Then 'If the player hand value has not been set to anything higher (it started as 1)... playerHighCardRank = playerHandRank[5] 'Your hand is high card. EndIf For i = 1 To 5 'The following section is not thoroughly commented because it is exactly the same as the previous section, computerHandRank[i] = cardRank[computerHand[i]] 'but with computer variables. Refer to above. EndFor SortHand() computerHandValue = 1 computerHasHand = "False" If computerHandSuit[1] = computerHandSuit[2] And computerHandSuit[2] = computerHandSuit[3] Then If Text.IsSubText(cardName[computerHand[5]],"A") = "False" Then If computerHandSuit[3] = computerHandSuit[4] And computerHandSuit[4] = computerHandSuit[5] Then 'Checks for straight flush If computerHandRank[1] = computerHandRank[2] - 1 And computerHandRank[2] = computerHandRank[3] - 1 Then If computerHandRank[3] = computerHandRank[4] - 1 And computerHandRank[4] = computerHandRank[5] - 1 Then computerHandValue = 9 computerStraightFlushRank = computerHandRank[i] computerHasHand = "True" EndIf EndIf EndIf Else If computerHandRank[1] = computerHandRank[2] - 1 And computerHandRank[2] = computerHandRank[3] - 1 Then If computerHandRank[3] = computerHandRank[4] - 1 Then computerHandValue = 9 computerStraightFlushHighCard = computerHandRank[5] computerHasHand = "True" EndIf EndIf EndIf EndIf If computerHasHand = "False" Then For i = 1 To 2 If computerHandRank[i] = computerHandRank[i + 3] Then 'Checks for four of a kind computerHandValue = 8 computerFourOfKindRank = computerHandRank[i] computerHasHand = "True" EndIf EndFor EndIf If computerHasHand = "False" Then If computerHandRank[1] = computerHandRank[2] Then If computerHandRank[3] = computerHandRank[4] And computerHandRank[4] = computerHandRank[5] Then computerHandValue = 7 'Check for full house computerFullHouseRank2 = computerHandRank[1] computerFullHouseRank3 = computerHandRank[3] computerHasHand = "True" ElseIf computerHandRank[1] = computerHandRank[2] And computerHandRank[2] = computerHandRank[3] Then If computerHandRank[4] = computerHandRank[5] Then computerHandValue = 7 computerFullHouseRank2 = computerHandRank[4] computerFullHouseRank3 = computerHandRank[1] computerHasHand = "True" EndIf EndIf EndIf EndIf If computerHasHand = "False" Then If computerHandSuit[1] = computerHandSuit[2] And computerHandSuit[2] = computerHandSuit[3] Then If computerHandSuit[3] = computerHandSuit[4] And computerHandSuit[4] = computerHandSuit[5] Then 'Checks for flush computerHandValue = 6 computerFlushHighCard = computerHandRank[5] computerHasHand = "True" EndIf EndIf EndIf If computerHasHand = "False" Then If Text.IsSubText(cardName[computerHand[5]],"A") = "False" Then If computerHandRank[1] = computerHandRank[2] - 1 And computerHandRank[2] = computerHandRank[3] - 1 Then If computerHandRank[3] = computerHandRank[4] - 1 And computerHandRank[4] = computerHandRank[5] - 1 Then computerHandValue = 5 'Checks for straight computerStraightHighCardRank = computerHandRank[5] computerHasHand = "True" EndIf EndIf Else If computerHandRank[1] = computerHandRank[2] - 1 And computerHandRank[2] = computerHandRank[3] - 1 Then If computerHandRank[3] = computerHandRank[4] - 1 Then computerHandValue = 5 computerStraightHighCard = computerHandRank[5] computerHasHand = "True" EndIf EndIf EndIf EndIf If computerHasHand = "False" Then For i = 1 To 3 If computerHandRank[i] = computerHandRank[i + 2] Then computerHandValue = 4 'Checks for three of a kind computerThreeOfKindRank = computerHandRank[i] computerHasHand = "True" EndIf EndFor EndIf If computerHasHand = "False" Then If computerHandRank[1] = computerHandRank[2] And computerHandRank[3] = computerHandRank[4] Then computerHandValue = 3 computerPairOneRank = computerHandRank[1] computerPairTwoRank = computerHandRank[3] 'Checks for two pair computerHasHand = "True" ElseIf computerHandRank[1] = computerHandRank[2] And computerHandRank[4] = computerHandRank[5] Then computerHandValue = 3 computerPairOneRank = computerHandRank[1] computerPairTwoRank = computerHandRank[4] computerHasHand = "True" ElseIf computerHandRank[2] = computerHandRank[3] And computerHandRank[4] = computerHandRank[5] Then computerHandValue = 3 computerPairOneRank = computerHandRank[2] computerPairTwoRank = computerHandRank[4] computerHasHand = "True" EndIf EndIf If computerHasHand = "False" Then For i = 1 To 4 If computerHandRank[i] = computerHandRank[i + 1] Then computerHandValue = 2 'Checks for one pair computerOnePairRank = computerHandRank[i] computerOnePairPosition = i EndIf EndFor EndIf If computerHandValue = 1 Then computerHighCardRank = computerHandRank[5] EndIf EndSub Sub CompareHands 'For the comparison of the player and computer hands. If playerHandValue > computerHandValue Then roundWinner = "Player" Else 'Basic statement: If either player's hand value is greater than the other's, they win. roundWinner = "Computer" EndIf If playerHandValue = computerHandValue Then 'If the hand values are the same.... If playerHandValue = 1 Then If computerHighCardRank > playerHighCardRank Then roundWinner = "Computer" 'Goes through and checks the second highest, third highest, etc, cards to see whose is greater. ElseIf computerHighCardRank < computerHighCardRank Then roundWinner = "Player" Else If computerHandRank[4] > playerHandRank[4] Then roundWinner = "Computer" ElseIf computerHandRank[4] < playerHandRank[4] Then roundWinner = "Player" Else If computerHandRank[3] > playerHandRank[3] Then roundWinner = "Computer" ElseIf computerHandRank[3] < playerHandRank[3] Then roundWinner = "Player" Else If computerHandRank[2] > playerHandRank[2] Then roundWinner = "Computer" ElseIf computerHandRank[2] < playerHandRank[2] Then roundWinner = "Player" Else If computerHandRank[1] > playerHandRank[1] Then roundWinner = "Computer" ElseIf computerHandRank[1] < playerHandRank[1] Then 'If all of the cards are the same, then there is no winner. Round ties. roundWinner = "Player" Else roundWinner = "None" EndIf EndIf EndIf EndIf EndIf ElseIf playerHandValue = 2 Then 'If both players have one pair.. If playerOnePairRank > computerOnePairRank Then 'If either player has a greater pair than the other, they win. roundWinner = "Player" ElseIf playerOnePairRank < computerOnePairRank Then roundWinner = "Computer" Else 'If the pairs are the same... pHighCardCounter = 0 cHighCardCounter = 0 For i = 1 To 5 If playerHandRank[i] <> playerOnePairRank Then pHighCardCounter = pHighCardCounter + 1 playerOnePairHighCardRank[pHighCardCounter] = playerHandRank[i] EndIf If computerHandRank[i] <> computerOnePairRank Then 'Goes through each hand and extracts non-paired cards for comparison. cHighCardCounter = cHighCardCounter + 1 computerOnePairHighCardRank[cHighCardCounter] = computerHandRank[i] EndIf EndFor If playerOnePairHighCardRank[3] > computerOnePairHighCardRank[3] Then 'Same process is used here as is for high card comparison. Refer to above. roundWinner = "Player" ElseIf playerOnePairHighCardRank[3] < computerOnePairHighCardRank[3] Then roundWinner = "Computer Else If playerOnePairHighCardRank[2] > computerOnePairHighCardRank[2] Then roundWinner = "Player" ElseIf playerOnePairHighCardRank[2] < computerOnePairHighCardRank[2] Then roundWinner = "Computer" Else If playerOnePairHighCardRank[1] > computerOnePairHighCardRank[1] Then roundWinner = "Player" ElseIf playerOnePairHighCardRank[1] < computerOnePairHighCardRank[1] Then roundWinner = "Computer" Else roundWinner = "None" EndIf EndIf EndIf EndIf ElseIf playerHandValue = 3 Then 'If both players have two pair.. If playerPairOneRank > playerPairTwoRank Then 'Stores the highest pair of each player. playerTwoPairHighPairRank = playerPairOneRank 'If either player has a greater high pair than the other, they win. Else playerTwoPairHighPairRank = playerPairTwoRank EndIf If computerPairOneRank > computerPairTwoRank Then computerTwoPairHighPairRank = computerPairOneRank Else computerTwoPairHighPairRank = computerPairTwoRank EndIf If playerTwoPairHighPairRank > computerTwoPairHighPairRank Then roundWinner = "Player" ElseIf playerTwoPairHighPairRank < computerTwoPairHighPairRank Then roundWinner = "Computer Else 'If they have the same pairs... pHighCardCounter = 0 cHighCardCounter = 0 For i = 1 To 5 If playerHandRank[i] <> playerPairOneRank And playerHandRank[i] <> playerPairTwoRank Then pHighCardCounter = pHighCardCounter + 1 'Extracts non-paired cards and compares them- refer to above. playerTwoPairHighCardRank = playerHandRank[i] EndIf If computerHandRank[i] <> computerPairOneRank And computerHandRank[i] <> computerPairTwoRank Then cHighCardCounter = cHighCardCounter + 1 computerTwoPairHighCardRank = computerHandRank[i] EndIf EndFor EndIf If playerTwoPairHighCardRank > computerTwoPairHighCardRank Then roundWinner = "Player" Else roundWinner = "Computer" EndIf ElseIf playerHandValue = 4 Then 'If both players have three of a kind.... If playerThreeOfKindRank > computerThreeOfKindRank Then 'If either player has the greater rank, they win. roundWinner = "Player" ElseIf playerThreeOfKindRank < computerThreeOfKindRank Then roundWinner = "Computer" EndIf ElseIf playerHandValue = 5 Then 'If both players have a straight... If playerStraightHighCardRank > computerStraightHighCardRank Then 'Checks the highest card, and if they are equal, roundWinner = "Player" ElseIf playerStraightHighCardRank < computerStraightHighCardRank Then roundWinner = "Computer" Else roundWinner = "None" 'There is a tie. EndIf ElseIf playerHandValue = 6 Then 'If both players have a flush... If computerHandRank[5] > playerHandRank[5] Then 'Compares the cards using same method as high card. Refer to above. roundWinner = "Computer" ElseIf computerHandRank[5] < playerHandRank[5] Then roundWinner = "Player" Else If computerHandRank[4] > playerHandRank[4] Then roundWinner = "Computer" ElseIf computerHandRank[4] < playerHandRank[4] Then roundWinner = "Player" Else If computerHandRank[3] > playerHandRank[3] Then roundWinner = "Computer" ElseIf computerHandRank[3] < playerHandRank[3] Then roundWinner = "Player" Else If computerHandRank[2] > playerHandRank[2] Then roundWinner = "Computer" ElseIf computerHandRank[2] < playerHandRank[2] Then roundWinner = "Player" Else If computerHandRank[1] > playerHandRank[1] Then roundWinner = "Computer" ElseIf computerHandRank[1] < playerHandRank[1] Then roundWinner = "Player" Else roundWinner = "None" EndIf EndIf EndIf EndIf EndIf ElseIf playerHandValue = 7 Then 'If both players have a full house.. (what are the odds?) If playerFullHouseRank2 > playerFullHouseRank3 Then playerFullHouseHighRank = playerFullHouseRank2 'Gets the higher pairing of each hand for comparison. Else playerFullHouseHighRank = playerFullHouseRank3 playerFullHouseLowRank = playerFullHouseRank2 EndIf If computerFullHouseRank2 > computerFullHouseRank3 Then computerFullHouseHighRank = computerFullHouseRank2 computerFullHouseLowRank = computerFullHouseRank3 Else computerFullHouseHighRank = computerFullHouseRank3 computerFullHouseLowRank = computerFullHouseRank2 EndIf If playerFullHouseHighRank > computerFullHouseHighRank Then 'If either player's pairing is greater, then they win. roundWinner = "Player" ElseIf playerFullHouseHighRank < computerFullHouseHighRank Then roundWinner = "Computer" Else 'No case for tieing; it is impossible here. If playerFullHouseLowRank > computerFullHouseLowRank Then roundWinner = "Player" Else roundWinner = "Computer" EndIf EndIf ElseIf playerHandValue = 8 Then 'If both players have a four of a kind... (I looked up the odds this time... .00005% chance! Probably wrong, but who cares) If playerFourOfKindRank > computerFourOfKindRank Then 'Compares the ranks and whoever's is higher wins. roundWinner = "Player" Else roundWinner = "Computer" EndIf EndIf EndIf EndSub Sub SortHand For i = 1 To 5 For j = 1 To 4 If playerHandRank[j + 1] < playerHandRank[j] Then 'Sorts the hands from smallest to greatest. tempCard = playerHandRank[j] playerHandRank[j] = playerHandRank[j + 1] playerHandRank[j + 1] = tempCard EndIf If computerHandRank[j + 1] < computerHandRank[j] Then tempCard = computerHandRank[j] computerHandRank[j] = computerHandRank[j + 1] computerHandRank[j + 1] = tempCard EndIf EndFor EndFor EndSub '=============================================================================== '=============================================================================== 'DISPLAY AND MANIPULATION OF CARDS '=============================================================================== '=============================================================================== Sub ShuffleCards For i = 1 To 52 tempCard = deck[i] randomCardLocation = Math.GetRandomNumber(52) deck[i] = deck[randomCardLocation] 'Shuffles the cards. 'Pulls' one out, determines a random position, and swaps it with one already there. deck[randomCardLocation] = tempCard EndFor EndSub Sub DealCards StackDeck() ' Line 957 For i = 1 To 5 playerHand[i] = deck[i] 'Comment out when stacking the deck. computerHand[i] = deck[i + 5] 'Distributes the cards to each player. ' EndFor EndSub Sub DisplayCards For i = 1 To 5 'Displays the player's cards. GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle(playerCardSlotX[i],playerCardSlotY[i],125,175) GraphicsWindow.FontSize = 20 playerHandSuit[i] = suits[playerHand[i]] If playerHand[i] > 0 And playerHand[i] < 27 Then GraphicsWindow.BrushColor = "Red" Else GraphicsWindow.BrushColor = "Black" EndIf GraphicsWindow.DrawBoundText(playerCardSlotX[i],playerCardSlotY[i],300,cardName[playerHand[i]]) If Text.GetLength(cardName[playerHand[i]]) > 2 Then suitOffSet = 88 Else suitOffSet = 98 EndIf GraphicsWindow.DrawBoundText(playerCardSlotX[i] + suitOffSet,playerCardSlotY[i] + 150,300,cardName[playerHand[i]]) DrawCardFace() GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 10 EndFor EndSub Sub DrawCardFace GraphicsWindow.BrushColor = "AntiqueWhite" GraphicsWindow.PenColor = "MidnightBlue" GraphicsWindow.PenWidth = 3 computerBackOfCardDisplay = Shapes.AddRectangle(125,175) computerBackOfCardDisplayX = computerCardSlotX[i] 'Creates the back of the computer's cards seen throughout each round. computerBackOfCardDisplayY = computerCardSlotY[i] Shapes.Move(computerBackOfCardDisplay,computerBackOfCardDisplayX,computerBackOfCardDisplayY) GraphicsWindow.PenWidth = .75 cardTop = computerBackOfCardDisplayY cardBottom = cardTop + 175 cardRight = computerBackOfCardDisplayX + 125 xInc = 0 yInc = 0 For j = 1 To 51 If j < 26 Then Shapes.AddLine(computerBackOfCardDisplayX + xInc,cardTop,cardRight,(computerBackOfCardDisplayY + 175) - yInc) Shapes.AddLine(computerBackOfCardDisplayX,cardBottom - yInc,cardRight - xInc,cardTop) xInc = xInc + 5 yInc = yInc + 7 ElseIf j = 26 Then 'These loops draw the lines on each card. xInc = 0 yInc = 0 Else Shapes.AddLine(computerBackOfCardDisplayX,cardTop + yInc,cardRight - xInc,cardBottom) Shapes.AddLine(computerBackOfCardDisplayX + xInc,cardBottom,cardRight,cardTop + yInc) xInc = xInc + 5 yInc = yInc + 7 EndIf EndFor EndSub Sub DisplayComputerCards For i = 1 To 5 GraphicsWindow.BrushColor = "White" 'Change color? computerCardDisplay[i] = Shapes.AddRectangle(125,175) Shapes.Move(computerCardDisplay[i],computerCardSlotX[i],computerCardSlotY[i]) GraphicsWindow.FontSize = 20 computerHandSuit[i] = suits[computerHand[i]] If computerHand[i] > 0 And computerHand[i] < 27 Then GraphicsWindow.BrushColor = "Red" Else 'Displays the computer's cards at the end of the round. GraphicsWindow.BrushColor = "Black" EndIf computerCardNameDisplay1[i] = Shapes.AddText(cardName[computerHand[i]]) Shapes.Move(computerCardNameDisplay1[i],computerCardSlotX[i],computerCardSlotY[i]) If Text.GetLength(cardName[computerHand[i]]) > 2 Then suitOffSet = 88 Else suitOffSet = 98 EndIf computerCardNameDisplay2[i] = Shapes.AddText(cardName[computerHand[i]]) Shapes.Move(computerCardNameDisplay2[i],computerCardSlotX[i] + suitOffSet,computerCardSlotY[i] + 150) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 10 EndFor EndSub Sub StackDeck playerHand[1] = 26 playerHand[2] = 1 playerHand[3] = 2 playerHand[4] = 3 playerHand[5] = 4 'For "testing" purposes. computerHand[1] = 14 computerHand[2] = 15 computerHand[3] = 16 computerHand[4] = 17 computerHand[5] = 31 EndSub '==================================================================================== '==================================================================================== 'DISPLAY AND MANIPULATION OF MONEY '==================================================================================== '==================================================================================== Sub playerRaiseOutcome validRaise = "True" playerRaiseAmount = Controls.GetTextBoxText(playerRaiseBox) 'Stores the raise amount and gets its length. Controls.SetTextBoxText(playerRaiseBox,"") playerRaiseAmountLength = Text.GetLength(playerRaiseAmount) If playerRaiseAmount <> "" Then 'If the box has not been left empty.. If playerRaiseAmount > playerBank Or playerRaiseAmountLength > 4 Then 'If raise is more than 4 digits or greater than player bank.. Controls.SetTextBoxText(textDisplayBox,"Player cannot raise by " + enter + "more than what they " + enter + "have.") 'Error message validRaise = "False" EndIf For i = 1 To playerRaiseAmountLength PRACharCode[i] = Text.GetCharacterCode((Text.GetSubText(playerRaiseAmount,i,1))) 'Stores the character codes of the raise amount If PRACharCode[i] < 48 Or PRACharCode[i] > 57 Then 'If any character is not a number... Controls.SetTextBoxText(textDisplayBox,"Player raise amount " + enter + "must be positive " + enter + "and numeric.") 'Error message validRaise = "False" EndIf EndFor If playerRaiseAmount >= 0 And playerRaiseAmount < 20 Then 'If raise is less than $20... Controls.SetTextBoxText(textDisplayBox,"Player must raise by " + enter + "at least $20.") 'Error message validRaise = "False" EndIf If playerRaiseAmount > computerBank Then 'If player bets more than they have.. Controls.SetTextBoxText(textDisplayBox,"Player cannot bet more " + enter + "than what the computer " + enter + "has." + enter) 'Error message validRaise = "False" EndIf If validRaise = "False" Then playerRaiseAmount = 0 'For control purposes. EndIf If validRaise = "True" Then 'If all of the error checks are passed.. potAmount = potAmount + playerRaiseAmount playerBank = playerBank - playerRaiseAmount 'Display the raise and add it to the pot. textDisplayMessage = textDisplayMessage + "Player raises $" + playerRaiseAmount + "!" + enter Controls.SetTextBoxText(textDisplayBox,textDisplayMessage) UpdateDisplayPot() 'Update the display. SubtractRaiseAmount() roundTurn = "Computer" EndIf EndIf EndSub Sub UpdateDisplayPot GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 50 Shapes.Remove(potAmountDisplay) 'Updates the displayed pot amount when called. potAmountDisplay = Shapes.AddText("$" + potAmount) Shapes.Move(potAmountDisplay,potLocationX,potLocationY) EndSub Sub SubtractRaiseAmount If roundTurn = "Player" Then GraphicsWindow.FontSize = 25 Shapes.Remove(playerBankDisplay) GraphicsWindow.BrushColor = "Black" playerBankDisplay = Shapes.AddText("$" + playerBank) 'Removes bank display,updates, and readds. Shapes.Move(playerBankDisplay,playerBankDisplayX,playerBankDisplayY) GraphicsWindow.BrushColor = "Red" PRAShape = Shapes.AddText("-$" + playerRaiseAmount) Shapes.Move(PRAShape,playerBankDisplayX,playerBankDisplayY + 25) Shapes.Animate(PRAShape,playerBankDisplayX + 500,playerBankDisplayY + 50,5000) For i = 1 To 100 Step .05 Shapes.SetOpacity(PRAShape,100-i) EndFor 'Creates the animation seen during money flow. GraphicsWindow.BrushColor = "Black" Else GraphicsWindow.FontSize = 25 Shapes.Remove(computerBankDisplay) GraphicsWindow.BrushColor = "Black" computerBankDisplay = Shapes.AddText("$" + computerBank) 'Refer to above. Shapes.Move(computerBankDisplay,computerBankDisplayX,computerBankDisplayY) GraphicsWindow.BrushColor = "Red" CRAShape = Shapes.AddText("-$" + computerRaiseAmount) Shapes.Move(CRAShape,computerBankDisplayX,computerBankDisplayY + 25) Shapes.Animate(CRAShape,computerBankDisplayX - 500,computerBankDisplayY - 5,5000) For i = 1 To 100 Step .05 Shapes.SetOpacity(CRAShape,100-i) EndFor GraphicsWindow.BrushColor = "Black" EndIf EndSub Sub SubtractAnte GraphicsWindow.FontSize = 25 Shapes.Remove(playerBankDisplay) GraphicsWindow.BrushColor = "Black" playerBankDisplay = Shapes.AddText("$" + playerBank) Shapes.Move(playerBankDisplay,playerBankDisplayX,playerBankDisplayY) 'For the start of each round. Takes ante from each player's bank GraphicsWindow.BrushColor = "Red" pAnteShape = Shapes.AddText("-$" + ante) Shapes.Move(pAnteShape,playerBankDisplayX,playerBankDisplayY + 25) Shapes.Animate(pAnteShape,playerBankDisplayX + 500,playerBankDisplayY + 50,5000) For i = 1 To 100 Step .05 Shapes.SetOpacity(pAnteShape,100-i) EndFor 'Displays new banks and adds an animation. GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 25 Shapes.Remove(computerBankDisplay) GraphicsWindow.BrushColor = "Black" computerBankDisplay = Shapes.AddText("$" + computerBank) Shapes.Move(computerBankDisplay,computerBankDisplayX,computerBankDisplayY) GraphicsWindow.BrushColor = "Red" cAnteShape = Shapes.AddText("-$" + ante) Shapes.Move(cAnteShape,computerBankDisplayX,computerBankDisplayY + 25) Shapes.Animate(cAnteShape,computerBankDisplayX - 500,computerBankDisplayY - 5,5000) For i = 1 To 100 Step .05 Shapes.SetOpacity(cAnteShape,100-i) EndFor GraphicsWindow.BrushColor = "Black" EndSub Sub RoundEndMoneyUpdate If roundWinner = "Player" Then playerBank = playerBank + potAmount 'If the player wins... GraphicsWindow.FontSize = 25 Shapes.Remove(playerBankDisplay) GraphicsWindow.BrushColor = "Black" playerBankDisplay = Shapes.AddText("$" + playerBank) 'At the end of the round- updates each players money applicably Shapes.Move(playerBankDisplay,playerBankDisplayX,playerBankDisplayY) GraphicsWindow.BrushColor = "Green" moneyWon = Shapes.AddText("+$" + potAmount) Shapes.Move(moneyWon,playerBankDisplayX,playerBankDisplayY + 25) Shapes.Animate(moneyWon,playerBankDisplayX + 500,playerBankDisplayY + 50,5000) For i = 1 To 100 Step .05 Shapes.SetOpacity(moneyWon,100-i) 'With animation, of course. EndFor GraphicsWindow.BrushColor = "Black" ElseIf roundWinner = "Computer" Then 'If the computer wins... computerBank = computerBank + potAmount GraphicsWindow.FontSize = 25 Shapes.Remove(computerBankDisplay) GraphicsWindow.BrushColor = "Black" computerBankDisplay = Shapes.AddText("$" + computerBank) Shapes.Move(computerBankDisplay,computerBankDisplayX,computerBankDisplayY) If Text.GetSubTextToEnd(moneyWon,2) <> 0 Then GraphicsWindow.BrushColor = "Green" moneyWon = Shapes.AddText("+$" + potAmount) 'Same as above. Shapes.Move(moneyWon,computerBankDisplayX,computerBankDisplayY + 25) Shapes.Animate(moneyWon,computerBankDisplayX - 500,computerBankDisplayY - 5,5000) For i = 1 To 100 Step .05 Shapes.SetOpacity(moneyWon,100-i) EndFor EndIf Else 'If there is a tie... playerBank = playerBank + Math.Floor(.5 * potAmount) 'Splits the pot. computerBank = computerBank + Math.Floor(.5 * potAmount) GraphicsWindow.FontSize = 25 Shapes.Remove(playerBankDisplay) GraphicsWindow.BrushColor = "Black" playerBankDisplay = Shapes.AddText("$" + playerBank) Shapes.Move(playerBankDisplay,playerBankDisplayX,playerBankDisplayY) GraphicsWindow.BrushColor = "Green" moneyWon = Shapes.AddText("+$" + potAmount) Shapes.Move(moneyWon,playerBankDisplayX,playerBankDisplayY + 25) Shapes.Animate(moneyWon,playerBankDisplayX + 500,playerBankDisplayY + 50,5000) For i = 1 To 100 Step .05 'Updates the banks and adds the animation. Shapes.SetOpacity(moneyWon,100-i) EndFor GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 25 Shapes.Remove(computerBankDisplay) GraphicsWindow.BrushColor = "Black" computerBankDisplay = Shapes.AddText("$" + computerBank) Shapes.Move(computerBankDisplay,computerBankDisplayX,computerBankDisplayY) If Text.GetSubTextToEnd(moneyWon,2) <> 0 Then GraphicsWindow.BrushColor = "Green" moneyWon = Shapes.AddText("+$" + potAmount) Shapes.Move(moneyWon,computerBankDisplayX,computerBankDisplayY + 25) Shapes.Animate(moneyWon,computerBankDisplayX - 500,computerBankDisplayY - 5,5000) For i = 1 To 100 Step .05 Shapes.SetOpacity(moneyWon,100-i) EndFor EndIf EndIf potAmount = 0 UpdateDisplayPot() EndSub Sub ApplyAnte playerBank = playerBank - 20 computerBank = computerBank - 20 'Subtracts ante at beginning of each round. SubtractAnte() potAmount = potAmount + 40 UpdateDisplayPot() EndSub '============================================================================= '============================================================================= 'MESSAGE DISPLAY '============================================================================= '============================================================================= Sub RoundEndMessageDisplay GraphicsWindow.FontSize = 15 If roundWinner <> "None" Then textDisplayMessage = textDisplayMessage + roundWinner + " won this " + enter + "round." + enter Else 'Displays the winner of each round. textDisplayMessage = textDisplayMessage + "Tie! Split the pot!" + enter EndIf If playerBank < 20 Then gameWinner = "Computer" 'If either player has less than $20, then the other wins the game. textDisplayMessage = textDisplayMessage + "Game over! Press finish to " + enter + "continue." + enter ElseIf computerBank < 20 Then gameWinner = "Player" textDisplayMessage = textDisplayMessage + "Game over! Press finish to " + enter + "continue." + enter Else gameWinner = "None" EndIf Controls.SetTextBoxText(textDisplayBox,textDisplayMessage) If gameWinner = "None" Then textDisplayMessage = textDisplayMessage + "Press 'Deal' when ready to " + enter + "begin the next round." + enter Controls.SetTextBoxText(textDisplayBox,textDisplayMessage) EndIf EndSub Sub EndOfGameDisplay GraphicsWindow.Clear() Controls.Remove(playerDealButton) GraphicsWindow.BrushColor = "DarkRed" GraphicsWindow.PenColor = "Black" GraphicsWindow.PenWidth = 10 GraphicsWindow.FillRectangle(455,25,300,215) 'Creates the last screen seen after the game is over. GraphicsWindow.DrawRectangle(455,25,300,215) GraphicsWindow.FontSize = 50 GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawBoundText(480,50,500,gameWinner) GraphicsWindow.DrawBoundText(540,135,500,"Wins!") GraphicsWindow.DrawBoundText(330,300,750,"Thank You For Playing!") GraphicsWindow.FontSize = 25 TitleScreenExitButton = Controls.AddButton("Exit",570,375) EndSub '============================================================================= '============================================================================= 'BUTTON CREATION AND RESULTS '============================================================================= '============================================================================= Sub DealButtonPress Controls.Remove(playerDealButton) Controls.SetTextBoxText(textDisplayBox,"") textDisplayMessage = "" turnCounter = 1 computerRaiseCounter = 0 checkSwitch = "False" callSwitch = "False" turnSwitch = "False" 'When the 'deal' button is pressed. Resets key variables and reinitializes the game potAmount = 0 roundTurn = "Player" playerRaiseAmount = 0 computerRaiseAmount = 0 validRaise = "True" ShuffleCards() DealCards() DisplayCards() ApplyAnte() EndSub Sub AddDealButton roundTurn = "None" GraphicsWindow.BrushColor = "DarkRed" playerDealButton = Controls.AddButton("Deal",computerCardSlotX[5] + 150,computerCardSlotY[5]) 'When called, adds the deal button. Controls.SetSize(playerDealButton,80,40) EndSub Sub AddFinishButton playerFinishButton = Controls.AddButton("Finish",computerCardSlotX[5] + 150,computerCardSlotY[5]) 'When called, adds the finish button. Controls.SetSize(playerFinishButton,80,40) EndSub '============================================================================= '============================================================================= 'COMPUTER IN-GAME REACTION LOGIC '============================================================================= '============================================================================= Sub ComputerTurn computerFold = "False" computerCall = "False" computerRaiseAmount = 0 If playerRaiseAmount < (300 + Math.GetRandomNumber(50)) Then 'This massive if statement has many possibilities, each of which have different effects If computerRaiseCounter < Math.GetRandomNumber(5) + 1 Then 'but all serve the same purpose: to vary the computer's raise amount based off of the If computerHandValue >= 4 Then 'player raise amount and its own hand. computerRaiseAmount = Math.Ceiling(Math.GetRandomNumber(100)/2) + 25 / 10 computerRaiseAmount = Math.Floor(computerRaiseAmount) computerRaiseAmount = computerRaiseAmount * 10 computerRaiseAmount = computerRaiseAmount * .5 computerRaiseAmount = Text.GetSubText(computerRaiseAmount,1,(Text.GetIndexOf(computerRaiseAmount,".")) - 1) If computerHandValue >= 5 Then computerRaiseAmount = computerRaiseAmount + 50 If computerHandValue >= 7 Then computerRaiseAmount = Math.Ceiling(2/3 * ((.8 / Math.GetRandomNumber(3)) * computerBank)) EndIf EndIf Else If computerHandValue = 3 Then If computerPairOneRank Or computerPairTwoRank > 8 Then If computerPairOneRank > computerPairTwoRank Then computerRaiseAmount = Math.Floor(1/3 * (Math.Power(computerPairOneRank,Math.Ceiling(Math.GetRandomNumber(2) + .5)))) Else computerRaiseAmount = Math.Floor(1/3 * (Math.Power(computerPairTwoRank,Math.Ceiling(Math.GetRandomNumber(2) + .5)))) EndIf Else computerRaiseAmount = (Math.GetRandomNumber(2) + 1) * (computerPairOneRank + computerPairTwoRank) EndIf ElseIf computerHandValue = 2 Then If computerOnePairRank > 5 Then If Math.GetRandomNumber(5) > 5 Then computerRaiseAmount = (computerOnePairRank + Math.GetRandomNumber(3)) * 2 + (-(Math.GetRandomNumber(1)) + 5) EndIf Else computerCall = "True" EndIf Else computerRaiseAmount = 0 EndIf EndIf EndIf Else If computerHandValue < Math.GetRandomNumber(3) + 1 Then computerFold = "True" Else computerCall = "True" EndIf EndIf If computerRaiseAmount > computerBank Then 'If computer raises more than it has... computerRaiseAmount = computerBank - Math.GetRandomNumber(5) + 5 'Change the raise amount accordingly. EndIf If computerRaiseAmount > playerBank Then computerRaiseAmount = Math.GetRandomNumber(playerBank) 'If computer raises more than what the player has, then change the raise amount to less than the player's bank. EndIf If playerBank = 0 Then computerCall = "True" 'Prevents the computer from raising when the player is out of money. computerRaiseAmount = 0 EndIf If computerFold = "False" Then If computerRaiseAmount = 0 Then If computerHandValue = 1 Then If computerHighCardRank < 11 Then If Math.GetRandomNumber(5) = 1 Then computerFold = "True" 'Possibilities for if, after passing through the massive if-statement above, the raise amount is 0 Else 'Makes a case for high cards. computerCall = "True" EndIf Else If computerRaiseCounter < 6 Then computerRaiseAmount = Math.GetRandomNumber(30) + computerHandRank[Math.GetRandomNumber(5)] 'Most common outcome, because high cards are the most common hand. Else computerCall = "True" EndIf EndIf Else computerCall = "True" EndIf EndIf EndIf If computerRaiseAmount > 0 Then 'If computer raises... computerRaiseCounter = computerRaiseCounter + 1 textDisplayMessage = textDisplayMessage + "Computer raises $" + computerRaiseAmount + "!" + enter 'Add '$' where ever a money display is computerBank = computerBank - computerRaiseAmount 'Display so and update the variables. potAmount = potAmount + computerRaiseAmount SubtractRaiseAmount() UpdateDisplayPot() 'Update money display. EndIf If computerFold = "True" Then 'If computer folds.. computerCall = "False" DisplayComputerCards() textDisplayMessage = textDisplayMessage + "Computer Folds!" + enter 'Display so and say that the player wins the round. roundWinner = "Player" roundTurn = "Player" RoundEndMoneyUpdate() 'Updates money and display. RoundEndMessageDisplay() AddDealButton() EndIf If computerCall = "True" Then 'If computer calls... computerRaiseAmount = playerRaiseAmount textDisplayMessage = textDisplayMessage + "Computer calls! " + enter If computerRaiseAmount <> 0 Then 'Display so and says how much was raised, if any. textDisplayMessage = textDisplayMessage + "Computer adds $" + computerRaiseAmount + " to " + enter + "the pot." + enter EndIf potAmount = potAmount + computerRaiseAmount computerBank = computerBank - computerRaiseAmount UpdateDisplayPot() SubtractRaiseAmount() 'Updates display, subtracts from money, prepares for the next round. roundTurn = "Player" textDisplayMessage = textDisplayMessage + "Reveal Cards!" + enter DisplayComputerCards() EvaluateHand() CompareHands() RoundEndMoneyUpdate() RoundEndMessageDisplay() If gameWinner = "None" Then AddDealButton() Else AddFinishButton() EndIf EndIf If computerCall = "False" And computerFold = "False" Then 'If the computer's decision does not end the round... roundTurn = "Player" textDisplayMessage = textDisplayMessage + "It is now the player's turn." + enter 'Display that it is the player's turn. Controls.SetTextBoxText(textDisplayBox,textDisplayMessage) EndIf EndSub 'Not sure if you made it this far, but thanks for going through it all if you did. And thanks for being such a great teacher! End>LHL658.sb< Start>LHN438-0.sb< X = -2.0 Y = -1.4 width = 3.0 height = 3.0 GraphicsWindow.Width=400 GraphicsWindow.Height=800 winWidth = GraphicsWindow.Height winHeight = GraphicsWindow.Width GraphicsWindow.Title="Eiffel Tower Fractal Hue = 0 Saturation = 50 Lightness = 50 precision = 2 stripy = "true 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(screeny,screenx,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 SquareComplex() imagCopy = squareImag+imagVal realCopy = squareReal+realVal dist = realCopy*realCopy+imagCopy*imagCopy If dist>4 Then Hue = i*360/20 color = LDColours.HSLtoRGB (Hue 1 Math.Abs(.5+LDMath.Sin(i*50)/3)) i = 20 ElseIf i = 19 And stripy <> "True" Then Hue = 360 color = LDColours.HSLtoRGB (Hue 1 Math.Abs(.5+LDMath.Sin(i*50)/3)) EndIf EndFor EndSub Sub SquareComplex squareReal = a*a-b*b squareImag = -2*a*b EndSub End>LHN438-0.sb< Start>LHN438.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 SquareComplex() 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 SquareComplex squareReal = a*a-b*b squareImag = -2*a*b EndSub End>LHN438.sb< Start>LHQ222.sb< ' AnimatedShapes.sb ' Creates a 1x23 grid of randomly colored squares GraphicsWindow.Width = 1000 GraphicsWindow.Height = 420 GraphicsWindow.BackgroundColor = GraphicsWindow.GetColorFromRGB(100,200,150) graphicswindow.PenColor = GraphicsWindow.GetRandomColor() GraphicsWindow.PenWidth = 2 GraphicsWindow.DrawEllipse(480, 200, 80, 60) For r = 1 To 4 ' 2 rows For c = 1 To 22 ' 22 columns clr = GraphicsWindow.GetRandomColor() GraphicsWindow.BrushColor = clr GraphicsWindow.FontSize = 22 box[r][c] = Shapes.Addtext("👹 😘") ' Adds a Shapes Shapes.Move(box[r][c], c * 20, r * 20) ' Positions it EndFor EndFor ' Animates the Shapes to the Center of the window For r = 1 To 8 For c = 1 To 23 Shapes.Animate(box[r][c], 490, 215, 1000) Program.Delay(400) ' A small delay (in milliseconds) EndFor EndFor End>LHQ222.sb< Start>LHR951.sb< ' Math Quiz ' Copyright © 2015 Nonki Takahashi. The MIT License. ' Version 0.1 ' GraphicsWindow.Title = "Math Quiz" Not = "True=False;False=True;" colors = "0=#EE0000;1=#EEEE00;2=#00EE00;3=#0000EE;4=#EE00EE;" colors = colors + "5=#CC0066;6=#CC9900;7=#66CC00;8=#0066CC;9=#9900CC;" gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.FontName = "Trebuchet MS" fs = 50 x0 = 50 y0 = 20 GraphicsWindow.BrushColor = "#EEEEEE" For n = 5 To 9 GraphicsWindow.FillRectangle(x0 + (n + 0.07) * fs, y0 + 1.4 * fs, fs / 2, fs * 2.5) EndFor GraphicsWindow.FontSize = fs For n = 0 To 9 GraphicsWindow.BrushColor = colors[n] GraphicsWindow.DrawText(x0 + n * fs, y0, n) For i = 0 To n - 1 GraphicsWindow.FillEllipse(x0 + (n + 0.2) * fs, y0 + (i + 3) * fs / 2, 10, 10) EndFor EndFor GraphicsWindow.TextInput = OnTextInput While "True" a = Math.GetRandomNumber(10) - 1 b = Math.GetRandomNumber(10) - 1 c = a + b GraphicsWindow.BrushColor = colors[a] shpA = Shapes.AddText(a) Shapes.Move(shpA, x0, y0 + 13 * fs / 2) GraphicsWindow.BrushColor = "#666666" shpP = Shapes.AddText("+") Shapes.Move(shpP, x0 + fs, y0 + 13 * fs / 2) GraphicsWindow.BrushColor = colors[b] shpB = Shapes.AddText(b) Shapes.Move(shpB, x0 + fs * 2, y0 + 13 * fs / 2) GraphicsWindow.BrushColor = "#666666" shpE = Shapes.AddText("=") Shapes.Move(shpE, x0 + fs * 3, y0 + 13 * fs / 2) len = Text.GetLength(c) ans = "" For i = 1 To len textInput = "False" While Not[textInput] Program.Delay(200) EndWhile lastText = GraphicsWindow.LastText If lastText + 0 = lastText Then For j = 1 To Math.Min(Text.GetLength(lastText), len - i + 1) k = Text.GetSubText(lastText, j, 1) GraphicsWindow.BrushColor = colors[k] ans = Text.Append(ans, k) shpK[i] = Shapes.AddText(k) Shapes.Move(shpK[i], x0 + fs * (3.5 + i / 2), y0 + 13 * fs / 2) i = i + 1 EndFor EndIf i = i - 1 EndFor If c = ans Then GraphicsWindow.BrushColor = "Green" shpJ = Shapes.AddText("✓") Shapes.Move(shpJ, x0 + fs * (4 + i), y0 + 13 * fs / 2) Sound.PlayBellRingAndWait() Program.Delay(500) Else GraphicsWindow.BrushColor = "Red" shpJ = Shapes.AddText("✗") Shapes.Move(shpJ, x0 + fs * (4 + i), y0 + 13 * fs / 2) Program.Delay(1000) EndIf Shapes.Remove(shpA) Shapes.Remove(shpP) Shapes.Remove(shpB) Shapes.Remove(shpE) For i = 1 To len Shapes.Remove(shpK[i]) EndFor Shapes.Remove(shpJ) EndWhile Sub OnTextInput textInput = "True" EndSub End>LHR951.sb< Start>LHT647.sb< ' SmallBasic Version 1.0 ' Funktion: Adding Blank Image Shape (NO flicker) ' Autor: Pappa Lapub ' Herkunft: https://social.msdn.microsoft.com/Forums/en-US/b160a45b-9568-4921-9471-492527df6847/random-numbers ' ImportURL: http://smallbasic.com/program/? ' Extension: LitDev ' Kommentar: ' ' Variablen: ' ' -------------------------------------------------------------------------------- blank = Program.Directory + "\Blank_100.png" filled = Program.Directory + "\Default_120.png" GraphicsWindow.Title = "Adding 20 Blank Image Shapes (NO flicker)" For n = 20 To 1 Step -1 ' For n = 1 To 20 shp[n] = Shapes.AddImage(blank) Shapes.Move(shp[n], 30*(n-1), 20*(n-1)) Program.Delay(200) EndFor GraphicsWindow.Title = "READY" For n = 20 To 1 Step -1 ' For n = 1 To 20 LDShapes.SetImage(shp[n], filled) Program.Delay(200) EndFor End>LHT647.sb< Start>LHV639.sb< ' Subtraction by Writing ' Version 0.1 ' Copyright © 2016 Nonki Takahashi. The MIT License. ' Last update 2016-03-14 ' Program ID ' GraphicsWindow.Title = "Subtraction 0.1" num1 = 67890 num2 = 12345 interval = 1000 ' [ms] Form() GraphicsWindow.PenColor = "LightGray" DrawGrid() While "True" If buttonClicked Then GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle(0, 0, gw, gh) GraphicsWindow.PenColor = "LightGray" DrawGrid() GraphicsWindow.PenColor = "Black" GraphicsWindow.BrushColor = "Black" ' Input numbers num1 = Controls.GetTextBoxText(tboxN1) num2 = Controls.GetTextBoxText(tboxN2) interval = Controls.GetTextBoxText(tboxInt) ' Calculate each length and positon (column) len1 = Text.GetLength(num1) len2 = Text.GetLength(num2) col1 = 2 col2 = 2 + (len1 - len2) ' Write numbers param = "col=" + col1 + ";row=1;text=" + num1 + ";" DrawText() Program.Delay(interval) ' Write a sign - param = "col=1;row=2;text=-;" DrawText() Program.Delay(interval) param = "col=" + col2 + ";row=2;text=" + num2 + ";" DrawText() Program.Delay(interval) ' Draw a line param = "col=1;row=2;len=" + (len1 + 1) + ";" DrawUnderline() Program.Delay(interval) ' Sutract between numbers from ones places b = 0 ' borrow len = len1 For i = 1 To len1 d1 = Text.GetSubText(num1, len1 - i + 1, 1) d2 = Text.GetSubText(num2, len2 - i + 1, 1) SubDigit() param = "col=" + (2 + len - i) + ";row=3;text=" + d + ";" DrawText() Stack.PushValue("local", i) While b < 0 i = i + 1 d1 = Text.GetSubText(num1, len1 - i + 1, 1) d2 = 1 b = 0 SubDigit() If (0 = d) And (i = len1) Then num1 = Text.GetSubTextToEnd(num1, 2) len1 = len1 - 1 Else param = "col=" + (2 + len - i) + ";row=1;text=" + d + ";" RedrawText() _l = Text.GetSubText(num1, 1, len1 - i) _r = Text.GetSubTextToEnd(num1, len1 - i + 2) num1 = Text.Append(Text.Append(_l, d), _r) EndIf EndWhile i = Stack.PopValue("local") Program.Delay(interval) EndFor buttonClicked = "False" Else Program.Delay(200) ' wait next button EndIf EndWhile Sub SubDigit ' param d1 - digit1 ' param d2 - digit2 ' param b - borrow ' return d - digit ' return b - new borrow If d1 + b < d2 Then d = 10 + d1 + b - d2 b = -1 Else d = d1 + b - d2 b = 0 EndIf EndSub Sub Form gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.FontName = "Courier New" fs = 60 fw = fs * 0.6 GraphicsWindow.BrushColor = "Gray" GraphicsWindow.PenWidth = 0 panel = Shapes.AddRectangle(gw, gh - fs * 5) Shapes.SetOpacity(panel, 50) Shapes.Move(panel, 0, fs * 5) GraphicsWindow.FontSize = fs / 3 GraphicsWindow.BrushColor = "Black" txtN1 = Shapes.AddText("Number1") Shapes.Move(txtN1, fw, fs * 5.3) tboxN1 = Controls.AddTextBox(fw * 3.5, fs * 5.26) Controls.SetTextBoxText(tboxN1, num1) txtN2 = Shapes.AddText("Number2") Shapes.Move(txtN2, fw, fs * 6.3) tboxN2 = Controls.AddTextBox(fw * 3.5, fs * 6.26) Controls.SetTextBoxText(tboxN2, num2) txtInt = Shapes.AddText("Interval") Shapes.Move(txtInt, fw * 8.5, fs * 5.3) tboxInt = Controls.AddTextBox(fw * 11.5, fs * 5.26) Controls.SetTextBoxText(tboxInt, interval) Controls.AddButton("Calc", fw * 14, fs * 6.22) Controls.ButtonClicked = OnButtonClicked GraphicsWindow.PenWidth = 2 GraphicsWindow.PenColor = "Black" GraphicsWindow.FontSize = fs EndSub Sub OnButtonClicked buttonClicked = "True" EndSub Sub RedrawText ' param["col"] - column ' param["row"] - row ' param["text"] - text to redraw ' return carry - shape _x = param["col"] * fw _y = param["row"] * fs GraphicsWindow.FontSize = fs * 0.25 GraphicsWindow.DrawLine(_x, _y, _x + fw, _y + fs) GraphicsWindow.DrawText(_x + fw * 0.75, _y, param["text"]) GraphicsWindow.FontSize = fs EndSub Sub DrawGrid ' param gw, gh - width and height for the graphics window ' param fw, fs - font width and font size (height) For _x = 0 To gw Step fw GraphicsWindow.DrawLine(_x, 0, _x, gh) EndFor For _y = 0 To gh Step fs GraphicsWindow.DrawLine(0, _y, gw, _y) EndFor EndSub Sub DrawText ' param["col"] - column ' param["row"] - row ' param["text"] - text _x = param["col"] * fw _y = param["row"] * fs GraphicsWindow.DrawText(_x, _y, param["text"]) EndSub Sub DrawUnderline ' param["col"] - column ' param["row"] - row ' param["len"] - length _x = param["col"] * fw _y = (param["row"] + 1) * fs _len = param["len"] * fw GraphicsWindow.DrawLine(_x, _y, _x + _len, _y) EndSub End>LHV639.sb< Start>LJB257.sb< 'invader = Shapes.AddImage("http://i61.tinypic.com/othfeo.png") 'Space GraphicsWindow.DrawImage("http://i58.tinypic.com/t66qeg.png",0,0) 'Initialize Window gw = 700 gh = 500 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp keyLeft = 0 keyRight = 0 keyUp = 0 keyDown = 0 keySpace = 0 Createmissiles() 'Initialize player player = Shapes.AddImage("http://i57.tinypic.com/1e7xtz.png") GraphicsWindow.DrawImage(player,300,300) playerX = 100 playerY = 100 speed = 3 Shapes.Move(player,playerX-25,playerY-25) 'Main loop - just move the player While gw = 700 processKey() Shapes.Move(player,playerX-25,playerY-25) Program.Delay(10) EndWhile 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 ElseIf (lastKey = "Space") Then keySpace = 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 ElseIf (lastKey = "Space") Then keySpace = 0 EndIf EndSub Sub processKey If (keyLeft = 1) Then playerX = playerX-speed EndIf If (keyRight = 1) Then playerX = playerX+speed EndIf If (keyUp = 1) Then playerY = playerY-speed EndIf If (keyDown = 1) Then playerY = playerY+speed EndIf If (keySpace = 1) Then spaceDown = "True" While ("True") start = Clock.ElapsedMilliseconds If spaceDown = "True" Then FireMissile() spaceDown = "False" EndIf Updatemissiles() delay = 20 - (Clock.ElapsedMilliseconds - start) If (delay > 0) Then Program.Delay(delay) EndIf EndWhile EndIf 'Check for hitting edges If (playerX < 0) Then playerX = 0 EndIf If (playerX > gw) Then playerX = gw EndIf If (playerY < 0) Then playerY = 0 EndIf If (playerY > gh) Then playerY = gh EndIf EndSub Sub Createmissiles missileImage = ImageList.LoadImage("http://i61.tinypic.com/vxn1xy.png") 'missile dimensions we use the half width and height missileWidth = ImageList.GetWidthOfImage(missileImage)/2 missileHeight = ImageList.GetHeightOfImage(missileImage)/2 nummissile = 20 For i = 1 To nummissile missileData["image"] = Shapes.AddImage(missileImage) missileData["Xpos"] = missileWidth + Math.GetRandomNumber(gw-2*missileWidth) missileData["Ypos"] = gh-missileHeight missileData["Xvel"] = 0 missileData["Yvel"] = -5 missileData["Status"] = 0 Shapes.HideShape(missileData["image"]) missiles[i] = missileData EndFor EndSub Sub Updatemissiles For i = 1 To nummissile missileData = missiles[i] 'get current missile array If (missileData["Status"] = 1) Then 'Reposition missile center missileData["Xpos"] = missileData["Xpos"] + missileData["Xvel"] missileData["Ypos"] = missileData["Ypos"] + missileData["Yvel"] 'Move missile center Shapes.Move(missileData["image"],missileData["Xpos"]-missileWidth,missileData["Ypos"]-missileHeight) 'missile finished with If (missileData["Ypos"] < -missileHeight) Then missileData["Status"] = 0 Shapes.HideShape(missileData["image"]) EndIf missiles[i] = missileData 'save updated missile array (it may have been modified) EndIf EndFor EndSub Sub FireMissile For i = 1 To nummissile missileData = missiles[i] 'get current missile array If (missileData["Status"] = 0) Then missileData["Status"] = 1 Shapes.ShowShape(missileData["image"]) missileData["Xpos"] = playerX + 12 missileData["Ypos"] = playerY - 65 missiles[i] = missileData 'save updated missile array (it may have been modified) i = nummissile 'End loop EndIf EndFor EndSub End>LJB257.sb< Start>LJF644.sb< numAtom = 1000 'Number of atoms tHalf = 10 'Half life dt = 0.1 'Time interval to use 'Create the window and atoms GraphicsWindow.Width = 600 GraphicsWindow.Height = 600 GraphicsWindow.BackgroundColor = "Black" GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "DarkKhaki" For i = 1 To numAtom atom[i] = Shapes.AddEllipse(10,10) Shapes.Move(atom[i],5+Math.GetRandomNumber(590)-5,5+Math.GetRandomNumber(590)-5) EndFor count = 0 'Number of decays so far time = Clock.ElapsedMilliseconds 'Start time prob = (1-Math.Power(2.718281828,-Math.NaturalLog(2)*dt/tHalf)) 'Probability of decay in each time interval While ("True") start = Clock.ElapsedMilliseconds For i = 1 To numAtom 'Check all surviving atoms If (atom[i] <> "") Then If (Math.GetRandomNumber(1/prob+0.5) = 1) Then 'A decay occurs with probability prop, this is 1 in 1/prob (the 0.5 rounds to nearest integer) decay() EndIf EndIf EndFor 'output to the title GraphicsWindow.Title = count+" decays in "+0.001*Math.Floor(Clock.ElapsedMilliseconds-time)+" seconds" 'A delay to keep the time approximately right delay = dt*1000 - (Clock.ElapsedMilliseconds-start) If (delay > 0) Then Program.Delay(delay) Else TextWindow.WriteLine("Increase dt or reduce numAtom for more realistic results") 'Warning if PC is too slow for model parameters EndIf EndWhile 'Do the decay - we could add particles coming out or other effect here Sub decay Shapes.SetOpacity(atom[i],25) atom[i] = "" count = count+1 EndSub End>LJF644.sb< Start>LJG183-0.sb< ' mahreen miangul OctOber 2017 GraphicsWindow.Left = 0.1 * (Desktop.Width - GraphicsWindow.Width) GraphicsWindow.Top = 0 * (Desktop.Height - GraphicsWindow.Height) GraphicsWindow.Title = "mahreen miangul" GraphicsWindow.BackgroundColor="darkcyan" GraphicsWindow.Width = "1280" GraphicsWindow.Height = "666" ' Madam Apple MakeImage() ' Hill GraphicsWindow.brushColor = "silver" GraphicsWindow.fillEllipse(-88,505,620,288) GraphicsWindow.fillEllipse(211,388,622,366) GraphicsWindow.fillEllipse(211,388,1888,666) shoot="False" zm=1 ' ********* ' 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 ' MOON GraphicsWindow.BrushColor = "yellow" GraphicsWindow.PenWidth=0 '<------------- moon= Shapes.AddEllipse(20,20) '<------------- Shapes.Move(moon,50,50) '<------------- GraphicsWindow.BrushColor = "darkcyan" shadow= Shapes.AddEllipse(20,20) '<------------- Shapes.Move(shadow,60,45) '<------------- ' TEXT CRLF= Text.GetCharacter(13)+Text.GetCharacter(10) '<------------- line feed GraphicsWindow.brushColor = "blue" GraphicsWindow.FontSize = 33 msg=Shapes.AddText("H E L L O!"+CRLF+"from"+CRLF+"mahreen "+CRLF+"miangul!") '<------------- Shapes.Move(msg,420,10) '<------------- GraphicsWindow.KeyDown = onkeyDown ' Cannon Drawing GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "mediumslateblue" cannon1_x = 722 cannon1_y = 555 cannon = Shapes.AddRectangle(55,110) Shapes.Move(cannon, cannon1_x, cannon1_y) 'Makesprite() SPRITE_init() ' <--------- all shape data is input here!! add_shapes() ' <--------- all shapes are added here!! ' Cannon Animation GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor="mediumslateblue" Ball=Shapes.AddEllipse(40,40) 'Shapes.Move(Ball,cannon1_x+5,cannon1_y+30) Shapes.HideShape(Ball) ' BlueCar Timer Timer.Interval=1000 '<-------------- Timer.Tick=BlueCar_up '<-------------- ' Drag & Drop to Target or Return Home GraphicsWindow.brushColor = "orange" home = "X=600;Y=40" spriteSize = "420" sprite[1] = Shapes.Addtext("👹") Shapes.Move(sprite[1], home["X"], home["Y"]) spriteTarget[1] = Shapes.Addtext(spriteSize + 0) 'upSize Target for special fx Shapes.Move(spriteTarget[1], 660, 420) Shapes.SetOpacity(spriteTarget[1], 80) '=========================================================================== ' Cloud Moving dx = GraphicsWindow.Width dY = GraphicsWindow.Height GraphicsWindow.BrushColor = "silver" GraphicsWindow.FontSize = 122 x = x + dX - 44 y = y + dY - 550 cloud() Sub cloud cloud = Shapes.Addtext("🌁") Shapes.Animate(cloud,x,y,22000) Endsub ' Aircraft Animation dZ = 0.1 zoom = 1 ddx=0 ' 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="8:1" ' Aircraft shapes number=5 repeat =1 shoot="False" zm=1 ' ********* While "True" ' And "North" <> "South" <--- No meanig , it always "True" mseX = GraphicsWindow.MouseX mseY = GraphicsWindow.MouseY If Mouse.IsLeftButtonDown Then 'handle click and select If selected = "" And clicked = "False" Then 'can loop thru here for more than 1 box If mseX >= home["X"] And mseX <= home["X"] + spriteSize And mseY >= home["Y"] And mseY <= home["Y"] + spriteSize Then selected = 1 'box number EndIf EndIf clicked = "True" 'the mse has been clicked for this frame Shapes.Move(sprite[selected], mseX, mseY) Else If Math.Round(mseX/50) = Math.Round(Shapes.GetLeft(spriteTarget[selected])/50) Then If Math.Round(mseY/50) = Math.Round(Shapes.GetTop(spriteTarget[selected])/50) Then Shapes.Remove(sprite[selected]) Shapes.SetOpacity(spriteTarget[selected], 100) EndIf EndIf Shapes.Move(sprite[selected], home["X"], home["Y"]) selected = "" 'deselect when finishised with the box clicked = "False" 'inits here, get ready for next click EndIf Program.Delay(20) 'EndWhile ' <----------- no use 'While 0=0 ' <----------- no use ' Aircraft Blinking Program zoom = zoom - dZ For i = 1 To Array.GetItemCount(shape[8]) ' Aircraft shapes data number = 8 If Array.ContainsValue(shape[8][i], "eye") Then Shapes.Zoom(shp[NMB][i], 1, zoom) ElseIf Array.ContainsValue(shape[8][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 ' Star Blinking Program ' While zm<6 If zm<6 Then ' <<<<>>>> mmm= Math.GetRandomNumber(80) ' blinking star number _op=Shapes.GetOpacity(star[mmm]) ' opacity ... brightness If _op>50 Then Shapes.SetOpacity(star[mmm],Math.GetRandomNumber(49)) ' darker Else Shapes.SetOpacity(star[mmm],50+Math.GetRandomNumber(50)) ' brighter EndIf If mmm=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) ' <<<<>>>> endif ' endwhile ' Aircraft Reverse Moving X,Y Direction cycleX= shapes.GetLeft(shp[NMB][1]) + 150 ' 1 = aircraft's body ' <<<<>>>> cycleY= shapes.GetTop(shp[NMB][1]) + 50 ' ' <<<<>>>> If cycleX<0 Or cycleX>GraphicsWindow.Width Then 'shape[8][1]["width"] Then ' 1 = aircraft's body ' <<<<>>>> ddx=-ddx EndIf If cycleY<0 Or cycleY>cannon1_y Then ' 1 = aircraft's body ' <<<<>>>> ddy=-ddy EndIf ' Ball Fire 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+5,cannon1_y+30) Shapes.HideShape(Ball) EndIf ' Collision Check Here ballX=shapes.GetLeft(ball) bally=shapes.GetTop(ball) If (cycleX1 ' 1 =reindeer's body ' <<<<>>>> GraphicsWindow.Title="You Hit !!!!!!!!!!!" Sound.PlayChimeAndWait() shoot="False" Shapes.Move(Ball,cannon1_x+5,cannon1_y+30) Shapes.HideShape(Ball) EndIf EndIf Program.Delay(20) EndWhile Sub MakeImage scale = 1 x0 = 1 * scale y0 = 1 * scale GraphicsWindow.PenWidth = 0 ' Trunk Point GraphicsWindow.BrushColor = "green" oTr = Shapes.Addrectangle(20 * scale, 60 * scale) Shapes.Move(oTr, x0 + 433 * scale, y0 + 480 * scale) Shapes.Rotate(oTr, 30) ' Face GraphicsWindow.BrushColor = "crimson" GraphicsWindow.PenColor = "Darkslategray" oFace1 = Shapes.AddEllipse(150 * scale, 150 * scale) Shapes.Move(oFace1, x0 + 311, y0 + 518) Shapes.Rotate(oFace1, 0) oFace2 = Shapes.AddEllipse(150 * scale, 150 * scale) Shapes.Move(oFace2, x0 + 403, y0 + 518) Shapes.Rotate(oFace2, 0) ' Eyes GraphicsWindow.BrushColor = "white" GraphicsWindow.PenColor = "dimgray" GraphicsWindow.PenWidth = 2 oEyeLeft = Shapes.AddEllipse(40 * scale, 40 * scale) Shapes.Move(oEyeLeft, x0 + 394 * scale, y0 + 538 * scale) Shapes.Rotate(oEyeLeft, 0) oEyeRight = Shapes.AddEllipse(40 * scale, 40 * scale) Shapes.Move(oEyeRight, x0 + 433 * scale, y0 + 538 * scale) Shapes.Rotate(oEyeRight, 80) GraphicsWindow.PenWidth = 2 GraphicsWindow.BrushColor = "snow" GraphicsWindow.PenColor = "DimGray" GraphicsWindow.PenWidth = 2 GraphicsWindow.BrushColor = "darkslategray" oEyeLeft2 = Shapes.AddEllipse(15 * scale, 15 * scale) Shapes.Move(oEyeLeft2, x0 + 416 * scale, y0 + 546 * scale) Shapes.Rotate(oEyeLeft2, 0) oEyeRight2 = Shapes.AddEllipse(15 * scale, 15 * scale) Shapes.Move(oEyeRight2, x0 + 436 * scale, y0 + 546 * scale) Shapes.Rotate(oEyeright2, -5) ' Mouth GraphicsWindow.PenColor = "darkslategray" GraphicsWindow.PenWidth = 11 oMouthLeft = Shapes.AddLine(0, 6 * scale, 66 * scale, 3) Shapes.Move(oMouthLeft, x0 + 400 * scale, y0 + 600 * scale) Shapes.Rotate(oMouthLeft, -2) endsub '' Blue Car Animation Sub BlueCar_up MM=MM+1 If MM=23 then MM=0 cloud() EndIf Timer.Pause() For k=1 To Array.GetItemCount(s[10]) ' k=1 to 7 For L=1 To Array.GetItemCount(shape[10]) ' ********* Shapes.Rotate(SHP["10:"+k][L],Shape[10][L]["angle"]) ' ********* ' <-------------- rotating angle // body = 8 // BlueCar index="4:1" to "4:7" endfor endfor Shapes.HideShape(oEyeLeft2) ''MM Shapes.HideShape(oEyeRight2) ''WM Program.Delay(300) For k=1 To Array.GetItemCount(s[10]) ' k=1 to 7 For L=1 To Array.GetItemCount(shape[10]) ' ********* Shapes.Rotate(SHP["10:"+K][L], 0) ' ********* ' <-------------- rotating angle // body = 8// BlueCar index="4:1" to "4:7" EndFor EndFor Program.Delay(30) Shapes.ShowShape(oEyeLeft2) ''MM Shapes.ShowShape(oEyeRight2) ''MM Timer.Resume() endsub ' Add Sprites Sub add_shapes For M=1 to Array.GetItemCount(s) ' 5 types shapes // BlueCar, Trees , House , Apple , Aircraft For N=1 to Array.GetItemCount(s[M]) ' repeat number //BlueCar=1 , Trees =14 , House=1 , Apple=18 , Aircraft=1 ss=s[M][N] ' scale _shx=shx[M][N] ' base point _X _shY=shY[M][N] ' base point _Y _shape=shape[M] ' temporary shape data NMB=M+":"+N ' shape index for i=1 To Array.GetItemCount(_shape) GraphicsWindow.PenWidth = _shape[i]["pw"] GraphicsWindow.BrushColor = _shape[i]["bc"] GraphicsWindow.penColor = _shape[i]["pc"] If _shape[i]["func"]="ell" Then shp[NMB][i] = Shapes.AddEllipse(_shape[i]["width"]*ss, _shape[i]["height"]*ss) ElseIf _shape[i]["func"]="rect" Then shp[NMB][i] = Shapes.AddRectangle(_shape[i]["width"]*ss, _shape[i]["height"]*ss) ElseIf _shape[i]["func"]="tri" Then shp[NMB][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[NMB][i] = Shapes.Addline(_shape[i]["x1"]*ss, _shape[i]["y1"]*ss,_shape[i]["x2"]*ss, _shape[i]["y2"]*ss) EndIf Shapes.Animate(shp[NMB][i], _shape[i]["x"]*ss+_shX, _shape[i]["y"]*ss+_shY, 500) Shapes.Rotate(shp[NMB][i], _Shape[i]["angle"]) EndFor endfor endfor EndSub ' KeyBoard Aniation ' Keys S, W, A, T, X,Z,F , SpaceBar works Sub OnKeyDown key= GraphicsWindow.LastKey If key="S" Then ddx=4 ElseIf Key="W"then ddx=-4 ElseIf Key="A"then ddy=4 ElseIf key="T"Then ddy=-4 ElseIf key="Space" Then ddx=0 ddy=0 EndIf If shoot="False" Then If Key = "X" Then angle=angle+1 Shapes.Rotate(cannon,angle) ElseIf Key = "Z" Then angle=angle-1 Shapes.Rotate(cannon,angle) ElseIf Key="F" then Shapes.ShowShape(Ball) shoot="True" EndIf endif 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 ' Move Sprite on Screen Sub move_index For ii=1 To Array.GetItemCount(shape[11]) ' 47 ' <--- shp[] array number is 47 ' <<<<>>>> Shapes.Move(shp["11:1"][ii],Shapes.GetLeft(shp["11:1"][ii])+dX,Shapes.Gettop(shp["11:1"][ii])+dY) ' current position +dX ,+dY EndFor EndSub Sub SPRITE_init s[1]="1=0" shX[1] = "1=0"' x offset shY[1] = "1=0"' y offset ' 14 Trees s[2]="1=0.8;2=.8;3=.8;4=.8;5=.8;6=.8;7=.8;8=.8;9=.8;10=.8;11=.8;12=.8;13=.8;14=.8" shX[2]="1=-0;2=100;3=280;4=200;5=10;6=150;7=740;8=644;9=777;10=866;11=966;12=1088;13=920;14=1100" shY[2]="1=200;2=170;3=100;4=140;5=300;6=300;7=880;8=100;9=80;10=70;11=80;12=100;13=330;14=330" shape[2][1]="func=ell;X=0;Y=188;width=200;height=140;bc=Green;pc=Green;pw=2" shape[2][2]="func=ell;X=10;Y=277;width=80;height=60;bc=Green;pc=Green;pw=2" shape[2][3]="func=ell;X=4;Y=255;width=80;height=70;bc=Green;pc=Green;pw=2;" shape[2][4]="func=ell;X=0;Y=191;width=80;height=80;bc=Green;pc=Green;pw=2;" shape[2][5]="func=ell;X=40;Y=177;width=80;height=80;bc=Green;pc=Green;pw=2" shape[2][6]="func=ell;X=100;Y=177;width=120;height=80;bc=Green;pc=Green;pw=2" shape[2][7]="func=ell;X=130;Y=240;width=100;height=80;bc=Green;pc=Green;pw=2;" shape[2][8]="func=ell;X=130;Y=260;width=100;height=80;bc=Green;pc=Green;pw=2;" shape[2][9]="func=rect;X=80;Y=322;width=60;height=100;bc=saddlebrown;pc=darkslatgray;pw=2" shape[2][10]="func=tri;X1=140;Y1=262;X2=110;Y2=322;X3=140;Y3=322;bc=saddlebrown;pc=darkslatgray;pw=0 shape[2][11]="func=tri;X1=140;Y1=262;X2=170;Y2=262;X3=140;Y3=322;bc=saddlebrown;pc=darkslatgray;pw=0" shape[2][12]="func=tri;X1=50;Y1=262;X2=96;Y2=262;X3=80;Y3=322;bc=saddlebrown;pc=darkslatgray;pw=0 shape[2][13]="func=tri;X1=96;Y1=262;X2=80;Y2=322;X3=126;Y3=322;bc=saddlebrown;pc=darkslatgray;pw=0" ' 18 Apples s[3] ="1=0.2;2=0.2;3=0.2;4=0.2;5=0.2;6=0.2;7=0.2;8=0.2;9=0.2;10=0.2;11=0.2;12=0.2;13=0.2;14=0.2;15=0.2;16=0.2;17=.2;18=.2;18=.2" shX[3] ="1=-60;2=60;3=140;4=140;5=650;6=600;7=700;8=800;9=900;10=1000;11=1080;12=-80;13=0;14=100;15=740;16=240;17=920;18=1100" shY[3] ="1=360;2=300;3=270;4=444;5=420;6=240;7=220;8=240;9=220;10=240;11=220;12=440;13=420;14=420;15=420;16=240;17=480;18=460" shape[3][1] = "func=rect;x=626;y=110;width=20;height=60;angle=30;bc=yellowgreen;pw=0;" shape[3][2] = "func=ell;x=511;y=148;width=150;height=150;bc=crimson;pw=0;" shape[3][3] = "func=ell;x=603;y=148;width=150;height=150;bc=crimson;pw=0;" shape[3][4] = "func=ell;x=594;y=188;width=40;height=40;bc=snow;pw=0;" shape[3][5] = "func=ell;x=633;y=188;width=40;height=40;bc=snow;pw=0;" shape[3][6] = "func=ell;x=614;y=196;width=15;height=15;bc=darkslategray;pw=0;" shape[3][7] = "func=ell;x=635;y=196;width=15;height=15;angle=7;bc=darkslategray;pw=0;" shape[3][8] = "func=rect;x=600;y=250;width=80;height=20;angle=-5;bc=purple;pw=0;" ' House ' s[4] ="1=1" shX[4] ="1=480" shY[4] ="1=210" shape[4][1] = "func=rect;x=40;y=58;width=17;height=25;angle=0;bc=saddlebrown;pc=darkslategray;pw=2;" ' Cimney 1 shape[4][2] = "func=rect;x=38;y=55;width=22;height=6;angle=0;bc=saddlebrown;pc=darkslategray;pw=2;" '<--------Chimney 2 shape[4][3] = "func=tri;x=0;y=0;x1=-20;y1=115;x2=98;y2=48;x3=215;y3=115;bc=darkgray;pc=darkslategray;pw=2" shape[4][4] = "func=tri;x=0;y=0;x1=-5;y1=112;x2=98;y2=55;x3=198;y3=112;bc=red;pc=darkslategray;pw=2" shape[4][5] = "func=rect;x=0;y=115;width=191;height=100;bc=NavajoWhite;pc=darkslategray;pw=2" shape[4][6] = "func=line;x=20;y=64;x1=60;y1=0;x2=90;y2=0;angle=0;pc=darkslategray;pw=2;" shape[4][7] = "func=line;x=20;y=65;x1=52;y1=5;x2=100;y2=5;angle=0;pc=darkslategray;pw=2;" shape[4][8] = "func=line;x=20;y=66;x1=42;y1=10;x2=114;y2=10;angle=0;pc=darkslategray;pw=2;" shape[4][9] = "func=line;x=20;y=67;x1=32;y1=15;x2=124;y2=15;angle=0;pc=darkslategray;pw=2;" shape[4][10] = "func=line;x=20;y=68;x1=22;y1=20;x2=134;y2=20;angle=0;pc=darkslategray;pw=2;" shape[4][11] = "func=line;x=20;y=69;x1=6;y1=25;x2=144;y2=25;pc=#000000;pw=2;" shape[4][12] = "func=line;x=20;y=70;x1=0;y1=30;x2=154;y2=30;angle=0;pc=darkslategray;pw=2;" shape[4][13] = "func=line;x=20;y=71;x1=-12;y1=35;x2=164;y2=35;angle=0;pc=darkslategray;pw=2;" shape[4][14] = "func=rect;x=70;y=141;width=33;height=66;bc=gainsboro;pc=darkslategray;pw=2"'<-------- Door shape[4][15] = "func=rect;x=67;y=206;width=39;height=12;bc=gray;pc=darkslategray;pw=2" shape[4][16] = "func=ell;x=92;y=171;width=5;height=5;bc=darkslategray;pc=darkslategray;pw=2" shape[4][17] = "func=rect;x=18;y=145;width=30;height=50;bc=DarkTurquoise;pc=darkslategray;pw=2"'<----------Window 1 shape[4][18] = "func=rect;x=12;y=190;width=40;height=8;bc=red;pc=darkslategray;pw=2"'<----------Window Base 1 shape[4][19] = "func=line;x=0;y=0;x1=18;y1=170;x2=48;y2=170;angle=0;pc=darkslategray;pw=2;" shape[4][20] = "func=line;x=0;y=0;x1=33;y1=147;x2=33;y2=190;angle=0;pc=darkslategray;pw=2;" shape[4][21] = "func=ell;x=57;y=148;width=10;height=10;bc=yellow;pc=darkslategray;pw=2"'<----------Knob1 shape[4][22] = "func=rect;x=59;y=155;width=6;height=12;bc=yellow;pc=darkslategray;pw=2"'<----------Knob1 shape[4][23] = "func=line;x=0;y=0;x1=60;y1=159;x2=65;y2=159;angle=0;pc=darkslategray;pw=2;" shape[4][24] = "func=line;x=0;y=0;x1=60;y1=162;x2=65;y2=162;angle=0;pc=darkslategray;pw=2;" shape[4][25] = "func=line;x=0;y=0;x1=60;y1=165;x2=65;y2=165;angle=0;pc=darkslategray;pw=2;" shape[4][26] = "func=rect;x=128;y=145;width=50;height=50;bc=DarkTurquoise;pc=darkslategray;pw=2"'<----------Window 2 shape[4][27] = "func=rect;x=123;y=190;width=60;height=8;bc=red;pc=darkslategray;pw=2"'<----------Window Base 2 shape[4][28] = "func=line;x=112;y=0;x1=15;y1=170;x2=65;y2=170;angle=0;pc=darkslategray;pw=2;" shape[4][29] = "func=line;x=0;y=0;x1=152;y1=145;x2=152;y2=190;angle=0;pc=darkslategray;pw=2;" shape[4][30] = "func=line;x=0;y=0;x1=55;y1=230;x2=122;y2=230;angle=0;pc=darkslategray;pw=2;" ' 1 shape[4][31] = "func=line;x=0;y=0;x1=50;y1=220;x2=127;y2=220;angle=0;pc=darkslategray;pw=2;" ' 2 shape[4][32] = "func=line;x=0;y=0;x1=50;y1=220;x2=55;y2=230;angle=0;pc=darkslategray;pw=2;" ' 3 shape[4][33] = "func=line;x=0;y=0;x1=125;y1=220;x2=120;y2=230;angle=0;pc=darkslategray;pw=2;" ' 4 shape[4][34] = "func=line;x=0;y=0;x1=55;y1=240;x2=122;y2=240;angle=0;pc=darkslategray;pw=2;" ' 5 shape[4][35] = "func=line;x=0;y=0;x1=122;y1=230;x2=122;y2=240;angle=0;pc=darkslategray;pw=2;" ' 6 'shape[4][28] = "func=line;x=0;y=0;x1=50;y1=220;x2=55;y2=230;angle=0;pc=darkslategray;pw=2;" ' 7 'shape[4][29] = "func=line;x=0;y=0;x1=125;y1=220;x2=120;y2=230;angle=0;pc=darkslategray;pw=2;" ' 8 ' Sprite Shapes 1 s[5] ="1=0.4" shX[5] ="1=1180" shY[5] ="1=10" ' Sprite Shapes 2 s[6] ="1=0" shX[6] ="1=0" shY[6] ="1=0" ' Sprite Shapes 3 s[7]="1=0" shX[7] = "1=0"' x offset shY[7] = "1=0"' y offset ' Aircraft s[8] = "1=0.7" shX[8]= "1=770" shY[8]= "1=-22" shape[8][1] = "func=tri;x=0;y=0;x1=400;y1=150;x2=370;y2=50;x3=150;y3=150;angle=0;bc=lightslategray;pc=darkslategray;pw=0" shape[8][2] = "func=tri;x=0;y=0;x1=400;y1=150;x2=370;y2=250;x3=150;y3=150;angle=0;bc=lightslategray;pc=darkslategray;pw=0" shape[8][3] = "func=ell;x=350;y=40;width=33;height=22;bc=yellowgreen;pw=0;tag=eye" ' eye 1 ' <<<<>>>> shape[8][4] = "func=ell;x=350;y=235;width=33;height=22;bc=greenyellow;pw=0;tag=eye" ' eye 2 ' <<<<>>>> shape[8][5] = "func=ell;x=20;y=130;width=280;height=40;bc=lightslategray;pc=darkslategray;pw=0"'<------------CockPit 1 shape[8][6] = "func=ell;x=40;y=137;width=120;height=25;bc=snow;pc=darkslategray;pw=2;tag=0" ' <------CockPit 2 ' <<<<>>>> shape[8][7] = "func=rect;x=368;y=105;width=25;height=40;angle=-10;bc=darkslategray;pc=darkslategray;pw=2" ' <------Tail shape[8][8] = "func=rect;x=370;y=150;width=25;height=40;angle=15;bc=darkslategray;pc=darkslategray;pw=2" ' <------Tail shape[8][9] = "func=rect;x=320;y=142;width=80;height=10;angle=0;bc=lightslategray;pc=lightslategray;pw=2" '---------Tail shape[8][10] = "func=ell;x=370;y=133;width=44;height=11;bc=cyan;pw=0;tag=mouth" ' ' <<<<>>>> shape[8][11] = "func=ell;x=370;y=153;width=44;height=11;bc=cyan;pw=0;tag=mouth" ' ' <<<<>>>> ' Sprite Shapes 9 s[9] ="1=0.8" ' scale shx[9] ="1=-180" ' initial x -position shy[9] ="1=-180" ' initial y-position ' BlueCar s[10] ="1=0.5" shX[10] ="1=420" shY[10] ="1=350" shape[10][1] = "func=rect;x=0;y=29;width=36;height=44;bc=#3B3B3B;pw=0;" shape[10][2] = "func=rect;x=83;y=28;width=36;height=44;bc=#3B3B3B;pw=0;" shape[10][3] = "func=rect;x=1;y=141;width=36;height=44;bc=#3B3B3B;pw=0;" shape[10][4] = "func=rect;x=83;y=142;width=36;height=44;bc=#3B3B3B;pw=0;" shape[10][5] = "func=rect;x=15;y=0;width=91;height=199;bc=#5A95CD;pw=0;" shape[10][6] = "func=rect;x=29;y=64;width=65;height=98;bc=#3B3B3B;pw=0;" shape[10][7] = "func=rect;x=35;y=85;width=53;height=68;bc=#5A95CD;pw=0;" shape[10][8] = "func=line;x=28;y=64;x1=0;y1=0;x2=8;y2=21;pc=#5A95CD;pw=2;" shape[10][9] = "func=line;x=87;y=63;x1=6;y1=0;x2=0;y2=22;pc=#5A95CD;pw=2;" shape[10][10] = "func=line;x=86;y=152;x1=0;y1=0;x2=7;y2=10;pc=#5A95CD;pw=2;" shape[10][11] = "func=line;x=24;y=151;x1=8;y1=0;x2=0;y2=11;pc=#5A95CD;pw=2;" shape[10][12]="func=ell;x=24;y=7;width=29;height=19;angle=-50;bc=#C4D9ED;pw=0.5" ' LF<------ shape[10][13]="func=ell;X=78;Y=7;width=29;height=19;angle=50;bc=#C4D9ED;pw=0.5" ' LR<------ shape[10][14]="func=rect;X=14;Y=180;width=33;height=15;angle=40;bc=#800000;pc=darkslategray;pw=0" shape[10][15]="func=rect;X=72;Y=180;width=33;height=15;angle=-40;bc=#800000;pc=darkslategray;pw=0" ' Ladder s[11] ="1=0.8" ' scale shx[11] ="1= -280" ' initial x -position shy[11] ="1= -150" ' initial y-position ' Ladder shape[11][1] = "func=line;x=0;y=0;x1=400;y1=200;x2=660;y2=525;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder P1 shape[11][2] = "func=line;x=0;y=0;x1=440;y1=200;x2=700;y2=525;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder P2 shape[11][3] = "func=line;x=0;y=0;x1=415;y1=220;x2=455;y2=220;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 1 shape[11][4] = "func=line;x=0;y=0;x1=430;y1=240;x2=470;y2=240;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 2 shape[11][5] = "func=line;x=0;y=0;x1=445;y1=260;x2=488;y2=260;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 3 shape[11][6] = "func=line;x=0;y=0;x1=460;y1=280;x2=505;y2=280;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 4 shape[11][7] = "func=line;x=0;y=0;x1=475;y1=300;x2=522;y2=300;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 5 shape[11][8] = "func=line;x=0;y=0;x1=492;y1=320;x2=537;y2=320;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 6 shape[11][9] = "func=line;x=0;y=0;x1=508;y1=340;x2=549;y2=340;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 7 shape[11][10] = "func=line;x=0;y=0;x1=528;y1=360;x2=568;y2=360;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 8 shape[11][11] = "func=line;x=0;y=0;x1=636;y1=500;x2=680;y2=500;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step L shape[11][12] = "func=line;x=0;y=0;x1=400;y1=200;x2=400;y2=530;angle=0;bc=mediumslateblue;pc=darkgray;pw=2"'<------------' Shadow1 P1 shape[11][13] = "func=line;x=0;y=0;x1=440;y1=200;x2=445;y2=500;angle=0;bc=mediumslateblue;pc=darkgray;pw=2"'<------------' Shadow1 P2 shape[11][14] = "func=line;x=0;y=0;x1=444;y1=500;x2=640;y2=500;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 P1 shape[11][15] = "func=line;x=0;y=0;x1=400;y1=530;x2=660;y2=530;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 P1 shape[11][16] = "func=line;x=0;y=0;x1=400;y1=220;x2=414;y2=220;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow1 Step 1 shape[11][17] = "func=line;x=0;y=0;x1=400;y1=240;x2=430;y2=240;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow1 Step 2 'shape[11][18] = "func=line;x=0;y=0;x1=400;y1=530;x2=444;y2=500;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow Step M 'shape[11][19] = "func=line;x=0;y=0;x1=440;y1=530;x2=484;y2=500;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 Step 1 shape[11][20] = "func=line;x=0;y=0;x1=530;y1=530;x2=530;y2=500;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 Step 2 shape[11][21] = "func=line;x=0;y=0;x1=570;y1=530;x2=570;y2=500;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 Step 3 shape[11][22] = "func=line;x=0;y=0;x1=604;y1=530;x2=604;y2=500;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 Step 4 'shape[11][23] = "func=line;x=0;y=0;x1=640;y1=530;x2=640;y2=500;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 Step 5 shape[11][24] = "func=line;x=0;y=0;x1=638;y1=530;x2=638;y2=502;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 Step L shape[11][25] = "func=line;x=0;y=0;x1=545;y1=380;x2=585;y2=380;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 9 shape[11][26] = "func=line;x=0;y=0;x1=560;y1=400;x2=600;y2=400;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 10 shape[11][27] = "func=line;x=0;y=0;x1=575;y1=420;x2=615;y2=420;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 11 shape[11][28] = "func=line;x=0;y=0;x1=590;y1=440;x2=630;y2=440;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 12 shape[11][29] = "func=line;x=0;y=0;x1=605;y1=460;x2=645;y2=460;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 13 shape[11][30] = "func=line;x=0;y=0;x1=622;y1=480;x2=660;y2=480;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 14 shape[11][31] = "func=line;x=0;y=0;x1=400;y1=260;x2=445;y2=260;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow1 Step 3 shape[11][32] = "func=line;x=0;y=0;x1=400;y1=280;x2=445;y2=280;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow1 Step 4 shape[11][33] = "func=line;x=0;y=0;x1=400;y1=300;x2=445;y2=300;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow1 Step 5 shape[11][34] = "func=line;x=0;y=0;x1=400;y1=320;x2=445;y2=320;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow1 Step 6 shape[11][35] = "func=line;x=0;y=0;x1=400;y1=340;x2=445;y2=340;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 7 shape[11][36] = "func=line;x=0;y=0;x1=400;y1=360;x2=445;y2=360;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 8 shape[11][37] = "func=line;x=0;y=0;x1=400;y1=380;x2=445;y2=380;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 9 'shape[11][38] = "func=line;x=0;y=0;x1=400;y1=400;x2=445;y2=400;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 10 'shape[11][39] = "func=line;x=0;y=0;x1=400;y1=420;x2=445;y2=420;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 11 'shape[11][40] = "func=line;x=0;y=0;x1=400;y1=440;x2=445;y2=440;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 12 'shape[11][41] = "func=line;x=0;y=0;x1=400;y1=460;x2=445;y2=460;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 13 'shape[11][42] = "func=line;x=0;y=0;x1=400;y1=480;x2=445;y2=480;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 14 'shape[11][43] = "func=line;x=0;y=0;x1=400;y1=500;x2=445;y2=500;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 15 endsub End>LJG183-0.sb< Start>LJG183.sb< ' mahreen miangul OctOber 2017 GraphicsWindow.Left = 0.1 * (Desktop.Width - GraphicsWindow.Width) GraphicsWindow.Top = 0 * (Desktop.Height - GraphicsWindow.Height) GraphicsWindow.Title = "mahreen miangul" GraphicsWindow.BackgroundColor="darkcyan" GraphicsWindow.Width = "1280" GraphicsWindow.Height = "666" ' Madam Apple MakeImage() ' Hill GraphicsWindow.brushColor = "silver" GraphicsWindow.fillEllipse(-88,505,620,288) GraphicsWindow.fillEllipse(211,388,622,366) GraphicsWindow.fillEllipse(211,388,1888,666) shoot="False" zm=1 ' ********* ' 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 ' MOON GraphicsWindow.BrushColor = "yellow" GraphicsWindow.PenWidth=0 '<------------- moon= Shapes.AddEllipse(20,20) '<------------- Shapes.Move(moon,50,50) '<------------- GraphicsWindow.BrushColor = "darkcyan" shadow= Shapes.AddEllipse(20,20) '<------------- Shapes.Move(shadow,60,45) '<------------- ' TEXT CRLF= Text.GetCharacter(13)+Text.GetCharacter(10) '<------------- line feed GraphicsWindow.brushColor = "blue" GraphicsWindow.FontSize = 33 msg=Shapes.AddText("H E L L O!"+CRLF+"from"+CRLF+"mahreen "+CRLF+"miangul!") '<------------- Shapes.Move(msg,420,10) '<------------- GraphicsWindow.KeyDown = onkeyDown ' Cannon Drawing GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "mediumslateblue" cannon1_x = 722 cannon1_y = 555 cannon = Shapes.AddRectangle(55,110) Shapes.Move(cannon, cannon1_x, cannon1_y) 'Makesprite() SPRITE_init() ' <--------- all shape data is input here!! add_shapes() ' <--------- all shapes are added here!! ' Cannon Animation GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor="mediumslateblue" Ball=Shapes.AddEllipse(40,40) 'Shapes.Move(Ball,cannon1_x+5,cannon1_y+30) Shapes.HideShape(Ball) ' BlueCar Timer Timer.Interval=1000 '<-------------- Timer.Tick=BlueCar_up '<-------------- ' Drag & Drop to Target or Return Home GraphicsWindow.brushColor = "orange" home = "X=600;Y=40" spriteSize = "420" sprite[1] = Shapes.Addtext("👹") Shapes.Move(sprite[1], home["X"], home["Y"]) spriteTarget[1] = Shapes.Addtext(spriteSize + 0) 'upSize Target for special fx Shapes.Move(spriteTarget[1], 660, 420) Shapes.SetOpacity(spriteTarget[1], 80) '=========================================================================== ' Cloud Moving dx = GraphicsWindow.Width dY = GraphicsWindow.Height GraphicsWindow.BrushColor = "silver" GraphicsWindow.FontSize = 122 x = x + dX - 44 y = y + dY - 550 cloud() Sub cloud cloud = Shapes.Addtext("🌁") Shapes.Animate(cloud,x,y,22000) Endsub Shapes.Animate(cloud,x,y,0) Program.Delay(800) cloud() ' Aircraft Animation dZ = 0.1 zoom = 1 ddx=0 ' 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="8:1" ' Aircraft shapes number=5 repeat =1 shoot="False" zm=1 ' ********* While "True" ' And "North" <> "South" <--- No meanig , it always "True" mseX = GraphicsWindow.MouseX mseY = GraphicsWindow.MouseY If Mouse.IsLeftButtonDown Then 'handle click and select If selected = "" And clicked = "False" Then 'can loop thru here for more than 1 box If mseX >= home["X"] And mseX <= home["X"] + spriteSize And mseY >= home["Y"] And mseY <= home["Y"] + spriteSize Then selected = 1 'box number EndIf EndIf clicked = "True" 'the mse has been clicked for this frame Shapes.Move(sprite[selected], mseX, mseY) Else If Math.Round(mseX/50) = Math.Round(Shapes.GetLeft(spriteTarget[selected])/50) Then If Math.Round(mseY/50) = Math.Round(Shapes.GetTop(spriteTarget[selected])/50) Then Shapes.Remove(sprite[selected]) Shapes.SetOpacity(spriteTarget[selected], 100) EndIf EndIf Shapes.Move(sprite[selected], home["X"], home["Y"]) selected = "" 'deselect when finishised with the box clicked = "False" 'inits here, get ready for next click EndIf Program.Delay(20) 'EndWhile ' <----------- no use 'While 0=0 ' <----------- no use ' Aircraft Blinking Program zoom = zoom - dZ For i = 1 To Array.GetItemCount(shape[8]) ' Aircraft shapes data number = 8 If Array.ContainsValue(shape[8][i], "eye") Then Shapes.Zoom(shp[NMB][i], 1, zoom) ElseIf Array.ContainsValue(shape[8][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 ' Star Blinking Program While zm<6 If zm<6 Then ' <<<<>>>> mmm= Math.GetRandomNumber(80) ' blinking star number _op=Shapes.GetOpacity(star[mmm]) ' opacity ... brightness If _op>50 Then Shapes.SetOpacity(star[mmm],Math.GetRandomNumber(49)) ' darker Else Shapes.SetOpacity(star[mmm],50+Math.GetRandomNumber(50)) ' brighter EndIf If mmm=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) ' <<<<>>>> endif endwhile ' Aircraft Reverse Moving X,Y Direction cycleX= shapes.GetLeft(shp[NMB][1]) + 150 ' 1 = aircraft's body ' <<<<>>>> cycleY= shapes.GetTop(shp[NMB][1]) + 50 ' ' <<<<>>>> If cycleX<0 Or cycleX>GraphicsWindow.Width Then 'shape[8][1]["width"] Then ' 1 = aircraft's body ' <<<<>>>> ddx=-ddx EndIf If cycleY<0 Or cycleY>cannon1_y Then ' 1 = aircraft's body ' <<<<>>>> ddy=-ddy EndIf ' Ball Fire 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+5,cannon1_y+30) Shapes.HideShape(Ball) EndIf ' Collision Check Here ballX=shapes.GetLeft(ball) bally=shapes.GetTop(ball) If (cycleX1 ' 1 =reindeer's body ' <<<<>>>> GraphicsWindow.Title="You Hit !!!!!!!!!!!" Sound.PlayChimeAndWait() shoot="False" Shapes.Move(Ball,cannon1_x+5,cannon1_y+30) Shapes.HideShape(Ball) EndIf EndIf Program.Delay(20) EndWhile Sub MakeImage scale = 1 x0 = 1 * scale y0 = 1 * scale GraphicsWindow.PenWidth = 0 ' Trunk Point GraphicsWindow.BrushColor = "green" oTr = Shapes.Addrectangle(20 * scale, 60 * scale) Shapes.Move(oTr, x0 + 433 * scale, y0 + 480 * scale) Shapes.Rotate(oTr, 30) ' Face GraphicsWindow.BrushColor = "crimson" GraphicsWindow.PenColor = "Darkslategray" oFace1 = Shapes.AddEllipse(150 * scale, 150 * scale) Shapes.Move(oFace1, x0 + 311, y0 + 518) Shapes.Rotate(oFace1, 0) oFace2 = Shapes.AddEllipse(150 * scale, 150 * scale) Shapes.Move(oFace2, x0 + 403, y0 + 518) Shapes.Rotate(oFace2, 0) ' Eyes GraphicsWindow.BrushColor = "white" GraphicsWindow.PenColor = "dimgray" GraphicsWindow.PenWidth = 2 oEyeLeft = Shapes.AddEllipse(40 * scale, 40 * scale) Shapes.Move(oEyeLeft, x0 + 394 * scale, y0 + 538 * scale) Shapes.Rotate(oEyeLeft, 0) oEyeRight = Shapes.AddEllipse(40 * scale, 40 * scale) Shapes.Move(oEyeRight, x0 + 433 * scale, y0 + 538 * scale) Shapes.Rotate(oEyeRight, 80) GraphicsWindow.PenWidth = 2 GraphicsWindow.BrushColor = "snow" GraphicsWindow.PenColor = "DimGray" GraphicsWindow.PenWidth = 2 GraphicsWindow.BrushColor = "darkslategray" oEyeLeft2 = Shapes.AddEllipse(15 * scale, 15 * scale) Shapes.Move(oEyeLeft2, x0 + 416 * scale, y0 + 546 * scale) Shapes.Rotate(oEyeLeft2, 0) oEyeRight2 = Shapes.AddEllipse(15 * scale, 15 * scale) Shapes.Move(oEyeRight2, x0 + 436 * scale, y0 + 546 * scale) Shapes.Rotate(oEyeright2, -5) ' Mouth GraphicsWindow.PenColor = "darkslategray" GraphicsWindow.PenWidth = 11 oMouthLeft = Shapes.AddLine(0, 6 * scale, 66 * scale, 3) Shapes.Move(oMouthLeft, x0 + 400 * scale, y0 + 600 * scale) Shapes.Rotate(oMouthLeft, -2) endsub '' Blue Car Animation Sub BlueCar_up Timer.Pause() For k=1 To Array.GetItemCount(s[10]) ' k=1 to 7 For L=1 To Array.GetItemCount(shape[10]) ' ********* Shapes.Rotate(SHP["10:"+k][L],Shape[10][L]["angle"]) ' ********* ' <-------------- rotating angle // body = 8 // BlueCar index="4:1" to "4:7" endfor endfor Shapes.HideShape(oEyeLeft2) ''MM Shapes.HideShape(oEyeRight2) ''WM Program.Delay(300) For k=1 To Array.GetItemCount(s[10]) ' k=1 to 7 For L=1 To Array.GetItemCount(shape[10]) ' ********* Shapes.Rotate(SHP["10:"+K][L], 0) ' ********* ' <-------------- rotating angle // body = 8// BlueCar index="4:1" to "4:7" EndFor EndFor Program.Delay(30) Shapes.ShowShape(oEyeLeft2) ''MM Shapes.ShowShape(oEyeRight2) ''MM Timer.Resume() endsub ' Add Sprites Sub add_shapes For M=1 to Array.GetItemCount(s) ' 5 types shapes // BlueCar, Trees , House , Apple , Aircraft For N=1 to Array.GetItemCount(s[M]) ' repeat number //BlueCar=1 , Trees =14 , House=1 , Apple=18 , Aircraft=1 ss=s[M][N] ' scale _shx=shx[M][N] ' base point _X _shY=shY[M][N] ' base point _Y _shape=shape[M] ' temporary shape data NMB=M+":"+N ' shape index for i=1 To Array.GetItemCount(_shape) GraphicsWindow.PenWidth = _shape[i]["pw"] GraphicsWindow.BrushColor = _shape[i]["bc"] GraphicsWindow.penColor = _shape[i]["pc"] If _shape[i]["func"]="ell" Then shp[NMB][i] = Shapes.AddEllipse(_shape[i]["width"]*ss, _shape[i]["height"]*ss) ElseIf _shape[i]["func"]="rect" Then shp[NMB][i] = Shapes.AddRectangle(_shape[i]["width"]*ss, _shape[i]["height"]*ss) ElseIf _shape[i]["func"]="tri" Then shp[NMB][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[NMB][i] = Shapes.Addline(_shape[i]["x1"]*ss, _shape[i]["y1"]*ss,_shape[i]["x2"]*ss, _shape[i]["y2"]*ss) EndIf Shapes.Animate(shp[NMB][i], _shape[i]["x"]*ss+_shX, _shape[i]["y"]*ss+_shY, 500) Shapes.Rotate(shp[NMB][i], _Shape[i]["angle"]) EndFor endfor endfor EndSub ' KeyBoard Aniation ' Keys S, W, A, T, X,Z,F , SpaceBar works Sub OnKeyDown key= GraphicsWindow.LastKey If key="S" Then ddx=4 ElseIf Key="W"then ddx=-4 ElseIf Key="A"then ddy=4 ElseIf key="T"Then ddy=-4 ElseIf key="Space" Then ddx=0 ddy=0 EndIf If shoot="False" Then If Key = "X" Then angle=angle+1 Shapes.Rotate(cannon,angle) ElseIf Key = "Z" Then angle=angle-1 Shapes.Rotate(cannon,angle) ElseIf Key="F" then Shapes.ShowShape(Ball) shoot="True" EndIf endif 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 ' Move Sprite on Screen Sub move_index For ii=1 To 47 ' 47 ' <--- shp[] array number is 47 ' <<<<>>>> Shapes.Move(shp["1:1"][ii],Shapes.GetLeft(shp["1:1"][ii])+dX,Shapes.Gettop(shp["1:1"][ii])+dY) ' current position +dX ,+dY EndFor EndSub Sub SPRITE_init ' Ladder s[1] ="1=0.8" ' scale shx[1] ="1= -280" ' initial x -position shy[1] ="1= -150" ' initial y-position ' Ladder shape[1][1] = "func=line;x=0;y=0;x1=400;y1=200;x2=660;y2=525;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder P1 shape[1][2] = "func=line;x=0;y=0;x1=440;y1=200;x2=700;y2=525;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder P2 shape[1][3] = "func=line;x=0;y=0;x1=415;y1=220;x2=455;y2=220;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 1 shape[1][4] = "func=line;x=0;y=0;x1=430;y1=240;x2=470;y2=240;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 2 shape[1][5] = "func=line;x=0;y=0;x1=445;y1=260;x2=488;y2=260;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 3 shape[1][6] = "func=line;x=0;y=0;x1=460;y1=280;x2=505;y2=280;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 4 shape[1][7] = "func=line;x=0;y=0;x1=475;y1=300;x2=522;y2=300;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 5 shape[1][8] = "func=line;x=0;y=0;x1=492;y1=320;x2=537;y2=320;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 6 shape[1][9] = "func=line;x=0;y=0;x1=508;y1=340;x2=549;y2=340;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 7 shape[1][10] = "func=line;x=0;y=0;x1=528;y1=360;x2=568;y2=360;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 8 shape[1][11] = "func=line;x=0;y=0;x1=636;y1=500;x2=680;y2=500;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step L shape[1][12] = "func=line;x=0;y=0;x1=400;y1=200;x2=400;y2=530;angle=0;bc=mediumslateblue;pc=darkgray;pw=2"'<------------' Shadow1 P1 shape[1][13] = "func=line;x=0;y=0;x1=440;y1=200;x2=445;y2=500;angle=0;bc=mediumslateblue;pc=darkgray;pw=2"'<------------' Shadow1 P2 shape[1][14] = "func=line;x=0;y=0;x1=444;y1=500;x2=640;y2=500;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 P1 shape[1][15] = "func=line;x=0;y=0;x1=400;y1=530;x2=660;y2=530;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 P1 shape[1][16] = "func=line;x=0;y=0;x1=400;y1=220;x2=414;y2=220;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow1 Step 1 shape[1][17] = "func=line;x=0;y=0;x1=400;y1=240;x2=430;y2=240;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow1 Step 2 'shape[1][18] = "func=line;x=0;y=0;x1=400;y1=530;x2=444;y2=500;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow Step M 'shape[1][19] = "func=line;x=0;y=0;x1=440;y1=530;x2=484;y2=500;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 Step 1 shape[1][20] = "func=line;x=0;y=0;x1=530;y1=530;x2=530;y2=500;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 Step 2 shape[1][21] = "func=line;x=0;y=0;x1=570;y1=530;x2=570;y2=500;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 Step 3 shape[1][22] = "func=line;x=0;y=0;x1=604;y1=530;x2=604;y2=500;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 Step 4 'shape[1][23] = "func=line;x=0;y=0;x1=640;y1=530;x2=640;y2=500;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 Step 5 shape[1][24] = "func=line;x=0;y=0;x1=638;y1=530;x2=638;y2=502;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 Step L shape[1][25] = "func=line;x=0;y=0;x1=545;y1=380;x2=585;y2=380;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 9 shape[1][26] = "func=line;x=0;y=0;x1=560;y1=400;x2=600;y2=400;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 10 shape[1][27] = "func=line;x=0;y=0;x1=575;y1=420;x2=615;y2=420;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 11 shape[1][28] = "func=line;x=0;y=0;x1=590;y1=440;x2=630;y2=440;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 12 shape[1][29] = "func=line;x=0;y=0;x1=605;y1=460;x2=645;y2=460;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 13 shape[1][30] = "func=line;x=0;y=0;x1=622;y1=480;x2=660;y2=480;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 14 shape[1][31] = "func=line;x=0;y=0;x1=400;y1=260;x2=445;y2=260;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow1 Step 3 shape[1][32] = "func=line;x=0;y=0;x1=400;y1=280;x2=445;y2=280;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow1 Step 4 shape[1][33] = "func=line;x=0;y=0;x1=400;y1=300;x2=445;y2=300;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow1 Step 5 shape[1][34] = "func=line;x=0;y=0;x1=400;y1=320;x2=445;y2=320;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow1 Step 6 shape[1][35] = "func=line;x=0;y=0;x1=400;y1=340;x2=445;y2=340;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 7 shape[1][36] = "func=line;x=0;y=0;x1=400;y1=360;x2=445;y2=360;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 8 shape[1][37] = "func=line;x=0;y=0;x1=400;y1=380;x2=445;y2=380;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 9 'shape[1][38] = "func=line;x=0;y=0;x1=400;y1=400;x2=445;y2=400;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 10 'shape[1][39] = "func=line;x=0;y=0;x1=400;y1=420;x2=445;y2=420;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 11 'shape[1][40] = "func=line;x=0;y=0;x1=400;y1=440;x2=445;y2=440;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 12 'shape[1][41] = "func=line;x=0;y=0;x1=400;y1=460;x2=445;y2=460;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 13 'shape[1][42] = "func=line;x=0;y=0;x1=400;y1=480;x2=445;y2=480;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 14 'shape[1][43] = "func=line;x=0;y=0;x1=400;y1=500;x2=445;y2=500;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 15 ' 14 Trees s[2]="1=0.8;2=.8;3=.8;4=.8;5=.8;6=.8;7=.8;8=.8;9=.8;10=.8;11=.8;12=.8;13=.8;14=.8" shX[2]="1=-0;2=100;3=280;4=200;5=10;6=150;7=740;8=644;9=777;10=866;11=966;12=1088;13=920;14=1100" shY[2]="1=200;2=170;3=100;4=140;5=300;6=300;7=880;8=100;9=80;10=70;11=80;12=100;13=330;14=330" shape[2][1]="func=ell;X=0;Y=188;width=200;height=140;bc=Green;pc=Green;pw=2" shape[2][2]="func=ell;X=10;Y=277;width=80;height=60;bc=Green;pc=Green;pw=2" shape[2][3]="func=ell;X=4;Y=255;width=80;height=70;bc=Green;pc=Green;pw=2;" shape[2][4]="func=ell;X=0;Y=191;width=80;height=80;bc=Green;pc=Green;pw=2;" shape[2][5]="func=ell;X=40;Y=177;width=80;height=80;bc=Green;pc=Green;pw=2" shape[2][6]="func=ell;X=100;Y=177;width=120;height=80;bc=Green;pc=Green;pw=2" shape[2][7]="func=ell;X=130;Y=240;width=100;height=80;bc=Green;pc=Green;pw=2;" shape[2][8]="func=ell;X=130;Y=260;width=100;height=80;bc=Green;pc=Green;pw=2;" shape[2][9]="func=rect;X=80;Y=322;width=60;height=100;bc=saddlebrown;pc=darkslatgray;pw=2" shape[2][10]="func=tri;X1=140;Y1=262;X2=110;Y2=322;X3=140;Y3=322;bc=saddlebrown;pc=darkslatgray;pw=0 shape[2][11]="func=tri;X1=140;Y1=262;X2=170;Y2=262;X3=140;Y3=322;bc=saddlebrown;pc=darkslatgray;pw=0" shape[2][12]="func=tri;X1=50;Y1=262;X2=96;Y2=262;X3=80;Y3=322;bc=saddlebrown;pc=darkslatgray;pw=0 shape[2][13]="func=tri;X1=96;Y1=262;X2=80;Y2=322;X3=126;Y3=322;bc=saddlebrown;pc=darkslatgray;pw=0" ' 18 Apples s[3] ="1=0.2;2=0.2;3=0.2;4=0.2;5=0.2;6=0.2;7=0.2;8=0.2;9=0.2;10=0.2;11=0.2;12=0.2;13=0.2;14=0.2;15=0.2;16=0.2;17=.2;18=.2;18=.2" shX[3] ="1=-60;2=60;3=140;4=140;5=650;6=600;7=700;8=800;9=900;10=1000;11=1080;12=-80;13=0;14=100;15=740;16=240;17=920;18=1100" shY[3] ="1=360;2=300;3=270;4=444;5=420;6=240;7=220;8=240;9=220;10=240;11=220;12=440;13=420;14=420;15=420;16=240;17=480;18=460" shape[3][1] = "func=rect;x=626;y=110;width=20;height=60;angle=30;bc=yellowgreen;pw=0;" shape[3][2] = "func=ell;x=511;y=148;width=150;height=150;bc=crimson;pw=0;" shape[3][3] = "func=ell;x=603;y=148;width=150;height=150;bc=crimson;pw=0;" shape[3][4] = "func=ell;x=594;y=188;width=40;height=40;bc=snow;pw=0;" shape[3][5] = "func=ell;x=633;y=188;width=40;height=40;bc=snow;pw=0;" shape[3][6] = "func=ell;x=614;y=196;width=15;height=15;bc=darkslategray;pw=0;" shape[3][7] = "func=ell;x=635;y=196;width=15;height=15;angle=7;bc=darkslategray;pw=0;" shape[3][8] = "func=rect;x=600;y=250;width=80;height=20;angle=-5;bc=purple;pw=0;" ' House ' s[4] ="1=1" shX[4] ="1=480" shY[4] ="1=210" shape[4][1] = "func=rect;x=40;y=58;width=17;height=25;angle=0;bc=saddlebrown;pc=darkslategray;pw=2;" ' Cimney 1 shape[4][2] = "func=rect;x=38;y=55;width=22;height=6;angle=0;bc=saddlebrown;pc=darkslategray;pw=2;" '<--------Chimney 2 shape[4][3] = "func=tri;x=0;y=0;x1=-20;y1=115;x2=98;y2=48;x3=215;y3=115;bc=darkgray;pc=darkslategray;pw=2" shape[4][4] = "func=tri;x=0;y=0;x1=-5;y1=112;x2=98;y2=55;x3=198;y3=112;bc=red;pc=darkslategray;pw=2" shape[4][5] = "func=rect;x=0;y=115;width=191;height=100;bc=NavajoWhite;pc=darkslategray;pw=2" shape[4][6] = "func=line;x=20;y=64;x1=60;y1=0;x2=90;y2=0;angle=0;pc=darkslategray;pw=2;" shape[4][7] = "func=line;x=20;y=65;x1=52;y1=5;x2=100;y2=5;angle=0;pc=darkslategray;pw=2;" shape[4][8] = "func=line;x=20;y=66;x1=42;y1=10;x2=114;y2=10;angle=0;pc=darkslategray;pw=2;" shape[4][9] = "func=line;x=20;y=67;x1=32;y1=15;x2=124;y2=15;angle=0;pc=darkslategray;pw=2;" shape[4][10] = "func=line;x=20;y=68;x1=22;y1=20;x2=134;y2=20;angle=0;pc=darkslategray;pw=2;" shape[4][11] = "func=line;x=20;y=69;x1=6;y1=25;x2=144;y2=25;pc=#000000;pw=2;" shape[4][12] = "func=line;x=20;y=70;x1=0;y1=30;x2=154;y2=30;angle=0;pc=darkslategray;pw=2;" shape[4][13] = "func=line;x=20;y=71;x1=-12;y1=35;x2=164;y2=35;angle=0;pc=darkslategray;pw=2;" shape[4][14] = "func=rect;x=70;y=141;width=33;height=66;bc=gainsboro;pc=darkslategray;pw=2"'<-------- Door shape[4][15] = "func=rect;x=67;y=206;width=39;height=12;bc=gray;pc=darkslategray;pw=2" shape[4][16] = "func=ell;x=92;y=171;width=5;height=5;bc=darkslategray;pc=darkslategray;pw=2" shape[4][17] = "func=rect;x=18;y=145;width=30;height=50;bc=DarkTurquoise;pc=darkslategray;pw=2"'<----------Window 1 shape[4][18] = "func=rect;x=12;y=190;width=40;height=8;bc=red;pc=darkslategray;pw=2"'<----------Window Base 1 shape[4][19] = "func=line;x=0;y=0;x1=18;y1=170;x2=48;y2=170;angle=0;pc=darkslategray;pw=2;" shape[4][20] = "func=line;x=0;y=0;x1=33;y1=147;x2=33;y2=190;angle=0;pc=darkslategray;pw=2;" shape[4][21] = "func=ell;x=57;y=148;width=10;height=10;bc=yellow;pc=darkslategray;pw=2"'<----------Knob1 shape[4][22] = "func=rect;x=59;y=155;width=6;height=12;bc=yellow;pc=darkslategray;pw=2"'<----------Knob1 shape[4][23] = "func=line;x=0;y=0;x1=60;y1=159;x2=65;y2=159;angle=0;pc=darkslategray;pw=2;" shape[4][24] = "func=line;x=0;y=0;x1=60;y1=162;x2=65;y2=162;angle=0;pc=darkslategray;pw=2;" shape[4][25] = "func=line;x=0;y=0;x1=60;y1=165;x2=65;y2=165;angle=0;pc=darkslategray;pw=2;" shape[4][26] = "func=rect;x=128;y=145;width=50;height=50;bc=DarkTurquoise;pc=darkslategray;pw=2"'<----------Window 2 shape[4][27] = "func=rect;x=123;y=190;width=60;height=8;bc=red;pc=darkslategray;pw=2"'<----------Window Base 2 shape[4][28] = "func=line;x=112;y=0;x1=15;y1=170;x2=65;y2=170;angle=0;pc=darkslategray;pw=2;" shape[4][29] = "func=line;x=0;y=0;x1=152;y1=145;x2=152;y2=190;angle=0;pc=darkslategray;pw=2;" shape[4][30] = "func=line;x=0;y=0;x1=55;y1=230;x2=122;y2=230;angle=0;pc=darkslategray;pw=2;" ' 1 shape[4][31] = "func=line;x=0;y=0;x1=50;y1=220;x2=127;y2=220;angle=0;pc=darkslategray;pw=2;" ' 2 shape[4][32] = "func=line;x=0;y=0;x1=50;y1=220;x2=55;y2=230;angle=0;pc=darkslategray;pw=2;" ' 3 shape[4][33] = "func=line;x=0;y=0;x1=125;y1=220;x2=120;y2=230;angle=0;pc=darkslategray;pw=2;" ' 4 shape[4][34] = "func=line;x=0;y=0;x1=55;y1=240;x2=122;y2=240;angle=0;pc=darkslategray;pw=2;" ' 5 shape[4][35] = "func=line;x=0;y=0;x1=122;y1=230;x2=122;y2=240;angle=0;pc=darkslategray;pw=2;" ' 6 'shape[4][28] = "func=line;x=0;y=0;x1=50;y1=220;x2=55;y2=230;angle=0;pc=darkslategray;pw=2;" ' 7 'shape[4][29] = "func=line;x=0;y=0;x1=125;y1=220;x2=120;y2=230;angle=0;pc=darkslategray;pw=2;" ' 8 ' Sprite Shapes 1 s[5] ="1=0.4" shX[5] ="1=1180" shY[5] ="1=10" ' Sprite Shapes 2 s[6] ="1=0" shX[6] ="1=0" shY[6] ="1=0" ' Sprite Shapes 3 s[7]="1=0" shX[7] = "1=0"' x offset shY[7] = "1=0"' y offset ' Aircraft s[8] = "1=0.7" shX[8]= "1=770" shY[8]= "1=-22" shape[8][1] = "func=tri;x=0;y=0;x1=400;y1=150;x2=370;y2=50;x3=150;y3=150;angle=0;bc=lightslategray;pc=darkslategray;pw=0" shape[8][2] = "func=tri;x=0;y=0;x1=400;y1=150;x2=370;y2=250;x3=150;y3=150;angle=0;bc=lightslategray;pc=darkslategray;pw=0" shape[8][3] = "func=ell;x=350;y=40;width=33;height=22;bc=yellowgreen;pw=0;tag=eye" ' eye 1 ' <<<<>>>> shape[8][4] = "func=ell;x=350;y=235;width=33;height=22;bc=greenyellow;pw=0;tag=eye" ' eye 2 ' <<<<>>>> shape[8][5] = "func=ell;x=20;y=130;width=280;height=40;bc=lightslategray;pc=darkslategray;pw=0"'<------------CockPit 1 shape[8][6] = "func=ell;x=40;y=137;width=120;height=25;bc=snow;pc=darkslategray;pw=2;tag=0" ' <------CockPit 2 ' <<<<>>>> shape[8][7] = "func=rect;x=368;y=105;width=25;height=40;angle=-10;bc=darkslategray;pc=darkslategray;pw=2" ' <------Tail shape[8][8] = "func=rect;x=370;y=150;width=25;height=40;angle=15;bc=darkslategray;pc=darkslategray;pw=2" ' <------Tail shape[8][9] = "func=rect;x=320;y=142;width=80;height=10;angle=0;bc=lightslategray;pc=lightslategray;pw=2" '---------Tail shape[8][10] = "func=ell;x=370;y=133;width=44;height=11;bc=cyan;pw=0;tag=mouth" ' ' <<<<>>>> shape[8][11] = "func=ell;x=370;y=153;width=44;height=11;bc=cyan;pw=0;tag=mouth" ' ' <<<<>>>> ' Sprite Shapes 9 s[9] ="1=0.8" ' scale shx[9] ="1=-180" ' initial x -position shy[9] ="1=-180" ' initial y-position ' BlueCar s[10] ="1=0.5" shX[10] ="1=420" shY[10] ="1=350" shape[10][1] = "func=rect;x=0;y=29;width=36;height=44;bc=#3B3B3B;pw=0;" shape[10][2] = "func=rect;x=83;y=28;width=36;height=44;bc=#3B3B3B;pw=0;" shape[10][3] = "func=rect;x=1;y=141;width=36;height=44;bc=#3B3B3B;pw=0;" shape[10][4] = "func=rect;x=83;y=142;width=36;height=44;bc=#3B3B3B;pw=0;" shape[10][5] = "func=rect;x=15;y=0;width=91;height=199;bc=#5A95CD;pw=0;" shape[10][6] = "func=rect;x=29;y=64;width=65;height=98;bc=#3B3B3B;pw=0;" shape[10][7] = "func=rect;x=35;y=85;width=53;height=68;bc=#5A95CD;pw=0;" shape[10][8] = "func=line;x=28;y=64;x1=0;y1=0;x2=8;y2=21;pc=#5A95CD;pw=2;" shape[10][9] = "func=line;x=87;y=63;x1=6;y1=0;x2=0;y2=22;pc=#5A95CD;pw=2;" shape[10][10] = "func=line;x=86;y=152;x1=0;y1=0;x2=7;y2=10;pc=#5A95CD;pw=2;" shape[10][11] = "func=line;x=24;y=151;x1=8;y1=0;x2=0;y2=11;pc=#5A95CD;pw=2;" shape[10][12]="func=ell;x=24;y=7;width=29;height=19;angle=-50;bc=#C4D9ED;pw=0.5" ' LF<------ shape[10][13]="func=ell;X=78;Y=7;width=29;height=19;angle=50;bc=#C4D9ED;pw=0.5" ' LR<------ shape[10][14]="func=rect;X=14;Y=180;width=33;height=15;angle=40;bc=#800000;pc=darkslategray;pw=0" shape[10][15]="func=rect;X=72;Y=180;width=33;height=15;angle=-40;bc=#800000;pc=darkslategray;pw=0" endsub End>LJG183.sb< Start>LJG207.sb< 'UserNum = 1 'NumClients = 1 'Goto SkipSetup '<--- temp 'TextWindow.Write("Enter the port: ") 'Port = TextWindow.Read() TextWindow.Write("Enter the IP: ") ServIp = TextWindow.Read() 'ServIp = "192.168.1.140" Port = "100" TextWindow.Hide() Server = ServIp + ":" + Port LDClient.Connect(Server) LDClient.ServerMessage = OnMessageRecieved IP = ServIp GraphicsWindow.Width = 800 GraphicsWindow.Height = 600 GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp LDGraphicsWindow.ExitOnClose = "False" LDGraphicsWindow.Closing = OnClose While UserNum = "" Program.Delay(100) Time = Time + 100 If Time > 5000 Then GraphicsWindow.ShowMessage("Could not get reply from host at: "+ServIp+":"+Port,"") Program.Delay(1000) Program.End() EndIf EndWhile GraphicsWindow.BrushColor = "Black" LDControls.CheckBoxChanged = OnCheckBoxChange For e = 1 to NumClients ReadyBox[e] = LDControls.AddCheckBox("Ready") Shapes.Move(ReadyBox[e],GraphicsWindow.Width - 100,l*20) EndFor While IsGameStarted <> "Y" Program.Delay(100) For w = 1 To NumClients If w <> UserNum Then LDControls.CheckBoxState(ReadyBox[w],ReadyBoxState[w]) EndIf EndFor If ClientChange Then GraphicsWindow.Clear() For l = 1 to NumClients GraphicsWindow.DrawText(10,l*20,Clients[l]) ReadyBox[l] = LDControls.AddCheckBox("Ready") Shapes.Move(ReadyBox[l],GraphicsWindow.Width - 100,l*20) EndFor ClientChange = "False" EndIf ' OnCheckBoxChange() EndWhile GraphicsWindow.Clear() SkipSetup: '====================TEMP================== GraphicsWindow.Width = 800 GraphicsWindow.Height = 600 GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp GraphicsWindow.MouseDown = OnMouseDown LDGraphicsWindow.ExitOnClose = "False" LDGraphicsWindow.Closing = OnClose '=========================================== Initialize() LDScrollBars.Add(2000,2000) LDScrollBars.Visibility = "False" LDClient.ServerMessage = OnMessageRecievedEvent While 1 = 1 Program.Delay(5) For i = 1 To NumOfShips TimeElapsed[i] = (Clock.ElapsedMilliseconds - ElapsedMill[i]) / 1000 ElapsedMill[i] = Clock.ElapsedMilliseconds ShipAccel[i] = (ShipF[i]/ShipMass[i]) StrafAccel[i] = ""'(StrafF[i]/ShipMass[i]) AngleAccel[i] = (AngleF[i]/ShipMass[i]) If ShipF[i] = 0 Then If Velocity[i] < 0 Then ShipAccel[i] = (ShipForce[i]/ShipMass[i]) EndIf If Velocity[i] > 0 Then ShipAccel[i] = (-ShipForce[i]/ShipMass[i]) EndIf EndIf ' If StrafF[i] = 0 Then ' If StrafVelocity[i] < 0 Then ' StrafAccel[i] = (StrafForce[i]/ShipMass[i]) ' EndIf ' If StrafVelocity[i] > 0 Then ' StrafAccel[i] = (-StrafForce[i]/ShipMass[i]) ' EndIf ' EndIf If AngleF[i] = 0 Then If AngleVel[i] < 0 Then AngleAccel[i] = (ShipRotForce[i]/ShipMass[i]) EndIf If Anglevel[i] > 0 Then AngleAccel[i] = (-ShipRotForce[i]/ShipMass[i]) EndIf EndIf Velocity[i] = Velocity[i] + (ShipAccel[i] * TimeElapsed[i]) StrafVelocity[i] = StrafVelocity[i] + (StrafAccel[i] * TimeElapsed[i]) If StrafVelocity[i] > Strafmaxspeed[i] Then StrafVelocity[i] = Strafmaxspeed[i] EndIf If StrafVelocity[i] < -Strafmaxspeed[i] Then StrafVelocity[i] = -Strafmaxspeed[i] EndIf If Velocity[i] > Shipmaxspeed[i] Then Velocity[i] = Shipmaxspeed[i] EndIf If Velocity[i] < -Shipmaxspeed[i] Then Velocity[i] = -Shipmaxspeed[i] EndIf VelocityX[i] = Velocity[i] * Math.Cos(Math.GetRadians(Angle[i]+90)) '<--- Find the Horizontal (X) Velocity VelocityY[i] = Velocity[i] * Math.Sin(Math.GetRadians(Angle[i]+90)) '<--- Find the Vertical (Y) Velocity VelocityX[i] = VelocityX[i] + StrafVelocity[i] * Math.Cos(Math.GetRadians(Angle[i]+180)) '<--- Find the Horizontal (X) Velocity VelocityY[i] = VelocityY[i] + StrafVelocity[i] * Math.Sin(Math.GetRadians(Angle[i]+180)) '<--- Find the Vertical (Y) Velocity AngleVel[i] = AngleVel[i] + (AngleAccel[i] * TimeElapsed[i]) If AngleVel[i] > ShipRotmaxspeed[i] Then AngleVel[i] = ShipRotmaxspeed[i] EndIf If AngleVel[i] < -ShipRotmaxspeed[i] Then AngleVel[i] = -ShipRotmaxspeed[i] EndIf '========================================================================================================================================================= If ShipF[i] <> 0 Then LDShapes.AnimationResume(Ship[i]) Else LDShapes.AnimationPause(Ship[i]) EndIf '========================================================================================================================================================= Angto = Zock77Math.GetAngle((Shipx[i]+Turretx[i]) + (Turretwidth[i] / 2),GraphicsWindow.MouseX,(Shipy[i]+Turrety[i]) + (TurretHeight[i] / 2),GraphicsWindow.MouseY) + 180 AngAt = TurretAngle[UserNum] GetDirection() If Math.Abs(AngAt-Angto) < TurretTurnSpeed[UserNum] Then Dir[UserNum] = 0 EndIf '========================================================================================================================================================= Shipx[i] = Shipx[i] + (VelocityX[i] * TimeElapsed[i]) Shipy[i] = Shipy[i] + (VelocityY[i] * TimeElapsed[i]) Angle[i] = Angle[i] + (AngleVel[i] * TimeElapsed[i]) TurretAngle[i] = TurretAngle[i] + (Dir[i] * TurretTurnSpeed[i]) TurretAngle[i] = TurretAngle[i] + (AngleVel[i] * TimeElapsed[i]) AngleInput = TurretAngle[i] RefineAngle() TurretAngle[i] = AngleOutput Shapes.Move(Ship[i],Shipx[i],Shipy[i]) Shapes.Rotate(Ship[i],Angle[i]) Shapes.Move(ShipShadow[i],Shipx[i]-5,Shipy[i]-5) Shapes.Rotate(ShipShadow[i],Angle[i]) Shapes.Move(turretShadow[i],Shipx[i]+5,Shipy[i]-10) Shapes.Rotate(turretShadow[i],TurretAngle[i]) Shapes.Move(Turret[i],Shipx[i]+Turretx[i],Shipy[i] + Turrety[i]) Shapes.Rotate(Turret[i],TurretAngle[i]) EndFor CheckKeyStrokes() MoveScrollBars() If Mouse.IsLeftButtonDown Then Fire() EndIf If MessageRecieved Then ' If LDQueue.GetCount("Messages") = 0 Then MessageRecieved = "False" ' Else ' RecInfo = LDQueue.Dequeue("Messages") OnMessageRecieved() EndIf 'EndIf ' If LDQueue.GetCount("Messages") > LastCount Then ' LastCount = LDQueue.GetCount("Messages") ' TextWindow.WriteLine(LastCount) ' EndIf If Clock.ElapsedMilliseconds - TimeSinceLastPosUpdate > 2000 Then SendPosUpdate() EndIf EndWhile '====================================================================================================== '=========================================SUBROUTINES================================================== '====================================================================================================== '====================================================================================================== Sub OnKeyDown For KeydownNum = 1 To Array.GetItemCount(Keybind) If GraphicsWindow.LastKey = Keybind[KeydownNum] Then Key[KeydownNum] = "Down" EndIf EndFor EndSub '====================================================================================================== Sub OnKeyUp For KeyUpNum = 1 To Array.GetItemCount(Keybind) If GraphicsWindow.LastKey = Keybind[KeyUpNum] Then Key[KeyUpNum] = "Up" EndIf EndFor EndSub '====================================================================================================== Sub CheckKeyStrokes If Key[3] = "Down" And AngleF[UserNum] <> ShipRotForce[UserNum] Then AngleF[UserNum] = ShipRotForce[UserNum] AngleForceChange() EndIf If Key[4] = "Down" And AngleF[UserNum] <> -ShipRotForce[UserNum] Then AngleF[UserNum] = -ShipRotForce[UserNum] AngleForceChange() EndIf ' If Key[7] = "Down" And StrafF[UserNum] <> -StrafForce[UserNum] Then ' StrafF[UserNum] = -StrafForce[UserNum] ' ForceChange() ' EndIf 'If Key[6] = "Down" And StrafF[UserNum] <> StrafForce[UserNum] Then ' StrafF[UserNum] = StrafForce[UserNum] ' ForceChange() 'EndIf ' If Key[6] = "Up" And Key[7] = "Up" And StrafF[UserNum] <> 0 Then ' StrafF[UserNum] = 0 ' ForceChange() ' EndIf If Key[3] = "Up" And Key[4] = "Up" And AngleF[UserNum] <> 0 Then AngleF[UserNum] = 0 AngleForceChange() EndIf If Key[2] = "Down" And ShipF[UserNum] <> ShipForce[UserNum] Then ShipF[UserNum] = ShipForce[UserNum] ForceChange() EndIf If Key[1] = "Down" And ShipF[UserNum] <> -ShipForce[UserNum] Then ShipF[UserNum] = -ShipForce[UserNum] ForceChange() EndIf If Key[1] = "Up" And Key[2] = "Up" And ShipF[UserNum] <> 0 Then ShipF[UserNum] = 0 ForceChange() EndIf If Key[5] = "Down" Then SendServerCheck() EndIf EndSub '====================================================================================================== Sub OnMessageRecieved If IsGameStarted <> "Y" Then RecInfo = LDClient.LastServerMessage EndIf If RecInfo["T"] = "N" Then '<--- Geting the user number for this PC from the server UserNum = RecInfo["UN"] IsGameStarted = RecInfo["ST"] Clients = RecInfo["C"] OldNumClients = NumClients NumClients = RecInfo["NC"] If NumClients <> OldNumClients Then ClientChange = "True" EndIf EndIf If RecInfo["N"] <> UserNum And LDUtilities.IsNumber(RecInfo["N"]) Then '<--- make sure you aren't getting feedback TextWindow.WriteLine("Moving tank " + RecInfo["N"]) If RecInfo["T"] = "RB" Then '<--- Ready checkbox update If RecInfo["R"] = "T" Then ReadyBoxState[RecInfo["N"]] = "True" ElseIf RecInfo["R"] = "F" Then ReadyBoxState[RecInfo["N"]] = "False" EndIf LDControls.CheckBoxState(ReadyBox[RecInfo["N"]],ReadyBoxState[RecInfo["N"]]) EndIf If RecInfo["T"] = "F" Then '<--- Firing stuff LDShapes.AnimationSet(Turret[RecInfo["N"]],1) LDShapes.AnimationResume(Turret[RecInfo["N"]]) TurretAngle[RecInfo["N"]] = RecInfo["A"] f[RecInfo["N"]] = f[RecInfo["N"]] + 1 If f[RecInfo["N"]] > WeaponArrays[RecInfo["W"]]["BallCount"] Then f[RecInfo["N"]] = 1 EndIf If Bullet[f[RecInfo["N"]]][RecInfo["N"]] = "" Then Bullet[f[RecInfo["N"]]][RecInfo["N"]] = Shapes.AddEllipse(10,10) EndIf Shapes.Move(Bullet[f[RecInfo["N"]]][RecInfo["N"]],RecInfo["X"],RecInfo["Y"]) AimAt2 = Zock77Math.GetCircle(WeaponArrays[RecInfo["W"]]["Velocity"]*100,RecInfo["X"],RecInfo["Y"],RecInfo["A"]-90) Shapes.Animate(Bullet[f[RecInfo["N"]]][RecInfo["N"]],Aimat2["x"],Aimat2["y"],200000) EndIf If RecInfo["T"] = "CH" Then '<--- Ping test Info3["T"] = "PNG" Info3["N"] = RecInfo["N"] Info3["TS"] = RecInfo["TS"] Info3["SB"] ="Client" LDClient.SendMessage(Info3) EndIf If RecInfo["T"] = "FU" Then '<--- Force and angle update 'Shipx[RecInfo["N"]] = RecInfo["X"] 'Shipy[RecInfo["N"]] = RecInfo["Y"] Velocity[RecInfo["N"]] = RecInfo["V"] ' Angle[RecInfo["N"]] = RecInfo["A"] ' AngleVel[RecInfo["N"]] = RecInfo["AV"] ShipF[RecInfo["N"]] = RecInfo["F"] ' AngleF[RecInfo["N"]] = RecInfo["AF"] EndIf If RecInfo["T"] = "PU" Then '<--- Force and angle update Shipx[RecInfo["N"]] = RecInfo["X"] Shipy[RecInfo["N"]] = RecInfo["Y"] ' Velocity[RecInfo["N"]] = RecInfo["V"] Angle[RecInfo["N"]] = RecInfo["A"] 'AngleVel[RecInfo["N"]] = RecInfo["AV"] ' ShipF[RecInfo["N"]] = RecInfo["F"] ' AngleF[RecInfo["N"]] = RecInfo["AF"] EndIf If RecInfo["T"] = "AU" Then '<--- Force and angle update 'Shipx[RecInfo["N"]] = RecInfo["X"] 'Shipy[RecInfo["N"]] = RecInfo["Y"] ' Velocity[RecInfo["N"]] = RecInfo["V"] ' Angle[RecInfo["N"]] = RecInfo["A"] AngleVel[RecInfo["N"]] = RecInfo["AV"] ' ShipF[RecInfo["N"]] = RecInfo["F"] AngleF[RecInfo["N"]] = RecInfo["AF"] EndIf Else '<---- Recinfo["n"] = usernum If RecInfo["T"] = "PNG" Then OldNum = RecInfo["TS"] ElapsedMilisecs = Math.Round(Clock.ElapsedMilliseconds) Ping = ElapsedMilisecs - RecInfo["TS"] TextWindow.WriteLine("-") TextWindow.WriteLine("Ping to "+RecInfo["SB"] + " = " + Ping) TextWindow.WriteLine("-") EndIf EndIf EndSub '====================================================================================================== Sub SendPosUpdate TimeSinceLastPosUpdate = Clock.ElapsedMilliseconds If Angle[UserNum] > 360 Then Angle[UserNum] = Angle[UserNum] - 360 EndIf If Angle[UserNum] < 0 Then Angle[UserNum] = Angle[UserNum] + 360 EndIf Info5["T"] = "PU" 'Type Info5["N"] = UserNum 'Num Info5["X"] = Math.Round(Shipx[UserNum]) Info5["Y"] = Math.Round(Shipy[UserNum]) Info5["A"] = Math.Round(Angle[UserNum]) LDClient.SendMessage(Info5) EndSub '====================================================================================================== Sub AngleForceChange Info7["T"] = "AU" 'Type Info7["N"] = UserNum 'Num Info7["AF"] = Math.Round(AngleF[UserNum]) ' Angle Info7["AV"] = Math.Round(AngleVel[UserNum]) ' Angle LDClient.SendMessage(Info7) EndSub '====================================================================================================== Sub ForceChange Info["T"] = "FU" 'Type Info["N"] = UserNum 'Num Info["F"] = Math.Round(ShipF[UserNum]) 'Force Info["V"] = Math.Round(Velocity[UserNum]) 'Force LDClient.SendMessage(Info) EndSub '====================================================================================================== Sub SendServerCheck ElapsedMilisecs = Math.Round(Clock.ElapsedMilliseconds) Info4["T"] = "CH" Info4["N"] = UserNum Info4["TS"] = ElapsedMilisecs LDClient.SendMessage(Info4) EndSub '====================================================================================================== Sub Initialize LDUtilities.NetworkURL = "http://sean.alyrica.net/" WeaponArrays = LDNetwork.GetGameData("ArmoredAssaultWeapons") Keybind[1] = "W" Keybind[2] = "S" Keybind[3] = "D" Keybind[4] = "A" Keybind[5] = "Space" Keybind[6] = "N/A" Keybind[7] = "N/A" NumOfShips = NumClients For KeyUpNum = 1 To Array.GetItemCount(Keybind) Key[KeyUpNum] = "Up" EndFor Img = ImageList.LoadImage(Program.Directory + "/Sand.png") For x = 1 to 2000 Step 1000 For y = 1 To 2000 Step 500 ' Shapes.Move(Shapes.AddImage(Img),i10,i11) GraphicsWindow.DrawImage(Img,x,y) EndFor EndFor LDShapes.AnimationInterval = 60 For i = 1 to NumOfShips TurretShadow[i] = ""'Shapes.AddImage(Program.Directory + "/Tank Turret1 shadow.png") ShipShadow[i] = ""'Shapes.AddImage(Program.Directory + "/Tank body1 Shadow.png") Ship[i] = Shapes.AddRectangle(20,50)'LDShapes.AddAnimatedImage(Program.Directory + "/Tank Body 2(Green) (Ani).png","True",3,1) ' LDShapes.AnimationPause(Ship[i]) 'ShipReverse[i] = LDShapes.AddAnimatedImage(Program.Directory + "/Tank Body 2(Green) (Ani)(Reverse).png","True",3,1) 'LDShapes.AnimationPause(ShipReverse[i]) 'Shapes.HideShape(ShipReverse[i]) Turret[i] = Shapes.AddRectangle(10,10)' LDShapes.AddAnimatedImage(Program.Directory + "/Tank Turret2(ani)(Green).png","False",6,1)' Shapes.AddImage(Program.Directory + "/Tank Turret1(Green).png") 'LDShapes.AnimationPause(Turret[i]) Turretx[i] = -59 Turrety[i] = -46 Turretwidth[i] = 188 TurretHeight[i] = 188 TurretTurnSpeed[i] = 0.5 Shipx[i] = GraphicsWindow.Width / 2 Shipy[i] = GraphicsWindow.Height - 200 ShipMass[i] = 5 ShipF[i] = 0 ShipRotForce[i] = 4000 ShipRotmaxspeed[i] = 200 ShipForce[i] = 2000 Shipmaxspeed[i] = 100 StrafForce[i] = 2500 StrafMaxSpeed[i] = 350 BallCount[i] = 40 WeaponNumber[i] = 1 ElapsedMill[i] = Clock.ElapsedMilliseconds EndFor EndSub '====================================================================================================== Sub OnClose LDClient.Disconnect() Program.End() EndSub '====================================================================================================== Sub OnCheckBoxChange Info2["T"] = "RB" Info2["R"] = Text.GetSubText(LDControls.CheckBoxGetState(ReadyBox[UserNum]),1,1) Info2["N"] = UserNum LDClient.SendMessage(Info2) EndSub '====================================================================================================== Sub OnMouseDown EndSub '====================================================================================================== Sub GetDirection If Angto < 0 Then Angto = Angto + 360 EndIf If Angto > 360 Then Angto = Angto - 360 EndIf Var1 = (360 - AngAt) - (360 - Angto) If Var1 <-180 Then Var1 = Var1 + 360 EndIf If Var1 > 180 Then Var1 = Var1 - 360 EndIf If Var1 > 0 Then Dir[UserNum] = 1 EndIf If Var1 < 0 Then Dir[UserNum] = -1 EndIf EndSub '====================================================================================================== Sub RefineAngle If AngleInput < 0 Then AngleInput = AngleInput + 360 EndIf If AngleInput > 360 Then AngleInput = AngleInput - 360 EndIf AngleOutput = AngleInput EndSub '====================================================================================================== Sub MoveScrollBars LDScrollBars.HorizontalScroll = Shipx[UserNum]- 350 LDScrollBars.VerticalScroll = Shipy[UserNum]- 250 EndSub '====================================================================================================== Sub Fire If Clock.ElapsedMilliseconds - SinceShot > WeaponArrays[WeaponNumber[UserNum]]["ROF"] Then LDShapes.AnimationSet(Turret[UserNum],1) LDShapes.AnimationResume(Turret[UserNum]) SinceShot = Clock.ElapsedMilliseconds f[UserNum] = f[UserNum] + 1 If f[UserNum] > WeaponArrays[WeaponNumber[UserNum]]["BallCount"] Then f[UserNum] = 1 EndIf If Bullet[f[UserNum]][UserNum] = "" Then Bullet[f[UserNum]][UserNum] = Shapes.AddEllipse(10,10) EndIf Firex = (Shipx[UserNum]+Turretx[UserNum]) + (Turretwidth[UserNum] / 2) + (Math.Cos(Math.GetRadians(TurretAngle[UserNum]-90)) * 80) Firey = (Shipy[UserNum]+Turrety[UserNum]) + (TurretHeight[UserNum] / 2) + (Math.Sin(Math.GetRadians(TurretAngle[UserNum]-90)) * 80) Shapes.Move(Bullet[f[UserNum]][UserNum],Firex,Firey) AimAt = Zock77Math.GetCircle(WeaponArrays[WeaponNumber[UserNum]]["Velocity"]*100,Shipx[UserNum],Shipy[UserNum],TurretAngle[UserNum]-90) Shapes.Animate(Bullet[f[UserNum]][UserNum],Aimat["x"],Aimat["y"],200000) FireMSG() EndIf EndSub '====================================================================================================== Sub FireMSG Info6["T"] = "F" Info6["N"] = UserNum Info6["W"] = WeaponNumber[UserNum] Info6["A"] = TurretAngle[UserNum] Info6["X"] = Math.Round(Firex) Info6["Y"] = Math.Round(Firey) LDClient.SendMessage(Info6) EndSub '====================================================================================================== Sub OnMessageRecievedEvent RecInfo = LDClient.LastServerMessage ' LDQueue.Enqueue("Messages",LDClient.LastServerMessage) MessageRecieved = "True" EndSub End>LJG207.sb< Start>LJH960.sb< GraphicsWindow.Hide() Title = "crackers" PATH = "http://www.crew99.com/crackers/" true = " - You are a WINNER" false = "" win = false duration = 250 move = 0 button = true btnup = true gfxwidth = 500 gfxheight = 500 gfxwidth2 = gfxwidth / 2 gfxheight2 = gfxheight / 2 '------------------------------------------------------------------------------ LOAD GFX For a = 1 to 4 For b = 1 To 4 If (b <> 4 or a <> 4) then puzzle[a-1][b-1] = Shapes.AddImage(PATH + "puzzle_" + a + "_" + b + ".png") field[a-1][b-1] = (a-1)*4 + b Shapes.Move(puzzle[a-1][b-1], (b-1)*125, (a-1)*125) Else field[a-1][b-1] = 0 EndIf EndFor EndFor shape_frame[0] = Shapes.AddLine(0,0,125,0) shape_frame[1] = Shapes.AddLine(0,125,125,125) shape_frame[2] = Shapes.AddLine(125,0,125,125) shape_frame[3] = Shapes.AddLine(0,0,0,125) For i = 0 To 3 Shapes.HideShape(shape_frame[i]) EndFor btnImage = ImageList.LoadImage(PATH + "btnGo1.png") btnWidth = ImageList.GetWidthOfImage(btnImage) btnHeight = ImageList.GetHeightOfImage(btnImage) btn1 = Shapes.AddImage(btnImage) Shapes.HideShape(btn1) btn2 = Shapes.AddImage(PATH + "btnGo2.png") Shapes.HideShape(btn2) '------------------------------------------------------------------------------ INIT WINDOW GraphicsWindow.CanResize = "false" GraphicsWindow.Title = Title GraphicsWindow.Width = gfxwidth GraphicsWindow.Height = gfxheight GraphicsWindow.Left = (Desktop.Width - 500) / 2 GraphicsWindow.Top = (Desktop.Height - 500) / 2 GraphicsWindow.BackgroundColor = "Black" GraphicsWindow.MouseMove = MouseMove GraphicsWindow.MouseUp = MouseClick GraphicsWindow.Show() Shapes.Move(btn1, GraphicsWindow.Width / 2 - btnWidth / 2, GraphicsWindow.Height / 2 - btnHeight / 2) Shapes.Move(btn2, GraphicsWindow.Width / 2 - btnWidth / 2, GraphicsWindow.Height / 2 - btnHeight / 2) Shapes.ShowShape(btn1) pic = false '------------------------------------------------------------------------------ UPDATE ON MOUSE MOVE 'Highlight the picture below the cursor and highlight the button. Sub MouseMove If button = true then mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY bb = Math.SquareRoot((gfxwidth2 - mx)*(gfxwidth2 - mx) + (gfxheight2 - my)*(gfxheight2 - my)) if bb < 74 and btnup = true then Shapes.ShowShape(btn2) Shapes.HideShape(btn1) btnup = false elseif bb > 74 and btnup = false then Shapes.ShowShape(btn1) Shapes.HideShape(btn2) btnup = true endif else x = math.Floor(GraphicsWindow.MouseX / 125) '* 125 y = math.Floor(GraphicsWindow.MouseY / 125) '* 125 For i = 0 To 3 Shapes.Move(shape_frame[i], x*125, y*125) EndFor EndIf EndSub '------------------------------------------------------------------------------ UPDATE ON MOUSE BUTTON UP Sub MouseClick If (x-1 >= 0) And (field[y][x-1] = 0) then move = move + 1 field[y][x-1] = field[y][x] field[y][x] = 0 puzzle[y][x-1] = puzzle[y][x] Shapes.Animate(puzzle[y][x], (x-1)*125, y*125, duration) ElseIf (x+1 <= 3) And (field[y][x+1] = 0) then move = move + 1 field[y][x+1] = field[y][x] field[y][x] = 0 puzzle[y][x+1] = puzzle[y][x] Shapes.Animate(puzzle[y][x], (x+1)*125, y*125, duration) ElseIf (y-1 >= 0) And (field[y-1][x] = 0) then move = move + 1 field[y-1][x] = field[y][x] field[y][x] = 0 puzzle[y-1][x] = puzzle[y][x] Shapes.Animate(puzzle[y][x], x*125, (y-1)*125, duration) ElseIf (y+1 <= 3) And (field[y+1][x] = 0) then move = move + 1 field[y+1][x] = field[y][x] field[y][x] = 0 puzzle[y+1][x] = puzzle[y][x] Shapes.Animate(puzzle[y][x], x*125, (y+1)*125, duration) EndIf CheckWin() 'after moving , check if the picture is already complete If button = true and btnup = false then button = false Shapes.HideShape(btn2) For f = 1 To 500 Shuffle() 'shuffle the picture EndFor For i = 0 To 3 'draw frame Shapes.ShowShape(shape_frame[i]) EndFor EndIf EndSub '------------------------------------------------------------------------------ CHECK IF THE PICTURE IS COMPLETED Sub CheckWin if move > 0 then win = true For a = 1 to 4 For b = 1 To 4 If (b <> 4 or a <> 4) then If field[a-1][b-1] <> (a-1)*4 + b then win = false EndIf EndIf EndFor EndFor EndIf GraphicsWindow.Title = Title + " " + win EndSub '------------------------------------------------------------------------------ SHUFFLE THE PICTURE Sub Shuffle px = 0 py = 0 GetNull() if xn = 0 Then px = (Math.GetRandomNumber(3-1) + 1) - 2 elseif xn = 3 Then px = (Math.GetRandomNumber(3-1)) - 2 else px = (Math.GetRandomNumber(3)) - 2 EndIf If px = 0 then While py = 0 if yn = 0 Then py = (Math.GetRandomNumber(3-1) + 1) - 2 elseif yn = 3 Then py = (Math.GetRandomNumber(3-1)) - 2 else py = (Math.GetRandomNumber(3)) - 2 EndIf EndWhile EndIf x = xn + px y = yn + py For i = 0 To 3 Shapes.Move(shape_frame[i], x*125, y*125) EndFor MouseClick() ' simulate a click to move the part EndSub '------------------------------------------------------------------------------ Get the empty field Sub GetNull For a = 1 to 4 For b = 1 To 4 If field[a-1][b-1] = 0 then xn = b-1 yn = a-1 EndIf EndFor EndFor EndSub End>LJH960.sb< Start>LJM030.sb< Controls.ButtonClicked = BC Controls.TextTyped = TT Images() Texts() Lang = 1 side = 1 start = 0 start2 = 0 Main() ShowText() BoxText() ShowBoxes() Sub Images AboutPic = ImageList.LoadImage(Program.Directory + "\About.bmp") EndSub Sub Texts Langs = "1=English;2=Deutsch" ButtonCap[1] = "1=Close;2=Beenden" ButtonCap[2] = "1=Start;2=Start" ButtonCap[3] = "1=Language;2=Sprache" ButtonCap[4] = "1=Next;2=Weiter" ButtonCap[5] = "1=Back;2=Zurück" ButtonCap[6] = "1=About;2=Über" SButCap[1] = "1=Yes;2=Ja" SButCap[2] = "1=No;2=Nein" Texts[1] = "1=How do you want to call your installer?;2=Wie möchten Sie Ihren Installer nennen?" Texts[2] = "1=Version number:;2=Versionsnummer:" Texts[3] = "1=Name of the writer(optional):;2=Name des Autors(optional):" Texts[4] = "1=Which languages do you want for your installer?;2=In welchen Sprachen soll Ihr Installer sein?"" Texts[5] = "1=Do you want to create a sektop symbol after the installation?;2=Soll ein Desktopsymbol erstellt werden?" Texts[6] = "1=Do you want that the program starts after the installation automaticelly?;2=Soll das Programm nach der Installation automatisch gestartet werden?" Texts[7] = "1=Which background image do you want to use? Leave this field empty if you do not want to use a background image.;2=Welches Hintergrundbild möchten Sie benutzen? Lassen Sie dieses Feld frei, wenn Sie keines benutzen möchten." Texts[8] = "1=Which Icon do you want to use? Leave this field empty if you do not want to use an icon.;2=Welches Icon möchten Sie benutzen? Lassen Sie dieses Feld frei, wenn Sie kein Icon benutzen möchten." Texts[9] = "1=Which font do you want to use?;2=Welche Schriftart möchten Sie benutzen?" Texts[10] = "1=Here you can write additional information.;2=Hier können Sie zusätzliche Informationen verfassen." Texts[11] = "1=English;2=Englisch" Texts[12] = "1=German;2=Deutsch" EndSub Sub Main LDUtilities.Icon = Program.Directory + "\Icon.ico" GraphicsWindow.Width = 900 GraphicsWindow.Height = 700 gw = GraphicsWindow.Width gh = GraphicsWindow.Height GraphicsWindow.Left = Desktop.Width/2 - gw/2 GraphicsWindow.Top = Desktop.Height/2 - gh/2 GraphicsWindow.Title = "InstallTime" GraphicsWindow.BackgroundColor = "Silver" GraphicsWindow.BrushColor = "Black" GraphicsWindow.PenColor = "Black" GraphicsWindow.FontName = "Arial" GraphicsWindow.FontBold = "True" GraphicsWindow.FontSize = 10.5 Button[1] = Controls.AddButton(ButtonCap[1][Lang], 10, 10) 'Close Button Button[2] = Controls.AddButton(ButtonCap[2][Lang], 95, 10) 'Start Button Button[3] = Controls.AddButton(ButtonCap[3][Lang], 180, 10) 'Language Button Button[4] = Controls.AddButton(ButtonCap[4][Lang], gw-75, gh-35) 'Next Button Button[5] = Controls.AddButton(ButtonCap[5][Lang], gw-160, gh-35) 'Back Button 'Button[6] = Controls.AddButton(ButtonCap[6][Lang], 265, 10) 'About Button Controls.SetSize(Button[1], 65, 25) Controls.SetSize(Button[2], 65, 25) Controls.SetSize(Button[3], 65, 25) Controls.SetSize(Button[4], 65, 25) Controls.SetSize(Button[5], 65, 25) 'Controls.SetSize(Button[6], 60, 25) Controls.HideControl(Button[5]) EndSub Sub ShowText GraphicsWindow.FontBold = "False" GraphicsWindow.FontSize = 15 If side = 1 Then 'Allgemeines GraphicsWindow.DrawBoundText(10, 60, gw-20, Texts[1][Lang]) GraphicsWindow.DrawBoundText(10, 130, gw-20, Texts[2][Lang]) GraphicsWindow.DrawBoundText(10, 200, gw-20, Texts[3][Lang]) GraphicsWindow.DrawBoundText(10, 270, gw-20, Texts[4][Lang]) 'Hierunter Kontrollbuttons erstellen. GraphicsWindow.DrawBoundText(10, 340, gw-20, Texts[5][Lang]) GraphicsWindow.DrawBoundText(10, 410, gw-20, Texts[6][Lang]) GraphicsWindow.DrawBoundText(65, 295, gw-20, Texts[11][Lang]) GraphicsWindow.DrawBoundText(205, 295, gw-20, Texts[12][Lang]) ElseIf side = 2 Then 'Bilder, Schriftarten, etc. GraphicsWindow.DrawBoundText(10, 60, gw-20, Texts[7][Lang]) GraphicsWindow.DrawBoundText(10, 130, gw-20, Texts[8][Lang]) GraphicsWindow.DrawBoundText(10, 200, gw-20, Texts[9][Lang]) ElseIf side = 3 Then 'Readme GraphicsWindow.DrawBoundText(10, 60, gw-20, Texts[10][Lang]) EndIf EndSub Sub ShowBoxes 'SIDE 1 If side = 1 Then Box[1][1] = Controls.AddTextBox(10, 80) 'Die erste Ziffer ist für die Seite Box[1][2] = Controls.AddTextBox(10, 150) Box[1][3] = Controls.AddTextBox(10, 220) GraphicsWindow.FontBold = "True" GraphicsWindow.FontSize = 10.5 SButton[1] = Controls.AddButton("", 10, 290) SButton[2] = Controls.AddButton("", 10, 360) SButton[3] = Controls.AddButton("", 10, 430) SButton[4] = Controls.AddButton("", 150, 290) For i = 1 To Array.GetItemCount(SButton) If start2 = 0 Then Controls.SetButtonCaption(SButton[i], SButCap[1][Lang]) ElseIf start2 = 1 Then Controls.SetButtonCaption(SButton[i], SButCapNew[i][Lang]) EndIf EndFor GraphicsWindow.FontSize = 15 GraphicsWindow.FontBold = "False" Controls.SetSize(Box[1][1], 400, 25) Controls.SetSize(Box[1][2], 400, 25) Controls.SetSize(Box[1][3], 400, 25) Controls.SetSize(SButton[1], 50, 25) Controls.SetSize(SButton[2], 50, 25) Controls.SetSize(SButton[3], 50, 25) Controls.SetSize(SButton[4], 50, 25) Controls.HideControl(Box[2][1]) Controls.HideControl(Box[2][2]) Controls.HideControl(Box[2][3]) Controls.ShowControl(Box[1][1]) Controls.ShowControl(Box[1][2]) Controls.ShowControl(Box[1][3]) Controls.ShowControl(SButton[1]) Controls.ShowControl(SButton[2]) Controls.ShowControl(SButton[3]) Controls.ShowControl(SButton[4]) 'SIDE 2 ElseIf side = 2 Then Box[2][1] = Controls.AddTextBox(10, 80) Box[2][2] = Controls.AddTextBox(10, 150) Box[2][3] = Controls.AddTextBox(10, 220) Controls.SetSize(Box[2][1], 400, 25) Controls.SetSize(Box[2][2], 400, 25) Controls.SetSize(Box[2][3], 400, 25) Controls.HideControl(Box[1][1]) Controls.HideControl(Box[1][2]) Controls.HideControl(Box[1][3]) Controls.HideControl(Box[3][1]) Controls.HideControl(Box[3][2]) Controls.HideControl(Box[3][3]) Controls.HideControl(SButton[1]) Controls.HideControl(SButton[2]) Controls.HideControl(SButton[3]) Controls.HideControl(SButton[4]) Controls.ShowControl(Box[2][1]) Controls.ShowControl(Box[2][2]) Controls.ShowControl(Box[2][3]) 'SIDE 3 ElseIf side = 3 Then Box[3][1] = Controls.AddMultiLineTextBox(10, 80) Controls.SetSize(Box[3][1], gw-20, gh-135) Controls.HideControl(Box[2][1]) Controls.HideControl(Box[2][2]) Controls.HideControl(Box[2][3]) Controls.ShowControl(Box[3][1]) Controls.ShowControl(Box[3][2]) Controls.ShowControl(Box[3][3]) EndIf For i = 1 To Array.GetItemCount(Box) Controls.SetTextBoxText(Box[side][i], BoxText[side][i]) EndFor EndSub Sub BoxText If start = 0 Then For i = 1 To Array.GetItemCount(Box) BoxText[i][side] = "" EndFor EndIf EndSub Sub Clear brush = GraphicsWindow.BrushColor GraphicsWindow.BrushColor = GraphicsWindow.BackgroundColor GraphicsWindow.FillRectangle(0,0,gw,gh) GraphicsWindow.BrushColor = brush EndSub Sub BC LCB = Controls.LastClickedButton If LCB = Button[1] Then 'BEENDEN Program.End() ElseIf LCB = Button[2] Then 'INSTALLER BAUEN 'alle Daten in "*.*\Data\Settings.txt" speichern 'später wird hier noch die LDUtilities.Zip Funktion eingebaut. Aber erst muss die von LitDev optimiert werden. ElseIf LCB = Button[3] Then 'SPRACHE ÄNDERN 'zuvor alle eingaben zwischenspeichern If Lang = 1 Then Lang = 2 For i = 1 to Array.GetItemCount(Button) Controls.SetButtonCaption(Button[i], ButtonCap[i][2]) EndFor For ii = 1 to Array.GetItemCount(SButton) v = Controls.GetButtonCaption(SButton[ii]) If v = "Yes" Then Controls.SetButtonCaption(SButton[ii], SButCap[1][Lang]) ElseIf v = "No" Then Controls.SetButtonCaption(SButton[ii], SButCap[2][Lang]) EndIf EndFor ElseIf Lang = 2 Then Lang = 1 For i = 1 to Array.GetItemCount(Button) Controls.SetButtonCaption(Button[i], ButtonCap[i][1]) EndFor For ii = 1 to Array.GetItemCount(SButton) v = Controls.GetButtonCaption(SButton[ii]) If v = "Ja" Then Controls.SetButtonCaption(SButton[1][ii], SButCap[1][Lang]) ElseIf v = "Nein" Then Controls.SetButtonCaption(SButton[1][ii], SButCap[2][Lang]) EndIf EndFor EndIf Clear() ShowText() ElseIf LCB = Button[4] Then 'EINE SEITE VORWÄRTS T[side][1] = Controls.GetTextBoxText(Box[side][1]) T[side][2] = Controls.GetTextBoxText(Box[side][2]) T[side][3] = Controls.GetTextBoxText(Box[side][3]) BoxText[side][1] = T[side][1] BoxText[side][2] = T[side][2] BoxText[side][3] = T[side][3] SButCapNew[1][Lang] = Controls.GetButtonCaption(SButton[1]) SButCapNew[2][Lang] = Controls.GetButtonCaption(SButton[2]) SButCapNew[3][Lang] = Controls.GetButtonCaption(SButton[3]) SButCapNew[4][Lang] = Controls.GetButtonCaption(SButton[4]) side = side+1 start2 = 1 Clear() ShowText() ShowBoxes() If side = 3 Then Controls.HideControl(Button[4]) EndIf If side > 1 Then Controls.ShowControl(Button[5]) EndIf ElseIf LCB = Button[5] Then 'EINE SEITE ZURÜCK T[side][1] = Controls.GetTextBoxText(Box[side][1]) T[side][2] = Controls.GetTextBoxText(Box[side][2]) T[side][3] = Controls.GetTextBoxText(Box[side][3]) BoxText[side][1] = T[side][1] BoxText[side][2] = T[side][2] BoxText[side][3] = T[side][3] side = side-1 Clear() ShowText() ShowBoxes() If side < 3 Then Controls.ShowControl(Button[4]) EndIf If side = 1 Then Controls.HideControl(Button[5]) EndIf 'ElseIf LCB = Button[6] Then ElseIf LCB = SButton[1] Then 'SPEZIALBUTTON JA/NEIN CapLCB = Controls.GetButtonCaption(SButton[1]) If CapLCB = "Yes" Then Controls.SetButtonCaption(SButton[1], SButCap[2][Lang]) ElseIf CapLCB = "Ja" Then Controls.SetButtonCaption(SButton[1], SButCap[2][Lang]) ElseIf CapLCB = "No" Then Controls.SetButtonCaption(SButton[1], SButCap[1][Lang]) ElseIf CapLCB = "Nein" Then Controls.SetButtonCaption(SButton[1], SButCap[1][Lang]) EndIf ElseIf LCB = SButton[2] Then 'SPEZIALBUTTON JA/NEIN CapLCB = Controls.GetButtonCaption(SButton[2]) If CapLCB = "Yes" Then Controls.SetButtonCaption(SButton[2], SButCap[2][Lang]) ElseIf CapLCB = "Ja" Then Controls.SetButtonCaption(SButton[2], SButCap[2][Lang]) ElseIf CapLCB = "No" Then Controls.SetButtonCaption(SButton[2], SButCap[1][Lang]) ElseIf CapLCB = "Nein" Then Controls.SetButtonCaption(SButton[2], SButCap[1][Lang]) EndIf ElseIf LCB = SButton[3] Then 'SPEZIALBUTTON JA/NEIN CapLCB = Controls.GetButtonCaption(SButton[3]) If CapLCB = "Yes" Then Controls.SetButtonCaption(SButton[3], SButCap[2][Lang]) ElseIf CapLCB = "Ja" Then Controls.SetButtonCaption(SButton[3], SButCap[2][Lang]) ElseIf CapLCB = "No" Then Controls.SetButtonCaption(SButton[3], SButCap[1][Lang]) ElseIf CapLCB = "Nein" Then Controls.SetButtonCaption(SButton[3], SButCap[1][Lang]) ElseIf LCB = SButton[4] Then 'SPEZIALBUTTON JA/NEIN CapLCB = Controls.GetButtonCaption(SButton[4]) If CapLCB = "Yes" Then Controls.SetButtonCaption(SButton[4], SButCap[2][Lang]) ElseIf CapLCB = "Ja" Then Controls.SetButtonCaption(SButton[4], SButCap[2][Lang]) ElseIf CapLCB = "No" Then Controls.SetButtonCaption(SButton[4], SButCap[1][Lang]) ElseIf CapLCB = "Nein" Then Controls.SetButtonCaption(SButton[4], SButCap[1][Lang]) EndIf EndIf EndIf EndSub Sub TT start = 1 EndSub End>LJM030.sb< Start>LJM592.sb< ' Decimal to Binary converter LED ' 14 SEPT 2016 ' program by YLed ' program no: ledOFF=ImageList.LoadImage(" https://social.msdn.microsoft.com/Forums/getfile/863319") ledON=ImageList.LoadImage("https://social.msdn.microsoft.com/Forums/getfile/863320") main() Sub main graphicsWindow.Clear() ' cls GraphicsWindow.Title = "25 LED Decimal to Binary display" GraphicsWindow.top= 0 GraphicsWindow.left= 0 GraphicsWindow.Height = 600 GraphicsWindow.Width = 1100 GraphicsWindow.BackgroundColor="darkblue" GraphicsWindow.fontsize=30 GraphicsWindow.BrushColor = "white" GraphicsWindow.DrawBoundText (200,10,1000," 25 LED Decimal to Binary display") GraphicsWindow.fontsize=25 GraphicsWindow.BrushColor = "yellow" GraphicsWindow.DrawBoundText (10,200,600," Enter the decimal number:") GraphicsWindow.BrushColor = "black" enter_box = Controls.AddTextBox(400, 200) Controls.SetSize(enter_box,400,50) Controls.setTextBoxtext(enter_box,"") f=0 r=0 buttonclicked = 0 For q=1 to 25 GraphicsWindow.DrawImage(ledOFF,50+f,100+r) f=f+30 EndFor f=0 GraphicsWindow.FontSize = 18 GraphicsWindow.BrushColor = "red" button = Controls.AddButton(" COMPUTE binary display ", 450, 300) button2 = Controls.AddButton(" Reset ", 450, 350) Controls.ButtonClicked = Click endsub Sub Click If Controls.LastClickedButton = button Then decimal=Controls.getTextBoxText(enter_box) compute_binary() led_display() buttonclicked = 1 EndIf If Controls.LastClickedButton = button2 Then main() EndIf EndSub ' loop until compute button is press buttonloop: If buttonclicked = 0 Then Goto buttonloop Else buttonclicked = 0 EndIf Sub compute_binary for binary= 25 to 1 step-1 x[binary]=Math.Remainder(decimal,2) If x[binary]=0 Then x[binary]=0 Else x[binary]=1 EndIf decimal=math.Floor(decimal/2) endfor EndSub Sub led_display f=0 r=0 For binary = 1 To 25 Program.Delay(20) If x[binary] = 1 then GraphicsWindow.DrawImage(ledON,50+f,100+r) EndIf f=f+30 EndFor f=0 r=r+100 EndSub End>LJM592.sb< Start>LJN728.sb< TextWindow.BackgroundColor = "yellow" TextWindow.ForegroundColor = "red" TextWindow.Clear() TextWindow.Left = Desktop.Width/2 - 350 TextWindow.Top = Desktop.Height/2 - 200 TextWindow.WriteLine("Enter a number") num = TextWindow.ReadNumber() TextWindow.WriteLine("Enter some text") str = TextWindow.Read() TextWindow.CursorLeft = 10 TextWindow.ForegroundColor = "cyan" TextWindow.Write(num) TextWindow.CursorLeft = 30 TextWindow.ForegroundColor = "green" TextWindow.WriteLine(str) TextWindow.ForegroundColor = "black" End>LJN728.sb< Start>LJQ402.sb< ' SmallBasic Version 1.0 ' Funktion: Diacritics in Small Basic ' Autor: Samanthatraductora ' Herkunft: http://social.msdn.microsoft.com/Forums/en-US/84591fef-3367-4ef5-b7d4-2f8adda29801/diacritics-in-small-basic ' ImportURL: http://smallbasic.com/program/? ' Extension: LitDev, http://litdev.hostoi.com/downloads/LitDev_v1.0.zip ' Kommentar: ' ' Variablen: ' ' -------------------------------------------------------------------------------- FilePath = "C:\SmallBasic\localizeme_Spanish.txt" ' Insert next 2 lines after you have 'installed' LitDev.dll and restarted SmallBasic. ' Will create a converted copy of your ..\localizeme_Spanish.txt named localizeme_Spanish--UTF8.txt ' and then use this converted SB compatible file as source for localisation strings. ' The following line could be harmful and has been automatically commented. ' FilePathConv = LDFile.ANSItoUTF8(FilePath, "True") FilePath = FilePathConv ' The following line could be harmful and has been automatically commented. ' TextWindow.Title = File.ReadLine(FilePath,1) TextWindow.ForegroundColor = "DarkGreen" ' The following line could be harmful and has been automatically commented. ' TextWindow.WriteLine(File.ReadLine(FilePath,2) Name = TextWindow.Read() ' The following line could be harmful and has been automatically commented. ' TextWindow.WriteLine(File.ReadLine(FilePath,3) + Name + File.ReadLine(FilePath,4)) ' ??? GUESSED Hobbies = TextWindow.Read() ' The following line could be harmful and has been automatically commented. ' TextWindow.WriteLine(File.ReadLine(FilePath,5)) Write = TextWindow.Read() ' The following line could be harmful and has been automatically commented. ' TextWindow.WriteLine(File.ReadLine(FilePath,6) + Clock.Date) End>LJQ402.sb< Start>LJQ600.sb< ' Simpleton HillBilly Lottery Straight-to-the-Point Tackling '******************************************************** TAB = Text.GetCharacter( 9) LF = Text.GetCharacter(10) Lottery: TextWindow.Clear() TextWindow.Write("Min Random Range: ") PickMin = Math.Floor( TextWindow.ReadNumber() ) TextWindow.Write(LF + "Max Random Range: ") PickMax = Math.Floor( TextWindow.ReadNumber() ) If PickMax < PickMin Then Sound.PlayBellRing() TextWindow.WriteLine(LF + "Max Range can't be lower than Min Range !!!") TextWindow.Pause() Goto Lottery EndIf TextWindow.Write(LF + "How many picks at once? ") NumTimes = Math.Abs( Math.Floor( TextWindow.ReadNumber() ) ) If NumTimes <= 0 Then NumTimes = 1 EndIf TextWindow.Clear() PickReset() PickCheck() While PickLeft > 0 For Lottery = 1 To NumTimes PickRandom() Number[Lottery] = PickNumber EndFor For Lottery = 1 To NumTimes TextWindow.Write(Number[Lottery] + TAB) EndFor TextWindow.WriteLine(LF + "Left: " + (PickLeft-1)) TextWindow.Pause() TextWindow.WriteLine("") EndWhile Goto Lottery '=================================================================' Sub PickRandom '--- Randomly picks a not yet drawn number between PickMin & PickMax range '--- Drawn numbers are flagged as picked in PickDrawn[] w/ value = 1 '--- Returns: PickNumber (PickNumber = "" if all is already picked up) PickRange = PickMax - PickMin PickCheck() ' Checks up how many numbers not marked as drawn is left If PickLeft > 0 Then ' If any still available, proceed to randomly choose one Picking = "True" While Picking PickNumber = Math.GetRandomNumber(PickRange+1) + PickMin-1 If PickDrawn[PickNumber] = "" Then PickDrawn [PickNumber] = 1 ' Flags index number as picked! Picking = "False" ' Flags to stop While Loop EndIf EndWhile Else PickNumber = "" ' It means all numbers within this range are taken EndIf EndSub '----------------------------------------------------------------------------------------------------------------' Sub PickCheck PickLeft = 0 For PickNumber = PickMin To PickMax If PickDrawn[PickNumber] = "" Then PickLeft = PickLeft + 1 EndIf EndFor EndSub '----------------------------------------------------------------------------------------------------------------' Sub PickReset PickDrawn = "" EndSub '----------------------------------------------------------------------------------------------------------------' End>LJQ600.sb< Start>LJR211.sb< TextWindow.Title = "이름입력기XL + 재밌는 퀴즈 (버전1.01)" TextWindow.WriteLine(" 제작자 : 전창민") TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.Write("이름 : ") 이름 = TextWindow.Read() TextWindow.WriteLine(이름 + "님 이시군요 맞으시죠. : 엔터 ") TextWindow.Pause() TextWindow.WriteLine(이름 + "님이 아니시면 1번 맞으시면 2번을 입력하세요.") a = TextWindow.ReadNumber() TextWindow.Clear() If 1= a Then TextWindow.WriteLine(이름 + "님이 아니시군요 다시 이름을 입력해주세요.") TextWindow.Write(" 이름 : ") 이름1= TextWindow.Read() TextWindow.WriteLine("아항 " + 이름1+ " 님이시군요.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(이름1 + "님 이름 입력기는 여기까지...") Else TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 아항 " + 이름 + " 님 이시군요 ") TextWindow.WriteLine(이름 + "님 이름 입력기는 여기까지...") EndIf TextWindow.Clear() TextWindow.WriteLine("1. : * 아몬드가 죽으면? * " ) TextWindow.Write("정답 : ") b = TextWindow.Read() If b = "다이아몬드" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("1. : * 아몬드가 죽으면? * " ) TextWindow.Write("정답 : ") b1 = TextWindow.Read() If b1 = "다이아몬드" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("1. : * 아몬드가 죽으면? * " ) TextWindow.Write("정답 : ") b2 = TextWindow.Read() If b2 = "다이아몬드" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'다이아몬드'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("2. : * 펭귄이다니는 고등학교는? * " ) TextWindow.Write("정답 : ") c = TextWindow.Read() If c = "냉장고" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("2. : * 펭귄이다니는 고등학교는? * " ) TextWindow.Write("정답 : ") c1 = TextWindow.Read() If c1 = "냉장고" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("2. : *펭귄이다니는 고등학교는? * " ) TextWindow.Write("정답 : ") c2 = TextWindow.Read() If c2 = "냉장고" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'냉장고'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("3. : * 자가용의 반대말은? * " ) TextWindow.Write("정답 : ") d = TextWindow.Read() If d = "커용" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("3. : * 자가용의 반대말은? * " ) TextWindow.Write("정답 : ") d1 = TextWindow.Read() If d1 = "커용" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("3. : * 자가용의 반대말은? * " ) TextWindow.Write("정답 : ") d2 = TextWindow.Read() If d2 = "커용" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'커용'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("4. : * 사과가 웃으면? * " ) TextWindow.Write("정답 : ") e = TextWindow.Read() If e = "풋사과" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("4. : * 사과가 웃으면? * " ) TextWindow.Write("정답 : ") e1 = TextWindow.Read() If e1 = "풋사과" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("4. : * 사과가 웃으면? * " ) TextWindow.Write("정답 : ") e2 = TextWindow.Read() If e2 = "풋사과" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'풋사과'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("5. : * 대통령선거의 반대말은? * " ) TextWindow.Write("정답 : ") f = TextWindow.Read() If f = "대통령 앉은거" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("5. : * 대통령선거의 반대말은? * " ) TextWindow.Write("정답 : ") f1 = TextWindow.Read() If f1 = "대통령 앉은거" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("5. : * 대통령선거의 반대말은? * " ) TextWindow.Write("정답 : ") f2 = TextWindow.Read() If f2 = "대통령 앉은거" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'대통령 앉은거'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g = TextWindow.Read() If g = "이쑤시개" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g1 = TextWindow.Read() If g1 = "이쑤시개" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g2 = TextWindow.Read() If g2 = "이쑤시개" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'이쑤시개'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("7. : * 가장 오래된 망고는? * " ) TextWindow.Write("정답 : ") h = TextWindow.Read() If h = "할망고" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("7. : * 가장 오래된 망고는? * " ) TextWindow.Write("정답 : ") h1 = TextWindow.Read() If h1 = "할망고" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔���.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("7. : * 가장 오래된 망고는? * " ) TextWindow.Write("정답 : ") h2 = TextWindow.Read() If h2 = "할망고" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'할망고'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("8. : * 라면은라면인데 달콤한 라면은? * " ) TextWindow.Write("정답 : ") i = TextWindow.Read() If i = "그대와 함께라면" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("8. : * 라면은라면인데 달콤한 라면은? * " ) TextWindow.Write("정답 : ") i1 = TextWindow.Read() If i1 = "그대와 함께라면" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("8. : * 라면은라면인데 달콤한 라면은? * " ) TextWindow.Write("정답 : ") i2 = TextWindow.Read() If i2 = "그대와 함께라면" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'그대와 함께라면'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("9. : * 신이화나면? * " ) TextWindow.Write("정답 : ") j = TextWindow.Read() If j = "신발끈" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하��요! ") TextWindow.WriteLine("9. : * 신이화나면? * " ) TextWindow.Write("정답 : ") j1 = TextWindow.Read() If j1 = "신발끈" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("9. : * 신이화나면? * " ) TextWindow.Write("정답 : ") j2 = TextWindow.Read() If j2 = "신발끈" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'신발끈'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("10. : * 사람의 몸무게가 제일 무거울때는? * " ) TextWindow.Write("정답 : ") k = TextWindow.Read() If k = "철들때" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("10. : * 사람의 몸무게가 제일 무거울때는? * " ) TextWindow.Write("정답 : ") k1 = TextWindow.Read() If k1 = "철들때" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("10. : * 사람의 몸무게가 제일 무거울때는? * " ) TextWindow.Write("정답 : ") k2 = TextWindow.Read() If k2 = "철들때" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'철들때'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("11. : * 둘리가 가는 고등학교는? * " ) TextWindow.Write("정답 : ") l = TextWindow.Read() If l = "요리보고" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("11. : * 둘리가 가는 고등학교는? * " ) TextWindow.Write("정답 : ") l1 = TextWindow.Read() If l1 = "요리보고" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("11. : * 둘리가 가는 고등학교는? * " ) TextWindow.Write("정답 : ") l2 = TextWindow.Read() If l2 = "요리보고" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'요리보고'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("12. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") m = TextWindow.Read() If g = "이쑤시개" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("12. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") m1 = TextWindow.Read() If m1 = "이쑤시개" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("12. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") m2 = TextWindow.Read() If m2 = "이쑤시개" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'이쑤시개'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("7. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g = TextWindow.Read() If g = "이쑤시개" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 ���마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g1 = TextWindow.Read() If g1 = "이쑤시개" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g2 = TextWindow.Read() If g2 = "이쑤시개" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'이쑤시개'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("7. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g = TextWindow.Read() If g = "이쑤시개" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g1 = TextWindow.Read() If g1 = "이쑤시개" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 ���는? * " ) TextWindow.Write("정답 : ") g2 = TextWindow.Read() If g2 = "이쑤시개" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'이쑤시개'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("7. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g = TextWindow.Read() If g = "이쑤시개" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g1 = TextWindow.Read() If g1 = "이쑤시개" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g2 = TextWindow.Read() If g2 = "이쑤시개" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'이쑤시개'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("7. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g = TextWindow.Read() If g = "이쑤시개" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g1 = TextWindow.Read() If g1 = "이쑤시개" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마�� 따라오는 개는? * " ) TextWindow.Write("정답 : ") g2 = TextWindow.Read() If g2 = "이쑤시개" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'이쑤시개'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("7. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g = TextWindow.Read() If g = "이쑤시개" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g1 = TextWindow.Read() If g1 = "이쑤시개" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g2 = TextWindow.Read() If g2 = "이쑤시개" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'이쑤시개'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("7. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g = TextWindow.Read() If g = "이쑤시개" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g1 = TextWindow.Read() If g1 = "이쑤시개" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g2 = TextWindow.Read() If g2 = "이쑤시개" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'이쑤시개'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("7. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g = TextWindow.Read() If g = "이쑤시개" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g1 = TextWindow.Read() If g1 = "이쑤시개" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g2 = TextWindow.Read() If g2 = "이쑤시개" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'이쑤시개'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("7. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g = TextWindow.Read() If g = "이쑤시개" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g1 = TextWindow.Read() If g1 = "이쑤시개" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g2 = TextWindow.Read() If g2 = "이쑤시개" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'이쑤시개'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("7. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g = TextWindow.Read() If g = "이쑤시개" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" ��시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g1 = TextWindow.Read() If g1 = "이쑤시개" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g2 = TextWindow.Read() If g2 = "이쑤시개" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'이쑤시개'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("7. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g = TextWindow.Read() If g = "이쑤시개" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g1 = TextWindow.Read() If g1 = "이쑤시개" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g2 = TextWindow.Read() If g2 = "이쑤시개" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'이쑤시개'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("7. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g = TextWindow.Read() If g = "이쑤시개" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g1 = TextWindow.Read() If g1 = "이쑤시개" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g2 = TextWindow.Read() If g2 = "이쑤시개" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'이쑤시개'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("7. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g = TextWindow.Read() If g = "이쑤시개" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g1 = TextWindow.Read() If g1 = "이쑤시개" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 ��세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g2 = TextWindow.Read() If g2 = "이쑤시개" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'이쑤시개'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("7. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g = TextWindow.Read() If g = "이쑤시개" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g1 = TextWindow.Read() If g1 = "이쑤시개" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g2 = TextWindow.Read() If g2 = "이쑤시개" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'이쑤시개'���었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("7. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g = TextWindow.Read() If g = "이쑤시개" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g1 = TextWindow.Read() If g1 = "이쑤시개" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g2 = TextWindow.Read() If g2 = "이쑤시개" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'이쑤시개'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("7. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g = TextWindow.Read() If g = "이쑤시개" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g1 = TextWindow.Read() If g1 = "이쑤시개" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g2 = TextWindow.Read() If g2 = "이쑤시개" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'이쑤시개'이었습니다. ") EndIf EndIf EndIf TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("7. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g = TextWindow.Read() If g = "이쑤시개" Then TextWindow.WriteLine(" ^^맞혔군요. :엔터.") Else TextWindow.WriteLine("ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g1 = TextWindow.Read() If g1 = "이쑤시개" Then TextWindow.WriteLine(" 이번엔 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 또 다시 하세요! ") TextWindow.WriteLine("6. : * 고기 먹을 떄마다 따라오는 개는? * " ) TextWindow.Write("정답 : ") g2 = TextWindow.Read() If g2 = "이쑤시개" Then TextWindow.WriteLine(" 드디어 ^^맞혔군요. :엔터.") Else TextWindow.WriteLine(" 휴 ~ 또 ㅠㅠ틀렸네요. :엔터.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine(" 정답은 바로!'이쑤시개'이었습니다. ") EndIf EndIf EndIf End>LJR211.sb< Start>LJS042.sb< 'LDGraphicsWindow.TransparentGW() GraphicsWindow.BackgroundColor ="#7700aaaa GraphicsWindow.Left =10 GraphicsWindow.Top=10 GraphicsWindow.Width=1660 GraphicsWindow.Height=1020 GraphicsWindow.Title="3D ObjLogo" LDUtilities.ShowErrors="false LDUtilities.ShowNoShapeErrors="false bgcl="teal dw=900 dh=dw 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,"","","") sf=1 pf=1 sset() penn="true args=0 ell=1 zang=0 j=0 zf=2 i=180 bw=700 bh=bw dd=55 xb=50 omod=0 acc() Sub replv For v=1 To 9 ct= LDText.Replace (ct,"%"+v,var[v]) endfor ct= LDText.Replace (ct,"%ss",lstp) endsub Sub mdd If Mouse.IsRightButtonDown Then LDControls.RichTextBoxSetText (bb, "cf "+GraphicsWindow.MouseX+";"+GraphicsWindow.MouseY,"true" ) Else If FCKeyboard.IsControlPressed Then LDControls.RichTextBoxSetText (bb,"obon","true") EndIf LDControls.RichTextBoxSetText (bb,"m2 "+GraphicsWindow.MouseX+" "+GraphicsWindow.MouseY,"true") If FCKeyboard.IsShiftPressed then LDControls.RichTextBoxSetText (bb,"oboff","true") EndIf GraphicsWindow.SetPixel(GraphicsWindow.MouseX,GraphicsWindow.MouseY,"white") endif EndSub Sub runprg nln=text.GetCharacter (13)+Text.GetCharacter(10) GraphicsWindow.Title="Running Objlogo script..." tt= ldControls.RichTextBoxGetText (bb) cc= LDText.Split (tt, nln ) x=1 ll=1 while x<= Array.GetItemCount (cc) ct= text.ConvertToLowerCase (LDText.Trim(cc[x])) replv() ctc= LDText.Split (ct," ") If ctc[1]="sq" Then For r=1 To 4 ldcall.Function ("t_Move",ctc[2]) T_TurnRight() endfor ElseIf ctc[1]="set" or ctc[1]="~" Then var[ctc[2]]=ctc[3] ElseIf ctc[1]="tr" or ctc[1]="`3" Then For r=1 To 3 ldcall.Function ("t_Move",ctc[2]) T_Angle =T_Angle +120 endfor ElseIf ctc[1]="add" or ctc[1]="++" Then var[ctc[2]]=var[ctc[2]]+ctc[3] ElseIf ctc[1]="mul" or ctc[1]="**" Then var[ctc[2]]=var[ctc[2]]*ctc[3] ElseIf ctc[1]="div" or ctc[1]="//" Then var[ctc[2]]=var[ctc[2]]/ctc[3] ElseIf ctc[1]="hx" or ctc[1]="`6" Then For r=1 To 6 ldcall.Function ("t_Move",ctc[2]) T_Angle =T_Angle +60 endfor ElseIf ctc[1]="s" or ctc[1]="^" Then If ctc[2]=0 then sf=1 Else sf=sf*ctc[2] endif ElseIf ctc[1]="ss" or ctc[1]="^/" Then sf=sf/ctc[2] If ss=0 then ss=1 EndIf ElseIf ctc[1]="pg" or ctc[1]="``" Then as=360/ctc[3] alm=ctc[4] If alm=0 then alm=1 endif ea=0 For r=1 To ctc[3] ldcall.Function ("t_Move",ctc[2]) T_Angle =t_Angle +as ea=ea+as/360 If ea>=alm then Goto xf endif endfor xf: elseif ctc[1]="rc" or ctc[1]="`4" Then For r=1 To 4 If Math.Remainder (r-1,2)=0 then ldcall.Function ("t_Move",ctc[2]) Else ldcall.Function ("t_Move",ctc[3]) EndIf T_TurnRight() endfor ElseIf ctc[1]="lp" or ctc[1]="{" Then li[ll]=x+1 lr[ll]=ctc[2]-1 lstp=lr[ll] ll=ll+1 ElseIf ctc[1]="elp" or ctc[1]="}" then if lr[ll-1] >0 Then lr[ll-1]=lr[ll-1]-1 x=li[ll-1]-1 lstp=lr[ll-1] 'TextWindow.WriteLine ("$:"+lstp) Else ll=ll-1 endif ElseIf ctc[1]="sp" Then 'Turtle.Speed =ctc[2] ElseIf ctc[1]="cf" or ctc[1]="\\" Then pp=ldtext.Split (ctc[2],";") clr=ctc[3] If Text.StartsWith (clr,"$") then clr= LDColours.HSLtoRGB(Text.GetSubText (clr,2,3),1,Text.GetSubText (clr,5,2)/100) elseIf clr="" then clr= LDColours.HSLtoRGB(hu,0.9,0.6) hu=hu+25 endif ElseIf ctc[1]="an" Then T_Angle =t_Angle +ctc[2] ElseIf ctc[1]="obon" or ctc[1]="!!" Then dt=0 xi=1 omod=1 ElseIf ctc[1]="oboff" or ctc[1]="!#" Then ssh=LDShapes.AddPolygon (dt) clr=ctc[2] If Text.StartsWith (clr,"$") then clr= LDColours.HSLtoRGB(Text.GetSubText (clr,2,3),1,Text.GetSubText (clr,5,2)/100) endif LDShapes.BrushColour (ssh,clr) ElseIf ctc[1]="aa" Then T_Angle =ctc[2] ElseIf ctc[1]="m" or ctc[1]=">" Then ldcall.Function ("t_Move",ctc[2]*sf) ElseIf ctc[1]="m2" or ctc[1]=">>" Then ldcall.Function2 ("t_Move2",ctc[2],ctc[3]) ElseIf ctc[1]="m3" or ctc[1]=">>>" Then ell=ctc[3] ldcall.Function ("t_Move1",ctc[2]*sf) ElseIf ctc[1]="wp" Then GraphicsWindow.BrushColor =ctc[2] ElseIf ctc[1]="pend" Then Goto pend ElseIf ctc[1]="wf" Then GraphicsWindow.FontName =ldtext.Replace (ctc[2],"_"," ") GraphicsWindow.FontSize =ctc[3] GraphicsWindow.FontBold =ctc[4] GraphicsWindow.FontItalic =ctc[5] ElseIf ctc[1]="wt" or ctc[1]="##" Then GraphicsWindow.DrawText (ctc[2],ctc[3],ctc[4]) ElseIf ctc[1]="pu" Then penn="false ElseIf ctc[1]="go" or ctc[1]="<<" Then xy=LDCall.Function2 ("findp",ctc[2],":") If xy>0 then ' TextWindow.WriteLine (xy) x=xy Goto xx Else TextWindow.WriteLine("miss:"+ctc[2]) endif ElseIf ctc[1]="call" or ctc[1]="[[" Then rtln[rl]=x+1 rl=rl+1 xy=LDCall.Function2 ("findp",ctc[2],"#") If xy>0 then ' TextWindow.WriteLine (xy) x=xy Goto xx Else TextWindow.WriteLine("miss:"+ctc[2]) endif ElseIf ctc[1]="ret" or ctc[1]="c9" Then rl=rl-1 x=rtln[rl] Goto xx ElseIf ctc[1]="dr3d" Then ' ok= LD3DView.AddCube (view3D 1 "red" "E") oo=LD3DView.AddTube(view3D,st,1 ,20,"yellow","D") LD3DView.AutoControl ("true" "true" ,-1 3) ElseIf ctc[1]="pd" Then penn="true ElseIf ctc[1]="bg" Then bgcl=ctc[2] ElseIf ctc[1]="hm" Then T_x=0 T_y=0 T_Angle =0 ElseIf ctc[1]="pc" Then GraphicsWindow.PenColor=ctc[2] GraphicsWindow.PenWidth=ctc[3] ElseIf ctc[1]="cls" Then GraphicsWindow.PenWidth =1 GraphicsWindow.PenColor ="black GraphicsWindow.BrushColor=bgcl 'GraphicsWindow.FillRectangle (0,0,900,900) bgcl="teal t_x=0 t_y=0 ElseIf ctc[1]="de" Then Program.Delay (ctc[2]) endif x=x+1 xx: EndWhile pend: GraphicsWindow.Title=" Objlogo done.)" EndSub Sub findp RETURN=0 for ff=1 To Array.GetItemCount (cc) ctx=ldtext.Trim (cc[ff]) If ctx=args[2]+text.ConvertToLowerCase (args[1]) Then RETURN=ff+1 'TextWindow.WriteLine (RETURN ) Goto rrr EndIf EndFor rrr: endsub sub sset GraphicsWindow.PenColor="black GraphicsWindow.PenWidth=1 bb=ldControls.AddRichTextBox (180,860) Controls.Move (bb,1480,35) rb=Controls.AddButton (" Run ... ",900,5) rb1=Controls.AddButton (" Cls ",970,5) rb2=Controls.AddButton (" New ",1030,5) hh=Controls.AddButton ("?",1080,5) Controls.ButtonClicked =bcc nln=Text.GetCharacter (13)+Text.GetCharacter (10) tyy[0]="s 0|aa 0|cls|lp 7| set 1 0.1|| lp 60| m %1| mul 1 1.1| an 5| elp| | an 100| | lp 60| m %1| div 1 1.12| an 5| elp| | an 72|elp tyy[0]=tyy[0]+"|dr3d| tyy[1]="cls|s 0|s 2|hm|an 45|lp 77|s 1.025|an 91.5|m 40|elp|dr3d ty=LDText.Replace (tyy[0],"|",nln) If pf=0 Then ty="aa 0"+nln endif LDControls.RichTextBoxClear (bb) LDControls.RichTextBoxFontBackground="lightgray LDControls.RichTextBoxFontFamily="Lucida console LDControls.RichTextBoxFontSize=16 LDControls.RichTextBoxDefault(bb) ldControls.RichTextBoxSetText (bb,ty,"false" ) lb=LDControls.AddComboBox(LDText.Split("Magic flower|Scale","|"),200,100) Controls.Move (lb,1100,5) LDControls.ComboBoxItemChanged =lbc T_x=0 T_y=0 opx=t_x opy=t_y hu=0 EndSub Sub lbc ic= LDControls.LastComboBoxIndex-1 ty=LDText.Replace (tyy[ic],"|",Text.GetCharacter (13)+Text.GetCharacter (10)) ldControls.RichTextBoxSetText (bb,ty,"False" ) EndSub sub acc Goto ccc idh=LDWindows.Create() clb=Controls.AddButton ("close",0,0) LDUtilities .gwStyle="none GraphicsWindow.Hide () LDWindows.Active=0 ccc: EndSub Sub bcc lb= Controls.LastClickedButton If lb=rb Then runprg() ElseIf lb=rb1 Then tt= ldControls.RichTextBoxGetText (bb) GraphicsWindow.Clear () sset () ldControls.RichTextBoxSetText (bb,tt,"False") ElseIf lb=hh Then LDWindows.Active =idh GraphicsWindow.Show () 'LDWindows.Activated=acc ElseIf lb=clb Then LDWindows.Active =idh GraphicsWindow.Hide () LDWindows.Active=0 Else 'rb2 GraphicsWindow.Clear () pf=0 sset () EndIf EndSub Sub t_TurnRight t_Angle =t_Angle +90 EndSub Sub t_TurnLeft t_Angle =t_Angle -90 EndSub Sub zmove ell=ell+args[1]*LDMath.Sin(zang)/30 endsub sub t_Move mm=LDMath.Convert2Cartesian (t_x,t_y,args[1] t_Angle-90 ) t_x= (mm[1]) t_y= (mm[2]) st=st+": "+t_x+" "+T_y+" "+0+" " EndSub End>LJS042.sb< Start>LJS543.sb< 'WINDOW dw = Desktop.Width dh = Desktop.Height left = ((dw - 700) / 2) info = left + 100 gray = GraphicsWindow.GetColorFromRGB(80, 80, 80) GraphicsWindow.Left = (dw - 624) / 2 GraphicsWindow.Top = (dh - 444) / 2 GraphicsWindow.Title = "Videogames Database" 'CURRENT_SHEET cs = Controls.AddButton("1", 0, 0) Controls.HideControl(cs) 'TOP GraphicsWindow.BrushColor = "gray" GraphicsWindow.FillRectangle(0, 0, dw, 150) GraphicsWindow.BrushColor = "white" GraphicsWindow.FontBold = "false" GraphicsWindow.FontSize = 30 GraphicsWindow.DrawText(left + 205, 50, "Videogames Database") 'TITLE GraphicsWindow.PenWidth = 1 GraphicsWindow.PenColor = "goldenrod" GraphicsWindow.BrushColor = gray back = Shapes.AddRectangle(35, 35) Shapes.Move(back, ((dw - length) / 2) - 14, 180) GraphicsWindow.BrushColor = "yellow" GraphicsWindow.FontSize = 20 title = Shapes.AddText("1") length = Text.GetLength(title) Shapes.Move(title, (dw - length) / 2, 185) 'BACK GraphicsWindow.BrushColor = "dimgray" GraphicsWindow.FillRectangle(left, 150, 700, dh) GraphicsWindow.PenColor = gray GraphicsWindow.DrawLine(left, 150, left + 700, 150) GraphicsWindow.BrushColor = "white" GraphicsWindow.FontSize = 15 GraphicsWindow.DrawText(left + 100, 250, "Name:") GraphicsWindow.DrawText(left + 100, 300, "Genre:") GraphicsWindow.DrawText(left + 100, 350, "Size:") GraphicsWindow.DrawText(left + 100, 400, "Year:") GraphicsWindow.DrawText(left + 100, 450, "Sequel:") GraphicsWindow.DrawText(left + 100, 500, "Company:") GraphicsWindow.DrawText(left + 100, 550, "Rating:") 'TEXT_BOXES GraphicsWindow.BrushColor = "black" GraphicsWindow.FontSize = 14 t1 = Controls.AddTextBox(left + 200, 250) Controls.SetSize(t1, 380, 26) Controls.SetTextBoxText(t1, "World of Warcraft") t2 = Controls.AddTextBox(left + 200, 300) Controls.SetSize(t2, 380, 26) Controls.SetTextBoxText(t2, "MMORPG") t3 = Controls.AddTextBox(left + 200, 350) Controls.SetSize(t3, 380, 26) Controls.SetTextBoxText(t3, "24 Gb") t4 = Controls.AddTextBox(left + 200, 400) Controls.SetSize(t4, 380, 26) Controls.SetTextBoxText(t4, 2004) t5 = Controls.AddTextBox(left + 200, 450) Controls.SetSize(t5, 380, 26) Controls.SetTextBoxText(t5, "Inspired by [ Warcraft III ]") t6 = Controls.AddTextBox(left + 200, 500) Controls.SetSize(t6, 380, 26) Controls.SetTextBoxText(t6, "Blizzard Entertainment") t7 = Controls.AddTextBox(left + 200, 550) Controls.SetSize(t7, 380, 26) Controls.SetTextBoxText(t7, "5/5") 'SHEETS GraphicsWindow.PenColor = "yellow" indi = Shapes.AddRectangle(37, 32) Shapes.Move(indi, left + 99, 634) s1 = Controls.AddButton("1", left + 100, 635) Controls.SetSize(s1, 35, 30) s2 = Controls.AddButton("2", left + 150, 635) Controls.SetSize(s2, 35, 30) s3 = Controls.AddButton("3", left + 200, 635) Controls.SetSize(s3, 35, 30) s4 = Controls.AddButton("4", left + 250, 635) Controls.SetSize(s4, 35, 30) s5 = Controls.AddButton("5", left + 300, 635) Controls.SetSize(s5, 35, 30) s6 = Controls.AddButton("6", left + 350, 635) Controls.SetSize(s6, 35, 30) s7 = Controls.AddButton("7", left + 400, 635) Controls.SetSize(s7, 35, 30) s8 = Controls.AddButton("8", left + 450, 635) Controls.SetSize(s8, 35, 30) s9 = Controls.AddButton("9", left + 500, 635) Controls.SetSize(s9, 35, 30) s10 = Controls.AddButton("10", left + 550, 635) Controls.SetSize(s10, 35, 30) 'COMMANDS clear = Controls.AddButton("Clear", left + 100, 595) Controls.SetSize(clear, 85, 30) Controls.HideControl(clear) save = Controls.AddButton("Save", left + 200, 595) Controls.SetSize(save, 85, 30) Controls.HideControl(save) 'IF_STATEMENTS 'BUTTON_DOWN Controls.ButtonClicked = bc Sub bc lcb = Controls.LastClickedButton gcs = Controls.GetButtonCaption(cs) 'DEFAULT_TITLE Shapes.Move(title, (dw - length) / 2, 185) 'SAVE If gcs = 2 Then If lcb = save Then Sound.PlayClick() gt21 = Controls.GetTextBoxText(t1) gt22 = Controls.GetTextBoxText(t2) gt23 = Controls.GetTextBoxText(t3) gt24 = Controls.GetTextBoxText(t4) gt25 = Controls.GetTextBoxText(t5) gt26 = Controls.GetTextBoxText(t6) gt27 = Controls.GetTextBoxText(t7) EndIf EndIf If gcs = 3 Then If lcb = save Then Sound.PlayClick() gt31 = Controls.GetTextBoxText(t1) gt32 = Controls.GetTextBoxText(t2) gt33 = Controls.GetTextBoxText(t3) gt34 = Controls.GetTextBoxText(t4) gt35 = Controls.GetTextBoxText(t5) gt36 = Controls.GetTextBoxText(t6) gt37 = Controls.GetTextBoxText(t7) EndIf EndIf If gcs = 4 Then If lcb = save Then Sound.PlayClick() gt41 = Controls.GetTextBoxText(t1) gt42 = Controls.GetTextBoxText(t2) gt43 = Controls.GetTextBoxText(t3) gt44 = Controls.GetTextBoxText(t4) gt45 = Controls.GetTextBoxText(t5) gt46 = Controls.GetTextBoxText(t6) gt47 = Controls.GetTextBoxText(t7) EndIf EndIf If gcs = 5 Then If lcb = save Then Sound.PlayClick() gt51 = Controls.GetTextBoxText(t1) gt52 = Controls.GetTextBoxText(t2) gt53 = Controls.GetTextBoxText(t3) gt54 = Controls.GetTextBoxText(t4) gt55 = Controls.GetTextBoxText(t5) gt56 = Controls.GetTextBoxText(t6) gt57 = Controls.GetTextBoxText(t7) EndIf EndIf If gcs = 6 Then If lcb = save Then Sound.PlayClick() gt61 = Controls.GetTextBoxText(t1) gt62 = Controls.GetTextBoxText(t2) gt63 = Controls.GetTextBoxText(t3) gt64 = Controls.GetTextBoxText(t4) gt65 = Controls.GetTextBoxText(t5) gt66 = Controls.GetTextBoxText(t6) gt67 = Controls.GetTextBoxText(t7) EndIf EndIf If gcs = 7 Then If lcb = save Then Sound.PlayClick() gt71 = Controls.GetTextBoxText(t1) gt72 = Controls.GetTextBoxText(t2) gt73 = Controls.GetTextBoxText(t3) gt74 = Controls.GetTextBoxText(t4) gt75 = Controls.GetTextBoxText(t5) gt76 = Controls.GetTextBoxText(t6) gt77 = Controls.GetTextBoxText(t7) EndIf EndIf If gcs = 8 Then If lcb = save Then Sound.PlayClick() gt81 = Controls.GetTextBoxText(t1) gt82 = Controls.GetTextBoxText(t2) gt83 = Controls.GetTextBoxText(t3) gt84 = Controls.GetTextBoxText(t4) gt85 = Controls.GetTextBoxText(t5) gt86 = Controls.GetTextBoxText(t6) gt87 = Controls.GetTextBoxText(t7) EndIf EndIf If gcs = 9 Then If lcb = save Then Sound.PlayClick() gt91 = Controls.GetTextBoxText(t1) gt92 = Controls.GetTextBoxText(t2) gt93 = Controls.GetTextBoxText(t3) gt94 = Controls.GetTextBoxText(t4) gt95 = Controls.GetTextBoxText(t5) gt96 = Controls.GetTextBoxText(t6) gt97 = Controls.GetTextBoxText(t7) EndIf EndIf If gcs = 10 Then If lcb = save Then Sound.PlayClick() gt101 = Controls.GetTextBoxText(t1) gt102 = Controls.GetTextBoxText(t2) gt103 = Controls.GetTextBoxText(t3) gt104 = Controls.GetTextBoxText(t4) gt105 = Controls.GetTextBoxText(t5) gt106 = Controls.GetTextBoxText(t6) gt107 = Controls.GetTextBoxText(t7) EndIf EndIf 'CLEAR If gcs = 2 Then If lcb = clear Then Sound.PlayClick() cleartbs() gt21 = "" gt22 = "" gt23 = "" gt24 = "" gt25 = "" gt26 = "" gt27 = "" EndIf EndIf If gcs = 3 Then If lcb = clear Then Sound.PlayClick() cleartbs() gt31 = "" gt32 = "" gt33 = "" gt34 = "" gt35 = "" gt36 = "" gt37 = "" EndIf EndIf If gcs = 4 Then If lcb = clear Then Sound.PlayClick() cleartbs() gt41 = "" gt42 = "" gt43 = "" gt44 = "" gt45 = "" gt46 = "" gt47 = "" EndIf EndIf If gcs = 5 Then If lcb = clear Then Sound.PlayClick() cleartbs() gt51 = "" gt52 = "" gt53 = "" gt54 = "" gt55 = "" gt56 = "" gt57 = "" EndIf EndIf If gcs = 6 Then If lcb = clear Then Sound.PlayClick() cleartbs() gt61 = "" gt62 = "" gt63 = "" gt64 = "" gt65 = "" gt66 = "" gt67 = "" EndIf EndIf If gcs = 7 Then If lcb = clear Then Sound.PlayClick() cleartbs() gt71 = "" gt72 = "" gt73 = "" gt74 = "" gt75 = "" gt76 = "" gt77 = "" EndIf EndIf If gcs = 8 Then If lcb = clear Then Sound.PlayClick() cleartbs() gt81 = "" gt82 = "" gt83 = "" gt84 = "" gt85 = "" gt86 = "" gt87 = "" EndIf EndIf If gcs = 9 Then If lcb = clear Then Sound.PlayClick() cleartbs() gt91 = "" gt92 = "" gt93 = "" gt94 = "" gt95 = "" gt96 = "" gt97 = "" EndIf EndIf If gcs = 10 Then If lcb = clear Then Sound.PlayClick() cleartbs() gt101 = "" gt102 = "" gt103 = "" gt104 = "" gt105 = "" gt106 = "" gt107 = "" EndIf EndIf 'S_1 If lcb = s1 Then Sound.PlayClick() Shapes.Move(indi, left + 99, 634) Shapes.SetText(title, "1") Controls.SetTextBoxText(t1, "World of Warcraft") Controls.SetTextBoxText(t2, "MMORPG") Controls.SetTextBoxText(t3, "24 Gb") Controls.SetTextBoxText(t4, 2004) Controls.SetTextBoxText(t5, "Inspired by [ Warcraft III ]") Controls.SetTextBoxText(t6, "Blizzard Entertainment") Controls.SetTextBoxText(t7, "5/5") Controls.HideControl(clear) Controls.HideControl(save) Else Controls.ShowControl(clear) Controls.ShowControl(save) EndIf 'S_2 If lcb = s2 Then Sound.PlayClick() Controls.SetButtonCaption(cs, "2") Shapes.Move(indi, left + 149, 634) Shapes.SetText(title, "2") Controls.SetTextBoxText(t1, gt21) Controls.SetTextBoxText(t2, gt22) Controls.SetTextBoxText(t3, gt23) Controls.SetTextBoxText(t4, gt24) Controls.SetTextBoxText(t5, gt25) Controls.SetTextBoxText(t6, gt26) Controls.SetTextBoxText(t7, gt27) EndIf 'S_3 If lcb = s3 Then Sound.PlayClick() Controls.SetButtonCaption(cs, 3) Shapes.Move(indi, left + 199, 634) Shapes.SetText(title, "3") Controls.SetTextBoxText(t1, gt31) Controls.SetTextBoxText(t2, gt32) Controls.SetTextBoxText(t3, gt33) Controls.SetTextBoxText(t4, gt34) Controls.SetTextBoxText(t5, gt35) Controls.SetTextBoxText(t6, gt36) Controls.SetTextBoxText(t7, gt37) EndIf 'S_4 If lcb = s4 Then Sound.PlayClick() Controls.SetButtonCaption(cs, 4) Shapes.Move(indi, left + 249, 634) Shapes.SetText(title, "4") Controls.SetTextBoxText(t1, gt41) Controls.SetTextBoxText(t2, gt42) Controls.SetTextBoxText(t3, gt43) Controls.SetTextBoxText(t4, gt44) Controls.SetTextBoxText(t5, gt45) Controls.SetTextBoxText(t6, gt46) Controls.SetTextBoxText(t7, gt47) EndIf 'S_5 If lcb = s5 Then Sound.PlayClick() Controls.SetButtonCaption(cs, 5) Shapes.Move(indi, left + 299, 634) Shapes.SetText(title, "5") Controls.SetTextBoxText(t1, gt51) Controls.SetTextBoxText(t2, gt52) Controls.SetTextBoxText(t3, gt53) Controls.SetTextBoxText(t4, gt54) Controls.SetTextBoxText(t5, gt55) Controls.SetTextBoxText(t6, gt56) Controls.SetTextBoxText(t7, gt57) EndIf 'S_6 If lcb = s6 Then Sound.PlayClick() Controls.SetButtonCaption(cs, 6) Shapes.Move(indi, left + 349, 634) Shapes.SetText(title, "6") Controls.SetTextBoxText(t1, gt61) Controls.SetTextBoxText(t2, gt62) Controls.SetTextBoxText(t3, gt63) Controls.SetTextBoxText(t4, gt64) Controls.SetTextBoxText(t5, gt65) Controls.SetTextBoxText(t6, gt66) Controls.SetTextBoxText(t7, gt67) EndIf 'S_7 If lcb = s7 Then Sound.PlayClick() Controls.SetButtonCaption(cs, 7) Shapes.Move(indi, left + 399, 634) Shapes.SetText(title, "7") Controls.SetTextBoxText(t1, gt71) Controls.SetTextBoxText(t2, gt72) Controls.SetTextBoxText(t3, gt73) Controls.SetTextBoxText(t4, gt74) Controls.SetTextBoxText(t5, gt75) Controls.SetTextBoxText(t6, gt76) Controls.SetTextBoxText(t7, gt77) EndIf 'S_8 If lcb = s8 Then Sound.PlayClick() Controls.SetButtonCaption(cs, 8) Shapes.Move(indi, left + 449, 634) Shapes.SetText(title, "8") Controls.SetTextBoxText(t1, gt81) Controls.SetTextBoxText(t2, gt82) Controls.SetTextBoxText(t3, gt83) Controls.SetTextBoxText(t4, gt84) Controls.SetTextBoxText(t5, gt85) Controls.SetTextBoxText(t6, gt86) Controls.SetTextBoxText(t7, gt87) EndIf 'S_9 If lcb = s9 Then Sound.PlayClick() Controls.SetButtonCaption(cs, 9) Shapes.Move(indi, left + 499, 634) Shapes.SetText(title, "9") Controls.SetTextBoxText(t1, gt91) Controls.SetTextBoxText(t2, gt92) Controls.SetTextBoxText(t3, gt93) Controls.SetTextBoxText(t4, gt94) Controls.SetTextBoxText(t5, gt95) Controls.SetTextBoxText(t6, gt96) Controls.SetTextBoxText(t7, gt97) EndIf 'S_10 If lcb = s10 Then Sound.PlayClick() Shapes.Move(title, ((dw - length) / 2) - 6, 185) Controls.SetButtonCaption(cs, 10) Shapes.Move(indi, left + 549, 634) Shapes.SetText(title, "10") Controls.SetTextBoxText(t1, gt101) Controls.SetTextBoxText(t2, gt102) Controls.SetTextBoxText(t3, gt103) Controls.SetTextBoxText(t4, gt104) Controls.SetTextBoxText(t5, gt105) Controls.SetTextBoxText(t6, gt106) Controls.SetTextBoxText(t7, gt107) EndIf EndSub 'SUB_ROUTINES 'CLEAR_TEXT_BOXES Sub cleartbs Controls.SetTextBoxText(t1, "") Controls.SetTextBoxText(t2, "") Controls.SetTextBoxText(t3, "") Controls.SetTextBoxText(t4, "") Controls.SetTextBoxText(t5, "") Controls.SetTextBoxText(t6, "") Controls.SetTextBoxText(t7, "") EndSub End>LJS543.sb< Start>LJX905.sb< GraphicsWindow.BackgroundColor = "#FAFAFA"'"#050505" GraphicsWindow.BrushColor = "Black"'"#EEFFEE33" GraphicsWindow.PenColor = "White"'"Black" size = 200 ellipse = Shapes.AddEllipse(size,size) Moving.Objecttype = ellipse Moving.Addobject() Moving.Objectselected = 1 GraphicsWindow.MouseMove = MouseMove For shapes_num = 1 to 30 GraphicsWindow.BrushColor = "White"'"Black" shape_size = Math.GetRandomNumber(15)+15 x = Math.GetRandomNumber(GraphicsWindow.Width-shape_size) y = Math.GetRandomNumber(GraphicsWindow.Height-shape_size) shape_type = Math.GetRandomNumber(3) If shape_type = 1 Then shape[shapes_num] = Shapes.AddEllipse(shape_size,shape_size) ElseIf shape_type = 2 Then shape[shapes_num] = Shapes.AddRectangle(shape_size,shape_size) ElseIf shape_type = 3 Then shape[shapes_num] = Shapes.AddTriangle(shape_size/2,0,0,shape_size,shape_size,shape_size) EndIf Shapes.Move(shape[shapes_num],x,y) EndFor Sub MouseMove Moving.X = GraphicsWindow.MouseX+size/2 Moving.Y = GraphicsWindow.MouseY+size/2 Moving.Oppositecoordinates() EndSub End>LJX905.sb< Start>LJZ753-0.sb< ' SmallBasic Version 1.2 ' Program: TWWidth(Height) ' Changelog: ' Author: Pappa Lapub ' Website: https://social.msdn.microsoft.com/Forums/en-US/24906a34-5afb-405b-b0b9-1acaf8917e6e/textwindow-right-margin ' ImportURL: http://smallbasic.com/program/?LJZ753 ' Extension: LitDev ' Comment: ' ' Variables: ' ToDo: ' ================================================================================ lf = Text.GetCharacter(10) qu = Text.GetCharacter(34) CSExt() LDInline.IncludeCS(cs, "","") wh = LDInline.Call("SBTW.GetWindowSize", "") TextWindow.WriteLine("Width: "+ wh[1]) TextWindow.WriteLine("Height: "+ wh[2]) w = LDInline.Get("SBTW.Width") TextWindow.WriteLine("Columns: "+ w) h = LDInline.Get("SBTW.Height") TextWindow.WriteLine("Lines: "+ h) TextWindow.WriteLine("Top: "+ TextWindow.Top) TextWindow.WriteLine("Left: "+ TextWindow.Left) TextWindow.WriteLine("Right Margin: "+ (TextWindow.Left + wh[1]) +lf) '' set right margin to Desktop.Width TextWindow.Write("Set TW right margin to Desktop.Width? [y|n] ") ans = Text.ConvertToLowerCase(TextWindow.Read()) If ans = "y" Then TextWindow.Left = Desktop.Width - wh[1] EndIf TextWindow.WriteLine(lf+lf) TextWindow.Pause() Program.End() Sub CSExt cs = "using System;"+ lf cs = cs +"using System.Diagnostics;"+ lf cs = cs +"using System.Runtime.InteropServices;"+ lf cs = cs +"using Microsoft.SmallBasic.Library;"+ lf cs = cs + "[SmallBasicType]"+ lf cs = cs + "public static class SBTW {"+ lf cs = cs + " [DllImport("+ qu +"user32.dll"+ qu +", SetLastError=true)]"+ lf cs = cs + " static extern bool GetWindowRect(IntPtr hwnd, out RECT lpRect);"+ lf cs = cs +" [StructLayout(LayoutKind.Sequential)]"+ lf cs = cs +" public struct RECT {"+ lf cs = cs +" public int Left; public int Top;"+ lf cs = cs +" public int Right; public int Bottom; }"+ lf cs = cs + " public static Primitive GetWindowSize() {"+ lf ' get TW size as array "1=width;2=height;" cs = cs +" TextWindow.Show();"+ lf cs = cs +" Process twProc = Process.GetCurrentProcess();"+ lf cs = cs +" RECT rct;"+ lf cs = cs +" GetWindowRect(twProc.MainWindowHandle, out rct);"+ lf cs = cs +" Primitive size = new Primitive();"+ lf cs = cs +" size[1] = rct.Right - rct.Left + 1;"+ lf cs = cs +" size[2] = rct.Bottom - rct.Top + 1;"+ lf cs = cs +" return size; }"+ lf cs = cs +" public static Primitive Width {"+ lf ' get/set TW width [Columns] (Default: 90) cs = cs +" get {"+ lf cs = cs +" TextWindow.Show();"+ lf cs = cs +" return Console.WindowWidth; }"+ lf cs = cs +" set {"+ lf cs = cs +" TextWindow.Show();"+ lf cs = cs +" int cw = (String.IsNullOrEmpty(value)) ? 90 : (int)value;"+ lf cs = cs +" cw = System.Math.Min(System.Math.Max(1, cw), Console.LargestWindowWidth);"+ lf cs = cs +" Console.WindowWidth = cw; } }"+ lf cs = cs +" public static Primitive Height {"+ lf ' get/set TW height [Lines] (Default: 30) cs = cs +" get {"+ lf cs = cs +" TextWindow.Show();"+ lf cs = cs +" return Console.WindowHeight; }"+ lf cs = cs +" set {"+ lf cs = cs +" TextWindow.Show();"+ lf cs = cs +" int ch = (String.IsNullOrEmpty(value)) ? 30 : (int)value;"+ lf cs = cs +" ch = System.Math.Min(System.Math.Max(1, ch), Console.LargestWindowHeight);"+ lf cs = cs +" Console.WindowHeight = ch; } } }"+ lf TextWindow.Left = 10 'TextWindow.WriteLine(cs) ' The following line could be harmful and has been automatically commented. ' 'File.WriteContents(Program.Directory +"\TWWidth.cs", cs) EndSub End>LJZ753-0.sb< Start>LJZ753-1.sb< ' SmallBasic Version 1.2 ' Program: TWWidth(Height) ' Changelog: ' Author: Pappa Lapub ' Website: https://social.msdn.microsoft.com/Forums/en-US/24906a34-5afb-405b-b0b9-1acaf8917e6e/textwindow-right-margin ' ImportURL: http://smallbasic.com/program/?LJZ753-1 ' Extension: LitDev ' Comment: ' ' Variables: ' ToDo: ' ================================================================================ lf = Text.GetCharacter(10) qu = Text.GetCharacter(34) CSExt() LDInline.IncludeCS(cs, "","") wh = LDInline.Call("SBTW.GetWindowSize", "") TextWindow.WriteLine("Width: "+ wh[1]) TextWindow.WriteLine("Height: "+ wh[2]) w = LDInline.Get("SBTW.Width") TextWindow.WriteLine("Columns: "+ w) h = LDInline.Get("SBTW.Height") TextWindow.WriteLine("Lines: "+ h) TextWindow.WriteLine("Top: "+ TextWindow.Top) TextWindow.WriteLine("Left: "+ TextWindow.Left) TextWindow.WriteLine("Right Margin: "+ (TextWindow.Left + wh[1]) +lf) '' set right margin to Desktop.Width TextWindow.Write("Set TW right margin to Desktop.Width? [y|n]: ") ans = Text.ConvertToLowerCase(TextWindow.Read()) If ans = "y" Then TextWindow.Left = Desktop.Width - wh[1] EndIf '' set TW width/height TextWindow.Write("Set TW width to 100 cols and height to 50 rows? [y|n]: ") ans2 = Text.ConvertToLowerCase(TextWindow.Read()) If ans2 = "y" Then LDInline.Set("SBTW.Width", 100) LDInline.Set("SBTW.Height", 50) EndIf TextWindow.WriteLine(lf+lf) TextWindow.Pause() Program.End() Sub CSExt cs = "using System;"+ lf cs = cs +"using System.Diagnostics;"+ lf cs = cs +"using System.Runtime.InteropServices;"+ lf cs = cs +"using Microsoft.SmallBasic.Library;"+ lf cs = cs +"[SmallBasicType]"+ lf cs = cs +"public static class SBTW {"+ lf cs = cs +" [DllImport("+ qu +"user32.dll"+ qu +", SetLastError=true)]"+ lf cs = cs +" static extern bool GetWindowRect(IntPtr hwnd, out RECT lpRect);"+ lf cs = cs +" [StructLayout(LayoutKind.Sequential)]"+ lf cs = cs +" public struct RECT {"+ lf cs = cs +" public int Left; public int Top;"+ lf cs = cs +" public int Right; public int Bottom; }"+ lf cs = cs +" public static Primitive GetWindowSize() {"+ lf ' get TW size as array "1=width;2=height;" cs = cs +" TextWindow.Show();"+ lf cs = cs +" Process twProc = Process.GetCurrentProcess();"+ lf cs = cs +" RECT rct;"+ lf cs = cs +" GetWindowRect(twProc.MainWindowHandle, out rct);"+ lf cs = cs +" Primitive size = new Primitive();"+ lf cs = cs +" size[1] = rct.Right - rct.Left + 1;"+ lf cs = cs +" size[2] = rct.Bottom - rct.Top + 1;"+ lf cs = cs +" return size; }"+ lf cs = cs +" public static Primitive Width {"+ lf ' get/set TW width [Columns] (Default: 90) cs = cs +" get {"+ lf cs = cs +" TextWindow.Show();"+ lf cs = cs +" return Console.WindowWidth; }"+ lf cs = cs +" set {"+ lf cs = cs +" TextWindow.Show();"+ lf cs = cs +" int cw = (String.IsNullOrEmpty(value)) ? 90 : (int)value;"+ lf cs = cs +" cw = System.Math.Min(System.Math.Max(1, cw), Console.LargestWindowWidth);"+ lf cs = cs +" Console.WindowWidth = cw; } }"+ lf cs = cs +" public static Primitive Height {"+ lf ' get/set TW height [Lines] (Default: 30) cs = cs +" get {"+ lf cs = cs +" TextWindow.Show();"+ lf cs = cs +" return Console.WindowHeight; }"+ lf cs = cs +" set {"+ lf cs = cs +" TextWindow.Show();"+ lf cs = cs +" int ch = (String.IsNullOrEmpty(value)) ? 30 : (int)value;"+ lf cs = cs +" ch = System.Math.Min(System.Math.Max(1, ch), Console.LargestWindowHeight);"+ lf cs = cs +" Console.WindowHeight = ch; } } }"+ lf TextWindow.Left = 10 'TextWindow.WriteLine(cs) ' The following line could be harmful and has been automatically commented. ' 'File.WriteContents(Program.Directory +"\TWWidth.cs", cs) EndSub End>LJZ753-1.sb< Start>LKB110.sb< LoadImage() FitToWindow() Graphics() LDEvents.MouseWheel = OnMouseWheel Sub Resize 'Aspect Ratio ratioX = GraphicsWindow.Width / imgWidth ratioY = GraphicsWindow.Height / imgHeight ratio = Math.Min(ratioX ratioY) 'Resize using Aspect Ratio & zoom newWidth = imgWidth * ratio * zoom newHeight = imgHeight * ratio * zoom EndSub Sub OnMouseWheel delta = LDEvents.LastMouseWheelDelta / 10 If zoom + delta > 0 And zoom + delta < 10 Then zoom = zoom + delta EndIf zoomPointX = GraphicsWindow.MouseX zoomPointY = GraphicsWindow.MouseY oldWidth = newWidth oldHeight = newHeight Resize() dX = oldWidth - newWidth dY = oldHeight - newHeight If delta > 0 Then If newWidth > GraphicsWindow.Width Then X = X + ((GraphicsWindow.Width /2 - zoomPointX) / (GraphicsWindow.Width/2)) * (Math.Abs(dx) / 2) + dX / 2 Else X = (GraphicsWindow.Width - newWidth) /2 EndIf If newHeight > GraphicsWindow.Height Then Y = Y + ((GraphicsWindow.Height /2 - zoomPointY) / (GraphicsWindow.Height/2)) * (Math.Abs(dY) /2) + dY / 2 Else Y = (GraphicsWindow.Height - newHeight) / 2 EndIf ElseIf delta < 0 Then If newWidth < GraphicsWindow.Width Then X = (GraphicsWindow.Width - newWidth) / 2 Else X = X - ((GraphicsWindow.Width /2 - zoomPointX) / (GraphicsWindow.Width/2)) * (Math.Abs(dx) / 2) + dX / 2 EndIf If newHeight < GraphicsWindow.Height Then Y = (GraphicsWindow.Height - newHeight) / 2 Else Y = Y - ((GraphicsWindow.Height /2 - zoomPointY) / (GraphicsWindow.Height/2)) * (Math.Abs(dY) /2) + dY / 2 EndIf EndIf Graphics() EndSub Sub Graphics LDShapes.SetSize(img, newWidth, newHeight) Shapes.Move(img X Y) EndSub Sub FitToWindow 'Fit to Window zoom = 1 Resize() X = (GraphicsWindow.Width - newWidth) / 2 Y = (GraphicsWindow.Height - newHeight) / 2 EndSub Sub LoadImage GraphicsWindow.Show() path = LDDialogs.OpenFile("*.*", "") img = ImageList.LoadImage(path) imgWidth = ImageList.GetWidthOfImage(img) imgHeight = ImageList.GetHeightOfImage(img) img = Shapes.AddImage(img) EndSub End>LKB110.sb< Start>LKB431.sb< ' Aliens 0.1 ' 2014-03-17 23:17:22 Shapes generated by Shapes 1.6b. ' ' initialize shapes GraphicsWindow.BackgroundColor = "DimGray" GraphicsWindow.Title = "Aliens 0.1" SB_Workaround() Shapes_Init() ' add shapes scale = 0.8 angle = 0 iMin = 1 iMax = 34 Shapes_Add() x = 80 y = 100 Shapes_Move() For i = iMin To iMax shape[i + 34] = shape[i] shape[i + 68] = shape[i] EndFor eyes = "e1=23;e2=24;e3=25;i1=26;i2=27;i3=28;" For i = 1 To 3 eyes["x" + i] = 80 + shape[eyes["e" + i]]["x"] * scale eyes["y" + i] = 100 + shape[eyes["e" + i]]["y"] * scale eyes["e" + (i + 3)] = eyes["e" + i] + 34 eyes["i" + (i + 3)] = eyes["i" + i] + 34 eyes["x" + (i + 3)] = 240 + shape[eyes["e" + i]]["x"] * scale eyes["y" + (i + 3)] = 120 + shape[eyes["e" + i]]["y"] * scale eyes["e" + (i + 6)] = eyes["e" + i] + 68 eyes["i" + (i + 6)] = eyes["i" + i] + 68 eyes["x" + (i + 6)] = 400 + shape[eyes["e" + i]]["x"] * scale eyes["y" + (i + 6)] = 100 + shape[eyes["e" + i]]["y"] * scale EndFor iMin = 35 iMax = 68 Shapes_Add() x = 240 y = 120 Shapes_Move() iMin = 69 iMax = 102 Shapes_Add() x = 400 y = 100 Shapes_Move() moved = "False" GraphicsWindow.MouseMove = OnMouseMove While "True" If moved Then MoveEyes() Else Program.Delay(1000 / 24) EndIf EndWhile Sub MoveEyes For i = 1 To 9 ir = shape[eyes["i" + i]]["width"] / 2 * scale er = shape[eyes["e" + i]]["width"] / 2 * scale ex = eyes["x" + i] + er ey = eyes["y" + i] + er x = mx - ex y = my - ey Math_CartesianToPolar() _a = Math.GetRadians(a) r = (er - ir) * 0.7 ix = ex + r * Math.Cos(_a) iy = ey + r * Math.Sin(_a) Shapes.Move(shape[eyes["i" + i]]["obj"], ix - ir, iy - ir) EndFor EndSub Sub OnMouseMove mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY moved = "True" EndSub Sub Shapes_Init ' Shapes | Initialize shapes data ' return shX, shY - current position of shapes ' return shape - array of shapes shX = 220 ' x offset shY = 100 ' y offset shape = "" shape[1] = "func=ell;x=0;y=53;width=21;height=50;bc=#B2E34F;pc=#000000;pw=0;rem=ear;" shape[2] = "func=ell;x=176;y=49;width=20;height=53;bc=#B2E34F;pc=#000000;pw=0;rem=ear;" shape[3] = "func=ell;x=88;y=0;width=17;height=18;bc=#B2E34F;pc=#000000;pw=0;rem=horn;" shape[4] = "func=rect;x=91;y=15;width=10;height=22;bc=#B2E34F;pc=#000000;pw=0;rem=horn;" shape[5] = "func=ell;x=10;y=35;width=175;height=111;bc=#B2E34F;pc=#000000;pw=0;rem=face;" shape[6] = "func=ell;x=45;y=66;width=102;height=51;bc=#B2E34F;pc=#333333;pw=2;rem=mouth;" shape[7] = "func=rect;x=34;y=62;width=127;height=38;bc=#B2E34F;pw=0;rem=mouth;" shape[8] = "func=ell;x=5;y=136;width=31;height=81;bc=#23ADD7;pc=#000000;pw=0;rem=arm;" shape[9] = "func=ell;x=154;y=135;width=36;height=82;bc=#23ADD7;pc=#000000;pw=0;rem=arm;" shape[10] = "func=ell;x=9;y=246;width=83;height=29;angle=350;bc=#154784;pc=#000000;pw=0;rem=foot;" shape[11] = "func=ell;x=101;y=245;width=83;height=29;angle=7;bc=#154784;pc=#000000;pw=0;rem=foot;" shape[12] = "func=rect;x=100;y=230;width=72;height=25;bc=#23ADD7;pc=#000000;pw=0;rem=leg;" shape[13] = "func=rect;x=21;y=231;width=72;height=23;bc=#23ADD7;pc=#000000;pw=0;rem=leg;" shape[14] = "func=rect;x=21;y=136;width=152;height=97;bc=#23ADD7;pc=#000000;pw=0;rem=body;" shape[15] = "func=rect;x=20;y=197;width=157;height=15;bc=#154784;pc=#000000;pw=0;rem=belt;" shape[16] = "func=rect;x=77;y=192;width=41;height=28;bc=#0B2646;pc=#000000;pw=0;rem=backle;" shape[17] = "func=ell;x=30;y=180;width=37;height=18;bc=#B2E34F;pc=#000000;pw=0;rem=finger;" shape[18] = "func=ell;x=30;y=196;width=36;height=15;bc=#B2E34F;pc=#000000;pw=0;rem=finger;" shape[19] = "func=ell;x=29;y=207;width=36;height=17;bc=#B2E34F;pc=#000000;pw=0;rem=finger;" shape[20] = "func=ell;x=135;y=182;width=34;height=17;bc=#B2E34F;pc=#000000;pw=0;rem=finger;" shape[21] = "func=ell;x=133;y=195;width=38;height=14;bc=#B2E34F;pc=#000000;pw=0;rem=finger;" shape[22] = "func=ell;x=134;y=207;width=35;height=16;angle=349;bc=#B2E34F;pc=#000000;pw=0;finger;" shape[23] = "func=ell;x=30;y=51;width=44;height=44;bc=#FFFFFF;pc=#000000;pw=0;rem=eye;" shape[24] = "func=ell;x=75;y=38;width=44;height=44;bc=#FFFFFF;pc=#000000;pw=0;rem=eye;" shape[25] = "func=ell;x=121;y=51;width=44;height=44;bc=#FFFFFF;pc=#000000;pw=0;rem=eye;" shape[26] = "func=ell;x=51;y=57;width=18;height=18;bc=#000000;pc=#000000;pw=2;rem=iris;" shape[27] = "func=ell;x=96;y=44;width=18;height=18;bc=#000000;pc=#000000;pw=2;rem=iris;" shape[28] = "func=ell;x=139;y=56;width=18;height=18;bc=#000000;pc=#000000;pw=2;rem=iris;" shape[29] = "func=rect;x=24;y=125;width=146;height=13;bc=#B84AC9;pc=#000000;pw=0;rem=neck;" shape[30] = "func=ell;x=13;y=186;width=30;height=33;bc=#B2E34F;pc=#000000;pw=0;rem=hand;" shape[31] = "func=ell;x=151;y=186;width=30;height=33;bc=#B2E34F;pc=#000000;pw=0;rem=hand;" shape[32] = "func=ell;x=118;y=159;width=40;height=11;angle=334;bc=#23ADD7;pc=#D8D822;pw=2;rem=mark;" shape[33] = "func=ell;x=127;y=154;width=20;height=22;bc=#23ADD7;pc=#D86822;pw=2;rem=mark;" shape[34] = "func=line;x=128;y=164;x1=0;y1=10;x2=21;y2=0;pc=#D8D822;pw=2;rem=mark;" 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>LKB431.sb< Start>LKC365.sb< 'Stare at the black cross and you will see some green dots in the spaces 'Also if you stare long enough some of the pink dots will seem to disappear sometimes gw = 500 gh = gw GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BackgroundColor = "LightGray" GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 44 GraphicsWindow.drawtext(gw/2-40,gh/2-50,"😚") GraphicsWindow.drawtext(gw/2-20,gh/2-50,"😚") GraphicsWindow.PenWidth = 0 For i = 1 To 12 If (Math.Remainder(i,2) = 1) Then GraphicsWindow.BrushColor = "Magenta" Else GraphicsWindow.BrushColor = "Magenta" EndIf GraphicsWindow.fontsize = 33 ball[i] = Shapes.Addtext("👹") theta = i*2*Math.Pi/12 x = gw/2+200*Math.sin(theta) y = gh/2+200*Math.cos(theta) Shapes.Move(ball[i],x-20,y-20) EndFor While("True") For i = 1 To 12 Shapes.HideShape(ball[i]) Program.Delay(150) Shapes.ShowShape(ball[i]) EndFor EndWhile End>LKC365.sb< Start>LKC878.sb< Date Mars-Sun distance Km Earth-Mars Distance Km 2015-01-01 207 040 000 294 650 000 2015-01-02 207 090 000 295 330 000 2015-01-03 207 130 000 296 010 000 2015-01-04 207 180 000 296 700 000 2015-01-05 207 230 000 297 380 000 2015-01-06 207 280 000 298 060 000 2015-01-07 207 330 000 298 750 000 2015-01-08 207 390 000 299 430 000 2015-01-09 207 450 000 300 120 000 2015-01-10 207 510 000 300 800 000 2015-01-11 207 570 000 301 480 000 2015-01-12 207 630 000 302 170 000 2015-01-13 207 700 000 302 850 000 2015-01-14 207 770 000 303 530 000 2015-01-15 207 840 000 304 220 000 2015-01-16 207 910 000 304 900 000 2015-01-17 207 980 000 305 580 000 2015-01-18 208 060 000 306 270 000 2015-01-19 208 140 000 306 950 000 2015-01-20 208 220 000 307 630 000 2015-01-21 208 300 000 308 310 000 2015-01-22 208 380 000 308 990 000 2015-01-23 208 470 000 309 670 000 2015-01-24 208 560 000 310 350 000 2015-01-25 208 650 000 311 030 000 2015-01-26 208 740 000 311 710 000 2015-01-27 208 830 000 312 390 000 2015-01-28 208 930 000 313 060 000 2015-01-29 209 020 000 313 740 000 2015-01-30 209 120 000 314 420 000 2015-01-31 209 220 000 315 090 000 2015-02-01 209 330 000 315 770 000 2015-02-02 209 430 000 316 440 000 2015-02-03 209 540 000 317 120 000 2015-02-04 209 640 000 317 790 000 2015-02-05 209 750 000 318 460 000 2015-02-06 209 860 000 319 130 000 2015-02-07 209 980 000 319 810 000 2015-02-08 210 090 000 320 480 000 2015-02-09 210 210 000 321 150 000 2015-02-10 210 330 000 321 820 000 2015-02-11 210 450 000 322 490 000 2015-02-12 210 570 000 323 160 000 2015-02-13 210 690 000 323 820 000 2015-02-14 210 820 000 324 490 000 2015-02-15 210 940 000 325 160 000 2015-02-16 211 070 000 325 820 000 2015-02-17 211 200 000 326 490 000 2015-02-18 211 330 000 327 150 000 2015-02-19 211 460 000 327 810 000 2015-02-20 211 600 000 328 470 000 2015-02-21 211 730 000 329 130 000 2015-02-22 211 870 000 329 780 000 2015-02-23 212 010 000 330 440 000 2015-02-24 212 150 000 331 090 000 2015-02-25 212 290 000 331 750 000 2015-02-26 212 430 000 332 400 000 2015-02-27 212 580 000 333 050 000 2015-02-28 212 720 000 333 690 000 2015-03-01 212 870 000 334 340 000 2015-03-02 213 020 000 334 990 000 2015-03-03 213 170 000 335 630 000 2015-03-04 213 320 000 336 270 000 2015-03-05 213 470 000 336 910 000 2015-03-06 213 620 000 337 550 000 2015-03-07 213 780 000 338 190 000 2015-03-08 213 930 000 338 820 000 2015-03-09 214 090 000 339 450 000 2015-03-10 214 250 000 340 090 000 2015-03-11 214 410 000 340 720 000 2015-03-12 214 570 000 341 340 000 2015-03-13 214 730 000 341 970 000 2015-03-14 214 890 000 342 600 000 2015-03-15 215 060 000 343 220 000 2015-03-16 215 220 000 343 840 000 2015-03-17 215 390 000 344 460 000 2015-03-18 215 560 000 345 070 000 2015-03-19 215 720 000 345 680 000 2015-03-20 215 890 000 346 290 000 2015-03-21 216 060 000 346 900 000 2015-03-22 216 230 000 347 510 000 2015-03-23 216 410 000 348 110 000 2015-03-24 216 580 000 348 710 000 2015-03-25 216 750 000 349 300 000 2015-03-26 216 930 000 349 900 000 2015-03-27 217 100 000 350 490 000 2015-03-28 217 280 000 351 080 000 2015-03-29 217 460 000 351 660 000 2015-03-30 217 640 000 352 240 000 2015-03-31 217 820 000 352 820 000 2015-04-01 218 000 000 353 400 000 2015-04-02 218 180 000 353 970 000 2015-04-03 218 360 000 354 540 000 2015-04-04 218 540 000 355 110 000 2015-04-05 218 720 000 355 680 000 2015-04-06 218 910 000 356 240 000 2015-04-07 219 090 000 356 800 000 2015-04-08 219 270 000 357 350 000 2015-04-09 219 460 000 357 900 000 2015-04-10 219 650 000 358 450 000 2015-04-11 219 830 000 359 000 000 2015-04-12 220 020 000 359 540 000 2015-04-13 220 210 000 360 080 000 2015-04-14 220 400 000 360 610 000 2015-04-15 220 580 000 361 140 000 2015-04-16 220 770 000 361 670 000 2015-04-17 220 960 000 362 190 000 2015-04-18 221 150 000 362 710 000 2015-04-19 221 340 000 363 220 000 2015-04-20 221 540 000 363 730 000 2015-04-21 221 730 000 364 240 000 2015-04-22 221 920 000 364 740 000 2015-04-23 222 110 000 365 240 000 2015-04-24 222 300 000 365 730 000 2015-04-25 222 500 000 366 220 000 2015-04-26 222 690 000 366 710 000 2015-04-27 222 880 000 367 190 000 2015-04-28 223 080 000 367 660 000 2015-04-29 223 270 000 368 130 000 2015-04-30 223 460 000 368 600 000 2015-05-01 223 660 000 369 060 000 2015-05-02 223 850 000 369 520 000 2015-05-03 224 050 000 369 970 000 2015-05-04 224 240 000 370 420 000 2015-05-05 224 440 000 370 860 000 2015-05-06 224 630 000 371 300 000 2015-05-07 224 830 000 371 740 000 2015-05-08 225 020 000 372 170 000 2015-05-09 225 220 000 372 590 000 2015-05-10 225 420 000 373 010 000 2015-05-11 225 610 000 373 430 000 2015-05-12 225 810 000 373 840 000 2015-05-13 226 000 000 374 240 000 2015-05-14 226 200 000 374 640 000 2015-05-15 226 390 000 375 040 000 2015-05-16 226 590 000 375 420 000 2015-05-17 226 790 000 375 810 000 2015-05-18 226 980 000 376 180 000 2015-05-19 227 180 000 376 560 000 2015-05-20 227 370 000 376 920 000 2015-05-21 227 570 000 377 280 000 2015-05-22 227 760 000 377 630 000 2015-05-23 227 960 000 377 980 000 2015-05-24 228 150 000 378 320 000 2015-05-25 228 350 000 378 660 000 2015-05-26 228 540 000 378 990 000 2015-05-27 228 730 000 379 310 000 2015-05-28 228 930 000 379 630 000 2015-05-29 229 120 000 379 940 000 2015-05-30 229 320 000 380 250 000 2015-05-31 229 510 000 380 550 000 2015-06-01 229 700 000 380 840 000 2015-06-02 229 890 000 381 130 000 2015-06-03 230 090 000 381 410 000 2015-06-04 230 280 000 381 690 000 2015-06-05 230 470 000 381 960 000 2015-06-06 230 660 000 382 220 000 2015-06-07 230 850 000 382 480 000 2015-06-08 231 040 000 382 730 000 2015-06-09 231 230 000 382 980 000 2015-06-10 231 420 000 383 210 000 2015-06-11 231 610 000 383 440 000 2015-06-12 231 800 000 383 670 000 2015-06-13 231 990 000 383 880 000 2015-06-14 232 170 000 384 090 000 2015-06-15 232 360 000 384 300 000 2015-06-16 232 550 000 384 490 000 2015-06-17 232 730 000 384 680 000 2015-06-18 232 920 000 384 860 000 2015-06-19 233 100 000 385 040 000 2015-06-20 233 290 000 385 200 000 2015-06-21 233 470 000 385 360 000 2015-06-22 233 660 000 385 520 000 2015-06-23 233 840 000 385 660 000 2015-06-24 234 020 000 385 800 000 2015-06-25 234 200 000 385 930 000 2015-06-26 234 380 000 386 050 000 2015-06-27 234 560 000 386 170 000 2015-06-28 234 740 000 386 270 000 2015-06-29 234 920 000 386 370 000 2015-06-30 235 100 000 386 470 000 2015-07-01 235 280 000 386 550 000 2015-07-02 235 460 000 386 630 000 2015-07-03 235 630 000 386 700 000 2015-07-04 235 810 000 386 760 000 2015-07-05 235 980 000 386 820 000 2015-07-06 236 150 000 386 870 000 2015-07-07 236 330 000 386 910 000 2015-07-08 236 500 000 386 940 000 2015-07-09 236 670 000 386 970 000 2015-07-10 236 840 000 386 980 000 2015-07-11 237 010 000 386 990 000 2015-07-12 237 180 000 386 990 000 2015-07-13 237 350 000 386 980 000 2015-07-14 237 520 000 386 970 000 2015-07-15 237 680 000 386 940 000 2015-07-16 237 850 000 386 910 000 2015-07-17 238 010 000 386 870 000 2015-07-18 238 180 000 386 820 000 2015-07-19 238 340 000 386 760 000 2015-07-20 238 500 000 386 690 000 2015-07-21 238 660 000 386 610 000 2015-07-22 238 820 000 386 530 000 2015-07-23 238 980 000 386 440 000 2015-07-24 239 140 000 386 330 000 2015-07-25 239 300 000 386 220 000 2015-07-26 239 460 000 386 110 000 2015-07-27 239 610 000 385 980 000 2015-07-28 239 770 000 385 840 000 2015-07-29 239 920 000 385 700 000 2015-07-30 240 070 000 385 550 000 2015-07-31 240 220 000 385 380 000 2015-08-01 240 370 000 385 210 000 2015-08-02 240 520 000 385 040 000 2015-08-03 240 670 000 384 850 000 2015-08-04 240 820 000 384 650 000 2015-08-05 240 960 000 384 450 000 2015-08-06 241 110 000 384 240 000 2015-08-07 241 250 000 384 010 000 2015-08-08 241 400 000 383 780 000 2015-08-09 241 540 000 383 540 000 2015-08-10 241 680 000 383 290 000 2015-08-11 241 820 000 383 030 000 2015-08-12 241 960 000 382 760 000 2015-08-13 242 100 000 382 490 000 2015-08-14 242 230 000 382 200 000 2015-08-15 242 370 000 381 900 000 2015-08-16 242 500 000 381 600 000 2015-08-17 242 630 000 381 280 000 2015-08-18 242 770 000 380 950 000 2015-08-19 242 900 000 380 620 000 2015-08-20 243 030 000 380 280 000 2015-08-21 243 160 000 379 920 000 2015-08-22 243 280 000 379 560 000 2015-08-23 243 410 000 379 190 000 2015-08-24 243 530 000 378 810 000 2015-08-25 243 660 000 378 420 000 2015-08-26 243 780 000 378 020 000 2015-08-27 243 900 000 377 610 000 2015-08-28 244 020 000 377 190 000 2015-08-29 244 140 000 376 760 000 2015-08-30 244 260 000 376 330 000 2015-08-31 244 370 000 375 880 000 2015-09-01 244 490 000 375 430 000 2015-09-02 244 600 000 374 960 000 2015-09-03 244 710 000 374 490 000 2015-09-04 244 820 000 374 000 000 2015-09-05 244 930 000 373 510 000 2015-09-06 245 040 000 373 010 000 2015-09-07 245 150 000 372 500 000 2015-09-08 245 260 000 371 970 000 2015-09-09 245 360 000 371 440 000 2015-09-10 245 460 000 370 900 000 2015-09-11 245 570 000 370 350 000 2015-09-12 245 670 000 369 780 000 2015-09-13 245 770 000 369 210 000 2015-09-14 245 860 000 368 630 000 2015-09-15 245 960 000 368 040 000 2015-09-16 246 060 000 367 440 000 2015-09-17 246 150 000 366 830 000 2015-09-18 246 240 000 366 210 000 2015-09-19 246 340 000 365 580 000 2015-09-20 246 430 000 364 940 000 2015-09-21 246 510 000 364 290 000 2015-09-22 246 600 000 363 630 000 2015-09-23 246 690 000 362 960 000 2015-09-24 246 770 000 362 280 000 2015-09-25 246 860 000 361 590 000 2015-09-26 246 940 000 360 900 000 2015-09-27 247 020 000 360 190 000 2015-09-28 247 100 000 359 470 000 2015-09-29 247 180 000 358 750 000 2015-09-30 247 250 000 358 010 000 2015-10-01 247 330 000 357 270 000 2015-10-02 247 400 000 356 510 000 2015-10-03 247 470 000 355 750 000 2015-10-04 247 540 000 354 980 000 2015-10-05 247 610 000 354 190 000 2015-10-06 247 680 000 353 400 000 2015-10-07 247 750 000 352 600 000 2015-10-08 247 810 000 351 790 000 2015-10-09 247 880 000 350 960 000 2015-10-10 247 940 000 350 130 000 2015-10-11 248 000 000 349 290 000 2015-10-12 248 060 000 348 440 000 2015-10-13 248 120 000 347 580 000 2015-10-14 248 170 000 346 710 000 2015-10-15 248 230 000 345 830 000 2015-10-16 248 280 000 344 940 000 2015-10-17 248 330 000 344 040 000 2015-10-18 248 390 000 343 140 000 2015-10-19 248 430 000 342 220 000 2015-10-20 248 480 000 341 290 000 2015-10-21 248 530 000 340 360 000 2015-10-22 248 570 000 339 410 000 2015-10-23 248 620 000 338 460 000 2015-10-24 248 660 000 337 500 000 2015-10-25 248 700 000 336 520 000 2015-10-26 248 740 000 335 540 000 2015-10-27 248 780 000 334 550 000 2015-10-28 248 810 000 333 560 000 2015-10-29 248 850 000 332 550 000 2015-10-30 248 880 000 331 530 000 2015-10-31 248 910 000 330 510 000 2015-11-01 248 940 000 329 480 000 2015-11-02 248 970 000 328 430 000 2015-11-03 249 000 000 327 380 000 2015-11-04 249 030 000 326 320 000 2015-11-05 249 050 000 325 250 000 2015-11-06 249 070 000 324 180 000 2015-11-07 249 090 000 323 090 000 2015-11-08 249 110 000 321 990 000 2015-11-09 249 130 000 320 890 000 2015-11-10 249 150 000 319 780 000 2015-11-11 249 170 000 318 660 000 2015-11-12 249 180 000 317 530 000 2015-11-13 249 190 000 316 390 000 2015-11-14 249 200 000 315 240 000 2015-11-15 249 210 000 314 090 000 2015-11-16 249 220 000 312 920 000 2015-11-17 249 230 000 311 750 000 2015-11-18 249 230 000 310 570 000 2015-11-19 249 240 000 309 390 000 2015-11-20 249 240 000 308 190 000 2015-11-21 249 240 000 306 990 000 2015-11-22 249 240 000 305 780 000 2015-11-23 249 240 000 304 560 000 2015-11-24 249 230 000 303 340 000 2015-11-25 249 230 000 302 110 000 2015-11-26 249 220 000 300 870 000 2015-11-27 249 210 000 299 620 000 2015-11-28 249 200 000 298 370 000 2015-11-29 249 190 000 297 110 000 2015-11-30 249 180 000 295 840 000 2015-12-01 249 160 000 294 560 000 2015-12-02 249 150 000 293 280 000 2015-12-03 249 130 000 291 990 000 2015-12-04 249 110 000 290 690 000 2015-12-05 249 090 000 289 390 000 2015-12-06 249 070 000 288 080 000 2015-12-07 249 050 000 286 760 000 2015-12-08 249 020 000 285 440 000 2015-12-09 249 000 000 284 110 000 2015-12-10 248 970 000 282 770 000 2015-12-11 248 940 000 281 420 000 2015-12-12 248 910 000 280 070 000 2015-12-13 248 880 000 278 720 000 2015-12-14 248 840 000 277 350 000 2015-12-15 248 810 000 275 980 000 2015-12-16 248 770 000 274 610 000 2015-12-17 248 740 000 273 230 000 2015-12-18 248 700 000 271 840 000 2015-12-19 248 660 000 270 450 000 2015-12-20 248 610 000 269 050 000 2015-12-21 248 570 000 267 650 000 2015-12-22 248 520 000 266 240 000 2015-12-23 248 480 000 264 830 000 2015-12-24 248 430 000 263 410 000 2015-12-25 248 380 000 261 990 000 2015-12-26 248 330 000 260 570 000 2015-12-27 248 280 000 259 130 000 2015-12-28 248 220 000 257 700 000 2015-12-29 248 170 000 256 260 000 2015-12-30 248 110 000 254 810 000 2015-12-31 248 050 000 253 360 000 2016-01-01 247 990 000 251 900 000 2016-01-02 247 930 000 250 440 000 2016-01-03 247 870 000 248 980 000 2016-01-04 247 810 000 247 510 000 2016-01-05 247 740 000 246 040 000 2016-01-06 247 670 000 244 570 000 2016-01-07 247 610 000 243 090 000 2016-01-08 247 540 000 241 600 000 2016-01-09 247 470 000 240 110 000 2016-01-10 247 390 000 238 620 000 2016-01-11 247 320 000 237 130 000 2016-01-12 247 240 000 235 630 000 2016-01-13 247 170 000 234 130 000 2016-01-14 247 090 000 232 630 000 2016-01-15 247 010 000 231 120 000 2016-01-16 246 930 000 229 620 000 2016-01-17 246 850 000 228 110 000 2016-01-18 246 760 000 226 590 000 2016-01-19 246 680 000 225 080 000 2016-01-20 246 590 000 223 560 000 2016-01-21 246 510 000 222 050 000 2016-01-22 246 420 000 220 530 000 2016-01-23 246 330 000 219 010 000 2016-01-24 246 240 000 217 480 000 2016-01-25 246 140 000 215 960 000 2016-01-26 246 050 000 214 430 000 2016-01-27 245 950 000 212 900 000 2016-01-28 245 860 000 211 380 000 2016-01-29 245 760 000 209 850 000 2016-01-30 245 660 000 208 320 000 2016-01-31 245 560 000 206 790 000 2016-02-01 245 450 000 205 250 000 2016-02-02 245 350 000 203 720 000 2016-02-03 245 250 000 202 190 000 2016-02-04 245 140 000 200 650 000 2016-02-05 245 030 000 199 120 000 2016-02-06 244 920 000 197 580 000 2016-02-07 244 810 000 196 050 000 2016-02-08 244 700 000 194 520 000 2016-02-09 244 590 000 192 980 000 2016-02-10 244 480 000 191 450 000 2016-02-11 244 360 000 189 920 000 2016-02-12 244 250 000 188 390 000 2016-02-13 244 130 000 186 860 000 2016-02-14 244 010 000 185 330 000 2016-02-15 243 890 000 183 810 000 2016-02-16 243 770 000 182 280 000 2016-02-17 243 650 000 180 760 000 2016-02-18 243 520 000 179 240 000 2016-02-19 243 400 000 177 720 000 2016-02-20 243 270 000 176 210 000 2016-02-21 243 140 000 174 690 000 2016-02-22 243 020 000 173 180 000 2016-02-23 242 890 000 171 680 000 2016-02-24 242 760 000 170 170 000 2016-02-25 242 620 000 168 670 000 2016-02-26 242 490 000 167 170 000 2016-02-27 242 360 000 165 670 000 2016-02-28 242 220 000 164 180 000 2016-02-29 242 080 000 162 690 000 2016-03-01 241 950 000 161 210 000 2016-03-02 241 810 000 159 730 000 2016-03-03 241 670 000 158 250 000 2016-03-04 241 530 000 156 780 000 2016-03-05 241 380 000 155 310 000 2016-03-06 241 240 000 153 840 000 2016-03-07 241 100 000 152 380 000 2016-03-08 240 950 000 150 930 000 2016-03-09 240 810 000 149 480 000 2016-03-10 240 660 000 148 040 000 2016-03-11 240 510 000 146 600 000 2016-03-12 240 360 000 145 170 000 2016-03-13 240 210 000 143 740 000 2016-03-14 240 060 000 142 330 000 2016-03-15 239 910 000 140 910 000 2016-03-16 239 750 000 139 510 000 2016-03-17 239 600 000 138 110 000 2016-03-18 239 440 000 136 720 000 2016-03-19 239 290 000 135 340 000 2016-03-20 239 130 000 133 970 000 2016-03-21 238 970 000 132 600 000 2016-03-22 238 810 000 131 250 000 2016-03-23 238 650 000 129 900 000 2016-03-24 238 490 000 128 560 000 2016-03-25 238 330 000 127 220 000 2016-03-26 238 160 000 125 900 000 2016-03-27 238 000 000 124 590 000 2016-03-28 237 840 000 123 280 000 2016-03-29 237 670 000 121 990 000 2016-03-30 237 500 000 120 710 000 2016-03-31 237 340 000 119 430 000 2016-04-01 237 170 000 118 170 000 2016-04-02 237 000 000 116 920 000 2016-04-03 236 830 000 115 680 000 2016-04-04 236 660 000 114 450 000 2016-04-05 236 490 000 113 230 000 2016-04-06 236 310 000 112 030 000 2016-04-07 236 140 000 110 840 000 2016-04-08 235 970 000 109 660 000 2016-04-09 235 790 000 108 490 000 2016-04-10 235 620 000 107 340 000 2016-04-11 235 440 000 106 200 000 2016-04-12 235 260 000 105 080 000 2016-04-13 235 090 000 103 980 000 2016-04-14 234 910 000 102 880 000 2016-04-15 234 730 000 101 810 000 2016-04-16 234 550 000 100 750 000 2016-04-17 234 370 000 99 704 000 2016-04-18 234 190 000 98 677 000 2016-04-19 234 010 000 97 667 000 2016-04-20 233 820 000 96 674 000 2016-04-21 233 640 000 95 699 000 2016-04-22 233 460 000 94 743 000 2016-04-23 233 270 000 93 804 000 2016-04-24 233 090 000 92 884 000 2016-04-25 232 910 000 91 983 000 2016-04-26 232 720 000 91 102 000 2016-04-27 232 530 000 90 241 000 2016-04-28 232 350 000 89 400 000 2016-04-29 232 160 000 88 580 000 2016-04-30 231 970 000 87 781 000 2016-05-01 231 780 000 87 004 000 2016-05-02 231 590 000 86 249 000 2016-05-03 231 410 000 85 516 000 2016-05-04 231 220 000 84 806 000 2016-05-05 231 030 000 84 120 000 2016-05-06 230 840 000 83 457 000 2016-05-07 230 650 000 82 819 000 2016-05-08 230 450 000 82 205 000 2016-05-09 230 260 000 81 616 000 2016-05-10 230 070 000 81 052 000 2016-05-11 229 880 000 80 514 000 2016-05-12 229 690 000 80 001 000 2016-05-13 229 490 000 79 515 000 2016-05-14 229 300 000 79 054 000 2016-05-15 229 110 000 78 620 000 2016-05-16 228 910 000 78 211 000 2016-05-17 228 720 000 77 830 000 2016-05-18 228 530 000 77 475 000 2016-05-19 228 330 000 77 146 000 2016-05-20 228 140 000 76 844 000 2016-05-21 227 940 000 76 569 000 2016-05-22 227 750 000 76 321 000 2016-05-23 227 550 000 76 099 000 2016-05-24 227 360 000 75 904 000 2016-05-25 227 160 000 75 736 000 2016-05-26 226 970 000 75 594 000 2016-05-27 226 770 000 75 479 000 2016-05-28 226 580 000 75 390 000 2016-05-29 226 380 000 75 328 000 2016-05-30 226 180 000 75 291 000 2016-05-31 225 990 000 75 281 000 2016-06-01 225 790 000 75 297 000 2016-06-02 225 600 000 75 338 000 2016-06-03 225 400 000 75 404 000 2016-06-04 225 210 000 75 496 000 2016-06-05 225 010 000 75 612 000 2016-06-06 224 810 000 75 753 000 2016-06-07 224 620 000 75 917 000 2016-06-08 224 420 000 76 105 000 2016-06-09 224 230 000 76 316 000 2016-06-10 224 030 000 76 549 000 2016-06-11 223 840 000 76 804 000 2016-06-12 223 640 000 77 081 000 2016-06-13 223 450 000 77 379 000 2016-06-14 223 260 000 77 696 000 2016-06-15 223 060 000 78 034 000 2016-06-16 222 870 000 78 391 000 2016-06-17 222 680 000 78 767 000 2016-06-18 222 480 000 79 161 000 2016-06-19 222 290 000 79 572 000 2016-06-20 222 100 000 80 002 000 2016-06-21 221 900 000 80 447 000 2016-06-22 221 710 000 80 909 000 2016-06-23 221 520 000 81 387 000 2016-06-24 221 330 000 81 881 000 2016-06-25 221 140 000 82 389 000 2016-06-26 220 950 000 82 912 000 2016-06-27 220 760 000 83 449 000 2016-06-28 220 570 000 83 999 000 2016-06-29 220 380 000 84 563 000 2016-06-30 220 190 000 85 140 000 2016-07-01 220 010 000 85 729 000 2016-07-02 219 820 000 86 330 000 2016-07-03 219 630 000 86 943 000 2016-07-04 219 450 000 87 567 000 2016-07-05 219 260 000 88 202 000 2016-07-06 219 080 000 88 846 000 2016-07-07 218 890 000 89 501 000 2016-07-08 218 710 000 90 165 000 2016-07-09 218 530 000 90 838 000 2016-07-10 218 350 000 91 519 000 2016-07-11 218 160 000 92 209 000 2016-07-12 217 980 000 92 906 000 2016-07-13 217 800 000 93 611 000 2016-07-14 217 620 000 94 322 000 2016-07-15 217 450 000 95 041 000 2016-07-16 217 270 000 95 766 000 2016-07-17 217 090 000 96 497 000 2016-07-18 216 920 000 97 234 000 2016-07-19 216 740 000 97 977 000 2016-07-20 216 570 000 98 725 000 2016-07-21 216 400 000 99 479 000 2016-07-22 216 220 000 100 240 000 2016-07-23 216 050 000 101 000 000 2016-07-24 215 880 000 101 770 000 2016-07-25 215 710 000 102 540 000 2016-07-26 215 540 000 103 320 000 2016-07-27 215 380 000 104 100 000 2016-07-28 215 210 000 104 890 000 2016-07-29 215 050 000 105 680 000 2016-07-30 214 880 000 106 470 000 2016-07-31 214 720 000 107 270 000 2016-08-01 214 560 000 108 070 000 2016-08-02 214 400 000 108 870 000 2016-08-03 214 240 000 109 680 000 2016-08-04 214 080 000 110 480 000 2016-08-05 213 920 000 111 300 000 2016-08-06 213 770 000 112 110 000 2016-08-07 213 610 000 112 930 000 2016-08-08 213 460 000 113 750 000 2016-08-09 213 310 000 114 570 000 2016-08-10 213 160 000 115 390 000 2016-08-11 213 010 000 116 210 000 2016-08-12 212 860 000 117 040 000 2016-08-13 212 710 000 117 870 000 2016-08-14 212 570 000 118 700 000 2016-08-15 212 420 000 119 530 000 2016-08-16 212 280 000 120 360 000 2016-08-17 212 140 000 121 190 000 2016-08-18 212 000 000 122 030 000 2016-08-19 211 860 000 122 860 000 2016-08-20 211 720 000 123 700 000 2016-08-21 211 590 000 124 540 000 2016-08-22 211 460 000 125 380 000 2016-08-23 211 320 000 126 220 000 2016-08-24 211 190 000 127 060 000 2016-08-25 211 060 000 127 900 000 2016-08-26 210 940 000 128 750 000 2016-08-27 210 810 000 129 590 000 2016-08-28 210 680 000 130 440 000 2016-08-29 210 560 000 131 290 000 2016-08-30 210 440 000 132 130 000 2016-08-31 210 320 000 132 980 000 2016-09-01 210 200 000 133 830 000 2016-09-02 210 090 000 134 690 000 2016-09-03 209 970 000 135 540 000 2016-09-04 209 860 000 136 390 000 2016-09-05 209 750 000 137 240 000 2016-09-06 209 640 000 138 100 000 2016-09-07 209 530 000 138 950 000 2016-09-08 209 420 000 139 810 000 2016-09-09 209 320 000 140 660 000 2016-09-10 209 220 000 141 520 000 2016-09-11 209 120 000 142 370 000 2016-09-12 209 020 000 143 230 000 2016-09-13 208 920 000 144 090 000 2016-09-14 208 830 000 144 950 000 2016-09-15 208 730 000 145 800 000 2016-09-16 208 640 000 146 660 000 2016-09-17 208 550 000 147 520 000 2016-09-18 208 470 000 148 380 000 2016-09-19 208 380 000 149 240 000 2016-09-20 208 300 000 150 100 000 2016-09-21 208 220 000 150 970 000 2016-09-22 208 140 000 151 830 000 2016-09-23 208 060 000 152 700 000 2016-09-24 207 980 000 153 560 000 2016-09-25 207 910 000 154 430 000 2016-09-26 207 840 000 155 290 000 2016-09-27 207 770 000 156 160 000 2016-09-28 207 700 000 157 030 000 2016-09-29 207 630 000 157 900 000 2016-09-30 207 570 000 158 770 000 2016-10-01 207 510 000 159 650 000 2016-10-02 207 450 000 160 520 000 2016-10-03 207 390 000 161 390 000 2016-10-04 207 330 000 162 270 000 2016-10-05 207 280 000 163 140 000 2016-10-06 207 230 000 164 020 000 2016-10-07 207 180 000 164 900 000 2016-10-08 207 130 000 165 770 000 2016-10-09 207 090 000 166 650 000 2016-10-10 207 040 000 167 530 000 2016-10-11 207 000 000 168 410 000 2016-10-12 206 960 000 169 290 000 2016-10-13 206 930 000 170 170 000 2016-10-14 206 890 000 171 060 000 2016-10-15 206 860 000 171 940 000 2016-10-16 206 830 000 172 820 000 2016-10-17 206 800 000 173 710 000 2016-10-18 206 780 000 174 600 000 2016-10-19 206 750 000 175 490 000 2016-10-20 206 730 000 176 380 000 2016-10-21 206 710 000 177 270 000 2016-10-22 206 690 000 178 160 000 2016-10-23 206 680 000 179 060 000 2016-10-24 206 660 000 179 950 000 2016-10-25 206 650 000 180 850 000 2016-10-26 206 640 000 181 750 000 2016-10-27 206 640 000 182 650 000 2016-10-28 206 630 000 183 550 000 2016-10-29 206 630 000 184 460 000 2016-10-30 206 630 000 185 360 000 2016-10-31 206 630 000 186 270 000 2016-11-01 206 640 000 187 170 000 2016-11-02 206 640 000 188 080 000 2016-11-03 206 650 000 188 990 000 2016-11-04 206 660 000 189 900 000 2016-11-05 206 680 000 190 820 000 2016-11-06 206 690 000 191 730 000 2016-11-07 206 710 000 192 650 000 2016-11-08 206 730 000 193 560 000 2016-11-09 206 750 000 194 480 000 2016-11-10 206 770 000 195 400 000 2016-11-11 206 800 000 196 320 000 2016-11-12 206 830 000 197 250 000 2016-11-13 206 860 000 198 170 000 2016-11-14 206 890 000 199 100 000 2016-11-15 206 920 000 200 020 000 2016-11-16 206 960 000 200 950 000 2016-11-17 207 000 000 201 880 000 2016-11-18 207 040 000 202 810 000 2016-11-19 207 080 000 203 750 000 2016-11-20 207 130 000 204 690 000 2016-11-21 207 170 000 205 620 000 2016-11-22 207 220 000 206 560 000 2016-11-23 207 270 000 207 500 000 2016-11-24 207 330 000 208 450 000 2016-11-25 207 380 000 209 390 000 2016-11-26 207 440 000 210 340 000 2016-11-27 207 500 000 211 290 000 2016-11-28 207 560 000 212 240 000 2016-11-29 207 630 000 213 190 000 2016-11-30 207 690 000 214 140 000 2016-12-01 207 760 000 215 100 000 2016-12-02 207 830 000 216 060 000 2016-12-03 207 900 000 217 010 000 2016-12-04 207 970 000 217 970 000 2016-12-05 208 050 000 218 930 000 2016-12-06 208 130 000 219 900 000 2016-12-07 208 210 000 220 860 000 2016-12-08 208 290 000 221 830 000 2016-12-09 208 370 000 222 790 000 2016-12-10 208 460 000 223 760 000 2016-12-11 208 540 000 224 730 000 2016-12-12 208 630 000 225 700 000 2016-12-13 208 720 000 226 670 000 2016-12-14 208 820 000 227 640 000 2016-12-15 208 910 000 228 620 000 2016-12-16 209 010 000 229 600 000 2016-12-17 209 110 000 230 570 000 2016-12-18 209 210 000 231 550 000 2016-12-19 209 310 000 232 530 000 2016-12-20 209 410 000 233 520 000 2016-12-21 209 520 000 234 500 000 2016-12-22 209 630 000 235 490 000 2016-12-23 209 740 000 236 480 000 2016-12-24 209 850 000 237 470 000 2016-12-25 209 960 000 238 460 000 2016-12-26 210 070 000 239 450 000 2016-12-27 210 190 000 240 440 000 2016-12-28 210 310 000 241 430 000 2016-12-29 210 430 000 242 430 000 2016-12-30 210 550 000 243 420 000 2016-12-31 210 670 000 244 420 000 2017-01-01 210 800 000 245 420 000 End>LKC878.sb< Start>LKD848.sb< GraphicsWindow.Width=1600 GraphicsWindow.Height =800 GraphicsWindow.Title="Walking... GraphicsWindow.Left=0 GraphicsWindow.Top =11 GraphicsWindow.BrushColor ="green GraphicsWindow.FillRectangle (0 400 1600 400) im=ImageList.LoadImage ("e:\ann.png") GraphicsWindow.BackgroundColor ="darkblue 'GraphicsWindow.DrawImage (im 0 0) ii=LDImage.SplitImage(im 12 4) For f=0 To 5 For x= 1 To 12 ss[f][x-1]=Shapes.AddImage(ii[x][2]) Shapes.Move (ss[f][x-1] 1550+f*70 250) Shapes.HideShape (ss[f][x-1]) Shapes.Animate (ss[f][x-1] f*70 250 15000) EndFor EndFor x=0 sw=0 While "true n= Math.Remainder (x 12) For f=0 To 5 Shapes.ShowShape (ss[f][n]) EndFor Program.Delay (80) For f=0 To 5 Shapes.HideShape (ss[f][n]) EndFor x=x+1 If (ldShapes.GetLeft (ss[0][1])<10) And sw=0 Then 'GraphicsWindow.Title= ldShapes.GetLeft (ss[1]) sw=1 For f=0 To 5 For x= 1 To 12 Shapes.Remove (ss[f][x-1]) ss[f][x-1]=Shapes.AddImage(ii[x][3]) Shapes.Move (ss[f][x-1] f*70 250) Shapes.HideShape (ss[f][x-1]) Shapes.Animate (ss[f][x-1] 1600+f*70 250 15000) EndFor EndFor x=0 endif If (ldShapes.GetLeft (ss[0][1])>1595) And sw=1 Then 'GraphicsWindow.Title= ldShapes.GetLeft (ss[1]) sw=0 For f=0 To 5 For x= 1 To 12 Shapes.Remove (ss[f][x-1]) ss[f][x-1]=Shapes.AddImage(ii[x][2]) Shapes.Move (ss[f][x-1] 1550+f*70 250) Shapes.HideShape (ss[f][x-1]) Shapes.Animate (ss[f][x-1] f*70 250 15000) EndFor EndFor x=0 endif EndWhile End>LKD848.sb< Start>LKL810-0.sb< ' Challenge of the Month - by NaochanON LKL810-0 added spinning simulation ' October 2016 Make an animation of a top rotating and moving in the GraphicsWindow make_top() CenterPosition() While "True" Top_move() Program.Delay(25) endwhile Sub Top_move Shapes.Move(el0,Shapes.GetLeft(el0)+pmX*ddx,Shapes.Gettop(el0)+pmY*ddY) XYC="X="+(Shapes.GetLeft(el0)+4)+";Y="+ (Shapes.Gettop(el0)+4) ' base point For i=1 To Array.GetItemCount(shp) If dat[i]["fn"] = "rc" then shx=XYC["X"]+DR[i]*Math.cos( math.GetRadians(DS0[i]+pmx*5))-dat[i]["w"]*s/2 shy=XYC["Y"]+DR[i]*Math.sin( math.GetRadians(DS0[i]+pmx*5))-dat[i]["h"]*s/2 ElseIf dat[i]["fn"] = "tr" then shx=XYC["X"]+DR[i]*Math.cos( math.GetRadians(DS0[i]+pmx*5))-cntr[i]["X"] shy=XYC["Y"]+DR[i]*Math.sin( math.GetRadians(DS0[i]+pmx*5))-cntr[i]["Y"] EndIf Shapes.Move(shp[i],shx,shy) Shapes.Rotate(shp[i],pmX*5) ' in this case it rotates only +5 or -5 degrees EndFor '---------------------------------------------------------------------------------------------- NN=NN+1 shx=XYC["X"]+DR[12]*Math.cos( math.GetRadians(DS0[12]+pmx*5))-dat[12]["w"]*s/2+NN*rot*math.Cos(math.GetRadians(pmx*5)) shy=XYC["Y"]+DR[12]*Math.sin( math.GetRadians(DS0[12]+pmx*5))-dat[12]["h"]*s/2+pmx*NN*rot*math.sin(math.GetRadians(math.Abs(pmx*5))) Shapes.Move(shp[12],shx,shy) ' spinning simulation If NN> dat[2]["w"]*s/rot-2 Then NN=0 EndIf '---------------------------------------------------------------------------------------------- If Shapes.GetLeft(el0)<0 or (Shapes.GetLeft(shp[2])+dat[2]["w"]*s)>1200 Then ' X edge pmX=-pmX EndIf If Shapes.Gettop(el0)<0 or (Shapes.Gettop(shp[11])+dat[11]["y3"]*s)>650 Then ' Y edge pmY=-pmY EndIf EndSub Sub CenterPosition For i= 1 To array.GetItemCount(SHP) If dat[i]["fn"] = "rc" then X[i]=Shapes.GetLeft(SHP[i])+dat[i]["w"]*s/2 ' center of the shape ... X Y[i]=Shapes.GetTop(SHP[i])+dat[i]["h"]*s/2 ' center of the shape ... Y ElseIf dat[i]["fn"] = "tr" then X[i]=Shapes.GetLeft(SHP[i])+cntr[i]["X"] ' center of the shape ... X Y[i]=Shapes.GetTop(SHP[i])+ cntr[i]["Y"] ' center of the shape ... Y EndIf DS0[i]=math.GetDegrees(Math.ArcTan((Y[i]-XYC["Y"])/(X[i]-XYC["X"]))) ' degree // angle of the shape_Center from XYC position DR[i]=Math.SquareRoot((X[i]-XYC["X"])*(X[i]-XYC["X"])+(Y[i]-XYC["Y"])*(Y[i]-XYC["Y"])) ' radius endfor endsub Sub make_top GraphicsWindow.BackgroundColor="Lightcyan" GraphicsWindow.Width=1200 GraphicsWindow.Height=650 dat[1] = "fn=rc;x=156;y=0;w=34;h=70;bc=Brown;pc=Brown;pw=1;" ' dat[2] = "fn=rc;x=0;y=70;w=346;h=20;bc=Green;pc=Green;pw=1;" ' dat[3] = "fn=rc;x=0;y=90;w=346;h=20;bc=Red;pc=Red;pw=1;" ' dat[4] = "fn=rc;x=0;y=110;w=346;h=20;bc=Yellow;pc=Yellow;pw=1;" ' dat[5] = "fn=tr;x=0;y=130;x1=0;y1=0;x2=48;y2=0;x3=48;y3=20;bc=Pink;pc=Pink;pw=1;" ' dat[6] = "fn=rc;x=48;y=130;w=250;h=20;bc=Pink;pc=Pink;pw=1;" ' dat[7] = "fn=tr;x=298;y=130;x1=0;y1=0;x2=48;y2=0;x3=0;y3=20;bc=Pink;pc=Pink;pw=1;" ' dat[8] = "fn=tr;x=48;y=150;x1=0;y1=0;x2=48;y2=0;x3=48;y3=20;bc=Lightgray;pc=Lightgray;pw=1;" ' dat[9] = "fn=rc;x=96;y=150;w=154;h=20;bc=Lightgray;pc=Lightgray;pw=1;" ' dat[10] = "fn=tr;x=250;y=150;x1=0;y1=0;x2=48;y2=0;x3=0;y3=20;bc=Lightgray;pc=Lightgray;pw=1;" ' dat[11] = "fn=tr;x=96;y=170;x1=0;y1=0;x2=154;y2=0;x3=77;y3=60;bc=cyan;pc=cyan;pw=1;" ' dat[12] = "fn=rc;x=0;y=70;w=16;h=60;bc=Black;pc=Black;pw=1;" ' spinning mark s=0.8 X0=100 Y0=100 For i = 1 To Array.GetItemCount(dat) GraphicsWindow.Penwidth = dat[i]["pw"]*s GraphicsWindow.PenColor = dat[i]["pc"] GraphicsWindow.BrushColor = dat[i]["bc"] If dat[i]["fn"] = "rc" Then SHP[i] = shapes.Addrectangle(dat[i]["w"]*s, dat[i]["h"]*s) ElseIf dat[i]["fn"] = "tr" Then SHP[i]= Shapes.Addtriangle(dat[i]["x1"]*s, dat[i]["y1"]*s, dat[i]["x2"]*s, dat[i]["y2"]*s, dat[i]["x3"]*s, dat[i]["y3"]*s) cntr[i]="X="+((math.Max(dat[i]["x2"],dat[i]["x3"])-dat[i]["x1"])*s/2)+";Y="+ ((math.Max(dat[i]["y2"],dat[i]["y3"])-dat[i]["y1"])*s/2) EndIf shapes.Move(SHP[i], X0+dat[i]["x"]*s, Y0+dat[i]["y"]*s) EndFor '---------------------------------------------------------------------------------------------- GraphicsWindow.BrushColor="Transparent" GraphicsWindow.PenColor="Lightcyan" el0= Shapes.AddEllipse(8,8) Shapes.Move(el0,Shapes.GetLeft(shp[1])-170*s,Shapes.Gettop(shp[1])-10) XYC="X="+(Shapes.GetLeft(el0)+4)+";Y="+ (Shapes.Gettop(el0)+4) ' base point '---------------------------------------------------------------------------------------------- ddx=-5 ddy=-1 pmX=1 pmY=1 rot=12 EndSub End>LKL810-0.sb< Start>LKL810.sb< ' Challenge of the Month - by NaochanON ' October 2016 Make an animation of a top rotating and moving in the GraphicsWindow make_top() CenterPosition() While "True" Top_move() Program.Delay(25) endwhile Sub Top_move Shapes.Move(el0,Shapes.GetLeft(el0)+pmX*ddx,Shapes.Gettop(el0)+pmY*ddY) XYC="X="+(Shapes.GetLeft(el0)+4)+";Y="+ (Shapes.Gettop(el0)+4) For i=1 To Array.GetItemCount(shp) If dat[i]["fn"] = "rc" then shx=XYC["X"]+(DR[i]*Math.cos( math.GetRadians(DS0[i]+pmx*5))-dat[i]["w"]*s/2) shy=XYC["Y"]+(DR[i]*Math.sin( math.GetRadians(DS0[i]+pmx*5))-dat[i]["h"]*s/2) ElseIf dat[i]["fn"] = "tr" then shx=XYC["X"]+(DR[i]*Math.cos( math.GetRadians(DS0[i]+pmx*5))-(math.Max(dat[i]["x2"],dat[i]["x3"])-dat[i]["x1"])*s/2) shy=XYC["Y"]+(DR[i]*Math.sin( math.GetRadians(DS0[i]+pmx*5))-(math.Max(dat[i]["y2"],dat[i]["y3"])-dat[i]["y1"])*s/2 ) EndIf Shapes.Move(shp[i],shx,shy) Shapes.Rotate(shp[i],pmX*5) EndFor If Shapes.GetLeft(el0)<0 or (Shapes.GetLeft(shp[2])+dat[2]["w"]*s)>1200 Then pmX=-pmX EndIf If Shapes.Gettop(el0)<0 or (Shapes.Gettop(shp[11])+dat[11]["y3"]*s)>650 Then pmY=-pmY EndIf EndSub Sub CenterPosition For i= 1 To array.GetItemCount(SHP) If dat[i]["fn"] = "rc" then X[i]=Shapes.GetLeft(SHP[i])+dat[i]["w"]*s/2 ' center of the shape ... X Y[i]=Shapes.GetTop(SHP[i])+dat[i]["h"]*s/2 ' center of the shape ... Y ElseIf dat[i]["fn"] = "tr" then X[i]=Shapes.GetLeft(SHP[i])+(math.Max(dat[i]["x2"],dat[i]["x3"])-dat[i]["x1"])*s/2 ' center of the shape ... X Y[i]=Shapes.GetTop(SHP[i])+ (math.Max(dat[i]["y2"],dat[i]["y3"])-dat[i]["y1"])*s/2 ' center of the shape ... Y EndIf DS0[i]=math.GetDegrees(Math.ArcTan((Y[i]-XYC["Y"])/(X[i]-XYC["X"]))) ' degree // angle of the shape_Center from XYC position DR[i]=Math.SquareRoot((X[i]-XYC["X"])*(X[i]-XYC["X"])+(Y[i]-XYC["Y"])*(Y[i]-XYC["Y"])) ' radius endfor endsub Sub make_top GraphicsWindow.BackgroundColor="Lightcyan" GraphicsWindow.Width=1200 GraphicsWindow.Height=650 dat[1] = "fn=rc;x=156;y=0;w=34;h=70;bc=Brown;pc=Brown;pw=1;" ' dat[2] = "fn=rc;x=0;y=70;w=346;h=20;bc=Green;pc=Green;pw=1;" ' dat[3] = "fn=rc;x=0;y=90;w=346;h=20;bc=Red;pc=Red;pw=1;" ' dat[4] = "fn=rc;x=0;y=110;w=346;h=20;bc=Yellow;pc=Yellow;pw=1;" ' dat[5] = "fn=tr;x=0;y=130;x1=0;y1=0;x2=48;y2=0;x3=48;y3=20;bc=Pink;pc=Pink;pw=1;" ' dat[6] = "fn=rc;x=48;y=130;w=250;h=20;bc=Pink;pc=Pink;pw=1;" ' dat[7] = "fn=tr;x=298;y=130;x1=0;y1=0;x2=48;y2=0;x3=0;y3=20;bc=Pink;pc=Pink;pw=1;" ' dat[8] = "fn=tr;x=48;y=150;x1=0;y1=0;x2=48;y2=0;x3=48;y3=20;bc=Lightgray;pc=Lightgray;pw=1;" ' dat[9] = "fn=rc;x=96;y=150;w=154;h=20;bc=Lightgray;pc=Lightgray;pw=1;" ' dat[10] = "fn=tr;x=250;y=150;x1=0;y1=0;x2=48;y2=0;x3=0;y3=20;bc=Lightgray;pc=Lightgray;pw=1;" ' dat[11] = "fn=tr;x=96;y=170;x1=0;y1=0;x2=154;y2=0;x3=77;y3=60;bc=cyan;pc=cyan;pw=1;" ' s=1 X0=100 Y0=100 For i = 1 To Array.GetItemCount(dat) GraphicsWindow.Penwidth = dat[i]["pw"]*s GraphicsWindow.PenColor = dat[i]["pc"] GraphicsWindow.BrushColor = dat[i]["bc"] If dat[i]["fn"] = "rc" Then SHP[i] = shapes.Addrectangle(dat[i]["w"]*s, dat[i]["h"]*s) ElseIf dat[i]["fn"] = "tr" Then SHP[i]= Shapes.Addtriangle(dat[i]["x1"]*s, dat[i]["y1"]*s, dat[i]["x2"]*s, dat[i]["y2"]*s, dat[i]["x3"]*s, dat[i]["y3"]*s) EndIf shapes.Move(SHP[i], X0+dat[i]["x"]*s, Y0+dat[i]["y"]*s) EndFor GraphicsWindow.BrushColor="Transparent" GraphicsWindow.PenColor="Lightcyan" el0= Shapes.AddEllipse(8,8) Shapes.Move(el0,Shapes.GetLeft(shp[1])-170,Shapes.Gettop(shp[1])-10) XYC="X="+(Shapes.GetLeft(el0)+4)+";Y="+ (Shapes.Gettop(el0)+4) '---------------------------------------------------------------------------------------------- ddx=-5 ddy=-1 pmX=1 pmY=1 EndSub End>LKL810.sb< Start>LKS007.sb< Turtle.Speed=10 Turtle.X=180 Turtle.y=120 Turtle.Angle=45 GraphicsWindow.BackgroundColor="black" GraphicsWindow.PenColor="red" Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.X=145 Turtle.Y=235 Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.x=500 Turtle.y= 120 Turtle.Angle=45 GraphicsWindow.PenColor="red" Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.Turn(95) Turtle.Move(150) Turtle.X=455 Turtle.y=235 Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.Move(75) Turtle.Turn(197) Turtle.X=352.5 Turtle.y= 320 Turtle.Angle=80 Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.Turn(75) Turtle.Move(30) Turtle.X=395 Turtle.Y =400 Turtle.Angle=-99 Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Angle=-148.5 Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) Turtle.Turn(1) Turtle.Move(1) End>LKS007.sb< Start>LKS836.sb< 'Challenge of the Month - February 2019 'Banner Challenge 'Make a smoothly scrolling text banner for the GraphicsWindow. 'Try using different font styles, colours, transparency and other effects to make the 'scrolling effect as fun as possible. 'Consider using Shapes or Controls, with Move or Animate. gw = 400 gh = 200 GraphicsWindow.Hide() GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Left = (Desktop.Width - gw) /2 GraphicsWindow.Top = (Desktop.Height - gh) /2 GraphicsWindow.Title = "Banner Challenge" GraphicsWindow.Show() GraphicsWindow.KeyUp = ExitProgram Sub ExitProgram If GraphicsWindow.LastKey = "Escape" Then Program.End() EndIf EndSub GraphicsWindow.BrushColor = "Black" i = 1 x = 330 a = "Hello World" b = "It's a beautiful day!" c = "a" Item = Controls.AddButton(a, x, 80) While i = 1 Controls.Move(Item, x - 10, 80) Program.Delay(8) x = x - 0.5 If x = 1 Then x = 400 EndIf If c = "a" And x = 400 Then Controls.SetButtonCaption(Item, b) c = "b" ElseIf c = "b" And x = 400 Then Controls.SetButtonCaption(Item, a) c = "a" EndIf EndWhile End>LKS836.sb< Start>LKV739.sb< 'The blue and green are the same colour (Cyan) gw = 500 gh = gw GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.PenWidth = 0 width = 5 For row = 1 To 10 y = (row-1)*50 For col = 1 To gw/width/2 x = (col-1)*2*width rem = Math.Remainder(row,4) If (rem = 0) Then GraphicsWindow.BrushColor = "Magenta" GraphicsWindow.FillRectangle(x,y,width,gh/10) GraphicsWindow.BrushColor = "Orange" GraphicsWindow.FillRectangle(x+width,y,width,gh/10) ElseIf (rem = 1) Then GraphicsWindow.BrushColor = "Magenta" GraphicsWindow.FillRectangle(x,y,width,gh/10) GraphicsWindow.BrushColor = "Cyan" GraphicsWindow.FillRectangle(x+width,y,width,gh/10) ElseIf (rem = 2) Then GraphicsWindow.BrushColor = "Magenta" GraphicsWindow.FillRectangle(x,y,width,gh/10) GraphicsWindow.BrushColor = "Orange" GraphicsWindow.FillRectangle(x+width,y,width,gh/10) Else GraphicsWindow.BrushColor = "Cyan" GraphicsWindow.FillRectangle(x,y,width,gh/10) GraphicsWindow.BrushColor = "Orange" GraphicsWindow.FillRectangle(x+width,y,width,gh/10) EndIf EndFor EndFor End>LKV739.sb< Start>LKW593-0.sb< Sub init qbc=LDText.Split("Black,DarkBlue,DarkGreen,DarkCyan,DarkRed,DarkMagenta,DarkYellow,Gray,DarkGray,Blue,Green,Cyan,Red,Magenta,Yellow,White" ",") not="true=false;false=true bgc=1 fgc=7 s200=120 '------------------max prg.lines LDGraphicsWindow.TransparentGW() insm="true mm["File"]="Main mm["New"]="File mm["Open"]="File mm["OpenDfs"]="File mm["Save"]="File mm["-"]="File mm["Exit"]="File mm["Edit"]="Main mm["Replace"]="Edit mm["List"]="Edit mm["ListDfs"]="Edit ch["ListDfs"]="false mm["AutoLinNr"]="Edit ch["AutoLinNr"]="true mm["TrOverType"]="Edit ch["TrOverType"]="true mm["UnMute"]="Edit ch["UnMute"]="true mm["Run"]="Main mm["Start"]="Run mm["Stop"]="Run mm["BgClr"]="Main mm[""]="bgclr For x=1 To 16 mm["|"+qbc[x]+" -> "+(x-1)]="BgClr EndFor mm["FgClr"]="Main mm[">unset<"]="fgclr For x=1 To 16 mm["/"+qbc[x]+" <- "+(x-1)]="FgClr EndFor ' GraphicsWindow.ShowMessage(mm "") sf=1.25 GraphicsWindow.Left=5 GraphicsWindow.top=5 LDGraphicsWindow.TopMost="true Timer.Interval=250 Timer.Tick=ttt TextWindow.Left=5 TextWindow.Top=5 ms=LDControls.AddMenu(500 30 mm "" ch) LDShapes.BrushColour(ms "SandyBrown") LDShapes.PenColour(ms "black") LDControls.MenuClicked=mcc LDControls.MenuBackground(ms "gold") TextWindow.BackgroundColor="darkblue TextWindow.Clear() TextWindow.Title="QBasic Editor LDTextWindow.SetColour(7 "#aaaaaa") TextWindow.ForegroundColor=7 'TextWindow.WriteLine("Edit:") LDTextWindow.KeyDown=kkk LDTextWindow.Keyup=kuu not="false=true;true=false cps="false ldTextWindow.Encoding="Unicode 'TextWindow.Write("░▒▓█┌─┐│┼┴┬┤├└┘") mem=LDFastArray.add() For wy=1 To s200 For wx=1 To 160 LDFastArray.set3D(mem wx wy 3 " ") LDFastArray.set3D(mem wx wy 1 1) LDFastArray.set3D(mem wx wy 2 7) EndFor EndFor If LDControls.MenuChecked(ms "Autolinnr") Then lll=lll+10 wlnr() EndIf EndSub nnn=Text.GetCharacter(13)+Text.GetCharacter(10) ttb=Text.GetCharacter(9) args=0 init() Sub wlnr wt=lll+":" For xx=1 To Text.GetLength(wt) ldcall.function("twrt" Text.GetSubText(wt xx 1)) EndFor EndSub Sub wsetup If www="true" Then Else GraphicsWindow.Width=600 GraphicsWindow.Height=400 www="true GraphicsWindow.BrushColor="tan GraphicsWindow.FillRectangle(0 0 GraphicsWindow.Width GraphicsWindow.Height) GraphicsWindow.Show() GraphicsWindow.BackgroundColor="tan EndIf EndSub While 1=1'---------------mainloop=============== If rnn Then TextWindow.Title="running >>> Timer.Pause() GraphicsWindow.Hide() indd="true arrmk() arr=LDText.Replace(arr "?" "print ") arr=LDText.Replace(arr "!" "wrt ") ' GraphicsWindow.ShowMessage(arr "") TextWindow.Clear() pl=LDText.Split(arr nnn) ln=1 dfmk() For gg=1 To Array.GetItemCount(pl)'----------make gotolbl index------- li=LDText.Split(text.ConvertToLowerCase(pl[gg]) ":") pl[gg]=LDText.Replace(pl[gg] "msin" "Math.sin") For qq=1 To Array.GetItemCount(arrd) pl[gg]=LDText.Replace(pl[gg] arrd[qq][1] arrd[qq][2]) EndFor gtt[li[1]]=gg EndFor 'GraphicsWindow.ShowMessage(pl "") 'TextWindow.WriteLine(gtt) While ln<=Array.GetItemCount(pl)'--------main run loop-------================== li=LDText.Split((pl[ln]) ":") For mi=2 To Array.GetItemCount(li) vi=LDText.Split(ldtext.replace(li[mi] "=" " = ") " ") vi[1]=text.ConvertToLowerCase(vi[1]) If vi[2]="=" Then vi[2]=vi[1] vi[1]="set" EndIf If Text.StartsWith(vi[1] "inpu") Then varr[vi[2]]=fcDialogs.AskForTextLine(vi[3]) ElseIf Text.StartsWith(vi[1] "paus") Then Program.Delay(vi[2]) ElseIf Text.StartsWith(vi[1] "sptr") Then memm[varr[vi[2]]]=varr[vi[3]] ' GraphicsWindow.ShowMessage(memm "") ElseIf Text.StartsWith(vi[1] "gosub") Then Stack.PushValue("gss" ln+1) ln=gtt[vi[2]] Goto ccc ElseIf Text.StartsWith(vi[1] "ret") Then If Stack.GetCount("gss")>0 Then ln=Stack.PopValue("gss") Goto ccc Else fcDialogs.ShowMessageAsError("ret w/o gosub on #"+ln+":"+gtt[ln]) EndIf ElseIf Text.StartsWith(vi[1] "cp") or Text.StartsWith(vi[1] "cmp") Then oa=varr["a"] oa=oa-vi[2] If oa=0 Then zff="true Else zff="false EndIf ElseIf Text.StartsWith(vi[1] "push") Then Stack.PushValue("reg" varr[vi[2]]) ElseIf Text.StartsWith(vi[1] "pop") and Stack.GetCount("reg")>0 Then varr[vi[2]]=Stack.PopValue("reg") ElseIf Text.StartsWith(vi[1] "add") Then varr[vi[2]]=varr[vi[2]]+varr[vi[3]] ElseIf Text.StartsWith(vi[1] "sub") Then varr[vi[2]]=varr[vi[2]]-varr[vi[3]] ElseIf Text.StartsWith(vi[1] "schr") Then TextWindow.Write(Text.GetCharacter(ldcall.Function("eptr" vi[2]))) ElseIf Text.StartsWith(vi[1] "inc") Then ii=vi[3] If ii=0 or ii="" Then ii=1 EndIf varr[vi[2]]=varr[vi[2]]+ii ElseIf Text.StartsWith(vi[1] "dec") Then ii=vi[3] If ii=0 or ii="" Then ii=1 EndIf varr[vi[2]]=varr[vi[2]]-ii ElseIf Text.StartsWith(vi[1] "djnz") Then varr["bc"]=varr["bc"]-1 If varr["bc"]>0 Then ln=gtt[vi[2]] Goto ccc EndIf ElseIf Text.StartsWith(vi[1] "jpz") and zff Then ln=gtt[vi[2]] Goto ccc ElseIf Text.StartsWith(vi[1] "jpnz") and not[zff] Then ln=gtt[vi[2]] Goto ccc ElseIf Text.StartsWith(vi[1] "goto") Then ln=gtt[vi[2]] Goto ccc ElseIf Text.StartsWith(vi[1] "if") Then If LDMath.Evaluate3( LDCall.Function("wset" vi[2])) Then ln=gtt[vi[3]] Else ln=gtt[vi[4]] EndIf Goto ccc ElseIf Text.StartsWith(vi[1] "plot") Then wsetup() GraphicsWindow.SetPixel(LDMath.Evaluate2(LDCall.Function("wset" vi[2])+"+0") LDMath.Evaluate2(LDCall.Function("wset" vi[3])+"+0") vi[4]) ElseIf Text.StartsWith(vi[1] "set")or Text.StartsWith(vi[1] "ld") or (vi[1]= "mov") Then varr[vi[2]]=LDMath.Evaluate2(LDCall.Function("wset" vi[3])+"+0") ElseIf Text.StartsWith(vi[1] "@pri") Then TextWindow.CursorLeft=vi[3] TextWindow.CursorTop=vi[4] Goto pp ElseIf Text.StartsWith(vi[1] "prin") Then pp: LDCall.Function("cltxt" ldtext.Replace(ldtext.Replace(ldtext.Replace(ldtext.Replace( LDCall.Function("numm" LDCall.Function("wset" vi[2])) "\n" nnn)"\t" ttb) "[" " = " )"\s" " ")) ElseIf Text.StartsWith(vi[1] "wrt") Then TextWindow.Write( ldtext.Replace(ldtext.Replace(ldtext.Replace(ldtext.Replace( LDCall.Function("numm" LDCall.Function("wset" vi[2])) "\n" nnn)"\t" ttb) "[" " = " )"\s" " ")) EndIf EndFor ln=ln+1 ccc: EndWhile TextWindow.Title="ok GraphicsWindow.ShowMessage("OK Done." "QBasic") GraphicsWindow.Show() www="false GraphicsWindow.Height=25 GraphicsWindow.Width=300 Timer.Resume() plist() rnn="false indd=rnn EndIf EndWhile Sub numm If FCExtensions.IsNumber(args[1]) Then return=LDMath.FixDecimal(args[1] 4) Else return=(args[1]) EndIf EndSub Sub plist TextWindow.Clear() ' arrmk() ' arr=LDText.Replace(arr "?" "Print ") ' arr2mm() mwrt() TextWindow.CursorLeft=0 TextWindow.CursorTop=1 EndSub Sub wset ii=args[1] ac=Array.GetAllIndices(varr) For rt=1 To Array.GetItemCount(ac) ii=LDText.Replace(ii "#"+ac[rt] varr[ac[rt]]) EndFor return=ii EndSub Sub eptr If Text.StartsWith(args[1] "$") Then return=memm[varr[text.GetSubTextToEnd( args[1] 2)]] Else return=args[1] EndIf EndSub Sub arrmk'---------------create array from edits arr="" For wy=1 To s200 al="" For wx=1 To 158 al=Text.Append(al LDFastArray.get3D(mem wx wy 3)) ppr= LDFastArray.get3D(mem wx wy 1) ppi= LDFastArray.get3D(mem wx wy 2) if ppi<>7 or ppr<>1 Then al=Text.Append(al "^"+ppr+"^"+ppi+"&") EndIf EndFor arr=Text.Append(arr al+nnn) EndFor EndSub Sub dfmk'---------------create array from defines arrd="" For wy=1 To 50 al="" For wx=1 To 158 al=Text.Append(al LDFastArray.get2D(memd wx wy)) EndFor al=LDText.Trim(al) arrd[wy]=LDText.Split(al ":") EndFor ' GraphicsWindow.ShowMessage(arrd "") EndSub Sub arr2mm'--------------fastarray recreate in=0 For wy=1 To s200 For wx=1 To 158 in=in+1 LDFastArray.set3D(mem wx wy 3 text.GetSubText(arr in 1)) EndFor While text.GetCharacterCode(text.GetSubText(arr in 1))>31 in=in+1 EndWhile in=in+1 EndFor EndSub Sub memdel For wy=1 To s200 For wx=1 To 158 LDFastArray.set3D(mem wx wy 3 " ") LDFastArray.set3D(mem wx wy 1 1) LDFastArray.set3D(mem wx wy 2 7) EndFor EndFor EndSub Sub loadmem ca=LDText.Split(cc nnn) memdel() For wy=1 To Array.GetItemCount(ca) For fx=1 To Text.GetLength(ca[wy]) LDFastArray.set3D(mem fx wy 3 text.GetSubText(ca[wy] fx 1)) EndFor EndFor EndSub Sub twrt'----------------memo&shw input px=TextWindow.CursorLeft+1 py=TextWindow.CursorTop+1 txx=args[1] If insm Then For tq=158 To px Step -1 For z=1 To 3 ch[z]=LDFastArray.get3D(mem tq py z) LDFastArray.Set3D(mem tq+1 py z ch[z]) EndFor LDCall.Function5("cwrt" tq py ch[3] ch[1] ch[2]) EndFor LDFastArray.Set3D(mem px py 3 txx) ott: LDFastArray.Set3D(mem px py 1 bgc) LDFastArray.Set3D(mem px py 2 fgc) LDCall.Function5("cwrt" px-1 py txx bgc fgc) Else ' For rw=1 To Text.GetLength(txx) LDFastArray.Set3D(mem px py 3 txx) If not[LDControls.MenuChecked(ms "TrOverType")] Then Goto ott EndIf bgc=LDFastArray.get3D(mem px py 1) fgc=LDFastArray.get3D(mem px py 2) ' EndFor qss: LDCall.Function5("cwrt" px-1 py txx bgc fgc) ' GraphicsWindow.ShowMessage(txx+"^"+bgc+"^"+fgc "") EndIf TextWindow.CursorLeft=px TextWindow.CursorTop=py-1 EndSub Sub cwrt TextWindow.BackgroundColor=args[4] TextWindow.ForegroundColor=args[5] TextWindow.CursorLeft=args[1] TextWindow.CursorTop=args[2]-1 TextWindow.Write(args[3]) EndSub sub cltxt ttw=LDText.Split(args[1] "&") for tx=1 to Array.GetItemCount(ttw) wq=LDText.Split(ttw[tx] "^") if wq[2]="" then wq[2]=1 EndIf if wq[3]="" then wq[3]=7 EndIf ldcall.Function5("cwrt" TextWindow.CursorLeft TextWindow.CursorTop+1 wq[1] wq[2] wq[3]) EndFor EndSub Sub mcc'-----------------menu handling---------------- ii=text.ConvertToLowerCase( LDControls.LastMenuItem) If ii="new" Then TextWindow.Clear() ElseIf ii="unmute" Then indd=not[LDControls.MenuChecked(ms "UnMute")] ElseIf ii="start" Then rnn="true ElseIf ii="stop" Then rnn="false ElseIf ii="exit" Then Program.End() ElseIf ii="list" Then plist() ElseIf ii="replace" Then indd="true tf=FCDialogs.AskForTextLine("text to fnd:") If tf="" Then Else tr=FCDialogs.AskForTextLine("text to replace:") arrmk() arr=LDText.Replace(arr tf tr) ' GraphicsWindow.ShowMessage(arr "") arr2mm() TextWindow.Clear() mwrt() EndIf indd="false ElseIf Text.StartsWith(ii "|") Then bgc=Text.GetSubTextToEnd(ii Text.GetLength(ii)-1) If not[FCExtensions.IsNumber(bgc)] Then bgc=-1 Else bgc=LDText.Trim(bgc) EndIf ElseIf Text.StartsWith(ii "/") Then fgc=Text.GetSubTextToEnd(ii Text.GetLength(ii)-1) If not[FCExtensions.IsNumber(bgc)] Then fgc=-1 Else fgc=LDText.Trim(fgc) EndIf ElseIf ii="save" Then indd="true ff=LDDialogs.saveFile("1=txt;2=bas;3=sb;4=itt" "e:\") mw=LDFastArray.ToArray(mem) ' The following line could be harmful and has been automatically commented. ' File.WriteContents(ff mw) indd="false ElseIf ii="open" Then indd="true ff=LDDialogs.OpenFile("1=txt;2=bas;3=sb;4=itt" "e:\") ' The following line could be harmful and has been automatically commented. ' If LDFile.Exists(ff) Then ' The following line could be harmful and has been automatically commented. ' cc=File.ReadContents(ff) TextWindow.Clear() If Text.IsSubText(ff ".itt") Then mem=LDFastArray.CreateFromValues(cc) mwrt() Else loadmem() mwrt() EndIf indd="false TextWindow.Title=ff EndIf ElseIf ii="opendfs" Then indd="true ff=LDDialogs.OpenFile("1=itt;2=dff" "e:\") ' The following line could be harmful and has been automatically commented. ' If LDFile.Exists(ff) Then ' The following line could be harmful and has been automatically commented. ' cc=File.ReadContents(ff) TextWindow.Clear() memd=LDFastArray.CreateFromValues(cc) mwrt() EndIf indd="False EndIf 'TextWindow.Title=ii EndSub Sub mwrt'----------------list cmd If LDControls.MenuChecked(ms "listdfs") Then p50=50 Else p50=0 EndIf For wy=1 To s200 For wx=1 To 150 LDCall.Function5("cwrt" wx-1 wy+p50 LDFastArray.Get3D(mem wx wy 3) LDFastArray.Get3D(mem wx wy 1) LDFastArray.Get3D(mem wx wy 2) ) EndFor EndFor If LDControls.MenuChecked(ms "listdfs") Then TextWindow.CursorLeft=0 TextWindow.CursorTop=0 TextWindow.BackgroundColor="darkred TextWindow.ForegroundColor="yellow TextWindow.Write("#defines:") For wy=1 To 50 For wx=1 To 158 TextWindow.CursorLeft=wx-1 TextWindow.CursorTop=wy TextWindow.Write(LDFastArray.Get2D(memd wx wy)) EndFor EndFor EndIf TextWindow.BackgroundColor="darkblue TextWindow.ForegroundColor="gray TextWindow.CursorLeft=0 TextWindow.CursorTop=p50 EndSub Sub ttt'-----------------Timer GraphicsWindow.Left=TextWindow.Left/sf+35 GraphicsWindow.Top=TextWindow.Top/sf EndSub Sub kuu'-----------------kyup lky=text.ConvertToLowerCase( LDTextWindow.LastKey) If Text.EndsWith(lky "iftkey") and not[cps] Then shh="false EndIf EndSub Sub kkk'-----------------keybrd-handling---------- If indd Then Else lk=text.ConvertToLowerCase( LDTextWindow.LastKey) 'TextWindow.WriteLine(lk) ' TextWindow.Title=lk If lk="return" Then 'TextWindow.WriteLine("") TextWindow.CursorLeft=0 TextWindow.CursorTop=TextWindow.CursorTop+1 If LDControls.MenuChecked(ms "Autolinnr") Then lll=lll+10 wlnr() EndIf ElseIf lk="left" Then If TextWindow.CursorLeft>0 Then TextWindow.CursorLeft=TextWindow.CursorLeft-1 EndIf ElseIf lk="delete" Then dell: px=TextWindow.CursorLeft+1 py=TextWindow.CursorTop+1 rr="" For tq= px To 158 For z=1 To 3 ch[z]=LDFastArray.get3D(mem tq+1 py z) LDFastArray.Set3D(mem tq py z ch[z]) EndFor LDCall.Function5("cwrt" tq-1 py ch[3] ch[1] ch[2]) EndFor LDFastArray.Set3D(mem 159 py 3 " ") LDFastArray.Set3D(mem 160 py 3 " ") TextWindow.Write(rr) TextWindow.CursorLeft=px-1 TextWindow.CursorTop=py-1 ElseIf lk="insert" Then insm=not[insm] ElseIf lk="oemtilde" Then If shh Then ldcall.function("twrt" "@") Else ldcall.function("twrt" "#") EndIf ElseIf lk="tab" Then ldcall.function("twrt" ttb) ElseIf lk="oem5" Then ldcall.function("twrt" "\") ElseIf lk="oem7" Then ldcall.function("twrt" "'") ElseIf lk="oemplus" Then ldcall.function("twrt" "=") ElseIf lk="down" Then TextWindow.CursorTop=TextWindow.CursorTop+1 ElseIf lk="up" Then If TextWindow.CursorTop>0 Then TextWindow.CursorTop=TextWindow.CursorTop-1 EndIf ElseIf lk="right" Then TextWindow.CursorLeft=TextWindow.CursorLeft+1 ElseIf Text.EndsWith(lk "iftkey") Then shh="true ElseIf Text.EndsWith(lk "uestion") Then If shh Then ldcall.function("twrt" "?") Else ldcall.function("twrt" "/") EndIf ElseIf Text.EndsWith(lk "kets") Then If shh Then ldcall.function("twrt" "[") Else ldcall.function("twrt" "(") EndIf ElseIf Text.EndsWith(lk "em6") Then If shh Then ldcall.function("twrt" "]") Else ldcall.function("twrt" ")") EndIf ElseIf Text.EndsWith(lk "em1") Then If shh Then ldcall.function("twrt" ";") Else ldcall.function("twrt" ":") EndIf ElseIf Text.EndsWith(lk "omma") Then If shh Then ldcall.function("twrt" "<") Else ldcall.function("twrt" ",") EndIf ElseIf Text.EndsWith(lk "iod") Then If shh Then ldcall.function("twrt" ">") Else ldcall.function("twrt" ".") EndIf ElseIf Text.EndsWith(lk "pital") Then cps=not[cps] If CPS Then shh="true Else shh="false EndIf ElseIf lk="space" Then If shh Then ldcall.function("twrt" "_") Else ldcall.function("twrt" " ") EndIf 'TextWindow.CursorLeft=TextWindow.CursorLeft-1 ElseIf lk="add" Then ldcall.function("twrt" "+") ElseIf lk="subtract" Then ldcall.function("twrt" "-") ElseIf lk="multiply" Then ldcall.function("twrt" "*") ElseIf lk="divide" Then ldcall.function("twrt" "/") ElseIf lk="back" Then If insm and TextWindow.CursorLeft>0 Then TextWindow.CursorLeft=TextWindow.CursorLeft-1 Goto dell ElseIf TextWindow.CursorLeft>0 Then TextWindow.CursorLeft=TextWindow.CursorLeft-1 ldcall.function("twrt" " ") TextWindow.CursorLeft=TextWindow.CursorLeft-1 EndIf Else If shh Then If lk="d1" Then ldcall.function("twrt" "$") elseIf lk="d2" Then ldcall.function("twrt" "!") Else ldcall.function("twrt" text.ConvertToUpperCase( Text.GetSubTextToEnd(lk Text.GetLength(lk)))) EndIf Else ldcall.function("twrt" Text.GetSubTextToEnd(lk Text.GetLength(lk))) EndIf ' ldcall.function("twrt" "<") ' TextWindow.CursorLeft=TextWindow.CursorLeft-1 EndIf EndIf EndSub End>LKW593-0.sb< Start>LKX813.sb< ' Draughts ' Version 0.1 ' Copyright © 2016 Nonki Takahashi. The MIT License. ' ' History : ' 0.1 2016-11-28 Simple version created. ' GraphicsWindow.Title = "Draughts 0.1" GraphicsWindow.BackgroundColor = "#003300" InitBoard() InitChessmen() picked = "" GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseMove = OnMouseMove GraphicsWindow.MouseUp = OnMouseUp Sub InitBoard pos = "x0=120;y0=30;" ' left, top board[8] = "b=B;d=B;f=B;h=B;" board[7] = "a=B;c=B;e=B;g=B;" board[6] = "b=B;d=B;f=B;h=B;" board[3] = "a=W;c=W;e=W;g=W;" board[2] = "b=W;d=W;f=W;h=W;" board[1] = "a=W;c=W;e=W;g=W;" color = "W=white;B=#330000;0=SaddleBrown;1=BurlyWood;" size = 48 ' font height and square size For j = 8 To 1 Step - 1 y = pos["y0"] + (8 - j) * size For i = 1 To 8 x = pos["x0"] + (i - 1) * size GraphicsWindow.BrushColor = color[Math.Remainder((i + j), 2)] GraphicsWindow.FillRectangle(x, y, size, size) EndFor EndFor EndSub Sub InitChessmen ' param size - font height and square size ' return nMen - number of chessmen ' return index - index of chessmen GraphicsWindow.PenWidth = 0 For j = 8 To 1 Step - 1 y = pos["y0"] + (8 - j) * size For i = 1 To 8 x = pos["x0"] + (i - 1) * size p = board[j][Text.GetSubText("abcdefgh", i, 1)] If p <> "" Then GraphicsWindow.BrushColor = color[Text.GetSubText(p, 1, 1)] obj = Shapes.AddEllipse(size * 0.8, size * 0.8) men[obj]["x"] = x men[obj]["y"] = y Shapes.Move(obj, men[obj]["x"] + size * 0.1, men[obj]["y"] + size * 0.1) EndIF EndFor EndFor nMen = Array.GetItemCount(men) index = Array.GetAllIndices(men) EndSub Sub OnMouseDown mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY For i = 1 To nMen obj = index[i] x = men[obj]["x"] y = men[obj]["y"] If x <= mx And mx <= x + size And y <= my And my <= y + size Then picked = obj dx = mx - x dy = my - y i = nMen + 1 ' break EndIf EndFor EndSub Sub OnMouseMove If picked <> "" Then mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY x = mx - dx y = my - dy men[picked]["x"] = x men[picked]["y"] = y Shapes.Move(picked, x, y) EndIf EndSub Sub OnMouseUp picked = "" EndSub End>LKX813.sb< Start>LLC088.sb< GraphicsWindow.BackgroundColor ="teal GraphicsWindow.Width =1300 GraphicsWindow.Height =800 GraphicsWindow.Left =10 GraphicsWindow.Top =10 GraphicsWindow.BrushColor="white GraphicsWindow.PenWidth=0 GraphicsWindow.Title ="Artia Serif LDUtilities.ShowNoShapeErrors="false Turtle.Speed =10 Turtle.Show () Turtle.Angle=0 GraphicsWindow.Clear () LDEvents.MouseWheel =mww args=0 scc=1 ox=0 oy=0 Turtle.PenUp () 'Goto yyy LDCall.Function4 ("dodrw" 40 100 300 "quentym") LDCall.Function4 ("dodrw" 30 100 600 "manual") Sub dodrw tt=args[4] c40=args[1] sx=args[2] sy=args[3] If tt="" Then 'repeat last text else ddd=tt endif dx=sx For w=1 to Text.GetLength (ddd) cc=text.GetSubText (ddd w 1) dx=dx+LDCall.Function ("fposx" cc) dy=LDCall.Function ("fposy" cc) LDCall.Function ("dcch" cc) dx=dx+nx endfor EndSub Sub fposy ac=args[1] If Text.IsSubText ("uy" ac) Then return=sy-50 elseIf ac="e" Then return=sy-50 else return=sy EndIf EndSub sub fposx ac=args[1] nx=50 If ac="m" Then rr=150 nx=160 elseIf ac="q" Then rr=250 nx=40 elseIf ac="e" Then rr=160 nx=50 elseIf Text.IsSubText ("uy" ac) Then rr=30 nx=150 ElseIf Text.IsSubText ("nha" ac) then rr=150 else rr=0 nx=100 endif return=rr EndSub Sub dcch 'f j cd=args[1] x300=dx y400=dy if cd="m" then aa=-1 LDCall.Function4("ldrw",x300,y400 100 0) ldcall.Function5( "cdrw" x300 y400-100 0 36, 5) LDCall.Function4("ldrw",-1,0 95 0) aa=1 ldcall.Function5( "cdrw" x300 y400-100 0 36, 5) LDCall.Function4("ldrw",-1,0 95 0) LDCall.Function4("ldrw",x300-25,y400 50 90) LDCall.Function4("ldrw",x300-135,y400 50 90) LDCall.Function4("ldrw",x300+85,y400 50 90) elseif cd="w" then aa=-1 LDCall.Function4("ldrw",x300,y400-100 100 180) ldcall.Function5( "cdrw" x300 y400 0 36, -5) Turtle.Angle=0 LDCall.Function4("ldrw",-1,0 95 0) aa=1 ldcall.Function5( "cdrw" x300 y400 0 36, -5) Turtle.Angle=0 LDCall.Function4("ldrw",-1,0 95 0) elseif cd="a" then LDCall.Function4("ldrw",x300 y400-50 70, -90) aa=-1 LDCall.Function4("ldrw",x300,y400 100 0) ldcall.Function5( "cdrw" x300 y400-100 0 36, 5) LDCall.Function4("ldrw",-1,0 95 0) LDCall.Function4("ldrw",x300-25,y400 50 90) LDCall.Function4("ldrw",x300-135,y400 50 90) elseif cd="b" then aa=1 ldcall.Function5( "cdrw" x300 y400-80 0 72, 6.5) LDCall.Function4("ldrw",-1,0 100 0) LDCall.Function4("ldrw",x300-25,y400-180 25 90) elseif cd="d" then aa=-1 ldcall.Function5( "cdrw" x300 y400-80 0 72, 6.5) LDCall.Function4("ldrw",-1,0 100 0) Turtle.Angle =Turtle.Angle-90 LDCall.Function4("ldrw",-1,0 25 0) elseif cd="c" then aa=-1 ldcall.Function5( "cdrw" x300 y400-80, -45 55, 6.5) elseif cd="e" then aa=-1 ldcall.Function5( "cdrw" x300 y400-80, -45 55, 6.5) Turtle.Angle=0 Turtle.Move (50) Turtle.Angle=-90 Turtle.Move(60) LDCall.Function4("ldrw",-1,0 50 0) elseif cd="g" then aa=-1 ldcall.Function5( "cdrw" x300 y400-80, -45 55, 6.5) Turtle.Angle=0 LDCall.Function4("ldrw",-1,0 35 0) Turtle.Angle=-90 LDCall.Function4("ldrw",-1,0 40 0) elseif cd="h" then aa=-1 LDCall.Function4("ldrw",x300,y400 100 0) ldcall.Function5( "cdrw" x300 y400-100 0 36, 5) LDCall.Function4("ldrw",-1,0 95 0) Turtle.Angle=0 LDCall.Function4("ldrw",-1,0 200 0) LDCall.Function4("ldrw",x300-25,y400 50 90) LDCall.Function4("ldrw",x300-135,y400 50 90) LDCall.Function4("ldrw",x300-135,y400-200 25 90) elseif cd="n" then aa=-1 LDCall.Function4("ldrw",x300,y400 100 0) ldcall.Function5( "cdrw" x300 y400-100 0 36, 5) LDCall.Function4("ldrw",-1,0 95 0) LDCall.Function4("ldrw",x300-25,y400 50 90) LDCall.Function4("ldrw",x300-135,y400 50 90) elseif cd="o" then aa=1 ldcall.Function5( "cdrw" x300 y400-80 0 72, 6.5) elseif cd="q" then aa=-1 ldcall.Function5( "cdrw" x300 y400-80, 10 65, 6.5) Turtle.Angle=Turtle.Angle+90 LDCall.Function4("ldrw",-1,0 35 0) elseif cd="p" then aa=1 ldcall.Function5( "cdrw" x300 y400-80 0 72, 5) Turtle.Angle=180 LDCall.Function4("ldrw",-1,0 105 0) elseif cd="r" then aa=1 ldcall.Function5( "cdrw" x300 y400-80 0 72, 4.5) Turtle.Angle=180 LDCall.Function4("ldrw",-1,0 100 0) LDCall.Function4("ldrw",x300+40 y400-25 80 135) LDCall.Function4("ldrw",x300-25,y400+20 50 90) elseif cd="s" then aa=-1 ldcall.Function5( "cdrw" x300 y400-80, -45 45, 4) aa=1 ldcall.Function5( "cdrw" ,-1 0, 0 45, 4.3) elseif cd="y" then aa=-1 LDCall.Function4("ldrw",x300,y400-100 100 180) ldcall.Function5( "cdrw" x300 y400 0 36, -5) Turtle.Angle=0 LDCall.Function4("ldrw",-1,0 95 0) Turtle.Angle=180 LDCall.Function4("ldrw",-1,0 200 0) LDCall.Function4("ldrw",x300-25,y400-100 50 90) LDCall.Function4("ldrw",x300+95,y400-100 50 90) elseif cd="u" then aa=-1 LDCall.Function4("ldrw",x300,y400-100 100 180) ldcall.Function5( "cdrw" x300 y400 0 36, -5) Turtle.Angle=0 LDCall.Function4("ldrw",-1,0 95 0) LDCall.Function4("ldrw",x300-25,y400-100 50 90) LDCall.Function4("ldrw",x300+95,y400-100 50 90) elseif cd="t" then aa=-1 LDCall.Function4("ldrw",x300+50,y400 200 0) LDCall.Function4("ldrw",x300+10 y400-150 80 90) LDCall.Function4("ldrw",x300+50,y400 30 90) elseif cd="l" then aa=-1 LDCall.Function4("ldrw",x300+50,y400 200 0) LDCall.Function4("ldrw",x300+25,y400 50 90) LDCall.Function4("ldrw",x300+25,y400-200 25 90) elseif cd="i" then aa=-1 LDCall.Function4("ldrw",x300+50,y400 150 0) LDCall.Function4("ldrw",x300+25,y400 50 90) LDCall.Function4("ldrw",x300+25,y400-150 50 90) elseif cd="k" then aa=-1 LDCall.Function4("ldrw",x300+50,y400 200 0) LDCall.Function4("ldrw",x300+50,y400-70 120 45) LDCall.Function4("ldrw",x300+50,y400-85 120 135) elseif cd="v" then aa=-1 LDCall.Function4("ldrw",x300,y400 180 25) LDCall.Function4("ldrw",x300,y400 180, -25) elseif cd="x" then aa=-1 LDCall.Function4("ldrw",x300,y400 190 35) LDCall.Function4("ldrw",x300+110,y400 190, -35) elseif cd="z" then aa=-1 LDCall.Function4("ldrw",x300,y400 130 90) LDCall.Function4("ldrw",x300,y400 185 35) Turtle.Angle=-90 LDCall.Function4("ldrw",-1,0 100 0) EndIf EndSub Sub ldrw If args[1]>=0 then Turtle.x=args[1] Turtle.Y=args[2] Turtle.Angle =args[4] EndIf For x=1 To args[3] Step 3 sset() Program.Delay (5) Turtle.Move (3) EndFor EndSub Sub sset sh= Shapes.AddEllipse (c40 c40) Shapes.Move (sh Turtle.X+ox Turtle.y+ox) LDShapes.AnimateOpacity (sh 1200 3) EndSub Sub cdrw if args[1]>=0 then Turtle.x=args[1] Turtle.Y=args[2] Turtle.Angle =args[3] endif For x=1 To args[4] sset() Program.Delay (20) Turtle.Angle=Turtle.Angle+5*aa Turtle.Move (args[5]) EndFor EndSub Sub mww If Mouse.IsLeftButtonDown Then an=an+ LDEvents.LastMouseWheelDelta *3 else scc=scc+ LDEvents.LastMouseWheelDelta/10 endif LDGraphicsWindow.Reposition (scc scc 0 0 an) EndSub End>LLC088.sb< Start>LLH554.sb< dw=800 dh=dw GraphicsWindow.Height =dw GraphicsWindow.Title ="3D-Bridge Model view3D = LD3DView.AddView(dw,dh,"True") GraphicsWindow.BackgroundColor ="darkblue LD3DView.AddAmbientLight (view3D "#50777777") LD3DView.AddDirectionalLight(view3D,"white",-1,-1,-1) ff="e:\sttn.jpg 'icc=ld3dview.AddIcosahedron(view3D 1 "#99ffffee" "D") zf=1.4 h5=4 For z=0 to 4 x1=0 For x=30 To 150 Step 2 xx= LDMath.Cos(x)*5 yy= LDMath.sin(x)*3.5 cc= LD3DView.AddCube (view3D .2 "green" "D") LD3DView.AddImage(view3D,cc,"",ff,"D") cc1= LD3DView.AddCube (view3D .2 "green" "D") LD3DView.AddImage(view3D,cc1,"",ff,"D") LD3DView.TranslateGeometry (view3D cc1 x1-5.2, h5, z*.2) x1=x1+.2 LD3DView.TranslateGeometry (view3D cc xx yy z*.2) If Math.Remainder (x 16)=0 then For f=yy to h5 step .2 cc3= LD3DView.AddCube (view3D .2 "green" "D") LD3DView.AddImage(view3D,cc3,"",ff,"D") LD3DView.TranslateGeometry (view3D cc3 xx f z*.2) endfor endif LD3DView.RotateGeometry2 (view3D cc 0 1 0, -x-.1) EndFor endfor 'LD3DView.AutoControl ("true" "true" ,-1 .3) LDEvents .MouseWheel =mww ww=15 yy=15 f50=50 Sub mww If FCKeyboard.IsControlPressed Then f50=f50- LDEvents.LastMouseWheelDelta*2 ElseIf FCKeyboard.IsShiftPressed then yy=yy+LDEvents.LastMouseWheelDelta*.2 elseif FCKeyboard.IsAltPressed then dd=dd+LDEvents.LastMouseWheelDelta*2 else ww=ww+LDEvents.LastMouseWheelDelta*5 EndIf w1=ldmath.Sin (ww) w2=ldmath.cos (ww) LD3DView.ResetCamera(view3D,w1*f50+dd, yy ,w2*f50+dd, -w1*5, 0, -w2*5, "","","") EndSub While "true i=i+1 ' LD3DView.RotateGeometry2 (view3D,icc 1 1 1 i) Program.Delay (6) endwhile End>LLH554.sb< Start>LLH687.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 turtle args=0 deg=44/7/360 view3D = LD3DView.AddView(dw,dh,"True") 'Some different light types LD3DView.AddDirectionalLight(view3D,"cyan",-1,-1,-1) LD3DView.AddDirectionalLight(view3D,"white",1,1,1) LD3DView.AddAmbientLight(view3D,"#50111111") LD3DView.SpecularExponent=30 LD3DView.ResetCamera(view3D,0,0,170, 0,0,-1,"","","") df=1 z_r=.02 og=0 dst=ldtext.Split ("6 7 5 3 3 4 4 4 5 4 4 4 4 8 2 2" " ") T_x=0 T_y=0 ty=0 T_Angle=0 pp="" For tt=0 to 14 ff=(dst[tt+1]-dst[tt])/5 For rt=0 to 4 For q=0 To 39 LDCall.Function ("tmove" dst[tt]+rt*ff) T_Angle=T_Angle +9 EndFor endfor endfor LDCall.Function("tset" pp) sub tMove mm=LDMath.Convert2Cartesian (t_x,t_y,args[1] t_Angle-90 ) t_x= (mm[1]) t_y= (mm[2]) ee=ee+z_r pp=pp+":"+t_x+":"+ee+":"+T_y EndSub 'camera orbit r170=100 LDEvents.MouseWheel =mww LD3DView.AutoControl ("true" "true", -1 1) p100=50 GraphicsWindow.KeyDown =kdd 'pa="true 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 oo=LD3DView.addtube(view3d,args[1],1.5,20,"cyan","D") LD3DView.TranslateGeometry (view3d oo og td 0 ) LD3DView.AnimateRotation (view3D oo 0 1 0 0, 360*df 5,-1) df=-1*df 'Program.Delay (200) 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>LLH687.sb< Start>LLJ132.sb< ' SmallBasic Version 1.2 ' Program: Loading Text ' Changelog: 15.12 ' Author: Pappa Lapub ' Website: https://social.msdn.microsoft.com/Forums/en-US/3036ed92-c3db-4353-9666-74e7aacb4cb9/how-do-i-make-a-loading-text-in-small-basic ' ImportURL: http://smallbasic.com/program/? ' Extension: --- ' Comment: ' ' Variables: ' ToDo: ' ================================================================================ txt = "Merry Christmas" len = Text.GetLength(txt) spc = Text.GetCharacter(32) arrMorse = "A=.-;B=-...;C=-.-.;D=-..;E=.;F=..-.;G=--.;H=....;I=..;J=.---;K=-.-;L=.-..;M=--;N=-.;O=---;P=.--.;Q=--.-;R=.-.;S=...;T=-;U=..-;V=...-;W=.--;X=-..-;Y=-.--;Z=--.." snd = "http://a.tumblr.com/tumblr_lj2igdReQM1qi5p4jo1.mp3" ' RySa-MXML, 5:02, 6.92MB If snd <> "" Then Sound.Play(snd) EndIf Timer.Interval = 1000 * Math.GetRandomNumber(5) Timer.Tick = OnTimerTick ' ////////// EVENT \\\\\\\\\\ Sub OnTimerTick char = Text.ConvertToUpperCase(Text.GetSubText(txt, n,1)) If Array.ContainsIndex(arrMorse, char) Then ' A;...;Z; (65, ..., 90) TextWindow.Write(arrMorse[char] + spc) EndIf If n >= len Then TextWindow.WriteLine("") EndIf n = Math.Remainder(n, len) + 1 Timer.Interval = 1000 * Math.GetRandomNumber(5) EndSub End>LLJ132.sb< Start>LLJ235-0.sb< ' SmallBasic Version 1.2 ' Program: Windmill ' Changelog: 17.4 ' Author: Pappa Lapub ' Website: https://social.msdn.microsoft.com/Forums/en-US/ba0a4827-f072-4afd-8fc4-f2e93a088663/how-can-a-3d-model-be-displayed ' ImportURL: http://smallbasic.com/program/?LLJ235-0 ' Extension: LitDev ' Comment: ' Windmill: http://animium.com/2008/06/windmill ' http://animium.com/wp-content/uploads/downloads/2015/01/windmill.rar ' Tulip: https://archive3d.net/?a=download&id=6aed1a1f ' https://storage3d.com/storage/2012.03/ec7beaea9e2764b1859ca3c5261faeb5.zip ' Variables: ' ToDo: ' ================================================================================ modPath = Program.Directory +"\windmill.3DS" tulPath = Program.Directory +"\Flower Ballade Tulip N130312.3DS" nTulips = 50 ' # of tulips scale = 0.3 ' tulips scale dist = 2200 '2000 ' 1000 durat = 5 bAnim = "True" lf = Text.GetCharacter(10) GraphicsWindow.Top = 0 gw = GraphicsWindow.Width * 1.2 ' 1000 gh = GraphicsWindow.Height * 1.2 ' Desktop.Height - 98 '' HEIGHT !! GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Title = "Windmill [R Reset | N aNimate | -/+ Speed | M camMode | Esc Exit]" LDGraphicsWindow.Icon = "C:\Program Files (x86)\Microsoft\Small Basic\Projects\Icons\Windmill3.ico" LDGraphicsWindow.BackgroundBrush(LDShapes.BrushGradient("1=SkyBlue;2=Tomato;3=Crimson;4=DarkSlateBlue;", "V")) view = LD3DView.AddView(gw,gh, "") ' "False" for load by Drag&Drop on Geometry via LDControls.FileDropped lAmb = LD3DView.AddAmbientLight(view, "Gray") lDir = LD3DView.AddDirectionalLight(view, "LightGray", -1,1,-0.5) '-1) LD3DView.AutoControl("True","True", dist, 100) LDGraphicsWindow.PauseUpdates() mod = LD3DView.LoadModel(view, modPath) 'LD3DView.ResetMaterial(view, mod[1], "SaddleBrown","D") ' Base 'LD3DView.ResetMaterial(view, mod[2], "Sienna","D") ' Mill house LD3DView.ResetMaterial(view, mod[5], "Maroon","D") ' door LD3DView.ResetMaterial(view, mod[6], "Yellow","S") ' window LD3DView.ResetMaterial(view, mod[7], "Green","D") ' ground LD3DView.TranslateGeometry(view, mod[4], -95,-610,400) ' wheel, sails sun = LD3DView.AddSphere(view, 2000, 20, "OrangeRed","E") LD3DView.TranslateGeometry(view, sun, -25000,3*dist,dist/2) LD3DView.Freeze(view, sun) AddTulip() PlaceTulips() LDGraphicsWindow.ResumeUpdates() LDGraphicsWindow.TopMost = "True" ResetView() GraphicsWindow.KeyDown = OnKeyDown ' ////////// EVENT \\\\\\\\\\ Sub OnKeyDown ' not X,Y,Z, A.D,W,S, Up,Down, Left,Right (W,S, Up,Down NOT working) lastKey = GraphicsWindow.LastKey If lastKey = "Escape" Then Program.End() ElseIf lastKey = "R" Then ResetView() ElseIf lastKey = "N" Then Animation() ElseIf lastKey = "M" Then CamMod() ElseIf lastKey = "OemPlus" Then ' Faster, up to 1 rps durat = Math.Max(1, durat-1) LD3DView.AnimateRotation(view, mod[4], -1,0.184528724970932,0, 0,-360, durat,-1) ElseIf lastKey = "OemMinus" Then ' Slower, down to 10 rps durat = Math.Min(10, durat+1) LD3DView.AnimateRotation(view, mod[4], -1,0.184528724970932,0, 0,-360, durat,-1) ElseIf lastKey = "V" Then GetCamView() ElseIf lastKey = "B" Then GetBoxPos() EndIf EndSub ' ////////// SUBs \\\\\\\\\\ Sub ResetView ''View along x downwards, +z up/-z down, +y right/-y left LD3DView.ResetCamera(view, dist,0,200, -1,0,0.25, 0,0,1) ' 800 !! durat = 5 ' reset speed bAnim = LDLogic.Not(bAnim) Animation() EndSub Sub Animation If bAnim Then LD3DView.AnimateRotation(view, mod[4], -1,0.184528724970932,0, 0,-360, durat,0) ' Stop Anim. Else LD3DView.AnimateRotation(view, mod[4], -1,0.184528724970932,0, 0,-360, durat,-1) ' Start Anim. EndIf bAnim = LDLogic.Not(bAnim) EndSub Sub AddTulip ' and scale and clone tulp[1] = LD3DView.LoadModel(view, tulPath) nTulp = Array.GetItemCount(tulp[1]) ' 11 For n = 1 To nTulp LD3DView.SetCentre(view, tulp[1][n], 0,0,0, "S") LD3DView.ScaleGeometry(view, tulp[1][n], scale,scale,scale) For t = 2 To nTulips tulp[t][n] = LD3DView.CloneObject(view, tulp[1][n]) EndFor EndFor EndSub Sub PlaceTulips d = 0.1 * dist min = 42 ' mill-base dimension: ~420 max = min + d/4 For t = 1 To nTulips RandomXOr() For n = 1 To nTulp LD3DView.TranslateGeometry(view, tulp[t][n], 10*x,10*y,0) LD3DView.Freeze(view, tulp[t][n]) EndFor EndFor EndSub Sub RandomXOr ' in 'outer' square sgn = 2*Math.GetRandomNumber(2) - 3 y = sgn * Math.GetRandomNumber(max) sgn = 2*Math.GetRandomNumber(2) - 3 If Math.Abs(y) <= min Then x = sgn * (min + Math.GetRandomNumber(max-min)) Else x = sgn * Math.GetRandomNumber(max) EndIf EndSub Sub CamMod If bCamMod Then LD3DView.CameraProperties(view, 0.125,"", 60) 'default Else LD3DView.CameraProperties(view, 0.125,"", -dist/2) ' parallel EndIf bCamMod = LDLogic.Not(bCamMod) EndSub Sub GetBoxPos obj = "1=Base;2=House;3=Shaft;4=Sails;5=Door;6=Window;7=Ground;" TextWindow.WriteLine(lf+ mod +lf) nMod = Array.GetItemCount(mod) ' 7 For n = 1 To nMod box[n] = LD3DView.BoundingBox(view, mod[n]) pos[n] = LD3DView.GetPosition(view, mod[n]) TextWindow.WriteLine(mod[n] +" ("+ obj[n] +")"+ lf +"BoundingBox: (1=dimX,2=dimY;3=dimZ;4=minX;5=minY;6=minZ)") TextWindow.WriteLine(box[n]) TextWindow.WriteLine("Position: (1=centX;2=centY;3=centZ)") TextWindow.WriteLine(pos[n] +lf) EndFor EndSub Sub GetCamView pos = LD3DView.GetCameraPosition(view) dir = LD3DView.GetCameraDirection(view) up = LD3DView.GetCameraUpDirection(view) TextWindow.WriteLine(lf+ "camPos: (1=xPos;2=yPos;3=zPos)" +lf+ pos) TextWindow.WriteLine("camDir: (1=xDir;2=yDir;3=zDir)" +lf+ dir) TextWindow.WriteLine("cUpDir: (1=xUp;2=yUp;3=zUp)" +lf+ up +lf) EndSub End>LLJ235-0.sb< Start>LLJ235.sb< ' SmallBasic Version 1.2 ' Program: Windmill ' Changelog: ' Author: Pappa Lapub ' Website: https://social.msdn.microsoft.com/Forums/en-US/ba0a4827-f072-4afd-8fc4-f2e93a088663/how-can-a-3d-model-be-displayed ' ImportURL: http://smallbasic.com/program/? ' Extension: LitDev ' Comment: http://animium.com/2008/06/windmill ' http://animium.com/wp-content/uploads/downloads/2015/01/windmill.rar ' http://tf3dm.com/3d-model/windmill-56151.html ' http://www.mediafire.com/file/yyqew7y0uzjwf4m/Windmill.7z ' Variables: ' ToDo: ' ================================================================================ modPath = Program.Directory +"\windmill.3DS" dist = 2200 '2000 ' 1000 'durat = 5 lf = Text.GetCharacter(10) GraphicsWindow.Top = 0 gw = GraphicsWindow.Width gh = GraphicsWindow.Width GraphicsWindow.Title = "Windmill [R Reset | N aNimate | -/+ Speed | M camMode | Esc Exit]" GraphicsWindow.BackgroundColor = "SkyBlue" view = LD3DView.AddView(gw,gh, "") ' "False" for load by Drag&Drop on Geometry via DControls.FileDropped lAmb = LD3DView.AddAmbientLight(view, "Gray") lDir = LD3DView.AddDirectionalLight(view, "LightGray", -1,1,-1) LD3DView.AutoControl("True","True", dist, 100) mod = LD3DView.LoadModel(view, modPath) LD3DView.ResetMaterial(view, mod[5], "Maroon", "D") ' door LD3DView.ResetMaterial(view, mod[6], "Brown", "E") ' window LD3DView.ResetMaterial(view, mod[7], "Green", "D") ' ground LD3DView.TranslateGeometry(view, mod[4], -95,-610,400) ' wheel sun = LD3DView.AddSphere(view, 2000, 20, "OrangeRed","E") LD3DView.TranslateGeometry(view, sun, -25000,2*dist,dist/2) ResetView() Animation() GraphicsWindow.KeyDown = OnKeyDown ' ////////// EVENTs \\\\\\\\\\ Sub OnKeyDown ' not X,Y,Z, A.D,W,S, Up,Down, Left,Right (W,S, Up,Down NOT working) lastKey = GraphicsWindow.LastKey If lastKey = "Escape" Then Program.End() ElseIf lastKey = "R" Then ResetView() ElseIf lastKey = "N" Then Animation() ElseIf lastKey = "M" Then CamMod() ElseIf lastKey = "OemPlus" Then durat = Math.Max(1, durat - 1) LD3DView.AnimateRotation(view, mod[4], -1,0.184528724970932,0, 0,360, durat,-1) ElseIf lastKey = "OemMinus" Then durat = Math.Min(10, durat + 1) LD3DView.AnimateRotation(view, mod[4], -1,0.184528724970932,0, 0,360, durat,-1) ElseIf lastKey = "V" Then GetView() ElseIf lastKey = "B" Then GetBoxPos() EndIf EndSub ' ////////// SUBs \\\\\\\\\\ Sub ResetView 'Blick entlang x abwärts, +z oben, +y rechts/-y links LD3DView.ResetCamera(view, dist,0,450, -1,0,0, 0,0,1) durat = 5 bAnim = LDLogic.Not(bAnim) Animation() EndSub Sub Animation If bAnim Then LD3DView.AnimateRotation(view, mod[4], -1,0.184528724970932,0, 0,360, durat,0) ' Stop Anim. Else LD3DView.AnimateRotation(view, mod[4], -1,0.184528724970932,0, 0,360, durat,-1) ' Start Anim. EndIf bAnim = LDLogic.Not(bAnim) EndSub Sub CamMod If bCamMod Then LD3DView.CameraProperties(view, 0.125,"", 60) 'default Else LD3DView.CameraProperties(view, 0.125,"", -dist) ' parallel EndIf bCamMod = LDLogic.Not(bCamMod) EndSub Sub GetBoxPos TextWindow.WriteLine("1=base;2=house;3=shaft;4=sails;5=door;6=window;7=ground;") TextWindow.WriteLine(mod +lf) nMod = Array.GetItemCount(mod) ' 7 For n = 1 To nMod box[n] = LD3DView.BoundingBox(view, mod[n]) pos[n] = LD3DView.GetPosition(view, mod[n]) TextWindow.WriteLine(mod[n] +lf+ "BoundingBox: (1=dimX,2=dimY;3=dimZ;4=minX;5=minY;6=minZ)") TextWindow.WriteLine(box[n]) TextWindow.WriteLine("Position: (1=centX;2=centY;3=centZ)") TextWindow.WriteLine(pos[n] +lf) EndFor EndSub Sub GetView pos = LD3DView.GetCameraPosition(view) dir = LD3DView.GetCameraDirection(view) up = LD3DView.GetCameraUpDirection(view) TextWindow.WriteLine("camPos (1=xPos;2=yPos;3=zPos)" +lf+ pos) TextWindow.WriteLine("camDir (1=xDir;2=yDir;3=zDir)" +lf+ dir) TextWindow.WriteLine("cUpDir (1=xUp;2=yUp;3=zUp)" +lf+ up +lf) EndSub End>LLJ235.sb< Start>LLJ836.sb< char = "abcdefghijklmnopqrstuvwxyz0123456789_" 'valid char's except "@" and "." enterAgain = "y" While enterAgain = "y" TextWindow.Write("Enter Email Address: ") email = Text.ConvertToLowerCase(TextWindow.Read()) length = Text.GetLength(email) ampIndex = Text.GetIndexOf(email, "@") dotIndex1 = Text.GetIndexOf(email, ".") If length >= 5 And Text.IsSubText(email, "@") = "True" And Text.IsSubText(email, ".") = "True" Then For i = 1 To ampIndex-1 CheckString() EndFor For i = (ampIndex +1) To dotIndex1-1 CheckString() EndFor For i = (dotIndex1+1) To length CheckString() EndFor Results() Else result[1] = "Invalid" Results() EndIf Repeat() EndWhile Sub CheckString If Text.IsSubText(char, Text.GetSubText(email, i, 1)) <> "True" Then result[i] = "Invalid" EndIf EndSub Sub Results If Array.ContainsValue(result, "Invalid") = "True" Then TextWindow.ForegroundColor = "Red" TextWindow.WriteLine("Email Address is INVALID") Else TextWindow.ForegroundColor = "Green" TextWindow.WriteLine("Email Address is VALID") EndIf TextWindow.ForegroundColor = "gray" 'TextWindow.WriteLine(result) 'if you uncomment this line you can see what's in the array For i = 1 To Array.GetItemCount(result) result[i] = "" 'empties the array before it is used again EndFor EndSub Sub Repeat TextWindow.WriteLine("") TextWindow.Write("Enter another? y ") enterAgain = Text.ConvertToLowerCase(TextWindow.ReadKey()) TextWindow.Clear() EndSub End>LLJ836.sb< Start>LLL899.sb< ' Asteroids Game ' Copyright (C) 2009, Jason T. Jacques ' License: MIT license http://www.opensource.org/licenses/mit-license.php ' Game area controls gameWidth = 640 gameHeight = 480 backColor = "black" ' Window title gameTitle = "Asteroids, Score: " ' Target frames per second fps = 25 ' Key controls leftKey = "Left" rightKey = "Right" forwardKey = "Up" backKey = "Down" fireKey = "Space" pauseKey = "P" ' Asteroid (rock) settings rockSpeed = 1 rockColor = "white" rockMin = 20 ' small size rock rockTypes = 3 ' number of rock sizes (multiples of small rock size) initRocks = 5 ' Ammo settings ammoSpeed = 5 ammoColor = "white" ammoLife = 600 ' moves before auto destruct ammoMax = 70 ammoSize = 5 ' Player settings playerColor = "white" playerHeight = 30 playerWidth = 20 safeTime = 100 ' time player has to get out of the way on level up ' Point multiplier pointsMultiply = 10 ' Array name initialisation rock = "rockArray" rockAngle = "rockAngle" rockSize = "rockSize" ammo = "ammoArray" ammoAngle = "ammoAngle" ammoAge = "ammoAge" ' Start game Init() Play() ' Setup world Sub Init GraphicsWindow.Hide() GraphicsWindow.Title = gameTitle + "0" GraphicsWindow.CanResize = false GraphicsWindow.Width = gameWidth GraphicsWindow.Height = gameHeight GraphicsWindow.BackgroundColor = backColor GraphicsWindow.BrushColor = backColor LevelCheck() GraphicsWindow.PenColor = playerColor player = Shapes.AddTriangle(playerWidth/2, 0, 0, playerHeight, playerWidth, playerHeight) Shapes.Move(player, (gameWidth - playerWidth) / 2, (gameHeight - playerHeight) / 2) playerAngle = 0 EndSub ' Main gane routine Sub Play GraphicsWindow.Show() GraphicsWindow.KeyDown = ChangeDirection ' Main loop play = 1 pause = 0 While(play = 1) Program.Delay(1000/fps) If (pause = 0) Then Move() CollisionCheck() AgeAmmo() LevelCheck() EndIf EndWhile EndSub ' Read key event and act Sub ChangeDirection If(GraphicsWindow.LastKey = rightKey) Then playerAngle = Math.Remainder(playerAngle + 10, 360) ElseIf(GraphicsWindow.LastKey = leftKey) Then playerAngle = Math.Remainder(playerAngle - 10, 360) ElseIf(GraphicsWindow.LastKey = forwardKey) Then playerSpeed = playerSpeed + 1 ElseIf(GraphicsWindow.LastKey = backKey) Then playerSpeed = playerSpeed - 1 ElseIf(GraphicsWindow.LastKey = fireKey) Then Fire() ElseIf(GraphicsWindow.LastKey = pauseKey) Then pause = Math.Remainder(pause + 1, 2) EndIf Shapes.Rotate(player, playerAngle) EndSub ' Move all on screen items Sub Move ' Move player x = Math.Remainder(Shapes.GetLeft(player) + (Math.Cos(Math.GetRadians(playerAngle - 90)) * playerSpeed) + gameWidth, gameWidth) y = Math.Remainder(Shapes.GetTop(player) + (Math.Sin(Math.GetRadians(playerAngle - 90)) * playerSpeed) + gameHeight, gameHeight) Shapes.Move(player, x, y) ' Move rocks For i = 1 To Array.GetItemCount(rock) x = Math.Remainder(Shapes.GetLeft(Array.GetValue(rock, i)) + (Math.Cos(Math.GetRadians(Array.GetValue(rockAngle, i) - 90)) * rockSpeed) + gameWidth, gameWidth) y = Math.Remainder(Shapes.GetTop(Array.GetValue(rock, i)) + (Math.Sin(Math.GetRadians(Array.GetValue(rockAngle, i) - 90)) * rockSpeed) + gameHeight, gameHeight) Shapes.Move(Array.GetValue(rock, i), x, y) EndFor ' Move ammo For i = 1 To Array.GetItemCount(ammo) x = Math.Remainder(Shapes.GetLeft(Array.GetValue(ammo, i)) + (Math.Cos(Math.GetRadians(Array.GetValue(ammoAngle, i) - 90)) * ammoSpeed) + gameWidth, gameWidth) y = Math.Remainder(Shapes.GetTop(Array.GetValue(ammo, i)) + (Math.Sin(Math.GetRadians(Array.GetValue(ammoAngle, i) - 90)) * ammoSpeed) + gameHeight, gameHeight) Shapes.Move(Array.GetValue(ammo, i), x, y) Array.SetValue(ammoAge, i, Array.GetValue(ammoAge, i) + 1) EndFor EndSub ' Check for collisions between onscreen items Sub CollisionCheck ' Calculate player bounding box. px1 = Shapes.GetLeft(player) - ( (Math.Abs(playerWidth * Math.Cos(Math.GetRadians(playerAngle)) + playerHeight * Math.Sin(Math.GetRadians(playerAngle))) - playerWidth) / 2) py1 = Shapes.GetTop(player) - ( (Math.Abs(playerWidth * Math.Sin(Math.GetRadians(playerAngle)) + playerHeight * Math.Cos(Math.GetRadians(playerAngle))) - playerHeight) / 2) px2 = px1 + Math.Abs(playerWidth * Math.Cos(Math.GetRadians(playerAngle)) + playerHeight * Math.Sin(Math.GetRadians(playerAngle))) py2 = py1 + Math.Abs(playerWidth * Math.Sin(Math.GetRadians(playerAngle)) + playerHeight * Math.Cos(Math.GetRadians(playerAngle))) ' Re-order co-oridinates if they are the wrong way arround If(px1 > px2) Then tmp = px1 px1 = px2 px2 = tmp EndIf If(py1 > py2) Then tmp = py1 py1 = py2 py2 = tmp EndIf ' Check if each rock has hit something For i = 1 To Array.GetItemCount(rock) ax1 = Shapes.Getleft(Array.GetValue(rock, i)) ay1 = Shapes.GetTop(Array.GetValue(rock, i)) ax2 = ax1 + Array.GetValue(rockSize, i) ay2 = ay1 + Array.GetValue(rockSize, i) ' Player collison If(playerSafe < 1) Then 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 EndGame() EndIf EndIf EndIf ' Ammo collison For j = 1 to Array.GetItemCount(ammo) bx1 = Shapes.Getleft(Array.GetValue(ammo, j)) by1 = Shapes.GetTop(Array.GetValue(ammo, j)) bx2 = bx1 + ammoSize by2 = by1 + ammoSize If ( (ax1 < bx1 And ax2 > bx1) Or (ax1 < bx2 And ax2 > bx2) ) Then If ( (ay1 < by1 And ay2 > by1) Or (ay1 < by2 And ay2 > by2) ) Then nextRemove = i RemoveRock() nextRemove = j RemoveAmmo() EndIf EndIf EndFor EndFor ' Decrease the time player is safe If (playerSafe > 0) Then playerSafe = playerSafe - 1 EndIf EndSub ' Add a new rock to the world Sub AddRock ' Check if the next rock size/position has been specified If (nextSize <> 0) Then size = rockMin* nextSize x = Shapes.GetLeft(nextPosition) y = Shapes.GetTop(nextPosition) nextSize = 0 Else ' Choose a random size and position size = rockMin * Math.GetRandomNumber(rockTypes) x = Math.GetRandomNumber(gameWidth - size) y = Math.GetRandomNumber(gameHeight - size) EndIf ' Draw the rock GraphicsWindow.PenColor = rockColor Array.SetValue(rock, (Array.GetItemCount(rock) + 1), Shapes.AddEllipse(size, size)) Shapes.Move(Array.GetValue(rock, Array.GetItemCount(rock)), x, y) Array.SetValue(rockAngle, Array.GetItemCount(rock), Math.GetRandomNumber(360)) Array.SetValue(rockSize, Array.GetItemCount(rock), size) EndSub ' Remove a rock from the world and update score Sub RemoveRock removeSize = Array.GetValue(rockSize, nextRemove) / rockMin ' If not a mini rock If (removeSize > 1) Then ' ... add new rocks until we have made up for it being broken apart... While(removeSize > 0) nextSize = Math.GetRandomNumber(removeSize - 1) nextPosition = Array.GetValue(rock, nextRemove) removeSize = removeSize - nextSize AddRock() EndWhile ' And give a point for a 'hit' score = score + 1 Else ' We've destroyed it - give some extra points and score = score + 5 EndIf ' Show updated score GraphicsWindow.Title = gameTitle + (score * pointsMultiply) ' Remove all references from the arrays If(nextRemove > Array.GetItemCount(rock)) Then TextWindow.Write("Error ") TextWindow.Write(nextRemove + " ") TextWindow.Write(Array.GetItemCount(rock) + " ") TextWindow.WriteLine(Array.GetValue(rock, nextRemove)) Else Shapes.Remove(Array.GetValue(rock, nextRemove)) For i = nextRemove To (Array.GetItemCount(rock) - 1) Array.SetValue(rock, i, Array.GetValue(rock, i+1)) Array.SetValue(rockAngle, i, Array.GetValue(rockAngle, i+1)) Array.SetValue(rockSize, i, Array.GetValue(rockSize, i+1)) EndFor Array.RemoveValue(rock, Array.GetItemCount(rock)) Array.RemoveValue(rockAngle, Array.GetItemCount(rockAngle)) Array.RemoveValue(rockSize, Array.GetItemCount(rockSize)) Endif EndSub ' Check if the player has completed the level, if so, level up Sub LevelCheck If(Array.GetItemCount(rock) < 1) Then nextSize = 0 For i = 1 To initRocks AddRock() EndFor initRocks = initRocks + 1 ' Give players some time to move out of the way playerSafe = safeTime EndIf EndSub ' Add ammo to game Sub Fire ' Remove additional ammo While(Array.GetItemCount(ammo) > (ammoMax - 1)) nextRemove = 1 RemoveAmmo() EndWhile ' Add the ammo GraphicsWindow.PenColor = ammoColor Array.SetValue(ammo, (Array.GetItemCount(ammo) + 1), Shapes.AddEllipse(ammoSize, ammoSize)) Shapes.Move(Array.GetValue(ammo, Array.GetItemCount(ammo)), (px1 + px2 - ammoSize) / 2, (py1 + py2 - ammoSize) / 2) Array.SetValue(ammoAngle, Array.GetItemCount(ammo), playerAngle) EndSub ' Check ammo age Sub AgeAmmo While (Array.GetValue(ammoAge, 1) > ammoLife) nextRemove = 1 RemoveAmmo() EndWhile EndSub ' Remove top Ammo Sub RemoveAmmo Shapes.Remove(Array.GetValue(ammo, nextRemove)) For i = nextRemove To (Array.GetItemCount(ammo) - 1) Array.SetValue(ammo, i, Array.GetValue(ammo, i+1)) Array.SetValue(ammoAngle, i, Array.GetValue(ammoAngle, i+1)) Array.SetValue(ammoAge, i, Array.GetValue(ammoAge, i+1)) EndFor Array.RemoveValue(ammo, Array.GetItemCount(ammo)) Array.RemoveValue(ammoAngle, Array.GetItemCount(ammoAngle)) Array.RemoveValue(ammoAge, Array.GetItemCount(ammoAge)) EndSub ' Display simple end game message box Sub EndGame play = 0 Shapes.Remove(player) GraphicsWindow.ShowMessage("You scored " + (score * pointsMultiply) + " points. Thanks for Playing.", "Game Over!") EndSub End>LLL899.sb< Start>LLL965.sb< ' One stroke figure (house) ' Copyright (c) 2012 Nonki Takahashi. All rights reserved. ' Definition of constants WIDTH = 200 HEIGHT = 200 ROOF = 80 ' height of roof LEFT = 200 TOP = 80 ' Main InitPoints() InitTurtle() For i = 2 To nPoints MoveTurtle() EndFor ' End of main Sub InitPoints ' p[3] ' p[2] p[4] ' p[1] p[6] ' ' p[5] = p[2], p[7] = p[4], p[8] = p[1], p[9] = p[6] p[1]["x"] = LEFT p[1]["y"] = TOP + ROOF + HEIGHT p[2]["x"] = LEFT p[2]["y"] = TOP + ROOF p[3]["x"] = LEFT + WIDTH / 2 p[3]["y"] = TOP p[4]["x"] = LEFT + WIDTH p[4]["y"] = TOP + ROOF p[5] = p[2] p[6]["x"] = LEFT + WIDTH p[6]["y"] = TOP + ROOF + HEIGHT p[7] = p[4] p[8] = p[1] p[9] = p[6] nPoints = 9 EndSub Sub InitTurtle Turtle.Show() Turtle.Speed = 8 Turtle.PenUp() x1 = Turtle.X y1 = Turtle.Y a1 = Turtle.Angle x2 = p[1]["x"] y2 = p[1]["y"] a2 = Math.ArcTan((y2 - y1) / (x2 - x1)) / Math.Pi * 180 Turtle.Turn(a2 - a1) Turtle.MoveTo(x2, y2) Turtle.PenDown() EndSub Sub MoveTurtle ' param i - index of points p[] x1 = Turtle.X y1 = Turtle.Y a1 = Turtle.Angle x2 = p[i]["x"] y2 = p[i]["y"] a2 = Math.ArcTan((y2 - y1) / (x2 - x1)) / Math.Pi * 180 Turtle.Turn(a2 - a1) Turtle.MoveTo(x2, y2) EndSub End>LLL965.sb< Start>LLP992.sb< title = "Curves and lines" zf=1'--------------------zoom mod="RT" '------------wheel mode ww=0 txtp=0 args=0 stp=0 lww=3 'listvars() LDUtilities.ShowNoShapeErrors="False GraphicsWindow.BackgroundColor="#aabbcc cc=0 lsc=0 inn=0 inpn=0 '------------------------hsb params hu=0 sa=0.9 br=0.5 mcurv=0 pp=0 op=90 lmd=1 nct=16'-----------------------------------------------active nodes+1 GraphicsWindow.DrawEllipse (0,0,2,2) For x=1 to 200'---------------------------------------------------------max nodes nr! cs[x]=Shapes.AddEllipse(15,15) Shapes.HideShape (cs[x]) endfor LDDialogs.AddRightClickMenu(LDText.Split ("All__OFF Nodes__ON Nd_________OFF Lines__ON Ln_________OFF Show__ON Sh_______OFF MakeObject MoveObj__ON Mv_________________OFF MAXnod --AddTracetxt-- RotMode ZoomMode HueMode SatMode LightMode OpactMode --Txt2Path-- txtclr penwd penclr edittxt"," "),"") LDDialogs.RightClickMenu =rmmn GraphicsWindow.KeyDown=kdd GraphicsWindow.Title = title Not = "False=True;True=False;" Form() rtt: rst=0 i=1 px=0 py=0 lmd=1 For x=1 To lsc Shapes.Remove (ls[x]) EndFor cc=0 lsc=0 while i < nct tsl=0 msg = "Add point "+i+" / "+(nct-1) ShowInstruction() GetPoint() If FCKeyboard.IsControlPressed and i>2 Then ox=px[i-2] nx=px[i-1] oy=py[i-2] ny=py[i-1] aag= mathplus.GetDegrees ( MathPlus.ATan2(nx-ox,ny-oy)+Math.Pi/2) If aag>180 Then aag=aag-360 elseIf aag<-180 Then aag=aag+360 endif aag=math.Round(aag) ' rr=ldmath.Convert2Radial (px[i-1],py[i-1],px[i-2],py[i-2]) dx=x-px[i-1] dy=y-py[i-1] dst=math.SquareRoot (dx*dx+dy*dy) qq= LDMath.Convert2Cartesian (px[i-1],py[i-1],dst,aag-90 ) 'GraphicsWindow.Title=aag+" : "+dst x=qq[1] y=qq[2] endif ShowPoint() px[i] = x py[i] = y i=i+1 Endwhile msg = "" ShowInstruction() GraphicsWindow.PenColor = "Gray" For c=0 to nct-4 step 2 dpx[1]=px[1+c] dpy[1]=py[1+c] dpx[2]=px[2+c] dpy[2]=py[2+c] dpx[3]=px[3+c] dpy[3]=py[3+c] GraphicsWindow.PenColor="Gray lsc=lsc+1 ls[lsc]=Shapes.AddLine (dpx[1], dpy[1], dpx[2], dpy[2]) lsc=lsc+1 ls[lsc]=Shapes.AddLine (dpx[2], dpy[2], dpx[3], dpy[3]) GraphicsWindow.PenColor="Red crc=c+1 DrawQuadraticBezier() endfor For f=1 to nct LDShapes.ZIndex(cs[f],5000+f) endfor GraphicsWindow .MouseMove =mmww LDShapes.ShapeEvent=sevv LDEvents.MouseWheel =mwhh While 1=1 Program.Delay(5) If dopann=1 and inn=0 And inpn=0 Then inn=1 mpan () inn=0 dopann =0 ElseIf rst=1 then Goto rtt ElseIf mobj=1 then oo=0 nn=1 For f=1 to nct For g=0 to Array.GetItemCount (lmt[f]) aa= LDText.Split (lmt[f][g],":") oo[nn][1]=aa[1] oo[nn][2]=aa[2] nn=nn+1 endfor endfor mobj=0 'TextWindow.WriteLine (oo) pp=pp+1 pol[pp]=LDShapes.Addpolygon(oo) LDShapes.BrushColour (pol[pp],"Green") Shapes.SetOpacity (pol[pp],80) oo=0 Endif endwhile '---------------------------------subs---------------------------------**************************************** Sub sevv If FCKeyboard.IsShiftPressed Or tsl=0 Then js= LDShapes.LastEventShape jt= LDShapes.LastEventType If jt="MouseDown" Then vv="" For fx=1 To text.GetLength(js) ct=text.GetSubText (js,fx,1) If Text.IsSubText("0123456789",ct) then vv=TextPlus.Append (vv,ct) endif endfor tsl=vv ndsell () endif endif EndSub Sub hidenodes For zx=1 to 200 Shapes.HideShape (cs[zx]) endfor EndSub Sub mwhh'------------------------------mswheel options--------------------------------- If txtp=1 then If FCKeyboard.IsControlPressed Then fsz=fsz+ldevents.LastMouseWheelDelta For rx=1 To Array.GetItemCount (wtx) LDShapes.Font (wtx[rx],fnt,fsz,fnb,fni) EndFor elseIf FCKeyboard.IsAltPressed Then can=can+LDEvents.LastMouseWheelDelta*3 LDShapes.RotateAbout (wtx[1],0,0,can )'pmm[1+stp][1],pmm[1+stp][2],can) elseIf txcm=1 then hu=hu+LDEvents.LastMouseWheelDelta*5 GraphicsWindow.Title=hu For rx=1 To Array.GetItemCount (wtx) LDShapes.PenColour (wtx[rx],LDColours.HSLtoRGB (hu+rx*5,sa,br)) EndFor ElseIf pncm=1 then lww=lww+LDEvents.LastMouseWheelDelta*3 If lww<0 then lww=0 endif For tt=1 to nct -1 For tq=1 to Array.GetItemCount(dline[tt]) LDShapes.PenWidth (dline[tt][tq],lww) endfor endfor ElseIf pncl=1 then hu=hu+LDEvents.LastMouseWheelDelta*5 hi=0 For tt=1 to nct -1 For tq=1 to Array.GetItemCount(dline[tt]) LDShapes.PenColour (dline[tt][tq],LDColours.HSLtoRGB (hu+hi,sa,br)) hi=hi+5 endfor endfor else stp=stp+ldevents.LastMouseWheelDelta retxt() endif elseIf mod="RT" Then ann=ann+LDEvents.LastMouseWheelDelta*5 LDShapes.RotateAbout (pol[pp], GraphicsWindow.MouseX , GraphicsWindow.MouseY,ann ) elseif mod="ZM" Then zf=zf+LDEvents.LastMouseWheelDelta/10 Shapes.Zoom (pol[pp],zf,zf) elseif mod="HU" Then hu=hu+LDEvents.LastMouseWheelDelta*5 elseif mod="SA" Then sa=sa+LDEvents.LastMouseWheelDelta/20 GraphicsWindow.Title ="S:"+sa elseif mod="BR" Then br=br+LDEvents.LastMouseWheelDelta/20 GraphicsWindow.Title ="B:"+br elseif mod="OP" Then op=op+LDEvents.LastMouseWheelDelta*5 If op>100 then op=100 ElseIf op<0 then op=0 endif EndIf hu=math.Remainder (hu,360) If sa<0 Then sa=0 ElseIf sa>1 then sa=1 endif If br<0 Then br=0 ElseIf br>1 then br=1 endif LDShapes.BrushColour (pol[pp], LDColours.HSLtoRGB(hu,sa,br)) Shapes.SetOpacity (pol[pp],op) EndSub Sub rmmn'---------------------------------------------------------rightclickmenu-------------*********** lm= LDDialogs.LastRightClickMenuItem If lm=1 Then txcm=0 pncm=0 pncl=0 For x=1 To cc Shapes.HideShape (cs[x]) EndFor For x=1 To lsc Shapes.HideShape (ls[x]) EndFor lmd=0 elseIf lm=2 Then For x=1 To cc Shapes.ShowShape (cs[x]) EndFor elseIf lm=3 Then For x=1 To cc Shapes.HideShape (cs[x]) EndFor elseIf lm=4 Then For xx=1 To lsc Shapes.showShape (ls[xx]) EndFor lmd=1 elseIf lm=5 Then For x=1 To lsc Shapes.HideShape (ls[x]) EndFor lmd=0 elseIf lm=6 Then ssln=1 elseIf lm=7 Then ssln=0 elseIf lm=8 Then mobj=1 elseIf lm=9 Then mcurv=1 elseIf lm=10 Then mcurv=0 elseIf lm=11 Then nd=fcDialogs.AskForTextLine("MAXnodes:") If nd="" then 'nixx else nct=nd rst=1 hidenodes () unlins() endif elseif lm=13 then 'RotMode ZoomMode HueMode SatMode LightMode OpactMode mod="RT elseif lm=14 then mod="ZM elseif lm=15 then mod="HU elseif lm=16 then mod="SA elseif lm=17 then mod="BR elseif lm=18 then mod="OP elseif lm=12 then cd=fcDialogs.AskForTextLine("Char:") Shapes.Remove(tx) tx=Shapes.AddText(cd) Shapes.SetOpacity (cd,60) LDShapes.Font (tx,"Arial",500,"True","False") Shapes.Move(tx,100,100) LDShapes.PenColour (tx,"Gray") LDShapes.ZIndex (tx,-100) elseif lm=19 then 'text2path cd=fcDialogs.AskForTextLine("Text:") ff=LDDialogs.Font(LDText.Split ("Arial 12 True False"," ")) For wx=1 to Text.GetLength (cd) wtx[wx]=shapes.AddText(Text.GetSubText (cd,wx,1)) LDShapes.Font(wtx[wx],ff[1],ff[2],ff[3],ff[4]) endfor fsz=ff[2] fnt=ff[1] fnb=ff[3] fni=ff[4] stp=0 retxt() txtp=1 elseif lm=20 then txcm=1 pncm=0 pncl=0 elseif lm=21 then pncm=1 txcm=0 pncl=0 elseif lm=22 then pncl=1 pncm=0 txcm=0 elseIf lm=23 and Array.GetItemCount (wtx)>0 Then ntx=fcDialogs.AskForTextLine("New txt - max.chr:"+Array.GetItemCount (wtx)) ff=LDDialogs.Font(ff) For ux= 1 to Array.GetItemCount (wtx) Shapes.SetText (wtx[ux],Text.GetSubText (ntx,ux,1)) LDShapes.Font(wtx[ux],ff[1],ff[2],ff[3],ff[4]) endfor fsz=ff[2] fnt=ff[1] fnb=ff[3] fni=ff[4] endif EndSub Sub kdd'---------------------------------------------------keys-------------------------------- lky=GraphicsWindow.LastKey 'GraphicsWindow.Title =lky If lky="Back" Then Shapes.HideShape (cs[cc]) cc=cc-1 i=i-1 msg = "Add point "+i+" / "+(nct-1) ShowInstruction() ElseIf lky="Tab" then tsl=tsl+1 If tsl=nct then tsl=1 endif ndsell() ElseIf lky="Escape" then tsl=0 ndsell() endif EndSub Sub retxt'-------------------------------------------------------text2path********************* co=1 if rmm<>1 then rmm=1 For ft=1 To nct-1 For rx=1 To Array.GetItemCount(lmt[ft]) pq=LDText.Split (lmt[ft][rx],":") pmm[co]=pq amm[co]=dpar[ft][rx] co=co+1 EndFor EndFor endif For rx=0 To Array.GetItemCount (wtx) 'ldMath.Convert2Cartesian (qx,qy,d[1]["dst"] ldShapes.Centre (wtx[rx+1],pmm[rx+stp][1],pmm[rx+stp][2]) LDShapes.RotateAbout (wtx[rx+1],0,0,amm[rx+stp]-90) 'TextWindow.Write(amm[rx]+", ") LDShapes.ZIndex (wtx[rx+1],1000+rx) endfor endsub Sub ndsell For kx=1 to nct-1 If Math.Remainder (kx,2)=1 then LDShapes.BrushColour (cs[kx],"Blue") Else LDShapes.BrushColour (cs[kx],"Cyan") EndIf endfor If Math.Remainder (tsl,2)=1 then LDShapes.BrushColour (cs[tsl],"Red") Else LDShapes.BrushColour (cs[tsl],"Magenta") EndIf EndSub Sub Form gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.FontName = "Trebuchet MS" GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 20 instruction = Shapes.AddText("") Shapes.Move(instruction, 10, 10) GraphicsWindow.MouseDown = OnMouseDown EndSub Sub DrawQuadraticBezier ' param px, py - array of three control points for quadratic Bezier curve ff=0 For k = 0 To 1 Step 0.05 x1 = dpx[1] + k * (dpx[2] - dpx[1]) y1 = dpy[1] + k * (dpy[2] - dpy[1]) x2 = dpx[2] + k * (dpx[3] - dpx[2]) y2 = dpy[2] + k * (dpy[3] - dpy[2]) GraphicsWindow.PenColor = "Gray" if ssln=1 then' ------------------------------------------------------animation tangent line line = Shapes.AddLine(x1, y1, x2, y2) lmt[crc][0]=x1+":"+y1 EndIf x = x1 + k * (x2 - x1) y = y1 + k * (y2 - y1) If k>0 Then ff=ff+1 lmt[crc][ff]=x+":"+y GraphicsWindow.PenColor = "Red dline[crc][ff] = Shapes.AddLine(_x, _y, x, y) LDCall.Function4("calcc",_x, _y, x, y) dpar[crc][ff]=cang EndIf _x = x ' last x _y = y ' last y ' msg = "k = " + k If ssln=1 then Program.Delay(30) Shapes.Remove(line) EndIf EndFor EndSub Sub GetPoint ' return x, y - clicked point msDwn = "False" While Not[msDwn] Program.Delay(30) EndWhile x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY EndSub Sub mmww if Mouse.IsLeftButtonDown then mx= GraphicsWindow.MouseX my= GraphicsWindow.MouseY If (mx<>omx Or my<>omy) Then dopann=1 endif omx=x omy=y EndIf EndSub Sub OnMouseDown msDwn = "True" If mcurv=1 And mouse.IsLeftButtonDown Then ldShapes.Centre (pol[pp],GraphicsWindow.MouseX,GraphicsWindow.MouseY ) 'mcurv=0 elseif mouse.IsLeftButtonDown and not [FCKeyboard.IsShiftPressed ] then mpan() endif EndSub Sub mpan If tsl>0 Then inpn=1 rmm=0 x= GraphicsWindow.MouseX y= GraphicsWindow.MouseY If FCKeyboard.IsControlPressed and tsl>2 Then i=tsl ox=px[i-2] nx=px[i-1] oy=py[i-2] ny=py[i-1] aag= mathplus.GetDegrees ( MathPlus.ATan2(nx-ox,ny-oy)+Math.Pi/2) If aag>180 Then aag=aag-360 elseIf aag<-180 Then aag=aag+360 endif aag=math.Round(aag) ' rr=ldmath.Convert2Radial (px[i-1],py[i-1],px[i-2],py[i-2]) dx=x-px[i-1] dy=y-py[i-1] dst=math.SquareRoot (dx*dx+dy*dy) qq= LDMath.Convert2Cartesian (px[i-1],py[i-1],dst,aag-90 ) 'GraphicsWindow.Title=aag+" : "+dst x=qq[1] y=qq[2] ElseIf FCKeyboard.IsAltPressed and tsl>1 and tsl< nct-1 then i=tsl ox=px[i+1] nx=px[i-1] oy=py[i+1] ny=py[i-1] aag= mathplus.GetDegrees ( MathPlus.ATan2(nx-ox,ny-oy)+Math.Pi/2) If aag>180 Then aag=aag-360 elseIf aag<-180 Then aag=aag+360 endif aag=math.Round(aag) ' GraphicsWindow.Title =aag dx=px[i+1]-px[i-1] dy=py[i+1]-py[i-1] dst=math.SquareRoot (dx*dx+dy*dy)/2 qq= LDMath.Convert2Cartesian (px[i+1],py[i+1],dst,aag-90 ) 'GraphicsWindow.Title=aag+" : "+dst x=qq[1] y=qq[2] endif px[tsl ] = x py[tsl ] = y ldShapes.Centre (cs[tsl], x,Y ) Shapes.Remove (ls[tsl]) Shapes.Remove (ls[tsl-1]) If tsl>1 and lmd=1 then ls[tsl-1]=Shapes.AddLine (x,y,px[tsl-1],py[tsl-1]) EndIf If tsl1 then DrawQuadraticBezier() endif dpx [3]=px[tsl+2] dpy [3]=py[tsl+2] dpx [1]=x dpy [1]=y dpx [2]=px[tsl+1] dpy [2]=py[tsl+1] crc=tsl If tsl2 Then LDShapes.BrushColour (cs[cc],"Brown") Else LDShapes.BrushColour (cs[cc],"Blue") EndIf EndSub Sub listvars sbb= (FCExtensions.GetAllSubs()) ww=FCExtensions.GetAllVariables() TextWindow.WriteLine (ldtext.Replace (sbb,";",ESLText.CRLF) ) aa=LDArray.Create(Array.GetItemCount(ww)) For f=1 to Array.GetItemCount(ww) LDArray.SetValue(aa,f,ww[f]) endfor LDArray.Sort (aa) For f=1 to Array.GetItemCount(ww) TextWindow.WriteLine (f+":"+LDArray.GetValue (aa,f)) endfor EndSub Sub calcc dx=args[3]-args[1] dy=args[4]-args[2] aag= mathplus.GetDegrees ( MathPlus.ATan2(dx,dy)+Math.Pi/2) If aag>180 Then aag=aag-360 elseIf aag<-180 Then aag=aag+360 endif cang=math.Round(aag) cdst=math.SquareRoot (dx*dx+dy*dy)/2 EndSub End>LLP992.sb< Start>LLQ017.sb< ' mahreen miangul ' Multiple KeyBoard ' NoveMber 2017 'GraphicsWindow.Left = 0.5 * (Desktop.Width - GraphicsWindow.Width) 'GraphicsWindow.Top = 0.5 * (Desktop.Height - GraphicsWindow.Height) GraphicsWindow.top= -2.0 ' 0 GraphicsWindow.left= 88 ' 0 GraphicsWindow.Title = "mahreen miangul" GraphicsWindow.BackgroundColor="darkcyan" GraphicsWindow.Width = "1280" GraphicsWindow.Height = "666" ' Madam Apple MakeImage() ' Hill GraphicsWindow.brushColor = "tan" GraphicsWindow.fillEllipse(-88,505,620,288) GraphicsWindow.fillEllipse(211,388,622,366) GraphicsWindow.fillEllipse(211,388,1888,666) GraphicsWindow.brushColor = "snow" shoot="False" zm=1 ' ********* ' 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 ' MOON GraphicsWindow.BrushColor = "yellow" GraphicsWindow.PenWidth=0 '<------------- moon= Shapes.AddEllipse(20,20) '<------------- Shapes.Move(moon,50,50) '<------------- GraphicsWindow.BrushColor = "darkcyan" shadow= Shapes.AddEllipse(20,20) '<------------- Shapes.Move(shadow,60,45) '<------------- ' 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,600,500) '<------------- GraphicsWindow.KeyDown = onkeyDown ' Cannon Drawing GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "mediumslateblue" cannon1_x = 5 cannon1_y = 555 cannon = Shapes.AddRectangle(55,110) Shapes.Move(cannon, cannon1_x, cannon1_y) 'Makesprite() SPRITE_init() ' <--------- all shape data is input here!! add_shapes() ' <--------- all shapes are added here!! GraphicsWindow.brushColor = "snow" GraphicsWindow.FontSize = 33 arrayOfx = "1=66;2=155;3=208;4=255;5=477;6=420;7=800;8=920;9=1022;10=1144" arrayofy = "1=600;2=420;3=600;4=420;5=420;6=622;7=600;8=300;9=330;10=300" For numOftext = 1 to 10 txt[numOftext] = Shapes.AddText("420") Shapes.Move(txt[numOftext],arrayOfx[numOftext],arrayofy[numOftext]) EndFor ' Cannon Animation GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor= "darkslategray" Ball=Shapes.AddEllipse(40,40) 'Shapes.Move(Ball,cannon1_x+5,cannon1_y+30) Shapes.HideShape(Ball) ' BlueCar Timer Timer.Interval=800 '<-------------- Timer.Tick=BlueCar_up '<-------------- ' Drag & Drop to Target or Return Home GraphicsWindow.brushColor = "snow" home = "X=0;Y=0" spriteSize = "420" sprite[1] = Shapes.Addtext("👹") Shapes.Move(sprite[1], home["X"], home["Y"]) spriteTarget[1] = Shapes.Addtext(spriteSize + 0) 'upSize Target for special fx Shapes.Move(spriteTarget[1], 599, 400) Shapes.SetOpacity(spriteTarget[1], 80) '=========================================================================== ' Cloud Moving dx = GraphicsWindow.Width dY = GraphicsWindow.Height GraphicsWindow.BrushColor = "silver" GraphicsWindow.FontSize = 122 x = x + dX - 44 y = y + dY - 550 cloud() Sub cloud cloud = Shapes.Addtext("🌁") Shapes.Animate(cloud,x,y,22000) Endsub Shapes.Animate(cloud,x,y,0) Program.Delay(800) cloud() ' Aircraft Animation dZ = 0.1 zoom = 1 ddx=0 ' 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="8:1" ' Aircraft shapes number=5 repeat =1 shoot="False" zm=1 ' ********* While "True" ' And "North" <> "South" <--- No meanig , it always "True" mseX = GraphicsWindow.MouseX mseY = GraphicsWindow.MouseY If Mouse.IsLeftButtonDown Then 'handle click and select If selected = "" And clicked = "False" Then 'can loop thru here for more than 1 box If mseX >= home["X"] And mseX <= home["X"] + spriteSize And mseY >= home["Y"] And mseY <= home["Y"] + spriteSize Then selected = 1 'box number EndIf EndIf clicked = "True" 'the mse has been clicked for this frame Shapes.Move(sprite[selected], mseX, mseY) Else If Math.Round(mseX/50) = Math.Round(Shapes.GetLeft(spriteTarget[selected])/50) Then If Math.Round(mseY/50) = Math.Round(Shapes.GetTop(spriteTarget[selected])/50) Then Shapes.Remove(sprite[selected]) Shapes.SetOpacity(spriteTarget[selected], 100) EndIf EndIf Shapes.Move(sprite[selected], home["X"], home["Y"]) selected = "" 'deselect when finishised with the box clicked = "False" 'inits here, get ready for next click EndIf Program.Delay(20) 'EndWhile ' <----------- no use 'While 0=0 ' <----------- no use ' Aircraft Blinking Program zoom = zoom - dZ For i = 1 To Array.GetItemCount(shape[8]) ' Aircraft shapes data number = 8 If Array.ContainsValue(shape[8][i], "eye") Then Shapes.Zoom(shp[NMB][i], 1, zoom) ElseIf Array.ContainsValue(shape[8][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 ' Star Blinking Program 'While zm<6 'If zm<6 Then ' <<<<>>>> mmm= Math.GetRandomNumber(80) ' blinking star number _op=Shapes.GetOpacity(star[mmm]) ' opacity ... brightness If _op>50 Then Shapes.SetOpacity(star[mmm],Math.GetRandomNumber(49)) ' darker Else Shapes.SetOpacity(star[mmm],50+Math.GetRandomNumber(50)) ' brighter EndIf If mmm=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) ' <<<<>>>> 'endif 'endwhile ' Aircraft Reverse Moving X,Y Direction cycleX= shapes.GetLeft(shp[NMB][1]) + 150 ' 1 = aircraft's body ' <<<<>>>> cycleY= shapes.GetTop(shp[NMB][1]) + 50 ' ' <<<<>>>> If cycleX<0 Or cycleX>GraphicsWindow.Width Then 'shape[8][1]["width"] Then ' 1 = aircraft's body ' <<<<>>>> ddx=-ddx EndIf If cycleY<0 Or cycleY>cannon1_y Then ' 1 = aircraft's body ' <<<<>>>> ddy=-ddy EndIf ' Ball Fire 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+5,cannon1_y+30) Shapes.HideShape(Ball) EndIf ' Collision Check Here ballX=shapes.GetLeft(ball) bally=shapes.GetTop(ball) If (cycleX1 ' 1 =reindeer's body ' <<<<>>>> GraphicsWindow.Title="You Hit !!!!!!!!!!!" Sound.PlayChimeAndWait() shoot="False" Shapes.Move(Ball,cannon1_x+5,cannon1_y+30) Shapes.HideShape(Ball) EndIf EndIf Program.Delay(20) EndWhile Sub MakeImage scale = 1 x0 = 1 * scale y0 = 1 * scale GraphicsWindow.PenWidth = 0 ' Trunk Point GraphicsWindow.BrushColor = "green" oTr = Shapes.Addrectangle(20 * scale, 60 * scale) Shapes.Move(oTr, x0 + 433 * scale, y0 + 480 * scale) Shapes.Rotate(oTr, 30) ' Face GraphicsWindow.BrushColor = "crimson" GraphicsWindow.PenColor = "Darkslategray" oFace1 = Shapes.AddEllipse(150 * scale, 150 * scale) Shapes.Move(oFace1, x0 + 311, y0 + 518) Shapes.Rotate(oFace1, 0) oFace2 = Shapes.AddEllipse(150 * scale, 150 * scale) Shapes.Move(oFace2, x0 + 403, y0 + 518) Shapes.Rotate(oFace2, 0) ' Eyes GraphicsWindow.BrushColor = "white" GraphicsWindow.PenColor = "dimgray" GraphicsWindow.PenWidth = 2 oEyeLeft = Shapes.AddEllipse(40 * scale, 40 * scale) Shapes.Move(oEyeLeft, x0 + 394 * scale, y0 + 538 * scale) Shapes.Rotate(oEyeLeft, 0) oEyeRight = Shapes.AddEllipse(40 * scale, 40 * scale) Shapes.Move(oEyeRight, x0 + 433 * scale, y0 + 538 * scale) Shapes.Rotate(oEyeRight, 80) GraphicsWindow.PenWidth = 2 GraphicsWindow.BrushColor = "snow" GraphicsWindow.PenColor = "DimGray" GraphicsWindow.PenWidth = 2 GraphicsWindow.BrushColor = "darkslategray" oEyeLeft2 = Shapes.AddEllipse(15 * scale, 15 * scale) Shapes.Move(oEyeLeft2, x0 + 416 * scale, y0 + 546 * scale) Shapes.Rotate(oEyeLeft2, 0) oEyeRight2 = Shapes.AddEllipse(15 * scale, 15 * scale) Shapes.Move(oEyeRight2, x0 + 436 * scale, y0 + 546 * scale) Shapes.Rotate(oEyeright2, -5) ' Mouth GraphicsWindow.PenColor = "darkslategray" GraphicsWindow.PenWidth = 11 oMouthLeft = Shapes.AddLine(0, 6 * scale, 66 * scale, 3) Shapes.Move(oMouthLeft, x0 + 400 * scale, y0 + 600 * scale) Shapes.Rotate(oMouthLeft, -2) endsub '' Blue Car Animation Sub BlueCar_up MM=MM+1 If MM=23 then MM=0 cloud() EndIf Timer.Pause() For k=1 To Array.GetItemCount(s[10]) ' k=1 to 7 For L=1 To Array.GetItemCount(shape[10]) ' ********* Shapes.Rotate(SHP["10:"+k][L],Shape[10][L]["angle"]) ' ********* ' <-------------- rotating angle // body = 8 // BlueCar index="4:1" to "4:7" endfor endfor Shapes.HideShape(oEyeLeft2) ''MM Shapes.HideShape(oEyeRight2) ''WM Program.Delay(300) For k=1 To Array.GetItemCount(s[10]) ' k=1 to 7 For L=1 To Array.GetItemCount(shape[10]) ' ********* Shapes.Rotate(SHP["10:"+K][L], 0) ' ********* ' <-------------- rotating angle // body = 8// BlueCar index="4:1" to "4:7" EndFor EndFor Program.Delay(30) Shapes.ShowShape(oEyeLeft2) ''MM Shapes.ShowShape(oEyeRight2) ''MM Timer.Resume() endsub ' Add Sprites Sub add_shapes For M=1 to Array.GetItemCount(s) ' 6 types shapes // BlueCar, Trees , House , Apple , Aircraft , Ladder3D/ For N=1 to Array.GetItemCount(s[M]) ' repeat number //BlueCar=1 , Trees =14 , House=1 , Apple=18 , Aircraft=1 , Ladder3D=1// ss=s[M][N] ' scale _shx=shx[M][N] ' base point _X _shY=shY[M][N] ' base point _Y _shape=shape[M] ' temporary shape data NMB=M+":"+N ' shape index for i=1 To Array.GetItemCount(_shape) GraphicsWindow.PenWidth = _shape[i]["pw"] GraphicsWindow.BrushColor = _shape[i]["bc"] GraphicsWindow.penColor = _shape[i]["pc"] If _shape[i]["func"]="ell" Then shp[NMB][i] = Shapes.AddEllipse(_shape[i]["width"]*ss, _shape[i]["height"]*ss) ElseIf _shape[i]["func"]="rect" Then shp[NMB][i] = Shapes.AddRectangle(_shape[i]["width"]*ss, _shape[i]["height"]*ss) ElseIf _shape[i]["func"]="tri" Then shp[NMB][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[NMB][i] = Shapes.Addline(_shape[i]["x1"]*ss, _shape[i]["y1"]*ss,_shape[i]["x2"]*ss, _shape[i]["y2"]*ss) EndIf Shapes.Animate(shp[NMB][i], _shape[i]["x"]*ss+_shX, _shape[i]["y"]*ss+_shY, 500) Shapes.Rotate(shp[NMB][i], _Shape[i]["angle"]) EndFor endfor endfor EndSub ' KeyBoard Aniation ' Keys S, W, A, T, X,Z,F , SpaceBar works Sub OnKeyDown key= GraphicsWindow.LastKey If key="S" Then ddx=4 ElseIf Key="W"then ddx=-4 ElseIf Key="A"then ddy=4 ElseIf key="T"Then ddy=-4 ElseIf key="Space" Then ddx=0 ddy=0 EndIf If shoot="False" Then If Key = "X" Then angle=angle+1 Shapes.Rotate(cannon,angle) ElseIf Key = "Z" Then angle=angle-1 Shapes.Rotate(cannon,angle) ElseIf Key="F" then Shapes.ShowShape(Ball) shoot="True" EndIf endif 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 ' Move Sprite on Screen Sub move_index For ii=1 To 47 ' 47 ' <--- shp[] array number is 47 ' <<<<>>>> Shapes.Move(shp["10:1"][ii],Shapes.GetLeft(shp["10:1"][ii])+dX,Shapes.Gettop(shp["10:1"][ii])+dY) ' current position +dX ,+dY EndFor EndSub Sub SPRITE_init ' 14 Trees s[1]="1=0.8;2=.8;3=.8;4=.8;5=.8;6=.8;7=.8;8=.8;9=.8;10=.8;11=.8;12=.8;13=.8;14=.8" shX[1]="1=-0;2=100;3=280;4=200;5=10;6=150;7=740;8=644;9=777;10=866;11=966;12=1088;13=920;14=1100" shY[1]="1=200;2=170;3=100;4=140;5=300;6=300;7=880;8=100;9=80;10=70;11=80;12=100;13=330;14=330" 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" ' 18 Apples s[2] ="1=0.2;2=0.2;3=0.2;4=0.2;5=0.2;6=0.2;7=0.2;8=0.2;9=0.2;10=0.2;11=0.2;12=0.2;13=0.2;14=0.2;15=0.2;16=0.2;17=.2;18=.2;18=.2" shX[2] ="1=-60;2=60;3=140;4=140;5=650;6=600;7=700;8=800;9=900;10=1000;11=1080;12=-80;13=0;14=100;15=740;16=240;17=920;18=1100" shY[2] ="1=360;2=300;3=270;4=444;5=420;6=240;7=220;8=240;9=220;10=240;11=220;12=440;13=420;14=420;15=420;16=240;17=480;18=460" shape[2][1] = "func=rect;x=626;y=110;width=20;height=60;angle=30;bc=yellowgreen;pw=0;" shape[2][2] = "func=ell;x=511;y=148;width=150;height=150;bc=crimson;pw=0;" shape[2][3] = "func=ell;x=603;y=148;width=150;height=150;bc=crimson;pw=0;" shape[2][4] = "func=ell;x=594;y=188;width=40;height=40;bc=snow;pw=0;" shape[2][5] = "func=ell;x=633;y=188;width=40;height=40;bc=snow;pw=0;" shape[2][6] = "func=ell;x=614;y=196;width=15;height=15;bc=darkslategray;pw=0;" shape[2][7] = "func=ell;x=635;y=196;width=15;height=15;angle=7;bc=darkslategray;pw=0;" shape[2][8] = "func=rect;x=600;y=250;width=80;height=20;angle=-5;bc=purple;pw=0;" ' House ' s[3] = "1=0.28" shX[3] ="1=522" shY[3] ="1=488" shape[3][1] = "func=rect;x=-420;y=-420;width=100;height=40;bc=skyblue;pw=1;"'1 shape[3][2] = "func=rect;x=-310;y=-420;width=100;height=40;bc=skyBlue;pw=1;"'1 shape[3][3] = "func=rect;x=-200;y=-420;width=100;height=40;bc=SkyBlue;pw=1;"'1 shape[3][4] = "func=rect;x=-90;y=-420;width=100;height=40;bc=SkyBlue;pw=1;" '1 shape[3][5] = "func=rect;x=20;y=-420;width=100;height=40;bc=skyblue;pw=1;" '1 shape[3][6] = "func=rect;x=130;y=-420;width=100;height=40;bc=skyblue;pw=1;"'1 shape[3][7] = "func=rect;x=240;y=-420;width=100;height=40;bc=skyblue;pw=1;"'1 shape[3][8] = "func=rect;x=350;y=-420;width=100;height=40;bc=skyblue;pw=1;" '1 shape[3][9] = "func=rect;x=460;y=-420;width=100;height=40;bc=skyblue;pw=1;"'1 shape[3][10] = "func=rect;x=570;y=-420;width=100;height=40;bc=skyblue;pw=1;"'1 shape[3][11] = "func=rect;x=-430;y=-375;width=50;height=40;bc=skyblue;pw=1;"'2 shape[3][12] = "func=rect;x=-370;y=-375;width=100;height=40;bc=skyblue;pw=1;"'2 shape[3][13] = "func=rect;x=-260;y=-375;width=100;height=40;bc=skyblue;pw=1;"'2 shape[3][14] = "func=rect;x=-150;y=-375;width=100;height=40;bc=skyblue;pw=1;"'2 shape[3][15] = "func=rect;x=-40;y=-375;width=100;height=40;bc=skyblue;pw=1;"'2 shape[3][16] = "func=rect;x=70;y=-375;width=100;height=40;bc=skyblue;pw=1;"'2 shape[3][17] = "func=rect;x=180;y=-375;width=100;height=40;bc=skyblue;pw=1;"'2 shape[3][18] = "func=rect;x=290;y=-375;width=100;height=40;bc=skyblue;pw=1;"'2 shape[3][19] = "func=rect;x=400;y=-375;width=100;height=40;bc=skyblue;pw=1;"'2 shape[3][20] = "func=rect;x=510;y=-375;width=100;height=40;bc=skyblue;pw=1;"'2 shape[3][21] = "func=rect;x=620;y=-375;width=100;height=40;bc=skyblue;pw=1;"'2 shape[3][22] = "func=rect;x=-420;y=-330;width=100;height=40;bc=skyblue;pw=1;"'3 shape[3][23] = "func=rect;x=-310;y=-330;width=100;height=40;bc=skyblue;pw=1;"'3 shape[3][24] = "func=rect;x=-200;y=-330;width=100;height=40;bc=skyblue;pw=1;"'3 shape[3][25] = "func=rect;x=-90;y=-330;width=100;height=40;bc=skyblue;pw=1;" '3 shape[3][26] = "func=rect;x=20;y=-330;width=100;height=40;bc=skyblue;pw=1;" '3 shape[3][27] = "func=rect;x=130;y=-330;width=100;height=40;bc=skyblue;pw=1;"'3 shape[3][28] = "func=rect;x=240;y=-330;width=100;height=40;bc=skyblue;pw=1;"'3 shape[3][29] = "func=rect;x=350;y=-330;width=100;height=40;bc=skyblue;pw=1;" '3 shape[3][30] = "func=rect;x=460;y=-330;width=100;height=40;bc=skyblue;pw=1;"'3 shape[3][31] = "func=rect;x=570;y=-330;width=100;height=40;bc=skyblue;pw=1;"'3 shape[3][32] = "func=rect;x=-430;y=-285;width=50;height=40;bc=skyblue;pw=1;"'4 shape[3][33] = "func=rect;x=-370;y=-285;width=100;height=40;bc=skyblue;pw=1;"'4 shape[3][34] = "func=rect;x=-260;y=-285;width=100;height=40;bc=skyblue;pw=1;"'4 shape[3][35] = "func=rect;x=-150;y=-285;width=100;height=40;bc=skyblue;pw=1;"'4 shape[3][36] = "func=rect;x=-40;y=-285;width=100;height=40;bc=skyblue;pw=1;"'4 shape[3][37] = "func=rect;x=70;y=-285;width=100;height=40;bc=skyblue;pw=1;"'4 shape[3][38] = "func=rect;x=180;y=-285;width=100;height=40;bc=skyblue;pw=1;"'4 shape[3][39] = "func=rect;x=290;y=-285;width=100;height=40;bc=skyblue;pw=1;"'4 shape[3][40] = "func=rect;x=400;y=-285;width=100;height=40;bc=skyblue;pw=1;"'4 shape[3][41] = "func=rect;x=510;y=-285;width=100;height=40;bc=skyblue;pw=1;"'4 shape[3][42] = "func=rect;x=620;y=-285;width=100;height=40;bc=skyblue;pw=1;"'4 shape[3][43] = "func=rect;x=-420;y=-240;width=100;height=40;bc=skyblue;pw=1;"'5 shape[3][44] = "func=rect;x=-310;y=-240;width=100;height=40;bc=orange;pw=1;"'5 shape[3][45] = "func=rect;x=-200;y=-240;width=100;height=40;bc=orange;pw=1;"'5 shape[3][46] = "func=rect;x=-90;y=-240;width=100;height=40;bc=orange;pw=1;" '5 shape[3][47] = "func=rect;x=20;y=-240;width=100;height=40;bc=orange;pw=1;" '5 shape[3][48] = "func=rect;x=130;y=-240;width=100;height=40;bc=orange;pw=1;"'5 shape[3][49] = "func=rect;x=240;y=-240;width=100;height=40;bc=orange;pw=1;"'5 shape[3][50] = "func=rect;x=350;y=-240;width=100;height=40;bc=orange;pw=1;" '5 shape[3][51] = "func=rect;x=460;y=-240;width=100;height=40;bc=orange;pw=1;"'5 shape[3][52] = "func=rect;x=570;y=-240;width=100;height=40;bc=orange;pw=1;"'5 shape[3][53] = "func=rect;x=-430;y=-195;width=50;height=40;bc=orange;pw=1;"'6 shape[3][54] = "func=rect;x=-370;y=-195;width=100;height=40;bc=orange;pw=1;"'6 shape[3][55] = "func=rect;x=-260;y=-195;width=100;height=40;bc=orange;pw=1;"'6 shape[3][56] = "func=rect;x=-150;y=-195;width=100;height=40;bc=orange;pw=1;"'6 shape[3][57] = "func=rect;x=-40;y=-195;width=100;height=40;bc=orange;pw=1;"'6 shape[3][58] = "func=rect;x=70;y=-195;width=100;height=40;bc=orange;pw=1;"'6 shape[3][59] = "func=rect;x=180;y=-195;width=100;height=40;bc=orange;pw=0;"'6 shape[3][60] = "func=rect;x=290;y=-195;width=100;height=40;bc=orange;pw=0;"'6 shape[3][61] = "func=rect;x=400;y=-195;width=100;height=40;bc=orange;pw=0;"'6 shape[3][62] = "func=rect;x=510;y=-195;width=100;height=40;bc=orange;pw=0;"'6 shape[3][63] = "func=rect;x=620;y=-195;width=100;height=40;bc=orange;pw=0;"'6 shape[3][64] = "func=rect;x=-420;y=-150;width=100;height=40;bc=orange;pw=0;"'7 shape[3][65] = "func=rect;x=-310;y=-150;width=100;height=40;bc=orange;pw=0;"'7 shape[3][66] = "func=rect;x=-200;y=-150;width=100;height=40;bc=orange;pw=0;"'7 shape[3][67] = "func=rect;x=-90;y=-150;width=100;height=40;bc=orange;pw=0;" '7 shape[3][68] = "func=rect;x=20;y=-150;width=100;height=40;bc=orange;pw=0;" '7 shape[3][69] = "func=rect;x=130;y=-150;width=100;height=40;bc=orange;pw=0;"'7 shape[3][70] = "func=rect;x=240;y=-150;width=100;height=40;bc=orange;pw=0;"'7 shape[3][71] = "func=rect;x=350;y=-150;width=100;height=40;bc=orange;pw=0;" '7 shape[3][72] = "func=rect;x=460;y=-150;width=100;height=40;bc=orange;pw=0;"'7 shape[3][73] = "func=rect;x=570;y=-150;width=100;height=40;bc=orange;pw=0;"'7 shape[3][74] = "func=rect;x=-430;y=-105;width=50;height=40;bc=orange;pw=0;"'8 shape[3][75] = "func=rect;x=-370;y=-105;width=100;height=40;bc=orange;pw=0;"'8 shape[3][76] = "func=rect;x=-260;y=-105;width=100;height=40;bc=orange;pw=0;"'8 shape[3][77] = "func=rect;x=-150;y=-105;width=100;height=40;bc=orange;pw=0;"'8 shape[3][78] = "func=rect;x=-40;y=-105;width=100;height=40;bc=orange;pw=0;"'8 shape[3][79] = "func=rect;x=70;y=-105;width=100;height=40;bc=orange;pw=0;"'8 shape[3][80] = "func=rect;x=180;y=-105;width=100;height=40;bc=orange;pw=0;"'8 shape[3][81] = "func=rect;x=290;y=-105;width=100;height=40;bc=orange;pw=0;"'8 shape[3][82] = "func=rect;x=400;y=-105;width=100;height=40;bc=orange;pw=0;"'8 shape[3][83] = "func=rect;x=510;y=-105;width=100;height=40;bc=orange;pw=0;"'8 shape[3][84] = "func=rect;x=620;y=-105;width=100;height=40;bc=orange;pw=0;"'8' shape[3][85] = "func=rect;x=-155;y=-335;width=200;height=300;bc=firebrick;pc=black;pw=2;"'D shape[3][86] = "func=rect;x=255;y=-335;width=250;height=180;bc=SeaGreen;pw=2;"'W shape[3][87] = "func=rect;x=680;y=-420;width=50;height=40;bc=skyblue;pw=1;"'LU1 shape[3][88] = "func=rect;x=730;y=-470;width=50;height=40;bc=skyblue;pw=1;"'LU1 shape[3][89] = "func=rect;x=780;y=-520;width=50;height=40;bc=skyblue;pw=1;"'LU1 'shape[3][90] = "func=rect;x=830;y=-570;width=50;height=40;bc=orange;pw=0;"'LU1 'shape[3][91] = "func=rect;x=880;y=-620;width=50;height=40;bc=orange;pw=0;"'L1 shape[3][90] = "func=rect;x=720;y=-400;width=50;height=40;bc=skyblue;pw=1;"'L1 shape[3][91] = "func=rect;x=760;y=-370;width=50;height=40;bc=skyblue;pw=1;"'L1 shape[3][92] = "func=rect;x=800;y=-340;width=50;height=40;bc=skyblue;pw=1;"'L1 shape[3][93] = "func=rect;x=840;y=-310;width=50;height=40;bc=skyblue;pw=1;"'L1 shape[3][94] = "func=rect;x=880;y=-280;width=50;height=40;bc=orange;pw=0;"'L1 shape[3][95] = "func=rect;x=700;y=-330;width=50;height=40;bc=orange;pw=0;"'L2 shape[3][96] = "func=rect;x=740;y=-300;width=50;height=40;bc=orange;pw=0;"'L2 shape[3][97] = "func=rect;x=780;y=-270;width=50;height=40;bc=orange;pw=0;"'L2 shape[3][98] = "func=rect;x=820;y=-240;width=50;height=40;bc=orange;pw=0;"'L2 shape[3][99] = "func=rect;x=860;y=-210;width=50;height=40;bc=orange;pw=0;"'L2 shape[3][100] = "func=rect;x=900;y=-180;width=50;height=40;bc=orange;pw=0;"'L2 shape[3][101] = "func=rect;x=700;y=-240;width=50;height=40;bc=orange;pw=0;"'L3 shape[3][102] = "func=rect;x=740;y=-210;width=50;height=40;bc=orange;pw=0;"'L3 shape[3][103] = "func=rect;x=780;y=-180;width=50;height=40;bc=orange;pw=0;"'L3 shape[3][104] = "func=rect;x=820;y=-150;width=50;height=40;bc=orange;pw=0;"'L3 shape[3][105] = "func=rect;x=700;y=-150;width=50;height=40;bc=orange;pw=0;"'L4 shape[3][106] = "func=rect;x=740;y=-120;width=50;height=40;bc=orange;pw=0;"'L4 shape[3][107] = "func=rect;x=770;y=-450;width=50;height=40;bc=orange;pw=0;"'LU2 shape[3][108] = "func=rect;x=800;y=-420;width=50;height=40;bc=orange;pw=0;"'LU2 shape[3][109] = "func=rect;x=850;y=-390;width=50;height=40;bc=orange;pw=0;"'LU2 shape[3][110] = "func=rect;x=820;y=-495;width=50;height=40;bc=orange;pw=0;"'LU3 shape[3][111] = "func=rect;x=-480;y=-420;width=50;height=40;bc=orange;pw=0;"'RU1 shape[3][112] = "func=rect;x=-520;y=-470;width=50;height=40;bc=orange;pw=0;"'RU1 shape[3][113] = "func=rect;x=-560;y=-520;width=50;height=40;bc=orange;pw=0;"'RU1 shape[3][114] = "func=rect;x=-500;y=-380;width=50;height=40;bc=orange;pw=0;"'R1 shape[3][115] = "func=rect;x=-540;y=-340;width=50;height=40;bc=orange;pw=0;"'R1 shape[3][116] = "func=rect;x=-580;y=-300;width=50;height=40;bc=orange;pw=0;"'R1 shape[3][117] = "func=rect;x=-620;y=-260;width=50;height=40;bc=orange;pw=0;"'R1 shape[3][118] = "func=rect;x=-660;y=-220;width=50;height=40;bc=orange;pw=0;"'R1 shape[3][119] = "func=rect;x=-480;y=-330;width=50;height=40;bc=skyblue;pw=1;"'R2 shape[3][120] = "func=rect;x=-500;y=-290;width=50;height=40;bc=skyblue;pw=1;"'R2 shape[3][121] = "func=rect;x=-525;y=-260;width=50;height=40;bc=skyblue;pw=1;"'R2 shape[3][122] = "func=rect;x=-560;y=-230;width=50;height=40;bc=skyblue;pw=1;"'R2 shape[3][123] = "func=rect;x=-600;y=-200;width=50;height=40;bc=orange;pw=0;"'R2 shape[3][124] = "func=rect;x=-640;y=-170;width=50;height=40;bc=orange;pw=0;"'R2 shape[3][125] = "func=rect;x=-475;y=-240;width=50;height=40;bc=orange;pw=0;"'R3 shape[3][126] = "func=rect;x=-500;y=-210;width=50;height=40;bc=orange;pw=0;"'R3 shape[3][127] = "func=rect;x=-540;y=-180;width=50;height=40;bc=orange;pw=0;"'R3 shape[3][128] = "func=rect;x=-580;y=-150;width=50;height=40;bc=orange;pw=0;"'R3 shape[3][129] = "func=rect;x=-480;y=-150;width=50;height=40;bc=orange;pw=0;"'R4 shape[3][130] = "func=rect;x=-520;y=-110;width=50;height=40;bc=orange;pw=0;"'R4 shape[3][131] = "func=rect;x=-540;y=-430;width=50;height=40;bc=orange;pw=0;"'RU1 shape[3][132] = "func=rect;x=-570;y=-390;width=50;height=40;bc=orange;pw=0;"'RU1 shape[3][133] = "func=rect;x=-610;y=-360;width=50;height=40;bc=orange;pw=0;"'RU1 shape[3][134] = "func=rect;x=-580;y=-480;width=50;height=40;bc=orange;pw=0;"'RU1 shape[3][135] = "func=rect;x=-610;y=-460;width=50;height=40;bc=orange;pw=0;"'RU2 shape[3][136] = "func=rect;x=-450;y=-470;width=80;height=40;angle=0;bc=lightSlateGray;pc=black;pw=2;"'Roof1 shape[3][137] = "func=rect;x=-360;y=-470;width=80;height=40;angle=0;bc=lightSlateGray;pc=black;pw=2;"'Roof1 shape[3][138] = "func=rect;x=-270;y=-470;width=80;height=40;angle=0;bc=lightSlateGray;pc=black;pw=2;"'Roof1 shape[3][139] = "func=rect;x=-180;y=-470;width=80;height=40;angle=0;bc=lightSlateGray;pc=black;pw=2;"'Roof1 shape[3][140] = "func=rect;x=-90;y=-470;width=80;height=40;angle=0;bc=lightSlateGray;pc=black;pw=2;"'Roof1 shape[3][141] = "func=rect;x=0;y=-470;width=80;height=40;angle=0;bc=lightSlateGray;pc=black;pw=2;"'Roof1 shape[3][142] = "func=rect;x=90;y=-470;width=80;height=40;angle=0;bc=firebrick;pw=2;"'Roof1 shape[3][143] = "func=rect;x=180;y=-470;width=80;height=40;angle=0;bc=firebrick;pw=2;"'Roof1 shape[3][144] = "func=rect;x=270;y=-470;width=80;height=40;angle=0;bc=firebrick;pw=2;"'Roof1 shape[3][145] = "func=rect;x=360;y=-470;width=80;height=40;angle=0;bc=firebrick;pw=2;"'Roof1 shape[3][146] = "func=rect;x=450;y=-470;width=80;height=40;angle=0;bc=firebrick;pw=2;"'Roof1 shape[3][147] = "func=rect;x=540;y=-470;width=80;height=40;angle=0;bc=firebrick;pw=2;"'Roof1 shape[3][148] = "func=rect;x=630;y=-470;width=80;height=40;angle=0;bc=firebrick;pw=2;"'Roof1 shape[3][149] = "func=rect;x=-500;y=-520;width=80;height=40;angle=0;bc=firebrick;pw=2;"'Roof2 shape[3][150] = "func=rect;x=-400;y=-520;width=80;height=40;angle=0;bc=firebrick;pw=2;"'Roof2 shape[3][151] = "func=rect;x=-300;y=-520;width=80;height=40;angle=0;bc=firebrick;pw=2;"'Roof2 shape[3][152] = "func=rect;x=-200;y=-520;width=80;height=40;angle=0;bc=firebrick;pw=2;"'Roof2 shape[3][153] = "func=rect;x=-100;y=-520;width=80;height=40;angle=0;bc=firebrick;pw=2;"'Roof2 shape[3][154] = "func=rect;x=0;y=-520;width=80;height=40;angle=0;bc=firebrick;pw=2;"'Roof2 shape[3][155] = "func=rect;x=100;y=-520;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof2 shape[3][156] = "func=rect;x=200;y=-520;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof2 shape[3][157] = "func=rect;x=300;y=-520;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof2 shape[3][158] = "func=rect;x=400;y=-520;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof2 shape[3][159] = "func=rect;x=500;y=-520;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof2 shape[3][160] = "func=rect;x=600;y=-520;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof2 shape[3][161] = "func=rect;x=700;y=-520;width=70;height=40;angle=0;bc=firebrick;pw=0;"'Roof2 shape[3][162] = "func=rect;x=-450;y=-570;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof3 shape[3][163] = "func=rect;x=-350;y=-570;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof3 shape[3][164] = "func=rect;x=-250;y=-570;width=80;height=40;angle=0;bc=firebrick;pw=0;"'R00r3 shape[3][165] = "func=rect;x=-150;y=-570;width=80;height=40;angle=0;bc=firebrick;pw=0;"'R00f3 shape[3][166] = "func=rect;x=-50;y=-570;width=80;height=40;angle=0;bc=firebrick;pw=0;"'R00f3 shape[3][167] = "func=rect;x=50;y=-570;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof3 shape[3][168] = "func=rect;x=150;y=-570;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof3 shape[3][169] = "func=rect;x=250;y=-570;width=80;height=40;angle=0;bc=firebrick;pw=0;"'R00f3 shape[3][170] = "func=rect;x=350;y=-570;width=80;height=40;angle=0;bc=firebrick;pw=0;"'R00f3 shape[3][171] = "func=rect;x=450;y=-570;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof3 shape[3][172] = "func=rect;x=550;y=-570;width=80;height=40;angle=0;bc=firebrick;pw=0;"'R00f3 shape[3][173] = "func=rect;x=650;y=-570;width=80;height=40;angle=0;bc=firebrick;pw=0;"'R00f3 shape[3][174] = "func=rect;x=-400;y=-620;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof4 shape[3][175] = "func=rect;x=-300;y=-620;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof4 shape[3][176] = "func=rect;x=-200;y=-620;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof4 shape[3][177] = "func=rect;x=-100;y=-620;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof4 shape[3][178] = "func=rect;x=0;y=-620;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof4 shape[3][179] = "func=rect;x=100;y=-620;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof4 shape[3][180] = "func=rect;x=200;y=-620;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof4 shape[3][181] = "func=rect;x=300;y=-620;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof4 shape[3][182] = "func=rect;x=400;y=-620;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof4 shape[3][183] = "func=rect;x=500;y=-620;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof4 shape[3][184] = "func=rect;x=600;y=-620;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof4 shape[3][185] = "func=rect;x=-340;y=-670;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof5 shape[3][186] = "func=rect;x=-240;y=-670;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof5 shape[3][187] = "func=rect;x=-140;y=-670;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof5 shape[3][188] = "func=rect;x=-40;y=-670;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof5 shape[3][189] = "func=rect;x=60;y=-670;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof5 shape[3][190] = "func=rect;x=160;y=-670;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof5 shape[3][191] = "func=rect;x=260;y=-670;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof5 shape[3][192] = "func=rect;x=360;y=-670;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof5 shape[3][193] = "func=rect;x=460;y=-670;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof5 shape[3][194] = "func=rect;x=560;y=-670;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof5 shape[3][195] = "func=rect;x=-300;y=-720;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof6 shape[3][196] = "func=rect;x=-200;y=-720;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof6 shape[3][197] = "func=rect;x=-100;y=-720;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof6 shape[3][198] = "func=rect;x=0;y=-720;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof6 shape[3][199] = "func=rect;x=100;y=-720;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof6 shape[3][200] = "func=rect;x=200;y=-720;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof6 shape[3][201] = "func=rect;x=300;y=-720;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof6 shape[3][202] = "func=rect;x=400;y=-720;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof6 shape[3][203] = "func=rect;x=500;y=-720;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof6 shape[3][204] = "func=rect;x=-250;y=-770;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof7 shape[3][205] = "func=rect;x=-150;y=-770;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof7 shape[3][206] = "func=rect;x=-50;y=-770;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof7 shape[3][207] = "func=rect;x=50;y=-770;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof7 shape[3][208] = "func=rect;x=150;y=-770;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof7 shape[3][209] = "func=rect;x=250;y=-770;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof7 shape[3][210] = "func=rect;x=350;y=-770;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof7 shape[3][211] = "func=rect;x=450;y=-770;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof7 shape[3][212] = "func=rect;x=-200;y=-820;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof8 shape[3][213] = "func=rect;x=-100;y=-820;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof8 shape[3][214] = "func=rect;x=0;y=-820;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof8 shape[3][215] = "func=rect;x=100;y=-820;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof8 shape[3][216] = "func=rect;x=200;y=-820;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof8 shape[3][217] = "func=rect;x=300;y=-820;width=80;height=40;angle=0;bc=firebrick;pw=0;"'Roof8 shape[3][218] = "func=rect;x=400;y=-820;width=80;height=40;angle=0;bc=darkslateGray;pc=darkslategry;pw=1;"'Roof8 shape[3][219] = "func=rect;x=1000;y=-500;width=80;height=40;angle=0;bc=skyblue;pw=1;"'RR1 shape[3][220] = "func=rect;x=1090;y=-500;width=80;height=40;angle=0;bc=SkyBlue;pw=1;"'RR1 shape[3][221] = "func=rect;x=1180;y=-500;width=80;height=40;angle=0;bc=SkyBlue;pw=1;"'RR1 shape[3][222] = "func=rect;x=1270;y=-500;width=80;height=40;angle=0;bc=SkyBlue;pw=1;"'RR1 shape[3][223] = "func=rect;x=1360;y=-500;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR1 shape[3][224] = "func=rect;x=1450;y=-500;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR1 shape[3][225] = "func=rect;x=1540;y=-500;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR1 shape[3][226] = "func=rect;x=1630;y=-500;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR1 shape[3][227] = "func=rect;x=1000;y=-450;width=80;height=40;angle=0;bc=lightSlateGray;pc=black;pw=1;"'RR2 shape[3][228] = "func=rect;x=1090;y=-450;width=80;height=40;angle=0;bc=lightSlateGray;pc=black;pw=1;"'RR2 shape[3][229] = "func=rect;x=1180;y=-450;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR2 shape[3][230] = "func=rect;x=1270;y=-450;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR2 shape[3][231] = "func=rect;x=1360;y=-450;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR2 shape[3][232] = "func=rect;x=1450;y=-450;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR2 shape[3][233] = "func=rect;x=1540;y=-450;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR2 shape[3][234] = "func=rect;x=1630;y=-450;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR2 shape[3][235] = "func=rect;x=1000;y=-400;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR3 shape[3][236] = "func=rect;x=1090;y=-400;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR3 shape[3][237] = "func=rect;x=1180;y=-400;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR3 shape[3][238] = "func=rect;x=1270;y=-400;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR3 shape[3][239] = "func=rect;x=1360;y=-400;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR3 shape[3][240] = "func=rect;x=1450;y=-400;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR3 shape[3][241] = "func=rect;x=1540;y=-400;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR3 shape[3][242] = "func=rect;x=1630;y=-400;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR3 shape[3][243] = "func=rect;x=1000;y=-350;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR4 shape[3][244] = "func=rect;x=1090;y=-350;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR4 shape[3][245] = "func=rect;x=1180;y=-350;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR4 shape[3][246] = "func=rect;x=1270;y=-350;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR4 shape[3][247] = "func=rect;x=1360;y=-350;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR4 shape[3][248] = "func=rect;x=1450;y=-350;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR4 shape[3][249] = "func=rect;x=1540;y=-350;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR4 shape[3][250] = "func=rect;x=1630;y=-350;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR4 shape[3][251] = "func=rect;x=1000;y=-300;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR5 shape[3][252] = "func=rect;x=1090;y=-300;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR5 shape[3][253] = "func=rect;x=1180;y=-300;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR5 shape[3][254] = "func=rect;x=1270;y=-300;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR5 shape[3][255] = "func=rect;x=1360;y=-300;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR5 shape[3][256] = "func=rect;x=1450;y=-300;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR5 shape[3][257] = "func=rect;x=1540;y=-300;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR5 shape[3][258] = "func=rect;x=1630;y=-300;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR5 shape[3][259] = "func=rect;x=1000;y=-250;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR6 shape[3][260] = "func=rect;x=1090;y=-250;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR6 shape[3][261] = "func=rect;x=1180;y=-250;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR6 shape[3][262] = "func=rect;x=1270;y=-250;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR6 shape[3][263] = "func=rect;x=1360;y=-250;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR6 shape[3][264] = "func=rect;x=1450;y=-250;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR6 shape[3][265] = "func=rect;x=1540;y=-250;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR6 shape[3][266] = "func=rect;x=1630;y=-250;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR6 shape[3][267] = "func=rect;x=1000;y=-200;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR7 shape[3][268] = "func=rect;x=1090;y=-200;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR7 shape[3][269] = "func=rect;x=1180;y=-200;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR7 shape[3][270] = "func=rect;x=1270;y=-200;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR7 shape[3][271] = "func=rect;x=1360;y=-200;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR7 shape[3][272] = "func=rect;x=1450;y=-200;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR7 shape[3][273] = "func=rect;x=1540;y=-200;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR7 shape[3][274] = "func=rect;x=1630;y=-200;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR7 shape[3][275] = "func=rect;x=1000;y=-150;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR8 shape[3][276] = "func=rect;x=1090;y=-150;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR8 shape[3][277] = "func=rect;x=1180;y=-150;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR8 shape[3][278] = "func=rect;x=1270;y=-150;width=80;height=40;angle=0;bc=firebrick;pw=0;"'RR8 shape[3][279] = "func=rect;x=1360;y=-150;width=80;height=40;angle=0;bc=skyblue;pc=black;pw=1;"'RR8 shape[3][280] = "func=rect;x=1450;y=-150;width=80;height=40;angle=0;bc=skyblue;pc=black;pw=1;"'RR8 shape[3][281] = "func=rect;x=1540;y=-150;width=80;height=40;angle=0;bc=skyblue;pc=black;pw=1;"'RR8 shape[3][282] = "func=rect;x=1630;y=-150;width=80;height=40;angle=0;bc=skyblue;pc=black;pw=1;"'RR8 shape[3][283] = "func=rect;x=-200;y=-850;width=680;height=22;angle=0;bc=silver;pw=0;" shape[3][284] = "func=rect;x=-380;y=-915;width=10;height=477;angle=48;bc=silver;pw=0;" shape[3][285] = "func=rect;x=650;y=-915;width=10;height=477;angle=-47;bc=silver;pw=0;" ' Ladder s[4] ="1=0.6" ' scale shx[4] ="1= 380" ' initial x -position shy[4] ="1= 180" ' initial y-position shape[4][1] = "func=line;x=0;y=0;x1=400;y1=200;x2=660;y2=525;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder P1 shape[4][2] = "func=line;x=0;y=0;x1=440;y1=200;x2=700;y2=525;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder P2 shape[4][3] = "func=line;x=0;y=0;x1=415;y1=220;x2=455;y2=220;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 1 shape[4][4] = "func=line;x=0;y=0;x1=430;y1=240;x2=470;y2=240;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 2 shape[4][5] = "func=line;x=0;y=0;x1=445;y1=260;x2=488;y2=260;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 3 shape[4][6] = "func=line;x=0;y=0;x1=460;y1=280;x2=505;y2=280;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 4 shape[4][7] = "func=line;x=0;y=0;x1=475;y1=300;x2=522;y2=300;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 5 shape[4][8] = "func=line;x=0;y=0;x1=492;y1=320;x2=537;y2=320;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 6 shape[4][9] = "func=line;x=0;y=0;x1=508;y1=340;x2=549;y2=340;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 7 shape[4][10] = "func=line;x=0;y=0;x1=528;y1=360;x2=568;y2=360;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 8 shape[4][11] = "func=line;x=0;y=0;x1=636;y1=500;x2=680;y2=500;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step L shape[4][12] = "func=line;x=0;y=0;x1=400;y1=200;x2=400;y2=530;angle=0;bc=mediumslateblue;pc=darkgray;pw=2"'<------------' Shadow1 P1 shape[4][13] = "func=line;x=0;y=0;x1=440;y1=200;x2=445;y2=500;angle=0;bc=mediumslateblue;pc=darkgray;pw=2"'<------------' Shadow1 P2 shape[4][14] = "func=line;x=0;y=0;x1=444;y1=500;x2=640;y2=500;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 P1 shape[4][15] = "func=line;x=0;y=0;x1=400;y1=530;x2=660;y2=530;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 P1 shape[4][16] = "func=line;x=0;y=0;x1=400;y1=220;x2=414;y2=220;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow1 Step 1 shape[4][17] = "func=line;x=0;y=0;x1=400;y1=240;x2=430;y2=240;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow1 Step 2 'shape[4][18] = "func=line;x=0;y=0;x1=400;y1=530;x2=444;y2=500;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow Step M 'shape[4][19] = "func=line;x=0;y=0;x1=440;y1=530;x2=484;y2=500;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 Step 1 shape[4][20] = "func=line;x=0;y=0;x1=530;y1=530;x2=530;y2=500;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 Step 2 shape[4][21] = "func=line;x=0;y=0;x1=570;y1=530;x2=570;y2=500;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 Step 3 shape[4][22] = "func=line;x=0;y=0;x1=604;y1=530;x2=604;y2=500;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 Step 4 'shape[4][23] = "func=line;x=0;y=0;x1=640;y1=530;x2=640;y2=500;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 Step 5 shape[4][24] = "func=line;x=0;y=0;x1=638;y1=530;x2=638;y2=502;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow2 Step L shape[4][25] = "func=line;x=0;y=0;x1=545;y1=380;x2=585;y2=380;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 9 shape[4][26] = "func=line;x=0;y=0;x1=560;y1=400;x2=600;y2=400;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 10 shape[4][27] = "func=line;x=0;y=0;x1=575;y1=420;x2=615;y2=420;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 11 shape[4][28] = "func=line;x=0;y=0;x1=590;y1=440;x2=630;y2=440;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 12 shape[4][29] = "func=line;x=0;y=0;x1=605;y1=460;x2=645;y2=460;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 13 shape[4][30] = "func=line;x=0;y=0;x1=622;y1=480;x2=660;y2=480;angle=0;bc=darkslategray;pc=#oooooo;pw=2" ' Ladder Step 14 shape[4][31] = "func=line;x=0;y=0;x1=400;y1=260;x2=445;y2=260;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow1 Step 3 shape[4][32] = "func=line;x=0;y=0;x1=400;y1=280;x2=445;y2=280;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow1 Step 4 shape[4][33] = "func=line;x=0;y=0;x1=400;y1=300;x2=445;y2=300;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow1 Step 5 shape[4][34] = "func=line;x=0;y=0;x1=400;y1=320;x2=445;y2=320;angle=0;bc=darkslategray;pc=darkgray;pw=2" ' <------------' Shadow1 Step 6 shape[4][35] = "func=line;x=0;y=0;x1=400;y1=340;x2=445;y2=340;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 7 shape[4][36] = "func=line;x=0;y=0;x1=400;y1=360;x2=445;y2=360;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 8 shape[4][37] = "func=line;x=0;y=0;x1=400;y1=380;x2=445;y2=380;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 9 'shape[4][38] = "func=line;x=0;y=0;x1=400;y1=400;x2=445;y2=400;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 10 'shape[4][39] = "func=line;x=0;y=0;x1=400;y1=420;x2=445;y2=420;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 11 'shape[4][40] = "func=line;x=0;y=0;x1=400;y1=440;x2=445;y2=440;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 12 'shape[4][41] = "func=line;x=0;y=0;x1=400;y1=460;x2=445;y2=460;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 13 'shape[4][42] = "func=line;x=0;y=0;x1=400;y1=480;x2=445;y2=480;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 14 'shape[4][43] = "func=line;x=0;y=0;x1=400;y1=500;x2=445;y2=500;angle=0;bc=darkslategray;pc=silver;pw=2" ' <------------' Shadow1 Step 15 ' Sprite Shapes 1 s[5] ="1=0.4" shX[5] ="1=1180" shY[5] ="1=10" ' Sprite Shapes 2 s[6] ="1=0" shX[6] ="1=0" shY[6] ="1=0" ' Sprite Shapes 3 s[7]="1=0" shX[7] = "1=0"' x offset shY[7] = "1=0"' y offset ' Aircraft s[8] = "1=0.7" shX[8]= "1=770" shY[8]= "1=-22" shape[8][1] = "func=tri;x=0;y=0;x1=400;y1=150;x2=370;y2=50;x3=150;y3=150;angle=0;bc=lightslategray;pc=darkslategray;pw=0" shape[8][2] = "func=tri;x=0;y=0;x1=400;y1=150;x2=370;y2=250;x3=150;y3=150;angle=0;bc=lightslategray;pc=darkslategray;pw=0" shape[8][3] = "func=ell;x=350;y=40;width=33;height=22;bc=yellowgreen;pw=0;tag=eye" ' eye 1 ' <<<<>>>> shape[8][4] = "func=ell;x=350;y=235;width=33;height=22;bc=greenyellow;pw=0;tag=eye" ' eye 2 ' <<<<>>>> shape[8][5] = "func=ell;x=20;y=130;width=280;height=40;bc=lightslategray;pc=darkslategray;pw=0"'<------------CockPit 1 shape[8][6] = "func=ell;x=40;y=137;width=120;height=25;bc=snow;pc=darkslategray;pw=2;tag=0" ' <------CockPit 2 ' <<<<>>>> shape[8][7] = "func=rect;x=368;y=105;width=25;height=40;angle=-10;bc=darkslategray;pc=darkslategray;pw=2" ' <------Tail shape[8][8] = "func=rect;x=370;y=150;width=25;height=40;angle=15;bc=darkslategray;pc=darkslategray;pw=2" ' <------Tail shape[8][9] = "func=rect;x=320;y=142;width=80;height=10;angle=0;bc=lightslategray;pc=lightslategray;pw=2" '---------Tail shape[8][10] = "func=ell;x=370;y=133;width=44;height=11;bc=cyan;pw=0;tag=mouth" ' ' <<<<>>>> shape[8][11] = "func=ell;x=370;y=153;width=44;height=11;bc=cyan;pw=0;tag=mouth" ' ' <<<<>>>> s[9] ="1=0.8" ' scale shx[9] ="1=-180" ' initial x -position shy[9] ="1=-180" ' initial y-position ' BlueCar s[10] ="1=0.5" shX[10] ="1=800" shY[10] ="1=550" shape[10][1] = "func=rect;x=0;y=29;width=36;height=44;bc=#3B3B3B;pw=0;" shape[10][2] = "func=rect;x=83;y=28;width=36;height=44;bc=#3B3B3B;pw=0;" shape[10][3] = "func=rect;x=1;y=141;width=36;height=44;bc=#3B3B3B;pw=0;" shape[10][4] = "func=rect;x=83;y=142;width=36;height=44;bc=#3B3B3B;pw=0;" shape[10][5] = "func=rect;x=15;y=0;width=91;height=199;bc=#5A95CD;pw=0;" shape[10][6] = "func=rect;x=29;y=64;width=65;height=98;bc=#3B3B3B;pw=0;" shape[10][7] = "func=rect;x=35;y=85;width=53;height=68;bc=#5A95CD;pw=0;" shape[10][8] = "func=line;x=28;y=64;x1=0;y1=0;x2=8;y2=21;pc=#5A95CD;pw=2;" shape[10][9] = "func=line;x=87;y=63;x1=6;y1=0;x2=0;y2=22;pc=#5A95CD;pw=2;" shape[10][10] = "func=line;x=86;y=152;x1=0;y1=0;x2=7;y2=10;pc=#5A95CD;pw=2;" shape[10][11] = "func=line;x=24;y=151;x1=8;y1=0;x2=0;y2=11;pc=#5A95CD;pw=2;" shape[10][12]="func=ell;x=24;y=7;width=29;height=19;angle=-50;bc=#C4D9ED;pw=0.5" ' LF<------ shape[10][13]="func=ell;X=78;Y=7;width=29;height=19;angle=50;bc=#C4D9ED;pw=0.5" ' LR<------ shape[10][14]="func=rect;X=14;Y=180;width=33;height=15;angle=40;bc=#800000;pc=darkslategray;pw=0" shape[10][15]="func=rect;X=72;Y=180;width=33;height=15;angle=-40;bc=#800000;pc=darkslategray;pw=0" endsub End>LLQ017.sb< Start>LLR789-0.sb< '############################################################### '############## A CURLING PROGRAM FOR SMALL BASIC ################# '############################################################### '=============================================================== 'Initial TextWindow screen to select player colours and show instructions '=============================================================== Colors[1] = "Red" Colors[2] = "Blue" Colors[3] = "Green" Colors[4] = "Cyan" Colors[5] = "Purple" Colors[6] = "Orange" Colors[7] = "Yellow" TextWindow.Title = "Curling" For i = 1 To 7 TextWindow.WriteLine(i+" : "+Colors[i]) EndFor TextWindow.WriteLine("") TextWindow.ForegroundColor = "Yellow" 'This is rather fussy code to ensure only allowed number data is entered to select player colours While (Color[1] = "") TextWindow.CursorTop = 8 TextWindow.WriteLine(" ") TextWindow.CursorTop = 8 TextWindow.Write("Player 1 Select Colour: ") Color[1] = Colors[TextWindow.ReadNumber()] EndWhile While (Color[2] = "" Or Color[1] = Color[2]) TextWindow.CursorTop = 9 TextWindow.WriteLine(" ") TextWindow.CursorTop = 9 TextWindow.Write("Player 2 Select Colour: ") Color[2] = Colors[TextWindow.ReadNumber()] EndWhile TextWindow.ForegroundColor = "White" TextWindow.WriteLine("") TextWindow.WriteLine("Screen reloution of 1280x800 is best.") TextWindow.WriteLine("") TextWindow.WriteLine("Use the mouse click to first direct the stone, then set the curl.") TextWindow.WriteLine("The stone will run roughly double the initial set direction.") TextWindow.WriteLine("Waggle the mouse just in front of the stone to sweep it further.") TextWindow.WriteLine("Sweeping to one side will also alter its path slightly.") TextWindow.WriteLine("") TextWindow.WriteLine("See the code to see what what else is happening - that's what its for.") TextWindow.WriteLine("") TextWindow.Write("Press ") TextWindow.ForegroundColor = "Red" TextWindow.Write("ENTER") TextWindow.ForegroundColor = "White" TextWindow.Write(" to play.") '=============================================================== 'Load the images (with the player colours) while waiting for an ENTER, then get rid of the TextWindow '=============================================================== 'dir = Program.Directory dir = "http://litdev.web.officelive.com/images/Thumbnails" For i = 1 To 2 stoneImage[i] = ImageList.LoadImage(dir+"\stone"+Color[i]+".png") brushImage[i] = ImageList.LoadImage(dir+"\brush"+Color[i]+".png") EndFor rad = ImageList.GetWidthOfImage(stoneImage[1])/2 brushW = ImageList.GetWidthOfImage(brushImage[1])/2 brushH = ImageList.GetHeightOfImage(brushImage[1])*7/8 TextWindow.Read() TextWindow.Hide() 'Download the sweeping sound - works OK just using it directly 'sweepSound = Network.DownloadFile("http://litdev.web.officelive.com/Documents/sweep.wma") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' 'File.CopyFile(sweepSound,Program.Directory+"\sweep.wma") 'must be named wma, not tmp 'sweepSound = Program.Directory+"\sweep.wma" sweepSound = "http://litdev.web.officelive.com/Documents/sweep.wma" 'Can't fix the sound conflict issues (sometimes crashes game) so flag to turn off sound effects (0-Off : 1-On) USESOUND = 0 '=============================================================== 'Set the GraphicsWindow up, including the background colour 'bg' '=============================================================== gw = 1250 gh = 400 GraphicsWindow.CanResize = "False" GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Left = (Desktop.Width-gw)/2 GraphicsWindow.Top = (Desktop.Height-gh)/2 GraphicsWindow.Title = "Curling" bg = "#ddeeff" GraphicsWindow.BackgroundColor = bg Mouse.HideCursor() Mouse.MouseX = GraphicsWindow.Left+gw/2 Mouse.MouseY = GraphicsWindow.Top+gh/2 CL = 0.85*gw 'Centre line of scoring zone '=============================================================== 'Draw the rink with SHAPES - they always lie on top of the background pane used for play direction and curl arrows 'The Order of adding the shapes is important - they lay on top of each other - rink, then brushes, then stones '=============================================================== GraphicsWindow.PenColor = "Blue" GraphicsWindow.BrushColor = "Blue" size = 9 Shapes.Move(Shapes.AddEllipse(size*rad,size*rad),CL-size/2*rad,gh/2-size/2*rad) GraphicsWindow.PenColor = bg GraphicsWindow.BrushColor = bg size = 6.5 Shapes.Move(Shapes.AddEllipse(size*rad,size*rad),CL-size/2*rad,gh/2-size/2*rad) GraphicsWindow.PenColor = "Red" GraphicsWindow.BrushColor = "Red" size = 4 Shapes.Move(Shapes.AddEllipse(size*rad,size*rad),CL-size/2*rad,gh/2-size/2*rad) GraphicsWindow.PenColor = bg GraphicsWindow.BrushColor = bg size = 1.5 Shapes.Move(Shapes.AddEllipse(size*rad,size*rad),CL-size/2*rad,gh/2-size/2*rad) 'Some game play lines (hog line, centre lines) GraphicsWindow.PenColor = "DarkGray" GraphicsWindow.BrushColor = GraphicsWindow.PenColor Shapes.Move(Shapes.AddRectangle(2,gh),CL-1,0) Shapes.Move(Shapes.AddRectangle(gw,2),0,gh/2-1) GraphicsWindow.PenColor = "Black" GraphicsWindow.BrushColor = GraphicsWindow.PenColor Shapes.Move(Shapes.AddRectangle(4,gh),gw/2-2,0) 'Back foot stop Shapes.Move(Shapes.AddRectangle(8,15),0,gh/2-25) Shapes.Move(Shapes.AddRectangle(8,15),0,gh/2+10) Shapes.Move(Shapes.AddRectangle(4,50),0,gh/2-25) 'Speckles on the ice GraphicsWindow.PenColor = "#ddccccff" GraphicsWindow.BrushColor = GraphicsWindow.PenColor For i = 1 To 1000 Shapes.Move(Shapes.AddEllipse(2,2),Math.GetRandomNumber(gw)-1,Math.GetRandomNumber(gh)-1) EndFor 'Brushes For i = 1 To 2 brush[i] = Shapes.AddImage(brushImage[i]) Shapes.HideShape(brush[i]) EndFor '=============================================================== 'Start events and set some game parameters 'hammer is the order of play hammer[1] = 2 means player 2 goes first '=============================================================== GraphicsWindow.MouseMove = OnMouseMove GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseUp = OnMouseUp MouseMove = 0 mouseDown = 0 mouseUp = 0 pi = Math.Pi deg2rad = pi/180 friction = 0.05 ' Stone friction elastic = 0.8 'Elasticity of collisions dt = 0.1 'Speed of game play (time-step size) soundDelay = 500 'Delay (ms) between trying to play sounds - the shortest that works OK for PlayClick() nStone = 16 '=============================================================== 'Main game play - 10 ends '=============================================================== START: hammer[1] = 1 hammer[2] = 3-hammer[1] For game = 1 To 10 For i = 1 To 2 Score[game][i] = 0 EndFor EndFor For game = 1 To 10 DrawScore() 'Update the score graphic - this is on the background layer and can be messed by the game shot direction arrows stone = "" 'Reset the active stones For i = 1 To 4 'Player For k = 1 To 2 'Stone For j = 1 To 2 'Team 'iNext is the stone to add, depends on player order (hammer) iNext = 4*(i-1)+2*(k-1)+j 'Add the stone and move to the starting area Shapes.Remove(stones[iNext]) stones[iNext] = Shapes.AddImage(stoneImage[hammer[j]]) Shapes.Move(stones[iNext],(4-i)*2*rad,(j-1)*(gh-4*rad)+(k-1)*2*rad) EndFor EndFor EndFor 'Now the game starts For i = 1 To 4 'Player For k = 1 To 2 'Stone For j = 1 To 2 'Team 'Select the current player stone iNext = 4*(i-1)+2*(k-1)+j 'Throw the stone throwStones() 'Update the score graphics - again it can be messed by the shot direction arrows DrawScore() EndFor EndFor EndFor UpdateScore() Program.Delay(1000) EndFor '=============================================================== 'Game finished - Find and report eport the winner '=============================================================== 'Remove the stone shapes for tidyness or in case we want to restart For i = 1 To nStone Shapes.Remove(stones[i]) EndFor stones = "" For i = 1 To 2 Total[i] = 0 For j = 1 To 10 Total[i] = Total[i] + Score[j][i] EndFor EndFor GraphicsWindow.BrushColor = "DarkGray" GraphicsWindow.FontSize = 70 If (Total[1] > Total[2]) Then GraphicsWindow.DrawText(100,100,"Player 1 is the WINNER") ElseIf (Total[2] > Total[1]) Then GraphicsWindow.DrawText(100,100,"Player 2 is the WINNER") Else GraphicsWindow.DrawText(100,100,"The game is a DRAW") EndIf 'Finish here - we could ask the user to restart and then GoTo START Program.Delay(5000) Program.End() '=============================================================== 'SUBROUTINES FOR GAME '=============================================================== '=============================================================== 'Calculate the Score - nearest sones within the scoring zone '=============================================================== Sub UpdateScore For iStone = 1 To nStone dist[iStone] = Math.SquareRoot((stoneX[iStone]-CL)*(stoneX[iStone]-CL) + (stoneY[iStone]-gh/2)*(stoneY[iStone]-gh/2)) rank[iStone] = 0 If (dist[iStone] < 5.5*rad) Then If (iStone/2 = Math.Floor(iStone/2)) Then rank[iStone] = 2 Else rank[iStone] = 1 EndIf EndIf EndFor For iStone = 1 To nStone-1 For jStone = iStone To nStone If (dist[jStone] < dist[iStone]) Then temp = dist[iStone] dist[iStone] = dist[jStone] dist[jStone] = temp temp = rank[iStone] rank[iStone] = rank[jStone] rank[jStone] = temp EndIf EndFor EndFor winner = rank[1] If (winner > 0) Then i = 1 While (rank[i] = winner) Score[game][hammer[winner]] = Score[game][hammer[winner]] + 1 i = i+1 EndWhile 'Next end the winner goes first - advantage to go last (have the hammer) hammer[1] = hammer[winner] hammer[2] = 3-hammer[1] EndIf DrawScore() EndSub '=============================================================== 'Draw the score graphics as required '=============================================================== Sub DrawScore GraphicsWindow.PenColor = bg GraphicsWindow.BrushColor = bg GraphicsWindow.FillRectangle(250,0,300,60) GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.FillRectangle(320,20,200,40) GraphicsWindow.BrushColor = "LightGray" GraphicsWindow.FillRectangle(320+20*(game-1),2,20,16) GraphicsWindow.BrushColor = Color[1] GraphicsWindow.DrawText(250,20,"Player 1") GraphicsWindow.BrushColor = Color[2] GraphicsWindow.DrawText(250,40,"Player 2") GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(250,0,"End") For iX = 1 To 10 'i and j variables used in main loop GraphicsWindow.DrawText(320+20*(iX-1),0,iX) For jX = 1 To 2 GraphicsWindow.DrawText(320+20*(iX-1),20*jX,Score[iX][jX]) EndFor EndFor EndSub '=============================================================== 'Throw the stones - the PHYSICS part '=============================================================== Sub throwStones 'Set the next active (stone) from the list of availables stones (stones) stone[iNext] = stones[iNext] If (iNext/2 = Math.Floor(iNext/2)) Then iPlayer = hammer[2] Else iPlayer = hammer[1] EndIf 'Do the initial direction, velocity and curl startStone() 'Run while stones are active (moving) active = 1 mouseMove = 0 While (active = 1) 'Add the player brush image (note it is centred on the middle of the brush, not the middle of the image) Shapes.ShowShape(brush[iPlayer]) xM = GraphicsWindow.MouseX yM = GraphicsWindow.MouseY Shapes.Move(brush[iPlayer],xM-brushW,yM-brushH) 'Process each active stone (each stone in the playiong area) active = 0 For iStone = 1 To Array.GetItemCount(stone) If (stoneX[iStone] > 0) Then ' Only consider moving stones for the position update 'iPlayerStone is the the player corresponding to the current stone - we can't sweep opponent stone untill it is past the score zone centre If (iStone/2 = Math.Floor(iStone/2)) Then iPlayerStone = hammer[2] Else iPlayerStone = hammer[1] EndIf 'Get the current stone path angle If (stoneU[iStone] = 0) Then ang = pi/2 Else ang = Math.ArcTan(stoneV[iStone]/stoneU[iStone]) EndIf If (stoneU[iStone] < 0) Then ang = ang+pi EndIf 'Check if the stone is being swept 'Are we just in front of the stone, is it our stone or are we past the score zone centre 'Is the stone moving and is the mouse moving (sweeping) 'We check 2 overlapping circles the size of the stone infront of its path direction sweep = 0 If ((iPlayerStone = iPlayer Or stoneX[iStone] > CL) And Math.Abs(stoneU[iStone]) > 0 And mouseMove = 1) Then centreX = stoneX[iStone]+2*rad*Math.Cos(ang) centreY = stoneY[iStone]+2*rad*Math.Sin(ang) dist = Math.SquareRoot((centreX-xM)*(centreX-xM)+(centreY-yM)*(centreY-yM)) If (dist < rad) Then sweep = 1 EndIf centreX = stoneX[iStone]+3*rad*Math.Cos(ang) centreY = stoneY[iStone]+3*rad*Math.Sin(ang) dist = Math.SquareRoot((centreX-xM)*(centreX-xM)+(centreY-yM)*(centreY-yM)) If (dist < rad) Then sweep = 1 EndIf mouseMove = 0 EndIf 'Give a swept stone an opacity change to see it is being swept If (sweep = 1) Then Shapes.SetOpacity(stone[iStone],50) 'Add your own sweeping sound here - otherwise uses a downloaded file If (USESOUND = 1) Then ms = Clock.ElapsedMilliseconds If (ms-lastSound > soundDelay) Then lastSound = ms Sound.Stop(sweepSound) Sound.Play(sweepSound) EndIf EndIf Else Shapes.SetOpacity(stone[iStone],100) EndIf 'Update the velocity and rotation speed for friction, accounting for reduced friction with sweep stoneU[iStone] = (1-friction*(1-0.2*sweep)*dt)*stoneU[iStone] stoneV[iStone] = (1-friction*(1-0.2*sweep)*dt)*stoneV[iStone] stoneRotate[iStone] = (1-0.5*friction*(1-0.2*sweep)*dt)*stoneRotate[iStone] 'Average velocity and the velocity of the left and right edges affected by the curl 'The curl is generated by differenbt velocities and hence friction on the spinning stone vel = Math.SquareRoot(stoneU[iStone]*stoneU[iStone]+stoneV[iStone]*stoneV[iStone]) dvel = stoneRotate[iStone]*deg2rad*rad vel1 = vel+dvel vel2 = vel-dvel 'This is a fudge to estimate a deviation based on the velocities of the stone wrt to the ice on either side of the spinning stone deviation = 0.0002*(vel1-vel2) 'stoneRotate > 0 (clockwise) increases stoneV (down) and deviation > 0 => vel1>vel2, hence bush below (yM>stoneY) swings stone up (reduces deviation) 'Sweep also affects the deviation - the trig (tan) is just accounting for the fact that the stone may not be moving just in the X direction If (sweep = 1) Then If (yM > stoneY[iStone]+(xM-stoneX[iStone])*Math.Tan(ang)) Then deviation = deviation-0.001*Math.Abs(dvel) Else deviation = deviation+0.001*Math.Abs(dvel) EndIf EndIf 'Update velocity - deviate from current path due to curl stoneU[iStone] = stoneU[iStone]-Math.Sin(ang)*deviation stoneV[iStone] = stoneV[iStone]+Math.Cos(ang)*deviation 'Update position and rotation stoneAngle[iStone] = stoneAngle[iStone]+stoneRotate[iStone]*dt stoneX[iStone] = stoneX[iStone]+stoneU[iStone]*dt stoneY[iStone] = stoneY[iStone]+stoneV[iStone]*dt 'Do any collisions Collision() 'Check for stopped stones If (vel > 1) Then active = 1 Else stoneU[iStone] = 0 stoneV[iStone] = 0 stoneRotate[iStone] = 0 'A stone that doesn't reach the half way point is dead If (stoneX[iStone] < gw/2) Then stoneX[iStone] = -1000 stoneY[iStone] = -1000 playClick() EndIf EndIf 'Remove and dead stones that hit the end or top /botton edges If (stoneX[iStone] > gw-rad Or stoneY[iStone] < rad Or stoneY[iStone] > gh-rad) Then stoneX[iStone] = -1000 stoneY[iStone] = -1000 stoneU[iStone] = 0 stoneV[iStone] = 0 playClick() EndIf 'Finally rotate and move the stone image shape Shapes.Rotate(stone[iStone],stoneAngle[iStone]) Shapes.Move(stone[iStone],stoneX[iStone]-rad,stoneY[iStone]-rad) EndIf EndFor Program.Delay(10) EndWhile 'Ensure all stones at the end of the delivery are fully opaque and hide the brush ans stop any remaining sweeping sound For iStone = 1 To Array.GetItemCount(stone) Shapes.SetOpacity(stone[iStone],100) EndFor Shapes.HideShape(brush[iPlayer]) Sound.Stop(sweepSound) EndSub '=============================================================== 'Check for collisions of active stones in the play area '=============================================================== Sub Collision 'Consider the current stone and all other stones in play (array stone) For jStone = 1 To Array.GetItemCount(stone) If (iStone <> jStone) Then dx = stoneX[jStone]-stoneX[iStone] dy = stoneY[jStone]-stoneY[iStone] dist = Math.SquareRoot(dx*dx+dy*dy) If (dist < 1.9*rad) Then 'Images are slightly bigger than stone diameter 'Calculate average velocity vector U = (stoneU[iStone]+stoneU[jStone])/2 V = (stoneV[iStone]+stoneV[jStone])/2 'This is the centre of momentun velocities - the collisions are easiest in this reference frame 'This is because each stone then effectively just rebounds as if it hit a wall 'Just like two balls with equal speed hitting head on - the centre of momentum there is stationary stoneU[iStone] = stoneU[iStone]-U stoneV[iStone] = stoneV[iStone]-V stoneU[jStone] = stoneU[jStone]-U stoneV[jStone] = stoneV[jStone]-V 'This is the normal unit vector from the centre of stone iStone to the centre of jStone normX = dx/dist normY = dy/dist 'This is not obvious, but I think it is the easiest way to calculate the collision reasonably without lots of trig and angles 'Basically it just uses vectors - hard to explain without a drawing, but with a drawing it should make sense 'u is the incident stone vector 'u* is its reflection direction vector 'n is the unit vector from stone i to stone j 'u.n is a dot product (the distance of u in the direction n) 'u -u* = 2u.n n dotProduct = normX*stoneU[iStone] + normY*stoneV[iStone] If (dotProduct > 0) Then ' Only collide stones that are impacting - but not if it is inside the collision radius and moving away (could happen with long time-steps) stoneU[iStone] = stoneU[iStone] - 2*normX*dotProduct stoneV[iStone] = stoneV[iStone] - 2*normY*dotProduct EndIf 'u*-u = -2u.n n dotProduct = normX*stoneU[jStone] + normY*stoneV[jStone] If (dotProduct < 0) Then stoneU[jStone] = stoneU[jStone] - 2*normX*dotProduct stoneV[jStone] = stoneV[jStone] - 2*normY*dotProduct EndIf 'Convert back from centre of momentun frame to true frame, with a little energy loss (elastic < 1) - this runs a stone on a little after it hits a target stone stoneU[iStone] = elastic*stoneU[iStone]+U stoneV[iStone] = elastic*stoneV[iStone]+V stoneU[jStone] = elastic*stoneU[jStone]+U stoneV[jStone] = elastic*stoneV[jStone]+V 'Play an impact sound playClick() EndIf EndIf EndFor EndSub '=============================================================== 'Initialise a stone throw - all the arrow starting for direction, power and curl '=============================================================== Sub startStone 'The starting point - rotation is just to align the handle in the X direction stoneX[iNext] = 50 stoneY[iNext] = gh/2 stoneAngle[iNext] = -68 Shapes.Rotate(stone[iNext],stoneAngle[iNext]) Shapes.Move(stone[iNext],stoneX[iNext]-rad,stoneY[iNext]-rad) 'Draw the arrow for speed and direction - most of the effor here is the overdraw to prevent shaddow images remaining as we move the arrow with the mouse mouseUp = 0 While (mouseUp = 0) If (mouseMove = 1) Then xM = GraphicsWindow.MouseX yM = GraphicsWindow.MouseY GraphicsWindow.PenColor = Color[iPlayer] GraphicsWindow.PenWidth = 2 Shapes.Remove(line) line=shapes.AddLine(stoneX[iNext]+22,stoneY[iNext],xM,yM) mouseMove = 0 EndIf EndWhile 'Set intial velocity vector - we could add some randomness here stoneU[iNext] = (xM-stoneX[iNext])/10 stoneV[iNext] = (yM-stoneY[iNext])/10 'Draw the arrow for curl xStart = xM mouseUp = 0 Shapes.Remove(line) While (mouseUp = 0) If (mouseMove = 1) Then xM = GraphicsWindow.MouseX yM = GraphicsWindow.MouseY GraphicsWindow.PenColor = Color[iPlayer] GraphicsWindow.PenWidth = 2 Shapes.Remove(line) line=shapes.AddLine(xStart,stoneY[iNext],xStart,yM) mouseMove = 0 EndIf EndWhile Shapes.Remove(line) 'Set intial curl rotation - again some randomness is possible, but I thought the game was best without stoneRotate[iNext] = (yM-gh/2)/2 EndSub '=============================================================== 'Play a click - try to prevent sound clashing - the time check is to make sure it is finished the last before starting the next sound '=============================================================== Sub playClick If (USESOUND = 1) Then ms = Clock.ElapsedMilliseconds If (ms-lastSound > soundDelay) Then lastSound = ms Sound.Stop(sweepSound) Sound.PlayClick() EndIf EndIf EndSub '=============================================================== 'The events - just set flags as required '=============================================================== Sub OnMouseMove mouseMove = 1 'TextWindow.WriteLine(Clock.ElapsedMilliseconds) 'Interesting effect - this event is triggered when a shape moves over the mouse - could be useful (not here though) EndSub Sub OnMouseDown mouseDown = 1 mouseUp = 0 EndSub Sub OnMouseUp mouseDown = 0 mouseUp = 1 EndSub End>LLR789-0.sb< Start>LLR789.sb< '############################################################### '############## A CURLING PROGRAM FOR SMALL BASIC ################# '############################################################### '=============================================================== 'Initial TextWindow screen to select player colours and show instructions '=============================================================== Colors[1] = "Red" Colors[2] = "Blue" Colors[3] = "Green" Colors[4] = "Cyan" Colors[5] = "Purple" Colors[6] = "Orange" Colors[7] = "Yellow" TextWindow.Title = "Curling" For i = 1 To 7 TextWindow.WriteLine(i+" : "+Colors[i]) EndFor TextWindow.WriteLine("") TextWindow.ForegroundColor = "Yellow" 'This is rather fussy code to ensure only allowed number data is entered to select player colours While (Color[1] = "") TextWindow.CursorTop = 8 TextWindow.WriteLine(" ") TextWindow.CursorTop = 8 TextWindow.Write("Player 1 Select Colour: ") Color[1] = Colors[TextWindow.ReadNumber()] EndWhile While (Color[2] = "" Or Color[1] = Color[2]) TextWindow.CursorTop = 9 TextWindow.WriteLine(" ") TextWindow.CursorTop = 9 TextWindow.Write("Player 2 Select Colour: ") Color[2] = Colors[TextWindow.ReadNumber()] EndWhile TextWindow.ForegroundColor = "White" TextWindow.WriteLine("") TextWindow.WriteLine("Screen reloution of 1280x800 is best.") TextWindow.WriteLine("") TextWindow.WriteLine("Use the mouse click to first direct the stone, then set the curl.") TextWindow.WriteLine("The stone will run roughly double the initial set direction.") TextWindow.WriteLine("Waggle the mouse just in front of the stone to sweep it further.") TextWindow.WriteLine("Sweeping to one side will also alter its path slightly.") TextWindow.WriteLine("") TextWindow.WriteLine("See the code to see what what else is happening - that's what its for.") TextWindow.WriteLine("") TextWindow.Write("Press ") TextWindow.ForegroundColor = "Red" TextWindow.Write("ENTER") TextWindow.ForegroundColor = "White" TextWindow.Write(" to play.") '=============================================================== 'Load the images (with the player colours) while waiting for an ENTER, then get rid of the TextWindow '=============================================================== 'dir = Program.Directory dir = "http://litdev.web.officelive.com/images/Thumbnails" For i = 1 To 2 stoneImage[i] = ImageList.LoadImage(dir+"\stone"+Color[i]+".png") brushImage[i] = ImageList.LoadImage(dir+"\brush"+Color[i]+".png") EndFor rad = ImageList.GetWidthOfImage(stoneImage[1])/2 brushW = ImageList.GetWidthOfImage(brushImage[1])/2 brushH = ImageList.GetHeightOfImage(brushImage[1])*7/8 TextWindow.Read() TextWindow.Hide() 'Download the sweeping sound - works OK just using it directly 'sweepSound = Network.DownloadFile("http://litdev.web.officelive.com/Documents/sweep.wma") ' The following line could be harmful and has been automatically commented. ' 'File.CopyFile(sweepSound,Program.Directory+"\sweep.wma") 'must be named wma, not tmp 'sweepSound = Program.Directory+"\sweep.wma" sweepSound = "http://litdev.web.officelive.com/Documents/sweep.wma" 'Can't fix the sound conflict issues (sometimes crashes game) so flag to turn off sound effects (0-Off : 1-On) USESOUND = 0 '=============================================================== 'Set the GraphicsWindow up, including the background colour 'bg' '=============================================================== gw = 1250 gh = 400 GraphicsWindow.CanResize = "False" GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Left = (Desktop.Width-gw)/2 GraphicsWindow.Top = (Desktop.Height-gh)/2 GraphicsWindow.Title = "Curling" bg = "#ddeeff" GraphicsWindow.BackgroundColor = bg Mouse.HideCursor() Mouse.MouseX = GraphicsWindow.Left+gw/2 Mouse.MouseY = GraphicsWindow.Top+gh/2 CL = 0.85*gw 'Centre line of scoring zone '=============================================================== 'Draw the rink with SHAPES - they always lie on top of the background pane used for play direction and curl arrows 'The Order of adding the shapes is important - they lay on top of each other - rink, then brushes, then stones '=============================================================== GraphicsWindow.PenColor = "Blue" GraphicsWindow.BrushColor = "Blue" size = 9 Shapes.Move(Shapes.AddEllipse(size*rad,size*rad),CL-size/2*rad,gh/2-size/2*rad) GraphicsWindow.PenColor = bg GraphicsWindow.BrushColor = bg size = 6.5 Shapes.Move(Shapes.AddEllipse(size*rad,size*rad),CL-size/2*rad,gh/2-size/2*rad) GraphicsWindow.PenColor = "Red" GraphicsWindow.BrushColor = "Red" size = 4 Shapes.Move(Shapes.AddEllipse(size*rad,size*rad),CL-size/2*rad,gh/2-size/2*rad) GraphicsWindow.PenColor = bg GraphicsWindow.BrushColor = bg size = 1.5 Shapes.Move(Shapes.AddEllipse(size*rad,size*rad),CL-size/2*rad,gh/2-size/2*rad) 'Some game play lines (hog line, centre lines) GraphicsWindow.PenColor = "DarkGray" GraphicsWindow.BrushColor = GraphicsWindow.PenColor Shapes.Move(Shapes.AddRectangle(2,gh),CL-1,0) Shapes.Move(Shapes.AddRectangle(gw,2),0,gh/2-1) GraphicsWindow.PenColor = "Black" GraphicsWindow.BrushColor = GraphicsWindow.PenColor Shapes.Move(Shapes.AddRectangle(4,gh),gw/2-2,0) 'Back foot stop Shapes.Move(Shapes.AddRectangle(8,15),0,gh/2-25) Shapes.Move(Shapes.AddRectangle(8,15),0,gh/2+10) Shapes.Move(Shapes.AddRectangle(4,50),0,gh/2-25) 'Speckles on the ice GraphicsWindow.PenColor = "#ddccccff" GraphicsWindow.BrushColor = GraphicsWindow.PenColor For i = 1 To 1000 Shapes.Move(Shapes.AddEllipse(2,2),Math.GetRandomNumber(gw)-1,Math.GetRandomNumber(gh)-1) EndFor 'Brushes For i = 1 To 2 brush[i] = Shapes.AddImage(brushImage[i]) Shapes.HideShape(brush[i]) EndFor '=============================================================== 'Start events and set some game parameters 'hammer is the order of play hammer[1] = 2 means player 2 goes first '=============================================================== GraphicsWindow.MouseMove = OnMouseMove GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseUp = OnMouseUp MouseMove = 0 mouseDown = 0 mouseUp = 0 pi = Math.Pi deg2rad = pi/180 friction = 0.05 ' Stone friction elastic = 0.8 'Elasticity of collisions dt = 0.1 'Speed of game play (time-step size) soundDelay = 500 'Delay (ms) between trying to play sounds - the shortest that works OK for PlayClick() nStone = 16 '=============================================================== 'Main game play - 10 ends '=============================================================== START: hammer[1] = 1 hammer[2] = 3-hammer[1] For game = 1 To 10 For i = 1 To 2 Score[game][i] = 0 EndFor EndFor For game = 1 To 10 DrawScore() 'Update the score graphic - this is on the background layer and can be messed by the game shot direction arrows stone = "" 'Reset the active stones For i = 1 To 4 'Player For k = 1 To 2 'Stone For j = 1 To 2 'Team 'iNext is the stone to add, depends on player order (hammer) iNext = 4*(i-1)+2*(k-1)+j 'Add the stone and move to the starting area Shapes.Remove(stones[iNext]) stones[iNext] = Shapes.AddImage(stoneImage[hammer[j]]) Shapes.Move(stones[iNext],(4-i)*2*rad,(j-1)*(gh-4*rad)+(k-1)*2*rad) EndFor EndFor EndFor 'Now the game starts For i = 1 To 4 'Player For k = 1 To 2 'Stone For j = 1 To 2 'Team 'Select the current player stone iNext = 4*(i-1)+2*(k-1)+j 'Throw the stone throwStones() 'Update the score graphics - again it can be messed by the shot direction arrows DrawScore() EndFor EndFor EndFor UpdateScore() Program.Delay(1000) EndFor '=============================================================== 'Game finished - Find and report eport the winner '=============================================================== 'Remove the stone shapes for tidyness or in case we want to restart For i = 1 To nStone Shapes.Remove(stones[i]) EndFor stones = "" For i = 1 To 2 Total[i] = 0 For j = 1 To 10 Total[i] = Total[i] + Score[j][i] EndFor EndFor GraphicsWindow.BrushColor = "DarkGray" GraphicsWindow.FontSize = 70 If (Total[1] > Total[2]) Then GraphicsWindow.DrawText(100,100,"Player 1 is the WINNER") ElseIf (Total[2] > Total[1]) Then GraphicsWindow.DrawText(100,100,"Player 2 is the WINNER") Else GraphicsWindow.DrawText(100,100,"The game is a DRAW") EndIf 'Finish here - we could ask the user to restart and then GoTo START Program.Delay(5000) Program.End() '=============================================================== 'SUBROUTINES FOR GAME '=============================================================== '=============================================================== 'Calculate the Score - nearest sones within the scoring zone '=============================================================== Sub UpdateScore For iStone = 1 To nStone dist[iStone] = Math.SquareRoot((stoneX[iStone]-CL)*(stoneX[iStone]-CL) + (stoneY[iStone]-gh/2)*(stoneY[iStone]-gh/2)) rank[iStone] = 0 If (dist[iStone] < 5.5*rad) Then If (iStone/2 = Math.Floor(iStone/2)) Then rank[iStone] = 2 Else rank[iStone] = 1 EndIf EndIf EndFor For iStone = 1 To nStone-1 For jStone = iStone To nStone If (dist[jStone] < dist[iStone]) Then temp = dist[iStone] dist[iStone] = dist[jStone] dist[jStone] = temp temp = rank[iStone] rank[iStone] = rank[jStone] rank[jStone] = temp EndIf EndFor EndFor winner = rank[1] If (winner > 0) Then i = 1 While (rank[i] = winner) Score[game][hammer[winner]] = Score[game][hammer[winner]] + 1 i = i+1 EndWhile 'Next end the winner goes first - advantage to go last (have the hammer) hammer[1] = hammer[winner] hammer[2] = 3-hammer[1] EndIf DrawScore() EndSub '=============================================================== 'Draw the score graphics as required '=============================================================== Sub DrawScore GraphicsWindow.PenColor = bg GraphicsWindow.BrushColor = bg GraphicsWindow.FillRectangle(250,0,300,60) GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.FillRectangle(320,20,200,40) GraphicsWindow.BrushColor = "LightGray" GraphicsWindow.FillRectangle(320+20*(game-1),2,20,16) GraphicsWindow.BrushColor = Color[1] GraphicsWindow.DrawText(250,20,"Player 1") GraphicsWindow.BrushColor = Color[2] GraphicsWindow.DrawText(250,40,"Player 2") GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(250,0,"End") For iX = 1 To 10 'i and j variables used in main loop GraphicsWindow.DrawText(320+20*(iX-1),0,iX) For jX = 1 To 2 GraphicsWindow.DrawText(320+20*(iX-1),20*jX,Score[iX][jX]) EndFor EndFor EndSub '=============================================================== 'Throw the stones - the PHYSICS part '=============================================================== Sub throwStones 'Set the next active (stone) from the list of availables stones (stones) stone[iNext] = stones[iNext] If (iNext/2 = Math.Floor(iNext/2)) Then iPlayer = hammer[2] Else iPlayer = hammer[1] EndIf 'Do the initial direction, velocity and curl startStone() 'Run while stones are active (moving) active = 1 mouseMove = 0 While (active = 1) 'Add the player brush image (note it is centred on the middle of the brush, not the middle of the image) Shapes.ShowShape(brush[iPlayer]) xM = GraphicsWindow.MouseX yM = GraphicsWindow.MouseY Shapes.Move(brush[iPlayer],xM-brushW,yM-brushH) 'Process each active stone (each stone in the playiong area) active = 0 For iStone = 1 To Array.GetItemCount(stone) If (stoneX[iStone] > 0) Then ' Only consider moving stones for the position update 'iPlayerStone is the the player corresponding to the current stone - we can't sweep opponent stone untill it is past the score zone centre If (iStone/2 = Math.Floor(iStone/2)) Then iPlayerStone = hammer[2] Else iPlayerStone = hammer[1] EndIf 'Get the current stone path angle If (stoneU[iStone] = 0) Then ang = pi/2 Else ang = Math.ArcTan(stoneV[iStone]/stoneU[iStone]) EndIf If (stoneU[iStone] < 0) Then ang = ang+pi EndIf 'Check if the stone is being swept 'Are we just in front of the stone, is it our stone or are we past the score zone centre 'Is the stone moving and is the mouse moving (sweeping) 'We check 2 overlapping circles the size of the stone infront of its path direction sweep = 0 If ((iPlayerStone = iPlayer Or stoneX[iStone] > CL) And Math.Abs(stoneU[iStone]) > 0 And mouseMove = 1) Then centreX = stoneX[iStone]+2*rad*Math.Cos(ang) centreY = stoneY[iStone]+2*rad*Math.Sin(ang) dist = Math.SquareRoot((centreX-xM)*(centreX-xM)+(centreY-yM)*(centreY-yM)) If (dist < rad) Then sweep = 1 EndIf centreX = stoneX[iStone]+3*rad*Math.Cos(ang) centreY = stoneY[iStone]+3*rad*Math.Sin(ang) dist = Math.SquareRoot((centreX-xM)*(centreX-xM)+(centreY-yM)*(centreY-yM)) If (dist < rad) Then sweep = 1 EndIf mouseMove = 0 EndIf 'Give a swept stone an opacity change to see it is being swept If (sweep = 1) Then Shapes.SetOpacity(stone[iStone],50) 'Add your own sweeping sound here - otherwise uses a downloaded file If (USESOUND = 1) Then ms = Clock.ElapsedMilliseconds If (ms-lastSound > soundDelay) Then lastSound = ms Sound.Stop(sweepSound) Sound.Play(sweepSound) EndIf EndIf Else Shapes.SetOpacity(stone[iStone],100) EndIf 'Update the velocity and rotation speed for friction, accounting for reduced friction with sweep stoneU[iStone] = (1-friction*(1-0.2*sweep)*dt)*stoneU[iStone] stoneV[iStone] = (1-friction*(1-0.2*sweep)*dt)*stoneV[iStone] stoneRotate[iStone] = (1-0.5*friction*(1-0.2*sweep)*dt)*stoneRotate[iStone] 'Average velocity and the velocity of the left and right edges affected by the curl 'The curl is generated by differenbt velocities and hence friction on the spinning stone vel = Math.SquareRoot(stoneU[iStone]*stoneU[iStone]+stoneV[iStone]*stoneV[iStone]) dvel = stoneRotate[iStone]*deg2rad*rad vel1 = vel+dvel vel2 = vel-dvel 'This is a fudge to estimate a deviation based on the velocities of the stone wrt to the ice on either side of the spinning stone deviation = 0.0002*(vel1-vel2) 'stoneRotate > 0 (clockwise) increases stoneV (down) and deviation > 0 => vel1>vel2, hence bush below (yM>stoneY) swings stone up (reduces deviation) 'Sweep also affects the deviation - the trig (tan) is just accounting for the fact that the stone may not be moving just in the X direction If (sweep = 1) Then If (yM > stoneY[iStone]+(xM-stoneX[iStone])*Math.Tan(ang)) Then deviation = deviation-0.001*Math.Abs(dvel) Else deviation = deviation+0.001*Math.Abs(dvel) EndIf EndIf 'Update velocity - deviate from current path due to curl stoneU[iStone] = stoneU[iStone]-Math.Sin(ang)*deviation stoneV[iStone] = stoneV[iStone]+Math.Cos(ang)*deviation 'Update position and rotation stoneAngle[iStone] = stoneAngle[iStone]+stoneRotate[iStone]*dt stoneX[iStone] = stoneX[iStone]+stoneU[iStone]*dt stoneY[iStone] = stoneY[iStone]+stoneV[iStone]*dt 'Do any collisions Collision() 'Check for stopped stones If (vel > 1) Then active = 1 Else stoneU[iStone] = 0 stoneV[iStone] = 0 stoneRotate[iStone] = 0 'A stone that doesn't reach the half way point is dead If (stoneX[iStone] < gw/2) Then stoneX[iStone] = -1000 stoneY[iStone] = -1000 playClick() EndIf EndIf 'Remove and dead stones that hit the end or top /botton edges If (stoneX[iStone] > gw-rad Or stoneY[iStone] < rad Or stoneY[iStone] > gh-rad) Then stoneX[iStone] = -1000 stoneY[iStone] = -1000 stoneU[iStone] = 0 stoneV[iStone] = 0 playClick() EndIf 'Finally rotate and move the stone image shape Shapes.Rotate(stone[iStone],stoneAngle[iStone]) Shapes.Move(stone[iStone],stoneX[iStone]-rad,stoneY[iStone]-rad) EndIf EndFor Program.Delay(10) EndWhile 'Ensure all stones at the end of the delivery are fully opaque and hide the brush ans stop any remaining sweeping sound For iStone = 1 To Array.GetItemCount(stone) Shapes.SetOpacity(stone[iStone],100) EndFor Shapes.HideShape(brush[iPlayer]) Sound.Stop(sweepSound) EndSub '=============================================================== 'Check for collisions of active stones in the play area '=============================================================== Sub Collision 'Consider the current stone and all other stones in play (array stone) For jStone = 1 To Array.GetItemCount(stone) If (iStone <> jStone) Then dx = stoneX[jStone]-stoneX[iStone] dy = stoneY[jStone]-stoneY[iStone] dist = Math.SquareRoot(dx*dx+dy*dy) If (dist < 1.9*rad) Then 'Images are slightly bigger than stone diameter 'Calculate average velocity vector U = (stoneU[iStone]+stoneU[jStone])/2 V = (stoneV[iStone]+stoneV[jStone])/2 'This is the centre of momentun velocities - the collisions are easiest in this reference frame 'This is because each stone then effectively just rebounds as if it hit a wall 'Just like two balls with equal speed hitting head on - the centre of momentum there is stationary stoneU[iStone] = stoneU[iStone]-U stoneV[iStone] = stoneV[iStone]-V stoneU[jStone] = stoneU[jStone]-U stoneV[jStone] = stoneV[jStone]-V 'This is the normal unit vector from the centre of stone iStone to the centre of jStone normX = dx/dist normY = dy/dist 'This is not obvious, but I think it is the easiest way to calculate the collision reasonably without lots of trig and angles 'Basically it just uses vectors - hard to explain without a drawing, but with a drawing it should make sense 'u is the incident stone vector 'u* is its reflection direction vector 'n is the unit vector from stone i to stone j 'u.n is a dot product (the distance of u in the direction n) 'u -u* = 2u.n n dotProduct = normX*stoneU[iStone] + normY*stoneV[iStone] If (dotProduct > 0) Then ' Only collide stones that are impacting - but not if it is inside the collision radius and moving away (could happen with long time-steps) stoneU[iStone] = stoneU[iStone] - 2*normX*dotProduct stoneV[iStone] = stoneV[iStone] - 2*normY*dotProduct EndIf 'u*-u = -2u.n n dotProduct = normX*stoneU[jStone] + normY*stoneV[jStone] If (dotProduct < 0) Then stoneU[jStone] = stoneU[jStone] - 2*normX*dotProduct stoneV[jStone] = stoneV[jStone] - 2*normY*dotProduct EndIf 'Convert back from centre of momentun frame to true frame, with a little energy loss (elastic < 1) - this runs a stone on a little after it hits a target stone stoneU[iStone] = elastic*stoneU[iStone]+U stoneV[iStone] = elastic*stoneV[iStone]+V stoneU[jStone] = elastic*stoneU[jStone]+U stoneV[jStone] = elastic*stoneV[jStone]+V 'Play an impact sound playClick() EndIf EndIf EndFor EndSub '=============================================================== 'Initialise a stone throw - all the arrow starting for direction, power and curl '=============================================================== Sub startStone 'The starting point - rotation is just to align the handle in the X direction stoneX[iNext] = 50 stoneY[iNext] = gh/2 stoneAngle[iNext] = -68 Shapes.Rotate(stone[iNext],stoneAngle[iNext]) Shapes.Move(stone[iNext],stoneX[iNext]-rad,stoneY[iNext]-rad) 'Draw the arrow for speed and direction - most of the effor here is the overdraw to prevent shaddow images remaining as we move the arrow with the mouse mouseUp = 0 While (mouseUp = 0) If (mouseMove = 1) Then GraphicsWindow.PenColor = bg GraphicsWindow.PenWidth = 4 GraphicsWindow.DrawLine(stoneX[iNext],stoneY[iNext],xM,yM) GraphicsWindow.BrushColor = bg GraphicsWindow.FillEllipse(xM-2,yM-2,4,4) xM = GraphicsWindow.MouseX yM = GraphicsWindow.MouseY GraphicsWindow.PenColor = Color[iPlayer] GraphicsWindow.PenWidth = 2 GraphicsWindow.DrawLine(stoneX[iNext],stoneY[iNext],xM,yM) mouseMove = 0 EndIf EndWhile GraphicsWindow.PenColor = bg GraphicsWindow.PenWidth = 4 GraphicsWindow.DrawLine(stoneX[iNext],stoneY[iNext],xM,yM) GraphicsWindow.BrushColor = bg GraphicsWindow.FillEllipse(xM-2,yM-2,4,4) 'Set intial velocity vector - we could add some randomness here stoneU[iNext] = (xM-stoneX[iNext])/10 stoneV[iNext] = (yM-stoneY[iNext])/10 'Draw the arrow for curl xStart = xM mouseUp = 0 While (mouseUp = 0) If (mouseMove = 1) Then GraphicsWindow.PenColor = bg GraphicsWindow.PenWidth = 4 GraphicsWindow.DrawLine(xStart,stoneY[iNext],xStart,yM) GraphicsWindow.BrushColor = bg GraphicsWindow.FillEllipse(xStart-2,yM-2,4,4) xM = GraphicsWindow.MouseX yM = GraphicsWindow.MouseY GraphicsWindow.PenColor = Color[iPlayer] GraphicsWindow.PenWidth = 2 GraphicsWindow.DrawLine(xStart,stoneY[iNext],xStart,yM) mouseMove = 0 EndIf EndWhile GraphicsWindow.PenColor = bg GraphicsWindow.PenWidth = 4 GraphicsWindow.DrawLine(xStart,stoneY[iNext],xStart,yM) GraphicsWindow.BrushColor = bg GraphicsWindow.FillEllipse(xStart-2,yM-2,4,4) 'Set intial curl rotation - again some randomness is possible, but I thought the game was best without stoneRotate[iNext] = (yM-gh/2)/2 EndSub '=============================================================== 'Play a click - try to prevent sound clashing - the time check is to make sure it is finished the last before starting the next sound '=============================================================== Sub playClick If (USESOUND = 1) Then ms = Clock.ElapsedMilliseconds If (ms-lastSound > soundDelay) Then lastSound = ms Sound.Stop(sweepSound) Sound.PlayClick() EndIf EndIf EndSub '=============================================================== 'The events - just set flags as required '=============================================================== Sub OnMouseMove mouseMove = 1 'TextWindow.WriteLine(Clock.ElapsedMilliseconds) 'Interesting effect - this event is triggered when a shape moves over the mouse - could be useful (not here though) EndSub Sub OnMouseDown mouseDown = 1 mouseUp = 0 EndSub Sub OnMouseUp mouseDown = 0 mouseUp = 1 EndSub End>LLR789.sb< Start>LLS938.sb< Start: GraphicsWindow.Title = "Caltionary" GraphicsWindow.CanResize = "false" GraphicsWindow.BrushColor = "red" GraphicsWindow.Show() GraphicsWindow.Width = "1000" GraphicsWindow.Height = "100" GraphicsWindow.BrushColor = "orange" DictionaryButton = Controls.AddButton("Dictionary",50,10) GraphicsWindow.BrushColor = "blue" CalculatorButton = Controls.AddButton("Calculator",150,10) GraphicsWindow.BrushColor = "Green" Notepadbutton = Controls.AddButton("Notepad", 250,10) GraphicsWindow.BrushColor = "Purple" MeasConverterButton = Controls.AddButton("Metric Converter",340,10) GraphicsWindow.BrushColor = "Black" RandomNumButton = Controls.AddButton("Random Number Generator",480,10) GraphicsWindow.BrushColor = "Yellow" GuessGameButton = Controls.AddButton("Guessing Game",680,10) GraphicsWindow.BrushColor = "Megenta" VowelCounter = Controls.AddButton("Password Generator", 800, 10) GraphicsWindow.BrushColor = "red" EndProgramButton = Controls.AddButton("Exit",380,50) i = Controls.LastClickedButton Controls.ButtonClicked = OnButtonClicked GraphicsWindow.KeyDown = OnKeyDown Sub OnButtonClicked IF Controls.LastClickedButton = Getdef Then RealDefword = Controls.GetTextBoxText(Defword) RealDefwordDef = Dictionary.GetDefinition(RealDefword) Controls.SetTextBoxText(Definition,RealDefwordDef) Endif If Controls.LastClickedButton = DictionaryButton Then GraphicsWindow.Clear() GraphicsWindow.BrushColor = "red" EndProgramButton = Controls.AddButton("Exit",1010,10) GraphicsWindow.BrushColor = "orange" options = Controls.AddButton("Options",500,10) GraphicsWindow.Width = 1100 GraphicsWindow.Height = 700 Getdef = Controls.AddButton("Find Definition",270,100) Defword = Controls.AddTextBox(100,100) Definition = Controls.AddMultiLineTextBox(100,200) Controls.SetSize(Definition,900,400) EndIf If Controls.LastClickedButton = options Then GraphicsWindow.Clear() options = Controls.AddButton("Options",700,10) GraphicsWindow.BrushColor = "red" GraphicsWindow.Show() GraphicsWindow.Width = "850" GraphicsWindow.Height = "100" GraphicsWindow.BrushColor = "orange" DictionaryButton = Controls.AddButton("Dictionary",50,10) GraphicsWindow.BrushColor = "Blue" CalculatorButton = Controls.AddButton("Calculator",150,10) GraphicsWindow.BrushColor = "Green" Notepadbutton = Controls.AddButton("Notepad", 250,10) GraphicsWindow.BrushColor = "Purple" MeasConverterButton = Controls.AddButton("Metric Converter",340,10) GraphicsWindow.BrushColor = "Black" RandomNumButton = Controls.AddButton("Random Number Generator",480,10) GraphicsWindow.BrushColor = "Yellow" GuessGameButton = Controls.AddButton("Guessing Game",680,10) GraphicsWindow.BrushColor = "Red" EndProgramButton = Controls.AddButton("Exit",380,50) EndIf If Controls.LastClickedButton = CalculatorButton Then GraphicsWindow.Height = "700" GraphicsWindow.Width = "1100" GraphicsWindow.BrushColor = "Blue" GraphicsWindow.Clear() GraphicsWindow.BrushColor = "Red EndProgramButton = Controls.AddButton("Exit",1010,10) GraphicsWindow.BrushColor = "Blue" options = Controls.AddButton("Options",500,10) GraphicsWindow.DrawBoundText(10,100,100,"First Number: ") GraphicsWindow.DrawBoundText(10,150,200,"Operation: ") GraphicsWindow.DrawBoundText(10,200,100,"Second Number: ") GraphicsWindow.DrawBoundText(10,300,100,"Answer: ") Num1Box = Controls.AddTextBox(200,95) OppBox = Controls.AddTextBox(200,145) Num2Box = Controls.AddTextBox(200,195) CalAnswerBox = Controls.AddTextBox(200,295) GetCalAnswer = Controls.AddButton("Enter",250,250) Round = Controls.AddButton("Round", 300, 350) CalClear = Controls.AddButton("Clear",250,350) CalAdd = Controls.AddButton("+",180,145) CalSub = Controls.AddButton("-",230,145) CalMul = Controls.AddButton("*",280,145) CalDiv = Controls.AddButton("/",330,145) Controls.SetSize(CalAdd,50,25) Controls.SetSize(CalSub,50,25) Controls.SetSize(CalMul,50,25) Controls.SetSize(CalDiv,50,25) EndIf If Controls.LastClickedButton = Round Then CalRound = Math.Round(Controls.GetTextBoxText(CalAnswerBox)) Controls.SetTextBoxText(CalAnswerBox, CalRound) EndIf If Controls.LastClickedButton = CalAdd Then Opp = "+" Controls.SetTextBoxText(OppBox,"+") EndIf If Controls.LastClickedButton = CalSub Then Opp = "-" Controls.SetTextBoxText(OppBox,"-") EndIf If Controls.LastClickedButton = CalMul Then Opp = "*" Controls.SetTextBoxText(OppBox,"*") EndIf If Controls.LastClickedButton = CalDiv Then Opp = "/" Controls.SetTextBoxText(OppBox,"/") EndIf If Controls.LastClickedButton = GetCalAnswer Then Num1 = Controls.GetTextBoxText(Num1Box) Num2 = Controls.GetTextBoxText(Num2Box) Opp = Controls.GetTextBoxText(OppBox) If Opp = "+" Then Num3 = Num1 + Num2 Controls.SetTextBoxText(CalAnswerBox,Num3) EndIf If Opp = "-" Then Num3 = Num1 - Num2 Controls.SetTextBoxText(CalAnswerBox,Num3) EndIf If Opp = "*" Then Num3 = Num1 * Num2 Controls.SetTextBoxText(CalAnswerBox,Num3) EndIf If Opp = "/" Then Num3 = Num1 / Num2 Controls.SetTextBoxText(CalAnswerBox,Num3) EndIf EndIf If Controls.LastClickedButton = CalClear Then Controls.SetTextBoxText(Num1Box,"") Controls.SetTextBoxText(Num2Box,"") Controls.SetTextBoxText(CalAnswerBox,"") Controls.SetTextBoxText(OppBox,"") EndIf If Controls.LastClickedButton = Notepadbutton Then GraphicsWindow.Clear() GraphicsWindow.BrushColor = "Red EndProgramButton = Controls.AddButton("Exit",1010,10) GraphicsWindow.BrushColor = "green" GraphicsWindow.Width = "1100" GraphicsWindow.Height = "700" options = Controls.AddButton("Options",500,10) GraphicsWindow.DrawBoundText(50,50,100,"Title:") GraphicsWindow.DrawBoundText(50,100,100,"Date:") GraphicsWindow.DrawBoundText(50,150,100,"Notes:") NoteTitle = Controls.AddTextBox(100, 50) NoteDate = Controls.AddTextBox(100, 100) NoteNotes = Controls.AddMultiLineTextBox(100, 150) Controls.SetTextBoxText(NoteNotes," ") Controls.SetSize(NoteNotes, 400, 300) NoteSave = Controls.AddButton("Save",200,500) Controls.SetSize(NoteSave,200,50) NoteClear = Controls.AddButton("Clear",200,600) Controls.SetSize(NoteClear,200,50) Controls.SetTextBoxText(NoteTitle,SaveNoteTitle) Controls.SetTextBoxText(NoteDate,SaveNoteDate) Controls.SetTextBoxText(NoteNotes,SaveNoteNotes) EndIf If Controls.LastClickedButton = NoteClear Then Controls.SetTextBoxText(NoteTitle,"") Controls.SetTextBoxText(NoteDate,"") Controls.SetTextBoxText(NoteNotes,"") SaveNoteTitle = Controls.GetTextBoxText(NoteTitle) SaveNoteDate = Controls.GetTextBoxText(NoteDate) SaveNoteNotes = Controls.GetTextBoxText(NoteNotes) EndIf If Controls.LastClickedButton = NoteSave Then SaveNoteTitle = Controls.GetTextBoxText(NoteTitle) SaveNoteDate = Controls.GetTextBoxText(NoteDate) SaveNoteNotes = Controls.GetTextBoxText(NoteNotes) EndIf If Controls.LastClickedButton = MeasConverterButton Then GraphicsWindow.Width = "1100" GraphicsWindow.Height = "700" GraphicsWindow.Clear() GraphicsWindow.BrushColor = "Red EndProgramButton = Controls.AddButton("Exit",1010,10) GraphicsWindow.BrushColor = "Purple" options = Controls.AddButton("Options",500,10) GraphicsWindow.DrawBoundText(200,180,100,"Centimeters:") MeasCMBox = Controls.AddTextBox(200,200) GraphicsWindow.DrawBoundText(500,180,100,"Inches:") MeasInchBox = Controls.AddTextBox(500,200) CMToInch = Controls.AddButton("Centimeters To Inches ->",330,100) InchToCM = Controls.AddButton("<- Inches To Centimeters",330,300) MeasClear = Controls.AddButton("Clear",400,200) RoundInch = Controls.AddButton("Round Inches", 500, 250) RoundCM = Controls.AddButton("Round Centimeters", 200, 250) EndIf If Controls.LastClickedButton = RoundInch Then Rounded = Math.Round(Controls.GetTextBoxText(MeasInchBox)) Controls.SetTextBoxText(MeasInchBox, Rounded) EndIf If Controls.LastClickedButton = RoundCm Then RoundedCM = Math.Round(Controls.GetTextBoxText(MeasCMBox)) Controls.SetTextBoxText(MeasCMBox, RoundedCM) EndIf If Controls.LastClickedButton = MeasClear Then Controls.SetTextBoxText(MeasCMBox,"") Controls.SetTextBoxText(MeasInchBox,"") EndIf If Controls.LastClickedButton = CMToInch Then CMNumber = Controls.GetTextBoxText(MeasCMBox) NewInch = CMNumber / 2.54 Controls.SetTextBoxText(MeasInchBox,NewInch) EndIf If Controls.LastClickedButton = InchToCM Then InchNumber = Controls.GetTextBoxText(MeasInchBox) NewCM = InchNumber * 2.54 Controls.SetTextBoxText(MeasCMBox,NewCM) EndIf If Controls.LastClickedButton = RandomNumButton Then GraphicsWindow.Width = "1100" GraphicsWindow.Height = "700" GraphicsWindow.Clear() GraphicsWindow.BrushColor = "Red" EndProgramButton = Controls.AddButton("Exit",1010,10) GraphicsWindow.BrushColor = "Black" options = Controls.AddButton("Options",500,10) GraphicsWindow.DrawBoundText(310,150,100,"Max Number:") MaxNumBox = Controls.AddTextBox(425,150) GraphicsWindow.DrawBoundText(310,200,100,"Min Number:") MinNumBox = Controls.AddTextBox(425,200) Controls.SetTextBoxText(MinNumBox,"0") GetRandomNum =Controls.AddButton("Get Random Number",435,250) GraphicsWindow.DrawBoundText(310,300,200,"Random Number:") RandomNumBox = Controls.AddTextBox(425,300) EndIf If Controls.LastClickedButton = GetRandomNum Then RandomNumStart: MaxNum = Controls.GetTextBoxText(MaxNumBox) MinNum = Controls.GetTextBoxText(MinNumBox) RandomNum = Math.GetRandomNumber(MaxNum) If RandomNum >= MinNum Then Controls.SetTextBoxText(RandomNumBox,RandomNum) Else Goto RandomNumStart EndIf EndIf If Controls.LastClickedButton = EndProgramButton Then Program.End() EndIf If Controls.LastClickedButton = GuessGameButton Then TextWindow.ForegroundColor = "yellow" TextWindow.Title = "Guess The Number" TextWindow.Write("Welcome, ") GuessGameStart: 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 GuessGameStart EndIf If Replaygame1 = "No" Or Replaygame1 = "no" Or Replaygame1 = "N" Or Replaygame1 = "n" Then TextWindow.Write("Thanks for playing!") TextWindow.Clear() TextWindow.Hide() 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 GuessGameStart EndIf If Replaygame = "No" Or Replaygame = "no" Or Replaygame = "N" Or Replaygame = "n" Then TextWindow.Write("Thanks for playing!") Program.Delay(2000) TextWindow.Clear() TextWindow.Hide() EndIf EndIf EndSub Sub OnKeyDown If GraphicsWindow.LastKey = "Return" Then i = Controls.GetTextBoxText(Defword) x = Dictionary.GetDefinition(i) Controls.SetTextBoxText(Definition,x) EndIf If GraphicsWindow.LastKey = "C" Then TextWindow.Clear() TextWindow.Hide() EndIf EndSub 'Controls.ButtonClicked = OnButtonClick Sub OnButtonClick If Controls.LastClickedButton = VowelCounter Then DW = Desktop.Width DH = Desktop.Height GraphicsWindow.Height = DH GraphicsWindow.Width = DW GraphicsWindow.BrushColor = "Green" GraphicsWindow.Clear() GraphicsWindow.FontSize = 75 GraphicsWindow.DrawText(200, 200, "Password Generated!") GraphicsWindow.FontSize = 13 Passcodebox = Controls.AddMultiLineTextBox(50, 50) Password = Security.GenerateEasyPassword(10) Controls.SetTextBoxText(Passcodebox, Password) EndIf EndSub End>LLS938.sb< Start>LLT850-0.sb< ' Sine Curves ' Version 0.2 ' Program ID LLT850-0 DrawGrid() a = 2 For k = 1 To 7 GraphicsWindow.Title = "k=" + k DrawSineCurve() Program.Delay(1000) EndFor Sub DrawGrid _gw = GraphicsWindow.Width _gh = GraphicsWindow.Height _ox = _gw / 2 _oy = _gh / 2 scale = 30 GraphicsWindow.PenColor = "Cyan" _x = 0 _y = _gh MappingToLogical() xmin = x ymin = y _x = _gw _y = 0 MappingToLogical() xmax = x ymax = y For x = Math.Ceiling(xmin) To Math.Floor(xmax) MappingToDevice() GraphicsWindow.DrawLine(_x, 0, _x, _gh) EndFor For y = Math.Ceiling(ymin) To Math.Floor(ymax) MappingToDevice() GraphicsWindow.DrawLine(0, _y, _gw, _y) EndFor EndSub Sub DrawSineCurve GraphicsWindow.PenColor = "Black" For x = xmin To xmax Step 0.1 x2 = x y2 = a * Math.Sin(k * x) If xmin < x Then Stack.PushValue("local", x) Stack.PushValue("local", y) x = x1 y = y1 MappingToDevice() _x1 = _x _y1 = _y x = x2 y = y2 MappingToDevice() _x2 = _x _y2 = _y GraphicsWindow.DrawLine(_x1, _y1, _x2, _y2) y = Stack.PopValue("local") x = Stack.PopValue("local") EndIf x1 = x2 y1 = y2 EndFor EndSub Sub MappingToDevice _x = _ox + scale * x _y = _oy - scale * y EndSub Sub MappingToLogical x = (_x - _ox) / scale y = -(_y - _oy) / scale EndSub End>LLT850-0.sb< Start>LLT850-1.sb< GraphicsWindow.BackgroundColor ="teal DrawGrid() a = 3 For k = 1 To 7 GraphicsWindow.Title = "k=" + k DrawSineCurve() Program.Delay(1000) EndFor Sub DrawGrid _gw = GraphicsWindow.Width _gh = GraphicsWindow.Height _ox = _gw / 2 _oy = _gh / 2 scale = 30 GraphicsWindow.PenColor = "#008888 _x = 0 _y = _gh MappingToLogical() xmin = x ymin = y _x = _gw _y = 0 MappingToLogical() xmax = x ymax = y For x = Math.Ceiling(xmin) To Math.Floor(xmax) MappingToDevice() GraphicsWindow.DrawLine(_x, 0, _x, _gh) EndFor For y = Math.Ceiling(ymin) To Math.Floor(ymax) MappingToDevice() GraphicsWindow.DrawLine(0, _y, _gw, _y) EndFor EndSub Sub DrawSineCurve GraphicsWindow.PenColor = LDColours.HSLtoRGB ((k-1)*45 1 0.8-k/20) For x = xmin To xmax Step 0.1 x2 = x y2 = (a-k/3) * Math.Sin(k * x) If xmin < x Then Stack.PushValue("local", x) Stack.PushValue("local", y) x = x1 y = y1 MappingToDevice() _x1 = _x _y1 = _y x = x2 y = y2 MappingToDevice() _x2 = _x _y2 = _y GraphicsWindow.DrawLine(_x1, _y1, _x2, _y2) y = Stack.PopValue("local") x = Stack.PopValue("local") EndIf x1 = x2 y1 = y2 EndFor EndSub Sub MappingToDevice _x = _ox + scale * x _y = _oy - scale * y EndSub Sub MappingToLogical x = (_x - _ox) / scale y = -(_y - _oy) / scale EndSub End>LLT850-1.sb< Start>LLV333.sb< 'PacMan blinkySpeed = 30 inkySpeed = 20 clydeSpeed = 40 move = "false" GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp 'PowerPellets For i = 1 to 4 GraphicsWindow.BrushColor = "Red" PowerPellet[i] = Shapes.AddEllipse(20,20) endfor '----Top Left shapes.Move(PowerPellet[1],55,80) '----Top Right shapes.Move(PowerPellet[2],525,80) '----Bottom Left shapes.Move(PowerPellet[3],55,500) '----Bottom Right shapes.Move(PowerPellet[4],525,500) 'PACMAN pacmanX = 280 pacmanY = 100 pacman = Shapes.AddImage("H:/pacman(final).jpg") Shapes.Move(pacman,pacmanX,pacmanY) 'BORDER GraphicsWindow.Top = 30 GraphicsWindow.Left = 200 GraphicsWindow.Width = 600 GraphicsWindow.Height = 600 Score = 0 GraphicsWindow.FontSize = 24 GraphicsWindow.BrushColor = "Orange" myScore = Shapes.AddText(Score) GraphicsWindow.BackgroundColor = "black" GraphicsWindow.PenColor = "red" 'Right GraphicsWindow.BrushColor = "blue" GraphicsWindow.FillRectangle(30,50,20,250) GraphicsWindow.DrawRectangle(30,50,20,250) GraphicsWindow.FillRectangle(30,350,20,200) GraphicsWindow.DrawRectangle(30,350,20,200) 'Left GraphicsWindow.FillRectangle(550,50,20,250) GraphicsWindow.DrawRectangle(550,50,20,250) GraphicsWindow.FillRectangle(550,350,20,200) GraphicsWindow.DrawRectangle(550,350,20,200) 'Top GraphicsWindow.FillRectangle(30,50,250,20) GraphicsWindow.DrawRectangle(30,50,250,20) GraphicsWindow.FillRectangle(330,50,240,20) GraphicsWindow.DrawRectangle(330,50,240,20) 'Bottom GraphicsWindow.FillRectangle(30,530,250,20) GraphicsWindow.DrawRectangle(30,530,250,20) GraphicsWindow.FillRectangle(330,530,240,20) GraphicsWindow.DrawRectangle(330,530,240,20) 'Fill Border GraphicsWindow.PenColor = "blue" GraphicsWindow.DrawLine(31,70,49,70) GraphicsWindow.DrawLine(551,70,569,70) GraphicsWindow.DrawLine(31,530,49,530) GraphicsWindow.DrawLine(551,530,569,530) 'INNER WALLS GraphicsWindow.PenColor = "lime" 'Top Left GraphicsWindow.DrawRectangle(85,105,100,100) 'Top Right GraphicsWindow.DrawRectangle(415,105,100,100) 'Bottom Left GraphicsWindow.DrawRectangle(85,395,100,100) 'Bottom Right GraphicsWindow.DrawRectangle(415,395,100,100) 'Middle GraphicsWindow.DrawRectangle(185,250,230,100) Pellets() Timer.Interval = 30 Timer.Tick = TimeTick Sub TimeTick If pacmanUp = "true" then pacmanY = pacmanY - 3 Shapes.Rotate(pacman,-90) 'Outer Walls - Top Side if pacmanUp = "true" and (pacmanx < 281) And (pacmanx+25 > 31) And (pacmanY < 71) and (pacmanY+25 > 49) then pacmanY = pacmanY + 3 ElseIf pacmanUp = "true" and (pacmanx < 570) and (pacmanx+25 > 330) and (pacmanY < 71) and (pacmanY+25 > 49) then pacmanY = pacmanY + 3 'Inner Walls ElseIf (pacmanx < 186) and (pacmanX + 25 > 84) And (pacmanY < 206) And (pacmanY + 25 > 104) Then pacmanY = pacmanY + 3 ElseIf (pacmanx < 516) and (pacmanx+25 > 414) and (pacmanY < 206) and (pacmanY + 25 > 104) then pacmanY = pacmanY + 3 ElseIf (pacmanx < 186) and (pacmanx + 25 > 84) and (pacmanY < 496) and (pacmanY+25 > 394) then pacmanY = pacmanY + 3 ElseIf (pacmanx < 516) and (pacmanx + 25 > 414) and (pacmanY < 496) and (pacmanY + 25 > 394) then pacmanY = pacmanY + 3 ElseIf (pacmanx < 416) and (pacmanx + 25 > 184) and (pacmanY < 351) and (pacmanY + 25 > 249) then pacmanY = pacmanY + 3 EndIf 'Top Teleporter If pacmanY+25 < 0 Then pacmanx = 290 pacmanY = 600 EndIf EndIf If pacmanDown = "true" Then pacmanY = pacmanY + 3 Shapes.Rotate(pacman,90) 'Outer Walls - Bottom Side If pacmanDown = "true" And (pacmanx < 281) and (pacmanx + 25 > 31) and (pacmanY < 550) and (pacmanY+25 > 529) then pacmanY = pacmanY - 3 ElseIf pacmanDown = "true" and (pacmanx < 570) and (pacmanx+25 > 330) and (pacmanY < 550) and (pacmanY+25 > 529) then pacmanY = pacmanY - 3 'Inner Walls ElseIf (pacmanx < 186) and (pacmanX+25 > 84) And (pacmanY < 206) And (pacmanY + 25 > 104) Then pacmanY = pacmanY - 3 ElseIf (pacmanx < 516) and (pacmanx+25 > 414) and (pacmanY < 206) and (pacmanY + 25 > 104) then pacmanY = pacmanY - 3 ElseIf (pacmanx < 186) and (pacmanx + 25 > 84) and (pacmanY < 496) and (pacmanY+25 > 394) then pacmanY = pacmanY - 3 ElseIf (pacmanx < 516) and (pacmanx + 25 > 414) and (pacmanY < 496) and (pacmanY + 25 > 394) then pacmanY = pacmanY - 3 ElseIf (pacmanx < 416) and (pacmanx + 25 > 184) and (pacmanY < 351) and (pacmanY + 25 > 249) then pacmanY = pacmanY - 3 EndIf 'Bottom Teleporter If pacmanY > 600 then pacmanx = 290 pacmanY = -25 EndIf EndIf If pacmanLeft = "true" Then pacmanX = pacmanX - 3 Shapes.Rotate(pacman,180) 'Outer Walls - Left Side If pacmanLeft = "true" And pacmanx < 52 And pacmanx+25 > 30 And pacmanY+25 > 70 And pacmanY < 300 Then pacmanx = pacmanx + 3 ElseIf pacmanLeft = "true" and pacmanx < 52 and pacmanx+25 > 30 and pacmanY+25 > 350 and pacmanY < 530 then pacmanx = pacmanx + 3 'Inner Walls ElseIf (pacmanx < 186) and (pacmanX+25 > 84) And (pacmanY < 206) And (pacmanY + 25 > 104) Then pacmanx = pacmanx + 3 ElseIf (pacmanx < 516) and (pacmanx+25 > 414) and (pacmanY < 206) and (pacmanY + 25 > 104) then pacmanx = pacmanx + 3 ElseIf (pacmanx < 186) and (pacmanx + 25 > 84) and (pacmanY < 496) and (pacmanY+25 > 394) then pacmanx = pacmanx + 3 ElseIf (pacmanx < 516) and (pacmanx + 25 > 414) and (pacmanY < 496) and (pacmanY + 25 > 394) then pacmanx = pacmanx + 3 ElseIf (pacmanx < 416) and (pacmanx + 25 > 184) and (pacmanY < 351) and (pacmanY + 25 > 249) then pacmanx = pacmanx + 3 EndIf 'Left Teleporter If pacmanx+25 < 0 then pacmanx = 601 pacmanY = 315 EndIf EndIf If pacmanRight = "true" Then pacmanX = pacmanX + 3 Shapes.Rotate(pacman,0) 'Outer Walls - Right Side If pacmanRight = "true" And (pacmanx < 570) And (pacmanx+25 > 548) And (pacmanY+25 > 70) And (pacmanY < 300) Then pacmanx = pacmanx - 3 ElseIf pacmanRight = "true" and (pacmanx < 570) and (pacmanx+25 > 548) and (pacmanY+25 > 350) and (pacmanY < 530) then pacmanx = pacmanx - 3 'Inner Walls ElseIf (pacmanx < 186) and (pacmanX+25 > 84) And (pacmanY < 206) And (pacmanY + 25 > 104) Then pacmanx = pacmanx - 3 ElseIf (pacmanx < 516) and (pacmanx+25 > 414) and (pacmanY < 206) and (pacmanY + 25 > 104) then pacmanx = pacmanx - 3 ElseIf (pacmanx < 186) and (pacmanx + 25 > 84) and (pacmanY < 496) and (pacmanY+25 > 396) then pacmanx = pacmanx - 3 ElseIf (pacmanx < 516) and (pacmanx + 25 > 414) and (pacmanY < 496) and (pacmanY + 25 > 396) then pacmanx = pacmanx - 3 ElseIf (pacmanx < 416) and (pacmanx + 25 > 184) and (pacmanY < 351) and (pacmanY + 25 > 249) then pacmanx = pacmanx - 3 EndIf 'Right Teleporter If pacmanx > 600 then pacmanx = -25 pacmanY = 315 EndIf EndIf 'Collision with Small Dots count = 0 For i = 1 To 194 If (pacmanx < Shapes.GetLeft(Sdot[i])+8) And (pacmanx+25 > shapes.GetLeft(Sdot[i])) And (pacmanY < shapes.GetTop(Sdot[i])+8) And (pacmanY+25 > shapes.GetTop(Sdot[i])) Then Shapes.Remove(Sdot[i]) Score = Score + 10 Shapes.SetText(myScore,Score) EndIf endfor 'Collision with PowerPellets For i = 1 To 4 If (pacmanX < Shapes.GetLeft(PowerPellet[i])+20) And (pacmanX+25 > Shapes.GetLeft(PowerPellet[i])) And (pacmanY < Shapes.GetTop(PowerPellet[i])+20) And (pacmanY+25 > Shapes.GetTop(PowerPellet[i])) Then Shapes.Remove(PowerPellet[i]) Score = Score + 100 Shapes.SetText(myScore,Score) EndIf EndFor Shapes.Move(pacman,pacmanX,pacmanY) GhostsMove() EndSub Sub OnkeyDown pressed = GraphicsWindow.LastKey If pressed = "W" Then pacmanUp = "true" pacmanDown = "false" pacmanLeft = "false" pacmanRight = "false" EndIf If pressed = "S" then pacmanDown = "true" pacmanUp = "false" pacmanLeft = "false" pacmanRight = "false" EndIf if pressed = "A" then pacmanLeft = "true" pacmanUp = "false" pacmanDown = "false" pacmanRight = "false" EndIf if pressed = "D" then pacmanRight = "true" pacmanUp = "false" pacmanDown = "false" pacmanLeft = "false" EndIf If pressed = "Q" Then Program.End() EndIf EndSub Sub OnKeyUp pressed = GraphicsWindow.LastKey If pressed = "W" Then pacmanUp = "false" EndIf If pressed = "S" then pacmanDown = "false" EndIf if pressed = "A" then pacmanLeft = "false" EndIf if pressed = "D" then pacmanRight = "false" EndIf EndSub GraphicsWindow.MouseMove = OnMouseMove Sub OnMouseMove x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY GraphicsWindow.Title = "X: " + x + " Y: " + y + " EndSub 'Small Pellets Sub Pellets GraphicsWindow.PenColor = "yellow" SdotX = 85 SdotY = 85 For i = 1 To 18 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotX = SdotX + 25 EndFor SdotX = 85 SdotY = 510 For i = 19 To 36 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotX = SdotX + 25 EndFor SdotX = 60 SdotY = 110 For i = 37 To 52 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotY = SdotY + 25 EndFor SdotX = 530 SdotY = 110 For i = 53 To 68 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotY = SdotY + 25 EndFor SdotX = 85 SdotY = 210 For i = 69 To 75 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotY = SdotY + 25 EndFor SdotX = 110 SdotY = 210 For i = 76 To 82 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotY = SdotY + 25 EndFor SdotX = 135 SdotY = 210 For i = 83 To 89 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotY = SdotY + 25 EndFor SdotX = 160 SdotY = 210 For i = 90 To 96 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotY = SdotY + 25 EndFor SdotX = 435 SdotY = 210 For i = 97 To 103 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotY = SdotY + 25 EndFor SdotX = 460 SdotY = 210 For i = 104 To 110 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotY = SdotY + 25 EndFor SdotX = 485 SdotY = 210 For i = 111 To 117 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotY = SdotY + 25 EndFor SdotX = 510 SdotY = 210 For i = 118 To 124 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotY = SdotY + 25 EndFor SdotX = 185 SdotY = 210 For i = 125 To 134 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotX = SdotX + 25 EndFor SdotX = 185 SdotY = 235 For i = 135 To 144 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotX = SdotX + 25 EndFor SdotX = 185 SdotY = 360 For i = 145 To 154 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotX = SdotX + 25 EndFor SdotX = 210 SdotY = 385 For i = 155 To 159 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotY = SdotY + 25 EndFor SdotX = 235 SdotY = 385 For i = 160 To 164 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotY = SdotY + 25 EndFor SdotX = 260 SdotY = 385 For i = 165 To 169 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotY = SdotY + 25 EndFor SdotX = 285 SdotY = 385 For i = 170 To 174 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotY = SdotY + 25 EndFor SdotX = 310 SdotY = 385 For i = 175 To 179 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotY = SdotY + 25 EndFor SdotX = 335 SdotY = 385 For i = 180 To 184 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotY = SdotY + 25 EndFor SdotX = 360 SdotY = 385 For i = 185 To 189 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotY = SdotY + 25 EndFor SdotX = 385 SdotY = 385 For i = 190 To 194 GraphicsWindow.BrushColor = "yellow" Sdot[i] = Shapes.AddEllipse(8,8) Shapes.Move(Sdot[i],SdotX,SdotY) SdotY = SdotY + 25 EndFor EndSub 'BLINKY blinkyAlive = "true" blinkyDirection = "up" blinkyX = 250 blinkyY = 365 blinky = Shapes.AddImage("H:/blinky.jpg") Shapes.Move(blinky,blinkyX,blinkyY) 'INKY inkyAlive = "true" inkyDirection = "up" inkyX = 130 inkyY = 265 inky = Shapes.AddImage("H:/inky.jpg") Shapes.Move(inky,inkyX,inkyY) 'CLYDE clydeAlive = "true" clydeDirection = "up" clydeX = 430 clydeY = 265 clyde = Shapes.AddImage("H:/clyde.jpg") Shapes.Move(clyde,clydeX,clydeY) 'PINKY pinkyAlive = "true" pinkyDirection = "up" pinkyX = 195 pinkyY = 220 pinky = Shapes.AddImage("H:/pinky.png") Shapes.Move(pinky,pinkyX,pinkyY) '========================================================================= Sub GhostsMove 'BLINKY'S MOVEMENT If blinkyAlive = "true" Then If blinkyDirection = "up" Then blinkyY = blinkyY - 5 'Outer Walls - Top Side if (blinkyX < 281) And (blinkyX+25 > 31) And (blinkyY < 71) and (blinkyY+25 > 49) then blinkyY = blinkyY + 5 ElseIf (blinkyX < 570) and (blinkyX+25 > 330) and (blinkyY < 71) and (blinkyY+25 > 49) then blinkyY = blinkyY + 5 'Inner Walls ElseIf (blinkyX < 186) and (blinkyX + 25 > 84) And (blinkyY < 206) And (blinkyY + 25 > 104) Then blinkyY = blinkyY + 5 ElseIf (blinkyX < 516) and (blinkyX+25 > 414) and (blinkyY < 206) and (blinkyY + 25 > 104) then blinkyY = blinkyY + 5 ElseIf (blinkyX < 186) and (blinkyX + 25 > 84) and (blinkyY < 496) and (blinkyY+25 > 394) then blinkyY = blinkyY + 5 ElseIf (blinkyX < 516) and (blinkyX + 25 > 414) and (blinkyY < 496) and (blinkyY + 25 > 394) then blinkyY = blinkyY + 5 ElseIf (blinkyX < 416) and (blinkyX + 25 > 184) and (blinkyY < 351) and (blinkyY + 25 > 249) then blinkyY = blinkyY + 5 EndIf 'Top Teleporter If blinkyY+25 < 0 Then blinkyX = 290 blinkyY = 600 EndIf EndIf If blinkyAlive = "true" Then If blinkyDirection = "down" Then blinkyY = blinkyY + 5 'Outer Walls - Bottom Side If (blinkyX < 281) and (blinkyX + 25 > 31) and (blinkyY < 550) and (blinkyY+25 > 529) then blinkyY = blinkyY - 5 ElseIf (blinkyX < 570) and (blinkyX+25 > 330) and (blinkyY < 550) and (blinkyY+25 > 529) then blinkyY = blinkyY - 5 'Inner Walls ElseIf (blinkyX < 186) and (blinkyX+25 > 84) And (blinkyY < 206) And (blinkyY + 25 > 104) Then blinkyY = blinkyY - 5 ElseIf (blinkyX < 516) and (blinkyX+25 > 414) and (blinkyY < 206) and (blinkyY + 25 > 104) then blinkyY = blinkyY - 5 ElseIf (blinkyX < 186) and (blinkyX + 25 > 84) and (blinkyY < 496) and (blinkyY+25 > 394) then blinkyY = blinkyY - 5 ElseIf (blinkyX < 516) and (blinkyX + 25 > 414) and (blinkyY < 496) and (blinkyY + 25 > 394) then blinkyY = blinkyY - 5 ElseIf (blinkyX < 416) and (blinkyX + 25 > 184) and (blinkyY < 351) and (blinkyY + 25 > 249) then blinkyY = blinkyY - 5 EndIf 'Bottom Teleporter If blinkyY > 600 then blinkyX = 290 blinkyY = -25 EndIf EndIf If blinkyAlive = "true" Then If blinkyDirection = "left" Then blinkyX = blinkyX - 5 'Outer Walls - Left Side If blinkyX < 52 And blinkyX+25 > 30 And blinkyY+25 > 70 And blinkyY < 300 Then blinkyX = blinkyX + 5 ElseIf blinkyX < 52 and blinkyX+25 > 30 and blinkyY+25 > 350 and blinkyY < 530 then blinkyX = blinkyX + 5 'Inner Walls ElseIf (blinkyX < 186) and (blinkyX+25 > 84) And (blinkyY < 206) And (blinkyY + 25 > 104) Then blinkyX = blinkyX + 5 ElseIf (blinkyX < 516) and (blinkyX+25 > 414) and (blinkyY < 206) and (blinkyY + 25 > 104) then blinkyX = blinkyX + 5 ElseIf (blinkyX < 186) and (blinkyX + 25 > 84) and (blinkyY < 496) and (blinkyY+25 > 394) then blinkyX = blinkyX + 5 ElseIf (blinkyX < 516) and (blinkyX + 25 > 414) and (blinkyY < 496) and (blinkyY + 25 > 394) then blinkyX = blinkyX + 5 ElseIf (blinkyX < 416) and (blinkyX + 25 > 184) and (blinkyY < 351) and (blinkyY + 25 > 249) then blinkyX = blinkyX + 5 EndIf 'Left Teleporter If blinkyX+25 < 0 then blinkyX = 601 blinkyY = 315 EndIf EndIf If blinkyAlive = "true" Then If blinkyDirection = "right" Then blinkyX = blinkyX + 5 'Outer Walls - Right Side If (blinkyX < 570) And (blinkyX+25 > 548) And (blinkyY+25 > 70) And (blinkyY < 300) Then blinkyX = blinkyX - 5 ElseIf (blinkyX < 570) and (blinkyX+25 > 548) and (blinkyY+25 > 350) and (blinkyY < 530) then blinkyX = blinkyX - 5 'Inner Walls ElseIf (blinkyX < 186) and (blinkyX+25 > 84) And (blinkyY < 206) And (blinkyY + 25 > 104) Then blinkyX = blinkyX - 5 ElseIf (blinkyX < 516) and (blinkyX+25 > 414) and (blinkyY < 206) and (blinkyY + 25 > 104) then blinkyX = blinkyX - 5 ElseIf (blinkyX < 186) and (blinkyX + 25 > 84) and (blinkyY < 496) and (blinkyY+25 > 396) then blinkyX = blinkyX - 5 ElseIf (blinkyX < 516) and (blinkyX + 25 > 414) and (blinkyY < 496) and (blinkyY + 25 > 396) then blinkyX = blinkyX - 5 ElseIf (blinkyX < 416) and (blinkyX + 25 > 184) and (blinkyY < 351) and (blinkyY + 25 > 249) then blinkyX = blinkyX - 5 EndIf 'Right Teleporter If blinkyX > 600 then blinkyX = -25 blinkyY = 315 EndIf EndIf EndIf EndIf EndIf EndIf Shapes.Move(blinky,blinkyX,blinkyY) blinkyCount = blinkyCount + 1 If blinkyCount = blinkySpeed Then n = Math.GetRandomNumber(4) If n = 1 Then blinkyDirection = "up" ElseIf n = 2 then blinkyDirection = "down" elseif n = 3 then blinkyDirection = "left" elseif n = 4 then blinkyDirection = "right" EndIf blinkyCount = 0 EndIf '================================================================================= 'CLYDE'S MOVEMENT If clydeAlive = "true" Then If clydeDirection = "up" Then clydeY = clydeY - 5 'Outer Walls - Top Side if (clydeX < 281) And (clydeX+25 > 31) And (clydeY < 71) and (clydeY+25 > 49) then clydeY = clydeY + 5 ElseIf (clydeX < 570) and (clydeX+25 > 330) and (clydeY < 71) and (clydeY+25 > 49) then clydeY = clydeY + 5 'Inner Walls ElseIf (clydeX < 186) and (clydeX + 25 > 84) And (clydeY < 206) And (clydeY + 25 > 104) Then clydeY = clydeY + 5 ElseIf (clydeX < 516) and (clydeX+25 > 414) and (clydeY < 206) and (clydeY + 25 > 104) then clydeY = clydeY + 5 ElseIf (clydeX < 186) and (clydeX + 25 > 84) and (clydeY < 496) and (clydeY+25 > 394) then clydeY = clydeY + 5 ElseIf (clydeX < 516) and (clydeX + 25 > 414) and (clydeY < 496) and (clydeY + 25 > 394) then clydeY = clydeY + 5 ElseIf (clydeX < 416) and (clydeX + 25 > 184) and (clydeY < 351) and (clydeY + 25 > 249) then clydeY = clydeY + 5 EndIf 'Top Teleporter If clydeY+25 < 0 Then clydeX = 290 clydeY = 600 EndIf EndIf If clydeAlive = "true" Then If clydeDirection = "down" Then clydeY = clydeY + 3 'Outer Walls - Bottom Side If (clydeX < 281) and (clydeX + 25 > 31) and (clydeY < 550) and (clydeY+25 > 529) then clydeY = clydeY - 5 ElseIf (clydeX < 570) and (clydeX+25 > 330) and (clydeY < 550) and (clydeY+25 > 529) then clydeY = clydeY - 5 'Inner Walls ElseIf (clydeX < 186) and (clydeX+25 > 84) And (clydeY < 206) And (clydeY + 25 > 104) Then clydeY = clydeY - 5 ElseIf (clydeX < 516) and (clydeX+25 > 414) and (clydeY < 206) and (clydeY + 25 > 104) then clydeY = clydeY - 5 ElseIf (clydeX < 186) and (clydeX + 25 > 84) and (clydeY < 496) and (clydeY+25 > 394) then clydeY = clydeY - 5 ElseIf (clydeX < 516) and (clydeX + 25 > 414) and (clydeY < 496) and (clydeY + 25 > 394) then clydeY = clydeY - 5 ElseIf (clydeX < 416) and (clydeX + 25 > 184) and (clydeY < 351) and (clydeY + 25 > 249) then clydeY = clydeY - 5 EndIf 'Bottom Teleporter If clydeY > 600 then clydeX = 290 clydeY = -25 EndIf EndIf If clydeAlive = "true" Then If clydeDirection = "left" Then clydeX = clydeX - 5 'Outer Walls - Left Side If clydeX < 52 And clydeX+25 > 30 And clydeY+25 > 70 And clydeY < 300 Then clydeX = clydeX + 5 ElseIf clydeX < 52 and clydeX+25 > 30 and clydeY+25 > 350 and clydeY < 530 then clydeX = clydeX + 5 'Inner Walls ElseIf (clydeX < 186) and (clydeX+25 > 84) And (clydeY < 206) And (clydeY + 25 > 104) Then clydeX = clydeX + 5 ElseIf (clydeX < 516) and (clydeX+25 > 414) and (clydeY < 206) and (clydeY + 25 > 104) then clydeX = clydeX + 5 ElseIf (clydeX < 186) and (clydeX + 25 > 84) and (clydeY < 496) and (clydeY+25 > 394) then clydeX = clydeX + 5 ElseIf (clydeX < 516) and (clydeX + 25 > 414) and (clydeY < 496) and (clydeY + 25 > 394) then clydeX = clydeX + 5 ElseIf (clydeX < 416) and (clydeX + 25 > 184) and (clydeY < 351) and (clydeY + 25 > 249) then clydeX = clydeX + 5 EndIf 'Left Teleporter If clydeX+25 < 0 then clydeX = 601 clydeY = 315 EndIf EndIf If clydeAlive = "true" Then If clydeDirection = "right" Then clydeX = clydeX + 5 'Outer Walls - Right Side If (clydeX < 570) And (clydeX+25 > 548) And (clydeY+25 > 70) And (clydeY < 300) Then clydeX = clydeX - 5 ElseIf (clydeX < 570) and (clydeX+25 > 548) and (clydeY+25 > 350) and (clydeY < 530) then clydeX = clydeX - 5 'Inner Walls ElseIf (clydeX < 186) and (clydeX+25 > 84) And (clydeY < 206) And (clydeY + 25 > 104) Then clydeX = clydeX - 5 ElseIf (clydeX < 516) and (clydeX+25 > 414) and (clydeY < 206) and (clydeY + 25 > 104) then clydeX = clydeX - 5 ElseIf (clydeX < 186) and (clydeX + 25 > 84) and (clydeY < 496) and (clydeY+25 > 396) then clydeX = clydeX - 5 ElseIf (clydeX < 516) and (clydeX + 25 > 414) and (clydeY < 496) and (clydeY + 25 > 396) then clydeX = clydeX - 5 ElseIf (clydeX < 416) and (clydeX + 25 > 184) and (clydeY < 351) and (clydeY + 25 > 249) then clydeX = clydeX - 5 EndIf 'Right Teleporter If clydeX > 600 then clydeX = -25 clydeY = 315 EndIf EndIf EndIf EndIf EndIf EndIf Shapes.Move(clyde,clydeX,clydeY) clydeCount = clydeCount + 1 If clydeCount = clydeSpeed Then n = Math.GetRandomNumber(4) If n = 1 Then clydeDirection = "up" ElseIf n = 2 then clydeDirection = "down" elseif n = 3 then clydeDirection = "left" elseif n = 4 then clydeDirection = "right" EndIf clydeCount = 0 EndIf '================================================================ 'PINKY'S MOVEMENT If pinkyAlive = "true" Then If pinkyDirection = "up" Then pinkyY = pinkyY - 5 'Outer Walls - Top Side if (pinkyX < 281) And (pinkyX+25 > 31) And (pinkyY < 71) and (pinkyY+25 > 49) then pinkyY = pinkyY + 5 ElseIf (pinkyX < 570) and (pinkyX+25 > 330) and (pinkyY < 71) and (pinkyY+25 > 49) then pinkyY = pinkyY + 5 'Inner Walls ElseIf (pinkyX < 186) and (pinkyX + 25 > 84) And (pinkyY < 206) And (pinkyY + 25 > 104) Then pinkyY = pinkyY + 5 ElseIf (pinkyX < 516) and (pinkyX+25 > 414) and (pinkyY < 206) and (pinkyY + 25 > 104) then pinkyY = inkyY + 5 ElseIf (pinkyX < 186) and (pinkyX + 25 > 84) and (pinkyY < 496) and (pinkyY+25 > 394) then pinkyY = pinkyY + 5 ElseIf (pinkyX < 516) and (pinkyX + 25 > 414) and (pinkyY < 496) and (pinkyY + 25 > 394) then pinkyY = pinkyY + 5 ElseIf (pinkyX < 416) and (pinkyX + 25 > 184) and (pinkyY < 351) and (pinkyY + 25 > 249) then pinkyY = pinkyY + 5 EndIf 'Top Teleporter If pinkyY+25 < 0 Then pinkyX = 290 pinkyY = 600 EndIf EndIf If pinkyAlive = "true" Then If pinkyDirection = "down" Then pinkyY = pinkyY + 3 'Outer Walls - Bottom Side If (pinkyX < 281) and (pinkyX + 25 > 31) and (pinkyY < 550) and (pinkyY+25 > 529) then pinkyY = pinkyY - 5 ElseIf (pinkyX < 570) and (pinkyX+25 > 330) and (pinkyY < 550) and (pinkyY+25 > 529) then pinkyY = pinkyY - 5 'Inner Walls ElseIf (pinkyX < 186) and (pinkyX+25 > 84) And (pinkyY < 206) And (pinkyY + 25 > 104) Then pinkyY = pinkyY - 5 ElseIf (pinkyX < 516) and (pinkyX+25 > 414) and (pinkyY < 206) and (pinkyY + 25 > 104) then pinkyY = pinkyY - 5 ElseIf (pinkyX < 186) and (pinkyX + 25 > 84) and (pinkyY < 496) and (pinkyY+25 > 394) then pinkyY = pinkyY - 5 ElseIf (pinkyX < 516) and (pinkyX + 25 > 414) and (pinkyY < 496) and (pinkyY + 25 > 394) then pinkyY = pinkyY - 5 ElseIf (pinkyX < 416) and (pinkyX + 25 > 184) and (pinkyY < 351) and (pinkyY + 25 > 249) then pinkyY = pinkyY - 5 EndIf 'Bottom Teleporter If pinkyY > 600 then pinkyX = 290 pinkyY = -25 EndIf EndIf If pinkyAlive = "true" Then If pinkyDirection = "left" Then pinkyX = pinkyX - 5 'Outer Walls - Left Side If pinkyX < 52 And pinkyX+25 > 30 And pinkyY+25 > 70 And pinkyY < 300 Then pinkyX = pinkyX + 5 ElseIf pinkyX < 52 and pinkyX+25 > 30 and pinkyY+25 > 350 and pinkyY < 530 then pinkyX = pinkyX + 5 'Inner Walls ElseIf (pinkyX < 186) and (pinkyX+25 > 84) And (pinkyY < 206) And (pinkyY + 25 > 104) Then inkyX = inkyX + 5 ElseIf (pinkyX < 516) and (pinkyX+25 > 414) and (pinkyY < 206) and (pinkyY + 25 > 104) then pinkyX = pinkyX + 5 ElseIf (pinkyX < 186) and (pinkyX + 25 > 84) and (pinkyY < 496) and (pinkyY+25 > 394) then pinkyX = pinkyX + 5 ElseIf (pinkyX < 516) and (pinkyX + 25 > 414) and (pinkyY < 496) and (pinkyY + 25 > 394) then pinkyX = pinkyX + 5 ElseIf (pinkyX < 416) and (pinkyX + 25 > 184) and (pinkyY < 351) and (pinkyY + 25 > 249) then pinkyX = pinkyX + 5 EndIf 'Left Teleporter If pinkyX+25 < 0 then pinkyX = 601 pinkyY = 315 EndIf EndIf If pinkyAlive = "true" Then If pinkyDirection = "right" Then pinkyX = pinkyX + 5 'Outer Walls - Right Side If (pinkyX < 570) And (pinkyX+25 > 548) And (pinkyY+25 > 70) And (pinkyY < 300) Then pinkyX = pinkyX - 5 ElseIf (pinkyX < 570) and (pinkyX+25 > 548) and (pinkyY+25 > 350) and (pinkyY < 530) then pinkyX = pinkyX - 5 'Inner Walls ElseIf (pinkyX < 186) and (pinkyX+25 > 84) And (pinkyY < 206) And (pinkyY + 25 > 104) Then pinkyX = pinkyX - 5 ElseIf (pinkyX < 516) and (pinkyX+25 > 414) and (pinkyY < 206) and (pinkyY + 25 > 104) then pinkyX = pinkyX - 5 ElseIf (pinkyX < 186) and (pinkyX + 25 > 84) and (pinkyY < 496) and (pinkyY+25 > 396) then pinkyX = pinkyX - 5 ElseIf (pinkyX < 516) and (pinkyX + 25 > 414) and (pinkyY < 496) and (pinkyY + 25 > 396) then pinkyX = pinkyX - 5 ElseIf (pinkyX < 416) and (pinkyX + 25 > 184) and (pinkyY < 351) and (pinkyY + 25 > 249) then pinkyX = pinkyX - 5 EndIf 'Right Teleporter If pinkyX > 600 then pinkyX = -25 pinkyY = 315 EndIf EndIf EndIf EndIf EndIf EndIf Shapes.Move(pinky,pinkyX,pinkyY) pinkyCount = pinkyCount + 1 If pinkyCount = pinkySpeed Then n = Math.GetRandomNumber(4) If n = 1 Then pinkyDirection = "up" ElseIf n = 2 then pinkyDirection = "down" elseif n = 3 then pinkyDirection = "left" elseif n = 4 then pinkyDirection = "right" EndIf pinkyCount = 0 EndIf '======================================================================== 'INKY'S MOVEMENT If inkyAlive = "true" Then If inkyDirection = "up" Then inkyY = inkyY - 5 'Outer Walls - Top Side if (inkyX < 281) And (inkyX+25 > 31) And (inkyY < 71) and (inkyY+25 > 49) then inkyY = inkyY + 5 ElseIf (inkyX < 570) and (inkyX+25 > 330) and (inkyY < 71) and (inkyY+25 > 49) then inkyY = inkyY + 5 'Inner Walls ElseIf (inkyX < 186) and (inkyX + 25 > 84) And (inkyY < 206) And (inkyY + 25 > 104) Then inkyY = inkyY + 5 ElseIf (inkyX < 516) and (inkyX+25 > 414) and (inkyY < 206) and (inkyY + 25 > 104) then inkyY = inkyY + 5 ElseIf (inkyX < 186) and (inkyX + 25 > 84) and (inkyY < 496) and (inkyY+25 > 394) then inkyY = inkyY + 5 ElseIf (inkyX < 516) and (inkyX + 25 > 414) and (inkyY < 496) and (inkyY + 25 > 394) then inkyY = inkyY + 5 ElseIf (inkyX < 416) and (inkyX + 25 > 184) and (inkyY < 351) and (inkyY + 25 > 249) then inkyY = inkyY + 5 EndIf 'Top Teleporter If inkyY+25 < 0 Then inkyX = 290 inkyY = 600 EndIf EndIf If inkyAlive = "true" Then If inkyDirection = "down" Then inkyY = inkyY + 3 'Outer Walls - Bottom Side If (inkyX < 281) and (inkyX + 25 > 31) and (inkyY < 550) and (inkyY+25 > 529) then inkyY = inkyY - 5 ElseIf (inkyX < 570) and (inkyX+25 > 330) and (inkyY < 550) and (inkyY+25 > 529) then inkyY = inkyY - 5 'Inner Walls ElseIf (inkyX < 186) and (inkyX+25 > 84) And (inkyY < 206) And (inkyY + 25 > 104) Then inkyY = inkyY - 5 ElseIf (inkyX < 516) and (inkyX+25 > 414) and (inkyY < 206) and (inkyY + 25 > 104) then inkyY = inkyY - 5 ElseIf (inkyX < 186) and (inkyX + 25 > 84) and (inkyY < 496) and (inkyY+25 > 394) then inkyY = inkyY - 5 ElseIf (inkyX < 516) and (inkyX + 25 > 414) and (inkyY < 496) and (inkyY + 25 > 394) then inkyY = inkyY - 5 ElseIf (inkyX < 416) and (inkyX + 25 > 184) and (inkyY < 351) and (inkyY + 25 > 249) then inkyY = inkyY - 5 EndIf 'Bottom Teleporter If inkyY > 600 then inkyX = 290 inkyY = -25 EndIf EndIf If inkyAlive = "true" Then If inkyDirection = "left" Then inkyX = inkyX - 5 'Outer Walls - Left Side If inkyX < 52 And inkyX+25 > 30 And inkyY+25 > 70 And inkyY < 300 Then inkyX = inkyX + 5 ElseIf inkyX < 52 and inkyX+25 > 30 and inkyY+25 > 350 and inkyY < 530 then inkyX = inkyX + 5 'Inner Walls ElseIf (inkyX < 186) and (inkyX+25 > 84) And (inkyY < 206) And (inkyY + 25 > 104) Then inkyX = inkyX + 5 ElseIf (inkyX < 516) and (inkyX+25 > 414) and (inkyY < 206) and (inkyY + 25 > 104) then inkyX = inkyX + 5 ElseIf (inkyX < 186) and (inkyX + 25 > 84) and (inkyY < 496) and (inkyY+25 > 394) then inkyX = inkyX + 5 ElseIf (inkyX < 516) and (inkyX + 25 > 414) and (inkyY < 496) and (inkyY + 25 > 394) then inkyX = inkyX + 5 ElseIf (inkyX < 416) and (inkyX + 25 > 184) and (inkyY < 351) and (inkyY + 25 > 249) then inkyX = inkyX + 5 EndIf 'Left Teleporter If inkyX+25 < 0 then inkyX = 601 inkyY = 315 EndIf EndIf If inkyAlive = "true" Then If inkyDirection = "right" Then inkyX = inkyX + 5 'Outer Walls - Right Side If (inkyX < 570) And (inkyX+25 > 548) And (inkyY+25 > 70) And (inkyY < 300) Then inkyX = inkyX - 5 ElseIf (inkyX < 570) and (inkyX+25 > 548) and (inkyY+25 > 350) and (inkyY < 530) then inkyX = inkyX - 5 'Inner Walls ElseIf (inkyX < 186) and (inkyX+25 > 84) And (inkyY < 206) And (inkyY + 25 > 104) Then inkyX = inkyX - 5 ElseIf (inkyX < 516) and (inkyX+25 > 414) and (inkyY < 206) and (inkyY + 25 > 104) then inkyX = inkyX - 5 ElseIf (inkyX < 186) and (inkyX + 25 > 84) and (inkyY < 496) and (inkyY+25 > 396) then inkyX = inkyX - 5 ElseIf (inkyX < 516) and (inkyX + 25 > 414) and (inkyY < 496) and (inkyY + 25 > 396) then inkyX = inkyX - 5 ElseIf (inkyX < 416) and (inkyX + 25 > 184) and (inkyY < 351) and (inkyY + 25 > 249) then inkyX = inkyX - 5 EndIf 'Right Teleporter If inkyX > 600 then inkyX = -25 inkyY = 315 EndIf EndIf EndIf EndIf EndIf EndIf Shapes.Move(inky,inkyX,inkyY) inkyCount = inkyCount + 1 If inkyCount = inkySpeed Then n = Math.GetRandomNumber(4) If n = 1 Then inkyDirection = "up" ElseIf n = 2 then inkyDirection = "down" elseif n = 3 then inkyDirection = "left" elseif n = 4 then inkyDirection = "right" EndIf inkyCount = 0 EndIf EndSub End>LLV333.sb< Start>LLV523.sb< player() variables() Menu() 'Done so far: 'got almost all mobs and bosses + bonus monsters/bosses 'got health pots and mana pots 'got/need skills 'got saving and loading, THINK SO! :D 'Need ASAP: 'equipment (add moar items!) + MEGA EPIC ITEMS! xD 'questgiver (HOW!?!?!) + daily quests 'town (NAME ? or more than one?) 'map (BUT HOOOOW) Sub variables path = Program.Directory + "\Diablo.txt" ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' variables=File.ReadContents(path) x = 0 y = 0 EndSub Sub Save_game path = Program.Directory + "\Diablo.txt" variables[1] = x variables[2] = y variables[3] = level variables[4] = playerhp variables[5] = playerstr variables[6] = playerdef variables[7] = playergold variables[8] = playerxp variables[9] = totalplayerhp variables[10] = sp variables[11] = totalplayermp variables[12] = playermp variables[13] = hppot variables[14] = mppot variables[15] = playervitinc variables[16] = playerintinc variables[17] = playervit variables[18] = playerint variables[19] = activatevls variables[20] = activatelbs variables[21] = activatescm variables[22] = activateepa variables[23] = activatesk variables[24] = activatezh variables[25] = activatedg variables[26] = rjpot ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' File.WriteContents(path, variables) EndSub Sub load_game path = Program.Directory + "\Diablo.txt" x = variables[1] y = variables [2] level = variables[3] playerhp = variables[4] playerstr = variables[5] playerdef = variables[6] playergold = variables[7] playerxp = variables[8] totalplayerhp = variables[9] sp = variables[10] totalplayermp = variables[11] playermp = variables[12] hppot =variables[13] mppot = variables[14] playervitinc = variables[15] playerintinc = variables[16] playervit = variables[17] playerint = variables[18] activatevls = variables[19] activatelbs = variables[20] activatescm = variables[21] activateepa = variables[22] activatesk = variables[23] activatezh =variables[24] activatedg= variables[25] rjpot = variables[26] EndSub Sub player sp = 0 weapon = "Sword" level = 1 totalplayerhp = 100 + playervitinc playerhp = 100 + playervitinc playerstr = 10 - enemydef playerdef = 10 playergold = 0 playerxp = 0 playermp = 30 + playerintinc totalplayermp = 30 + playerintinc hppot = 10 mppot = 10 playervitinc = 0 playerintinc = 0 playervit = 10 playerint = 10 activatevls = 0 activatelbs = 0 activatescm = 0 activateepa = 0 activatedg = 0 activatesk = 0 activatezh = 0 EndSub Sub skeleton enemyname = "Skeleton" enemyhp = 10 totalenemyhp = 10 enemystr = 12 - playerdef enemydef = 1 xpdrop = 5 golddrop = 3 EndSub Sub hordeofzombies enemyname = "Horde of Zombies" enemyhp = 10 totalenemyhp = 10 enemystr = 12 - playerdef enemydef = 1 xpdrop = 5 golddrop = 3 EndSub Sub zombie enemyname = "Zombie" enemyhp = 20 totalenemyhp = 20 enemystr = 14 - playerdef enemydef = 2 xpdrop = 10 golddrop = 6 EndSub Sub demon enemyname = "Demon" enemyhp = 30 totalenemyhp = 30 enemystr = 16- playerdef enemydef = 3 xpdrop = 15 golddrop = 9 EndSub Sub skeletonking enemyname = "Leoric, the Skeleton King" enemyhp = 250 totalenemyhp = 250 enemystr = 25- playerdef enemydef = 15 xpdrop = 25 golddrop = 45 EndSub Sub zombiehulk enemyname = "Zombie Hulk" enemyhp = 300 totalenemyhp = 300 enemystr = 30- playerdef enemydef = 20 xpdrop = 30 golddrop = 50 EndSub Sub demongeneral enemyname = "Demon General" enemyhp = 500 totalenemyhp = 500 enemystr = 35- playerdef enemydef = 25 xpdrop = 40 golddrop = 60 EndSub Sub Mephisto eneyname = "Mephisto" enemyhp = 850 totalenemyhp = 850 enemystr = 50- playerdef enemydef = 40 xpdrop = 40 goldrop = 80 EndSub Sub Diablo enemyname = "Diablo" enemyhp = 1000 totalenemyhp = 1000 enemystr = 60- playerdef enemydef = 50 xpdrop = 50 golddrop = 100 EndSub Sub Menu TextWindow.WriteLine(" Diablo") space() TextWindow.WriteLine(" ALPHA TEST") For i =1 To 5 space() EndFor TextWindow.WriteLine(" 1. New Game") TextWindow.WriteLine(" 2. Load Game") TextWindow.WriteLine(" 3. Exit") For i =1 To 10 space() EndFor TextWindow.WriteLine("All trademarks referenced herein are the properties of their respective owners.") TextWindow.WriteLine(" ©2015 Blizzard Entertainment, Inc. All rights reserved.") space() menu1 = TextWindow.ReadKey() If menu1 = 1 Then TextWindow.Clear() intro() ElseIf menu1 = 2 then TextWindow.Clear() ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' variables = File.ReadContents(path) load_game() selectlocation() elseif menu1 = 3 then Program.End() Else wrongoption() Menu() EndIf EndSub Sub space TextWindow.WriteLine(" ") endsub Sub enter TextWindow.WriteLine("Press Enter") TextWindow.PauseWithoutMessage() TextWindow.Clear() endsub Sub wrongoption TextWindow.Clear() TextWindow.WriteLine("You can only select the options listed.") space() enter() EndSub Sub intro TextWindow.WriteLine("Story: You need to save Sanctuary from the Prime Evils!") TextWindow.WriteLine("Diablo roams the streets of the human world once again.") TextWindow.WriteLine("Kill Diablo before the Prime Evils empower him.") space() enter() selectlocation() EndSub Sub leveling If (50 <= playerxp) And (playerxp <= 99 * 50) And (Math.Remainder(playerxp, 50) = 0) Then sp = sp + 1 level = level + 1 EndIf EndSub Sub town If x = 1 And y = 1 then TextWindow.Clear() selectlocation() EndIf If x = 4 And y = 60 then TextWindow.Clear() selectlocation() EndIf If x = 1 And (2 <= y And y <= 6) Then TownRandom() endif If x = 4 And (61 <= y And y <= 66) Then TownRandom() endif EndSub Sub townshopname If x = 1 And y = 1 then TextWindow.WriteLine("8. Enter Tristram") space() EndIf If x = 4 And y = 60 then TextWindow.WriteLine("8. Enter Hell Town Shop") space() EndIf EndSub Sub townshopname2 If x = 1 And y = 1 then TextWindow.Write("Tristram ") EndIf If x = 4 And y = 60 then TextWindow.Write("Hell Town ") EndIf EndSub Sub townshopenter if selectlocation1 = 8 then TextWindow.Clear() shop() EndIf EndSub Sub townname If x = 1 And y = 1 then TextWindow.WriteLine("Tristram") space() EndIf If x = 1 And (2 <= y And y <= 6) Then TextWindow.WriteLine("Tristram") space() endif If x =4 And y = 60 then TextWindow.WriteLine("Hell Town Shop") space() EndIf If x = 4 And (61 <= y And y <= 66) Then TextWindow.WriteLine("Hell Town") space() endif EndSub sub townrandom randomencounter1 = Math.GetRandomNumber(100) If randomencounter1 < 3then TextWindow.Clear() TextWindow.WriteLine("You have found a Health Potion.") space() enter() hppot = hppot + 1 selectlocation() elseIf randomencounter1 < 6 then TextWindow.Clear() TextWindow.WriteLine("You have found a Mana Potion.") space() enter() mppot = mppot + 1 selectlocation() Else selectlocation() EndIf EndSub Sub selectlocation leveling() townname() TextWindow.WriteLine("Coordinates: " + "(" + x + "," + y + ")") space() TextWindow.WriteLine("Level: " + level + " Stat Point: " + sp) space() TextWindow.WriteLine("Exp: " + playerxp + " Gold: " + playergold) space() TextWindow.WriteLine("Nephalem Health: " + playerhp + "/" + totalplayerhp + " Nephalem Mana: " + playermp + "/" + totalplayermp) space() TextWindow.WriteLine("1. North (" + x + "," + (y + 1) + ")") TextWindow.WriteLine("2. East (" + (x + 1) + "," + y + ")") TextWindow.WriteLine("3. West (" + (x - 1) + "," + y + ")") TextWindow.WriteLine("4. South (" + x + "," + (y - 1) + ")") space() TextWindow.WriteLine("5. Inventory") TextWindow.WriteLine("6. Statistics") TextWindow.WriteLine("7. Journal") space() townshopname() TextWindow.WriteLine("9. Miscellaneous") space() selectlocation1 = TextWindow.ReadKey() townshopenter() If selectlocation1 = 1 Then TextWindow.Clear() y = y + 1 randomencounter() ElseIf selectlocation1 = 2 then TextWindow.Clear() x = x + 1 randomencounter() elseif selectlocation1 = 3 then TextWindow.Clear() x = x-1 randomencounter() elseif selectlocation1 = 4 then TextWindow.Clear() y = y-1 randomencounter() elseif selectlocation1 = 5 then TextWindow.Clear() selectlocationinventory() elseif selectlocation1 = 6 then TextWindow.Clear() stats() elseif selectlocation1 = 7 then TextWindow.Clear() journal() elseIf selectlocation1 = 9 Then misc() Else wrongoption() selectlocation() EndIf EndSub Sub journal TextWindow.WriteLine("Journal") space() TextWindow.WriteLine("Table of Contents") space() space() TextWindow.WriteLine("1. Monsters") TextWindow.WriteLine("2. Bosses") TextWindow.WriteLine("3. Weapons") TextWindow.WriteLine("4. Armors") TextWindow.WriteLine("5. Potions") TextWindow.WriteLine("6. Towns") TextWindow.WriteLine("7. Shops") space() TextWindow.WriteLine("8. Return") space() journal1 =TextWindow.ReadKey() If journal1 = 1 then TextWindow.Clear() mobjournal() elseIf journal1 = 2 then TextWindow.Clear() bossjournal() elseIf journal1 = 3 then TextWindow.Clear() weaponjournal() elseIf journal1 = 4 then TextWindow.Clear() armorjournal() elseIf journal1 = 5 then TextWindow.Clear() potionjournal() elseIf journal1 = 6 then TextWindow.Clear() townjournal() elseIf journal1 = 7 then TextWindow.Clear() shopjournal() elseIf journal1 = 8 Then TextWindow.Clear() selectLocation() Else TextWindow.Clear() wrongoption() TextWindow.Clear() journal() EndIf endsub Sub mobjournal TextWindow.WriteLine("Monsters") space() space() TextWindow.WriteLine("Skeleton") TextWindow.WriteLine("Health: 10") TextWindow.WriteLine("Strenght: 12") TextWindow.WriteLine("Defence: 1") TextWindow.WriteLine("Experience: 5") TextWindow.WriteLine("Gold drop: 3") space() TextWindow.WriteLine("Zombie") TextWindow.WriteLine("Health: 20") TextWindow.WriteLine("Strenght: 14") TextWindow.WriteLine("Defence: 2") TextWindow.WriteLine("Experience: 10") TextWindow.WriteLine("Gold drop: 6") space() TextWindow.WriteLine("Demon") TextWindow.WriteLine("Health: 30") TextWindow.WriteLine("Strenght: 16") TextWindow.WriteLine("Defence: 3") TextWindow.WriteLine("Experience: 15") TextWindow.WriteLine("Gold drop: 9") space() space() TextWindow.WriteLine("1. Return 2. Next Page") space() space() journal1 =TextWindow.ReadKey() If journal1 = 1 Then TextWindow.Clear() journal() Else TextWindow.Clear() wrongoption() TextWindow.Clear() mobjournal() endif EndSub Sub bossjournal TextWindow.WriteLine("Bosses") space() space() TextWindow.WriteLine("Skeleton King: HP = 250, Str = 25, Def = 15, XP drop = 25, Gold drop = 45") TextWindow.WriteLine("Appears on (9,66)") space() TextWindow.WriteLine("Zombie Hulk: HP = 300, Str = 30, Def = 20, XP drop = 30, Gold drop = 50") TextWindow.WriteLine("Appears on (3,66)") space() TextWindow.WriteLine("Demon General: HP = 500, Str = 35, Def = 25, XP drop = 40, Gold drop = 60") TextWindow.WriteLine("Appears on (6,46)") space() TextWindow.WriteLine("Diablo: HP = 1000, Str = 60, Def = 50, XP drop = 50, Gold drop = 100") TextWindow.WriteLine("Appears on (6,66) and when all previous bosses are defeated") space() space() TextWindow.WriteLine("1. Return") space() space() journal1 =TextWindow.ReadKey() If journal1 = 1 Then TextWindow.Clear() journal() Else TextWindow.Clear() wrongoption() TextWindow.Clear() bossjournal() endif EndSub Sub weaponjournal TextWindow.WriteLine("Weapons") space() space() TextWindow.WriteLine("Bloodletter: Has a 40% chance to siphon the enemy hp and add it to yours") space() TextWindow.WriteLine("Thunderfury, Blessed Blade of the Windseeker: Has a 30% chance to stun the enemy for 1 turn") space() space() TextWindow.WriteLine("1. Return") space() space() journal1 =TextWindow.ReadKey() If journal1 = 1 Then TextWindow.Clear() journal() Else TextWindow.Clear() wrongoption() TextWindow.Clear() weaponjournal() endif EndSub Sub armorjournal TextWindow.WriteLine("Armor") space() space() TextWindow.WriteLine("Spiked Chain Mail: Deals damage every turn to the enemy") space() TextWindow.WriteLine("Electric Plate Armor: Has a 30% chance to stub the enemey for 1 turn") space() space() TextWindow.WriteLine("1. Return") space() space() journal1 =TextWindow.ReadKey() If journal1 = 1 Then TextWindow.Clear() journal() Else TextWindow.Clear() wrongoption() TextWindow.Clear() armorjournal() endif EndSub Sub potionjournal TextWindow.WriteLine("Potions") space() space() TextWindow.WriteLine("Health Potion: Heals for 15 health points.") space() TextWindow.WriteLine("Mana Potion: Gives 15 mana points") space() space() TextWindow.WriteLine("1. Return") space() space() journal1 =TextWindow.ReadKey() If journal1 = 1 Then TextWindow.Clear() journal() Else TextWindow.Clear() wrongoption() TextWindow.Clear() potionjournal() endif EndSub Sub shopjournal TextWindow.WriteLine("Shop and merchants") space() space() TextWindow.WriteLine("A place of commerce where you can buy and sell goods.") TextWindow.WriteLine("You will meet merchants around the world randomly.") space() space() TextWindow.WriteLine("Tristram: Appears on (1,1)") space() TextWindow.WriteLine("Hell Town Shop: Appears on (4,60)") space() space() TextWindow.WriteLine("1. Return") space() space() journal1 =TextWindow.ReadKey() If journal1 = 1 Then TextWindow.Clear() journal() Else TextWindow.Clear() wrongoption() TextWindow.Clear() shopjournal() endif EndSub Sub townjournal TextWindow.WriteLine("Town") space() space() TextWindow.WriteLine("In safe zones you will randomly find potions.") TextWindow.WriteLine("Towns will always have one or two merchants. ") space() space() TextWindow.WriteLine("Tristram: Appears on (1,2),(1,3),(1,4),(1,5),(1,6)") space() TextWindow.WriteLine("Hell Town: Appears on (4,61),(4,62),(4,63),(4,64),(4,65),(4,66)") space() space() TextWindow.WriteLine("1. Return") space() space() journal1 =TextWindow.ReadKey() If journal1 = 1 Then TextWindow.Clear() journal() Else TextWindow.Clear() wrongoption() TextWindow.Clear() townjournal() endif EndSub Sub stats TextWindow.WriteLine("Level: " + level + " Stat Point: " + sp) space() TextWindow.WriteLine("Exp: " + playerxp + " Gold: " + playergold) space() TextWindow.WriteLine("Nephalem Health: " + playerhp + "/" + totalplayerhp + " Nephalem Mana: " + playermp + "/" + totalplayermp) space() space() TextWindow.WriteLine("1. Strength: " + playerstr + " Gives 1 damage per point") TextWindow.WriteLine("2. Vitality: " + playervit + " Gives 5 health per point") TextWindow.WriteLine("3. Armor: " + playerdef + " Reduces 1 damage per point") TextWindow.WriteLine("4. Intelligence: " + playerint + " Gives 3 mana points per point") TextWindow.WriteLine(" ") TextWindow.WriteLine("5. Return") space() staat = TextWindow.ReadKey() If staat = 1 then spiszero() sp = sp - 1 playerstr = playerstr + 1 TextWindow.Clear() stats() elseif staat = 2 then spiszero() sp = sp - 1 playervit = playervit + 1 playervitinc = playervitinc + 5 TextWindow.Clear() stats() elseif staat = 3 then spiszero() sp = sp - 1 playerdef = playerdef + 1 TextWindow.Clear() stats() elseif staat = 4 then spiszero() sp = sp - 1 playerint = playerint +1 playerintinc = playerintinc + 3 TextWindow.Clear() stats() elseIf staat = 5 Then TextWindow.Clear() selectLocation() Else TextWindow.Clear() wrongoption() stats() EndIf endsub Sub spiszero If sp = 0 Then TextWindow.Clear() stats() EndIf EndSub Sub randomencounter town() randomencounter1 = Math.GetRandomNumber(100) If randomencounter1 < 5 then TextWindow.Clear() TextWindow.WriteLine("You have found a Health Potion.") space() enter() hppot = hppot + 1 selectlocation() elseIf randomencounter1 < 10 then TextWindow.Clear() TextWindow.WriteLine("You have found a Mana Potion.") space() enter() mppot = mppot + 1 selectlocation() elseIf randomencounter1 < 30 then TextWindow.Clear() shop() else enemy() EndIf EndSub Sub shop TextWindow.Clear() townshopname2() TextWindow.WriteLine("Shop") space() TextWindow.WriteLine("Gold: " + playergold) space() TextWindow.WriteLine("1. Weapon") TextWindow.WriteLine("2. Armor") TextWindow.WriteLine("3. Potion") space() TextWindow.WriteLine("4. Return") space() shop = TextWindow.ReadKey() if shop = 1 Then TextWindow.Clear() weapons() ElseIf shop = 2 then TextWindow.Clear() armors() elseif shop = 3 Then TextWindow.Clear() potions() elseif shop = 4 then TextWindow.Clear() selectlocation() Else wrongoption() shop() EndIf EndSub Sub potions TextWindow.WriteLine("Health Pot: x" + hppot + " Mana Pot: x" + mppot) space() TextWindow.WriteLine("Gold: " + playergold) space() TextWindow.WriteLine("1. Buy 1 Health Pot for 10 gold") TextWindow.WriteLine("2. Buy 1 Mana Pot for 10 gold") space() TextWindow.WriteLine("3. Sell 1 Health Pot for 5 gold") TextWindow.WriteLine("4. Sell 1 Mana Pot for 5 gold") space() TextWindow.WriteLine("5. Return") space() potion1 = TextWindow.ReadKey() If potion1= 1 Then If playergold < 10 Then TextWindow.Clear() potions() EndIf hppot = hppot + 1 playergold = playergold - 10 TextWindow.Clear() potions() ElseIf potion1= 2 then If playergold < 10 Then TextWindow.Clear() potions() EndIf mppot = mppot + 1 playergold = playergold - 10 TextWindow.Clear() potions() elseif potion1= 3 then If hppot <= 0 then TextWindow.Clear() potions() EndIf playergold = playergold + 5 hppot = hppot - 1 TextWindow.Clear() potions() elseif potion1= 4 then If mppot <= 0 then TextWindow.Clear() potions() EndIf playergold = playergold + 5 mppot = mppot - 1 TextWindow.Clear() potions() elseif potion1 = 5 then TextWindow.Clear() shop() Else wrongoption() potions() EndIf EndSub Sub weapons TextWindow.WriteLine("Gold: " + playergold) space() TextWindow.WriteLine("1. Buy Bloodletter x" + activatevls + " Cost: 50 gold") TextWindow.WriteLine("2. Buy Thunderfury, Blessed Blade of the Windseeker x" + activatelbs + " Cost: 50 gold") TextWindow.WriteLine(" . Buy Grandfather x" + FUNCTION + " Cost: 80 gold") TextWindow.WriteLine(" . Buy Windforce x" + FUNCTION + " Cost: 90 gold") TextWindow.WriteLine(" . Buy Oculus x" + FUNCTION + " Cost: 100 gold") TextWindow.WriteLine(" . Buy Tyrael's Might x" + FUNCTION + " Cost: 100 gold") TextWindow.WriteLine(" . Buy Monster Hunter x" + FUNCTION + " Cost: 100 gold") TextWindow.WriteLine(" . Buy Wildwood x" + FUNCTION + " Cost: 100 gold") TextWindow.WriteLine(" . Buy Doombringer x" + FUNCTION + " Cost: 100 gold") space() TextWindow.WriteLine("3. Return") space() weapon1 = TextWindow.ReadKey() If weapon1= 1 Then If activatevls =1 Then TextWindow.Clear() weapons() EndIf If playergold < 50 Then TextWindow.Clear() weapons() EndIf TextWindow.Clear() TextWindow.WriteLine("You bought the Bloodletter!") activatevls = 1 activatelbs = 0 playergold = playergold - 50 TextWindow.Clear() weapons() elseIf weapon1= 2 Then If activatelbs = 1 Then TextWindow.Clear() weapons() EndIf If playergold < 50 Then TextWindow.Clear() weapons() EndIf TextWindow.Clear() TextWindow.WriteLine("You bought Thunderfury, Blessed Blade of the Windseeker!") activatelbs = 1 activatevls = 0 playergold = playergold - 50 TextWindow.Clear() weapons() elseif weapon1 = 3 then TextWindow.Clear() shop() Else wrongoption() weapons() EndIf EndSub Sub bloodletter If activatevls = 1 then vlschance = Math.GetRandomNumber(100) If vlschance <40 Then vlssiphon = enemyhp/10 weapon = "Bloodletter" enemyhp = enemyhp - vlssiphon playerhp = playerhp + vlssiphon space() TextWindow.WriteLine("Bloodletter siphons " + vlssiphon + " Health Points") Else endif playerhpormpoverhun() endif EndSub Sub playerhpormpoverhun If playerhp > 100 Then playerhp = totalplayerhp EndIf If playermp > 30 Then playermp = totalplayermp endif EndSub Sub thunderfury If activatelbs = 1 then lbschance = Math.GetRandomNumber(100) lbsstun() EndIf EndSub Sub lbsstun stun = 0 If lbschance <30 Then weapon = "Thunderfury, Blessed Blade of the Windseeker" stun = stun + 1 Else EndIf if stun > 0 then stun = stun - 1 playerattackstun() If enemyhp <= 0 Then TextWindow.Clear() EndIf Else EndIf EndSub sub playerattackstun space() TextWindow.WriteLine(enemyname + " is stuned for 1 turn.") spikechainmail() enemyhp = enemyhp - playerstr space() enter() battle() endsub sub spellfreeze space() TextWindow.WriteLine(enemyname + " is frozen for 1 turn.") spikechainmail() enemyhp = enemyhp - playerstr space() enter() battle() endsub Sub armors TextWindow.WriteLine("Gold: " + playergold) space() TextWindow.WriteLine("1. Spiked Chain Mail x" + activatescm + " Cost: 50 gold") TextWindow.WriteLine("2. Electric Plate Armor x" + activateepa + " Cost: 50 gold") space() TextWindow.WriteLine("3. Return") space() armor1 = TextWindow.ReadKey() If armor1= 1 Then If activatescm =1 Then TextWindow.Clear() armors() EndIf If playergold < 50 Then TextWindow.Clear() armors() EndIf TextWindow.Clear() TextWindow.WriteLine("You bought the Spiked Chain Mail!") activatescm = 1 activateepa = 0 playergold = playergold - 50 TextWindow.Clear() armors() elseIf armor1= 2 Then If activateepa =1 Then TextWindow.Clear() armors() EndIf If playergold < 50 Then TextWindow.Clear() armors() EndIf TextWindow.Clear() TextWindow.WriteLine("You bought the Electric Plate Armor!") activateepa = 1 activatescm = 0 playergold = playergold - 50 TextWindow.Clear() armors() elseif armor1 = 3 then TextWindow.Clear() shop() Else wrongoption() armors() EndIf EndSub Sub spikechainmail If activatescm = 1 then spikechainmaildmg = totalenemyhp/25 space() TextWindow.WriteLine(armor + " deals " + spikechainmaildmg + " dmg.") enemyhp = enemyhp - spikechainmaildmg Else endif endsub Sub electricplatearmor If activateepa = 1 then epachance = Math.GetRandomNumber(100) epastun() EndIf EndSub Sub epastun stun = 0 If epachance <30 Then armor = "Electric Plate Armor" stun = stun + 1 Else EndIf if stun > 0 then stun = stun - 1 epaarmorstun() If enemyhp <= 0 Then TextWindow.Clear() EndIf Else EndIf EndSub sub epaarmorstun space() enemyhp = enemyhp - playerstr TextWindow.WriteLine(enemyname + " is stuned for 1 turn.") space() enter() battle() endsub Sub weaponname If activatevls = 1 then weapon = "Bloodletter" EndIf If activatelbs = 1 then weapon = "Thunderfury, Blessed Blade of the Windseeker" endif EndSub Sub armorname If activatescm = 1 then armor = "Spiked Chain Mail" EndIf If activateepa = 1 then armor = "Electric Plate Armor" EndIf EndSub Sub selectlocationinventory playerhpormpoverhun() If hppot < 1 Then TextWindow.Clear() selectlocationinventory() ElseIf mppot < 1 then TextWindow.Clear() selectlocationinventory() EndIf TextWindow.WriteLine("Nephalem Health: " + playerhp + "/" + totalplayerhp+ " Nephalem Mana: " + playermp + "/" + totalplayermp) space() TextWindow.WriteLine("1. Use Health Potion x" + hppot) TextWindow.WriteLine("2. Use Mana Potion x" +mppot) TextWindow.WriteLine(" . Use Rejuvenation Potion x" +rjpot) space() TextWindow.WriteLine("3. Return") space() inventory1 = TextWindow.ReadKey() If inventory1 = 1 Then If playerhp = 100 Then TextWindow.Clear() selectlocationinventory() endif space() TextWindow.WriteLine("You gained 15 Health Points") space() playerhp = playerhp + 15 hppot = hppot - 1 enter() selectlocationinventory() elseIf inventory1 = 2 Then If playermp = 30 Then TextWindow.Clear() selectlocationinventory() endif space() TextWindow.WriteLine("You gained 15 Mana Points") space() playermp = playermp + 15 mppot = mppot - 1 enter() selectlocationinventory() elseif inventory1 = 3 then TextWindow.Clear() selectlocation() EndIf EndSub Sub misc TextWindow.Clear() TextWindow.WriteLine("1. Save") TextWindow.WriteLine("2. Load") TextWindow.WriteLine("3. Return") TextWindow.WriteLine("4. Exit") space() misc1 = TextWindow.ReadKey() If misc1 = 1 Then Save_game() TextWindow.Clear() TextWindow.WriteLine("Your game has been saved.") space() enter() Program.End() ElseIf misc1 = 2 then TextWindow.Clear() ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' ' variables = File.ReadContents(path) load_game() selectlocation() elseif misc1 = 4 then Program.End() ElseIf misc1 = 3 then TextWindow.Clear() selectlocation() Else wrongoption() misc() EndIf EndSub Sub enemy TextWindow.Clear() If x = 6 And y = 66 and activatedg = 1 And activatesk = 1 And activatezh = 1 Then Diablo() TextWindow.WriteLine("You encountered " + enemyname +".") space() enter() battle() ElseIf x = 6 and y = 46 then demongeneral() TextWindow.WriteLine("You encountered " + enemyname +".") space() enter() battle() elseif x = 3 and y = 66 then zombiehulk() TextWindow.WriteLine("You encountered " + enemyname +".") space() enter() battle() elseif x = 9 and y = 66 then skeletonking() battle() endif enemy1 = Math.GetRandomNumber(100) If enemy1 < 40 Then skeleton() TextWindow.WriteLine("You encountered a " + enemyname +".") space() enter() battle() ElseIf enemy1 <70 then zombie() TextWindow.WriteLine("You encountered a " + enemyname +".") space() enter() battle() elseif enemy1 <100 then demon() TextWindow.WriteLine("You encountered a " + enemyname +".") space() enter() battle() EndIf EndSub Sub battle If playerhp<=0Then defeat() EndIf If enemyhp <= 0 Then mobwin() EndIf TextWindow.Clear() weaponname() armorname() TextWindow.WriteLine(enemyname ) space() TextWindow.WriteLine("Nephalem Helth: " + playerhp + "/" + totalplayerhp+ " Nephalem Mana: " + playermp + "/" + totalplayermp) space() TextWindow.WriteLine(enemyname + ": " + enemyhp +"/" + totalenemyhp) space() TextWindow.WriteLine("1. Use your " + weapon) TextWindow.WriteLine("2. Inventory") TextWindow.WriteLine("3. Skills") TextWindow.WriteLine("4. Run Away") TextWindow.WriteLine("5. Do Nothing(Skip Turn)") space() battle1 = TextWindow.ReadKey() If battle1 = 1 Then playerattack() ElseIf battle1 = 2 then TextWindow.Clear() inventory() elseif battle1 = 3 then TextWindow.Clear() skill() elseif battle1 = 4 then runaway1 = Math.GetRandomNumber(2) If runaway1 =1 then space() TextWindow.WriteLine(enemyname + " attacked your back and dealt " + enemystr+".") playerhp = playerhp - enemystr space() enter() battle() Else TextWindow.Clear() selectlocation() EndIf elseif battle1 = 5 then TextWindow.WriteLine(enemyname + " attacked and dealt " + enemystr+".") playerhp = playerhp - enemystr space() enter() battle() Else wrongoption() battle() endif EndSub Sub inventory playerhpormpoverhun() If hppot < 1 Then TextWindow.Clear() selectlocationinventory() ElseIf mppot < 1 then TextWindow.Clear() selectlocationinventory() EndIf TextWindow.WriteLine("Nephalem Health: " + playerhp + "/" + totalplayerhp+ " Nephalem Mana: " + playermp + "/" + totalplayermp) space() TextWindow.WriteLine("1. Use Health Potion x" + hppot) TextWindow.WriteLine("2. Use Mana Potion x" + mppot) TextWindow.WriteLine(" . Use Rejuvenation Potion x" + rjpot) space() TextWindow.WriteLine("3. Return") space() inventory1 = TextWindow.ReadKey() If inventory1 = 1 Then If playerhp = 100 Then TextWindow.Clear() inventory() endif space() TextWindow.WriteLine("You gained 15 Health Points") space() TextWindow.WriteLine(enemyname + " attacked and dealt " + enemystr+".") playerhp = playerhp - enemystr playerhp = playerhp + 15 hppot = hppot -1 enter() inventory() elseIf inventory1 = 2 Then If playermp = 30 Then TextWindow.Clear() inventory() endif space() TextWindow.WriteLine("You gained 15 Mana Points") space() TextWindow.WriteLine(enemyname + " attacked and dealt " + enemystr+".") playerhp = playerhp - enemystr playermp = playermp + 15 mppot = mppot - 1 enter() inventory() elseif inventory1 = 3 then TextWindow.Clear() battle() EndIf EndSub Sub skill If playerhp<=0Then defeat() EndIf If enemyhp <= 0 Then mobwin() EndIf If playermp <= 0 Then TextWindow.Clear() battle() EndIf TextWindow.WriteLine("Nephalem Health: " + playerhp + "/" + totalplayerhp+ " Nephalem Mana: " + playermp + "/" + totalplayermp) TextWindow.WriteLine(enemyname + ": " + enemyhp +"/" + totalenemyhp) space() TextWindow.WriteLine("1. Instant Critical strike Cost: 5 Mana") TextWindow.WriteLine("2. Heal Cost: 5 Mana") TextWindow.WriteLine("3. Cast a powerfull spell| NEED SUB MENU/FUNCTIONS!") space() TextWindow.WriteLine("3. Return") space() skill1 = TextWindow.ReadKey() space() If skill1 = 1 Then TextWindow.WriteLine("You dealt " + (playerstr *1.5)) space() TextWindow.WriteLine(enemyname + " attacked and dealt " + enemystr+".") space() playerhp = playerhp - enemystr enemyhp = enemyhp - (playerstr*1.5) playermp = playermp - 5 enter() skill() ElseIf skill1 = 2 then TextWindow.WriteLine("You healed yourself for 50 health points.") space() TextWindow.WriteLine(enemyname + " attacked and dealt " + enemystr+".") space() playerhp = playerhp - enemystr enter() playerhp = playerhp + 50 playermp = playermp - 5 playerhpormpoverhun() skill() elseif skill1 = 3 then TextWindow.Clear() battle() Else wrongoption() EndIf EndSub sub playerattack space() TextWindow.WriteLine("You attacked and dealt " +playerstr + " dmg.") bloodletter() thunderfury() spikechainmail() electricplatearmor() space() TextWindow.WriteLine(enemyname + " attacked and dealt " + enemystr+" dmg.") enemyhp = enemyhp - playerstr playerhp = playerhp - enemystr space() enter() battle() endsub Sub diabloactivate If x = 6 and y = 46 then activatedg = 1 elseif x = 3 and y = 66 then activatezh = 1 elseif x = 9 and y = 66 then activatesk = 1 EndIf EndSub sub mobwin TextWindow.Clear() diabloactivate() TextWindow.WriteLine("You have defeated " + enemyname + ",mortal") space() TextWindow.WriteLine("You gained " + xpdrop + " experience.") TextWindow.WriteLine("You gained " + golddrop + " gold.") playerxp = playerxp + xpdrop playergold = playergold + golddrop space() enter() selectlocation() EndSub Sub defeat TextWindow.Clear() TextWindow.WriteLine("You have been defeated by " + enemyname + ".") TextWindow.WriteLine("Your deeds of valor shall be remembered.") enter() Program.End() EndSub End>LLV523.sb< Start>LLX858.sb< ' Infrared simulation ' program by par Yvan Leduc - May 22th 2016 ' program no: HSQ291 GraphicsWindow.Title = " I N F R A R E D simulation" GraphicsWindow.top= 0 GraphicsWindow.left= 0 GraphicsWindow.Height=200 GraphicsWindow.Width=300 GraphicsWindow.BackgroundColor="BLACK" image=ImageList.LoadImage("https://rstorage.filemobile.com/storage/25388938/15") ' common bee image GraphicsWindow.DraWresizedImage(image,0,0,300,200) For y = 1 To 200 For x= 1 To 300 hex=graphicswindow.GetPixel(x,y) RED() GREEN() BLUE() ' here is my formula for infrared bw simulation hR=MATH.Floor(Math.Abs((R-B)*0.45)) hG=MATH.Floor(Math.Abs(G*15)) hB=MATH.Floor(Math.Abs((B-R)*0.45)) GV=(hR+hG+hB)/10 If GV > 255 Then GV=255 ElseIf GV < 0 then GV=1 EndIf GREY_value=GraphicsWindow.GetColorFromRGB (GV,GV,GV) GraphicsWindow.SetPixel(x,y,GREY_value) Endfor EndFor Sound.PlayBellRing() ' ************************** END OF PROGRAMME *************************************************** Sub RED R[1]=Text.GetSubText(hex, 2, 1) R[2]=Text.GetSubText(hex, 3, 1) For H = 1 To 2 If R[H]="A" THEN R[H]=10 elseIf R[H]="B" THEN R[H]=11 elseIf R[H]="C" THEN R[H]=12 ElseIf R[H]="D" THEN R[H]=13 elseIf R[H]="E" THEN R[H]=14 elseIf R[H]="F" THEN R[H]=15 EndIf EndFor R= (R[2]* Math.Power(16,0))+ (R[1]* Math.Power(16,1)) EndSub Sub GREEN G[1]=Text.GetSubText(hex, 2, 1) G[2]=Text.GetSubText(hex, 3, 1) For H = 1 To 2 If G[H]="A" THEN G[H]=10 elseIf G[H]="B" THEN G[H]=11 elseIf G[H]="C" THEN G[H]=12 ElseIf G[H]="D" THEN G[H]=13 elseIf G[H]="E" THEN G[H]=14 elseIf G[H]="F" THEN G[H]=15 EndIf EndFor G= (G[2]* Math.Power(16,0))+ (G[1]* Math.Power(16,1)) EndSub Sub BLUE B[1]=Text.GetSubText(hex, 2, 1) B[2]=Text.GetSubText(hex, 3, 1) For H = 1 To 2 If B[H]="A" THEN B[H]=10 elseIf B[H]="B" THEN B[H]=11 elseIf B[H]="C" THEN B[H]=12 ElseIf B[H]="D" THEN B[H]=13 elseIf B[H]="E" THEN B[H]=14 elseIf B[H]="F" THEN B[H]=15 EndIf EndFor B= (B[2]* Math.Power(16,0))+ (B[1]* Math.Power(16,1)) EndSub End>LLX858.sb< Start>LMB722.sb< Ang = 45 AddLine() Sorce = "x=100;y=300" Bulb = Shapes.AddImage("http://sean.alyrica.net/LightBulb.png") Shapes.Move(Bulb,Sorce["x"] - 28,Sorce["y"] + 5) GraphicsWindow.PenColor = "Yellow" GraphicsWindow.DrawLine(100,100,Sorce["x"],Sorce["y"]) GraphicsWindow.KeyDown = Kd Angle = Ang + Ang GetAngle() AddLine2() Sub GetAngle x = 400 * Math.Cos(Math.GetRadians(Angle + 270)) + 100 y = 400 * Math.Sin(Math.GetRadians(Angle + 270)) + 100 EndSub Sub AddLine GraphicsWindow.PenColor = "Black" Shapes.Remove(Line) x1 = 40 * Math.Cos(Math.GetRadians(Ang + 90)) + 100 y1 = 40 * Math.Sin(Math.GetRadians(Ang + 90)) + 100 x2 = 40 * Math.Cos(Math.GetRadians(Ang - 90)) + 100 y2 = 40 * Math.Sin(Math.GetRadians(Ang - 90)) + 100 Line = Shapes.AddLine(x1,y1,x2,y2) EndSub Sub Kd If GraphicsWindow.LastKey = "Up" And Ang > 0 Then Ang = Ang - 1 AddLine() AddLine2() EndIf If GraphicsWindow.LastKey = "Down" And Ang < 90 Then Ang = Ang + 1 AddLine() AddLine2() EndIf EndSub Sub AddLine2 GraphicsWindow.PenColor = "Yellow" Angle = Ang + Ang GetAngle() Shapes.Remove(Line2) Line2 = Shapes.AddLine(100,100,x,y) EndSub End>LMB722.sb< Start>LMD288.sb< GraphicsWindow.BackgroundColor = "DarkBlue" Ball = Shapes.AddEllipse(100, 100) GraphicsWindow.BrushColor = "White" Mouse.HideCursor() TextThing = Shapes.AddText(0) GraphicsWindow.MouseMove = OnMouseMove Sub OnMouseMove Shapes.SetText(TextThing, "X=" + (GraphicsWindow.MouseX) + " Y=" + (GraphicsWindow.MouseY)) Shapes.Move(Ball, GraphicsWindow.MouseX - 50, GraphicsWindow.MouseY - 50) Shapes.Move(TextThing, GraphicsWindow.MouseX - 43, GraphicsWindow.MouseY - 6) EndSub End>LMD288.sb< Start>LMK953-0.sb< GraphicsWindow.Hide() gw = 1000 gh = 580 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.CanResize = "false" GraphicsWindow.Title = "Moving Soccerball" GraphicsWindow.Top = 4 GraphicsWindow.Left = (Desktop.Width - gw) / 2 sceneryImage = ImageList.LoadImage(Program.Directory + "/Grass Scenery.jpg") soccerballImage = ImageList.LoadImage(Program.Directory + "/football2.png") GraphicsWindow.DrawResizedImage(sceneryImage, 0, 0, gw, gh) ball = Shapes.AddImage(soccerballImage) radius = (ImageList.GetWidthOfImage(soccerballImage)) / 2 GraphicsWindow.Show() x = 1 y = 1 displaceX = 0 ' Start stationary displaceY = 0 spin = 1 dt = 1 'Frame updtate time slope = Math.Arctan(1/5) ' 1 in 5 slope gravity = 0.001 ' Gravity acceleration down While "true" 'Bounce by reversing slope angle, Xvelocity and spin If x < 0 Or x > gw - radius * 2 Then spin = -spin 'This is just the direction of spin slope = -slope displaceX = -displaceX EndIf 'Update acceleration depending on slope Acceleration = gravity*Math.Sin(slope)*dt 'In direction of slope accX = Acceleration*Math.Cos(slope) accY = Acceleration*Math.Sin(slope) 'Update velocity displaceX = displaceX + accX*dt displaceY = displaceY + accY*dt Velocity = Math.SquareRoot(displaceX*displaceX + displaceY*displaceY)*dt ' total velocity in direction moving (speed) 'Update position x = x + displaceX*dt y = y + displaceY*dt Distance = Velocity*dt 'Distance travelled down slope in this step 'Update angle angle = angle + spin*360*Distance/(2*Math.pi*radius) ' Fraction of a full rotation in degrees 'Do the redraws Shapes.Rotate(ball, angle) Shapes.Move(ball, x, y) Program.Delay(2) EndWhile End>LMK953-0.sb< Start>LMK953.sb< GraphicsWindow.Hide() gw = 1000 gh = 580 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.CanResize = "false" GraphicsWindow.Title = "Moving Soccerball" GraphicsWindow.Top = 4 GraphicsWindow.Left = (Desktop.Width - gw) / 2 sceneryImage = ImageList.LoadImage(Program.Directory + "/Grass Scenery.jpg") soccerballImage = ImageList.LoadImage(Program.Directory + "/Soccerball.png") GraphicsWindow.DrawResizedImage(sceneryImage, 0, 0, gw, gh) ball = Shapes.AddImage(soccerballImage) radius = (ImageList.GetWidthOfImage(soccerballImage)) / 2 GraphicsWindow.Show() x = 1 y = 1 displaceX = 1 displaceY = 0 spin = 1 While "true" If x > gw - radius * 2 Then spin = -1 displaceX = -1 displaceY = 0.1 EndIf If x < 0 Then spin = 1 displaceX = 1 displaceY = 0.1 EndIf x = x + displaceX y = y + displaceY angle = angle + spin Shapes.Rotate(ball, angle) Shapes.Move(ball, x, y) Program.Delay(2) EndWhile End>LMK953.sb< Start>LML124.sb< topOffset = 0 'space to add something later Initialise() While "True" If buttonClicked Then lastButtonClicked = Controls.GetButtonCaption(Controls.LastClickedButton) If lastButtonClicked = "C" Then toggleConfiguration = -toggleConfiguration If toggleConfiguration = 1 Then ' The following line could be harmful and has been automatically commented. ' ctrl = File.ReadLine(File.GetSettingsFilePath(), 1) If ctrl = "" Then ctrl = "size=30;space=10;btnRows=4;btnColumns=3" EndIf GraphicsWindow.FontSize = defaultFontSize * (ctrl["size"]/30) GraphicsWindow.Title = defaultTitle Else ' The following line could be harmful and has been automatically commented. ' ctrl = File.ReadLine(File.GetSettingsFilePath(), 2) If ctrl = "" Then ctrl = "size=40;space=15;btnRows=2;btnColumns=9" EndIf GraphicsWindow.FontSize = defaultFontSize * (ctrl["size"]/30) GraphicsWindow.Title = "Big" EndIf UpdateGW() RemoveControls() AddControls() number = "" Else number = Text.Append(number, lastButtonClicked) Controls.SetTextBoxText(txtBox, number) EndIf buttonClicked = "False" EndIf Program.Delay(100) EndWhile Sub Initialise toggleConfiguration = 1 GraphicsWindow.CanResize = "False" defaultBrushColour = GraphicsWindow.BrushColor defaultFontSize = GraphicsWindow.FontSize defaultTitle = GraphicsWindow.Title ' The following line could be harmful and has been automatically commented. ' ctrl = File.ReadLine(File.GetSettingsFilePath(), 1) If ctrl = "" Then 'configure ctrl = "size=40;space=15;btnRows=2;btnColumns=9" ' The following line could be harmful and has been automatically commented. ' File.WriteLine(File.GetSettingsFilePath(), 2, ctrl) ctrl = "size=30;space=10;btnRows=4;btnColumns=3" '4,3 2,9 ' The following line could be harmful and has been automatically commented. ' File.WriteLine(File.GetSettingsFilePath(), 1, ctrl) EndIf UpdateGW() AddControls() Controls.ButtonClicked = OnButtonClicked EndSub Sub OnButtonClicked buttonClicked = "True" EndSub Sub UpdateGW gw = ctrl["size"] * ctrl["btnColumns"] + ctrl["space"] * (ctrl["btnColumns"]+1) GraphicsWindow.Width = gw gh = ctrl["size"] * (ctrl["btnRows"]+1) + ctrl["space"] * (ctrl["btnRows"]+2) + topOffset GraphicsWindow.Height = gh EndSub Sub AddControls txtBox = Controls.AddTextBox(ctrl["space"], ctrl["space"] + topOffset) width = ctrl["size"]*ctrl["btnColumns"] + ctrl["space"]*(ctrl["btnColumns"]-1) Controls.SetSize(txtBox, width, ctrl["size"]) For r = ctrl["btnRows"]-1 To 1 Step -1 'rows 3 to 1 top = (r-1) * (ctrl["size"] + ctrl["space"]) + ctrl["space"]*2 + ctrl["size"] + topOffset For c = 1 To ctrl["btnColumns"] left = (c-1) * (ctrl["size"] + ctrl["space"]) + ctrl["space"] i = i + 1 button[i] = Controls.AddButton(i, left, top) Controls.SetSize(button[i], ctrl["size"], ctrl["size"]) EndFor EndFor top = ctrl["space"]*(ctrl["btnRows"]+1) + ctrl["size"]*ctrl["btnRows"] + topOffset button[10] = Controls.AddButton(0, ctrl["space"], top) width = ctrl["size"]*(ctrl["btnColumns"]-1) + ctrl["space"]*(ctrl["btnColumns"]-2) Controls.SetSize(button[10], width, ctrl["size"]) GraphicsWindow.BrushColor = "Red" left = ctrl["space"]*ctrl["btnColumns"] + ctrl["size"]*(ctrl["btnColumns"]-1) button[11] = Controls.AddButton("C", left, top) Controls.SetSize(button[11], ctrl["size"], ctrl["size"]) GraphicsWindow.BrushColor = defaultBrushColour EndSub Sub RemoveControls For i = Array.GetItemCount(button) To 1 Step -1 Controls.Remove(button[i]) EndFor Controls.Remove(txtBox) EndSub End>LML124.sb< Start>LML762-1.sb< ' Old Japan Color Name Pallet by naochanON LML762 GraphicsWindow.MouseMove=Onmousemove OldJapanColorName() Pallet() Sub onmousemove MX= GraphicsWindow.MouseX MY= GraphicsWindow.MouseY MI=math.Floor(MX/40)+1 MJ=Math.Floor(MY/35)+1 NN= MI+(MJ-1)*25 GraphicsWindow.Title=NN+ "Color Name= "+c[NN][2] EndSub Sub Pallet GraphicsWindow.Width=1000 GraphicsWindow.Height=700 For N=1 To 465 i= Math.Remainder((N-1),25) j= Math.Floor((N-1)/25) GraphicsWindow.BrushColor=c[N][1] GraphicsWindow.FillRectangle(i*40,j*35,40,35) EndFor endsub Sub OldJapanColorName C[1]="1=#FEF4F4;2=桜色さくらいろ" C[2]="1=#FDEFF2;2=薄桜うすざくら" C[3]="1=#E9DFE5;2=桜鼠さくらねず" C[4]="1=#E4D2D8;2=鴇鼠ときねず" C[5]="1=#F6BFBC;2=虹色にじいろ" C[6]="1=#F5B1AA;2=珊瑚色さんごいろ" C[7]="1=#F5B199;2=一斤染いっこんぞめ" C[8]="1=#EFAB93;2=宍色ししいろ" C[9]="1=#F2A0A1;2=紅梅色こうばいいろ" C[10]="1=#F0908D;2=薄紅うすべに" C[11]="1=#EE827C;2=甚三紅じんざもみ" C[12]="1=#F09199;2=桃色ももいろ" C[13]="1=#F4B3C2;2=鴇色ときいろ" C[14]="1=#EEBBCB;2=撫子色なでしこいろ" C[15]="1=#E8D3C7;2=灰梅はいうめ" C[16]="1=#E8D3D1;2=灰桜はいざくら" C[17]="1=#E6CDE3;2=淡紅藤あわべにふじ" C[18]="1=#E5ABBE;2=石竹色せきちくいろ" C[19]="1=#E597B2;2=薄紅梅うすこうばい" C[20]="1=#E198B4;2=桃花色ももはないろ" C[21]="1=#E4AB9B;2=水柿みずがき" C[22]="1=#E09E87;2=ときがら茶ときがらちゃ" C[23]="1=#D69090;2=退紅あらぞめ" C[24]="1=#D4ACAD;2=薄柿うすがき" C[25]="1=#C97586;2=長春色ちょうしゅんいろ" C[26]="1=#C099A0;2=梅鼠うめねず" C[27]="1=#B88884;2=鴇浅葱ときあさぎ" C[28]="1=#B48A76;2=梅染うめぞめ" C[29]="1=#A86965;2=蘇芳香すおうこう" C[30]="1=#A25768;2=浅蘇芳あさすおう" C[31]="1=#EC6D71;2=真朱まそお" C[32]="1=#EB6EA5;2=赤紫あかむらさき" C[33]="1=#E95295;2=躑躅色つつじいろ" C[34]="1=#E7609E;2=牡丹色ぼたんいろ" C[35]="1=#D0576B;2=今様色いまよういろ" C[36]="1=#C85179;2=中紅なかべに" C[37]="1=#E9546B;2=薔薇色ばらいろ" C[38]="1=#E95464;2=韓紅からくれない" C[39]="1=#C85554;2=銀朱ぎんし���" C[40]="1=#C53D43;2=赤紅あかべに" C[41]="1=#E83929;2=紅緋べにひ" C[42]="1=#E60033;2=赤あか" C[43]="1=#E2041B;2=猩々緋しょうじょうひ" C[44]="1=#D7003A;2=紅くれない" C[45]="1=#C9171E;2=深緋こきひ" C[46]="1=#D3381C;2=緋色ひいろ" C[47]="1=#CE5242;2=赤丹あかに" C[48]="1=#D9333F;2=紅赤べにあか" C[49]="1=#B94047;2=臙脂えんじ" C[50]="1=#BA2636;2=朱・緋あけ" C[51]="1=#B7282E;2=茜色あかねいろ" C[52]="1=#A73836;2=紅海老茶べにえびちゃ" C[53]="1=#9E3D3F;2=蘇芳すおう" C[54]="1=#A22041;2=真紅しんく" C[55]="1=#A22041;2=濃紅こいくれない" C[56]="1=#F8F4E6;2=象牙色ぞうげいろ" C[57]="1=#EDE4CD;2=練色ねりいろ" C[58]="1=#E9E4D4;2=灰白色かいはくしょく" C[59]="1=#EBE1A9;2=蒸栗色むしぐりいろ" C[60]="1=#F2F2B0;2=女郎花おみなえし" C[61]="1=#E4DC8A;2=枯草色かれくさいろ" C[62]="1=#F8E58C;2=淡黄たんこう" C[63]="1=#DDBB99;2=白茶しらちゃ" C[64]="1=#D7A98C;2=赤白橡あかしろつるばみ" C[65]="1=#F2C9AC;2=洗柿あらいがき" C[66]="1=#FFF1CF;2=鳥の子色とりのこいろ" C[67]="1=#FDDEA5;2=蜂蜜色はちみついろ" C[68]="1=#FCE2C4;2=肌色はだいろ" C[69]="1=#FDE8D0;2=薄卵色うすたまごいろ" C[70]="1=#F9C89B;2=雄黄ゆうおう" C[71]="1=#F7BD8F;2=洒落柿しゃれがき" C[72]="1=#F6B894;2=赤香あかこう" C[73]="1=#F4DDA5;2=砥粉色とのこいろ" C[74]="1=#F1BF99;2=肉色にくいろ" C[75]="1=#F1BF99;2=人色ひといろ" C[76]="1=#EFCD9A;2=丁子色ちょうじいろ" C[77]="1=#EFCD9A;2=香色こういろ" C[78]="1=#F0CFA0;2=薄香うすこう" C[79]="1=#EDD3A1;2=浅黄うすき" C[80]="1=#E0C38C;2=枯色かれいろ" C[81]="1=#F3BF88;2=淡香うすこう" C[82]="1=#F7B977;2=杏色あんずいろ" C[83]="1=#F19072;2=東雲色しののめいろ" C[84]="1=#F19072;2=曙色あけぼのいろ" C[85]="1=#EE836F;2=珊瑚朱色さんごしゅいろ" C[86]="1=#EB9B6F;2=深支子こきくちなし" C[87]="1=#E0815E;2=そひ" C[88]="1=#DF7163;2=浅緋うすきひ" C[89]="1=#D57C6B;2=真赭まそほ" C[90]="1=#D0826C;2=洗朱あらいしゅ" C[91]="1=#CA8269;2=遠州茶えんしゅうちゃ" C[92]="1=#BB5548;2=紅樺色べにかばいろ" C[93]="1=#AB6953;2=赭そほ" C[94]="1=#96514D;2=小豆色あずきいろ" C[95]="1=#8D6449;2=枯茶からちゃ" C[96]="1=#DEB068;2=飴色あめいろ" C[97]="1=#BF794E;2=駱駝色らくだいろ" C[98]="1=#BC763C;2=土色つちいろ" C[99]="1=#B98C46;2=黄唐茶きがらちゃ" C[100]="1=#B79B5B;2=桑染くわぞめ" C[101]="1=#B77B57;2=櫨���はじいろ" C[102]="1=#B68D4C;2=黄橡きつるばみ" C[103]="1=#AD7D4C;2=丁字染ちょうじぞめ" C[104]="1=#AD7D4C;2=香染こうぞめ" C[105]="1=#AE7C4F;2=枇杷茶びわちゃ" C[106]="1=#AD7E4E;2=芝翫茶しかんちゃ" C[107]="1=#AE7C58;2=焦香こがれこう" C[108]="1=#A86F4C;2=胡桃色くるみいろ" C[109]="1=#946243;2=渋紙色しぶかみいろ" C[110]="1=#917347;2=朽葉色くちばいろ" C[111]="1=#956F29;2=桑茶くわちゃ" C[112]="1=#8C7042;2=路考茶ろこうちゃ" C[113]="1=#7B6C3E;2=国防色こくぼうしょく" C[114]="1=#D8A373;2=伽羅色きゃらいろ" C[115]="1=#CD8C5C;2=江戸茶えどちゃ" C[116]="1=#CD5E3C;2=樺色かばいろ" C[117]="1=#CB8347;2=紅鬱金べにうこん" C[118]="1=#C37854;2=土器色かわらけいろ" C[119]="1=#C38743;2=狐色きつねいろ" C[120]="1=#C39143;2=黄土色おうどいろ" C[121]="1=#BF783A;2=琥珀色こはくいろ" C[122]="1=#BB5535;2=赤茶あかちゃ" C[123]="1=#BB5520;2=代赭たいしゃ" C[124]="1=#B55233;2=煉瓦色れんがいろ" C[125]="1=#AA4F37;2=雀茶すずめちゃ" C[126]="1=#9F563A;2=団十郎茶だんじゅうろうちゃ" C[127]="1=#9F563A;2=柿渋色かきしぶいろ" C[128]="1=#9A493F;2=紅鳶べにとび" C[129]="1=#98623C;2=灰茶はいちゃ" C[130]="1=#965042;2=茶色ちゃいろ" C[131]="1=#965036;2=檜皮色ひわだいろ" C[132]="1=#95483F;2=鳶色とびいろ" C[133]="1=#954E2A;2=柿茶かきちゃ" C[134]="1=#8F2E14;2=弁柄色べんがらいろ" C[135]="1=#8A3319;2=赤錆色あかさびいろ" C[136]="1=#8A3B00;2=褐色かっしょく" C[137]="1=#852E19;2=栗梅くりうめ" C[138]="1=#7B4741;2=紅檜皮べにひはだ" C[139]="1=#773C30;2=海老茶えびちゃ" C[140]="1=#783C1D;2=唐茶からちゃ" C[141]="1=#762F07;2=栗色くりいろ" C[142]="1=#752100;2=赤銅色しゃくどういろ" C[143]="1=#6C3524;2=錆色さびいろ" C[144]="1=#683F36;2=赤褐色せっかっしょく" C[145]="1=#664032;2=茶褐色ちゃかっしょく" C[146]="1=#6D3C32;2=栗皮茶くりかわちゃ" C[147]="1=#583822;2=黒茶くろちゃ" C[148]="1=#6C2C2F;2=葡萄茶えびちゃ" C[149]="1=#640125;2=葡萄色えびいろ" C[150]="1=#F8B862;2=萱草色かんぞういろ" C[151]="1=#F6AD49;2=柑子色こうじいろ" C[152]="1=#F39800;2=金茶きんちゃ" C[153]="1=#F08300;2=蜜柑色みかんいろ" C[154]="1=#EC6D51;2=鉛丹色えんたんいろ" C[155]="1=#EE7948;2=黄丹おうに" C[156]="1=#ED6D3D;2=柿色かきいろ" C[157]="1=#EC6800;2=黄赤きあか" C[158]="1=#EC6800;2=人参色にんじんいろ" C[159]="1=#EE7800;2=橙色だいだいいろ" C[160]="1=#EB6238;2=照柿てりがき" C[161]="1=#EA5506;2=赤橙あかだいだい" C[162]="1=#EA5506;2=金赤きんあか" C[163]="1=#EB6101;2=朱色しゅいろ" C[164]="1=#E49E61;2=小麦色こむぎいろ" C[165]="1=#E45E32;2=丹色にいろ" C[166]="1=#E17B34;2=黄茶きちゃ" C[167]="1=#DD7A56;2=肉桂色にっけいいろ" C[168]="1=#DB8449;2=赤朽葉色あかくちばいろ" C[169]="1=#D66A35;2=黄櫨染こうろぜん" C[170]="1=#FFD900;2=蒲公英色たんぽぽいろ" C[171]="1=#FFD900;2=黄色きいろ" C[172]="1=#FFEA00;2=中黄ちゅうき" C[173]="1=#FFEC47;2=菜の花色なのはないろ" C[174]="1=#FEF263;2=黄檗色きはだいろ" C[175]="1=#FCD575;2=卵色たまごいろ" C[176]="1=#FBD26B;2=花葉色はなばいろ" C[177]="1=#F5E56B;2=刈安色かりやすいろ" C[178]="1=#EEC362;2=玉蜀黍色とうもろこしいろ" C[179]="1=#EBD842;2=金糸雀色かなりあいろ" C[180]="1=#FFDB4F;2=黄支子色きくちなしいろ" C[181]="1=#FBCA4D;2=支子色くちなしいろ" C[182]="1=#FCC800;2=向日葵色ひまわりいろ" C[183]="1=#F8B500;2=山吹色やまぶきいろ" C[184]="1=#FABF14;2=鬱金色うこんいろ" C[185]="1=#F7C114;2=藤黄とうおう" C[186]="1=#E6B422;2=金色こんじき" C[187]="1=#E6B422;2=黄金こがね" C[188]="1=#D9A62E;2=櫨染はじぞめ" C[189]="1=#D3A243;2=黄朽葉色きくちばいろ" C[190]="1=#C89932;2=山吹茶やまぶきちゃ" C[191]="1=#D0AF4C;2=芥子色からしいろ" C[192]="1=#8B968D;2=豆がら茶まめがらちゃ" C[193]="1=#6E7955;2=麹塵きくじん" C[194]="1=#767C6B;2=山鳩色やまばといろ" C[195]="1=#888E7E;2=利休鼠りきゅうねずみ" C[196]="1=#5A544B;2=海松茶みるちゃ" C[197]="1=#56564B;2=藍海松茶あいみるちゃ" C[198]="1=#555647;2=藍媚茶あいこびちゃ" C[199]="1=#494A41;2=千歳茶せんさいちゃ" C[200]="1=#6B6F59;2=岩井茶いわいちゃ" C[201]="1=#474B42;2=仙斎茶せんさいちゃ" C[202]="1=#333631;2=黒緑くろみどり" C[203]="1=#5B6356;2=柳煤竹やなぎすすたけ" C[204]="1=#726250;2=樺茶色かばちゃいろ" C[205]="1=#9D896C;2=空五倍子色うつぶしいろ" C[206]="1=#94846A;2=生壁色なまかべいろ" C[207]="1=#897858;2=肥後煤竹ひごすすたけ" C[208]="1=#716246;2=媚茶こびちゃ" C[209]="1=#CBB994;2=白橡しろつるばみ" C[210]="1=#D6C6AF;2=亜麻色あまいろ" C[211]="1=#BFA46F;2=榛色はしばみいろ" C[212]="1=#9E9478;2=灰汁色あくいろ" C[213]="1=#A59564;2=利休茶りきゅうちゃ" C[214]="1=#715C1F;2=鶯茶うぐいすちゃ" C[215]="1=#C7B370;2=木蘭色もくらんじき" C[216]="1=#DCD3B2;2=砂色すないろ" C[217]="1=#A19361;2=油色あぶらいろ" C[218]="1=#8F8667;2=利休色りきゅういろ" C[219]="1=#887938;2=梅幸茶ばいこうちゃ" C[220]="1=#6A5D21;2=璃寛茶りかんちゃ" C[221]="1=#918754;2=黄海松茶きみるちゃ" C[222]="1=#A69425;2=菜種油色なたねゆいろ" C[223]="1=#ADA250;2=青朽葉あおくちば" C[224]="1=#938B4B;2=根岸色ねぎしいろ" C[225]="1=#8C8861;2=鶸茶ひわちゃ" C[226]="1=#A1A46D;2=柳茶やなぎちゃ" C[227]="1=#726D40;2=海松色みるいろ" C[228]="1=#928C36;2=鶯色うぐいすいろ" C[229]="1=#DCCB18;2=緑黄色りょくおうしょく" C[230]="1=#D7CF3A;2=鶸色ひわいろ" C[231]="1=#C5C56A;2=抹茶色まっちゃいろ" C[232]="1=#C3D825;2=若草色わかくさいろ" C[233]="1=#B8D200;2=黄緑きみどり" C[234]="1=#E0EBAF;2=若芽色わかめいろ" C[235]="1=#D8E698;2=若菜色わかないろ" C[236]="1=#C7DC68;2=若苗色わかなえいろ" C[237]="1=#99AB4E;2=青丹あおに" C[238]="1=#7B8D42;2=草色くさいろ" C[239]="1=#69821B;2=苔色こけいろ" C[240]="1=#AACF53;2=萌黄もえぎ" C[241]="1=#B0CA71;2=苗色なえいろ" C[242]="1=#B9D08B;2=若葉色わかばいろ" C[243]="1=#839B5C;2=松葉色まつばいろ" C[244]="1=#CEE4AE;2=夏虫色なつむしいろ" C[245]="1=#82AE46;2=鶸萌黄ひわもえぎ" C[246]="1=#A8C97F;2=柳色やなぎいろ" C[247]="1=#9BA88D;2=青白橡あおしろつるばみ" C[248]="1=#C8D5BB;2=柳鼠やなぎねず" C[249]="1=#C1D8AC;2=裏葉柳うらはやなぎ" C[250]="1=#A8BF93;2=山葵色わさびいろ" C[251]="1=#769164;2=老竹色おいたけいろ" C[252]="1=#D6E9CA;2=白緑びゃくろく" C[253]="1=#93CA76;2=淡萌黄うすもえぎ" C[254]="1=#93B881;2=柳染やなぎぞめ" C[255]="1=#BADCAD;2=薄萌葱うすもえぎ" C[256]="1=#97A791;2=深川鼠ふかがわねずみ" C[257]="1=#98D98E;2=若緑わかみどり" C[258]="1=#88CB7F;2=浅緑あさみどり" C[259]="1=#69B076;2=薄緑うすみどり" C[260]="1=#6B7B6E;2=青鈍あおにび" C[261]="1=#BED2C3;2=青磁鼠せいじねず" C[262]="1=#93B69C;2=薄青うすあお" C[263]="1=#A6C8B2;2=錆青磁さびせいじ" C[264]="1=#47885E;2=緑青色ろくしょういろ" C[265]="1=#316745;2=千歳緑ちとせみどり" C[266]="1=#68BE8D;2=若竹色わかたけいろ" C[267]="1=#3EB370;2=緑みどり" C[268]="1=#007B43;2=常磐色ときわいろ" C[269]="1=#BED3CA;2=千草鼠ちぐさねず" C[270]="1=#92B5A9;2=千草色ちぐさいろ" C[271]="1=#7EBEA5;2=青磁色���いじいろ" C[272]="1=#7EBEAB;2=青竹色あおたけいろ" C[273]="1=#028760;2=常磐緑ときわみどり" C[274]="1=#3B7960;2=木賊色とくさいろ" C[275]="1=#2F5D50;2=天鵞絨びろうど" C[276]="1=#3A5B52;2=虫襖むしあお" C[277]="1=#475950;2=革色かわいろ" C[278]="1=#00552E;2=深緑ふかみどり" C[279]="1=#005243;2=鉄色てついろ" C[280]="1=#006E54;2=萌葱色もえぎいろ" C[281]="1=#00A381;2=花緑青はなろくしょう" C[282]="1=#38B48B;2=翡翠色ひすいいろ" C[283]="1=#00A497;2=青緑あおみどり" C[284]="1=#80ABA9;2=水浅葱みずあさぎ" C[285]="1=#5C9291;2=錆浅葱さびあさぎ" C[286]="1=#478384;2=青碧せいへき" C[287]="1=#43676B;2=御召茶おめしちゃ" C[288]="1=#80989B;2=湊鼠みなとねずみ" C[289]="1=#2C4F54;2=高麗納戸こうらいなんど" C[290]="1=#1F3134;2=百入茶ももし��ちゃ" C[291]="1=#47585C;2=錆鼠さびねず" C[292]="1=#485859;2=錆鉄御納戸さびてつおなんど" C[293]="1=#6C848D;2=藍鼠あいねず" C[294]="1=#53727D;2=錆御納戸さびおなんど" C[295]="1=#5B7E91;2=舛花色ますはないろ" C[296]="1=#426579;2=熨斗目花色のしめはないろ" C[297]="1=#4C6473;2=御召御納戸おめしおなんど" C[298]="1=#455765;2=鉄御納戸てつおなんど" C[299]="1=#44617B;2=紺鼠こんねず" C[300]="1=#393F4C;2=藍鉄あいてつ" C[301]="1=#393E4F;2=青褐あおかち" C[302]="1=#203744;2=褐返かちかえし" C[303]="1=#4D4C61;2=褐色かちいろ" C[304]="1=#EAF4FC;2=月白げっぱく" C[305]="1=#EAEDF7;2=白菫色しろすみれいろ" C[306]="1=#E8ECEF;2=白花色しらはないろ" C[307]="1=#EBF6F7;2=藍白あいじろ" C[308]="1=#C1E4E9;2=白藍しらあい" C[309]="1=#BCE2E8;2=水色みずいろ" C[310]="1=#A2D7DD;2=瓶覗かめのぞき" C[311]="1=#ABCED8;2=秘色色ひそくいろ" C[312]="1=#A0D8EF;2=空色そらいろ" C[313]="1=#89C3EB;2=勿忘草色わすれなぐさいろ" C[314]="1=#84A2D4;2=青藤色あおふじいろ" C[315]="1=#83CCD2;2=白群びゃくぐん" C[316]="1=#84B9CB;2=浅縹あさはなだ" C[317]="1=#698AAB;2=薄花色うすはないろ" C[318]="1=#008899;2=納戸色なんどいろ" C[319]="1=#00A3AF;2=浅葱色あさぎいろ" C[320]="1=#2A83A2;2=花浅葱はなあさぎ" C[321]="1=#59B9C6;2=新橋色しんばしいろ" C[322]="1=#2CA9E1;2=天色あまいろ" C[323]="1=#38A1DB;2=露草色つゆくさいろ" C[324]="1=#0095D9;2=青あお" C[325]="1=#0094C8;2=薄藍うすあい" C[326]="1=#2792C3;2=縹色はなだいろ" C[327]="1=#007BBB;2=紺碧こんぺき" C[328]="1=#5383C3;2=薄群青うすぐんじょう" C[329]="1=#5A79BA;2=薄花桜うすはなざくら" C[330]="1=#4C6CB3;2=群青色ぐんじょういろ" C[331]="1=#3E62AD;2=杜若色かきつばたいろ" C[332]="1=#1E50A2;2=瑠璃色るりいろ" C[333]="1=#507EA4;2=薄縹うすはなだ" C[334]="1=#19448E;2=瑠璃紺るりこん" C[335]="1=#164A84;2=紺瑠璃こんるり" C[336]="1=#165E83;2=藍色あいいろ" C[337]="1=#274A78;2=青藍せいらん" C[338]="1=#2A4073;2=深縹こきはなだ" C[339]="1=#223A70;2=紺色こんいろ" C[340]="1=#192F60;2=紺青こんじょう" C[341]="1=#1C305C;2=留紺とめこん" C[342]="1=#0F2350;2=濃藍こいあい" C[343]="1=#17184B;2=鉄紺てつこん" C[344]="1=#0D0015;2=漆黒しっこく" C[345]="1=#BBC8E6;2=淡藤色あわふじいろ" C[346]="1=#BBBCDE;2=藤色ふじいろ" C[347]="1=#8491C3;2=紅掛空色べにかけそらいろ" C[348]="1=#8491C3;2=紅碧べ��みどり" C[349]="1=#4D5AAF;2=紺桔梗こんききょう" C[350]="1=#4D5AAF;2=花色はないろ" C[351]="1=#4A488E;2=紺藍こんあい" C[352]="1=#4D4398;2=紅桔梗べにききょう" C[353]="1=#5654A2;2=桔梗色ききょういろ" C[354]="1=#706CAA;2=藤納戸ふじなんど" C[355]="1=#68699B;2=紅掛花色べにかけはないろ" C[356]="1=#867BA9;2=紫苑色しおんいろ" C[357]="1=#DBD0E6;2=白藤色しらふじいろ" C[358]="1=#A59ACA;2=藤紫ふじむらさき" C[359]="1=#7058A3;2=菫色すみれいろ" C[360]="1=#674598;2=青紫あおむらさき" C[361]="1=#674196;2=菖蒲色しょうぶいろ" C[362]="1=#9079AD;2=竜胆色りんどういろ" C[363]="1=#745399;2=江戸紫えどむらさき" C[364]="1=#65318E;2=本紫ほんむらさき" C[365]="1=#522F60;2=葡萄色ぶどういろ" C[366]="1=#493759;2=深紫ふかむらさき" C[367]="1=#2E2930;2=紫黒しこく" C[368]="1=#884898;2=紫むらさき" C[369]="1=#C0A2C7;2=薄葡萄うすぶどう" C[370]="1=#460E44;2=紫紺しこん" C[371]="1=#74325C;2=暗紅色あんこうしょく" C[372]="1=#55295B;2=桑の実色くわのみいろ" C[373]="1=#895B8A;2=古代紫こだいむらさき" C[374]="1=#824880;2=茄子紺なすこん" C[375]="1=#915C8B;2=二藍ふたあい" C[376]="1=#9D5B8B;2=京紫きょうむらさき" C[377]="1=#7A4171;2=蒲葡えびぞめ" C[378]="1=#BC64A4;2=若紫わかむらさき" C[379]="1=#B44C97;2=紅紫べにむらさき" C[380]="1=#AA4C8F;2=梅紫うめむらさき" C[381]="1=#CC7EB1;2=菖蒲色あやめいろ" C[382]="1=#CCA6BF;2=紅藤色べにふじいろ" C[383]="1=#C4A3BF;2=浅紫あさむらさき" C[384]="1=#E7E7EB;2=紫水晶むらさきすいしょう" C[385]="1=#DCD6D9;2=薄梅鼠うすうめねず" C[386]="1=#D3CFD9;2=暁鼠あかつきねず" C[387]="1=#D3CCD6;2=牡丹鼠ぼたんねず" C[388]="1=#C8C2C6;2=霞色かすみいろ" C[389]="1=#A6A5C4;2=藤鼠ふじねず" C[390]="1=#A69ABD;2=半色はしたいろ" C[391]="1=#A89DAC;2=薄色うすいろ" C[392]="1=#9790A4;2=薄鼠うすねず" C[393]="1=#9E8B8E;2=鳩羽鼠はとばねずみ" C[394]="1=#95859C;2=鳩羽色はとばいろ" C[395]="1=#95949A;2=桔梗鼠ききょうねず" C[396]="1=#71686C;2=紫鼠むらさきねず" C[397]="1=#705B67;2=葡萄鼠ぶどうねずみ" C[398]="1=#634950;2=濃色こきいろ" C[399]="1=#5F414B;2=紫鳶むらさきとび" C[400]="1=#4F455C;2=濃鼠こいねず" C[401]="1=#5A5359;2=藤煤竹ふじすすたけ" C[402]="1=#594255;2=滅紫けしむらさき" C[403]="1=#524748;2=紅消鼠べにけしねずみ" C[404]="1=#513743;2=似せ紫にせむらさき" C[405]="1=#E6EAE3;2=灰黄��はいきみどり" C[406]="1=#D4DCD6;2=蕎麦切色そばきりいろ" C[407]="1=#D4DCDA;2=薄雲鼠うすくもねず" C[408]="1=#D3CBC6;2=枯野色かれのいろ" C[409]="1=#C8C2BE;2=潤色うるみいろ" C[410]="1=#B3ADA0;2=利休白茶りきゅうしろちゃ" C[411]="1=#A99E93;2=茶鼠ちゃねずみ" C[412]="1=#A58F86;2=胡桃染くるみぞめ" C[413]="1=#928178;2=江戸鼠えどねず" C[414]="1=#887F7A;2=煤色すすいろ" C[415]="1=#B4866B;2=丁子茶ちょうじちゃ" C[416]="1=#B28C6E;2=柴染ふしぞめ" C[417]="1=#A16D5D;2=宗伝唐茶そうでんからちゃ" C[418]="1=#9F6F55;2=砺茶とのちゃ" C[419]="1=#8C6450;2=煎茶色せんちゃいろ" C[420]="1=#856859;2=銀煤竹ぎんすすだけ" C[421]="1=#765C47;2=黄枯茶きがらちゃ" C[422]="1=#6F514C;2=煤竹色すすたけいろ" C[423]="1=#6F4B3E;2=焦茶こげちゃ" C[424]="1=#544A47;2=黒橡くろつるばみ" C[425]="1=#543F32;2=憲法色けんぽういろ" C[426]="1=#554738;2=涅色くりいろ" C[427]="1=#433D3C;2=檳榔子染びんろうじぞめ" C[428]="1=#432F2F;2=黒鳶くろとび" C[429]="1=#3F312B;2=赤墨あかすみ" C[430]="1=#302833;2=黒紅くろべに" C[431]="1=#FFFFFF;2=白しろ" C[432]="1=#FFFFFC;2=胡粉色ごふんいろ" C[433]="1=#F7FCFE;2=卯の花色うのはないろ" C[434]="1=#F8FBF8;2=白磁はくじ" C[435]="1=#FBFAF5;2=生成り色きなりいろ" C[436]="1=#F3F3F3;2=乳白色にゅうはくしょく" C[437]="1=#F3F3F2;2=白練しろねり" C[438]="1=#EAE5E3;2=素色そしょく" C[439]="1=#E5E4E6;2=白梅鼠しらうめねず" C[440]="1=#DCDDDD;2=白鼠しろねず" C[441]="1=#DDDCD6;2=絹鼠きぬねず" C[442]="1=#C0C6C9;2=灰青はいあお" C[443]="1=#AFAFB0;2=銀鼠ぎんねず" C[444]="1=#ADADAD;2=薄鈍うすにび" C[445]="1=#A3A3A2;2=薄墨色うすずみいろ" C[446]="1=#9EA1A3;2=錫色すずいろ" C[447]="1=#9FA0A0;2=素鼠すねずみ" C[448]="1=#949495;2=鼠色ねずみいろ" C[449]="1=#888084;2=源氏鼠げんじねず" C[450]="1=#7D7D7D;2=灰色はいいろ" C[451]="1=#7B7C7D;2=鉛色なまりいろ" C[452]="1=#727171;2=鈍色にびいろ" C[453]="1=#595857;2=墨すみ" C[454]="1=#595455;2=丼鼠どぶねずみ" C[455]="1=#524E4D;2=消炭色けしずみいろ" C[456]="1=#474A4D;2=藍墨茶あいすみちゃ" C[457]="1=#383C3C;2=羊羹色ようかんいろ" C[458]="1=#2B2B2B;2=蝋色ろういろ" C[459]="1=#2B2B2B;2=黒くろ" C[460]="1=#180614;2=烏羽色からすばいろ" C[461]="1=#281A14;2=鉄黒てつぐろ" C[462]="1=#000B00;2=濡羽色ぬればいろ" C[463]="1=#250D00;2=黒檀こくたん" C[464]="1=#241A08;2=��法黒茶けんぽうくろちゃ" C[465]="1=#16160E;2=暗黒色あんこくしょく" EndSub End>LML762-1.sb< Start>LMM209.sb< GraphicsWindow.BackgroundColor ="teal GraphicsWindow.Width =1200 GraphicsWindow.Height =800 GraphicsWindow.Left =10 GraphicsWindow.Top =10 GraphicsWindow.BrushColor="white GraphicsWindow.PenWidth=0 LDUtilities.ShowNoShapeErrors="false Turtle.Speed =10 Turtle.Show () Turtle.Angle=0 GraphicsWindow.Clear () LDEvents.MouseWheel =mww args=0 scc=1 c40=50 Turtle.PenUp () ddd=ldtext.Split ("280 280 r 450 300 t 580 300 i 830 300 a" " ") dodrw() GraphicsWindow.BrushColor ="teal c40=30 ox=10 oy=10 dodrw() ww= LDShapes.GetAllShapes () ii=10000 While "true For f=1 to Array.GetItemCount (ww)+100 ii=ii+1 cc=LDShapes.GetColour (ww[f]) If cc[1]="#FFFFFFFF" Then else cl=LDColours.HSLtoRGB (Math.Remainder (ii 360) 1 .4) LDShapes.BrushColour (ww[f] cl) LDShapes.ZIndex (ww[f] ii+f) cc=LDShapes.GetColour (ww[f-100]) If cc[1]="#FFFFFFFF" Then else LDShapes.BrushColour (ww[f-100] "teal") endif Program.Delay (30) endif EndFor endwhile Sub dodrw For w=1 to Array.GetItemCount (ddd) Step 3 x300=ddd[w] y400=ddd[w+1] LDCall.Function ("dcch" ddd[w+2]) endfor EndSub Sub dcch 'f j cd=args[1] if cd="m" then aa=-1 LDCall.Function4("ldrw",x300,y400 100 0) ldcall.Function5( "cdrw" x300 y400-100 0 36, 5) LDCall.Function4("ldrw",-1,0 95 0) aa=1 ldcall.Function5( "cdrw" x300 y400-100 0 36, 5) LDCall.Function4("ldrw",-1,0 95 0) elseif cd="w" then aa=-1 LDCall.Function4("ldrw",x300,y400-100 100 180) ldcall.Function5( "cdrw" x300 y400 0 36, -5) Turtle.Angle=0 LDCall.Function4("ldrw",-1,0 95 0) aa=1 ldcall.Function5( "cdrw" x300 y400 0 36, -5) Turtle.Angle=0 LDCall.Function4("ldrw",-1,0 95 0) elseif cd="a" then LDCall.Function4("ldrw",x300 y400-50 70, -90) aa=-1 LDCall.Function4("ldrw",x300,y400 100 0) ldcall.Function5( "cdrw" x300 y400-100 0 36, 5) LDCall.Function4("ldrw",-1,0 95 0) elseif cd="b" then aa=1 ldcall.Function5( "cdrw" x300 y400-80 0 72, 6.5) LDCall.Function4("ldrw",-1,0 100 0) elseif cd="d" then aa=-1 ldcall.Function5( "cdrw" x300 y400-80 0 72, 6.5) LDCall.Function4("ldrw",-1,0 100 0) elseif cd="c" then aa=-1 ldcall.Function5( "cdrw" x300 y400-80, -45 55, 6.5) elseif cd="e" then aa=-1 ldcall.Function5( "cdrw" x300 y400-80, -45 55, 6.5) Turtle.Angle=0 Turtle.Move (50) Turtle.Angle=-90 Turtle.Move(60) LDCall.Function4("ldrw",-1,0 50 0) elseif cd="g" then aa=-1 ldcall.Function5( "cdrw" x300 y400-80, -45 55, 6.5) Turtle.Angle=0 LDCall.Function4("ldrw",-1,0 35 0) Turtle.Angle=-90 LDCall.Function4("ldrw",-1,0 40 0) elseif cd="h" then aa=-1 LDCall.Function4("ldrw",x300,y400 100 0) ldcall.Function5( "cdrw" x300 y400-100 0 36, 5) LDCall.Function4("ldrw",-1,0 95 0) Turtle.Angle=0 LDCall.Function4("ldrw",-1,0 200 0) elseif cd="n" then aa=-1 LDCall.Function4("ldrw",x300,y400 100 0) ldcall.Function5( "cdrw" x300 y400-100 0 36, 5) LDCall.Function4("ldrw",-1,0 95 0) elseif cd="o" then aa=1 ldcall.Function5( "cdrw" x300 y400-80 0 72, 6.5) elseif cd="q" then aa=-1 ldcall.Function5( "cdrw" x300 y400-80, 10 65, 6.5) Turtle.Angle=Turtle.Angle+90 LDCall.Function4("ldrw",-1,0 35 0) elseif cd="p" then aa=1 ldcall.Function5( "cdrw" x300 y400-80 0 72, 5) Turtle.Angle=180 LDCall.Function4("ldrw",-1,0 105 0) elseif cd="r" then aa=1 ldcall.Function5( "cdrw" x300 y400-80 0 72, 4.5) Turtle.Angle=180 LDCall.Function4("ldrw",-1,0 105 0) LDCall.Function4("ldrw",x300+40 y400-25 80 135) elseif cd="s" then aa=-1 ldcall.Function5( "cdrw" x300 y400-80, -45 45, 4) aa=1 ldcall.Function5( "cdrw" ,-1 0, 0 45, 4.3) elseif cd="y" then aa=-1 LDCall.Function4("ldrw",x300,y400-100 100 180) ldcall.Function5( "cdrw" x300 y400 0 36, -5) Turtle.Angle=0 LDCall.Function4("ldrw",-1,0 95 0) Turtle.Angle=180 LDCall.Function4("ldrw",-1,0 200 0) elseif cd="u" then aa=-1 LDCall.Function4("ldrw",x300,y400-100 100 180) ldcall.Function5( "cdrw" x300 y400 0 36, -5) Turtle.Angle=0 LDCall.Function4("ldrw",-1,0 95 0) elseif cd="t" then aa=-1 LDCall.Function4("ldrw",x300+50,y400 200 0) LDCall.Function4("ldrw",x300 y400-150 100 90) elseif cd="l" then aa=-1 LDCall.Function4("ldrw",x300+50,y400 200 0) elseif cd="i" then aa=-1 LDCall.Function4("ldrw",x300+50,y400 160 0) elseif cd="k" then aa=-1 LDCall.Function4("ldrw",x300+50,y400 200 0) LDCall.Function4("ldrw",x300+50,y400-70 120 45) LDCall.Function4("ldrw",x300+50,y400-85 120 135) elseif cd="v" then aa=-1 LDCall.Function4("ldrw",x300,y400 180 25) LDCall.Function4("ldrw",x300,y400 180, -25) elseif cd="x" then aa=-1 LDCall.Function4("ldrw",x300,y400 190 35) LDCall.Function4("ldrw",x300+110,y400 190, -35) elseif cd="z" then aa=-1 LDCall.Function4("ldrw",x300,y400 130 90) LDCall.Function4("ldrw",x300,y400 185 35) Turtle.Angle=-90 LDCall.Function4("ldrw",-1,0 100 0) EndIf EndSub Sub ldrw If args[1]>=0 then Turtle.x=args[1] Turtle.Y=args[2] Turtle.Angle =args[4] EndIf For x=1 To args[3] Step 3 sset() Program.Delay (5) Turtle.Move (3) EndFor EndSub Sub sset sh= Shapes.AddEllipse (c40 c40) Shapes.Move (sh Turtle.X+ox Turtle.y+ox) LDShapes.AnimateOpacity (sh 1200 3) EndSub Sub cdrw if args[1]>=0 then Turtle.x=args[1] Turtle.Y=args[2] Turtle.Angle =args[3] endif For x=1 To args[4] sset() Program.Delay (20) Turtle.Angle=Turtle.Angle+5*aa Turtle.Move (args[5]) EndFor EndSub Sub mww If Mouse.IsLeftButtonDown Then an=an+ LDEvents.LastMouseWheelDelta *3 else scc=scc+ LDEvents.LastMouseWheelDelta/10 endif LDGraphicsWindow.Reposition (scc scc 0 0 an) EndSub End>LMM209.sb< Start>LMM385.sb< 'Lessons learnt: 1: can't share/set anything at the same time, including: ' GW properties, subroutines and variables firstPlayed = Clock.ElapsedMilliseconds 'logs record for total time the program has been run DEBUG() gw = 624 gh = 442 boxSize = 3 ribbonHeight = 25 textOffset = 5 'X & Y gameDuration_s = 60 'in seconds timeUpdateRate_ms = 1000 pause = 0 gameover = 0 waitForTick = "True" GraphicsWindow.Hide() GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseMove = OnMouseMove Timer.Interval = 10 Timer.Tick = TimeKeepingThread While waitForTick EndWhile Timer.Interval = 1000 Timer.Tick = FlagShowBox CreateUI() CreateBox() CreateMenu() GraphicsWindow.Show() Shapes.Zoom(box, 1, 1) 'initialise the Zoom to GW before Hiding. Workaround Zoom Bug Shapes.HideShape(box) While "True" If start = 1 Then startTime = Clock.ElapsedMilliseconds showRunTime = 1 play = 1 start = 0 ElseIf flag = "Box Clicked On" Then responseTime = Clock.ElapsedMilliseconds - timeShown writeMe[0] = responseTime n = 0 DisplayTimes1() Sound.PlayChime() Program.Delay(300) HideBox() flag = "" ElseIf flag = "Show Box" Then ShowBox() timeShown = Clock.ElapsedMilliseconds Timer.Interval = Math.GetRandomNumber(2500) + 500 'next tick flag = "" ElseIf gameover = 1 Then Timer.Pause() 'pause Timer.Tick = FlagShowBox. WIP flag off gameover ?? Shapes.HideShape(box) EndIf OperateMenu() ProcessSelectedMenuItem() EndWhile '******************************************************************************************** ' Event Handlers '******************************************************************************************** Sub TimeKeepingThread 'runs & writes uninterupted in the background Timer.Pause() TextWindow.WriteLine("tick") waitForTick = "False" UpdateTime() EndSub Sub FlagShowBox 'ticking timer If play = 1 Then flag = "Show Box" EndIf EndSub Sub OnMouseDown If GraphicsWindow.MouseX >= boxX And GraphicsWindow.MouseX <= boxX + boxTrueSize And gameover = 0 Then If GraphicsWindow.MouseY >= boxY And GraphicsWindow.MouseY <= boxY + boxTrueSize Then flag = "Box Clicked On" 'can't run animation in event thread EndIf EndIf SelectMenuItem() EndSub Sub OnMouseMove mouseX = GraphicsWindow.MouseX mouseY = GraphicsWindow.MouseY MenuFocus() EndSub '---------------------------------------------------------------------------------------------------------- Sub SelectMenuItem For i = 1 To Array.GetItemCount(subMenu[j]) If mouseX > menuWidth * (j-1) And mouseX < menuWidth * j Then If mouseY > ribbonHeight * i And mouseY < ribbonHeight * (i+1) Then menuFlag = subMenu[j][i] TextWindow.WriteLine(menuFlag) EndIf EndIf EndFor EndSub Sub ProcessSelectedMenuItem If menuFlag = "Play" Then 'TextWindow.WriteLine("menuFlag = Play") start = 1 EndIf EndSub '*************************************************************************************** 'Show and Hide the Box '*************************************************************************************** Sub ShowBox boxZoom = Math.GetRandomNumber(15) + 5 '5'20 boxTrueSize = boxSize * boxZoom boxZoomOffset = ((boxSize * boxZoom) - boxSize) / 2 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 '**************************************************************************** 'Time Keeping Thread '**************************************************************************** Sub UpdateTime TextWindow.WriteLine("tick2") While "true" 'WIP use a write subroutine to write the whole bottom display If showRunTime = 1 Then now = Clock.ElapsedMilliseconds elapsedSeconds = (now - firstPlayed) / 1000 seconds = Math.Floor(Math.Remainder(elapsedSeconds, 60)) minutes = Math.Floor(Math.Remainder(elapsedSeconds / 60, 60)) hours = Math.Floor(Math.Remainder(elapsedSeconds / 3600, 24)) '/60/60 days = Math.Floor(elapsedSeconds / 86400) '/60/60/24 If seconds < 10 Then seconds = Text.Append("0", seconds) EndIf If minutes < 10 Then minutes = Text.Append("0", minutes) EndIf If hours < 10 Then hours = Text.Append("0", hours) EndIf runtime = "Run Time: " + days + ":" + hours + ":" + minutes + ":" + seconds writeMeToo[1] = runtime m = 1 DisplayTimes2() If pause = 0 And gameover = 0 Then secondsRemaining = gameDuration_s - (now - startTime) / 1000 TextWindow.WriteLine("secondsRemaining " + secondsRemaining) seconds = Math.Ceiling(Math.Remainder(secondsRemaining, 60)) minutes = Math.Floor(Math.Remainder(secondsRemaining / 60, 60)) If seconds = 0 And minutes = -1 Then minutes = "00" gameover = 1 EndIf If seconds < 10 Then seconds = Text.Append("0", seconds) EndIf If seconds = 60 Then seconds = "00" minutes = Math.Ceiling(Math.Remainder(secondsRemaining / 60, 60)) EndIf timeRemaining = "Time Remaining: " + minutes + ":" + seconds writeMeToo[2] = timeRemaining m = 2 DisplayTimes2() EndIf Program.Delay(timeUpdateRate_ms) EndIf EndWhile EndSub '****************************************************************************************** '1 & 2 Prevent Same Subroutine being Called at the Same Time (should've used game loop) '****************************************************************************************** Sub DisplayTimes1 GraphicsWindow.BrushColor = "lightgray" GraphicsWindow.FillRectangle(gw/3 * n, gh - ribbonHeight, gw/3, ribbonHeight) GraphicsWindow.FontSize = 17 GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(gw/3 * n + textOffset, gh - ribbonHeight, writeMe[n]) EndSub Sub DisplayTimes2 GraphicsWindow.BrushColor = "lightgray" GraphicsWindow.FillRectangle(gw/3 * m, gh - ribbonHeight, gw/3, ribbonHeight) GraphicsWindow.FontSize = 17 GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(gw/3 * m + textOffset, gh - ribbonHeight, writeMeToo[m]) TextWindow.WriteLine("DisplayTimes2") EndSub '______________________________________________________________ '************************************************************************************* 'MENU '************************************************************************************* Sub OperateMenu If menuFlag = "Open Sub Menu" Then OpenSubMenu() CloseOtherSubMenu() menuFlag = 0 ElseIf menuFlag = "Close Sub Menu" Then CloseSubMenu() menuFlag = 0 ElseIf menuFlag = "Highlight Play" Then OpenSubMenu() HighlightPlay() menuFlag = 0 ElseIf menuFlag = "Highlight Pause" Then OpenSubMenu() HighlightPause() menuFlag = 0 ElseIf menuFlag = "Highlight Exit" Then OpenSubMenu() HighlightExit() menuFlag = 0 ElseIf menuFlag = "Highlight Story" Then OpenSubMenu() HighlightStory() menuFlag = 0 EndIf EndSub Sub HighlightStory TextWindow.WriteLine("Highlight on Exit") GraphicsWindow.BrushColor = "yellow" GraphicsWindow.FillRectangle(menuX[2], subMenuY[1], menuWidth, ribbonHeight) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(menuX[2] + textOffset, subMenuY[1] + textOffset, subMenu[2][1]) EndSub Sub HighlightExit TextWindow.WriteLine("Highlight on Exit") GraphicsWindow.BrushColor = "yellow" GraphicsWindow.FillRectangle(menuX[1], subMenuY[3], menuWidth, ribbonHeight) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(menuX[1] + textOffset, subMenuY[3] + textOffset, subMenu[1][3]) EndSub Sub HighlightPause TextWindow.WriteLine("Highlight on Pause") GraphicsWindow.BrushColor = "yellow" GraphicsWindow.FillRectangle(menuX[1], subMenuY[2], menuWidth, ribbonHeight) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(menuX[1] + textOffset, subMenuY[2] + textOffset, subMenu[1][2]) EndSub Sub HighlightPlay TextWindow.WriteLine("Highlight on Play") GraphicsWindow.BrushColor = "yellow" GraphicsWindow.FillRectangle(menuX[1], subMenuY[1], menuWidth, ribbonHeight) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(menuX[1] + textOffset, subMenuY[1] + textOffset, subMenu[1][1]) EndSub Sub OpenSubMenu 'If menuSelected = 1 'game menu selected subMenu[1] = "1=Play;2=Pause;3=Exit" subMenu[2] = "1=Story" If j = 1 Then For i =1 To 3 DrawSubMenu() EndFor ElseIf j = 2 Then i = 1 DrawSubMenu() EndIf EndSub Sub DrawSubMenu subMenuY[i] = ribbonHeight * i GraphicsWindow.BrushColor = "lightgray" GraphicsWindow.FillRectangle(menuX[j], subMenuY[i], menuWidth, ribbonHeight) GraphicsWindow.FontSize = 12 GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(menuX[j] + textOffset, subMenuY[i] + textOffset, subMenu[j][i]) EndSub Sub CreateMenu GraphicsWindow.FontSize = 12 menu = "1=Game;2=Help" For i = 1 To 2 menuX[i] = gw/8 * (i-1) menuWidth = gw/8 GraphicsWindow.BrushColor = "lightgray" GraphicsWindow.FillRectangle(menuX[i], 0, menuWidth, ribbonHeight) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(menuX[i] + textOffset, textOffset, menu[i]) EndFor EndSub Sub CloseSubMenu If j = 1 Then For i =1 To 3 DrawOverSubMenu() EndFor ElseIf j = 2 Then i = 1 DrawOverSubMenu() EndIf EndSub Sub CloseOtherSubMenu If j = 2 Then 'Convaluted logic, makes sure the other subMenu is closed when the other is opened j = 1 CloseSubMenu() j = 2 ElseIf j = 1 Then j = 2 CloseSubMenu() j = 1 EndIf EndSub Sub DrawOverSubMenu subMenuY[i] = ribbonHeight * i GraphicsWindow.BrushColor = "black" GraphicsWindow.FillRectangle(menuX[j], subMenuY[i], menuWidth, ribbonHeight) EndSub Sub MenuFocus If mouseX > 0 And mouseX < menuWidth And mouseY < ribbonHeight Then j = 1 'menu[j] = Game subMenuOpen = 1 menuFlag = "Open Sub Menu" EndIf If j = 1 Then If mouseX < 0 Or mouseX > menuWidth Or mouseY > ribbonHeight * 4 Then subMenuOpen = 0 menuFlag = "Close Sub Menu" EndIf EndIf If mouseX > menuWidth And mouseX < menuWidth * 2 And mouseY < ribbonHeight Then j = 2 subMenuOpen = 1 menuFlag = "Open Sub Menu" EndIf If j = 2 Then If mouseX < menuWidth Or mouseX > menuWidth * 2 Or mouseY > ribbonHeight * 2 Then subMenuOpen = 0 menuFlag = "Close Sub Menu" EndIf EndIf If subMenuOpen = 1 And mouseX > 0 And mouseX < menuWidth And j = 1 Then If mouseY > ribbonHeight And mouseY < ribbonHeight * 2 Then menuFlag = "Highlight Play" ElseIf mouseY > ribbonHeight * 2 And mouseY < ribbonHeight * 3 Then menuFlag = "Highlight Pause" ElseIf mouseY > ribbonHeight * 3 And mouseY < ribbonHeight * 4 Then menuFlag = "Highlight Exit" EndIf EndIf If subMenuOpen = 1 And mouseX > menuWidth And mouseX < menuWidth * 2 And j = 2 Then If mouseY > ribbonHeight And mouseY < ribbonHeight * 2 Then menuFlag = "Highlight Story" EndIf EndIf EndSub '************************************************************************************* ' Set up '************************************************************************************ Sub CreateUI GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Left = (Desktop.Width - gw) / 2 GraphicsWindow.Top = 10 GraphicsWindow.BackgroundColor = "black" n = 0 writeMe[0] = "Response Time" writeMeToo = "1=Total Run Time;2=Time Remaining" DisplayTimes1() For m = 1 To 2 DisplayTimes2() EndFor EndSub Sub CreateBox GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "yellow" box = Shapes.AddRectangle(boxSize, boxSize) EndSub Sub DEBUG TextWindow.Title = "DEBUGGING" TextWindow.Left = 5 TextWindow.Top = 80 EndSub End>LMM385.sb< Start>LMP326.sb< dnr[1]["co"] = "20th Century Fox" dnr[2]["co"] = "AAA Northern California" dnr[3]["co"] = "Abercrombie & Fitch" dnr[4]["co"] = "Accommodations Plus Intl" dnr[5]["co"] = "Adesa / AFC / KAR" dnr[6]["co"] = "Adesa Corporation" dnr[7]["co"] = "Advance Auto Business Support, LLC" dnr[8]["co"] = "Advanced Micro Devices (AMD)" dnr[9]["co"] = "AEM Electronics" dnr[10]["co"] = "AeroComputers" dnr[11]["co"] = "Affinia" dnr[12]["co"] = "AFNI" dnr[13]["co"] = "Agilent Technologies, Inc." dnr[14]["co"] = "Alliance Coal" dnr[15]["co"] = "Allstate Insurance Company" dnr[16]["co"] = "Alpha Natural Resources" dnr[17]["co"] = "Altera Corporation" dnr[18]["co"] = "American Academy of Dermatology" dnr[19]["co"] = "American Airlines" dnr[20]["co"] = "American Tire Distributors" dnr[21]["co"] = "Ameritas" dnr[22]["co"] = "Andersen Corporation" dnr[23]["co"] = "Anna's Linens" dnr[24]["co"] = "Ansys" dnr[25]["co"] = "Aramark Uniform Services" dnr[26]["co"] = "Ariba" dnr[27]["co"] = "Atlanticare Health System, Atlanticare " dnr[28]["co"] = "Aviva USA Corporation" dnr[29]["co"] = "Bare Escentuals Inc" dnr[30]["co"] = "Bayer Consumer Care" dnr[31]["co"] = "BCBS-MA" dnr[32]["co"] = "BCBS-MI" dnr[33]["co"] = "Beachbody" dnr[34]["co"] = "Best Buy" dnr[35]["co"] = "Best Buy " dnr[36]["co"] = "Biogen Idec" dnr[37]["co"] = "Blue Cross Blue Shield of FL" dnr[38]["co"] = "Blue Cross Blue Shield of KC,BCBSKC " dnr[39]["co"] = "Blue Cross Blue Shield of Massachusetts" dnr[40]["co"] = "Blue Cross Blue Shield of Massachusetts, BCBSMA " dnr[41]["co"] = "Blue Cross Blue Shield of Michigan" dnr[42]["co"] = "Blue Cross Blue Shield of SC" dnr[43]["co"] = "Blue Shield of CA" dnr[44]["co"] = "Blue Skies LLC" dnr[45]["co"] = "Bob Evans" dnr[46]["co"] = "Bob Evans Farms Inc." dnr[47]["co"] = "Border States Industries Inc." dnr[48]["co"] = "Brand Energy" dnr[49]["co"] = "Broadcom Corporation" dnr[50]["co"] = "Buffalo Wild Wings" dnr[51]["co"] = "Bunge" dnr[52]["co"] = "Bunge Limited" dnr[53]["co"] = "Business Technology Career Opportunities Inc" dnr[54]["co"] = "Camping World Inc" dnr[55]["co"] = "Cardinal" dnr[56]["co"] = "Cardinal Health" dnr[57]["co"] = "Cardinal Health" dnr[58]["co"] = "Carefx Corporation" dnr[59]["co"] = "Carhartt" dnr[60]["co"] = "Carhartt" dnr[61]["co"] = "Carhartt, Inc." dnr[62]["co"] = "Carolinas Healthcare Systems" dnr[63]["co"] = "Carolinas Healthcare Systems, Carolinas " dnr[64]["co"] = "Carters" dnr[65]["co"] = "Carters" dnr[66]["co"] = "Cassidy-Turley" dnr[67]["co"] = "Caterpillar" dnr[68]["co"] = "Caterpillar" dnr[69]["co"] = "Caterpillar, Inc." dnr[70]["co"] = "Catholic Health Initiatives" dnr[71]["co"] = "Chickasaw Nation" dnr[72]["co"] = "Chrysler" dnr[73]["co"] = "Church & Dwight" dnr[74]["co"] = "Cisco Systems" dnr[75]["co"] = "Citent, Inc." dnr[76]["co"] = "City of Newport News" dnr[77]["co"] = "City of Ottawa, Canada" dnr[78]["co"] = "City of Riverside" dnr[79]["co"] = "Class Trainers, LLC" dnr[80]["co"] = "Classified Ventures, LLC" dnr[81]["co"] = "Clear Channel Communications, Inc." dnr[82]["co"] = "ClearEdge Power" dnr[83]["co"] = "Comerica" dnr[84]["co"] = "Covidien" dnr[85]["co"] = "Cummins, Inc." dnr[86]["co"] = "CVS Caremark" dnr[87]["co"] = "Cydcor" dnr[88]["co"] = "Cypress Semiconductor" dnr[89]["co"] = "Del Monte" dnr[90]["co"] = "Digi-Key Corporation" dnr[91]["co"] = "Disney (Walt)" dnr[92]["co"] = "Drop In Inc" dnr[93]["co"] = "DTE" dnr[94]["co"] = "DTE Energy Company" dnr[95]["co"] = "Duke Energy" dnr[96]["co"] = "Ecolab" dnr[97]["co"] = "Ecolab" dnr[98]["co"] = "Ecolab Inc." dnr[99]["co"] = "Elavon" dnr[100]["co"] = "Elekta" dnr[101]["co"] = "Emerson Power" dnr[102]["co"] = "Emptoris" dnr[103]["co"] = "Enterprise" dnr[104]["co"] = "Ethertronics" dnr[105]["co"] = "Ethicon / Johnson & Johnson" dnr[106]["co"] = "Exar Corporation" dnr[107]["co"] = "Executive Information Systems" dnr[108]["co"] = "Exelixis" dnr[109]["co"] = "Express Scripts" dnr[110]["co"] = "Express Scripts" dnr[111]["co"] = "Express Scripts Inc" dnr[112]["co"] = "F5 Networks" dnr[113]["co"] = "FannieMae" dnr[114]["co"] = "First Data Corporation" dnr[115]["co"] = "First Solar, Inc." dnr[116]["co"] = "Flat Iron Construction" dnr[117]["co"] = "Fluor Corporation" dnr[118]["co"] = "Follett" dnr[119]["co"] = "FordDirect" dnr[120]["co"] = "FordDirect" dnr[121]["co"] = "Fossil" dnr[122]["co"] = "Fossil Inc." dnr[123]["co"] = "Fosters" dnr[124]["co"] = "Four Inc." dnr[125]["co"] = "Franklin Templeton Investments" dnr[126]["co"] = "Galderma Laboratories" dnr[127]["co"] = "GE Capital" dnr[128]["co"] = "Gemilogical Institue of America" dnr[129]["co"] = "Genentech" dnr[130]["co"] = "Genentech" dnr[131]["co"] = "General Atomics - Asi" dnr[132]["co"] = "Genzyme Corporation" dnr[133]["co"] = "Geometric" dnr[134]["co"] = "Gilead Science, Inc." dnr[135]["co"] = "Gogo or AirCell" dnr[136]["co"] = "Graybar Electric" dnr[137]["co"] = "Great West Casualty Company" dnr[138]["co"] = "Group Health Cooperative of South Central Wisconsin (GHC),GHC " dnr[139]["co"] = "Guthy-Renker Corp." dnr[140]["co"] = "Haliburton" dnr[141]["co"] = "Health and Hospital Corporation of Marion County / Wishard Health Services" dnr[142]["co"] = "Health Care Service Corporation (HCSC)" dnr[143]["co"] = "HealthNow, Inc." dnr[144]["co"] = "Hershey" dnr[145]["co"] = "Highmark" dnr[146]["co"] = "Hitachi Data Systems" dnr[147]["co"] = "Humana" dnr[148]["co"] = "Humana Inc." dnr[149]["co"] = "iBasis" dnr[150]["co"] = "IBM" dnr[151]["co"] = "IBM (Including Lab Services)" dnr[152]["co"] = "IBM Corporation" dnr[153]["co"] = "IBM Global Services" dnr[154]["co"] = "IBM ISSD" dnr[155]["co"] = "IBM ISSL" dnr[156]["co"] = "IBM ISSW" dnr[157]["co"] = "IBM or IBM Lab Services also known as IBM Software Services for Websphere (ISSW)" dnr[158]["co"] = "IEEE" dnr[159]["co"] = "IHS Inc." dnr[160]["co"] = "Industrial Science" dnr[161]["co"] = "Invensys" dnr[162]["co"] = "Iowa Health System, IHS " dnr[163]["co"] = "ITES-IBM" dnr[164]["co"] = "ITS, Inc." dnr[165]["co"] = "Ivera Medical Corporation" dnr[166]["co"] = "Jack Morton Worldwide Inc." dnr[167]["co"] = "Janus" dnr[168]["co"] = "JPMorgan Chase" dnr[169]["co"] = "Jupiter Consolidated Group" dnr[170]["co"] = "Kaiser Permanente" dnr[171]["co"] = "Kansas Department of Labor" dnr[172]["co"] = "Kendle" dnr[173]["co"] = "Kirklands Inc." dnr[174]["co"] = "Knowledge Works" dnr[175]["co"] = "Komori" dnr[176]["co"] = "Leapfrog" dnr[177]["co"] = "Ledcor Industries" dnr[178]["co"] = "Legal Shield" dnr[179]["co"] = "Lexmark" dnr[180]["co"] = "Lexmark International" dnr[181]["co"] = "Life Technologies Corporation" dnr[182]["co"] = "Life Time Fitness" dnr[183]["co"] = "Lowe’s" dnr[184]["co"] = "Lowes" dnr[185]["co"] = "LSI Corporation" dnr[186]["co"] = "Lucile Packard Childrens Hospital" dnr[187]["co"] = "Luxottica" dnr[188]["co"] = "m.y.pilgrims" dnr[189]["co"] = "Mason Companies" dnr[190]["co"] = "MasterCard" dnr[191]["co"] = "Mazda USA North American Operations" dnr[192]["co"] = "MDC Holding" dnr[193]["co"] = "MDC Holdings" dnr[194]["co"] = "MedImpact" dnr[195]["co"] = "Medtronic" dnr[196]["co"] = "Meridian IT" dnr[197]["co"] = "Mission Health System" dnr[198]["co"] = "Mission Health System, Mission Health " dnr[199]["co"] = "Monsanto" dnr[200]["co"] = "Monsanto Company" dnr[201]["co"] = "Montana Department of Commerce" dnr[202]["co"] = "Move.com" dnr[203]["co"] = "MTD" dnr[204]["co"] = "MTD Products" dnr[205]["co"] = "MTD Products" dnr[206]["co"] = "Mutual of Omaha Insurance Co." dnr[207]["co"] = "NASCO, Atlanta" dnr[208]["co"] = "NAU Country Insurance Company" dnr[209]["co"] = "NCH Danco" dnr[210]["co"] = "Neiman Marcus, Inc." dnr[211]["co"] = "Nestle USA" dnr[212]["co"] = "NetJets" dnr[213]["co"] = "NetJets Inc." dnr[214]["co"] = "NewPage" dnr[215]["co"] = "North Shore Long Island Jewish, NSLIJ " dnr[216]["co"] = "Northwestern Medical Faculty Foundation" dnr[217]["co"] = "Northwestern Memorial Healthcare" dnr[218]["co"] = "NTC Texas" dnr[219]["co"] = "Nvidia Corporation" dnr[220]["co"] = "NYU Hospitals Center, NYU " dnr[221]["co"] = "ON Semiconductor" dnr[222]["co"] = "Open Dealer Exchange, LLC" dnr[223]["co"] = "Otterbox" dnr[224]["co"] = "Outcome Sciences - Quintiles" dnr[225]["co"] = "Parker Hannifin" dnr[226]["co"] = "Peabody" dnr[227]["co"] = "Persona Inc" dnr[228]["co"] = "PetSmar" dnr[229]["co"] = "Pharmavite" dnr[230]["co"] = "Physicians Mutual Insurance Company" dnr[231]["co"] = "Polycom" dnr[232]["co"] = "Porteous Fastener" dnr[233]["co"] = "Premier" dnr[234]["co"] = "Premier" dnr[235]["co"] = "Premier" dnr[236]["co"] = "Premier, Premier – Charlotte, NC" dnr[237]["co"] = "Principal Life Insurance Company" dnr[238]["co"] = "Printronix" dnr[239]["co"] = "Roche" dnr[240]["co"] = "Roche" dnr[241]["co"] = "S&B Engineers" dnr[242]["co"] = "SAGE Publications" dnr[243]["co"] = "Sarah Cannon Research Institute" dnr[244]["co"] = "Scheels" dnr[245]["co"] = "Schnitzer Steel" dnr[246]["co"] = "SDGE/Sempra" dnr[247]["co"] = "SDI Media" dnr[248]["co"] = "Selectiva" dnr[249]["co"] = "Sephora" dnr[250]["co"] = "Shell" dnr[251]["co"] = "Sigma-Aldrich Corporation" dnr[252]["co"] = "SM Energy Company" dnr[253]["co"] = "Smuckers (JM)" dnr[254]["co"] = "Society of Petroleum Engineers" dnr[255]["co"] = "SolidWorks" dnr[256]["co"] = "Spacelabs Medical" dnr[257]["co"] = "Spartech Corporation" dnr[258]["co"] = "Splunk Inc." dnr[259]["co"] = "Sprint Communications" dnr[260]["co"] = "St. Jude" dnr[261]["co"] = "Standard Aero" dnr[262]["co"] = "State Auto Insurance Companies" dnr[263]["co"] = "State of Florida" dnr[264]["co"] = "State of Kansas SRS" dnr[265]["co"] = "State of Louisiana Dept. of Social Services" dnr[266]["co"] = "State of Missouri" dnr[267]["co"] = "State of Montana" dnr[268]["co"] = "Sterling Commerce" dnr[269]["co"] = "Stifel Financial" dnr[270]["co"] = "Stifel Nicholas" dnr[271]["co"] = "Stryker" dnr[272]["co"] = "Stryker - Instruments" dnr[273]["co"] = "Stryker Corporation" dnr[274]["co"] = "Stryker South Pacific" dnr[275]["co"] = "StubHub" dnr[276]["co"] = "Stuller" dnr[277]["co"] = "Stuller, Inc." dnr[278]["co"] = "Symmetry Medical" dnr[279]["co"] = "Synthes" dnr[280]["co"] = "Target" dnr[281]["co"] = "Target" dnr[282]["co"] = "Target Corporation" dnr[283]["co"] = "TBC" dnr[284]["co"] = "Technotraining, Inc." dnr[285]["co"] = "TeleTech Holdings" dnr[286]["co"] = "Tennessee Valley Authority" dnr[287]["co"] = "Texas Health Resources" dnr[288]["co"] = "Texas Health Resources " dnr[289]["co"] = "The Enterprise Account/Strategic Account list plus the following:" dnr[290]["co"] = "The Mens Wearhouse" dnr[291]["co"] = "The Mens Wearhouse" dnr[292]["co"] = "Thomson Reuters" dnr[293]["co"] = "TIAA-CREF" dnr[294]["co"] = "Tindley Charter School" dnr[295]["co"] = "Tomkins Building" dnr[296]["co"] = "Town & Country Bank - Pevely, MO" dnr[297]["co"] = "Town Sports International" dnr[298]["co"] = "Toyota Financial Services" dnr[299]["co"] = "TRAK Microwave Corporation" dnr[300]["co"] = "Transplace" dnr[301]["co"] = "Transplace" dnr[302]["co"] = "Travelport" dnr[303]["co"] = "Trend Micro Inc." dnr[304]["co"] = "TriHealth" dnr[305]["co"] = "TriHealth Inc." dnr[306]["co"] = "Tripwire" dnr[307]["co"] = "Tri-State" dnr[308]["co"] = "Tru Vue" dnr[309]["co"] = "Trustmark National Bank" dnr[310]["co"] = "Tufts" dnr[311]["co"] = "Tw telecom" dnr[312]["co"] = "Union Bank" dnr[313]["co"] = "United Guaranty Corporation" dnr[314]["co"] = "Urban Outfitters" dnr[315]["co"] = "Vantiv" dnr[316]["co"] = "Vermeer Manufacturing Company" dnr[317]["co"] = "Vermont Student Assistance Corp." dnr[318]["co"] = "Virginia Housing Development Authority" dnr[319]["co"] = "Volkswagon" dnr[320]["co"] = "Volvo IT, NA" dnr[321]["co"] = "Vratsinas Construction Company" dnr[322]["co"] = "Walmart.com USA, LLC" dnr[323]["co"] = "Washington University" dnr[324]["co"] = "Waste Management" dnr[325]["co"] = "Wells Fargo" dnr[326]["co"] = "West Corporation" dnr[327]["co"] = "Western Union" dnr[328]["co"] = "Westfield LLC" dnr[329]["co"] = "Wheaton Van Lines, Inc." dnr[330]["co"] = "Wheaton World Wide Moving / Wheaton Van Lines" dnr[331]["co"] = "Wind River" dnr[332]["co"] = "Wonderware" dnr[333]["co"] = "WOW- Wide Open West" dnr[334]["co"] = "Wright Express LLC" dnr[335]["co"] = "Xilinx" dnr[336]["co"] = "YUM! Brands" dnr[1]["company"] = "x 20TH CENTURY FOX" dnr[2]["company"] = "x AAA NORTHERN CALIFORNIA" dnr[3]["company"] = "x ABERCROMBIE & FITCH" dnr[4]["company"] = "x ACCOMMODATIONS PLUS INTL" dnr[5]["company"] = "x ADESA / AFC / KAR" dnr[6]["company"] = "x ADESA CORPORATION" dnr[7]["company"] = "x ADVANCE AUTO BUSINESS SUPPORT, LLC" dnr[8]["company"] = "x ADVANCED MICRO DEVICES (AMD)" dnr[9]["company"] = "x AEM ELECTRONICS" dnr[10]["company"] = "x AEROCOMPUTERS" dnr[11]["company"] = "x AFFINIA" dnr[12]["company"] = "x AFNI" dnr[13]["company"] = "x AGILENT TECHNOLOGIES, INC." dnr[14]["company"] = "x ALLIANCE COAL" dnr[15]["company"] = "x ALLSTATE INSURANCE COMPANY" dnr[16]["company"] = "x ALPHA NATURAL RESOURCES" dnr[17]["company"] = "x ALTERA CORPORATION" dnr[18]["company"] = "x AMERICAN ACADEMY OF DERMATOLOGY" dnr[19]["company"] = "x AMERICAN AIRLINES" dnr[20]["company"] = "x AMERICAN TIRE DISTRIBUTORS" dnr[21]["company"] = "x AMERITAS" dnr[22]["company"] = "x ANDERSEN CORPORATION" dnr[23]["company"] = "x ANNA'S LINENS" dnr[24]["company"] = "x ANSYS" dnr[25]["company"] = "x ARAMARK UNIFORM SERVICES" dnr[26]["company"] = "x ARIBA" dnr[27]["company"] = "x ATLANTICARE HEALTH SYSTEM, ATLANTICARE " dnr[28]["company"] = "x AVIVA USA CORPORATION" dnr[29]["company"] = "x BARE ESCENTUALS INC" dnr[30]["company"] = "x BAYER CONSUMER CARE" dnr[31]["company"] = "x BCBS-MA" dnr[32]["company"] = "x BCBS-MI" dnr[33]["company"] = "x BEACHBODY" dnr[34]["company"] = "x BEST BUY" dnr[35]["company"] = "x BEST BUY " dnr[36]["company"] = "x BIOGEN IDEC" dnr[37]["company"] = "x BLUE CROSS BLUE SHIELD OF FL" dnr[38]["company"] = "x BLUE CROSS BLUE SHIELD OF KC,BCBSKC " dnr[39]["company"] = "x BLUE CROSS BLUE SHIELD OF MASSACHUSETTS" dnr[40]["company"] = "x BLUE CROSS BLUE SHIELD OF MASSACHUSETTS, BCBSMA " dnr[41]["company"] = "x BLUE CROSS BLUE SHIELD OF MICHIGAN" dnr[42]["company"] = "x BLUE CROSS BLUE SHIELD OF SC" dnr[43]["company"] = "x BLUE SHIELD OF CA" dnr[44]["company"] = "x BLUE SKIES LLC" dnr[45]["company"] = "x BOB EVANS" dnr[46]["company"] = "x BOB EVANS FARMS INC." dnr[47]["company"] = "x BORDER STATES INDUSTRIES INC." dnr[48]["company"] = "x BRAND ENERGY" dnr[49]["company"] = "x BROADCOM CORPORATION" dnr[50]["company"] = "x BUFFALO WILD WINGS" dnr[51]["company"] = "x BUNGE" dnr[52]["company"] = "x BUNGE LIMITED" dnr[53]["company"] = "x BUSINESS TECHNOLOGY CAREER OPPORTUNITIES INC" dnr[54]["company"] = "x CAMPING WORLD INC" dnr[55]["company"] = "x CARDINAL" dnr[56]["company"] = "x CARDINAL HEALTH" dnr[57]["company"] = "x CARDINAL HEALTH" dnr[58]["company"] = "x CAREFX CORPORATION" dnr[59]["company"] = "x CARHARTT" dnr[60]["company"] = "x CARHARTT" dnr[61]["company"] = "x CARHARTT, INC." dnr[62]["company"] = "x CAROLINAS HEALTHCARE SYSTEMS" dnr[63]["company"] = "x CAROLINAS HEALTHCARE SYSTEMS, CAROLINAS " dnr[64]["company"] = "x CARTERS" dnr[65]["company"] = "x CARTERS" dnr[66]["company"] = "x CASSIDY-TURLEY" dnr[67]["company"] = "x CATERPILLAR" dnr[68]["company"] = "x CATERPILLAR" dnr[69]["company"] = "x CATERPILLAR, INC." dnr[70]["company"] = "x CATHOLIC HEALTH INITIATIVES" dnr[71]["company"] = "x CHICKASAW NATION" dnr[72]["company"] = "x CHRYSLER" dnr[73]["company"] = "x CHURCH & DWIGHT" dnr[74]["company"] = "x CISCO SYSTEMS" dnr[75]["company"] = "x CITENT, INC." dnr[76]["company"] = "x CITY OF NEWPORT NEWS" dnr[77]["company"] = "x CITY OF OTTAWA, CANADA" dnr[78]["company"] = "x CITY OF RIVERSIDE" dnr[79]["company"] = "x CLASS TRAINERS, LLC" dnr[80]["company"] = "x CLASSIFIED VENTURES, LLC" dnr[81]["company"] = "x CLEAR CHANNEL COMMUNICATIONS, INC." dnr[82]["company"] = "x CLEAREDGE POWER" dnr[83]["company"] = "x COMERICA" dnr[84]["company"] = "x COVIDIEN" dnr[85]["company"] = "x CUMMINS, INC." dnr[86]["company"] = "x CVS CAREMARK" dnr[87]["company"] = "x CYDCOR" dnr[88]["company"] = "x CYPRESS SEMICONDUCTOR" dnr[89]["company"] = "x DEL MONTE" dnr[90]["company"] = "x DIGI-KEY CORPORATION" dnr[91]["company"] = "x DISNEY (WALT)" dnr[92]["company"] = "x DROP IN INC" dnr[93]["company"] = "x DTE" dnr[94]["company"] = "x DTE ENERGY COMPANY" dnr[95]["company"] = "x DUKE ENERGY" dnr[96]["company"] = "x ECOLAB" dnr[97]["company"] = "x ECOLAB" dnr[98]["company"] = "x ECOLAB INC." dnr[99]["company"] = "x ELAVON" dnr[100]["company"] = "x ELEKTA" dnr[101]["company"] = "x EMERSON POWER" dnr[102]["company"] = "x EMPTORIS" dnr[103]["company"] = "x ENTERPRISE" dnr[104]["company"] = "x ETHERTRONICS" dnr[105]["company"] = "x ETHICON / JOHNSON & JOHNSON" dnr[106]["company"] = "x EXAR CORPORATION" dnr[107]["company"] = "x EXECUTIVE INFORMATION SYSTEMS" dnr[108]["company"] = "x EXELIXIS" dnr[109]["company"] = "x EXPRESS SCRIPTS" dnr[110]["company"] = "x EXPRESS SCRIPTS" dnr[111]["company"] = "x EXPRESS SCRIPTS INC" dnr[112]["company"] = "x F5 NETWORKS" dnr[113]["company"] = "x FANNIEMAE" dnr[114]["company"] = "x FIRST DATA CORPORATION" dnr[115]["company"] = "x FIRST SOLAR, INC." dnr[116]["company"] = "x FLAT IRON CONSTRUCTION" dnr[117]["company"] = "x FLUOR CORPORATION" dnr[118]["company"] = "x FOLLETT" dnr[119]["company"] = "x FORDDIRECT" dnr[120]["company"] = "x FORDDIRECT" dnr[121]["company"] = "x FOSSIL" dnr[122]["company"] = "x FOSSIL INC." dnr[123]["company"] = "x FOSTERS" dnr[124]["company"] = "x FOUR INC." dnr[125]["company"] = "x FRANKLIN TEMPLETON INVESTMENTS" dnr[126]["company"] = "x GALDERMA LABORATORIES" dnr[127]["company"] = "x GE CAPITAL" dnr[128]["company"] = "x GEMILOGICAL INSTITUE OF AMERICA" dnr[129]["company"] = "x GENENTECH" dnr[130]["company"] = "x GENENTECH" dnr[131]["company"] = "x GENERAL ATOMICS - ASI" dnr[132]["company"] = "x GENZYME CORPORATION" dnr[133]["company"] = "x GEOMETRIC" dnr[134]["company"] = "x GILEAD SCIENCE, INC." dnr[135]["company"] = "x GOGO OR AIRCELL" dnr[136]["company"] = "x GRAYBAR ELECTRIC" dnr[137]["company"] = "x GREAT WEST CASUALTY COMPANY" dnr[138]["company"] = "x GROUP HEALTH COOPERATIVE OF SOUTH CENTRAL WISCONSIN (GHC),GHC " dnr[139]["company"] = "x GUTHY-RENKER CORP." dnr[140]["company"] = "x HALIBURTON" dnr[141]["company"] = "x HEALTH AND HOSPITAL CORPORATION OF MARION COUNTY / WISHARD HEALTH SERVICES" dnr[142]["company"] = "x HEALTH CARE SERVICE CORPORATION (HCSC)" dnr[143]["company"] = "x HEALTHNOW, INC." dnr[144]["company"] = "x HERSHEY" dnr[145]["company"] = "x HIGHMARK" dnr[146]["company"] = "x HITACHI DATA SYSTEMS" dnr[147]["company"] = "x HUMANA" dnr[148]["company"] = "x HUMANA INC." dnr[149]["company"] = "x IBASIS" dnr[150]["company"] = "x IBM" dnr[151]["company"] = "x IBM (INCLUDING LAB SERVICES)" dnr[152]["company"] = "x IBM CORPORATION" dnr[153]["company"] = "x IBM GLOBAL SERVICES" dnr[154]["company"] = "x IBM ISSD" dnr[155]["company"] = "x IBM ISSL" dnr[156]["company"] = "x IBM ISSW" dnr[157]["company"] = "x IBM OR IBM LAB SERVICES ALSO KNOWN AS IBM SOFTWARE SERVICES FOR WEBSPHERE (ISSW)" dnr[158]["company"] = "x IEEE" dnr[159]["company"] = "x IHS INC." dnr[160]["company"] = "x INDUSTRIAL SCIENCE" dnr[161]["company"] = "x INVENSYS" dnr[162]["company"] = "x IOWA HEALTH SYSTEM, IHS " dnr[163]["company"] = "x ITES-IBM" dnr[164]["company"] = "x ITS, INC." dnr[165]["company"] = "x IVERA MEDICAL CORPORATION" dnr[166]["company"] = "x JACK MORTON WORLDWIDE INC." dnr[167]["company"] = "x JANUS" dnr[168]["company"] = "x JPMORGAN CHASE" dnr[169]["company"] = "x JUPITER CONSOLIDATED GROUP" dnr[170]["company"] = "x KAISER PERMANENTE" dnr[171]["company"] = "x KANSAS DEPARTMENT OF LABOR" dnr[172]["company"] = "x KENDLE" dnr[173]["company"] = "x KIRKLANDS INC." dnr[174]["company"] = "x KNOWLEDGE WORKS" dnr[175]["company"] = "x KOMORI" dnr[176]["company"] = "x LEAPFROG" dnr[177]["company"] = "x LEDCOR INDUSTRIES" dnr[178]["company"] = "x LEGAL SHIELD" dnr[179]["company"] = "x LEXMARK" dnr[180]["company"] = "x LEXMARK INTERNATIONAL" dnr[181]["company"] = "x LIFE TECHNOLOGIES CORPORATION" dnr[182]["company"] = "x LIFE TIME FITNESS" dnr[183]["company"] = "x LOWE’S" dnr[184]["company"] = "x LOWES" dnr[185]["company"] = "x LSI CORPORATION" dnr[186]["company"] = "x LUCILE PACKARD CHILDRENS HOSPITAL" dnr[187]["company"] = "x LUXOTTICA" dnr[188]["company"] = "x M.Y.PILGRIMS" dnr[189]["company"] = "x MASON COMPANIES" dnr[190]["company"] = "x MASTERCARD" dnr[191]["company"] = "x MAZDA USA NORTH AMERICAN OPERATIONS" dnr[192]["company"] = "x MDC HOLDING" dnr[193]["company"] = "x MDC HOLDINGS" dnr[194]["company"] = "x MEDIMPACT" dnr[195]["company"] = "x MEDTRONIC" dnr[196]["company"] = "x MERIDIAN IT" dnr[197]["company"] = "x MISSION HEALTH SYSTEM" dnr[198]["company"] = "x MISSION HEALTH SYSTEM, MISSION HEALTH " dnr[199]["company"] = "x MONSANTO" dnr[200]["company"] = "x MONSANTO COMPANY" dnr[201]["company"] = "x MONTANA DEPARTMENT OF COMMERCE" dnr[202]["company"] = "x MOVE.COM" dnr[203]["company"] = "x MTD" dnr[204]["company"] = "x MTD PRODUCTS" dnr[205]["company"] = "x MTD PRODUCTS" dnr[206]["company"] = "x MUTUAL OF OMAHA INSURANCE CO." dnr[207]["company"] = "x NASCO, ATLANTA" dnr[208]["company"] = "x NAU COUNTRY INSURANCE COMPANY" dnr[209]["company"] = "x NCH DANCO" dnr[210]["company"] = "x NEIMAN MARCUS, INC." dnr[211]["company"] = "x NESTLE USA" dnr[212]["company"] = "x NETJETS" dnr[213]["company"] = "x NETJETS INC." dnr[214]["company"] = "x NEWPAGE" dnr[215]["company"] = "x NORTH SHORE LONG ISLAND JEWISH, NSLIJ " dnr[216]["company"] = "x NORTHWESTERN MEDICAL FACULTY FOUNDATION" dnr[217]["company"] = "x NORTHWESTERN MEMORIAL HEALTHCARE" dnr[218]["company"] = "x NTC TEXAS" dnr[219]["company"] = "x NVIDIA CORPORATION" dnr[220]["company"] = "x NYU HOSPITALS CENTER, NYU " dnr[221]["company"] = "x ON SEMICONDUCTOR" dnr[222]["company"] = "x OPEN DEALER EXCHANGE, LLC" dnr[223]["company"] = "x OTTERBOX" dnr[224]["company"] = "x OUTCOME SCIENCES - QUINTILES" dnr[225]["company"] = "x PARKER HANNIFIN" dnr[226]["company"] = "x PEABODY" dnr[227]["company"] = "x PERSONA INC" dnr[228]["company"] = "x PETSMAR" dnr[229]["company"] = "x PHARMAVITE" dnr[230]["company"] = "x PHYSICIANS MUTUAL INSURANCE COMPANY" dnr[231]["company"] = "x POLYCOM" dnr[232]["company"] = "x PORTEOUS FASTENER" dnr[233]["company"] = "x PREMIER" dnr[234]["company"] = "x PREMIER" dnr[235]["company"] = "x PREMIER" dnr[236]["company"] = "x PREMIER, PREMIER – CHARLOTTE, NC" dnr[237]["company"] = "x PRINCIPAL LIFE INSURANCE COMPANY" dnr[238]["company"] = "x PRINTRONIX" dnr[239]["company"] = "x ROCHE" dnr[240]["company"] = "x ROCHE" dnr[241]["company"] = "x S&B ENGINEERS" dnr[242]["company"] = "x SAGE PUBLICATIONS" dnr[243]["company"] = "x SARAH CANNON RESEARCH INSTITUTE" dnr[244]["company"] = "x SCHEELS" dnr[245]["company"] = "x SCHNITZER STEEL" dnr[246]["company"] = "x SDGE/SEMPRA" dnr[247]["company"] = "x SDI MEDIA" dnr[248]["company"] = "x SELECTIVA" dnr[249]["company"] = "x SEPHORA" dnr[250]["company"] = "x SHELL" dnr[251]["company"] = "x SIGMA-ALDRICH CORPORATION" dnr[252]["company"] = "x SM ENERGY COMPANY" dnr[253]["company"] = "x SMUCKERS (JM)" dnr[254]["company"] = "x SOCIETY OF PETROLEUM ENGINEERS" dnr[255]["company"] = "x SOLIDWORKS" dnr[256]["company"] = "x SPACELABS MEDICAL" dnr[257]["company"] = "x SPARTECH CORPORATION" dnr[258]["company"] = "x SPLUNK INC." dnr[259]["company"] = "x SPRINT COMMUNICATIONS" dnr[260]["company"] = "x ST. JUDE" dnr[261]["company"] = "x STANDARD AERO" dnr[262]["company"] = "x STATE AUTO INSURANCE COMPANIES" dnr[263]["company"] = "x STATE OF FLORIDA" dnr[264]["company"] = "x STATE OF KANSAS SRS" dnr[265]["company"] = "x STATE OF LOUISIANA DEPT. OF SOCIAL SERVICES" dnr[266]["company"] = "x STATE OF MISSOURI" dnr[267]["company"] = "x STATE OF MONTANA" dnr[268]["company"] = "x STERLING COMMERCE" dnr[269]["company"] = "x STIFEL FINANCIAL" dnr[270]["company"] = "x STIFEL NICHOLAS" dnr[271]["company"] = "x STRYKER" dnr[272]["company"] = "x STRYKER - INSTRUMENTS" dnr[273]["company"] = "x STRYKER CORPORATION" dnr[274]["company"] = "x STRYKER SOUTH PACIFIC" dnr[275]["company"] = "x STUBHUB" dnr[276]["company"] = "x STULLER" dnr[277]["company"] = "x STULLER, INC." dnr[278]["company"] = "x SYMMETRY MEDICAL" dnr[279]["company"] = "x SYNTHES" dnr[280]["company"] = "x TARGET" dnr[281]["company"] = "x TARGET" dnr[282]["company"] = "x TARGET CORPORATION" dnr[283]["company"] = "x TBC" dnr[284]["company"] = "x TECHNOTRAINING, INC." dnr[285]["company"] = "x TELETECH HOLDINGS" dnr[286]["company"] = "x TENNESSEE VALLEY AUTHORITY" dnr[287]["company"] = "x TEXAS HEALTH RESOURCES" dnr[288]["company"] = "x TEXAS HEALTH RESOURCES " dnr[289]["company"] = "x THE ENTERPRISE ACCOUNT/STRATEGIC ACCOUNT LIST PLUS THE FOLLOWING:" dnr[290]["company"] = "x THE MENS WEARHOUSE" dnr[291]["company"] = "x THE MENS WEARHOUSE" dnr[292]["company"] = "x THOMSON REUTERS" dnr[293]["company"] = "x TIAA-CREF" dnr[294]["company"] = "x TINDLEY CHARTER SCHOOL" dnr[295]["company"] = "x TOMKINS BUILDING" dnr[296]["company"] = "x TOWN & COUNTRY BANK - PEVELY, MO" dnr[297]["company"] = "x TOWN SPORTS INTERNATIONAL" dnr[298]["company"] = "x TOYOTA FINANCIAL SERVICES" dnr[299]["company"] = "x TRAK MICROWAVE CORPORATION" dnr[300]["company"] = "x TRANSPLACE" dnr[301]["company"] = "x TRANSPLACE" dnr[302]["company"] = "x TRAVELPORT" dnr[303]["company"] = "x TREND MICRO INC." dnr[304]["company"] = "x TRIHEALTH" dnr[305]["company"] = "x TRIHEALTH INC." dnr[306]["company"] = "x TRIPWIRE" dnr[307]["company"] = "x TRI-STATE" dnr[308]["company"] = "x TRU VUE" dnr[309]["company"] = "x TRUSTMARK NATIONAL BANK" dnr[310]["company"] = "x TUFTS" dnr[311]["company"] = "x TW TELECOM" dnr[312]["company"] = "x UNION BANK" dnr[313]["company"] = "x UNITED GUARANTY CORPORATION" dnr[314]["company"] = "x URBAN OUTFITTERS" dnr[315]["company"] = "x VANTIV" dnr[316]["company"] = "x VERMEER MANUFACTURING COMPANY" dnr[317]["company"] = "x VERMONT STUDENT ASSISTANCE CORP." dnr[318]["company"] = "x VIRGINIA HOUSING DEVELOPMENT AUTHORITY" dnr[319]["company"] = "x VOLKSWAGON" dnr[320]["company"] = "x VOLVO IT, NA" dnr[321]["company"] = "x VRATSINAS CONSTRUCTION COMPANY" dnr[322]["company"] = "x WALMART.COM USA, LLC" dnr[323]["company"] = "x WASHINGTON UNIVERSITY" dnr[324]["company"] = "x WASTE MANAGEMENT" dnr[325]["company"] = "x WELLS FARGO" dnr[326]["company"] = "x WEST CORPORATION" dnr[327]["company"] = "x WESTERN UNION" dnr[328]["company"] = "x WESTFIELD LLC" dnr[329]["company"] = "x WHEATON VAN LINES, INC." dnr[330]["company"] = "x WHEATON WORLD WIDE MOVING / WHEATON VAN LINES" dnr[331]["company"] = "x WIND RIVER" dnr[332]["company"] = "x WONDERWARE" dnr[333]["company"] = "x WOW- WIDE OPEN WEST" dnr[334]["company"] = "x WRIGHT EXPRESS LLC" dnr[335]["company"] = "x XILINX" dnr[336]["company"] = "x YUM! BRANDS" dnr[1]["manager"] = "Alfred Arnaud" dnr[2]["manager"] = "Joe Klewicki" dnr[3]["manager"] = "John Griffin" dnr[4]["manager"] = "Joe Klewicki" dnr[5]["manager"] = "John Griffin" dnr[6]["manager"] = "Joe Klewicki" dnr[7]["manager"] = "Joe Klewicki" dnr[8]["manager"] = "Alfred Arnaud" dnr[9]["manager"] = "Alfred Arnaud" dnr[10]["manager"] = "Alfred Arnaud" dnr[11]["manager"] = "Joe Klewicki" dnr[12]["manager"] = "Joe Klewicki" dnr[13]["manager"] = "Alfred Arnaud" dnr[14]["manager"] = "Chris Wilson" dnr[15]["manager"] = "Joe Klewicki" dnr[16]["manager"] = "Chris Wilson" dnr[17]["manager"] = "Alfred Arnaud" dnr[18]["manager"] = "Alfred Arnaud" dnr[19]["manager"] = "Joe Klewicki" dnr[20]["manager"] = "Alfred Arnaud" dnr[21]["manager"] = "John Griffin" dnr[22]["manager"] = "Joe Klewicki" dnr[23]["manager"] = "Alfred Arnaud" dnr[24]["manager"] = "Alfred Arnaud" dnr[25]["manager"] = "Chris Wilson" dnr[26]["manager"] = "Alfred Arnaud" dnr[27]["manager"] = "David Hastoglis" dnr[28]["manager"] = "Joe Klewicki" dnr[29]["manager"] = "Joe Klewicki" dnr[30]["manager"] = "Alfred Arnaud" dnr[31]["manager"] = "Vishal Rajpal" dnr[32]["manager"] = "Joel Stanesa" dnr[33]["manager"] = "Alfred Arnaud" dnr[34]["manager"] = "Joe Klewicki" dnr[35]["manager"] = "Derek Tanahill" dnr[36]["manager"] = "Alfred Arnaud" dnr[37]["manager"] = "Joe Klewicki" dnr[38]["manager"] = "David Hastoglis" dnr[39]["manager"] = "Joe Klewicki" dnr[40]["manager"] = "David Hastoglis" dnr[41]["manager"] = "Joe Klewicki" dnr[42]["manager"] = "Joe Klewicki" dnr[43]["manager"] = "Joe Klewicki" dnr[44]["manager"] = "Alfred Arnaud" dnr[45]["manager"] = "John Griffin" dnr[46]["manager"] = "Joe Klewicki" dnr[47]["manager"] = "Joe Klewicki" dnr[48]["manager"] = "Chris Wilson" dnr[49]["manager"] = "Alfred Arnaud" dnr[50]["manager"] = "Alfred Arnaud" dnr[51]["manager"] = "John Spyers" dnr[52]["manager"] = "Joe Klewicki" dnr[53]["manager"] = "Joe Klewicki" dnr[54]["manager"] = "Alfred Arnaud" dnr[55]["manager"] = "Hari Madamalla" dnr[56]["manager"] = "John Griffin" dnr[57]["manager"] = "Joe Klewicki" dnr[58]["manager"] = "Joe Klewicki" dnr[59]["manager"] = "Joel Stanesa" dnr[60]["manager"] = "Hari Madamalla" dnr[61]["manager"] = "Joe Klewicki" dnr[62]["manager"] = "Joe Klewicki" dnr[63]["manager"] = "David Hastoglis" dnr[64]["manager"] = "Ruth Minj" dnr[65]["manager"] = "Vishal Rajpal" dnr[66]["manager"] = "John Spyers" dnr[67]["manager"] = "John Griffin" dnr[68]["manager"] = "Hari Madamalla" dnr[69]["manager"] = "Joe Klewicki" dnr[70]["manager"] = "MaryBeth Ostasz" dnr[71]["manager"] = "JP Contreras" dnr[72]["manager"] = "Joel Stanesa" dnr[73]["manager"] = "Alfred Arnaud" dnr[74]["manager"] = "Alfred Arnaud" dnr[75]["manager"] = "Joe Klewicki" dnr[76]["manager"] = "Alfred Arnaud" dnr[77]["manager"] = "Alfred Arnaud" dnr[78]["manager"] = "Alfred Arnaud" dnr[79]["manager"] = "Joe Klewicki" dnr[80]["manager"] = "Joe Klewicki" dnr[81]["manager"] = "Joe Klewicki" dnr[82]["manager"] = "Alfred Arnaud" dnr[83]["manager"] = "Joel Stanesa" dnr[84]["manager"] = "JP Contreras" dnr[85]["manager"] = "Alfred Arnaud" dnr[86]["manager"] = "Joe Klewicki" dnr[87]["manager"] = "Alfred Arnaud" dnr[88]["manager"] = "Alfred Arnaud" dnr[89]["manager"] = "JP Contreras" dnr[90]["manager"] = "Joe Klewicki" dnr[91]["manager"] = "Alfred Arnaud" dnr[92]["manager"] = "Alfred Arnaud" dnr[93]["manager"] = "Joel Stanesa" dnr[94]["manager"] = "Joe Klewicki" dnr[95]["manager"] = "Jon Nance" dnr[96]["manager"] = "Derek Tanahill" dnr[97]["manager"] = "Hari Madamalla" dnr[98]["manager"] = "Joe Klewicki" dnr[99]["manager"] = "Alfred Arnaud" dnr[100]["manager"] = "Alfred Arnaud" dnr[101]["manager"] = "Alfred Arnaud" dnr[102]["manager"] = "Ruth Minj" dnr[103]["manager"] = "John Spyers" dnr[104]["manager"] = "Alfred Arnaud" dnr[105]["manager"] = "John Griffin" dnr[106]["manager"] = "Alfred Arnaud" dnr[107]["manager"] = "Alfred Arnaud" dnr[108]["manager"] = "Alfred Arnaud" dnr[109]["manager"] = "Derek Tanahill" dnr[110]["manager"] = "John Spyers" dnr[111]["manager"] = "Joe Klewicki" dnr[112]["manager"] = "Alfred Arnaud" dnr[113]["manager"] = "Paul Patterson" dnr[114]["manager"] = "Joe Klewicki" dnr[115]["manager"] = "Joe Klewicki" dnr[116]["manager"] = "Alfred Arnaud" dnr[117]["manager"] = "Joe Klewicki" dnr[118]["manager"] = "Ruth Minj" dnr[119]["manager"] = "Joel Stanesa" dnr[120]["manager"] = "Joe Klewicki" dnr[121]["manager"] = "Hari Madamalla" dnr[122]["manager"] = "Joe Klewicki" dnr[123]["manager"] = "Alfred Arnaud" dnr[124]["manager"] = "Joe Klewicki" dnr[125]["manager"] = "Joe Klewicki" dnr[126]["manager"] = "Chris Wilson" dnr[127]["manager"] = "Paul Patterson" dnr[128]["manager"] = "Alfred Arnaud" dnr[129]["manager"] = "JP Contreras" dnr[130]["manager"] = "Alfred Arnaud" dnr[131]["manager"] = "Alfred Arnaud" dnr[132]["manager"] = "Alfred Arnaud" dnr[133]["manager"] = "Alfred Arnaud" dnr[134]["manager"] = "Alfred Arnaud" dnr[135]["manager"] = "MaryBeth Ostasz" dnr[136]["manager"] = "Hari Madamalla" dnr[137]["manager"] = "Joe Klewicki" dnr[138]["manager"] = "David Hastoglis" dnr[139]["manager"] = "Joe Klewicki" dnr[140]["manager"] = "Jim Roberts" dnr[141]["manager"] = "John Griffin" dnr[142]["manager"] = "Joe Klewicki" dnr[143]["manager"] = "Joe Klewicki" dnr[144]["manager"] = "Alfred Arnaud" dnr[145]["manager"] = "John Griffin" dnr[146]["manager"] = "Alfred Arnaud" dnr[147]["manager"] = "John Griffin" dnr[148]["manager"] = "Joe Klewicki" dnr[149]["manager"] = "Alfred Arnaud" dnr[150]["manager"] = "Ruth Minj" dnr[151]["manager"] = "Hari Madamalla" dnr[152]["manager"] = "Joe Klewicki" dnr[153]["manager"] = "Joe Klewicki" dnr[154]["manager"] = "Joe Klewicki" dnr[155]["manager"] = "Joe Klewicki" dnr[156]["manager"] = "Joe Klewicki" dnr[157]["manager"] = "Vishal Rajpal" dnr[158]["manager"] = "Alfred Arnaud" dnr[159]["manager"] = "Alfred Arnaud" dnr[160]["manager"] = "Alfred Arnaud" dnr[161]["manager"] = "Alfred Arnaud" dnr[162]["manager"] = "David Hastoglis" dnr[163]["manager"] = "Joe Klewicki" dnr[164]["manager"] = "Joe Klewicki" dnr[165]["manager"] = "Alfred Arnaud" dnr[166]["manager"] = "Joe Klewicki" dnr[167]["manager"] = "MaryBeth Ostasz" dnr[168]["manager"] = "John Griffin" dnr[169]["manager"] = "Alfred Arnaud" dnr[170]["manager"] = "Joe Klewicki" dnr[171]["manager"] = "Alfred Arnaud" dnr[172]["manager"] = "Alfred Arnaud" dnr[173]["manager"] = "Joe Klewicki" dnr[174]["manager"] = "John Griffin" dnr[175]["manager"] = "Alfred Arnaud" dnr[176]["manager"] = "Alfred Arnaud" dnr[177]["manager"] = "Alfred Arnaud" dnr[178]["manager"] = "Joe Klewicki" dnr[179]["manager"] = "Kevin Kelly" dnr[180]["manager"] = "Joe Klewicki" dnr[181]["manager"] = "Alfred Arnaud" dnr[182]["manager"] = "Derek Tanahill" dnr[183]["manager"] = "Jon Nance" dnr[184]["manager"] = "Joe Klewicki" dnr[185]["manager"] = "Alfred Arnaud" dnr[186]["manager"] = "Joe Klewicki" dnr[187]["manager"] = "John Griffin" dnr[188]["manager"] = "Joe Klewicki" dnr[189]["manager"] = "Chris Wilson" dnr[190]["manager"] = "John Spyers" dnr[191]["manager"] = "Alfred Arnaud" dnr[192]["manager"] = "JP Contreras" dnr[193]["manager"] = "Alfred Arnaud" dnr[194]["manager"] = "Vishal Rajpal" dnr[195]["manager"] = "Derek Tanahill" dnr[196]["manager"] = "Joe Klewicki" dnr[197]["manager"] = "Joe Klewicki" dnr[198]["manager"] = "David Hastoglis" dnr[199]["manager"] = "John Spyers" dnr[200]["manager"] = "Joe Klewicki" dnr[201]["manager"] = "Alfred Arnaud" dnr[202]["manager"] = "Alfred Arnaud" dnr[203]["manager"] = "Hari Madamalla" dnr[204]["manager"] = "John Griffin" dnr[205]["manager"] = "Joe Klewicki" dnr[206]["manager"] = "Joe Klewicki" dnr[207]["manager"] = "David Hastoglis" dnr[208]["manager"] = "Alfred Arnaud" dnr[209]["manager"] = "Chris Wilson" dnr[210]["manager"] = "Joe Klewicki" dnr[211]["manager"] = "Alfred Arnaud" dnr[212]["manager"] = "John Griffin" dnr[213]["manager"] = "Joe Klewicki" dnr[214]["manager"] = "John Griffin" dnr[215]["manager"] = "David Hastoglis" dnr[216]["manager"] = "JP Contreras" dnr[217]["manager"] = "JP Contreras" dnr[218]["manager"] = "Alfred Arnaud" dnr[219]["manager"] = "Joe Klewicki" dnr[220]["manager"] = "David Hastoglis" dnr[221]["manager"] = "Alfred Arnaud" dnr[222]["manager"] = "Joe Klewicki" dnr[223]["manager"] = "MaryBeth Ostasz" dnr[224]["manager"] = "Alfred Arnaud" dnr[225]["manager"] = "Alfred Arnaud" dnr[226]["manager"] = "John Spyers" dnr[227]["manager"] = "Alfred Arnaud" dnr[228]["manager"] = "Paul Patterson" dnr[229]["manager"] = "Alfred Arnaud" dnr[230]["manager"] = "Joe Klewicki" dnr[231]["manager"] = "Alfred Arnaud" dnr[232]["manager"] = "Alfred Arnaud" dnr[233]["manager"] = "Vishal Rajpal" dnr[234]["manager"] = "Joe Klewicki" dnr[235]["manager"] = "Hari Madamalla" dnr[236]["manager"] = "David Hastoglis" dnr[237]["manager"] = "Joe Klewicki" dnr[238]["manager"] = "Alfred Arnaud" dnr[239]["manager"] = "John Griffin" dnr[240]["manager"] = "Hari Madamalla" dnr[241]["manager"] = "Chris Wilson" dnr[242]["manager"] = "Alfred Arnaud" dnr[243]["manager"] = "Alfred Arnaud" dnr[244]["manager"] = "Hari Madamalla" dnr[245]["manager"] = "Alfred Arnaud" dnr[246]["manager"] = "JP Contreras" dnr[247]["manager"] = "Alfred Arnaud" dnr[248]["manager"] = "Alfred Arnaud" dnr[249]["manager"] = "Alfred Arnaud" dnr[250]["manager"] = "Jim Roberts" dnr[251]["manager"] = "Joe Klewicki" dnr[252]["manager"] = "Alfred Arnaud" dnr[253]["manager"] = "Alfred Arnaud" dnr[254]["manager"] = "Chris Wilson" dnr[255]["manager"] = "Alfred Arnaud" dnr[256]["manager"] = "Alfred Arnaud" dnr[257]["manager"] = "Alfred Arnaud" dnr[258]["manager"] = "Joe Klewicki" dnr[259]["manager"] = "Alfred Arnaud" dnr[260]["manager"] = "Derek Tanahill" dnr[261]["manager"] = "Alfred Arnaud" dnr[262]["manager"] = "John Griffin" dnr[263]["manager"] = "Alfred Arnaud" dnr[264]["manager"] = "Alfred Arnaud" dnr[265]["manager"] = "Joe Klewicki" dnr[266]["manager"] = "Alfred Arnaud" dnr[267]["manager"] = "Alfred Arnaud" dnr[268]["manager"] = "Ruth Minj" dnr[269]["manager"] = "Joe Klewicki" dnr[270]["manager"] = "John Spyers" dnr[271]["manager"] = "JP Contreras" dnr[272]["manager"] = "Alfred Arnaud" dnr[273]["manager"] = "Alfred Arnaud" dnr[274]["manager"] = "Alfred Arnaud" dnr[275]["manager"] = "Alfred Arnaud" dnr[276]["manager"] = "Chris Wilson" dnr[277]["manager"] = "Alfred Arnaud" dnr[278]["manager"] = "Alfred Arnaud" dnr[279]["manager"] = "Alfred Arnaud" dnr[280]["manager"] = "Derek Tanahill" dnr[281]["manager"] = "Vishal Rajpal" dnr[282]["manager"] = "Joe Klewicki" dnr[283]["manager"] = "Vishal Rajpal" dnr[284]["manager"] = "Joe Klewicki" dnr[285]["manager"] = "Chris Wilson" dnr[286]["manager"] = "Paul Patterson" dnr[287]["manager"] = "David Hastoglis" dnr[288]["manager"] = "Vishal Rajpal" dnr[289]["manager"] = "JP Contreras" dnr[290]["manager"] = "Joe Klewicki" dnr[291]["manager"] = "Hari Madamalla" dnr[292]["manager"] = "Derek Tanahill" dnr[293]["manager"] = "Jon Nance" dnr[294]["manager"] = "Alfred Arnaud" dnr[295]["manager"] = "Chris Wilson" dnr[296]["manager"] = "Alfred Arnaud" dnr[297]["manager"] = "Alfred Arnaud" dnr[298]["manager"] = "Alfred Arnaud" dnr[299]["manager"] = "Alfred Arnaud" dnr[300]["manager"] = "Chris Wilson" dnr[301]["manager"] = "Chris Wilson" dnr[302]["manager"] = "Jon Nance" dnr[303]["manager"] = "Alfred Arnaud" dnr[304]["manager"] = "John Griffin" dnr[305]["manager"] = "Joe Klewicki" dnr[306]["manager"] = "Alfred Arnaud" dnr[307]["manager"] = "MaryBeth Ostasz" dnr[308]["manager"] = "Alfred Arnaud" dnr[309]["manager"] = "Joe Klewicki" dnr[310]["manager"] = "Paul Patterson" dnr[311]["manager"] = "MaryBeth Ostasz" dnr[312]["manager"] = "Joe Klewicki" dnr[313]["manager"] = "Joe Klewicki" dnr[314]["manager"] = "Ruth Minj" dnr[315]["manager"] = "John Griffin" dnr[316]["manager"] = "Joe Klewicki" dnr[317]["manager"] = "Joe Klewicki" dnr[318]["manager"] = "Alfred Arnaud" dnr[319]["manager"] = "Joel Stanesa" dnr[320]["manager"] = "Alfred Arnaud" dnr[321]["manager"] = "Joe Klewicki" dnr[322]["manager"] = "Joe Klewicki" dnr[323]["manager"] = "John Spyers" dnr[324]["manager"] = "Jim Roberts" dnr[325]["manager"] = "Derek Tanahill" dnr[326]["manager"] = "Joe Klewicki" dnr[327]["manager"] = "Joe Klewicki" dnr[328]["manager"] = "Joe Klewicki" dnr[329]["manager"] = "Joe Klewicki" dnr[330]["manager"] = "John Griffin" dnr[331]["manager"] = "Alfred Arnaud" dnr[332]["manager"] = "Alfred Arnaud" dnr[333]["manager"] = "Alfred Arnaud" dnr[334]["manager"] = "Alfred Arnaud" dnr[335]["manager"] = "Alfred Arnaud" dnr[336]["manager"] = "John Griffin" TextWindow.title = "Check Caution List" begin: TextWindow.ForegroundColor = "red" TextWindow.Writeline("Please enter the first few letters of the company name: ") 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>LMP326.sb< Start>LMP765.sb< Sub Welcome GraphicsWindow.Width= 800 GraphicsWindow.Height = 500 GraphicsWindow.BackgroundColor = "RoyalBlue" GraphicsWindow.BrushColor = "#EEE8AA" GraphicsWindow.FillRectangle ( 0,0, 20 , 260 ) GraphicsWindow.FillRectangle ( 0 ,260 , 20 , 240 ) GraphicsWindow.FillRectangle ( 20 ,0 , 780 , 20 ) GraphicsWindow.FillRectangle ( 20 , 480 , 780 , 20 ) GraphicsWindow.FillRectangle ( 780 , 20 , 20 , 500) GraphicsWindow.BrushColor = "RoyalBlue" GraphicsWindow.FillRectangle(20, 20, 760, 460) GraphicsWindow.FontName = "Comic Sans MS" graphicsWindow.FontSize = 40 GraphicsWindow.BrushColor = "White" GraphicsWindow.DrawText(201, 50, "Welcome to W.H.G") GraphicsWindow.FontName = "Comic Sans MS" graphicsWindow.FontSize = 20 GraphicsWindow.BrushColor = "White" GraphicsWindow.DrawText(201, 100 , "Ranked #1 game in the Southern Hemisphere") GraphicsWindow.FontName = "Comic Sans MS" graphicsWindow.FontSize = 20 GraphicsWindow.BrushColor = "White" GraphicsWindow.DrawText(201, 150, " Use the arrow keys to move your player ") GraphicsWindow.DrawText(201, 200, "Once you touch the barrier you cannot move ") GraphicsWindow.drawtext ( 201 , 250 , "Your mission is to reach the red square") GraphicsWindow.drawtext ( 201 , 300 , " There are 3 levels") GraphicsWindow.drawtext ( 201 , 350 , "Good LUCK!!, you need it...") GraphicsWindow.drawtext ( 201 , 400 , "Press Space to begin") While welcome_loop <> 1 ' while message is up player has the ability to quit or proceed to next level welcome_key = GraphicsWindow.LastKey If welcome_key = "Space" Then 'quit GraphicsWindow.Clear() Goto restart welcome_loop = 1 EndIf If welcome_key = "Q" Then Program.End() EndIf EndWhile EndSub Welcome() '__________________________________________________________________________ restart: 'restart the program initialise () ' Intitialize variables add_boundries() 'draw boundries GraphicsWindow.KeyDown = move_square 'key down event While gameover <> 0 'while game is being played keep theses subroutines running enemy1 () enemy2 () 'enemies enemy3 () enemy4() enemy5() 'debug () collision_1() collision_2() 'collison between each enemy and the player collision_3() collision_4() collision_5() winning () 'when you win loseing()' when you lose 'Sound.Play("T:\94726_growing_on_me.mp3") ' background music If win = 1 Then ' if game is won then stop everything moving and display message gameover = 0 EndIf If lose = 1 then ' if game is lost then stop all graphics and display message gameover = 0 endif endwhile If playagain= 1 then GraphicsWindow.Clear () ' if user chooses to play again clear everything and reset all graphics and variables to original gameover = 1 win = 0 lose = 0 playagain = 0 level = 1 lose_box = 1 Goto restart ' restart game GraphicsWindow.KeyDown = move_square endif '____________________________________________________________________________ round_2: if level = 2 then GraphicsWindow.Clear() add_boundries_2() initialise_2() GraphicsWindow.KeyDown = move_square endif While new_level <> 0 'while game is being played keep theses subroutines running enemy1_2() enemy2_2() enemy3_2() enemy4_2() enemy5_2() enemy6_2() enemy7_2() enemy8_2() enemy9_2() collision_1_2() collision_2_2() collision_3_2() collision_4_2() collision_5_2() collision_6_2() collision_7_2() collision_8_2() collision_9_2() winning_2 () 'when you win loesing_2() ' when you lose 'Sound.Play("T:\94726_growing_on_me.mp3") ' background music If lose_2=1 then new_level = 0 endif If win_2 = 1 Then Program.End() EndIf If playagain_2 = 1 then GraphicsWindow.Clear() add_boundries_2()' initialise_2() Goto round_2 level = 2 new_level = 1 endif EndWhile '_______________________________________________________________________________________________ Sub level_3 round_3: GraphicsWindow.Clear() add_boundries_3() initialise_3() GraphicsWindow.KeyDown = move_square_2 While new_level <> 0 'while game is being played keep theses subroutines running enemy1_2() enemy2_2() enemy3_2() enemy4_2() enemy5_2() enemy6_2() enemy7_2() enemy8_2() enemy9_2() collision_1_2() collision_2_2() collision_3_2() collision_4_2() collision_5_2() collision_6_2() collision_7_2() collision_8_2() collision_9_2() collision_friend() winning_3() 'when you win loesing_2() ' when you lose 'Sound.Play("T:\94726_growing_on_me.mp3") ' background music If lose_2 =1 then new_level = 0 endif If playagain_3 = 1 then GraphicsWindow.Clear() add_boundries_3()' initialise_3() 'Goto round_3 level = 3 new_level = 1 endif EndWhile If playagain_3 = 1 Then Goto round_3 EndIf EndSub '_________________________________________________________________________________ sub move_square ' sub routine that allows user to move player and does not allow them to move further if they hit the boundries key = GraphicsWindow.LastKey If key = "Left" and (GraphicsWindow.GetPixel (square_x - 5,square_y) <> "#EEE8AA" AND GraphicsWindow.GetPixel (square_x - 5 , square_y + 40 ) <> "#EEE8AA" and GraphicsWindow.GetPixel (square_x, square_y + 20 ) <> "#EEE8AA") Then square_x = square_x - 10 EndIf If key = "Right" and ( GraphicsWindow.GetPixel (square_x + 45 , square_y ) <> "#EEE8AA" and GraphicsWindow.GetPixel (square_x + 45 , square_y + 40 ) <> "#EEE8AA" ) Then square_x = square_x + 10 EndIf If key = "Up" and ( GraphicsWindow.GetPixel (square_x , square_y - 5 ) <> "#EEE8AA" and GraphicsWindow.GetPixel (square_x + 40 , square_y -5 ) <> "#EEE8AA" ) Then square_y = square_y- 10 endif If key = "Down" and ( GraphicsWindow.GetPixel (square_x , square_y + 45 ) <> "#EEE8AA" and GraphicsWindow.GetPixel (square_x + 40 , square_y +45 ) <> "#EEE8AA" ) Then square_y = square_y + 10 endif Shapes.Move ( square , square_x, square_y) EndSub sub move_square_2 ' sub routine that allows user to move player and does not allow them to move further if they hit the boundries key = GraphicsWindow.LastKey If key = "Left" and (GraphicsWindow.GetPixel (square_x - 5,square_y) <> "#EEE8AA" AND GraphicsWindow.GetPixel (square_x - 5 , square_y + 40 ) <> "#EEE8AA" and GraphicsWindow.GetPixel (square_x, square_y + 20 ) <> "#EEE8AA") Then square_x = square_x - 15 EndIf If key = "Right" and ( GraphicsWindow.GetPixel (square_x + 45 , square_y ) <> "#EEE8AA" and GraphicsWindow.GetPixel (square_x + 45 , square_y + 40 ) <> "#EEE8AA" ) Then square_x = square_x + 15 EndIf If key = "Up" and ( GraphicsWindow.GetPixel (square_x , square_y - 5 ) <> "#EEE8AA" and GraphicsWindow.GetPixel (square_x + 40 , square_y -5 ) <> "#EEE8AA" ) Then square_y = square_y- 15 endif If key = "Down" and ( GraphicsWindow.GetPixel (square_x , square_y + 45 ) <> "#EEE8AA" and GraphicsWindow.GetPixel (square_x + 40 , square_y +45 ) <> "#EEE8AA" ) Then square_y = square_y + 15 endif Shapes.Move ( square , square_x, square_y) EndSub Sub enemy1 'right ___yellow enemy colour_enemy1_left = (GraphicsWindow.GetPixel (enemy1_x ,enemy1_y+20)) 'were colour is being detected colour_enemy1_right = (GraphicsWindow.GetPixel (enemy1_x + 40 ,enemy1_y+20)) If colour_enemy1_left= "#EEE8AA" Then direction_enemy1 = -direction_enemy1 endif 'Whether the enemy will go left or right depending on what colour it detects If colour_enemy1_right= "#EEE8AA" Then direction_enemy1 = -direction_enemy1 endif enemy1_x=enemy1_x + direction_enemy1 Shapes.Move(enemy1, enemy1_x, enemy1_y) EndSub Sub enemy2 'top__yellow enemy colour_enemy2_top = (GraphicsWindow.GetPixel (enemy2_x + 20 ,enemy2_y)) colour_enemy2_bottom = (GraphicsWindow.GetPixel (enemy2_x + 20,enemy2_y + 40)) 'were colour is being detected If colour_enemy2_bottom = "#EEE8AA" Then direction_enemy2 = -direction_enemy2 endif 'Whether the enemy will go left or right depending on what colour it detects If colour_enemy2_top = "#EEE8AA" Then direction_enemy2= -direction_enemy2 endif enemy2_y=enemy2_y + direction_enemy2 Shapes.Move(enemy2, enemy2_x, enemy2_y) endsub Sub enemy3 'bottom ___blue enemy colour_enemy3_bottom = (GraphicsWindow.GetPixel (enemy3_x + 20 ,enemy3_y+ 40 )) 'were colour is being detected colour_enemy3_top = (GraphicsWindow.GetPixel (enemy3_x + 20 ,enemy3_y)) If colour_enemy3_bottom= "#EEE8AA" Then direction_enemy3 = -direction_enemy3 endif If colour_enemy3_top = "#EEE8AA" Then direction_enemy3 = -direction_enemy3 endif 'Whether the enemy will go left or right depending on what colour it detects enemy3_y = enemy3_y + direction_enemy3 shapes.Move(enemy3, enemy3_x, enemy3_y) EndSub Sub enemy4 'bottom ___blue enemy colour_enemy4_bottom = (GraphicsWindow.GetPixel (enemy4_x + 20 ,enemy4_y+ 40 )) 'were colour is being detected colour_enemy4_top = (GraphicsWindow.GetPixel (enemy4_x + 20 ,enemy4_y)) If colour_enemy4_bottom= "#EEE8AA" Then direction_enemy4 = -direction_enemy4 endif If colour_enemy4_top = "#EEE8AA" Then direction_enemy4 = -direction_enemy4 endif 'Whether the enemy will go left or right depending on what colour it detects enemy4_y = enemy4_y + direction_enemy4 shapes.Move(enemy4, enemy4_x, enemy4_y) EndSub Sub enemy5'bottom ___blue enemy colour_enemy5_bottom = (GraphicsWindow.GetPixel (enemy5_x + 20 ,enemy5_y+ 40 )) 'were colour is being detected colour_enemy5_top = (GraphicsWindow.GetPixel (enemy5_x + 20 ,enemy5_y)) If colour_enemy5_bottom= "#EEE8AA" Then direction_enemy5 = -direction_enemy5 endif If colour_enemy5_top = "#EEE8AA" Then direction_enemy5 = -direction_enemy5 endif 'Whether the enemy will go left or right depending on what colour it detects enemy5_y = enemy5_y + direction_enemy5 shapes.Move(enemy5, enemy5_x, enemy5_y) EndSub 'Collision between each anemy to the player sub collision_1 square_centerx = (square_x + (square_width/2 + 3)) 'Square centre square_centery = (square_y + (square_height/2)) enemy1_centerx = enemy1_x + 20 enemy1_centery = enemy1_y + 20 'enemy centre collision = Math.SquareRoot((square_centerx - enemy1_centerx) * (square_centerx - enemy1_centerx) + (square_centery - enemy1_centery) * (square_centery - enemy1_centery)) 'equation that i dont get but works accuratley If collision <40 then lose = 1 'if collision is succesfull player has lost the game endif EndSub sub collision_3 square_centerx = (square_x + (square_width/2)) square_centery = (square_y + (square_height/2)) enemy3_centerx = enemy3_x + 20 enemy3_centery = enemy3_y + 20 collision = Math.SquareRoot((square_centerx - enemy3_centerx) * (square_centerx - enemy3_centerx) + (square_centery - enemy3_centery) * (square_centery - enemy3_centery)) If collision < 40 Then lose = 1 endif EndSub sub collision_2 square_centerx = (square_x + (square_width/2)) square_centery = (square_y + (square_height/2)) enemy2_centerx = enemy2_x + 20 enemy2_centery = enemy2_y + 20 collision = Math.SquareRoot((square_centerx - enemy2_centerx) * (square_centerx - enemy2_centerx) + (square_centery - enemy2_centery) * (square_centery - enemy2_centery)) If collision < 40 Then lose= 1 endif EndSub sub collision_4 square_centerx = (square_x + (square_width/2)) square_centery = (square_y + (square_height/2)) enemy4_centerx = enemy4_x + 20 enemy4_centery = enemy4_y + 20 collision = Math.SquareRoot((square_centerx - enemy4_centerx) * (square_centerx - enemy4_centerx) + (square_centery - enemy4_centery) * (square_centery - enemy4_centery)) If collision < 40 Then lose= 1 endif EndSub sub collision_5 square_centerx = (square_x + (square_width/2)) square_centery = (square_y + (square_height/2)) enemy5_centerx = enemy5_x + 20 enemy5_centery = enemy5_y + 20 collision = Math.SquareRoot((square_centerx - enemy5_centerx) * (square_centerx - enemy5_centerx) + (square_centery - enemy5_centery) * (square_centery - enemy5_centery)) If collision < 40 Then lose= 1 endif EndSub Sub debug 'Displays colours,coordinates if enabled graphicsWindow.FontSize = 14 GraphicsWindow.BrushColor = "Gray" GraphicsWindow.FillRectangle(70, 70, 135, 120) GraphicsWindow.BrushColor = "White" GraphicsWindow.DrawText(70, 70, "you pressed " + key) GraphicsWindow.DrawText(70, 90, "square_x " + square_x) GraphicsWindow.DrawText(70, 120, "square_y " + square_y) colour = GraphicsWindow.GetPixel (square_x, square_y ) 'GraphicsWindow.DrawText(70, 130, "colour =" + colour_enemy1) endsub Sub add_boundries GraphicsWindow.BrushColor = "#EEE8AA" GraphicsWindow.FillRectangle ( 0 , 240 , 550 , 20) GraphicsWindow.FillRectangle ( 0,0, 20 , 240 ) GraphicsWindow.FillRectangle ( 0 ,260 , 20 , 240 ) GraphicsWindow.FillRectangle (0,260,20,240 ) GraphicsWindow.FillRectangle ( 20 ,0 , 780 , 20 ) GraphicsWindow.FillRectangle ( 20 , 480 , 780 , 20 ) GraphicsWindow.FillRectangle ( 780 , 20 , 20 , 500) GraphicsWindow.BrushColor = "Chartreuse" GraphicsWindow.FillRectangle (20 , 20 , 80 , 80 ) GraphicsWindow.BrushColor = "red" GraphicsWindow.FillRectangle ( 20 , 400 , 80 , 80 ) EndSub Sub add_boundries_2 GraphicsWindow.BrushColor = "#EEE8AA" GraphicsWindow.FillRectangle ( 0,0, 20 , 260 ) GraphicsWindow.FillRectangle ( 0 ,260 , 20 , 240 ) GraphicsWindow.FillRectangle ( 20 ,0 , 780 , 20 ) GraphicsWindow.FillRectangle ( 20 , 480 , 780 , 20 ) GraphicsWindow.FillRectangle ( 780 , 20 , 20 , 500) GraphicsWindow.BrushColor = "Chartreuse" GraphicsWindow.FillRectangle(100,20,80,80) GraphicsWindow.BrushColor = "Red" GraphicsWindow.FillRectangle (380,20,80,80) GraphicsWindow.BrushColor = "#EEE8AA" GraphicsWindow.FillRectangle (20,250,100,20) GraphicsWindow.FillRectangle (360,230,250,20) GraphicsWindow.FillRectangle(340,20,20,340) EndSub Sub add_boundries_3 GraphicsWindow.BrushColor = "#EEE8AA" GraphicsWindow.FillRectangle ( 0,0, 20 , 260 ) GraphicsWindow.FillRectangle ( 0 ,260 , 20 , 240 ) GraphicsWindow.FillRectangle ( 20 ,0 , 780 , 20 ) GraphicsWindow.FillRectangle ( 20 , 480 , 780 , 20 ) GraphicsWindow.FillRectangle ( 780 , 20 , 20 , 500) GraphicsWindow.FillRectangle ( 700 , 20 , 20 , 100) GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.FillRectangle(20,400,80,80) GraphicsWindow.BrushColor = "Chartreuse" GraphicsWindow.FillRectangle(100,20,80,80) GraphicsWindow.BrushColor = "Red" GraphicsWindow.FillRectangle (700,400,80,80) EndSub sub collision_friend square_centerx = (square_x + (square_width/2 + 3)) 'Square centre square_centery = (square_y + (square_height/2)) friend_centerx = friend_x + 20 friend_centery = friend_y + 20 'enemy centre collision = Math.SquareRoot((square_centerx - friend_centerx) * (square_centerx - friend_centerx) + (square_centery - friend_centery) * (square_centery - friend_centery)) 'equation that i dont get but works accuratley If collision <40 then good_fade() direction_enemy1_2 = 0.5 direction_enemy9_2= 0.5 'if collision is succesfull player has lost the game endif EndSub Sub good_fade For friend_opacity = 100 To 0 Step -5 Shapes.SetOpacity (friend , friend_opacity) EndFor EndSub sub winning colour_square = ( GraphicsWindow.GetPixel (square_x + 40 , square_y)) If colour_square = "#FF0000" Then 'if player reaches red square they win win = 1 EndIf If win = 1 Then ' when player wins fade out majority of graphics and display a message fade () win_message () EndIf EndSub sub winning_2 colour_square = ( GraphicsWindow.GetPixel (square_x + 40 , square_y)) If colour_square = "#FF0000" Then 'if player reaches red square they win win_2 = 1 EndIf If win_2 = 1 Then ' when player wins fade out majority of graphics and display a message fade_2 () win_message_2 () EndIf EndSub sub winning_3 colour_square = ( GraphicsWindow.GetPixel (square_x + 40 , square_y)) If colour_square = "#FF0000" Then 'if player reaches red square they win win_3 = 1 EndIf If win_3 = 1 Then ' when player wins fade out majority of graphics and display a message fade_2 () win_message_3 () EndIf EndSub sub win_message GraphicsWindow.FontName = "Comic Sans MS" graphicsWindow.FontSize = 40 GraphicsWindow.BrushColor = "Lime" GraphicsWindow.FillRectangle(20, 20, 760, 460) GraphicsWindow.BrushColor = "White" GraphicsWindow.DrawText(240, 100, "CONGRATULATIONS!!!") GraphicsWindow.DrawText(220, 200, "Press SPACE for Next Level") GraphicsWindow.DrawText(240, 150 , "You Passed Level 1") GraphicsWindow.drawtext ( 240 , 250 , "Press Q to Escape") graphicsWindow.FontSize = 15 GraphicsWindow.BrushColor = "White" GraphicsWindow.DrawText(20,20,"__________,-~-. _.–._.-~-,") GraphicsWindow.DrawText(20,40,"_________/ .- ,’_______`-. \") GraphicsWindow.DrawText(20,60,"_________ /___’()___()`___\") GraphicsWindow.DrawText(20,80,"_________|____,’(_)`.____ |") GraphicsWindow.DrawText(20,100,"_________\___( ._|_. )___ /") GraphicsWindow.DrawText(20,120,"__________\___ .__,’___ /") GraphicsWindow.DrawText(20,140,"__________.-`._______,’-.__") GraphicsWindow.DrawText(20,160,"________,’__,’___`-’___`.__`.") GraphicsWindow.DrawText(20,180,"_______/___/____N_____\___\_") GraphicsWindow.DrawText(20,200,"_____,’____/____I______\___`.__") GraphicsWindow.DrawText(20,220,"___,’_____|_____C_______|_____`.") GraphicsWindow.DrawText(20,240,"__|_____,’|_____E_______|`._____|") GraphicsWindow.DrawText(20,260,"___`.__,’_ \____!______/-._`.__,’") GraphicsWindow.DrawText(20,280,"_________/_`.___!____,’__\_") GraphicsWindow.DrawText(20,300,"__.-._,’______`._:_,’_______`.,-") GraphicsWindow.DrawText(20,320,"_/_,-._`_______)___(________’_,-.__\") GraphicsWindow.DrawText(20,340,"(_(___`._____,’_____`.______,’___)_)") GraphicsWindow.DrawText(20,360,"_\_\____\__,’________`.____/.___/_/" ) While wait <> 1 ' while message is up player has the ability to quit or proceed to next level win_key = GraphicsWindow.LastKey If win_key = "Q" Then 'quit Program.End() EndIf If win_key = "Space" Then 'playagain level = 2 wait = 1 EndIf EndWhile EndSub sub win_message_2 GraphicsWindow.FontName = "Comic Sans MS" graphicsWindow.FontSize = 40 GraphicsWindow.BrushColor = "Lime" GraphicsWindow.FillRectangle(20, 20, 760, 460) GraphicsWindow.BrushColor = "White" GraphicsWindow.DrawText(240, 100, "CONGRATULATIONS!!!") GraphicsWindow.DrawText(220, 200, "Press SPACE for Next Level") GraphicsWindow.DrawText(240, 150 , "You Passed Level 2") GraphicsWindow.drawtext ( 240 , 250 , "Your almost there!!") graphicsWindow.FontSize = 20 GraphicsWindow.drawtext ( 150 , 400, "*Hint if you need help on the next level collect the red coin " ) GraphicsWindow.drawtext ( 150 , 450,"*look in the the yellow square " ) graphicsWindow.FontSize = 15 GraphicsWindow.BrushColor = "White" GraphicsWindow.DrawText(20,20,"__________,-~-. _.–._.-~-,") GraphicsWindow.DrawText(20,40,"_________/ .- ,’_______`-. \") GraphicsWindow.DrawText(20,60,"_________ /___’()___()`___\") GraphicsWindow.DrawText(20,80,"_________|____,’(_)`.____ |") GraphicsWindow.DrawText(20,100,"_________\___( ._|_. )___ /") GraphicsWindow.DrawText(20,120,"__________\___ .__,’___ /") GraphicsWindow.DrawText(20,140,"__________.-`._______,’-.__") GraphicsWindow.DrawText(20,160,"________,’__,’___`-’___`.__`.") GraphicsWindow.DrawText(20,180,"_______/___/____N_____\___\_") GraphicsWindow.DrawText(20,200,"_____,’____/____I______\___`.__") GraphicsWindow.DrawText(20,220,"___,’_____|_____C_______|_____`.") GraphicsWindow.DrawText(20,240,"__|_____,’|_____E_______|`._____|") GraphicsWindow.DrawText(20,260,"___`.__,’_ \____!______/-._`.__,’") GraphicsWindow.DrawText(20,280,"_________/_`.___!____,’__\_") GraphicsWindow.DrawText(20,300,"__.-._,’______`._:_,’_______`.,-") GraphicsWindow.DrawText(20,320,"_/_,-._`_______)___(________’_,-.__\") GraphicsWindow.DrawText(20,340,"(_(___`._____,’_____`.______,’___)_)") GraphicsWindow.DrawText(20,360,"_\_\____\__,’________`.____/.___/_/" ) While wait <> 1 ' while message is up player has the ability to quit or proceed to next level win_key = GraphicsWindow.LastKey If win_key = "Q" Then 'quit Program.End() EndIf If win_key = "Space" Then 'playagain wait = 1 new_level = 1 level_3() EndIf EndWhile EndSub sub win_message_3 GraphicsWindow.FontName = "Comic Sans MS" graphicsWindow.FontSize = 40 GraphicsWindow.BrushColor = "RoyalBlue" GraphicsWindow.FillRectangle(20, 20, 760, 460) GraphicsWindow.BrushColor = "White" GraphicsWindow.DrawText(150, 100, "Nice!!") GraphicsWindow.DrawText(100, 150, "You made the impossible possible!!") GraphicsWindow.drawtext ( 150 , 200 , "Press Space to Exit the Game") While wait <> 1 ' while message is up player has the ability to quit or proceed to next level win_key = GraphicsWindow.LastKey If win_key = "Space" Then 'playagain wait = 1 Program.End() EndIf EndWhile EndSub Sub loseing If lose = 1 Then 'when player loses fade out majority of graphics and display a message fade () lose_message () EndIf EndSub Sub loesing_2 If lose_2 = 1 Then fade_2 () lose_message_2() EndIf EndSub sub lose_message GraphicsWindow.FontName = "Comic Sans MS" graphicsWindow.FontSize = 40 GraphicsWindow.BrushColor = "OrangeRed" GraphicsWindow.FillRectangle(20, 20, 760, 460) GraphicsWindow.BrushColor = "White" GraphicsWindow.DrawText(201, 100, "Badluck") GraphicsWindow.DrawText(201, 200, "Press SPACE to Play Again") GraphicsWindow.DrawText(201, 150, "You Died") GraphicsWindow.DrawText(201,250, "Press Q to Quit") While wait <> 1 'while the message is displayed player has the ability to quit or try again lose_key = GraphicsWindow.LastKey If lose_key = "Q" Then 'quit Program.End() EndIf If lose_key = "Space" Then ' playagian playagain = 1 wait = 1 EndIf endwhile EndSub sub lose_message_2 GraphicsWindow.FontName = "Comic Sans MS" graphicsWindow.FontSize = 40 GraphicsWindow.BrushColor = "OrangeRed" GraphicsWindow.FillRectangle(20, 20, 760, 460) GraphicsWindow.BrushColor = "White" GraphicsWindow.DrawText(201, 100, "Badluck") GraphicsWindow.DrawText(201, 200, "Press SPACE to Play Again") GraphicsWindow.DrawText(201, 150, "You Died") GraphicsWindow.DrawText(201,250, "Press Q to Quit") While wait <> 1 'while the message is displayed player has the ability to quit or try again lose_key = GraphicsWindow.LastKey If lose_key = "Q" Then 'quit Program.End() EndIf If lose_key = "Space" Then ' playagian playagain_2 = 1 playagain_3 = 1 wait = 1 EndIf EndWhile endsub sub fade ' fade out everything by lowering the opacity For square_opacity = 100 To 0 Step -5 Shapes.SetOpacity (square, square_opacity) Program.Delay (10) EndFor For enemy1_opacity = 100 To 0 Step -5 Shapes.SetOpacity (enemy1,enemy1_opacity) Program.Delay (10) EndFor For enemy2_opacity = 100 To 0 Step -5 Shapes.SetOpacity (enemy2,enemy2_opacity) Program.Delay (10) EndFor For enemy3_opacity = 100 To 0 Step -5 Shapes.SetOpacity (enemy3 ,enemy3_opacity) Program.Delay (10) EndFor For enemy4_opacity = 100 To 0 Step -5 Shapes.SetOpacity (enemy4 ,enemy4_opacity) Program.Delay (10) EndFor For enemy5_opacity = 100 To 0 Step -5 Shapes.SetOpacity (enemy5 ,enemy5_opacity) Program.Delay (10) EndFor if playagain=1 Then square_opacity= 100 EndIf EndSub Sub initialise 'enforce all variables and graphic window square_x = 40 'player x position square_y = 40 'player y position GraphicsWindow.BrushColor = "orange" square = Shapes.AddRectangle (40 , 40 ) square_height = 40 square_width = 40 Shapes.Move ( square , square_x , square_y ) wait = 0 'cheat codes - super speed, god mode , music for menu and each level, 'world class menu , timer, piont score base on time enemy1_x = 650 'left enemy1_y = 225 GraphicsWindow.BrushColor = "yellow" enemy1 = Shapes.AddEllipse(40, 40) direction_enemy1 = 0.2 enemy2_x = 400 'top enemy2_y = 100 GraphicsWindow.BrushColor = "green" enemy2 = Shapes.AddEllipse ( 40, 40 ) direction_enemy2 = 0.2 enemy3_x = 400 enemy3_y = 350 GraphicsWindow.BrushColor = "blue" 'bottom enemy3 = Shapes.AddEllipse ( 40 ,40 ) direction_enemy3 = 0.2 enemy4_x = 200 enemy4_y = 150 GraphicsWindow.BrushColor = "Purple" 'bottom enemy4 = Shapes.AddEllipse ( 40 ,40 ) direction_enemy4 = 0.2 enemy5_x = 200 enemy5_y = 400 GraphicsWindow.BrushColor = "blue" 'bottom enemy5 = Shapes.AddEllipse ( 40 ,40 ) direction_enemy5 = 0.2 GraphicsWindow.Width= 800 GraphicsWindow.Height = 500 GraphicsWindow.BackgroundColor = "RoyalBlue" gameover = 1 win = 0 lose = 0 playagain = 0 level = 1 lose_box = 1 'opacity square_opacity = 100 Shapes.SetOpacity (square , square_opacity) enemy1_opacity = 100 Shapes.SetOpacity (enemy1, enemy1_opacity ) enemy2_opacity = 100 Shapes.SetOpacity ( enemy2 , enemy2_opacity ) enemy3_opacity = 100 Shapes.SetOpacity (enemy3 , enemy3_opacity) enemy4_opacity = 100 Shapes.SetOpacity (enemy4 , enemy4_opacity) enemy5_opacity = 100 Shapes.SetOpacity (enemy5 , enemy5_opacity) endsub sub initialise_2 square_x = 110 'player x position 100,20 square_y = 30 'player y position GraphicsWindow.BrushColor = "orange" square = Shapes.AddRectangle (40 , 40 ) square_height = 40 square_width = 40 Shapes.Move ( square , square_x , square_y ) wait = 0 'cheat codes - super speed, god mode , music for menu and each level, 'world class menu , timer, piont score base on time enemy1_2_x = 150 enemy1_2_y = 420 GraphicsWindow.BrushColor = "yellow" enemy1_2 = Shapes.AddEllipse(40, 40) Shapes.Move ( enemy1_2 , enemy1_2_x , enemy1_2_y ) direction_enemy1_2 = 0.2 enemy2_2_x = 260 enemy2_2_y = 240 GraphicsWindow.BrushColor = "green" enemy2_2 = Shapes.AddEllipse ( 40, 40 ) Shapes.Move ( enemy2_2 , enemy2_2_x , enemy2_2_y ) direction_enemy2_2 = 0.2 enemy3_2_x = 400 enemy3_2_y = 360 GraphicsWindow.BrushColor = "blue" enemy3_2 = Shapes.AddEllipse ( 40 ,40 ) Shapes.Move ( enemy3_2 , enemy3_2_x , enemy3_2_y ) direction_enemy3_2 = 0.2 enemy4_2_x = 500 enemy4_2_y = 280 GraphicsWindow.BrushColor = "Chartreuse" enemy4_2 = Shapes.AddEllipse ( 40 ,40 ) Shapes.Move ( enemy4_2 , enemy4_2_x , enemy4_2_y ) direction_enemy4_2 = 0.2 enemy5_2_x = 300 enemy5_2_y = 320 GraphicsWindow.BrushColor = "brown" enemy5_2 = Shapes.AddEllipse ( 40 ,40 ) Shapes.Move ( enemy5_2 , enemy5_2_x , enemy5_2_y ) direction_enemy5_2 = 0.2 enemy6_2_x = 100 enemy6_2_y = 150 GraphicsWindow.BrushColor = "HotPink" enemy6_2 = Shapes.AddEllipse (40 , 40 ) Shapes.Move ( enemy6_2 , enemy6_2_x , enemy6_2_y ) direction_enemy6_2 = 0.2 enemy7_2_x = 700 enemy7_2_y = 217 GraphicsWindow.BrushColor = "DarkMagenta" enemy7_2 = Shapes.AddEllipse (40 , 40 ) Shapes.Move ( enemy7_2 , enemy7_2_x , enemy7_2_y ) direction_enemy7_2 = 0.2 enemy8_2_x = 650 enemy8_2_y = 150 GraphicsWindow.BrushColor = "SandyBrown" enemy8_2 = Shapes.AddEllipse (40 , 40 ) Shapes.Move ( enemy8_2 , enemy8_2_x , enemy8_2_y ) direction_enemy8_2 = 0.2 enemy9_2_x = 330 enemy9_2_y = 400 GraphicsWindow.BrushColor = "Cyan" enemy9_2 = Shapes.AddEllipse (40 , 40 ) Shapes.Move ( enemy9_2 , enemy9_2_x , enemy9_2_y ) direction_enemy9_2 = 0.2 GraphicsWindow.Width= 800 GraphicsWindow.Height = 500 GraphicsWindow.BackgroundColor = "RoyalBlue" win_2 = 0 level = 2 lose_box = 1 lose_2 = 0 playagain_2 = 0 'opacity square_opacity = 100 Shapes.SetOpacity (square , square_opacity) enemy1_2_opacity = 100 Shapes.SetOpacity (enemy1, enemy1_opacity ) enemy2_2_opacity = 100 Shapes.SetOpacity ( enemy2 , enemy2_opacity ) enemy3_2_opacity = 100 Shapes.SetOpacity (enemy3 , enemy3_opacity) enemy4_2_opacity = 100 Shapes.SetOpacity (enemy4_2 , enemy4_2_opacity) enemy5_2_opacity = 100 Shapes.SetOpacity (enemy5_2 , enemy5_2_opacity) enemy6_2_opacity = 100 Shapes.SetOpacity (enemy6_2 , enemy6_2_opacity) enemy7_2_opacity = 100 Shapes.SetOpacity (enemy7_2 , enemy7_2_opacity) enemy8_2_opacity = 100 Shapes.SetOpacity (enemy8_2 , enemy8_2_opacity) enemy9_2_opacity = 100 Shapes.SetOpacity (enemy9_2 , enemy9_2_opacity) gameover=0 new_level=1 EndSub sub initialise_3 square_x = 110 'player x position 100,20 square_y = 30 'player y position GraphicsWindow.BrushColor = "orange" square = Shapes.AddRectangle (40 , 40 ) square_height = 40 square_width = 40 Shapes.Move ( square , square_x , square_y ) wait = 0 'cheat codes - super speed, god mode , music for menu and each level, 'world class menu , timer, piont score base on time enemy1_2_x = 150 enemy1_2_y = 420 GraphicsWindow.BrushColor = "yellow" '______________ enemy1_2 = Shapes.AddEllipse(40, 40) Shapes.Move ( enemy1_2 , enemy1_2_x , enemy1_2_y ) direction_enemy1_2 = 2 enemy2_2_x = 260 enemy2_2_y = 240 GraphicsWindow.BrushColor = "green" enemy2_2 = Shapes.AddEllipse ( 40, 40 ) Shapes.Move ( enemy2_2 , enemy2_2_x , enemy2_2_y ) direction_enemy2_2 = 2 enemy3_2_x = 400 enemy3_2_y = 360 GraphicsWindow.BrushColor = "blue" enemy3_2 = Shapes.AddEllipse ( 40 ,40 ) Shapes.Move ( enemy3_2 , enemy3_2_x , enemy3_2_y ) direction_enemy3_2 = 2 enemy4_2_x = 500 enemy4_2_y = 280 GraphicsWindow.BrushColor = "Chartreuse" enemy4_2 = Shapes.AddEllipse ( 40 ,40 ) Shapes.Move ( enemy4_2 , enemy4_2_x , enemy4_2_y ) direction_enemy4_2 = 2 enemy5_2_x = 300 enemy5_2_y = 320 GraphicsWindow.BrushColor = "brown" enemy5_2 = Shapes.AddEllipse ( 40 ,40 ) Shapes.Move ( enemy5_2 , enemy5_2_x , enemy5_2_y ) direction_enemy5_2 = 2 enemy6_2_x = 100 enemy6_2_y = 150 GraphicsWindow.BrushColor = "HotPink" enemy6_2 = Shapes.AddEllipse (40 , 40 ) Shapes.Move ( enemy6_2 , enemy6_2_x , enemy6_2_y ) direction_enemy6_2 =2 enemy7_2_x = 700 enemy7_2_y = 217 GraphicsWindow.BrushColor = "DarkMagenta" enemy7_2 = Shapes.AddEllipse (40 , 40 ) Shapes.Move ( enemy7_2 , enemy7_2_x , enemy7_2_y ) direction_enemy7_2 = 2 enemy8_2_x = 650 enemy8_2_y = 150 GraphicsWindow.BrushColor = "SandyBrown" enemy8_2 = Shapes.AddEllipse (40 , 40 ) Shapes.Move ( enemy8_2 , enemy8_2_x , enemy8_2_y ) direction_enemy8_2 = 3 enemy9_2_x = 330 enemy9_2_y = 400 GraphicsWindow.BrushColor = "Cyan" enemy9_2 = Shapes.AddEllipse (40 , 40 ) Shapes.Move ( enemy9_2 , enemy9_2_x , enemy9_2_y ) direction_enemy9_2 = 2 friend_x = 40 friend_y = 430 GraphicsWindow.BrushColor = "Red" friend = Shapes.AddEllipse (40 , 40 ) Shapes.Move ( friend , friend_x , friend_y ) GraphicsWindow.Width= 800 GraphicsWindow.Height = 500 GraphicsWindow.BackgroundColor = "RoyalBlue" win_2 = 0 level = 2 lose_box = 1 lose_2 = 0 playagain_3 = 0 'opacity square_opacity = 100 Shapes.SetOpacity (square , square_opacity) enemy1_2_opacity = 100 Shapes.SetOpacity (enemy1, enemy1_opacity ) enemy2_2_opacity = 100 Shapes.SetOpacity ( enemy2 , enemy2_opacity ) enemy3_2_opacity = 100 Shapes.SetOpacity (enemy3 , enemy3_opacity) enemy4_2_opacity = 100 Shapes.SetOpacity (enemy4_2 , enemy4_2_opacity) enemy5_2_opacity = 100 Shapes.SetOpacity (enemy5_2 , enemy5_2_opacity) enemy6_2_opacity = 100 Shapes.SetOpacity (enemy6_2 , enemy6_2_opacity) enemy7_2_opacity = 100 Shapes.SetOpacity (enemy7_2 , enemy7_2_opacity) enemy8_2_opacity = 100 Shapes.SetOpacity (enemy8_2 , enemy8_2_opacity) enemy9_2_opacity = 100 Shapes.SetOpacity (enemy9_2 , enemy9_2_opacity) friend_opacity = 100 Shapes.SetOpacity (friend , friend_opacity) gameover=0 new_level=1 EndSub Sub enemy1_2 colour_enemy1_2_left = (GraphicsWindow.GetPixel (enemy1_2_x ,enemy1_2_y + 20 )) 'were colour is being detected colour_enemy1_2_right = (GraphicsWindow.GetPixel (enemy1_2_x + 40 ,enemy1_2_y+20)) If colour_enemy1_2_left= "#EEE8AA" Then direction_enemy1_2 = -direction_enemy1_2 endif If colour_enemy1_2_right = "#EEE8AA" Then direction_enemy1_2 = -direction_enemy1_2 endif 'Whether the enemy will go left or right depending on what colour it detects enemy1_2_x = enemy1_2_x + direction_enemy1_2 shapes.Move(enemy1_2, enemy1_2_x, enemy1_2_y) EndSub Sub enemy2_2 colour_enemy2_2_left = (GraphicsWindow.GetPixel (enemy2_2_x ,enemy2_2_y + 20 )) 'were colour is being detected colour_enemy2_2_right = (GraphicsWindow.GetPixel (enemy2_2_x + 40 ,enemy2_2_y+20)) If colour_enemy2_2_left= "#EEE8AA" Then direction_enemy2_2 = -direction_enemy2_2 endif If colour_enemy2_2_right = "#EEE8AA" Then direction_enemy2_2 = -direction_enemy2_2 endif 'Whether the enemy will go left or right depending on what colour it detects enemy2_2_x = enemy2_2_x + direction_enemy2_2 shapes.Move(enemy2_2, enemy2_2_x, enemy2_2_y) EndSub Sub enemy3_2 colour_enemy3_2_left = (GraphicsWindow.GetPixel (enemy3_2_x ,enemy3_2_y + 20 )) 'were colour is being detected colour_enemy3_2_right = (GraphicsWindow.GetPixel (enemy3_2_x + 40 ,enemy3_2_y+20)) If colour_enemy3_2_left= "#EEE8AA" Then direction_enemy3_2 = -direction_enemy3_2 endif If colour_enemy3_2_right = "#EEE8AA" Then direction_enemy3_2 = -direction_enemy3_2 endif 'Whether the enemy will go left or right depending on what colour it detects enemy3_2_x = enemy3_2_x + direction_enemy3_2 shapes.Move(enemy3_2, enemy3_2_x, enemy3_2_y) EndSub Sub enemy4_2 colour_enemy4_2_left = (GraphicsWindow.GetPixel (enemy4_2_x ,enemy4_2_y + 20 )) 'were colour is being detected colour_enemy4_2_right = (GraphicsWindow.GetPixel (enemy4_2_x + 40 ,enemy4_2_y+20)) If colour_enemy4_2_left= "#EEE8AA" Then direction_enemy4_2 = -direction_enemy4_2 endif If colour_enemy4_2_right = "#EEE8AA" Then direction_enemy4_2 = -direction_enemy4_2 endif 'Whether the enemy will go left or right depending on what colour it detects enemy4_2_x = enemy4_2_x + -direction_enemy4_2 shapes.Move(enemy4_2, enemy4_2_x, enemy4_2_y) EndSub Sub enemy5_2 colour_enemy5_2_left = (GraphicsWindow.GetPixel (enemy5_2_x ,enemy5_2_y + 20 )) 'were colour is being detected colour_enemy5_2_right = (GraphicsWindow.GetPixel (enemy5_2_x + 40 ,enemy5_2_y+20)) If colour_enemy5_2_left= "#EEE8AA" Then direction_enemy5_2 = -direction_enemy5_2 endif If colour_enemy5_2_right = "#EEE8AA" Then direction_enemy5_2 = -direction_enemy5_2 endif 'Whether the enemy will go left or right depending on what colour it detects enemy5_2_x = enemy5_2_x + direction_enemy5_2 shapes.Move(enemy5_2, enemy5_2_x, enemy5_2_y) EndSub Sub enemy6_2 colour_enemy6_2_left = (GraphicsWindow.GetPixel (enemy6_2_x ,enemy6_2_y + 20 )) 'were colour is being detected colour_enemy6_2_right = (GraphicsWindow.GetPixel (enemy6_2_x + 40 ,enemy6_2_y+20)) If colour_enemy6_2_left= "#EEE8AA" Then direction_enemy6_2 = -direction_enemy6_2 endif If colour_enemy6_2_right = "#EEE8AA" Then direction_enemy6_2 = -direction_enemy6_2 endif 'Whether the enemy will go left or right depending on what colour it detects enemy6_2_x = enemy6_2_x + direction_enemy6_2 shapes.Move(enemy6_2, enemy6_2_x, enemy6_2_y) EndSub Sub enemy7_2 colour_enemy7_2_left = (GraphicsWindow.GetPixel (enemy7_2_x ,enemy7_2_y + 20 )) 'were colour is being detected colour_enemy7_2_right = (GraphicsWindow.GetPixel (enemy7_2_x + 40 ,enemy7_2_y+20)) If colour_enemy7_2_left= "#EEE8AA" Then direction_enemy7_2 = -direction_enemy7_2 endif If colour_enemy7_2_right = "#EEE8AA" Then direction_enemy7_2 = -direction_enemy7_2 endif 'Whether the enemy will go left or right depending on what colour it detects enemy7_2_x = enemy7_2_x + direction_enemy7_2 shapes.Move(enemy7_2, enemy7_2_x, enemy7_2_y) EndSub sub enemy8_2 colour_enemy8_2_left = (GraphicsWindow.GetPixel (enemy8_2_x ,enemy8_2_y + 20 )) 'were colour is being detected colour_enemy8_2_right = (GraphicsWindow.GetPixel (enemy8_2_x + 40 ,enemy8_2_y+20)) If colour_enemy8_2_left= "#EEE8AA" Then direction_enemy8_2 = -direction_enemy8_2 endif If colour_enemy8_2_right = "#EEE8AA" Then direction_enemy8_2 = -direction_enemy8_2 endif 'Whether the enemy will go left or right depending on what colour it detects enemy8_2_x = enemy8_2_x + direction_enemy8_2 shapes.Move(enemy8_2, enemy8_2_x, enemy8_2_y) EndSub Sub enemy9_2 'bottom ___blue enemy colour_enemy9_bottom = (GraphicsWindow.GetPixel (enemy9_2_x + 20 ,enemy9_2_y+ 40 )) 'were colour is being detected colour_enemy9_top = (GraphicsWindow.GetPixel (enemy9_2_x + 20 ,enemy9_2_y)) If colour_enemy9_bottom= "#EEE8AA" Then direction_enemy9_2 = -direction_enemy9_2 endif If colour_enemy9_top = "#EEE8AA" Then direction_enemy9_2 = -direction_enemy9_2 endif 'Whether the enemy will go left or right depending on what colour it detects enemy9_2_y = enemy9_2_y + direction_enemy9_2 shapes.Move(enemy9_2, enemy9_2_x, enemy9_2_y) EndSub sub collision_1_2 square_centerx = (square_x + (square_width/2 + 3)) 'Square centre square_centery = (square_y + (square_height/2)) enemy1_2_centerx = enemy1_2_x + 20 enemy1_2_centery = enemy1_2_y + 20 'enemy centre collision = Math.SquareRoot((square_centerx - enemy1_2_centerx) * (square_centerx - enemy1_2_centerx) + (square_centery - enemy1_2_centery) * (square_centery - enemy1_2_centery)) 'equation that i dont get but works accuratley If collision <40 then lose_2 = 1 'if collision is succesfull player has lost the game endif EndSub sub collision_2_2 square_centerx = (square_x + (square_width/2 + 3)) 'Square centre square_centery = (square_y + (square_height/2)) enemy2_2_centerx = enemy2_2_x + 20 enemy2_2_centery = enemy2_2_y + 20 'enemy centre collision = Math.SquareRoot((square_centerx - enemy2_2_centerx) * (square_centerx - enemy2_2_centerx) + (square_centery - enemy2_2_centery) * (square_centery - enemy2_2_centery)) 'equation that i dont get but works accuratley If collision <40 then lose_2 = 1 'if collision is succesfull player has lost the game endif EndSub sub collision_3_2 square_centerx = (square_x + (square_width/2 + 3)) 'Square centre square_centery = (square_y + (square_height/2)) enemy3_2_centerx = enemy3_2_x + 20 enemy3_2_centery = enemy3_2_y + 20 'enemy centre collision = Math.SquareRoot((square_centerx - enemy3_2_centerx) * (square_centerx - enemy3_2_centerx) + (square_centery - enemy3_2_centery) * (square_centery - enemy3_2_centery)) 'equation that i dont get but works accuratley If collision <40 then lose_2 = 1 'if collision is succesfull player has lost the game endif EndSub sub collision_4_2 square_centerx = (square_x + (square_width/2 + 3)) 'Square centre square_centery = (square_y + (square_height/2)) enemy4_2_centerx = enemy4_2_x + 20 enemy4_2_centery = enemy4_2_y + 20 'enemy centre collision = Math.SquareRoot((square_centerx - enemy4_2_centerx) * (square_centerx - enemy4_2_centerx) + (square_centery - enemy4_2_centery) * (square_centery - enemy4_2_centery)) 'equation that i dont get but works accuratley If collision <40 then lose_2 = 1 'if collision is succesfull player has lost the game endif EndSub sub collision_5_2 square_centerx = (square_x + (square_width/2 + 3)) 'Square centre square_centery = (square_y + (square_height/2)) enemy5_2_centerx = enemy5_2_x + 20 enemy5_2_centery = enemy5_2_y + 20 'enemy centre collision = Math.SquareRoot((square_centerx - enemy5_2_centerx) * (square_centerx - enemy5_2_centerx) + (square_centery - enemy5_2_centery) * (square_centery - enemy5_2_centery)) 'equation that i dont get but works accuratley If collision <40 then lose_2 = 1 'if collision is succesfull player has lost the game endif EndSub sub collision_6_2 square_centerx = (square_x + (square_width/2 + 3)) 'Square centre square_centery = (square_y + (square_height/2)) enemy6_2_centerx = enemy6_2_x + 20 enemy6_2_centery = enemy6_2_y + 20 'enemy centre collision = Math.SquareRoot((square_centerx - enemy6_2_centerx) * (square_centerx - enemy6_2_centerx) + (square_centery - enemy6_2_centery) * (square_centery - enemy6_2_centery)) 'equation that i dont get but works accuratley If collision <40 then lose_2 = 1 'if collision is succesfull player has lost the game endif EndSub sub collision_7_2 square_centerx = (square_x + (square_width/2 + 3)) 'Square centre square_centery = (square_y + (square_height/2)) enemy7_2_centerx = enemy7_2_x + 20 enemy7_2_centery = enemy7_2_y + 20 'enemy centre collision = Math.SquareRoot((square_centerx - enemy7_2_centerx) * (square_centerx - enemy7_2_centerx) + (square_centery - enemy7_2_centery) * (square_centery - enemy7_2_centery)) 'equation that i dont get but works accuratley If collision <40 then lose_2 = 1 'if collision is succesfull player has lost the game endif EndSub sub collision_8_2 square_centerx = (square_x + (square_width/2 + 3)) 'Square centre square_centery = (square_y + (square_height/2)) enemy8_2_centerx = enemy8_2_x + 20 enemy8_2_centery = enemy8_2_y + 20 'enemy centre collision = Math.SquareRoot((square_centerx - enemy8_2_centerx) * (square_centerx - enemy8_2_centerx) + (square_centery - enemy8_2_centery) * (square_centery - enemy8_2_centery)) 'equation that i dont get but works accuratley If collision <40 then lose_2 = 1 'if collision is succesfull player has lost the game endif EndSub sub collision_9_2 square_centerx = (square_x + (square_width/2 + 3)) 'Square centre square_centery = (square_y + (square_height/2)) enemy9_2_centerx = enemy9_2_x + 20 enemy9_2_centery = enemy9_2_y + 20 'enemy centre collision = Math.SquareRoot((square_centerx - enemy9_2_centerx) * (square_centerx - enemy9_2_centerx) + (square_centery - enemy9_2_centery) * (square_centery - enemy9_2_centery)) 'equation that i dont get but works accuratley If collision <40 then lose_2 = 1 'if collision is succesfull player has lost the game endif EndSub Sub fade_2 ' fade out everything by lowering the opacity For square_opacity = 100 To 0 Step -5 Shapes.SetOpacity (square, square_opacity) Program.Delay (10) EndFor For enemy1_2_opacity = 100 To 0 Step -5 Shapes.SetOpacity (enemy1_2,enemy1_2_opacity) Program.Delay (10) EndFor For enemy2_2_opacity = 100 To 0 Step -5 Shapes.SetOpacity (enemy2_2,enemy2_2_opacity) Program.Delay (10) EndFor For enemy3_2_opacity = 100 To 0 Step -5 Shapes.SetOpacity (enemy3_2 ,enemy3_2_opacity) Program.Delay (10) EndFor For enemy4_2_opacity = 100 To 0 Step -5 Shapes.SetOpacity (enemy4_2,enemy4_2_opacity) Program.Delay (10) EndFor For enemy5_2_opacity = 100 To 0 Step -5 Shapes.SetOpacity (enemy5_2,enemy5_2_opacity) Program.Delay (10) EndFor For enemy6_2_opacity = 100 To 0 Step -5 Shapes.SetOpacity (enemy6_2,enemy6_2_opacity) Program.Delay (10) EndFor For enemy7_2_opacity = 100 To 0 Step -5 Shapes.SetOpacity (enemy7_2,enemy7_2_opacity) Program.Delay (10) EndFor For enemy8_2_opacity = 100 To 0 Step -5 Shapes.SetOpacity (enemy8_2,enemy8_2_opacity) Program.Delay (10) EndFor For enemy9_2_opacity = 100 To 0 Step -5 Shapes.SetOpacity (enemy9_2,enemy9_2_opacity) Program.Delay (10) EndFor For friend_opacity = 100 To 0 Step -5 Shapes.SetOpacity (friend,friend_opacity) Program.Delay (10) EndFor EndSub End>LMP765.sb< Start>LMQ261.sb< GraphicsWindow.BackgroundColor="darkblue GraphicsWindow.PenWidth=0 GraphicsWindow.Title="SoundBars For x=1 To 9 For y=0 To 30 r[x][y]=Shapes.AddRectangle(40 5) Shapes.Move(r[x][y] 30+x*45 300-y*8) LDShapes.BrushColour(r[x][y] LDColours.HSLtoRGB(240-y*10 1 .6)) EndFor EndFor While 1=1 For rr=1 To 9 v[rr]=v[rr]+Math.GetRandomNumber(5)-3 if v[rr]>30 Then v[rr]=30 elseif v[rr]<0 Then v[rr]=0 EndIf for n=1 to v[rr] Shapes.ShowShape(r[rr][n]) EndFor for n=v[rr]+1 to 30 Shapes.hideShape(r[rr][n]) EndFor EndFor EndWhile End>LMQ261.sb< Start>LMV451.sb< TextWindow.WriteLine(" ") TextWindow.Write(" Please type the Hexidecimal code (excluding the '#' at the start): ") hexi = TextWindow.Read() '____________________Converting Hexidecimal to RGB___________' hexchar1 = Text.GetSubText(hexi,1,1) hexchar2 = Text.GetSubText(hexi,2,1) hexchag1 = Text.GetSubText(hexi,3,1) hexchag2 = Text.GetSubText(hexi,4,1) hexchab1 = Text.GetSubText(hexi,5,1) hexchab2 = Text.GetSubText(hexi,6,1) hcol[1] = 1 hcol[2] = 2 hcol[3] = 3 hcol[4] = 4 hcol[5] = 5 hcol[6] = 6 hcol[7] = 7 hcol[8] = 8 hcol[9] = 9 hcol["A"] = 10 hcol["B"] = 11 hcol["C"] = 12 hcol["D"] = 13 hcol["E"] = 14 hcol["F"] = 15 rval = (hcol[hexchar1]*16)+hcol[hexchar2] gval = (hcol[hexchag1]*16)+hcol[hexchag2] bval = (hcol[hexchab1]*16)+hcol[hexchab2] '_______________CONVERTING_RGB_TO_LUMINANCE______' lumin = Math.SquareRoot(((rval*rval)*0.3)+((gval*gval)*0.59)+((bval*bval)*0.11)) lumr = Math.Round(lumin) greyhex = GraphicsWindow.GetColorFromRGB(lumr,lumr,lumr) TextWindow.WriteLine(" ") TextWindow.WriteLine(" "+greyhex) End>LMV451.sb< Start>LMX663.sb< cons = "BCDFGHJKLMNPQRSTVWXYZ" vowel = "AEIOU" GraphicsWindow.KeyDown = OnMM Sub OnMM LK = GraphicsWindow.LastKey If Text.IsSubText(cons,LK) Then GraphicsWindow.BackgroundColor = GraphicsWindow.GetRandomColor() ElseIf Text.IsSubText(vowel,LK) Then Sound.PlayBellRing() Else Program.End() EndIf EndSub End>LMX663.sb< Start>LNC347.sb< ' mahreen miangul 'Smiley & Smiley 'December 2016 GraphicsWindow.BackgroundColor = "snow GraphicsWindow.Width = 1000 GraphicsWindow.Height = 500 ' Image-Add-Move- Animate-Rotate scale = 4 x0 = 0 * scale y0 = 0 * scale 'GraphicsWindow.PenWidth = 0 ' Face GraphicsWindow.BrushColor = "orange oFace = Shapes.AddEllipse(32 * scale, 32 * scale) Shapes.Move(oFace, x0 + scale, y0) ' Eyes GraphicsWindow.Penwidth = 4 GraphicsWindow.PenColor = "black GraphicsWindow.BrushColor = "white oEyeLeft = Shapes.AddEllipse(14 * scale, 10 * scale) Shapes.Move(oEyeLeft, x0 + 4 * scale, y0 + 6 * scale) Shapes.Rotate(oEyeLeft, 110) GraphicsWindow.brushcolor = "black oEyeLeft2 = Shapes.AddEllipse(4 * scale, 4 * scale) Shapes.Move(oEyeLeft2, x0 + 9 * scale, y0 + 10 * scale) GraphicsWindow.Penwidth = 4 GraphicsWindow.PenColor = "black GraphicsWindow.BrushColor = "white oEyeRight = Shapes.AddEllipse(14 * scale, 10 * scale) Shapes.Move(oEyeRight, x0 + 18 * scale, y0 + 8 * scale) Shapes.Rotate(oEyeRight, 110) GraphicsWindow.brushcolor = "black oEyeRight2 = Shapes.AddEllipse(4 * scale, 4 * scale) Shapes.Move(oEyeRight2, x0 + 23 * scale, y0 + 12 * scale) GraphicsWindow.PenWidth = 0 ' Mouth GraphicsWindow.brushColor = "Black" oMouthLeft = Shapes.Addellipse(14 * scale, 6 * scale) Shapes.Move(oMouthLeft, x0 + 10 * scale, y0 + 22 * scale) GraphicsWindow.brushColor = "orange oMouthRight = Shapes.Addellipse(11 * scale, 5 * scale) Shapes.Move(oMouthRight, x0 + 10 * scale, y0 + 21.5 * scale) graphicswindow.BrushColor = "gray GraphicsWindow.Fillrectangle(0, 380, 1000, 130) 'GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor() GraphicsWindow.BrushColor = "limegreen GraphicsWindow.FontSize = 88 haroon3 = Shapes.addtext("👹") Shapes.move(haroon3, 1080, -150) Shapes.animate(haroon3, 0, 380, 2000) Shapes.rotate(haroon3, 0) 'Shapes.Zoom(haroon3, 5, 3) 'Shapes.SetOpacity(haroon3, 50) 'Add-Move-Animate-Rotate ' DrawFill--Ellipse ' haroon1 'GraphicsWindow.BrushColor = "#7B68EE"'MediumSlateBlue 'GraphicsWindow.BrushColor = "#2F4F4F"'DarkSlateGray GraphicsWindow.penwidth = 8 GraphicsWindow.penColor = "black GraphicsWindow.BrushColor = "gold 'GraphicsWindow.FontSize = 88 haroon5 = Shapes.addellipse(120, 120) For i = 0 To 1 Shapes.animate(haroon5, 850, 260, 2000) Shapes.rotate(haroon5, 30 * i) 'Shapes.SetOpacity(haroon5, 50) 'Shapes.Zoom(haroon5, 6, 5) Program.Delay(1000) EndFor ' haroon1 GraphicsWindow.penwidth = 4 GraphicsWindow.BrushColor = "snow haroon5 = Shapes.addellipse(40, 44) For i = 0 To 1 Shapes.animate(haroon5, 870, 280, 2000) Shapes.rotate(haroon5, 30 * i) Program.Delay(1000) EndFor ' haroon1 GraphicsWindow.penwidth = 0 GraphicsWindow.BrushColor = "gold haroon5 = Shapes.addrectangle(40, 22) For i = 0 To 1 Shapes.animate(haroon5, 863, 303, 2000) Shapes.rotate(haroon5, 30 * i) Program.Delay(1000) EndFor GraphicsWindow.penwidth = 4 GraphicsWindow.pencolor = "black haroon5 = Shapes.addline(55, 50, 22, 33) For i = 0 To 0 Shapes.animate(haroon5, 850, 262, 2000) Shapes.rotate(haroon5, 30 * i) Program.Delay(1000) EndFor GraphicsWindow.brushcolor = "black" haroon5 = Shapes.addellipse(12, 12) For i = 0 To 0 Shapes.animate(haroon5, 897, 289, 2000) Shapes.rotate(haroon5, 30 * i) Program.Delay(1000) EndFor ' Eye2 GraphicsWindow.penwidth = 4 GraphicsWindow.BrushColor = "snow haroon5 = Shapes.addellipse(40, 44) For i = 0 To 1 Shapes.animate(haroon5, 915, 305, 2000) Shapes.rotate(haroon5, 30 * i) Program.Delay(1000) EndFor GraphicsWindow.penwidth = 0 GraphicsWindow.BrushColor = "gold haroon5 = Shapes.addrectangle(40, 22) For i = 0 To 1 Shapes.animate(haroon5, 908, 328, 2000) Shapes.rotate(haroon5, 30 * i) Program.Delay(1000) EndFor GraphicsWindow.penwidth = 4 GraphicsWindow.pencolor = "black haroon5 = Shapes.addline(55, 50, 22, 33) For i = 0 To 0 Shapes.animate(haroon5, 894, 288, 2000) Shapes.rotate(haroon5, 30 * i) Program.Delay(1000) EndFor GraphicsWindow.brushcolor = "black" haroon5 = Shapes.addellipse(12, 12) For i = 0 To 0 Shapes.animate(haroon5, 942, 318, 2000) Shapes.rotate(haroon5, 30 * i) Program.Delay(1000) EndFor GraphicsWindow.penwidth = 4 GraphicsWindow.BrushColor = "DarkMagenta haroon5 = Shapes.addellipse(65, 48) For i = 0 To 1 Shapes.animate(haroon5, 860, 315, 2000) Shapes.rotate(haroon5, 30 * i) Program.Delay(1000) EndFor GraphicsWindow.penwidth = 0 GraphicsWindow.BrushColor = "gold haroon5 = Shapes.addrectangle(80, 15) For i = 0 To 1 Shapes.animate(haroon5, 865, 316, 2000) Shapes.rotate(haroon5, 30 * i) Program.Delay(1000) EndFor GraphicsWindow.penwidth = 0 GraphicsWindow.brushcolor = "black haroon5 = Shapes.addrectangle(68, 4) For i = 0 To 1 Shapes.animate(haroon5, 860, 322, 2000) Shapes.rotate(haroon5, 30 * i) Program.Delay(1000) EndFor ' Blink start While "True" Program.Delay(2900) Shapes.HideShape(oEyeLeft2) Shapes.HideShape(oEyeRight2) Program.Delay(100) Shapes.ShowShape(oEyeLeft2) Shapes.ShowShape(oEyeRight2) EndWhile End>LNC347.sb< Start>LNF080.sb< ARROWS=5 L=1 args=0 INIT() While 1=1 textwindow.writeline("") textwindow.writeline( "You are in room "+L) textwindow.writeline( "Tunnels lead to "+ RO[L][1]+"|"+RO[L][2]+"|"+RO[L][3]) If ldcall.Function( "MON" 1) Then textwindow.writeline( "You smell something terrible nearby.") ElseIf ldcall.Function( "MON" 2) OR ldcall.Function( "MON" 3) Then textwindow.writeline( "You hear a rustling.") ElseIf ldcall.Function( "MON" 4) OR ldcall.Function( "MON" 5) Then textwindow.writeline( "You feel a cold wind blowing from a nearby cavern.") EndIf ggg: textwindow.writeline("") textwindow.write( "Shoot or move? (S-M) ") ks=text.ConvertToUpperCase( TextWindow.Read()) If Ks="S" OR Ks="M" Then Else Goto ggg EndIf If Ks="M" Then '! Move TextWindow.Write( "No. of rooms: ") I=TextWindow.ReadNumber() If ldcall.Function( "CHK" I) Then L=I Else textwindow.writeline( "Not possibile.") EndIf Else ' ! Shoot textwindow.write( "Where? ") I=TextWindow.ReadNumber() If ldcall.Function( "CHK" I) Then If LO[I]=1 Then textwindow.writeline( "You kill the Monster Wumpus.") textwindow.writeline( "You win.") Goto EXD Else textwindow.writeline( "Arrows aren't that crooked - Try another room.") If math.GetRandomNumber(4)<3 Then textwindow.writeline( "You woke the Wumpus and he moved.") LO[WPOS]=0 WPOS=RO[WPOS][math.GetRandomNumber(2)] LO[WPOS]=1 EndIf ARROWS=ARROWS-1 If ARROWS=0 Then textwindow.writeline( "You ran out of arrows.") Goto EXD EndIf EndIf Else textwindow.writeline( "Not possibile.") EndIf EndIf case= LO[L] If CASE= 1 Then textwindow.writeline( "You eaten by Wumpus.") Goto EXd ElseIf CASE=2 or case=3 Then textwindow.writeline( "A giant bat takes you in another room.") I=L While i=l L=math.GetRandomNumber(19)+1 EndWhile ElseIf CASE=4 or case=5 Then textwindow.writeline( "You fall into a bottomless pit.") Goto EXD EndIf EndWhile exd: Program.Delay(4444) Program.End() Sub MON'(X)=X=LO(RO(L,1)) OR X=LO(RO(L,2)) OR X=LO(RO(L,3)) x=args[1] If lo[ro[l][1]]=x or lo[ro[l][2]]=x or lo[ro[l][3]]=x Then return="true Else return="false EndIf EndSub Sub CHK '=X=RO(L,1) OR X=RO(L,2) OR X=RO(L,3) x=args[1] If ro[l][1]=x or ro[l][2]=x or ro[l][3]=x Then return="true Else return="false EndIf EndSub Sub INIT DAT="2,6,5,3,8,1,4,10,2,5,2,3,1,14,4,15,1,7,17,6,8,7,2,9,18,8,10,9,3,11,19,10,12,11,4,13,20,12,14,5,11,13,6,16,14,20,15,17,16,7,18,17,9,19,18,11,20,19,13,16 dd=LDText.Split(dat ",") textwindow.writeline( "Hunt the Wumpus") ii=1 For I=1 To 20 '! Create the cave LO[I]=0 For J=1 To 3 RO[I][J]=dd[ii] ii=ii+1 EndFor EndFor WPOS=Math.GetRandomNumber(19)+1 LO[WPOS]=1 For I=2 To 5 DOo: T=math.GetRandomNumber(19)+1 If LO[T]>0 Then Goto DOo EndIf LO[T]=I EndFor EndSub End>LNF080.sb< Start>LNJ705.sb< ' ship approach docking ' yled and litdev animation LD3DVIEW, with .3ds files ' program: colors() GraphicsWindow.TOP=0 GraphicsWindow.LEFT=0 GraphicsWindow.Width=1366 GraphicsWindow.Height=768 GraphicsWindow.Title ="3d apollo" GraphicsWindow.BackgroundColor = dblue planet = LD3DView.AddView(1366,768,"false") ' better visual quality flag set to false view = LD3DView.AddView(GraphicsWindow.Width,GraphicsWindow.Height,"True") LD3DView.LoadModel(view,Program.Directory+"\aurora.3ds") LD3DView.AddDirectionalLight (view,white,180,-90,-155) 'LD3DView.AddAmbientLight(planet,dgray) LD3DView.AutoControl ("true" "true", -1 3) LD3DView.AddspotLight(view,white,1,4,5 ,-1 ,-1 ,-1, 18, 20) LD3DView.AddDirectionalLight (planet,blue,180,-90,-155) LD3DView.AddspotLight(planet,blue,1,4,5 ,-1 ,-1 ,-1, 18, 20) neptune=LD3DView.AddSphere (planet,1 ,100,cyan,"D") LD3DView.TranslateGeometry (planet,neptune, -2, -1, -1) For t = 500 to 10 Step -1 LD3DView.ResetCamera(view,-20,-5,t,0,0,-1,0,-1,0) LD3DView.AnimateTranslation (planet,neptune, -2,-1,-1,10) Program.Delay(100) w=w+1 endfor LD3DView.AutoControl("True","True",20,1) Sub colors dblue=GraphicsWindow.GetColorFromRGB(0,0,50) dgreen=GraphicsWindow.GetColorFromRGB(0,25,0) lgreen=GraphicsWindow.GetColorFromRGB(100,225,100) dmagenta=GraphicsWindow.GetColorFromRGB(175,5,5) cyan=GraphicsWindow.GetColorFromRGB(50,250,225) blue=GraphicsWindow.GetColorFromRGB(150,150,250) magenta=GraphicsWindow.GetColorFromRGB(250,50,250) white=GraphicsWindow.GetColorFromRGB(255,255,250) lbrown=GraphicsWindow.GetColorFromRGB(250,225,100) dgray=GraphicsWindow.GetColorFromRGB(15,15,15) mgray=GraphicsWindow.GetColorFromRGB(135,145,105) EndSub End>LNJ705.sb< Start>LNK116.sb< length = 100 'Star side length numPoint = 5 'Number of star points pointangle = 36 'A 36 degree point is a special case with parallel opposite edges for 5 pointed star Turtle.Turn(pointangle/2) 'Top point pointing up netTurn = 360/numPoint 'The inner turn angle between each point 'Turtle.Speed = 10 'With 5 points, the net turn for each loop is 72 and 5 loops is therefore 360 'The 180 reverses the turtle before doing the additional turns required For i = 1 To numPoint Turtle.Move(length) Turtle.Turn(180-pointangle) Turtle.Move(length) Turtle.Turn(-180+(netTurn+pointangle)) EndFor End>LNK116.sb< Start>LNL706.sb< Radius = 25 GraphicsWindow.BrushColor = "White" Ball = Shapes.AddEllipse(2*Radius, 2*Radius) GraphicsWindow.MouseDown = OnMouseDown Sub OnMouseDown GraphicsWindow.MouseMove = OnMouseMove EndSub Sub OnMouseMove If Mouse.IsLeftButtonDown = "True" Then Mouse.HideCursor() x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY Shapes.Move(Ball, x - Radius/2, y - Radius/2) Else Mouse.ShowCursor() EndIf EndSub End>LNL706.sb< Start>LNM164-0.sb< ' Roulette 0.2b ' Copyright (c) 2013 Nonki Takahashi ' ' History: ' 0.2b 18/06/2013 Rotated wheel. (LNM164-0) ' 0.11a 18/06/2013 Background color changed. ' 0.1a 12/06/2013 Created just for picture. (LNM164) ' GraphicsWindow.Title = "Roulette 0.2b" gw = GraphicsWindow.Width gh = GraphicsWindow.Height x0 = gw / 2 y0 = gh / 2 r4 = gh / 2 * 0.9 r3 = r4 * 0.8 r2 = r3 * 0.8 r1 = r3 * 0.5 rb = r1 * 0.15 fs = (r3 - r2) * 0.8 GraphicsWindow.BackgroundColor = "Green" GraphicsWindow.BrushColor = "#331800" GraphicsWindow.FillEllipse(x0 - r4, y0 - r4, r4 * 2, r4 * 2) url = "http://www.nonkit.com/smallbasic.files/Roulette.png" wheel = Shapes.AddImage(url) Shapes.Move(wheel, x0 - r3, y0 - r3) GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "White" ball = Shapes.AddEllipse(rb * 2, rb * 2) angle = 0 Shapes.Animate(ball, x0 - rb , y0 - rb - (r1 + r2) / 2, 1000) GraphicsWindow.BrushColor = "Black" Controls.AddButton("Start", 10, 10) Controls.ButtonClicked = OnButtonClicked Timer.Interval = 1000/24 Sub OnButtonClicked da0 = Math.GetRandomNumber(10) + 10 t0 = Clock.ElapsedMilliseconds Timer.Tick = OnTick EndSub Sub OnTick t1 = Clock.ElapsedMilliseconds da = da0 - (t1 - t0) / 1000 If 0 < da Then angle = angle + da If 360 <= angle Then angle = angle - 360 EndIf Shapes.Rotate(wheel, angle) Else Timer.Tick = Dummy EndIf EndSub Sub Dummy EndSub End>LNM164-0.sb< Start>LNM164-4.sb< ' Small Roulette 0.4b ' Copyright © 2013-2015 Nonki Takahashi. The MIT License. ' ' History: ' 0.4a 2015-09-22 Added table layout. (LNM164-4) ' 0.3b 2015-04-08 Added ball animation. (LNM164-3) ' 0.22b 2013-06-18 Changed for Silverlight. (LNM164-2) ' 0.2b 2013-06-18 Rotated wheel. (LNM164-0) ' 0.11a 2013-06-18 Background color changed. ' 0.1a 2013-06-12 Created just for picture. (LNM164) ' GraphicsWindow.Title = "Roulette 0.4a" gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh csv = "1,5,8,4,9,2,10,6,3,7" color = "1=Black;2=DarkRed;" CSVtoArray() scale = 0.5 x0 = 135 y0 = gh / 2 DrawRoulette() DrawLayout() GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "White" ball = Shapes.AddEllipse(rb * 2, rb * 2) angle = 0 Math_PolarToCartesian() Shapes.Animate(ball, x - rb, y - rb, 1000) GraphicsWindow.BrushColor = "Black" Controls.AddButton("Start", 10, 10) Controls.ButtonClicked = OnButtonClicked Timer.Interval = 1000/24 Sub CSVtoArray n = 0 p = 1 l = Text.GetLength(csv) While p <= l _p = Text.GetIndexOf(Text.GetSubTextToEnd(csv, p), ",") If 0 < _p Then n = n + 1 arry[n] = Text.GetSubText(csv, p, _p - 1) p = p + _p Else n = n + 1 arry[n] = Text.GetSubTextToEnd(csv, p) p = l + 1 EndIf EndWhile EndSub Sub DrawLayout GraphicsWindow.PenColor = "White" GraphicsWindow.PenWidth = 4 y1 = 130 Stack.PushValue("local", y1) x1 = 270 x2 = 470 x3 = 550 dy = 10 For i = 1 To 10 row = Math.Remainder(i - 1, 2) + 1 col = Math.Floor((i - 1) / 2) + 1 x = x1 + (col - 1) * 40 y = y1 + (row - 1) * 40 + 40 value = i GetIndexOf() iColor = Math.Remainder(index - 1, 2) + 1 GraphicsWindow.BrushColor = color[iColor] GraphicsWindow.FillRectangle(x, y, 40, 40) If i < 10 Then dx = 15 Else dx = 12 EndIf x = x1 + (col - 1) * 40 + dx y = y1 + (row - 1) * 40 + 40 + dy GraphicsWindow.BrushColor = "White" GraphicsWindow.DrawText(x, y, i) EndFor dx = 35 x = x1 + dx y = y1 + dy GraphicsWindow.DrawText(x, y, "1-5") x = x + 100 GraphicsWindow.DrawText(x, y, "6-10") dx = 24 x = x1 + 200 + dx y = y1 + 40 + dy GraphicsWindow.DrawText(x, y, "ODD") y = y + 40 GraphicsWindow.DrawText(x, y, "EVEN") For i = 1 To 5 y = y1 + (i - 1) * 40 If i = 1 Or i = 5 Then x = x2 Else x = x3 EndIf GraphicsWindow.DrawLine(x1, y, x, y) EndFor x = x1 y2 = y1 + 40 * 4 GraphicsWindow.DrawLine(x, y1, x, y2) x = x1 + 40 * 5 y2 = y1 + 40 * 4 GraphicsWindow.DrawLine(x, y1, x, y2) y1 = y1 + 40 y2 = y1 + 40 * 2 For i = 2 To 8 If i <> 6 And i <> 7 Then x = x1 + (i - 1) * 40 GraphicsWindow.DrawLine(x, y1, x, y2) EndIf EndFor x = x1 + 100 y1 = Stack.PopValue("local") y2 = y1 + 40 GraphicsWindow.DrawLine(x, y1, x, y2) y1 = y1 + 120 y2 = y1 + 40 GraphicsWindow.DrawLine(x, y1, x, y2) x = x1 + 30 y = y1 + 10 width = 40 height = 20 GraphicsWindow.BrushColor = "Black" FillRhombus() x = x + 100 GraphicsWindow.BrushColor = "DarkRed" FillRhombus() EndSub Sub DrawRoulette r4 = 441 / 2 * 0.9 * scale r3 = r4 * 0.8 r2 = r3 * 0.8 r1 = r3 * 0.5 r0 = r3 * 0.1 rb = r1 * 0.15 r = r1 a = -92 fs = (r3 - r2) * 0.8 GraphicsWindow.BackgroundColor = "Green" GraphicsWindow.BrushColor = "#331800" GraphicsWindow.FillEllipse(x0 - r4, y0 - r4, r4 * 2, r4 * 2) url = "http://www.nonkit.com/smallbasic.files/Roulette10.png" wheel = Shapes.AddImage(url) Shapes.Move(wheel, x0 - r3 / scale, y0 - r3 / scale) Shapes.Zoom(wheel, scale, scale) EndSub Sub FillRhombus ' param x, y - left top position ' param width, height - size of the rhombus Stack.PushValue("local", x) Stack.PushValue("local", y) x[0] = x y[0] = y x[1] = x[0] + width / 2 y[1] = y[0] x[2] = x[1] y[2] = y[0] + height x[3] = x[0] y[3] = y[0] + height / 2 GraphicsWindow.FillTriangle(x[1], y[1], x[2], y[2], x[3], y[3]) x[3] = x[0] + width GraphicsWindow.FillTriangle(x[1], y[1], x[2], y[2], x[3], y[3]) y = Stack.PopValue("local") x = Stack.PopValue("local") EndSub Sub GetIndexOf ' param value - to search ' return index max = Array.GetItemCount(arry) For index = 1 To max If arry[index] = value Then Goto break EndIf EndFor break: EndSub Sub OnButtonClicked da = 0.1 da0 = Math.GetRandomNumber(10) + 10 t0 = Clock.ElapsedMilliseconds tl = Clock.ElapsedMilliseconds Timer.Tick = OnTick EndSub Sub OnTick t1 = Clock.ElapsedMilliseconds dt = (t1 - tl) / 1000 tl = t1 If r1 - r < 0 Then sign = -1 ElseIf r1 - r = 0 Then sign = 0 Else sign = 1 EndIf ar = 30 vr = vr + sign * ar * dt vr = vr * 0.99 * Math.Abs(r - r1) / (Math.Abs(r - r1) + 1) dr = vr * dt r = r + dr If 0 < da Then da = da0 - (t1 - t0) / 1000 ElseIf Math.Abs(r - r1) < 1 Then Timer.Tick = DoNothing EndIf va = (va + Math.GetRadians(da) * 50) * 0.99 a = a + va * dt _a = Math.GetRadians(va * dt) r = Math.Abs(r / Math.Cos(_a)) If r2 < r Then r = r - (r - r2) EndIf Math_PolarToCartesian() Shapes.Move(ball, x - rb, y - rb) If 0 < da Then angle = angle + da If 360 <= angle Then angle = angle - 360 EndIf Shapes.Rotate(wheel, angle) EndIf EndSub Sub DoNothing EndSub Sub Math_PolarToCartesian ' param r ' param a ' param x0, y0 ' return x, y _a = Math.GetRadians(a) x = x0 + r * Math.Cos(_a) y = y0 + r * Math.Sin(_a) EndSub End>LNM164-4.sb< Start>LNM164.sb< ' Roulette 0.1a ' Copyright (c) 2013 Nonki Takahashi ' ' History: ' 0.1a 12/06/2013 Created just for picture. ' GraphicsWindow.Title = "Roulette 0.1a" gw = GraphicsWindow.Width gh = GraphicsWindow.Height csv = "1,5,4,2,6,3" CSVtoArray() x0 = gw / 2 y0 = gh / 2 r3 = gh / 2 * 0.8 r2 = r3 * 0.8 r1 = r3 * 0.5 fs = (r3 - r2) * 0.8 GraphicsWindow.BackgroundColor = "Green" GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(x0 - r3, y0 - r3, r3 * 2, r3 * 2) GraphicsWindow.BrushColor = "Silver" GraphicsWindow.FillEllipse(x0 - r2, y0 - r2, r2 * 2, r2 * 2) GraphicsWindow.PenColor = "Gray" GraphicsWindow.FontSize = fs For i = 1 To n angle = 2 * Math.Pi * i / n x3 = x0 + r2 * Math.Sin(angle) y3 = y0 + r2 * Math.Cos(angle) If Math.Remainder(i, 2) = 0 Then FillArc() EndIf GraphicsWindow.DrawLine(x0, y0, x3, y3) obj = Shapes.AddText(arry[i]) angle = 2 * Math.Pi * (i + 0.5) / n x2 = x0 + (r3 + r2) / 2 * Math.Sin(angle) y2 = y0 + (r3 + r2) / 2 * Math.Cos(angle) Shapes.Move(obj, x2 - fs * 0.4, y2 - fs * 0.5) Shapes.Rotate(obj, 180-Math.GetDegrees(angle)) EndFor GraphicsWindow.BrushColor = "Gray" GraphicsWindow.FillEllipse(x0 - r1, y0 - r1, r1 * 2, r1 * 2) GraphicsWindow.BrushColor = "Silver" GraphicsWindow.PenWidth = 8 GraphicsWindow.PenColor = "Silver" For i = 1 To 4 angle = 2 * Math.Pi * (i + 0.5) / 4 x1 = x0 + r1 * 0.7 * Math.Sin(angle) y1 = y0 + r1 * 0.7 * Math.Cos(angle) GraphicsWindow.FillEllipse(x1 - 8, y1 - 8, 16, 16) GraphicsWindow.DrawLine(x0, y0, x1, y1) EndFor GraphicsWindow.FillEllipse(x0 - 16, y0 - 16, 32, 32) Sub FillArc GraphicsWindow.PenColor = "DarkRed" da = Math.GetRadians(0.32) For a = angle To angle + 2 * Math.Pi / n - da Step da x = x0 + r3 * Math.Sin(a) y = y0 + r3 * Math.Cos(a) x2 = x0 + r2 * Math.Sin(a) y2 = y0 + r2 * Math.Cos(a) GraphicsWindow.DrawLine(x, y, x2, y2) EndFor GraphicsWindow.PenColor = "Gray" EndSub Sub CSVtoArray n = 0 p = 1 l = Text.GetLength(csv) While p <= l _p = Text.GetIndexOf(Text.GetSubTextToEnd(csv, p), ",") If 0 < _p Then n = n + 1 arry[n] = Text.GetSubText(csv, p, _p - 1) p = p + _p Else n = n + 1 arry[n] = Text.GetSubTextToEnd(csv, p) p = l + 1 EndIf EndWhile EndSub End>LNM164.sb< Start>LNN766.sb< PublicScoreData = "" GeneratorBusy = 0 Local_Busy = 0 BoxSizeChanged = 0 replaylvl = 0 ' Tells the game generator whether or not to generate a new map or just restart the current map. 1= Restart ; 0 = New Map DrawUI_MinBoxes = 30 'Square this Number to get number to tiles on screen. Represents X & Y max values DrawUI_BoxSize = 25 'Default Width and Height of a Square DrawUI_BoxMinSize = 20 'Minimum allowable Width and Height of a Square GenerateMinIllegals = 150 GenerateMinPoints = 40 'Min Amount of Points Needed GenerateMinTeleport = 5 AccessFunction = "Calculate_Access" BrodCastFunction = "ServerBrodcast" SendMessageFunction = "ServerMessage" DebugFunction = "Debug" args = "" return = "" DesktopHeight = Desktop.Height - 30 DesktopWidth= Desktop.Width - 30 GraphicsWindow.Width = DesktopWidth GraphicsWindow.Height = DesktopHeight GraphicsWindow.Left = 0 GraphicsWindow.Top = 0 GraphicsWindow.Show() XArray = LDArray.Create(500) YArray = LDArray.Create(500) GenerateLevel() '4 neighbour blocks to check TextWindow.Hide() GraphicsWindow.PenColor = "Gray" GraphicsWindow.PenWidth = 1 StepX = "1=-1;2=1;3=0;4=0" StepY = "1=0;2=0;3=-1;4=1" 'Initial target from turtle start point Closest_X = Math.Floor(Turtle.X/DrawUI_BoxSize) Closest_Y = Math.Floor(Turtle.Y/DrawUI_BoxSize) AI_Path() running = "True" While (running) CurrentX = Closest_X CurrentY = Closest_Y 'Search for next closest not already passed through MinValue = 1000 Closest_X = 0 'Next nearest Yellow cell For TryX = 0 To DrawUI_MinBoxes For TryY = 0 To DrawUI_MinBoxes If (GameBoard[TryX][TryY] = 3 And Value[TryX][TryY] < MinValue) Then Closest_X = TryX Closest_Y = TryY MinValue = Value[TryX][TryY] EndIf EndFor EndFor 'Final Red cell If (Closest_X = 0) Then For TryX = 0 To DrawUI_MinBoxes For TryY = 0 To DrawUI_MinBoxes If (GameBoard[TryX][TryY] = 4 And Value[TryX][TryY] < MinValue) Then Closest_X = TryX Closest_Y = TryY MinValue = Value[TryX][TryY] EndIf EndFor EndFor running = "False" EndIf 'TextWindow.WriteLine("Closest "+Closest_X+","+Closest_Y+" : "+GameBoard[Closest_X][Closest_Y]) AI_Path() SendTurtle() GameBoard[Closest_X][Closest_Y] = "" 'Finished with this cell - it is the new start cell EndWhile '_________________________________________________________________________________________________________________________________ ' Generates Map '_________________________________________________________________________________________________________________________________ Sub GenerateLevel TextWindow.WriteLine("Gen Level") If GeneratorBusy = 0 Then TextWindow.WriteLine("Generator Free") 'Server Side GameOver = 0 GeneratorBusy = 1 Games = Games + 1 Score = 0 endsquare = 0 FindEnclosedAttempted = 0 GeneratedIllegalsVar = 1 GeneratedPointsVar = 1 If replaylvl = 0 Then 'Game needs a new map TextWindow.WriteLine("New Map Requsted") GameBoard = "" GameBoard[2][2] = 0 GameBoard[2][3] = 0 GenerateBorders() TextWindow.WriteLine("Borders Finished") GenerateIllegals() TextWindow.WriteLine("Barriers Finished") GeneratePoints() TextWindow.WriteLine("Target Squares Finished") Generate_Teleport() TextWindow.WriteLine("Teleport Squares Finished ") TextWindow.WriteLine("New Map Complete") Else TextWindow.WriteLine("Old Map Requested") EndIf GameBoard["TeleportX"] = TeleportXLink GameBoard["TeleportY"] = TeleportYLink GameBoard["Pairs"][1] = 2 GameBoard["Pairs"][2] = 1 GameBoard["BoxestoGo"] = GenerateMinPoints BoxesToGo = GenerateMinPoints StoreGameBoard = GameBoard Hash = LDEncryption.MD5Hash(StoreGameBoard) LDCall.Function2(BrodCastFunction, StoreGameBoard,"GameBoard" ) 'Brodcast Game to All Clients 'Start Client Side 'Clients Read the Game Like this 'TeleportXLink = GameBoard["TeleportX"] 'TeleportYLink = GameBoard["TeleportY"] DrawNumbers() DrawKey() ScoreData() DrawUI() DebugPanelUI() SanityCheck() FindEnclosed() If Games = 1 Then 'ShowHelp() EndIf Sound.PlayChimes() SpawnPlayer() 'GameOverCheck() replaylvl = 0 GeneratorBusy = 0 EndIf EndSub Sub DebugPanelUI EndSub Sub ScoreData GraphicsWindow.BrushColor = "BLACK" ScoreDataBox = LDControls.AddListBox(PublicScoreData,200,170) Controls.Move(ScoreDataBox, UIx , UIy + 200) GraphicsWindow.BrushColor = "WHITE" EndSub Sub GenerateBorders For GenerateBordersXVar = 0 To DrawUI_MinBoxes For GenerateBordersYVar = 0 To DrawUI_MinBoxes If GenerateBordersXVar = 1 Or GenerateBordersXVar = DrawUI_MinBoxes Then GameBoard[GenerateBordersXVar][GenerateBordersYVar] = 1 ElseIf GenerateBordersYVar = 1 or GenerateBordersYVar = DrawUI_MinBoxes Then GameBoard[GenerateBordersXVar][GenerateBordersYVar] = 1 EndIf EndFor EndFor EndSub Sub GeneratePoints GeneratedPointsVar = 0 While GeneratedPointsVar <= GenerateMinPoints RandomX = Math.GetRandomNumber(DrawUI_MinBoxes) RandomY = Math.GetRandomNumber(DrawUI_MinBoxes) CurrentCell = GameBoard[RandomX][RandomY] If CurrentCell = "" Or CurrentCell = 0 And CurrentCell <> 0 And CurrentCell <> 2 And CurrentCell <> 3 And CurrentCell <> 4 And CurrentCell <> 1 Then If LDCall.Function2(AccessFunction,RandomX,RandomY) > 1 then GameBoard[RandomX][RandomY] = 3 GeneratedPointsVar = GeneratedPointsVar + 1 EndiF If LDCall.Function2(AccessFunction,RandomX,RandomY) > 1 And endsquare = 0 Then 'Always have one end square endsquare = 1 GameBoard[RandomX][RandomY] = 4 GeneratedPointsVar = GeneratedPointsVar + 1 EndIf EndIf EndWhile EndSub Sub GenerateIllegals While GeneratedIllegalsVar <= GenerateMinIllegals RandomX = Math.GetRandomNumber(DrawUI_MinBoxes) RandomY = Math.GetRandomNumber(DrawUI_MinBoxes) CurrentCell = GameBoard[RandomX][RandomY] If CurrentCell = "" Or CurrentCell = 0 And CurrentCell <> 0 Then If LDCall.Function2(AccessFunction,RandomX,RandomY) >= 1 And CurrentCell <> 1 And CurrentCell <> 2 And CurrentCell <> 3 And CurrentCell <> 4 then GameBoard[RandomX][RandomY] = 1 GeneratedIllegalsVar = GeneratedIllegalsVar + 1 EndIf EndIf EndWhile EndSub Sub Generate_Teleport GeneratedTeleportVar = 0 TeleportXLink = "" TeleportYLink = "" While GeneratedTeleportVar < GenerateMinTeleport RandomX = Math.GetRandomNumber(DrawUI_MinBoxes) RandomY = Math.GetRandomNumber(DrawUI_MinBoxes) CurrentCell = GameBoard[RandomX][RandomY] XDistance = Math.Abs(TeleportXLink[1] - RandomX) YDistance = Math.Abs(TeleportYLink[1] - RandomY) CDistance =Math.SquareRoot( (Math.Power(XDistance,2) + Math.Power(YDistance,2)) ) CDistance = Math.Floor(CDistance) If CurrentCell = "" Or CurrentCell = 0 And CurrentCell <> 0 And CurrentCell <> 1 And CurrentCell <> 2 And CurrentCell <> 3 And CurrentCell <> 4 Then If LDCall.Function2(AccessFunction,RandomX,RandomY) >= 1 Then If CDistance = 0 OR CDistance >= 5 Then GameBoard[RandomX][RandomY] = 5 TeleportXLink[Array.GetItemCount(TeleportXLink) + 1] = RandomX TeleportYLink[Array.GetItemCount(TeleportYLink) + 1 ] = RandomY GeneratedTeleportVar = GeneratedTeleportVar + 1 ' LDCall.Function(DebugFunction,"Distance:" + XDistance +","+ YDistance+";"+ CDistance) ' Debug EndIf EndIf EndIf EndWhile 'TextWindow.WriteLine( Array.GetItemCount(TeleportXLink) ) 'debug EndSub Sub SanityCheck GraphicsWindow.Title = "Sanity Check" Sanity = 1 Sanity_Numbers() If SIllegals < GenerateMinIllegals Then LDCall.Function(DebugFunction,"ILLEGALS: (" + SIllegals + "<" + GenerateMinIllegals +")") EndIf If SPoints < GenerateMinPoints Then LDCall.Function(DebugFunction,"POINTS: (" + SPoints + "<" + GenerateMinPoints +")") EndIf EndSub Sub Sanity_Numbers SPoints = 0 SIllegals = 0 For Sx = 1 To DrawUI_MinBoxes For Sy = 1 To DrawUI_MinBoxes CurrentCell = GameBoard[Sx][Sy] If CurrentCell = 1 Then SIllegals = SIllegals + 1 ElseIf CurrentCell = 3 or CurrentCell = 4 Then SPoints = SPoints + 1 EndIf EndFor EndFor EndSub Sub FindEnclosed FindEnclosedRunning = 1 GraphicsWindow.Title = "Find Enclosed" LDArray.Delete(RootX) LDArray.Delete(RootY) PointCellsFound = 0 RootX = LDArray.Create(Math.Power(DrawUI_MinBoxes,2) + 100 ) ' More than enough Room for a map with 30x30 Dimmensions RootY = LDArray.Create(Math.Power(DrawUI_MinBoxes,2) + 100) LDArray.SetValue(RootX,1,2) LDArray.SetValue(RootY,1,2) FGameBoard = GameBoard MaxRoot = LDArray.Count( RootX) + 1 For PathI = 1 To MaxRoot FEx = LDArray.GetValue(RootX,PathI) FEy = LDArray.GetValue(RootY,PathI) CurrentCell = GameBoard[FEx][FEy] ' LDCall.Function(DebugFunction, "Visiting" +"(" + FEx +"," + FEy +")") 'Debug If FGameBoard[FEx][FEy] <> 6 Then 'Visited If CurrentCell = 3 or CurrentCell = 4 then PointCellsFound = PointCellsFound + 1 EndIf 'Find Adj 'Up Cell[1]["X"] = FEx Cell[1]["Y"] = FEy + 1 Cell[1]["Value"] = GameBoard[(Cell[1]["X"])][ (Cell[1]["Y"])] 'Down Cell[2]["X"] = FEx Cell[2]["Y"] = FEy - 1 Cell[2]["Value"] = GameBoard[(Cell[2]["X"])][(Cell[2]["Y"])] 'Left Cell[3]["X"] = FEx - 1 Cell[3]["Y"] = FEy Cell[3]["Value"] = GameBoard[(Cell[3]["X"])][Cell[3]["Y"]] 'Right Cell[4]["X"] = FEx + 1 Cell[4]["Y"] = FEy Cell[4]["Value"] = GameBoard[(Cell[4]["X"])][(Cell[4]["Y"])] For TempI = 1 To 4 TempX = Cell[TempI]["X"] TempY = Cell[TempI]["Y"] If (FGameBoard[TempX][TempY] <> 6) And ( TempX = Math.Abs(TempX) And TempY = Math.Abs(TempY) ) And (TempX >= 2 And TempX <= 30 And TempY >= 2 And TempY <= 30) Then If Cell[TempI]["Value"] = 1 Then 'Barrier FGameBoard[TempX][TempY] = 6 ElseIf Cell[TempI]["Value"] = 5 Then 'Teleport CurrentCell5x = 1 While CurrentCell5x <= Array.GetItemCount(TeleportXLink) If TeleportXLink[ CurrentCell5x ] = TempX And TeleportYLink[CurrentCell5x] = TempY Then If (LDCall.Function2(AccessFunction,TeleportXLink[ GameBoard["Pairs"][CurrentCell5x] ],TeleportYLink[ GameBoard["Pairs"][CurrentCell5x] ]) <> 0) AND FGameBoard[TeleportXLink[GameBoard["Pairs"][CurrentCell5x]]][TeleportYLink[ GameBoard["Pairs"][CurrentCell5x]]] <> 6 Then LDArray.SetValue(RootX, LDArray.Count(RootX) + 1, TeleportXLink[ GameBoard["Pairs"][CurrentCell5x] ] ) LDArray.SetValue(RootY, LDArray.Count(RootY) + 1, TeleportYLink[ GameBoard["Pairs"][CurrentCell5x] ] ) ' TextWindow.WriteLine("Teleport from ("+TempX+","+TempY+") to ("+ LDArray.GetValue(RootX, LDArray.Count(RootX) ) +","+ LDArray.GetValue(RootY LDArray.Count(RootY) ) +")" ) ' Debug EndIf EndIf CurrentCell5x = Array.GetItemCount( TeleportXLink) + 1 EndWhile Else ' TextWindow.WriteLine( PathI + "." + "(" + Cell[TempI]["X"] +"," + Cell[TempI]["Y"] +") ~ " + Cell[PathI]["Value"] + " // " + TempI ) 'Debug LDArray.SetValue(RootX, LDArray.Count(RootX) + 1, TempX ) LDArray.SetValue(RootY, LDArray.Count(RootY) + 1, TempY ) EndIf EndIf EndFor MaxRoot = LDArray.Count(RootX) FGameBoard[FEx][FEy] = 6 EndIf EndFor If PointCellsFound <> GenerateMinPoints Then If LDArray.Count(RootX) = 1 And FindEnclosedAttempted = 0 Then LDCall.Function(DebugFunction,"Find Enclosed Array Error") FindEnclosedAttempted = 1 FindEnclosed() ElseIf PointCellsFound <> SPoints And LDArray.Count(RootX) <> 1 Then 'If they Equal no Alarms Should Ring GraphicsWindow.ShowMessage("Warning : This level may be unplayable . " + PointCellsFound + " out of " + GenerateMinPoints +" point tiles are reachable" , "Find Enclosed ") LDCall.Function(DebugFunction,"Warning : This level may be unplayable . " + PointCellsFound + " out of " + GenerateMinPoints +" point tiles are reachable") ElseIf LDArray.Count(RootX) = 1 And FindEnclosedAttempted = 1 Then GraphicsWindow.ShowMessage("Error Code :FEA2 " , "Find Enclosed Array Error") LDCall.Function(DebugFunction,"Error Code :FEA2 (" + LDArray.Count(RootX) +")") EndIf EndIf ' TextWindow.WriteLine ( LDArray.Count(RootX) )'Debug FindEnclosedRunning = 0 LDCall.Function(DebugFunction,"") EndSub '_________________________________________________________________________________________________________________________________ ' Draws Map '_________________________________________________________________________________________________________________________________ Sub DrawUI ' Draws Basic UI PointsSquaresDrawn = 0 For UIx = 1 To DrawUI_MinBoxes For UIy = 1 To DrawUI_MinBoxes CurrentCell = GameBoard[UIx][UIy] If CurrentCell = 1 Then GraphicsWindow.BrushColor = "Black" ElseIf CurrentCell = 2 then ElseIf CurrentCell = 3 Then GraphicsWindow.BrushColor = "Yellow" PointsSquaresDrawn = PointsSquaresDrawn + 1 LDArray.SetValue(XArray,PointsSquaresDrawn,UIX)'THE UIX & UIY MIX UP IS INTENTIONAL! LDArray.SetValue(YArray,PointsSquaresDrawn,UIY) Elseif CurrentCell = 4 Then GraphicsWindow.BrushColor = "Red" PointsSquaresDrawn = PointsSquaresDrawn + 1 LDArray.SetValue(XArray,PointsSquaresDrawn,UIX) LDArray.SetValue(YArray,PointsSquaresDrawn,UIY) ElseIf CurrentCell = 5 Then GraphicsWindow.BrushColor = "White" CurrentCell5x = 0 While CurrentCell5x <= Array.GetItemCount(TeleportXLink) If TeleportXLink[ CurrentCell5x ] = UIx Then CurrentCell5x = Array.GetItemCount(TeleportXLink) GraphicsWindow.BrushColor = "Orange" EndIf CurrentCell5x = CurrentCell5x + 1 EndWhile Else GraphicsWindow.BrushColor = "White" EndIf GraphicsWindow.DrawRectangle( UIx * DrawUI_BoxSize , UIy * DrawUI_BoxSize , DrawUI_BoxSize , DrawUI_BoxSize ) GraphicsWindow.FillRectangle( UIx * DrawUI_BoxSize , UIy * DrawUI_BoxSize , DrawUI_BoxSize , DrawUI_BoxSize ) EndFor EndFor BoxesToGo = PointsSquaresDrawn EndSub Sub DrawNumbers For UIx = 1 To DrawUI_BoxSize * DrawUI_MinBoxes Step DrawUI_BoxSize GraphicsWindow.DrawText(UIx , 5, Math.Round( UIx/ DrawUI_BoxSize) ) EndFor For UIy = 1 To DrawUI_BoxSize * DrawUI_MinBoxes Step DrawUI_BoxSize GraphicsWindow.DrawText(5 , UIy, Math.Round( UIy/ DrawUI_BoxSize) ) EndFor EndSub Sub DrawKey UIx = (1 * DrawUI_BoxSize * 32) UIy = (DrawUI_BoxSize * 32 * 0.40 ) GraphicsWindow.DrawText(UIx + 90 , UIy - 20 , "Key" ) GraphicsWindow.DrawRectangle( UIx , UIy , 200 ,170 ) GraphicsWindow.DrawText(UIx + 10 + 40 , UIy + 15 , "Point Square") GraphicsWindow.DrawText(UIx + 10 + 40 , UIy + 50 + 5 , "End Square") GraphicsWindow.DrawText(UIx + 10 + 40 , UIy + 90 + 5, "Teleport Square") GraphicsWindow.DrawText(UIx + 10 + 40 , UIy + 130 + 5, "Turtle") GraphicsWindow.BrushColor = "Yellow" YRectangle = Shapes.AddRectangle(30,30) GraphicsWindow.BrushColor = "Red" RRectangle = Shapes.AddRectangle(30,30) GraphicsWindow.BrushColor = "Orange" ORectangle = Shapes.AddRectangle(30,30) Shapes.Move( YRectangle,UIx + 10, UIy + 10) Shapes.Move( RRectangle, UIx + 10, UIy + 50) Shapes.Move( ORectangle,UIx + 10,UIy+ 90 ) LDDialogs.ToolTip(YRectangle,"This is a Point Square. Land on this square and gain 100 points.") LDDialogs.ToolTip(RRectangle,"This is an End Square. A square that the game has detected to have only one enterance. Be warned this is not perfect.") LDDialogs.ToolTip(ORectangle,"This is a teleport square. It teleports you to another teleport sqaure. Teleport Squares are special in that they can be walked on more than once") EndSub '_________________________________________________________________________________________________________________________________ ' Misc '_________________________________________________________________________________________________________________________________ Sub Calculate_Access CAx = args[1] CAy = args[2] Access = 4 If GameBoard[CAx][CAy+1] = 1 Or GameBoard[CAx][CAy+1] = 2 Then 'Up Access = Access - 1 EndIf If GameBoard[CAx][CAy-1] = 1 Or GameBoard[CAx][CAy-1] = 2 Then 'Down Access = Access - 1 EndIf If GameBoard[CAx-1][CAy] = 1 Or GameBoard[CAx-1][CAy] = 2 Then 'Left Access = Access - 1 EndIf If GameBoard[CAx+1][CAy] = 1 Or GameBoard[CAx+1][CAy] = 2 Then 'Righ Access = Access - 1 EndIf return = Access EndSub Sub SpawnPlayer Turtle.Show() Turtle.X = (3 * DrawUI_BoxSize) - (DrawUI_BoxSize/2) Turtle.Y = (3 * DrawUI_BoxSize) - (DrawUI_BoxSize/2) Turtle.Speed = 10 'Turtle.PenUp() RandomBrush = GraphicsWindow.GetRandomColor() TurtleFx = Math.Round( Turtle.X / DrawUI_BoxSize ) TurtleFY = Math.Round( Turtle.Y / DrawUI_BoxSize ) CurrentCell = GameBoard[TurtleFx][TurtleFY] StartTime = Clock.ElapsedMilliseconds EndSub '_________________________________________________________________________________________________________________________________ ' AI Pathing '_________________________________________________________________________________________________________________________________ Sub SendTurtle CurrentValue = Value[CurrentX][CurrentY] While (CurrentValue > 0) 'TextWindow.Pause() For i = 1 To 4 TryX = CurrentX+StepX[i] TryY = CurrentY+StepY[i] If (Value[TryX][TryY]<> "" And Value[TryX][TryY] < CurrentValue) Then 'TextWindow.WriteLine(TryX+","+TryY) Turtle.MoveTo((TryX+0.5)*DrawUI_BoxSize,(TryY+0.5)*DrawUI_BoxSize) If (GameBoard[TryX][TryY] = 5) Then 'Teleport TryX = Math.GetRandomNumber(DrawUI_MinBoxes)-1 TryY = Math.GetRandomNumber(DrawUI_MinBoxes)-1 While (GameBoard[TryX][TryY] <> "" Or Value[TryX][TryY] = "") TryX = Math.GetRandomNumber(DrawUI_MinBoxes)-1 TryY = Math.GetRandomNumber(DrawUI_MinBoxes)-1 EndWhile 'TextWindow.WriteLine(TryX+","+TryY) Turtle.X = (TryX+0.5)*DrawUI_BoxSize Turtle.Y = (TryY+0.5)*DrawUI_BoxSize 'We have teleported so abandon this path and look for the next nearest at our new location so end this sub 'CurrentX = TryX 'CurrentY = TryY 'Goto Finished EndIf CurrentX = TryX CurrentY = TryY CurrentValue = Value[CurrentX][CurrentY] i = 4 'End Loop EndIf EndFor EndWhile 'Finished: EndSub Sub AI_Path Value = "" 'Array of stes from taget to start 'A queue is like a stack except it is first in first out 'Use this since we want to check next values in order they were added LDQueue.Enqueue("StateX",Closest_X) LDQueue.Enqueue("StateY",Closest_Y) 'Start at the target position and work back over the grid Value[Closest_X][Closest_Y] = 0 'GraphicsWindow.DrawText(Closest_X*30,Closest_Y*30,0) While (LDQueue.GetCount("StateX") > 0) TestX = LDQueue.Dequeue("StateX") TestY = LDQueue.Dequeue("StateY") NextValue = Value[TestX][TestY]+1 'Check neighbours For i = 1 To 4 TryX = TestX+StepX[i] TryY = TestY+StepY[i] 'Check if try is a new valid square (depends on what GameBoard is) and we have not aleady set it 'TextWindow.WriteLine(TryX+","+TryY+": "+GameBoard[TryX][TryY]) 'DEBUG If (Value[TryX][TryY] = "" And GameBoard[TryX][TryY] <> 1) Then 'Add new square to queue to check next and mark its current value LDQueue.Enqueue("StateX",TryX) LDQueue.Enqueue("StateY",TryY) Value[TryX][TryY] = NextValue 'GraphicsWindow.DrawText(TryX*30,TryY*30,NextValue) EndIf EndFor 'TextWindow.Pause() 'DEBUG EndWhile EndSub End>LNN766.sb< Start>LNP547.sb< 'Example solution to December 2013 Challenge (Curriculum 2.6(3)) 'Uses Timer and Stack to asyncronously download images in preparation for use 'Shape images are created and destroyed as required 'The only limiting feature is that ImageList will continue to grow gradually consuminng memory 'Setup variables and GW Initialise() 'Start Timer to get images asyncronously (in parallel on Timer thread) Timer.Interval = 1000 Timer.Tick = OnTick 'Main loop While "True" start = Clock.ElapsedMilliseconds UpdateImages() 'Pause up to 10ms depending on time spent doing updates delay = 10 - (Clock.ElapsedMilliseconds-start) If (delay > 0) Then Program.Delay(delay) EndIf EndWhile '=========================================================== 'SUBROUTINES '=========================================================== 'All initialisation Sub Initialise imageCount = 0 'Current image number imageShape = "" 'Store for current moving images tag = "santa claus" 'Tag for Flickr image 'Setup GW gw = Desktop.Width-40 gh = 600 GraphicsWindow.BackgroundColor = "Black" GraphicsWindow.Top = 10 GraphicsWindow.Left = 10 GraphicsWindow.Title = tag+" slideshow" GraphicsWindow.Height = gh GraphicsWindow.Width = gw GraphicsWindow.BrushColor = "Pink" GraphicsWindow.FontSize = 50 loading = Shapes.AddText("loading...") Shapes.Move(loading,100,100) Mouse.HideCursor() EndSub 'Asyncronous download of images - careful not to use any variable names used in main loop subrotines Sub OnTick Timer.Pause() ' Stop the timer as this sub will continue for ever loading imges as required While ("True") If (Stack.GetCount("images") < 10) Then 'load up to 10 images ready to use 'If we don't use ImageList then we cannot get the image size 'There is no way in standard SB to remove used images from ImageList so memory will gradually grow image = ImageList.LoadImage(Flickr.GetRandomPicture(tag)) w = ImageList.GetWidthOfImage(image) h = ImageList.GetHeightOfImage(image) img = Shapes.AddImage(image) 'We can get some flicker when image is added - to minimise we immediately move off-screen Shapes.Move(img,-w,(gh-h)/2) Stack.PushValue("images", img) If (imageShape = "") Then 'Create first image NextImage() Shapes.Remove(loading) EndIf EndIf Program.Delay(10) 'Don't mash cpu when nothing to do EndWhile EndSub 'Get the next image and add it to the moving list array Sub NextImage If (Stack.GetCount("images") > 0) Then imageCount = imageCount+1 imageShape[imageCount] = Stack.PopValue("images") EndIf EndSub 'Move the current active images Sub UpdateImages indexShapes = Array.GetAllIndices(imageShape) For i = 1 To Array.GetItemCount(indexShapes) 'Get current moving image and update its position index = indexShapes[i] shape = imageShape[index] x = Shapes.GetLeft(shape) y = Shapes.GetTop(shape) Shapes.Move(shape, x+1, y) 'Start a new image (with a pixel space of 10) If (x < 10 And x+1 >= 10) Then NextImage() EndIf 'Clean up and remove finished images If (x > gw) Then Shapes.Remove(shape) 'Remove finished with shape imageShape[index] = "" EndIf EndFor EndSub End>LNP547.sb< Start>LNP892-4.sb< ' 50 Lines program by NaochanON LNP892-4 ' Push Space key at gate bar Gradually speed Up. If you miss hitting 10 times , it stops. gui() GraphicsWindow.KeyDown=OnkeyDown GraphicsWindow.KeyUp=OnkeyUp While (MM-NN<11) Markmove() Program.Delay(20) endWhile Sub OnKeyDown If GraphicsWindow.LastKey="Space" Then SpaceDown="Yes" EndIf endsub Sub OnkeyUp Spacedown="No" EndSub Sub MarkMove For k=1 To 10 Shapes.Move(mark[K],Shapes.GetLeft(mark[K])-3-DX,Shapes.GetTop(mark[K])) If Shapes.GetLeft(mark[K])<-100 Then Shapes.Move(mark[K],10*(20+i*Math.GetRandomNumber(40))+1000,Shapes.GetTop(mark[K])) Shapes.SetOpacity(mark[K],100) DX=DX+0.1 EndIf if math.Abs(Shapes.GetLeft(mark[K])-210)<(1.5+DX/2) Then ' Count Ellipse MM=MM+1 EndIf If SpaceDown="Yes" And Math.Abs(Shapes.GetLeft(mark[K])+DR[K]/2-(200+10/2))<16 Then ' Hit count Sound.PlayClick() Shapes.SetOpacity(mark[K],50) NN=NN+1 Spacedown="No" K=K+1 EndIf GraphicsWindow.Title="If missing 10 times, it stops. Your Hit counts = "+NN+ " Total= "+MM + " Hit ratio = "+math.Floor(NN/MM*1000)/10+ "%" EndFor EndSub Sub gui GraphicsWindow.Width=1000 GraphicsWindow.FontSize=20 For i=1 To 10 color=GraphicsWindow.GetRandomColor() GraphicsWindow.BrushColor=color GraphicsWindow.PenColor=color DR[i]=30+Math.GetRandomNumber(50) mark[i]=Shapes.AddEllipse(DR[i],DR[i]) Shapes.Move(mark[i],10*(20+i*Math.GetRandomNumber(40))+1000,200-DR[i]/2) EndFor GraphicsWindow.FillRectangle(200,80,10,300) ' gate bar EndSub End>LNP892-4.sb< Start>LNQ427.sb< GraphicsWindow.Title="Algoritm Small basic" GraphicsWindow.Width = Desktop.Width GraphicsWindow.Height = Desktop.Height GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 GraphicsWindow.PenColor="black" GraphicsWindow.FontSize = 14 GraphicsWindow.FontName = "Arial" GraphicsWindow.DrawText(40,30"Алгоритмийн төрөл") Шугаман = Controls.AddButton("Шугаман", 40,60) Controls.SetSize(Шугаман, 100, 50) Салаалсан = Controls.AddButton(" Салаалсан", 40,140) Controls.SetSize( Салаалсан, 100, 50) Давдалттай = Controls.AddButton(" Давдалттай", 40,220) Controls.SetSize(Давдалттай, 100, 50) Controls.ButtonClicked = MouseAction Sub MouseAction x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY GraphicsWindow.PenWidth = 100 If x > 40 And x < 140 Then If y > 60 And y < 110 Then EndIf EndIf If x > 40 And x < 140 Then If y > 140 And y < 190 Then bodlogo() EndIf endIf If x > 40 And x < 140 Then If y > 220 And y < 270 Then EndIf endIf EndSub Sub bodlogo GraphicsWindow.Width = Desktop.Width GraphicsWindow.Height = Desktop.Height GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 GraphicsWindow.PenColor="black" GraphicsWindow.FontSize = 14 GraphicsWindow.FontName = "Arial" GraphicsWindow.DrawText(200,50"Бодлого") ih= Controls.AddButton("1.2тооны ихийг ол", 200,90) Controls.SetSize(ih, 500, 50) bga= Controls.AddButton("2. x,y бодит тоог соль ", 200,170) Controls.SetSize(bga, 500, 50) too= Controls.AddButton("3.Өгөгдсөн 3 тоо ", 200,230) Controls.SetSize(too, 500, 50) nat= Controls.AddButton("4.Натурал a,b тоо өгөгдөв ", 200,310) Controls.SetSize(nat, 500, 50) gur= Controls.AddButton("5.Гурвалжин орших уу ", 200,390) Controls.SetSize(gur, 500, 50) shu= Controls.AddButton("6. Дугтуй ", 200,470) Controls.SetSize(shu, 500, 50) Tegsh= Controls.AddButton("7.Тэгш тооны нийлбэр ", 200,530) Controls.SetSize(Tegsh, 500, 50) Controls.ButtonClicked = Mouse EndSub Sub Mouse x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY GraphicsWindow.PenWidth = 100 If x > 200 And x < 600 Then If y > 90 And y < 140Then GraphicsWindow.Clear() bodlogo1() EndIf EndIf If x > 200 And x < 600 Then If y > 170 And y < 220Then GraphicsWindow.Clear() bodlogo2() EndIf EndIf If x > 200 And x < 600 Then If y > 230 And y < 290Then GraphicsWindow.Clear() bodlogo3() EndIf EndIf If x > 200 And x < 600 Then If y > 310 And y < 360Then GraphicsWindow.Clear() bodlogo4() EndIf EndIf If x > 200 And x < 600 Then If y > 390 And y < 440 Then GraphicsWindow.Clear() tseg() EndIf EndIf If x > 200 And x < 600 Then If y > 470 And y < 520 Then GraphicsWindow.Clear() bodlogo6() EndIf EndIf If x > 200 And x < 600 Then If y > 530 And y < 580 Then GraphicsWindow.Clear() bodlogo7() EndIf EndIf EndSub Sub bodlogo1 GraphicsWindow.Title = " Бодлого 1 " GraphicsWindow.DrawText(40,30"1. a,b бодит тоо өгөгдөв. Ихийг хэвлэ") Controls.ButtonClicked = MouseAc GraphicsWindow.FontSize = 12 GraphicsWindow.FontName = "Arial" Triangle = Controls.AddButton("Бодох", 40, 420) Controls.SetSize(Triangle, 120, 30) Triangle = Controls.AddButton("Зурах", 40, 370) Controls.SetSize(Triangle, 120, 30) MouseAc() EndSub Sub MouseAc x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY If x > 40 And x < 160 Then If y > 370 And y < 400 Then GraphicsWindow.PenWidth = 1 GraphicsWindow.DrawText(30, 80, "a тоог оруул") a = Controls.AddTextBox(120,80) Controls.SetSize(a,40,25) GraphicsWindow.DrawText(30,120,"b тоог оруул") b= Controls.AddTextBox(120,120) Controls.SetSize(b,40,25) Turtle.Show() GraphicsWindow.Width = Desktop.Width GraphicsWindow.Height = Desktop.Height GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 Turtle.Speed = 20 Turtle.X = 480 Turtle.Y = 100 elp() sum() pllg() Turtle.Turn(180) sum() Turtle.Turn(180) nohtsol() shuluun() Turtle.Turn(180) Tontsogt() zurs() Turtle.Turn(45) Turtle.X = 530 Turtle.Y = 235 bshuluun() Turtle.Turn(180) Tontsogt() bzurs() Turtle.Turn(-90) hwle() Turtle.Turn(180) sum() Turtle.Turn(45) elp() Turtle.Hide() EndIf EndIf If y >420 And y < 450 Then If x > 40 And x < 160 Then bod () EndIf EndIf EndSub Sub elp sides = 5 length = 30 / sides angle = -90 / sides Turtle.Turn(90) Turtle.Move(50) For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor sides=sides*2 Turtle.Move(100) For i = 1 To sides Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Move(50) EndSub Sub sum Turtle.Turn(90) Turtle.Move(25) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub pllg Turtle.Turn(-45) Turtle.Move(60) Turtle.Turn(135) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(120) Turtle.Turn(135) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(120) Turtle.Turn(135) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(40) EndSub Sub nohtsol for i=1 to 4 Turtle.Turn(-90) Turtle.Move(80) EndFor EndSub Sub shuluun Turtle.Turn(-90) Turtle.Move(80) Turtle.Turn(45) Turtle.Move(70) Turtle.Turn(-90) Turtle.Move(70) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub Tontsogt Turtle.Turn(-45) Turtle.Move(60) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(120) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(120) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(60) EndSub sub zurs Turtle.Turn(90) Turtle.Move(80) Turtle.Turn(-90) Turtle.Move(70) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub hwle Turtle.X =480 Turtle.Y =400 Turtle.Turn(-45) Turtle.Move(40) Turtle.Turn(180) sides = 10 length = 30 / sides angle = -90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Turn(180) Turtle.Move(80) sides = 5 length = 30 / sides angle = 90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Move(90) Turtle.Turn(180) sides = 10 length = 30 / sides angle = -90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Turn(180) Turtle.Move(40) EndSub Sub bshuluun Turtle.Move(80) Turtle.Turn(90) Turtle.Move(70) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub bzurs Turtle.Turn(90) Turtle.Move(80) Turtle.Turn(90) Turtle.Move(110) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) GraphicsWindow.FontSize = 14 EndSub sub bod GraphicsWindow.DrawText(465, 70, "Эхлэл") a1 = Controls.GetTextBoxText(a) b1= Controls.GetTextBoxText(b) If(a1>b1)then max=a1 Else max=b1 EndIf GraphicsWindow.DrawText(420, 140, "a="+a1) GraphicsWindow.DrawText(460,140, "b="+b1) GraphicsWindow.DrawText(460, 220, a1 +">"+b1) if (a1>b1) Then GraphicsWindow.DrawText(320, 320, a1) Else GraphicsWindow.DrawText(580, 320, b1) EndIf GraphicsWindow.DrawText(440, 420,"max="+max) GraphicsWindow.DrawText(440, 470, "Төгсгөл") EndSub sub bodlogo4 GraphicsWindow.Width = Desktop.Width GraphicsWindow.Height = Desktop.Height GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 GraphicsWindow.Title = " Бодлого 4 " GraphicsWindow.DrawText(40,30"4. Натурал a,b тоонууд өгөгдөв. Ихийг нь багад нь хуваахад гарах ноогдвор ба үлдэгдлийг ол.") Controls.ButtonClicked = MouseA GraphicsWindow.FontSize = 12 GraphicsWindow.FontName = "Arial" Triangle = Controls.AddButton("Бодох", 40, 420) Controls.SetSize(Triangle, 120, 30) Triangle = Controls.AddButton("Зурах", 40, 370) Controls.SetSize(Triangle, 120, 30) EndSub MouseA() Sub MouseA x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY If x > 40 And x < 160 Then If y > 370 And y < 400 Then GraphicsWindow.PenWidth = 1 GraphicsWindow.FontSize = 14 GraphicsWindow.DrawText(30, 80, "a тоог оруул") a = Controls.AddTextBox(120,80) Controls.SetSize(a,40,25) GraphicsWindow.DrawText(30,120,"b тоог оруул") b= Controls.AddTextBox(120,120) Controls.SetSize(b,40,25) Turtle.Show() GraphicsWindow.Width = Desktop.Width GraphicsWindow.Height = Desktop.Height GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 Turtle.Speed = 20 Turtle.X = 480 Turtle.Y = 100 elps() sm() pllgr() Turtle.Turn(180) sm() Turtle.Turn(180) shnohtsol() shluun() Turtle.Turn(180) Tgontsogt() sm() Turtle.Turn(180) Tgontsogt() Turtle.Turn(180) tshuluun() Turtle.X = 530 Turtle.Y = 235 bshluun() Turtle.Turn(180) Tgontsogt() sm() Turtle.Turn(180) Tgontsogt() Turtle.Turn(180) tshuluunb() Turtle.Turn(180) sm() hwl() Turtle.Turn(180) sm() Turtle.Turn(45) elps() Turtle.Hide() EndIf EndIf If y >420 And y < 450 Then If x > 40 And x < 160 Then bodoh() EndIf EndIf EndSub Sub elps sides = 5 length = 30 / sides angle = -90 / sides Turtle.Turn(90) Turtle.Move(50) For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor sides=sides*2 Turtle.Move(100) For i = 1 To sides Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Move(50) EndSub Sub sm Turtle.Turn(90) Turtle.Move(25) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub pllgr Turtle.Turn(-45) Turtle.Move(60) Turtle.Turn(135) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(120) Turtle.Turn(135) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(120) Turtle.Turn(135) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(40) EndSub Sub shnohtsol for i=1 to 4 Turtle.Turn(-90) Turtle.Move(80) EndFor EndSub Sub ushuluun Turtle.Turn(-90) Turtle.Move(80) Turtle.Turn(45) Turtle.Move(70) Turtle.Turn(-90) Turtle.Move(345) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub shluun Turtle.Turn(-90) Turtle.Move(80) Turtle.Turn(45) Turtle.Move(70) Turtle.Turn(-90) Turtle.Move(70) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub Tgontsogt Turtle.Turn(-45) Turtle.Move(60) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(120) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(120) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(60) EndSub sub zuraas Turtle.Turn(90) Turtle.Move(80) Turtle.Turn(-90) Turtle.Move(70) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub hwl Turtle.Turn(-45) Turtle.Move(40) Turtle.Turn(180) sides = 10 length = 30 / sides angle = -90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Turn(180) Turtle.Move(80) sides = 5 length = 30 / sides angle = 90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Move(90) Turtle.Turn(180) sides = 10 length = 30 / sides angle = -90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Turn(180) Turtle.Move(40) EndSub Sub bshluun Turtle.Move(80) Turtle.Turn(90) Turtle.Move(70) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub bzuraas Turtle.Turn(90) Turtle.Move(80) Turtle.Turn(90) Turtle.Move(110) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub tshuluun Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(-90) Turtle.Move(145) EndSub Sub tshuluunb Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(90) Turtle.Move(130) EndSub sub bodoh a1 = Controls.GetTextBoxText(a) b1= Controls.GetTextBoxText(b) If(a1>b1)Then n=Math.Floor(a1/b1) u=Math.Remainder(a1,b1) Else n=b1/a1 u=Math.Remainder(b1,a1) EndIf GraphicsWindow.DrawText(465, 70, "Эхлэл") GraphicsWindow.DrawText(420, 140, "a="+a1) GraphicsWindow.DrawText(470,140, "b="+b1) GraphicsWindow.DrawText(440, 230, a1 +">"+b1) if (a1>b1) Then GraphicsWindow.DrawText(320, 320,"n="+n ) GraphicsWindow.DrawText(320, 380, "u="+u) Else GraphicsWindow.DrawText(600, 320,"n="+n ) GraphicsWindow.DrawText(600, 380, "u="+u) EndIf GraphicsWindow.DrawText(440, 460,n) GraphicsWindow.DrawText(470, 460,u) GraphicsWindow.DrawText(440, 530, "Төгсгөл") EndSub Sub bodlogo2 GraphicsWindow.Width = Desktop.Width GraphicsWindow.Height = Desktop.Height GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 GraphicsWindow.Title = " Бодлого 2 " GraphicsWindow.DrawText(40,30"1. x,y бодит тоо өгөгдсөн. Тэдгээрийн багыг нь энэ 2 тооны нийлбэрийн хагасаар, ихийг 2 тооны нийлбэрийг 2 дахин авсан утгаар соль.") Controls.ButtonClicked = Hulgan GraphicsWindow.FontSize = 12 GraphicsWindow.FontName = "Arial" Triangle = Controls.AddButton("Бодох", 40, 420) Controls.SetSize(Triangle, 120, 30) Triangle = Controls.AddButton("Зурах", 40, 370) Controls.SetSize(Triangle, 120, 30) Hulgan() EndSub Sub Hulgan x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY If x > 40 And x < 160 Then If y > 370 And y < 400 Then GraphicsWindow.PenWidth = 1 Turtle.Show() GraphicsWindow.Width = Desktop.Width GraphicsWindow.Height = Desktop.Height GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 Turtle.Speed = 20 Turtle.X = 480 Turtle.Y = 100 ellp() dsum() pllgrm() Turtle.Turn(180) dsum() Turtle.Turn(180) nohtsolsh() ushluun() hwleh() tshluun() Turtle.X = 530 Turtle.Y = 235 bshuln() Turtle.X = 610 Turtle.Y = 290 dgsum() Turtle.Turn(180) nohtsolsh() shuln() Turtle.Turn(180) Tgshontsogt() dsum() Turtle.Turn(180) Tgshontsogt() Turtle.Turn(180) tshluun() Turtle.X = 670 Turtle.Y = 360 bshluun() Turtle.Turn(180) Tgshontsogt() dsum() Turtle.Turn(180) Tgshontsogt() Turtle.Turn(180) tshluunb() Turtle.Turn(180) dsum() hwleh() tshluunb() Turtle.Turn(180) dsum() Turtle.Turn(45) ellp() Turtle.Hide() EndIf EndIf If y >420 And y < 450 Then If x > 40 And x < 160 Then bodno() EndIf EndIf EndSub Sub ellp sides = 5 length = 30 / sides angle = -90 / sides Turtle.Turn(90) Turtle.Move(50) For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor sides=sides*2 Turtle.Move(100) For i = 1 To sides Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Move(50) EndSub Sub dsum Turtle.Turn(90) Turtle.Move(25) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub pllgrm Turtle.Turn(-45) Turtle.Move(60) Turtle.Turn(135) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(120) Turtle.Turn(135) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(120) Turtle.Turn(135) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(40) EndSub Sub nohtsolsh for i=1 to 4 Turtle.Turn(-90) Turtle.Move(80) EndFor EndSub Sub ushluun Turtle.Turn(-90) Turtle.Move(80) Turtle.Turn(45) Turtle.Move(70) Turtle.Turn(-90) Turtle.Move(345) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub shuln Turtle.Turn(-90) Turtle.Move(80) Turtle.Turn(45) Turtle.Move(70) Turtle.Turn(-90) Turtle.Move(70) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub Tgshontsogt Turtle.Turn(-45) Turtle.Move(60) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(120) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(120) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(60) EndSub sub zuras Turtle.Turn(90) Turtle.Move(80) Turtle.Turn(-90) Turtle.Move(70) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub hwleh Turtle.Turn(-45) Turtle.Move(40) Turtle.Turn(180) sides = 10 length = 30 / sides angle = -90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Turn(180) Turtle.Move(80) sides = 5 length = 30 / sides angle = 90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Move(90) Turtle.Turn(180) sides = 10 length = 30 / sides angle = -90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Turn(180) Turtle.Move(40) EndSub Sub bushln Turtle.Move(80) Turtle.Turn(90) Turtle.Move(70) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub bzrs Turtle.Turn(90) Turtle.Move(80) Turtle.Turn(90) Turtle.Move(110) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub tshluun Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(-90) Turtle.Move(145) EndSub Sub bshuln Turtle.Move(80) Turtle.Turn(90) Turtle.Move(20) Turtle.Turn(-90) For i=1 To 2 Turtle.Move(40) Turtle.TurnRight() EndFor Turtle.Move(40) For i=1 To 2 Turtle.Move(40) Turtle.TurnRight() EndFor Turtle.Move(50) EndSub Sub dgsum Turtle.Turn(90) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub tshluunb Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(90) Turtle.Move(130) GraphicsWindow.FontSize = 14 GraphicsWindow.DrawText(30, 80, " x тоог оруул") bntx= Controls.AddTextBox(120,80) Controls.SetSize(bntx,40,25) GraphicsWindow.DrawText(30,120,"y тоог оруул") bnty= Controls.AddTextBox(120,120) Controls.SetSize(bnty,40,25) EndSub sub bodno x1 = Controls.GetTextBoxText(bntx) y1= Controls.GetTextBoxText(bnty) s=x1+y1 If(x1 40 And x < 160 Then If y > 370 And y < 400 Then GraphicsWindow.PenWidth = 1 GraphicsWindow.DrawText(30, 80, " a тоог оруул") sba= Controls.AddTextBox(120,80) Controls.SetSize(sba,40,25) GraphicsWindow.DrawText(30,120,"b тоог оруул") sbb= Controls.AddTextBox(120,120) Controls.SetSize(sbb,40,25) GraphicsWindow.DrawText(30,160,"c тоог оруул") sbc= Controls.AddTextBox(120,160) Controls.SetSize(sbc,40,25) Turtle.Show() GraphicsWindow.Width = Desktop.Width GraphicsWindow.Height = Desktop.Height GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 Turtle.Speed = 20 Turtle.X = 650 Turtle.Y = 40 elp1() sum1() pllg1() Turtle.Turn(180) sum1() Turtle.Turn(180) nohtsol1() shuluun1() Turtle.Turn(180) Tontsogt1() Turtle.Turn(180) tshuluun1() Turtle.X = 700 Turtle.Y = 155 Turtle.Turn(90) togsshuluun() Turtle.Turn(180) sum1() Turtle.Turn(180) nohtsol1() shuluun1() Turtle.Turn(180) Tontsogt1() Turtle.Turn(180) tshuluun1() Turtle.X = 700 Turtle.Y = 325 Turtle.Turn(90) togsshuluun() Turtle.Turn(180) sum1() Turtle.Turn(180) nohtsol1() shuluun1() Turtle.Turn(180) Tontsogt1() Turtle.Turn(180) tshuluun1() Turtle.X = 700 Turtle.Y = 495 Turtle.Turn(90) togsshuluun() Turtle.Turn(180) sum1() hwle1() Turtle.Turn(180) sum1() Turtle.Turn(45) elp1() Turtle.Hide() EndIf EndIf If y >420 And y < 450 Then If x > 40 And x < 160 Then bod3() EndIf EndIf EndSub Sub elp1 sides = 5 length = 30 / sides angle = -90 / sides Turtle.Turn(90) Turtle.Move(50) For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor sides=sides*2 Turtle.Move(100) For i = 1 To sides Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Move(50) EndSub Sub sum1 Turtle.Turn(90) Turtle.Move(15) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub pllg1 Turtle.Turn(-45) Turtle.Move(60) Turtle.Turn(135) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(120) Turtle.Turn(135) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(120) Turtle.Turn(135) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(40) EndSub Sub nohtsol1 for i=1 to 4 Turtle.Turn(-90) Turtle.Move(80) EndFor EndSub Sub ushuluun1 Turtle.Turn(-90) Turtle.Move(80) Turtle.Turn(45) Turtle.Move(50) Turtle.Turn(-90) Turtle.Move(325) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub shuluun1 Turtle.Turn(-90) Turtle.Move(80) Turtle.Turn(45) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub Tontsogt1 Turtle.Turn(-45) Turtle.Move(60) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(120) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(120) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(60) EndSub sub zurs1 Turtle.Turn(90) Turtle.Move(80) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub hwle1 Turtle.Turn(-45) Turtle.Move(100) Turtle.Turn(180) sides = 10 length = 30 / sides angle = -90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Turn(180) Turtle.Move(200) sides = 5 length = 30 / sides angle = 90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Move(210) Turtle.Turn(180) sides = 10 length = 30 / sides angle = -90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Turn(180) Turtle.Move(100) EndSub Sub bshuluun1 Turtle.Move(80) Turtle.Turn(90) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub bzurs1 Turtle.Turn(90) Turtle.Move(80) Turtle.Turn(90) Turtle.Move(80) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub tshuluun1 Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(-90) Turtle.Move(95) EndSub Sub tshuluunb1 Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(90) Turtle.Move(120) EndSub sub togsshuluun Turtle.Turn(-90) Turtle.Move(80) Turtle.Turn(90) Turtle.Move(100) Turtle.Turn(90) Turtle.Move(138) EndSub Sub bod3 a1 = Controls.GetTextBoxText(sba) b1 = Controls.GetTextBoxText(sbb) c1 = Controls.GetTextBoxText(sbc) if(a1<0)Then a2=a1*a1 Else a2=a1 if(b1<0)Then b2=b1*b1 Else b2=b1 If(c1<0)Then c2=c1*c1 Else c2=c1 EndIf EndIf EndIf GraphicsWindow.DrawText(630, 20, "Эхлэл") GraphicsWindow.DrawText(600, 70, a1) GraphicsWindow.DrawText(630, 70, b1) GraphicsWindow.DrawText(660, 70, c1) GraphicsWindow.DrawText(630,160, a1 + "< 0") GraphicsWindow.DrawText(520, 205, "a="+a2 ) GraphicsWindow.DrawText(630, 320, b1 + "< 0") GraphicsWindow.DrawText(520, 380, "b="+b2) GraphicsWindow.DrawText(630,500, c1 + "< 0") GraphicsWindow.DrawText(520, 540,"c=" +c2 ) GraphicsWindow.DrawText(560, 620, "a="+a2 ) GraphicsWindow.DrawText(620, 620, "b="+b2 ) GraphicsWindow.DrawText(680, 620, "c="+c2 ) GraphicsWindow.DrawText(610, 670, "төгсгөл" ) EndSub Sub bodlogo7 GraphicsWindow.Width = Desktop.Width GraphicsWindow.Height = Desktop.Height GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 GraphicsWindow.Title = " Бодлого 7 " GraphicsWindow.DrawText(10,30"7. a,b,c натурал тоонууд өгөгдсөн. Тэдгээрэс тэгш тоонуудынх нь нийлбэрийг ол.") Controls.ButtonClicked = bod7 GraphicsWindow.FontSize = 12 GraphicsWindow.FontName = "Arial" Triangle = Controls.AddButton("Бодох", 40, 420) Controls.SetSize(Triangle, 120, 30) Triangle = Controls.AddButton("Зурах", 40, 370) Controls.SetSize(Triangle, 120, 30) GraphicsWindow.FontSize = 12 bod7() EndSub Sub bod7 x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY If x > 40 And x < 160 Then If y > 370 And y < 400 Then GraphicsWindow.PenWidth = 1 GraphicsWindow.DrawText(30, 80, " a тоог оруул") sbta= Controls.AddTextBox(120,80) Controls.SetSize(sbta,40,25) GraphicsWindow.DrawText(30,120,"b тоог оруул") sbtb= Controls.AddTextBox(120,120) Controls.SetSize(sbtb,40,25) GraphicsWindow.DrawText(30,160,"c тоог оруул") sbtc= Controls.AddTextBox(120,160) Controls.SetSize(sbtc,40,25) Turtle.Show() GraphicsWindow.Width = Desktop.Width GraphicsWindow.Height = Desktop.Height GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 Turtle.Speed = 20 Turtle.X = 650 Turtle.Y = 40 elp2() sum2() pllg2() Turtle.Turn(180) sum2() Turtle.Turn(180) Tontsogt2() sum2() Turtle.Turn(180) nohtsol2() shuluun2() Turtle.Turn(180) Tontsogt2() Turtle.Turn(180) tshuluun2() Turtle.X = 700 Turtle.Y = 195 Turtle.Turn(90) togsshuluun2() Turtle.Turn(180) sum2() Turtle.Turn(180) nohtsol2() shuluun2() Turtle.Turn(180) Tontsogt2() Turtle.Turn(180) tshuluun2() Turtle.X = 700 Turtle.Y = 340 Turtle.Turn(90) togsshuluun2() Turtle.Turn(180) sum2() Turtle.Turn(180) nohtsol2() shuluun2() Turtle.Turn(180) Tontsogt2() Turtle.Turn(180) tshuluun2() Turtle.X = 700 Turtle.Y = 486 Turtle.Turn(90) togsshuluun2() Turtle.Turn(180) sum2() hwle2() Turtle.Turn(180) sum2() Turtle.Turn(45) elp2() Turtle.Hide() EndIf EndIf If y >420 And y < 450 Then If x > 40 And x < 160 Then bodolt() EndIf EndIf EndSub Sub elp2 sides = 5 length = 30 / sides angle = -90 / sides Turtle.Turn(90) Turtle.Move(50) For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor sides=sides*2 Turtle.Move(100) For i = 1 To sides Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Move(50) EndSub Sub sum2 Turtle.Turn(90) Turtle.Move(10) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub pllg2 Turtle.Turn(-45) Turtle.Move(60) Turtle.Turn(135) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(120) Turtle.Turn(135) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(120) Turtle.Turn(135) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(40) EndSub Sub nohtsol2 for i=1 to 4 Turtle.Turn(-90) Turtle.Move(80) EndFor EndSub Sub ushuluun2 Turtle.Turn(-90) Turtle.Move(80) Turtle.Turn(45) Turtle.Move(50) Turtle.Turn(-90) Turtle.Move(325) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub shuluun2 Turtle.Turn(-90) Turtle.Move(80) Turtle.Turn(45) Turtle.Move(70) Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub Tontsogt2 Turtle.Turn(-45) Turtle.Move(60) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(120) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(120) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(60) EndSub sub zurs2 Turtle.Turn(90) Turtle.Move(80) Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub hwle2 Turtle.Turn(-45) Turtle.Move(40) Turtle.Turn(180) sides = 10 length = 30 / sides angle = -90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Turn(180) Turtle.Move(80) sides = 5 length = 30 / sides angle = 90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Move(90) Turtle.Turn(180) sides = 10 length = 30 / sides angle = -90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Turn(180) Turtle.Move(40) EndSub Sub bshuluun2 Turtle.Move(80) Turtle.Turn(90) Turtle.Move(20) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub bzurs2 Turtle.Turn(90) Turtle.Move(80) Turtle.Turn(90) Turtle.Move(60) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub tshuluun2 Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(-90) Turtle.Move(125) EndSub Sub tshuluunb2 Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(90) Turtle.Move(120) EndSub sub togsshuluun2 Turtle.Turn(-90) Turtle.Move(80) Turtle.Turn(90) Turtle.Move(80) Turtle.Turn(90) Turtle.Move(138) EndSub Sub bodolt a1 = Controls.GetTextBoxText(sbta) b1 = Controls.GetTextBoxText(sbtb) c1 = Controls.GetTextBoxText(sbtc) s=0 if(Math.Remainder(a1,2)=0) Then s=s+a1 Else s=s EndIf if(Math.Remainder(b1,2)=0) Then s=s+b1 Else s=s EndIf if(Math.Remainder(c1,2)=0) Then s=s+c1 Else s=s EndIf GraphicsWindow.DrawText(630, 20, "Эхлэл") GraphicsWindow.DrawText(600, 60, a1) GraphicsWindow.DrawText(630, 60, b1) GraphicsWindow.DrawText(660, 60, c1) GraphicsWindow.DrawText(630,100,"s=0") GraphicsWindow.DrawText(630,190, a1 + "mod2=0") GraphicsWindow.DrawText(520, 235, "s="+s) GraphicsWindow.DrawText(630, 330, b1 + "mod2=0") GraphicsWindow.DrawText(520, 380, "s="+s) GraphicsWindow.DrawText(630,480, c1 + "mod2=0") GraphicsWindow.DrawText(520, 520,"s="+s) GraphicsWindow.DrawText(610, 600,"s="+s ) GraphicsWindow.DrawText(610, 645, "төгсгөл" ) EndSub Sub tseg GraphicsWindow.Title = " Бодлого 5" GraphicsWindow.Width = Desktop.Width GraphicsWindow.Height = Desktop.Height GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 Controls.ButtonClicked = Action1 GraphicsWindow.DrawText(20, 20,"Координатуудаараа өгөгдсөн 3 цэгээр ") GraphicsWindow.DrawText(100, 40,"оройгоо хийсэн гурвалжин орших уу?") GraphicsWindow.FontSize = 12 GraphicsWindow.FontName = "Arial" Triangle = Controls.AddButton("Бодох", 40, 420) Controls.SetSize(Triangle, 120, 30) Triangle = Controls.AddButton("Зурах", 40, 370) Controls.SetSize(Triangle, 120, 30) Action1() EndSub Sub Action1 x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY If x > 40 And x < 160 Then If y > 370 And y < 400 Then GraphicsWindow.PenWidth = 1 GraphicsWindow.DrawText(30, 80, "a1 цэгийг оруул") bdwa = Controls.AddTextBox(150,80) Controls.SetSize(bdwa,40,20) GraphicsWindow.DrawText(30, 110, "a2 цэгийг оруул ") bdwa2 = Controls.AddTextBox(150,110) Controls.SetSize(bdwa2,40,20) GraphicsWindow.DrawText(30, 140, "b1 цэгийг оруул ") bdwb = Controls.AddTextBox(150,140) Controls.SetSize(bdwb,40,20) GraphicsWindow.DrawText(30, 170, "b2 цэгийг оруул") bdwb2 = Controls.AddTextBox(150,170) Controls.SetSize(bdwb2,40,20) GraphicsWindow.DrawText(30, 200, "c1 цэгийг оруул ") bdwc = Controls.AddTextBox(150,200) Controls.SetSize(bdwc,40,20) GraphicsWindow.DrawText(30, 230, "c2 цэгийг оруул") bdwc2 = Controls.AddTextBox(150,230) Controls.SetSize(bdwc2,40,20) Turtle.Show() Turtle.Speed = 50 Turtle.X = 580 Turtle.Y = 50 eelp1() sumd() pallg() Turtle.Turn(180) sumd() Turtle.Turn(180) Tontsog() sumd() Turtle.Turn(180) Tontsog() sumd() Turtle.Turn(180) Tontsog() sumd() Turtle.Turn(180) nshalga1() Turtle.Turn(-90) Turtle.X = 624 Turtle.Y = 372 Turtle.Turn(45) Turtle.Move(150) zrs1() hwlel1() Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(90) Turtle.Move(190) Turtle.X = 540 Turtle.Y = 372 Turtle.Move(150) Turtle.Turn(180) zrs1() hwlel1() Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(-90) Turtle.Move(193) sumd() Turtle.Turn(45) eelp1() Turtle.Hide() EndIf EndIf If y >420 And y < 450 Then If x > 40 And x < 160 Then bod5() EndIf EndIf EndSub Sub eelp1 sides = 5 length = 35 / sides angle = -90/ sides Turtle.Turn(90) Turtle.Move(50) For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor sides=sides*2 Turtle.Move(100) For i = 1 To sides Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Move(50) EndSub Sub sumd Turtle.Turn(90) Turtle.Move(25) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub pallg Turtle.Turn(-45) Turtle.Move(90) Turtle.Turn(135) Turtle.Move(50) Turtle.Turn(45) Turtle.Move(160) Turtle.Turn(135) Turtle.Move(50) Turtle.Turn(45) Turtle.Move(160) Turtle.Turn(135) Turtle.Move(50) Turtle.Turn(45) Turtle.Move(50) EndSub Sub noxtsol Turtle.Turn(120) Turtle.Move(140) Turtle.Turn(-150) Turtle.Move(140) Turtle.Turn(-30) Turtle.Move(140) Turtle.Turn(-150) Turtle.Move(140) Turtle.Turn(-30) Turtle.Move(140) EndSub Sub ushulun Turtle.Turn(-90) Turtle.Move(80) Turtle.Turn(45) Turtle.Move(70) Turtle.Turn(-90) Turtle.Move(345) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub shulun Turtle.Turn(-90) Turtle.Move(80) Turtle.Turn(-90) Turtle.Move(70) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub Tontsog Turtle.Turn(-45) Turtle.Move(80) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(160) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(160) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(80) EndSub sub zras Turtle.Turn(90) Turtle.Move(80) Turtle.Turn(-90) Turtle.Move(70) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub hwlel1 Turtle.Turn(-45) Turtle.Move(110) Turtle.Turn(180) sides = 10 length = 30 / sides angle = -90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Turn(180) Turtle.Move(220) sides = 5 length = 30 / sides angle = 90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Move(230) Turtle.Turn(180) sides = 10 length = 30 / sides angle = -90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Turn(180) Turtle.Move(110) EndSub Sub bzras Turtle.Turn(90) Turtle.Move(80) Turtle.Turn(90) Turtle.Move(110) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub tshulun Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(-90) Turtle.Move(145) EndSub Sub tshulunb Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(90) Turtle.Move(130) EndSub Sub zrs1 Turtle.Turn(90) Turtle.Move(65) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub nshalga1 Turtle.Turn(-85) Turtle.Move(60) Turtle.Turn(-95) Turtle.Move(60) Turtle.Turn(-85) Turtle.Move(60) Turtle.Turn(-95) Turtle.Move(60) Turtle.Turn(-85) Turtle.Move(60) Turtle.Turn(-95) Turtle.Move(60) EndSub Sub bod5 a1 = Controls.GetTextBoxText(bdwa) a2 = Controls.GetTextBoxText(bdwa2) b1= Controls.GetTextBoxText(bdwb) b2= Controls.GetTextBoxText(bdwb2) c1= Controls.GetTextBoxText(bdwc) c2= Controls.GetTextBoxText(bdwc2) a=Math.SquareRoot((a1-b1)*(a1-b1)+(a2-b2)*(a2-b2)) a=math.Floor(a) b=Math.SquareRoot((c1-b1)*(c1-b1)+(c2-b2)*(c2-b2)) b=math.Floor(b) c3=Math.SquareRoot((a1-c1)*(a1-c1)+(a2-c2)*(a2-c2)) c3=math.Floor(c3) GraphicsWindow.DrawText(571,339, a+b ) GraphicsWindow.DrawText(583,339 ,">"+c3) GraphicsWindow.DrawText(571,357, a+c3 ) GraphicsWindow.DrawText(583,357 ,">"+b) GraphicsWindow.DrawText(571,370, b+c3 ) GraphicsWindow.DrawText(583,370 ,">"+a) If(a+b>c3 And a+c3>b And c3+b>a) Then GraphicsWindow.DrawText(340, 450, "Гурвалжин үүснэ") else GraphicsWindow.DrawText(720, 450, "Гурвалжин үүсэхгүй") EndIf GraphicsWindow.DrawText(560, 30, "Эхлэл") GraphicsWindow.DrawText(500, 80,a1) GraphicsWindow.DrawText(530, 80,a2) GraphicsWindow.DrawText(560, 80,b1) GraphicsWindow.DrawText(590, 80, b2) GraphicsWindow.DrawText(620, 80, c1) GraphicsWindow.DrawText(640, 80, c2) GraphicsWindow.DrawText(560, 160,"a тал =" +a) GraphicsWindow.DrawText(560, 210, "b тал =" +b) GraphicsWindow.DrawText(560, 270, "c тал =" +c3) GraphicsWindow.DrawText(560, 540, "төгсгөл") EndSub Sub bodlogo6 GraphicsWindow.Title = "bodlogo 6" GraphicsWindow.Width = Desktop.Width GraphicsWindow.Height = Desktop.Height GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 Controls.ButtonClicked = sbbod7 GraphicsWindow.DrawText(20, 20, "6. (a,b)(c,d) талуудтай 2 дугтуй өгөгдсөн бол ") GraphicsWindow.DrawText(40, 40, " харилцан бие биедээ багтах эсэхийг тогтоо.") GraphicsWindow.FontSize = 12 GraphicsWindow.FontName = "Arial" Triangle = Controls.AddButton("Бодох", 40, 420) Controls.SetSize(Triangle, 120, 30) Triangle = Controls.AddButton("Зурах", 40, 370) Controls.SetSize(Triangle, 120, 30) sbbod7() EndSub Sub sbbod7 x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY If x > 40 And x < 160 Then If y > 370 And y < 400 Then GraphicsWindow.PenWidth = 1 GraphicsWindow.DrawText(30, 80, "a талыг оруул") bna = Controls.AddTextBox(150,80) Controls.SetSize(bna,40,20) GraphicsWindow.DrawText(30, 110, "b талыг оруул ") bnb = Controls.AddTextBox(150,110) Controls.SetSize(bnb,40,20) GraphicsWindow.DrawText(30, 140, "c талыг оруул ") bnc = Controls.AddTextBox(150,140) Controls.SetSize(bnc,40,20) GraphicsWindow.DrawText(30, 170, "d талыг оруул") bnd = Controls.AddTextBox(150,170) Controls.SetSize(bnd,40,20) Turtle.Show() Turtle.Speed = 50 Turtle.X = 680 Turtle.Y = 50 elips() dsumg() pllgrm1() Turtle.Turn(180) dsumg() Turtle.Turn(180) nshalga() shln1() Turtle.Turn(180) nshalga() shuln1() hwlh() toshluun() Turtle.X = 515 Turtle.Y = 369 dsumg() hwleh1() Turtle.Turn(180) dsumg() Turtle.X = 728 Turtle.Y = 186 Turtle.Turn(225) bshuluun6() Turtle.Turn(180) nshalga() shuln2() hwlh() toshluun1() Turtle.X = 865 Turtle.Y = 313 Turtle.Turn(-90) bshuluuno() hwleh1() Turtle.Turn(180) dsumg() Turtle.Turn(45) Turtle.Move(20) Turtle.Turn(90) Turtle.Move(430) dsumg1() Turtle.X = 660 Turtle.Y = 477 Turtle.Turn(45) dsumg() hwleh1() Turtle.Hide() EndIf EndIf If y >420 And y < 450 Then If x > 40 And x < 160 Then BODOH6() EndIf EndIf EndSub Sub prll Turtle.Turn(-45) Turtle.Move(60) Turtle.Turn(135) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(120) Turtle.Turn(135) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(120) Turtle.Turn(135) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(40) EndSub Sub t1 Turtle.Turn(-45) Turtle.Move(60) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(120) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(120) Turtle.Turn(-90) Turtle.Move(40) Turtle.Turn(-90) Turtle.Move(60) EndSub Sub hwleh1 Turtle.Turn(-45) Turtle.Move(110) Turtle.Turn(180) sides = 10 length = 30 / sides angle = -90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Turn(180) Turtle.Move(220) sides = 5 length = 30 / sides angle = 90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Move(230) Turtle.Turn(180) sides = 10 length = 30 / sides angle = -90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Turn(180) Turtle.Move(110) EndSub Sub elips sides = 5 length = 30 / sides angle = -90 / sides Turtle.Turn(90) Turtle.Move(50) For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor sides=sides*2 Turtle.Move(100) For i = 1 To sides Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Move(50) EndSub Sub dsumg Turtle.Turn(90) Turtle.Move(25) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub dsumg1 Turtle.Turn(90) Turtle.Move(25) Turtle.Turn(45) EndSub Sub pllgrm1 Turtle.Turn(-45) Turtle.Move(60) Turtle.Turn(135) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(120) Turtle.Turn(135) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(120) Turtle.Turn(135) Turtle.Move(40) Turtle.Turn(45) Turtle.Move(40) EndSub Sub nshalga for i=1 to 4 Turtle.Turn(-90) Turtle.Move(80) EndFor EndSub Sub ushluun1 Turtle.Turn(-90) Turtle.Move(80) Turtle.Turn(45) Turtle.Move(70) Turtle.Turn(-90) Turtle.Move(345) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub shln1 Turtle.Turn(-90) Turtle.Move(80) Turtle.Turn(45) Turtle.Move(100) Turtle.Turn(-90) Turtle.Move(70) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub bshuluun6 Turtle.Turn(90) Turtle.Move(80) Turtle.Turn(90) Turtle.Move(70) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub bshuluuno Turtle.Turn(90) Turtle.Move(80) Turtle.Turn(90) Turtle.Move(80) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub toshluun Turtle.Turn(-90) Turtle.Move(15) Turtle.Turn(-90) Turtle.Move(175) EndSub Sub toshluun1 Turtle.Turn(-90) Turtle.Move(15) Turtle.Turn(-90) Turtle.Move(252) EndSub Sub tshuluunb6 Turtle.Turn(-90) Turtle.Move(20) Turtle.Turn(90) Turtle.Move(130) EndSub Sub hwlh Turtle.Turn(-45) Turtle.Move(40) Turtle.Turn(180) sides = 10 length = 30 / sides angle = -90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Turn(180) Turtle.Move(80) sides = 5 length = 30 / sides angle = 90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Move(90) Turtle.Turn(180) sides = 10 length = 30 / sides angle = -90 / sides For i = 1 To sides*2 Turtle.Move(length) Turtle.Turn(angle) EndFor Turtle.Turn(180) Turtle.Move(40) EndSub Sub shuln1 Turtle.Turn(-90) Turtle.Move(80) Turtle.Turn(45) Turtle.Move(120) Turtle.Turn(-90) Turtle.Move(80) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub shuln2 Turtle.Turn(-90) Turtle.Move(80) Turtle.Turn(45) Turtle.Move(60) Turtle.Turn(-90) Turtle.Move(80) Turtle.Turn(45) Turtle.Move(-10) Turtle.Move(10) Turtle.Turn(-90) Turtle.Move(-10) Turtle.Move(10) EndSub Sub BODOH6 a = Controls.GetTextBoxText( bna) b= Controls.GetTextBoxText(bnb) c= Controls.GetTextBoxText(bnc) d= Controls.GetTextBoxText(bnd) If (a>c)Then If(b>d)Then GraphicsWindow.DrawText(900,400"2-r dugtui 1-rt bagtana") Else GraphicsWindow.DrawText(600,400" bagtahgui") EndIf Else If(b"+c ) GraphicsWindow.DrawText(500,300,b ) GraphicsWindow.DrawText(510,300,"<"+d ) GraphicsWindow.DrawText(800,300,b ) GraphicsWindow.DrawText(810,300,">"+d) GraphicsWindow.DrawText(680, 20, "Эхлэл") GraphicsWindow.DrawText(630, 75, "a="+a) GraphicsWindow.DrawText(630,90, "b="+b) GraphicsWindow.DrawText(665,75, "c="+c) GraphicsWindow.DrawText(665,90, "d="+d) GraphicsWindow.DrawText(640,510, "Төгсгөл") EndSub End>LNQ427.sb< Start>LNQ503.sb< 'โซว์ ไตเติ้ลนำเสนอ GraphicsWindow.Show() GraphicsWindow.Title = "Hello world! สวัสดีชาวโลก" GraphicsWindow.Width = 1200 GraphicsWindow.Height = 800 GraphicsWindow.BackgroundColor = "Bisque" GraphicsWindow.BrushColor = "Green" GraphicsWindow.FontName = "Tahoma" GraphicsWindow.FontSize = "60" GraphicsWindow.FontBold = "2" GraphicsWindow.DrawText(150, 20, "การจัดทำโครงงานคอมพิวเตอร์") GraphicsWindow.DrawText(155, 80, "นำเสนอประเภทโครงงานเกมส์") GraphicsWindow.DrawText(250, 140, "นำเสนอโดย !!!") GraphicsWindow.DrawText(250, 200, "นางศศิกาน์ เนาวบุตร ") GraphicsWindow.DrawText(250, 250, "นางศศิกานต์ วรรณทวี ") GraphicsWindow.DrawText(250, 300, "นาวรธิดา นิลจันทร์ ") GraphicsWindow.DrawText(250, 350, "เด็กหญิง สุภาพรรณ มีแป้น ") GraphicsWindow.DrawRectangle(50,50,100,100) GraphicsWindow.BrushColor = "SkyBlue" GraphicsWindow.DrawRectangle(150,150,100,100) Program.Delay(3000) GraphicsWindow.Clear() GraphicsWindow.BrushColor = "Navy" Helloworld = Shapes.AddText("ชื่อกลุ่ม รักโรงเรียน ด.ส.") GraphicsWindow.BrushColor = "Red" Helloworld2 = Shapes.AddText("โรงเรียนมัธยมวัดด่านสำโรง") Helloworld3 = Shapes.AddText("นำเสนอโคร��งานคอมพิวเตอร์") GraphicsWindow.BrushColor = "Gold" Ombre = Shapes.AddText("ชื่อกลุ่ม รักโรงเรียน ด.ส.") GraphicsWindow.DrawLine(50,50,150,150) Name = Shapes.AddRectangle(30,30) Name2 = Shapes.AddEllipse(30,30) Shapes.SetOpacity(Ombre, 30) GraphicsWindow.BackgroundColor = "white" Shapes.Move(Ombre, GraphicsWindow.Width / 2 - 33, GraphicsWindow.Height / 2 - 13) Shapes.Move(Helloworld, GraphicsWindow.Width / 2 - 30, GraphicsWindow.Height /2 - 10) Shapes.Move(Helloworld2, GraphicsWindow.Width / 2 - 100, GraphicsWindow.Height /3 - 100) Shapes.Move(Helloworld3, GraphicsWindow.Width / 2 - 100, GraphicsWindow.Height /1 - 100) Program.Delay(1000) For i = 1 To 9 Step 0.1 Shapes.Zoom(Helloworld, i, i) Shapes.Zoom(Ombre, i, i) Shapes.Zoom(Helloworld2, i, i) Shapes.Zoom(Helloworld3, i, i) Program.Delay(50) EndFor Program.Delay(1900) GraphicsWindow.Clear() 'โค้ดงานรูปภาพของนักเรียนที่ได้วาดด้วยโปรแกรม Small Basic ' ' initialize shapes Shapes_Init() ' add shapes scale = 1 Shapes_Add() angle = 0 Sub Shapes_Init ' Shapes | Initialize shapes data ' return shX, shY - current position of shapes ' return shape - array of shapes shX = 251 ' x offset shY = 125 ' y offset shape = "" shape[1] = "func=line;x=189;y=0;x1=4;y1=0;x2=0;y2=726;pc=#000000;pw=2;" shape[2] = "func=line;x=192;y=1;x1=0;y1=0;x2=812;y2=4;pc=#000000;pw=2;" shape[3] = "func=line;x=1004;y=5;x1=0;y1=0;x2=15;y2=702;pc=#000000;pw=2;" shape[4] = "func=line;x=187;y=718;x1=0;y1=9;x2=838;y2=0;pc=#000000;pw=2;" shape[5] = "func=line;x=501;y=5;x1=4;y1=0;x2=0;y2=29;pc=#215615;pw=4;" shape[6] = "func=line;x=493;y=34;x1=8;y1=0;x2=0;y2=35;pc=#215615;pw=4;" shape[7] = "func=line;x=479;y=69;x1=14;y1=0;x2=0;y2=46;pc=#215615;pw=4;" shape[8] = "func=line;x=464;y=116;x1=15;y1=0;x2=0;y2=48;pc=#215615;pw=4;" shape[9] = "func=line;x=437;y=164;x1=27;y1=0;x2=0;y2=35;pc=#215615;pw=4;" shape[10] = "func=line;x=403;y=199;x1=34;y1=0;x2=0;y2=21;pc=#215615;pw=4;" shape[11] = "func=line;x=351;y=220;x1=52;y1=0;x2=0;y2=20;pc=#215615;pw=4;" shape[12] = "func=line;x=305;y=240;x1=47;y1=0;x2=0;y2=16;pc=#215615;pw=4;" shape[13] = "func=line;x=261;y=256;x1=44;y1=0;x2=0;y2=12;pc=#215615;pw=4;" shape[14] = "func=line;x=194;y=268;x1=67;y1=0;x2=0;y2=22;pc=#215615;pw=4;" shape[15] = "func=line;x=192;y=318;x1=0;y1=0;x2=26;y2=1;pc=#215615;pw=4;" shape[16] = "func=line;x=218;y=319;x1=0;y1=0;x2=23;y2=5;pc=#215615;pw=4;" shape[17] = "func=line;x=241;y=324;x1=0;y1=0;x2=45;y2=3;pc=#215615;pw=4;" shape[18] = "func=line;x=286;y=324;x1=0;y1=3;x2=51;y2=0;pc=#215615;pw=4;" shape[19] = "func=line;x=337;y=322;x1=0;y1=2;x2=46;y2=0;pc=#215615;pw=4;" shape[20] = "func=line;x=383;y=321;x1=0;y1=1;x2=80;y2=0;pc=#215615;pw=4;" shape[21] = "func=line;x=463;y=321;x1=0;y1=0;x2=72;y2=8;pc=#215615;pw=4;" shape[22] = "func=line;x=535;y=329;x1=0;y1=0;x2=74;y2=3;pc=#215615;pw=4;" shape[23] = "func=line;x=609;y=331;x1=0;y1=1;x2=78;y2=0;pc=#215615;pw=4;" shape[24] = "func=line;x=687;y=323;x1=0;y1=8;x2=66;y2=0;pc=#215615;pw=4;" shape[25] = "func=line;x=753;y=321;x1=0;y1=2;x2=81;y2=0;pc=#215615;pw=4;" shape[26] = "func=line;x=835;y=321;x1=0;y1=0;x2=71;y2=12;pc=#215615;pw=4;" shape[27] = "func=line;x=906;y=333;x1=0;y1=0;x2=49;y2=2;pc=#215615;pw=4;" shape[28] = "func=line;x=956;y=329;x1=0;y1=6;x2=48;y2=0;pc=#215615;pw=4;" shape[29] = "func=line;x=637;y=5;x1=0;y1=0;x2=21;y2=49;pc=#215615;pw=4;" shape[30] = "func=line;x=658;y=54;x1=0;y1=0;x2=21;y2=41;pc=#215615;pw=4;" shape[31] = "func=line;x=679;y=95;x1=0;y1=0;x2=30;y2=44;pc=#215615;pw=4;" shape[32] = "func=line;x=709;y=139;x1=0;y1=0;x2=27;y2=49;pc=#215615;pw=4;" shape[33] = "func=line;x=736;y=188;x1=0;y1=0;x2=22;y2=21;pc=#215615;pw=4;" shape[34] = "func=line;x=758;y=209;x1=0;y1=0;x2=28;y2=28;pc=#215615;pw=4;" shape[35] = "func=line;x=771;y=237;x1=0;y1=0;x2=56;y2=16;pc=#215615;pw=4;" shape[36] = "func=line;x=827;y=253;x1=0;y1=0;x2=41;y2=13;pc=#215615;pw=4;" shape[37] = "func=line;x=868;y=266;x1=0;y1=0;x2=42;y2=16;pc=#215615;pw=4;" shape[38] = "func=line;x=910;y=282;x1=0;y1=0;x2=48;y2=10;pc=#215615;pw=4;" shape[39] = "func=line;x=958;y=292;x1=0;y1=0;x2=46;y2=19;pc=#215615;pw=4;" shape[40] = "func=line;x=340;y=327;x1=0;y1=0;x2=0;y2=43;pc=#4E3932;pw=4;" shape[41] = "func=line;x=340;y=370;x1=0;y1=0;x2=8;y2=45;pc=#4E3932;pw=4;" shape[42] = "func=line;x=348;y=415;x1=0;y1=0;x2=30;y2=58;pc=#4E3932;pw=4;" shape[43] = "func=line;x=378;y=473;x1=0;y1=0;x2=51;y2=54;pc=#4E3932;pw=4;" shape[44] = "func=line;x=429;y=527;x1=0;y1=0;x2=54;y2=28;pc=#4E3932;pw=4;" shape[45] = "func=line;x=483;y=555;x1=0;y1=0;x2=83;y2=15;pc=#4E3932;pw=4;" shape[46] = "func=line;x=566;y=570;x1=0;y1=0;x2=90;y2=0;pc=#4E3932;pw=4;" shape[47] = "func=line;x=656;y=547;x1=0;y1=23;x2=54;y2=0;pc=#4E3932;pw=4;" shape[48] = "func=line;x=710;y=504;x1=0;y1=43;x2=45;y2=0;pc=#4E3932;pw=4;" shape[49] = "func=line;x=756;y=445;x1=0;y1=59;x2=43;y2=0;pc=#4E3932;pw=4;" shape[50] = "func=line;x=799;y=382;x1=0;y1=62;x2=24;y2=0;pc=#4E3932;pw=4;" shape[51] = "func=line;x=823;y=325;x1=0;y1=57;x2=12;y2=0;pc=#4E3932;pw=4;" shape[52] = "func=line;x=519;y=365;x1=4;y1=0;x2=0;y2=21;pc=#4E3932;pw=4;" shape[53] = "func=line;x=514;y=386;x1=5;y1=0;x2=0;y2=14;pc=#4E3932;pw=4;" shape[54] = "func=line;x=501;y=400;x1=13;y1=0;x2=0;y2=4;pc=#4E3932;pw=4;" shape[55] = "func=line;x=460;y=404;x1=40;y1=0;x2=0;y2=9;pc=#4E3932;pw=4;" shape[56] = "func=line;x=459;y=413;x1=0;y1=0;x2=5;y2=17;pc=#4E3932;pw=4;" shape[57] = "func=line;x=463;y=428;x1=0;y1=0;x2=10;y2=7;pc=#4E3932;pw=4;" shape[58] = "func=line;x=473;y=435;x1=0;y1=0;x2=25;y2=13;pc=#4E3932;pw=4;" shape[59] = "func=line;x=498;y=448;x1=0;y1=0;x2=23;y2=1;pc=#4E3932;pw=4;" shape[60] = "func=line;x=521;y=449;x1=0;y1=0;x2=19;y2=2;pc=#4E3932;pw=4;" shape[61] = "func=line;x=540;y=451;x1=0;y1=0;x2=20;y2=1;pc=#4E3932;pw=4;" shape[62] = "func=line;x=561;y=446;x1=0;y1=6;x2=16;y2=0;pc=#4E3932;pw=4;" shape[63] = "func=line;x=574;y=425;x1=3;y1=21;x2=0;y2=0;pc=#4E3932;pw=4;" shape[64] = "func=line;x=357;y=327;x1=0;y1=0;x2=6;y2=21;pc=#4E3932;pw=4;" shape[65] = "func=line;x=363;y=348;x1=0;y1=0;x2=22;y2=31;pc=#4E3932;pw=4;" shape[66] = "func=line;x=385;y=379;x1=0;y1=0;x2=21;y2=11;pc=#4E3932;pw=4;" shape[67] = "func=line;x=406;y=390;x1=0;y1=0;x2=26;y2=7;pc=#4E3932;pw=4;" shape[68] = "func=line;x=432;y=397;x1=0;y1=0;x2=27;y2=3;pc=#4E3932;pw=4;" shape[69] = "func=line;x=459;y=392;x1=0;y1=8;x2=34;y2=0;pc=#4E3932;pw=4;" shape[70] = "func=line;x=493;y=368;x1=0;y1=24;x2=17;y2=0;pc=#4E3932;pw=4;" shape[71] = "func=line;x=510;y=345;x1=0;y1=23;x2=11;y2=0;pc=#4E3932;pw=4;" shape[72] = "func=line;x=521;y=333;x1=0;y1=12;x2=3;y2=0;pc=#4E3932;pw=4;" shape[73] = "func=line;x=617;y=333;x1=3;y1=0;x2=0;y2=24;pc=#4E3932;pw=4;" shape[74] = "func=line;x=617;y=357;x1=0;y1=0;x2=11;y2=32;pc=#4E3932;pw=4;" shape[75] = "func=line;x=628;y=389;x1=0;y1=0;x2=25;y2=16;pc=#4E3932;pw=4;" shape[76] = "func=line;x=653;y=405;x1=0;y1=0;x2=32;y2=9;pc=#4E3932;pw=4;" shape[77] = "func=line;x=685;y=410;x1=0;y1=4;x2=32;y2=0;pc=#4E3932;pw=4;" shape[78] = "func=line;x=718;y=391;x1=0;y1=18;x2=27;y2=0;pc=#4E3932;pw=4;" shape[79] = "func=line;x=745;y=366;x1=0;y1=25;x2=16;y2=0;pc=#4E3932;pw=4;" shape[80] = "func=line;x=761;y=341;x1=0;y1=25;x2=7;y2=0;pc=#4E3932;pw=4;" shape[81] = "func=line;x=768;y=326;x1=0;y1=14;x2=1;y2=0;pc=#4E3932;pw=4;" shape[82] = "func=line;x=510;y=499;x1=0;y1=0;x2=45;y2=10;pc=#4E3932;pw=4;" shape[83] = "func=line;x=441;y=343;x1=1;y1=0;x2=0;y2=27;pc=#4E3932;pw=4;" shape[84] = "func=line;x=693;y=333;x1=0;y1=0;x2=2;y2=18;pc=#4E3932;pw=4;" shape[85] = "func=line;x=686;y=351;x1=9;y1=0;x2=0;y2=28;pc=#4E3932;pw=4;" shape[86] = "func=line;x=676;y=379;x1=10;y1=0;x2=0;y2=14;pc=#4E3932;pw=4;" shape[87] = "func=line;x=660;y=393;x1=16;y1=0;x2=0;y2=10;pc=#4E3932;pw=4;" shape[88] = "func=line;x=434;y=324;x1=0;y1=0;x2=8;y2=22;pc=#4E3932;pw=4;" shape[89] = "func=line;x=436;y=369;x1=5;y1=0;x2=0;y2=11;pc=#4E3932;pw=4;" shape[90] = "func=line;x=428;y=380;x1=8;y1=0;x2=0;y2=11;pc=#4E3932;pw=4;" shape[91] = "func=line;x=506;y=560;x1=1;y1=0;x2=0;y2=25;pc=#4E3932;pw=4;" shape[92] = "func=line;x=501;y=585;x1=5;y1=0;x2=0;y2=19;pc=#4E3932;pw=4;" shape[93] = "func=line;x=642;y=569;x1=2;y1=0;x2=0;y2=21;pc=#4E3932;pw=4;" shape[94] = "func=line;x=642;y=590;x1=0;y1=0;x2=1;y2=17;pc=#4E3932;pw=4;" shape[95] = "func=line;x=308;y=326;x1=5;y1=0;x2=0;y2=37;pc=#2C201C;pw=4;" shape[96] = "func=line;x=303;y=364;x1=4;y1=0;x2=0;y2=43;pc=#2C201C;pw=4;" shape[97] = "func=line;x=303;y=407;x1=0;y1=0;x2=3;y2=43;pc=#2C201C;pw=4;" shape[98] = "func=line;x=342;y=327;x1=10;y1=0;x2=0;y2=42;pc=#2C201C;pw=4;" shape[99] = "func=line;x=328;y=369;x1=14;y1=0;x2=0;y2=46;pc=#2C201C;pw=4;" shape[100] = "func=line;x=316;y=415;x1=12;y1=0;x2=0;y2=34;pc=#2C201C;pw=4;" shape[101] = "func=line;x=268;y=328;x1=5;y1=0;x2=0;y2=33;pc=#2C201C;pw=4;" shape[102] = "func=line;x=266;y=361;x1=2;y1=0;x2=0;y2=41;pc=#2C201C;pw=4;" shape[103] = "func=line;x=265;y=402;x1=1;y1=0;x2=0;y2=38;pc=#2C201C;pw=4;" shape[104] = "func=line;x=265;y=440;x1=0;y1=0;x2=5;y2=27;pc=#2C201C;pw=4;" shape[105] = "func=line;x=297;y=404;x1=4;y1=0;x2=0;y2=37;pc=#2C201C;pw=4;" shape[106] = "func=line;x=285;y=441;x1=12;y1=0;x2=0;y2=24;pc=#2C201C;pw=4;" shape[107] = "func=line;x=279;y=465;x1=6;y1=0;x2=0;y2=9;pc=#2C201C;pw=4;" shape[108] = "func=line;x=282;y=361;x1=9;y1=0;x2=0;y2=50;pc=#2C201C;pw=4;" shape[109] = "func=line;x=276;y=411;x1=6;y1=0;x2=0;y2=53;pc=#2C201C;pw=4;" shape[110] = "func=line;x=236;y=326;x1=2;y1=0;x2=0;y2=32;pc=#2C201C;pw=4;" shape[111] = "func=line;x=233;y=358;x1=3;y1=0;x2=0;y2=47;pc=#2C201C;pw=4;" shape[112] = "func=line;x=233;y=405;x1=0;y1=0;x2=13;y2=42;pc=#2C201C;pw=4;" shape[113] = "func=line;x=246;y=447;x1=0;y1=0;x2=4;y2=14;pc=#2C201C;pw=4;" shape[114] = "func=line;x=253;y=434;x1=9;y1=0;x2=0;y2=27;pc=#2C201C;pw=4;" shape[115] = "func=line;x=248;y=360;x1=8;y1=0;x2=0;y2=70;pc=#2C201C;pw=4;" shape[116] = "func=line;x=815;y=377;x1=0;y1=27;x2=28;y2=0;pc=#4E3932;pw=4;" shape[117] = "func=line;x=839;y=377;x1=4;y1=0;x2=0;y2=36;pc=#4E3932;pw=4;" shape[118] = "func=line;x=824;y=413;x1=15;y1=0;x2=0;y2=38;pc=#4E3932;pw=4;" shape[119] = "func=line;x=805;y=451;x1=19;y1=0;x2=0;y2=19;pc=#4E3932;pw=4;" shape[120] = "func=line;x=780;y=470;x1=25;y1=0;x2=0;y2=8;pc=#4E3932;pw=4;" shape[121] = "func=line;x=778;y=459;x1=0;y1=22;x2=89;y2=0;pc=#2C201C;pw=4;" shape[122] = "func=line;x=867;y=459;x1=0;y1=0;x2=16;y2=9;pc=#2C201C;pw=4;" shape[123] = "func=line;x=767;y=496;x1=0;y1=0;x2=53;y2=4;pc=#2C201C;pw=4;" shape[124] = "func=line;x=820;y=498;x1=0;y1=2;x2=49;y2=0;pc=#2C201C;pw=4;" shape[125] = "func=line;x=870;y=474;x1=0;y1=24;x2=36;y2=0;pc=#2C201C;pw=4;" shape[126] = "func=line;x=881;y=464;x1=0;y1=0;x2=28;y2=5;pc=#2C201C;pw=4;" shape[127] = "func=line;x=849;y=430;x1=0;y1=10;x2=29;y2=0;pc=#2C201C;pw=4;" shape[128] = "func=line;x=878;y=407;x1=0;y1=23;x2=32;y2=0;pc=#2C201C;pw=4;" shape[129] = "func=line;x=910;y=393;x1=0;y1=14;x2=12;y2=0;pc=#2C201C;pw=4;" shape[130] = "func=line;x=907;y=393;x1=15;y1=0;x2=0;y2=40;pc=#2C201C;pw=4;" shape[131] = "func=line;x=880;y=433;x1=27;y1=0;x2=0;y2=29;pc=#2C201C;pw=4;" shape[132] = "func=line;x=861;y=380;x1=0;y1=16;x2=41;y2=0;pc=#2C201C;pw=4;" shape[133] = "func=line;x=902;y=360;x1=0;y1=20;x2=32;y2=0;pc=#2C201C;pw=4;" shape[134] = "func=line;x=917;y=360;x1=17;y1=0;x2=0;y2=31;pc=#2C201C;pw=4;" shape[135] = "func=line;x=906;y=391;x1=11;y1=0;x2=0;y2=17;pc=#2C201C;pw=4;" shape[136] = "func=line;x=853;y=393;x1=13;y1=0;x2=0;y2=12;pc=#2C201C;pw=4;" shape[137] = "func=line;x=868;y=347;x1=0;y1=20;x2=44;y2=0;pc=#2C201C;pw=4;" shape[138] = "func=line;x=912;y=338;x1=0;y1=9;x2=5;y2=0;pc=#2C201C;pw=4;" shape[139] = "func=line;x=914;y=345;x1=0;y1=25;x2=9;y2=0;pc=#2C201C;pw=4;" shape[140] = "func=line;x=923;y=336;x1=0;y1=9;x2=0;y2=0;pc=#2C201C;pw=4;" shape[141] = "func=line;x=869;y=333;x1=0;y1=15;x2=17;y2=0;pc=#2C201C;pw=4;" shape[142] = "func=line;x=802;y=325;x1=0;y1=0;x2=7;y2=11;pc=#2C201C;pw=4;" shape[143] = "func=line;x=809;y=336;x1=0;y1=0;x2=9;y2=2;pc=#2C201C;pw=4;" shape[144] = "func=line;x=813;y=338;x1=5;y1=0;x2=0;y2=20;pc=#2C201C;pw=4;" shape[145] = "func=line;x=813;y=358;x1=0;y1=0;x2=6;y2=13;pc=#2C201C;pw=4;" shape[146] = "func=line;x=819;y=371;x1=0;y1=0;x2=7;y2=23;pc=#2C201C;pw=4;" shape[147] = "func=line;x=818;y=326;x1=0;y1=18;x2=19;y2=0;pc=#2C201C;pw=4;" shape[148] = "func=line;x=822;y=327;x1=0;y1=40;x2=25;y2=0;pc=#2C201C;pw=4;" shape[149] = "func=line;x=832;y=333;x1=0;y1=42;x2=22;y2=0;pc=#2C201C;pw=4;" shape[150] = "func=line;x=771;y=464;x1=0;y1=20;x2=96;y2=0;pc=#4E3932;pw=4;" shape[151] = "func=line;x=769;y=491;x1=0;y1=0;x2=101;y2=1;pc=#4E3932;pw=8;" shape[152] = "func=line;x=866;y=474;x1=0;y1=21;x2=37;y2=0;pc=#4E3932;pw=8;" shape[153] = "func=line;x=864;y=463;x1=0;y1=0;x2=38;y2=9;pc=#4E3932;pw=8;" shape[154] = "func=line;x=776;y=486;x1=0;y1=0;x2=98;y2=0;pc=#4E3932;pw=8;" shape[155] = "func=line;x=865;y=474;x1=0;y1=15;x2=29;y2=0;pc=#4E3932;pw=8;" shape[156] = "func=line;x=790;y=475;x1=0;y1=8;x2=101;y2=0;pc=#4E3932;pw=8;" shape[157] = "func=line;x=810;y=470;x1=0;y1=8;x2=67;y2=0;pc=#4E3932;pw=8;" shape[158] = "func=line;x=845;y=473;x1=0;y1=2;x2=44;y2=0;pc=#4E3932;pw=8;" shape[159] = "func=line;x=858;y=476;x1=0;y1=6;x2=23;y2=0;pc=#4E3932;pw=8;" shape[160] = "func=line;x=875;y=431;x1=0;y1=29;x2=29;y2=0;pc=#4E3932;pw=8;" shape[161] = "func=line;x=899;y=405;x1=0;y1=25;x2=16;y2=0;pc=#4E3932;pw=8;" shape[162] = "func=line;x=881;y=404;x1=34;y1=0;x2=0;y2=26;pc=#4E3932;pw=8;" shape[163] = "func=line;x=897;y=370;x1=0;y1=44;x2=28;y2=0;pc=#4E3932;pw=8;" shape[164] = "func=line;x=858;y=365;x1=69;y1=0;x2=0;y2=42;pc=#4E3932;pw=8;" shape[165] = "func=line;x=907;y=338;x1=0;y1=36;x2=14;y2=0;pc=#4E3932;pw=8;" shape[166] = "func=line;x=905;y=338;x1=16;y1=0;x2=0;y2=18;pc=#4E3932;pw=8;" shape[167] = "func=line;x=870;y=356;x1=37;y1=0;x2=0;y2=16;pc=#4E3932;pw=8;" shape[168] = "func=line;x=811;y=449;x1=0;y1=22;x2=25;y2=0;pc=#4E3932;pw=8;" shape[169] = "func=line;x=828;y=408;x1=0;y1=44;x2=18;y2=0;pc=#4E3932;pw=8;" shape[170] = "func=line;x=845;y=369;x1=0;y1=42;x2=6;y2=0;pc=#4E3932;pw=8;" shape[171] = "func=line;x=822;y=365;x1=0;y1=19;x2=29;y2=0;pc=#4E3932;pw=8;" shape[172] = "func=line;x=816;y=448;x1=0;y1=18;x2=68;y2=0;pc=#4E3932;pw=8;" shape[173] = "func=line;x=843;y=450;x1=0;y1=12;x2=41;y2=0;pc=#4E3932;pw=8;" shape[174] = "func=line;x=837;y=436;x1=0;y1=16;x2=59;y2=0;pc=#4E3932;pw=8;" shape[175] = "func=line;x=836;y=424;x1=0;y1=21;x2=63;y2=0;pc=#4E3932;pw=8;" shape[176] = "func=line;x=827;y=430;x1=0;y1=29;x2=70;y2=0;pc=#4E3932;pw=16;" shape[177] = "func=line;x=823;y=389;x1=0;y1=69;x2=78;y2=0;pc=#4E3932;pw=16;" shape[178] = "func=line;x=853;y=398;x1=0;y1=39;x2=51;y2=0;pc=#4E3932;pw=16;" shape[179] = "func=line;x=881;y=380;x1=0;y1=49;x2=29;y2=0;pc=#4E3932;pw=16;" shape[180] = "func=line;x=879;y=414;x1=0;y1=37;x2=25;y2=0;pc=#4E3932;pw=16;" shape[181] = "func=line;x=804;y=475;x1=0;y1=7;x2=62;y2=0;pc=#4E3932;pw=16;" shape[182] = "func=line;x=845;y=375;x1=0;y1=57;x2=13;y2=0;pc=#4E3932;pw=16;" shape[183] = "func=line;x=853;y=367;x1=0;y1=49;x2=21;y2=0;pc=#4E3932;pw=16;" shape[184] = "func=line;x=859;y=367;x1=0;y1=44;x2=27;y2=0;pc=#4E3932;pw=16;" shape[185] = "func=line;x=871;y=355;x1=0;y1=42;x2=32;y2=0;pc=#4E3932;pw=16;" shape[186] = "func=line;x=889;y=356;x1=0;y1=31;x2=17;y2=0;pc=#4E3932;pw=16;" shape[187] = "func=line;x=819;y=353;x1=0;y1=0;x2=10;y2=27;pc=#4E3932;pw=16;" shape[188] = "func=line;x=829;y=357;x1=0;y1=23;x2=29;y2=0;pc=#4E3932;pw=16;" shape[189] = "func=line;x=841;y=349;x1=0;y1=21;x2=44;y2=0;pc=#4E3932;pw=16;" shape[190] = "func=line;x=857;y=345;x1=0;y1=32;x2=46;y2=0;pc=#4E3932;pw=16;" shape[191] = "func=line;x=891;y=340;x1=0;y1=15;x2=22;y2=0;pc=#4E3932;pw=16;" shape[192] = "func=line;x=811;y=330;x1=0;y1=2;x2=30;y2=0;pc=#4E3932;pw=16;" shape[193] = "func=line;x=833;y=330;x1=0;y1=0;x2=48;y2=12;pc=#4E3932;pw=16;" shape[194] = "func=line;x=868;y=342;x1=0;y1=0;x2=40;y2=0;pc=#4E3932;pw=16;" shape[195] = "func=line;x=845;y=329;x1=0;y1=0;x2=49;y2=10;pc=#4E3932;pw=16;" shape[196] = "func=line;x=822;y=334;x1=8;y1=0;x2=0;y2=26;pc=#4E3932;pw=16;" shape[197] = "func=line;x=822;y=347;x1=0;y1=11;x2=48;y2=0;pc=#4E3932;pw=16;" shape[198] = "func=line;x=830;y=336;x1=0;y1=29;x2=21;y2=0;pc=#4E3932;pw=16;" shape[199] = "func=line;x=834;y=339;x1=0;y1=0;x2=79;y2=8;pc=#4E3932;pw=16;" shape[200] = "func=line;x=893;y=337;x1=0;y1=0;x2=16;y2=3;pc=#4E3932;pw=16;" shape[201] = "func=line;x=906;y=338;x1=0;y1=1;x2=15;y2=0;pc=#4E3932;pw=16;" shape[202] = "func=line;x=901;y=376;x1=0;y1=16;x2=17;y2=0;pc=#4E3932;pw=16;" shape[203] = "func=line;x=895;y=411;x1=0;y1=19;x2=10;y2=0;pc=#4E3932;pw=16;" shape[204] = "func=line;x=775;y=487;x1=0;y1=0;x2=49;y2=7;pc=#4E3932;pw=16;" shape[205] = "func=line;x=813;y=490;x1=0;y1=6;x2=59;y2=0;pc=#4E3932;pw=16;" shape[206] = "func=line;x=815;y=449;x1=0;y1=23;x2=44;y2=0;pc=#4E3932;pw=16;" shape[207] = "func=line;x=833;y=444;x1=0;y1=28;x2=49;y2=0;pc=#4E3932;pw=16;" shape[208] = "func=line;x=862;y=445;x1=0;y1=31;x2=20;y2=0;pc=#4E3932;pw=16;" shape[209] = "func=line;x=844;y=362;x1=5;y1=0;x2=0;y2=56;pc=#4E3932;pw=16;" shape[210] = "func=line;x=805;y=325;x1=0;y1=0;x2=8;y2=8;pc=#4E3932;pw=2;" shape[211] = "func=line;x=806;y=326;x1=0;y1=0;x2=6;y2=7;pc=#4E3932;pw=4;" shape[212] = "func=line;x=806;y=325;x1=0;y1=0;x2=10;y2=0;pc=#4E3932;pw=4;" shape[213] = "func=line;x=819;y=371;x1=0;y1=24;x2=23;y2=0;pc=#4E3932;pw=4;" shape[214] = "func=line;x=850;y=461;x1=31;y1=0;x2=0;y2=6;pc=#2C201C;pw=4;" shape[215] = "func=line;x=824;y=467;x1=26;y1=0;x2=0;y2=4;pc=#2C201C;pw=4;" shape[216] = "func=line;x=877;y=462;x1=0;y1=0;x2=30;y2=9;pc=#2C201C;pw=4;" shape[217] = "func=line;x=871;y=471;x1=36;y1=0;x2=0;y2=28;pc=#2C201C;pw=4;" shape[218] = "func=line;x=814;y=499;x1=56;y1=0;x2=0;y2=3;pc=#2C201C;pw=4;" shape[219] = "func=line;x=768;y=497;x1=46;y1=5;x2=0;y2=0;pc=#2C201C;pw=4;" shape[220] = "func=line;x=876;y=430;x1=0;y1=31;x2=31;y2=0;pc=#2C201C;pw=4;" shape[221] = "func=line;x=904;y=396;x1=0;y1=35;x2=18;y2=0;pc=#2C201C;pw=4;" shape[222] = "func=line;x=901;y=395;x1=21;y1=0;x2=0;y2=18;pc=#2C201C;pw=4;" shape[223] = "func=line;x=913;y=362;x1=0;y1=39;x2=21;y2=0;pc=#2C201C;pw=4;" shape[224] = "func=line;x=902;y=360;x1=32;y1=0;x2=0;y2=19;pc=#2C201C;pw=4;" shape[225] = "func=line;x=908;y=336;x1=0;y1=35;x2=14;y2=0;pc=#2C201C;pw=4;" shape[226] = "func=line;x=893;y=333;x1=28;y1=0;x2=0;y2=34;pc=#2C201C;pw=4;" shape[227] = "func=line;x=883;y=412;x1=18;y1=0;x2=0;y2=15;pc=#2C201C;pw=4;" shape[228] = "func=line;x=869;y=427;x1=14;y1=0;x2=0;y2=6;pc=#2C201C;pw=4;" shape[229] = "func=line;x=880;y=379;x1=25;y1=0;x2=0;y2=16;pc=#2C201C;pw=4;" shape[230] = "func=line;x=867;y=393;x1=16;y1=0;x2=0;y2=10;pc=#2C201C;pw=4;" shape[231] = "func=line;x=872;y=364;x1=23;y1=0;x2=0;y2=16;pc=#2C201C;pw=4;" shape[232] = "func=line;x=857;y=380;x1=15;y1=0;x2=0;y2=9;pc=#2C201C;pw=4;" shape[233] = "func=line;x=803;y=325;x1=0;y1=0;x2=10;y2=17;pc=#2C201C;pw=4;" shape[234] = "func=line;x=812;y=337;x1=0;y1=4;x2=13;y2=0;pc=#2C201C;pw=4;" shape[235] = "func=line;x=812;y=337;x1=9;y1=0;x2=0;y2=21;pc=#2C201C;pw=4;" shape[236] = "func=line;x=812;y=359;x1=0;y1=0;x2=11;y2=33;pc=#2C201C;pw=4;" shape[237] = "func=line;x=827;y=357;x1=0;y1=26;x2=26;y2=0;pc=#2C201C;pw=4;" shape[238] = "func=line;x=853;y=338;x1=0;y1=19;x2=12;y2=0;pc=#2C201C;pw=4;" shape[239] = "func=line;x=865;y=328;x1=0;y1=10;x2=3;y2=0;pc=#2C201C;pw=4;" shape[240] = "func=line;x=823;y=335;x1=0;y1=14;x2=16;y2=0;pc=#2C201C;pw=4;" shape[241] = "func=line;x=839;y=327;x1=0;y1=8;x2=11;y2=0;pc=#2C201C;pw=4;" shape[242] = "func=line;x=815;y=346;x1=10;y1=0;x2=0;y2=17;pc=#2C201C;pw=4;" shape[243] = "func=line;x=312;y=329;x1=35;y1=0;x2=0;y2=114;pc=#4E3932;pw=8;" shape[244] = "func=line;x=311;y=330;x1=7;y1=0;x2=0;y2=54;pc=#4E3932;pw=8;" shape[245] = "func=line;x=309;y=375;x1=1;y1=0;x2=0;y2=37;pc=#4E3932;pw=8;" shape[246] = "func=line;x=309;y=409;x1=0;y1=0;x2=2;y2=29;pc=#4E3932;pw=8;" shape[247] = "func=line;x=241;y=330;x1=0;y1=0;x2=28;y2=3;pc=#4E3932;pw=8;" shape[248] = "func=line;x=264;y=332;x1=0;y1=1;x2=47;y2=0;pc=#4E3932;pw=8;" shape[249] = "func=line;x=309;y=328;x1=0;y1=4;x2=41;y2=0;pc=#4E3932;pw=8;" shape[250] = "func=line;x=237;y=330;x1=8;y1=0;x2=0;y2=81;pc=#4E3932;pw=8;" shape[251] = "func=line;x=236;y=403;x1=0;y1=0;x2=16;y2=47;pc=#4E3932;pw=8;" shape[252] = "func=line;x=250;y=417;x1=0;y1=33;x2=18;y2=0;pc=#4E3932;pw=8;" shape[253] = "func=line;x=268;y=416;x1=0;y1=0;x2=8;y2=47;pc=#4E3932;pw=8;" shape[254] = "func=line;x=276;y=439;x1=0;y1=27;x2=17;y2=0;pc=#4E3932;pw=8;" shape[255] = "func=line;x=292;y=391;x1=0;y1=50;x2=11;y2=0;pc=#4E3932;pw=8;" shape[256] = "func=line;x=248;y=342;x1=0;y1=1;x2=89;y2=0;pc=#4E3932;pw=16;" shape[257] = "func=line;x=244;y=356;x1=0;y1=0;x2=91;y2=0;pc=#4E3932;pw=16;" shape[258] = "func=line;x=244;y=369;x1=0;y1=3;x2=91;y2=0;pc=#4E3932;pw=16;" shape[259] = "func=line;x=312;y=334;x1=26;y1=0;x2=0;y2=81;pc=#4E3932;pw=16;" shape[260] = "func=line;x=277;y=363;x1=35;y1=0;x2=0;y2=75;pc=#4E3932;pw=16;" shape[261] = "func=line;x=269;y=369;x1=30;y1=0;x2=0;y2=48;pc=#4E3932;pw=16;" shape[262] = "func=line;x=251;y=373;x1=0;y1=59;x2=39;y2=0;pc=#4E3932;pw=16;" shape[263] = "func=line;x=241;y=373;x1=0;y1=32;x2=42;y2=0;pc=#4E3932;pw=16;" shape[264] = "func=line;x=244;y=370;x1=0;y1=0;x2=3;y2=60;pc=#4E3932;pw=16;" shape[265] = "func=line;x=252;y=364;x1=5;y1=0;x2=0;y2=73;pc=#4E3932;pw=16;" shape[266] = "func=line;x=262;y=381;x1=0;y1=0;x2=18;y2=66;pc=#4E3932;pw=16;" shape[267] = "func=line;x=278;y=416;x1=0;y1=32;x2=16;y2=0;pc=#4E3932;pw=16;" shape[268] = "func=line;x=278;y=403;x1=0;y1=49;x2=9;y2=0;pc=#4E3932;pw=16;" shape[269] = "func=line;x=314;y=394;x1=2;y1=0;x2=0;y2=32;pc=#4E3932;pw=16;" shape[270] = "func=line;x=244;y=337;x1=0;y1=11;x2=5;y2=0;pc=#4E3932;pw=16;" shape[271] = "func=line;x=316;y=328;x1=36;y1=0;x2=0;y2=119;pc=#2C201C;pw=4;" shape[272] = "func=line;x=302;y=398;x1=0;y1=0;x2=14;y2=52;pc=#2C201C;pw=4;" shape[273] = "func=line;x=302;y=379;x1=0;y1=19;x2=0;y2=0;pc=#2C201C;pw=4;" shape[274] = "func=line;x=302;y=361;x1=0;y1=18;x2=5;y2=0;pc=#2C201C;pw=4;" shape[275] = "func=line;x=292;y=408;x1=12;y1=0;x2=0;y2=43;pc=#2C201C;pw=4;" shape[276] = "func=line;x=280;y=451;x1=12;y1=0;x2=0;y2=23;pc=#2C201C;pw=4;" shape[277] = "func=line;x=263;y=365;x1=5;y1=0;x2=0;y2=22;pc=#2C201C;pw=4;" shape[278] = "func=line;x=259;y=387;x1=4;y1=0;x2=0;y2=27;pc=#2C201C;pw=4;" shape[279] = "func=line;x=259;y=414;x1=0;y1=0;x2=8;y2=34;pc=#2C201C;pw=4;" shape[280] = "func=line;x=267;y=448;x1=0;y1=0;x2=13;y2=28;pc=#2C201C;pw=4;" shape[281] = "func=line;x=277;y=392;x1=0;y1=0;x2=4;y2=51;pc=#2C201C;pw=4;" shape[282] = "func=line;x=278;y=443;x1=3;y1=0;x2=0;y2=40;pc=#2C201C;pw=4;" shape[283] = "func=line;x=232;y=324;x1=5;y1=0;x2=0;y2=82;pc=#2C201C;pw=4;" shape[284] = "func=line;x=232;y=404;x1=0;y1=0;x2=19;y2=54;pc=#2C201C;pw=4;" shape[285] = "func=line;x=252;y=436;x1=11;y1=0;x2=0;y2=26;pc=#2C201C;pw=4;" shape[286] = "func=line;x=240;y=295;x1=0;y1=8;x2=169;y2=0;pc=#215615;pw=16;" shape[287] = "func=line;x=392;y=295;x1=0;y1=0;x2=182;y2=8;pc=#215615;pw=16;" shape[288] = "func=line;x=537;y=305;x1=0;y1=1;x2=215;y2=0;pc=#215615;pw=16;" shape[289] = "func=line;x=194;y=298;x1=0;y1=9;x2=86;y2=0;pc=#215615;pw=16;" shape[290] = "func=line;x=195;y=275;x1=0;y1=25;x2=114;y2=0;pc=#215615;pw=16;" shape[291] = "func=line;x=264;y=243;x1=0;y1=41;x2=139;y2=0;pc=#215615;pw=16;" shape[292] = "func=line;x=262;y=289;x1=0;y1=0;x2=641;y2=12;pc=#215615;pw=16;" shape[293] = "func=line;x=310;y=279;x1=0;y1=0;x2=574;y2=11;pc=#215615;pw=16;" shape[294] = "func=line;x=229;y=308;x1=0;y1=0;x2=79;y2=5;pc=#215615;pw=16;" shape[295] = "func=line;x=300;y=303;x1=0;y1=11;x2=92;y2=0;pc=#215615;pw=16;" shape[296] = "func=line;x=347;y=311;x1=0;y1=2;x2=115;y2=0;pc=#215615;pw=16;" shape[297] = "func=line;x=439;y=311;x1=0;y1=0;x2=109;y2=0;pc=#215615;pw=16;" shape[298] = "func=line;x=371;y=305;x1=0;y1=0;x2=245;y2=12;pc=#215615;pw=16;" shape[299] = "func=line;x=609;y=309;x1=0;y1=10;x2=151;y2=0;pc=#215615;pw=16;" shape[300] = "func=line;x=725;y=312;x1=0;y1=0;x2=120;y2=0;pc=#215615;pw=16;" shape[301] = "func=line;x=828;y=312;x1=0;y1=0;x2=93;y2=5;pc=#215615;pw=16;" shape[302] = "func=line;x=341;y=268;x1=0;y1=0;x2=518;y2=6;pc=#215615;pw=16;" shape[303] = "func=line;x=327;y=219;x1=0;y1=56;x2=149;y2=0;pc=#215615;pw=16;" shape[304] = "func=line;x=394;y=180;x1=0;y1=74;x2=102;y2=0;pc=#215615;pw=16;" shape[305] = "func=line;x=507;y=9;x1=7;y1=0;x2=0;y2=64;pc=#215615;pw=16;" shape[306] = "func=line;x=492;y=62;x1=14;y1=0;x2=0;y2=74;pc=#215615;pw=16;" shape[307] = "func=line;x=474;y=122;x1=17;y1=0;x2=0;y2=64;pc=#215615;pw=16;" shape[308] = "func=line;x=438;y=165;x1=35;y1=0;x2=0;y2=64;pc=#215615;pw=16;" shape[309] = "func=line;x=391;y=199;x1=60;y1=0;x2=0;y2=42;pc=#215615;pw=16;" shape[310] = "func=line;x=333;y=226;x1=73;y1=0;x2=0;y2=31;pc=#215615;pw=16;" shape[311] = "func=line;x=251;y=244;x1=109;y1=0;x2=0;y2=38;pc=#215615;pw=16;" shape[312] = "func=line;x=209;y=275;x1=73;y1=0;x2=0;y2=21;pc=#215615;pw=16;" shape[313] = "func=line;x=204;y=308;x1=0;y1=0;x2=48;y2=5;pc=#215615;pw=16;" shape[314] = "func=line;x=241;y=313;x1=0;y1=0;x2=80;y2=2;pc=#215615;pw=16;" shape[315] = "func=line;x=290;y=314;x1=0;y1=3;x2=89;y2=0;pc=#215615;pw=16;" shape[316] = "func=line;x=379;y=257;x1=0;y1=0;x2=460;y2=8;pc=#215615;pw=16;" shape[317] = "func=line;x=412;y=176;x1=0;y1=78;x2=128;y2=0;pc=#215615;pw=16;" shape[318] = "func=line;x=456;y=130;x1=0;y1=83;x2=90;y2=0;pc=#215615;pw=16;" shape[319] = "func=line;x=509;y=9;x1=0;y1=0;x2=119;y2=1;pc=#215615;pw=16;" shape[320] = "func=line;x=515;y=18;x1=0;y1=0;x2=121;y2=4;pc=#215615;pw=16;" shape[321] = "func=line;x=626;y=7;x1=0;y1=0;x2=26;y2=67;pc=#215615;pw=16;" shape[322] = "func=line;x=645;y=60;x1=0;y1=0;x2=32;y2=57;pc=#215615;pw=16;" shape[323] = "func=line;x=670;y=98;x1=0;y1=0;x2=33;y2=57;pc=#215615;pw=16;" shape[324] = "func=line;x=688;y=137;x1=0;y1=0;x2=40;y2=67;pc=#215615;pw=16;" shape[325] = "func=line;x=706;y=153;x1=0;y1=0;x2=54;y2=105;pc=#215615;pw=16;" shape[326] = "func=line;x=729;y=194;x1=0;y1=0;x2=60;y2=68;pc=#215615;pw=16;" shape[327] = "func=line;x=770;y=238;x1=0;y1=0;x2=67;y2=41;pc=#215615;pw=16;" shape[328] = "func=line;x=432;y=242;x1=0;y1=0;x2=344;y2=12;pc=#215615;pw=16;" shape[329] = "func=line;x=445;y=235;x1=0;y1=0;x2=306;y2=8;pc=#215615;pw=16;" shape[330] = "func=line;x=475;y=222;x1=0;y1=0;x2=270;y2=9;pc=#215615;pw=16;" shape[331] = "func=line;x=511;y=20;x1=38;y1=0;x2=0;y2=210;pc=#215615;pw=16;" shape[332] = "func=line;x=498;y=19;x1=38;y1=0;x2=0;y2=198;pc=#215615;pw=16;" shape[333] = "func=line;x=490;y=20;x1=33;y1=0;x2=0;y2=189;pc=#215615;pw=16;" shape[334] = "func=line;x=484;y=34;x1=26;y1=0;x2=0;y2=111;pc=#215615;pw=16;" shape[335] = "func=line;x=465;y=117;x1=24;y1=0;x2=0;y2=73;pc=#215615;pw=16;" shape[336] = "func=line;x=477;y=125;x1=21;y1=0;x2=0;y2=89;pc=#215615;pw=16;" shape[337] = "func=line;x=437;y=165;x1=0;y1=43;x2=37;y2=0;pc=#215615;pw=16;" shape[338] = "func=line;x=429;y=244;x1=0;y1=10;x2=58;y2=0;pc=#215615;pw=16;" shape[339] = "func=line;x=503;y=208;x1=0;y1=0;x2=234;y2=9;pc=#215615;pw=16;" shape[340] = "func=line;x=522;y=190;x1=0;y1=0;x2=202;y2=15;pc=#215615;pw=16;" shape[341] = "func=line;x=517;y=198;x1=0;y1=0;x2=111;y2=9;pc=#215615;pw=16;" shape[342] = "func=line;x=529;y=178;x1=0;y1=0;x2=187;y2=16;pc=#215615;pw=16;" shape[343] = "func=line;x=524;y=166;x1=0;y1=0;x2=188;y2=18;pc=#215615;pw=16;" shape[344] = "func=line;x=523;y=147;x1=0;y1=0;x2=177;y2=19;pc=#215615;pw=16;" shape[345] = "func=line;x=525;y=154;x1=0;y1=0;x2=181;y2=20;pc=#215615;pw=16;" shape[346] = "func=line;x=535;y=137;x1=0;y1=0;x2=158;y2=18;pc=#215615;pw=16;" shape[347] = "func=line;x=618;y=26;x1=0;y1=0;x2=61;y2=124;pc=#215615;pw=16;" shape[348] = "func=line;x=600;y=20;x1=0;y1=0;x2=56;y2=127;pc=#215615;pw=16;" shape[349] = "func=line;x=525;y=121;x1=0;y1=0;x2=138;y2=13;pc=#215615;pw=16;" shape[350] = "func=line;x=539;y=120;x1=0;y1=0;x2=132;y2=23;pc=#215615;pw=16;" shape[351] = "func=line;x=535;y=109;x1=0;y1=0;x2=148;y2=17;pc=#215615;pw=16;" shape[352] = "func=line;x=537;y=97;x1=0;y1=0;x2=119;y2=14;pc=#215615;pw=16;" shape[353] = "func=line;x=541;y=84;x1=0;y1=0;x2=108;y2=15;pc=#215615;pw=16;" shape[354] = "func=line;x=546;y=73;x1=0;y1=0;x2=88;y2=8;pc=#215615;pw=16;" shape[355] = "func=line;x=545;y=60;x1=0;y1=0;x2=86;y2=11;pc=#215615;pw=16;" shape[356] = "func=line;x=551;y=50;x1=0;y1=0;x2=71;y2=5;pc=#215615;pw=16;" shape[357] = "func=line;x=544;y=33;x1=0;y1=0;x2=71;y2=5;pc=#215615;pw=16;" shape[358] = "func=line;x=550;y=40;x1=0;y1=0;x2=64;y2=7;pc=#215615;pw=16;" shape[359] = "func=line;x=618;y=47;x1=0;y1=0;x2=47;y2=86;pc=#215615;pw=16;" shape[360] = "func=line;x=665;y=114;x1=0;y1=0;x2=65;y2=100;pc=#215615;pw=16;" shape[361] = "func=line;x=730;y=216;x1=0;y1=0;x2=49;y2=40;pc=#215615;pw=16;" shape[362] = "func=line;x=787;y=249;x1=0;y1=0;x2=98;y2=38;pc=#215615;pw=16;" shape[363] = "func=line;x=852;y=273;x1=0;y1=0;x2=58;y2=19;pc=#215615;pw=16;" shape[364] = "func=line;x=868;y=280;x1=0;y1=0;x2=70;y2=21;pc=#215615;pw=16;" shape[365] = "func=line;x=918;y=297;x1=0;y1=0;x2=40;y2=6;pc=#215615;pw=16;" shape[366] = "func=line;x=937;y=298;x1=0;y1=0;x2=64;y2=20;pc=#215615;pw=16;" shape[367] = "func=line;x=861;y=315;x1=0;y1=0;x2=70;y2=9;pc=#215615;pw=16;" shape[368] = "func=line;x=920;y=322;x1=0;y1=2;x2=50;y2=0;pc=#215615;pw=16;" shape[369] = "func=line;x=959;y=321;x1=0;y1=0;x2=40;y2=0;pc=#215615;pw=16;" shape[370] = "func=line;x=894;y=299;x1=0;y1=0;x2=67;y2=18;pc=#215615;pw=16;" shape[371] = "func=line;x=892;y=305;x1=0;y1=0;x2=82;y2=8;pc=#215615;pw=16;" shape[372] = "func=line;x=633;y=29;x1=0;y1=0;x2=48;y2=88;pc=#215615;pw=16;" shape[373] = "func=line;x=681;y=117;x1=0;y1=0;x2=34;y2=62;pc=#215615;pw=16;" shape[374] = "func=line;x=734;y=206;x1=0;y1=0;x2=63;y2=50;pc=#215615;pw=16;" shape[375] = "func=line;x=799;y=255;x1=0;y1=0;x2=116;y2=43;pc=#215615;pw=16;" shape[376] = "func=line;x=475;y=311;x1=0;y1=0;x2=110;y2=14;pc=#215615;pw=16;" shape[377] = "func=line;x=571;y=321;x1=0;y1=2;x2=77;y2=0;pc=#215615;pw=16;" shape[378] = "func=line;x=642;y=322;x1=0;y1=0;x2=56;y2=0;pc=#215615;pw=16;" shape[379] = "func=line;x=685;y=314;x1=0;y1=12;x2=81;y2=0;pc=#215615;pw=16;" shape[380] = "func=line;x=737;y=317;x1=0;y1=0;x2=84;y2=0;pc=#215615;pw=16;" shape[381] = "func=line;x=815;y=316;x1=0;y1=0;x2=61;y2=0;pc=#215615;pw=16;" shape[382] = "func=line;x=854;y=316;x1=0;y1=0;x2=73;y2=13;pc=#215615;pw=16;" shape[383] = "func=line;x=913;y=328;x1=0;y1=0;x2=37;y2=0;pc=#215615;pw=16;" shape[384] = "func=line;x=944;y=325;x1=0;y1=6;x2=45;y2=0;pc=#215615;pw=16;" shape[385] = "func=line;x=482;y=227;x1=0;y1=4;x2=30;y2=0;pc=#16100E;pw=4;" shape[386] = "func=line;x=512;y=227;x1=0;y1=0;x2=29;y2=1;pc=#16100E;pw=4;" shape[387] = "func=line;x=557;y=209;x1=0;y1=0;x2=38;y2=7;pc=#16100E;pw=4;" shape[388] = "func=line;x=595;y=216;x1=0;y1=0;x2=29;y2=10;pc=#16100E;pw=4;" shape[389] = "func=line;x=530;y=166;x1=16;y1=0;x2=0;y2=15;pc=#2A4823;pw=8;" shape[390] = "func=line;x=505;y=181;x1=25;y1=0;x2=0;y2=22;pc=#2A4823;pw=8;" shape[391] = "func=line;x=484;y=203;x1=21;y1=0;x2=0;y2=17;pc=#2A4823;pw=8;" shape[392] = "func=line;x=462;y=220;x1=22;y1=0;x2=0;y2=17;pc=#2A4823;pw=8;" shape[393] = "func=line;x=462;y=231;x1=0;y1=6;x2=69;y2=0;pc=#2A4823;pw=8;" shape[394] = "func=line;x=531;y=229;x1=0;y1=2;x2=50;y2=0;pc=#2A4823;pw=8;" shape[395] = "func=line;x=581;y=229;x1=0;y1=0;x2=55;y2=4;pc=#2A4823;pw=8;" shape[396] = "func=line;x=636;y=233;x1=0;y1=0;x2=40;y2=9;pc=#2A4823;pw=8;" shape[397] = "func=line;x=543;y=169;x1=0;y1=0;x2=45;y2=18;pc=#2A4823;pw=8;" shape[398] = "func=line;x=588;y=187;x1=0;y1=0;x2=25;y2=21;pc=#2A4823;pw=8;" shape[399] = "func=line;x=613;y=208;x1=0;y1=0;x2=32;y2=17;pc=#2A4823;pw=8;" shape[400] = "func=line;x=645;y=225;x1=0;y1=0;x2=33;y2=13;pc=#2A4823;pw=8;" shape[401] = "func=line;x=491;y=222;x1=0;y1=0;x2=128;y2=0;pc=#2A4823;pw=16;" shape[402] = "func=line;x=507;y=208;x1=0;y1=1;x2=96;y2=0;pc=#2A4823;pw=16;" shape[403] = "func=line;x=522;y=196;x1=0;y1=0;x2=60;y2=0;pc=#2A4823;pw=16;" shape[404] = "func=line;x=533;y=184;x1=0;y1=1;x2=38;y2=0;pc=#2A4823;pw=16;" shape[405] = "func=line;x=555;y=184;x1=0;y1=0;x2=60;y2=33;pc=#2A4823;pw=16;" shape[406] = "func=line;x=603;y=213;x1=0;y1=0;x2=34;y2=13;pc=#2A4823;pw=16;" shape[407] = "func=line;x=484;y=184;x1=0;y1=45;x2=60;y2=0;pc=#2A4823;pw=16;" shape[408] = "func=line;x=479;y=219;x1=0;y1=12;x2=24;y2=0;pc=#2A4823;pw=8;" shape[409] = "func=line;x=615;y=224;x1=0;y1=0;x2=45;y2=8;pc=#2A4823;pw=8;" shape[410] = "func=line;x=542;y=172;x1=0;y1=0;x2=59;y2=28;pc=#2A4823;pw=8;" shape[411] = "func=line;x=475;y=232;x1=0;y1=5;x2=45;y2=0;pc=#16100E;pw=4;" shape[412] = "func=line;x=518;y=232;x1=0;y1=0;x2=38;y2=0;pc=#16100E;pw=4;" shape[413] = "func=line;x=614;y=219;x1=0;y1=0;x2=51;y2=13;pc=#16100E;pw=4;" shape[414] = "func=line;x=665;y=232;x1=0;y1=0;x2=23;y2=7;pc=#16100E;pw=4;" shape[415] = "func=line;x=602;y=220;x1=14;y1=0;x2=0;y2=3;pc=#16100E;pw=4;" shape[416] = "func=line;x=363;y=330;x1=0;y1=0;x2=28;y2=0;pc=#4A3B36;pw=8;" shape[417] = "func=line;x=383;y=330;x1=0;y1=0;x2=48;y2=0;pc=#4A3B36;pw=8;" shape[418] = "func=line;x=365;y=332;x1=0;y1=0;x2=14;y2=28;pc=#4A3B36;pw=8;" shape[419] = "func=line;x=375;y=357;x1=0;y1=0;x2=15;y2=19;pc=#4A3B36;pw=8;" shape[420] = "func=line;x=388;y=370;x1=0;y1=0;x2=37;y2=19;pc=#4A3B36;pw=8;" shape[421] = "func=line;x=390;y=376;x1=0;y1=0;x2=29;y2=12;pc=#4A3B36;pw=8;" shape[422] = "func=line;x=421;y=371;x1=0;y1=16;x2=13;y2=0;pc=#4A3B36;pw=8;" shape[423] = "func=line;x=429;y=330;x1=0;y1=0;x2=11;y2=25;pc=#4A3B36;pw=8;" shape[424] = "func=line;x=431;y=350;x1=6;y1=0;x2=0;y2=25;pc=#4A3B36;pw=8;" shape[425] = "func=line;x=373;y=340;x1=0;y1=2;x2=59;y2=0;pc=#4A3B36;pw=16;" shape[426] = "func=line;x=382;y=353;x1=0;y1=0;x2=50;y2=2;pc=#4A3B36;pw=16;" shape[427] = "func=line;x=387;y=363;x1=0;y1=0;x2=43;y2=10;pc=#4A3B36;pw=16;" shape[428] = "func=line;x=417;y=342;x1=14;y1=0;x2=0;y2=43;pc=#4A3B36;pw=16;" shape[429] = "func=line;x=371;y=334;x1=0;y1=0;x2=17;y2=34;pc=#4A3B36;pw=16;" shape[430] = "func=line;x=358;y=325;x1=0;y1=2;x2=76;y2=0;pc=#4A3B36;pw=4;" shape[431] = "func=line;x=361;y=328;x1=0;y1=0;x2=9;y2=18;pc=#4A3B36;pw=4;" shape[432] = "func=line;x=363;y=337;x1=0;y1=0;x2=7;y2=17;pc=#4A3B36;pw=4;" shape[433] = "func=line;x=370;y=352;x1=0;y1=0;x2=21;y2=27;pc=#4A3B36;pw=4;" shape[434] = "func=line;x=391;y=379;x1=0;y1=0;x2=36;y2=14;pc=#4A3B36;pw=4;" shape[435] = "func=line;x=423;y=374;x1=0;y1=19;x2=13;y2=0;pc=#4A3B36;pw=4;" shape[436] = "func=line;x=435;y=352;x1=0;y1=24;x2=6;y2=0;pc=#4A3B36;pw=4;" shape[437] = "func=line;x=430;y=326;x1=0;y1=0;x2=9;y2=18;pc=#4A3B36;pw=4;" shape[438] = "func=line;x=621;y=336;x1=0;y1=1;x2=69;y2=0;pc=#4A3B36;pw=8;" shape[439] = "func=line;x=627;y=340;x1=0;y1=0;x2=8;y2=43;pc=#4A3B36;pw=8;" shape[440] = "func=line;x=622;y=341;x1=1;y1=0;x2=0;y2=19;pc=#4A3B36;pw=8;" shape[441] = "func=line;x=622;y=359;x1=0;y1=0;x2=11;y2=27;pc=#4A3B36;pw=8;" shape[442] = "func=line;x=630;y=382;x1=0;y1=0;x2=27;y2=18;pc=#4A3B36;pw=8;" shape[443] = "func=line;x=657;y=386;x1=0;y1=14;x2=19;y2=0;pc=#4A3B36;pw=8;" shape[444] = "func=line;x=674;y=368;x1=0;y1=19;x2=11;y2=0;pc=#4A3B36;pw=8;" shape[445] = "func=line;x=681;y=347;x1=0;y1=21;x2=9;y2=0;pc=#4A3B36;pw=8;" shape[446] = "func=line;x=687;y=336;x1=3;y1=15;x2=0;y2=0;pc=#4A3B36;pw=8;" shape[447] = "func=line;x=631;y=347;x1=0;y1=0;x2=55;y2=0;pc=#4A3B36;pw=16;" shape[448] = "func=line;x=632;y=359;x1=0;y1=0;x2=51;y2=1;pc=#4A3B36;pw=16;" shape[449] = "func=line;x=635;y=371;x1=0;y1=0;x2=44;y2=0;pc=#4A3B36;pw=16;" shape[450] = "func=line;x=638;y=381;x1=0;y1=0;x2=36;y2=0;pc=#4A3B36;pw=16;" shape[451] = "func=line;x=648;y=389;x1=0;y1=0;x2=18;y2=0;pc=#4A3B36;pw=16;" shape[452] = "func=line;x=672;y=349;x1=18;y1=0;x2=0;y2=29;pc=#4A3B36;pw=16;" shape[453] = "func=line;x=632;y=388;x1=0;y1=0;x2=28;y2=15;pc=#4A3B36;pw=4;" shape[454] = "func=line;x=815;y=382;x1=0;y1=21;x2=26;y2=0;pc=#4E3932;pw=4;" shape[455] = "func=line;x=836;y=382;x1=5;y1=0;x2=0;y2=38;pc=#4E3932;pw=4;" shape[456] = "func=line;x=813;y=416;x1=23;y1=0;x2=0;y2=48;pc=#4E3932;pw=4;" shape[457] = "func=line;x=792;y=458;x1=24;y1=0;x2=0;y2=19;pc=#4E3932;pw=4;" shape[458] = "func=line;x=775;y=475;x1=19;y1=0;x2=0;y2=9;pc=#4E3932;pw=4;" shape[459] = "func=line;x=0;y=38;x1=7;y1=0;x2=0;y2=91;pc=#ECEC69;pw=4;" shape[460] = "func=line;x=479;y=564;x1=21;y1=0;x2=0;y2=17;pc=#ECEC69;pw=4;" shape[461] = "func=line;x=471;y=581;x1=8;y1=0;x2=0;y2=21;pc=#ECEC69;pw=4;" shape[462] = "func=line;x=471;y=602;x1=0;y1=0;x2=10;y2=28;pc=#ECEC69;pw=4;" shape[463] = "func=line;x=481;y=630;x1=0;y1=0;x2=47;y2=3;pc=#ECEC69;pw=4;" shape[464] = "func=line;x=528;y=632;x1=0;y1=1;x2=11;y2=0;pc=#ECEC69;pw=4;" shape[465] = "func=line;x=532;y=612;x1=0;y1=3;x2=17;y2=0;pc=#ECEC69;pw=4;" shape[466] = "func=line;x=549;y=612;x1=0;y1=0;x2=12;y2=33;pc=#ECEC69;pw=4;" shape[467] = "func=line;x=561;y=645;x1=0;y1=0;x2=14;y2=58;pc=#ECEC69;pw=4;" shape[468] = "func=line;x=555;y=610;x1=0;y1=0;x2=15;y2=1;pc=#ECEC69;pw=4;" shape[469] = "func=line;x=570;y=611;x1=0;y1=0;x2=10;y2=22;pc=#ECEC69;pw=4;" shape[470] = "func=line;x=580;y=633;x1=0;y1=0;x2=24;y2=16;pc=#ECEC69;pw=4;" shape[471] = "func=line;x=605;y=642;x1=0;y1=7;x2=13;y2=0;pc=#ECEC69;pw=4;" shape[472] = "func=line;x=588;y=611;x1=0;y1=13;x2=19;y2=0;pc=#ECEC69;pw=4;" shape[473] = "func=line;x=607;y=609;x1=0;y1=2;x2=24;y2=0;pc=#ECEC69;pw=4;" shape[474] = "func=line;x=631;y=609;x1=0;y1=0;x2=14;y2=39;pc=#ECEC69;pw=4;" shape[475] = "func=line;x=645;y=648;x1=0;y1=0;x2=4;y2=56;pc=#ECEC69;pw=4;" shape[476] = "func=line;x=648;y=579;x1=0;y1=0;x2=17;y2=4;pc=#ECEC69;pw=4;" shape[477] = "func=line;x=652;y=583;x1=13;y1=0;x2=0;y2=26;pc=#ECEC69;pw=4;" shape[478] = "func=line;x=639;y=609;x1=13;y1=0;x2=0;y2=10;pc=#ECEC69;pw=4;" shape[479] = "func=line;x=664;y=595;x1=0;y1=0;x2=16;y2=10;pc=#ECEC69;pw=4;" shape[480] = "func=line;x=667;y=605;x1=13;y1=0;x2=0;y2=20;pc=#ECEC69;pw=4;" shape[481] = "func=line;x=646;y=625;x1=21;y1=0;x2=0;y2=7;pc=#ECEC69;pw=4;" shape[482] = "func=line;x=454;y=586;x1=19;y1=0;x2=0;y2=6;pc=#ECEC69;pw=4;" shape[483] = "func=line;x=454;y=592;x1=0;y1=0;x2=5;y2=28;pc=#ECEC69;pw=4;" shape[484] = "func=line;x=444;y=618;x1=16;y1=0;x2=0;y2=7;pc=#ECEC69;pw=4;" shape[485] = "func=line;x=444;y=625;x1=0;y1=0;x2=0;y2=19;pc=#ECEC69;pw=4;" shape[486] = "func=line;x=444;y=644;x1=0;y1=0;x2=24;y2=11;pc=#ECEC69;pw=4;" shape[487] = "func=line;x=468;y=655;x1=0;y1=0;x2=39;y2=6;pc=#ECEC69;pw=4;" shape[488] = "func=line;x=507;y=661;x1=0;y1=0;x2=27;y2=0;pc=#ECEC69;pw=4;" shape[489] = "func=line;x=534;y=658;x1=0;y1=3;x2=23;y2=0;pc=#ECEC69;pw=4;" shape[490] = "func=line;x=499;y=645;x1=0;y1=0;x2=38;y2=8;pc=#ECEC69;pw=4;" shape[491] = "func=line;x=537;y=653;x1=0;y1=0;x2=19;y2=3;pc=#ECEC69;pw=4;" shape[492] = "func=line;x=618;y=635;x1=0;y1=0;x2=3;y2=36;pc=#ECEC69;pw=4;" shape[493] = "func=line;x=612;y=671;x1=9;y1=0;x2=0;y2=38;pc=#ECEC69;pw=4;" shape[494] = "func=line;x=552;y=664;x1=0;y1=0;x2=2;y2=31;pc=#ECEC69;pw=4;" shape[495] = "func=line;x=547;y=695;x1=7;y1=0;x2=0;y2=19;pc=#ECEC69;pw=4;" shape[496] = "func=line;x=501;y=606;x1=0;y1=0;x2=21;y2=8;pc=#ECEC69;pw=4;" shape[497] = "func=line;x=522;y=614;x1=0;y1=0;x2=10;y2=2;pc=#ECEC69;pw=4;" shape[498] = "func=line;x=634;y=605;x1=0;y1=9;x2=11;y2=0;pc=#ECEC69;pw=4;" shape[499] = "func=line;x=449;y=640;x1=0;y1=0;x2=79;y2=14;pc=#ECEC69;pw=8;" shape[500] = "func=line;x=516;y=652;x1=0;y1=2;x2=48;y2=0;pc=#ECEC69;pw=8;" shape[501] = "func=line;x=455;y=634;x1=0;y1=0;x2=117;y2=24;pc=#ECEC69;pw=8;" shape[502] = "func=line;x=470;y=629;x1=0;y1=0;x2=135;y2=26;pc=#ECEC69;pw=16;" shape[503] = "func=line;x=488;y=619;x1=0;y1=0;x2=110;y2=36;pc=#ECEC69;pw=16;" shape[504] = "func=line;x=531;y=629;x1=0;y1=0;x2=89;y2=13;pc=#ECEC69;pw=16;" shape[505] = "func=line;x=555;y=649;x1=0;y1=0;x2=12;y2=49;pc=#ECEC69;pw=16;" shape[506] = "func=line;x=573;y=652;x1=0;y1=0;x2=5;y2=48;pc=#ECEC69;pw=16;" shape[507] = "func=line;x=569;y=689;x1=0;y1=0;x2=74;y2=11;pc=#ECEC69;pw=16;" shape[508] = "func=line;x=580;y=659;x1=0;y1=23;x2=59;y2=0;pc=#ECEC69;pw=16;" shape[509] = "func=line;x=625;y=617;x1=0;y1=0;x2=13;y2=50;pc=#ECEC69;pw=16;" shape[510] = "func=line;x=635;y=651;x1=1;y1=0;x2=0;y2=44;pc=#ECEC69;pw=16;" shape[511] = "func=line;x=585;y=681;x1=0;y1=0;x2=50;y2=6;pc=#ECEC69;pw=16;" shape[512] = "func=line;x=578;y=651;x1=0;y1=18;x2=55;y2=0;pc=#ECEC69;pw=16;" shape[513] = "func=line;x=585;y=624;x1=0;y1=12;x2=25;y2=0;pc=#ECEC69;pw=16;" shape[514] = "func=line;x=604;y=617;x1=0;y1=5;x2=26;y2=0;pc=#ECEC69;pw=16;" shape[515] = "func=line;x=614;y=621;x1=0;y1=0;x2=13;y2=55;pc=#ECEC69;pw=16;" shape[516] = "func=line;x=598;y=649;x1=14;y1=0;x2=0;y2=4;pc=#ECEC69;pw=16;" shape[517] = "func=line;x=492;y=612;x1=0;y1=0;x2=54;y2=16;pc=#ECEC69;pw=16;" shape[518] = "func=line;x=541;y=619;x1=0;y1=5;x2=28;y2=0;pc=#ECEC69;pw=16;" shape[519] = "func=line;x=569;y=618;x1=0;y1=0;x2=9;y2=23;pc=#ECEC69;pw=16;" shape[520] = "func=line;x=452;y=626;x1=0;y1=11;x2=1;y2=0;pc=#ECEC69;pw=16;" shape[521] = "func=line;x=452;y=618;x1=0;y1=12;x2=20;y2=0;pc=#ECEC69;pw=16;" shape[522] = "func=line;x=464;y=594;x1=0;y1=0;x2=3;y2=34;pc=#ECEC69;pw=16;" shape[523] = "func=line;x=467;y=576;x1=0;y1=24;x2=31;y2=0;pc=#ECEC69;pw=16;" shape[524] = "func=line;x=486;y=576;x1=12;y1=0;x2=0;y2=52;pc=#ECEC69;pw=16;" shape[525] = "func=line;x=473;y=595;x1=15;y1=0;x2=0;y2=35;pc=#ECEC69;pw=16;" shape[526] = "func=line;x=455;y=642;x1=0;y1=0;x2=60;y2=11;pc=#ECEC69;pw=16;" shape[527] = "func=line;x=636;y=614;x1=0;y1=15;x2=32;y2=0;pc=#ECEC69;pw=16;" shape[528] = "func=line;x=662;y=603;x1=0;y1=10;x2=9;y2=0;pc=#ECEC69;pw=16;" shape[529] = "func=line;x=640;y=588;x1=15;y1=0;x2=0;y2=38;pc=#ECEC69;pw=16;" shape[530] = "func=line;x=650;y=582;x1=0;y1=0;x2=8;y2=4;pc=#ECEC69;pw=16;" shape[531] = "func=line;x=550;y=712;x1=0;y1=0;x2=92;y2=0;pc=#ECEC69;pw=16;" shape[532] = "func=line;x=561;y=699;x1=0;y1=0;x2=66;y2=2;pc=#ECEC69;pw=16;" shape[533] = "func=line;x=556;y=676;x1=10;y1=0;x2=0;y2=30;pc=#ECEC69;pw=16;" shape[534] = "func=line;x=635;y=638;x1=0;y1=0;x2=8;y2=76;pc=#ECEC69;pw=16;" shape[535] = "func=line;x=431;y=634;x1=11;y1=0;x2=0;y2=47;pc=#1E5B10;pw=4;" shape[536] = "func=line;x=416;y=681;x1=15;y1=0;x2=0;y2=36;pc=#1E5B10;pw=4;" shape[537] = "func=line;x=681;y=611;x1=0;y1=0;x2=18;y2=22;pc=#1E5B10;pw=4;" shape[538] = "func=line;x=699;y=633;x1=0;y1=0;x2=15;y2=23;pc=#1E5B10;pw=4;" shape[539] = "func=line;x=714;y=656;x1=0;y1=0;x2=29;y2=23;pc=#1E5B10;pw=4;" shape[540] = "func=line;x=743;y=679;x1=0;y1=0;x2=25;y2=30;pc=#1E5B10;pw=4;" shape[541] = "func=line;x=679;y=630;x1=0;y1=0;x2=26;y2=51;pc=#1E5B10;pw=16;" shape[542] = "func=line;x=701;y=667;x1=0;y1=0;x2=48;y2=40;pc=#1E5B10;pw=16;" shape[543] = "func=line;x=717;y=671;x1=0;y1=0;x2=36;y2=31;pc=#1E5B10;pw=16;" shape[544] = "func=line;x=661;y=712;x1=0;y1=0;x2=91;y2=2;pc=#1E5B10;pw=16;" shape[545] = "func=line;x=654;y=641;x1=0;y1=0;x2=13;y2=56;pc=#1E5B10;pw=16;" shape[546] = "func=line;x=663;y=635;x1=0;y1=12;x2=20;y2=0;pc=#1E5B10;pw=16;" shape[547] = "func=line;x=664;y=653;x1=0;y1=6;x2=34;y2=0;pc=#1E5B10;pw=16;" shape[548] = "func=line;x=663;y=667;x1=0;y1=0;x2=56;y2=9;pc=#1E5B10;pw=16;" shape[549] = "func=line;x=670;y=688;x1=0;y1=0;x2=66;y2=3;pc=#1E5B10;pw=16;" shape[550] = "func=line;x=662;y=701;x1=0;y1=0;x2=73;y2=2;pc=#1E5B10;pw=16;" shape[551] = "func=line;x=674;y=676;x1=0;y1=0;x2=51;y2=10;pc=#1E5B10;pw=16;" shape[552] = "func=line;x=688;y=628;x1=0;y1=0;x2=19;y2=47;pc=#1E5B10;pw=16;" shape[553] = "func=line;x=696;y=656;x1=0;y1=0;x2=36;y2=28;pc=#1E5B10;pw=16;" shape[554] = "func=line;x=441;y=652;x1=6;y1=0;x2=0;y2=31;pc=#1E5B10;pw=16;" shape[555] = "func=line;x=428;y=672;x1=13;y1=0;x2=0;y2=38;pc=#1E5B10;pw=16;" shape[556] = "func=line;x=424;y=715;x1=0;y1=0;x2=115;y2=4;pc=#1E5B10;pw=16;" shape[557] = "func=line;x=436;y=705;x1=0;y1=2;x2=94;y2=0;pc=#1E5B10;pw=16;" shape[558] = "func=line;x=439;y=694;x1=0;y1=0;x2=94;y2=0;pc=#1E5B10;pw=16;" shape[559] = "func=line;x=446;y=681;x1=0;y1=1;x2=91;y2=0;pc=#1E5B10;pw=16;" shape[560] = "func=line;x=450;y=663;x1=0;y1=0;x2=48;y2=19;pc=#1E5B10;pw=16;" shape[561] = "func=line;x=488;y=674;x1=0;y1=0;x2=54;y2=0;pc=#1E5B10;pw=16;" shape[562] = "func=line;x=540;y=672;x1=4;y1=0;x2=0;y2=36;pc=#1E5B10;pw=16;" shape[563] = "func=line;x=533;y=688;x1=9;y1=0;x2=0;y2=28;pc=#1E5B10;pw=16;" shape[564] = "func=line;x=455;y=658;x1=0;y1=0;x2=49;y2=16;pc=#1E5B10;pw=16;" shape[565] = "func=line;x=484;y=669;x1=0;y1=0;x2=61;y2=1;pc=#1E5B10;pw=16;" shape[566] = "func=line;x=653;y=631;x1=0;y1=10;x2=29;y2=0;pc=#1E5B10;pw=16;" shape[567] = "func=line;x=678;y=619;x1=0;y1=12;x2=7;y2=0;pc=#1E5B10;pw=16;" shape[568] = "func=line;x=685;y=619;x1=0;y1=0;x2=22;y2=48;pc=#1E5B10;pw=16;" shape[569] = "func=line;x=705;y=658;x1=0;y1=0;x2=21;y2=21;pc=#1E5B10;pw=16;" shape[570] = "func=line;x=657;y=660;x1=0;y1=0;x2=2;y2=58;pc=#1E5B10;pw=16;" shape[571] = "func=line;x=419;y=697;x1=0;y1=21;x2=10;y2=0;pc=#1E5B10;pw=8;" shape[572] = "func=line;x=442;y=644;x1=0;y1=0;x2=15;y2=14;pc=#1E5B10;pw=8;" shape[573] = "func=line;x=443;y=649;x1=0;y1=0;x2=46;y2=21;pc=#1E5B10;pw=8;" shape[574] = "func=line;x=474;y=662;x1=0;y1=0;x2=75;y2=3;pc=#1E5B10;pw=8;" shape[575] = "func=line;x=548;y=665;x1=1;y1=0;x2=0;y2=28;pc=#1E5B10;pw=8;" shape[576] = "func=line;x=543;y=671;x1=3;y1=0;x2=0;y2=49;pc=#1E5B10;pw=8;" shape[577] = "func=line;x=537;y=718;x1=0;y1=0;x2=11;y2=0;pc=#1E5B10;pw=8;" shape[578] = "func=line;x=647;y=628;x1=0;y1=8;x2=29;y2=0;pc=#1E5B10;pw=8;" shape[579] = "func=line;x=670;y=614;x1=0;y1=14;x2=12;y2=0;pc=#1E5B10;pw=8;" shape[580] = "func=line;x=646;y=635;x1=0;y1=0;x2=11;y2=31;pc=#1E5B10;pw=8;" shape[581] = "func=line;x=669;y=675;x1=0;y1=4;x2=17;y2=0;pc=#1E5B10;pw=8;" shape[582] = "func=line;x=654;y=718;x1=0;y1=0;x2=115;y2=0;pc=#1E5B10;pw=8;" shape[583] = "func=line;x=753;y=699;x1=0;y1=0;x2=14;y2=12;pc=#1E5B10;pw=8;" shape[584] = "func=line;x=750;y=702;x1=0;y1=0;x2=11;y2=14;pc=#1E5B10;pw=8;" shape[585] = "func=line;x=750;y=711;x1=0;y1=0;x2=25;y2=6;pc=#1E5B10;pw=8;" shape[586] = "func=line;x=766;y=710;x1=0;y1=0;x2=15;y2=9;pc=#1E5B10;pw=8;" shape[587] = "func=line;x=478;y=566;x1=19;y1=0;x2=0;y2=20;pc=#C7C760;pw=4;" shape[588] = "func=line;x=455;y=586;x1=23;y1=0;x2=0;y2=8;pc=#C7C760;pw=4;" shape[589] = "func=line;x=454;y=594;x1=0;y1=0;x2=6;y2=22;pc=#C7C760;pw=4;" shape[590] = "func=line;x=445;y=616;x1=15;y1=0;x2=0;y2=12;pc=#C7C760;pw=4;" shape[591] = "func=line;x=445;y=628;x1=0;y1=0;x2=1;y2=13;pc=#C7C760;pw=4;" shape[592] = "func=line;x=446;y=641;x1=0;y1=0;x2=20;y2=10;pc=#C7C760;pw=4;" shape[593] = "func=line;x=466;y=651;x1=0;y1=0;x2=33;y2=6;pc=#C7C760;pw=4;" shape[594] = "func=line;x=499;y=657;x1=0;y1=0;x2=46;y2=3;pc=#C7C760;pw=4;" shape[595] = "func=line;x=545;y=660;x1=0;y1=0;x2=9;y2=0;pc=#C7C760;pw=4;" shape[596] = "func=line;x=500;y=603;x1=0;y1=0;x2=36;y2=17;pc=#C7C760;pw=4;" shape[597] = "func=line;x=536;y=618;x1=0;y1=2;x2=17;y2=0;pc=#C7C760;pw=4;" shape[598] = "func=line;x=533;y=615;x1=0;y1=11;x2=26;y2=0;pc=#C7C760;pw=4;" shape[599] = "func=line;x=559;y=614;x1=0;y1=0;x2=15;y2=2;pc=#C7C760;pw=4;" shape[600] = "func=line;x=574;y=616;x1=0;y1=0;x2=8;y2=35;pc=#C7C760;pw=4;" shape[601] = "func=line;x=581;y=651;x1=1;y1=0;x2=0;y2=46;pc=#C7C760;pw=4;" shape[602] = "func=line;x=574;y=697;x1=7;y1=0;x2=0;y2=15;pc=#C7C760;pw=4;" shape[603] = "func=line;x=572;y=615;x1=0;y1=0;x2=17;y2=31;pc=#C7C760;pw=4;" shape[604] = "func=line;x=589;y=646;x1=0;y1=0;x2=29;y2=3;pc=#C7C760;pw=4;" shape[605] = "func=line;x=618;y=630;x1=0;y1=19;x2=1;y2=0;pc=#C7C760;pw=4;" shape[606] = "func=line;x=588;y=613;x1=0;y1=11;x2=18;y2=0;pc=#C7C760;pw=4;" shape[607] = "func=line;x=606;y=613;x1=0;y1=0;x2=21;y2=0;pc=#C7C760;pw=4;" shape[608] = "func=line;x=627;y=613;x1=0;y1=0;x2=13;y2=26;pc=#C7C760;pw=4;" shape[609] = "func=line;x=640;y=639;x1=0;y1=0;x2=7;y2=36;pc=#C7C760;pw=4;" shape[610] = "func=line;x=647;y=675;x1=0;y1=0;x2=0;y2=32;pc=#C7C760;pw=4;" shape[611] = "func=line;x=612;y=653;x1=6;y1=0;x2=0;y2=30;pc=#C7C760;pw=4;" shape[612] = "func=line;x=605;y=683;x1=7;y1=0;x2=0;y2=26;pc=#C7C760;pw=4;" shape[613] = "func=line;x=462;y=618;x1=0;y1=0;x2=45;y2=21;pc=#C7C760;pw=4;" shape[614] = "func=line;x=507;y=639;x1=0;y1=0;x2=41;y2=7;pc=#C7C760;pw=4;" shape[615] = "func=line;x=531;y=625;x1=7;y1=0;x2=0;y2=10;pc=#C7C760;pw=4;" shape[616] = "func=line;x=650;y=579;x1=0;y1=0;x2=14;y2=7;pc=#C7C760;pw=4;" shape[617] = "func=line;x=649;y=586;x1=15;y1=0;x2=0;y2=25;pc=#C7C760;pw=4;" shape[618] = "func=line;x=663;y=596;x1=0;y1=0;x2=14;y2=8;pc=#C7C760;pw=4;" shape[619] = "func=line;x=668;y=604;x1=9;y1=0;x2=0;y2=13;pc=#C7C760;pw=4;" shape[620] = "func=line;x=645;y=617;x1=23;y1=0;x2=0;y2=16;pc=#C7C760;pw=4;" shape[621] = "func=line;x=633;y=576;x1=20;y1=0;x2=0;y2=34;pc=#C7C760;pw=4;" shape[622] = "func=line;x=497;y=567;x1=0;y1=0;x2=7;y2=2;pc=#C7C760;pw=4;" shape[623] = "func=line;x=57;y=74;x1=25;y1=0;x2=0;y2=137;pc=#EEEECE;pw=4;" shape[624] = "func=line;x=104;y=148;x1=12;y1=0;x2=0;y2=95;pc=#F7F7E8;pw=4;" shape[625] = "func=line;x=368;y=402;x1=0;y1=0;x2=85;y2=84;pc=#F7F7E8;pw=16;" shape[626] = "func=line;x=434;y=467;x1=0;y1=0;x2=127;y2=26;pc=#F7F7E8;pw=16;" shape[627] = "func=line;x=472;y=481;x1=0;y1=0;x2=148;y2=3;pc=#F7F7E8;pw=16;" shape[628] = "func=line;x=489;y=468;x1=0;y1=0;x2=121;y2=3;pc=#F7F7E8;pw=16;" shape[629] = "func=line;x=545;y=447;x1=0;y1=23;x2=77;y2=0;pc=#F7F7E8;pw=16;" shape[630] = "func=line;x=579;y=396;x1=0;y1=0;x2=13;y2=64;pc=#F7F7E8;pw=16;" shape[631] = "func=line;x=558;y=483;x1=0;y1=6;x2=136;y2=0;pc=#F7F7E8;pw=16;" shape[632] = "func=line;x=603;y=460;x1=0;y1=14;x2=123;y2=0;pc=#F7F7E8;pw=16;" shape[633] = "func=line;x=597;y=446;x1=0;y1=21;x2=151;y2=0;pc=#F7F7E8;pw=16;" shape[634] = "func=line;x=604;y=421;x1=0;y1=34;x2=157;y2=0;pc=#F7F7E8;pw=16;" shape[635] = "func=line;x=761;y=334;x1=18;y1=0;x2=0;y2=89;pc=#F7F7E8;pw=16;" shape[636] = "func=line;x=742;y=372;x1=28;y1=0;x2=0;y2=66;pc=#F7F7E8;pw=16;" shape[637] = "func=line;x=713;y=384;x1=50;y1=0;x2=0;y2=61;pc=#F7F7E8;pw=16;" shape[638] = "func=line;x=682;y=407;x1=65;y1=0;x2=0;y2=33;pc=#F7F7E8;pw=16;" shape[639] = "func=line;x=651;y=415;x1=86;y1=0;x2=0;y2=15;pc=#F7F7E8;pw=16;" shape[640] = "func=line;x=611;y=410;x1=59;y1=19;x2=0;y2=0;pc=#F7F7E8;pw=16;" shape[641] = "func=line;x=610;y=394;x1=0;y1=0;x2=41;y2=32;pc=#F7F7E8;pw=16;" shape[642] = "func=line;x=636;y=412;x1=0;y1=0;x2=68;y2=24;pc=#F7F7E8;pw=16;" shape[643] = "func=line;x=602;y=334;x1=9;y1=0;x2=0;y2=55;pc=#F7F7E8;pw=16;" shape[644] = "func=line;x=609;y=354;x1=0;y1=0;x2=20;y2=66;pc=#F7F7E8;pw=16;" shape[645] = "func=line;x=626;y=401;x1=0;y1=0;x2=43;y2=30;pc=#F7F7E8;pw=16;" shape[646] = "func=line;x=646;y=415;x1=0;y1=0;x2=58;y2=20;pc=#F7F7E8;pw=16;" shape[647] = "func=line;x=773;y=333;x1=0;y1=0;x2=26;y2=0;pc=#F7F7E8;pw=16;" shape[648] = "func=line;x=798;y=330;x1=0;y1=0;x2=8;y2=16;pc=#F7F7E8;pw=16;" shape[649] = "func=line;x=754;y=344;x1=56;y1=0;x2=0;y2=97;pc=#F7F7E8;pw=16;" shape[650] = "func=line;x=758;y=336;x1=39;y1=0;x2=0;y2=93;pc=#F7F7E8;pw=16;" shape[651] = "func=line;x=802;y=360;x1=0;y1=0;x2=7;y2=39;pc=#F7F7E8;pw=16;" shape[652] = "func=line;x=777;y=381;x1=36;y1=0;x2=0;y2=75;pc=#F7F7E8;pw=16;" shape[653] = "func=line;x=724;y=442;x1=68;y1=0;x2=0;y2=67;pc=#F7F7E8;pw=16;" shape[654] = "func=line;x=685;y=498;x1=59;y1=0;x2=0;y2=43;pc=#F7F7E8;pw=16;" shape[655] = "func=line;x=713;y=391;x1=79;y1=0;x2=0;y2=109;pc=#F7F7E8;pw=16;" shape[656] = "func=line;x=705;y=421;x1=79;y1=0;x2=0;y2=94;pc=#F7F7E8;pw=16;" shape[657] = "func=line;x=475;y=498;x1=0;y1=0;x2=124;y2=36;pc=#F7F7E8;pw=16;" shape[658] = "func=line;x=494;y=485;x1=0;y1=0;x2=117;y2=41;pc=#F7F7E8;pw=16;" shape[659] = "func=line;x=505;y=487;x1=0;y1=14;x2=216;y2=0;pc=#F7F7E8;pw=16;" shape[660] = "func=line;x=569;y=462;x1=0;y1=25;x2=164;y2=0;pc=#F7F7E8;pw=16;" shape[661] = "func=line;x=578;y=497;x1=0;y1=11;x2=138;y2=0;pc=#F7F7E8;pw=16;" shape[662] = "func=line;x=642;y=440;x1=0;y1=61;x2=116;y2=0;pc=#F7F7E8;pw=16;" shape[663] = "func=line;x=698;y=452;x1=0;y1=32;x2=56;y2=0;pc=#F7F7E8;pw=16;" shape[664] = "func=line;x=352;y=342;x1=0;y1=0;x2=20;y2=57;pc=#F7F7E8;pw=16;" shape[665] = "func=line;x=361;y=369;x1=0;y1=0;x2=37;y2=38;pc=#F7F7E8;pw=16;" shape[666] = "func=line;x=380;y=393;x1=0;y1=0;x2=65;y2=17;pc=#F7F7E8;pw=16;" shape[667] = "func=line;x=352;y=350;x1=2;y1=0;x2=0;y2=52;pc=#F7F7E8;pw=16;" shape[668] = "func=line;x=352;y=388;x1=0;y1=0;x2=24;y2=50;pc=#F7F7E8;pw=16;" shape[669] = "func=line;x=364;y=420;x1=0;y1=0;x2=29;y2=52;pc=#F7F7E8;pw=16;" shape[670] = "func=line;x=387;y=464;x1=0;y1=0;x2=44;y2=55;pc=#F7F7E8;pw=16;" shape[671] = "func=line;x=423;y=511;x1=0;y1=0;x2=58;y2=33;pc=#F7F7E8;pw=16;" shape[672] = "func=line;x=479;y=544;x1=0;y1=0;x2=78;y2=15;pc=#F7F7E8;pw=16;" shape[673] = "func=line;x=545;y=559;x1=0;y1=0;x2=105;y2=3;pc=#F7F7E8;pw=16;" shape[674] = "func=line;x=638;y=522;x1=0;y1=40;x2=82;y2=0;pc=#F7F7E8;pw=16;" shape[675] = "func=line;x=697;y=468;x1=0;y1=73;x2=69;y2=0;pc=#F7F7E8;pw=16;" shape[676] = "func=line;x=367;y=419;x1=0;y1=0;x2=97;y2=107;pc=#F7F7E8;pw=16;" shape[677] = "func=line;x=411;y=485;x1=0;y1=0;x2=101;y2=60;pc=#F7F7E8;pw=16;" shape[678] = "func=line;x=480;y=537;x1=0;y1=0;x2=170;y2=17;pc=#F7F7E8;pw=16;" shape[679] = "func=line;x=622;y=506;x1=0;y1=46;x2=90;y2=0;pc=#F7F7E8;pw=16;" shape[680] = "func=line;x=470;y=524;x1=0;y1=0;x2=193;y2=11;pc=#F7F7E8;pw=16;" shape[681] = "func=line;x=544;y=519;x1=0;y1=6;x2=137;y2=0;pc=#F7F7E8;pw=16;" shape[682] = "func=line;x=616;y=504;x1=0;y1=11;x2=86;y2=0;pc=#F7F7E8;pw=16;" shape[683] = "func=line;x=563;y=537;x1=0;y1=3;x2=113;y2=0;pc=#F7F7E8;pw=16;" shape[684] = "func=line;x=423;y=474;x1=0;y1=0;x2=87;y2=52;pc=#F7F7E8;pw=16;" shape[685] = "func=line;x=446;y=480;x1=0;y1=0;x2=82;y2=26;pc=#F7F7E8;pw=16;" shape[686] = "func=line;x=382;y=404;x1=0;y1=0;x2=106;y2=69;pc=#F7F7E8;pw=16;" shape[687] = "func=line;x=404;y=425;x1=0;y1=0;x2=67;y2=50;pc=#F7F7E8;pw=16;" shape[688] = "func=line;x=416;y=406;x1=0;y1=0;x2=88;y2=74;pc=#F7F7E8;pw=16;" shape[689] = "func=line;x=458;y=451;x1=0;y1=0;x2=136;y2=19;pc=#F7F7E8;pw=16;" shape[690] = "func=line;x=527;y=336;x1=0;y1=0;x2=82;y2=5;pc=#F7F7E8;pw=16;" shape[691] = "func=line;x=530;y=340;x1=1;y1=0;x2=0;y2=44;pc=#F7F7E8;pw=16;" shape[692] = "func=line;x=541;y=342;x1=0;y1=0;x2=0;y2=68;pc=#F7F7E8;pw=16;" shape[693] = "func=line;x=552;y=344;x1=0;y1=0;x2=5;y2=80;pc=#F7F7E8;pw=16;" shape[694] = "func=line;x=551;y=359;x1=0;y1=0;x2=53;y2=1;pc=#F7F7E8;pw=16;" shape[695] = "func=line;x=554;y=349;x1=0;y1=0;x2=47;y2=1;pc=#F7F7E8;pw=16;" shape[696] = "func=line;x=554;y=373;x1=0;y1=0;x2=52;y2=4;pc=#F7F7E8;pw=16;" shape[697] = "func=line;x=556;y=390;x1=0;y1=0;x2=55;y2=4;pc=#F7F7E8;pw=16;" shape[698] = "func=line;x=547;y=394;x1=0;y1=0;x2=95;y2=52;pc=#F7F7E8;pw=16;" shape[699] = "func=line;x=585;y=397;x1=0;y1=0;x2=80;y2=55;pc=#F7F7E8;pw=16;" shape[700] = "func=line;x=591;y=410;x1=0;y1=0;x2=24;y2=43;pc=#F7F7E8;pw=16;" shape[701] = "func=line;x=636;y=429;x1=0;y1=26;x2=123;y2=0;pc=#F7F7E8;pw=16;" shape[702] = "func=line;x=588;y=424;x1=0;y1=0;x2=13;y2=44;pc=#F7F7E8;pw=16;" shape[703] = "func=line;x=442;y=405;x1=0;y1=0;x2=25;y2=0;pc=#F7F7E8;pw=8;" shape[704] = "func=line;x=467;y=395;x1=0;y1=10;x2=34;y2=0;pc=#F7F7E8;pw=8;" shape[705] = "func=line;x=497;y=352;x1=0;y1=43;x2=28;y2=0;pc=#F7F7E8;pw=8;" shape[706] = "func=line;x=445;y=413;x1=0;y1=0;x2=21;y2=31;pc=#F7F7E8;pw=8;" shape[707] = "func=line;x=454;y=409;x1=0;y1=0;x2=5;y2=33;pc=#F7F7E8;pw=8;" shape[708] = "func=line;x=450;y=427;x1=0;y1=0;x2=66;y2=40;pc=#F7F7E8;pw=8;" shape[709] = "func=line;x=468;y=403;x1=0;y1=16;x2=62;y2=0;pc=#F7F7E8;pw=8;" shape[710] = "func=line;x=521;y=378;x1=0;y1=27;x2=10;y2=0;pc=#F7F7E8;pw=8;" shape[711] = "func=line;x=470;y=421;x1=0;y1=0;x2=26;y2=18;pc=#F7F7E8;pw=8;" shape[712] = "func=line;x=496;y=439;x1=0;y1=0;x2=63;y2=7;pc=#F7F7E8;pw=8;" shape[713] = "func=line;x=554;y=440;x1=0;y1=6;x2=15;y2=0;pc=#F7F7E8;pw=8;" shape[714] = "func=line;x=566;y=410;x1=0;y1=0;x2=0;y2=33;pc=#F7F7E8;pw=8;" shape[715] = "func=line;x=485;y=425;x1=0;y1=0;x2=77;y2=11;pc=#F7F7E8;pw=16;" shape[716] = "func=line;x=493;y=401;x1=0;y1=23;x2=62;y2=0;pc=#F7F7E8;pw=16;" shape[717] = "func=line;x=528;y=400;x1=0;y1=25;x2=45;y2=0;pc=#F7F7E8;pw=16;" shape[718] = "func=line;x=549;y=411;x1=0;y1=17;x2=37;y2=0;pc=#F7F7E8;pw=16;" shape[719] = "func=line;x=530;y=361;x1=5;y1=0;x2=0;y2=53;pc=#F7F7E8;pw=16;" shape[720] = "func=line;x=773;y=383;x1=25;y1=0;x2=0;y2=62;pc=#F7F7E8;pw=16;" shape[721] = "func=line;x=591;y=492;x1=131;y1=0;x2=0;y2=57;pc=#F7F7E8;pw=16;" shape[722] = "func=line;x=829;y=393;x1=5;y1=0;x2=0;y2=27;pc=#F7F7E8;pw=8;" shape[723] = "func=line;x=816;y=416;x1=13;y1=0;x2=0;y2=35;pc=#F7F7E8;pw=8;" shape[724] = "func=line;x=801;y=447;x1=18;y1=0;x2=0;y2=19;pc=#F7F7E8;pw=8;" shape[725] = "func=line;x=785;y=465;x1=18;y1=0;x2=0;y2=8;pc=#F7F7E8;pw=8;" shape[726] = "func=line;x=815;y=395;x1=17;y1=0;x2=0;y2=20;pc=#F7F7E8;pw=8;" shape[727] = "func=line;x=806;y=415;x1=9;y1=0;x2=0;y2=36;pc=#F7F7E8;pw=8;" shape[728] = "func=line;x=791;y=449;x1=15;y1=0;x2=0;y2=24;pc=#F7F7E8;pw=8;" shape[729] = "func=line;x=809;y=410;x1=18;y1=0;x2=0;y2=41;pc=#F7F7E8;pw=8;" shape[730] = "func=line;x=516;y=581;x1=0;y1=0;x2=108;y2=9;pc=#F7F7E8;pw=16;" shape[731] = "func=line;x=517;y=590;x1=0;y1=5;x2=100;y2=0;pc=#F7F7E8;pw=16;" shape[732] = "func=line;x=519;y=570;x1=0;y1=0;x2=46;y2=10;pc=#F7F7E8;pw=16;" shape[733] = "func=line;x=546;y=577;x1=0;y1=0;x2=87;y2=4;pc=#F7F7E8;pw=16;" shape[734] = "func=line;x=634;y=581;x1=0;y1=0;x2=0;y2=17;pc=#F7F7E8;pw=16;" shape[735] = "func=line;x=591;y=596;x1=41;y1=0;x2=0;y2=9;pc=#F7F7E8;pw=16;" shape[736] = "func=line;x=513;y=599;x1=79;y1=4;x2=0;y2=0;pc=#F7F7E8;pw=16;" shape[737] = "func=line;x=511;y=568;x1=5;y1=0;x2=0;y2=29;pc=#F7F7E8;pw=16;" shape[738] = "func=line;x=496;y=556;x1=0;y1=0;x2=59;y2=12;pc=#4E3932;pw=4;" shape[739] = "func=line;x=551;y=567;x1=0;y1=0;x2=101;y2=5;pc=#4E3932;pw=4;" shape[740] = "func=line;x=649;y=548;x1=0;y1=23;x2=60;y2=0;pc=#4E3932;pw=4;" shape[741] = "func=line;x=642;y=574;x1=1;y1=0;x2=0;y2=16;pc=#4E3932;pw=4;" shape[742] = "func=line;x=503;y=563;x1=5;y1=0;x2=0;y2=37;pc=#4E3932;pw=4;" shape[743] = "func=line;x=490;y=493;x1=0;y1=0;x2=47;y2=7;pc=#4E3932;pw=4;" shape[744] = "func=line;x=69;y=2;x1=38;y1=0;x2=0;y2=80;pc=#AA3822;pw=2;" shape[745] = "func=line;x=366;y=6;x1=9;y1=0;x2=0;y2=21;pc=#AA3822;pw=4;" shape[746] = "func=line;x=358;y=27;x1=8;y1=0;x2=0;y2=44;pc=#AA3822;pw=4;" shape[747] = "func=line;x=358;y=71;x1=0;y1=0;x2=0;y2=49;pc=#AA3822;pw=4;" shape[748] = "func=line;x=357;y=120;x1=1;y1=0;x2=0;y2=48;pc=#AA3822;pw=4;" shape[749] = "func=line;x=357;y=168;x1=0;y1=0;x2=0;y2=40;pc=#AA3822;pw=4;" shape[750] = "func=line;x=357;y=208;x1=0;y1=0;x2=6;y2=24;pc=#AA3822;pw=4;" shape[751] = "func=line;x=395;y=7;x1=6;y1=0;x2=0;y2=21;pc=#AA3822;pw=4;" shape[752] = "func=line;x=395;y=23;x1=0;y1=5;x2=21;y2=0;pc=#AA3822;pw=4;" shape[753] = "func=line;x=389;y=23;x1=27;y1=0;x2=0;y2=29;pc=#AA3822;pw=4;" shape[754] = "func=line;x=383;y=52;x1=6;y1=0;x2=0;y2=34;pc=#AA3822;pw=4;" shape[755] = "func=line;x=381;y=86;x1=2;y1=0;x2=0;y2=24;pc=#AA3822;pw=4;" shape[756] = "func=line;x=381;y=79;x1=0;y1=31;x2=27;y2=0;pc=#AA3822;pw=4;" shape[757] = "func=line;x=383;y=79;x1=25;y1=0;x2=0;y2=54;pc=#AA3822;pw=4;" shape[758] = "func=line;x=383;y=129;x1=0;y1=4;x2=19;y2=0;pc=#AA3822;pw=4;" shape[759] = "func=line;x=378;y=129;x1=24;y1=0;x2=0;y2=33;pc=#AA3822;pw=4;" shape[760] = "func=line;x=368;y=162;x1=10;y1=0;x2=0;y2=27;pc=#AA3822;pw=4;" shape[761] = "func=line;x=366;y=189;x1=2;y1=0;x2=0;y2=24;pc=#AA3822;pw=4;" shape[762] = "func=line;x=366;y=213;x1=0;y1=0;x2=3;y2=14;pc=#AA3822;pw=4;" shape[763] = "func=line;x=364;y=10;x1=15;y1=0;x2=0;y2=112;pc=#AA3822;pw=8;" shape[764] = "func=line;x=363;y=56;x1=5;y1=0;x2=0;y2=117;pc=#AA3822;pw=8;" shape[765] = "func=line;x=361;y=73;x1=0;y1=0;x2=0;y2=107;pc=#AA3822;pw=8;" shape[766] = "func=line;x=360;y=169;x1=1;y1=0;x2=0;y2=42;pc=#AA3822;pw=8;" shape[767] = "func=line;x=360;y=205;x1=0;y1=0;x2=6;y2=22;pc=#AA3822;pw=8;" shape[768] = "func=line;x=361;y=145;x1=0;y1=62;x2=11;y2=0;pc=#AA3822;pw=8;" shape[769] = "func=line;x=368;y=136;x1=0;y1=26;x2=25;y2=0;pc=#AA3822;pw=8;" shape[770] = "func=line;x=368;y=111;x1=0;y1=34;x2=19;y2=0;pc=#AA3822;pw=8;" shape[771] = "func=line;x=369;y=132;x1=0;y1=16;x2=29;y2=0;pc=#AA3822;pw=8;" shape[772] = "func=line;x=369;y=148;x1=0;y1=25;x2=9;y2=0;pc=#AA3822;pw=8;" shape[773] = "func=line;x=373;y=143;x1=0;y1=17;x2=14;y2=0;pc=#AA3822;pw=8;" shape[774] = "func=line;x=377;y=80;x1=0;y1=61;x2=29;y2=0;pc=#AA3822;pw=8;" shape[775] = "func=line;x=367;y=77;x1=0;y1=55;x2=39;y2=0;pc=#AA3822;pw=8;" shape[776] = "func=line;x=380;y=44;x1=0;y1=68;x2=7;y2=0;pc=#AA3822;pw=8;" shape[777] = "func=line;x=371;y=44;x1=0;y1=85;x2=12;y2=0;pc=#AA3822;pw=8;" shape[778] = "func=line;x=391;y=6;x1=7;y1=0;x2=0;y2=25;pc=#AA3822;pw=8;" shape[779] = "func=line;x=390;y=26;x1=0;y1=5;x2=22;y2=0;pc=#AA3822;pw=8;" shape[780] = "func=line;x=385;y=25;x1=28;y1=0;x2=0;y2=31;pc=#AA3822;pw=8;" shape[781] = "func=line;x=365;y=34;x1=36;y1=0;x2=0;y2=42;pc=#AA3822;pw=8;" shape[782] = "func=line;x=374;y=9;x1=10;y1=0;x2=0;y2=54;pc=#AA3822;pw=16;" shape[783] = "func=line;x=380;y=8;x1=9;y1=0;x2=0;y2=51;pc=#AA3822;pw=16;" shape[784] = "func=line;x=363;y=32;x1=32;y1=0;x2=0;y2=39;pc=#AA3822;pw=16;" shape[785] = "func=line;x=361;y=10;x1=0;y1=64;x2=22;y2=0;pc=#AA3822;pw=16;" shape[786] = "func=line;x=367;y=49;x1=9;y1=0;x2=0;y2=105;pc=#AA3822;pw=16;" EndSub Sub Shapes_Add ' Shapes | Add shapes as shapes data ' param shape - array of shapes ' param scale - to zoom ' return nShapes - number of shapes ' return shAngle - current angle of shapes Stack.PushValue("local", i) nShapes = Array.GetItemCount(shape) s = scale For i = 1 To nShapes GraphicsWindow.PenWidth = shape[i]["pw"] * s If shape[i]["pw"] > 0 Then GraphicsWindow.PenColor = shape[i]["pc"] EndIf If shape[i]["func"] = "rect" Then GraphicsWindow.BrushColor = shape[i]["bc"] shape[i]["obj"] = Shapes.AddRectangle(shape[i]["width"]* s, shape[i]["height"] * s) ElseIf shape[i]["func"] = "ell" Then GraphicsWindow.BrushColor = shape[i]["bc"] shape[i]["obj"] = Shapes.AddEllipse(shape[i]["width"]* s, shape[i]["height"] * s) ElseIf shape[i]["func"] = "tri" Then GraphicsWindow.BrushColor = shape[i]["bc"] 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) EndIf Shapes.Move(shape[i]["obj"], shX + shape[i]["x"] * s, shY + shape[i]["y"] * s) If Text.IsSubText("rect|ell|tri", shape[i]["func"]) And shape[i]["angle"] <> 0 Then Shapes.Rotate(shape[i]["obj"], shape[i]["angle"]) EndIf shape[i]["rx"] = shape[i]["x"] shape[i]["ry"] = shape[i]["y"] EndFor shAngle = 0 i = Stack.PopValue("local") EndSub Program.Delay(2500) GraphicsWindow.Clear() 'โค้ดงานเกม หรือ งานที่นักเรียนนำเสนอ ต่อตรงนี้ '' For i = 1 To 10 APL[i] = Shapes.AddImage("http://sozaidas.com/sozai/010801fruit/010801fruit02-trans.png") Shapes.Move(APL[i],Math.GetRandomNumber(640),-100-Math.GetRandomNumber(200) ) fal[i]=(5+Math.GetRandomNumber(10))/5 Shapes.Zoom(APL[i],fal[i]/3,fal[i]/3) EndFor bct = Shapes.AddRectangle(40,20) '---------------- backet --------------- GraphicsWindow.FontSize=20 msg=Shapes.AddText(" ") While "true" Shapes.move(bct,GraphicsWindow.MouseX,430) ' move backet For i = 1 To 10 Shapes.Move(APL[i], shapes.GetLeft(APL[i]), shapes.Gettop(APL[i])+fal[i]) ' move apples If Math.Abs(Shapes.GetLeft(bct)-Shapes.GetLeft(APL[i]))<80 And Math.abs(Shapes.GetTop(bct)-Shapes.Gettop(APL[i]))<20 Then NN=NN+1 Sound.PlayClick() Shapes.move(APL[i] ,Math.GetRandomNumber(640),-100-Math.GetRandomNumber(200)) ' elseIf shapes.Gettop(APL[i])>500 Then MM=MM+1 Shapes.Move(APL[i], Math.GetRandomNumber(640),-100-Math.GetRandomNumber(200) ) EndIf EndFor Shapes.SetText(msg,"Hit count= "+NN+ " Total= "+(MM+NN)) Program.Delay(10) endWhile End>LNQ503.sb< Start>LNR359.sb< GraphicsWindow.Title="Swarm Of Flies" Background=ImageList.LoadImage("http://www.reiselandbulgarien.de/wp-content/uploaded_images/2008/Evgeni/Lake_Vaya.jpg") GraphicsWindow.DrawImage(Background,0,0) GraphicsWindow.Height=imagelist.GetHeightOfImage(Background) GraphicsWindow.Width=imagelist.GetWidthOfImage(Background) Insect_Amount=20 GraphicsWindow.BrushColor="Black" For i = 1 To Insect_Amount Insect[i]=shapes.AddRectangle(5,5) endfor While "True" Mouse_X = GraphicsWindow.MouseX Mouse_Y = GraphicsWindow.MouseY For i = 1 To Insect_Amount If Insect_X[i] > Insect_GotoX[i]-50 And Insect_X[i] < Insect_GotoX[i]+50 and Insect_Y[i] > Insect_GotoY[i]-50 And Insect_Y[i] < Insect_GotoY[i]+50 Then Insect_GotoX[i] = Mouse_X + math.GetRandomNumber(301) - 151 Insect_GotoY[i] = Mouse_Y + math.GetRandomNumber(200)*-1+20 endif Shapes.Zoom(Insect[i],(Insect_GotoX[i] - Insect_X[i]) * 0.002+1,(Insect_GotoX[i] - Insect_X[i]) * 0.002+1) Insect_X[i] = Insect_X[i] + (Insect_GotoX[i] - Insect_X[i]) * 0.05 Insect_Y[i] = Insect_Y[i] + (Insect_GotoY[i] - Insect_Y[i]) * 0.05 Shapes.Move(Insect[i],Insect_X[i],Insect_Y[i]) endfor Program.Delay(20) EndWhile End>LNR359.sb< Start>LNT836.sb< ' program by yled May 14th 2016 ' challenge of May ' program no: GraphicsWindow.Title = "Magical Number Quizz" GraphicsWindow.top= 0 GraphicsWindow.left= 0 GraphicsWindow.Height = 768 GraphicsWindow.Width = 1366 design() GraphicsWindow.FontSize = 30 graphicswindow.brushcolor="white" GraphicsWindow.DrawBoundText(10,10,1300, " this computer will tell you the mumber you have in mind, ready to start ") question() GraphicsWindow.MouseDown = OnMouseDown 'Start mouse down event clicked = 0 'Initially not clicked While ("True") 'Continual loop just waiting for clicked flag to be set GraphicsWindow.FontSize = 25 graphicswindow.brushcolor="yellow" GraphicsWindow.DrawBoundText(900,100,300, " click to continue") If (clicked = 1) Then clicked = 0 'Reset clicked flag so we don't keep restarting move() until we get another click x=x+1 GraphicsWindow.FontSize = 35 GraphicsWindow.BrushColor = "black" GraphicsWindow.DrawBoundText(110, 50+z, 800, question[x]) z=z+30 If x=8 then Goto answer endif EndIf Program.Delay(20) 'Delay while waiting for click to prevent mashing cpu EndWhile Sub OnMouseDown 'Flag when the mouse is clicked clicked = 1 EndSub answer: typein=Controls.AddTextBox(710,280) GraphicsWindow.FontSize = 30 GraphicsWindow.BrushColor = "red" button = Controls.AddButton(" ANSWER ", 1050, 450) Controls.ButtonClicked = Click Sub Click If Controls.LastClickedButton = button Then n=Controls.GetTextBoxText(typein) n1=Text.GetLength(n) n2=text.GetSubText(n,1,n1-2) Controls.Remove(typein) GraphicsWindow.FontSize = 65 GraphicsWindow.BrushColor = "white" GraphicsWindow.DrawBoundText(110, 350, 800, "Your number is: ") GraphicsWindow.FontSize = 125 GraphicsWindow.BrushColor = "yellow" GraphicsWindow.DrawBoundText(710, 350, 800, n2) EndIf EndSub Sub question question[1] = "Think of a number, but dont say it me " question[2] ="DOUBLE that number " question[3]= "ADD 4 to that sum " question[4]="Then MULTILPY the whole by 5 " question[5]="Then ADD 12 " question[6]="MULTIPLY the amount by 10 " question[7] ="from the sum of the whole DEDUCT 320 " question[8] ="enter the REMAINDER in the box " EndSub Sub Design BGimage=ImageList.LoadImage("https://social.msdn.microsoft.com/Forums/getfile/863657") For a= 1 To 1366 Step 62 For b=1 To 768 Step 26 GraphicsWindow.DrawImage(BGimage,a,b) EndFor EndFor EndSub End>LNT836.sb< Start>LNV488.sb< ' SmallBasic Version 1.0 ' Funktion: FlatDirView ' Autor: pappalapub ' Herkunft: http://social.msdn.microsoft.com/Forums/en-US/ad1e68b2-6b36-467f-b6c3-20671b0fd8e9/ ' ImportURL: http://smallbasic.com/program/? ' Extension: ' Kommentar: For GraphicsWindow (GW), ' 2. Write a flat-directory viewer for selectable folder (e.g. Subs in IE-Cache) ' The following line could be harmful and has been automatically commented. ' ' and show only 'SubDirName\File.ext' in MultiLineTextBox line by line ' Lists only 1 SubLevel deep, ending \ and " in path are accepted ' Variablen: ' ' -------------------------------------------------------------------------------- CRLF = Text.GetCharacter(13)+Text.GetCharacter(10) QU = Text.GetCharacter(34) TAB = Text.GetCharacter(9) ' The following line could be harmful and has been automatically commented. ' SaveFile = Text.GetSubText(File.GetSettingsFilePath(),1,Text.GetLength(File.GetSettingsFilePath())-8) + "lst" GraphicsWindow.Width = 600 GraphicsWindow.Height = 500 GW = GraphicsWindow.Width GH = GraphicsWindow.Height GraphicsWindow.Title = "FlatDirView (1 SubLevel Listing Depth)" GraphicsWindow.DrawResizedImage("http://media.moddb.com/images/downloads/1/42/41949/117953_1.jpg",0,0,GW,GH) GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.DrawText(13,14,"Paste folderpath here..") GraphicsWindow.BrushColor = "Lime" GraphicsWindow.FillRectangle(GW-99,11,26,24) GraphicsWindow.BrushColor = "MidnightBlue" Dir = Controls.AddTextBox(10,10) Controls.SetSize(Dir,GW-120,26) Shapes.SetOpacity(Dir,90) Exp = Controls.AddButton("Export", GW-63, 10) Go = Controls.AddButton("Go", GW-100, 10) Shapes.SetOpacity(Go,70) View = Controls.AddMultiLineTextBox(10,45) Controls.SetSize(View, GW-20, GH-55) Shapes.SetOpacity(View,70) Controls.ButtonClicked = OnButtonClick ' ///// SUBs \\\\\ Sub OnButtonClick If Controls.LastClickedButton = Go Then Cleanup() Listing() Else If Text <> "" Then ' The following line could be harmful and has been automatically commented. ' Done = File.AppendContents(SaveFile,"FlatDirList (1 SubLevel deep) for: "+QU+DirPath+QU+CRLF+CRLF+Text+"----------"+CRLF) GraphicsWindow.ShowMessage(Done + " saving FlatDirList to:" + CRLF + CRLF + SaveFile, Done) Else GraphicsWindow.ShowMessage("No DirList to save!", "Error") EndIf EndIf EndSub Sub Listing DirPath = Controls.GetTextBoxText(Dir) RemoveQU() PathLen = Text.GetLength(DirPath) ' The following line could be harmful and has been automatically commented. ' Subs = File.GetDirectories(DirPath) If Subs <> "FAILED" Then ' The following line could be harmful and has been automatically commented. ' If File.GetDirectories(DirPath) = "" And File.GetFiles(DirPath) = "" Then GraphicsWindow.ShowMessage("Nothing to show!","Empty directory") Else LastDir = DirPath GraphicsWindow.FillRectangle(13,14,GW-120,20) GetFileNames() GetDirNames() Controls.SetTextBoxText(View,Text) EndIf Else Controls.SetTextBoxText(Dir,LastDir) GraphicsWindow.ShowMessage("Wrong folder path!", "Error") EndIf EndSub Sub GetFileNames ' The following line could be harmful and has been automatically commented. ' Files = File.GetFiles(DirPath) For FileNum = 1 To Array.GetItemCount(Files) Text = Text + Text.GetSubTextToEnd(Files[FileNum],PathLen+2) + CRLF EndFor Text = Text + CRLF EndSub Sub GetDirNames For DirNum = 1 To Array.GetItemCount(Subs) GetSubFileNames() GetSubDirNames() Text = Text + CRLF EndFor EndSub Sub GetSubFileNames ' The following line could be harmful and has been automatically commented. ' SubFiles = File.GetFiles(Subs[DirNum]) If SubFiles = "" Then Text = Text + Text.GetSubTextToEnd(Subs[DirNum],PathLen+2) + "\. " + TAB + "[empty Dir]" + CRLF Else For SubFileNum = 1 To Array.GetItemCount(SubFiles) Text = Text + Text.GetSubTextToEnd(SubFiles[SubFileNum],PathLen+2) + CRLF EndFor EndIf EndSub Sub GetSubDirNames ' The following line could be harmful and has been automatically commented. ' SubDirs = File.GetDirectories(Subs[DirNum]) For SubDirNum = 1 To Array.GetItemCount(SubDirs) Text = Text + Text.GetSubTextToEnd(SubDirs[SubDirNum],PathLen+2) + "\. " + TAB + "[2nd/deeper level]" + CRLF EndFor EndSub Sub RemoveQU While Text.IsSubText(DirPath,QU) QuPos = Text.GetIndexOf(DirPath,QU) DirPath = Text.GetSubText(DirPath,1, QuPos-1) + Text.GetSubTextToEnd(DirPath,QuPos+1) EndWhile If Text.GetSubTextToEnd(DirPath,Text.GetLength(DirPath)) = "\" Then DirPath = Text.GetSubText(DirPath,1,Text.GetLength(DirPath)-1) EndIf Controls.SetTextBoxText(Dir,DirPath) EndSub Sub Cleanup Text = "" Controls.SetTextBoxText(View,"") EndSub End>LNV488.sb< Start>LNV725.sb< ' SmallBasic Version 1.2 ' Program: Math_Functions (.sbsub) ' Changelog: ' Author: Nonki Takahashi ' Website: https://social.msdn.microsoft.com/Forums/en-US/95706095-0984-40d7-897f-0ec14ed58039/small-basic-subroutine-library-project ' https://gist.github.com/nonkit/e898af0f9f79726a6fba4a64d02a3a71 ' ImportURL: http://smallbasic.com/program/? ' SBOnline: http://smallbasic-publicwebsite-dev.azurewebsites.net/Program/view.aspx? ' Extension: ' Comment: SmallBasicCompiler.exe Math_Functions.sb -> Math_Functions.exe ' -> rename Math_Functions.exe to Math_Functions.sbsub ' Variables: ' ToDo: ' ============================================================================== x = "" ' or _x y = "" ' or _y _r = "" _a = "" ' //////////////////// SUBs //////////////////// 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>LNV725.sb< Start>LNW806.sb< GraphicsWindow.Show() GraphicsWindow.Title = "The Great Commander" GraphicsWindow.Width = 1366 GraphicsWindow.Height = 768 GraphicsWindow.BackgroundColor = "green" GraphicsWindow.BrushColor = "blue" shp = Shapes.AddEllipse(200,200) Shapes.Animate(shp,100,768/3,5000) GraphicsWindow.BrushColor = "red" shq = Shapes.AddEllipse(200,200) Shapes.Animate(shq,130,768/3,5000) GraphicsWindow.BrushColor = "maroon" GraphicsWindow.FontName = "Berlin Sans FB" GraphicsWindow.FontBold = "true" GraphicsWindow.FontSize = 150 shx = Shapes.AddText("MARRON") Shapes.Animate(shx,1366/4,768/3,5000) GraphicsWindow.FontName = "Berlin Sans FB" GraphicsWindow.FontBold = "true" GraphicsWindow.FontSize = 80 shv = Shapes.AddText("The games of the century.") Shapes.Animate(shv,1366/4.9,768/1.8,4000) Program.Delay(7000) GraphicsWindow.Clear() Sound.PlayChimes() GraphicsWindow.FontName = "Berlin Sans FB" GraphicsWindow.FontSize = 80 L = Shapes.AddText("L") O = Shapes.AddText("O") A = Shapes.AddText("A") D = Shapes.AddText("D") I = Shapes.AddText("I") N = Shapes.AddText("N") G = Shapes.AddText("G") pr = Shapes.AddText(".") pr2 = Shapes.AddText(".") pr3 = Shapes.AddText(".") Shapes.Animate(L,400,768/2.5,2000) Shapes.Animate(O,440,768/2.5,3000) Shapes.Animate(A,495,768/2.5,4000) Shapes.Animate(D,550,768/2.5,2000) Shapes.Animate(I,605,768/2.5,3000) Shapes.Animate(N,630,768/2.5,4000) Shapes.Animate(G,688,768/2.5,2000) Shapes.Animate(pr,750,768/2.5,3000) Shapes.Animate(pr2,780,768/2.5,4000) Shapes.Animate(pr3,810,768/2.5,5000) Program.Delay(7000) Menu() Sub menu GraphicsWindow.Clear() Sound.PlayChime() img = "C:\Users\arnulfo\Documents\background 2.png" GraphicsWindow.DrawResizedImage(img,0,0,1366,768) GraphicsWindow.FontSize = 72 GraphicsWindow.BrushColor = "maroon" GraphicsWindow.DrawText(1366/5,768/3,"THE GREAT COMMANDER") GraphicsWindow.BrushColor = "black" sjk = Controls.AddButton("PLAY",1366/2.95,768/2.1) syh = Controls.AddButton("HELP",1366/2.0135,768/2.1) lng = Controls.AddButton("LANGUAGE",1366/2.95,768/1.6) qte = Controls.AddButton("QUIT",1366/15,768/12) credits = Controls.AddButton("CREDITS",1366/2.625,768/1.3) Controls.ButtonClicked = ctrl Endsub Sub ctrl If Controls.LastClickedButton = sjk Then GraphicsWindow.Clear() Sound.PlayClick() GraphicsWindow.BackgroundColor = "Orange" GraphicsWindow.BrushColor = "maroon" GraphicsWindow.DrawText(50,50,"Choose avatar") lrs = Controls.AddButton("DOCTOR LORRAINE SEO",1366/15,768/3) mtp = Controls.AddButton("COMMANDER MATTHEW PARK",1366/15,768/2) backs = Controls.AddButton("BACK",1366/2,768/12) Controls.ButtonClicked = avatar ElseIf Controls.LastClickedButton = syh Then GraphicsWindow.Clear() Sound.PlayClick() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.FontSize = 72 GraphicsWindow.BrushColor = "orange" GraphicsWindow.DrawText(1366/3,768/10,"HOW TO PLAY") GraphicsWindow.FontSize = 48 GraphicsWindow.DrawText(1366/3,768/4,"It's all up to you now!") GraphicsWindow.DrawText(1366/3,768/3,"Make the right decisions!") GraphicsWindow.DrawText(1366/3,768/2.4,"THE GREAT COMMANDER") GraphicsWindow.DrawText(1366/15,768/1.9,"Tip for players: If you're a KDRAMA fan, imagine") GraphicsWindow.DrawText(1366/15,768/1.7,"your oppa or noona. If you're ordinary, imagine") GraphicsWindow.DrawText(1366/15,768/1.5,"your crush. See how far you can go. Have fun!") hlb = Controls.AddButton("<---BACK",1366/15,768/12) Controls.ButtonClicked = ctrp ElseIf Controls.LastClickedButton = lng Then GraphicsWindow.Clear() Sound.PlayClick() GraphicsWindow.BackgroundColor = "LightSalmon" GraphicsWindow.FontSize = 72 GraphicsWindow.BrushColor = "SaddleBrown" GraphicsWindow.DrawText(1366/4,768/12,"LANGUAGE OPTIONS") GraphicsWindow.FontSize = 56 krn = Controls.AddButton("한국어",1366/2.5,768/5) jpn = Controls.AddButton("日本語",1366/2.5,768/3.3) thl = Controls.AddButton("ไทย",1366/2.5,768/2.45) GraphicsWindow.FontName = "Calibri" phl = Controls.AddButton("TAGALOG",1366/2.5,768/1.95) bck = Controls.AddButton("<---BACK",1366/15,768/12) Controls.ButtonClicked = ctrl2 ElseIf Controls.LastClickedButton = qte Then GraphicsWindow.Clear() Sound.PlayClick() GraphicsWindow.BackgroundColor = "PeachPuff" GraphicsWindow.FontSize = 48 GraphicsWindow.BrushColor = "IndianRed" GraphicsWindow.DrawText(1366/4,768/3,"Are you sure you want to quit?") yes = Controls.AddButton("YES",1366/3,768/2) no = Controls.AddButton("NO",1366/2,768/2) Controls.ButtonClicked = qop ElseIf Controls.LastClickedButton = credits Then GraphicsWindow.Clear() creditimage = "C:\Users\arnulfo\Pictures\Camera Roll\credits.png" GraphicsWindow.DrawResizedImage(creditimage,0,0,1366,768) GraphicsWindow.DrawText(1366/2.5,768/2.5,"SIR ARLAN SADUESTE") lan = "C:\Users\arnulfo\Downloads\Sir Arlan Batman Chibi Official.jpg" GraphicsWindow.DrawResizedImage(lan,200,300,300,300) nxt22 = Controls.AddButton("NEXT",1366/1.7,768/1.7) Controls.ButtonClicked = nxtc EndIf EndSub Sub nxtc If Controls.LastClickedButton = nxt22 Then GraphicsWindow.Clear() GraphicsWindow.DrawResizedImage(creditimage,0,0,1366,768) GraphicsWindow.DrawText(1366/2.5,768/2.5,"MYSELF, ARRON GAMO") myself = "C:\Users\arnulfo\Pictures\Camera Roll\me myself.png" GraphicsWindow.DrawImage(myself,100,150) hy = Controls.AddButton("BACK",1366/1.7,768/1.7) Controls.ButtonClicked = hyc EndIf EndSub Sub hyc If Controls.LastClickedButton = hy Then menu() EndIf EndSub Sub ctrl2 If Controls.LastClickedButton = bck Then GraphicsWindow.FontName = "Berlin Sans FB" GraphicsWindow.Clear() Menu() ElseIf Controls.LastClickedButton = krn Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "yellow" GraphicsWindow.FontSize = 56 GraphicsWindow.BrushColor = "maroon" GraphicsWindow.DrawText(1366/15,768/3,"위대한 군대 에서 세로운 한국어를 만들것이다.") krb = Controls.AddButton("뒤로",1366/15,768/12) Controls.ButtonClicked = ctnk ElseIf Controls.LastClickedButton = jpn Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "yellow" GraphicsWindow.FontSize = 56 GraphicsWindow.BrushColor = "maroon" GraphicsWindow.DrawText(1366/15,768/3,"私は日本語で大司令官を別バージョンにします。") jpb = Controls.AddButton("バック",1366/15,768/12) Controls.ButtonClicked = ctnj ElseIf Controls.LastClickedButton = thl Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "yellow" GraphicsWindow.FontSize = 46 GraphicsWindow.BrushColor = "maroon" GraphicsWindow.DrawText(1366/15,768/3,"ผมจะสร้างรุ่นที่แยกต่างหากจากผู้บัญชาการทหารที่ดีในไทย") thb = Controls.AddButton("กลับ",1366/15,768/12) Controls.ButtonClicked = ctnt ElseIf Controls.LastClickedButton = phl Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "yellow" GraphicsWindow.FontSize = 40 GraphicsWindow.BrushColor = "maroon" GraphicsWindow.DrawText(1366/15,768/3,"Gagawa ako ng panibagong bersyon ng Ang Hepeng Magaling sa Tagalog.") phb = Controls.AddButton("Bumalik",1366/15,768/12) Controls.ButtonClicked = ctnf EndIf EndSub Sub ctnk If Controls.LastClickedButton = krb Then GraphicsWindow.FontName = "Berlin Sans FB" menu() EndIf EndSub Sub ctnj If Controls.LastClickedButton = jpb Then GraphicsWindow.FontName = "Berlin Sans FB" menu() EndIf EndSub Sub ctnt If Controls.LastClickedButton = thb Then GraphicsWindow.FontName = "Berlin Sans FB" menu() EndIf EndSub Sub ctnf If Controls.LastClickedButton = phb Then GraphicsWindow.FontName = "Berlin Sans FB" menu() EndIf EndSub Sub qop If Controls.LastClickedButton = no Then menu() ElseIf Controls.LastClickedButton = yes Then Program.End() EndIf EndSub Sub avatar If Controls.LastClickedButton = lrs Then GraphicsWindow.Clear() imq = "C:\Users\arnulfo\Documents\tgcoff.png" GraphicsWindow.DrawResizedImage(imq,0,0,1366,768) GraphicsWindow.FontSize = 36 GraphicsWindow.BrushColor = "maroon" GraphicsWindow.DrawText(1366/15,768/12,"A wounded North Korean soldier came to your hospital.") save = Controls.AddButton("SAVE",1366/12,768/3) dsave = Controls.AddButton("LET HIM DIE",1366/3,768/3) Controls.ButtonClicked = sdsave ElseIf Controls.LastClickedButton = mtp Then GraphicsWindow.Clear() nksoldier2 = "C:\Users\arnulfo\Documents\tgc1.png" GraphicsWindow.DrawResizedImage(nksoldier2,0,0,1366,768) GraphicsWindow.FontSize = 36 GraphicsWindow.DrawText(1366/15,768/12,"You saw a North Korean soldier coming.") nks = Controls.AddButton("KILL HIM",1366/12,768/3) lhb = Controls.AddButton("LET HIM BE",1366/3,768/3) Controls.ButtonClicked = nkb ElseIf Controls.LastClickedButton = backs Then menu() EndIf EndSub Sub ctrp If Controls.LastClickedButton = hlb Then menu() EndIf EndSub Sub sdsave If Controls.LastClickedButton = save Then GraphicsWindow.Clear() GraphicsWindow.DrawText(1366/15,768/12,"The soldier reported the advanced technology in your") GraphicsWindow.DrawText(1366/15,768/7,"hospital. They invited you to a press conference.") tnd = Controls.AddButton("ATTEND",1366/3,768/3) dg = Controls.AddButton("DON'T ATTEND",1366/12,768/3) Controls.ButtonClicked = atnd ElseIf Controls.LastClickedButton = dsave Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/3,768/1.7,"~LOVE OTHERS TOO~") qp = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = qpc EndIf EndSub Sub qpc If Controls.LastClickedButton = qp Then menu() EndIf EndSub Sub atnd If Controls.LastClickedButton = tnd Then GraphicsWindow.Clear() GraphicsWindow.DrawText(1366/15,768/12,"You almost got killed because they tried to assassinate") GraphicsWindow.DrawText(1366/15,768/7,"you. Good thing Commander Park also attended.") gwh = Controls.AddButton("GO WITH HIM",1366/12,768/3) dgwh = Controls.AddButton("STAY",1366/3,768/3) Controls.ButtonClicked = cmp ElseIf Controls.LastClickedButton = dg Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/5,768/1.7,"THEY KILLED YOU BECAUSE OF YOUR HIGH PRIDE.") pq = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = pqc EndIf EndSub Sub pqc If Controls.LastClickedButton = pq Then menu() EndIf EndSub Sub cmp If Controls.LastClickedButton = gwh Then GraphicsWindow.Clear() jgk = "C:\Users\arnulfo\Documents\East Korea Map TGC GAMO.png" GraphicsWindow.DrawResizedImage(jgk,0,0,1366,768) GraphicsWindow.DrawText(1366/15,768/12,"You went back with him to East Korea.") GraphicsWindow.DrawText(1366/15,768/7,"He wants to court you.") lhc = Controls.AddButton("BE HIS GIRLFRIEND",1366/12,768/3) dlhc = Controls.AddButton("REJECT HIM",1366/2,768/3) Controls.ButtonClicked = acp ElseIf Controls.LastClickedButton = dgwh Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/3,768/1.7,"THEY KILLED YOU!") lp = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = lpc EndIf EndSub Sub lpc If Controls.LastClickedButton = lp Then menu() EndIf EndSub Sub acp If Controls.LastClickedButton = lhc Then GraphicsWindow.Clear() heart = "C:\Users\arnulfo\Documents\Heart.png" GraphicsWindow.DrawResizedImage(heart,0,0,1366,768) GraphicsWindow.DrawText(1366/15,768/12,"But he needs to leave because the North Koreans invaded East Korea.") dlhg = Controls.AddButton("DON'T LET HIM GO",1366/12,768/3) lhg = Controls.AddButton("LET HIM GO",1366/2,768/3) Controls.ButtonClicked = let ElseIf Controls.LastClickedButton = dlhc Then GraphicsWindow.Clear() jbackground = "C:\Users\arnulfo\Documents\Level 4 BG.png" GraphicsWindow.DrawResizedImage(jbackground,0,0,1366,768) GraphicsWindow.DrawText(1366/15,768/12,"You saw him with another girl, but he's leaving") GraphicsWindow.DrawText(1366/15,768/7,"for another mission.") ksh = Controls.AddButton("RUN AFTER HIM",1366/12,768/3) dgah = Controls.AddButton("NEVERMIND",1366/2,768/3) Controls.ButtonClicked = lc EndIf EndSub Sub let If Controls.LastClickedButton = dlhg Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/25,768/1.7,"THE MILITARY DID NOT HAVE A COMMANDER, EAST KOREANS DIED.") qq = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = qqc ElseIf Controls.LastClickedButton = lhg Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/3,768/1.7,"HE LEFT YOU FOR THE COUNTRY.") q = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = bacq EndIf EndSub Sub qqc If Controls.LastClickedButton = qq Then menu() EndIf EndSub Sub bacq If Controls.LastClickedButton = q Then menu() EndIf EndSub Sub lc If Controls.LastClickedButton = ksh Then GraphicsWindow.Clear() GraphicsWindow.DrawText(1366/15,768/12,"You were able to run after him.") kcc = Controls.AddButton("CONFESS",1366/12,768/3) kss = Controls.AddButton("KISS HIM",1366/3,768/3) Controls.ButtonClicked = khs ElseIf Controls.LastClickedButton = dgah Then GraphicsWindow.Clear() GraphicsWindow.DrawText(1366/15,768/12,"You saw him after the mission and kissed you.") lha = Controls.AddButton("LOVE HIM AGAIN",1366/12,768/3) dlh = Controls.AddButton("NEVER LOVE HIM AGAIN",1366/2,768/3) Controls.ButtonClicked = luv EndIf EndSub Sub luv If Controls.LastClickedButton = dlh Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/3,768/1.7,"YOUR LOVE STORY ENDED") qs = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = qss ElseIf Controls.LastClickedButton = lha Then GraphicsWindow.Clear() hospital = "C:\Users\arnulfo\Documents\Level 3 Background Official.png" GraphicsWindow.DrawResizedImage(hospital,0,0,1366,768) GraphicsWindow.DrawText(1366/15,768/12,"Now, South Koreans got envious.") GraphicsWindow.DrawText(1366/15,768/7,"They attacked East Korea and the last asylum is the national hospital.") gag = Controls.AddButton("GRAB THE GUN AT THE TABLE",1366/12,768/3) sdr = Controls.AddButton("SURRENDER",1366/1.8,768/3) Controls.ButtonClicked = gtg EndIf EndSub Sub qss If Controls.LastClickedButton = qs Then menu() EndIf EndSub Sub khs If Controls.LastClickedButton = kcc Then GraphicsWindow.Clear() hospital = "C:\Users\arnulfo\Documents\Level 3 Background Official.png" GraphicsWindow.DrawResizedImage(hospital,0,0,1366,768) GraphicsWindow.DrawText(1366/15,768/12,"Now, South Koreans got envious.") GraphicsWindow.DrawText(1366/15,768/7,"They attacked East Korea and the last asylum is the national hospital.") gag = Controls.AddButton("GRAB THE GUN AT THE TABLE",1366/12,768/3) sdr = Controls.AddButton("SURRENDER",1366/1.8,768/3) Controls.ButtonClicked = gtg ElseIf Controls.LastClickedButton = kss Then GraphicsWindow.Clear() GraphicsWindow.DrawText(1366/15,768/12,"He told you that he can't love you again.") lhl = Controls.AddButton("LET HIM LEAVE",1366/12,768/3) plh = Controls.AddButton("PULL HIM",1366/3,768/3) Controls.ButtonClicked = leave EndIf EndSub Sub gtg If Controls.LastClickedButton = gag Then GraphicsWindow.Clear() GraphicsWindow.DrawText(1366/15,768/12,"You were shot by a South Korean soldier.") cnf = Controls.AddButton("SAY I LOVE YOU",1366/12,768/3) nva = Controls.AddButton("TELL HIM NOT TO MIND",1366/2,768/3) Controls.ButtonClicked = mnd ElseIf Controls.LastClickedButton = sdr Then GraphicsWindow.Clear() mbg = "C:\Users\arnulfo\Documents\tgc bgrnd new2.png" GraphicsWindow.DrawResizedImage(mbg,0,0,1366,768) GraphicsWindow.DrawText(1366/15,768/12,"Commander Park came to rescue you.") rwh = Controls.AddButton("RUN WITH HIM",1366/12,768/3) stp = Controls.AddButton("STAY WITH THE PEOPLE",1366/2,768/3) Controls.ButtonClicked = choice1 EndIf EndSub Sub mnd If Controls.LastClickedButton = cnf Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/5,768/1.7,"THEY TRIED TO REVIVE YOU BUT YOU DIED.") bck = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = backgo ElseIf Controls.LastClickedButton = nva Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/15,768/1.7,"YOU DIED BECAUSE YOU TOLD HIM NOT TO MIND, SO HE LEFT.") back12 = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = back12c EndIf EndSub Sub back12c If Controls.LastClickedButton = back12 Then menu() EndIf EndSub Sub leave If Controls.LastClickedButton = lhl Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" bck = Controls.AddButton("BACK",1366/15,768/12) GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/5,768/1.7,"YOUR FAIRYTALE JUST ENDED.") Controls.ButtonClicked = backgo ElseIf Controls.LastClickedButton = plh Then GraphicsWindow.Clear() flg22 = "C:\Users\arnulfo\Documents\eung.png" GraphicsWindow.DrawResizedImage(flg22,0,0,1366,768) GraphicsWindow.DrawText(1366/15,768/12,"He kissed you and you went to South Korea together with") GraphicsWindow.DrawText(1366/15,768/7,"your medical team secretly. The government sent you. But there,") GraphicsWindow.DrawText(1366/15,768/5,"he was shot by the South Korean military.") emr = Controls.AddButton("RUN HIM TO THE EMERGENCY ROOM",1366/12,768/2.4) cry = Controls.AddButton("CRY AND CRY",1366/12,768/3) Controls.ButtonClicked = skk EndIf EndSub Sub backgo If Controls.LastClickedButton = bck Then menu() EndIf EndSub Sub choice1 If Controls.LastClickedButton = rwh Then GraphicsWindow.Clear() jeguk1 = "C:\Users\arnulfo\Documents\Level 2 Official.png" GraphicsWindow.DrawResizedImage(jeguk1,0,0,1366,768) GraphicsWindow.DrawText(1366/15,768/12,"The bestfriend of Commander Park, Richard Joo, died.") lh = Controls.AddButton("LET HIM LEAVE",1366/12,768/3) gwh2 = Controls.AddButton("GO WITH HIM",1366/2,768/3) Controls.ButtonClicked = cpark ElseIf Controls.LastClickedButton = stp Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/15,768/1.7,"DIED WITH YOUR PEOPLE ~ YOU'RE A HERO.") bck101 = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = bck101c EndIf EndSub Sub bck101c If Controls.LastClickedButton = bck101 Then menu() EndIf EndSub Sub cpark If Controls.LastClickedButton = lh Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/5,768/1.7,"YOU WERE KILLED BY NORTH KOREANS WHO SAW YOU.") bck = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = backgo2 ElseIf Controls.LastClickedButton = gwh2 Then GraphicsWindow.Clear() nkk = "C:\Users\arnulfo\Downloads\north korea.png" GraphicsWindow.DrawResizedImage(nkk,0,0,1366,768) GraphicsWindow.DrawText(1366/15,768/12,"On your way to Hanji, you met Ronald Choi - North Korea's dictator.") kh = Controls.AddButton("KILL HIM",1366/12,768/3) dkh = Controls.AddButton("SURRENDER",1366/3,768/3) Controls.ButtonClicked = rchoi EndIf EndSub Sub backgo2 If Controls.LastClickedButton = bck Then menu() EndIf EndSub Sub rchoi If Controls.LastClickedButton = kh Then GraphicsWindow.Clear() flag = "C:\Users\arnulfo\Documents\flag.png" GraphicsWindow.DrawResizedImage(flag,0,0,1366,768) GraphicsWindow.DrawText(1366/15,768/12,"Yes! You are now finish with North Korea.") GraphicsWindow.DrawText(1366/15,768/7,"THE ONLY ONE LEFT IS SOUTH KOREA.") pcd = Controls.AddButton("PROCEED TO SOUTH KOREA?",1366/12,768/2.4) sth2 = Controls.AddButton("STAY HERE",1366/2,768/2.4) Controls.ButtonClicked = pcdh ElseIf Controls.LastClickedButton = dkh Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/15,768/1.7,"THEY KILLED YOU AND EAST KOREANS NEVER EXPERIENCED PEACE.") b = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = bcon EndIf EndSub Sub pcdh If Controls.LastClickedButton = pcd Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "Plum" GraphicsWindow.DrawText(1366/15,768/12,"When you arrived, you saw Yoo Miriam - SK President") srdr = Controls.AddButton("SURRENDER",1366/12,768/3) khr22 = Controls.AddButton("KILL HER",1366/3,768/3) Controls.ButtonClicked = khrs ElseIf Controls.LastClickedButton = sth2 Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/15,768/1.7,"SOUTH KOREAN IMMIGRANTS SAW AND KILLED YOU.") bbc = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = bbcc EndIf EndSub Sub bbcc If Controls.LastClickedButton = bbc Then menu() EndIf EndSub Sub khrs If Controls.LastClickedButton = khr22 Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "pink" GraphicsWindow.DrawText(1366/15,768/12,"Now, peace has been obtained in East Korea.") GraphicsWindow.DrawText(1366/15,768/7,"How do you want to end the story?") ksshc = Controls.AddButton("KISS HIM",1366/12,768/3) hgghc = Controls.AddButton("HUG HIM",1366/3,768/3) gbtjc = Controls.AddButton("GO BACK TO EAST KOREA",1366/12,768/2) Controls.ButtonClicked = jjc ElseIf Controls.LastClickedButton = srdr Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/15,768/1.7,"SHE ORDERED THE SOLDIERS TO KILL YOU AND PARK.") sdback = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = sdbackc EndIf EndSub Sub sdbackc If Controls.LastClickedButton = sdback Then menu() EndIf EndSub Sub jjc If Controls.LastClickedButton = ksshc Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "PaleGoldenrod" GraphicsWindow.DrawText(1366/2.5,768/12,"Where?") shpwc = Controls.AddButton("SHIPWRECK",1366/12,768/3) bnchc = Controls.AddButton("SITTING ON THE BENCH",1366/2,768/3) seac = Controls.AddButton("ON THE ROAD",1366/12,768/2) Controls.ButtonClicked = dmc ElseIf Controls.LastClickedButton = hgghc Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "SpringGreen" Sound.Play("C:\Users\arnulfo\Music\CHEN (EXO), Punch - Everytime.mp3") GraphicsWindow.DrawText(1366/15,768/12,"They reunited and hugged each other tightly. And") GraphicsWindow.DrawText(1366/15,768/7,"they lived happily ever after.") GraphicsWindow.DrawText(1366/2.5,768/2.5,"Thanks for playing!") ElseIf Controls.LastClickedButton = gbtjc Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "LightCoral" Sound.Play("C:\Users\arnulfo\Music\CHEN (EXO), Punch - Everytime.mp3") GraphicsWindow.DrawText(1366/15,768/12,"They went back to East Korea and lived happily ever after.") GraphicsWindow.DrawText(1366/2.5,768/2.5,"Thanks for playing!") EndIf EndSub Sub dmc If Controls.LastClickedButton = shpwc Then GraphicsWindow.Clear() Sound.Play("C:\Users\arnulfo\Music\CHEN (EXO), Punch - Everytime.mp3") zktc = "C:\Users\arnulfo\Downloads\sw.jpg" GraphicsWindow.DrawResizedImage(zktc,0,0,1366,768) GraphicsWindow.BrushColor = "Orange" GraphicsWindow.DrawText(1366/15,768/12,"They kissed at the shipwreck and lived happily ever after.") GraphicsWindow.DrawText(1366/2.5,768/2.5,"Kamsahamnida for playing!") ElseIf Controls.LastClickedButton = bnchc Then GraphicsWindow.Clear() Sound.Play("C:\Users\arnulfo\Music\CHEN (EXO), Punch - Everytime.mp3") GraphicsWindow.BackgroundColor = "Moccasin" GraphicsWindow.DrawText(1366/15,768/2,"They kissed, sitting on the bench and lived happily ever after.") GraphicsWindow.DrawText(1366/4,768/2.5,"Gomawoyo for playing") ElseIf Controls.LastClickedButton = seac Then GraphicsWindow.Clear() Sound.Play("C:\Users\arnulfo\Music\CHEN (EXO), Punch - Everytime.mp3") road2 = "C:\Users\arnulfo\Documents\road.png" GraphicsWindow.DrawResizedImage(road2,0,0,1366,768) GraphicsWindow.BackgroundColor = "Moccasin" GraphicsWindow.DrawText(1366/15,768/12,"They kissed on the middle of the road and lived happily ever after.") GraphicsWindow.DrawText(1366/5,768/2.5,"Kamsahamnida for playing!") EndIf EndSub Sub bcon If Controls.LastClickedButton = b Then menu() EndIf EndSub Sub skk If Controls.LastClickedButton = emr Then GraphicsWindow.Clear() imsk = "C:\Users\arnulfo\Downloads\south korea.png" GraphicsWindow.DrawResizedImage(imsk,0,0,1366,768) GraphicsWindow.DrawText(1366/15,768/12,"You saw Miriam Yoo - President of South Korea - in that hospital.") GraphicsWindow.DrawText(1366/15,768/7,"You have a gun hidden under Commander's pillow.") ed = Controls.AddButton("KILL HER",1366/12,768/2.4) ued = Controls.AddButton("SURRENDER",1366/3,768/2.4) Controls.ButtonClicked = edu ElseIf Controls.LastClickedButton = cry Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/15,768/1.7,"YOU DID NOTHING BUT CRY~ SO HE DIED.") backoh = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = backohc EndIf EndSub Sub backohc If Controls.LastClickedButton = backoh Then menu() EndIf EndSub edu() Sub edu If Controls.LastClickedButton = ed Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "pink" GraphicsWindow.DrawText(1366/15,768/12,"Now, peace has been obtained in East Korea.") GraphicsWindow.DrawText(1366/15,768/7,"How do you want to end the story?") kssh = Controls.AddButton("KISS HIM",1366/12,768/3) hggh = Controls.AddButton("HUG HIM",1366/3,768/3) gbtj = Controls.AddButton("GO BACK TO EAST KOREA",1366/12,768/2) Controls.ButtonClicked = jj ElseIf Controls.LastClickedButton = ued Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/15,768/1.7,"THEY KILLED YOU WITHOUT ANY EAST KOREAN KNOWING.") backls = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = backlsc EndIf EndSub Sub backlsc If Controls.LastClickedButton = backls Then menu() EndIf EndSub Sub jj If Controls.LastClickedButton = kssh Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "PaleGoldenrod" GraphicsWindow.DrawText(1366/2.5,768/12,"Where?") shpw = Controls.AddButton("SHIPWRECK",1366/12,768/3) bnch = Controls.AddButton("SITTING ON THE BENCH",1366/2,768/3) sea = Controls.AddButton("ON THE ROAD",1366/12,768/2) Controls.ButtonClicked = dm ElseIf Controls.LastClickedButton = hggh Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "SpringGreen" Sound.Play("C:\Users\arnulfo\Music\CHEN (EXO), Punch - Everytime.mp3") GraphicsWindow.DrawText(1366/15,768/12,"They reunited and hugged each other tightly. And") GraphicsWindow.DrawText(1366/15,768/7,"they lived happily ever after.") GraphicsWindow.DrawText(1366/2.5,768/2.5,"Thanks for playing!") ElseIf Controls.LastClickedButton = gbtj Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "LightCoral" Sound.Play("C:\Users\arnulfo\Music\CHEN (EXO), Punch - Everytime.mp3") GraphicsWindow.DrawText(1366/15,768/12,"They went back to East Korea and lived happily ever after.") GraphicsWindow.DrawText(1366/2.5,768/2.5,"Thanks for playing!") EndIf EndSub Sub dm If Controls.LastClickedButton = shpw Then GraphicsWindow.Clear() Sound.Play("C:\Users\arnulfo\Music\CHEN (EXO), Punch - Everytime.mp3") zkt = "C:\Users\arnulfo\Downloads\sw.jpg" GraphicsWindow.DrawResizedImage(zkt,0,0,1366,768) GraphicsWindow.BrushColor = "Orange" GraphicsWindow.DrawText(1366/15,768/12,"They kissed at the shipwreck and lived happily ever after.") GraphicsWindow.DrawText(1366/2.5,768/2.5,"Kamsahamnida for playing!") ElseIf Controls.LastClickedButton = bnch Then GraphicsWindow.Clear() Sound.Play("C:\Users\arnulfo\Music\CHEN (EXO), Punch - Everytime.mp3") GraphicsWindow.BackgroundColor = "green" GraphicsWindow.DrawText(1366/15,768/12,"They kissed at the bench by the Han River.") GraphicsWindow.DrawText(1366/15,768/7,"They lived happily ever after.") GraphicsWindow.DrawText(1366/2.5,768/2.5,"Gomawo for playing<3") ElseIf Controls.LastClickedButton = sea Then GraphicsWindow.Clear() Sound.Play("C:\Users\arnulfo\Music\CHEN (EXO), Punch - Everytime.mp3") GraphicsWindow.DrawText(1366/15,768/12,"They kissed at the coast of Japan Sea") GraphicsWindow.DrawText(1366/15,768/7,"and they lived happily ever after.") GraphicsWindow.DrawText(1366/2.5,768/2.5,"gomabseumnida for playing") EndIf EndSub GraphicsWindow.BrushColor = "maroon" Sub nkb If Controls.LastClickedButton = nks Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/15,768/1.7,"YOU HAVE BEEN KILLED BY THE NK GOVERNMENT.") bbck = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = bbckc ElseIf Controls.LastClickedButton = lhb Then GraphicsWindow.Clear() nk = "C:\Users\arnulfo\Downloads\nk.jpg" GraphicsWindow.DrawResizedImage(nk,0,0,1366,768) GraphicsWindow.DrawText(1366/15,768/12,"East Korea sent you to North Korea for a conference.") att = Controls.AddButton("ATTEND",1366/12,768/3) datt = Controls.AddButton("DON'T ATTEND",1366/3,768/3) Controls.ButtonClicked = attc EndIf EndSub Sub bbckc If Controls.LastClickedButton = bbck Then menu() EndIf EndSub Sub attc If Controls.LastClickedButton = att Then GraphicsWindow.Clear() GraphicsWindow.DrawText(1366/15,768/12,"There in NK, you saw Dr. Lorraine Seo") GraphicsWindow.DrawText(1366/15,768/7,"- the most respected doctor in East Korea.") GraphicsWindow.DrawText(1366/15,768/5,"Meanwhile, someone wants to shoot her.") stay = Controls.AddButton("LET HER STAY",1366/3,768/3) sher = Controls.AddButton("SAVE HER",1366/12,768/3) Controls.ButtonClicked = ster ElseIf Controls.LastClickedButton = datt Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/15,768/1.7,"YOU WERE PUNISHED BY THE GOVERNMENT.") bbcch = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = bbcchc EndIf EndSub Sub bbcchc If Controls.LastClickedButton = bbcch Then menu() EndIf EndSub Sub ster If Controls.LastClickedButton = stay Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/5,768/1.7,"YOUR 'LOVE STORY TO BE' ENDED.") bhcbhc = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = bhcbhcc ElseIf Controls.LastClickedButton = sher Then GraphicsWindow.Clear() hbb = "C:\Users\arnulfo\Documents\hbb.png" GraphicsWindow.DrawResizedImage(hbb,0,0,1366,768) GraphicsWindow.DrawText(1366/15,768/12,"Now, your love story started.") lg = Controls.AddButton("COURT HER",1366/12,768/3) dlg = Controls.AddButton("DON'T COURT HER",1366/3,768/3) Controls.ButtonClicked = lgc EndIf EndSub Sub bhcbhcc If Controls.LastClickedButton = bhcbhc Then menu() EndIf EndSub Sub lgc If Controls.LastClickedButton = lg Then GraphicsWindow.Clear() dots = "C:\Users\arnulfo\Downloads\dots.jpg" GraphicsWindow.DrawResizedImage(dots,0,0,1366,768) GraphicsWindow.DrawText(1366/15,768/12,"Many people were shot by the rebel South Koreans.") GraphicsWindow.DrawText(1366/15,768/7,"Dr.Lorraine needs to leave.") lhrl2 = Controls.AddButton("LET HER LEAVE",1366/12,768/3) lhll2 = Controls.AddButton("DO NOT LET HER",1366/2,768/3) Controls.ButtonClicked = llh ElseIf Controls.LastClickedButton = dlg Then GraphicsWindow.Clear() hb = "C:\Users\arnulfo\Downloads\hb.png" GraphicsWindow.DrawResizedImage(hb,0,0,1366,768) GraphicsWindow.DrawText(1366/15,768/12,"She needed to go to a mission but") GraphicsWindow.DrawText(1366/15,768/7,"she saw you with another girl.") rah = Controls.AddButton("RUN AFTER HER",1366/12,768/3) nvm22 = Controls.AddButton("NEVERMIND",1366/3,768/3) Controls.ButtonClicked = rahm EndIf EndSub Sub rahm If Controls.LastClickedButton = rah Then GraphicsWindow.Clear() gdr = "C:\Users\arnulfo\Documents\Level 4 BG.png" GraphicsWindow.DrawResizedImage(gdr,0,0,1366,768) GraphicsWindow.DrawText(1366/15,768/12,"Now, you pulled her. What do you want to do after?") ksh222 = Controls.AddButton("KISS HER",1366/12,768/3) lhrl = Controls.AddButton("LET HER LEAVE",1366/3,768/3) Controls.ButtonClicked = krl ElseIf Controls.LastClickedButton = nvm22 Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/15,768/1.7,"YOUR FAIRYTALE ENDED :(") bmpc = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = bmpcc EndIf EndSub Sub bmpcc If Controls.LastClickedButton = bmpc Then menu() EndIf EndSub Sub krl If Controls.LastClickedButton = ksh222 Then GraphicsWindow.Clear() jgk22 = "C:\Users\arnulfo\Documents\Level 2 Official.png" GraphicsWindow.DrawResizedImage(jgk22,0,0,1366,768) GraphicsWindow.DrawText(1366/15,768/12,"Your dearest colleague, Richard Joo, died.") gtyng = Controls.AddButton("GO TO YANGJU WITH HER",1366/12,768/3) gtync = Controls.AddButton("LEAVE HER AT JEGUK(EAST KOREAN CAPITAL)",1366/12,768/2) Controls.ButtonClicked = gtyc ElseIf Controls.LastClickedButton = lhrl Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/4,768/1.7,"YOUR LOVE STORY ENDED :(") bbb = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = bbbc EndIf EndSub Sub bbbc If Controls.LastClickedButton = bbb Then menu() EndIf EndSub Sub llh If Controls.LastClickedButton = lhrl2 Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/7,768/1.7,"SHE NEVER FELL IN LOVE WITH YOU AGAIN.") backbac = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = backbacc ElseIf Controls.LastClickedButton = lhll2 Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/15,768/1.7,"EAST KOREA HAD LESS MANPOWER = COLONIZATION") backback = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = backbackc EndIf EndSub Sub backbacc If Controls.LastClickedButton = backbac Then menu() EndIf EndSub Sub backbackc If Controls.LastClickedButton = backback Then menu() EndIf EndSub Sub gtyc If Controls.LastClickedButton = gtyng Then GraphicsWindow.Clear() yangju = "C:\Users\arnulfo\Documents\yangju.png" GraphicsWindow.DrawResizedImage(yangju,0,0,1366,768) GraphicsWindow.DrawText(1366/15,768/12,"On your way to Yangju, someone tried to shoot her -") GraphicsWindow.DrawText(1366/15,768/7,"turns out they were the NK and the SK DICTATORS - JOINED FORCES") shn = Controls.AddButton("SAVE HER AND SHOOT THE ENEMY",1366/12,768/3) lvh = Controls.AddButton("LET HER AVOID IT HERSELF",1366/12,768/2) Controls.ButtonClicked = shh ElseIf Controls.LastClickedButton = gtync Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/15,768/1.7,"YOU LEFT HER - ENEMIES KILLED HER :(") kcb = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = kcbc EndIf EndSub Sub kcbc If Controls.LastClickedButton = kcb Then menu() EndIf EndSub Sub shh If Controls.LastClickedButton = shn Then GraphicsWindow.Clear() road = "C:\Users\arnulfo\Documents\road.png" GraphicsWindow.DrawResizedImage(road,0,0,1366,768) GraphicsWindow.DrawText(1366/30,768/12,"You almost killed everyone and kissed her but one soldier was able to shoot her.") egs = Controls.AddButton("INJECT MEDICINE AND USE EMERGENCY OXYGEN SUPPLY",1366/12,768/3) egs2 = Controls.AddButton("BRING HER TO THE NEAREST HOSPITAL",1366/12,768/2) Controls.ButtonClicked = egsc ElseIf Controls.LastClickedButton = lvh Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/4,768/1.7,"SHE WAS KILLED") EndIf EndSub Sub egsc If Controls.LastClickedButton = egs Then GraphicsWindow.Clear() hpt = "C:\Users\arnulfo\Documents\Level 3 Background Official.png" GraphicsWindow.DrawResizedImage(hpt,0,0,1366,768) GraphicsWindow.DrawText(1366/15,768/12,"She survived but someone with a knife is going to her room.") mts = Controls.AddButton("RUN TO HER ROOM AND TELL HER NOT TO WORRY",1366/12,768/3) mts2 = Controls.AddButton("RUN TO THE POLICE TASK FORCE DOWNSTAIRS",1366/12,768/2) Controls.ButtonClicked = mtsc ElseIf Controls.LastClickedButton = egs2 Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "black" GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/15,768/1.7,"SHE DIED BECAUSE OF SEVERE ORGAN DAMAGE") bccc = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = bcb EndIf EndSub Sub bcb If Controls.LastClickedButton = bccc Then menu() EndIf EndSub Sub mtsc If Controls.LastClickedButton = mts Then GraphicsWindow.Clear() GraphicsWindow.DrawText(1366/15,768/12,"You were able to protect her. Do you want to kiss her?") yes1 = Controls.AddButton("YES",1366/12,768/3) no1 = Controls.AddButton("NO",1366/2,768/3) Controls.ButtonClicked = agrc ElseIf Controls.LastClickedButton = mts2 Then GraphicsWindow.Clear() GraphicsWindow.DrawText(1366/2.5,768/2.5,"GAME OVER") GraphicsWindow.DrawText(1366/15,768/1.7,"YOU CAME LATE ~ SHE'S DEAD NOW.") fcb = Controls.AddButton("BACK",1366/15,768/12) Controls.ButtonClicked = fcbc EndIf EndSub Sub fcbc If Controls.LastClickedButton = fcb Then menu() EndIf EndSub Sub agrc If Controls.LastClickedButton = yes1 Then GraphicsWindow.Clear() Sound.Play("C:\Users\arnulfo\Downloads\K.Will - 말해! 뭐해- (Talk Love).mp3") GraphicsWindow.BackgroundColor = "PapayaWhip" GraphicsWindow.DrawText(1366/15,768/12,"They kissed and liv--- oopss...") GraphicsWindow.DrawText(1366/15,768/7,"Everything was just a part of a scary, beautiful nightmare. :)") GraphicsWindow.DrawText(1366/7,768/2.5,"GOMAWO FOR PLAYING :) <3") ElseIf Controls.LastClickedButton = no1 Then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "Moccasin" GraphicsWindow.DrawText(1366/15,768/12,"How would you end the story?") khh = Controls.AddButton("KISS HER AT THE PARK WHEN CHERRY BLOSSOMS FALL",1366/12,768/3) khh2 = Controls.AddButton("KISS HER FOREHEAD AT THE MIDDLE OF JEGUK(EAST KOREA'S CAPITAL)INTERSECTION"1366/12,768/2) Controls.ButtonClicked = khhc EndIf EndSub Sub khhc If Controls.LastClickedButton = khh Then GraphicsWindow.Clear() Sound.Play("C:\Users\arnulfo\Downloads\K.Will - 말해! 뭐해- (Talk Love).mp3") cb = "C:\Users\arnulfo\Downloads\cb.jpg" GraphicsWindow.DrawResizedImage(cb,0,0,1366,768) GraphicsWindow.DrawText(1366/15,768/12,"You kissed her and your love story never came to an end.") GraphicsWindow.DrawText(1366/4,768/2.5,"Kamsa for playing :)") ElseIf Controls.LastClickedButton = khh2 Then GraphicsWindow.Clear() Sound.Play("C:\Users\arnulfo\Downloads\K.Will - 말해! 뭐해- (Talk Love).mp3") gi = "C:\Users\arnulfo\Downloads\gi.jpg" GraphicsWindow.DrawResizedImage(gi,0,0,1366,768) GraphicsWindow.DrawText(1366/15,768/12,"You kissed her at the intersection and you lived happily ever after.") GraphicsWindow.DrawText(1366/3,768/2.5,"KAMSA for playing<3") EndIf EndSub End>LNW806.sb< Start>LNW961.sb< GraphicsWindow.Width =800 GraphicsWindow.Height=800 for x=0 To 800 Step 6 For y=0 To 800 Step 6 cc=ldmath.sin(x*2)/2+ldmath.sin(y*2)/2 GraphicsWindow.BrushColor=LDColours.HSLtoRGB (x*y/640,1,cc) GraphicsWindow.FillEllipse(x y 8 8) EndFor endfor Sub cll 'grayscale only ch=ldmath.Decimal2Base (256+cc,16) cc=text.GetSubTextToEnd (ch,2) cf="# cf=text.Append (cf,cc) cf=text.Append (cf,cc) cf=text.Append (cf,cc) EndSub End>LNW961.sb< Start>LNX632.sb< ' SmallBasic Version 1.2 ' Program: gcd (Recursion), lcm / ggT, kgV ' Changelog: ' Author: Pappa Lapub ' Website: https://social.msdn.microsoft.com/Forums/en-US/b9ab0f8c-469e-41f5-85d4-f6bd070cdefc/challenge-of-the-month-december-2015 ' ImportURL: http://smallbasic.com/program/? ' Extension: LitDev ' Comment: Write a program to find the GCF (Greatest Common Factor) of two numbers ' http://rosettacode.org/wiki/Greatest_common_divisor#C.23 ' http://rosettacode.org/wiki/Least_common_multiple#C.23 ' http://rosettacode.org/wiki/Prime_decomposition#C.23 ' ================================================================================ args = "" TextWindow.Write("Give me a 'A' (eg: 2310) : ") a = TextWindow.ReadNumber() TextWindow.Write("Give me a 'B' (!0, eg: 2592) : ") b = TextWindow.ReadNumber() TextWindow.WriteLine(" --> gcd for ("+ a +";"+ b +") = "+ LDCall.Function2("gcdCalc", a,b)) return = "" TextWindow.WriteLine(" --> lcm for ("+ a +";"+ b +") = "+ LDCall.Function2("lcmCalc", a,b)) return = "" TextWindow.WriteLine("") ' ggT Sub gcdCalc ' b <> 0 If args[2] = 0 Then ' to exclude 0 return = args[1] ' to exclude 0 Else ' to exclude 0 'tmp = Math.Remainder(args[1], args[2]) ' Variant1 'return = LDCall.Function2("gcdCalc", args[2], tmp) ' Variant1 , or .. return = LDCall.Function2("gcdCalc", args[2], Math.Remainder(args[1], args[2])) ' Variant2 EndIf ' to exclude 0 EndSub ' kgV Sub lcmCalc ' a,b <> 0 return = args[1] * args[2] / LDCall.Function2("gcdCalc", args[1], args[2]) EndSub End>LNX632.sb< Start>LNZ153.sb< 'daniel garcia 'big project start: points=0 TextWindow.ForegroundColor= " white " TextWindow.WriteLine("You are trapped in a house and locked inside you need to get out") TextWindow.WriteLine("") TextWindow.WriteLine("You look around and find out you are in a bedroom and you ") TextWindow.WriteLine("see a window to your left, a door to your right,") TextWindow.WriteLine("a bed under you, a cupboard, a filing cabinet, and a dresser with things on top") TextWindow.WriteLine("do you want to look under the bed (y/n)") answer1= TextWindow.Read() If answer1= "y" Then Goto bed1 ElseIf answer1= "n" then Goto bed2 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto start EndIf section1: TextWindow.WriteLine("do you check inside the cupboard (y/n)") answer2= TextWindow.Read() If answer2= "y"Then Goto cupboard1 ElseIf answer2="n" then Goto cupboard2 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section1 EndIf section2: TextWindow.WriteLine("do you want to check the window(y/n)") answer3= TextWindow.Read() If answer3= "y"Then Goto window1 ElseIf answer3="n" then Goto window2 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section2 EndIf section3: TextWindow.WriteLine("do you want to check the cabinet(y/n)") answer4= TextWindow.Read() If answer4= "y"Then Goto cabinet1 ElseIf answer4="n" then Goto cabinet2 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section3 EndIf section4: TextWindow.WriteLine("do you want to check and see whats on the dresser(y/n)") answer5= TextWindow.Read() If answer5= "y"Then Goto dresser1 ElseIf answer5="n" then Goto dresser2 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section4 EndIf section5: TextWindow.WriteLine("do you want to check the door(y/n)") answer6= TextWindow.Read() If answer6= "y"Then Goto door1 ElseIf answer6="n" then Goto door2 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section5 EndIf section6: TextWindow.WriteLine("as you step out of the bedroom you see a bathroom") TextWindow.WriteLine(" a kitchen, a closet, the furnace, and a set of stairs") TextWindow.WriteLine("do you want to go to the restroom (y/n)") answer7= TextWindow.Read() If answer7= "y" Then Goto bathroom1 ElseIf answer7= "n" then Goto bathroom2 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section6 EndIf section7: TextWindow.WriteLine("do you want to go into the closet (y/n)") answer8= TextWindow.Read() If answer8= "y" Then Goto closet1 ElseIf answer8= "n" then Goto closet2 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section7 EndIf section8: TextWindow.WriteLine("do you want to examine the furnace (y/n)") answer9= TextWindow.Read() If answer9= "y" Then Goto furnace1 ElseIf answer9= "n" then Goto furnace2 EndIf section9: TextWindow.WriteLine("do you want to go up the stairs (y/n)") answer10= TextWindow.Read() If answer10= "y" Then Goto stairs1 ElseIf answer10= "n" then Goto stairs2 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section9 EndIf section10: TextWindow.WriteLine("as you reach the top of the stairs you notice") TextWindow.WriteLine("a couch and tv, the master bedroom, a second bedroom") TextWindow.WriteLine("counters with drawers and a fake plant") TextWindow.WriteLine(" ") TextWindow.WriteLine("do you want to watch tv (y/n)") answer11= TextWindow.Read() If answer11= "y" then Goto tv1 elseif answer11= "n" then Goto tv2 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section10 EndIf section11: TextWindow.WriteLine("do you want to try the guest bedroom (y/n)") answer12= TextWindow.Read() If answer12= "y" then Goto bedroom1 elseif answer12= "n" then Goto bedroom2 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section11 endif section12: TextWindow.WriteLine("do you want to search the plant (y/n)") answer13= TextWindow.Read() If answer13= "y" Then Goto plant1 ElseIf answer13= "n" then Goto plant2 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section12 EndIf section13: TextWindow.WriteLine("do you want to search the drawers in the counter (y/n)") answer14= TextWindow.Read() If answer14= "y" Then Goto drawers1 ElseIf answer14= "n" then Goto drawers2 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section13 EndIf section14: TextWindow.WriteLine("do you want to try the key in the master bedroom door (y/n)") answer15= TextWindow.Read() If answer15= "y" Then Goto master1 ElseIf answer15= "n" then Goto master2 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section14 EndIf section15: TextWindow.WriteLine("when you wlk into the master bedroom you notice a dresser, another plant, a closet,") TextWindow.WriteLine(" a bed, and a window") dresser: TextWindow.WriteLine("do you search the dresser first (y/n)") answer16= TextWindow.Read() If answer16= "y" Then Goto dresser3 ElseIf answer16= "n" then Goto dresser4 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto dresser endif section16: TextWindow.WriteLine("now do you want to try to open the window(y/n)") answer17= TextWindow.Read() If answer17= "y" Then Goto window3 ElseIf answer17= "n" then TextWindow.WriteLine("you may as well try, what do you have to lose") Goto window3 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section16 EndIf section17: TextWindow.WriteLine("do you want to take a nap in the bed (y/n)") answer18= TextWindow.Read() If answer18= "y" Then Goto bed3 ElseIf answer18= "n" then Goto bed4 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section17 EndIf section18: TextWindow.WriteLine("do you search this plant or leave it alone like the last one (y/n)") answer19= TextWindow.Read() If answer19= "y" Then Goto plant3 ElseIf answer19= "n" then Goto plant4 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section18 EndIf section19: TextWindow.WriteLine("do you wish to check the closet (y/n)") answer20= TextWindow.Read() If answer20= "y" Then Goto closet3 ElseIf answer20= "n"then Goto closet4 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section19 EndIf section20: TextWindow.WriteLine("you are now in a secret story of the building") TextWindow.WriteLine("do you want to explore a little and see what you can find (y/n)") answer21= TextWindow.Read() If answer21= "y" Then Goto stuff ElseIf answer21= "n" then TextWindow.WriteLine("you really are trying to get yourself killed") TextWindow.WriteLine("try that again") Program.Delay(2000) Goto section20 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section20 EndIf section21: TextWindow.WriteLine("in the room you find $30000, a baseball bat, and a note") option1: TextWindow.WriteLine("do you take the $30000(y/n)") answer22= TextWindow.Read() If answer22= "y" Then Goto money1 ElseIf answer22= "n" then Goto money2 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto option1 EndIf section22: TextWindow.WriteLine("do you take the baseball bat(y/n)") answer23= TextWindow.Read() If answer23= "y" Then Goto bat1 ElseIf answer23= "n" then Goto bat2 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section22 EndIf section23: TextWindow.WriteLine("do you take and read the note(y/n)") answer24= TextWindow.Read() If answer24= "y" then Goto note1 ElseIf answer24= "n" then Goto note2 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section23 EndIf section24: TextWindow.WriteLine("do you take the notes advice and ") TextWindow.WriteLine("try to get out through the window(y/n)") answer25= TextWindow.Read() If answer25= "y" Then TextWindow.WriteLine("ok lets go for it") read: TextWindow.WriteLine("do you remember what the note said (y/n)") answer26=TextWindow.Read() If answer26= "y" Then TextWindow.WriteLine("you head off toward the hole in the closet ceiling") Goto ceiling1 ElseIf answer26= "n" then TextWindow.WriteLine("there is only one way out of this place and that is a simple path to take") TextWindow.WriteLine("first you must go back through the hole in the closet ceiling") TextWindow.WriteLine("then you use the key from the drawers to unlock to closet door") TextWindow.WriteLine("then you must go back downstairs to the main lvl and search in the plants soil") TextWindow.WriteLine("in the soil you will find a cell phone and you must call 616-745-1414 to unlock the window in the bedroom on the main floor") TextWindow.WriteLine("then you leave through the window") TextWindow.WriteLine("") TextWindow.WriteLine("now do you remember(y/n)") Goto read ElseIf answer25= "n" then TextWindow.WriteLine("well you can walk aimlesly for a while but im out of here") Program.Delay(5000) Program.End() Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto read EndIf Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto read EndIf section25: TextWindow.WriteLine("you are now back in the closet of the master bedroom.") TextWindow.WriteLine("do you want to use the key to unlock the door (y/n)") answer27=textwindow.Read() If answer27= "y" Then Goto unlock ElseIf answer27= "n" then TextWindow.WriteLine("the note said to use the key, try again") Goto section25 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section25 EndIf section26: TextWindow.WriteLine("now do you want to leave the master bedroom(y/n)") answer28= TextWindow.Read() If answer28= "y" then Goto upstairs elseif answer28= "n" then TextWindow.WriteLine("why dont you try again") Goto section26 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section26 EndIf section27: TextWindow.WriteLine("you are now downstairs do you want to go to the bedroom(y/n)") answer29= TextWindow.read() If answer29= "y" then TextWindow.WriteLine("you dont go into the bedroom yet read the note carefully") Goto section28 elseif answer29= "n" then TextWindow.WriteLine("good you dont go into the bedroom yet because you havent called the number") Goto section28 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section27 EndIf section28: TextWindow.WriteLine("do you want to search the plants soil (y/n)") answer30=textwindow.Read() If answer30= "y" then TextWindow.WriteLine("you walk over to the plant and start digging in the soil") Program.Delay(3000) TextWindow.WriteLine("you eventually find the phone but it has a combonation lock") Goto lock1 phone: TextWindow.WriteLine("while the phone is still ringing there is a loud crack sound from inside the bedroom") TextWindow.WriteLine("do you want to go investigate (y/n)") answer31=textwindow.Read() ElseIf answer30= "n" then TextWindow.WriteLine(" you need to get the cell phone out to unlock the window") TextWindow.WriteLine("try again") Goto section28 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto section28 EndIf If answer31= "y" then Goto bedroom elseif answer31= "n" then program.Delay(3000) TextWindow.WriteLine("you hear another click and the phone suddenly dies") TextWindow.WriteLine("you then realize that the first click sound was the window unlocking") TextWindow.WriteLine("and that the second click was the window relocking") Program.Delay(5000) TextWindow.WriteLine("the game is now over you lost at the very end") Program.Delay(3000) Program.End() Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto phone endif bed1: TextWindow.WriteLine(" you look under the bed and find nothing") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 goto section1 bed2: TextWindow.WriteLine("smart choice considering how nothing was under there to begin with") TextWindow.WriteLine("you have made a good decision") points=points+50 Goto section1 cupboard1: TextWindow.WriteLine("you check inside the cupboard and find that it is filled with food") TextWindow.WriteLine("do you eat some(y/n)") point01= TextWindow.Read() If point01= "y" Then TextWindow.WriteLine(" as you eat the food you realize it tastes funny and that it may be poisend") Program.Delay(3000) TextWindow.WriteLine(" it is and you die. game over") Program.Delay(3000) Program.End() ElseIf point01= "n" then TextWindow.WriteLine("smart move that food could have been poisend") TextWindow.WriteLine("you have made a good decision") points=points+50 goto section2 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto cupboard1 EndIf cupboard2: TextWindow.WriteLine("there might be something important in the cupbourd so you better check it out") Goto cupboard1 window1: TextWindow.WriteLine("you check the window but unfortunatly it is locked") Goto section3 window2: TextWindow.WriteLine(" you dont know what story you are on so if you did go ouyt the window you might die") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 Goto section4 cabinet1: TextWindow.WriteLine("you search the filing cabinet and find some interesting papers but nothing of use") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 cabinet2: TextWindow.WriteLine("what are some old papers going to help you with at a time like this") TextWindow.WriteLine("you have made a good decision") points=points+50 goto section4 dresser1: TextWindow.WriteLine("you find a knife, a belt, an entire outfit, car keys, and an ID") TextWindow.WriteLine("you have made a good decision") points=points+50 Goto section5 dresser2: TextWindow.WriteLine("there is something that catches your eye on the dresser so you check it out") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 Goto dresser1 door1: TextWindow.WriteLine("you try the doorknob and it turns so you walk out into the main living space") TextWindow.WriteLine("you have made a good decision") points=points+50 Goto section6 door2: TextWindow.WriteLine("you have already searched all of this part of the house you must move on") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 bathroom1: TextWindow.WriteLine("you go to the bathroom and feel much better after") Goto section7 bathroom2: TextWindow.WriteLine(" i guess you dont go to the bathroom ") Goto section7 closet1: TextWindow.WriteLine("you only find clothes and shoes... nothing useful") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 Goto section8 closet2: TextWindow.WriteLine("i doubt there was anything interesting in there anyway") TextWindow.WriteLine("after all it is just a closet") TextWindow.WriteLine("you have made a good decision") points=points+50 Goto section8 furnace1: TextWindow.WriteLine("as you look closely you notice there is a large peice of rope") TextWindow.WriteLine("do you take it (y/n)") point02= TextWindow.Read() If point02= "y" then TextWindow.WriteLine("smart choice") TextWindow.WriteLine("you have made a good decision") points=points+50 Goto section9 elseif point02= "n" then TextWindow.WriteLine("you noticed stairs earlier you may need the rope to get down from somewhere high") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 Goto section9 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto furnace1 EndIf furnace2: TextWindow.WriteLine("you start to walk away when you notice something odd about the furnace") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 Goto furnace1 stairs1: TextWindow.WriteLine(" it would be smart to go upstairs since you have already searched all of this floor") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 Goto section10 stairs2: TextWindow.WriteLine(" it would be smart to go upstairs since you have already searched all of this floor") TextWindow.WriteLine("so you go up the stairs") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 Goto section10 tv1: TextWindow.WriteLine("you choose to watch a little tv but after a while grow bored and get up") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 Goto section11 tv2: TextWindow.WriteLine("good idea tv rots the brain and it wastes valuable time") TextWindow.WriteLine("you have made a good decision") points=points+50 Goto section11 bedroom1: TextWindow.WriteLine("when you walk in the room all you see is a bed, do you want to take a nap") point03= TextWindow.Read() If point03= "y" then TextWindow.WriteLine(" you take a brief nap and then get up and leave") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 Goto section12 elseif point03= "n" then TextWindow.WriteLine("best not to waste valuable time") TextWindow.WriteLine("you have made a good decision") points=points+50 Goto section12 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto bedroom1 EndIf bedroom2: TextWindow.WriteLine("it is just a guest room after all") TextWindow.WriteLine("you have made a good decision") points=points+50 Goto section12 plant1: TextWindow.WriteLine("why on earth would you think that something is in the plant") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 Goto section13 plant2: TextWindow.WriteLine("why on earth would you think that something is in the plant") TextWindow.WriteLine("you have made a good decision") points=points+50 Goto section13 drawers1: TextWindow.WriteLine("you find a key, flashlight and a license plate") TextWindow.WriteLine("you have made a good decision") points=points+50 Goto section14 drawers2: TextWindow.WriteLine("you may want to think again. why dont you give that another shot") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 Goto section13 master1: TextWindow.WriteLine("the key fits and unlocks the door") TextWindow.WriteLine("you have made a good decision") points=points+50 TextWindow.WriteLine("do you go in (y/n)") point04= TextWindow.Read() If point04= "y" then game: TextWindow.WriteLine("you go into the master bedroom") TextWindow.WriteLine("you have made a good decision") points=points+50 Goto section15 elseif point04= "n" then TextWindow.WriteLine("you have already searched the entire area so you must go in") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 goto game Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto master1 EndIf master2: TextWindow.WriteLine("you have already searched the entire area so you must go in") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 dresser3: TextWindow.WriteLine("as you search the contents of the dresser you find a fingerprint kit") TextWindow.WriteLine("with finger prints in it") TextWindow.WriteLine("you have made a good decision") points=points+50 Goto section16 dresser4: TextWindow.WriteLine("you may want to search the contents. i mean its not like i know anything") Goto dresser window3: TextWindow.WriteLine(" you open the window and realize that you could tie the rope to something and climb out") TextWindow.WriteLine("do you try it (y/n)") point05= TextWindow.Read() If point05= "y" Then TextWindow.WriteLine("unfortunately you search the room but there is nothing that you could tie the rope to") Goto section17 ElseIf point05= "n" then TextWindow.WriteLine("good thinking because there is nothing to tie your rope to") TextWindow.WriteLine("you have made a good decision") points=points+50 Goto section17 Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto window3 EndIf bed3: TextWindow.WriteLine("you take a short nap then you get back up") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 Goto section18 bed4: TextWindow.WriteLine("you are a very alert person if you dont take a nap") TextWindow.WriteLine("you have made a good decision") points=points+50 Goto section18 plant3: TextWindow.WriteLine(" just like the last one this plant holds no signifagance whatsoever") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 Goto section19 plant4: TextWindow.WriteLine("just like the last one this plant holds no signifagance whatsoever") TextWindow.WriteLine("you have made a good decision") points=points+50 Goto section19 closet3: TextWindow.WriteLine("you enter the closet") TextWindow.WriteLine("you have made a good decision") points=points+50 Program.Delay(3000) TextWindow.WriteLine("BANG!!") Program.Delay(2500) TextWindow.WriteLine("the door has just shut behind you and locked") TextWindow.WriteLine("do you screem for help and hope someone comes (y/n)") point06= TextWindow.Read() If point06= "y" then TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 TextWindow.WriteLine("you screem and screem for hours but nobody comes now do you lie down and addmit defeat (y/n)") point07=textwindow.Read() elseif point06= "n" then TextWindow.WriteLine("you have made a good decision") points=points+50 Goto look Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto closet3 EndIf blah: If point07= "y" then TextWindow.WriteLine("you are a wimp i dont want you playing my game anymore good-bye") Program.Delay(5000) Program.End() elseif point07= "n" then look: TextWindow.WriteLine("do you look around the room to see what can be used to escape") point08= TextWindow.Read() EndIf If point08= "y" then TextWindow.WriteLine("while looking around you notice a hole in the ceiling and a ladder in the corner") TextWindow.WriteLine("you have made a good decision") points=points+50 hole: TextWindow.WriteLine("do you climb up the ladder into the hole") point09=textwindow.Read() ElseIf point08= "n" then TextWindow.WriteLine("why dont you try that one again") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 Goto look Else TextWindow.WriteLine(" you didnt enter a valid answer") Goto hole EndIf If point09= "y" then TextWindow.WriteLine("you have made a good decision") points=points+50 Goto section20 ElseIf point09= "n" then TextWindow.WriteLine("then you can stay right there till you die... actually why dont you try again") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 goto hole EndIf closet4: TextWindow.WriteLine("you have already searched the entire area so you must go in") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 Goto closet3 stuff: TextWindow.WriteLine("you explore around for a while and eventually you come to a room,do you look for helpful items (y/n)") point10= TextWindow.Read() TextWindow.WriteLine("you have made a good decision") points=points+50 If point10= "y" then Goto section21 elseif point10= "n" then TextWindow.WriteLine(" since you dont want to survive you will roam the secret floor until you die") Program.Delay(3000) TextWindow.WriteLine("you have now died and the game is over") Program.Delay(6000) Program.End() EndIf money1: TextWindow.WriteLine("what is the matter with you, you could die and you are worried about money") TextWindow.WriteLine("why dont you restate that answer") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 Goto option1 money2: TextWindow.WriteLine("good job not taking the money there are more important things") TextWindow.WriteLine("you have made a good decision") points=points+50 Goto section22 bat1: TextWindow.WriteLine("you take the bat with you just in case") TextWindow.WriteLine("you have made a good decision") points=points+50 Goto section23 bat2: TextWindow.WriteLine("you try not to take the bat but you want to take it incase of an emergancy ") TextWindow.WriteLine("so bad that eventually you take it") Goto section23 note1: TextWindow.WriteLine("you take the note and read it. it says,") TextWindow.WriteLine("") TextWindow.WriteLine("there is only one way out of this place and that is a simple path to take") TextWindow.WriteLine("first you must go back through the hole in the closet ceiling") TextWindow.WriteLine("then you use the key from the drawers to unlock to closet door") TextWindow.WriteLine("then you must go back downstairs to the main lvl and search in the plants soil") TextWindow.WriteLine("in the soil you will find a cell phone and you must call 616-745-1414 to unlock the window in the bedroom on the main floor") TextWindow.WriteLine("then you leave through the window") TextWindow.WriteLine("you have made a good decision") points=points+50 Goto section24 note2: TextWindow.WriteLine("you better take the note just to be sure there is no vital info") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 Goto note1 ceiling1: TextWindow.WriteLine("after walking for several minutes you reach the hole in the closet") Program.Delay(3000) TextWindow.WriteLine("but the ladder has been knocked over. do you use your rope to climb down(y/n)") climb1: point11= TextWindow.Read() If point11= "y" Then TextWindow.WriteLine("you have made a good decision") points=points+50 Goto section25 ElseIf point11= "n" then TextWindow.WriteLine("you are stuck until you climb down with the rope ") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 EndIf Goto climb1 unlock: TextWindow.WriteLine("congradulations you have made it back to the master bedroom") Goto section26 upstairs: TextWindow.WriteLine("you are now upstairs in the main living area ") down: TextWindow.WriteLine("do you wish to go downstairs(y/n)") point12= TextWindow.Read() If point12= "y" then Goto section27 elseif point12= "n" then TextWindow.WriteLine("you need to focus on the goal of getting out") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 TextWindow.WriteLine("try again") Goto down EndIf bedroom: TextWindow.WriteLine("you are now back in the room you started in, a shiver runs down your spine") TextWindow.WriteLine("but you quickly realize that the crack sound was the lock on the window") TextWindow.WriteLine("do you seize the oppertunity and escape (y/n)") point13= TextWindow.Read() If point13= "y" then escape: Goto end escape2: TextWindow.WriteLine("congradulations you have made it out") TextWindow.WriteLine("you have won") Program.Delay(5000) Program.End() elseif point13= "n" then TextWindow.WriteLine("GET OUT YOU FOOL!!!!") TextWindow.WriteLine("you have made a pointless move you lose 50 points") points= points-50 Goto escape EndIf lock1: TextWindow.WriteLine("the phone has a combanation lock. the numbers are 1-10 there are 7 numbers") number1= Math.GetRandomNumber(10) number2= Math.GetRandomNumber(10) number3= Math.GetRandomNumber(10) number4= Math.GetRandomNumber(10) number5= Math.GetRandomNumber(10) number6= Math.GetRandomNumber(10) number7= Math.GetRandomNumber(10) TextWindow.WriteLine("you will get to guess the numbers one at a time") retry: TextWindow.WriteLine("what is your first number") number01= TextWindow.ReadNumber() While number01>number1 TextWindow.WriteLine("your number is to high") goto retry EndWhile While number01number2 TextWindow.WriteLine("your number is to high") goto second EndWhile While number02number3 TextWindow.WriteLine("your number is to high") goto third EndWhile While number03number4 TextWindow.WriteLine("your number is to high") goto fourth EndWhile While number04number5 TextWindow.WriteLine("your number is to high") goto fith EndWhile While number05number6 TextWindow.WriteLine("your number is to high") goto six EndWhile While number06number7 TextWindow.WriteLine("your number is to high") goto seven EndWhile While number07=1000 Then TextWindow.WriteLine(" you have enough to escape now rune for the exit") Goto escape2 elseif points<=999 then TextWindow.WriteLine("you do not have enough points to get out") TextWindow.WriteLine("do you wish to play again") restart= TextWindow.Read() If restart= "y" then Goto start elseIf restart= "n" then Program.Delay(3000) Program.End() EndIf End>LNZ153.sb< Start>LNZ598.sb< ' SmallBasic Version 1.0 ' Funktion: Turtle PolySpiral ' Autor: Pappa Lapub ' Herkunft: http://www.codeproject.com/Articles/117957/Turtle-Graphics-and-L-systems-with-F-and-WPF ' ImportURL: http://smallbasic.com/program/? ' Extension: ' Kommentar: Scott Philip Brown, 13 Oct 2010 ' Variablen: Figures = "1=20;2=90;3=5;4=10;5=36;6=95;7=1;8=20;9=50;10=117;11=3;12=10;" ' -------------------------------------------------------------------------------- Turtle.Speed = 10 Figure = "1=20;2=90;3=5;4=10;" ' numLines,; Angle; Inc; Length PolySpiral() Figure = "1=40;2=98;3=2;4=50;" PolySpiral() Figure = "1=50;2=117;3=3;4=10;" PolySpiral() Sub PolySpiral For T = 1 To Figure[1] Turtle.Turn(Figure[2]) Turtle.Move(Figure[4]) Figure[4] = Figure[4]+Figure[3] EndFor Program.Delay(5000) For T = 1 To Figure[1] +20 ' ?? +20 , ?? numLines has to be increased (+20) to remove ALL Lines from 2nd Figure Shapes.HideShape("_turtleLine"+T) 'Shapes.Remove("_turtleLine"+T) EndFor EndSub End>LNZ598.sb< Start>LPF760.sb< Sub LookUp TextWindow.ForegroundColor = "White" TextWindow.WriteLine(Clock.Date) TextWindow.WriteLine(Clock.Time) Sound.PlayChimeAndWait() TextWindow.WriteLine("Type a word and hit the Enter key to look it up!") Speech.Speak("Type a word and hit they Enter key to look it up!") word = TextWindow.Read() def = Dictionary.GetDefinition(word) TextWindow.Write("Here is your definition for ") TextWindow.Write(word) TextWindow.Write(":") Speech.Speak("Here is your definition for ") Speech.Speak(word) Speech.Speak(":") TextWindow.WriteLine(def) Sound.PlayBellRingAndWait() TextWindow.WriteLine("Thank you for using the Dictionary Lookup!") Speech.Speak("Thank you for using the Dictionary Lookup!") EndSub Sub Again TextWindow.WriteLine("Would you like to look up another word?") Speech.Speak("Would you like to look up another word?") TextWindow.WriteLine("If yes, type the letter y. If no, type anything else.") Speech.Speak("If yes, type the letter y. If no, type anything else.") If (TextWindow.Read() = "y") Then LookUp() Again() Else TextWindow.WriteLine("Goodbye.") Speech.Speak("Goodbye.") Program.Delay(1000) Program.End() EndIf EndSub TextWindow.ForegroundColor = "Blue" TextWindow.WriteLine("Welcome to Dictionary Lookup in Small Basic by Abhi S.") LookUp() Again() End>LPF760.sb< Start>LPG626.sb< clr=LDText.Split ("#0044cc #ddcc00 darkred" " ") Shapes_Init() Shapes_Add() GraphicsWindow.Title="Walking demo" dd="true Timer.Interval=21000 Timer.Tick=rrr Sub rrr rst="true EndSub While "true If rst Then rst="false GraphicsWindow.Clear () Shapes_Init () Shapes_Add () Program.Delay (111) dd="true endif MM=MM+1 walking() If -30 0 Then Shapes.Rotate(sshp[j][i], shp[i]["angle"]) EndIf EndFor EndFor EndSub Sub Shapes_Init X0 = ldtext.Split ( "10 140 25" " ") Y0 = ldtext.Split ( "50 250 450" " ") shp="" sshp="" shp[1] = "func=ell;x=42;y=0;width=34;height=45;bc=#EB9869;pc=#EB9869;pw=2;" ' face shp[2] = "func=line;x=65;y=13;x1=0;y1=0;x2=8;y2=1;pc=#6A5ACD;pw=4;" ' Eye shp[3] = "func=line;x=65;y=29;x1=0;y1=0;x2=8;y2=3;pc=#F80800;pw=2;" ' mouse shp[4] = "func=tri;x=74;y=17;x1=0;y1=0;x2=10;y2=8;x3=0;y3=12;angle=0;bc=#EB9869;pw=0;" 'nose shp[5] = "func=rect;x=53;y=50;width=8;height=60;angle=0;bc=cyan;pc=#000000;pw=1;" ' Left arm shp[6] = "func=ell;x=53;y=110;width=13;height=22;angle=0;bc=#EB9869;pw=0;" ' Left hand shp[7] = "func=ell;x=40;y=42;width=33;height=103;bc=@cc;pw=0;" ' body shp[8] = "func=rect;x=53;y=50;width=8;height=60;angle=0;bc=cyan;pc=#000000;pw=1;" ' Right arm shp[9] = "func=ell;x=53;y=110;width=13;height=22;angle=0;bc=#EB9869;pw=0;" ' Right hand shp[10] = "func=rect;x=50;y=140;width=12;height=71;angle=0;bc=darkblue;pw=0;" ' left Leg shp[11] = "func=ell;x=50;y=209;width=33;height=13;angle=0;bc=brown;pw=0;" ' left foot shp[12] = "func=rect;x=50;y=140;width=12;height=71;angle=0;bc=blue;pc=#6A5ACD;pw=0;" ' Right Leg shp[13] = "func=ell;x=50;y=209;width=33;height=13;angle=0;bc=chocolate;pw=0" ' Right foot EndSub End>LPG626.sb< Start>LPL617.sb< ' Challenge of the month October 2012 Crescent area by NaochanON gui() While "true" For k=0 to 9 plot() GraphicsWindow.Title=" Lap % = "+math.Floor(XLap*100*10)/10 +" %" + " Crescent area = "+math.Round(Yarea*100*10)/10+" % " Shapes.Animate(DMoon,260+45*(1-math.cos(rad))*2 ,5,2000) Program.Delay(2000) endfor scatter() Program.Delay(3000) Shapes.Animate(DMoon,250,5,3000) endwhile Sub plot rad= Math.GetRadians(10*k) XLap=(1-Math.Cos(rad)) X= 130+45*2*XLap*6 Yarea=(1-2*(rad-math.Cos(rad)*math.Sin(rad))/math.Pi) Y=100+100*(1-Yarea)*4 GraphicsWindow.BrushColor="Yellow" GraphicsWindow.PenColor="Yellow" Shapes.Remove(mark[k]) mark[k]= Shapes.AddEllipse(10,10) Shapes.Animate(mark[k],X,Y,1500) EndSub sub scatter For k=0 To 9 Shapes.Animate( mark[k],600-Math.GetRandomNumber(1200),500+Math.GetRandomNumber(1200),1500) EndFor EndSub sub gui GraphicsWindow.Top=50 GraphicsWindow.Width=800 GraphicsWindow.Height=600 GraphicsWindow.BackgroundColor="darkgreen" GraphicsWindow.BrushColor="Black" GraphicsWindow.PenColor="Black" GraphicsWindow.FillRectangle(100,100,600,400) GraphicsWindow.BrushColor="Yellow" GraphicsWindow.PenColor="Yellow" ' ---------------- show message ------------------------------------ LF= Text.GetCharacter(10) msg=" s=( Πr^2/2*θ/Π - rcos(θ)*rsin(θ)/2 )"+LF msg=msg+" CS=Πr^2 - 4*s"+LF+LF msg=msg+" =r^2*( Π - 2*(θ-cos(θ)*sin(θ)) )"+LF msg=msg+" Crescent %= CS/Πr^2 *100"+LF msg=msg+" = ( Π-2*(θ-cos(θ)*sin(θ)) ) /Π*100"+LF msg=msg+" = ( 1- 2*(θ-cos(θ)*sin(θ)) /Π )*100"+LF+LF msg=msg+" X Lap = r*(1-cos(θ))*2/2r*100"+LF msg=msg+" = (1-cos(θ))*100" smsg= Shapes.AddText(msg) Shapes.Move(smsg,450,120) ' ---------------- graph ------------------------------------ GraphicsWindow.FontSize=20 For i=0 To 5 GraphicsWindow.DrawText(50,90+i*80,100-i*20) GraphicsWindow.fillRectangle(100,100+i*80,10,4) EndFor GraphicsWindow.DrawText(50,60," (%)") For J=0 To 10 GraphicsWindow.DrawText(120+j*60*90/100,500,j*10) GraphicsWindow.fillRectangle(130+j*60*90/100,490,4,10) EndFor GraphicsWindow.DrawText(250,530," Lap (%) ") ' ---------------- Light Moon and Dark Moon -------------------------- Lmoon= Shapes.AddEllipse(90,90) Shapes.Move(Lmoon,350,5) GraphicsWindow.BrushColor="Black" GraphicsWindow.PenColor="Black" Dmoon= Shapes.AddEllipse(90,90) Shapes.SetOpacity(Dmoon,70) Shapes.Move(Dmoon,250,5) EndSub End>LPL617.sb< Start>LPS958.sb< 'Main Var1 = "USA" TextWindow.WriteLine ("Main") TextWindow.WriteLine (Var1) 'Call Sub R1 R1() TextWindow.WriteLine ("Main after R1") TextWindow.WriteLine (Var1) 'Call Sub R2 R2() TextWindow.WriteLine ("Main after R2") TextWindow.WriteLine (Var1) Sub R1 TextWindow.WriteLine ("At begin R1") TextWindow.WriteLine (Var1) Var1 = "Germany" TextWindow.WriteLine ("At end R1") TextWindow.WriteLine (Var1) EndSub Sub R2 TextWindow.WriteLine ("At begin R2") TextWindow.WriteLine (Var1) Var1 = "France" TextWindow.WriteLine ("At end R2") TextWindow.WriteLine (Var1) EndSub End>LPS958.sb< Start>LPT820.sb< Sub init not="true=false;false=true LDGraphicsWindow.TransparentGW() mm["File"]="Main mm["New"]="File mm["Open"]="File mm["OpenDfs"]="File mm["Save"]="File mm["-"]="File mm["Exit"]="File mm["Edit"]="Main mm["Replace"]="Edit mm["List"]="Edit mm["ListDfs"]="Edit ch["ListDfs"]="false mm["AutoLinNr"]="Edit ch["AutoLinNr"]="true mm["UnMute"]="Edit ch["UnMute"]="true mm["Run"]="Main mm["Start"]="Run mm["Stop"]="Run sf=1 GraphicsWindow.Left=5 GraphicsWindow.top=5 LDGraphicsWindow.TopMost="true Timer.Interval=250 Timer.Tick=ttt TextWindow.Left=5 TextWindow.Top=5 ms=LDControls.AddMenu(500 30 mm "" ch) LDShapes.BrushColour(ms "SandyBrown") LDShapes.PenColour(ms "black") LDControls.MenuClicked=mcc LDControls.MenuBackground(ms "gold") TextWindow.BackgroundColor="darkblue TextWindow.Clear() TextWindow.Title="QBasic Editor LDTextWindow.SetColour(7 "#aaaaaa") TextWindow.ForegroundColor=7 'TextWindow.WriteLine("Edit:") LDTextWindow.KeyDown=kkk LDTextWindow.Keyup=kuu not="false=true;true=false cps="false ldTextWindow.Encoding="Unicode 'TextWindow.Write("░▒▓█┌─┐│┼┴┬┤├└┘") mem=LDFastArray.add() For wy=1 To 200 For wx=1 To 160 LDFastArray.set2D(mem wx wy " ") EndFor EndFor If LDControls.MenuChecked(ms "Autolinnr") Then lll=lll+10 ldcall.function("twrt" lll+":") EndIf EndSub nnn=Text.GetCharacter(13)+Text.GetCharacter(10) ttb=Text.GetCharacter(9) args=0 init() Sub wsetup If www="true" Then Else GraphicsWindow.Width=600 GraphicsWindow.Height=400 www="true GraphicsWindow.BrushColor="tan GraphicsWindow.FillRectangle(0 0 GraphicsWindow.Width GraphicsWindow.Height) GraphicsWindow.Show() GraphicsWindow.BackgroundColor="tan EndIf EndSub While 1=1'---------------mainloop=============== If rnn Then TextWindow.Title="running >>> Timer.Pause() GraphicsWindow.Hide() indd="true arrmk() arr=LDText.Replace(arr "?" "print ") TextWindow.Clear() pl=LDText.Split(arr nnn) ln=1 dfmk() For gg=1 To Array.GetItemCount(pl)'----------make gotolbl index------- li=LDText.Split(text.ConvertToLowerCase(pl[gg]) ":") pl[gg]=LDText.Replace(pl[gg] "msin" "Math.sin") For qq=1 To Array.GetItemCount(arrd) pl[gg]=LDText.Replace(pl[gg] arrd[qq][1] arrd[qq][2]) EndFor gtt[li[1]]=gg EndFor 'GraphicsWindow.ShowMessage(pl "") 'TextWindow.WriteLine(gtt) While ln<=Array.GetItemCount(pl)'--------main run loop-------================== li=LDText.Split((pl[ln]) ":") For mi=2 To Array.GetItemCount(li) vi=LDText.Split(ldtext.replace(li[mi] "=" " = ") " ") vi[1]=text.ConvertToLowerCase(vi[1]) If vi[2]="=" Then vi[2]=vi[1] vi[1]="set" EndIf If Text.StartsWith(vi[1] "inpu") Then varr[vi[2]]=fcDialogs.AskForTextLine(vi[3]) ElseIf Text.StartsWith(vi[1] "paus") Then Program.Delay(vi[2]) ElseIf Text.StartsWith(vi[1] "gosub") Then Stack.PushValue("gss" ln+1) ln=gtt[vi[2]] Goto ccc ElseIf Text.StartsWith(vi[1] "ret") Then If Stack.GetCount("gss")>0 Then ln=Stack.PopValue("gss") Goto ccc Else fcDialogs.ShowMessageAsError("ret w/o gosub on #"+ln+":"+gtt[ln]) EndIf ElseIf Text.StartsWith(vi[1] "cp") or Text.StartsWith(vi[1] "cmp") Then oa=varr["a"] oa=oa-vi[2] If oa=0 Then zff="true Else zff="false EndIf ElseIf Text.StartsWith(vi[1] "inc") Then ii=vi[3] If ii=0 or ii="" Then ii=1 EndIf varr[vi[2]]=varr[vi[2]]+ii ElseIf Text.StartsWith(vi[1] "dec") Then ii=vi[3] If ii=0 or ii="" Then ii=1 EndIf varr[vi[2]]=varr[vi[2]]-ii ElseIf Text.StartsWith(vi[1] "djnz") Then varr["bc"]=varr["bc"]-1 If varr["bc"]>0 Then ln=gtt[vi[2]] Goto ccc EndIf ElseIf Text.StartsWith(vi[1] "jpz") and zff Then ln=gtt[vi[2]] Goto ccc ElseIf Text.StartsWith(vi[1] "jpnz") and not[zff] Then ln=gtt[vi[2]] Goto ccc ElseIf Text.StartsWith(vi[1] "goto") Then ln=gtt[vi[2]] Goto ccc ElseIf Text.StartsWith(vi[1] "if") Then If LDMath.Evaluate3( LDCall.Function("wset" vi[2])) Then ln=gtt[vi[3]] Else ln=gtt[vi[4]] EndIf Goto ccc ElseIf Text.StartsWith(vi[1] "plot") Then wsetup() GraphicsWindow.SetPixel(LDMath.Evaluate2(LDCall.Function("wset" vi[2])+"+0") LDMath.Evaluate2(LDCall.Function("wset" vi[3])+"+0") vi[4]) ElseIf Text.StartsWith(vi[1] "set")or Text.StartsWith(vi[1] "ld") or (vi[1]= "mov") Then varr[vi[2]]=LDMath.Evaluate2(LDCall.Function("wset" vi[3])+"+0") ElseIf Text.StartsWith(vi[1] "@pri") Then TextWindow.CursorLeft=vi[3] TextWindow.CursorTop=vi[4] Goto pp ElseIf Text.StartsWith(vi[1] "prin") Then pp: TextWindow.Write(ldtext.Replace(ldtext.Replace(ldtext.Replace( LDCall.Function("wset" vi[2]) "\n" nnn)"\t" ttb)"\s" " ")) EndIf EndFor ln=ln+1 ccc: EndWhile TextWindow.Title="ok GraphicsWindow.ShowMessage("OK Done." "QBasic") GraphicsWindow.Show() www="false GraphicsWindow.Height=25 GraphicsWindow.Width=300 Timer.Resume() plist() rnn="false indd=rnn EndIf EndWhile Sub plist TextWindow.Clear() arrmk() arr=LDText.Replace(arr "?" "Print ") arr2mm() mwrt() TextWindow.CursorLeft=0 TextWindow.CursorTop=1 EndSub Sub wset ii=args[1] ac=Array.GetAllIndices(varr) For rt=1 To Array.GetItemCount(ac) ii=LDText.Replace(ii "#"+ac[rt] varr[ac[rt]]) EndFor return=ii EndSub Sub arrmk'---------------create array from edits arr="" For wy=1 To 200 al="" For wx=1 To 158 al=Text.Append(al LDFastArray.get2D(mem wx wy)) EndFor arr=Text.Append(arr al+nnn) EndFor EndSub Sub dfmk'---------------create array from defines arrd="" For wy=1 To 50 al="" For wx=1 To 158 al=Text.Append(al LDFastArray.get2D(memd wx wy)) EndFor al=LDText.Trim(al) arrd[wy]=LDText.Split(al ":") EndFor ' GraphicsWindow.ShowMessage(arrd "") EndSub Sub arr2mm'--------------fastarray recreate in=0 For wy=1 To 200 For wx=1 To 158 in=in+1 LDFastArray.set2D(mem wx wy text.GetSubText(arr in 1)) EndFor While text.GetCharacterCode(text.GetSubText(arr in 1))>31 in=in+1 EndWhile in=in+1 EndFor EndSub Sub twrt'----------------memo&shw input px=TextWindow.CursorLeft+1 py=TextWindow.CursorTop+1 txx=args[1] For rw=1 To Text.GetLength(txx) LDFastArray.Set2D(mem px+rw-1 py Text.GetSubText(txx rw 1)) EndFor TextWindow.Write(txx) EndSub Sub mcc'-----------------menu handling---------------- ii=text.ConvertToLowerCase( LDControls.LastMenuItem) If ii="new" Then TextWindow.Clear() ElseIf ii="unmute" Then indd=not[LDControls.MenuChecked(ms "UnMute")] ElseIf ii="start" Then rnn="true ElseIf ii="stop" Then rnn="false ElseIf ii="exit" Then Program.End() ElseIf ii="list" Then plist() ElseIf ii="replace" Then indd="true tf=FCDialogs.AskForTextLine("text to fnd:") If tf="" Then Else tr=FCDialogs.AskForTextLine("text to replace:") arrmk() arr=LDText.Replace(arr tf tr) ' GraphicsWindow.ShowMessage(arr "") arr2mm() TextWindow.Clear() mwrt() EndIf indd="false ElseIf ii="save" Then indd="true ff=LDDialogs.saveFile("1=txt;2=bas;3=sb;4=itt" "e:\") mw=LDFastArray.ToArray(mem) ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' File.WriteContents(ff mw) indd="false ElseIf ii="open" Then indd="true ff=LDDialogs.OpenFile("1=txt;2=bas;3=sb;4=itt" "e:\") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' If LDFile.Exists(ff) Then ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' cc=File.ReadContents(ff) TextWindow.Clear() If Text.IsSubText(ff ".itt") Then mem=LDFastArray.CreateFromValues(cc) mwrt() Else TextWindow.WriteLine(cc) EndIf TextWindow.Title=ff EndIf ElseIf ii="opendfs" Then indd="true ff=LDDialogs.OpenFile("1=itt;2=dff" "e:\") ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' If LDFile.Exists(ff) Then ' The following line could be harmful and has been automatically commented. ' The following line could be harmful and has been automatically commented. ' cc=File.ReadContents(ff) TextWindow.Clear() memd=LDFastArray.CreateFromValues(cc) mwrt() EndIf indd="False EndIf 'TextWindow.Title=ii EndSub Sub mwrt'----------------list cmd If LDControls.MenuChecked(ms "listdfs") Then p50=50 Else p50=0 EndIf For wy=1 To 200 For wx=1 To 158 TextWindow.CursorLeft=wx-1 TextWindow.CursorTop=wy-1+p50 TextWindow.Write(LDFastArray.Get2D(mem wx wy)) EndFor EndFor If LDControls.MenuChecked(ms "listdfs") Then TextWindow.CursorLeft=0 TextWindow.CursorTop=0 TextWindow.Write("#defines:") For wy=1 To 50 For wx=1 To 158 TextWindow.CursorLeft=wx-1 TextWindow.CursorTop=wy TextWindow.Write(LDFastArray.Get2D(memd wx wy)) EndFor EndFor EndIf TextWindow.CursorLeft=0 TextWindow.CursorTop=p50 EndSub Sub ttt'-----------------Timer GraphicsWindow.Left=TextWindow.Left/sf+35 GraphicsWindow.Top=TextWindow.Top/sf EndSub Sub kuu'-----------------kyup lky=text.ConvertToLowerCase( LDTextWindow.LastKey) If Text.EndsWith(lky "iftkey") and not[cps] Then shh="false EndIf EndSub Sub kkk'-----------------keybrd-handling---------- If indd Then Else lk=text.ConvertToLowerCase( LDTextWindow.LastKey) 'TextWindow.WriteLine(lk) ' TextWindow.Title=lk If lk="return" Then 'TextWindow.WriteLine("") TextWindow.CursorLeft=0 TextWindow.CursorTop=TextWindow.CursorTop+1 If LDControls.MenuChecked(ms "Autolinnr") Then lll=lll+10 ldcall.function("twrt" lll+":") EndIf ElseIf lk="left" Then If TextWindow.CursorLeft>0 Then TextWindow.CursorLeft=TextWindow.CursorLeft-1 EndIf ElseIf lk="oemtilde" Then if shh Then ldcall.function("twrt" "@") else ldcall.function("twrt" "#") EndIf ElseIf lk="tab" Then ldcall.function("twrt" ttb) ElseIf lk="oem5" Then ldcall.function("twrt" "\") ElseIf lk="oem7" Then ldcall.function("twrt" "'") ElseIf lk="oemplus" Then ldcall.function("twrt" "=") ElseIf lk="down" Then TextWindow.CursorTop=TextWindow.CursorTop+1 ElseIf lk="up" Then If TextWindow.CursorTop>0 Then TextWindow.CursorTop=TextWindow.CursorTop-1 EndIf ElseIf lk="right" Then TextWindow.CursorLeft=TextWindow.CursorLeft+1 ElseIf Text.EndsWith(lk "iftkey") Then shh="true ElseIf Text.EndsWith(lk "uestion") Then If shh Then ldcall.function("twrt" "?") Else ldcall.function("twrt" "/") EndIf ElseIf Text.EndsWith(lk "kets") Then If shh Then ldcall.function("twrt" "[") Else ldcall.function("twrt" "(") EndIf ElseIf Text.EndsWith(lk "em6") Then If shh Then ldcall.function("twrt" "]") Else ldcall.function("twrt" ")") EndIf ElseIf Text.EndsWith(lk "em1") Then If shh Then ldcall.function("twrt" ";") Else ldcall.function("twrt" ":") EndIf ElseIf Text.EndsWith(lk "omma") Then If shh Then ldcall.function("twrt" "<") Else ldcall.function("twrt" ",") EndIf ElseIf Text.EndsWith(lk "iod") Then If shh Then ldcall.function("twrt" ">") Else ldcall.function("twrt" ".") EndIf ElseIf Text.EndsWith(lk "pital") Then cps=not[cps] If CPS Then shh="true Else shh="false EndIf ElseIf lk="space" Then ldcall.function("twrt" " ") 'TextWindow.CursorLeft=TextWindow.CursorLeft-1 ElseIf lk="add" Then ldcall.function("twrt" "+") ElseIf lk="subtract" Then ldcall.function("twrt" "-") ElseIf lk="multiply" Then ldcall.function("twrt" "*") ElseIf lk="divide" Then ldcall.function("twrt" "/") ElseIf lk="back" Then If TextWindow.CursorLeft>0 Then TextWindow.CursorLeft=TextWindow.CursorLeft-1 ldcall.function("twrt" " ") TextWindow.CursorLeft=TextWindow.CursorLeft-1 EndIf Else If shh Then ldcall.function("twrt" text.ConvertToUpperCase( Text.GetSubTextToEnd(lk Text.GetLength(lk)))) Else ldcall.function("twrt" Text.GetSubTextToEnd(lk Text.GetLength(lk))) EndIf ' ldcall.function("twrt" "<") ' TextWindow.CursorLeft=TextWindow.CursorLeft-1 EndIf EndIf EndSub End>LPT820.sb< Start>LPX256.sb< 'A program that reads and spell-checks a sentence of text from the user 'Challenge of the month June 'By Miguel Mendes 'MAIN------------------------------------------ SetLayout() 'End of MAIN---------------------------------- 'Event Handler Controls.ButtonClicked = CheckMousePosition 'end of Event Handler 'Subs---------------------------------------------- Sub SetLayout GraphicsWindow.Hide() GraphicsWindow.Width = 800 GraphicsWindow.Height = 600 GraphicsWindow.BackgroundColor = "Black" TextBox = Controls.AddTextBox(10, 10) Controls.SetSize(TextBox, 400, 400) ButtonSpellCheck = Controls.AddButton("Spell-Check", 10, 430) GraphicsWindow.Show() GraphicsWindow.Top = (Desktop.Height - GraphicsWindow.Height) / 2'Makes the window apear on the midle of the screen GraphicsWindow.Left = (Desktop.Width - GraphicsWindow.Width) / 2'Makes the window apear on the midle of the screen GraphicsWindow.CanResize = "False" NumberOfWords = 1' The programs works if you have at least 1 word in the text box so making it 1 by default EndSub Sub CheckMousePosition If (Mouse.MouseX >= 455 And Mouse.MouseX < 535) And (Mouse.MouseY >= 680 And Mouse.MouseY < 705) Then ButtonSpellCheckAction() ElseIf (Mouse.MouseX >= 570 And Mouse.MouseX < 705) And (Mouse.MouseY >= 680 And Mouse.MouseY < 705) Then else 'Do nothing EndIf EndSub Sub ButtonSpellCheckAction 'Reset's the final variable NewRawText = "" GetAllWords() SpellCheck() HighlightWord() RewriteText() EndSub Sub GetAllWords RawText = Controls.GetTextBoxText(TextBox) BreakTextToWords() EndSub Sub BreakTextToWords Length = Text.GetLength(RawText) SpaceIndex = Text.GetIndexOf(RawText, " ")'look's for spaces that separate word's a = 1'Defines word1 to be the first If (SpaceIndex = 0) Then 'Only 1 word Word[1] = RawText 'leave the sub to be spell checked Else For i = 1 To Length 'Just to make shure it loop's enough times Letter[i] = Text.GetSubText(RawText, i, 1) If Letter[i] = (" ") Then a = a + 1'makes another word Else If NumberOfWords = "1" Then'first time runing Word[a] = Word[a] + Letter[i] Else'Clears the word's in use and the counter For q = 1 To NumberOfWords Word[q] = "" EndFor Word[1] = Word[1] + Letter[i]'Recovers the letter lost to check if it was the first time runing NumberOfWords = 1 EndIf EndIf EndFor NumberOfWords = a EndIf EndSub Sub SpellCheck For c = 1 To NumberOfWords If Dictionary.GetDefinition(Word[c]) = "" Then BadWord[c] = "True" Else BadWord[c] = "False" EndIf EndFor EndSub Sub HighlightWord For w = 1 To NumberOfWords If BadWord[w] = "False" Then NewRawText = NewRawText + Word[w] + " " Else NewRawText = NewRawText + Text.ConvertToUpperCase(Word[w]) + " " EndIf EndFor EndSub Sub RewriteText Controls.SetTextBoxText(TextBox, NewRawText) EndSub 'End of Sub's-------------------------------------- End>LPX256.sb< Start>LPX272.sb< GraphicsWindow.Title = "Text Challenge 2 - November 2012 (Graphic Version with Button) GraphicsWindow.Width = 728 GraphicsWindow.Height = 500 GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 GraphicsWindow.BackgroundColor = "OrangeRed" GraphicsWindow.BrushColor = "Black" Resp = Controls.AddTextBox(189, 20) Controls.SetSize(Resp, 300, 25) GraphicsWindow.BrushColor = "Red" Enter = Controls.AddButton("Enter", 489, 20) Controls.SetSize(Enter, 50, 25) GraphicsWindow.BrushColor = "White" Controls.ButtonClicked = OnButtonClick question=1 Do_question() Sub Do_question If question =1 Then GraphicsWindow.DrawText(0,60 "1. Welcome, What is your name?") Sound.PlayClick() ElseIf Question= 2 then GraphicsWindow.DrawText(0,80 "2. Hello, " + UserAns[1] + "! How are you? [Great, Good, or Bad]") Sound.PlayClick() elseif Question= 3 then If UserAns[2] = "great" Then GraphicsWindow.DrawText(0,100 "_ That's awesome to hear!") ElseIf UserAns[2] = "good" Then GraphicsWindow.DrawText(0,100 "_ That's good to hear!") ElseIf UserAns[2] = "bad" Then GraphicsWindow.DrawText(0,100 "_ I am sorry to hear that!") Else GraphicsWindow.DrawText(0,100 "_ Sorry! I don't follow?") EndIf GraphicsWindow.DrawText(0,120 "3. What is your hobby, " + UserAns[1] + "?") Sound.PlayClick() elseif UserAns[3]<>"" then TextWindow.Write(UserAns) endif endsub Sub OnButtonClick UserAns[question] = Controls.GetTextBoxText(Resp) Controls.SetTextBoxText(Resp, "") question = question+1 Do_question() EndSub End>LPX272.sb< Start>LQB255.sb< 'Initialize variable values TextWindow.WriteLine("Enter the Distance Multiplier.") While distanceMult < 1 distanceMult = TextWindow.Read() EndWhile TextWindow.WriteLine("How many bodies?") While count < 2 count = TextWindow.Read() EndWhile dty = Desktop.Height dtx = Desktop.Width dtx=dtx-14 dty=dty-36 desktopHeight = dty desktopWidth = dtx pi = 3.14157 gravity = 1 bodies = count initialMass = 1'20/bodies 'Set Graphic window initial condition. GraphicsWindow.BackgroundColor = "Black" GraphicsWindow.Top = 4 GraphicsWindow.Left = 4 GraphicsWindow.CanResize = 0 GraphicsWindow.Title = "My 2D Universe" GraphicsWindow.Width = desktopWidth GraphicsWindow.Height = desktopHeight 'main will loop until the program is exited or the reset button is clicked. 'When the simulation is reset the program will jump back to the place 'objects subroutine and reset all momentum to zero. main: GraphicsWindow.BrushColor = "Blue" Shapes.AddText("Click to reset.") placeObjects() reset = 0 While reset = 0 GraphicsWindow.MouseDown = mouseClick drawUniverse() calculateForce() updateBodies() endwhile For a = 1 to bodies Shapes.Remove(body[a]) EndFor reset = 0 Goto main TextWindow.Read() Program.End() sub mouseClick reset = 1 EndSub 'updateBodies will apply force, factor in intertia, and update the x,y 'coordinates of each body. Sub updateBodies 'TextWindow.WriteLine("Update Bodies") onScreen = 0 For a = 1 To bodies x[a] = x[a] + xa[a] y[a] = y[a] + ya[a] If x[a] > 0 And x[a] < desktopWidth And y[a] > 0 And y[a] < desktopHeight Then onScreen = 1 EndIf EndFor If onScreen = 0 Then reset = 1 EndIf endSub 'Calculate force will iterate through each pair of bodies to create a total 'of the effective force to apply to each body. Sub calculateForce startTime = Clock.ElapsedMilliseconds 'TextWindow.WriteLine("Calculate Force") For a = 1 To bodies For b = a To bodies If mass[a] > 0 And mass[b] > 0 Then dx = x[a] - x[b] dy = y[a] - y[b] dx = dx * distanceMult dy = dy * distanceMult If dx = 0 Then dx = .0000001 EndIf If dy = 0 Then dy = .0000001 EndIf distance = Math.SquareRoot((dx*dx)+(dy*dy)) getSize() If distance < (size[a] * 4) then distance = size[a] * 4 Endif force = (mass[a] * mass[b] * gravity) / Math.SquareRoot(distance) 'calculate slope(Force Vecter) mdx = Math.Abs(dx) mdy = Math.Abs(dy) If mdx > mdy Then fx = 1 fy = (mdy / mdx) Else fy = 1 fx = (mdx / mdy) EndIf If dx < 0 Then fx = fx * -1 EndIf If dy < 0 Then fy = fy * -1 EndIf 'constrain force vector to a maximum multiplier of 1. dforce = 1 / Math.SquareRoot((mdy * mdy) + (mdx * mdx)) fy = fy * dforce fx = fx * dforce fy = fy * force fx = fx * force xa[b] = xa[b] + fx / mass[b] ya[b] = ya[b] + fy / mass[b] xa[a] = xa[a] + fx * -1 / mass[a] ya[a] = ya[a] + fy * -1 / mass[a] EndIf EndFor EndFor For a = 1 To bodies For b = a To bodies If mass[a] > 0 And mass[b] > 0 And a <> b Then getSize() distance = Math.SquareRoot((x[a]-x[b]) * (x[a]-x[b]) + (y[a]-y[b]) * (y[a]-y[b])) * distanceMult If distance < size[a] + size[b] Then xa[a] = ((mass[a] * xa[a]) + (mass[b] * xa[b])) / (mass[a] + mass[b]) ya[a] = ((mass[a] * ya[a]) + (mass[b] * ya[b])) / (mass[a] + mass[b]) If mass[a] 150 Then Shapes.Animate(body[a], x[a], y[a], cDelay) Else Shapes.Move(body[a], x[a], y[a]) EndIf endfor EndSub 'placeObjects will set initial values for the various bodies and create 'the sprites for each one. Sub placeObjects 'TextWindow.WriteLine("Place Objects") For a = 1 To bodies mass[a] = initialMass x[a] = Math.GetRandomNumber(desktopWidth * .8) y[a] = Math.GetRandomNumber(desktopHeight * .8) x[a] = x[a] + desktopWidth * .05 y[a] = y[a] + desktopHeight * .05 xa[a] = 0 ya[a] = 0 checked[a] = 0 getSize() GraphicsWindow.BrushColor = "White" GraphicsWindow.PenColor = "White" body[a] = Shapes.AddEllipse(size[a], size[a]) Shapes.Move(body[a], x[a] - size[a] / 2, y[a] - size[a] / 2) Shapes.ShowShape(body[a]) EndFor EndSub Sub getSize 'TextWindow.WriteLine("Get Size") size[a] = Math.SquareRoot(mass[a] / pi)+1 If size[a] < 1 Then size[a] = 1 EndIf EndSub End>LQB255.sb< Start>LQB609.sb< 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 String:") textbox3 = Controls.AddTextBox(665, 50) GraphicsWindow.DrawBoundText(680, 20, 150, "Background Colour:") button = Controls.AddButton("Submit", 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 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) 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 'submit' 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("The accepted colours are: 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>LQB609.sb< Start>LQK731.sb< GraphicsWindow.CanResize = "false" windowHeight = Desktop.Height - 100 windowWidth = Desktop.Width - 10 centerX = windowWidth/2 centerY = windowHeight/2 GraphicsWindow.Width = windowWidth GraphicsWindow.Height = windowHeight GraphicsWindow.Title = "Abram's Astroids" GraphicsWindow.Left = (Desktop.Width - windowWidth) / 2 GraphicsWindow.Top = 10 '((Desktop.Height - windowHeight) / 2) - 20 GraphicsWindow.BackgroundColor = "black" GraphicsWindow.Show() 'Setup event handlers GraphicsWindow.KeyDown = onKeyDown GraphicsWindow.KeyUp = onKeyUp ' Key controls leftKey = "Left" rightKey = "Right" upKey = "Up" downKey = "Down" fireKey = "Space" pauseKey = "P" quitKey = "Escape" hyperspaceKey = "RightCtrl" changeWeaponKey = "G" leftKeyPressed = false rightKeyPressed = false upKeyPressed = false downKeyPressed = false fireKeyPressed = false hyperspaceKeyPressed = false changeWeaponKeyPressed = false leftRightPriority = rightKey upDownPriority = upKey ' Dec2Hex conversion string hexaDecimal = "0123456789ABCDEF" imagePath = Program.Directory + "\images\" 'Load images initImages() ' Determine speed of computer CalibrateDelay() 'Some constants used for array indecies _size = 1 _x = 2 _y = 3 _shape = 4 _isVisible = 5 _angle = 6 _speed = 7 _maxSpeed = 8 _startPos = 9 _width = 10 _height = 11 _hits = 12 _direction = 13 _totalHits = 14 _maxSpritePoints = 15 _completePoints = 16 _shots = 17 _hasWeapons = 18 _shotTicker = 19 'level constants _maxSprites = 1 _spritesToLevelUp = 2 _pointWorth = 3 _minSpriteSpeed = 4 _maxSpriteSpeed = 5 _shotInterval = 6 _backgroundImages = 7 _objectImages = 8 _enemyImages = 9 _EnemyRatio = 10 _maxHits = 11 _hasBoss = 12 'Some other constants true = 1 false = 0 play = true pause = false alive = true gameEnd = false ' Desired frames per second (but will be lower on slower computers) fpsTarget = 30 initGame() ' The game loop MainLoop() ' Exit game Program.End() Sub initGame 'Setup Game play = 1 level = 1 maxLevels = 10 score = 0 lives = 5 curPoints = 0 pointsForOneUp = 0 curX = centerX curY = windowHeight - shipHeight 'Setup Sprites spritesOnScreen = 0 currentSprite = 1 spritesDestroyed = 0 initLevels() initBackground() initSprites() updateScoreBoard() initExplosion() initShip() initWeapons() LoadSounds() 'Timer.Interval = 1000 'Timer.Tick = initStars EndSub Sub initImages bg = ImageList.LoadImage(imagePath+"background.jpg") gameOverBg = ImageList.LoadImage(imagePath+"gameover.jpg") warpbg = ImageList.LoadImage(imagePath+"warp.jpg") fireBallImage = ImageList.LoadImage(imagePath+"fireball.png") fireBallSmallImage = ImageList.LoadImage(imagePath+"fireball-small.png") blueFireBallImage = ImageList.LoadImage(imagePath+"blue-fireball.png") blueFireBallSmallImage = ImageList.LoadImage(imagePath+"blue-fireball-small.png") EndSub ' Preload all sounds in game by loading then immediately stopping them. ' Makes it quick to play later since retained in memory. Sub LoadSounds ' All sounds were custom made for this game mainly using 80's style synthesizers Sound.Play(Program.Directory + "\audio\scores.mp3") Sound.Stop(Program.Directory + "\audio\scores.mp3") Sound.Play(Program.Directory + "\audio\score_entered.mp3") Sound.Stop(Program.Directory + "\audio\score_entered.mp3") ' Play and wait for a quiet sound to finish. When done ' all sounds are loaded & ready to go Sound.PlayAndWait(Program.Directory + "\audio\quiet.mp3") endsub Sub initLevels For level_count = 1 To maxLevels 'Grab the images for this level ' The following line could be harmful and has been automatically commented. ' levelBGImages = File.GetFiles(Program.Directory + "\images\levels\"+level_count+"\background\") ' The following line could be harmful and has been automatically commented. ' levelObjectImages = File.GetFiles(Program.Directory + "\images\levels\"+level_count+"\objects\") ' The following line could be harmful and has been automatically commented. ' levelEnemyImages = File.GetFiles(Program.Directory + "\images\levels\"+level_count+"\enemies\") levels[level_count][_maxSprites] = 3+Math.Ceiling((level_count/2))*2 ' number of sprites at a time levels[level_count][_spritesToLevelUp] = 5*level_count ' number of sprites needed to beat level levels[level_count][_maxSpriteSpeed] = level_count*6 ' max speed of sprites levels[level_count][_minSpriteSpeed] = levels[level_count][_maxSpriteSpeed]/2 ' min speed of sprites levels[level_count][_pointWorth] = level_count*55 ' point value for sprite levels[level_count][_completePoints] = level_count*1000 'bonus points for completing a level levels[level_count][_shotInterval] = (maxLevels - (level_count + 2)) * 3 levels[level_count][_enemyImages] = levelEnemyImages levels[level_count][_objectImages] = levelObjectImages levels[level_count][_backgroundImages] = levelBGImages levels[level_count][_EnemyRatio] = .01 * level_count levels[level_count][_maxHits] = Math.Round(level_count/2) levels[level_count][_hasBoss] = Math.Remainder(level_count,5) endFor EndSub Sub initSprites 'setup sprites For i = 1 to Array.GetItemCount(levels[level][_objectImages]) spriteImage[i] = levels[level][_objectImages][i] endFor 'spriteImage[1] = imagePath + "sprite1.gif" For i = 1 to Array.GetItemCount(levels[level][_enemyImages]) enemyImage[i] = levels[level][_enemyImages][i] EndFor EndSub Sub initStars ' draw stars starCount = Math.GetRandomNumber(500) starColors[1] = "white" starColors[2] = "red" starColors[3] = "LightCyan" stars = "" For i = 1 To starCount GraphicsWindow.PenColor = starColors[Math.GetRandomNumber(3)] GraphicsWindow.BrushColor = GraphicsWindow.PenColor starSize = Math.GetRandomNumber(3) starX = Math.GetRandomNumber(Desktop.Width) starY = Math.GetRandomNumber(windowHeight) 'GraphicsWindow.FillEllipse(starX,starY,starSize,starSize) stars[Array.GetItemCount(stars)+1] = Shapes.AddEllipse(starSize,starSize) Shapes.Move(stars[Array.GetItemCount(stars)],starX,starY) EndFor EndSub Sub initBackground bgImage = ImageList.LoadImage(levels[level][_backgroundImages][1]) GraphicsWindow.DrawResizedImage(bgImage,0,0,windowWidth,windowHeight) EndSub Sub initShip 'Load ship EastWest = "" NorthSouth = "" curShipName = "ship" shipImages[1][1] = ImageList.LoadImage(imagePath+"ship.png") shipImages[1][2] = "ship" shipImages[2][1] = ImageList.LoadImage(imagePath+"ship-north.png") shipImages[2][2] = "ship-north" shipImages[3][1] = ImageList.LoadImage(imagePath+"ship-east.png") shipImages[3][2] = "ship-east" shipImages[4][1] = ImageList.LoadImage(imagePath+"ship-south.png") shipImages[4][2] = "ship-south" shipImages[5][1] = ImageList.LoadImage(imagePath+"ship-west.png") shipImages[5][2] = "ship-west" shipImages[6][1] = ImageList.LoadImage(imagePath+"ship-north-east.png") shipImages[6][2] = "ship-north-east" shipImages[7][1] = ImageList.LoadImage(imagePath+"ship-north-west.png") shipImages[7][2] = "ship-north-west" shipImages[8][1] = ImageList.LoadImage(imagePath+"ship-south-east.png") shipImages[8][2] = "ship-south-east" shipImages[9][1] = ImageList.LoadImage(imagePath+"ship-south-west.png") shipImages[9][2] = "ship-south-west" shipWidth = ImageList.GetWidthOfImage(shipImages[1][1]) shipHeight = ImageList.GetHeightOfImage(shipImages[1][1]) ship = Shapes.AddImage(shipImages[1][1]) shipLeft = curX shipRight = curX + shipWidth shipTop = curY ' - shipHeight shipBottom = curY + shipHeight Shapes.Move(ship,shipLeft,shipTop) endSub sub initWeapons possibleBulletsOnScreen = 5 bulletColor = "red" bulletSpeed = 10 bulletWidth = 5 bulletHeight = 10 bulletShape = "rectangle" bulletStrength = 1 endsub ' Create explosion pieces sub initExplosion explodeImage[1] = ImageList.LoadImage(imagePath+"explode-small1.png") explodeImage[2] = ImageList.LoadImage(imagePath+"explode-small1.png") explodeImage[3] = ImageList.LoadImage(imagePath+"explode-small1.png") explodeImage[4] = ImageList.LoadImage(imagePath+"explode-small1.png") explodeImage[5] = ImageList.LoadImage(imagePath+"explode-medium1.png") explodeImage[6] = ImageList.LoadImage(imagePath+"explode-medium1.png") explodeImage[7] = ImageList.LoadImage(imagePath+"explode-medium1.png") explodeImage[8] = ImageList.LoadImage(imagePath+"explode-medium1.png") explodeImage[9] = ImageList.LoadImage(imagePath+"explode-large1.png") explodeImage[10] = ImageList.LoadImage(imagePath+"explode-large1.png") explodeImage[11] = ImageList.LoadImage(imagePath+"explode-large1.png") explodeImage[12] = ImageList.LoadImage(imagePath+"explode-large1.png") ' Create small explosion pieces that are permanently available For explosion_i = 1 to Array.GetItemCount(explodeImage) temp = Shapes.AddImage(explodeImage[explosion_i]) ' Move it immediately off screen so it isn't ever seen Shapes.Move(temp, 0, -100) ' Save in array explosion[explosion_i] = temp endfor ' Center of explosion explosionX = 0 explosionY = 0 explosionSpread = 0 explosionAlpha = 100 exploding = false explosionSize = 0 endsub Sub MainLoop While(play = true) If (pause = false) Then If alive = true AND gameEnd = false then doKeys() addSprites() updateScoreBoard() else removeAllSprites() EndIf Explode() Move() ' Smooth estimate of time elapsed between frames tNow = Clock.Millisecond dT = tNow - tLast tLast = tNow ' Handle millisecond rollover at 1 second marks If (dT < 0) Then dT = dT + 1000 EndIf k = 0.1 ' 1 = no smoothing, values less than 1 smooths. 0.1 default dTLossy = dTLossy * (1 - k) + dT * k ' Figure out how long we need to wait to achieve desired average frame rate waitLoops = 1000 / fpsTarget - dTLossy waitLoops = waitLoops * loopsPerMilliSec For i = 1 to waitLoops i=i endfor EndIf EndWhile EndSub 'One sub to move them all, one sub to bind them, one sub to... Sub Move 'move ship If alive = true then GraphicsWindow.BackgroundColor = "black" moveShip() Else alive = alive + 1 endif 'move all active bullets tmpBullets = Array.GetItemCount(bullets) For protected_b = 1 To tmpBullets Shapes.Move(bullets[protected_b],Shapes.GetLeft(bullets[protected_b]),Shapes.GetTop(bullets[protected_b])-20) If Shapes.GetTop(bullets[protected_b]) < -10 Then shotRemoveIndex = protected_b RemoveShot() EndIf tmpBullets = Array.GetItemCount(bullets) EndFor 'Move enemy Bullets For protected_e = 0 To Array.GetItemCount(enemyBullets) 'If array.GetItemCount(enemyBullets[temp_a]) >= 0 Then 'For protected_e = 0 To Array.GetItemCount(enemyBullets[temp_a]) Shapes.Move(enemyBullets[protected_e][1],Shapes.GetLeft(enemyBullets[protected_e][1]),Shapes.GetTop(enemyBullets[protected_e][1])+20) If Shapes.GetTop(enemyBullets[protected_e][1]) > windowHeight Then enemyShotRemoveIndex = protected_e 'enemyShotRemoveSpriteIndex = temp_a RemoveEnemyShot() EndIf 'EndFor 'EndIf EndFor 'Move all active sprites tmpSprites = Array.GetItemCount(sprites) For protected_a = 1 to Array.GetItemCount(sprites) curSprite = protected_a If sprites[protected_a][_direction] = "left" Then newLeft = Shapes.GetLeft(sprites[protected_a][_shape]) - sprites[protected_a][_x] Else newLeft = Shapes.GetLeft(sprites[protected_a][_shape]) + sprites[protected_a][_x] EndIf newTop = Shapes.GetTop(sprites[protected_a][_shape]) - sprites[protected_a][_y] Shapes.Move(sprites[protected_a][_shape],newLeft ,newTop ) isSpriteVisible() If sprites[curSprite][_isVisible] = 0 Then If sprites[curSprite][_hasWeapons] = true then 'If this sprite is an enemy, bounce him off the wall If newTop < windowHeight - sprites[curSprite][_height] then If sprites[curSprite][_direction] = "right" then sprites[curSprite][_x] = -sprites[curSprite][_x] sprites[curSprite][_direction] = "left" Else sprites[curSprite][_x] = Math.Abs(sprites[curSprite][_x]) sprites[curSprite][_direction] = "right" EndIf Else spriteRemoveIndex = curSprite removeSprite() EndIf Else spriteRemoveIndex = curSprite removeSprite() EndIf ElseIf sprites[protected_a][_hasWeapons] = 1 And shapes.GetTop(sprites[protected_a][_shape]) < curY And Shapes.GetLeft(sprites[protected_a][_shape]) > curX - 100 And Shapes.GetLeft(sprites[protected_a][_shape])+sprites[protected_a][_width] < curX + shipWidth + 100 then If sprites[curSprite][_shots] <= 10 And sprites[curSprite][_shotTicker] >= levels[level][_shotInterval] then sprites[curSprite][_shotTicker] = 0 enemyShoot() EndIf sprites[curSprite][_shotTicker] = sprites[curSprite][_shotTicker] + 1 EndIf EndFor anyHits() EndSub Sub moveShip shipLeft = curX shipRight = curX + shipWidth shipName = "ship" If NorthSouth <> "" then shipName = shipName+"-"+NorthSouth endif If EastWest <> "" then shipName = shipName+"-"+EastWest endif If curShipName <> shipName then For s = 1 To Array.GetItemCount(shipImages) If shipImages[s][2] = shipName Then Shapes.Remove(ship) ship = Shapes.AddImage(shipImages[s][1]) s = 10000 EndIf EndFor endif curShipName = shipName Shapes.Move(ship,curX,curY) endSub Sub anyHits For a = 1 To Array.GetItemCount(sprites) spriteLeft = Shapes.GetLeft(sprites[a][_shape]) spriteTop = Shapes.GetTop(sprites[a][_shape]) spriteSize = sprites[a][_width] spriteBottom = spriteTop + spriteSize For b = 1 To Array.GetItemCount(bullets) bulletLeft = Shapes.GetLeft(bullets[b]) + 2 bulletTop = Shapes.GetTop(bullets[b]) ' Did we shoot the sprite If bulletTop > 0 Then If ((bulletLeft >= spriteLeft) And (bulletLeft <= spriteLeft+spriteSize)) And (bulletTop < spriteBottom And bulletTop > spriteTop) then curSprite = a shotRemoveIndex = b RemoveShot() tmpHits = sprites[a][_hits] sprites[a][_hits] = sprites[a][_hits] - bulletStrength If sprites[a][_hits] <= 0 then explosionX = Shapes.GetLeft(sprites[a][_shape]) explosionY = Shapes.GetTop(sprites[a][_shape]) explosionSpread = sprites[a][_width]/2 exploding = true curPoints = sprites[a][_maxSpritePoints]*tmpHits If sprites[a][_hasWeapons] = true then spritesDestroyed = spritesDestroyed + 1 endIf spriteRemoveIndex = a removeSprite() Else 'hit but not destroyed If sprites[a][_hasWeapons] = 0 Then sprites[a][_width] = sprites[a][_width] * 0.75 sprites[a][_height] = sprites[a][_height] * 0.75 If sprites[a][_height] <= 10 then sprites[a][_height] = 10 EndIf If sprites[a][_width] <= 10 then sprites[a][_width] = 10 EndIf Shapes.Zoom(sprites[a][_shape],sprites[a][_width]*.01,sprites[a][_height]*.01) endIf curPoints = sprites[a][_maxSpritePoints] / sprites[a][_totalHits] spriteLeft = Shapes.GetLeft(sprites[a][_shape]) spriteTop = Shapes.GetTop(sprites[a][_shape]) spriteRight = spriteLeft + sprites[a][_width] spriteSize = sprites[a][_width] spriteBottom = spriteTop + spriteSize 'change direction If sprites[a][_direction] = "left" then sprites[a][_direction] ="right" else sprites[a][_direction] ="left" endif endIf 'GraphicsWindow.ShowMessage("spritesize: " + spriteSize updateScore() a = Array.GetItemCount(sprites) + 100 ' endif endIf endif EndFor 'Did our ship collide with an sprite or enemy? If alive = true Then spriteLeft = Shapes.GetLeft(sprites[a][_shape]) spriteTop = Shapes.GetTop(sprites[a][_shape]) spriteRight = spriteLeft + sprites[a][_width] spriteSize = sprites[a][_width] spriteBottom = spriteTop + spriteSize If shapes.GetTop(sprites[a][_shape]) + sprites[a][_height] >= curY And spriteTop <= shipBottom Then If shipLeft >= spriteLeft AND shipRight <= spriteRight Then 'we got hit removeLife() spriteRemoveIndex = a removeSprite() 'force exiting out of the loops a = 100000 b = 100000 EndIf endIf EndIf EndFor 'Did we get shot? For e = 1 to Array.GetItemCount(enemyBullets) If shapes.GetTop(enemyBullets[e][1]) + 9 >= curY And Shapes.GetTop(enemyBullets[e][1]) <= shipBottom Then If shipLeft <= Shapes.GetLeft(enemyBullets[e][1]) AND shipRight >= Shapes.GetLeft(enemyBullets[e][1]) Then 'we got hit removeLife() enemyShotRemoveIndex = e RemoveEnemyShot() 'force exiting out of the loop e = 100000 EndIf endIf EndFor EndSub Sub addSprites while spritesOnScreen < levels[level][_maxSprites] 'add as many sprites as neccessary to fulfill the maxSprites for this level For addingSpriteIndex = levels[level][_maxSprites] - spritesOnScreen To levels[level][_maxSprites] protected_sprite = Array.GetItemCount(sprites)+1 sprites[protected_sprite][_size] = Math.GetRandomNumber(2) ' size sprites[protected_sprite][_startpos] = Math.GetRandomNumber(windowWidth+100) 'X speedX = Math.GetRandomNumber(levels[level][_maxSpriteSpeed]) speedY = Math.GetRandomNumber(levels[level][_maxSpriteSpeed]) 'Quick random logic to determine if the sprite is an object or a enemy (enemy has weapons, objects don't) sprites[protected_sprite][_hasWeapons] = Math.Remainder(Math.GetRandomNumber(2),2) If sprites[protected_sprite][_hasWeapons] = 0 Then tmpSpriteImage = ImageList.LoadImage(spriteImage[Math.GetRandomNumber(Array.GetItemCount(spriteImage))]) 'Image Else tmpSpriteImage = ImageList.LoadImage(enemyImage[Math.GetRandomNumber(Array.GetItemCount(enemyImage))]) 'Image speedX = speedX*1.5 speedY = speedY*1.5 EndIf If speedX < levels[level][_minSpriteSpeed] then speedX = levels[level][_minSpriteSpeed] endIf If speedY < levels[level][_minSpriteSpeed] then speedY = levels[level][_minSpriteSpeed] endIf If speedX = 0 Then speedX = levels[level][_maxSpriteSpeed]*.5 endif If speedY = 0 then speedY = levels[level][_maxSpriteSpeed]*.5 endif 'Setup the direction and speed for this Sprite If sprites[protected_sprite][_startpos] > centerX Then 'came from the right, move toward the left sprites[protected_sprite][_x] = speedX sprites[protected_sprite][_direction] = "left" Else 'came from the left, move toward the right sprites[protected_sprite][_x] = speedX sprites[protected_sprite][_direction] = "right" endif sprites[protected_sprite][_y] = -speedY 'Add the sprite image to the sprites array sprites[protected_sprite][_shape] = Shapes.AddImage(tmpSpriteImage) If sprites[protected_sprite][_hasWeapons] = 0 Then Shapes.Zoom(sprites[protected_sprite][_shape],sprites[protected_sprite][_size],sprites[protected_sprite][_size]) endIf 'Grab the exact width and height of the sprite sprites[protected_sprite][_width] = ImageList.GetWidthOfImage(tmpSpriteImage) sprites[protected_sprite][_height] = ImageList.GetHeightOfImage(tmpSpriteImage) sprites[protected_sprite][_speed] = speedX sprites[protected_sprite][_isVisible] = 1 sprites[protected_sprite][_shots] = 0 ' Keeps running total of shots fired by this enemy sprites[protected_sprite][_shotTicker] = 1 'Enemy sprites hits depends on level If sprites[protected_sprite][_hasWeapons] = true Then sprites[protected_sprite][_hits] = Math.GetRandomNumber(levels[level][_maxHits]) 'This will decrease each time it is hit, once zero the sprite will explode 'Asteroid sprites have different hits based on zoom size else sprites[protected_sprite][_hits] = Math.Ceiling(sprites[protected_sprite][_size] * 1.5) 'This will decrease each time it is hit, once zero the asteroid will explode endif sprites[protected_sprite][_totalHits] = sprites[protected_sprite][_hits] 'This will remember how many hits it took for score calculations sprites[protected_sprite][_maxSpritePoints] = Math.GetRandomNumber(levels[level][_pointWorth]) 'Move the sprite to it's initial position Shapes.Move(sprites[protected_sprite][_shape], sprites[protected_sprite][_startpos],-200) 'Update the count of Sprites on the screen spritesOnScreen = Array.GetItemCount(sprites) curSprite = protected_sprite EndFor endWhile EndSub Sub isSpriteVisible If sprites[curSprite][_direction] = "left" AND (Shapes.GetLeft(sprites[curSprite][_shape]) <= -sprites[curSprite][_width]) Then sprites[curSprite][_isVisible] = false ElseIf sprites[curSprite][_direction] = "right" AND (Shapes.GetLeft(sprites[curSprite][_shape]) > windowWidth+sprites[curSprite][_width]) then sprites[curSprite][_isVisible] = true EndIf If Shapes.GetTop(sprites[curSprite][_shape]) > windowHeight then sprites[curSprite][_isVisible] = false endif If sprites[curSprite][_isVisible] = false Then ' GraphicsWindow.ShowMessage("sprite " + curSprite + "moving: " + sprites[curSprite][_direction] +" is not visible. X:" + Shapes.GetLeft(sprites[curSprite][_shape]) + " Y:" + Shapes.GetTop(sprites[curSprite][_shape]) + " VS window width:" + windowWidth + " height:" + windowHeight ,"test") endif EndSub Sub removeAllSprites For spriteRemoveIndex = 1 to Array.GetItemCount(sprites) spritesOnScreen = 0 removeSprite() EndFor endSub Sub removeSprite ' Remove graphic Shapes.Remove(sprites[spriteRemoveIndex][_shape]) ' Pack down the arrays to have a continuous index (don't leave holes) For remove_i = spriteRemoveIndex To (Array.GetItemCount(sprites) - 1) sprites[remove_i] = sprites[remove_i +1] EndFor ' Remove item at end of list, it's either the one requested or a duplicate from packing above sprites[Array.GetItemCount(sprites)] = "" spritesOnScreen = Array.GetItemCount(sprites) 'spritesOnScreen - 1 EndSub Sub updateScore score = Math.Floor(score + curPoints) If spritesDestroyed >= levels[level][_spritesToLevelUp] Then levelUp() GraphicsWindow.BackgroundColor = "black" endIf 'Add a new life everytime the player earns 10000 points pointsForOneUp = pointsForOneUp + curPoints If pointsForOneUp >= 10000 then oneUp() pointsForOneUp = 0 EndIf updateScoreBoard() EndSub Sub oneUp lives = lives + 1 GraphicsWindow.ShowMessage("One Up!!!","One up!") EndSub Sub updateScoreBoard GraphicsWindow.PenColor = "white" GraphicsWindow.FontName = "COMIC SANS MS" GraphicsWindow.FontSize = 25 Shapes.SetOpacity(bg,10) 'GraphicsWindow.DrawResizedImage(bg,1,1,440,100) 'GraphicsWindow.DrawRectangle(1,1,440,100) GraphicsWindow.BrushColor = "white" GraphicsWindow.DrawText(5,1,"Score: " + score) GraphicsWindow.DrawText(200,1,"Level: " + level) GraphicsWindow.DrawText(5,30,"Lives: " + lives) GraphicsWindow.DrawText(160,30,"Destroyed: " + spritesDestroyed) 'GraphicsWindow.DrawText(5,50,"shipLeft: " + shipLeft + " shipRight: " + shipRight) 'GraphicsWindow.DrawText(5,60,"bullets: " + bulletCount) EndSub Sub removeLife GraphicsWindow.BackgroundColor = "DimGray" explosionX = curX explosionY = curY explosionSize = 4 exploding = true Shapes.Move(ship,centerX, windowHeight + 100) Explode() Program.Delay(1000) lives = lives - 1 alive = -40 removeAllShots() removeAllEnemyShots() curX = centerX curY = windowHeight - shipHeight GraphicsWindow.Clear() initShip() initBackGround() initWeapons() initExplosion() initSprites() 'If we've spent all of our lives, end the game If lives <= 0 Then gameOver() EndIf EndSub Sub levelUp GraphicsWindow.Clear() 'Clear astroids off of screen removeAllSprites() 'Reset destroyed astroid count spritesDestroyed = 0 'Clear all shots off the screen removeAllShots() bullets = "" bulletCount = 0 GraphicsWindow.DrawResizedImage(bg,centerX-250,centerY-100,500,200) GraphicsWindow.DrawRectangle(centerX-250,centerY-100,500,200) GraphicsWindow.BrushColor = "white" GraphicsWindow.DrawText(centerX-200,centerY,"LEVEL " + level + " COMPLETE!") Program.Delay(1000) score = score + levels[level][_completePoints] level = level + 1 'warp speed to next level warp() 'Program.Delay(1000) GraphicsWindow.Clear() initBackground() initExplosion() initShip() initWeapons() initSprites() If level >= maxLevels then GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "MidnightBlue" youWin() endif EndSub Sub warp 'GraphicsWindow.BackgroundColor = "DimGray" GraphicsWindow.DrawResizedImage(warpbg,1,1,windowWidth,windowHeight) For s = 1 To Array.GetItemCount(stars) Shapes.Rotate(warpbg,s * 5) 'GraphicsWindow.FillEllipse(starX,starY,starSize,starSize) Shapes.Zoom(stars[s],5,5) 'newY = Shapes.GetTop(stars[s]) + 250 Shapes.Move(stars[s],centerX, centerY) newY = Math.GetRandomNumber(windowHeight*2) newX = Math.GetRandomNumber(windowWidth*2) GraphicsWindow.PenColor = "white" Shapes.Animate(stars[s],newX ,newY ,500) Shapes.Zoom(stars[s],0,0) If s = 100 then s = Array.GetItemCount(stars)+1 EndIf EndFor Program.Delay(1000) endSub Sub gameOver play = true pause = false alive = false gameEnd = true GraphicsWindow.Clear() GraphicsWindow.FontBold = 1 GraphicsWindow.BrushColor = "DimGray" GraphicsWindow.FontSize = 30 GraphicsWindow.DrawResizedImage(gameOverBg,0,0,windowWidth,windowHeight) GraphicsWindow.DrawText(centerX-100,centerY,"GAME OVER") 'Restart game RestartGame() EndSub Sub youWin removeAllSprites() play = true pause = true GraphicsWindow.Clear() GraphicsWindow.FontBold = 1 GraphicsWindow.PenColor = "Blue" GraphicsWindow.FontSize = 40 GraphicsWindow.DrawResizedImage(bg,centerX-250,centerY-100,500,200) GraphicsWindow.DrawRectangle(centerX-250,centerY-100,500,200) GraphicsWindow.BrushColor = "white" GraphicsWindow.DrawText(centerX-200,centerY,"YOU WIN!") 'add ability to restart game EndSub Sub doKeys EastWest = "" NorthSouth = "" If rightKeyPressed = true And leftKeyPressed = true then ' Figure out which direction based on last pressed or released If leftRightPriority = rightKey Then curX = curX + 20 EastWest = "east" Else curX = curX - 20 EastWest = "west" EndIf Else If rightKeyPressed = true Then curX = curX + 20 EastWest = "east" ElseIf leftKeyPressed = true Then curX = curX - 20 EastWest = "west" EndIf endif If curX + shipWidth > windowWidth then curX = windowWidth - shipWidth endif If curX <= 0 then curX = 0 'shipWidth endif If upKeyPressed = true then curY = curY - 20 NorthSouth = "north" EndIf If downKeyPressed = true then curY = curY + 20 NorthSouth = "south" EndIf If curY > windowHeight - shipHeight then curY = windowHeight - shipHeight ElseIf curY < 0 then curY = 0 endif shipTop = curY - shipHeight shipBottom = curY EndSub Sub changeWeapon 'removeAllShots() If bulletColor = "red" then possibleBulletsOnScreen = 10 bulletColor = "purple" bulletSpeed = 20 bulletWidth = 60 bulletHeight = 40 bulletShape = "circle" bulletStrength = 5 bulletCount = 0 Else possibleBulletsOnScreen = 5 bulletColor = "red" bulletSpeed = 10 bulletWidth = 5 bulletHeight = 10 bulletShape = "rectangle" bulletStrength = 1 endif endSub Sub shoot 'GraphicsWindow.PenColor = bulletColor bulletCount = Array.GetItemCount(bullets)+1 If bulletCount <= possibleBulletsOnScreen And alive = true And gameEnd = false then If bulletShape = "circle" then 'bullets[bulletCount] = Shapes.AddEllipse(bulletWidth,bulletHeight) bullets[bulletCount] = Shapes.AddImage(fireBallImage) bulletWidth = ImageList.GetWidthOfImage(fireBallImage) else 'bullets[bulletCount] = Shapes.AddRectangle(bulletWidth,bulletHeight) bullets[bulletCount] = Shapes.AddImage(blueFireBallSmallImage) bulletWidth = ImageList.GetWidthOfImage(blueFireBallSmallImage) endif Shapes.Move(bullets[bulletCount],curX ,curY-(shipHeight+(bulletHeight/2))) endIf endSub Sub enemyShoot GraphicsWindow.PenColor = "orange" enemyBullets[Array.GetItemCount(enemyBullets)+1][1] = Shapes.AddRectangle(5,9) enemyBullets[Array.GetItemCount(enemyBullets)][2] = curSprite ' used for tracking sprites[curSprite][_shots] = sprites[curSprite][_shots] + 1 Shapes.Move(enemyBullets[Array.GetItemCount(enemyBullets)][1],Shapes.GetLeft(sprites[curSprite][_shape])+(sprites[curSprite][_width]/2),Shapes.GetTop(sprites[curSprite][_shape])+sprites[curSprite][_height]) endSub Sub removeAllShots tmpBulletCount = Array.GetItemCount(bullets) For shotRemoveIndex = 1 to tmpBulletCount RemoveShot() EndFor bullets = "" endSub Sub RemoveShot ' Remove graphic shot Shapes.Remove(bullets[shotRemoveIndex]) ' Pack down the arrays to have a continuous index (don't leave holes) For i = shotRemoveIndex To (Array.GetItemCount(bullets) - 1) bullets[i] = bullets[i+1] EndFor ' Remove item at end of list, it's either the one requested or a duplicate from packing above bullets[Array.GetItemCount(bullets)] = "" EndSub Sub removeAllEnemyShots tmpBulletCount = Array.GetItemCount(enemyBullets) For enemyShotRemoveIndex = 1 to tmpBulletCount RemoveEnemyShot() EndFor enemyBullets = "" endSub sub RemoveEnemyShot ' Remove graphic shot Shapes.Remove(enemyBullets[enemyShotRemoveIndex][1]) sprites[enemyBullets[enemyShotRemoveIndex][2]][_shots] = sprites[enemyBullets[enemyShotRemoveIndex][2]][_shots] - 1 ' Pack down the arrays to have a continuous index (don't leave holes) For i = enemyShotRemoveIndex To (Array.GetItemCount(enemyBullets) - 1) enemyBullets[i] = enemyBullets[i+1] EndFor ' Remove item at end of list, it's either the one requested or a duplicate from packing above enemyBullets[Array.GetItemCount(enemyBullets)] = "" EndSub Sub CalibrateDelay ' Figure out dummy wait loops per millisecond ' Used instead of Program.Delay()'s coarse resolution of 16 ms tLast = Clock.Millisecond For ci = 1 to 20000 ci = ci endfor tNow = Clock.Millisecond dT = tNow - tLast If (dT < 0) Then dT = dT + 1000 EndIf loopsPerMilliSec = 20000 / dT endsub ' Read key event ' Note that key priority is remembered in case both up/down pressed ' we will do what the last key press indicates. ' Also note that this is an event handler, so key presses can ' interrupt code running elsewhere at any time, must be careful not to ' change variables etc that could affect code undesireably. Sub OnKeyDown If(GraphicsWindow.LastKey = rightKey) Then rightKeyPressed = true ' If both left & right pressed, this has higher priority since pressed last leftRightPriority = rightKey endif If(GraphicsWindow.LastKey = leftKey) Then leftKeyPressed = true leftRightPriority = leftKey EndIf If(GraphicsWindow.LastKey = upKey) Then upKeyPressed = true upDownPriority = upKey EndIf If(GraphicsWindow.LastKey = downKey) Then downKeyPressed = true upDownPriority = downKey EndIf If(GraphicsWindow.LastKey = fireKey) Then fireKeyPressed = true endif If(GraphicsWindow.LastKey = pauseKey) Then if (pause = true) then pause = false else pause = true endif elseif(GraphicsWindow.LastKey = quitKey) Then play = false EndIf If GraphicsWindow.LastKey = hyperspaceKey Then hyperspaceKeyPressed = true Endif If GraphicsWindow.LastKey = changeWeaponKey Then changeWeaponKeyPressed = true Endif ' Save letters for high score input highScoreLetter = GraphicsWindow.LastKey ' Show keypress text if we want to know what they all are 'dText = GraphicsWindow.LastKey 'Debug() EndSub ' Run on key release, see note above Sub OnKeyUp if GraphicsWindow.LastKey = rightKey Then rightKeyPressed = false EndIf if GraphicsWindow.LastKey = leftKey Then leftKeyPressed = false EndIf if GraphicsWindow.LastKey = upKey Then upKeyPressed = false EndIf if GraphicsWindow.LastKey = downKey Then downKeyPressed = false EndIf If(GraphicsWindow.LastKey = fireKey) Then ' Only allow one shot per key press shoot() fireKeyPressed = false endif If GraphicsWindow.LastKey = hyperspaceKey Then hyperspaceKeyPressed = false Endif If GraphicsWindow.LastKey = changeWeaponKey Then changeWeapon() changeWeaponKeyPressed = false Endif EndSub Sub Explode ' Animate exploding stuff (only 1 thing can explode at a time) If exploding = true then ' Move along with ground explosionX = explosionX explosionSpread = explosionSpread + 4 explosionAlpha = explosionAlpha-10 offset = explosionSize If explosionSpread > 40 then exploding = false explosionSpread = 0 ' Move parts off screen Shapes.Move(explosion[offset+1], 0, -50) Shapes.Move(explosion[offset+2], 0, -50) Shapes.Move(explosion[offset+3], 0, -50) Shapes.Move(explosion[offset+4], 0, -50) explosionAlpha = 110 else ' Move all pieces of explosion in four directions Shapes.Move(explosion[offset+1], explosionX + explosionSpread, explosionY + explosionSpread) Shapes.Move(explosion[offset+2], explosionX + explosionSpread, explosionY - explosionSpread) Shapes.Move(explosion[offset+3], explosionX - explosionSpread, explosionY + explosionSpread) Shapes.Move(explosion[offset+4], explosionX - explosionSpread, explosionY - explosionSpread) endif 'fade explosion For i = 1 To 4 Shapes.SetOpacity(explosion[offset+i],explosionAlpha) EndFor endif EndSub ' Pull in scores from file Sub GetHighScores ' Read in 5 scores, name then below it is score For z = 1 to 5 ' The following line could be harmful and has been automatically commented. ' highScoreName[z] = File.ReadLine (Program.Directory + "\scores.txt", z * 2 - 1) ' The following line could be harmful and has been automatically commented. ' highScoreValue[z] = File.ReadLine (Program.Directory + "\scores.txt", z * 2) Endfor EndSub ' Get players score if higher than scoreboard, show scoreboard. ' Show high scores with nice graphic effect - it's their only reward Sub ShowHighScores ' Look through all scores and see if player beat one, starting with highest score For i = 1 To Array.GetItemCount(highScoreName) GraphicsWindow.ShowMessage(highScoreValue[i],"TEST") If score > highScoreValue[i] Then ' We beat a score, play tune Sound.Stop(Program.Directory + "\audio\scores.mp3") Sound.Play(Program.Directory + "\audio\scores.mp3") ' Shift all scores down 1 slot For j = Array.GetItemCount(highScoreName)-1 to i Step -1 highScoreName[j+1] = highScoreName[j] highScoreValue[j+1] = highScoreValue[j] EndFor ' Get players name GraphicsWindow.BrushColor = "DimGray" GraphicsWindow.FontName = "courier" GraphicsWindow.FontSize = 40 GraphicsWindow.DrawText(centerX - 40 * 5, centerY + 200, "YOU MADE THE TOP 5!") GraphicsWindow.FontSize = 30 GraphicsWindow.DrawText(centerX - 30 * 4, centerY + 250, "ENTER INITIALS: ") k = 0 ' no letters entered yet temp2 = "" While k < 3 ' Only allow typical characters (may need tweak for other languages) ' Get copy of entered key in uppercase, changes in event handler temp = Text.ConvertToUpperCase(highScoreLetter) If Text.GetLength(temp) = 1 And Text.GetCharacterCode(temp) >= 64 And Text.GetCharacterCode(temp) <= 95 Then ' Show letter entered GraphicsWindow.BrushColor = "DarkOrange" GraphicsWindow.FontName = "courier" GraphicsWindow.FontSize = 50 GraphicsWindow.DrawText(centerX - 50 * (1.5 - k), centerY + 300, temp) ' Build name string temp2 = Text.Append(temp2, temp) k = k + 1 Program.Delay(200) highScoreLetter = "" EndIf EndWhile Sound.Stop(Program.Directory + "\audio\score_entered.mp3") Sound.Play(Program.Directory + "\audio\score_entered.mp3") Program.Delay(2000) ' Save name/score to array highScoreName[i] = temp2 highScoreValue[i] = score ' Save score to file. Write 5 scores, name then below it is the score For z = 1 to Array.GetItemCount(highScoreName) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(Program.Directory + "\scores.txt", z * 2 - 1, highScoreName[z]) ' The following line could be harmful and has been automatically commented. ' File.WriteLine(Program.Directory + "\scores.txt", z * 2, highScoreValue[z]) Endfor ' exit for i = 100 EndIf endfor ' Clear drawn graphics GraphicsWindow.PenColor = "black" GraphicsWindow.BrushColor = "black" ' Display list of scores GraphicsWindow.FontName = "courier" GraphicsWindow.FontSize = 30 GraphicsWindow.BrushColor = "DimGray" GraphicsWindow.DrawText(windowWidth / 2 - 30 * 6, windowHeight / 4 - 50, "HIGH SCORES") GraphicsWindow.BrushColor = "FireBrick" ' If no list of high scores, probably had file error reading them in, or file I/O remarked out If Array.GetItemCount(highScoreName) = 0 Then GraphicsWindow.FontSize = 10 ' The following line could be harmful and has been automatically commented. ' GraphicsWindow.DrawText(windowWidth / 2 - 10 * 25, windowHeight / 4, "Error Reading High Scores, Ensure 'File.' Uncommented In Source Code!") Else highScoreLetter = "" ' Create sinewave of color intensity to give score reflection look, ' and wait for player to press key to start another game i = 6.28 ' 2 * pi While highScoreLetter = "" i = i - 0.15 If i < 0 Then i = 6.28 EndIf For j = 1 to Array.GetItemCount(highScoreName) ' Each name in score has slightly different phase offset to give rolling reflection look k = Math.Floor(7.5 + 7.4 * Math.Sin(Math.Remainder(i + j * 0.6, 6.28))) temp = Text.Append(Text.GetSubText(hexaDecimal, k, 1), "0") temp2 = Text.Append("#FF", temp) temp2 = Text.Append(temp2, temp) GraphicsWindow.BrushColor = temp2 temp = Text.Append(highScoreName[j] + " - ", highScoreValue[j]) GraphicsWindow.DrawText(windowWidth / 2 - 30 * 3, windowHeight / 4 + j * 35, temp) Endfor Program.Delay(33) EndWhile Endif EndSub ' Restart entire game over Sub RestartGame ' Get name if high score, show scoreboard ShowHighScores() Program.Delay(1000) Endsub End>LQK731.sb< Start>LQP820.sb< 'Create GW gw = 600 gh = 600 GraphicsWindow.Width = gw GraphicsWindow.Height = gh 'Create game boxes radius = 20 numBox = 5 GraphicsWindow.BrushColor = "Blue" For i = 1 To numBox enemy[i] = Shapes.AddRectangle(2*radius,2*radius) enemyPosX[i] = Math.GetRandomNumber(gw) enemyPosY[i] = Math.GetRandomNumber(gh) enemyVelX[i] = Math.GetRandomNumber(5) - 3 enemyVelY[i] = Math.GetRandomNumber(5) EndFor GraphicsWindow.BrushColor = "Red" player = Shapes.AddRectangle(2*radius,2*radius) playerPosX = gw/2 playerPosY = gh/2 speed = 3 ' Player move speed 'key control GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp keyLeft = 0 keyRight = 0 keyUp = 0 keyDown = 0 'Infinite game loop While ("True") For i = 1 To numBox 'Update enemy positions enemyPosX[i] = enemyPosX[i]+enemyVelX[i] enemyPosY[i] = enemyPosY[i]+enemyVelY[i] 'Check for off screen If (enemyPosY[i] > gw +radius) Then enemyPosY[i] = -radius EndIf 'Bounce off sides If (enemyPosX[i] < radius Or enemyPosX[i] > gw-radius) Then enemyVelX[i] = -enemyVelX[i] EndIf 'Update position (X,Y) is shape center Shapes.Move(enemy[i],enemyPosX[i]-radius,enemyPosY[i]-radius) EndFor 'Move player with keys processKey() Shapes.Move(player,playerPosX-radius,playerPosY-radius) 'Collision detection collision() Program.Delay(20) EndWhile 'SUBROUTINES '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 playerPosX = playerPosX-speed EndIf If (keyRight = 1) Then playerPosX = playerPosX+speed EndIf If (keyUp = 1) Then playerPosY = playerPosY-speed EndIf If (keyDown = 1) Then playerPosY = playerPosY+speed EndIf EndSub Sub collision For i = 1 To numBox distX = Math.Abs(playerPosX - enemyPosX[i]) distY = Math.Abs(playerPosY - enemyPosY[i]) If (distX < 2*radius And distY < 2*radius) Then Sound.PlayClickAndWait() EndIf EndFor EndSub End>LQP820.sb< Start>LQT869.sb< gw=800 gh=800 gw2=gw/2 ''center gh2=gh/2 GraphicsWindow.Width=gw GraphicsWindow.Height=gh GraphicsWindow.PenWidth=.3 GraphicsWindow.BackgroundColor="tan GraphicsWindow.PenColor="darkred GraphicsWindow.Left=5 GraphicsWindow.Top=5 bb=LDShapes.BrushGradient("1=white;2=tan;3=tan;4=brown" "") LDGraphicsWindow.BackgroundBrush(bb) args=0 not="true=false;false=true zz=1 oox=0 ooy=0 LDEvents.MouseWheel=mww GraphicsWindow.KeyDown=kkd Sub kkd lk=text.ConvertToLowerCase( GraphicsWindow.LastKey) If lk="left" Then oox=oox-20 ElseIf lk="right" Then oox=oox+20 ElseIf lk="up" Then ooy=ooy-20 ElseIf lk="down" Then ooy=ooy+20 EndIf LDGraphicsWindow.Reposition(zz zz oox, ooy 0) EndSub Sub mww zz=zz+LDEvents.LastMouseWheelDelta/10 LDGraphicsWindow.Reposition(zz zz oox, ooy 0) GraphicsWindow.Title=zz EndSub Sub t_Move ox=t_X oy=t_Y mm=LDMath.Convert2Cartesian(ox oy args[1] t_Angle-90) t_x=mm[1] t_y=mm[2] if not[pnm] then Shapes.AddLine(ox oy t_X t_Y) EndIf EndSub Sub t_Mov2 ox=t_X oy=t_Y t_x=args[1] t_y=args[2] if not[pnm] then Shapes.AddLine(ox oy t_X t_Y) EndIf EndSub t_x=gw/2 t_y=gh/2 l=300 ''radius of pattern For h=0 To 359 Step 6 ldcall.function2("t_mov2" gw2,gh2) pnm="false t_Angle=h ldcall.function("t_move" l) pnm="true EndFor p3=l*0.37 ''position inside arrows l3=l*0.3 dh=3 For h=0 To 359 Step 6 xx=gw2+LDMath.Sin(h)*p3 yy=gh2-LDMath.Cos(h)*p3 pnm="true ldcall.function2("t_mov2" xx,yy) xxx=gw2+LDMath.Sin(h+dh)*l3 yyy=gh2-LDMath.Cos(h+dh)*l3 pnm="false ldcall.function2("t_mov2" xxx,yyy) ldcall.function2("t_mov2" xx,yy) xxx=gw2+LDMath.Sin(h-dh)*l3 yyy=gh2-LDMath.Cos(h-dh)*l3 pnm="false ldcall.function2("t_mov2" xxx,yyy) EndFor p2=l*0.73 ''outside arrows l2=l*0.80 dh=1.0 For h=0 To 359 Step 6 xx=gw2+LDMath.Sin(h)*p2 yy=gh2-LDMath.Cos(h)*p2 pnm="true ldcall.function2("t_mov2" xx,yy) xxx=gw2+LDMath.Sin(h+dh)*l2 yyy=gh2-LDMath.Cos(h+dh)*l2 pnm="false ldcall.function2("t_mov2" xxx,yyy) ldcall.function2("t_mov2" xx,yy) xxx=gw2+LDMath.Sin(h-dh)*l2 yyy=gh2-LDMath.Cos(h-dh)*l2 pnm="false ldcall.function2("t_mov2" xxx,yyy) EndFor For s=1 To 2 ''stars If s=1 Then '' inner j=0.53 l2=0.2*l Else j=1 ''outer l2=0.1*l EndIf p2=l*j ''position center For h=0 To 359 Step 6 xx=gw2+LDMath.Sin(h)*p2 yy=gh2-LDMath.Cos(h)*p2 pnm="true ldcall.function2("t_mov2" xx,yy) pnm="false t_Angle=h For iss=0 To 14 ldcall.function("t_move" l2) t_angle=t_angle+(180) ldcall.function("t_move" l2) t_angle=t_angle+(150) EndFor EndFor EndFor End>LQT869.sb< Start>LQV688.sb< 'normImg = ImageList.LoadImage(Program.Directory +"\img\NM_4.png") ' 88x88 GraphicsWindow.BackgroundColor = "Black" 'normImg = ImageList.LoadImage(Program.Directory +"\car_normalmap.png") ' 88x88 'textureImg = ImageList.LoadImage(Program.Directory +"\car_texture.png") ' 88x88 'normImg = ImageList.LoadImage("https://social.msdn.microsoft.com/Forums/getfile/965521") ' 88x88 'textureImg = ImageList.LoadImage("https://social.msdn.microsoft.com/Forums/getfile/965522") ' 88x88 normImg = ImageList.LoadImage("https://social.msdn.microsoft.com/Forums/getfile/966180") ' 88x88 textureImg = ImageList.LoadImage("https://social.msdn.microsoft.com/Forums/getfile/966181") ' 88x88 w = ImageList.GetWidthOfImage(normImg) h = ImageList.GetHeightOfImage(normImg) image1 = Shapes.AddImage(normImg) image2 = Shapes.AddImage(textureImg) image = Shapes.AddImage(normImg) Shapes.Move(image2,100,0) Shapes.Move(image,300-w/2,300-h/2) GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "Yellow" light = Shapes.AddEllipse(10,10) GraphicsWindow.KeyDown = OnKeyDown normal = LDImage.HeightMap2NormalMap(textureImg,1) image3 = Shapes.AddImage(normal) Shapes.Move(image3,300-w/2,100-h/2) While ("True") start = Clock.ElapsedMilliseconds angle = angle+1 Shapes.Rotate(image,angle) move = "False" x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY Shapes.Move(light,x-5,y-5) LDImage.NormalMap(image3,x-300,y-100,20,textureImg,0.1,2) rotate = LDMath.Rotate(300,300,x,y,-angle) x = rotate[1] y = rotate[2] LDImage.NormalMap(image,x-300,y-300,20,textureImg,0.1,2) delay = Math.Max(1,20-(Clock.ElapsedMilliseconds-start)) Program.Delay(delay) EndWhile Sub OnKeyDown If (textureImg = "") Then textureImg = textureImgSave Else textureImgSave = textureImg textureImg = "" EndIf EndSub End>LQV688.sb< Start>LQZ137.sb< GraphicsWindow.BackgroundColor="midnightblue GraphicsWindow.Title="Hearts For s100=10 To 100 Step .3 cc= LDColours.HSLtoRGB (s100/3 1 .65) For x=0 To 1 Step .004 y=Math.Power(x 2/3)-Math.SquareRoot(1-x*x) GraphicsWindow.SetPixel (x*s100+200 300-y*s100 cc) y=Math.Power(x 2/3)+Math.SquareRoot(1-x*x) GraphicsWindow.SetPixel (x*s100+200 300-y*s100 cc) y=Math.Power(x 2/3)-Math.SquareRoot(1-x*x) GraphicsWindow.SetPixel (200-x*s100 300-y*s100 cc) y=Math.Power(x 2/3)+Math.SquareRoot(1-x*x) GraphicsWindow.SetPixel (200-x*s100 300-y*s100 cc) EndFor EndFor End>LQZ137.sb< Start>LRB032.sb< t_angle=180 penn="true GraphicsWindow.Title ="3D lettering GraphicsWindow.BackgroundColor="#000055 GraphicsWindow.PenColor="white GraphicsWindow.PenWidth=2 GraphicsWindow.Width=1200 GraphicsWindow.Height=900 GraphicsWindow.Left=10 GraphicsWindow.Top=5 args=0 obj=0 Sub tcmd 'TextWindow.WriteLine (args[1]) cc=text.ConvertToLowerCase (text.GetSubText(args[1],1,1)) xc=text.GetSubTextToEnd (args[1] 2) If cc="m" or cc="f" Then LDCall.Function ("t_mov" xc) ll=xc ElseIf cc="b" then LDCall.Function ("t_mov", -ll) ElseIf cc="x" then t_x=xc ElseIf cc="y" then t_y=xc ElseIf cc="r" then t_angle=t_angle+90 ElseIf cc="l" then t_angle=t_angle-90 ElseIf cc="a" then t_angle =xc ElseIf cc="t" then t_angle=t_angle+ xc ElseIf cc="u" then penn="false ElseIf cc="d" then penn="true ElseIf cc="w" then GraphicsWindow.PenWidth=xc ElseIf cc="c" then GraphicsWindow.PenColor=xc endif endsub Sub tstrf ar=args[1] ta=ldtext.Split (args[2] ":") For x=1 To Array.GetItemCount (ta) ar=LDText.Replace (ar "%"+x ta[x]) EndFor tm=ldtext.Split (ar " ") For x=1 To Array.GetItemCount (tm) LDCall.Function ("tcmd" tm[x]) EndFor EndSub Sub tstr ar=args[1] tm=ldtext.Split (ar " ") xi=1 while xi<=Array.GetItemCount (tm) If text.StartsWith (tm[xi] "[") Then ff=ldtext.Split(tm[xi] ":") For ss=1 To ff[2] For s=xi+1 To xi+ff[3] LDCall.Function ("tcmd" tm[s]) EndFor EndFor xi=xi+ff[3] +1 ' TextWindow.WriteLine (">>>"+xi) else LDCall.Function ("tcmd" tm[xi]) xi=xi+1 endif EndWhile EndSub Sub mirr q=args[1] If Text.StartsWith (q "l") then q="r"+Text.GetSubTextToEnd (q 2) ElseIf Text.StartsWith (q "r") then q="l"+Text.GetSubTextToEnd (q 2) ElseIf Text.StartsWith (q "t") then q="t"+Text.GetSubTextToEnd (q 2)*-1 endif return=q endsub Sub tstrm ar=args[1] tm=ldtext.Split (ar " ") xi=1 while xi<=Array.GetItemCount (tm) If text.StartsWith (tm[xi] "[") Then ff=ldtext.Split(tm[xi] ":") For ss=1 To ff[2] For s=xi+1 To xi+ff[3] LDCall.Function ("tcmd" ldcall.Function ("mirr" tm[s])) EndFor EndFor xi=xi+ff[3] +1 ' TextWindow.WriteLine (">>>"+xi) else LDCall.Function ("tcmd" ldcall.Function ("mirr" tm[xi])) xi=xi+1 endif EndWhile EndSub Sub cpp LDCall.Function ("tstr" "[:10:2 f5 t9 l f20 l f"+xll+" l f20 l [:10:2 f5 t9") EndSub Sub cppm LDCall.Function ("tstrm" "[:10:2 f5 t9 l f20 l f"+xll+" l f20 l [:10:2 f5 t9") EndSub Sub drr t_angle=180 '--------------------------------i xll=115 ldcall.Function2 ("tpos" 141 250) f50=70 skk="true cpp() LDCall.Function ("t_mov" 150) cpp() LDCall.Function ("t_mov" 155) obb() 'Goto ccc '--------------------------------h skk="true ldcall.Function2 ("tpos" 291 250) For f=1 To 2 cpp() LDCall.Function2 ("tstrf" "f%1 r f90 r f%2" f50+":"+(f50-5) ) cpp() LDCall.Function ("t_mov" 150) EndFor obb() '--------------------------------p xll=115 ldcall.Function2 ("tpos" 571 250) ox=t_x oy=t_y f50=70 skk="true cpp() LDCall.Function ("tstr" "f180 r f60 [:20:2 f8 t9 f60 l f15 l f90 [:20:2 f11 t-9 f195") LDCall.Function ("tstr" "l f20 l [:10:2 f5 t9 f155") obb() '--------------------------------d xll=115 ldcall.Function2 ("tpos" 871 250) ox=t_x oy=t_y f50=70 skk="true cpp() LDCall.Function ("tstr" "f180 r f60 [:10:2 f8 t9 f110 [:10:2 f8 t9 f30 l f15 l f60 [:10:2 f11 t-9 f110 [:10:2 f11 t-9 f195") LDCall.Function ("tstr" "l f20 l [:10:2 f5 t9 f155") obb() '--------------------------------g xll=115 ldcall.Function2 ("tpos" 1055 500) ox=t_x oy=t_y f50=70 skk="true t_angle=0 cpp() LDCall.Function ("tstr" "f80 r f30 [:10:2 f8 t9 f110 [:10:2 f8 t9 f90 l f15 l f120 [:10:2 f11 t-9 f110 [:10:2 f11 t-9 f131 l f100") obb() t_angle=180 '------------------------------l ldcall.Function2 ("tpos" 141 550) LDCall.Function ("tstr" " [:10:2 f5 t9 l f20 l f180 t-55 f85 l t-35 f20 t-55 [:11:2 f8 t5 f55 r f170") cpp() LDCall.Function ("t_mov" 156) obb() '--------------------------------n ldcall.Function2 ("tpos" 361 550) xll=85 f50=70 skk="true cpp() LDCall.Function ("t_mov" 150) LDCall.Function ("tstr" "r t55 f250 t-55 f10 l f195") cpp() LDCall.Function ("tstr" "f110 r t55 f200 t-55 f72 l f20 l") LDCall.Function ("tstr" "[:10:2 f5 t9 f150") obb() '--------------------------------r xll=115 ldcall.Function2 ("tpos" 611 550) f50=70 skk="true cpp() LDCall.Function ("tstr" "f175 r f60 [:20:2 f8 t9 f60 l f15 t-45 f120 [:5:2 f9 t-9 f40 l f20 l f15 t45 f120 t135 f30") LDCall.Function ("tstr" "[:20:2 f11 t-9 f198 l f20 l [:10:2 f5 t9 f153") obb() fff: '------------------------------f ldcall.Function2 ("tpos" 141 690) t_angle=0 LDCall.Function ("tstrm" "[:10:2 f5 t9 l f20 l f180 t-55 f85 l t-35 f20 t-55 [:11:2 f8 t5 f55 r f75 r f50 [:10:2 f5 t9 l f15 l f80 l f15 l [:10:2 f5 t9 f55 r f75") cppm() LDCall.Function ("t_mov" 156) obb() '------------------------------e ldcall.Function2 ("tpos" 390 690) t_angle=0 LDCall.Function ("tstrm" "[:10:2 f5 t9 l f20 l f180 t-55 f85 l t-35 f20 t-55 [:11:2 f8 t5 f55 r f85 r f50 [:10:2 f5 t9 l f15 l f80 l f15 l [:10:2 f5 t9 f55 r f85") LDCall.Function ("tstrm" "r f55 [:11:2 f8 t5 t-55 f15 l t-35 f85 t-55 f183 l f20 l [:10:2 f5 t9") LDCall.Function ("t_mov" 150) obb() '------------------------------t ldcall.Function2 ("tpos" 660 640) t_angle=0 LDCall.Function ("tstrm" "t-90 f150 t-55 f85 l t-35 f20 t-55 [:11:2 f8 t5 f2 r f170") cppm() LDCall.Function ("tstrm" "f175 r f2 [:11:2 f8 t5 t-55 f20 l t-35 f77 t-55 f44") obb() '------------------------------z ldcall.Function2 ("tpos" 900 860) t_angle=180 LDCall.Function ("tstr" "f30 l f180 t-55 f85 l t-35 f20 t-55 [:11:2 f8 t5 f55 r t35 f250 l t55 f20 l f170 t-55 f85 l t-35 f20 t-55 [:11:2 f8 t5 f50 r t35 f250") obb() EndSub Sub obb If obj Then GraphicsWindow.BrushColor=GraphicsWindow.PenColor pp=LDShapes.AddPolygon (oo) LDShapes.BrushPolygon (sst oo) 'LDShapes.AnimateOpacity (pp 600 5) LDShapes.SetShapeEvent (pp) LDEffect.DropShaddow (pp "") az[pp]=1 ii=1 oo=0 EndIf EndSub Sub tpos t_x=args[1]+dx t_y=args[2]+dy ox=t_x oy=t_y EndSub '--------------------------------------main not="true=false;false=true in=1 LDDialogs.AddRightClickMenu (LDText.Split("Zoom Zindx Rotate Color RotAll ZoomAll PanX PanY" " ") " ") LDDialogs.RightClickMenu=rmm sel="false im= ImageList.LoadImage ("e:\sttn.jpg") im1=LDImage.Copy(im) LDImage.EffectGamma (im 3) sst0=LDShapes.BrushImage (im) sst=LDShapes.BrushImage (im1) LDGraphicsWindow.BackgroundBrush ( sst0) dx=0 dy=0 obj="true LDCall.Function ("tstr" "w2 cgold") drr() LDGraphicsWindow.Reposition (.5 .5 0 0 0) 'GraphicsWindow.MouseDown=mdd LDShapes.ShapeEvent=see GraphicsWindow.MouseMove=mvv GraphicsWindow.MouseUp=muu LDEvents.MouseWheel=mww sc=.5 Sub rmm in= LDDialogs.LastRightClickMenuItem EndSub Sub mww If in=1 Then az[ssh]=az[ssh]+ LDEvents.LastMouseWheelDelta/15 Shapes.Zoom(ssh az[ssh] az[ssh]) ElseIf in=2 then zz[ssh]=zz[ssh]+ LDEvents.LastMouseWheelDelta LDShapes.ZIndex (ssh zz[ssh]) ElseIf in=3 then aa[ssh]=aa[ssh]+ LDEvents.LastMouseWheelDelta*3 Shapes.Rotate (ssh aa[ssh]) ElseIf in=4 then ah[ssh]=ah[ssh]+ LDEvents.LastMouseWheelDelta*5 LDShapes.BrushColour (ssh LDColours.HSLtoRGB ( ah[ssh] 1 .5)) Else If in=5 then an=an+LDEvents.LastMouseWheelDelta*3 ElseIf in=6 then sc=sc+LDEvents.LastMouseWheelDelta/10 ElseIf in=7 then pnx=pnx+LDEvents.LastMouseWheelDelta*5 Else pny=pny+LDEvents.LastMouseWheelDelta*5 endif LDGraphicsWindow.Reposition (sc sc pnx pny an) endif EndSub Sub muu sel="false Shapes.SetOpacity (ssh 99) EndSub Sub see ls= LDShapes.LastEventShape lt= LDShapes.LastEventType If lt="MouseDown" and not[sel] Then Shapes.SetOpacity (ls 60) ssh=ls sel="true ' GraphicsWindow.Title=ls EndIf If lt="MouseUp" Then Shapes.SetOpacity (ls 99) EndIf EndSub Sub mvv If sel then ldShapes.Centre (ssh GraphicsWindow.MouseX GraphicsWindow.MouseY ) endif EndSub sub t_Mov ds=args[1] mm=LDMath.Convert2Cartesian (t_x,t_y,ds, t_Angle-90 ) t_x= (mm[1]) t_y= (mm[2]) If obj Then oo[ii][1]=t_x oo[ii][2]=t_y ii=ii+1 elseIf penn then GraphicsWindow.DrawLine (ox,oy T_x T_y) endif ox=T_x oy=t_y EndSub End>LRB032.sb< Start>LRD036.sb< ' Questions about world countries by NaoChanON 2011/12/10 ' ' Controls.ButtonClicked=ControlClicked GraphicsWindow.MouseDown=Mouseclicked Init_data() init_window() Mark() UpDown_MARK() Question() Sub Mouseclicked MX= GraphicsWindow.MouseX MY= GraphicsWindow.MouseY If Math.Abs(MX-(dx[Qnmb[ans]]-4))<20 And Math.Abs(MY-(dy[Qnmb[ans]]-4))<20 Then Result=Result+1 Test_Result() Sound.PlayChime() Congratulation() Else Test_Result() Sound.PlayClickAndWait() Sound.PlayClick() Nogood() EndIf EndSub Sub ControlClicked name="" name=controls.LastClickedButton ' Last button nm=controls.GetButtonCaption(name) ' Button's caption If nm=qs[1] or nm=qs[2] Then QS_Country() elseif nm=qs[3] or nm=qs[4] then WQS_Country() elseif nm="▲" then QS_Up() elseif nm="▼" then QS_Down() elseif (NN=1 or NN=2) and nm=Answer then ' correct answer Result=Result+1 Test_Result() Sound.PlayChime() Congratulation() elseif (NN=1 or NN=2) and nm<>Answer then ' wrong answer Test_Result() Sound.PlayClickAndWait() Sound.PlayClick() Nogood() EndIf EndSub Sub Test_Result Shapes.Remove(Stest) Correct=Math.Floor(Result/Qnumber*1000)/10 GraphicsWindow.BrushColor="Red" stest=shapes.AddText("Question= "+Qnumber+" Correct answer= "+Result +" Rate= "+Correct+" %") Shapes.Animate(stest,200,40,1000) EndSub Sub Question GraphicsWindow.BrushColor="Navy" GraphicsWindow.FontName="Coorienew" GraphicsWindow.FontSize=30 Controls.Remove(sqs) sqs=Controls.AddButton(Qs[NN],100,600) Controls.SetSize(sqs,800,50) For i=1 To 5 Controls.Remove(BTN[i]) EndFor EndSub Sub QS_Country ' question abou Country name RMV_MSG() Qnumber=Qnumber+1 For i=1 To 5 RND=96 RND_Number() Qnmb[i]=RN ' select 5 countries or capitals exam[i]=Dat[NN][Qnmb[i]] ' Examples 5 countries or capitals QS_button() ' set button EndFor RND=5 RND_Number() ' select 1 number to make it correct answer ANS=RN ' Correct answer Answer=Dat[NN][Qnmb[ans]] Shapes.Animate(scr[1],dx[Qnmb[ANS]]-4,dy[Qnmb[ANS]]-4,1500) ' Question place EndSub Sub WQS_Country RMV_MSG() Qnumber=Qnumber+1 For i=1 To 5 RND=96 RND_Number() Qnmb[i]=RN ' select 5 countries or capitals Shapes.Animate(scr[Qnmb[i]],dx[Qnmb[i]]-4,dy[Qnmb[i]]-4,1500) ' Question place EndFor RND=5 RND_Number() ' select 1 number to make it correct answer ANS=RN ' Correct answer i=1 exam[i]=Dat[NN-2][Qnmb[ans]] QS_button() ' set button EndSub Sub QS_Up NN=NN+1 If NN>4 Then NN=4 EndIf Question() EndSub Sub QS_Down NN=NN-1 If NN<1 Then NN=1 EndIf Question() EndSub Sub UpDown_MARK GraphicsWindow.BrushColor="Red" GraphicsWindow.FontSize=20 sup=Controls.AddButton("▲",50,595) Controls.SetSize(sup,45,30) sdw=Controls.AddButton("▼",50,625) Controls.SetSize(sdw,45,30) EndSub Sub RND_Number ' gets randomnumber RN=math.GetRandomNumber(RND) EndSub Sub QS_Button ' Answers Controls.Remove(BTN[i]) GraphicsWindow.BrushColor="Green" BTN[i]=Controls.AddButton(EXAM[i],100+(i-1)*200,655) Controls.SetSize(BTN[i],195,50) EndSub Sub congratulation Shapes.Remove(smsg) GraphicsWindow.BrushColor="Navy" smsg=Shapes.AddText("Yes OK. Congratulation !") Shapes.Move(smsg,300,-50) Shapes.Animate(smsg,300,550,1000) Shapes.Zoom(smsg,2,2) EndSub Sub Nogood Shapes.Remove(smsg) GraphicsWindow.BrushColor="red" smsg=Shapes.AddText("No good. Study more!") Shapes.Move(smsg,300,-50) Shapes.Animate(smsg,300,550,1000) Shapes.Zoom(smsg,2,2) EndSub Sub Mark ' mark Capitals GraphicsWindow.PenColor="Red" GraphicsWindow.BrushColor="Yellow" For i=1 To 96 scr[i]=shapes.AddEllipse(10,10) Shapes.Move(scr[i],dx[i]-5,-50) Shapes.Animate(scr[i],dx[i]-5,dy[i]-5,1000) EndFor EndSub Sub RMV_MSG Shapes.Remove(smsg) ' remove message For j=1 To 96 Shapes.Animate(scr[j],500,-50,500) ' to hide shapes EndFor EndSub Sub Init_data ' Adress Country capital NN=1 ' Question number and Question QS[1]="(1) Select Country name : The name of this Country?" QS[2]="(2) Select Capital name : The name of this Capital?" QS[3]="(3) Select Country : Where is this Country?" QS[4]="(4) Select Capital : Where is this Capital?" d[1]="38,156,Iceland:Reykjavik" d[2]="58,323,Mauritania:Nouakchott" d[3]="75,257,Portugal:Lisbon" d[4]="82,201,Ireland:Dublin" d[5]="82,278,Morocco:Rabat" d[6]="85,339,Mali:Bamako" d[7]="94,252,Spain:Madrid" d[8]="103,207,England:London" d[9]="112,224,France:Paris" d[10]="117,270,Algeria:Algiers" d[11]="124,335,Niger:Niamey" d[12]="128,229,Switzerland:Bern" d[13]="134,352,Nigeria:Abu Dhabi" d[14]="135,268,Tunisia:Tunis" d[15]="137,174,Norway:Oslo" d[16]="137,371,Gabon:Libreville" d[17]="140,194,Denmark:Copenhagen" d[18]="141,245,Italy:Rome" d[19]="142,215,Germany:Berlin" d[20]="148,415,Angola:Luanda" d[21]="151,285,Libya:Tripoli" d[22]="151,390,Republic of the Congo:Brazzaville" d[23]="152,452,Namibia:Windhoek" d[24]="153,226,Austria:Vienna" d[25]="159,394,Democratic Republic of the Congo:Kinshasa" d[26]="160,174,Sweden:Stockholm" d[27]="169,208,Poland:Warsaw" d[28]="169,364,Central African Republic:Bangui" d[29]="173,452,Botswana:Gaborone" d[30]="175,262,Greece:Athens" d[31]="177,169,Finland:Helsinki" d[32]="179,242,Bulgaria:Sofia" d[33]="187,237,Romania:Bucharest" d[34]="191,429,Zambia:Lusaka" d[35]="192,460,South Africa:Pretoria" d[36]="193,200,Belarus:Minsk" d[37]="200,289,Egypt:Cairo" d[38]="205,339,Sudan:Khartoum" d[39]="208,218,Ukraine:Kiev" d[40]="209,255,Turkey:Ankara" d[41]="209,456,Mozambique:Maputo" d[42]="218,402,Tanzania:Dodoma" d[43]="219,385,Kenya:Nairobi" d[44]="221,275,Syria:Damascus" d[45]="226,193,Russia:Moscow" d[46]="227,354,Ethiopia:Addis Ababa" d[47]="244,275,Iraq:Baghdad" d[48]="244,373,Somalia:Mogadishu" d[49]="246,333,Yemen:Sanaa" d[50]="252,287,Kuwait:Kuwait City" d[51]="257,438,Madagascar:Antananarivo" d[52]="262,302,Qatar:Doha" d[53]="270,271,Iran:Tehran" d[54]="289,311,Oman:Muscat" d[55]="317,275,Afghanistan:Kabul" d[56]="326,210,Kazakhstan:Astana" d[57]="332,278,Pakistan:Islamabad" d[58]="343,297,India:New Delhi" d[59]="357,356,Sri Lanka:Sri Jayawardenapura-Kotte" d[60]="372,294,Nepal:Kathmandu" d[61]="399,304,Bangladesh:Dhaka" d[62]="406,319,Myanmar:Naypyidaw" d[63]="423,340,Thailand:Bangkok" d[64]="427,322,Laos:Vientiane" d[65]="427,374,Malaysia:Kuala Lumpur" d[66]="435,345,Cambodia:Phnom Penh" d[67]="436,222,Mongolia:Ulaanbaatar" d[68]="439,317,Vietnam:Hanoi" d[69]="442,400,Indonesia:Jakarta" d[70]="466,367,Brunei:Bandar Seri Begawan" d[71]="473,253,China:Beijing" d[72]="484,334,Philippines:Manila" d[73]="499,255,North Korea:Pyongyang" d[74]="505,264,South Korea:Seoul" d[75]="544,266,Japan:Tokyo" d[76]="563,404,Papua New Guinea:Port Moresby" d[77]="575,489,Australia:Canberra" d[78]="657,509,New Zealand:Wellington" d[79]="920,310,Mexico:Mexico City" d[80]="969,344,Nicaragua:Managua" d[81]="984,355,Panama:Panama City" d[82]="985,312,Cuba:Havana" d[83]="990,232,Canada:Ottawa" d[84]="991,381,Ecuador:Quito" d[85]="994,256,America:NewYork" d[86]="997,419,Peru:Lima" d[87]="1002,363,Colombia:Bogota" d[88]="1013,482,Chile:Santiago" d[89]="1015,323,Dominica:Roseau" d[90]="1027,353,Venezuela:Caracas" d[91]="1028,435,Bolivia:La Paz" d[92]="1054,492,Argentina:Buenos Aires" d[93]="1058,457,Paraguay:Asuncion" d[94]="1061,485,Uruguay:Montevideo" d[95]="1062,367,Suriname:Paramaribo" d[96]="1086,427,Brazil:Brasilia" For i=1 To 96 midp="" midP2="" midP=Text.GetIndexOf(d[i],",") dx[i]=text.GetSubText(d[i],1,midP-1) ' Place -X dy[i]=text.GetSubText(d[i],midP+1,3) ' Place-Y midP2=Text.GetIndexOf(d[i],":") Dat[1][i]=Text.GetSubText(d[i],midp+5,(MidP2-midP-5)) ' Contry Name Dat[2][i]=Text.GetSubTextToEnd(d[i],midp2+1) ' capital Name EndFor EndSub Sub init_window ' shows World Map GraphicsWindow.left=50 GraphicsWindow.top=0 GraphicsWindow.Width=1200 GraphicsWindow.Height=765 url="http://gpscycling.net/fland/map/pj/07_mille.gif" 'url=Program.Directory+"\07_mille.gif" map=imagelist.LoadImage(url) GraphicsWindow.DrawResizedImage(map,0,0,1200,760) GraphicsWindow.Show() GraphicsWindow.BrushColor="Navy" GraphicsWindow.FontSize="30 GraphicsWindow.FontName="Coorienew" GraphicsWindow.FontItalic="true" GraphicsWindow.DrawText(350,10," The question about geography ") EndSub End>LRD036.sb< Start>LRD998.sb< r200=150 GraphicsWindow.BackgroundColor ="darkblue GraphicsWindow.BrushColor="gold GraphicsWindow.Width=900 GraphicsWindow.Height=900 GraphicsWindow.Left=5 GraphicsWindow.Top=5 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=60 ya=30 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) i=1 GraphicsWindow.Title="3D dog dd=":" args=0 GraphicsWindow.BrushColor=LDColours.HSLtoRGB (30 .9 .7) a2=3 r20=40 w="-1 4 0:0 0 0:10 0 0 LD3DView.AddTube (view3D w 1 12 GraphicsWindow.BrushColor "D") hh=LD3DView.AddSphere (view3D 1.3 20 GraphicsWindow.BrushColor "D") LD3DView.TranslateGeometry (view3D hh, -1 4 0) While "true For r=r20 To 180-r20 Step a2 mcam() endfor For r=180-r20 To r20 Step -a2 mcam() EndFor endwhile Sub mtub cc=ldtext.Replace (args[1] "d5" 3) return=LD3DView.AddTube (view3D cc 1 12 GraphicsWindow.BrushColor "D") EndSub sub mcam r5=5 py=-ldmath.Sin(r)*r5 px=ldmath.cos(r)*r5 px1=ldmath.cos(180-r)*r5 w="0 0 0:0 0 d5:"+px+dd+py+dd+":d5 ww="0 0 0:0 0 -d5:"+px1+dd+py+dd+":-d5 tt=LDCall.Function ("mtub" w ) tt1=LDCall.Function ("mtub" ww ) r5=5 py=-ldmath.Sin(r)*r5 px=ldmath.cos(r)*r5+10 px1=ldmath.cos(180-r)*r5+10 w="10 0 0:10 0 d5:"+px+dd+py+dd+":d5 ww="10 0 0:10 0 -d5:"+px1+dd+py+dd+":-d5 qtt=LDCall.Function ("mtub" w ) qtt1=LDCall.Function ("mtub" ww ) px= LDMath.Cos(aa) py= LDMath.sin (aa) LD3DView.ResetCamera(view3D, px*r35,ya,py*r35, -px, -.5, -py, "","","") aa=aa+.55 ' LD3DView.TranslateGeometry (view3D tt LDMath.Cos(aa)*r20 LDMath.sin(aa)*r20 r*5) Program.Delay (33) LD3DView.ModifyObject (view3D tt "X") LD3DView.ModifyObject (view3D tt1 "X") LD3DView.ModifyObject (view3D qtt "X") LD3DView.ModifyObject (view3D qtt1 "X") EndSub End>LRD998.sb< Start>LRJ038-0.sb< GraphicsWindow.Title = "Fishes args=0 Init() GraphicsWindow.BackGroundColor = "#3F48CC" GraphicsWindow.BrushColor="pink GraphicsWindow.PenWidth = 2 sh[1]=Shapes.AddTriangle (0 200 0 140 40 160) GraphicsWindow.BrushColor ="black sh[2]=Shapes.AddTriangle (0 140 40 160 85 70) sh[3]=Shapes.AddTriangle (0 140 85 70 45 50) mirr="true LDCall.Function2 ("drwfish" 1100 400) mirr="false LDCall.Function2 ("drwfish" 100 100) Sub drwfish ofsx=args[1] ofsy=args[2] GraphicsWindow.PenWidth = 15 ' back fin param = "x1=200;y1=100;x2=400;y2=20;x3=400;y3=150 DrawTriangle() ' tail fin param = "x1=400;y1=225;x2=550;y2=150;x3=550;y3=300 DrawTriangle() ' body GraphicsWindow.BrushColor = "#99D9EA" If mirr Then GraphicsWindow.FillEllipse(ofsx-100-350 70+ofsy 350, 300) param = "x=450;y=70;width=350;height=300 DrawEllipse() else GraphicsWindow.FillEllipse(100+ofsx 70+ofsy 350, 300) param = "x=100;y=70;width=350;height=300 DrawEllipse() endif ' eye GraphicsWindow.BrushColor = "Black" If mirr Then GraphicsWindow.FillEllipse(ofsx-150-40 160+ofsy 40, 40) param = "x=190;y=160;width=40;height=40 DrawEllipse() else GraphicsWindow.FillEllipse(150+ofsx 160+ofsy 40, 40) param = "x=150;y=160;width=40;height=40 DrawEllipse() endif par = "x1=110;y1=260;x2=140;y2=240|x1=220;y1=120;x2=245;y2=200|x1=245;y1=200;x2=200;y2=300 pp=ldtext.Split (par "|") For r=1 to 3 param=pp[r] DrawLine() endfor 'pectoral fin param = "x1=220;y1=300;x2=280;y2=275;x3=280;y3=325;" DrawTriangle() EndSub For q=1 To 3 Shapes.HideShape (sh[q]) EndFor Sub Init gw = 1200 gh = 900 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Left =10 GraphicsWindow.top=10 EndSub Sub DrawGrid pwSaved = GraphicsWindow.PenWidth pcSaved = GraphicsWindow.PenColor GraphicsWindow.PenWidth = 1 GraphicsWindow.PenColor = "Cyan" For x = 0 To gw Step 50 GraphicsWindow.DrawLine(x, 0, x, gh) EndFor For y = 0 To gh Step 50 GraphicsWindow.DrawLine(0, y, gw, y) EndFor GraphicsWindow.PenColor = pcSaved GraphicsWindow.PenWidth = pwSaved EndSub Sub mvpen For q=1 To 3 Shapes.Move(sh[q] args[1]+10 args[2]-190) EndFor EndSub Sub DrawTriangle paramSaved = param _x1 = param["x1"] _y1 = param["y1"] _x2 = param["x2"] _y2 = param["y2"] _x3 = param["x3"] _y3 = param["y3"] param = "x1=" + _x1 + ";y1=" + _y1 + ";x2=" + _x2 + ";y2=" + _y2 + ";" DrawLine() param = "x1=" + _x2 + ";y1=" + _y2 + ";x2=" + _x3 + ";y2=" + _y3 + ";" DrawLine() param = "x1=" + _x3 + ";y1=" + _y3 + ";x2=" + _x1 + ";y2=" + _y1 + ";" DrawLine() param = paramSaved EndSub Sub DrawLine pc = GraphicsWindow.PenColor bc = GraphicsWindow.BrushColor GraphicsWindow.BrushColor = pc pw = GraphicsWindow.PenWidth x1 = param["x1"]+ofsx y1 = param["y1"]+ofsy x2 = param["x2"]+ofsx y2 = param["y2"]+ofsy If mirr Then x1 = ofsx-param["x1"] x2 = ofsx-param["x2"] endif 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 = 0'Math.GetRandomNumber(2) - 1 _dy = 0'Math.GetRandomNumber(2) - 1 _pw = pw'(Math.GetRandomNumber(2) / 10 + 0.9) * pw GraphicsWindow.FillEllipse(x - _pw / 2 + _dx, y - _pw / 2 + _dy, _pw, _pw) LDCall.Function2("mvpen" x - _pw / 2 + _dx, y - _pw / 2) Program.Delay (13) EndFor GraphicsWindow.BrushColor = bc EndSub Sub DrawEllipse pc = GraphicsWindow.PenColor bc = GraphicsWindow.BrushColor GraphicsWindow.BrushColor = pc pw = GraphicsWindow.PenWidth x = param["x"]+ofsx y = param["y"]+ofsy If mirr Then x=ofsx-param["x"] EndIf 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/2 _x = (x + a) + a * Math.Cos(θ) _y = (y + b) + b * Math.Sin(θ) _dx =0 _dy = 0 _pw = pw GraphicsWindow.FillEllipse(_x - _pw / 2 + _dx, _y - _pw / 2 + _dy, _pw, _pw) LDCall.Function2("mvpen" _x - _pw / 2 + _dx, _y - _pw / 2) Program.Delay (3) EndFor GraphicsWindow.BrushColor = bc EndSub End>LRJ038-0.sb< Start>LRJ038-1.sb< GraphicsWindow.Title = "Fish & Frog args=0 Init() GraphicsWindow.BackGroundColor = "#3F48CC GraphicsWindow.BrushColor="pink GraphicsWindow.PenWidth = 0 sh[1]=Shapes.AddTriangle (0 200 0 140 40 160) GraphicsWindow.BrushColor ="black sh[2]=Shapes.AddTriangle (0 140 40 160 85 70) sh[3]=Shapes.AddTriangle (0 140 85 70 45 50) For r=1 to 3 LDShapes.ZIndex (sh[r] 2000) endfor drwfrog() mirr="true LDCall.Function2 ("drwfish" 1100 200) For q=1 To 3 Shapes.HideShape (sh[q]) EndFor For r=0 to 360 Step .5 cc=LDMath.Cos(r)*1.3 LDGraphicsWindow.Reposition (cc cc 0 0 r) endfor For r=360 to 0 Step -.5 cc=LDMath.Cos(r)*1.3 LDGraphicsWindow.Reposition (cc cc 0 0 r) endfor cc=.8 LDGraphicsWindow.Reposition (cc cc 0 0 r) Sub drwfish ofsx=args[1] ofsy=args[2] ' back fin xi=-500 param = "x1=200;y1=100;x2=400;y2=20;x3=400;y3=150 DrawTriangle() ' tail fin xi=-555 param = "x1=400;y1=225;x2=550;y2=150;x3=550;y3=300 DrawTriangle() ' body GraphicsWindow.BrushColor = "#FF99D9EA If mirr Then xi=200 ldcall.Function4 ("dEllipse" ofsx-100-350 70+ofsy 350, 300) param = "x=450;y=70;width=350;height=300 DrawEllipse() else xi=200 ldcall.Function4 ("dEllipse" 100+ofsx 70+ofsy 350, 300) param = "x=100;y=70;width=350;height=300 DrawEllipse() endif ' eye GraphicsWindow.BrushColor = "Black" If mirr Then ldcall.Function4 ("dEllipse" ofsx-150-40 160+ofsy 40, 40) else ldcall.Function4 ("dEllipse" 150+ofsx 160+ofsy 40, 40) endif xi=300 GraphicsWindow.BrushColor = "darkblue par = "x1=110;y1=260;x2=140;y2=240|x1=220;y1=120;x2=245;y2=200|x1=245;y1=200;x2=200;y2=300 pp=ldtext.Split (par "|") For r=1 to 3 param=pp[r] DrawLine() endfor 'pectoral fin xi=555 param = "x1=220;y1=300;x2=280;y2=275;x3=280;y3=325;" DrawTriangle() EndSub Sub drwfrog GraphicsWindow.BrushColor ="white xi=-100 ldcall.Function4 ("dEllipse" 200, 100, 70, 70) ldcall.Function4 ("dEllipse" 330, 100, 70, 70) 'GraphicsWindow.PenWidth=12 param = "x=200;y=100;width=70;height=70 DrawEllipse() param = "x=330;y=100;width=70;height=70;" DrawEllipse() xi=-100 GraphicsWindow.BrushColor = "Lime" ldcall.Function4 ("dEllipse" 250, 270, 100, 150) param = "x=250;y=270;width=100;height=150;" DrawEllipse() xi=-100 ldcall.Function4 ("dEllipse" 200, 170, 200, 100) param = "x=200;y=170;width=200;height=100;" DrawEllipse() par = "x1=230;y1=135;x2=240;y2=135|x1=360;y1=135;x2=370;y2=135|x1=200;y1=220;x2=400;y2=220|x1=250;y1=310;x2=150;y2=210|x1=150;y1=240;x2=180;y2=240|x1=180;y1=210;x2=180;y2=240 pp=ldtext.Split (par "|") For r=1 to Array.GetItemCount (pp) param=pp[r] DrawLine() endfor DrawLine() EndSub Sub Init gw = 1200 gh = 900 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Left =10 GraphicsWindow.top=10 EndSub Sub mvpen For q=1 To 3 Shapes.Move(sh[q] args[1]+10 args[2]-190) EndFor EndSub Sub DrawTriangle paramSaved = param _x1 = param["x1"] _y1 = param["y1"] _x2 = param["x2"] _y2 = param["y2"] _x3 = param["x3"] _y3 = param["y3"] param = "x1=" + _x1 + ";y1=" + _y1 + ";x2=" + _x2 + ";y2=" + _y2 + ";" DrawLine() param = "x1=" + _x2 + ";y1=" + _y2 + ";x2=" + _x3 + ";y2=" + _y3 + ";" DrawLine() param = "x1=" + _x3 + ";y1=" + _y3 + ";x2=" + _x1 + ";y2=" + _y1 + ";" DrawLine() param = paramSaved EndSub Sub DrawLine pc = GraphicsWindow.PenColor bc = GraphicsWindow.BrushColor GraphicsWindow.BrushColor = pc x1 = param["x1"]+ofsx y1 = param["y1"]+ofsy x2 = param["x2"]+ofsx y2 = param["y2"]+ofsy If mirr Then x1 = ofsx-param["x1"] x2 = ofsx-param["x2"] endif len = Math.SquareRoot((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1)) For k = 0 To 1 Step pw / len /2 x = x1 * (1 - k) + x2 * k y = y1 * (1 - k) + y2 * k ldcall.Function4 ("dEllipse" x - pw / 2 , y - pw / 2 , pw, pw) LDCall.Function2("mvpen" x - pw / 2 , y - pw / 2) Program.Delay (13) EndFor GraphicsWindow.BrushColor = bc EndSub Sub DrawEllipse pc = GraphicsWindow.PenColor bc = GraphicsWindow.BrushColor GraphicsWindow.BrushColor = pc pw =12 x = param["x"]+ofsx y = param["y"]+ofsy If mirr Then x=ofsx-param["x"] EndIf width = param["width"] height = param["height"] a = width / 2 b = height / 2 len = 2 * Math.Pi * Math.Max(a, b) If len>500 then s5=2 Else s5=5 endif For θ = 0 To 360 Step s5 _x = (x + a) + a * ldMath.Cos(θ) _y = (y + b) + b * ldMath.Sin(θ) ldcall.Function4 ("dEllipse" _x - pw / 2 , _y - pw / 2, pw, pw) LDCall.Function2("mvpen" _x - pw / 2, _y - pw / 2) Program.Delay (3) EndFor GraphicsWindow.BrushColor = bc EndSub Sub dellipse ee=Shapes.AddEllipse (args[3] args[4]) ecc=ecc+1 'GraphicsWindow.Title =ecc shapes.Move (ee args[1] args[2]) LDShapes.ZIndex (ee xi) xi=xi+1 EndSub End>LRJ038-1.sb< Start>LRJ038.sb< ' Fish ' Version 0.1 ' Copyright © 2016 Nonki Takahashi. The MIT License. ' Program ID GraphicsWindow.Title = "Fish" Init() GraphicsWindow.PenWidth = 15 GraphicsWindow.BackGroundColor = "#3F48CC" DrawGrid() ' back fin param = "x1=200;y1=100;x2=400;y2=20;x3=400;y3=150;" DrawTriangle() ' tail fin param = "x1=400;y1=225;x2=550;y2=150;x3=550;y3=300;" DrawTriangle() ' body GraphicsWindow.BrushColor = "#99D9EA" GraphicsWindow.FillEllipse(100, 70, 350, 300) param = "x=100;y=70;width=350;height=300;" DrawEllipse() ' eye GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillEllipse(150, 160, 40, 40) param = "x=150;y=160;width=40;height=40;" DrawEllipse() ' mouth param = "x1=110;y1=260;x2=140;y2=240;" DrawLine() ' gill param = "x1=220;y1=120;x2=245;y2=200;" DrawLine() param = "x1=245;y1=200;x2=200;y2=300;" DrawLine() ' pectoral fin param = "x1=220;y1=300;x2=280;y2=275;x3=280;y3=325;" DrawTriangle() Sub Init gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh EndSub Sub DrawGrid pwSaved = GraphicsWindow.PenWidth pcSaved = GraphicsWindow.PenColor GraphicsWindow.PenWidth = 1 GraphicsWindow.PenColor = "Cyan" For x = 0 To gw Step 50 GraphicsWindow.DrawLine(x, 0, x, gh) EndFor For y = 0 To gh Step 50 GraphicsWindow.DrawLine(0, y, gw, y) EndFor GraphicsWindow.PenColor = pcSaved GraphicsWindow.PenWidth = pwSaved EndSub Sub DrawTriangle paramSaved = param _x1 = param["x1"] _y1 = param["y1"] _x2 = param["x2"] _y2 = param["y2"] _x3 = param["x3"] _y3 = param["y3"] param = "x1=" + _x1 + ";y1=" + _y1 + ";x2=" + _x2 + ";y2=" + _y2 + ";" DrawLine() param = "x1=" + _x2 + ";y1=" + _y2 + ";x2=" + _x3 + ";y2=" + _y3 + ";" DrawLine() param = "x1=" + _x3 + ";y1=" + _y3 + ";x2=" + _x1 + ";y2=" + _y1 + ";" DrawLine() param = paramSaved EndSub 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>LRJ038.sb< Start>LRL116.sb< '#############QUIZ WIZ############ ' By Zack Scott May 2009 '################################# 'variables and startup roundCount = 0 'roundcount counts every question answered and increases the round at intevals of 10 round = 1 'round increases the difficulty and adds more mathematic operations score = 0 'score is your score max = 40 'max is the max number of questions count = 0 'count counts the number of questions answered (for max) startupProc()'calls the startup procedure newquestion:'location info for goto repretition roundCount = roundCount + 1'roundcount is for extensability, it counts up per questyion for the purpose of modifying the round at certain intervals (in this case 10) If roundCount = 10 Then 'checks if roundCount is equivelant to a change interval, if so, changes round round = round + 1 ElseIf roundCount = 20 Then round = round + 1 ElseIf roundCount = 30 Then round = round + 1 ElseIf roundCount = max Then 'if the questions answered reaches the max number of questions it calls winScore winScore() EndIf 'timer and question generatioon variables and booleans WaitingForAnswer = "True" ClockTimer = 0 TimerExpired = "False" 'graphicwindow options which are reset every repetition GraphicsWindow.BackgroundColor = "#542437" 'colours bgColour = GraphicsWindow.BackgroundColor 'colours GraphicsWindow.Clear() GraphicsWindow.BrushColor = "#C02942" 'colours brushColour = GraphicsWindow.BrushColor 'colours GraphicsWindow.PenColor = "#ECD078" 'colours penColour = GraphicsWindow.PenColor 'colours GraphicsWindow.Title = "Educational Game - Quiz Wiz!" 'title GraphicsWindow.Height = "350" 'height GraphicsWindow.Width = "600" 'width GraphicsWindow.FontName = "Calibri" 'font GraphicsWindow.FontSize = 28 'font size 'other variables not central to the startup procedure and more important in repetition GraphicsWindow.DrawText(2, 2, "Score: " + score + "/" + count) 'displays the score random = 0 '#### end startup used in main ####' '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 'now removed submit button code 'submitButtonX = GraphicsWindow.Width - 380 'submission button 'submitButtonY = GraphicsWindow.Height - 115 'submission button '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 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) 'now removed submit button code 'GraphicsWindow.FillRectangle(submitButtonX, submitButtonY, buttonWidth, buttonHeight) 'GraphicsWindow.DrawRectangle(submitButtonX, submitButtonY, buttonWidth, buttonHeight) '###drawing text### GraphicsWindow.BrushColor = "#ECD078" GraphicsWindow.DrawText(buttonOneX + 25, buttonOneY + 30, "") 'answer 1 goes here GraphicsWindow.DrawText(buttonTwoX + 25, buttonTwoY + 30,"") 'answer 2 would go here GraphicsWindow.DrawText(buttonThreeX + 25, buttonThreeY + 30,"")'answer 3 would go here GraphicsWindow.MouseDown = handleClick 'GraphicsWindow.DrawText(30, 50, "SmallBasic Quiz Game") needs to be done with images 'round number and operation printing 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 GraphicsWindow.FontSize = 48 GraphicsWindow.BrushColor = "#D95B43" spaceSize = 40 symbolMax = round symbol = Math.GetRandomNumber(symbolMax) If round = 1 and symbol = 1 Then oneMaxObjective = 99 twoMaxObjective = 99 ElseIf round = 2 and symbol = 1 Then oneMaxObjective = 500 twoMaxObjective = 499 ElseIf round = 3 and symbol = 1 Then oneMaxObjective = 1000 twoMaxObjective = 1000 ElseIf round = 4 and symbol = 1 Then oneMaxObjective = 10000 twoMaxObjective = 10000 'elseif round = 5 and symbol = 1 then unneeded round 5 code ' oneMaxObjective = 1000000 ' twoMaxObjective = 1000000 ElseIf round = 2 and symbol = 2 Then oneMaxObjective = 700 twoMaxObjective = 599 ElseIf round = 3 and symbol = 2 Then oneMaxObjective = 1000 twoMaxObjective = 1000 ElseIf round = 4 and symbol = 2 Then oneMaxObjective = 10000 twoMaxObjective = 10000 ElseIf round = 3 and symbol = 3 Then oneMaxObjective = 150 twoMaxObjective = 8 ElseIf round = 4 and symbol = 3 Then oneMaxObjective = 500 twoMaxObjective = 25 ElseIf round = 4 and symbol = 4 Then oneMaxObjective = 150 twoMaxObjective = 30 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" 'randomizationSymbol if goes here 'level of random addition and subtraction goes here 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 'regen: If symbol = 1 Then symbolVerbal = "+" If correctAnswer = 1 Then answerOne = integerOne + integerTwo answerTwo = integerOne + integerTwo - Math.GetRandomNumber(randomLevel) answerThree = integerOne + integerTwo + 10 'Math.GetRandomNumber(randomLevel) correctAnswerValue = answerOne ElseIf correctAnswer = 2 Then answerOne = integerOne + integerTwo + Math.GetRandomNumber(randomLevel) answerTwo = integerOne + integerTwo answerThree = integerOne + integerTwo + 10 'Math.GetRandomNumber(randomLevel) correctAnswerValue = answerTwo ElseIf correctAnswer = 3 Then answerOne = integerOne + integerTwo + Math.GetRandomNumber(randomLevel) answerTwo = integerOne + integerTwo - Math.GetRandomNumber(randomLevel) answerThree = integerOne + integerTwo correctAnswerValue = answerThree EndIf ElseIf symbol = 2 Then symbolVerbal = "-" If correctAnswer = 1 Then answerOne = integerOne - integerTwo answerTwo = integerOne - integerTwo + Math.GetRandomNumber(randomLevel) answerThree = integerOne - integerTwo - 10 'Math.GetRandomNumber(randomLevel) correctAnswerValue = answerOne ElseIf correctAnswer = 2 Then answerOne = integerOne - integerTwo - Math.GetRandomNumber(randomLevel) answerTwo = integerOne - integerTwo answerThree = integerOne - integerTwo - Math.GetRandomNumber(randomLevel) correctAnswerValue = answerTwo ElseIf correctAnswer = 3 Then answerOne = integerOne - integerTwo - Math.GetRandomNumber(randomLevel) answerTwo = integerOne - integerTwo + Math.GetRandomNumber(randomLevel) answerThree = integerOne - integerTwo correctAnswerValue = answerThree EndIf ElseIf symbol = 3 Then symbolVerbal = "x" If correctAnswer = 1 Then answerOne = integerOne * integerTwo answerTwo = integerOne * integerTwo + Math.GetRandomNumber(randomLevel) answerThree = integerOne * integerTwo - Math.GetRandomNumber(randomLevel) correctAnswerValue = answerOne ElseIf correctAnswer = 2 Then answerOne = integerOne * integerTwo - Math.GetRandomNumber(randomLevel) answerTwo = integerOne * integerTwo answerThree = integerOne * integerTwo + Math.GetRandomNumber(randomLevel) correctAnswerValue = answerTwo ElseIf correctAnswer = 3 Then answerOne = integerOne * integerTwo - Math.GetRandomNumber(randomLevel) answerTwo = integerOne * integerTwo - Math.GetRandomNumber(randomLevel) answerThree = integerOne * integerTwo correctAnswerValue = answerThree EndIf ElseIf symbol = 4 Then symbolVerbal = "÷" If correctAnswer = 1 Then answerOne = integerOne / integerTwo answerOne = Math.Round(answerOne) answerTwo = integerOne / integerTwo + Math.GetRandomNumber(randomLevel) answerTwo = math.Round(answerTwo) answerThree = integerOne / integerTwo - Math.GetRandomNumber(randomLevel) answerThree = Math.Round(answerthree) correctAnswerValue = answerOne ElseIf correctAnswer = 2 Then answerOne = integerOne / integerTwo - Math.GetRandomNumber(randomLevel) answerOne = Math.Round(answerOne) answerTwo = integerOne / integerTwo answerTwo = math.Round(answerTwo) answerThree = integerOne / integerTwo + Math.GetRandomNumber(randomLevel) answerThree = Math.Round(answerthree) correctAnswerValue = answerTwo ElseIf correctAnswer = 3 Then answerOne = integerOne / integerTwo - Math.GetRandomNumber(randomLevel) answerOne = Math.Round(answerOne) answerTwo = integerOne / integerTwo - Math.GetRandomNumber(randomLevel) answerTwo = math.Round(answerTwo) answerThree = integerOne / integerTwo answerThree = Math.Round(answerthree) correctAnswerValue = answerThree EndIf EndIf 'answer one symbol two code here 'spacing code 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 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 countdown = ImageList.LoadImage("G:/Basic/Time.jpg") 'image used to display text above timer in the centre 'arrow = ImageList.LoadImage("G:/Basic/Arrow2.jpg") 'unneeded arrow code originally was to be used to point out which answer was correct GraphicsWindow.DrawImage(countdown, 215, 115) GraphicsWindow.FillRectangle(buttonTwoX - 20, 150, 200, 30) GraphicsWindow.BrushColor = "#F02942" timeCount = 0 'used for timer While (WaitingForAnswer = "True") 'while loop to check if program is waiting for an answer ClockTimer = ClockTimer + 1 Program.Delay(100) GraphicsWindow.FillRectangle((buttonTwoX - 20) + (timeCount * 2) , 150, 2, 30) timeCount = timeCount + 1 If (ClockTimer > 100) Then WaitingForAnswer = "False" TimerExpired = "True" count = count + 1 textwindow.WriteLine("Times up! Your score is " + score + "/" + count + ".") handleClick() EndIf EndWhile TimerExpired = "False" Goto newquestion 'repition 'function for handling a click on the button' Sub handleClick WaitingForAnswer = "False" xpos = GraphicsWindow.MouseX ypos = GraphicsWindow.MouseY 'checks if you clicked inside the button 'button one check If(xpos > buttonOneX And xpos < (buttonOneX + buttonWidth)) and (ypos > buttonOneY And ypos < (buttonOneY + buttonHeight)) Then If correctAnswer = 1 Then score = score + 1 count = count + 1 TextWindow.WriteLine("Correct, your score is " + score + "/" + count + ".") Else count = count + 1 TextWindow.WriteLine("Incorrect, your score is " + score + "/" + count + ". The correct answer was number " + correctAnswer +": " + correctAnswerValue + ".") If correctAnswer = 2 Then 'the correct answer was 2 'GraphicsWindow.DrawImage(arrow, 26, 480) ElseIf correctAnswer = 3 then 'the correct answer was 3 EndIf EndIf ElseIf(xpos > buttonTwoX And xpos < (buttonTwoX + buttonWidth)) and (ypos > buttonTwoY And ypos < (buttonTwoY + buttonHeight)) Then If correctAnswer = 2 Then score = score + 1 count = count + 1 TextWindow.WriteLine("Correct, your score is " + score + "/" + count + ".") 'button two check Else count = count + 1 TextWindow.WriteLine("Incorrect, your score is " + score + "/" + count + ". The correct answer was number " + correctAnswer +": " + correctAnswerValue + ".") If correctAnswer = 1 then 'the correct answer was 1 ElseIf correctAnswer = 3 then 'the correct answer was 3 EndIf EndIf ElseIf(xpos > buttonThreeX And xpos < (buttonThreeX + buttonWidth)) and (ypos > buttonThreeY And ypos < (buttonThreeY + buttonHeight)) Then If correctAnswer = 3 Then score = score + 1 count = count + 1 TextWindow.WriteLine("Correct, your score is " + score + "/" + count + ".") 'button two check Else count = count + 1 TextWindow.WriteLine("Incorrect, your score is " + score + "/" + count + ". The correct answer was number " + correctAnswer +": " + correctAnswerValue + ".") If correctAnswer = 1 Then 'the correct answer was 1 ElseIf correctAnswer = 2 Then 'the correct answer was 2 EndIf EndIf EndIf EndSub Sub startupProc 'other stuff done during startup WaitingForAnswer = "False" TextWindow.WriteLine("###########-WELCOME TO QUIZ WIZ-##########") GraphicsWindow.Show() GraphicsWindow.BackgroundColor = "black" quizSplash = ImageList.LoadImage("G:/Basic/Quiz.jpg") GraphicsWindow.DrawImage(quizSplash, 15, 76) Program.Delay(2500) EndSub Sub winScore 'after player has done max questions -- displays score WaitingForAnswer = "False" 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!") EndIf TextWindow.WriteLine("Your score was below average, good luck next time") TextWindow.WriteLine("###################################") EndSub '########### UNNEEDED CODE ########### 'symbolDirect = * ' If correctAnswer = 1 and round = 1 then ' If randomizationSymbol = 1 then ' answerOne = answerOne - Math.GetRandomNumber(25) ' If randomizationSymbolTwo = 1 then ' answerTwo = answerTwo - Math.GetRandomNumber(25) ' ElseIf randomizationSymbolTwo = 2 then ' answerTwo = answerTwo + Math.GetRandomNumber(25) ' endif ' ElseIf randomizationSymbol = 2 then ' If randomizationSymbolTwo = 1 then ' answerTwo = answerTwo - Math.GetRandomNumber(25) ' ElseIf randomizationSymbolTwo = 2 then ' answerTwo = answerTwo + Math.GetRandomNumber(25) ' endIf ' EndIf ' endif 'If answerOne <= 0 and if symbol = 2 then 'Goto regen '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 = 20 'elseIf answerOne >= -1000 And answerOne <= -9999 then ' answerSpacing = 30 End>LRL116.sb< Start>LRL417.sb< ' program by mathew ' program no RFQ073 ' program no width = 1366 'meters height = 700'meters GraphicsWindow.Height=height GraphicsWindow.Width=width GraphicsWindow.Top=0 GraphicsWindow.Left=0 GraphicsWindow.BackgroundColor="darkblue" t=0'time g = -9.8 x=0 y=700 ' _____________________drawing scales _______________________________ GraphicsWindow.brushcolor="white" GraphicsWindow.fontsize=15 for h_1 = 0 To height Step 100 GraphicsWindow.DrawText(0, height-h_1, h_1) endfor For w_1 = 0 To width Step 100 GraphicsWindow.DrawText(w_1,height - 30, w_1) endfor ' _________________________drawing boxes_____________________________ GraphicsWindow.brushcolor="white" GraphicsWindow.fontsize=20 GraphicsWindow.DrawText(900, 20, "Horizontal Velocity") GraphicsWindow.DrawText(900, 60, "Vertical Velocity") GraphicsWindow.DrawText(900, 100, "Height reached") GraphicsWindow.DrawText(900, 140, "relative Speed") GraphicsWindow.brushcolor="red" GraphicsWindow.fontsize=25 hvelocity=Controls.AddTextBox(1100, 20) vvelocity=Controls.AddTextBox(1100, 60) GraphicsWindow.BRUSHCOLOR="BLUE" box3=Controls.AddTextBox(1100, 100) Controls.SetTextBoxText(box3,"") GraphicsWindow.BRUSHCOLOR="darkgreen" box4=Controls.AddTextBox(1100, 140) Controls.SetTextBoxText(box4,"") ' _______________ mouse controls ___________________________________ launch = Controls.AddButton("Launch",1200, 200) GraphicsWindow.brushcolor="red" projectile =Shapes.AddEllipse(20, 20) Shapes.Move(projectile, 0,790) Controls.ButtonClicked=launching notanswer = "True" While notanswer If clicked = launch Then vvelocity=Controls.GetTextBoxText(vvelocity) hvelocity=Controls.GetTextBoxText(hvelocity) While objectheight>=0 proceed() 'TextWindow.WriteLine("Luach proceeded") endwhile notanswer="False" clicked="" Else 'TextWindow.WriteLine("nothing lciked") EndIf Program.Delay(250) endwhile ' TextWindow.WriteLine("ended") ' ______________________________ LAUNCH _____________________________________ Sub launching clicked= Controls.LastClickedButton 'TextWindow.WriteLine("Clicked") 'TextWindow.WriteLine("Button clicked was " + clicked) EndSub ' ___________________________ PLOT THE OBJECT _______________________________________ sub proceed t= t +0.1 objectheight = (vvelocity*t)+0.5*g*(t*t) objectdis = (hvelocity*t) 'TextWindow.WriteLine(objectdis + " , " + objectheight + "at time " + t) GraphicsWindow.DrawLine(x,y, objectdis, height-objectheight) x= objectdis y = height - objectheight Shapes.Move(projectile,x,y) Controls.setTextBoxtext(box3,objectheight) Controls.setTextBoxtext(box4,vvelocity-x) Program.Delay(100) 'TextWindow.WriteLine("Shot ball") endsub ' _________________________________ PHYSIC core EQUATION _________________________________ Sub equation If vvelocity <> "" And hvelocity <>"" then objectheight = (vvelocity*t)+0.5*g*(math.Power(t,2)) objectdis = (hvelocity*t) launch = "True" Else launch="False" EndIf endsub End>LRL417.sb< Start>LRM180.sb< 'Basic Challenge 2 'Write a program with 4 buttons, one in each corner or the GraphicsWindow. They will: 'Change the background colour 'Make a sound 'Show an image in the middle of the GraphicsWindow 'Clear the GraphicsWindow, but not the buttons! 'TO DO collect variables, init ?? Animate opn screen?? Preview Next pic & BG colour. flag_cap3 = 0 flag_clear = 0 SetGW() Message() LoadPic() Controls.Remove(openningMsg) Offsets() Controls.ButtonClicked = ButtonClicked AddButtons() While "true" If flag_cap3 = 1 Then 'load next pic didn't work in event routine Controls.SetButtonCaption(btn[3], "Wait a Sec") LoadPic() Controls.SetButtonCaption(btn[3], "Show Image") flag_cap3 = 0 ElseIf flag_clear = 1 Then AddButtons() flag_clear = 0 EndIf 'Program.Delay(20) not needed there's no events triggered EndWhile Sub ButtonClicked Sound.PlayClickAndWait() caption = Controls.GetButtonCaption(Controls.LastClickedButton) If caption = "BG Colour" Then GraphicsWindow.BackgroundColor = GraphicsWindow.GetRandomColor() ElseIf caption = "Make Sound" Then Sound.PlayChimesAndWait() ElseIf caption = "Show Image" Then GraphicsWindow.DrawResizedImage(pic, picOffset_X, picOffset_Y, PW, PH) flag_cap3 = 1 ElseIf caption = "Clear" Then GraphicsWindow.ShowMessage("You DON'T need to Clear the Screen for this Program", "Clear Message") GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = "white" flag_clear = 1 EndIf EndSub Sub Message openningMsg = Shapes.AddText("Loading.... Please Wait") Shapes.Move(openningMsg, gw/2-80, gh/2) Shapes.Zoom(openningMsg, 2,2) EndSub Sub LoadPic url = Flickr.GetPictureOfMoment() pic = ImageList.LoadImage(url) EndSub Sub SetGW GraphicsWindow.CanResize = 0 gw = 600 gh = 350 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Left = (Desktop.Width - gw) / 2 GraphicsWindow.Top = (Desktop.Height - gh) / 2 - 50 EndSub Sub Offsets capt = "1=BG Colour;2=Make Sound;3=Show Image;4=Clear" size = "bw=100;bh=35" btnOffset_R = gw-size["bw"] -10 btnOffset_B = gh-size["bh"] -10 picOffset_X = size["bw"] + 2*10 picOffset_Y = size["bh"] + 2*10 PW = gw - picOffset_X*2 PH = gh - picOffset_Y*2 EndSub Sub AddButtons For i = 1 To 4 btn[i] = Controls.AddButton(capt[i], 0,0) Controls.SetSize(btn[i], size["bw"], size["bh"]) EndFor Controls.Move(btn[1], 10, 10) Controls.Move(btn[2], 10, btnOffset_B) Controls.Move(btn[3], btnOffset_R , 10) Controls.Move(btn[4], btnOffset_R, btnOffset_B) EndSub End>LRM180.sb< Start>LRM363.sb< GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp 'Simplified dummy setup for images walking left and right playerX[1] = 50 'Initial X (Left of player) playerY[1] = GraphicsWindow.Height - 60 'Initial Y (Top of player) playerX[2] = 350 'Initial X (Left of player) playerY[2] = GraphicsWindow.Height - 60 'Initial Y (Top of player) dir = Program.Directory+"\sidestroller\" For i = 1 To 3 walkL[i] = ImageList.LoadImage(dir+"walkL"+i+".png") walkR[i] = ImageList.LoadImage(dir+"walkR"+i+".png") For j = 1 To 2 playerWalkLeft[j][i] = Shapes.AddImage(walkL[i]) Shapes.HideShape(playerWalkLeft[j][i]) playerWalkRight[j][i] = Shapes.AddImage(walkR[i]) Shapes.HideShape(playerWalkRight[j][i]) EndFor EndFor 'Show initial players For i = 1 To 2 playerFrame[i] = 1 'First frame player[i] = playerWalkRight[i][playerFrame[i]] Shapes.Move(player[i],playerX[i],playerY[i]) Shapes.ShowShape(player[i]) EndFor 'Main Loop While("True") start = Clock.ElapsedMilliseconds movePlayers() delay = 25 - (Clock.ElapsedMilliseconds-start) 'Max delay of 25ms is 40 fps If (delay > 0) Then Program.Delay(delay) EndIf EndWhile 'Move players 'player1 is the current active shown image (there is only ever one not hidden at a time) Sub movePlayers i = 1 'Player 1 If (keyDown["Z"]) Then moveLeft() ElseIf (keyDown["X"]) Then moveRight() Else iFrame[i] = 0 'Reset frame for next movement EndIf i = 2 'Player 2 If (keyDown["Left"]) Then moveLeft() ElseIf (keyDown["Right"]) Then moveRight() Else iFrame[i] = 0 EndIf EndSub Sub moveLeft playerX[i] = playerX[i]-2 'Move player position left If (Math.Remainder(iFrame[i],8) = 0) Then 'Update player every 8 frames of movement Shapes.HideShape(player[i]) 'Hide current player image (will be last player image) playerFrame[i] = 1+Math.Remainder(playerFrame[i],3) 'Cycle player image in group (these for walking left) player[i] = playerWalkLeft[i][playerFrame[i]] 'The next player image in group is now the current player image Shapes.Move(player[i],playerX[i],playerY[i]) 'Move the image before we show it Shapes.ShowShape(player[i]) 'Show current player image Else Shapes.Move(player[i],playerX[i],playerY[i]) 'Just move player EndIf iFrame[i] = iFrame[i]+1 EndSub Sub moveRight playerX[i] = playerX[i]+2 'Move player position right If (Math.Remainder(iFrame[i],8) = 0) Then 'Update player every 8 frames of movement Shapes.HideShape(player[i]) 'Hide current player image (will be last player image) playerFrame[i] = 1+Math.Remainder(playerFrame[i],3) 'Cycle player image in group (these for walking left) player[i] = playerWalkRight[i][playerFrame[i]] 'The next player image in group is now the current player image Shapes.Move(player[i],playerX[i],playerY[i]) 'Move the image before we show it Shapes.ShowShape(player[i]) 'Show current player image Else Shapes.Move(player[i],playerX[i],playerY[i]) 'Just move player EndIf iFrame[i] = iFrame[i]+1 EndSub 'Register events Sub OnKeyDown key = GraphicsWindow.LastKey keyDown[key] = "True" EndSub Sub OnKeyUp key = GraphicsWindow.LastKey keyDown[key] = "" EndSub End>LRM363.sb< Start>LRP836.sb< GraphicsWindow.PenWidth = 0 GraphicsWindow.BackgroundColor = "LightBlue" img = ImageList.LoadImage("https://social.msdn.microsoft.com/Forums/getfile/793426") skis = Shapes.AddImage(img) Shapes.Move(skis, GraphicsWindow.Width/2-ImageList.GetWidthOfImage(img)/2, GraphicsWindow.Height-ImageList.GetHeightOfImage(img)) left = Shapes.AddTriangle(0, 0, 50, 0, 25, 50) right = Shapes.AddTriangle(0, 0, 50, 0, 25, 50) Shapes.Rotate(left, 90) Shapes.Rotate(right, -90) Shapes.Move(right, GraphicsWindow.Width-50, 0) horizon = GraphicsWindow.Height/2 GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle(0, horizon, GraphicsWindow.Width, horizon) GraphicsWindow.BrushColor = "Black" horizon = horizon -10 pole = Shapes.AddRectangle(1, 10) X = GraphicsWindow.Width/2 Y = horizon zoom = 0.5 dY = 0.001 dX = 0 direction = 1 GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp While 0=0 dY = dY + 0.1 Y = Y + dY zoom = zoom + 0.1 If Y > 420 Then dY = 0.1 Y = horizon zoom = 1 X = Math.GetRandomNumber(100)+ GraphicsWindow.Width/2-50 dX = 0 direction = -direction EndIf If direction > 0 Then Shapes.ShowShape(left) Shapes.HideShape(right) Else Shapes.ShowShape(right) Shapes.HideShape(left) EndIf If key = "Right" Then dX = dX + 0.15 X = X - dX Shapes.Rotate(skis, 15) EndIf If key = "Left" Then dX = dX + 0.15 X = X + dX Shapes.Rotate(skis, -15) EndIf Shapes.Move(pole, X, Y) Shapes.Zoom(pole, zoom, zoom) Program.Delay(15) EndWhile Sub OnKeyDown key = GraphicsWindow.LastKey EndSub Sub OnKeyUp key = "" dX = 0 Shapes.Rotate(skis, 0) EndSub End>LRP836.sb< Start>LRQ912.sb< TextWindow.Title = "Sound Player" NE = "True" T = "True" While NE = "True" n = SoundPlus.CreateSoundPlayer("C:\Users\Public\Music\ALLE TITEL\Abba - Honey, Honey.mp3") SoundPlus.Play(n) Program.Delay(1000) l = SoundPlus.GetLenght(n) Program.Delay(1000) p = SoundPlus.GetPosition(n) While T = "True" p = SoundPlus.GetPosition(n) If p >= l Then T = "False" EndIf Program.Delay(1000) 'Ist nur nötig damit es nicht flackert TextWindow.Clear() TextWindow.WriteLine("Lenght: "+l) TextWindow.WriteLine("Position :"+p) TextWindow.WriteLine("File: "+SoundPlus.GetSound(n)) '<- %20?????? TextWindow.WriteLine("Volume: "+SoundPlus.GetVolume(n)) TextWindow.WriteLine("SpeedRatio: " + SoundPlus.GetSpeedRatio(n)) EndWhile TextWindow.Clear() TextWindow.WriteLine("Lenght: "+l) TextWindow.WriteLine("Position:"+p) TextWindow.Read() EndWhile End>LRQ912.sb< Start>LRR985.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 turtle args=0 deg=44/7/360 view3D = LD3DView.AddView(dw,dh,"True") 'Some different light types LD3DView.AddDirectionalLight(view3D,"cyan",-1,-1,-1) LD3DView.AddDirectionalLight(view3D,"white",1,1,1) LD3DView.AddAmbientLight(view3D,"#50111111") LD3DView.SpecularExponent=30 LD3DView.ResetCamera(view3D,0,0,170, 0,0,-1,"","","") df=1 For qq=0 to 8 Step .3 T_x=0 T_y=0 ty=0 T_Angle=0 pp="" z_r=LDMath.Sin(qq*9)+.5 For q=0 To 200 LDCall.Function ("tmove" 2-qq/5) T_Angle=T_Angle +3.6 z_ang=LDMath.Sin(q*3.6)*math.SquareRoot (qq*28) EndFor LDCall.Function("tset" pp) endfor sub tMove mm=LDMath.Convert2Cartesian (t_x,t_y,args[1] t_Angle-90 ) t_x= (mm[1]) t_y= (mm[2]) ee=ee+ldmath.Sin(z_ang)*z_r pp=pp+":"+t_x+":"+ee+":"+T_y EndSub 'camera orbit r170=100 LDEvents.MouseWheel =mww LD3DView.AutoControl ("true" "true", -1 1) p100=50 GraphicsWindow.KeyDown =kdd 'pa="true 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 oo=LD3DView.addtube(view3d,args[1],1.5,20,"cyan","S") LD3DView.TranslateGeometry (view3d oo 0 qq td) 'LD3DView.AnimateRotation (view3D oo 0 1 0 0, 360*df qq*1.5,-1) df=-1*df 'Program.Delay (200) 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>LRR985.sb< Start>LRT473.sb< ' shadow test LD shadow ' program no : ' Nov 21th 2016, 21:12 East Atlantic Time, 'normImg = ImageList.LoadImage(Program.Directory +"\img\NM_4.png") ' 88x88 GraphicsWindow.BackgroundColor = "Black" 'normImg = ImageList.LoadImage(Program.Directory +"\car_normalmap.png") ' 88x88 'textureImg = ImageList.LoadImage(Program.Directory +"\car_texture.png") ' 88x88 normImg = ImageList.LoadImage("https://social.msdn.microsoft.com/Forums/getfile/965521") ' 88x88 textureImg = ImageList.LoadImage("https://social.msdn.microsoft.com/Forums/getfile/965522") ' 88x88 w = ImageList.GetWidthOfImage(normImg) h = ImageList.GetHeightOfImage(normImg) image1 = Shapes.AddImage(normImg) image2 = Shapes.AddImage(textureImg) image = Shapes.AddImage(normImg) ximg=LDImage.Copy(image1) LDImage.EffectGray(ximg) Shapes.Move(image2,100,0) Shapes.Move(ximg,300-w/2,300-h/2) GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "Yellow" light = Shapes.AddEllipse(10,10) GraphicsWindow.KeyDown = OnKeyDown While ("True") start = Clock.ElapsedMilliseconds angle = angle+1 Shapes.Rotate(ximg,angle) move = "False" x = GraphicsWindow.MouseX y = GraphicsWindow.MouseY Shapes.Move(light,x-5,y-5) rotate = LDMath.Rotate(300,300,x,y,-angle) x = rotate[1] y = rotate[2] LDImage.Shadow(ximg,x-300,y-300,20,textureImg,0.1,2) 'LDImage.Shadow(image,x-300,y-300,20,textureImg,"","") delay = 10-(Clock.ElapsedMilliseconds-start) If (delay > 0) Then Program.Delay(delay) EndIf EndWhile Sub OnKeyDown If (textureImg = "") Then textureImg = textureImgSave Else textureImgSave = textureImg textureImg = "" EndIf EndSub End>LRT473.sb< Start>LRT709.sb< 'program no : gw = 600 gh = 600 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BackgroundColor = "gray" view = LD3DView.AddView(gw,gh,"True") LD3DView.ResetCamera(view,-10,-10,-10,1,1,1,0,1,0) LD3DView.AutoControl("true","true",10,1) col[1] = "#FFFFFF" ' WHITE col[2] = "#009B48" 'green Pantone 347 C col[3] = "#B71234" ' red Pantone 200 C col[5] = "#FE5000" 'orange Pantone Orange 021 C col[4] = "#0046AD" ' blue Pantone 293 C col[6] = "#FFD500" ' yellow Pantone Yellow 012 C For iFace = 1 To 6 For i = 1 To 3 For j = 1 To 3 indices = "0:2:1 1:2: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 ElseIf (iFace = 2) Then p0 = k2+":"+i1+":"+j2 p1 = k2+":"+i2+":"+j2 p2 = k2+":"+i1+":"+j1 p3 = k2+":"+i2+":"+j1 ElseIf (iFace = 3) Then p0 = j1+":"+k1+":"+i1 p1 = j1+":"+k1+":"+i2 p2 = j2+":"+k1+":"+i1 p3 = j2+":"+k1+":"+i2 ElseIf (iFace = 4) Then p0 = j2+":"+k2+":"+i1 p1 = j2+":"+k2+":"+i2 p2 = j1+":"+k2+":"+i1 p3 = j1+":"+k2+":"+i2 ElseIf (iFace = 5) Then p0 = i1+":"+j1+":"+k1 p1 = i2+":"+j1+":"+k1 p2 = i1+":"+j2+":"+k1 p3 = i2+":"+j2+":"+k1 ElseIf (iFace = 6) Then p0 = i1+":"+j2+":"+k2 p1 = i2+":"+j2+":"+k2 p2 = i1+":"+j1+":"+k2 p3 = i2+":"+j1+":"+k2 EndIf points = p0+" "+p1+" "+p2+" "+p3 faces[iFace][i][j] = LD3DView.AddGeometry(view,points,indices,"",col[iFace],"E") LD3DView.SetCentre(view,faces[iFace][i][j],0,0,0,"R2") EndFor EndFor EndFor time = 2 angle = 360 iFace = 1 For i = 1 To 3 For j = 1 To 3 LD3DView.AnimateRotation(view,faces[iFace][i][j],1,0,0,0,angle,time,-1) EndFor EndFor j = 1 iFace = 3 For i = 1 To 3 LD3DView.AnimateRotation(view,faces[iFace][i][j],1,0,0,0,angle,time,-1) EndFor iFace = 4 For i = 1 To 3 LD3DView.AnimateRotation(view,faces[iFace][i][j],1,0,0,0,angle,time,-1) EndFor i = 1 iFace = 5 For j = 1 To 3 LD3DView.AnimateRotation(view,faces[iFace][i][j],1,0,0,0,angle,time,-1) EndFor iFace = 6 For j = 1 To 3 LD3DView.AnimateRotation(view,faces[iFace][i][j],1,0,0,0,angle,time,-1) EndFor End>LRT709.sb< Start>LRZ137.sb< TextWindow.WriteLine("1 = Write_Hello") TextWindow.WriteLine("2 = Add_Bouncing_Ball") TextWindow.WriteLine("3 = Close_Program") TextWindow.WriteLine("4 = Insert_Line") TextWindow.WriteLine("5 = Self_Destruct") TextWindow.WriteLine(" --") TextWindow.Write("Choose the number of subroutine: ") Num = TextWindow.ReadNumber() If Num = 1 Then S1() ElseIf Num = 2 Then S2() ElseIf Num = 3 Then S3() ElseIf Num = 4 Then S4() ElseIf Num = 5 Then S5() EndIf Sub S1 TextWindow.Clear() TextWindow.WriteLine("Hello") EndSub Sub S2 dx = 3 dy = 3 y = 200 Ball = Shapes.AddEllipse(10,10) While 1 = 1 Program.Delay(5) x = x + dx y = y + dy Shapes.Move(Ball,x,y) If x < 0 Or x > GraphicsWindow.Width - 10 Then dx = - dx EndIf If y < 0 Or y > GraphicsWindow.Height - 10 Then dy = - dy EndIf EndWhile EndSub Sub S3 Program.End() EndSub Sub S4 GraphicsWindow.DrawLine(100,100,200,100) EndSub Sub S5 TextWindow.Clear() TextWindow.WriteLine("You had to pick it didn't you :-)") EndSub End>LRZ137.sb< Start>LSB518.sb< 'Text Challenge I 'Amir CPS '11/01/2013 DD/MM/YYYY Directory = "Your Program Directory" TextWindow.Write("Enter Keyword to search : ") LoadAllFiles() RealLines() SearchKeyword() Sub LoadAllFiles index = 0 Ext = ".sb" ' The following line could be harmful and has been automatically commented. ' AllFiles = File.GetFiles(Directory) FileCounts = Array.GetItemCount(AllFiles) For i = 1 To FileCounts If Text.IsSubText(AllFiles[i],Ext) Then index = index + 1 Files[index] = AllFiles[i] EndIf EndFor FileCounts = Array.GetItemCount(Files) EndSub Sub RealLines For index = 1 To FileCounts iLine = 1 line = "First" While (line <> "") ' The following line could be harmful and has been automatically commented. ' line = File.ReadLine(Files[index], iLine) lines[index][iLine] = line iLine = iLine+1 EndWhile TotallinesinFile[index] = iLine EndFor EndSub Sub SearchKeyword Keyword = TextWindow.Read() For FileIndex = 1 To FileCounts For LineNum = 1 To TotallinesinFile[FileIndex] If Text.IsSubText(lines[FileIndex][LineNum],Keyword) Then TextWindow.WriteLine("Keyword Found in File"+Text.GetCharacter(10)+Files[FileIndex]+Text.GetCharacter(10)+"In Line Number "+ LineNum) EndIf EndFor EndFor EndSub End>LSB518.sb< Start>LSF761.sb< 'Red or Black Card Counting (quickdraw card game) V0.1. Intermediate Challenge 2 April 2013 '---------------------------Main Program (flow)------------------------------------------------------------------------- TextLogo() Begin() While beginProgram = "y" CreateDeck() Shuffle() BeginDealing() While deal = "y" And cardsRemaining > 1 'dealing BeginBetting() While cardsRemaining > 1 And bet = "r" Or bet = "b" And cardsRemaining > 1 'betting PlaceBet() DealCard() Result() EndWhile LastCard() EndWhile PlayAgain() 'clears Val for next shuffle EndWhile TextLogo() TheEnd() '================Subroutines==================================================== Sub Begin TextWindow.Title = "QuickDraw Red or Black (with card counting)" TextWindow.WriteLine("Welcome to QuickDraw Red or Black") TextWindow.Write("Press y to play ") beginProgram = Text.ConvertToLowerCase(TextWindow.ReadKey()) EndSub Sub CreateDeck For i= 1 To 13 'create full deck card[i*4-3] = "bS" + i card[i*4-2] = "bC" + i card[i*4-1] = "rH" + i card[i*4-0] = "rD" + i EndFor EndSub Sub Shuffle i=1 While i <= Array.GetItemCount(card) rand = Math.GetRandomNumber(Array.GetItemCount(card)) If Array.ContainsValue(val, rand) = "False" Then val[i] = rand shuffled[i] = card[val[i]] i = i+1 EndIf EndWhile EndSub Sub BeginDealing deal = "y" cardsRemaining = 52 EndSub Sub BeginBetting If cardsRemaining = 52 Then TextWindow.Write("Place a bet? y ") placeABet = Text.ConvertToLowerCase(TextWindow.ReadKey()) Else TextWindow.Write("Continue betting? y ") placeABet = Text.ConvertToLowerCase(TextWindow.ReadKey()) EndIf If placeABet = "y" And cardsRemaining > 1 Then bet = "r" 'to start While bet loop Else deal = "n" 'to end While deal loop EndIf EndSub Sub PlaceBet bet = "n" TextWindow.Write("Place your Bet, r or b ") 'if "n" then If bet in DeaLCard skips deal bet = TextWindow.ReadKey() EndSub Sub DealCard 'pick card and then get indices in the form of a new array i.e. (w/o the deleted value) If bet = "r" Or bet = "b" Then dealIndex = Math.GetRandomNumber(Array.GetItemCount(card)) deltCard[53-Array.GetItemCount(card)] = card[dealIndex] 'WIP NEEDS RESET after card[dealIndex] = "" 'remove card from Card array newDeck = Array.GetAllIndices(card) 'only gets indices with a value, not indices whose value is deleted For j=1 To Array.GetItemCount(newDeck) newDeck[j] = card[newDeck[j]] 'assigns value to the newArray EndFor card = newDeck EndIf EndSub Sub Result 'show these results below cardsRemaining = Array.GetItemCount(card) TextWindow.Clear() TextWindow.WriteLine("<>") If Text.ConvertToLowerCase(bet) = "r" Then 'WIP BECAREFUL DELETING TEXTWINDOW.WRITELINES buggie betRed = "RED" TextWindow.Write("You bet: ") TextWindow.BackgroundColor = "gray" TextWindow.ForegroundColor = "red" TextWindow.WriteLine(betRed) red = red + 1 ElseIf Text.ConvertToLowerCase(bet) = "b" Then betBlack = "BLACK" TextWindow.Write("You bet: ") TextWindow.BackgroundColor = "gray" TextWindow.ForegroundColor = "black" TextWindow.WriteLine(betBlack) black = black + 1 EndIf TextWindow.BackgroundColor = "Black" TextWindow.ForegroundColor = "gray" sumRed_Black = red + black TextWindow.WriteLine("Card delt: " + deltCard[sumRed_Black]) If Text.StartsWith(deltCard[sumRed_Black], Text.ConvertToLowerCase(bet)) = "True" Then TextWindow.WriteLine("You win") ElseIf Text.StartsWith(deltCard[sumRed_Black], Text.ConvertToLowerCase(bet)) = "False" Then TextWindow.WriteLine("You lose") EndIf TextWindow.WriteLine("There's " + cardsRemaining + " cards Remaining.") If Text.ConvertToLowerCase(bet) = "r" Or Text.ConvertToLowerCase(bet) = "b" Then If Text.StartsWith(deltCard[sumRed_Black], "r") = "true" Then sumDeltRed = sumDeltRed +1 Else sumDeltBlack = sumDeltBlack +1 EndIf EndIf TextWindow.WriteLine("no of red delt: " +sumDeltRed) TextWindow.WriteLine("no of black delt: " +sumDeltBlack) TextWindow.WriteLine("Probability next card is Red = " +(26 - sumDeltRed)/cardsRemaining) TextWindow.WriteLine("Probability next card is Black = " +(26 - sumDeltBlack)/cardsRemaining) TextWindow.WriteLine("") EndSub Sub LastCard If cardsRemaining = 1 Then TextWindow.WriteLine("There's 1 card remaining") TextWindow.WriteLine("Place bet, double or nothing? y ") placeABetLastCard = Text.ConvertToLowerCase(TextWindow.ReadKey()) If placeABetLastCard = "y" Then 'change name betLastCard TextWindow.WriteLine("last card is: " + card[1]) TextWindow.Write("Place your Bet, r or b ") betLastCard = Text.ConvertToLowerCase(TextWindow.ReadKey()) If Text.StartsWith(card[1], betLastCard) = "True" Then TextWindow.WriteLine("you win") Else TextWindow.WriteLine("you loose") EndIf EndIf deal = "n" bet = "n" EndIf EndSub Sub PlayAgain TextWindow.Write("Play again y ") beginProgram = Text.ConvertToLowerCase(TextWindow.ReadKey()) For i = 1 To 52 'clears Val for next shuffle val[i] = "" deltCard[i] = "" ' clears for play again EndFor red = 0 black = 0 sumDeltRed = 0 sumDeltBlack = 0 EndSub Sub TheEnd TextWindow.Title = "The End" TextWindow.Clear() TextWindow.WriteLine("Goodbye") Program.Delay(600) Program.End() EndSub Sub TextLogo character[1] = "!" character[2] = "@" character[3] = "#" character[4] = "$" character[5] = "%" character[6] = "^" character[7] = "+" Colour[1] = "yellow" Colour[2] = "white" Colour[3] = "gray" Colour[4] = "red" Colour[5] = "Black" Colour[6] = "Blue" Colour[7] = "Cyan" Colour[8] = "Green" Colour[9] = "Magenta" Colour[10] = "DarkBlue" Colour[11] = "DarkCyan" Colour[12] = "DarkGray" Colour[13] = "DarkGreen" Colour[14] = "DarkMagenta" Colour[15] = "DarkRed" Colour[16] = "DarkYellow" logoWord[1] = "Jibba" logoWord[2] = "Jabba" TextWindow.Clear() For i = 1 To 50 TextWindow.BackgroundColor = (Colour[Math.GetRandomNumber(16)]) TextWindow.Write(character[Math.GetRandomNumber(7)]) Program.Delay(Math.GetRandomNumber(40)) EndFor TextWindow.BackgroundColor = "black" TextWindow.ForegroundColor = "yellow" TextWindow.Write(" by " + logoWord[1] +" " + logoWord[2]) Program.Delay(600) TextWindow.ForegroundColor = "gray" TextWindow.Clear() EndSub End>LSF761.sb< Start>LSG226.sb< 'July monthly challenge Intermediate Challenge 1 'Import it, then change the path for the file of which the textbox contence gets written to. GraphicsWindow.Title="Booking Forum" GraphicsWindow.Width=500 GraphicsWindow.Height=400 GraphicsWindow.Top=10 GraphicsWindow.Left=10 'Interface GraphicsWindow.DrawText(25,45,"Name") namebox=Controls.AddTextBox(15,60) GraphicsWindow.DrawText(330,45,"Arrival Date") arrivalbox=Controls.AddTextBox(320,60) GraphicsWindow.DrawText(25,105,"Departure Date") departurebox=Controls.AddTextBox(15,120) GraphicsWindow.DrawText(330,105,"Number of People") peoplebox=Controls.AddTextBox(320,120) GraphicsWindow.DrawText(25,165,"Breakfast?") breakfastbox=Controls.AddTextBox(15,180) GraphicsWindow.DrawText(330,165,"Special Request?") specialbox=Controls.AddTextBox(320,180) submitbutton=Controls.AddButton("Submit",230,270) Controls.ButtonClicked=OnButtonClicked Sub OnButtonClicked nameboxcontense=Controls.GetTextBoxText(namebox) arrivalboxcontence=Controls.GetTextBoxText(arrivalbox) departureboxcontence=Controls.GetTextBoxText(departurebox) peopleboxcontence=Controls.GetTextBoxText(peoplebox) breakfastboxcontence=Controls.GetTextBoxText(breakfastbox) specialboxcontence=Controls.GetTextBoxText(specialbox) contence="Name= "+nameboxcontense+"; "+"Arrival Date= "+arrivalboxcontence+"; "+"Departure Date= "+departureboxcontence+"; "+"Number of people= "+peopleboxcontence+"; "+"Breakfast= "+breakfastboxcontence+"; "+"Special Requests= "+specialboxcontence If Controls.LastClickedButton=submitbutton Then ' The following line could be harmful and has been automatically commented. ' File.WriteContents("C:\Users\Public\Documents\BookingForum.txt",contence) GraphicsWindow.ShowMessage("Saved successfully.","Message") EndIf EndSub End>LSG226.sb< Start>LSH161.sb< gw = 600 gh = 600 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Title = "3D Rubic Cube" GraphicsWindow.BackgroundColor = "Black" view = LD3DView.AddView(gw,gh,"True") LD3DView.ResetCamera(view,-5,-5,-5,1,1,1,0,1,0) LD3DView.AutoControl("true","true",10,1) LD3DView.AddAmbientLight(view,"White") image = ImageList.LoadImage("http://litdev.co.uk/game_images/rubic.png") 'image = ImageList.LoadImage(Program.Directory+"/rubic.png") 'LD3DView.SpecularExponent = 5 col[1] = "#CC0000" ' red col[2] = "#FFFFFF" ' white col[3] = "#ffd700" ' yellow col[4] = "#fF6000" 'orange col[5] = "#00BB00" 'green col[6] = "#0000EE" ' blue numBit = 0 For iFace = 1 To 6 For i = 1 To 3 For j = 1 To 3 indices = "0:2:1 1:2: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 'bitFace[numBit] = iFace bitX[numBit] = x bitY[numBit] = y bitZ[numBit] = z 'bitCube[numBit] = (z-1)*9+(y-1)*3+x bitCol[numBit] = col[iFace] bit[numBit] = LD3DView.AddGeometry(view,points,indices,"",bitCol[numBit],"D") LD3DView.AddImage(view,bit[numBit],"0:0 1:0 0:1 1:1",image,"D") bitPos[numBit] = LD3DView.GetPosition(view,bit[numBit]) LD3DView.SetCentre(view,bit[numBit],0,0,0,"R2") EndFor EndFor EndFor time = 1 repeat = 1 While ("True") xVal = 1 yVal = 0 zVal = 0 angle = -90 Rotate() xVal = 0 yVal = 1 zVal = 0 angle = 180 Rotate() xVal = 0 yVal = 0 zVal = 2 angle = 90 Rotate() xVal = 0 yVal = 0 zVal = 2 angle = -90 Rotate() xVal = 0 yVal = 1 zVal = 0 angle = 180 Rotate() xVal = 1 yVal = 0 zVal = 0 angle = 90 Rotate() xVal = 1 yVal = 0 zVal = 0 angle = -270 Rotate() xVal = 0 yVal = 0 zVal = 2 angle = 360 Rotate() xVal = 0 yVal = 1 zVal = 0 angle = -180 Rotate() EndWhile Sub Rotate For i = 1 To numBit If (bitX[i] = xVal) Then LD3DView.AnimateRotation(view,bit[i],1,0,0,0,angle,time,repeat) ElseIf (bitY[i] = yVal) Then LD3DView.AnimateRotation(view,bit[i],0,1,0,0,angle,time,repeat) ElseIf (bitZ[i] = zVal) Then LD3DView.AnimateRotation(view,bit[i],0,0,1,0,angle,time,repeat) EndIf EndFor Program.Delay(1000*time) LDGraphicsWindow.PauseUpdates() lastCol = bitCol For i = 1 To numBit If (bitX[i] = xVal Or bitY[i] = yVal Or bitZ[i] = zVal) Then pos1 = bitPos[i] For j = 1 To numBit If (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.001) Then 'bit j is now where i started bitCol[i] = lastCol[j] LD3DView.ResetMateral(view,bit[i],bitCol[i],"D") LD3DView.AddImage(view,bit[i],"0:0 1:0 0:1 1:1",image,"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>LSH161.sb< Start>LSH948.sb< ss=2 GraphicsWindow.Width=800 GraphicsWindow.Height=600 cc=LDGraphicsWindow.Capture ("" "false") GraphicsWindow.Width=799 GraphicsWindow.Height=599 LDImage.OpenWorkingImage (cc) GraphicsWindow.BackgroundColor="teal While ss<800*600 If Math.Remainder (ss 5)=0 Then GraphicsWindow.Title=ss EndIf For x=ss To 800*599 Step ss If x>ss Then px=math.Remainder (x 799) py=Math.Floor (x/799) LDImage.SetWorkingImagePixel (cc px+1 py+1 "black") endif EndFor ss=ss+1 EndWhile LDImage.CloseWorkingImage (cc) GraphicsWindow.DrawImage (cc 0 0) GraphicsWindow.MouseMove=mmm For x=1 to 799 GraphicsWindow.Title=x For y=1 To 599 cp=GraphicsWindow.GetPixel ( x y) if cp="#000000" Then Else pc=pc+1 EndIf EndFor endfor GraphicsWindow.ShowMessage (pc "count primes < "+799*599) LDImage.CloseWorkingImage (cc) Sub mmm If GraphicsWindow.GetPixel(GraphicsWindow.MouseX GraphicsWindow.MouseY)="#000000" Then else GraphicsWindow.Title =GraphicsWindow.MouseY *799+GraphicsWindow.MouseX EndIf EndSub End>LSH948.sb< Start>LSJ620-0.sb< ii=ImageList.LoadImage("c:\ALMDOM\sb\skyy.png") LDImage.MakeTransparent(II "BLACK") im=LDImage.SplitImage(ii 16 9) ad=1 GraphicsWindow.Width=980 GraphicsWindow.BackgroundColor="darkblue For f=1 To 18 is[f]=LDShapes.AddAnimatedImage(ii "true" 16 9) LDShapes.AnimationPause(is[f]) ofs[f]=Math.GetRandomNumber(300) EndFor Timer.Interval=80 as=20 asa=LDText.Split("97 97 97 97 97 97 97 97 97 97 97 97 97 98 99 100 101 102 103 104" " ") as2=LDText.Split("81 82 83 84" " ") Timer.Tick=ttt Sub ttt as=as+1 asb=asb+1 For f=1 To 18 Step 2 If as>=20 Then as=1 For c=1 To 18 Step 2 ofs[c]=Math.GetRandomNumber(300) Shapes.Move(is[c] 50*c ofs[c]) EndFor EndIf If as<13 Then Shapes.Move(is[f] 50*f as*10+ofs[f]) EndIf LDShapes.AnimationSet(is[f] asa[as]) EndFor For f=2 To 18 Step 2 If asb>4 Then asb=1 EndIf Shapes.Move(is[f] 50*f as*10+5) If f=6 Then occ=48 ElseIf Math.Remainder(f/8 2)=0 Then occ=-16 ElseIf Math.Remainder(f/4 2)=0 Then occ=24 ElseIf Math.Remainder(f/2 2)=0 Then occ=8 Else occ=0 EndIf LDShapes.AnimationSet(is[f] as2[asb]+occ) EndFor EndSub End>LSJ620-0.sb< Start>LSJ620.sb< ii=ImageList.LoadImage("c:\ALMDOM\sb\skyy.png") LDImage.MakeTransparent(II "BLACK") im=LDImage.SplitImage(ii 16 9) ad=1 GraphicsWindow.Width=980 GraphicsWindow.BackgroundColor="darkblue For f=1 To 17 is[f]=LDShapes.AddAnimatedImage(ii "true" 16 9) LDShapes.AnimationPause(is[f]) ofs[f]=Math.GetRandomNumber(300) EndFor Timer.Interval=80 as=20 asa=LDText.Split("97 97 97 97 97 97 97 97 97 97 97 97 97 98 99 100 101 102 103 104" " ") Timer.Tick=ttt Sub ttt as=as+1 For f=1 To 17 If as>20 Then as=1 Shapes.Move(is[f] 50*f ofs[f]) EndIf If as<13 Then Shapes.Move(is[f] 50*f as*10+ofs[f]) EndIf LDShapes.AnimationSet(is[f] asa[as]) EndFor EndSub End>LSJ620.sb< Start>LSK042-1.sb< 'This was made from the example "Paint Prgram" 'You can use custom colors 'Just press the first letter of the color 'There are 8 colors, but you can add as many as you like. ' Now you can add as many colors as you want without needing to change anything else. ' Serdan: The color array should be defined before creating the color boxes. Colors = "D1=Red;D2=White;D3=Blue;D4=Green;D5=Purple;D6=Yellow;D7=Orange;D8=DarkBlue" Color_Amount = Array.GetItemCount(Colors) Box_Amount_Horizontal = 2 Box_Amount_Vertical = 5 Box_Amount = Box_Amount_Horizontal * Box_Amount_Vertical Box_Width = 20 Box_Height = 20 AddRectangles() Penwidth = 4 GraphicsWindow.BackgroundColor = "Black" GraphicsWindow.PenColor = "White" GraphicsWindow.PenWidth = Penwidth GraphicsWindow.BrushColor = GraphicsWindow.PenColor GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseMove = OnMouseMove GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.MouseUp = OnMouseUp GraphicsWindow.KeyUp = OnKeyUp Sub OnKeyDown key = GraphicsWindow.LastKey If (key = "Up") and Penwidth <= 20 Then Penwidth = Penwidth + 1 elseIf (key = "Down") and Penwidth > 1 Then Penwidth = Penwidth - 1 elseif (key = "LeftShift") Then Shift = 1 else GraphicsWindow.PenColor = Colors[key] GraphicsWindow.BrushColor = GraphicsWindow.PenColor endif GraphicsWindow.PenWidth = Penwidth EndSub Sub OnKeyUp key = GraphicsWindow.LastKey If (key = "LeftShift") Then Shift = 0 bla = 0 endif EndSub Sub OnMouseDown prevX = GraphicsWindow.MouseX prevY = GraphicsWindow.MouseY EndSub ' Serdan: Check for collision with the color boxes and change brush and pen color accordingly. Sub OnMouseUp For i = 1 To Box_Amount If (Mouse_X > BoxPos_X[i] And Mouse_X < BoxPos_X[i] + Box_Width And Mouse_Y > BoxPos_Y[i] And Mouse_Y < BoxPos_Y[i] + Box_Height) Then GraphicsWindow.PenColor = Colors[Text.Append("D", i)] GraphicsWindow.BrushColor = GraphicsWindow.PenColor EndIf EndFor UpdateRectangles() EndSub Sub OnMouseMove Mouse_X = GraphicsWindow.MouseX Mouse_Y = GraphicsWindow.MouseY If Mouse.IsRightButtonDown = "False" Then UpdateRectangles() endif If Shift = 1 then If bla = 0 then Shift_X = Mouse_X Shift_Y = Mouse_Y bla = 1 endif Penwidth = Math.SquareRoot((Mouse_X - Shift_X) * (Mouse_X - Shift_X) + (Mouse_Y - Shift_Y) * (Mouse_Y - Shift_Y))*2 Shapes.Remove(Brush) Brush = Shapes.AddEllipse(Penwidth,Penwidth) Shapes.Move(Brush,Shift_X - Penwidth/2,Shift_Y - Penwidth/2) Else Shapes.Remove(Brush) endif If (Mouse.IsLeftButtonDown) then GraphicsWindow.FillEllipse(prevX-Penwidth/2,prevY-Penwidth/2,Penwidth,Penwidth) ' This here is for getting rid of the corners in the lines. GraphicsWindow.DrawLine(prevX, prevY, Mouse_X, Mouse_Y) endif prevX = Mouse_X prevY = Mouse_Y EndSub Sub AddRectangles For i = 1 To Box_Amount_Vertical For j = 1 To Box_Amount_Horizontal Box_Number = Box_Number + 1 Box_X[Box_Number] = j * Box_Width - Box_Width Box_Y[Box_Number] = i * Box_Height - Box_Height ' Serdan: Get color from the color array. GraphicsWindow.BrushColor = Colors[Text.Append("D", j + (i - 1) * Box_Amount_Horizontal)] Box[Box_Number] = Shapes.AddRectangle(Box_Width,Box_Height) Shapes.Move(Box[Box_Number],Box_X[Box_Number],Box_Y[Box_Number]) endfor endfor endsub Sub UpdateRectangles For i = 1 To Box_Amount ' Serdan: Remember box positions for collision detection. BoxPos_X[i] = Box_X[i] + Mouse_X + 50 BoxPos_Y[i] = Box_Y[i] + Mouse_Y + 50 Shapes.Move(Box[i], BoxPos_X[i], BoxPos_Y[i]) endfor endsub End>LSK042-1.sb< Start>LSK042.sb< 'This was made from the example "Paint Prgram" 'You can use custom colors 'Just press the first letter of the color 'There are 8 colors, but you can add as many as you like. Box_Amount_Horizontal = 2 Box_Amount_Vertical = 5 Box_Amount = Box_Amount_Horizontal * Box_Amount_Vertical Box_Width = 20 Box_Height = 20 AddRectangles() Penwidth = 4 ' Now you can add as many colors as you want without needing to change anything else. Colors = "D1=Red;D2=White;D3=Blue;D4=Green;D5=Purple;D6=Yellow;D7=Orange;D8=DarkBlue" Color_Amount = Array.GetItemCount(Colors) GraphicsWindow.BackgroundColor = "Black" GraphicsWindow.PenColor = "White" GraphicsWindow.PenWidth = Penwidth GraphicsWindow.BrushColor = GraphicsWindow.PenColor GraphicsWindow.MouseDown = OnMouseDown GraphicsWindow.MouseMove = OnMouseMove GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp Sub OnKeyDown key = GraphicsWindow.LastKey If (key = "Up") and Penwidth <= 20 Then Penwidth = Penwidth + 1 elseIf (key = "Down") and Penwidth > 1 Then Penwidth = Penwidth - 1 elseif (key = "LeftShift") Then Shift = 1 else GraphicsWindow.PenColor = Colors[key] GraphicsWindow.BrushColor = GraphicsWindow.PenColor endif GraphicsWindow.PenWidth = Penwidth EndSub Sub OnKeyUp key = GraphicsWindow.LastKey If (key = "LeftShift") Then Shift = 0 bla = 0 endif EndSub Sub OnMouseDown prevX = GraphicsWindow.MouseX prevY = GraphicsWindow.MouseY EndSub Sub OnMouseMove Mouse_X = GraphicsWindow.MouseX Mouse_Y = GraphicsWindow.MouseY If Mouse.IsRightButtonDown = "False" Then UpdateRectangles() endif If Shift = 1 then If bla = 0 then Shift_X = Mouse_X Shift_Y = Mouse_Y bla = 1 endif Penwidth = Math.SquareRoot((Mouse_X - Shift_X) * (Mouse_X - Shift_X) + (Mouse_Y - Shift_Y) * (Mouse_Y - Shift_Y))*2 Shapes.Remove(Brush) Brush = Shapes.AddEllipse(Penwidth,Penwidth) Shapes.Move(Brush,Shift_X - Penwidth/2,Shift_Y - Penwidth/2) Else Shapes.Remove(Brush) endif If (Mouse.IsLeftButtonDown) then GraphicsWindow.FillEllipse(prevX-Penwidth/2,prevY-Penwidth/2,Penwidth,Penwidth) ' This here is for getting rid of the corners in the lines. GraphicsWindow.DrawLine(prevX, prevY, Mouse_X, Mouse_Y) endif prevX = Mouse_X prevY = Mouse_Y EndSub Sub AddRectangles For i = 1 To Box_Amount_Vertical For j = 1 To Box_Amount_Horizontal Box_Number = Box_Number + 1 Box_X[Box_Number] = j * Box_Width - Box_Width Box_Y[Box_Number] = i * Box_Height - Box_Height GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor() Box[Box_Number] = Shapes.AddRectangle(Box_Width,Box_Height) Shapes.Move(Box[Box_Number],Box_X[Box_Number],Box_Y[Box_Number]) endfor endfor endsub Sub UpdateRectangles For i = 1 To Box_Amount X = Box_X[i] + Mouse_X + 50 Y = Box_Y[i] + Mouse_Y + 50 Shapes.Move(Box[i],X,Y) endfor endsub End>LSK042.sb< Start>LSK834.sb< GraphicsWindow.BrushColor="teal w1=Shapes.AddRectangle(10 700) ll=Shapes.AddRectangle(10 430) GraphicsWindow.Height=730 GraphicsWindow.Top=10 Shapes.Move(w1 10 10) Shapes.Rotate(ll, -5) Shapes.Move(ll 190 200) LDPhysics.Reset() LDPhysics.AddFixedShape(w1 1 .1) LDPhysics.AddMovingShape(ll 1 .1 2) LDShapes.BrushColour(ll "black") w11=Shapes.AddRectangle(700 20) Shapes.Move(w11 10 710) LDPhysics.AddFixedShape(w11 1 .1) GraphicsWindow.BackgroundColor="tan m=Shapes.AddRectangle(120 150) Shapes.Move(m 20 500) LDPhysics.AddMovingShape(m 1 .1 1) LDPhysics.SetGravity(0 92) LDShapes.BrushColour(m "brown") While 1=1 LDPhysics.DoTimestep() Program.Delay(20) EndWhile End>LSK834.sb< Start>LSL249.sb< GraphicsWindow.KeyDown=kkk Shapes.AddEllipse(10,10) GraphicsWindow.Width =1500 GraphicsWindow.Height =900 gg=LDShapes.BrushGradient ("1=#00aaaa;2=#008080;3=#000080","DD") LDGraphicsWindow.BackgroundBrushGradient(gg) t_x=30 t_y=700 flmd=1 t_Angle =75 t_PenDown () penn="True aa=30 tc=0 dd=0 vmir=0 ss=-0.5 ii=10 sm="False GraphicsWindow.PenWidth=3 'c1=LDDialogs.Colour() args=0 sc=0 t_x=30 t_y=190 t_Angle =75 cc="" txx="EXPQ2Q15;MIL/.\I|IQ#fiQri;1_5_._1_1Q_2Q15_" txx=text.ConvertToUpperCase (txx) txx=LDText.Replace(txx,"H","I.I") txx=LDText.Replace(txx,"K","I<") txx=LDText.Replace(txx,"X","><") For f=1 To Text.GetLength (txx) lc=cc cc= Text.GetSubText(txx,f,1) cc= Text.ConvertToUpperCase(cc) If f dd=0 mi=0 pmm=0 t_y=t_y+20 t_Angle=t_Angle+30 LDCall.Function ("sewto",15) t_Angle=t_Angle-60 LDCall.Function ("sewto",15) ang3() d=0 LDCall.Function ("sewto",18) 'LDCall.Function ("sewto",1) ang4() d=0 LDCall.Function ("sewto",18) ang3() 'LDCall.Function ("sewto",1) pshw() t_Angle=75 t_y=t_y-20 t_x=t_x+95 elseIf cc="<" then '--------------------- dd=0 pmm=0 mi=0 t_y=t_y-100 t_Angle=t_Angle+210 t_x=t_x+85 LDCall.Function ("sewto",15) t_Angle=t_Angle-60 LDCall.Function ("sewto",15) ang3() d=0 LDCall.Function ("sewto",18) 'LDCall.Function ("sewto",1) ang4() d=0 LDCall.Function ("sewto",18) ang3() 'LDCall.Function ("sewto",1) pshw() t_Angle=75 t_y=t_y+100 t_x=t_x+35 elseIf cc="P" then '---------------------P dd=0 t_y=t_y+50 pmm=0 mi=0 LDCall.Function ("sewto",17) ang2() LDCall.Function ("sewto",5) ang1() dd=0 LDCall.Function ("sewto",2) ang1() LDCall.Function ("sewto",10) t_TurnRight () LDCall.Function ("sewto",9) t_TurnRight () LDCall.Function ("sewto",12) dd=6 LDCall.Function ("sewto",30) dd=0 ang1() LDCall.Function ("sewto",14) t_TurnRight () LDCall.Function ("sewto",10) pshw() t_Angle =75 t_x=t_x+140 t_y=t_y-50 elseIf cc="2" then '---------------------2 dd=0 pmm=0 mi=0 t_y=t_y+50 LDCall.Function ("sewto",17) ang2() LDCall.Function ("sewto",5) ang1() dd=0 LDCall.Function ("sewto",2) ang1() LDCall.Function ("sewto",10) t_TurnRight () dd=6 LDCall.Function ("sewto",30) dd=0 LDCall.Function ("sewto",2) dd=6 LDCall.Function ("sewto",15) dd=0 ang1() LDCall.Function ("sewto",3) t_TurnLeft () LDCall.Function ("sewto",15) t_TurnRight () LDCall.Function ("sewto",10) t_TurnRight () LDCall.Function ("sewto",25) pshw() t_Angle =75 t_x=t_x+140 t_y=t_y-50 elseIf cc="5" then '---------------------5 dd=0 pmm=0 mi=0 t_y=t_y-145 t_Angle=t_Angle+180 vmir=1 xmr=t_x*2 LDCall.Function ("sewto",17) ang2() LDCall.Function ("sewto",5) ang1() dd=0 LDCall.Function ("sewto",2) ang1() LDCall.Function ("sewto",10) t_TurnRight () dd=6 LDCall.Function ("sewto",30) dd=0 LDCall.Function ("sewto",2) dd=6 LDCall.Function ("sewto",15) dd=0 ang1() LDCall.Function ("sewto",3) t_TurnLeft () LDCall.Function ("sewto",15) t_TurnRight () LDCall.Function ("sewto",10) t_TurnRight () LDCall.Function ("sewto",25) pshw() t_Angle =75 t_x=t_x+140 t_y=t_y+145 vmir=0 elseIf cc="G" then '---------------------G dd=0 LDCall.Function ("sewto",16) dd=6 LDCall.Function ("sewto",15) dd=0 LDCall.Function ("sewto",12) t_TurnRight () LDCall.Function ("sewto",10) t_TurnRight () LDCall.Function ("sewto",10) dd=-10 LDCall.Function ("sewto",9) dd=0 LDCall.Function ("sewto",11) dd=-10 LDCall.Function ("sewto",9) dd=0 LDCall.Function ("sewto",2) t_TurnLeft() LDCall.Function ("sewto",10) t_TurnRight () LDCall.Function ("sewto",8) t_TurnRight () LDCall.Function ("sewto",20) t_TurnRight () LDCall.Function ("sewto",12) dd=6 LDCall.Function ("sewto",15) t_x=t_x+140 elseIf cc="C" then '---------------------C dd=0 LDCall.Function ("sewto",16) dd=6 LDCall.Function ("sewto",15) dd=0 LDCall.Function ("sewto",12-tc) t_TurnRight () LDCall.Function ("sewto",10) t_TurnRight () LDCall.Function ("sewto",10-tc) dd=-10 LDCall.Function ("sewto",9) dd=0 LDCall.Function ("sewto",11) dd=-10 LDCall.Function ("sewto",9) dd=0 LDCall.Function ("sewto",10) t_TurnRight () LDCall.Function ("sewto",10) t_TurnRight () LDCall.Function ("sewto",12) dd=6 LDCall.Function ("sewto",15) t_x=t_x+140 elseIf cc="F" then '---------------------F t_y=t_y+64 dd=0 LDCall.Function ("sewto",29) dd=6 LDCall.Function ("sewto",15) dd=0 LDCall.Function ("sewto",12-tc) t_TurnRight () LDCall.Function ("sewto",10) t_TurnRight () LDCall.Function ("sewto",10-tc) ang1() dd=0 LDCall.Function ("sewto",2) ang1() LDCall.Function ("sewto",6) t_TurnRight () LDCall.Function ("sewto",8) t_TurnRight () LDCall.Function ("sewto",6) ang1() dd=0 LDCall.Function ("sewto",15) t_TurnRight () LDCall.Function ("sewto",10) t_TurnRight () t_x=t_x+140 t_y=t_y-64 elseIf cc="E" then '---------------------E pmm=0 mi=0 dd=0 LDCall.Function ("sewto",16) dd=6 LDCall.Function ("sewto",15) dd=0 LDCall.Function ("sewto",12-tc) t_TurnRight () LDCall.Function ("sewto",10) t_TurnRight () LDCall.Function ("sewto",10-tc) ang1() dd=0 LDCall.Function ("sewto",2) ang1() LDCall.Function ("sewto",6) t_TurnRight () LDCall.Function ("sewto",8) t_TurnRight () LDCall.Function ("sewto",6) ang1() dd=0 LDCall.Function ("sewto",2) ang1() LDCall.Function ("sewto",10) t_TurnRight () LDCall.Function ("sewto",9) t_TurnRight () LDCall.Function ("sewto",12) dd=6 LDCall.Function ("sewto",15) pshw () t_x=t_x+140 Endif Endfor Sub kkk lk = GraphicsWindow.LastKey If lk="Left" Then dd=dd-0.1 elseIf lk="Right" Then dd=dd+0.1 elseif lk="Space" then dd=0 endif GraphicsWindow.Title=dd EndSub Sub sewto fff=args[1] For x=1 To math.Abs(fff) If ii<6 Then t_PenUp () Else t_PenDown () endif GraphicsWindow.PenColor=LDColours.HSLtoRGB(sc,1,0.8) sc=sc+2 ldcall.function("t_Move",10) ldcall.function("t_Turn",-180+aa+dd) GraphicsWindow.PenColor="Black ldcall.function("t_Move",ii) ldcall.function("t_Turn",180-aa) If sm then ii=ii+ss If Math.Remainder(x,2)=0 Then ii=ii+ss/3 endif If (ss<0) And (ii<1) Then ss=-ss ii=1 endif If (ss>0 And ii>10) Then ss=-ss ii=10 endif endif GraphicsWindow.title=x 'GraphicsWindow.title="Done%:"+Math.Round ((x/1600)*100) endfor EndSub Sub ang1 dd=-15 LDCall.Function ("sewto",6) dd=0 EndSub Sub ang2 dd=15 LDCall.Function ("sewto",6) dd=0 EndSub Sub ang3 dd=15 LDCall.Function ("sewto",12) dd=0 EndSub Sub ang4 dd=15 LDCall.Function ("sewto",4) dd=0 EndSub Sub t_Turn t_Angle =t_Angle +args[1] EndSub sub t_Move ds=args[1] mm=LDMath.Convert2Cartesian (t_x,t_y,ds, t_Angle-90 ) If penn then If vmir=1 Then GraphicsWindow.DrawLine (xmr -math.Round(t_x),math.Round(t_y),xmr-math.Round (mm[1]),math.Round (mm[2])) Else GraphicsWindow.DrawLine (math.Round(t_x),math.Round(t_y),math.Round (mm[1]),math.Round (mm[2])) endif t_x= (mm[1]) t_y= (mm[2]) mi=mi+1 If vmir=1 Then pmm[mi][1]=xmr - t_x Else pmm[mi][1]= t_x EndIf pmm[mi][2]=t_y endif EndSub Sub t_TurnRight t_Angle =t_Angle +90 EndSub Sub t_TurnLeft t_Angle =t_Angle -90 EndSub Sub t_pendown penn="True EndSub Sub t_penup penn="Fale EndSub Sub pshw rc1= LDColours.HSLtoRGB(Math.GetRandomNumber(360),1,0.8) bcc= LDText.Split(Rc1+" Yellow Orange"," ") bgp= LDShapes.BrushGradient (bcc,"DD") If flmd=1 then LDShapes.BrushGradientPolygon(bgp,pmm) endif EndSub End>LSL249.sb< Start>LSL357.sb< GraphicsWindow.Title = "Kazakhstan" Init() InitPolygon() AddSun() AddEagle() AddPattern() Sub FlipPolylinesAtBottom _bottomY = _pY[1][1] For _iPolyline = 1 To _nPolyline _nV = Array.GetItemCount(_pX[_iPolyline]) For _iV = 1 To _nV If _bottomY < _pY[_iPolyline][_iV] Then _bottomY = _pY[_iPolyline][_iV] EndIf EndFor EndFor For _iPolyline = 1 To _nPolyline _nV = Array.GetItemCount(_pX[_iPolyline]) For _iV = 1 To _nV _pY[_iPolyline][_iV] = 2 * _bottomY - _pY[_iPolyline][_iV] EndFor EndFor EndSub Sub FlipPolylinesAtRight _rightX = _pX[1][1] For _iPolyline = 1 To _nPolyline _nV = Array.GetItemCount(_pX[_iPolyline]) For _iV = 1 To _nV If _rightX < _pX[_iPolyline][_iV] Then _rightX = _pX[_iPolyline][_iV] EndIf EndFor EndFor For _iPolyline = 1 To _nPolyline _nV = Array.GetItemCount(_pX[_iPolyline]) For _iV = 1 To _nV _pX[_iPolyline][_iV] = 2 * _rightX - _pX[_iPolyline][_iV] EndFor EndFor EndSub Sub FlipPolylinesAtTop _topY = _pY[1][1] For _iPolyline = 1 To _nPolyline _nV = Array.GetItemCount(_pX[_iPolyline]) For _iV = 1 To _nV If _pY[_iPolyline][_iV] < _topY Then _topY = _pY[_iPolyline][_iV] EndIf EndFor EndFor For _iPolyline = 1 To _nPolyline _nV = Array.GetItemCount(_pX[_iPolyline]) For _iV = 1 To _nV _pY[_iPolyline][_iV] = 2 * _topY - _pY[_iPolyline][_iV] EndFor EndFor EndSub Sub MovePolylines For _iPolyline = 1 To _nPolyline _nV = Array.GetItemCount(_pX[_iPolyline]) For _iV = 1 To _nV _pX[_iPolyline][_iV] = _pX[_iPolyline][_iV] + deltaX _pY[_iPolyline][_iV] = _pY[_iPolyline][_iV] + deltaY EndFor EndFor EndSub Sub Init scale = 0.7 ' for patern design offsetX = 0 offsetY = 0 scale = 3.0 ' for eagle head design offsetX = 900 offsetY = 600 scale = 3.0 ' for eagle left wing design offsetX = 1000 offsetY = 400 scale = 1.6 ' for eagle design offsetX = 700 offsetY = 400 scale = 0.5 ' for whole flag offsetX = 0 offsetY = 0 gw = scale * 2000 gh = scale * 1000 GraphicsWindow.Height = gh GraphicsWindow.Width = gw GraphicsWindow.BackgroundColor = "DeepSkyBlue" centerX = 2000 / 2 + 90 centerY = 1000 / 2 - 80 sunDiameter = 276 amountOfRays = 32 distanceFromCenter = (276 + 15 + 30) / 2 lengthOfRays = 210 - distanceFromCenter sunColor = "Gold" EndSub Sub ShowCoordinate GraphicsWindow.MouseMove = OnMouseMove EndSub Sub OnMouseMove _mx = Math.Round(GraphicsWindow.MouseX / scale + offsetX) _my = Math.Round(GraphicsWindow.MouseY / scale + offsetY) GraphicsWindow.Title = _mx + "," + _my EndSub Sub AddCenter _x = "1=" + (2000 / 2 + 90) + ";2=60;3=60;4=180;" _y = "1=" + (1000 / 2 - 80) + ";2=55;3=945;4=945;" GraphicsWindow.PenColor = "Black" GraphicsWindow.PenWidth = 1 GraphicsWindow.BrushColor = "Transparent" _n = Array.GetItemCount(_x) For _i = 1 To _n _cross1 = Shapes.AddLine(-4, -4, 4, 4) Shapes.Move(_cross1, scale * (_x[_i] - offsetX), scale * (_y[_i] - offsetY)) _cross2 = Shapes.AddLine(-4, 4, 4, -4) Shapes.Move(_cross2, scale * (_x[_i] - offsetX), scale * (_y[_i] - offsetY)) EndFor _r = "0=210;1=235;2=265;3=305;4=320;5=308;6=335;7=350;" _n = Array.GetItemCount(_r) For _i = 0 To _n - 1 _d = scale * _r[_i] * 2 _circleMark = Shapes.AddEllipse(_d, _d) Shapes.Move(_circleMark, scale * (centerX - offsetX) - _d / 2, scale * (centerY - offsetY) - _d / 2) EndFor EndSub Sub DrawGrid GraphicsWindow.PenColor = "Navy" GraphicsWindow.PenWidth = 1 For _x = 0 To gw Step scale * 100 GraphicsWindow.DrawLine(_x - scale * offsetX, 0 - scale * offsetY, _x - scale * offsetX, gh - 1 - scale * offsetY) EndFor For _y = 0 To gh Step scale * 100 GraphicsWindow.DrawLine(0 - scale * offsetX, _y - scale * offsetY, gw - 1 - scale * offsetX, _y - scale * offsetY) EndFor EndSub Sub AddSun _opacity = 100 _sunRadius = sunDiameter / 2 _angleStep = 360 / amountOfRays _stepRadians = Math.GetRadians(_angleStep) GraphicsWindow.BrushColor = sunColor GraphicsWindow.PenColor = sunColor GraphicsWindow.PenWidth = 0 _sunCircle = Shapes.AddEllipse(scale * sunDiameter, scale * sunDiameter) Shapes.Move(_sunCircle, scale * (centerX - _sunRadius - offsetX), scale * (centerY - _sunRadius - offsetY)) Shapes.SetOpacity(_sunCircle, _opacity) For _angle = 0 To 359 Step _angleStep _radians = Math.GetRadians(_angle) _x1 = scale * (centerX + Math.Cos(_radians - _stepRadians / 4) * distanceFromCenter - offsetX) _y1 = scale * (centerY + Math.Sin(_radians - _stepRadians / 4) * distanceFromCenter - offsetY) _x2 = scale * (centerX + Math.Cos(_radians + _stepRadians / 4) * distanceFromCenter - offsetX) _y2 = scale * (centerY + Math.Sin(_radians + _stepRadians / 4) * distanceFromCenter - offsetY) _X3 = scale * (centerX + Math.Cos(_radians) * (distanceFromCenter + lengthOfRays) - offsetX) _Y3 = scale * (centerY + Math.Sin(_radians) * (distanceFromCenter + lengthOfRays) - offsetY) _triangle[_angle] = Shapes.AddTriangle(_x1, _y1, _x2, _y2, _x3, _y3) Shapes.SetOpacity(_triangle[_angle], _opacity) _circleDiameter = Math.SquareRoot((_x2 - _x1) * (_x2 - _x1) + (_y2 - _y1) * (_y2 - _y1)) + 2 _circle[_angle] = Shapes.AddEllipse(_circleDiameter, _circleDiameter) Shapes.Move(_circle[_angle], (_x1 + _x2) / 2 - _circleDiameter / 2, (_y1 + _y2) / 2 - _circleDiameter / 2) Shapes.SetOpacity(_circle[_angle], _opacity) EndFor EndSub Sub AddEagle ' eye _x = scale * 1031 _y = scale * 721 _size = scale * 4 GraphicsWindow.BrushColor = sunColor GraphicsWindow.FillEllipse(_x - _size / 2 - scale * offsetX, _y - _size / 2 - scale * offsetY, _size, _size) ' head InitHead() FillSplines() ' tail InitTail() FillSplines() ' left wing InitLeftWing() FillSplines() ' right wing InitRightWing() FillSplines() EndSub Sub AddPattern ' small hearts InitSmallHeart() FillSplines() FlipPolylinesAtTop() deltaX = 0 deltaY = 894 MovePolylines() FillSplines() FlipPolylinesAtRight() FillSplines() deltaY = -894 MovePolylines() FlipPolylinesAtBottom() FillSplines() ' large hearts InitLargeHeart() FillSplines() deltaY = 350 MovePolylines() FillSplines() FlipPolylinesAtBottom() FillSplines() deltaY = -350 MovePolylines() FillSplines() FlipPolylinesAtRight() FillSplines() deltaY = 350 MovePolylines() FillSplines() FlipPolylinesAtTop() FillSplines() deltaY = -350 MovePolylines() FillSplines() ' roles InitRole() FillSplines() deltaX = 0 deltaY = 350 MovePolylines() FillSplines() MovePolylines() FillSplines() FlipPolylinesAtBottom() FillSplines() deltaY = -350 MovePolylines() FillSplines() MovePolylines() FillSplines() FlipPolylinesAtRight() FillSplines() deltaY = 350 MovePolylines() FillSplines() MovePolylines() FillSplines() FlipPolylinesAtTop() FillSplines() deltaY = -350 MovePolylines() FillSplines() MovePolylines() FillSplines() EndSub ' B-Spline Curve 0.3 ' Small Basic version ported by Nonki Takahashi. ' ' History: ' 0.3 2014-03-12 Ported _Interpret() routine. ' 0.2 2014-03-12 Leading _ is added to each non user routine name. ' 0.1 2014-02-21 Created. (WWV142) ' ' Reference: ' [1] Steven Harrington, COMPUTER GRAPHICS A Programming Approach, McGraw-Hill, 1983 ' * Numbers such as (8.1) in comment mean algorithm numbers in this book. ' Leading _ is added to non user routine name. ' Sub FillSplines Not = "True=False;False=True;" MAX_NUMBER_OF_LINES = 20 MAX_SAMPLE_POINTS = 20 DFSIZE = MAX_NUMBER_OF_LINES * MAX_SAMPLE_POINTS * 4 free = 1 numberOfLines = 10 polygon = "" polygon["bc"] = sunColor nv = 0 For _iPolyline = 1 To _nPolyline InitSample() If ns = 1 Then nv = nv + 1 polygon["x" + nv] = sx[1] polygon["y" + nv] = sy[1] Else SetBSpline() For i = 1 To 5 ax[i] = sx[i] ay[i] = sy[i] az[i] = 0 EndFor StartBSpline() For i = 6 To ns - 2 x = sx[i] y = sy[i] z = 0 CurveAbs3() EndFor x1 = sx[ns - 1] y1 = sy[ns - 1] z1 = 0 x2 = sx[ns] y2 = sy[ns] z2 = 0 EndBSpline() start = 1 count = free - 1 GraphicsWindow.PenColor = "Black" AddPolygon() EndIf '_Interpret() free = 1 EndFor If polygon["x1"] <> polygon["x" + nv] Or polygon["y1"] <> polygon["y" + nv] Then nv = nv + 1 polygon["x" + nv] = polygon["x1"] polygon["y" + nv] = polygon["y1"] EndIf FillPolygon() EndSub ' FillSplines Sub DrawPolygon GraphicsWindow.PenColor = "Black" GraphicsWindow.PenWidth = 1 n = 0 While polygon["x" + (n + 1)] <> "" n = n + 1 If 2 <= n Then GraphicsWindow.DrawLine(polygon["x" + (n - 1)], polygon["y" + (n - 1)], polygon["x" + n], polygon["y" + n]) EndIf EndWhile EndSub ' DrawPolygon Sub AddPolygon For nth = start To start + count - 1 _GetPoint() ' revised version _x = Math.Floor(x) _y = Math.Floor(y) If op = 1 Or op = 2 Then If nv = 0 Or (_x <> polygon["x" + nv] Or _y <> polygon["y" + nv]) Then nv = nv + 1 polygon["x" + nv] = _x polygon["y" + nv] = _y EndIf Else msg = "Error: OP-code error " + op _Error() EndIf EndFor EndSub ' AddPolygon Sub InitHead ' 7 <= number of sample points _pX = "" _pY = "" _pX[1] = "1=1067;2=1061;3=1056;4=1051;5=1048;6=1043;7=1038;" _pY[1] = "1=710;2=711;3=712;4=713;5=713;6=715;7=717;" _pX[2] = "1=1038;2=1038;3=1037;4=1036;5=1031;6=1029;7=1027;" _pY[2] = "1=717;2=719;3=722;4=725;5=726;6=726;7=724;" _pX[3] = "1=1027;2=1026;3=1024;4=1021;5=1020;6=1019;7=1017;" _pY[3] = "1=724;2=724;3=724;4=724;5=723;6=723;7=722;" _pX[4] = "1=1017;2=1012;3=1010;4=1008;5=1006;6=1006;7=1005;" _pY[4] = "1=722;2=724;3=726;4=730;5=734;6=739;7=744;" _pX[5] = "1=1005;2=1006;3=1008;4=1010;5=1012;6=1014;7=1016;" _pY[5] = "1=744;2=742;3=740;4=738;5=737;6=736;7=735;" _pX[6] = "1=1014;2=1020;3=1026;4=1053;5=1083;6=1112;7=1115;8=1111;9=1082;10=1076;11=1072;" _pY[6] = "1=741;2=738;3=736;4=733;5=734;6=735;7=734;8=732;9=731;10=731;11=728;" _pX[7] = "1=1072;2=1070;3=1066;4=1063;5=1062;6=1057;7=1055;" _pY[7] = "1=728;2=730;3=730;4=731;5=730;6=730;7=728;" _pX[8] = "1=1062;" _pY[8] = "1=720;" _pX[9] = "1=1057;" _pY[9] = "1=719;" _nPolyline = Array.GetItemCount(_pX) EndSub ' InitHead Sub InitTail ' 7 <= number of sample points _pX = "" _pY = "" _pX[1] = "1=1175;2=1175;3=1174;4=1172;5=1170;6=1167;7=1164;" _pY[1] = "1=714;2=716;3=718;4=720;5=721;6=722;7=723;" _pX[2] = "1=1166;2=1159;3=1132;4=1084;5=1069;6=1054;7=1048;8=1049;9=1059;10=1075;" _pY[2] = "1=728;2=736;3=742;4=743;5=746;6=753;7=765;8=767;9=764;10=754;" _pX[3] = "1=1075;2=1075;3=1075;4=1078;5=1084;6=1090;7=1095;" _pY[3] = "1=754;2=759;3=764;4=770;5=764;6=759;7=753;" _pX[4] = "1=1095;2=1095;3=1095;4=1096;5=1100;6=1110;7=1117;" _pY[4] = "1=753;2=758;3=765;4=769;5=769;6=760;7=755;" _pX[5] = "1=1117;2=1117;3=1117;4=1119;5=1126;6=1132;7=1136;" _pY[5] = "1=755;2=760;3=765;4=768;5=767;6=760;7=754;" _pX[6] = "1=1136;2=1138;3=1141;4=1146;5=1150;6=1154;7=1156;" _pY[6] = "1=754;2=758;3=764;4=765;5=761;6=756;7=754;" _pX[7] = "1=1156;2=1160;3=1162;4=1167;5=1171;6=1177;7=1181;" _pY[7] = "1=754;2=756;3=759;4=761;5=759;6=750;7=746;" _pX[8] = "1=1181;2=1182;3=1185;4=1189;5=1195;6=1198;7=1202;8=1209;9=1218;10=1221;11=1222;12=1223;" _pY[8] = "1=746;2=751;3=754;4=755;5=748;6=739;7=741;8=745;9=746;10=741;11=733;12=728;" _pX[9] = "1=1223;2=1229;3=1238;4=1246;5=1252;6=1255;7=1255;" _pY[9] = "1=728;2=731;3=734;4=733;5=728;6=721;7=717;" _pX[10] = "1=1255;2=1237;3=1216;4=1204;5=1195;6=1183;7=1175;" _pY[10] = "1=717;2=716;3=713;4=712;5=712;6=712;7=714;" _nPolyline = Array.GetItemCount(_pX) EndSub ' InitTail Sub InitLeftWing ' 7 <= number of sample points _pX = "" _pY = "" _pX[1] = "1=1100;2=1084;3=1068;4=1054;5=1033;6=1021;7=1017;8=1017;" _pY[1] = "1=654;2=670;3=689;4=698;5=707;6=712;7=718;8=720;" _pX[2] = "1=1022;2=1030;3=1037;4=1051;5=1079;6=1096;7=1121;8=1153;9=1179;" _pY[2] = "1=722;2=719;3=716;4=708;5=690;6=675;7=666;8=662;9=657;" _pX[3] = "1=1179;2=1188;3=1200;4=1212;5=1225;6=1241;7=1259;" _pY[3] = "1=657;2=646;3=637;4=629;5=622;6=614;7=604;" _pX[4] = "1=1259;2=1265;3=1272;4=1288;5=1300;6=1317;7=1326;" _pY[4] = "1=604;2=592;3=582;4=566;5=558;6=551;7=553;" _pX[5] = "1=1326;2=1325;3=1324;4=1322;5=1320;6=1317;7=1313;" _pY[5] = "1=553;2=557;3=561;4=565;5=569;6=574;7=579;" _pX[6] = "1=1313;2=1316;3=1319;4=1321;5=1324;6=1327;7=1329;" _pY[6] = "1=579;2=578;3=577;4=577;5=576;6=576;7=576;" _pX[7] = "1=1329;2=1329;3=1327;4=1324;5=1322;6=1317;7=1314;" _pY[7] = "1=576;2=582;3=585;4=588;5=590;6=594;7=597;" _pX[8] = "1=1325;2=1322;3=1316;4=1310;5=1305;6=1300;7=1296;" _pY[8] = "1=601;2=604;3=607;4=611;5=614;6=617;7=621;" _pX[9] = "1=1303;2=1293;3=1287;4=1284;5=1285;6=1282;7=1275;8=1269;" _pY[9] = "1=624;2=628;3=631;4=635;5=639;6=643;7=645;8=648;" _pX[10] = "1=1274;2=1272;3=1270;4=1268;5=1266;6=1263;7=1260;" _pY[10] = "1=653;2=656;3=657;4=657;5=658;6=658;7=658;" _pX[11] = "1=1261;2=1254;3=1247;4=1241;5=1228;6=1218;7=1203;" _pY[11] = "1=670;2=674;3=679;4=683;5=689;6=692;7=694;" _pX[12] = "1=1203;2=1217;3=1231;4=1247;5=1255;6=1271;7=1285;" _pY[12] = "1=694;2=695;3=694;4=690;5=687;6=680;7=671;" _pX[13] = "1=1270;2=1277;3=1286;4=1303;5=1308;6=1306;7=1293;8=1287;" _pY[13] = "1=663;2=659;3=657;4=656;5=654;6=652;7=650;8=649;" _pX[14] = "1=1287;2=1300;3=1320;4=1324;5=1320;6=1307;7=1302;" _pY[14] = "1=649;2=645;3=640;4=637;5=635;6=634;7=633;" _pX[15] = "1=1302;2=1316;3=1336;4=1341;5=1339;6=1327;7=1323;" _pY[15] = "1=633;2=628;3=621;4=617;5=614;6=615;7=613;" _pX[16] = "1=1323;2=1337;3=1360;4=1367;5=1370;6=1365;7=1342;8=1337;" _pY[16] = "1=613;2=603;3=588;4=579;5=568;6=568;7=581;8=579;" _pX[17] = "1=1337;2=1356;3=1382;4=1394;5=1393;6=1387;7=1380;8=1361;9=1347;10=1339;" _pY[17] = "1=579;2=562;3=536;4=520;5=517;6=514;7=519;8=539;9=551;10=554;" _pX[18] = "1=1339;2=1352;3=1379;4=1388;5=1386;6=1379;7=1371;8=1346;9=1337;" _pY[18] = "1=554;2=539;3=501;4=484;5=479;6=477;7=483;8=518;9=527;" _pX[19] = "1=1337;2=1348;3=1354;4=1361;5=1360;6=1354;7=1348;8=1344;9=1336;10=1327;" _pY[19] = "1=527;2=504;3=488;4=464;5=443;6=439;7=445;8=462;9=493;10=508;" _pX[20] = "1=1327;2=1332;3=1331;4=1326;5=1321;6=1304;7=1281;8=1249;9=1199;10=1150;11=1100;" _pY[20] = "1=508;2=481;3=463;4=459;5=462;6=516;7=556;8=593;9=629;10=647;11=654;" _nPolyline = Array.GetItemCount(_pX) EndSub ' InitLeftWing Sub InitRightWing ' 7 <= number of sample points _pX = "" _pY = "" _pX[1] = "1=1085;2=1044;3=1000;4=985;5=960;6=938;7=904;8=869;9=859;10=856;11=852;12=849;13=849;14=851;" _pY[1] = "1=654;2=650;3=637;4=630;5=616;6=600;7=563;8=500;9=465;10=462;11=461;12=463;13=483;14=511;" _pX[2] = "1=851;2=841;3=835;4=829;5=825;6=819;7=818;8=829;9=843;" _pY[2] = "1=511;2=483;3=459;4=443;5=440;6=444;7=458;8=501;9=529;" _pX[3] = "1=843;2=821;3=812;4=802;5=796;6=793;7=794;8=798;9=815;10=826;11=842;" _pY[3] = "1=529;2=500;3=486;4=477;5=475;6=480;7=486;8=499;9=522;10=538;11=556;" _pX[4] = "1=842;2=831;3=802;4=795;5=789;6=787;7=801;8=812;9=819;10=841;" _pY[4] = "1=556;2=549;3=522;4=516;5=516;6=522;7=538;8=551;9=559;10=579;" _pX[5] = "1=841;2=835;3=817;4=809;5=811;6=829;7=844;8=866;" _pY[5] = "1=579;2=579;3=570;4=569;5=578;6=591;7=600;8=611;" _pX[6] = "1=866;2=857;3=840;4=835;5=835;6=848;7=862;8=873;9=865;10=853;11=851;12=862;13=872;14=881;" _pY[6] = "1=611;2=611;3=611;4=610;5=612;6=619;7=622;8=625;9=629;10=631;11=633;12=637;13=638;14=639;" _pX[7] = "1=881;2=874;3=866;4=866;5=876;6=886;7=896;" _pY[7] = "1=639;2=642;3=644;4=648;5=651;6=654;7=655;" _pX[8] = "1=896;2=880;3=886;4=900;5=918;6=938;7=963;8=983;" _pY[8] = "1=655;2=661;3=661;4=669;5=676;6=685;7=691;8=694;" _pX[9] = "1=983;2=963;3=946;4=932;5=928;6=912;7=901;" _pY[9] = "1=694;2=689;3=683;4=678;5=676;6=668;7=663;" _pX[10] = "1=914;2=908;3=902;4=900;5=897;6=892;7=889;" _pY[10] = "1=653;2=653;3=653;4=651;5=650;6=648;7=645;" _pX[11] = "1=896;2=889;3=881;4=881;5=883;6=875;7=877;8=863;9=851;10=856;11=862;" _pY[11] = "1=637;2=634;3=632;4=627;5=621;6=618;7=608;8=602;9=594;10=592;11=591;" _pX[12] = "1=862;2=859;3=855;4=851;5=848;6=845;7=843;" _pY[12] = "1=591;2=588;3=585;4=581;5=578;6=573;7=571;" _pX[13] = "1=855;2=855;3=853;4=851;5=849;6=846;7=843;" _pY[13] = "1=570;2=565;3=561;4=555;5=550;6=545;7=541;" _pX[14] = "1=843;2=846;3=849;4=850;5=851;6=854;7=856;" _pY[14] = "1=541;2=540;3=540;4=541;5=541;6=541;7=543;" _pX[15] = "1=859;2=885;3=918;4=930;5=957;6=1001;7=1016;8=1054;9=1076;" _pY[15] = "1=537;2=559;3=600;4=611;5=620;6=658;7=660;8=663;9=674;" _nPolyline = Array.GetItemCount(_pX) EndSub ' InitRightWing Sub InitSmallHeart ' 7 <= number of sample points _pX = "" _pY = "" _pX[1] = "1=120;2=119;3=111;4=102;5=103;6=107;7=113;8=118;9=120;" _pY[1] = "1=120;2=114;3=96;4=74;5=69;6=66;7=70;8=76;9=84;" _pX[2] = "1=120;2=117;3=107;4=96;5=91;6=94;7=103;8=108;9=110;" _pY[2] = "1=60;2=55;3=52;4=57;5=72;6=81;7=99;8=112;9=120;" _nPolyline = Array.GetItemCount(_pX) EndSub ' InitSmallHeart Sub InitLargeHeart ' 7 <= number of sample points _pX = "" _pY = "" _pX[1] = "1=110;2=93;3=80;4=69;5=59;6=55;7=57;8=67;9=69;10=82;" _pY[1] = "1=180;2=210;3=236;4=254;5=276;6=294;7=301;8=316;9=320;10=325;" _pX[2] = "1=96;2=101;3=107;4=112;5=114;6=117;7=120;" _pY[2] = "1=325;2=323;3=320;4=316;5=313;6=308;7=299;" _pX[3] = "1=120;2=115;3=112;4=111;5=111;6=113;7=115;" _pY[3] = "1=215;2=222;3=228;4=234;5=237;6=242;7=244;" _pX[4] = "1=115;2=109;3=107;4=103;5=99;6=94;7=91;" _pY[4] = "1=244;2=242;3=242;4=243;5=245;6=249;7=255;" _pX[5] = "1=91;2=107;3=113;4=115;5=111;6=108;7=100;8=96;9=93;10=96;" _pY[5] = "1=255;2=253;3=257;4=266;5=276;6=278;7=281;8=280;9=276;10=268;" _pX[6] = "1=96;2=91;3=87;4=86;5=84;6=84;7=84;" _pY[6] = "1=268;2=268;3=269;4=270;5=273;6=276;7=280;" _pX[7] = "1=84;2=81;3=79;4=79;5=77;6=75;7=74;" _pY[7] = "1=280;2=280;3=281;4=282;5=282;6=283;7=285;" _pX[8] = "1=74;2=75;3=77;4=79;5=79;6=81;7=84;" _pY[8] = "1=285;2=287;3=288;4=288;5=289;6=290;7=290;" _pX[9] = "1=84;2=84;3=84;4=86;5=87;6=91;7=96;" _pY[9] = "1=290;2=294;3=297;4=300;5=301;6=302;7=302;" _pX[10] = "1=96;2=93;3=96;4=100;5=106;6=109;7=103;8=90;9=78;10=72;11=67;12=67;13=69;14=78;15=80;16=105;17=120;" _pY[10] = "1=302;2=294;3=292;4=289;5=293;6=299;7=312;8=316;9=314;10=309;11=301;12=292;13=276;14=255;15=251;16=209;17=180;" _nPolyline = Array.GetItemCount(_pX) EndSub ' InitLargeHeart Sub InitRole ' 7 <= number of sample points _pX = "" _pY = "" _pX[1] = "1=60;2=64;3=66;4=62;5=57;6=60;7=67;" _pY[1] = "1=55;2=63;3=74;4=95;5=118;6=134;7=142;" _pX[2] = "1=67;2=65;3=63;4=60;5=59;6=57;7=56;" _pY[2] = "1=142;2=143;3=144;4=145;5=146;6=148;7=150;" _pX[3] = "1=103;2=107;3=114;4=115;5=118;6=120;7=120;" _pY[3] = "1=150;2=146;3=139;4=137;5=132;6=126;7=120;" _pX[4] = "1=110;2=110;3=105;4=89;5=77;6=69;7=71;8=76;9=81;10=87;11=91;12=93;13=95;14=91;15=86;" _pY[4] = "1=120;2=127;3=137;4=145;5=140;6=126;7=118;8=111;9=108;10=107;11=108;12=111;13=116;14=122;15=122;" _pX[5] = "1=86;2=85;3=85;4=85;5=86;6=86;7=87;" _pY[5] = "1=122;2=121;3=119;4=118;5=117;6=116;7=115;" _pX[6] = "1=87;2=85;3=83;4=81;5=80;6=79;7=79;" _pY[6] = "1=115;2=114;3=115;4=117;5=118;6=120;7=123;" _pX[7] = "1=79;2=78;3=77;4=76;5=75;6=74;7=74;" _pY[7] = "1=123;2=123;3=124;4=124;5=125;6=126;7=127;" _pX[8] = "1=74;2=74;3=75;4=76;5=77;6=78;7=79;" _pY[8] = "1=127;2=127;3=128;4=129;5=130;6=131;7=131;" _pX[9] = "1=79;2=79;3=80;4=81;5=83;6=85;7=87;" _pY[9] = "1=131;2=134;3=135;4=137;5=138;6=140;7=139;" _pX[10] = "1=87;2=86;3=86;4=85;5=85;6=85;7=86;" _pY[10] = "1=139;2=138;3=137;4=136;5=135;6=133;7=132;" _pX[11] = "1=86;2=92;3=96;4=100;5=103;6=100;7=97;8=92;9=85;10=79;11=73;" _pY[11] = "1=132;2=131;3=130;4=127;5=116;6=106;7=102;8=98;9=96;10=98;11=103;" _pX[12] = "1=73;2=74;3=75;4=77;5=79;6=82;7=86;" _pY[12] = "1=103;2=99;3=94;4=92;5=90;6=89;7=89;" _pX[13] = "1=86;2=85;3=84;4=82;5=80;6=78;7=76;" _pY[13] = "1=89;2=88;3=85;4=84;5=84;6=84;7=85;" _pX[14] = "1=76;2=77;3=77;4=78;5=79;6=81;7=82;" _pY[14] = "1=85;2=82;3=81;4=80;5=79;6=79;7=79;" _pX[15] = "1=82;2=82;3=81;4=80;5=79;6=77;7=76;" _pY[15] = "1=79;2=78;3=76;4=75;5=74;6=74;7=75;" _pX[16] = "1=76;2=76;3=75;4=74;5=72;6=67;7=60;" _pY[16] = "1=75;2=71;3=67;4=64;5=61;6=58;7=55;" _nPolyline = Array.GetItemCount(_pX) EndSub ' InitRole Sub _Error TextWindow.WriteLine(msg) TextWindow.Pause() Program.End() EndSub ' _Error Sub InitSample ' param _iPolyline - index for polyline ns = Array.GetItemCount(_pX[_iPolyline]) For is = 1 To ns sx[is] = scale * (_pX[_iPolyline][is] - offsetX) sy[is] = scale * (_pY[_iPolyline][is] - offsetY) EndFor GraphicsWindow.PenColor = "DarkOrange" EndSub ' InitSample Sub WaitClick clicked = "False" While Not[clicked] Program.Delay(100) EndWhile EndSub ' WaitClick Sub OnMouseDown sx[i] = GraphicsWindow.MouseX sy[i] = GraphicsWindow.MouseY clicked = "True" EndSub ' OnMouseDown Sub Pause TextWindow.Write(msg) TextWindow.Read() EndSub ' Pause Sub Dump b = firstBlend name = "firstBlend" DumpB() b = secondBlend name = "secondBlend" DumpB() b = blend name = "blend" DumpB() b = nextToLastBlend name = "nextToLastBlend" DumpB() b = lastBlend name = "lastBlend" DumpB() EndSub ' Dump Sub DumpB sum = "" For j = 1 To 4 For i = 1 To numberOfLines sum[i] = sum[i] + b[j][i] r[i] = Math.Round(b[j][i] * 100) / 100 EndFor TextWindow.WriteLine(name+"["+j+"]="+r) EndFor For i = 1 To numberOfLines sum[i] = Math.Round(sum[i] * 100) / 100 EndFor TextWindow.WriteLine("sum="+sum) EndSub ' DumpB Sub _PutPoint ' (2.1) wirte a complete command to display file ' param op, x, y - command to be written ' global dfOp, dfX, dfY - display file ' global free - position to next null cell ' constant DFSIZE - length of display file array If DFSIZE < free Then msg = "Error: Display file full" _Error() Else dfOp[free] = op dfX[free] = x dfY[free] = y free = free + 1 EndIf EndSub ' _PutPoint Sub _GetPoint ' (2.2 revised) Read Nth Command from Display File ' param nth - address of command to read ' return op, x, y - command to be read ' global dfOp, dfX, dfY - display file op = dfOp[nth] x = dfX[nth] y = dfY[nth] EndSub ' _GetPoint Sub _DisplayFileEnter ' (2.3) create a command combined with operation and pen position and save it to display file ' param op - operation to be filed ' global dfPenX, dfPenY - current position of pen x = dfPenX y = dfPenY _PutPoint() EndSub ' _DisplayFileEnter Sub _DoMove ' (2.8 revised) Execute to Move Pen ' param x, y - point for pen moving to ' global framePenX, framePenY - point (screen co-ordinate) framePenX = x framePenY = y EndSub ' _DoMove Sub _DoLine ' (2.9 revised) Execute to Draw Line ' param x, y - point for pen moving to ' global framePenX, framePenY - point (screen co-ordinate) GraphicsWindow.DrawLine(framePenX, framePenY, x, y) framePenX = x framePenY = y EndSub ' _DoLine Sub MoveAbs3 ' (8.1) 3-dimensional absolute move ' param x, y, z - target co-ordinate for pen move ' global dfPenX, dfPenY, dfPenZ - current pen position dfPenX = x dfPenY = y dfPenZ = z op = 1 _DisplayFileEnter() EndSub ' _MoveAbs3 Sub LineAbs3 ' (8.3) 3-dimensional absolute line draw ' param x, y, z - target co-ordinate draw line ' global dfPenX, dfPenY, dfPenZ - current pen position dfPenX = x dfPenY = y dfPenZ = z op = 2 _DisplayFileEnter() EndSub ' _LineAbs3 Sub _MakeCurve ' (12.3) fill section of curve ' param b - array of blend function value ' global linesPerSection - number of lines per 1 curve section ' global xsm, ysm, zsm - 4-element array including sample points ' local i - stepping for 4 sample points ' local j - stepping for lines in curve section ' local x, y, z - co-ordinate of point on fitted curve Stack.PushValue("local", i) Stack.PushValue("local", j) Stack.PushValue("local", x) Stack.PushValue("local", y) Stack.PushValue("local", z) For j = 1 To linesPerSection x = 0 y = 0 z = 0 ' add contribution from each sample point For i = 1 To 4 x = x + xsm[i] * b[i][j] y = y + ysm[i] * b[i][j] z = z + zsm[i] * b[i][j] EndFor ' draw fitted curve LineAbs3() EndFor z = Stack.PopValue("local") y = Stack.PopValue("local") x = Stack.PopValue("local") j = Stack.PopValue("local") i = Stack.PopValue("local") EndSub ' _MakeCurve Sub _NextSection ' (12.4) shift the sample points to prepare for the next curve section ' global xsm, ysm, zsm - 4-element array for sample points ' local i - stepping for sample points Stack.PushValue("local", i) For i = 1 To 3 xsm[i] = xsm[i + 1] ysm[i] = ysm[i + 1] zsm[i] = zsm[i + 1] EndFor i = Stack.PopValue("local") EndSub ' _NextSection Sub _PutInSM ' (12.6) put new sample point in xsm, ysm, zsm arrays ' param x, y, z - new sample point ' global xsm, ysm, zsm - 4-element arrays to keep sample points xsm[4] = x ysm[4] = y zsm[4] = z EndSub ' _PutInSM Sub CurveAbs3 ' (12.7) extend curve ' param x, y, z - new sample point for the curve ' global blend - array[4][linePerSection] for blend function value _PutInSM() b = blend _MakeCurve() _NextSection() EndSub ' CurveAbs3 Sub SetBSpline ' (12.10) set number of lines in a section of B-spline interpolation ' param numberOfLines ' global linesPerSection - memory for numberOfLines ' global blend[][] ' global firstBlend[][] ' global nextToLastBlend[][] ' global lastBlend[][] - array[4][MAX_NUMBER_OF_LINES] to keep blending function value ' local i, j - stepping for points needed on the curve ' local u - temporary memory Stack.PushValue("local", i) Stack.PushValue("local", j) Stack.PushValue("local", u) If numberOfLines < 1 Or MAX_NUMBER_OF_LINES < numberOfLines Then msg = "Error: Invalid number of line segments" _Error() EndIf linesPerSection = numberOfLines For i = 1 To numberOfLines u = i / numberOfLines firstBlend[1][i] = Math.Power(1 - u, 3) firstBlend[4][i] = Math.Power(u, 3) / 6 firstBlend[3][i] = (3 / 2 - 11 * u / 12) * Math.Power(u, 2) firstBlend[2][i] = 1 - firstBlend[1][i] - firstBlend[3][i] - firstBlend[4][i] secondBlend[1][i] = firstBlend[1][i] / 4 secondBlend[4][i] = firstBlend[4][i] secondBlend[3][i] = (((1 - u) * u + 1) * u + 1 / 3) / 2 secondBlend[2][i] = 1 - secondBlend[1][i] - secondBlend[3][i] - secondBlend[4][i] blend[1][i] = firstBlend[1][i] / 6 blend[4][i] = firstBlend[4][i] blend[3][i] = secondBlend[3][i] blend[2][i] = 1 - blend[1][i] - blend[3][i] - blend[4][i] j = numberOfLines - i If 0 < j Then nextToLastBlend[1][j] = secondBlend[4][i] nextToLastBlend[2][j] = secondBlend[3][i] nextToLastBlend[3][j] = secondBlend[2][i] nextToLastBlend[4][j] = secondBlend[1][i] lastBlend[1][j] = firstBlend[4][i] lastBlend[2][j] = firstBlend[3][i] lastBlend[3][j] = firstBlend[2][i] lastBlend[4][j] = firstBlend[1][i] EndIf EndFor nextToLastBlend[1][numberOfLines] = 0 nextToLastBlend[2][numberOfLines] = 1 / 6 nextToLastBlend[3][numberOfLines] = 7 / 12 nextToLastBlend[4][numberOfLines] = 1 / 4 lastBlend[1][numberOfLines] = 0 lastBlend[2][numberOfLines] = 0 lastBlend[3][numberOfLines] = 0 lastBlend[4][numberOfLines] = 1 u = Stack.PopValue("local") j = Stack.PopValue("local") i = Stack.PopValue("local") EndSub ' SetBSpline Sub StartBSpline ' (12.11) start B-spline interpolation curve ' param ax[], ay[], az[] - 5-element array to keep first 5 points ' global xsm, ysm, zsm - 4-element array for sample points ' global firstBlend ' global secondBlend - array[4][linesPerSection] to keep blending function value ' local i - stepping for sample points Stack.PushValue("local", i) For i = 1 To 4 xsm[i] = ax[i] ysm[i] = ay[i] zsm[i] = az[i] EndFor x = ax[1] y = ay[1] z = az[1] MoveAbs3() b = firstBlend _MakeCurve() _NextSection() x = ax[5] y = ay[5] z = az[5] _PutInSM() b = secondBlend _MakeCurve() _NextSection() i = Stack.PopValue("local") EndSub ' StartBSpline Sub EndBSpline ' (12.12) stop B-spline curve ' param x1, y1, z1 - previous sample point from the last ' param x2, y2, z2 - the last sample point ' global nextToLastBlend, lastBlend - array[4][linePerSection] of blend function value x = x1 y = y1 z = z1 _PutInSM() b = nextToLastBlend _MakeCurve() _NextSection() x = x2 y = y2 z = z2 _PutInSM() b = lastBlend _MakeCurve() EndSub ' EndBSpline ' Fill Polygon 0.2 ' Small Basic version ported by Nonki Takahashi. ' Numbers such as (3.8) in comment mean algorithm numbers the book [1]. ' Leading _ is added to non user routine name. ' This version neglects normalization co-ordinate, only uses screen co-ordinate. ' ' History: ' 0.2 2014-03-19 Created new interface. (NZT505-0) ' 0.1 2014-03-12 Created. (NZT505) ' ' Reference: ' [1] Steve Harington, COMPUTER GRAPHICS A Programming Aproach, McGraw-Hill, 1983 ' Sub InitPolygon scanDecrement = 1 ROUNDOFF = Math.Power(10, -20) free = 1 solid = "True" EndSub Sub FillPolygon GraphicsWindow.BrushColor = polygon["bc"] n = 0 ax = "" ay = "" While polygon["x" + (n + 1)] <> "" n = n + 1 ax[n] = polygon["x" + n] ay[n] = polygon["y" + n] EndWhile PolygonAbs2() start = 1 count = 1 _Interpret() free = 1 EndSub Sub LineAbs2 ' (2.5) Save Command to Draw Line ' param x, y - target co-ordinate to draw line ' global dfPenX, dfPenY - current pen position dfPenX = x dfPenY = y op = 2 _DisplayFileEnter() EndSub ' LineAbs2 Sub PolygonAbs2 ' (3.1) Write Polygon to Display File ' param n - number of edges for the polygon ' param ax, ay - array of vertices for the polygon ' global dfPenX, dfPenY - current pen position ' local i - stepping across edges for the polygon Stack.PushValue("local", i) If n < 3 Then msg = "Error: Polygon sides error" _Error() EndIf op = n dfPenX = ax[n] dfPenY = ay[n] _DisplayFileEnter() For i = 1 To n x = ax[i] y = ay[i] LineAbs2() EndFor i = Stack.PopValue("local") EndSub ' PolygonAbs2 Sub _Interpret ' (3.6) Scan Display File and Execute Commands ' param start - first address to scan display file ' param count - number of commands to be executed ' local nth - address in display file ' local op, x, y - display file command ' loop to execute all commands needed For nth = start To start + count - 1 _GetPoint() ' revised version If op = 1 Then _DoMove() ElseIf op = 2 Then _DoLine() Else index = nth _DoPolygon() nth = index EndIf EndFor EndSub ' _Interpret Sub _DoPolygon ' (3.7) Execute Polygon Command If solid Then _FillPolygon() EndIf _DoMove() EndSub ' _DoPolygon Sub _FillPolygon ' (3.8) Fill Polygon ' param op, x, y - polygon command ' param index - position of command in display file ' global yMax - maximum y array for each edge of the polygon ' global scanDecrement - displacement for scan line ' local edges - number of edges to process ' local scan - y co-ordinate of scan line ' local startEdge, endEdge - edges crossing the scan line ' load information about vertices of the polygon _LoadPolygon() ' revised version ' enough edges to consider? If edges < 2 Then msg = "Waring: one or no edge" TextWindow.WriteLine(msg) Goto return EndIf ' set scan line scan = yMax[1] ' initialize the numbers for start and end edges to process startEdge = 1 endEdge = 1 ' fill polygon ' get a new edge included in scan step lastEdge = edges _Include() ' determine intersection point with scan line, and remove processed edge _UpdateXValues() ' repeat until all edges are processed While startEdge < endEdge ' fill scan line _FillScan() scan = scan - scanDecrement _Include() _UpdateXValues() EndWhile return: EndSub ' _FillPolygon Sub _LoadPolygon ' (3.9 revised) Read Information about Polygon Edges and Convert to the Screen Co-ordinate ' param op, x, y - polygon command ' param index - display file address for the command ' return edges - saved number of edges ' global widthStart, heightStart - address for start point of the screen ' global width, height - size of the screen ' constant ROUNDOFF - small number greater than any round-off error ' local x1, y1, x2, y2 - end points of the edge in actual screen co-ordinate ' local k - stepping across the edges of the polygon ' set start point for an edge Stack.PushValue("local", j) x1 = x ' adjust y co-ordinate to be at middle of the scan line y1 = y + 0.5 ' initialize the number of edges to save edges = 0 ' loop to get information of each edge For k = index + 1 To index + op ' get next vertex nth = k Stack.PushValue("local", op) _GetPoint() ' revised version op = Stack.PopValue("local") x2 = x y2 = y + 0.5 ' examine whether a horizontal line If ROUNDOFF < Math.Abs(y1 - y2) Then ' increment saved number of edge data edges = edges + 1 ' save edge data in decending order of the y j = edges _PolyInsert() EndIf ' old points are reset x1 = x2 y1 = y2 EndFor j = Stack.PopValue("local") EndSub ' _LoadPolygon Sub _PolyInsert ' (3.10) Sort and Write Edges Information of the Polygon ' param j - insert number ' param x1, y1, x2, y2 - both ends of the edge ' global yMax, yMin, xa, dx - arrays for edges information ' local j1 - stepping across the saved edges ' local yM - maximum y for new edge ' insert maximum y into sorted global arrays j1 = j ' find maximum y yM = Math.Max(y1, y2) ' find appropriate insert place and shift entries While 1 < j1 And yMax[j1 - 1] < yM yMax[j1] = yMax[j1 - 1] yMin[j1] = yMin[j1 - 1] xa[j1] = xa[j1 - 1] dx[j1] = dx[j1 - 1] j1 = j1 - 1 EndWHile ' insert edge information yMax[j1] = yM dx[j1] = (x2 - x1) / (y2 - y1) If y2 < y1 Then yMin[j1] = y2 xa[j1] = x1 Else yMin[j1] = y1 xa[j1] = x2 EndIf EndSub ' _PolyInsert Sub _Include ' (3.11) include edges newly across with the scan line into consideration set ' param endEdge - current last element number ' param lastEdge - last edge number ' param scan - current position of the scan line ' global yMax, xa, dx - arrays for edges information ' local scanDecrement - displacement for the scan line While endEdge <= lastEdge And scan <= yMax[endEdge] ' restore start point to last scan line position xa[endEdge] = xa[endEdge] + dx[endEdge] * (scanDecrement + scan - yMax[endEdge]) ' memory x displacement for a scan dx[endEdge] = dx[endEdge] * -scanDecrement endEdge = endEdge + 1 EndWhile EndSub ' _Include Sub _UpdateXValues ' (3.12) Update Intersection Points between Scan Line and the Edges ' param endEdge, startEdge - current limit in the list ' param scan - current scan line ' global yMin, xa, dx - arrays for edges information ' local k - stepping across edges ' local i - stepping across shifted up edges Stack.PushValue("local", i) For k = startEdge To endEdge - 1 If yMin[k] < scan Then xa[k] = xa[k] + dx[k] _XSort() Else startEdge = startEdge + 1 If startEdge <= k Then For i = k To startEdge Step -1 yMin[i] = yMin[i - 1] xa[i] = xa[i - 1] dx[i] = dx[i - 1] EndFor EndIf EndIf EndFor i = Stack.PopValue("local") EndSub ' _UpdateXValues Sub _XSort ' (3.13 revised) Check Order of X Co-ordinate for Intersection Points ' param startEdge - first number of considered edge ' param k - edge number to check the order ' global yMin, xa, dx - arrays of edges information ' local l - stepping across the edges l = k While startEdge < l And xa[l] < xa[l - 1] _Exchange() ' revised version l = l - 1 EndWhile EndSub ' _XSort Sub _Exchange ' (3.14 revised) Exchange Two Parameters ' param l - stepping across the edges ' global yMin, xa, dx - arrays of edges information ' local t - temporary memory t = yMin[l] yMin[l] = yMin[l - 1] yMin[l - 1] = t t = xa[l] xa[l] = xa[l - 1] xa[l - 1] = t t = dx[l] dx[l] = dx[l - 1] dx[l - 1] = t EndSub ' _Exchange Sub _FillScan ' (3.15) Fill Scan Line ' param startEdge, endEdge - edges intersecting the scan line ' param scan - position of scan line ' global xa - array of intersection points between edges and the scan line ' local j - stepping across the edges j = startEdge While j < endEdge x1 = xa[j] x2 = xa[j + 1] y = scan _FillIn() j = j + 2 EndWhile EndSub ' _FillScan Sub _FillIn ' Fill in the Given Horizontal Line ' param x1 ' param x2 ' param y GraphicsWindow.FillRectangle(x1, y, x2 - x1 + 1, 1) EndSub End>LSL357.sb< Start>LSL807.sb< '================================================================================== ' Graphical explosion example - using arrays and Shape manipulation ' Also random numbers and RGB colours and Clock delays '================================================================================== 'Size and center GraphicsWindow gw = 800 gh = 600 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Top = (Desktop.Height-gh)/2 GraphicsWindow.Left = (Desktop.Width-gw)/2 GraphicsWindow.BackgroundColor = "Black" 'Night background 'Main control parameters nbit = 25 'Number of bits in explosion rad = 2 'Effective radius (half width) of shapes nstep = 20 ' Number of animation steps While ("True") 'Keep looping new explosions for ever GraphicsWindow.Clear() ' Also removes all shapes so the Shapes.Remove isn't really needed GraphicsWindow.PenWidth = 0 'No pen borders on shapes 'Create the shapes cenX = gw/8 + Math.GetRandomNumber(gw*3/4) 'Initial position X - centre of shape is at (X,Y), top left corner at (X-rad,Y-rad) cenY = gh/8 + Math.GetRandomNumber(gh*3/4) 'Initial position Y For i = 1 To nbit GraphicsWindow.BrushColor = GraphicsWindow.GetColorFromRGB(255,Math.GetRandomNumber(255),0) 'A random red/yellow colour - red and bits of green is orange! Shapes.Remove(bit[i]) 'Remove any existing shapes before creating a new one bit[i] = Shapes.AddRectangle(2*rad,2*rad) 'New rectangle shape with random colour 10x10 pixels X[i]= cenX Y[i]= cenY velX[i] = (Math.GetRandomNumber(201)-101)/100*300/nstep 'Velocity to fly away X (pixels per step) (-15 to 15) in 201 steps velY[i] = (Math.GetRandomNumber(201)-101)/100*300/nstep 'Velocity to fly away Y (pixels per step) (-15 to 15) in 201 steps angle[i] = Math.GetRandomNumber(360) 'Random rotation in degrees rotation[i] = Math.GetRandomNumber(61)-31 'Random rotation speed (degrees per step) (-30 to 30) Shapes.Rotate(bit[i],angle[i]) 'Random rotation Shapes.Move(bit[i],X[i]-rad,Y[i]-rad) 'Position the bit in start position EndFor 'Move, rotate etc to do the explosion in nstep steps GraphicsWindow.PenWidth = 0.1 ' Thin tracer GraphicsWindow.PenColor = "#55555588" 'A gray/blue colour with some transparency ARGB For t = 1 To nstep 'nstep steps to fly away the explosion start = Clock.ElapsedMilliseconds For i = 1 To nbit X[i] = X[i]+velX[i] 'New position X Y[i] = Y[i]+velY[i] 'New position Y Shapes.Move(bit[i],X[i]-rad,Y[i]-rad) 'Move the bit scale = t/nstep*10 'Scale to zoom shape (max value is 10) Shapes.Zoom(bit[i],scale,scale) 'Zoom the fragment a little angle[i] = angle[i]+rotation[i] 'Update angle of rotation Shapes.Rotate(bit[i],angle[i]) 'Rotate the bit Shapes.SetOpacity(bit[i],(nstep-t)/nstep*100) 'Fade the bit (0 is transparent) GraphicsWindow.DrawLine(cenX,cenY,X[i],Y[i]) ' A tracer - this slows things a bit EndFor delay = 50 - (Clock.ElapsedMilliseconds-start) ' up to 50ms delay depending on how long the drawing update took If (delay > 0) Then Program.Delay(delay) 'Small delay for each step of the explosion EndIf EndFor Program.Delay(500) 'A longer delay between explosions EndWhile End>LSL807.sb< Start>LSM678-0.sb< ' Connect Four 0.2a ' Clone version written by Nonki Takahashi ' ' History: ' 0.2a 2013-11-10 Modified as demo version. (LSM678-0) ' 0.1a 2013-11-07 Created as alpha version. (LSM678) ' gw = 640 gh = 480 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Title = "Connect Four 0.2a" dx = 90 dy = 80 InitDisks() InitBoard() 'DrawGrid() a2col = "A=1;B=2;C=3;D=4;E=5;F=6;G=7;" rec = "1=D;2=D;3=E;4=C;5=C;6=D;7=F;8=G;9=F;" For i = 1 To Array.GetItemCount(rec) col = a2col[rec[i]] DropDisk() EndFor Sub InitDisks color = "1=Gold;2=Red;" GraphicsWindow.PenWidth = 0 For i = 1 To 42 GraphicsWindow.BrushColor = color[Math.Remainder(i - 1, 2) + 1] disk[i] = Shapes.AddEllipse(dy, dy) Shapes.Move(disk[i], 0, -100) EndFor EndSub Sub InitBoard For i = 1 To 42 board[i] = 0 EndFor url = "http://www.nonkit.com/smallbasic.files/Connect4Board.png" Shapes.AddImage(url) EndSub Sub DropDisk ' param i - disk index ' param col - column number 1..7 ' return succeed - "True" if succeed succeed = "False" x = (col - 1) * dx + 10 ms = 500 For row = 6 To 1 Step -1 If board[(row - 1) * 7 + col] = 0 Then Shapes.Move(disk[i], x, -100) y = (row - 1) * dy + 5 Shapes.Animate(disk[i], x, y, ms) Program.Delay(ms) Sound.PlayClick() board[(row - 1) * 7 + col] = Math.Remainder(i - 1, 2) + 1 succeed = "True" Goto break EndIf EndFor break: EndSub End>LSM678-0.sb< Start>LSM678-1.sb< ' Connect Four 0.3a ' Clone version written by Nonki Takahashi ' ' History: ' 0.3a 2013-11-11 Added checking for game end. (LSM678-1) ' 0.2a 2013-11-10 Modified as demo version. (LSM678-0) ' 0.1a 2013-11-07 Created as alpha version. (LSM678) ' gw = 640 gh = 480 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Title = "Connect Four 0.3a" dx = 90 dy = 80 InitDisks() InitBoard() GraphicsWindow.PenWidth = 10 GraphicsWindow.PenColor = "LightGray" GraphicsWindow.BrushColor = "#00000000" ' transparent ring = Shapes.AddEllipse(dy, dy) ' to show last move Shapes.SetOpacity(ring, 50) Shapes.HideShape(ring) InitFour() a2col = "A=1;B=2;C=3;D=4;E=5;F=6;G=7;" rec = "1=D;2=D;3=E;4=C;5=C;6=D;7=F;8=G;9=F;10=D;" rec = rec + "11=D;12=F;13=C;14=C;15=F;16=F;17=B;18=C;19=A;20=E;" rec = rec + "21=E;22=E;23=A;24=B;25=B;26=B;" For i = 1 To Array.GetItemCount(rec) col = a2col[rec[i]] DropDisk() EndFor Sub InitDisks color = "1=Gold;2=Red;" GraphicsWindow.PenWidth = 0 For i = 1 To 42 GraphicsWindow.BrushColor = color[Math.Remainder(i - 1, 2) + 1] disk[i] = Shapes.AddEllipse(dy, dy) Shapes.Move(disk[i], 0, -100) EndFor EndSub Sub InitBoard For i = 1 To 42 board[i] = 0 EndFor url = "http://www.nonkit.com/smallbasic.files/Connect4Board.png" Shapes.AddImage(url) EndSub Sub InitFour InitCheckList() nFour = 0 For row = 1 To 6 For col = 1 To 4 nFour = nFour +1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = (row - 1) * 7 + col + 1 four[nFour][3] = (row - 1) * 7 + col + 2 four[nFour][4] = (row - 1) * 7 + col + 3 AddCheckList() EndFor EndFor For row = 1 To 3 For col = 1 To 7 nFour = nFour +1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = row * 7 + col four[nFour][3] = (row + 1) * 7 + col four[nFour][4] = (row + 2) * 7 + col AddCheckList() EndFor EndFor For row = 1 To 3 For col = 1 To 4 nFour = nFour +1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = row * 7 + col + 1 four[nFour][3] = (row + 1) * 7 + col + 2 four[nFour][4] = (row + 2) * 7 + col + 3 AddCheckList() EndFor EndFor For row = 1 To 3 For col = 4 To 7 nFour = nFour +1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = row * 7 + col - 1 four[nFour][3] = (row + 1) * 7 + col - 2 four[nFour][4] = (row + 2) * 7 + col - 3 AddCheckList() EndFor EndFor EndSub Sub InitCheckList For i = 1 To 42 list[i]["n"] = 0 EndFor EndSub Sub AddCheckList ' param nFour - entry index of four For i = 1 To 4 cell = four[nFour][i] n = list[cell]["n"] + 1 list[cell][n] = nFour list[cell]["n"] = n EndFor EndSub Sub DropDisk ' param i - disk index ' param col - column number 1..7 ' return succeed - "True" if succeed succeed = "False" x = (col - 1) * dx + 10 ms = 500 For row = 6 To 1 Step -1 cell = (row - 1) * 7 + col If board[cell] = 0 Then Shapes.Move(disk[i], x, -100) y = (row - 1) * dy + 5 Shapes.Animate(disk[i], x, y, ms) Program.Delay(ms) Shapes.HideShape(ring) Shapes.Move(ring, x, y - 5) Shapes.ShowShape(ring) Sound.PlayClick() board[cell] = Math.Remainder(i - 1, 2) + 1 succeed = "True" CheckFour() Goto break EndIf EndFor break: EndSub Sub CheckFour ' param cell ' return isFour - "True" if four isFour = "False" n = list[cell]["n"] For f = 1 To n fi = list[cell][f] turn = board[four[fi][1]] For d = 2 To 4 If turn <> board[four[fi][d]] Then Goto notFour EndIf EndFor ShowWinner() isFour = "True" Goto break2 notFour: EndFor break2: EndSub Sub ShowWinner ' param turn - winner GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "Black" pw = 300 ph = 200 popup = Shapes.AddRectangle(pw, ph) Shapes.SetOpacity(popup, 80) x = (gw - pw) / 2 y = (gh - ph) / 2 Shapes.Move(popup, x, y) fs = 40 GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = color[turn] winner = Shapes.AddEllipse(fs, fs) Shapes.Move(winner, x + 20, y + fs * 0.1 + 30) GraphicsWindow.FontSize = fs GraphicsWindow.BrushColor = "White" msg = Shapes.AddText("wins!") Shapes.Move(msg, x + fs * 1.2 + 20, y + 30) GraphicsWindow.BrushColor = "Black" ok = Controls.AddButton("OK", x + 20, y + fs * 2 + 30) wait = "True" Controls.ButtonClicked = OnButtonClicked While wait Program.Delay(200) EndWhile Controls.Remove(ok) Shapes.Remove(msg) Shapes.Remove(winner) Shapes.Remove(popup) EndSub Sub OnButtonClicked wait = "False" EndSub End>LSM678-1.sb< Start>LSM678-2.sb< ' Connect Four 0.4b ' Clone version written by Nonki Takahashi ' ' History: ' 0.4b 2013-11-11 Added mouse handler for human player. (LSM678-2) ' 0.3a 2013-11-11 Added checking for game end. (LSM678-1) ' 0.2a 2013-11-10 Modified as demo version. (LSM678-0) ' 0.1a 2013-11-07 Created as alpha version. (LSM678) ' gw = 640 gh = 480 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Title = "Connect Four 0.4b" dx = 90 dy = 80 InitDisks() InitBoard() InitRing() InitFour() While "True" i = 0 inGame = "True" ' game start clicked = "False" GraphicsWindow.MouseDown = OnMouseDown While inGame If clicked Then If (0 <= my) And (my <= gh) And (0 <= mx) Then For col = 1 To 7 If mx <= cx[col] Then i = i + 1 DropDisk() Goto colFound EndIf EndFor colFound: EndIf clicked = "False" Else Program.Delay(200) EndIf EndWhile ' game reset Shapes.HideShape(ring) For i = 1 To 42 board[i] = 0 Shapes.Move(disk[i], 0, -100) EndFor EndWhile Sub OnMouseDown mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY clicked = "True" EndSub Sub InitDisks color = "1=Gold;2=Red;" GraphicsWindow.PenWidth = 0 For i = 1 To 42 GraphicsWindow.BrushColor = color[Math.Remainder(i - 1, 2) + 1] disk[i] = Shapes.AddEllipse(dy, dy) Shapes.Move(disk[i], 0, -100) EndFor EndSub Sub InitBoard For i = 1 To 42 board[i] = 0 EndFor For col = 1 To 7 cx[col] = col * dx + 5 EndFor url = "http://www.nonkit.com/smallbasic.files/Connect4Board.png" Shapes.AddImage(url) EndSub Sub InitRing GraphicsWindow.PenWidth = 10 GraphicsWindow.PenColor = "LightGray" GraphicsWindow.BrushColor = "#00000000" ' transparent ring = Shapes.AddEllipse(dy, dy) ' to show last move Shapes.SetOpacity(ring, 50) Shapes.HideShape(ring) EndSub Sub InitFour InitCheckList() nFour = 0 For row = 1 To 6 For col = 1 To 4 nFour = nFour +1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = (row - 1) * 7 + col + 1 four[nFour][3] = (row - 1) * 7 + col + 2 four[nFour][4] = (row - 1) * 7 + col + 3 AddCheckList() EndFor EndFor For row = 1 To 3 For col = 1 To 7 nFour = nFour +1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = row * 7 + col four[nFour][3] = (row + 1) * 7 + col four[nFour][4] = (row + 2) * 7 + col AddCheckList() EndFor EndFor For row = 1 To 3 For col = 1 To 4 nFour = nFour +1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = row * 7 + col + 1 four[nFour][3] = (row + 1) * 7 + col + 2 four[nFour][4] = (row + 2) * 7 + col + 3 AddCheckList() EndFor EndFor For row = 1 To 3 For col = 4 To 7 nFour = nFour +1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = row * 7 + col - 1 four[nFour][3] = (row + 1) * 7 + col - 2 four[nFour][4] = (row + 2) * 7 + col - 3 AddCheckList() EndFor EndFor EndSub Sub InitCheckList For i = 1 To 42 list[i]["n"] = 0 EndFor EndSub Sub AddCheckList ' param nFour - entry index of four For i = 1 To 4 cell = four[nFour][i] n = list[cell]["n"] + 1 list[cell][n] = nFour list[cell]["n"] = n EndFor EndSub Sub DropDisk ' param i - disk index ' param col - column number 1..7 ' return succeed - "True" if succeed succeed = "False" x = (col - 1) * dx + 10 ms = 500 For row = 6 To 1 Step -1 cell = (row - 1) * 7 + col If board[cell] = 0 Then Shapes.Move(disk[i], x, -100) y = (row - 1) * dy + 5 Shapes.Animate(disk[i], x, y, ms) Program.Delay(ms) Shapes.HideShape(ring) Shapes.Move(ring, x, y - 5) Shapes.ShowShape(ring) Sound.PlayClick() board[cell] = Math.Remainder(i - 1, 2) + 1 succeed = "True" CheckFour() Goto break EndIf EndFor break: EndSub Sub CheckFour ' param cell ' return inGame - "True" if not four inGame = "True" n = list[cell]["n"] For f = 1 To n fi = list[cell][f] turn = board[four[fi][1]] For d = 2 To 4 If turn <> board[four[fi][d]] Then Goto notFour EndIf EndFor ShowWinner() inGame = "False" Goto break2 notFour: EndFor break2: EndSub Sub ShowWinner ' param turn - winner GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "Black" pw = 300 ph = 200 popup = Shapes.AddRectangle(pw, ph) Shapes.SetOpacity(popup, 80) x = (gw - pw) / 2 y = (gh - ph) / 2 Shapes.Move(popup, x, y) fs = 40 GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = color[turn] winner = Shapes.AddEllipse(fs, fs) Shapes.Move(winner, x + 20, y + fs * 0.1 + 30) GraphicsWindow.FontSize = fs GraphicsWindow.BrushColor = "White" msg = Shapes.AddText("wins!") Shapes.Move(msg, x + fs * 1.2 + 20, y + 30) GraphicsWindow.BrushColor = "Black" ok = Controls.AddButton("OK", x + 20, y + fs * 2 + 30) wait = "True" Controls.ButtonClicked = OnButtonClicked While wait Program.Delay(200) EndWhile Controls.Remove(ok) Shapes.Remove(msg) Shapes.Remove(winner) Shapes.Remove(popup) EndSub Sub OnButtonClicked wait = "False" EndSub End>LSM678-2.sb< Start>LSM678-3.sb< ' Connect Four 0.5b ' Small Basic clone version written by Nonki Takahashi ' ' History: ' 0.5b 2013-12-13 Added very weak AI. (LSM678-3) ' 0.4b 2013-11-11 Added mouse handler for human player. (LSM678-2) ' 0.3a 2013-11-11 Added checking for game end. (LSM678-1) ' 0.2a 2013-11-10 Modified as demo version. (LSM678-0) ' 0.1a 2013-11-07 Created as alpha version. (LSM678) ' gw = 640 gh = 480 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Title = "Connect Four 0.5b" dx = 90 dy = 80 Not = "True=False;False=True;" InitDisks() InitBoard() InitRing() InitFour() 'DumpCheckList() While "True" i = 0 inGame = "True" ' game start clicked = "False" GraphicsWindow.MouseDown = OnMouseDown While inGame AI() If inGame Then Human() EndIf If 42 <= i Then turn = 0 inGame = "False" EndIf EndWhile ShowResult() ' game reset Shapes.HideShape(ring) For i = 1 To 42 board[i] = 0 Shapes.Move(disk[i], 0, -100) EndFor EndWhile Sub AI succeed = "False" While Not[succeed] i = i + 1 col = Math.GetRandomNumber(7) DropDisk() If succeed Then AnimateDisk() Else i = i - 1 EndIf EndWhile EndSub Sub Human succeed = "False" While Not[succeed] clicked = "False" While Not[clicked] Program.Delay(100) EndWhile If (0 <= my) And (my <= gh) And (0 <= mx) Then For col = 1 To 7 If mx <= cx[col] Then i = i + 1 DropDisk() If succeed Then AnimateDisk() EndIf Goto break3 EndIf EndFor break3: EndIf EndWhile EndSub Sub OnMouseDown mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY clicked = "True" EndSub Sub InitDisks color = "1=Gold;2=Red;" GraphicsWindow.PenWidth = 0 For i = 1 To 42 GraphicsWindow.BrushColor = color[Math.Remainder(i - 1, 2) + 1] disk[i] = Shapes.AddEllipse(dy, dy) Shapes.Move(disk[i], 0, -100) EndFor EndSub Sub InitBoard For i = 1 To 42 board[i] = 0 EndFor For col = 1 To 7 cx[col] = col * dx + 5 EndFor url = "http://www.nonkit.com/smallbasic.files/Connect4Board.png" Shapes.AddImage(url) EndSub Sub InitRing GraphicsWindow.PenWidth = 10 GraphicsWindow.PenColor = "LightGray" GraphicsWindow.BrushColor = "#00000000" ' transparent ring = Shapes.AddEllipse(dy, dy) ' to show last move Shapes.SetOpacity(ring, 50) Shapes.HideShape(ring) EndSub Sub InitFour InitCheckList() nFour = 0 For row = 1 To 6 For col = 1 To 4 nFour = nFour +1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = (row - 1) * 7 + col + 1 four[nFour][3] = (row - 1) * 7 + col + 2 four[nFour][4] = (row - 1) * 7 + col + 3 AddCheckList() EndFor EndFor For row = 1 To 3 For col = 1 To 7 nFour = nFour +1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = row * 7 + col four[nFour][3] = (row + 1) * 7 + col four[nFour][4] = (row + 2) * 7 + col AddCheckList() EndFor EndFor For row = 1 To 3 For col = 1 To 4 nFour = nFour +1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = row * 7 + col + 1 four[nFour][3] = (row + 1) * 7 + col + 2 four[nFour][4] = (row + 2) * 7 + col + 3 AddCheckList() EndFor EndFor For row = 1 To 3 For col = 4 To 7 nFour = nFour +1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = row * 7 + col - 1 four[nFour][3] = (row + 1) * 7 + col - 2 four[nFour][4] = (row + 2) * 7 + col - 3 AddCheckList() EndFor EndFor EndSub Sub DumpCheckList For row = 1 To 6 line = "" For col = 1 To 7 cell = (row - 1) * 7 + col n = list[cell]["n"] If Text.GetLength(n) < 2 Then line = Text.Append(line, " ") EndIf line = Text.Append(line, n) If col < 7 Then line = line + " " EndIf EndFor TextWindow.WriteLine(line) EndFor EndSub Sub InitCheckList For i = 1 To 42 list[i]["n"] = 0 EndFor EndSub Sub AddCheckList ' param nFour - entry index of four For i = 1 To 4 cell = four[nFour][i] n = list[cell]["n"] + 1 list[cell][n] = nFour list[cell]["n"] = n EndFor EndSub Sub DropDisk ' param i - disk index ' param col - column number 1..7 ' return succeed - "True" if succeed succeed = "False" For row = 6 To 1 Step -1 cell = (row - 1) * 7 + col If board[cell] = 0 Then board[cell] = Math.Remainder(i - 1, 2) + 1 succeed = "True" CheckFour() Goto break EndIf EndFor break: EndSub Sub AnimateDisk ' param i - disk index ' param col - column number 1..7 x = (col - 1) * dx + 10 ms = 500 Shapes.Move(disk[i], x, -100) y = (row - 1) * dy + 5 Shapes.Animate(disk[i], x, y, ms) Program.Delay(ms) Shapes.HideShape(ring) Shapes.Move(ring, x, y - 5) Shapes.ShowShape(ring) Sound.PlayClick() EndSub Sub CheckFour ' param cell - to check ' return inGame - "True" if not four ' return turn - winner (0 means draw) inGame = "True" n = list[cell]["n"] For f = 1 To n fi = list[cell][f] turn = board[four[fi][1]] For d = 2 To 4 If turn <> board[four[fi][d]] Then Goto notFour EndIf EndFor inGame = "False" Goto break2 notFour: EndFor break2: EndSub Sub ShowResult ' param turn - winner (0 means draw) GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "Black" pw = 300 ph = 200 popup = Shapes.AddRectangle(pw, ph) Shapes.SetOpacity(popup, 80) x = (gw - pw) / 2 y = (gh - ph) / 2 Shapes.Move(popup, x, y) fs = 40 If turn <> 0 Then GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = color[turn] winner = Shapes.AddEllipse(fs, fs) Shapes.Move(winner, x + 20, y + fs * 0.1 + 30) GraphicsWindow.FontSize = fs GraphicsWindow.BrushColor = "White" msg = Shapes.AddText("wins!") Shapes.Move(msg, x + fs * 1.2 + 20, y + 30) Else GraphicsWindow.FontSize = fs GraphicsWindow.BrushColor = "White" msg = Shapes.AddText("Draw") Shapes.Move(msg, x + 20, y + 30) EndIf GraphicsWindow.BrushColor = "Black" ok = Controls.AddButton("OK", x + 20, y + fs * 2 + 30) wait = "True" Sound.PlayChime() Controls.ButtonClicked = OnButtonClicked While wait Program.Delay(200) EndWhile Controls.Remove(ok) Shapes.Remove(msg) Shapes.Remove(winner) Shapes.Remove(popup) EndSub Sub OnButtonClicked wait = "False" EndSub End>LSM678-3.sb< Start>LSM678-5.sb< ' Connect Four 0.7 ' Small Basic clone version written by Nonki Takahashi ' ' History: ' 0.7 2013-11-28 Added debug code and bug fixed. (LSM678-5) ' 0.6 2013-11-28 Made AI little stronger. (LSM678-4) ' 0.5b 2013-11-13 Added very weak AI. (LSM678-3) ' 0.4b 2013-11-11 Added mouse handler for human player. (LSM678-2) ' 0.3a 2013-11-11 Added checking for game end. (LSM678-1) ' 0.2a 2013-11-10 Modified as demo version. (LSM678-0) ' 0.1a 2013-11-07 Created as alpha version. (LSM678) ' debug = "False" depth = 4 If debug Then depth = 3 WQ = Text.GetCharacter(34) EndIf gw = 640 gh = 480 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Title = "Connect Four 0.7" dx = 90 dy = 80 Not = "True=False;False=True;" InitDisks() InitBoard() InitRing() If debug Then InitNumbers() EndIf InitFour() InitSix() 'DumpCheckList() While "True" If debug Then TextWindow.WriteLine("Game Start") EndIf rec = "" i = 0 inGame = "True" ' game start clicked = "False" GraphicsWindow.MouseDown = OnMouseDown While inGame If debug Then TextWindow.WriteLine("Move " + (i + 1)) EndIf AI() If inGame Then If debug Then TextWindow.WriteLine("Move " + (i + 1)) EndIf Human() EndIf If inGame And (42 <= i) Then turn = 0 inGame = "False" EndIf EndWhile ShowResult() ' game reset Shapes.HideShape(ring) For i = 1 To 42 board[i] = 0 Shapes.Move(disk[i], 0, -100) EndFor EndWhile Sub AI succeed = "False" While Not[succeed] i = i + 1 level = depth MiniMax() If succeed Then DropDisk() AnimateDisk() Else i = i - 1 EndIf EndWhile EndSub Sub MiniMax ' return max max = -1 For col = 1 To 7 Stack.PushValue("stack", board) Stack.PushValue("stack", rec) DropDisk() 'DumpBoard() If succeed And inGame Then level = level - 1 ' in game If level = 0 And max < 0 Then ' deepest level Evaluate() If max < score Then max = score maxcol = col If debug Then case = 1 DumpMax() EndIf EndIf ElseIf 0 < level Then ' middle level Stack.PushValue("stack", col) Stack.PushValue("stack", max) Stack.PushValue("stack", maxcol) Stack.PushValue("stack", cell) i = i + 1 MiniMax() i = i - 1 child = -max cell = Stack.PopValue("stack") maxcol = Stack.PopValue("stack") max = Stack.PopValue("stack") col = Stack.PopValue("stack") If max < child Then max = child maxcol = col If debug Then case = 2 DumpMax() EndIf EndIf Evaluate() If debug Then TextWindow.WriteLine("case=3 score=" + score) EndIf If max < score Then max = score maxcol = col If debug Then case = 3 DumpMax() EndIf EndIf EndIf level = level + 1 ElseIf succeed Then ' game end If turn = 0 And max < 0 Then ' draw max = 0 maxcol = col If debug Then case = 4 DumpMax() EndIf ElseIf max < 1 Then ' win max = 1 maxcol = col If debug Then case = 5 DumpMax() EndIf EndIf EndIf rec = Stack.PopValue("stack") board = Stack.PopValue("stack") EndFor col = maxcol If debug Then TextWindow.Write("i=" + i + " level=" + level) If 0 < max Then TextWindow.ForegroundColor = "Green" EndIf TextWindow.Write(" max=" + max) TextWindow.ForegroundColor = "Gray" TextWindow.Write(" maxcol=" + col) TextWindow.WriteLine(" rec=" + WQ + rec + WQ) DumpBoard() EndIf EndSub Sub DumpMax TextWindow.Write("case=" + case) If 0 < max Then TextWindow.ForegroundColor = "Green" EndIf TextWindow.Write(" max=" + max) TextWindow.ForegroundColor = "Gray" TextWindow.WriteLine(" maxcol=" + col) EndSub Sub Evaluate ' param board[] - board of connect four ' param cell - last move ' return score - (-1..1) for current player Stopped() score = 0.1 * stopped2 + stopped3 If 1 < score Then score = 1 EndIf If debug Then TextWindow.WriteLine("score=" + score) EndIf EndSub Sub Stopped ' param board[] - board of connect four ' param cell - last move ' return stopped2 - number of stopped two ' return stopped3 - number of stopped three stopped2 = 0 stopped3 = 0 turn = Math.Remainder(board[cell] - 1, 2) + 1 enemy = 3 - turn empty = 0 If debug Then TextWindow.WriteLine("StoppedTwo: cell=" + cell) EndIf For n = 1 To list[cell]["n"] c1 = four[list[cell][n]][1] c4 = four[list[cell][n]][4] If debug Then TextWindow.Write("board[" + c1 + "]=" + board[c1]) TextWindow.Write(" board[" + c4 + "]=" + board[c4]) EndIf If c1 = cell Then c2 = four[list[cell][n]][2] c3 = four[list[cell][n]][3] If debug Then TextWindow.Write(" board[" + c2 + "]=" + board[c2]) TextWindow.Write(" board[" + c3 + "]=" + board[c3]) EndIf If (board[c2] = enemy) And (board[c3] = enemy) And (board[c4] <> turn) Then If board[c4] = enemy Then stopped3 = stopped3 + 1 ElseIf board[c4] = empty Then stopped2 = stopped2 + 1 EndIf EndIf ElseIf c4 = cell Then c2 = four[list[cell][n]][2] c3 = four[list[cell][n]][3] If debug Then TextWindow.Write(" board[" + c2 + "]=" + board[c2]) TextWindow.Write(" board[" + c3 + "]=" + board[c3]) EndIf If (board[c2] = enemy) And (board[c3] = enemy) And (board[c1] <> turn) Then If board[c1] = enemy Then stopped3 = stopped3 + 1 ElseIf board[c1] = empty Then stopped2 = stopped2 + 1 EndIf EndIf EndIf If debug Then TextWindow.WriteLine("") EndIf EndFor EndSub Sub Human succeed = "False" While Not[succeed] clicked = "False" While Not[clicked] Program.Delay(100) EndWhile If (0 <= my) And (my <= gh) And (0 <= mx) Then For col = 1 To 7 If mx <= cx[col] Then i = i + 1 DropDisk() If succeed Then AnimateDisk() EndIf Goto break3 EndIf EndFor break3: EndIf EndWhile EndSub Sub OnMouseDown mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY clicked = "True" EndSub Sub InitDisks color = "1=Yellow;2=Red;" GraphicsWindow.PenWidth = 0 For i = 1 To 42 GraphicsWindow.BrushColor = color[Math.Remainder(i - 1, 2) + 1] disk[i] = Shapes.AddEllipse(dy, dy) Shapes.Move(disk[i], 0, -100) EndFor EndSub Sub InitBoard For i = 1 To 42 board[i] = 0 ' empty EndFor For col = 1 To 7 cx[col] = col * dx + 5 EndFor url = "http://www.nonkit.com/smallbasic.files/Connect4Board.png" Shapes.AddImage(url) EndSub Sub InitRing GraphicsWindow.PenWidth = 10 GraphicsWindow.PenColor = "LightGray" GraphicsWindow.BrushColor = "#00000000" ' transparent ring = Shapes.AddEllipse(dy, dy) ' to show last move Shapes.SetOpacity(ring, 50) Shapes.HideShape(ring) EndSub Sub InitFour InitCheckList() nFour = 0 For row = 1 To 6 ' horizontal For col = 1 To 4 nFour = nFour + 1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = (row - 1) * 7 + col + 1 four[nFour][3] = (row - 1) * 7 + col + 2 four[nFour][4] = (row - 1) * 7 + col + 3 AddCheckList() EndFor EndFor For row = 1 To 3 ' vertical For col = 1 To 7 nFour = nFour + 1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = row * 7 + col four[nFour][3] = (row + 1) * 7 + col four[nFour][4] = (row + 2) * 7 + col AddCheckList() EndFor EndFor For row = 1 To 3 ' diagnostic \ For col = 1 To 4 nFour = nFour + 1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = row * 7 + col + 1 four[nFour][3] = (row + 1) * 7 + col + 2 four[nFour][4] = (row + 2) * 7 + col + 3 AddCheckList() EndFor EndFor For row = 1 To 3 ' diagnostic / For col = 4 To 7 nFour = nFour + 1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = row * 7 + col - 1 four[nFour][3] = (row + 1) * 7 + col - 2 four[nFour][4] = (row + 2) * 7 + col - 3 AddCheckList() EndFor EndFor EndSub Sub InitSix InitCheckList6() nSix = 0 For row = 1 To 6 ' horizontal For col = 1 To 2 nSix = nSix + 1 six[nSix][1] = (row - 1) * 7 + col six[nSix][2] = (row - 1) * 7 + col + 1 six[nSix][3] = (row - 1) * 7 + col + 2 six[nSix][4] = (row - 1) * 7 + col + 3 six[nSix][5] = (row - 1) * 7 + col + 3 six[nSix][6] = (row - 1) * 7 + col + 3 AddCheckList6() EndFor EndFor For row = 1 To 2 ' diagnostic \ For col = 1 To 2 nSix = nSix + 1 six[nSix][1] = (row - 1) * 7 + col six[nSix][2] = row * 7 + col + 1 six[nSix][3] = (row + 1) * 7 + col + 2 six[nSix][4] = (row + 2) * 7 + col + 3 six[nSix][5] = (row + 3) * 7 + col + 4 six[nSix][6] = (row + 4) * 7 + col + 5 AddCheckList6() EndFor EndFor For row = 1 To 2 ' diagnostic / For col = 6 To 7 nSix = nSix + 1 six[nSix][1] = (row - 1) * 7 + col six[nSix][2] = row * 7 + col - 1 six[nSix][3] = (row + 1) * 7 + col - 2 six[nSix][4] = (row + 2) * 7 + col - 3 six[nSix][5] = (row + 3) * 7 + col - 4 six[nSix][6] = (row + 4) * 7 + col - 5 AddCheckList6() EndFor EndFor EndSub Sub DumpCheckList For row = 1 To 6 line = "" For col = 1 To 7 cell = (row - 1) * 7 + col n = list[cell]["n"] If Text.GetLength(n) < 2 Then line = Text.Append(line, " ") EndIf line = Text.Append(line, n) If col < 7 Then line = line + " " EndIf EndFor TextWindow.WriteLine(line) EndFor EndSub Sub DumpBoard TextWindow.WriteLine(" A B C D E F G") For _i = 1 To 42 If Math.Remainder(_i, 7) = 1 Then TextWindow.Write((Math.Floor((_i - 1) / 7) + 1) + " ") EndIf If board[_i] = 0 Then TextWindow.Write(" ") Else TextWindow.ForegroundColor = color[Math.Remainder(board[_i] - 1, 2) + 1] TextWindow.Write("●") EndIf If Math.Remainder(_i, 7) = 0 Then TextWindow.WriteLine("") EndIf TextWindow.ForegroundColor = "Gray" EndFor TextWindow.WriteLine("") EndSub Sub InitCheckList For i = 1 To 42 list[i]["n"] = 0 EndFor EndSub Sub InitCheckList6 For i = 1 To 42 list6[i]["n"] = 0 EndFor EndSub Sub AddCheckList ' param nFour - entry index of four For i = 1 To 4 cell = four[nFour][i] n = list[cell]["n"] + 1 list[cell][n] = nFour list[cell]["n"] = n EndFor EndSub Sub AddCheckList6 ' param nSix - entry index of six For i = 1 To 6 cell = four[nSix][i] n = list6[cell]["n"] + 1 list6[cell][n] = nSix list6[cell]["n"] = n EndFor EndSub Sub DropDisk ' param i - disk index (number of moves) ' param col - column number 1..7 ' return cell - cell number of move ' return succeed - "True" if succeed succeed = "False" For row = 6 To 1 Step -1 cell = (row - 1) * 7 + col If board[cell] = 0 Then board[cell] = Math.Remainder(i - 1, 2) + 1 succeed = "True" Rec_Rec() CheckFour() Goto break EndIf EndFor break: EndSub Sub Rec_Rec ' param i - disk index ' param col - column number 1..7 rec[i] = col EndSub Sub AnimateDisk ' param i - disk index ' param col - column number 1..7 ' param row - row number 1..6 x = (col - 1) * dx + 10 ms = 500 Shapes.Move(disk[i], x, -100) y = (row - 1) * dy + 5 Shapes.Animate(disk[i], x, y, ms) Program.Delay(ms) Shapes.HideShape(ring) Shapes.Move(ring, x, y - 5) Shapes.ShowShape(ring) Sound.PlayClickAndWait() EndSub Sub InitNumbers GraphicsWindow.BrushColor = "Blue" For i = 1 To 42 col = Math.Remainder(i - 1, 7) + 1 row = Math.Floor((i - 1) / 7) + 1 x = (col - 1) * dx + 10 y = (row - 1) * dy + 5 num = Shapes.AddText(i) Shapes.Move(num, x, y) EndFor EndSub Sub CheckFour ' param cell - to check ' return inGame - "True" if not four ' return turn - winner (0 means draw) inGame = "True" n = list[cell]["n"] For f = 1 To n fi = list[cell][f] turn = board[four[fi][1]] For d = 2 To 4 If turn <> board[four[fi][d]] Then Goto notFour EndIf EndFor inGame = "False" Goto break2 notFour: EndFor break2: EndSub Sub ShowResult ' param turn - winner (0 means draw) GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "Black" pw = 300 ph = 200 popup = Shapes.AddRectangle(pw, ph) Shapes.SetOpacity(popup, 80) x = (gw - pw) / 2 y = (gh - ph) / 2 Shapes.Move(popup, x, y) fs = 40 If turn <> 0 Then GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = color[turn] winner = Shapes.AddEllipse(fs, fs) Shapes.Move(winner, x + 20, y + fs * 0.1 + 30) GraphicsWindow.FontSize = fs GraphicsWindow.BrushColor = "White" msg = Shapes.AddText("wins!") Shapes.Move(msg, x + fs * 1.2 + 20, y + 30) If debug Then TextWindow.WriteLine(color[turn] + "wins!") EndIf Else GraphicsWindow.FontSize = fs GraphicsWindow.BrushColor = "White" msg = Shapes.AddText("Draw") Shapes.Move(msg, x + 20, y + 30) If debug Then TextWindow.WriteLine(color[turn] + "Draw") EndIf EndIf GraphicsWindow.BrushColor = "Black" ok = Controls.AddButton("OK", x + 20, y + fs * 2 + 30) wait = "True" Sound.PlayChimeAndWait() Controls.ButtonClicked = OnButtonClicked While wait Program.Delay(200) EndWhile Controls.Remove(ok) Shapes.Remove(msg) Shapes.Remove(winner) Shapes.Remove(popup) EndSub Sub OnButtonClicked wait = "False" EndSub End>LSM678-5.sb< Start>LSM678-6.sb< ' Connect Four 0.8 ' Small Basic clone version written by Nonki Takahashi ' ' History: ' 0.8 2013-12-01 Made AI stronger. (LSM678-6) ' 0.7 2013-11-28 Added debug code and bug fixed. (LSM678-5) ' 0.6 2013-11-28 Made AI little stronger. (LSM678-4) ' 0.5b 2013-11-13 Added very weak AI. (LSM678-3) ' 0.4b 2013-11-11 Added mouse handler for human player. (LSM678-2) ' 0.3a 2013-11-11 Added checking for game end. (LSM678-1) ' 0.2a 2013-11-10 Modified as demo version. (LSM678-0) ' 0.1a 2013-11-07 Created as alpha version. (LSM678) ' debug = "False" depth = 4 If debug Then depth = 3 WQ = Text.GetCharacter(34) EndIf gw = 640 gh = 480 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Title = "Connect Four 0.8" dx = 90 dy = 80 Not = "True=False;False=True;" InitDisks() InitBoard() InitRing() If debug Then InitNumbers() EndIf InitFour() If debug Then DumpCheckList() EndIf While "True" If debug Then TextWindow.WriteLine("Game Start") EndIf rec = "" i = 0 inGame = "True" ' game start clicked = "False" GraphicsWindow.MouseDown = OnMouseDown While inGame If debug Then TextWindow.WriteLine("----------------------------------------") TextWindow.WriteLine("Move " + (i + 1)) EndIf AI() If inGame Then If debug Then TextWindow.WriteLine("----------------------------------------") TextWindow.WriteLine("Move " + (i + 1)) EndIf Human() EndIf If inGame And (42 <= i) Then player = 0 inGame = "False" EndIf EndWhile ShowResult() ' game reset Shapes.HideShape(ring) For i = 1 To 42 board[i] = 0 Shapes.Move(disk[i], 0, -100) EndFor EndWhile Sub AI succeed = "False" While Not[succeed] i = i + 1 CalcTurn() level = depth MiniMax() If succeed Then DropDisk() AnimateDisk() Else i = i - 1 CalcTurn() EndIf EndWhile EndSub Sub MiniMax ' return max max = -1 once = "False" ' once succeed For col = 1 To 7 If debug Then TextWindow.Write("Trial: col=" + col) TextWindow.ForegroundColor = color[turn] TextWindow.WriteLine(" i=" + i) TextWindow.ForegroundColor = "Gray" EndIf Stack.PushValue("stack", board) Stack.PushValue("stack", rec) DropDisk() 'DumpBoard() If succeed And inGame Then level = level - 1 ' in game If level = 0 And max < 0 Then ' deepest level Evaluate() If max < score Then max = score maxcol = col If debug Then case = "1:deepest" DumpMax() EndIf EndIf ElseIf 0 < level Then ' middle level Stack.PushValue("stack", col) Stack.PushValue("stack", max) Stack.PushValue("stack", maxcol) Stack.PushValue("stack", cell) Stack.PushValue("stack", succeed) Stack.PushValue("stack", once) i = i + 1 CalcTurn() MiniMax() i = i - 1 CalcTurn() child = -max once = Stack.PopValue("stack") succeed = Stack.PopValue("stack") cell = Stack.PopValue("stack") maxcol = Stack.PopValue("stack") max = Stack.PopValue("stack") col = Stack.PopValue("stack") If max < child Then max = child maxcol = col once = "True" If debug Then case = "2:minimax" DumpMax() EndIf EndIf Evaluate() If debug Then TextWindow.WriteLine("case=3:eval score=" + score) EndIf If max < score Then max = score maxcol = col once = "True" If debug Then case = "3:eval" DumpMax() EndIf EndIf EndIf level = level + 1 If Not[once] Then maxcol = col once = "True" EndIf ElseIf succeed Then ' game end If player = 0 And max < 0 Then ' draw max = 0 maxcol = col once = "True" If debug Then case = "4:draw" DumpMax() EndIf ElseIf max < 1 Then ' win max = 1 maxcol = col once = "True" If debug Then case = "5:win" DumpMax() EndIf EndIf If Not[once] Then maxcol = col once = "True" EndIf EndIf rec = Stack.PopValue("stack") board = Stack.PopValue("stack") EndFor If once Then succeed = "True" EndIf col = maxcol If debug Then TextWindow.Write("i=" + i + " level=" + level) If 0 < max Then TextWindow.ForegroundColor = color[turn] EndIf TextWindow.Write(" max=" + max) TextWindow.ForegroundColor = "Gray" TextWindow.Write(" maxcol=" + col) TextWindow.WriteLine(" rec=" + WQ + rec + WQ) DumpBoard() EndIf EndSub Sub CalcTurn ' param i - number of moves turn = Math.Remainder(i - 1, 2) + 1 EndSub Sub DumpMax TextWindow.Write("case=" + case) If 0 < max Then TextWindow.ForegroundColor = color[turn] EndIf TextWindow.Write(" max=" + max) TextWindow.ForegroundColor = "Gray" TextWindow.WriteLine(" maxcol=" + col) EndSub Sub Evaluate ' param board[] - board of connect four ' param cell - last move ' return score - (-1..1) for current player Stopped() score = 0.1 * stopped2 + 0.2 * stopped3 + 0.05 * list[cell]["n"] If 7 < cell Then Assisted() score = score - 0.5 * assist EndIf If 1 < score Then score = 1 EndIf If debug Then TextWindow.WriteLine("score=" + score) EndIf EndSub Sub Assisted ' param board[] - board of connect four ' param cell - last move ' param turn - current player ' return assist - 1 if assisted upper = cell - 7 ' upper cell enemy = 3 - turn assist = 0 For n = 1 To list[upper]["n"] count = 0 For c = 1 To 4 If board[four[list[upper][n]][c]] = enemy Then count = count + 1 EndIf EndFor If count = 3 Then assist = 1 Goto break4 EndIf EndFor break4: EndSub Sub Stopped ' param board[] - board of connect four ' param cell - last move ' param turn - current player ' return stopped2 - number of stopped two ' return stopped3 - number of stopped three stopped2 = 0 stopped3 = 0 enemy = 3 - turn empty = 0 If debug Then TextWindow.WriteLine("StoppedTwo: cell=" + cell) EndIf For n = 1 To list[cell]["n"] c1 = four[list[cell][n]][1] c4 = four[list[cell][n]][4] If debug Then TextWindow.Write("board[" + c1 + "]=" + board[c1]) TextWindow.Write(" board[" + c4 + "]=" + board[c4]) EndIf If c1 = cell Then c2 = four[list[cell][n]][2] c3 = four[list[cell][n]][3] If debug Then TextWindow.Write(" board[" + c2 + "]=" + board[c2]) TextWindow.Write(" board[" + c3 + "]=" + board[c3]) EndIf If (board[c2] = enemy) And (board[c3] = enemy) And (board[c4] <> turn) Then If board[c4] = enemy Then stopped3 = stopped3 + 1 ElseIf board[c4] = empty Then stopped2 = stopped2 + 1 EndIf EndIf ElseIf c4 = cell Then c2 = four[list[cell][n]][2] c3 = four[list[cell][n]][3] If debug Then TextWindow.Write(" board[" + c2 + "]=" + board[c2]) TextWindow.Write(" board[" + c3 + "]=" + board[c3]) EndIf If (board[c2] = enemy) And (board[c3] = enemy) And (board[c1] <> turn) Then If board[c1] = enemy Then stopped3 = stopped3 + 1 ElseIf board[c1] = empty Then stopped2 = stopped2 + 1 EndIf EndIf EndIf If debug Then TextWindow.WriteLine("") EndIf EndFor EndSub Sub Human succeed = "False" While Not[succeed] clicked = "False" While Not[clicked] Program.Delay(100) EndWhile If (0 <= my) And (my <= gh) And (0 <= mx) Then For col = 1 To 7 If mx <= cx[col] Then i = i + 1 CalcTurn() DropDisk() If succeed Then AnimateDisk() EndIf Goto break3 EndIf EndFor break3: EndIf EndWhile EndSub Sub OnMouseDown mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY clicked = "True" EndSub Sub InitDisks color = "0=Green;1=Gold;2=Red;" If debug Then color[1] = "Yellow" ' for dump in TextWindow EndIf GraphicsWindow.PenWidth = 0 For i = 1 To 42 GraphicsWindow.BrushColor = color[Math.Remainder(i - 1, 2) + 1] disk[i] = Shapes.AddEllipse(dy, dy) Shapes.Move(disk[i], 0, -100) EndFor EndSub Sub InitBoard For i = 1 To 42 board[i] = 0 ' empty EndFor For col = 1 To 7 cx[col] = col * dx + 5 EndFor url = "http://www.nonkit.com/smallbasic.files/Connect4Board.png" Shapes.AddImage(url) EndSub Sub InitRing GraphicsWindow.PenWidth = 10 GraphicsWindow.PenColor = "LightGray" GraphicsWindow.BrushColor = "#00000000" ' transparent ring = Shapes.AddEllipse(dy, dy) ' to show last move Shapes.SetOpacity(ring, 50) Shapes.HideShape(ring) EndSub Sub InitFour InitCheckList() nFour = 0 For row = 1 To 6 ' horizontal For col = 1 To 4 nFour = nFour + 1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = (row - 1) * 7 + col + 1 four[nFour][3] = (row - 1) * 7 + col + 2 four[nFour][4] = (row - 1) * 7 + col + 3 AddCheckList() EndFor EndFor For row = 1 To 3 ' vertical For col = 1 To 7 nFour = nFour + 1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = row * 7 + col four[nFour][3] = (row + 1) * 7 + col four[nFour][4] = (row + 2) * 7 + col AddCheckList() EndFor EndFor For row = 1 To 3 ' diagnostic \ For col = 1 To 4 nFour = nFour + 1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = row * 7 + col + 1 four[nFour][3] = (row + 1) * 7 + col + 2 four[nFour][4] = (row + 2) * 7 + col + 3 AddCheckList() EndFor EndFor For row = 1 To 3 ' diagnostic / For col = 4 To 7 nFour = nFour + 1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = row * 7 + col - 1 four[nFour][3] = (row + 1) * 7 + col - 2 four[nFour][4] = (row + 2) * 7 + col - 3 AddCheckList() EndFor EndFor EndSub Sub DumpCheckList For row = 1 To 6 line = "" For col = 1 To 7 cell = (row - 1) * 7 + col n = list[cell]["n"] If Text.GetLength(n) < 2 Then line = Text.Append(line, " ") EndIf line = Text.Append(line, n) If col < 7 Then line = line + " " EndIf EndFor TextWindow.WriteLine(line) EndFor EndSub Sub DumpBoard TextWindow.WriteLine(" A B C D E F G") For _i = 1 To 42 If Math.Remainder(_i, 7) = 1 Then TextWindow.Write((Math.Floor((_i - 1) / 7) + 1) + " ") EndIf If board[_i] = 0 Then TextWindow.Write(" ") Else TextWindow.ForegroundColor = color[Math.Remainder(board[_i] - 1, 2) + 1] TextWindow.Write("●") EndIf If Math.Remainder(_i, 7) = 0 Then TextWindow.WriteLine("") EndIf TextWindow.ForegroundColor = "Gray" EndFor TextWindow.WriteLine("") EndSub Sub InitCheckList For i = 1 To 42 list[i]["n"] = 0 EndFor EndSub Sub AddCheckList ' param nFour - entry index of four For i = 1 To 4 cell = four[nFour][i] n = list[cell]["n"] + 1 list[cell][n] = nFour list[cell]["n"] = n EndFor EndSub Sub DropDisk ' param i - disk index (number of moves) ' param col - column number 1..7 ' return cell - cell number of move ' return succeed - "True" if succeed succeed = "False" For row = 6 To 1 Step -1 cell = (row - 1) * 7 + col If board[cell] = 0 Then board[cell] = Math.Remainder(i - 1, 2) + 1 succeed = "True" Rec_Rec() CheckFour() Goto break EndIf EndFor break: EndSub Sub Rec_Rec ' param i - disk index ' param col - column number 1..7 rec[i] = col EndSub Sub AnimateDisk ' param i - disk index ' param col - column number 1..7 ' param row - row number 1..6 x = (col - 1) * dx + 10 ms = 500 Shapes.Move(disk[i], x, -100) y = (row - 1) * dy + 5 Shapes.Animate(disk[i], x, y, ms) Program.Delay(ms) Shapes.HideShape(ring) Shapes.Move(ring, x, y - 5) Shapes.ShowShape(ring) Sound.PlayClickAndWait() EndSub Sub InitNumbers GraphicsWindow.BrushColor = "Blue" For i = 1 To 42 col = Math.Remainder(i - 1, 7) + 1 row = Math.Floor((i - 1) / 7) + 1 x = (col - 1) * dx + 10 y = (row - 1) * dy + 5 num = Shapes.AddText(i) Shapes.Move(num, x, y) EndFor EndSub Sub CheckFour ' param cell - to check ' return inGame - "True" if not four ' return player - winner (0 means draw) inGame = "True" n = list[cell]["n"] For f = 1 To n fi = list[cell][f] player = board[four[fi][1]] For d = 2 To 4 If player <> board[four[fi][d]] Then Goto notFour EndIf EndFor inGame = "False" Goto break2 notFour: EndFor break2: EndSub Sub ShowResult ' param player - winner (0 means draw) GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "Black" pw = 300 ph = 200 popup = Shapes.AddRectangle(pw, ph) Shapes.SetOpacity(popup, 80) x = (gw - pw) / 2 y = (gh - ph) / 2 Shapes.Move(popup, x, y) fs = 40 If player <> 0 Then GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = color[player] winner = Shapes.AddEllipse(fs, fs) Shapes.Move(winner, x + 20, y + fs * 0.1 + 30) GraphicsWindow.FontSize = fs GraphicsWindow.BrushColor = "White" msg = Shapes.AddText("wins!") Shapes.Move(msg, x + fs * 1.2 + 20, y + 30) If debug Then TextWindow.WriteLine(color[player] + "wins!") EndIf Else GraphicsWindow.FontSize = fs GraphicsWindow.BrushColor = "White" msg = Shapes.AddText("Draw") Shapes.Move(msg, x + 20, y + 30) If debug Then TextWindow.WriteLine("Draw") EndIf EndIf GraphicsWindow.BrushColor = "Black" ok = Controls.AddButton("OK", x + 20, y + fs * 2 + 30) wait = "True" Sound.PlayChimeAndWait() Controls.ButtonClicked = OnButtonClicked While wait Program.Delay(200) EndWhile Controls.Remove(ok) Shapes.Remove(msg) Shapes.Remove(winner) Shapes.Remove(popup) EndSub Sub OnButtonClicked wait = "False" EndSub End>LSM678-6.sb< Start>LSM678-9.sb< depth = 4 gw = 640 gh = 480 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Title = "Connect Four 0.8" dx = 90 dy = 80 Not = "True=False;False=True;" InitDisks() InitBoard() InitRing() InitFour() GraphicsWindow.BackgroundColor ="darkblue" While "True" rec = "" i = 0 inGame = "True" ' game start clicked = "False" GraphicsWindow.MouseDown = OnMouseDown While inGame AI() If inGame Then Human() EndIf If inGame And (42 <= i) Then player = 0 inGame = "False" EndIf EndWhile ShowResult() ' game reset Shapes.HideShape(ring) For i = 1 To 42 board[i] = 0 Shapes.Move(disk[i], 0, -100) EndFor EndWhile Sub AI succeed = "False" While Not[succeed] i = i + 1 CalcTurn() level = depth MiniMax() If succeed Then DropDisk() AnimateDisk() Else i = i - 1 CalcTurn() EndIf EndWhile EndSub Sub MiniMax ' return max max = -1 once = "False" ' once succeed For col = 1 To 7 Stack.PushValue("stack", board) Stack.PushValue("stack", rec) DropDisk() 'DumpBoard() If succeed And inGame Then level = level - 1 ' in game If level = 0 And max < 0 Then ' deepest level Evaluate() If max < score Then max = score maxcol = col EndIf ElseIf 0 < level Then ' middle level Stack.PushValue("stack", col) Stack.PushValue("stack", max) Stack.PushValue("stack", maxcol) Stack.PushValue("stack", cell) Stack.PushValue("stack", succeed) Stack.PushValue("stack", once) i = i + 1 CalcTurn() MiniMax() i = i - 1 CalcTurn() child = -max once = Stack.PopValue("stack") succeed = Stack.PopValue("stack") cell = Stack.PopValue("stack") maxcol = Stack.PopValue("stack") max = Stack.PopValue("stack") col = Stack.PopValue("stack") If max < child Then max = child maxcol = col once = "True" EndIf Evaluate() If max < score Then max = score maxcol = col once = "True" EndIf EndIf level = level + 1 If Not[once] Then maxcol = col once = "True" EndIf ElseIf succeed Then ' game end If player = 0 And max < 0 Then ' draw max = 0 maxcol = col once = "True" ElseIf max < 1 Then ' win max = 1 maxcol = col once = "True" EndIf If Not[once] Then maxcol = col once = "True" EndIf EndIf rec = Stack.PopValue("stack") board = Stack.PopValue("stack") EndFor If once Then succeed = "True" EndIf col = maxcol EndSub Sub CalcTurn ' param i - number of moves turn = Math.Remainder(i - 1, 2) + 1 EndSub Sub Evaluate Stopped() score = 0.1 * stopped2 + 0.2 * stopped3 + 0.05 * list[cell]["n"] If 7 < cell Then Assisted() score = score - 0.5 * assist EndIf If 1 < score Then score = 1 EndIf EndSub Sub Assisted ' param board[] - board of connect four ' param cell - last move ' param turn - current player ' return assist - 1 if assisted upper = cell - 7 ' upper cell enemy = 3 - turn assist = 0 For n = 1 To list[upper]["n"] count = 0 For c = 1 To 4 If board[four[list[upper][n]][c]] = enemy Then count = count + 1 EndIf EndFor If count = 3 Then assist = 1 Goto break4 EndIf EndFor break4: EndSub Sub Stopped stopped2 = 0 stopped3 = 0 enemy = 3 - turn empty = 0 For n = 1 To list[cell]["n"] c1 = four[list[cell][n]][1] c4 = four[list[cell][n]][4] If c1 = cell Then c2 = four[list[cell][n]][2] c3 = four[list[cell][n]][3] If (board[c2] = enemy) And (board[c3] = enemy) And (board[c4] <> turn) Then If board[c4] = enemy Then stopped3 = stopped3 + 1 ElseIf board[c4] = empty Then stopped2 = stopped2 + 1 EndIf EndIf ElseIf c4 = cell Then c2 = four[list[cell][n]][2] c3 = four[list[cell][n]][3] If (board[c2] = enemy) And (board[c3] = enemy) And (board[c1] <> turn) Then If board[c1] = enemy Then stopped3 = stopped3 + 1 ElseIf board[c1] = empty Then stopped2 = stopped2 + 1 EndIf EndIf EndIf EndFor EndSub Sub Human succeed = "False" While Not[succeed] clicked = "False" While Not[clicked] Program.Delay(100) EndWhile If (0 <= my) And (my <= gh) And (0 <= mx) Then For col = 1 To 7 If mx <= cx[col] Then i = i + 1 CalcTurn() DropDisk() If succeed Then AnimateDisk() EndIf Goto break3 EndIf EndFor break3: EndIf EndWhile EndSub Sub OnMouseDown mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY clicked = "True" EndSub Sub InitDisks color = "0=Green;1=Gold;2=Red;" GraphicsWindow.PenWidth = 0 For i = 1 To 42 GraphicsWindow.BrushColor = color[Math.Remainder(i - 1, 2) + 1] disk[i] = Shapes.AddEllipse(dy, dy) Shapes.Move(disk[i], 0, -100) EndFor EndSub Sub InitBoard For i = 1 To 42 board[i] = 0 ' empty EndFor For col = 1 To 7 cx[col] = col * dx + 5 EndFor url = "http://www.nonkit.com/smallbasic.files/Connect4Board.png" Shapes.AddImage(url) EndSub Sub InitRing GraphicsWindow.PenWidth = 10 GraphicsWindow.PenColor = "LightGray" GraphicsWindow.BrushColor = "#00000000" ' transparent ring = Shapes.AddEllipse(dy, dy) ' to show last move Shapes.SetOpacity(ring, 50) Shapes.HideShape(ring) EndSub Sub InitFour InitCheckList() nFour = 0 For row = 1 To 6 ' horizontal For col = 1 To 4 nFour = nFour + 1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = (row - 1) * 7 + col + 1 four[nFour][3] = (row - 1) * 7 + col + 2 four[nFour][4] = (row - 1) * 7 + col + 3 AddCheckList() EndFor EndFor For row = 1 To 3 ' vertical For col = 1 To 7 nFour = nFour + 1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = row * 7 + col four[nFour][3] = (row + 1) * 7 + col four[nFour][4] = (row + 2) * 7 + col AddCheckList() EndFor EndFor For row = 1 To 3 ' diagnostic \ For col = 1 To 4 nFour = nFour + 1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = row * 7 + col + 1 four[nFour][3] = (row + 1) * 7 + col + 2 four[nFour][4] = (row + 2) * 7 + col + 3 AddCheckList() EndFor EndFor For row = 1 To 3 ' diagnostic / For col = 4 To 7 nFour = nFour + 1 four[nFour][1] = (row - 1) * 7 + col four[nFour][2] = row * 7 + col - 1 four[nFour][3] = (row + 1) * 7 + col - 2 four[nFour][4] = (row + 2) * 7 + col - 3 AddCheckList() EndFor EndFor EndSub Sub InitCheckList For i = 1 To 42 list[i]["n"] = 0 EndFor EndSub Sub AddCheckList ' param nFour - entry index of four For i = 1 To 4 cell = four[nFour][i] n = list[cell]["n"] + 1 list[cell][n] = nFour list[cell]["n"] = n EndFor EndSub Sub DropDisk succeed = "False" For row = 6 To 1 Step -1 cell = (row - 1) * 7 + col If board[cell] = 0 Then board[cell] = Math.Remainder(i - 1, 2) + 1 succeed = "True" Rec_Rec() CheckFour() Goto break EndIf EndFor break: EndSub Sub Rec_Rec ' param i - disk index ' param col - column number 1..7 rec[i] = col EndSub Sub AnimateDisk ' param i - disk index ' param col - column number 1..7 ' param row - row number 1..6 x = (col - 1) * dx + 10 ms = 500 Shapes.Move(disk[i], x, -100) y = (row - 1) * dy + 5 Shapes.Animate(disk[i], x, y, ms) Program.Delay(ms) Shapes.HideShape(ring) Shapes.Move(ring, x, y - 5) Shapes.ShowShape(ring) Sound.PlayClickAndWait() EndSub Sub InitNumbers GraphicsWindow.BrushColor = "Blue" For i = 1 To 42 col = Math.Remainder(i - 1, 7) + 1 row = Math.Floor((i - 1) / 7) + 1 x = (col - 1) * dx + 10 y = (row - 1) * dy + 5 num = Shapes.AddText(i) Shapes.Move(num, x, y) EndFor EndSub Sub CheckFour inGame = "True" n = list[cell]["n"] For f = 1 To n fi = list[cell][f] player = board[four[fi][1]] For d = 2 To 4 If player <> board[four[fi][d]] Then Goto notFour EndIf EndFor inGame = "False" Goto break2 notFour: EndFor break2: EndSub Sub ShowResult ' param player - winner (0 means draw) GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "Black" pw = 300 ph = 200 fs = 40 ot= GraphicsWindow.Title If player <> 0 Then GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = color[player] GraphicsWindow.Title =color[player]+" WON!" Else GraphicsWindow.FontSize = fs GraphicsWindow.BrushColor = "White" GraphicsWindow.Title ="Draw" EndIf GraphicsWindow.BrushColor = "Black" ok = Controls.AddButton("- NEW game -", gw/2 gh/2) LDShapes.AnimateZoom (ok 500 3 3 3) wait = "True" Sound.PlayChimes() Controls.ButtonClicked = OnButtonClicked While wait Program.Delay(5) EndWhile GraphicsWindow.Title =ot Controls.Remove(ok) EndSub Sub OnButtonClicked wait = "False" EndSub End>LSM678-9.sb< Start>LSM678.sb< ' Connect Four 0.1a ' Clone version written by Nonki Takahashi ' ' History: ' 0.1a 2013-11-07 Created as alpha version. ' gw = 640 gh = 480 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Title = "Connect Four 0.1a" GraphicsWindow.BackgroundColor = "CornflowerBlue" dx = 90 dy = 80 'DrawGrid() DrawHoles() Sub DrawGrid GraphicsWindow.PenColor = "Gray" For x = 5 To gw Step dx GraphicsWindow.DrawLine(x, 0, x, gh) EndFor For y = dy To gh Step dy GraphicsWindow.DrawLine(0, y, gw, y) EndFor EndSub Sub DrawHoles GraphicsWindow.BrushColor = "White" For y = 0 To gh Step dy For x = 5 To gw Step dx GraphicsWindow.FillEllipse(x + 10, y + 5, dy - 10, dy - 10) EndFor EndFor EndSub End>LSM678.sb< Start>LSM832-0.sb< 'Program no: r200=150 GraphicsWindow.Width=900 GraphicsWindow.Height=900 GraphicsWindow.Left=5 GraphicsWindow.Top=5 gradient[1] = "MediumSeaGreen" gradient[2] = "SteelBlue" gradient[3] = "LightBlue" gradient[4] = "lightsalmon" gradient[5] = "lightyellow" brush1 = LDShapes.BrushGradient(gradient,"V") LDShapes.BrushGradientBackground(brush1) view3D = LD3DView.AddView(900 900,"true") LD3DView.AddDirectionalLight (VIEW3D,"#22aaFF",-180,-90,-155) LD3DView.AddspotLight(view3D,"#FFFFFF",1,4,12,-1 ,-1 ,-1, 200, 1000) r35=60 ya=30 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) i=1 GraphicsWindow.Title="3D man dd=":" args=0 GraphicsWindow.BrushColor=LDColours.HSLtoRGB (30 .9 .7) a2=3 r20=40 w="0 0 0:0 11 0 LD3DView.AddTube (view3D w 2 20 GraphicsWindow.BrushColor "D") hh=LD3DView.AddSphere (view3D 5 20 GraphicsWindow.BrushColor "D") LD3DView.TranslateGeometry (view3D hh 0 11 0) While "true For r=r20 To 180-r20 Step a2 mcam() endfor For r=180-r20 To r20 Step -a2 mcam() EndFor endwhile Sub mtub cc=ldtext.Replace (args[1] "d5" 3) return=LD3DView.AddTube (view3D cc 1 12 GraphicsWindow.BrushColor "D") EndSub sub mcam r5=8 py=-ldmath.Sin(r)*r5 px=ldmath.cos(r)*r5 px1=ldmath.cos(180-r)*r5 w="0 0 0:0 0 d5:"+px+dd+py+dd+":d5 ww="0 0 0:0 0 -d5:"+px1+dd+py+dd+":-d5 tt=LDCall.Function ("mtub" w ) tt1=LDCall.Function ("mtub" ww ) r8=5 py=-ldmath.Sin(r)*r8+8 px=ldmath.cos(r)*r8 px1=ldmath.cos(180-r)*r8 w="0 8 0:0 8 d5:"+px+dd+py+dd+":d5 ww="0 8 0:0 8 -d5:"+px1+dd+py+dd+":-d5 qtt=LDCall.Function ("mtub" w ) qtt1=LDCall.Function ("mtub" ww ) px= LDMath.Cos(aa) py= LDMath.sin (aa) LD3DView.ResetCamera(view3D, px*r35,ya,py*r35, -px, -.5, -py, "","","") aa=aa+.55 ' LD3DView.TranslateGeometry (view3D tt LDMath.Cos(aa)*r20 LDMath.sin(aa)*r20 r*5) Program.Delay (33) LD3DView.ModifyObject (view3D tt "X") LD3DView.ModifyObject (view3D tt1 "X") LD3DView.ModifyObject (view3D qtt "X") LD3DView.ModifyObject (view3D qtt1 "X") EndSub End>LSM832-0.sb< Start>LSM832-1.sb< 'Program no: LSM832-0 'program no: r200=150 GraphicsWindow.Width=900 GraphicsWindow.Height=900 GraphicsWindow.Left=5 GraphicsWindow.Top=5 gradient[1] = "MediumSeaGreen" gradient[2] = "SteelBlue" gradient[3] = "LightBlue" gradient[4] = "lightsalmon" gradient[5] = "lightyellow" brush1 = LDShapes.BrushGradient(gradient,"V") LDShapes.BrushGradientBackground(brush1) view3D = LD3DView.AddView(900 900,"true") LD3DView.AddDirectionalLight (VIEW3D,"#22aaFF",-180,-90,-155) LD3DView.AddspotLight(view3D,"#FFFFFF",1,4,12,-1 ,-1 ,-1, 500, 1000) LD3DView.AddspotLight(view3D,"#0000ff",45,45,1,1 ,45 ,1, 500, 1000) LD3DView.AddspotLight(view3D,"#ff0000",-45,-45,1,-180 ,90 ,-90, 500, 1000) r35=60 ya=30 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) i=1 GraphicsWindow.Title="3D man dd=":" args=0 GraphicsWindow.BrushColor=LDColours.HSLtoRGB (30 .9 .7) a2=3 r20=40 w="0 0 0:0 11 0 LD3DView.AddTube (view3D w 5 20 GraphicsWindow.BrushColor "D") hh=LD3DView.AddSphere (view3D 5 200 GraphicsWindow.BrushColor "D") LD3DView.TranslateGeometry (view3D hh 0 15 0) While "true For r=r20 To 180-r20 Step a2 mcam() endfor For r=180-r20 To r20 Step -a2 mcam() EndFor endwhile Sub mtub cc=ldtext.Replace (args[1] "d5" 3) return=LD3DView.AddTube (view3D cc 1 12 GraphicsWindow.BrushColor "D") EndSub sub mcam r5=8 py=-ldmath.Sin(r)*r5 px=ldmath.cos(r)*r5 px1=ldmath.cos(180-r)*r5 w="0 0 0:0 0 d5:"+px+dd+py+dd+":d5 ww="0 0 0:0 0 -d5:"+px1+dd+py+dd+":-d5 tt=LDCall.Function ("mtub" w ) tt1=LDCall.Function ("mtub" ww ) r8=5 py=-ldmath.Sin(r)*r8+8 px=ldmath.cos(r)*r8 px1=ldmath.cos(180-r)*r8 w="0 8 0:0 8 d5:"+px+dd+py+dd+":d5 ww="0 8 0:0 8 -d5:"+px1+dd+py+dd+":-d5 qtt=LDCall.Function ("mtub" w ) qtt1=LDCall.Function ("mtub" ww ) px= LDMath.Cos(aa) py= LDMath.sin (aa) LD3DView.ResetCamera(view3D, px*r35,ya,py*r35, -px, -.5, -py, "","","") aa=aa+.55 ' LD3DView.TranslateGeometry (view3D tt LDMath.Cos(aa)*r20 LDMath.sin(aa)*r20 r*5) Program.Delay (33) LD3DView.ModifyObject (view3D tt "X") LD3DView.ModifyObject (view3D tt1 "X") LD3DView.ModifyObject (view3D qtt "X") LD3DView.ModifyObject (view3D qtt1 "X") EndSub End>LSM832-1.sb< Start>LSM832.sb< r200=150 GraphicsWindow.BackgroundColor ="darkblue GraphicsWindow.BrushColor="gold GraphicsWindow.Width=900 GraphicsWindow.Height=900 GraphicsWindow.Left=5 GraphicsWindow.Top=5 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=60 ya=30 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) i=1 GraphicsWindow.Title="3D man dd=":" args=0 GraphicsWindow.BrushColor=LDColours.HSLtoRGB (30 .9 .7) a2=3 r20=40 w="0 0 0:0 11 0 LD3DView.AddTube (view3D w 1 12 GraphicsWindow.BrushColor "D") hh=LD3DView.AddSphere (view3D 1.7 20 GraphicsWindow.BrushColor "D") LD3DView.TranslateGeometry (view3D hh 0 11 0) While "true For r=r20 To 180-r20 Step a2 mcam() endfor For r=180-r20 To r20 Step -a2 mcam() EndFor endwhile Sub mtub cc=ldtext.Replace (args[1] "d5" 3) return=LD3DView.AddTube (view3D cc 1 12 GraphicsWindow.BrushColor "D") EndSub sub mcam r5=8 py=-ldmath.Sin(r)*r5 px=ldmath.cos(r)*r5 px1=ldmath.cos(180-r)*r5 w="0 0 0:0 0 d5:"+px+dd+py+dd+":d5 ww="0 0 0:0 0 -d5:"+px1+dd+py+dd+":-d5 tt=LDCall.Function ("mtub" w ) tt1=LDCall.Function ("mtub" ww ) r8=5 py=-ldmath.Sin(r)*r8+8 px=ldmath.cos(r)*r8 px1=ldmath.cos(180-r)*r8 w="0 8 0:0 8 d5:"+px+dd+py+dd+":d5 ww="0 8 0:0 8 -d5:"+px1+dd+py+dd+":-d5 qtt=LDCall.Function ("mtub" w ) qtt1=LDCall.Function ("mtub" ww ) px= LDMath.Cos(aa) py= LDMath.sin (aa) LD3DView.ResetCamera(view3D, px*r35,ya,py*r35, -px, -.5, -py, "","","") aa=aa+.55 ' LD3DView.TranslateGeometry (view3D tt LDMath.Cos(aa)*r20 LDMath.sin(aa)*r20 r*5) Program.Delay (33) LD3DView.ModifyObject (view3D tt "X") LD3DView.ModifyObject (view3D tt1 "X") LD3DView.ModifyObject (view3D qtt "X") LD3DView.ModifyObject (view3D qtt1 "X") EndSub End>LSM832.sb< Start>LSP860.sb< GraphicsWindow.BackgroundColor="darkred GraphicsWindow.BrushColor="teal GraphicsWindow.PenWidth=.7 GraphicsWindow.PenColor="black aa=LDFigures.AddBlockArrow(70 140 .35 45 "Up") Shapes.Zoom(aa .5 .5) GraphicsWindow.MouseMove=mmm GraphicsWindow.BrushColor="gold pstt() in=60000 ii=Shapes.AddText("60:00") fs="false LDShapes.Font(ii "Bodoni Bd Bt" 50 fs fs) LDEffect.DropShadow(ii "") Timer.Tick=ttt Timer.Interval=150 Sub ttt in=in-150 Shapes.SetText(ii ldMath.FixDecimal(in/1000 2)) If in<=0 Then Timer.Pause() GraphicsWindow.ShowMessage("TotalScore: "+(sc+math.floor(Math.SquareRoot(Math.Abs(sc))*5)) "GameOver!") Program.End() EndIf EndSub Sub pstt px=Math.GetRandomNumber(10) py=Math.GetRandomNumber(10) EndSub Sub mmm LDShapes.Centre(aa GraphicsWindow.MouseX GraphicsWindow.MouseY) nn=ldMath.Convert2Radial(GraphicsWindow.MouseX GraphicsWindow.MouseY px*35+55 py*35+55) Shapes.Rotate(aa nn[2]+90) GraphicsWindow.Title="Score: "+sc EndSub For x=1 To 10 For y=1 To 10 e[x][y]=Shapes.AddEllipse(12 12) Shapes.Move(e[x][y] x*35+55 y*35+55) LDEffect.DropShadow(e[x][y] "") LDShapes.SetShapeEvent(e[x][y]) EndFor EndFor LDShapes.ShapeEvent=see Sub see If LDShapes.LastEventType="MouseDown" Then If LDShapes.LastEventShape=e[px][py] Then sc=sc+10 LDShapes.AnimateZoom(e[px][py] 250 2 2.5 2.5) pstt() Else sc=sc-5 LDShapes.AnimateZoom(LDShapes.LastEventShape 150 3 1.5 1.5) EndIf EndIf EndSub End>LSP860.sb< Start>LSQ570.sb< ' SmallBasic Version 1.0 ' Funktion: ' Autor: Pappa Lapub ' Herkunft: http://social.msdn.microsoft.com/Forums/en-US/bc86767d-323c-4920-8118-16436fb3af02/ ' ImportURL: http://smallbasic.com/program/? ' Extension: ' Kommentar: In TextBox eine Zeit in Sekunden eingeben. ' Die eingegebene Zeit soll dann im Programm ein bestimmtes Ereignis auslösen ' Variablen: ' ' -------------------------------------------------------------------------------- CRLF = Text.GetCharacter(13) + Text.GetCharacter(10) Zeit = Controls.AddTextBox(10,10) Start = Controls.AddButton("Start",180, 8) Controls.ButtonClicked = OnButtonClick Sub OnButtonClick If Controls.LastClickedButton = Start Then If Controls.GetTextBoxText(Zeit) <> "" Then Sekunden = Controls.GetTextBoxText(Zeit) CheckZahl() If IsZahl Then Aktion() Else GraphicsWindow.ShowMessage("Eingabe ist KEINE reine Zahl", "Eingabefehler") EndIf Else GraphicsWindow.ShowMessage("Gib erst mal die Zeit [sec] ein.", "Keine Eingabe") EndIf EndIf EndSub Sub CheckZahl IsZahl = "True" For I = 1 To Text.GetLength(Sekunden) Ascii = Text.GetCharacterCode(Text.GetSubText(Sekunden, I, 1)) If Ascii < 48 Or Ascii > 57 Then IsZahl = "False" EndIf EndFor EndSub Sub Aktion ' hier weitere Verarbeitung von Sekunden, zB. GraphicsWindow.ShowMessage(Sekunden + " [sec]", "Aktion (Korrekte Eingabe)") Timer() ' eventuell ein Timer zum Aktonsstart nach Sekunden Wartezeit EndSub Sub Timer Timer.Interval = 1000 * Sekunden Timer.Tick = Zeitablauf EndSub Sub Zeitablauf GraphicsWindow.ShowMessage("Deine Zeit ist nun abgelaufen!" + CRLF + Sekunden + " [sec]", "Zeitablauf") EndSub End>LSQ570.sb< Start>LST928-0.sb< GraphicsWindow.Width = 600 GraphicsWindow.Height = 400 GraphicsWindow.Title = "Computer Implementation of Vigenere Cipher. Version 1.10 By Amir Rke" GraphicsWindow.Show() GraphicsWindow.DrawText(10,330,"Secret Key (shoud be less than the message)") GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 11 txtMain = Controls.AddMultiLineTextBox(10,10) Controls.SetSize(txtMain,580,310) GraphicsWindow.FontSize = 18 txtKey = Controls.AddTextBox(10,350) Controls.SetSize(txtKey,150,30) GraphicsWindow.FontSize = 12 btnCipher = Controls.AddButton("Cipher", 180,350) btnDecipher = Controls.AddButton("Decipher",250,350) GraphicsWindow.DrawText(350,330,"Progress :") GraphicsWindow.DrawText(450,330,"Time Taken :") lableLev = Shapes.AddText("0") Shapes.Move(lableLev,415,330) lableProg = Shapes.AddText("0%") Shapes.Move(lableProg,350,360) lableTime = Shapes.AddText("0") Shapes.Move(lableTime,450,360) level = 1 Controls.ButtonClicked = do_Click Sub do_Click If Controls.LastClickedButton = "Button1" Then If Controls.GetTextBoxText(txtKey) = "" Then GraphicsWindow.ShowMessage("Enter the key first","Error") Else eNcrypt() EndIf ElseIf Controls.LastClickedButton = "Button2" Then If Controls.GetTextBoxText(txtKey) = "" Then GraphicsWindow.ShowMessage("Enter the key first","Error") Else deCrypt() EndIf EndIf EndSub Sub eNcrypt timeStarted = Clock.ElapsedMilliseconds repeatKey() getStringCharCode() getKeyCharCode() Shapes.SetText(lableLev,3) For i = 1 To Text.GetLength(string) level3 = Math.Round((i*100)/Text.GetLength(string)) Shapes.SetText(lableProg,level3+"%") If charscode[i] < 0 Or charscode[i] > 26 Then encryptestring = Text.Append(encryptestring,Text.GetCharacter(charscode[i] + 65)) Else encryptedcharcode[i] = 65 + Math.Remainder(keycharscode[i] + charscode[i],26) encryptedchar[i] = Text.GetCharacter(encryptedcharcode[i]) encryptestring = Text.Append(encryptestring,encryptedchar[i]) EndIf EndFor Controls.SetTextBoxText(txtMain,"") Controls.SetTextBoxText(txtMain,encryptestring) encryptestring = "" key = "" Controls.SetTextBoxText(txtKey,"") finalkey = "" timeEnd = Clock.ElapsedMilliseconds - timeStarted '| Min = Math.Remainder(timeinmiliseconds/(1000*60),60) '| Secs = Math.Remainder(timeinmiliseconds/1000,60) Min = Math.Round(Math.Remainder(timeEnd/(1000*60),60)) Secs = Math.Round(Math.Remainder(timeEnd/1000,60)) Shapes.SetText(lableTime,Min+" Min and "+Secs+" Sec") EndSub Sub deCrypt timeStarted = Clock.ElapsedMilliseconds repeatKey() getStringCharCode() getKeyCharCode() Shapes.SetText(lableLev,3) For i = 1 To Text.GetLength(string) level3 = Math.Round((i*100)/Text.GetLength(string)) Shapes.SetText(lableProg,level3+"%") If charscode[i] < 0 Or charscode[i] > 26 Then decryptestring = Text.Append(decryptestring,Text.GetCharacter(charscode[i] + 65)) Else encryptedcharcode[i] = Math.Remainder(charscode[i] - keycharscode[i],26) + 65 If encryptedcharcode[i] < 65 Then encryptedcharcode[i] = encryptedcharcode[i] + 26 EndIf encryptedchar[i] = Text.GetCharacter(encryptedcharcode[i]) decryptestring = Text.Append(decryptestring,encryptedchar[i]) EndIf EndFor Controls.SetTextBoxText(txtMain,"") Controls.SetTextBoxText(txtMain,decryptestring) decryptestring = "" key = "" Controls.SetTextBoxText(txtKey,"") finalkey = "" timeEnd = Clock.ElapsedMilliseconds - timeStarted '| Min = Math.Remainder(timeinmiliseconds/(1000*60),60) '| Secs = Math.Remainder(timeinmiliseconds/1000,60) Min = Math.Round(Math.Remainder(timeEnd/(1000*60),60)) Secs = Math.Round(Math.Remainder(timeEnd/1000,60)) Shapes.SetText(lableTime,Min+" Min and "+Secs+" Sec") EndSub Sub repeatKey string = Text.ConvertToUpperCase(Controls.GetTextBoxText(txtMain)) key = Text.ConvertToUpperCase(Controls.GetTextBoxText(txtKey)) i = 1 While Text.GetLength(finalkey) < Text.GetLength(string) If i > Text.GetLength(key) Then i = 1 EndIf keyl = Text.GetSubText(key,i,1) finalkey = finalkey + keyl i = i + 1 EndWhile EndSub Sub getStringCharCode Shapes.SetText(lableLev,1) For i= 1 To Text.GetLength(string) level1 = Math.Round((i*100)/Text.GetLength(string)) Shapes.SetText(lableProg,level1+"%") chars[i] = Text.GetSubText(string,i,1) charscode[i] = Text.GetCharacterCode(chars[i]) - 65 EndFor EndSub Sub getKeyCharCode Shapes.SetText(lableLev,2) For i = 1 To Text.GetLength(finalkey) level2 = Math.Round((i*100)/Text.GetLength(string)) Shapes.SetText(lableProg,level2+"%") keychars[i] = Text.GetSubText(finalkey,i,1) keycharscode[i] = Text.GetCharacterCode(keychars[i]) - 65 EndFor EndSub End>LST928-0.sb< Start>LST928.sb< 'Vigenere Cipher By Amir CPS 'https://fb.me/AmirCPS 'Version 1.0 'Date 3-09-2012 GraphicsWindow.Width = 600 GraphicsWindow.Height = 400 GraphicsWindow.Title = "Computer Implementation of Vigenere Cipher. Version 1.10 By Amir Rke" GraphicsWindow.Show() GraphicsWindow.DrawText(10,330,"Secret Key (shoud be less than the message)") GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 11 txtMain = Controls.AddMultiLineTextBox(10,10) Controls.SetSize(txtMain,580,310) GraphicsWindow.FontSize = 18 txtKey = Controls.AddTextBox(10,350) Controls.SetSize(txtKey,150,30) GraphicsWindow.FontSize = 12 btnCipher = Controls.AddButton("Cipher", 180,350) btnDecipher = Controls.AddButton("Decipher",250,350) Controls.ButtonClicked = do_Click Sub do_Click If Controls.LastClickedButton = "Button1" Then If Controls.GetTextBoxText(txtKey) = "" Then GraphicsWindow.ShowMessage("Enter the key first","Error") Else eNcrypt() EndIf ElseIf Controls.LastClickedButton = "Button2" Then If Controls.GetTextBoxText(txtKey) = "" Then GraphicsWindow.ShowMessage("Enter the key first","Error") Else deCrypt() EndIf EndIf EndSub Sub eNcrypt repeatKey() getStringCharCode() getKeyCharCode() For i = 1 To Text.GetLength(string) If charscode[i] < 0 Or charscode[i] > 26 Then encryptestring = Text.Append(encryptestring,Text.GetCharacter(charscode[i] + 65)) Else encryptedcharcode[i] = 65 + Math.Remainder(keycharscode[i] + charscode[i],26) encryptedchar[i] = Text.GetCharacter(encryptedcharcode[i]) encryptestring = Text.Append(encryptestring,encryptedchar[i]) EndIf EndFor Controls.SetTextBoxText(txtMain,"") Controls.SetTextBoxText(txtMain,encryptestring) encryptestring = "" key = "" Controls.SetTextBoxText(txtKey,"") finalkey = "" EndSub Sub deCrypt repeatKey() getStringCharCode() getKeyCharCode() For i = 1 To Text.GetLength(string) If charscode[i] < 0 Or charscode[i] > 26 Then decryptestring = Text.Append(decryptestring,Text.GetCharacter(charscode[i] + 65)) Else encryptedcharcode[i] = Math.Remainder(charscode[i] - keycharscode[i],26) + 65 If encryptedcharcode[i] < 65 Then encryptedcharcode[i] = encryptedcharcode[i] + 26 EndIf encryptedchar[i] = Text.GetCharacter(encryptedcharcode[i]) decryptestring = Text.Append(decryptestring,encryptedchar[i]) EndIf EndFor Controls.SetTextBoxText(txtMain,"") Controls.SetTextBoxText(txtMain,decryptestring) decryptestring = "" key = "" Controls.SetTextBoxText(txtKey,"") finalkey = "" EndSub Sub repeatKey string = Text.ConvertToUpperCase(Controls.GetTextBoxText(txtMain)) key = Text.ConvertToUpperCase(Controls.GetTextBoxText(txtKey)) i = 1 While Text.GetLength(finalkey) < Text.GetLength(string) If i > Text.GetLength(key) Then i = 1 EndIf keyl = Text.GetSubText(key,i,1) finalkey = finalkey + keyl i = i + 1 EndWhile EndSub Sub getStringCharCode For i= 1 To Text.GetLength(string) chars[i] = Text.GetSubText(string,i,1) charscode[i] = Text.GetCharacterCode(chars[i]) - 65 EndFor EndSub Sub getKeyCharCode For i = 1 To Text.GetLength(finalkey) keychars[i] = Text.GetSubText(finalkey,i,1) keycharscode[i] = Text.GetCharacterCode(keychars[i]) - 65 EndFor EndSub End>LST928.sb< Start>LSW046.sb< GraphicsWindow.BackgroundColor = "DarkBlue" TextThing = Shapes.AddText(0) Ball = Shapes.AddEllipse(16, 16) GraphicsWindow.MouseMove = OnMouseMove Sub OnMouseMove Shapes.SetText(TextThing, "X=" + (Mouse.MouseX - GraphicsWindow.Left - 8) + " Y=" + (Mouse.MouseY - GraphicsWindow.Top - 31)) Shapes.Move(Ball, Mouse.MouseX - GraphicsWindow.Left - 8 - 8, Mouse.MouseY - GraphicsWindow.Top - 31 - 8) EndSub End>LSW046.sb< Start>LSW450-1.sb< arrayOfCharacters[1] = "a" arrayOfCharacters[2] = "b" arrayOfCharacters[3] = "c" arrayOfCharacters[4] = "d" arrayOfCharacters[5] = "e" arrayOfCharacters[6] = "f" arrayOfCharacters[7] = "g" arrayOfCharacters[8] = "h" arrayOfCharacters[9] = "i" arrayOfCharacters[10] = "j" arrayOfCharacters[11] = "k" arrayOfCharacters[12] = "l" arrayOfCharacters[13] = "m" arrayOfCharacters[14] = "n" arrayOfCharacters[15] = "o" arrayOfCharacters[16] = "p" arrayOfCharacters[17] = "q" arrayOfCharacters[18] = "r" arrayOfCharacters[19] = "s" arrayOfCharacters[20] = "t" arrayOfCharacters[21] = "u" arrayOfCharacters[22] = "v" arrayOfCharacters[23] = "w" arrayOfCharacters[24] = "x" arrayOfCharacters[25] = "y" arrayOfCharacters[16] = "z" stringvalue = "" index = 0 While(getrandomnumber<26) random = Math.GetRandomNumber(26) temporarystringvalue = arrayOfCharacters[random] If Text.IsSubText(stringvalue,temporarystringvalue) = "False" then stringvalue = stringvalue + temporarystringvalue Else getrandomnumber = getrandomnumber - 1 EndIf getrandomnumber = getrandomnumber + 1 EndWhile TextWindow.Write(stringvalue+" ") Textwindow.WriteLine(" Length of Text Is "+Text.GetLength(stringvalue)) End>LSW450-1.sb< Start>LSW450.sb< arrayOfCharacters[1] = "a" arrayOfCharacters[2] = "b" arrayOfCharacters[3] = "c" arrayOfCharacters[4] = "d" arrayOfCharacters[5] = "e" arrayOfCharacters[6] = "f" arrayOfCharacters[7] = "g" arrayOfCharacters[8] = "g" arrayOfCharacters[9] = "h" arrayOfCharacters[10] = "i" arrayOfCharacters[11] = "j" arrayOfCharacters[12] = "k" arrayOfCharacters[13] = "l" arrayOfCharacters[14] = "m" arrayOfCharacters[15] = "n" arrayOfCharacters[16] = "o" arrayOfCharacters[17] = "p" arrayOfCharacters[18] = "q" arrayOfCharacters[19] = "r" arrayOfCharacters[20] = "s" arrayOfCharacters[21] = "t" arrayOfCharacters[22] = "u" arrayOfCharacters[23] = "v" arrayOfCharacters[24] = "w" arrayOfCharacters[25] = "x" arrayOfCharacters[26] = "y" arrayOfCharacters[27] = "z" For getrandomnumber = 1 To 27 stringvalue = arrayOfCharacters[Math.GetRandomNumber(27)] TextWindow.Write(stringvalue) EndFor End>LSW450.sb< Start>LSW731.sb< args=0 Sub p3d'---------------3d part---------- GraphicsWindow.BackgroundColor="darkblue" GraphicsWindow.Width=900 GraphicsWindow.Height=900 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) ll=3 pp="0 0 0 0:"+ll+":0" p1=LD3DView.AddTube(view3D pp .4 10 "gold" "D") pp="0:"+(ll+1)+":0 0:"+(ll+2.5)+":0" oo=LD3DView.AddTube(view3D pp 2.2 12 "gold" "D") cb=LD3DView.AddCube(view3D 2 "beige" "D") LD3DView.TranslateGeometry(view3D cb 4 1 0) nn=LD3DView.AddCone(view3D 1.4 .2 .5 12 "gold" "D") C=LD3DView.AddCone(view3D .2 1.1 1 12 "gold" "D") LD3DView.TranslateGeometry(view3D c 0 ll 0) LD3DView.RotateGeometry(view3D c 0 1 0 15) cpp="1=-2.73109702608761;2=7.86546240961225;3=-9.39220212916752;4=0.235205428927602;5=-0.624102000454974;6=0.745100730929102;7=0.328891246842536;8=0.77248957934199;9=0.543222235883618 LD3DView.ResetCamera(view3D cpp[1] cpp[2] cpp[3] cpp[4] cpp[5] cpp[6] cpp[7] cpp[8] cpp[9]) cc=LDGraphicsWindow.Capture("" "false") LD3DView.ModifyObject(view3D cb "X") LD3DView.ModifyObject(view3D c "X") LD3DView.ModifyObject(view3D oo "X") LD3DView.ModifyObject(view3D nn "X") LD3DView.ModifyObject(view3D p1 "X") GraphicsWindow.BackgroundColor="darkred LDImage.MakeTransparent(cc "darkblue") EndSub p3d() GraphicsWindow.BrushColor="black GraphicsWindow.FillRectangle(0 0 900 900) lbl() Sub lbl'--------------labeling------------- GraphicsWindow.FontName="Zx spectrum GraphicsWindow.FontSize=20 GraphicsWindow.BrushColor="black GraphicsWindow.FontBold="false t1=Shapes.AddText("RE:") Shapes.Rotate(t1,-8) Shapes.Zoom(t1 1.3 1.3) LDShapes.BrushColour(t1 "darkred") ee=50 LDShapes.penColour(t1 "gold") Shapes.Move(t1 0 303) t=Shapes.AddText(" Shading Hidde") LDShapes.BrushColour(t "gold") LDShapes.penColour(t "darkred") Shapes.Move(t 86 320-ee) Shapes.Rotate(t,-8) Shapes.Zoom(t 1.3 1.3) t=Shapes.AddText(" Colour Keep ") LDShapes.BrushColour(t "gold") LDShapes.penColour(t "darkred") Shapes.Move(t 90 345-ee) Shapes.Rotate(t, -8) Shapes.Zoom(t 1.3 1.3) LDShapes.ZIndex(t1 11) EndSub GraphicsWindow.Height=800 GraphicsWindow.Width=600 GraphicsWindow.BrushColor="#10334E GraphicsWindow.FillRectangle(0 320 600 600) GraphicsWindow.BrushColor= "gold" GraphicsWindow.FillTriangle(0 370 650 280 550 220) GraphicsWindow.FillTriangle(0 310 0 370 140 350) GraphicsWindow.FillRectangle(0 280 990 2) LDGraphicsWindow.FloodFillTolerance=11 LDGraphicsWindow.FloodFill(530 310 "#10334E") GraphicsWindow.BrushColor="black GraphicsWindow.FillRectangle(0 275 200 10) GraphicsWindow.PenWidth=2.5 GraphicsWindow.PenColor="darkred Shapes.AddLine(504 256 502 242) DFF() drw="true GraphicsWindow.top=5 GraphicsWindow.Left=5 GraphicsWindow.PenWidth=1.5 GraphicsWindow.PenColor="lightgray GraphicsWindow.DrawLine(40 180 500 180) ccc=LDText.Split("red yellow green #00dddd" " ") For x=1 To 4 GraphicsWindow.PenWidth=20 GraphicsWindow.PenColor=ccc[x] GraphicsWindow.DrawLine(300+x*20, -5,700,500-x*30) EndFor GraphicsWindow.FontName="Arial GraphicsWindow.FontBold="True GraphicsWindow.BrushColor="cyan GraphicsWindow.FontSize=60 GraphicsWindow.DrawText(45 100 "ZX Spectrum") GraphicsWindow.FontSize=70 GraphicsWindow.FontBold="true GraphicsWindow.FontName="Arial GraphicsWindow.BrushColor="white t1=shapes.AddText ("VU-3D") Shapes.Move(t1 25 180) Shapes.Zoom(t1 .8 1) GraphicsWindow.DrawResizedImage(cc 0 320 650 700) GraphicsWindow.PenWidth=0 qw=Shapes.AddEllipse(160 70) Shapes.Zoom(qw .88 .88) Shapes.Rotate(qw 10) Shapes.Move(qw 300 358) bb=LDShapes.BrushGradient("1=gold;2=#222222" "H") LDShapes.BrushShape(qw bb) GraphicsWindow.Title="VU-3D Theme GraphicsWindow.BackgroundColor="black zxx() Sub zxx'--------------logo draw---------------- Turtle.Speed=10 GraphicsWindow.PenWidth=10 GraphicsWindow.PenColor="white Turtle.Angle=0 Turtle.x=45 Turtle.y=80 shp=ls cutt() shp=li cutt() shp=ln cutt() shp=lc cutt() shp=ll cutt() shp=la cutt() shp=li cutt() shp=lr cutt() Turtle.Hide() EndSub Sub cutt'-------------turtle draw-------------- aa=LDText.Split(shp " ") For x=1 To Array.GetItemCount(aa) If aa[x]="d" Then Turtle.PenDown() ElseIf aa[x]="u" Then Turtle.PenUp() ElseIf aa[x]="r" Then Turtle.TurnRight() ElseIf aa[x]="l" Then Turtle.TurnLeft() ElseIf aa[x]="a" Then Turtle.Turn(-60) ElseIf aa[x]="b" Then Turtle.Turn(60) Else Turtle.Move(aa[x]*20) EndIf EndFor EndSub Sub dff'----------------logotype--------------- lv="u 2.7 r r d 2.45 u -.25 d l 3 u -.13 d a -0.1 2.45 b l u -2.45 r .8 l ls="d r 4.5 -.25 l 1.25 -.25 l 4.25 -.25 r 1.25 -.25 r 4.25 -.25 u r 2.25 l .8 l li="d 2.5 u .5 d .5 u -3.5 r .8 l ln="d 2.45 u -.25 d r 4.25 -.25 r 2.25 u l .8 l lc="u .25 d r -.25 4.25 u -4 d l d 2.25 u -.25 d r 4 u r 2.5 l .6 l ll="u .25 d 3.5 u -3.75 r .8 l lr="d 2.45 u -.25 d r 4 l le="u r 4 d l .25 l d -.25 4.5 -.25 r 2.25 -.25 r 4.25 -.25 r 1.25 -.25 r 4 l u 1.25 l 4.8 l la="u 2.5 r d -.25 4.5 -.25 r 2.25 -.25 r 4.25 -.25 r 1.25 -.25 r 4 r u 1.25 l .8 l EndSub End>LSW731.sb< Start>LSW971.sb< TextWindow.Title = "SB forum function loop" fun = "1=Helping out;2=More practice;3=Satisfaction" While "true" TextWindow.Write(fun[1] + " = ") TextWindow.Write(fun[2] + " = ") TextWindow.Write(fun[3] + " = ") Program.Delay(80) EndWhile End>LSW971.sb< Start>LSX899.sb< 'K-Pad Text Editor by Kroltan '------------------------------------------------------------------------------------------------------------------------ GLOBAL VARIABLES ver = "1.0" 'Version variable ' The following line could be harmful and has been automatically commented. ' loadedlang = File.ReadContents(Program.Directory + "\lang.ini") loadfile = loadfilename_string[lang] 'Set title var to Untitled savestate = 1 'File is saved by start bgimg1 = "http://www.freeimagehosting.net/uploads/2d18f053b8.png" 'Background image URL fontcolor = "Green" 'Title text font color If loadedlang = "" Then lang = "eng" Else lang = loadedlang EndIf ' The following line could be harmful and has been automatically commented. ' File.WriteContents(Program.Directory + "\lang.ini",lang) '----------------------------------------------------------------------------------------------------------------------------------------- Strings loading_string["eng"] = "Loading..." 'Shown while loading newfile_string["eng"] = "New File" 'Button String savefile_string["eng"] = "Save File" 'Button String loadfile_string["eng"] = "Open File" 'Button String export_string["eng"] = "Export to .TXT" 'Button String read_string["eng"] = "Read File" 'Button String web_string["eng"] = "Visit our site: http://k-dev.webs.com/" 'Site message string confirm_string["eng"] = "This file has not been saved, do you want to proceed?" 'Confirmation string name_string["eng"] = "Give a name for your file" 'New file dialog string loadfilename_string["eng"] = "Untitled" 'When no title has been gave to the document restartprogram_string["eng"] = "Restart the program to apply selected language." loading_string["por"] = "Carregando..." 'Shown while loading newfile_string["por"] = "Novo Arquivo" 'Button String savefile_string["por"] = "Salvar Arquivo" 'Button String loadfile_string["por"] = "Abrir Arquivo" 'Button String export_string["por"] = "Exportar para .TXT" 'Button String read_string["por"] = "Ler Arquivo" 'Button String web_string["por"] = "Visite nosso site: http://k-dev.webs.com/" 'Site message string confirm_string["por"] = "Esse arquivo não foi salvo, continuar?" 'Confirmation string name_string["por"] = "Dê um nome para seu arquivo" 'New file dialog string loadfilename_string["por"] = "Sem Título" 'When no title has been gave to the document restartprogram_string["por"] = "Reinicie o programa para aplicar a tradução escolhida." loading_string["spa"] = "Cargando..." 'Shown while loading newfile_string["spa"] = "Nuevo Archivo" 'Button String savefile_string["spa"] = "Guardar Archivo" 'Button String loadfile_string["spa"] = "Abrir Archivo" 'Button String export_string["spa"] = "Exportar a .TXT" 'Button String read_string["spa"] = "Ler Archivo" 'Button String web_string["spa"] = "Visite nuestro sitio: http://k-dev.webs.com/" 'Site message string confirm_string["spa"] = "Este archivo no se ha guardado, ¿desea continuar?" 'Confirmation string name_string["spa"] = "Dé un nombre para el archivo" 'New file dialog string loadfilename_string["spa"] = "Sin título" 'When no title has been gave to the document restartprogram_string["spa"] = "Reinicie el programa para aplicar el idioma elegido." '-------------------------------------------------------------------------------------------------------------------------------------- STARTUP GraphicsWindow.DrawText(10,10,loading_string[lang]) 'Preload text GraphicsWindow.Title = "K-Pad " + ver 'Set the window's title to... GraphicsWindow.DrawResizedImage(bgimg1,0,0,GraphicsWindow.Width*2,36) 'Draw the background image GraphicsWindow.PenColor = "Gainsboro" 'Set color to a very light gray GraphicsWindow.DrawLine(0,37,GraphicsWindow.Width*2,37) 'Draw separator line newfile_btn = FCControls.AddButton(80,30,newfile_string[lang]) 'Adds the New File button savefile_btn = FCControls.AddButton(84,30,savefile_string[lang]) 'Adds the Save File button loadfile_btn = FCControls.AddButton(80,30,loadfile_string[lang]) 'Adds the Load File button export_btn = FCControls.AddButton(80,30, export_string[lang]) ' Adds the Export to .TXT button read_btn = FCControls.AddButton(80,30, read_string[lang]) 'Adds the Read File button English_btn = FCControls.AddButton(40,20,"eng") 'Adds the English button Portugese_btn = FCControls.AddButton(40,20,"por") 'Adds the Portugese button Spanish_btn = FCControls.AddButton(40,20,"spa") 'Adds the Spanish button FCControls.Move(English_btn,0,GraphicsWindow.Height-20) FCControls.Move(Portugese_btn,41,GraphicsWindow.Height-20) FCControls.Move(Spanish_btn,82,GraphicsWindow.Height-20) GraphicsWindow.FontSize = 20 'Sets font size GraphicsWindow.BrushColor = fontcolor 'Set font color title = FCControls.AddLabel(GraphicsWindow.Width - 100,30,"K - Pad " + ver) 'Write the title at window FCControls.Move(newfile_btn,3,3) 'Moves the button FCControls.Move(savefile_btn,86,3) 'Moves the button FCControls.Move(loadfile_btn,173,3) 'Moves the button FCControls.Move(title,GraphicsWindow.Width-120,0) 'Moves the text FCControls.Move(export_btn,256,3) 'Moves the button If lang = "eng" then FCControls.Move(read_btn,339,3) 'Moves the button EndIf FCControls.RegisterMouseDownEvent(savefile_btn, "savefile") 'Register mousedown FCControls.RegisterMouseDownEvent(newfile_btn, "newfile") 'Register mousedown FCControls.RegisterMouseDownEvent(loadfile_btn, "loadfile") 'Register mousedown FCControls.RegisterMouseDownEvent(export_btn, "export") 'Register mousedown FCControls.RegisterMouseDownEvent(read_btn, "readfile") 'Register mousedown k_dev = FCControls.AddButton(40,20,"K-Dev") 'Add k-dev websie button FCControls.Move(k_dev,GraphicsWindow.Width - 40, GraphicsWindow.Height - 20) 'Moves the k-dev button FCControls.RegisterMouseDownEvent(k_dev, "web") 'Register mousedown FCControls.RegisterMouseDownEvent(English_btn, "setlang") 'Register mousedown FCControls.RegisterMouseDownEvent(Portugese_btn, "setlang") 'Register mousedown FCControls.RegisterMouseDownEvent(Spanish_btn, "setlang") 'Register mousedown If lang = "eng" Then Speech.Speak("Hello! Welcome to the K-pad text editor version " + ver) 'Welcome EndIf '------------------------------------------------------------------------------------------------------------------------------- SUBROUTINES Sub setlang If FCControls.LastEventSource = English_btn Then lang = "eng" ' The following line could be harmful and has been automatically commented. ' File.WriteContents(Program.Directory + "\lang.ini",lang) ElseIf FCControls.LastEventSource = Portugese_btn Then lang = "por" ' The following line could be harmful and has been automatically commented. ' File.WriteContents(Program.Directory + "\lang.ini",lang) ElseIf FCControls.LastEventSource = Spanish_btn Then lang = "spa" ' The following line could be harmful and has been automatically commented. ' File.WriteContents(Program.Directory + "\lang.ini",lang) EndIf FCDialogs.ShowMessageAsInformation(restartprogram_string[lang]) EndSub Sub readfile readcontents = FCControls.GetText(tbox) 'Gets the text Speech.Speak(readcontents) 'Speaks the text EndSub Sub export exportloc = FCDialogs.AskForSaveLocation2(".txt") 'Ask for save location savecontents = FCControls.GetText(tbox) 'Get the text to export ' The following line could be harmful and has been automatically commented. ' File.WriteContents(exportloc,savecontents) ' "export" the file (it just saves with other extension) EndSub Sub setsav savestate = 0 'Not saved EndSub Sub web FCDialogs.ShowMessage(web_string[lang]) 'Shows a message with Ok opition EndSub Sub savefile fileloc = FCDialogs.AskForSaveLocation2(".kpad") 'Asks for a place to save savecontents = FCControls.GetText(tbox) 'Get the textbox's contents ' The following line could be harmful and has been automatically commented. ' File.WriteContents(fileloc,savecontents) ' Write the textbox's contents to a file savestate = 1 EndSub Sub loadfile If savestate = 1 Then 'If file is saved loadfile = FCDialogs.AskForFile2(".kpad") 'Show "load file" window ' The following line could be harmful and has been automatically commented. ' contents = File.ReadContents(loadfile) 'Loads the selected file's contents tbox = FCControls.AddMultilineTextBox(GraphicsWindow.Width, GraphicsWindow.Height - 38,contents) 'Creates the textbox with the content provided FCControls.Move(tbox, 0, 31) 'Moves textbox to correct location ElseIf savestate = 0 Then 'If file is not saved confirml = FCDialogs.AskForYesNo(confirm_string[lang]) 'Ask for confirmation If confirml = "Yes" Then 'If user confirms loadfile = FCDialogs.AskForFile2(".kpad") 'Ask for a file ' The following line could be harmful and has been automatically commented. ' contents = File.ReadContents(loadfile) 'Get the contents of selected file tbox = FCControls.AddMultilineTextBox(GraphicsWindow.Width, GraphicsWindow.Height - 38,contents) 'Creates the textbox with loaded contents Controls.Move(tbox, 0, 31) 'Moves the textbox to correct location EndIf EndIf EndSub Sub newfile If savestate = 1 Then 'If file is saved filename = FCDialogs.AskForTextLine(name_string[lang]) 'Ask for a title If filename = "" Then ' If no name is given loadfile = loadfilename_string[lang] 'Set name to untitled Else 'Otherwise loadfile = filename 'Get the title defined by the user EndIf tbox = FCControls.AddMultilineTextBox(GraphicsWindow.Width, GraphicsWindow.Height - 52,"") 'Generates the text box FCControls.Move(tbox, 0, 31) 'Moves the textbox to correct position ElseIf savestate = 0 Then 'If file isn't saved confirmn = FCDialogs.AskForYesNo(confirm_string[lang]) 'Ask for confirmaion before clearing the textbox If confirmn = "Yes" Then 'If user is sure that will discard unsaved info filename = FCDialogs.AskForTextLine(name_string[lang]) 'Ask for filename If filename = "" Then 'If no title is provided loadfile = loadfilename_string[lang] 'Set title to Untitled Else 'Otherwise loadfile = filename 'Get the title defined by user EndIf tbox = FCControls.AddMultilineTextBox(GraphicsWindow.Width, GraphicsWindow.Height - 52,"") 'Creates the textbox FCControls.Move(tbox, 0, 31) 'Moves the textbox to correct location EndIf EndIf EndSub '------------------------------------------------------------------------------------------------------------------------------------------- LOOP loop: FCControls.RegisterKeyDownEvent(tbox, "setsav") 'Register keypress If savestate = 1 Then 'If saved GraphicsWindow.Title = loadfile + " - K-Pad " + ver 'Set title without "*" ElseIf savestate = 0 Then 'If not saved GraphicsWindow.Title = loadfile + "* - K-Pad " + ver 'Set title with "*" EndIf FCControls.SetWidth(tbox, GraphicsWindow.Width) 'Adjust the textbox's width FCControls.SetHeight(tbox, GraphicsWindow.Height - 52) 'Adjust the textbox's height Goto loop ' by Kroltan End>LSX899.sb< Start>LTB987.sb< '====================================================== 'PASSWORD LOGIN CODE WITH MODERATELY SECURE ENCRYPTION '====================================================== '====================================================== 'INITIALISE '====================================================== usersFile = Program.Directory+"\passwords.txt" readUsers() '====================================================== 'MAIN CODE '====================================================== While ("True") 'Read user name and check it is at least 4 characters TextWindow.WriteLine("Enter your name") name = TextWindow.Read() If (Text.GetLength(name) < 4) Then TextWindow.WriteLine("Name must have at least 4 characters") Else 'Check if this user name exists and get its index in the list of users userNumber = 0 indices = Array.GetAllIndices(users) For i = 1 To Array.GetItemCount(indices) If (users[indices[i]]["name"] = name) Then userNumber = indices[i] EndIf EndFor If (userNumber > 0) Then 'Existing user - get password and check it TextWindow.WriteLine("Enter your password") password = TextWindow.Read() encrypt() If (encrypted = users[userNumber]["pwd"]) Then TextWindow.WriteLine("Logged In") Else TextWindow.WriteLine("Incorrect Password") EndIf Else 'New user - get a password - check it is at least 6 characters, encrypt, add it to the current list and save it TextWindow.WriteLine("Enter password for new user") password = TextWindow.Read() If (Text.GetLength(password) < 6) Then TextWindow.WriteLine("Password must have at least 6 characters") Else encrypt() AddUser() writeUsers() TextWindow.WriteLine("New user added") EndIf EndIf EndIf TextWindow.WriteLine("") EndWhile '====================================================== 'SUBROUTINES '====================================================== Sub encrypt 'Convert string to a number (a big number) len = Text.GetLength(password) var1 = 1 For i = 1 To len val = Text.GetCharacterCode(Text.GetSubText(password,i,1)) var1 = var1*val EndFor 'TextWindow.WriteLine(var1) 'Limit the size of the number to 9 digits because we will cube it and there are limits to the number of digits of numbers in SmallBasic While (var1 > 1000000000) var1 = Math.Floor(var1/2) EndWhile 'TextWindow.WriteLine(var1) 'Make the number very big (cube it) var2 = var1*var1*var1 'Take every second digit as the encrypted value - very hard to fill the blanks to create a number that is a perfect cube 'TextWindow.WriteLine(var2) len = Text.GetLength(var2) encrypted = "" For i = 1 To len Step 2 val = Text.GetSubText(var2,i,1) encrypted = Text.Append(encrypted,val) EndFor EndSub Sub readUsers ' The following line could be harmful and has been automatically commented. ' users = File.ReadContents(usersFile) EndSub Sub writeUsers ' The following line could be harmful and has been automatically commented. ' File.WriteContents(usersFile,users) EndSub Sub AddUser 'Find first free index number count = 1 While (Array.ContainsIndex(users,count)) count = count+1 EndWhile users[count]["name"] = name users[count]["pwd"] = encrypted EndSub End>LTB987.sb< Start>LTC319.sb< 'GW PROPERTIES '============================================================= GraphicsWindow.Width = 1000 GraphicsWindow.Height = 800 GraphicsWindow.CanResize = "False" GraphicsWindow.Top = 100 GraphicsWindow.Left = 200 GraphicsWindow.DrawResizedImage(Program.Directory + "\TitleScreen.png",0,0,1000,800) Sound.Play(Program.Directory + "\Theme.mp3") While GraphicsWindow.LastKey <> "Return" EndWhile '============================================================= 'ALL MARIO SPRITES '============================================================= MarioDuck = Shapes.AddImage(Program.Directory + "\MarioDuck.png") MarioDead = Shapes.AddImage(Program.Directory + "\MarioDead.png") MarioHammer[1] = Shapes.AddImage(Program.Directory + "\MarioHammer1.png") MarioHammer[2] = Shapes.AddImage(Program.Directory + "\MarioHammer2.png") MarioHammer[3] = Shapes.AddImage(Program.Directory + "\MarioHammer3.png") MarioHammer[4] = Shapes.AddImage(Program.Directory + "\MarioHammer4.png") MarioHammer[5] = Shapes.AddImage(Program.Directory + "\MarioHammer5.png") MarioHammer[6] = Shapes.AddImage(Program.Directory + "\MarioHammer6.png") MarioHammer[7] = Shapes.AddImage(Program.Directory + "\MarioHammer7.png") MarioHit[1] = Shapes.AddImage(Program.Directory + "\MarioHit1.png") MarioHit[2] = Shapes.AddImage(Program.Directory + "\MarioHit2.png") MarioHit[3] = Shapes.AddImage(Program.Directory + "\MarioHit3.png") MarioJump[1] = Shapes.AddImage(Program.Directory + "\MarioJump1.png") MarioJump[2] = Shapes.AddImage(Program.Directory + "\MarioJump2.png") MarioStand = Shapes.AddImage(Program.Directory + "\MarioStand1.png") MarioWalk[1] = Shapes.AddImage(Program.Directory + "\MarioWalk1.png") MarioWalk[2] = Shapes.AddImage(Program.Directory + "\MarioWalk2.png") MarioWalk[3] = Shapes.AddImage(Program.Directory + "\MarioWalk3.png") MarioWalk[4] = Shapes.AddImage(Program.Directory + "\MarioWalk4.png") MarioStandFlip = Shapes.AddImage(Program.Directory + "\MarioStand1Flip.png") MarioWalkFlip[1] = Shapes.AddImage(Program.Directory + "\MarioWalk1Flip.png") MarioWalkFlip[2] = Shapes.AddImage(Program.Directory + "\MarioWalk2Flip.png") MarioWalkFlip[3] = Shapes.AddImage(Program.Directory + "\MarioWalk3Flip.png") MarioWalkFlip[4] = Shapes.AddImage(Program.Directory + "\MarioWalk4Flip.png") MarioJumpFlip[1] = Shapes.AddImage(Program.Directory + "\MarioJump1Flip.png") MarioJumpFlip[2] = Shapes.AddImage(Program.Directory + "\MarioJump2Flip.png") TextBubble[1] = Shapes.AddImage(Program.Directory + "\TextBubble.png") TextBubble[2] = Shapes.AddImage(Program.Directory + "\TextBubble2.png") HealthBar = Shapes.AddImage(Program.Directory + "\HealthBar.png") CoinBar = Shapes.AddImage(Program.Directory + "\CoinBar.png") Mushroom = Shapes.AddImage(Program.Directory + "\Mushroom.png") POW = Shapes.AddImage(Program.Directory + "\POWBlock.png") SMushroom = Shapes.AddImage(Program.Directory + "\SuperMushroom.png") EMushroom = Shapes.AddImage(Program.Directory + "\EmergencyMushroom.png") Frankly = Shapes.AddImage(Program.Directory + "\Frankly.png") GraphicsWindow.FontSize = 36 GraphicsWindow.FontBold = "True" GraphicsWindow.BrushColor = "White" ItemPurchased = Shapes.AddText("Item Purchased!") GraphicsWindow.FontBold = "False" GraphicsWindow.FontSize = 12 Shapes.Move(ItemPurchased,400,200) Shapes.SetOpacity(ItemPurchased,0) GraphicsWindow.BrushColor = "Black" Transition = Shapes.AddRectangle(1000,800) Shapes.SetOpacity(Transition,0) '============================================================= 'RougePort Image GraphicsWindow.DrawResizedImage(Program.Directory + "\MainTown.png",0,0,1000,800) 'HIDES ALL MARIO SPRITES '============================================================= Shapes.HideShape(MarioStand) Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioDead) Shapes.HideShape(MarioDuck) For x = 1 To 7 Shapes.HideShape(MarioHammer[x]) EndFor For x = 1 To 4 Shapes.HideShape(MarioWalk[x]) Shapes.HideShape(MarioWalkFlip[x]) EndFor For x = 1 To 2 Shapes.HideShape(MarioJump[x]) Shapes.HideShape(MarioJumpFlip[x]) Shapes.HideShape(TextBubble[x]) EndFor For x = 1 To 3 Shapes.HideShape(MarioHit[x]) EndFor Shapes.HideShape(Mushroom) Shapes.HideShape(EMushroom) Shapes.HideShape(POW) Shapes.HideShape(SMushroom) Shapes.HideShape(Frankly) '============================================================= 'Coordinates for Mario '============ MarioX = 475 MarioY = 600 '============ 'VARIABLE SETTING '============ CanMove = "True" Orientation = "Right" Area = "RougePort" VertMove = "True" EnteredGoombaHouse = "False" Health = 20 Coins = 999 AmtEmergencyMushroom = 0 AmtMushroom = 0 AmtSuperMushroom = 0 AmtPOWBlock = 0 Dialouge = "False" '============ 'Shows Mario initally standing '============ Shapes.ShowShape(MarioStand) Shapes.Move(MarioStand,MarioX,MarioY) '============ 'HUD '============ Shapes.Move(HealthBar,0,0) Shapes.Move(CoinBar,871,0) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 16 TotalHealth = Shapes.AddText(Health + " / 20") CoinTotal = Shapes.AddText(Coins) Shapes.Move(CoinTotal,965,10) Shapes.Move(TotalHealth,55,10) '============ 'ALL EVENTS '============================================================= GraphicsWindow.KeyDown = MarioMove GraphicsWindow.KeyUp = MarioStop While "True" TextWindow.WriteLine(MarioX + "," + MarioY) Boundries() EndWhile '============================================================= Sub MarioMove If CanMove = "True" And GraphicsWindow.LastKey = "Right" Then Orientation = "Right" For ForVar = 1 To 20 CanMove = "False" MarioX = MarioX + 0.4 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalk[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalk[1]) Program.Delay(1) EndFor For ForVar = 1 To 20 MarioX = MarioX + 0.4 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalk[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalk[2]) Program.Delay(1) EndFor For ForVar = 1 To 20 MarioX = MarioX + 0.4 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalk[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalk[3]) Program.Delay(1) EndFor For ForVar = 1 To 20 MarioX = MarioX + 0.4 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalk[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalk[4]) Program.Delay(1) EndFor CanMove = "True" EndIf If CanMove = "True" And VertMove = "True" And GraphicsWindow.LastKey = "Up" Then CanMove = "False" If Orientation = "Right" Then For ForVar = 1 To 20 MarioY= MarioY - 0.2 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalk[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalk[1]) Program.Delay(1) EndFor For ForVar = 1 To 20 MarioY = MarioY - 0.2 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalk[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalk[2]) Program.Delay(1) EndFor For ForVar = 1 To 20 MarioY = MarioY - 0.2 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalk[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalk[3]) Program.Delay(1) EndFor For ForVar = 1 To 20 MarioY = MarioY - 0.2 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalk[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalk[4]) Program.Delay(1) EndFor EndIf If Orientation = "Left" Then For ForVar = 1 To 20 MarioY = MarioY - 0.2 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalkFlip[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalkFlip[1]) Program.Delay(1) EndFor For ForVar = 1 To 20 MarioY = MarioY - 0.2 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalkFlip[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalkFlip[2]) Program.Delay(1) EndFor For ForVar = 1 To 20 MarioY = MarioY - 0.2 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalkFlip[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalkFlip[3]) Program.Delay(1) EndFor For ForVar = 1 To 20 MarioY = MarioY - 0.2 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalkFlip[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalkFlip[4]) Program.Delay(1) EndFor EndIf CanMove = "True" EndIf If CanMove = "True" And VertMove = "True" And GraphicsWindow.LastKey = "Down" Then CanMove = "False" If Orientation = "Right" Then For ForVar = 1 To 20 MarioY= MarioY + 0.2 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalk[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalk[1]) Program.Delay(1) EndFor For ForVar = 1 To 20 MarioY = MarioY + 0.2 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalk[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalk[2]) Program.Delay(1) EndFor For ForVar = 1 To 20 MarioY = MarioY + 0.2 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalk[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalk[3]) Program.Delay(1) EndFor For ForVar = 1 To 20 MarioY = MarioY + 0.2 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalk[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalk[4]) Program.Delay(1) EndFor EndIf If Orientation = "Left" Then For ForVar = 1 To 20 MarioY = MarioY + 0.2 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalkFlip[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalkFlip[1]) Program.Delay(1) EndFor For ForVar = 1 To 20 MarioY = MarioY + 0.2 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalkFlip[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalkFlip[2]) Program.Delay(1) EndFor For ForVar = 1 To 20 MarioY = MarioY + 0.2 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalkFlip[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalkFlip[3]) Program.Delay(1) EndFor For ForVar = 1 To 20 MarioY = MarioY + 0.2 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalkFlip[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalkFlip[4]) Program.Delay(1) EndFor EndIf CanMove = "True" EndIf If CanMove = "True" And GraphicsWindow.LastKey = "Left" Then Orientation = "Left" CanMove = "False" For ForVar = 1 To 20 MarioX = MarioX - 0.4 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalkFlip[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalkFlip[1]) Program.Delay(1) EndFor For ForVar = 1 To 20 MarioX = MarioX - 0.4 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalkFlip[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalkFlip[2]) Program.Delay(1) EndFor For ForVar = 1 To 20 MarioX = MarioX - 0.4 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalkFlip[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalkFlip[3]) Program.Delay(1) EndFor For ForVar = 1 To 20 MarioX = MarioX - 0.4 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) For x = 1 To 4 Shapes.Move(MarioWalkFlip[x],MarioX,MarioY) EndFor Shapes.ShowShape(MarioWalkFlip[4]) Program.Delay(1) EndFor CanMove = "True" EndIf If CanMove = "True" And GraphicsWindow.LastKey = "Space" Then CanMove = "False" If Orientation = "Right" Then For ForVar = 1 To 40 MarioY= MarioY - 1 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) Shapes.Move(MarioJump[1],MarioX,MarioY) Shapes.Move(MarioJumpFlip[1],MarioX,MarioY) Shapes.Move(MarioJump[2],MarioX,MarioY) Shapes.Move(MarioJumpFlip[2],MarioX,MarioY) Shapes.ShowShape(MarioJump[1]) Program.Delay(1) EndFor For ForVar = 1 To 40 MarioY = MarioY + 1 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJumpFlip[2]) Shapes.Move(MarioJump[1],MarioX,MarioY) Shapes.Move(MarioJumpFlip[1],MarioX,MarioY) Shapes.Move(MarioJump[2],MarioX,MarioY) Shapes.Move(MarioJumpFlip[2],MarioX,MarioY) Shapes.ShowShape(MarioJump[2]) Program.Delay(1) EndFor EndIf If Orientation = "Left" Then For ForVar = 1 To 40 MarioY = MarioY - 1 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioJumpFlip[2]) Shapes.Move(MarioJump[1],MarioX,MarioY) Shapes.Move(MarioJumpFlip[1],MarioX,MarioY) Shapes.Move(MarioJump[2],MarioX,MarioY) Shapes.Move(MarioJumpFlip[2],MarioX,MarioY) Shapes.ShowShape(MarioJumpFlip[1]) Program.Delay(1) EndFor For ForVar = 1 To 40 MarioY = MarioY + 1 Shapes.HideShape(MarioStandFlip) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJump[2]) Shapes.Move(MarioJump[1],MarioX,MarioY) Shapes.Move(MarioJumpFlip[1],MarioX,MarioY) Shapes.Move(MarioJump[2],MarioX,MarioY) Shapes.Move(MarioJumpFlip[2],MarioX,MarioY) Shapes.ShowShape(MarioJumpFlip[2]) Program.Delay(1) EndFor EndIf CanMove = "True" EndIf EndSub Sub MarioStop Shapes.Move(MarioStand,MarioX,MarioY) Shapes.HideShape(MarioDead) Shapes.HideShape(MarioDuck) Shapes.HideShape(MarioHammer[1]) Shapes.HideShape(MarioHammer[2]) Shapes.HideShape(MarioHammer[3]) Shapes.HideShape(MarioHammer[4]) Shapes.HideShape(MarioHammer[5]) Shapes.HideShape(MarioHammer[6]) Shapes.HideShape(MarioHammer[7]) Shapes.HideShape(MarioHit[1]) Shapes.HideShape(MarioHit[2]) Shapes.HideShape(MarioHit[3]) Shapes.HideShape(MarioJump[1]) Shapes.HideShape(MarioJump[2]) Shapes.HideShape(MarioWalk[1]) Shapes.HideShape(MarioWalk[2]) Shapes.HideShape(MarioWalk[3]) Shapes.HideShape(MarioWalk[4]) Shapes.HideShape(MarioWalkFlip[1]) Shapes.HideShape(MarioWalkFlip[2]) Shapes.HideShape(MarioWalkFlip[3]) Shapes.HideShape(MarioWalkFlip[4]) Shapes.HideShape(MarioJumpFlip[1]) Shapes.HideShape(MarioJumpFlip[2]) Shapes.HideShape(MarioStand) Shapes.HideShape(MarioStandFlip) If Orientation = "Right" Then Shapes.ShowShape(MarioStand) Shapes.Move(MarioStand,MarioX,MarioY) ElseIf Orientation = "Left" Then Shapes.ShowShape(MarioStandFlip) Shapes.Move(MarioStandFlip,MarioX,MarioY) Else Shapes.ShowShape(MarioStand) Shapes.Move(MarioStand,MarioX,MarioY) EndIf EndSub Sub Boundries If Area = "RougePort" Then 'ROUGEPORT BOUNDRIES '============================= If MarioY < 450 Then MarioY = 460 EndIf If MarioY > 675 Then MarioY = 665 EndIf If MarioX < 390 And MarioY < 495 Then MarioX = 400 EndIf If MarioX > 545 And MarioY < 495 Then MarioX = 535 EndIf If MarioY < 500 And MarioX > 565 Or MarioY < 500 And MarioX < 370 Then MarioY = 510 EndIf If MarioX < 0 Then MarioX = 0 EndIf '============================= 'IF A ROOM IS ENTERED '============================= If MarioX > 300 And MarioX < 355 And MarioY > 500 And MarioY < 520 Then Area = "Shop1" CanMove = "False" TransitionNeeded = "True" Transitions() Program.Delay(100) EndIf If MarioX > 590 And MarioX < 655 And MarioY > 500 And MarioY < 520 Then Area = "Goomba" CanMove = "False" TransitionNeeded = "True" Transitions() Program.Delay(100) EndIf If MarioX > 950 Then Area = "Screen2" CanMove = "False" TransitionNeeded = "True" Transitions() Program.Delay(100) EndIf EndIf If Area = "Shop1" Then If MarioX < 30 Then Area = "RougePort" CanMove = "False" TransitionNeeded = "True" Transitions() Program.Delay(100) EndIf If MarioX > 200 and Dialouge = "False" Then Dialouge = "True" CanMove = "False" Shapes.ShowShape(TextBubble[1]) Shapes.ShowShape(TextBubble[2]) Shapes.Move(TextBubble[1],370,250) Shapes.Move(TextBubble[2],600,400) GraphicsWindow.FontSize = 12 GraphicsWindow.BrushColor = "Black" ShopText1 = Shapes.AddText("Hello Sir! Welcome to the Shop, hope you find something you like!") ShopText6 = Shapes.AddText("ALL DONE") ShopText7 = Shapes.AddText("CLICK ON ITEMS TO BUY THEM") GraphicsWindow.FontSize = 10 ShopText2 = Shapes.AddText("Mushroom: Heals 5 HP - Cost: 5 Coins - You own: " + AmtMushroom) ShopText3 = Shapes.AddText("Super Mushroom: Heals 20 HP - Cost: 20 Coins - You own: " + AmtSuperMushroom) ShopText4 = Shapes.AddText("Emergency Mushroom: Auto Heals 5 HP when you're health is low - Cost: 15 Coins - You own: " + AmtEmergencyMushroom) ShopText5 = Shapes.AddText("POW Block: Deals 10 HP Damage to all Enemies - Cost: 15 Coins - You own: " + AmtPOWBlock) Shapes.Move(ShopText1,400,280) Shapes.Move(ShopText2,410,300) Shapes.Move(ShopText3,410,320) Shapes.Move(ShopText4,410,340) Shapes.Move(ShopText5,410,360) Shapes.Move(ShopText6,700,380) Shapes.Move(ShopText7,440,380) Shapes.ShowShape(Mushroom) Shapes.ShowShape(SMushroom) Shapes.ShowShape(EMushroom) Shapes.ShowShape(POW) Shapes.Move(Mushroom,380,300) Shapes.Move(SMushroom,380,320) Shapes.Move(EMushroom,380,340) Shapes.Move(POW,380,360) While Dialouge = "True" CanMove = "False" If Mouse.IsLeftButtonDown then If GraphicsWindow.MouseX >370 and GraphicsWindow.MouseX < 675 and GraphicsWindow.MouseY > 290 and GraphicsWindow.MouseY < 310 and Coins >= 5 then AmtMushroom = AmtMushroom + 1 Coins = Coins - 5 Shapes.SetOpacity(ItemPurchased,100) Program.Delay(1000) Shapes.SetOpacity(ItemPurchased,0) Elseif GraphicsWindow.MouseX >370 and GraphicsWindow.MouseX < 720 and GraphicsWindow.MouseY > 310 and GraphicsWindow.MouseY < 330 and Coins >= 20 then AmtSuperMushroom = AmtSuperMushroom + 1 Coins = Coins - 20 Shapes.SetOpacity(ItemPurchased,100) Program.Delay(1000) Shapes.SetOpacity(ItemPurchased,0) Elseif GraphicsWindow.MouseX >370 and GraphicsWindow.MouseX < 890 and GraphicsWindow.MouseY > 330 and GraphicsWindow.MouseY < 355 and Coins >= 15 then AmtEmergencyMushroom = AmtEmergencyMushroom + 1 Coins = Coins - 15 Shapes.SetOpacity(ItemPurchased,100) Program.Delay(1000) Shapes.SetOpacity(ItemPurchased,0) Elseif GraphicsWindow.MouseX >370 and GraphicsWindow.MouseX < 800 and GraphicsWindow.MouseY > 355 and GraphicsWindow.MouseY < 375 and Coins >= 15 then AmtPOWBlock = AmtPOWBlock + 1 Coins = Coins - 15 Shapes.SetOpacity(ItemPurchased,100) Program.Delay(1000) Shapes.SetOpacity(ItemPurchased,0) EndIf If GraphicsWindow.MouseX > 690 and GraphicsWindow.MouseX < 770 and GraphicsWindow.MouseY > 375 and GraphicsWindow.MouseY < 400 then Dialouge = "False" Area = "RougePort" TransitionNeeded = "True" Transitions() CanMove = "True" Shapes.HideShape(TextBubble[1]) Shapes.HideShape(TextBubble[2]) Shapes.HideShape(ShopText1) Shapes.HideShape(ShopText2) Shapes.HideShape(ShopText3) Shapes.HideShape(ShopText4) Shapes.HideShape(ShopText5) Shapes.HideShape(ShopText6) Shapes.HideShape(ShopText7) Shapes.HideShape(CoinTotal) Shapes.HideShape(POW) Shapes.HideShape(Mushroom) Shapes.HideShape(SMushroom) Shapes.HideShape(EMushroom) GraphicsWindow.BrushColor = "Black" CoinTotal = (Coins) Shapes.ShowShape(CoinTotal) Shapes.Move(CoinTotal,965,10) EndIf EndIf Endwhile EndIf EndIf If Area = "Goomba" Then If MarioX > 900 then MarioX = 890 EndIf If MarioX > 200 and Dialouge = "False" then Dialouge = "True" CanMove = "False" Shapes.ShowShape(TextBubble[1]) Shapes.ShowShape(TextBubble[2]) Shapes.Move(TextBubble[1],370,250) Shapes.Move(TextBubble[2],600,400) EndIf If MarioX < 30 Then Area = "RougePort" CanMove = "False" Dialouge = "True" TransitionNeeded = "True" Transitions() Shapes.HideShape(Frankly) Shapes.HideShape(TextBubble[1]) Shapes.HideShape(TextBubble[2]) Program.Delay(100) Dialouge = "False" EndIf EndIf If Area = "Screen2" then If MarioY > 740 Then MarioY = 730 EndIf If MarioY < 500 Then MarioY = 510 EndIf If MarioX > 600 And MarioY < 570 And MarioY > 560 Then MarioY = 580 EndIf If MarioY < 560 And MarioX > 600 Then MarioX = 590 EndIf If MarioX > 920 Then Area = "Screen3" CanMove = "False" TransitionNeeded = "True" Transitions() Program.Delay(100) EndIf If MarioX < 30 then Area = "RougePort" CanMove = "False" TransitionNeeded = "True" Transitions() Program.Delay(100) EndIf EndIf EndSub Sub Transitions If TransitionNeeded = "True" Then If Area = "RougePort" Then MarioX = 475 MarioY = 600 EndIf If Area = "Shop1" Then MarioX = 50 MarioY = 490 EndIf If Area = "Goomba" Then MarioX = 50 MarioY = 490 EndIf If Area = "Screen2" Then MarioX = 50 MarioY = 650 EndIf If Area = "Screen3" Then MarioX = 50 MarioY = 650 EndIf Shapes.SetOpacity(Transition,10) Program.Delay(100) Shapes.SetOpacity(Transition,20) Program.Delay(100) Shapes.SetOpacity(Transition,30) Program.Delay(100) Shapes.SetOpacity(Transition,40) Program.Delay(100) Shapes.SetOpacity(Transition,50) Program.Delay(100) Shapes.SetOpacity(Transition,60) Program.Delay(100) Shapes.SetOpacity(Transition,70) Program.Delay(100) Shapes.SetOpacity(Transition,80) Program.Delay(100) Shapes.SetOpacity(Transition,90) Program.Delay(100) Shapes.SetOpacity(Transition,100) If Area = "RougePort" Then GraphicsWindow.DrawResizedImage(Program.Directory + "\MainTown.png",0,0,1000,800) VertMove = "True" Shapes.Move(MarioStand,MarioX,MarioY) Shapes.Move(MarioStandFlip,MarioX,MarioY) Shapes.HideShape(CoinTotal) Shapes.HideShape(TotalHealth) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 16 TotalHealth = Shapes.AddText(Health + " / 20") CoinTotal = Shapes.AddText(Coins) Shapes.Move(CoinTotal,965,10) Shapes.Move(TotalHealth,55,10) Shapes.ShowShape(TotalHealth) Shapes.ShowShape(CoinTotal) MarioX = 475 MarioY = 600 Shapes.Zoom(MarioStand,1,1) Shapes.Zoom(MarioStandFlip,1,1) For x = 1 To 4 Shapes.Zoom(MarioWalk[x],1,1) Shapes.Zoom(MarioWalkFlip[x],1,1) EndFor For x = 1 To 2 Shapes.Zoom(MarioJump[x],1,1) Shapes.Zoom(MarioJumpFlip[x],1,1) EndFor EndIf If Area = "Shop1" Then GraphicsWindow.DrawResizedImage(Program.Directory + "\Shop1.png",0,0,1000,800) VertMove = "False" Shapes.Move(MarioStand,MarioX,MarioY) Shapes.Move(MarioStandFlip,MarioX,MarioY) MarioX = 50 MarioY = 550 Shapes.HideShape(CoinTotal) Shapes.HideShape(TotalHealth) GraphicsWindow.BrushColor = "White" GraphicsWindow.FontSize = 16 TotalHealth = Shapes.AddText(Health + " / 20") CoinTotal = Shapes.AddText(Coins) Shapes.Move(CoinTotal,965,10) Shapes.Move(TotalHealth,55,10) Shapes.ShowShape(TotalHealth) Shapes.ShowShape(CoinTotal) Shapes.Zoom(MarioStand,3,3) Shapes.Zoom(MarioStandFlip,3,3) For x = 1 To 4 Shapes.Zoom(MarioWalk[x],3,3) Shapes.Zoom(MarioWalkFlip[x],3.01,3.01) EndFor For x = 1 To 2 Shapes.Zoom(MarioJump[x],3,3) Shapes.Zoom(MarioJumpFlip[x],3,3) EndFor EndIf If Area = "Goomba" Then GraphicsWindow.DrawResizedImage(Program.Directory + "\FranklysHouse.jpg",0,0,1000,800) Shapes.ShowShape(Frankly) Shapes.Zoom(Frankly,3,3) Shapes.Move(Frankly,600,550) Shapes.Move(MarioStand,MarioX,MarioY) Shapes.Move(MarioStandFlip,MarioX,MarioY) VertMove = "False" MarioX = 50 MarioY = 490 Shapes.HideShape(CoinTotal) Shapes.HideShape(TotalHealth) GraphicsWindow.BrushColor = "White" GraphicsWindow.FontSize = 16 TotalHealth = Shapes.AddText(Health + " / 20") CoinTotal = Shapes.AddText(Coins) Shapes.Move(CoinTotal,965,10) Shapes.Move(TotalHealth,55,10) Shapes.ShowShape(TotalHealth) Shapes.ShowShape(CoinTotal) Shapes.Zoom(MarioStand,3,3) Shapes.Zoom(MarioStandFlip,3,3) For x = 1 To 4 Shapes.Zoom(MarioWalk[x],3,3) Shapes.Zoom(MarioWalkFlip[x],3.01,3.01) EndFor For x = 1 To 2 Shapes.Zoom(MarioJump[x],3,3) Shapes.Zoom(MarioJumpFlip[x],3,3) EndFor EndIf If Area = "Screen2" Then GraphicsWindow.DrawResizedImage(Program.Directory + "\ForestBackground1.jpg",0,0,1000,800) Shapes.Move(MarioStand,MarioX,MarioY) Shapes.Move(MarioStandFlip,MarioX,MarioY) VertMove = "True" Shapes.HideShape(CoinTotal) Shapes.HideShape(TotalHealth) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 16 TotalHealth = Shapes.AddText(Health + " / 20") CoinTotal = Shapes.AddText(Coins) Shapes.Move(CoinTotal,965,10) Shapes.Move(TotalHealth,55,10) Shapes.ShowShape(TotalHealth) Shapes.ShowShape(CoinTotal) Shapes.Zoom(MarioStand,1,1) Shapes.Zoom(MarioStandFlip,1,1) For x = 1 To 4 Shapes.Zoom(MarioWalk[x],1,1) Shapes.Zoom(MarioWalkFlip[x],1,1) EndFor For x = 1 To 2 Shapes.Zoom(MarioJump[x],1,1) Shapes.Zoom(MarioJumpFlip[x],1,1) EndFor EndIf If Area = "Screen3" Then GraphicsWindow.DrawResizedImage(Program.Directory + "\ForestBackground1.jpg",0,0,1000,800) Shapes.Move(MarioStand,MarioX,MarioY) Shapes.Move(MarioStandFlip,MarioX,MarioY) VertMove = "True" Shapes.HideShape(CoinTotal) Shapes.HideShape(TotalHealth) GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 16 TotalHealth = Shapes.AddText(Health + " / 20") CoinTotal = Shapes.AddText(Coins) Shapes.Move(CoinTotal,965,10) Shapes.Move(TotalHealth,55,10) Shapes.ShowShape(TotalHealth) Shapes.ShowShape(CoinTotal) Shapes.Zoom(MarioStand,1,1) Shapes.Zoom(MarioStandFlip,1,1) For x = 1 To 4 Shapes.Zoom(MarioWalk[x],1,1) Shapes.Zoom(MarioWalkFlip[x],1,1) EndFor For x = 1 To 2 Shapes.Zoom(MarioJump[x],1,1) Shapes.Zoom(MarioJumpFlip[x],1,1) EndFor EndIf Program.Delay(100) Shapes.SetOpacity(Transition,90) Program.Delay(100) Shapes.SetOpacity(Transition,80) Program.Delay(100) Shapes.SetOpacity(Transition,70) Program.Delay(100) Shapes.SetOpacity(Transition,60) Program.Delay(100) Shapes.SetOpacity(Transition,50) Program.Delay(100) Shapes.SetOpacity(Transition,40) Program.Delay(100) Shapes.SetOpacity(Transition,30) Program.Delay(100) Shapes.SetOpacity(Transition,20) Program.Delay(100) Shapes.SetOpacity(Transition,10) Program.Delay(100) Shapes.SetOpacity(Transition,0) TransitionNeeded = "False" CanMove = "True" EndIf EndSub End>LTC319.sb< Start>LTC819.sb< 'PRESS F5 OR RUN GraphicsWindow.Show() GraphicsWindow.Title = "StickRPG 2.0" GraphicsWindow.Width =Desktop.Width GraphicsWindow.Height =Desktop.Height - 250 GraphicsWindow.Top = 0 GraphicsWindow.Left = 0 TextWindow.Show() TextWindow.Title = "StickRPG 2.0" TextWindow.BackgroundColor = "Blue" TextWindow.ForegroundColor = "White" TextWindow.WriteLine("Stick RPG- 2.0") TextWindow.WriteLine("Please move the TextWindow into the bottom section of the screen.") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("Instructions:") TextWindow.WriteLine("You control the character by using the Arrow keys.") TextWindow.WriteLine("The blue section of the screen will be your status bar. This is where your Stats (Health, sleep, etc.) will appear.") TextWindow.WriteLine("The white section of the screen will be your game section, where you interact with the game and move your character.") TextWindow.WriteLine("When you are ready,") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("Please type in your character's name CAREFULLY.") name = TextWindow.Read() Textwindow.Pause() TextWindow.Clear() TextWindow.WriteLine("Your character's name is " + name + ", correct?") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("Please type in the color you want your character to be: Red or Blue (exactly how they are written here).") TextWindow.WriteLine("Note: more colors will be avalible later in the game.") co = TextWindow.Read() TextWindow.Pause() TextWindow.Clear() If co = "Red" then color = "Red" Else If co = "Blue" Then color = "Blue" Else TextWindow.WriteLine("your character's color was unrecognized. It will be the default color, Blue.") color = "Blue" TextWindow.Pause() TextWindow.Clear() EndIf EndIf TextWindow.WriteLine("Your character's stats are as follows:") TextWindow.WriteLine("15 strength") TextWindow.WriteLine("10 intelligence") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("Remember, your character's color is " + color + ".") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("Warning: if you too hungry, too thirsty, too tired, or too injured then you will die") TextWindow.Pause() TextWindow.Clear() TextWindow.WriteLine("Press any key to begin.") TextWindow.Pause() drawcity1() Drawcharacter() Timer.Interval = 500 sleep = 3 hunger = 15 strength = 15 AChealth = 10 + strength intellegence = 10 Time = 1 day = 1 death = 1 houseoptions = 0 health = AChealth thirst = 10 sleepnum = 10 money = 100 works = 1 phone = 0 sleepsettings = 0 timedot = 0 Tuition = 0 grade = 9 candystandowned = 0 computer = 0 jail = 0 tv = 0 cdplayer = 0 seconds = 0 minutes = 0 hours = 0 cd1 = 0 gun = 0 ammo = 0 houselevel = 0 losthealth = 0 orangeowned = 0 yellowowned = 0 greenowned = 0 purpleowned = 0 membership = 0 '============================================Events================================================================================================== GraphicsWindow.KeyDown = MoveCycle Controls.ButtonClicked = buttons Timer.Tick = ticker '==========================================Subroutines========================================================================================================================================================================================================================================================================================================================== Sub MoveCycle key= GraphicsWindow.LastKey delX = 0 delY = 0 If (key = "Up") Then delY = -2 ElseIf (key = "W") then delY = -2 ElseIf (key = "Down") Then delY = 2 elseif (key = "S") then delY = 2 ElseIf (key = "Left") Then delX = -2 elseif (key = "A") then delX = -2 ElseIf (key = "Right") Then delX = 2 elseif (key = "D") then delX = 2 EndIf X = Shapes.GetLeft(Character) Y = Shapes.GetTop(Character) Shapes.Move(Character, X + delX, Y + delY) EndSub '========== Sub statsbar TextWindow.Clear() AChealth = 10 + strength TextWindow.WriteLine(" " + name + " Health: " + health + "/" + AChealth + " Money: $" + money + " Sleep: " + sleep + " Hunger: " + hunger + " Thirst: " + thirst + " strength: " + strength + " Intellegence: " + intellegence + " Time: " + Time + " Day " + day + " ") If candystandowned = 1 Then If location = "candy" Then TextWindow.WriteLine("You have " + candies + " candies.") EndIf EndIf timesensor() EndSub '========= Sub pausebuttons timer.Pause() xpause = Shapes.GetLeft(Character) ypause = Shapes.GetTop(Character) GraphicsWindow.Clear() GraphicsWindow.BackgroundColor = white GraphicsWindow.BrushColor = black GraphicsWindow.FontSize = 55 GraphicsWindow.DrawText(50,50,"Pause Menu") GraphicsWindow.DrawLine(50,113,420,113) GraphicsWindow.FontSize = 40 GraphicsWindow.DrawText(50,200,"Intellegence: " + intellegence) GraphicsWindow.DrawText(50,260,"Strength: " + strength) GraphicsWindow.DrawText(50,320,"Money: " + money) GraphicsWindow.DrawText(50,380,"Health: " + health + "/" + AChealth) GraphicsWindow.DrawText(50,440,"Hunger: " + hunger) GraphicsWindow.DrawText(50,500,"Thirst: " + thirst) GraphicsWindow.DrawText(50,560,"Time: " + time) GraphicsWindow.DrawText(50,620,"Day " + day) quitbutton = Controls.AddButton("Quit Game",250,680) Resumebutton = Controls.AddButton("Resume",60,680) EndSub '=========== Sub sleeps If sleepsettings = 0 Then Time = Time + 10 sleep = sleep + 1 If AChealth - health <= 19 Then health = AChealth Else health = health + 20 EndIf ticker() statsbar() houseoptions = 10 home() EndIf EndSub '======== Sub locationsensor If location = "home" Then home() ElseIf location = "outofbounds" then health = health - 10 Shapes.Move(Character,105,105) Elseif location = "mcsticks" then McSticks() elseif location = "highschool" then highschooldot = 0 highschool() elseif location = "candy" then candy() elseif location = "electricstore" then electronicsstore() elseif location = "general store" then generalstoredot = 0 generalstore() elseif location = "teenstore" then teenstore() elseif location = "guns&ammo" then gunsandammunition() elseif location = "houseupgrades" then houseupgrades() elseif location = "hospital" then hospital() elseif location = "clothing" then clothingstore() elseif location = "furniture" then stickfurniture() elseif location = "gym" then gym() EndIf EndSub '========= Sub idied timer.Pause() GraphicsWindow.Clear() GraphicsWindow.Hide() TextWindow.Clear() TextWindow.BackgroundColor = red TextWindow.WriteLine("You played for " + hours + " hours, " + minutes + " minutes, and " + seconds + " seconds.") TextWindow.WriteLine("You died by " + death + ".") TextWindow.WriteLine("Thank you for playing Stick RPG 2.0") Program.Delay(3500) TextWindow.Clear() Textwindow.WriteLine("Credits:") TextWindow.WriteLine("Programmer: Jake Bauer") TextWindow.WriteLine("Animator: Jake Bauer") TextWindow.WriteLine("Writer: Jake Bauer") TextWindow.WriteLine("Stick RPG, Stick RPG Complete, and Stick RPG 2 by XGen Studios") Program.Delay(3500) Program.End() EndSub '========= Sub timesensor If Time > 24 Then Time = Time - 24 day = day + 1 hunger = hunger - 5 thirst = thirst - 2 sleep = sleep - 1 EndIf EndSub '=========== Sub deathsub If health < 0 Then death = "suffering too much damage" idied() elseif thirst < 0 then death = "not drinking enough liquids" idied() elseif hunger < 0 then death = "starving" idied() elseif sleep < 0 then death = "not getting enough sleep" idied() elseif jail = 1 then death = "going to jail for the rest of your life" idied() EndIf EndSub '======== Sub ticker If timedot = 0 Then statsbar() locations() locationsensor() deathsub() timesensor() realtime() ElseIf timedot = 1 then timesensor() statsbar() deathsub() realtime() EndIf If candystandowned = 1 Then candyadd() EndIf EndSub '========== Sub houseleave clear() drawcity1() location = "road" Drawcharacter() locations() Shapes.Move(Character,22,102) Program.Delay(500) timedot = 0 EndSub '=========== Sub Drawcharacter If color = "Red" Then charactercolor = red Elseif color = "Blue" Then charactercolor = blue elseif color = "Orange" Then charactercolor = orange elseif color = "Yellow" then charactercolor = yellow elseif color = "Green" then charactercolor = lime elseif color = "Purple" then charactercolor = purple Else charactercolor = blue EndIf GraphicsWindow.BrushColor = charactercolor Character = Shapes.AddEllipse(15,15) EndSub '========== Sub clear TextWindow.Clear() GraphicsWindow.Clear() EndSub '========== Sub enter timedot = 1 clear() GraphicsWindow.BackgroundColor = white GraphicsWindow.FontSize = 22 GraphicsWindow.BrushColor = blue EndSub '========== Sub realtime seconds = seconds + 1 If seconds >= 60 Then seconds = seconds - 60 minutes = minutes + 1 EndIf if minutes >= 60 Then minutes = minutes - 60 hours = hours + 1 EndIf EndSub '========== Sub candyadd candyaddvariable5 = candyaddvariable5 + 1 If candyaddvariable5 >= 2 Then candyaddvariable5 = candyaddvariable5 - 2 candies = candies + 1 EndIf EndSub '==============================================Objectives================================================================================================================== 'Objective #1: create buttons (using Controls.AddButton) for the current interfaces 'Objectve #2: here is a list of all of the buildings that need/can need to be built: 'college! 'Car store(?) 'dollar store(?) '=========================================Interface=Subs================================================================================================================== Sub home enter() If houseoptions = 0 Then sleepbutton = Controls.AddButton("Sleep (" + sleepnum +" hours)",200,100) kitchenbutton = Controls.AddButton("Enter Kitchen",200,150) leavebutton = Controls.AddButton("Leave House",400,750) officebutton = Controls.AddButton("Enter Office",200,200) livingroom = Controls.AddButton("Enter Living Room",200,250) playmusicroom = Controls.AddButton("Play Music",200,300) changeclothes = Controls.AddButton("Change Clothes/Colors",200,350) If phone = 1 Then messages = Controls.AddButton("Check Messages",300,100) EndIf ElseIf houseoptions = 1 then enterpantry = Controls.AddButton("Check Pantry",200,100) If pbsandwiches>= 1 then eatapbsandwichbutton = Controls.AddButton("Eat a PB&J Sandwich (+10 hunger)",200,150) EndIf If toast>= 1 then eattoastbutton = Controls.AddButton("Eat a Piece of Toast (+2 hunger)",200,200) EndIf leavekitchen = Controls.AddButton("Leave Kitchen",400,750) Elseif houseoptions = 2 then homeworks = Controls.AddButton("Do Homework",200,100) If computer = 1 then computerbutton = Controls.AddButton("Use Computer",200,200) EndIf leaveoffice = Controls.AddButton("Leave Office",400,750) elseif houseoptions = 3 then If tv = 1 then watchtvbutton = Controls.AddButton("Watch TV",200,200) EndIf leavebutton2 = Controls.AddButton("Leave Living Room",400,750) elseif houseoptions = 15 then If breadslices>= 2 then toastbutton = Controls.AddButton("Make a Slice of Toast",200,200) If pbservings>= 1 then If jellyservings>=1 then pbjsandwichbutton = Controls.AddButton("Make A PB&J Sandwich",200,250) EndIf EndIf EndIf leavepantrybutton = Controls.AddButton("Leave Pantry",400,750) elseif houseoptions = 25 then intellegence = intellegence + 1 Time = Time + 1 GraphicsWindow.FontSize = 45 GraphicsWindow.DrawText(200,100,"Intelligence Increased!!!") GraphicsWindow.DrawText(250,150,intellegence) GraphicsWindow.FontSize = 25 homeworkokbutton = Controls.AddButton(" OK ",250,250) elseif houseoptions = 10 then GraphicsWindow.FontSize = 40 GraphicsWindow.DrawText(200,100,"Health Restored!") GraphicsWindow.DrawText(200,150,"Sleep Increased (" + sleep + ")") GraphicsWindow.DrawText(200,200,"Hunger : " + hunger) GraphicsWindow.DrawText(200,250,"Thirst: " + thirst) GraphicsWindow.DrawText(200,300,"Time: " + Time ) GraphicsWindow.DrawText(200,350,"Day " + day) GraphicsWindow.FontSize = 25 okaysleepbutton1 = Controls.AddButton(" OK ",210,450) elseif houseoptions = 4 then If cdplayer = 1 then If cd1 = 1 then cd1playbutton = Controls.AddButton("Play CD #1",200,200) EndIf EndIf leavemusicbutton = Controls.AddButton("Leave",400,750) Elseif houseoptions = 35 then tvchannel1button = Controls.AddButton("Channel 1: News",200,200) tvchannel2button = Controls.AddButton("Channel 2: Bodybuilding",200,250) turnofftvbutton = Controls.AddButton("Turn Off TV",400,750) elseif houseoptions = 351 then intellegence = intellegence + 2 Time = Time + 2 GraphicsWindow.DrawText(200,100,"Intelligence Increased!!!") GraphicsWindow.DrawText(250,150,intellegence) GraphicsWindow.FontSize = 25 okchannel1button = Controls.AddButton("OK",250,250) elseif houseoptions = 352 then strength = strength + 1 Time = Time + 2 GraphicsWindow.DrawText(200,100,"Strength Increased!!!") GraphicsWindow.DrawText(250,150,strength) GraphicsWindow.FontSize = 25 okchannel2button = Controls.AddButton("OK",250,250) elseif houseoptions = 5 then If orangeowned = 1 then changeobutton = Controls.AddButton("Change Into Orange Clothes",200,250) EndIf If yellowowned = 1 then changeybutton = Controls.AddButton("Change Into Yellow Clothes",200,300) EndIf If greenowned = 1 then changegbutton = Controls.AddButton("Change Into Green Clothes",200,350) EndIf If purpleowned = 1 then changepbutton = Controls.AddButton("Change Into Purple Clothes",200,450) EndIf changebbutton = Controls.AddButton("Change Into Blue Clothes",200,400) changerbutton = Controls.AddButton("Change Into Red Clothes",200,200) okclothesbutton = Controls.AddButton("OK",400,750) EndIf EndSub '============== Sub McSticks enter() sodabutton = Controls.AddButton("Buy Soda",200,100) Milkshakebutton = Controls.AddButton("Buy Milkshake",200,175) nuggetsbutton = Controls.AddButton("Buy McNuggets",200,250) friesbutton = Controls.AddButton("Buy Fries",200,325) burgerbutton = Controls.AddButton("Buy Cheeseburger",200,400) workmcbutton = Controls.AddButton("Work (1x)",200,485) leavemcbutton = Controls.AddButton("Leave",400,750) GraphicsWindow.FontSize = 17 GraphicsWindow.DrawText(200,145,"$5, Thirst +2") GraphicsWindow.DrawText(200,220,"$7, Hunger +2, Thirst +2") GraphicsWindow.DrawText(200,295,"$12, Hunger +5") GraphicsWindow.DrawText(200,370,"$10, Hunger +4") GraphicsWindow.DrawText(200,445,"$15, Hunger +10") GraphicsWindow.DrawText(200,530,"($5/Hr.)") EndSub '============= Sub highschool enter() If highschooldot = 0 Then studybutton = Controls.AddButton("Study",200,100) gotoclassbutton = Controls.AddButton("Go to Class ($5 without tuition)",200,150) takeatestbutton = Controls.AddButton("Take A Test",200,200) Tuitionoptionsbutton = Controls.AddButton("Tuition Options",200,250) graduategradebutton = Controls.AddButton("Graduate Grade",200,300) GraphicsWindow.DrawText(200,350,"You are in grade " + grade) leavehighschoolbutton = Controls.AddButton("Leave",200,750) ElseIf highschooldot = 1 then intellegence = intellegence + 1 Time = Time + 1 GraphicsWindow.FontSize = 45 GraphicsWindow.DrawText(200,100,"Intelligence Increased!!!") GraphicsWindow.DrawText(250,150,intellegence) GraphicsWindow.FontSize = 25 okstudybutton = Controls.AddButton(" OK ",250,250) elseif highschooldot = 2 then If Tuition = 0 then money = money - 5 intellegence = intellegence + 2 Time = Time + 1 elseif Tuition = 1 then intellegence = intellegence + 2 Time = Time + 1 endif GraphicsWindow.DrawText(200,100,"Intelligence Increased!!!") GraphicsWindow.DrawText(250,150,intellegence) GraphicsWindow.DrawText(250,200,"You have $" + money) okayclassbutton = Controls.AddButton(" OK ",250,250) elseif highschooldot = 3 then If intellegence < 30 then GraphicsWindow.DrawText(200,100,"Test failed. :-( ") Else GraphicsWindow.DrawText(200,100,"Test passed! You now have a tuition!!!") Tuition = 1 endif okaytestbutton = Controls.AddButton(" OK ",250,250) elseif highschooldot = 4 then If Tuition = 0 then GraphicsWindow.DrawText(200,100,"You can either pass a test (over 30 intelligence) or you can buy one for $30.") GraphicsWindow.DrawText(200,150,"Your intelligence is " + intellegence) takeatest2button = Controls.AddButton("Take a test",200,200) buyatuitionbutton = Controls.AddButton("Buy a tuition",200,250) elseif Tuition = 1 then GraphicsWindow.DrawText(200,100,"You already have a tuition.") EndIf okaytuitionoptionsbutton = Controls.AddButton(" OK ",250,350) elseif highschooldot = 5 then GraphicsWindow.DrawText(200,200,"You are in grade " + grade) GraphicsWindow.DrawText(200,250,"You can gradutate/advance a grade by taking a graduation test. You must have a certain number of intelligence:") GraphicsWindow.DrawText(200,300,"9 => 10: 50 intelligence.") GraphicsWindow.DrawText(200,350,"10 => 11: 75 intelligence.") GraphicsWindow.DrawText(200,400,"11 => 12: 100 intelligence.") GraphicsWindow.DrawText(200,450,"12 => Graduated: 150 intelligence.") takegraduationtestbutton = Controls.AddButton("Take graduation/advancement test",200,500) okaygraduationbutton = Controls.AddButton("OK",200,750) Elseif highschooldot = 6 then If grade = 9 then If intellegence > 49 then GraphicsWindow.DrawText(200,200,"Test passed! You are now in 10th grade!") grade = 10 Else GraphicsWindow.DrawText(200,200,"Test failed. :-( ") EndIf elseIf grade = 10 then If intellegence > 74 then GraphicsWindow.DrawText(200,200,"Test passed! You are now in 11th grade!") grade = 11 Else GraphicsWindow.DrawText(200,200,"Test failed. :-( ") EndIf elseIf grade = 11 then If intellegence > 99 then GraphicsWindow.DrawText(200,200,"Test passed! You are now in 12th grade!") grade = 12 Else GraphicsWindow.DrawText(200,200,"Test failed. :-( ") EndIf elseIf grade = 12 then If intellegence > 149 then GraphicsWindow.DrawText(200,200,"Test passed! You are now graduated!") grade = 13 Else GraphicsWindow.DrawText(200,200,"Test failed. :-( ") EndIf EndIf okaygraduationtestbutton = Controls.AddButton("OK",200,250) EndIf EndSub '============= Sub candy enter() Buyalollipopbutton = Controls.AddButton("Buy a Lollipop ($2, Hunger +2)",200,200) If candystandowned = 1 Then workatthhecandystandbutton = Controls.AddButton("Work at the Candy Stand ($10/hr.)",200,250) Else buythecandyshopscandystandbutton = Controls.AddButton("Buy The Candy Shop's Candy Stand ($500, $10/hour)",200,250) EndIf leavecandybutton = Controls.AddButton("Leave",250,750) EndSub '============= Sub electronicsstore enter() If computer = 0 Then buycomputerbutton = Controls.AddButton("Buy a Computer ($1000)",200,200) EndIf If tv = 0 then buytvbutton = Controls.AddButton("Buy a TV ($500)",200,250) EndIf If phone = 0 Then buyaphonebutton = Controls.AddButton("Buy a Phone ($100)",200,300) EndIf If cdplayer = 0 Then buyacdplayerbutton = Controls.AddButton("Buy a CD Player ($50)",200,350) EndIf leaveelectronicsstorebutton = Controls.AddButton("Leave",250,750) EndSub '============= Sub generalstore enter() If generalstoredot = 0 Then aisle1button = Controls.AddButton("Aisle 1: Food",200,200) aisle2button = Controls.AddButton("Aisle 2: Drinks",200,250) aisle3button = Controls.AddButton("Aisle 3: Other",200,300) leavegeneralstorebutton = Controls.AddButton("Leave",400,750) If gun = 1 Then If ammo >= 20 Then robstorebutton = Controls.AddButton("Rob the Store",200,700) EndIf EndIf ElseIf generalstoredot = 1 then buybreadbutton = Controls.AddButton("Buy a Loaf of Bread ($20, 10 slices)",200,200) aisle1leavebutton = Controls.AddButton("Leave Aisle",400,750) Elseif generalstoredot = 2 then aisle2leavebutton = Controls.AddButton("Leave Aisle",400,750) elseif generalstoredot = 3 then buypeanutbutterbutton = Controls.AddButton("Buy a Jar of Peanut Butter ($5, 10 servings)",200,200) buyjellybutton= Controls.AddButton("Buy a Jar of Jelly ($5, 10 servings)",200,250) aisle3leavebutton = Controls.AddButton("Leave Aisle",400,750) EndIf EndSub '============= Sub teenstore enter() If cd1 = 0 Then buycd1button = Controls.AddButton("Buy CD #1 ($10)",200,200) EndIf leaveteenstorebutton = Controls.AddButton("Leave",400,750) EndSub '============= Sub gunsandammunition enter() If gun = 0 then buyagun = Controls.AddButton("Buy a Handgun ($200)",200,200) Else buyammobutton = Controls.AddButton("Buy 10x Ammo ($5)",200,200) EndIf leavegunstorebutton = Controls.AddButton("Leave",400,750) EndSub '============= Sub houseupgrades enter() If houselevel = 0 Then housetocondobutton = Controls.AddButton("Upgrade House => Condo ($1500)",200,200) ElseIf houselevel = 1 then condotomansion = Controls.AddButton("Upgrade Condo => Mansion ($2000)",200,200) elseif houselevel = 2 then mansiontocastlebutton = Controls.AddButton("Upgrade Mansion => Castle ($3000)",200,200) EndIf leavehouseupgradestore = Controls.AddButton("Leave",400,750) EndSub '============= Sub hospital enter() If health < AChealth Then healbutton = Controls.AddButton("Heal ($1/hp)",200,200) EndIf leavehospitalbutton = Controls.AddButton("Leave",400,750) EndSub '============= Sub clothingstore enter() If orangeowned = 0 Then buyorangebutton = Controls.AddButton("Buy Orange Suit ($20)",200,200) EndIf If yellowowned = 0 Then buyyellowbutton = Controls.AddButton("Buy Yellow Suit ($20)",200,250) EndIf If greenowned = 0 Then buygreenbutton = Controls.AddButton("Buy Green Suit ($20)",200,300) EndIf If purpleowned = 0 Then buypurplebutton = Controls.AddButton("Buy Purple Suit ($20)",200,350) EndIf leaveclothingstorebutton = Controls.AddButton("Leave",400,750) EndSub '============= Sub stickfurniture enter() if houselevel = 1 Then EndIf if houselevel = 2 Then EndIf if houselevel = 3 Then EndIf leavefurniturebutton = Controls.AddButton("Leave",400,750) EndSub '============= Sub gym enter() If membership = 0 Then buymembershipbutton = Controls.AddButton("Buy Membership ($20)",200,200) Else Workoutbutton = Controls.AddButton("Work Out! (2 strength/hr.)",200,200) EndIf leavegymbutton = Controls.AddButton("Leave",400,750) EndSub '============= '==================================Long=Subs===================================================================================================== sub buttons lastbutton = Controls.LastClickedButton GraphicsWindow.BrushColor = blue If lastbutton = pausebutton Then pausebuttons() ElseIf lastbutton = quitbutton then Program.Delay(500) Program.End() ElseIf lastbutton = sleepbutton then sleeps() elseif lastbutton = kitchenbutton then houseoptions = 1 home() elseif lastbutton = leavebutton then houseleave() elseif lastbutton = leavekitchen then houseoptions = 0 home() elseif lastbutton = livingroom then houseoptions = 3 home() elseif lastbutton = officebutton then houseoptions = 2 home() elseif lastbutton = leaveoffice then houseoptions = 0 home() Elseif lastbutton = leavebutton2 then houseoptions = 0 home() elseif lastbutton = Resumebutton then drawcity1() Drawcharacter() Shapes.Move(Character,xpause,ypause) timer.Resume() elseif lastbutton = homeworks then houseoptions = 25 home() elseif lastbutton = homeworkokbutton then houseoptions = 2 home() elseif lastbutton = okaysleepbutton1 then houseoptions = 0 home() Elseif lastbutton = enterpantry then houseoptions = 15 home() Elseif lastbutton = sodabutton then If money >= 5 then money = money - 5 thirst = thirst + 2 EndIf elseif lastbutton = Milkshakebutton then If money >= 7 then money = money - 7 thirst = thirst + 2 hunger = hunger + 2 EndIf elseif lastbutton = nuggetsbutton then if money>= 12 then money = money - 12 hunger = hunger + 5 EndIf elseif lastbutton = friesbutton then If money >= 10 then money = money - 10 hunger = hunger + 4 EndIf elseif lastbutton = burgerbutton then if money >= 15 then money = money - 15 hunger = hunger + 10 EndIf elseif lastbutton = workmcbutton then money = money + 6 Time = Time + 1 Elseif lastbutton = leavemcbutton then clear() drawcity1() location = "road" Drawcharacter() locations() Shapes.Move(Character,72,102) Program.Delay(500) timedot = 0 elseif lastbutton = leavehighschoolbutton then clear() drawcity1() location = "road" Drawcharacter() locations() Shapes.Move(Character,100,170) timedot = 0 elseif lastbutton = studybutton then highschooldot = 1 highschool() elseif lastbutton = gotoclassbutton then highschooldot = 2 highschool() elseif lastbutton = takeatestbutton then highschooldot= 3 highschool() elseif lastbutton = Tuitionoptionsbutton then highschooldot = 4 highschool() elseif lastbutton = okstudybutton then highschooldot = 0 highschool() elseif lastbutton = okayclassbutton then highschooldot = 0 highschool() elseif lastbutton = okaytestbutton then highschooldot = 0 highschool() elseif lastbutton = okaytuitionoptionsbutton then highschooldot = 0 highschool() elseif lastbutton = takeatest2button then highschooldot= 3 highschool() elseif lastbutton = buyatuitionbutton then if money >= 30 then If Tuition = 0 then money = money - 30 Tuition = 1 highschooldot = 4 highschool() EndIf EndIf elseif lastbutton = graduategradebutton then highschooldot = 5 highschool() elseif lastbutton = okaygraduationbutton then highschooldot = 0 highschool() elseif lastbutton = takegraduationtestbutton then highschooldot = 6 highschool() elseif lastbutton = okaygraduationtestbutton then highschooldot = 0 highschool() elseif lastbutton = leavecandybutton then clear() drawcity1() Drawcharacter() locations() Shapes.Move(Character,105,190) location = "Road" timedot = 0 elseif lastbutton = Buyalollipopbutton then If money>= 2 then money = money - 2 hunger = hunger + 2 EndIf elseif lastbutton = buythecandyshopscandystandbutton then If money>= 500 then money = money - 500 candystandowned = 1 candy() EndIf elseif lastbutton = workatthhecandystandbutton then money = money + 10 Time = Time + 1 elseif lastbutton = buycomputerbutton then If money>= 1000 then money = money - 1000 computer = 1 electronicsstore() EndIf elseif lastbutton = buytvbutton then If money >= 500 then money = money - 500 tv = 1 electronicsstore() EndIf elseif lastbutton = leaveelectronicsstorebutton then clear() drawcity1() location = "road" Drawcharacter() locations() Shapes.Move(Character,102,280) timedot = 0 elseif lastbutton = buyacdplayerbutton then If money>= 50 then money = money - 50 cdplayer = 1 electronicsstore() EndIf elseif lastbutton = playmusicroom then houseoptions = 4 home() Elseif lastbutton = leavemusicbutton then houseoptions = 0 home() elseif lastbutton = leavegeneralstorebutton then clear() drawcity1() location = "road" Drawcharacter() locations() Shapes.Move(Character,222,10) timedot = 0 elseif lastbutton = aisle1button then generalstoredot = 1 generalstore() elseif lastbutton = aisle2button then generalstoredot = 2 generalstore() elseif lastbutton = aisle3button then generalstoredot = 3 generalstore() elseif lastbutton = aisle1leavebutton then generalstoredot = 0 generalstore() elseif lastbutton = aisle2leavebutton then generalstoredot = 0 generalstore() elseif lastbutton = aisle3leavebutton then generalstoredot = 0 generalstore() elseif lastbutton = buybreadbutton then If money>= 20 then money = money - 20 breadslices = breadslices + 10 EndIf elseif lastbutton = buypeanutbutterbutton then If money>= 5 then money = money - 5 pbservings = pbservings + 10 EndIf Elseif lastbutton = buyjellybutton then If money>= 5 then money = money - 5 jellyservings = jellyservings + 10 EndIf elseif lastbutton = leavepantrybutton then houseoptions = 1 home() elseif lastbutton = toastbutton then If breadslices>= 1 then breadslices = breadslices - 1 toast = toast + 1 houseoptions = 15 home() EndIf elseif lastbutton = pbjsandwichbutton then breadslices = breadslices - 2 pbservings = pbservings -1 jellyservings = jellyservings - 1 pbsandwiches = pbsandwiches + 1 houseoptions = 15 home() elseif lastbutton = eatapbsandwichbutton then pbsandwiches = pbsandwiches - 1 hunger = hunger + 10 houseoptions = 1 home() elseif lastbutton = eattoastbutton then toast = toast - 1 hunger = hunger + 2 houseoptions = 1 home() elseif lastbutton = watchtvbutton then houseoptions = 35 home() elseif lastbutton = tvchannel1button then houseoptions = 351 home() elseif lastbutton = okchannel1button then houseoptions = 35 home() elseif lastbutton = tvchannel2button then houseoptions = 352 home() elseif lastbutton = okchannel2button then houseoptions = 35 home() elseif lastbutton = cd1playbutton then Sound.PlayMusic("o5 c2 d8 e4 d4 f4 e4 d8 h8 c4 a4 g4") Sound.PlayMusic("f4 e4 d4 e8 c8 g2") Sound.PlayMusic("c2 d8 e4 d4 f4 e4 d8 h8 c4 a4 g4") Sound.PlayMusic("f4 e4 d4 e8 c8 g2") elseif lastbutton = leaveteenstorebutton then clear() drawcity1() location = "road" Drawcharacter() locations() Shapes.Move(Character,583,540) timedot = 0 elseif lastbutton = buycd1button then If money>= 10 then money = money - 10 cd1 = 1 teenstore() EndIf elseif lastbutton = buyagun then If money >= 200 then money = money - 200 gun = 1 gunsandammunition() endif Elseif lastbutton = buyammobutton then If money>= 5 then money = money - 5 ammo = ammo + 10 gunsandammunition() EndIf elseif lastbutton = robstorebutton then clear() drawcity1() Drawcharacter() Shapes.Move(Character,575,400) jail = 1 Program.Delay(3000) elseif lastbutton = leavegunstorebutton then clear() drawcity1() location = "road" Drawcharacter() locations() Shapes.Move(Character,102,370) timedot = 0 elseif lastbutton = turnofftvbutton then houseoptions = 3 home() elseif lastbutton = leavehouseupgradestore then clear() drawcity1() location = "road" Drawcharacter() locations() Shapes.Move(Character,102,370) timedot = 0 elseif lastbutton = housetocondobutton then If money >= 1500 then money = money - 1500 houselevel = 1 houseupgrades() EndIf elseif lastbutton = condotomansion then If money >= 2000 then money = money - 2000 houselevel = 2 houseupgrades() EndIf elseif lastbutton = leavehospitalbutton then clear() drawcity1() location = "road" Drawcharacter() locations() Shapes.Move(Character,222,160) timedot = 0 elseif lastbutton = healbutton then losthealth = AChealth - health If money >= losthealth then money = money - losthealth health = AChealth EndIf elseif lastbutton = mansiontocastlebutton then If money >= 3000 then money = money - 3000 houselevel = 3 houseupgrades() EndIf elseif lastbutton = leaveclothingstorebutton then clear() drawcity1() location = "road" Drawcharacter() locations() Shapes.Move(Character,462,150) timedot = 0 elseif lastbutton = changeclothes then houseoptions = 5 home() elseif lastbutton = okclothesbutton then houseoptions = 0 home() elseif lastbutton = buyorangebutton then If money >= 20 then money = money - 20 orangeowned = 1 clothingstore() EndIf elseif lastbutton = buyyellowbutton then If money >= 20 then money = money - 20 yellowowned = 1 clothingstore() EndIf elseif lastbutton = buygreenbutton then If money >= 20 then money = money - 20 greenowned = 1 clothingstore() EndIf elseif lastbutton = buypurplebutton then If money >= 20 then money = money - 20 purpleowned = 1 clothingstore() EndIf elseif lastbutton = changerbutton then color = "Red" elseif lastbutton = changeobutton then color = "Orange" elseif lastbutton = changeybutton then color = "Yellow" elseif lastbutton = changegbutton then color = "Green" elseif lastbutton = changebbutton then color = "Blue" elseif lastbutton = changepbutton then color = "Purple" elseif lastbutton = leavefurniturebutton then clear() drawcity1() location = "road" Drawcharacter() locations() Shapes.Move(Character,343,193) timedot = 0 elseif lastbutton = homebutton then Shapes.Move(Character,1,1) elseif lastbutton = leavegymbutton then clear() drawcity1() location = "road" Drawcharacter() locations() Shapes.Move(Character,463,193) timedot = 0 elseif lastbutton = buymembershipbutton then If money >= 20 then money = money - 20 membership = 1 gym() EndIf elseif lastbutton = Workoutbutton then strength = strength + 2 Time = Time + 1 EndIf EndSub '================================================== Sub drawcity1 Drawcharacter() TextWindow.Clear() TextWindow.Title = "Stick RPG 2.0: Stats Bar" GraphicsWindow.Show() GraphicsWindow.Clear() GraphicsWindow.Title = "Stick RPG 2.0: Gameplay area" lime = GraphicsWindow.GetColorFromRGB(0,255,0) red = GraphicsWindow.GetColorFromRGB(255,0,0) yellow = GraphicsWindow.GetColorFromRGB(255,255,0) blue = GraphicsWindow.GetColorFromRGB(0,0,255) silvergray2 = GraphicsWindow.GetColorFromRGB(192,192,255) coffeebrown = GraphicsWindow.GetColorFromRGB(103,78,55) ashgray = GraphicsWindow.GetColorFromRGB(102,99,98) cyan = GraphicsWindow.GetColorFromRGB(0,255,255) movietheaterred = GraphicsWindow.GetColorFromRGB(195,0,0) black = GraphicsWindow.GetColorFromRGB(0,0,0) white = GraphicsWindow.GetColorFromRGB(255,255,255) goldenbrown = GraphicsWindow.GetColorFromRGB(234,193,23) grayrandomcolorthatidontknowwhatisit = GraphicsWindow.GetColorFromRGB(219,218,216) caramelcolor = GraphicsWindow.GetColorFromRGB(184,115,51) white100 = GraphicsWindow.GetColorFromRGB(155,155,155) neonblue = GraphicsWindow.GetColorFromRGB(40,72,234) firebrick = GraphicsWindow.GetColorFromRGB(128,5,23) breadcolor = GraphicsWindow.GetColorFromRGB(255,207,93) woodbrown = GraphicsWindow.GetColorFromRGB(150,111,51) shamrockgreen = GraphicsWindow.GetColorFromRGB(52,124,23) harvestgold = GraphicsWindow.GetColorFromRGB(237,226,117) blue2 = GraphicsWindow.GetColorFromRGB(116,128,237) orange = GraphicsWindow.GetColorFromRGB(255,165,0) purple = GraphicsWindow.GetColorFromRGB(128,0,128) GraphicsWindow.BackgroundColor = lime If houselevel = 0 Then GraphicsWindow.BrushColor = red Shapes.AddTriangle(50,1,1,50,100,50) GraphicsWindow.BrushColor = coffeebrown GraphicsWindow.DrawRectangle(1,50,100,50) GraphicsWindow.FillRectangle(1,50,100,50) GraphicsWindow.BrushColor = red GraphicsWindow.FontSize = 13 GraphicsWindow.DrawText(25,75,"HOME") GraphicsWindow.BrushColor = white GraphicsWindow.DrawRectangle(20,55,20,20) GraphicsWindow.FillRectangle(20,55,20,20) GraphicsWindow.DrawRectangle(50,55,20,20) GraphicsWindow.FillRectangle(50,55,20,20) ElseIf houselevel = 1 then GraphicsWindow.BrushColor = harvestgold GraphicsWindow.DrawEllipse(1,1,100,100) GraphicsWindow.FillEllipse(1,1,100,100) GraphicsWindow.BrushColor = lime GraphicsWindow.DrawRectangle(1,1,100,50) GraphicsWindow.FillRectangle(1,1,100,50) GraphicsWindow.BrushColor = harvestgold GraphicsWindow.DrawRectangle(1,1,20,50) GraphicsWindow.FillRectangle(1,1,20,50) GraphicsWindow.DrawRectangle(80,1,20,50) GraphicsWindow.FillRectangle(80,1,20,50) GraphicsWindow.BrushColor = white GraphicsWindow.DrawRectangle(25,25,20,20) GraphicsWindow.FillRectangle(25,25,20,20) GraphicsWindow.DrawRectangle(55,25,20,20) GraphicsWindow.FillRectangle(55,25,20,20) GraphicsWindow.BrushColor = blue2 GraphicsWindow.FontSize = 13 GraphicsWindow.DrawText(25,75,"CONDO") GraphicsWindow.DrawEllipse(35,55,25,20) GraphicsWindow.FillEllipse(35,55,25,20) elseif houselevel = 2 then GraphicsWindow.BrushColor = silvergray2 GraphicsWindow.DrawRectangle(1,25,100,75) GraphicsWindow.FillRectangle(1,25,100,75) GraphicsWindow.BrushColor = red GraphicsWindow.DrawTriangle(1,24,25,1,50,24) GraphicsWindow.FillTriangle(1,24,25,1,50,24) GraphicsWindow.DrawTriangle(51,24,75,1,100,24) GraphicsWindow.FillTriangle(51,24,75,1,100,24) GraphicsWindow.BrushColor = blue2 GraphicsWindow.DrawText(20,70,"MANSION") GraphicsWindow.BrushColor = white GraphicsWindow.DrawRectangle(25,35,20,20) GraphicsWindow.FillRectangle(25,35,20,20) GraphicsWindow.DrawRectangle(55,35,20,20) GraphicsWindow.FillRectangle(55,35,20,20) elseif houselevel = 3 then GraphicsWindow.BrushColor = grayrandomcolorthatidontknowwhatisit GraphicsWindow.DrawRectangle(1,1,20,20) GraphicsWindow.FillRectangle(1,1,20,20) GraphicsWindow.DrawRectangle(28,1,20,20) GraphicsWindow.FillRectangle(28,1,20,20) GraphicsWindow.DrawRectangle(54,1,20,20) GraphicsWindow.FillRectangle(54,1,20,20) GraphicsWindow.DrawRectangle(81,1,20,20) GraphicsWindow.FillRectangle(81,1,20,20) GraphicsWindow.DrawRectangle(1,20,100,80) GraphicsWindow.FillRectangle(1,20,100,80) GraphicsWindow.BrushColor = white GraphicsWindow.DrawRectangle(20,40,20,20) GraphicsWindow.FillRectangle(20,40,20,20) GraphicsWindow.DrawRectangle(50,40,20,20) GraphicsWindow.FillRectangle(50,40,20,20) GraphicsWindow.BrushColor = black GraphicsWindow.DrawText(25,75,"CASTLE") EndIf GraphicsWindow.BrushColor = white GraphicsWindow.DrawRectangle(1,100,100000,20) GraphicsWindow.FillRectangle(1,100,100000,20) GraphicsWindow.DrawRectangle(100,1,20,100000) GraphicsWindow.FillRectangle(100,1,20,100000) GraphicsWindow.BrushColor = goldenbrown GraphicsWindow.DrawRectangle(1,120,100,50) GraphicsWindow.FillRectangle(1,120,100,50) GraphicsWindow.BrushColor = yellow GraphicsWindow.FontSize = 20 GraphicsWindow.DrawBoundText(45,130,20,"M") GraphicsWindow.FontSize = 13 GraphicsWindow.BrushColor = red GraphicsWindow.DrawRectangle(20,155,75,10) Graphicswindow.FillRectangle(20,155,75,10) GraphicsWindow.BrushColor = yellow GraphicsWindow.DrawBoundText(20,150,1000,"McStick's") GraphicsWindow.BrushColor = white GraphicsWindow.DrawRectangle(1,170,10000,20) GraphicsWindow.FillRectangle(1,170,10000,20) GraphicsWindow.BrushColor = grayrandomcolorthatidontknowwhatisit GraphicsWindow.DrawRectangle(120,1,80,50) GraphicsWindow.FillRectangle(120,1,80,50) GraphicsWindow.BrushColor = silvergray2 GraphicsWindow.DrawRectangle(120,50,100,24) Graphicswindow.FillRectangle(120,50,100,24) GraphicsWindow.DrawRectangle(120,75,100,24) GraphicsWindow.FillRectangle(120,75,100,24) GraphicsWindow.BrushColor = black GraphicsWindow.FontSize = 12 GraphicsWindow.DrawBoundText(125,5,3000,"Bus Station") GraphicsWindow.BrushColor = red GraphicsWindow.DrawRectangle(120,120,100,50) GraphicsWindow.FillRectangle(120,120,100,50) GraphicsWindow.BrushColor = yellow GraphicsWindow.DrawBoundText(125,125,1000000,"Train Station") GraphicsWindow.FontSize = 25 GraphicsWindow.BrushColor = white GraphicsWindow.DrawRectangle(220,1,20,100000) GraphicsWindow.FillRectangle(220,1,20,100000) GraphicsWindow.BrushColor = caramelcolor GraphicsWindow.DrawRectangle(1,190,100,150) GraphicsWindow.FillRectangle(1,190,100,150) GraphicsWindow.BrushColor = coffeebrown GraphicsWindow.DrawRectangle(120,190,100,65) GraphicsWindow.FillRectangle(120,190,100,65) GraphicsWindow.BrushColor = black GraphicsWindow.FontSize = 22 GraphicsWindow.DrawBoundText(5,205,1000,"High") GraphicsWindow.DrawBoundText(5,225,1000,"School") GraphicsWindow.DrawBoundText(5,245,1000,"Of Stick") GraphicsWindow.FontSize = 17 GraphicsWindow.DrawBoundText(125,205,1000,"Candy") GraphicsWindow.BrushColor = white GraphicsWindow.DrawRectangle(1,340,10000,20) GraphicsWindow.FillRectangle(1,340,10000,20) GraphicsWindow.DrawRectangle(100,255,100000,20) GraphicsWindow.FillRectangle(100,255,100000,20) GraphicsWindow.BrushColor = grayrandomcolorthatidontknowwhatisit GraphicsWindow.DrawRectangle(120,275,100,65) GraphicsWindow.FillRectangle(120,275,100,65) GraphicsWindow.BrushColor = silvergray2 GraphicsWindow.DrawRectangle(1,360,100,60) GraphicsWindow.FillRectangle(1,360,100,60) GraphicsWindow.BrushColor = black GraphicsWindow.DrawBoundText(125,280,1000,"Electronics") GraphicsWindow.DrawBoundText(130,300,1000,"Store") GraphicsWindow.FontSize = 15 GraphicsWindow.DrawBoundText(5,370,10000,"Guns &") GraphicsWindow.DrawBoundText(5,385,10000,"Ammunition") GraphicsWindow.BrushColor = ashgray GraphicsWindow.DrawRectangle(120,360,100,60) GraphicsWindow.FillRectangle(120,360,100,60) GraphicsWindow.BrushColor = coffeebrown GraphicsWindow.DrawRectangle(240,1,100,100) GraphicsWindow.FillRectangle(240,1,100,100) GraphicsWindow.BrushColor = black GraphicsWindow.FontSize = 17 GraphicsWindow.DrawBoundText(125,365,10000,"House") GraphicsWindow.DrawBoundText(125,380,10000,"Upgrades") GraphicsWindow.FontSize = 19 GraphicsWindow.DrawBoundText(245,10,1000000,"General") GraphicsWindow.DrawBoundText(245,30,100000,"Store") GraphicsWindow.BrushColor = white100 GraphicsWindow.DrawRectangle(240,120,100,140) GraphicsWindow.FillRectangle(240,120,100,140) GraphicsWindow.BrushColor = red GraphicsWindow.FontSize = 60 GraphicsWindow.DrawBoundText(260,125,1000000,"+") GraphicsWindow.FontSize = 24 GraphicsWindow.DrawBoundText(241,200,10000,"Hospital") GraphicsWindow.BrushColor = white GraphicsWindow.DrawRectangle(340,1,20,10000000) GraphicsWindow.FillRectangle(340,1,20,10000000) GraphicsWindow.DrawRectangle(1,420,10000000,20) GraphicsWindow.FillRectangle(1,420,10000000,20) GraphicsWindow.BrushColor = cyan GraphicsWindow.DrawRectangle(240,275,100,65) GraphicsWindow.FillRectangle(240,275,100,65) GraphicsWindow.BrushColor = blue GraphicsWindow.FontSize = 17 GraphicsWindow.DrawBoundText(245,280,10000,"Swimming") GraphicsWindow.DrawBoundText(250,300,10000,"Pool") GraphicsWindow.BrushColor = red GraphicsWindow.DrawRectangle(240,360,100,60) GraphicsWindow.FillRectangle(240,360,100,60) GraphicsWindow.BrushColor = black GraphicsWindow.DrawBoundText(245,365,1000,"Arcade &") GraphicsWindow.DrawBoundText(245,380,1000,"Bowling") GraphicsWindow.BrushColor = movietheaterred GraphicsWindow.DrawRectangle(360,1,100,100) GraphicsWindow.FillRectangle(360,1,100,100) GraphicsWindow.FontSize = 22 GraphicsWindow.BrushColor = neonblue GraphicsWindow.DrawBoundText(365,5,1000,"Cinema") GraphicsWindow.BrushColor = breadcolor GraphicsWindow.DrawRectangle(360,120,100,52) GraphicsWindow.FillRectangle(360,120,100,52) GraphicsWindow.BrushColor = silvergray2 GraphicsWindow.DrawRectangle(360,190,100,65) GraphicsWindow.FillRectangle(360,190,100,65) GraphicsWindow.BrushColor = ashgray GraphicsWindow.DrawBoundText(365,125,10000,"Bakery") GraphicsWindow.BrushColor = black GraphicsWindow.FontSize = 17 GraphicsWindow.DrawBoundText(365,195,10000,"Stick") GraphicsWindow.DrawBoundText(365,210,10000,"Furniture") GraphicsWindow.BrushColor = ashgray GraphicsWindow.DrawRectangle(360,275,120,145) GraphicsWindow.FillRectangle(360,275,120,145) GraphicsWindow.BrushColor = grayrandomcolorthatidontknowwhatisit GraphicsWindow.FontSize = 20 GraphicsWindow.DrawBoundText(365,280,1000,"Stick Job") GraphicsWindow.FontSize = 16 GraphicsWindow.DrawBoundText(365,300,1000,"Offices") GraphicsWindow.BrushColor = white GraphicsWindow.DrawRectangle(365,325,20,20) GraphicsWindow.FillRectangle(365,325,20,20) GraphicsWindow.DrawRectangle(395,325,20,20) GraphicsWindow.FillRectangle(395,325,20,20) GraphicsWindow.DrawRectangle(425,325,20,20) GraphicsWindow.FillRectangle(425,325,20,20) GraphicsWindow.DrawRectangle(365,350,20,20) GraphicsWindow.FillRectangle(365,350,20,20) GraphicsWindow.DrawRectangle(395,350,20,20) GraphicsWindow.FillRectangle(395,350,20,20) GraphicsWindow.DrawRectangle(425,350,20,20) GraphicsWindow.FillRectangle(425,350,20,20) GraphicsWindow.DrawRectangle(365,375,20,20) GraphicsWindow.FillRectangle(365,375,20,20) GraphicsWindow.DrawRectangle(395,375,20,20) GraphicsWindow.FillRectangle(395,375,20,20) GraphicsWindow.DrawRectangle(425,375,20,20) GraphicsWindow.FillRectangle(425,375,20,20) GraphicsWindow.DrawRectangle(460,1,20,100000) GraphicsWindow.FillRectangle(460,1,20,100000) GraphicsWindow.BrushColor = firebrick GraphicsWindow.DrawRectangle(480,1,100,100) GraphicsWindow.FillRectangle(480,1,100,100) GraphicsWindow.BrushColor = white100 GraphicsWindow.FontSize = 18 GraphicsWindow.DrawBoundText(485,5,1000,"Library") GraphicsWindow.BrushColor = woodbrown GraphicsWindow.DrawRectangle(480,120,100,50) GraphicsWindow.FillRectangle(480,120,100,50) GraphicsWindow.BrushColor = neonblue GraphicsWindow.DrawBoundText(485,125,1000,"Clothing") GraphicsWindow.BrushColor = silvergray2 GraphicsWindow.DrawRectangle(1,440,340,120) GraphicsWindow.FillRectangle(1,440,340,120) GraphicsWindow.BrushColor = red GraphicsWindow.DrawRectangle(480,190,100,150) GraphicsWindow.FillRectangle(480,190,100,150) GraphicsWindow.BrushColor = black GraphicsWindow.FontSize = 75 GraphicsWindow.DrawBoundText(20,450,10000,"Airport") GraphicsWindow.BrushColor = yellow GraphicsWindow.FontSize = 40 GraphicsWindow.DrawBoundText(485,195,1000,"GYM") GraphicsWindow.FontSize = 20 GraphicsWindow.DrawBoundText(482,250,1000,"Gold Gym") GraphicsWindow.DrawBoundText(485,270,1000,"Fitness") GraphicsWindow.BrushColor = grayrandomcolorthatidontknowwhatisit GraphicsWindow.DrawRectangle(480,360,100,60) GraphicsWindow.FillRectangle(480,360,100,60) GraphicsWindow.DrawRectangle(360,440,100,120) GraphicsWindow.FillRectangle(360,440,100,120) GraphicsWindow.BrushColor = black GraphicsWindow.DrawBoundText(510,365,1000,"City") GraphicsWindow.DrawBoundText(510,385,1000,"Hall") GraphicsWindow.DrawBoundText(365,445,1000,"Stick") GraphicsWindow.DrawBoundText(365,470,1000,"Museum") GraphicsWindow.BrushColor = white GraphicsWindow.DrawRectangle(370,495,15,35) GraphicsWindow.FillRectangle(370,495,15,35) GraphicsWindow.DrawRectangle(395,495,15,35) GraphicsWindow.FillRectangle(395,495,15,35) GraphicsWindow.DrawRectangle(420,495,15,35) GraphicsWindow.FillRectangle(420,495,15,35) GraphicsWindow.DrawLine(362,495,443,495) GraphicsWindow.DrawLine(362,530,443,530) GraphicsWindow.BrushColor = shamrockgreen GraphicsWindow.DrawRectangle(480,440,100,120) GraphicsWindow.FillRectangle(480,440,100,120) GraphicsWindow.BrushColor = white GraphicsWindow.FontSize = 32 GraphicsWindow.DrawBoundText(485,445,1000,"Teens") GraphicsWindow.DrawBoundText(485,480,1000,"Shop") GraphicsWindow.DrawRectangle(580,1,20,10000) GraphicsWindow.FillRectangle(580,1,20,10000) GraphicsWindow.DrawRectangle(1,560,10000,20) GraphicsWindow.FillRectangle(1,560,10000,20) GraphicsWindow.BrushColor = black GraphicsWindow.FontSize = 22 pausebutton = Controls.AddButton("Pause & Stats",1710,5) homebutton = Controls.AddButton("Home",1610,5) EndSub '============ Sub locations left = Shapes.GetLeft(Character) top = Shapes.GetTop(Character) If top < 100 Then If left < 100 Then location = "home" ElseIf left < 120 then location = "road" ElseIf left < 220 Then location = "bus station" ElseIf left < 240 then location = "road" ElseIf left < 340 then location = "general store" ElseIf left < 360 then location = "road" ElseIf left < 460 then location = "cinema" ElseIf left < 480 then location = "road" ElseIf left < 580 then location = "library" ElseIf left < 600 then location = "road" Else location = "outofbounds" Endif ElseIf top < 120 then If left < 600 then location = "road" Else location = "outofbounds" EndIf elseIf top < 170 then If left < 100 then location = "mcsticks" Elseif left < 120 then location = "road" Elseif left < 220 then location = "trainstation" ElseIf left < 240 then location = "road" Elseif left < 340 then location = "hospital" elseif left < 360 then location = "road" elseif left < 460 then location = "bakery" elseif left < 480 then location = "road" Elseif left < 580 then location = "clothing" elseif left < 600 then location = "road" Else location = "outofbounds" EndIf elseif top < 190 then If left < 240 then location = "road" elseif left < 340 then location = "hospital" elseIf left < 600 then location = "road" Else location = "outofbounds" EndIf elseif top < 255 then If left < 100 then location = "highschool" elseif left < 120 then location = "road" elseif left < 220 then location = "candy" elseif left < 240 then location = "road" elseif left < 340 then location = "hospital" elseif left < 360 then location = "road" elseif left < 460 then location = "furniture" elseif left < 480 then location = "road" elseif left < 580 then location = "gym" elseif left < 600 then location = "road" Else location = "outofbounds" EndIf elseif top < 275 then If left < 100 then location = "highschool" elseif left < 480 then location = "road" elseif left < 580 then location = "gym" elseif left < 600 then location = "road" Else location = "outofbounds" EndIf elseif top < 340 then If left < 100 then location = "highschool" Elseif left < 120 then location = "road" elseif left < 220 then location = "electricstore" elseif left < 240 then location = "road" elseif left < 340 then location = "swimmingpool" elseif left < 360 then location = "road" elseif left < 460 then location = "jobs" elseif left < 480 then location = "road" elseif left < 580 then location = "gym" elseif left < 600 then location = "road" else location = "outofbounds" EndIf elseif top < 360 then If left < 360 then location = "road" elseif left < 460 then location = "jobs" elseif left < 600 then location = "road" Else location = "outofbounds" EndIf elseif top < 420 then If left < 100 then location = "guns&ammo" elseif left < 120 then location = "road" elseif left < 220 then location = "houseupgrades" elseif left < 240 then location = "road" elseif left < 340 then location = "arcade" elseif left < 360 then location = "road" elseif left < 460 then location = "jobs" elseif left < 480 then location = "road" elseif left < 580 then location = "cityhall" Elseif left < 600 then location = "road" Else location = "outofbounds" EndIf elseif top < 440 then If left < 600 then location = "road" Else location = "outofbounds" EndIf elseif top < 560 then If left < 340 then location = "airport" elseif left < 360 then location = "road" elseif left < 460 then location = "museum" elseif left < 480 then location = "road" elseif left < 580 then location = "teenstore" elseif left < 600 then location = "road" Else location = "outofbounds" endif EndIf If left < 0 Then location = "outofbounds" EndIf If top < 0 Then location = "outofbounds" EndIf endsub End>LTC819.sb< Start>LTD210.sb< LoadImage() FitToWindow() Graphics() LDEvents.MouseWheel = OnMouseWheel Sub Resize 'Aspect Ratio ratioX = GraphicsWindow.Width / imgWidth ratioY = GraphicsWindow.Height / imgHeight ratio = Math.Min(ratioX, ratioY) 'Resize using Aspect Ratio & zoom newWidth = imgWidth * ratio * zoom newHeight = imgHeight * ratio * zoom EndSub Sub OnMouseWheel delta = LDEvents.LastMouseWheelDelta / 10 If (zoom + delta > 0) And (zoom + delta < 10) Then zoom = zoom + delta EndIf zoomPointX = GraphicsWindow.MouseX zoomPointY = GraphicsWindow.MouseY oldWidth = newWidth oldHeight = newHeight Resize() dX = oldWidth - newWidth dY = oldHeight - newHeight Goto MySolution If delta > 0 Then If newWidth > GraphicsWindow.Width Then X = X + ((GraphicsWindow.Width /2 - zoomPointX) / (GraphicsWindow.Width/2)) * (Math.Abs(dx) / 2) + dX / 2 Else X = (GraphicsWindow.Width - newWidth) /2 EndIf If newHeight > GraphicsWindow.Height Then Y = Y + ((GraphicsWindow.Height /2 - zoomPointY) / (GraphicsWindow.Height/2)) * (Math.Abs(dY) /2) + dY / 2 Else Y = (GraphicsWindow.Height - newHeight) / 2 EndIf ElseIf delta < 0 Then If newWidth < GraphicsWindow.Width Then X = (GraphicsWindow.Width - newWidth) / 2 Else X = X - ((GraphicsWindow.Width /2 - zoomPointX) / (GraphicsWindow.Width/2)) * (Math.Abs(dx) / 2) + dX / 2 EndIf If newHeight < GraphicsWindow.Height Then Y = (GraphicsWindow.Height - newHeight) / 2 Else Y = Y - ((GraphicsWindow.Height /2 - zoomPointY) / (GraphicsWindow.Height/2)) * (Math.Abs(dY) /2) + dY / 2 EndIf EndIf MySolution: offsetX = zoomPointX - X offsetY = zoomPointY - Y offsetX = offsetX * (newWidth / oldWidth) offsetY = offsetY * (newHeight / oldHeight) X = zoomPointX - offsetX Y = zoomPointY - offsetY Graphics() EndSub Sub Graphics LDShapes.SetSize(img, newWidth, newHeight) Shapes.Move(img X Y) EndSub Sub FitToWindow 'Fit to Window zoom = 1 Resize() X = (GraphicsWindow.Width - newWidth) / 2 Y = (GraphicsWindow.Height - newHeight) / 2 EndSub Sub LoadImage GraphicsWindow.Show() path = LDDialogs.OpenFile("*.*", "") img = ImageList.LoadImage(path) imgWidth = ImageList.GetWidthOfImage(img) imgHeight = ImageList.GetHeightOfImage(img) img = Shapes.AddImage(img) EndSub End>LTD210.sb< Start>LTF561.sb< ' SmallBasic Version 1.2 ' Program: KaterMukke (TomcatMusic) EN ' Changelog: 16.6 ' Author: Pappa Lapub ' Website: https://social.msdn.microsoft.com/Forums/en-US/b9187717-da69-4b67-95cf-5c4ee5c56037/a-suggestion-for-a-new-challange ' ImportURL: http://smallbasic.com/program/? ' Extension: LitDev v1.2.10 ' Comment: https://soundcloud.com/katermukke (Orig image source) ' ' KEYS: Esc .. Exit; B .. Black background; C .. colorChange On/Off; F .. colorFlash On/Off ' MOUSE: L-Mouse .. show/hide tongue; MouseWheel .. -/+ speed for shown tongue ' R-Mouse .. Creoles flap On/Off (at thread end) ' Variables: ' ToDo: ' ================================================================================ picDir = Program.Directory +"\img\" ' 4 images (5 with Hal url) picIco = picDir +"KaterMukke.png" ' 32x32 '' picIco = Program.Directory +"\Icons\KaterMukke.ico" picBG = picDir +"KaterMukke_480.png" '' https://i1.sndcdn.com/artworks-000156784007-scysel-t500x500.jpg (orig) ' The following line could be harmful and has been automatically commented. ' '' picBG = LDFile.MusicFolder +"\DouglasGreed-2016-RoadkillEP\KaterMukke_480.png" ' 480x480 picCreol = picDir +"KaterHoop.png" ' 62x72 picOrb = picDir +"W7Orb.png" ' 106x318 (triple) ' The following line could be harmful and has been automatically commented. ' '' picOrb = LDFile.PicturesFolder +"\StartButtons\ExplorerOrb\ExplorerOrb.png" ' 106x318 (triple) ' The following line could be harmful and has been automatically commented. ' '' picOrb = LDFile.PicturesFolder +"\StartButtons\Blu3_BiOhAzArD_StArT_ORB_WiN_7_by_FalconJus.jpg" ' 106x318 (triple) picHal = "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f6/HAL9000.svg/240px-HAL9000.svg.png" ' 240x240 'picHal = picDir +"HAL9000_240x240.png" ' 240x240 (single) ' The following line could be harmful and has been automatically commented. ' '' picHal = LDFile.PicturesFolder +"\StartButtons\Start Orb HAL6000 MariuszJ.bmp" ' 54x162 (triple) ' -------------------------------------------------------------------------------- arrCols = "1=#751AFA;2=#FF9C11;3=#EA181F;4=#15D663;5=#CADD1F;6=#5DFF27;7=#FE0470;8=#0E5EFB;" arrCols = arrCols +"9=#BA09FC;10=#F4FF2B;11=#FF661D;12=#2600FA;13=#FE0470;14=#3DC7ED;15=#FD565D;" nCols = Array.GetItemCount(arrCols) colTongue = "Crimson" ' tongue color colOut_L = "Black" ' left pupil outer color colIn_L = "Yellow" ' left pupil inner color colOut_R = "Black" ' right pupil outer color colIn_R = "Red" ' right pupil inner color intv = 1000 ' Start interval for tongue bChange = "True" ' Randomly change BG colors every 2 sec , "True"/"False" bFlash = "True" ' Randomly flash BG colors every 15-25 sec, "True"/"False" bComplete = "True" ' Async thread 'RotateCreol' is completed and ready to go (again) args = "" ImageListWorks() BuildGUI() Timer.Interval = 10000 Timer.Tick = OnTimerTick '' Randomly change BG color GraphicsWindow.KeyDown = OnKeyDown '' Toggle ChangeBGCol and/or FlashBGCol GraphicsWindow.MouseDown = OnMouseDown '' Show/Hide tongue LDEvents.MouseWheel = OnMouseWheel '' Lick speed when tongue showing Controls.ButtonClicked = OnButtonClick '' Flash White / Pulse Red LDCall.CallComplete = OnCallComplete '' Flapping creoles While "True" If bChange Then 'n = Math.Remainder(n, nCols) + 1 '' continuous: 1 - nCols n = Math.GetRandomNumber(nCols) '' randomly GraphicsWindow.BackgroundColor = arrCols[n] LDShapes.BrushColour(shpPierc, arrCols[n]) Program.Delay(2000) EndIf Program.Delay(20) EndWhile ' ////////// SUBs \\\\\\\\\\ Sub ImageListWorks '' all the preparatory work, that can be done in ImageList before a GUI is needed imgW = ImageList.GetWidthOfImage(picBG) ' 480 imgH = ImageList.GetHeightOfImage(picBG) ' 480 imgCreol = ImageList.LoadImage(picCreol) LDImage.Resize(imgCreol, 62*0.6, 72*0.6) brushHal = LDShapes.BrushImage(picHal) imgOrb = ImageList.LoadImage(picOrb) LDImage.Crop(imgOrb, 22,24, 62,62) ' for 106x318 Triple-Orbs 1./3 'LDImage.Crop(imgOrb, 7,7, 39,39) ' for 54x162 Triple-Orbs 1./3 brushOrb = LDShapes.BrushImage(imgOrb) LDImage.Remove(imgOrb) imgTong = LDCall.Function("CreateTongueImg", colTongue) ' (colTongue) -> ImageList# (40x80) brushPupil_L = LDCall.Function2("CreatePupilBrush", colOut_L, colIn_L) ' (colOut, colIn) -> Brush# (79x79) brushPupil_R = LDCall.Function2("CreatePupilBrush", colOut_R, colIn_R) ' (colOut, colIn) -> Brush# (79x79) EndSub Sub BuildGUI GraphicsWindow.CanResize = "" GraphicsWindow.Top = 0 GraphicsWindow.Width = imgW GraphicsWindow.Height = imgH GraphicsWindow.Title = "Tomcat Mucce" ' "Kater Mukke" LDGraphicsWindow.Icon = picIco LDGraphicsWindow.PauseUpdates() shpBG = Shapes.AddImage(picBG) GraphicsWindow.PenWidth = 0 GraphicsWindow.BrushColor = "#80FFA07A" '' semitransparent LightSalmon shpFlash = Shapes.AddRectangle(imgW,imgH) Shapes.SetOpacity(shpFlash, 0) GraphicsWindow.BrushColor = "#80FF0000" '' semitransparent Red shpPuls = Shapes.AddRectangle(imgW+40,imgH+40) Shapes.Move(shpPuls, -20,-20) Shapes.HideShape(shpPuls) '' Right + left halfhoop creoles shpCreolR = Shapes.AddImage(imgCreol) Shapes.Move(shpCreolR, 359,170) LDImage.EffectReflect(imgCreol, "") shpCreolL = Shapes.AddImage(imgCreol) Shapes.Move(shpCreolL, 74,163) LDImage.Remove(imgCreol) '' Nose piercing GraphicsWindow.BrushColor = "Gold" shpPierc = Shapes.AddEllipse(7,8) Shapes.Move(shpPierc, 258,280) '' Tongue shpTong = Shapes.AddImage(imgTong) Shapes.HideShape(shpTong) Shapes.Move(shpTong, 220,300) LDImage.Remove(imgTong) '' 2 Buttons GraphicsWindow.FontSize = 30 btnHal = Controls.AddButton("MIAOW", 115,178) LDShapes.SetSize(btnHal, 120,120) 'Controls.SetSize(btnHal, 120,120) -> would lead to PROBLEM LDControls.SetButtonStyle(btnHal, brushHal, "Transparent",brushPupil_L, "Transparent","Transparent","DeepPink", 110,"") GraphicsWindow.FontSize = 28 btnOrb = Controls.AddButton("GRRRR", 253,188) ' "HISSS" LDShapes.SetSize(btnOrb, 100,100) 'Controls.SetSize(btnOrb, 100,100) -> would lead to PROBLEM LDControls.SetButtonStyle(btnOrb, brushOrb,"Transparent",brushPupil_R, "Transparent","Transparent","Yellow", 100,"") LDGraphicsWindow.ResumeUpdates() LDGraphicsWindow.TopMost = "True" EndSub ' ////////// EVENTs \\\\\\\\\\ Sub OnTimerTick If bFlash Then bFlash = "" nFlash = 3 + Math.GetRandomNumber(5) ' 3 - 8 Flashes For f = 1 To nFlash GraphicsWindow.BackgroundColor = "Black" Program.Delay(200) GraphicsWindow.BackgroundColor = arrCols[n] '"White" Program.Delay(200) EndFor Timer.Interval = 1000 * (15 + Math.GetRandomNumber(10)) ' 15 - 25 sec between Flashes Program.Delay(200) bFlash = "True" EndIf EndSub Sub OnButtonClick lastBtn = Controls.LastClickedButton If lastBtn = btnHal Then LDShapes.AnimateOpacity(shpFlash, 1000, 3.5) Else 'If lastBtn = btnOrb Then Shapes.ShowShape(shpPuls) LDShapes.AnimateZoom(shpPuls, 1200, 2.25, -1,-1) EndIf EndSub Sub OnKeyDown lastKey = GraphicsWindow.LastKey If lastKey = "Escape" Then Program.End() ElseIf lastKey = "B" Then '' Black BG, no colorFlash, no colorChange bChange = "" bFlash = "" GraphicsWindow.BackgroundColor = "Black" LDShapes.BrushColour(shpPierc, "Black") ' "Gold") ElseIf lastKey = "C" Then ' "Space" Then '' Toggle colorChange On/Off bChange = LDLogic.Not(bChange) ElseIf lastKey = "F" Then ' "Return" Then '' Toggle colorFlash On/Off bFlash = LDLogic.Not(bFlash) EndIf EndSub Sub OnMouseDown If Mouse.IsRightButtonDown Then rClick = Math.Remainder(rClick+1,2) If rClick = 1 And bComplete Then LDCall.CallAsync("","","", "RotateCreol","") EndIf Else 'If Mouse.IsLeftButtonDown Then lClick = Math.Remainder(lClick+1, 2) If lClick = 1 Then ' lick Shapes.ShowShape(shpTong) LDShapes.AnimateZoom(shpTong, intv, 0, 1,0) Else LDShapes.AnimateZoom(shpTong, 0, 0, 1,0) Shapes.HideShape(shpTong) EndIf EndIf EndSub Sub OnMouseWheel If lClick = 1 Then 'intv = Math.Min(Math.Max(0, intv - 100*LDEvents.LastMouseWheelDelta), 10000) intv = Math.Max(0, intv - 100*LDEvents.LastMouseWheelDelta) If intv > 10000 Then 'LDShapes.AnimateZoom(shpTong, 0, 0, 1,0) ' intv = 0 LDShapes.AnimateZoom(shpTong, intv, 0.5, 1,0) 'EndIf Else LDShapes.AnimateZoom(shpTong, intv, 0, 1,0) ' 0 <= intv <= 10000 EndIf EndIf EndSub ' ////////// FUNCTIONs \\\\\\\\\\ Sub CreateTongueImg ' lower half-ellipse, Crimson on Transparent, 40x80 For x = -19 To 20 ' 1 - 40 For y = -39 To 40 ' 1 - 80 If y > 0 And x*x + y*y/4 <= 400 Then pxl[x+20][y+40] = args[1] Else pxl[x+20][y+40] = "Transparent" EndIf EndFor EndFor return = LDImage.SetImagePixels(pxl) pxl = "" '' WORKS, even after return, clear pxl Array EndSub Sub CreatePupilBrush ' 79x79 For x = -39 To 0 ' 1 - 40 For y = -39 To 0 ' 1 - 40 'If (x-30)*(x-30) + y*y <= 2500 Then ' r = 50 If (x-50)*(x-50) + y*y <= 3600 Then ' r= 60 pxl[40+x][40+y] = args[1] ' inside ... pxl[40-x][40+y] = args[1] ' mirror about y-axis pxl[40+x][40-y] = args[1] ' mirror about x-axis pxl[40-x][40-y] = args[1] ' mirror diagonal Else pxl[40+x][40+y] = args[2] ' outside ... pxl[40-x][40+y] = args[2] ' mirror about y-axis pxl[40+x][40-y] = args[2] ' mirror about x-axis pxl[40-x][40-y] = args[2] ' mirror diagonal EndIf EndFor EndFor imgTemp = LDImage.SetImagePixels(pxl) pxl = "" return = LDShapes.BrushImage(imgTemp) LDImage.Remove(imgTemp) '' WORKS, even after return, removes temporary ImageList image EndSub Sub RotateCreol For ang = -140 To 140 LDShapes.RotateAbout(shpCreolL, 110,178, 140-Math.Abs(ang)) LDShapes.RotateAbout(shpCreolR, 361,185, Math.Abs(ang)-140) Program.Delay(5) EndFor bComplete = "True" EndSub Sub OnCallComplete If LDCall.LastCall = "RotateCreol()" And rClick = 1 Then bComplete = "" LDCall.CallAsync("","","", "RotateCreol", "") EndIf EndSub End>LTF561.sb< Start>LTF622-0.sb< GraphicsWindow.Title = "Interactive Periodic Table GraphicsWindow.BackgroundColor="teal args=0 GraphicsWindow.BrushColor="black Sub eset H= Controls.AddButton("H",0,0) Li= Controls.AddButton("Li",0,30) Na= Controls.AddButton("Na",0,60) K= Controls.AddButton("K",0,90) Rb= Controls.AddButton("Rb",0,120) Cs= Controls.AddButton("Cs",0,150) Fr= Controls.AddButton("Fr",0,180) Be= Controls.AddButton("Be",30,30) Mg= Controls.AddButton("Mg",30,60) Ca= Controls.AddButton("Ca",30,90) Sr= Controls.AddButton("Sr",30,120) Ba= Controls.AddButton("Ba",30,150) Ra= Controls.AddButton("Ra",30,180) Sc= Controls.AddButton("Sc",60,90) Y= Controls.AddButton("Y",60,120) Ti= Controls.AddButton("Ti",90,90) Zr= Controls.AddButton("Zr",90,120) Hf= Controls.AddButton("Hf",90,150) Rf= Controls.AddButton("Rf",90,180) V= Controls.AddButton("V",120,90) Nb= Controls.AddButton("Nb",120,120) Ta= Controls.AddButton("Ta",120,150) Db= Controls.AddButton("Db",120,180) Cr= Controls.AddButton("Cr",150,90) Mo= Controls.AddButton("Mo",150,120) W= Controls.AddButton("W",150,150) Sg= Controls.AddButton("Sg",150,180) Mn= Controls.AddButton("Mn",180,90) Tc= Controls.AddButton("Tc",180,120) Re= Controls.AddButton("Re",180,150) Bh= Controls.AddButton("Bh",180,180) Fe= Controls.AddButton("Fe",210,90) Ru= Controls.AddButton("Ru",210,120) Os= Controls.AddButton("Os",210,150) Hs= Controls.AddButton("Hs",210,180) Co= Controls.AddButton("Co",240,90) Rh= Controls.AddButton("Rh",240,120) Ir= Controls.AddButton("Ir",240,150) Mt= Controls.AddButton("Mt",240,180) Ni= Controls.AddButton("Ni",270,90) Pd= Controls.AddButton("Pd",270,120) Pt= Controls.AddButton("Pt",270,150) Ds= Controls.AddButton("Ds",270,180) Cu= Controls.AddButton("Cu",300,90) Ag= Controls.AddButton("Ag",300,120) Au= Controls.AddButton("Au",300,150) Rg= Controls.AddButton("Rg",300,180) Zn= Controls.AddButton("Zn",330,90) Cd= Controls.AddButton("Cd",330,120) Hg= Controls.AddButton("Hg",330,150) Cn= Controls.AddButton("Cn",330,180) B= Controls.AddButton("B",360,30) Al= Controls.AddButton("Al",360,60) Ga= Controls.AddButton("Ga",360,90) In= Controls.AddButton("In",360,120) Tl= Controls.AddButton("Tl",360,150) Uut= Controls.AddButton("Nh",360,180) C= Controls.AddButton("C",390,30) Si= Controls.AddButton("Si",390,60) Ge= Controls.AddButton("Ge",390,90) Sn= Controls.AddButton("Sn",390,120) Pb= Controls.AddButton("Pb",390,150) Fl= Controls.AddButton("Fl",390,180) N= Controls.AddButton("N",420,30) P= Controls.AddButton("P",420,60) As= Controls.AddButton("As",420,90) Sb= Controls.AddButton("Sb",420,120) Bi= Controls.AddButton("Bi",420,150) Uup= Controls.AddButton("Mc",420,180) O= Controls.AddButton("O",450,30) S= Controls.AddButton("S",450,60) Se= Controls.AddButton("Se",450,90) Te= Controls.AddButton("Te",450,120) Po= Controls.AddButton("Po",450,150) Lv= Controls.AddButton("Lv",450,180) F= Controls.AddButton("F",480,30) Cl= Controls.AddButton("Cl",480,60) Br= Controls.AddButton("Br",480,90) I= Controls.AddButton("I",480,120) At= Controls.AddButton("At",480,150) Uus= Controls.AddButton("Ts",480,180) He= Controls.AddButton("He",510,0) Ne= Controls.AddButton("Ne",510,30) Ar= Controls.AddButton("Ar",510,60) Kr= Controls.AddButton("Kr",510,90) Xe= Controls.AddButton("Xe",510,120) Rn= Controls.AddButton("Rn",510,150) Uuo= Controls.AddButton("Og",510,180) La= Controls.AddButton("La",90,240) Ac= Controls.AddButton("Ac",90,270) Ce= Controls.AddButton("Ce",120,240) Th= Controls.AddButton("Th",120,270) Pr= Controls.AddButton("Pr",150,240) Pa= Controls.AddButton("Pa",150,270) Nd= Controls.AddButton("Nd",180,240) U= Controls.AddButton("U",180,270) Pm= Controls.AddButton("Pm",210,240) Np= Controls.AddButton("Np",210,270) Sm= Controls.AddButton("Sm",240,240) Pu= Controls.AddButton("Pu",240,270) Eu= Controls.AddButton("Eu",270,240) Am= Controls.AddButton("Am",270,270) Gd= Controls.AddButton("Gd",300,240) Cm= Controls.AddButton("Cm",300,270) Tb= Controls.AddButton("Tb",330,240) Bk= Controls.AddButton("Bk",330,270) Dy= Controls.AddButton("Dy",360,240) Cf= Controls.AddButton("Cf",360,270) Ho= Controls.AddButton("Ho",390,240) Es= Controls.AddButton("Es",390,270) Er= Controls.AddButton("Er",420,240) Fm= Controls.AddButton("Fm",420,270) Tm= Controls.AddButton("Tm",450,240) Md= Controls.AddButton("Md",450,270) Yb= Controls.AddButton("Yb",480,240) No= Controls.AddButton("No",480,270) Lu= Controls.AddButton("Lu",510,240) Lr= Controls.AddButton("Lr",510,270) EndSub eset() For ff=1 To 118 LDShapes.BrushColour("Button"+ff "transparent") LDEffect.DropShadow("Button"+ff "color=white") EndFor ff="http://upload.wikimedia.org/wikipedia/commons/thumb/ imm[3]=ff+"a/ae/Lithium_paraffin.jpg/440px-Lithium_paraffin.jpg imm[4]=ff+"0/0c/Be-140g.jpg/280px-Be-140g.jpg imm[5]=ff+"1/19/Boron_R105.jpg/440px-Boron_R105.jpg imm[6]=ff+"f/f0/Graphite-and-diamond-with-scale.jpg/440px-Graphite-and-diamond-with-scale.jpg imm[7]=ff+"d/d2/Liquidnitrogen.jpg/440px-Liquidnitrogen.jpg imm[8]=ff+"c/c3/Liquid_oxygen_in_a_beaker_4.jpg/300px-Liquid_oxygen_in_a_beaker_4.jpg imm[9]=ff+"9/91/Liquid_fluorine_tighter_crop.jpg/330px-Liquid_fluorine_tighter_crop.jpg imm[10]=ff+"4/46/Neon_discharge_tube.jpg/440px-Neon_discharge_tube.jpg imm[11]=ff+"2/27/Na_%28Sodium%29.jpg/440px-Na_%28Sodium%29.jpg imm[12]=ff+"5/5c/CSIRO_ScienceImage_2893_Crystalised_magnesium.jpg/440px-CSIRO_ScienceImage_2893_Crystalised_magnesium.jpg imm[13]=ff+"5/5d/Aluminium-4.jpg/440px-Aluminium-4.jpg imm[14]=ff+"e/e9/SiliconCroda.jpg/440px-SiliconCroda.jpg imm[15]=ff+"8/88/PhosphComby.jpg/440px-PhosphComby.jpg imm[16]=ff+"4/44/Sulfur-sample.jpg/440px-Sulfur-sample.jpg imm[17]=ff+"f/f4/Chlorine_ampoule.jpg/440px-Chlorine_ampoule.jpg img[li]=ImageList.LoadImage(imm[3]) img[Be]=ImageList.LoadImage(imm[4]) img[b ]=ImageList.LoadImage(imm[5]) img[c ]=ImageList.LoadImage(imm[6]) img[n ]=ImageList.LoadImage(imm[7]) img[o ]=ImageList.LoadImage(imm[8]) img[f ]=ImageList.LoadImage(imm[9]) img[ne]=ImageList.LoadImage(imm[10]) img[na]=ImageList.LoadImage(imm[11]) img[mg]=ImageList.LoadImage(imm[12]) img[al]=ImageList.LoadImage(imm[13]) img[Si]=ImageList.LoadImage(imm[14]) img[p ]=ImageList.LoadImage(imm[15]) img[s ]=ImageList.LoadImage(imm[16]) img[cl]=ImageList.LoadImage(imm[17]) ss=LDShapes.GetAllShapes () For x=1 To Array.GetItemCount (ss) LDShapes.SetSize (ss[x] 28 28) Shapes.Move (ss[x] ldShapes.GetLeft(ss[x])+30 ldShapes.GetTop (ss[x])+30) EndFor Controls.ButtonClicked = OnButtonClick GraphicsWindow.PenWidth=0 rr=Shapes.AddRectangle(900 80) Shapes.Move(rr 0 330) LDShapes.BrushColour(rr "#99ffffff") sh[300]=Shapes.AddText("11") sh[320]=Shapes.AddText("11") sh[340]=Shapes.AddText("11") Shapes.Move(sh[300] 20 340) Shapes.Move(sh[320] 20 360) Shapes.Move(sh[340] 20 380) int="true lcb=Na OnButtonClick() Sub OnButtonClick if int Then int="false else lcb=Controls.LastClickedButton EndIf LDGraphicsWindow.BackgroundImage(img[lcb]) If lcb = H Then ldcall.function2("dtx" 300,"Element=Hydrogen. Atomic number=1. Atomic radius=0.37. Bonding radius=0.32.") ldcall.function2("dtx" 320,"Atomic weight=1.00794. Density=0.0899. First outer shell=1. Boiling point=20.268(K).") ldcall.function2("dtx" 340,"Melting point=14.025(K). Electronegativity(Pauling's)=2.10") ElseIf lcb = Li Then ldcall.function2("dtx" 300,"Element=Lithium. Atomic number=3. Atomic radius=1.52. Bonding radius=1.23.") ldcall.function2("dtx" 320,"Atomic weight=6.941. Density=0.534. First outer shell=1. Boiling point=1615(K).") ldcall.function2("dtx" 340, "Melting point=453.7(K). Electronegativity(Pauling's)=0.98.") ElseIf lcb = Na Then ldcall.function2("dtx" 300,"Element=Sodium. Atomic number=11. Atomic radius=1.90. Bonding radius=1.23.") ldcall.function2("dtx" 320,"Atomic weight=22.98977. Density=0.97. First outer shell=1. Boiling point=1156(K).") ldcall.function2("dtx" 340,"Melting point=371(K). Electronegativity(Pauling's)=0.93.") ElseIf lcb = K Then ldcall.function2("dtx" 300,"Element=Potassium. Atomic number=19. Atomic radius=2.35. Bonding radius=2.03.") ldcall.function2("dtx" 320,"Atomic weight=39.0983. Density=0.86. First outer shell=8. Second outer shell=1.") ldcall.function2("dtx" 340,"Boiling point=1032(K). Melting point=336.35(K). Electronegativity(Pauling's)=0.82.") ElseIf lcb = Rb Then ldcall.function2("dtx" 300,"Element=Rubidium. Atomic number=37. Atomic radius=2.48. Bonding radius=2.16.") ldcall.function2("dtx" 320,"Atomic weight=85.4678. Density=1.532. First outer shell=8. Second outer shell=1.") ldcall.function2("dtx" 340,"Boiling point=961(K). Melting point=312.64(K). Electronegativity(Pauling's)=0.82.") ElseIf lcb = Cs Then ldcall.function2("dtx" 300,"Element=Cesium. Atomic number=55. Atomic radius=2.67. Bonding radius=2.35.") ldcall.function2("dtx" 320,"Atomic weight=132.90545.Density=1.8785. First outer shell=18.") ldcall.function2("dtx" 340,"Second outer shell=8. Third outer shell=1. Boiling point=944(K).") ldcall.function2("dtx" 360,"Melting point=301.55. Electronegativity(Pauling's)=0.79.") ElseIf lcb = Fr Then ldcall.function2("dtx" 300,"Element=Francium. Atomic number=87. Atomic radius=2.70. Atomic weight=223.") ldcall.function2("dtx" 320,"Density=2.41. First outer shell=18. Second outer shell=8. Third outer shell=1.") ldcall.function2("dtx" 340,"Boiling point=950(K). Melting point=300.2(K). Electronegativity(Pauling's)=0.70.") ElseIf lcb = Be Then ldcall.function2("dtx" 300,"Element=Beryllium. Atomic number=4. Atomic radius=1.12. Bonding radius=0.90.") ldcall.function2("dtx" 320,"Atomic weight=9.01218. Density=1.85. First outer shell=2. Boiling point=2745(K).") ldcall.function2("dtx" 340,"Melting point=1560(K). Electronegativity(Pauling's)=1.57.") ElseIf lcb = Mg Then ldcall.function2("dtx" 300,"Element=Magnesium. Atomic number=12. Atomic radius=1.60. Bonding radius=1.36.") ldcall.function2("dtx" 320,"Atomic weight=24.3050. Density=1.74. First outer shell=2. Boiling point=1363(K).") ldcall.function2("dtx" 340,"Melting point=922(K). Electronegativity(Pauling's)=1.31.") ElseIf lcb = Ca Then ldcall.function2("dtx" 300,"Element=Calcium. Atomic number=20. Atomic radius=1.97. Bonding radius=1.74.") ldcall.function2("dtx" 320,"Atomic weight=40.078. Density=1.54. First outer shell=8. Second outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=1757(K). Melting point=1112(K). Electronegativity(Pauling's)=1.00.") ElseIf lcb = Sr Then ldcall.function2("dtx" 300,"Element=Strontium. Atomic number=38. Atomic radius=2.15. Bonding radius=1.91.") ldcall.function2("dtx" 320,"Atomic weight=87.62. Density=2.6. First outer shell=8. Second outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=1650(K). Melting point=1041(K). Electronegativity(Pauling's)=0.95.") ElseIf lcb = Ba Then ldcall.function2("dtx" 300,"Element=Barium. Atomic number=56. Atomic radius=2.22. Bonding radius=1.98.") ldcall.function2("dtx" 320,"Atomic weight=137.327. Density=3.51. First outer shell=18. Second outer shell=8.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=2171(K). Melting point=1002(K). Electronegativity(Pauling's)=0.89.") ElseIf lcb = Ra Then ldcall.function2("dtx" 300,"Element=Radium. Atomic number=88. Atomic radius=2.33. Atomic weight=226. Density=5.") ldcall.function2("dtx" 320,"First outer shell=18. Second outer shell=8. Third outer shell=2. Boiling point=2010(K).") ldcall.function2("dtx" 340,"Melting point=973(K). Electronegativity(Pauling's)=0.89.") ElseIf lcb = Sc Then ldcall.function2("dtx" 300,"Element=Scandium. Atomic number=21. Atomic Radius=1.62. Bonding radius=1.44. Density=2.9890.") ldcall.function2("dtx" 320,"First outer shell=9. Second outer shell=2. Boiling point=3104(K). Melting point=1812(K).") ldcall.function2("dtx" 340,"Atomic weight=44.95591. Electronegativity(Pauling's)=1.36.") ElseIf lcb = Y Then ldcall.function2("dtx" 300,"Element=Yttrium. Atomic number=39. Atomic radius=1.78. Bonding radius=1.62. Density=4.4689.") ldcall.function2("dtx" 320," Atomic weight=88.90585. First outer shell=9. Second outer shell=2. Boiling point=3611(K).") ldcall.function2("dtx" 340,"Melting point=1799(K). Electronegativity(Pauling's)=1.22.") ElseIf lcb = Ti Then ldcall.function2("dtx" 300,"Element=Titanium. Atomic number=22. Atomic radius=1.45. Atomic weight=47.867.") ldcall.function2("dtx" 320,"Bonding radius=1.32. Density=4.54. First outer shell=10. Second outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=3562(K). Melting point=1943(K).Electronegativity(Pauling's)=1.54.") ElseIf lcb = Zr Then ldcall.function2("dtx" 300,"Element=Zirconium. Atomic number=40. Atomic radius=1.60. Atomic weight=91.224.") ldcall.function2("dtx" 320,"Bonding radius=1.45. Density=6.49. First outer shell=10. Second outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=4682(K). Melting point=2125(K). Electronegativity(Pauling's)=1.33.") ElseIf lcb = Hf Then ldcall.function2("dtx" 300,"Element=Hafnium. Atomic number=72. Atomic radius=1.67. Atomic weight=178.49.") ldcall.function2("dtx" 320,"Bonding radius=1.44. Density=13.31. First outer shell=32. Second outer shell=10.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=4876(K). Melting point=2500(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=1.30.") ElseIf lcb = Rf Then ldcall.function2("dtx" 300,"Element=Rutherfordium. Atomic number=104. Atomic radius=?. Bonding radius=?.") ldcall.function2("dtx" 320,"Atomic weight=261. Density=17. First outer shell=?. Boiling point=?.") ldcall.function2("dtx" 340,"Atomic weight=261. Melting point=?. Electronegativity=?.") ElseIf lcb = V Then ldcall.function2("dtx" 300,"Element=Vanadium. Atomic number=23. Atomic radius=1.34. Atomic weight=50.9415.") ldcall.function2("dtx" 320,"Bonding radius=1.22. Density=5.96. First outer shell=11. Second outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=3682(K). Melting point=2175(K). Electronegativity(Pauling's)=1.63.") ElseIf lcb = Nb Then ldcall.function2("dtx" 300,"Element=Niobium. Atomic number=41. Atomic radius=1.46. Atomic weight=92.90638.") ldcall.function2("dtx" 320,"Bonding radius=1.34. Density=8.57. First outer shell=12. Second outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=5017(K). Melting point=2740(K). Electronegativity(Pauling's)=1.60.") ElseIf lcb = Ta Then ldcall.function2("dtx" 300,"Element=Tantalum. Atomic number=73. Atomic radius=1.49. Atomic weight=180.9479.") ldcall.function2("dtx" 320,"Bonding radius=1.34. Density=16.6. First outer shell=32. Second outer shell=11.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=5731(K). Melting point=3287(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=1.50.") ElseIf lcb = Db Then ldcall.function2("dtx" 300,"Element=Dubnium. Atomic number=105. Atomic radius=?. Atomic weight=262.") ldcall.function2("dtx" 320,"Bonding radius=?. Density=21.6. First outer shell=?. Boiling point=?.") ldcall.function2("dtx" 340,"Melting point=?. Electronegativity(Pauling's)=?.") ElseIf lcb = Cr Then ldcall.function2("dtx" 300,"Element=Chromium. Atomic number=24. Atomic radius=1.30. Atomic weight=51.9961.") ldcall.function2("dtx" 320,"Bonding radius=1.18. Density=7.20. First outer shell=13. Second outer shell=1.") ldcall.function2("dtx" 340,"Boiling point=2945(K). Melting point=2130(K). Electronegativity(Pauling's)=1.66.") ElseIf lcb = Mo Then ldcall.function2("dtx" 300,"Element=Molybdenum. Atomic number=42. Atomic radius=1.39. Atomic weight=95.94.") ldcall.function2("dtx" 320,"Bonding radius=1.30. Density=10.2. First outer shell=13. Second outer shell=1.") ldcall.function2("dtx" 340,"Boiling point=4912(K), Melting point=2890(K). Electronegativity(Pauling's)=2.16.") ElseIf lcb = W Then ldcall.function2("dtx" 300,"Element=Tungsten. Atomic number=74. Atomic radius=1.41. Atomic weight=183.84.") ldcall.function2("dtx" 320,"Bonding radius=1.30. Density=19.35. First outer shell=32. Second outer shell=12.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=5828(K). Melting point=3680(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)= 2.36.") ElseIf lcb = Sg Then ldcall.function2("dtx" 300,"Element=Seaborgium. Atomic number=106. Atomic radius=?. Atomic weight=266.") ldcall.function2("dtx" 320,"Bonding radius=?. Density=23.2. First outer shell-?. Boiling point=?.") ldcall.function2("dtx" 340,"Melting point=?. Electronegativity(Pauling's)=?.") ElseIf lcb = Mn Then ldcall.function2("dtx" 300,"Element=Manganese. Atomic number=25. Atomic radius=1.35. Atomic weight=54.93805.") ldcall.function2("dtx" 320,"Bonding radius=1.17. Density=7.20. First outer shell=13. Second outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=2335(K). Melting point=1517(K). Electronegativity(Pauling's)=1.55.") ElseIf lcb = Tc Then ldcall.function2("dtx" 300,"Element=Technetium. Atomic number=43. Atomic radius=1.36. Atomic weight=98.") ldcall.function2("dtx" 320,"Bonding radius=1.27. Density=11.50. First outer shell=13. Second outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=4538(K). Melting point=2473(K). Electronegativity(Pauling's)=1.90.") ElseIf lcb = Re Then ldcall.function2("dtx" 300,"Element=Rhenium. Atomic number=75. Atomic radius=1.37. Atomic weight=186.207.") ldcall.function2("dtx" 320,"Bonding radius=1.28. Density=20.53. First outer shell=32. Second outer shell=13.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=5869(K). Melting point=3453(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=1.90.") ElseIf lcb = Bh Then ldcall.function2("dtx" 300,"Element=Bohrium. Atomic number=107. Atomic radius=?. Atomic weight=264.") ldcall.function2("dtx" 320,"Bonding radius=?. Density=27.2. First outer shell=?. Boiling point=?.") ldcall.function2("dtx" 340,"Melting point=?. Electronegativity(Pauling's)=?.") ElseIf lcb = Fe Then ldcall.function2("dtx" 300,"Element=Iron. Atomic number=26. Atomic radius=1.26. Atomic weight=55.845.") ldcall.function2("dtx" 320,"Bonding radius=1.17. Density=7.86. First outer shell=14. Second outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=3135(K). Melting point=1809(K). Electronegativity(Pauling's)=1.83.") ElseIf lcb = Ru Then ldcall.function2("dtx" 300,"Element=Ruthenium. Atomic number=44. Atomic radius=1.34. Atomic weight=101.07.") ldcall.function2("dtx" 320,"Bonding radius=1.25. Density=12.30. First outer shell=15. Second outer shell=1.") ldcall.function2("dtx" 340,"Boiling point=4423(K). Melting point=2523(K). ELectronegativity(Pauling's)=2.20.") ElseIf lcb = Os Then ldcall.function2("dtx" 300,"Element=Osmium. Atomic number=76. Atomic radius=1.35. Atomic weight=190.23.") ldcall.function2("dtx" 320,"Bonding radius=1.26. Density=22.48. First outer shell=32. Second outer shell=14.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=5285(K). Melting point=3300(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=2.20.") ElseIf lcb = Hs Then ldcall.function2("dtx" 300,"Element=Hassium. Atomic number=108. Atomic radius=? Atomic weight=269.") ldcall.function2("dtx" 320,"Bonding radius=? Density=28.6. First outer shell=? Boiling point=?.") ldcall.function2("dtx" 340,"Melting point=? Electronegativity(Pauling's)=?") ElseIf lcb = Co Then ldcall.function2("dtx" 300,"Element=Cobalt. Atomic number=27. Atomic radius=1.25. Atomic weight=58.93320.") ldcall.function2("dtx" 320,"Bonding radius=1.16. Density=8.9. First outer shell=15. Second outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=3201(K). Melting point=1768(K). Electronegativity(Pauling's)=1.88.") ElseIf lcb = Rh Then ldcall.function2("dtx" 300,"Element=Rhodium. Atomic number=45. Atomic radius=1.34. Atomic weight=102.90550.") ldcall.function2("dtx" 320,"Bonding radius=1.25. Density=12.4. First outer shell=16. Second outer shell=1.") ldcall.function2("dtx" 340,"Boiling point=3970(K). Melting point=2236(K). Electronegativity(Pauling's)=2.28.") ElseIf lcb = Ir Then ldcall.function2("dtx" 300,"Element=Iridium. Atomic number=77. Atomic radius=1.36. Atomic weight=192.217.") ldcall.function2("dtx" 320,"Bonding radius=1.27. Density=22.421. First outer shell=32. Second outer shell=15.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=4701(K). Melting point=2716(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=2.20.") ElseIf lcb = Mt Then ldcall.function2("dtx" 300,"Element=Meitnerium. Atomic number=109. Atomic radius=? Atomic weight=268.") ldcall.function2("dtx" 320,"Bonding radius=? Density=28.2. First outer shell=?. Boiling point=?") ldcall.function2("dtx" 340,"Melting point=? Electronegativity(Pauling's)=?") ElseIf lcb = Ni Then ldcall.function2("dtx" 300,"Element=Nickel. Atomic number=28. Atomic radius=1.24. Atomic weight=58.6934.") ldcall.function2("dtx" 320,"Bonding radius=1.15. Density=8.90. First outer shell=16. Second outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=3187(K). Melting point=1726(K). Electronegativity(Pauling's)=1.91.") ElseIf lcb = Pd Then ldcall.function2("dtx" 300,"Element=Palladium. Atomic number=46. Atomic radius=1.37. Atomic weight=106.42.") ldcall.function2("dtx" 320,"Bonding radius=1.28. Density=12.02. First outer shell=18. Second outer shell=0.") ldcall.function2("dtx" 340,"Boiling point=3236(K). Melting point=1825(K). Electronegativity(Pauling's)=2.20.") ElseIf lcb = Pt Then ldcall.function2("dtx" 300,"Element=Platinum. Atomic number=78. Atomic radius=1.39. Atomic weight=195.078.") ldcall.function2("dtx" 320,"Bonding radius=1.30. Density=21.45. First outer shell=32. Second outer shell=17.") ldcall.function2("dtx" 340,"Third outer shell=1. Boiling point=4100(K). Melting point=2045(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=2.28.") ElseIf lcb = Ds Then ldcall.function2("dtx" 300,"Element=Darmstadtium. Atomic number=110. Atomic radius=? Atomic weight=271.") ldcall.function2("dtx" 320,"Bonding radius=? Density=27.4. First outer shell=? Boiling point=? Melting point=?") ldcall.function2("dtx" 340,"Electronegativity(Pauling's)=?") ElseIf lcb = Cu Then ldcall.function2("dtx" 300,"Element=Copper. Atomic number=29. Atomic radius=1.28. Atomic weight=63.546.") ldcall.function2("dtx" 320,"Bonding radius=1.17. Density=8.92. First outer shell=18. Second outer shell=1.") ldcall.function2("dtx" 340,"Boiling point=3836(K). Melting point=1357.6(K). Electronegativity(Pauling's)=1.90.") ElseIf lcb = Ag Then ldcall.function2("dtx" 300,"Element=Silver. Atomic number=47. Atomic radius=1.44. Atomic weight=107.8682.") ldcall.function2("dtx" 320,"Bonding radius=1.34. Density=10.5. First outer shell=18. Second outer shell=1.") ldcall.function2("dtx" 340,"Boiling point=2436(K). Melting point=1234(K). Electronegativity(Pauling's)=1.93.") ElseIf lcb = Au Then ldcall.function2("dtx" 300,"Element=Gold. Atomic number=79. Atomic radius=1.46. Atomic weight=196.9655.") ldcall.function2("dtx" 320,"Bonding radius=1.34. Density=18.88. First outer shell=32. Second outer shell=18.") ldcall.function2("dtx" 340,"Third outer shell=1. Boiling point=3130(K). Melting point=1337.58(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=2.54.") ElseIf lcb = Rg Then ldcall.function2("dtx" 300,"Element=Roentgenium. Atomic number=111. Atomic radius=? Atomic weight=272.") ldcall.function2("dtx" 320,"Bonding radius=? Density=24.4. First outer shell=?. Boiling point=?.") ldcall.function2("dtx" 340,"Melting point=? Electronegativity(Pauling's)=?") ElseIf lcb = Zn Then ldcall.function2("dtx" 300,"Element=Zinc. Atomic number=30. Atomic radius=1.38. Atomic weight=65.39.") ldcall.function2("dtx" 320,"Bonding radius=1.25. Density=7.14. First outer shell=18. Second outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=1180(K). Melting point=692.73(K). Electronegativity(Pauling's)=1.65.") ElseIf lcb = Cd Then ldcall.function2("dtx" 300,"Element=Cadmium. Atomic number=48. Atomic radius=1.71. Atomic weight=112.411.") ldcall.function2("dtx" 320,"Bonding radius=1.48. Density=8.642. First outer shell=18. Second outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=1040(K). Melting point=594.18(K). Electronegativity(Pauling's)=1.69.") ElseIf lcb = Hg Then ldcall.function2("dtx" 300,"Element=Mercury. Atomic number=80. Atomic radius=1.60. Atomic weight=200.59.") ldcall.function2("dtx" 320,"Bonding radius=1.49. Density=13.594. First outer shell=32. Second outer shell=18.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=630(K). Melting point=234.28.") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=2.00.") ElseIf lcb = Cn Then ldcall.function2("dtx" 300,"Element=Copernicium. Atomic number=112. Atomic radius=? Atomic weight=277.") ldcall.function2("dtx" 320,"Bonding radius=? Density=16.8. First outer shell=? Boiling point=?") ldcall.function2("dtx" 340,"Melting point=? Electronegativity(Pauling's)=?") ElseIf lcb = B Then ldcall.function2("dtx" 300,"Element=Boron. Atomic number=5. Atomic radius=0.98. Atomic weight=10.811.") ldcall.function2("dtx" 320,"Bonding radius=0.82. Density=2.34. First outer shell=3. Boiling point=4275(K).") ldcall.function2("dtx" 340,"Melting point=2300(K). Electronegativity(Pauling's)=2.04.") ElseIf lcb = Al Then ldcall.function2("dtx" 300,"Element=Aluminium. Atomic number=13. Atomic radius=1.43. Atomic weight=26.98154.") ldcall.function2("dtx" 320,"Bonding radius=1.18. Density=2.702. First outer shell=3. Boiling point=2740(K).") ldcall.function2("dtx" 340,"Melting point=933.25. Electronegativity(Pauling's)=1.61.") ElseIf lcb = Ga Then ldcall.function2("dtx" 300,"Element=Gallium. Atomic number=31. Atomic radius=1.41. Atomic weight=69.723.") ldcall.function2("dtx" 320,"Bonding radius=1.26. Density=5.904. First outer shell=18. Second outer shell=3.") ldcall.function2("dtx" 340,"Boiling point=2478(K). Melting point=302.9(K). Electronegativity(Pauling's)=1.81.") ElseIf lcb = In Then ldcall.function2("dtx" 300,"Element=Indium. Atomic number=49. Atomic radius=1.66. Atomic weight=114.818.") ldcall.function2("dtx" 320,"Bonding radius=1.44. Density=7.30. First outer shell=18. Second outer shell=3.") ldcall.function2("dtx" 340,"Boiling point=2346(K). Melting point=429.76(K). Electronegativity(Pauling's)=1.78.") ElseIf lcb = Tl Then ldcall.function2("dtx" 300,"Element=Thallium. Atomic number=81. Atomic radius=1.71. Atomic weight=204.3833.") ldcall.function2("dtx" 320,"Bonding radius=1.48. Density=11.85. First outer shell=32. Second outer shell=18.") ldcall.function2("dtx" 340,"Third outer shell=3. Boiling point=1746(K). Melting point=577(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=2.04.") ElseIf lcb = Uut Then ldcall.function2("dtx" 300,"Element=Unutrium. Atomic number=113. Atomic radius=? Atomic weight=?") ldcall.function2("dtx" 320,"Bonding radius=? Demsity=16? First outer shell=? Boiling point=?") ldcall.function2("dtx" 340,"Melting point=? Electronegativity(Pauling's)=?") ElseIf lcb = C Then ldcall.function2("dtx" 300,"Element=Carbon. Atomic number=6. Atomic radius=0.91. Atomic weight=12.0107.") ldcall.function2("dtx" 320,"Bonding radius=0.77. Density=2.25. First outer shell=4. Boiling point=5100(K).") ldcall.function2("dtx" 340,"Melting point=3823(K). Electronegativity(Pauling's)=2.55.") ElseIf lcb = Si Then ldcall.function2("dtx" 300,"Element=Silicon. Atomic number=14. Atomic radius=1.32. Atomic weight=28.0855.") ldcall.function2("dtx" 320,"Bonding radius=1.11. Density=2.33. First outer shell=4. Boiling point=3540(K).") ldcall.function2("dtx" 340,"Melting point=1685(K). Electronegativity(Pauling's)=1.90.") ElseIf lcb = Ge Then ldcall.function2("dtx" 300,"Element=Germanium. Atomic number=32. Atomic radius=1.37. Atomic weight=72.61.") ldcall.function2("dtx" 320,"Bonding radius=1.22. Density=5.35. First outer shell=18. Second outer shell=4.") ldcall.function2("dtx" 340,"Boiling point=3107(K). Melting point=1210.4(K). Electronegativity(Pauling's)=2.01.") ElseIf lcb = Sn Then ldcall.function2("dtx" 300,"Element=Tin. Atomic number=50. Atomic radius=1.62. Atomic weight=118.710.") ldcall.function2("dtx" 320,"Bonding radius=1.41. Density=7.28. First outer shell=18. Second outer shell=4.") ldcall.function2("dtx" 340,"Boiling point=2876(K). Melting point=505.06(K). Electronegativity(Pauling's)=1.96.") ElseIf lcb = Pb Then ldcall.function2("dtx" 300,"Element=Lead. Atomic number=82. Atomic radius=1.75. Atomic weight=207.2.") ldcall.function2("dtx" 320,"Bonding radius=1.47. Density=11.3437. First outer shell=32. Second outer shell=18.") ldcall.function2("dtx" 340,"Third outer shell=4. Boiling point=2023(K). Melting point=600.6(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=2.33.") ElseIf lcb = Fl Then ldcall.function2("dtx" 300,"Element=Flerovium. Atomic number=114. Atomic radius=? Atomic weight=289.") ldcall.function2("dtx" 320,"Bonding radius=? Density=14. First outer shell=? Boiling point=?") ldcall.function2("dtx" 340,"Melting point=? Electronegativity(Pauling's)=?") ElseIf lcb = N Then ldcall.function2("dtx" 300,"Element=Nitrogen. Atomic number=7. Atomic radius=0.92. Atomic weight=10.00674.") ldcall.function2("dtx" 320,"Bonding radius=0.75. Density=1.2506. First outer shell=5. Boiling point=77.35(K).") ldcall.function2("dtx" 340,"Melting point=63.14(K). Electronegativity(Pauling's)=3.04.") ElseIf lcb = P Then ldcall.function2("dtx" 300,"Element=Phosphorus. Atomic number=15. Atomic radius=1.28. Atomic weight=30.97376.") ldcall.function2("dtx" 320,"Bonding radius=1.06. Density=1.82. First outer shell=5. Boiling point=550(K).") ldcall.function2("dtx" 340,"Melting point=317.3(K). Electronegativity(Pauling's)=2.19.") ElseIf lcb = As Then ldcall.function2("dtx" 300,"Element=Arsenic. Atomic number=33. Atomic radius=1.39. Atomic weight=74.92160.") ldcall.function2("dtx" 320,"Bonding radius=1.20. Density=5.727. First outer shell=18. Second outer shell=5.") ldcall.function2("dtx" 340,"Boiling point=886(K). Melting point=1091(K). Electronegativity(Pauling's)=2.18.") ElseIf lcb = Sb Then ldcall.function2("dtx" 300,"Element=Antimony. Atomic number=51. Atomic radius=1.59. Atomic weight=121.760.") ldcall.function2("dtx" 320,"Bonding radius=1.40. Density=6.684. First outer shell=18. Second outer shell=5.") ldcall.function2("dtx" 340,"Boiling point=1860(K). Melting point=904(K). Electronegativity(Pauling's)=2.05.") ElseIf lcb = Bi Then ldcall.function2("dtx" 300,"Element=Bismuth. Atomic number=83. Atomic radius=1.70. Atomic weight=208.98038.") ldcall.function2("dtx" 320,"Bonding radius=1.46. Density=9.80. First outer shell=32. Second outer shell=18.") ldcall.function2("dtx" 340,"Third outer shell=5. Boiling point=1837(K). Melting point=544.52(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=2.02.") ElseIf lcb = Uup Then ldcall.function2("dtx" 300,"Element=Moscovium. Atomic number=115. Atomic radius=? Atomic weight=?") ldcall.function2("dtx" 320,"Bonding radius=? Density=13.5? First outer shell=? Boiling point=?") ldcall.function2("dtx" 340,"Melting point=? Electronegativity(Pauling's)=?") ElseIf lcb = O Then ldcall.function2("dtx" 300,"Element=Oxygen. Atomic number=8. Atomic radius=0.65. Atomic weight=15.9994.") ldcall.function2("dtx" 320,"Bonding radius=0.73. Density=1.429. First outer shell=6. Boiling point=90.18(K).") ldcall.function2("dtx" 340,"Melting point=50.35(K). Electronegativity(Pauling's)=3.44.") ElseIf lcb = S Then ldcall.function2("dtx" 300,"Element=Sulfur. Atomic number=16. Atomic radius=1.27. Atomic weight=32.066.") ldcall.function2("dtx" 320,"Bonding radius=1.02. Density=2.07. First outer shell=6. Boiling point=717.75(K).") ldcall.function2("dtx" 340,"Melting point=388.36(K). Electronegativity(Pauling's)=2.58.") ElseIf lcb = Se Then ldcall.function2("dtx" 300,"Element=Selenium. Atomic number=34. Atomic radius=1.40. Atomic weight=78.96.") ldcall.function2("dtx" 320,"Bonding radius=1.16. Density=4.81. First outer shell=18. Second outer shell=6.") ldcall.function2("dtx" 340,"Boiling point=958(K). Melting point=494(K). Electronegativity(Pauling's)=2.55.") ElseIf lcb = Te Then ldcall.function2("dtx" 300,"Element=Tellurium. Atomic number=52. Atomic radius=1.42. Atomic weight=127.60.") ldcall.function2("dtx" 320,"Bonding radius=1.36. Density=6.25. First outer shell=18. Second outer shell=6.") ldcall.function2("dtx" 340,"Boiling point=1261(K). Melting point=722.65(K). Electronegativity(Pauling's)=2.10.") ElseIf lcb = Po Then ldcall.function2("dtx" 300,"Element=Polonium. Atomic number=84. Atomic radius=1.67. Atomic weight=209.") ldcall.function2("dtx" 320,"Bonding radius=1.46. Density=9.4. First outer shell=32. Second outer shell=18.") ldcall.function2("dtx" 340,"Third outer shell=6. Boiling point=1235(K). Melting point=527(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=2.00.") ElseIf lcb = Lv Then ldcall.function2("dtx" 300,"Element=Livermorium. Atomic number=116. Atomic radius=? Atomic weight=289.") ldcall.function2("dtx" 320,"Bonding radius=? Density=12.9. First outer shell=? Boiling point=?") ldcall.function2("dtx" 340,"Melting point=? Electronegativity(Pauling's)=?") ElseIf lcb = F Then ldcall.function2("dtx" 300,"Element=Flourine. Atomic number=9. Atomic radius=0.57. Atomic weight=18.99840.") ldcall.function2("dtx" 320,"Bonding radius=0.72. Density=1.696. First outer shell=7. Boiling point=84.95(K).") ldcall.function2("dtx" 340,"Melting point=53.48(K). Electronegativity(Pauling's)=3.98.") ElseIf lcb = Cl Then ldcall.function2("dtx" 300,"Element=Chlorine. Atomic number=17. Atomic radius=0.97. Atomic weight=35.4527.") ldcall.function2("dtx" 320,"Bonding radius=0.99. Density=3.214. First outer shell=7. Boiling point=239.1(K).") ldcall.function2("dtx" 340,"Melting point=172.16(K). Electronegativity(Pauling's)=3.16.") ElseIf lcb = Br Then ldcall.function2("dtx" 300,"Element=Bromine. Atomic number=35. Atomic radius=1.12. Atomic weight=79.904.") ldcall.function2("dtx" 320,"Bonding radius=1.14. Density=3.119. First outer shell=18. Second outer shell=7.") ldcall.function2("dtx" 340,"Boiling point=332.25(K). Melting point=265.9(K). Electronegativity(Pauling's)=2.96.") ElseIf lcb = I Then ldcall.function2("dtx" 300,"Element=Iodine. Atomic number=53. Atomic radius=1.32. Atomic weight=126.90447.") ldcall.function2("dtx" 320,"Bonding radius=1.33. Density=4.93. First outer shell=18. Second outer shell=7.") ldcall.function2("dtx" 340,"Boiling point=458.4(K). Melting point=386.7(K). Electronegativity(Pauling's)=2.66.") ElseIf lcb = At Then ldcall.function2("dtx" 300,"Element=Astatine. Atomic number=85. Atomic radius=1.45. Atomic weight=210.") ldcall.function2("dtx" 320,"Bonding radius=1.45. Density=? First outer shell=32. Second outer shell=19.") ldcall.function2("dtx" 340,"Third outer shell=7. Boiling point=610(K). Melting point=575(K).") ElseIf lcb = Uus Then ldcall.function2("dtx" 300,"Element=Tennessine. Atomic number=117. Atomic radius=? Atomic weight=?") ldcall.function2("dtx" 320,"Bonding radius=? Density=? First outer shell? Boiling point=?") ldcall.function2("dtx" 340,"Melting point=? Electronegativity(Pauling's)=?") ElseIf lcb = He Then ldcall.function2("dtx" 300,"Element=Helium. Atomic number=2. Atomic radius=0.50. Atomic weight=4.00260.") ldcall.function2("dtx" 320,"Bonding radius=0.93. Density=0.1785. First outer shell=2. Boiling point=4.215(K).") ldcall.function2("dtx" 340,"Melting point=0.95(K). Electronegativity(Pauling's)=0.") ElseIf lcb = Ne Then ldcall.function2("dtx" 300,"Element=Neon. Atomic number=10. Atomic radius=0.51. Atomic weight=20.1797.") ldcall.function2("dtx" 320,"Bonding radius=0.71. Density=0.9002. First outer shell=8. Boiling point=27.096(K).") ldcall.function2("dtx" 340,"Melting point=24.553(K). Electronegativity(Pauling's)=0.") ElseIf lcb = Ar Then ldcall.function2("dtx" 300,"Element=Argon. Atomic number=18. Atomic radius=0.88. Atomic weight=39.948.") ldcall.function2("dtx" 320,"Bonding radius=0.98. Density=1.784. First outer shell=8. Boiling point=87.3(K).") ldcall.function2("dtx" 340,"Melting point=83.81(K). Electronegativity(Pauling's)=0.") ElseIf lcb = Kr Then ldcall.function2("dtx" 300,"Element=Krypton. Atomic number=36. Atomic radius=1.03. Atomic weight=1.12.") ldcall.function2("dtx" 320,"Bonding radius=1.12. Density=3.733. First outer shell=18. Second outer shell=8.") ldcall.function2("dtx" 340,"Boiling point=119.8(K). Melting point=115.78(K). Electronegativity(Pauling's)=0.") ElseIf lcb = Xe Then ldcall.function2("dtx" 300,"Element=Xenon. Atomic number=54. Atomic radius=1.54. Atomic weight=131.29.") ldcall.function2("dtx" 320,"Bonding radius=1.31. Density=5.887. First outer shell=18. Second outer shell=8.") ldcall.function2("dtx" 340,"Boiling point=165.03(K). Melting point=161,36(K). Electronegativity(Pauling's)=2.60.") ElseIf lcb = Rn Then ldcall.function2("dtx" 300,"Element=Radon. Atomic number=86. Atomic radius=1.34. Atomic weight=222.") ldcall.function2("dtx" 320,"Density=9.73. First outer shell=32. Second outer shell=18. Third outer shell=8.") ldcall.function2("dtx" 340,"Boiling point=211(K). Melting point=202(K).Electronegativity(Pauling's)=0.") ElseIf lcb = Uuo Then ldcall.function2("dtx" 300,"Element=Oganesson. Atomic number=118. Atomic radius=? Atomic weight=293.") ldcall.function2("dtx" 320,"Bonding radius=? Density=? First outer shell=? Boiling point=? Melting point=?") ldcall.function2("dtx" 340,"Electronegativity(Pauling's)=?") ElseIf lcb = La Then ldcall.function2("dtx" 300,"Element=Lanthanum. Atomic number=57. Atomic radius=1.38. Atomic weight=138.9055.") ldcall.function2("dtx" 320,"Bonding radius=1.69. Density=6.1453. First outer shell=18. Second outer shell=9.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=3730(K). Melting point=1193(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=1.10.") ElseIf lcb = Ac Then ldcall.function2("dtx" 300,"Element=Actinium. Atomic number=89. Atomic radius=1.88. Atomic weight=227.") ldcall.function2("dtx" 320,"Density=10.07. First outer shell=18. Second outer shell=9. Third outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=3473(K). Melting point=1323(K). Electronegativity(Pauling's)=1.10.") ElseIf lcb = Ce Then ldcall.function2("dtx" 300,"Element=Cerium. Atomic number=58. Atomic radius=1.81. Atomic weight=140.116.") ldcall.function2("dtx" 320,"Bonding radius=1.65. Density=6.657. First outer shell=20. Second outer shell=8.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=3699(K). Melting point=1071(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=1.12.") ElseIf lcb = Th Then ldcall.function2("dtx" 300,"Element=Thorium. Atomic number=90. Atomic radius=1.80. Atomic weight=232.0381.") ldcall.function2("dtx" 320,"Bonding radius=1.65. Density=11.7. First outer shell=18. Second outer shell=10.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=5061(K). Melting point=2028(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=1.30.") ElseIf lcb = Pr Then ldcall.function2("dtx" 300,"Element=Praseodymium. Atomic number=59. Atomic radius=1.82. Atomic weight=140.90765.") ldcall.function2("dtx" 320,"Bonding radius=1.65. Density=6.773. First outer shell=21. Second outer shell=8.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=3785(K). Melting point=1204(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=1.13.") ElseIf lcb = Pa Then ldcall.function2("dtx" 300,"Element=Protactinum. Atomic number=91. Atomic radius=1.61. Atomic weight=231.03588.") ldcall.function2("dtx" 320,"Density=15.37. First outer shell=20. Second outer shell=9. Third outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=4500(K). Melting point=1825(K). Electronegativity(Pauling's)=1.50") ElseIf lcb = Nd Then ldcall.function2("dtx" 300,"Element=Neodymium. Atomic number=60. Atomic radius=1.82. Atomic weight=144.24.") ldcall.function2("dtx" 320,"Bonding radius=1.64. Density=7.004. First outer shell=22. Second outer shell=8.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=3341(K). Melting point=1289(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=1.14.") ElseIf lcb = U Then ldcall.function2("dtx" 300,"Element=Uranium. Atomic number=92. Atomic radius=1.38. Atomic weight=238.0289.") ldcall.function2("dtx" 320,"Bonding radius=1.42. Density=19.05. First outer shell=21. Second outer shell=9.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=4407(K). Melting point=1405(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=1.38.") ElseIf lcb = Pm Then ldcall.function2("dtx" 300,"Element=Promethium. Atomic number=61. Atomic radius=1.63. Atomic weight=145.") ldcall.function2("dtx" 320,"Bonding radius=1.63. Density=7.22. First outer shell=23. Second outer shell=8.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=2733(K). Melting point=1441(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=1.13.") ElseIf lcb = Np Then ldcall.function2("dtx" 300,"Element=Neptunium. Atomic number=93. Atomic radius=1.30. Atomic weight=237.") ldcall.function2("dtx" 320,"Density=20.45. First outer shell=22. Second outer shell=9. Third outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=4175(K). Melting point=910(K). Electronegativity(Pauling's)=1.36.") ElseIf lcb = Sm Then ldcall.function2("dtx" 300,"Element=Samarium. Atomic number=62. Atomic radius=1.81. Atomic weight=150.36.") ldcall.function2("dtx" 320,"Bonding radius=1.62. Density=7.520. First outer shell=24. Second outer shell=8.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=2064(K). Melting point=1345(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=1.17.") ElseIf lcb = Pu Then ldcall.function2("dtx" 300,"Element=Plutonium. Atomic number=94. Atomic radius=1.51. Atomic weight=244.") ldcall.function2("dtx" 320,"Density=19.84. First outer shell=23. Second outer shell=9. Third outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=3503(K). Melting point=913(K). Electronegativity(Pauling's)=1.28.") ElseIf lcb = Eu Then ldcall.function2("dtx" 300,"Element=Europium. Atomic number=63. Atomic radius=1.99. Atomic weight=151.964.") ldcall.function2("dtx" 320,"Bonding radius=1.85. Density=5.2434. First outer shell=25. Second outer shell=8.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=1870(K). Melting point=1090(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=1.20.") ElseIf lcb = Am Then ldcall.function2("dtx" 300,"Element=Americium. Atomic number=95. Atomic radius=1.84. Atomic weight=243.") ldcall.function2("dtx" 320,"Density=13.67. First outer shell=25. Second outer shell=8. Third outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=2880(K). Melting point=1268(K).") ElseIf lcb = Gd Then ldcall.function2("dtx" 300,"Element=Gadolinium. Atomic number=64. Atomic radius=1.80. Atomic weight=157.25.") ldcall.function2("dtx" 320,"Bonding radius=1.61. Density=7.9004. First outer shell=25. Second outer shell=9.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=3539(K). Melting point=1585(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=1.20.") ElseIf lcb = Cm Then ldcall.function2("dtx" 300,"Element=Curium. Atomic number=96. Atomic radius=? Atomic weight=247.") ldcall.function2("dtx" 320,"Density=13.51. First outer shell=25. Second outer shell=9. Third outer shell=2.") ldcall.function2("dtx" 340,"Electronegativity(Pauling's)=1.30.") ElseIf lcb = Tb Then ldcall.function2("dtx" 300,"Element=Terbium. Atomic number=65. Atomic radius=1.80. Atomic weight=158.92534.") ldcall.function2("dtx" 320,"Bonding radius=1.59. Density=8.2294. First outer shell=27. Second outer shell=8.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=3496(K). Melting point=1630(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=1.10.") ElseIf lcb = Bk Then ldcall.function2("dtx" 300,"Element=Berkelium. Atomic number=97. Atomic radius=? Atomic weight=247.") ldcall.function2("dtx" 320,"Density=14. First outer shell=26. Second outer shell=9. Third outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=? Melting point=? Electronegativity(Pauling's)=1.30.") ElseIf lcb = Dy Then ldcall.function2("dtx" 300,"Element=Dysprosium. Atomic number=66. Atomic radius=1.80. Atomic weight=162.50.") ldcall.function2("dtx" 320,"Bonding radius=1.59. Density=8.5500. First outer shell=28. Second outer shell=8.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=2835(K). Melting point=1682(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=1.22.") ElseIf lcb = Cf Then ldcall.function2("dtx" 300,"Element=Californium. Atomic number=98. Atomic radius=? Atomic weight=251.") ldcall.function2("dtx" 320,"Density=15.1. First outer shell=27. Second outer shell=9. Third outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=? Melting point=? Electronegativity(Pauling's)=1.30.") ElseIf lcb = Ho Then ldcall.function2("dtx" 300,"Element=Holmium. Atomic number=67. Atomic radius=1.79. Atomic weight=164.93032.") ldcall.function2("dtx" 320,"Bonding radius=1.58. Density=8.7947. First outer shell=29. Second outer shell=8.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=2968(K). Melting point=1743(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=1.23.") ElseIf lcb = Es Then ldcall.function2("dtx" 300,"Element=Einsteinium. Atomic number=99. Atomic radius=? Atomic weight=252.") ldcall.function2("dtx" 320,"Density=? First outer shell=28. Second outer shell=9. Third outer shell=2.") ldcall.function2("dtx" 340,"Electronegativity(Pauling's)=1.30") ElseIf lcb = Er Then ldcall.function2("dtx" 300,"Element=Erbium. Atomic number=68. Atomic radius=1.78. Atomic weight=167.26.") ldcall.function2("dtx" 320,"Bonding radius=1.78. Density=9.006. First outer shell=30. Second outer shell=8.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=3136(K). Melting point=1795(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=1.24.") ElseIf lcb = Fm Then ldcall.function2("dtx" 300,"Element=Fermium. Atomic number=100. Atomic radius=? Atomic weight=257.") ldcall.function2("dtx" 320,"Density=? First outer shell=29. Second outer shell=9. Third outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=? Melting point=? Electronegativity(Pauling's)=1.30.") ElseIf lcb = Tm Then ldcall.function2("dtx" 300,"Element=Thulium. Atomic number=69. Atomic radius=1.77. Atomic weight=168.93421.") ldcall.function2("dtx" 320,"Bonding radius=1.56. Density=9.3208. First outer shell=31. Second outer shell=8.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=2220(K). Melting point=1818(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=1.25.") ElseIf lcb = Md Then ldcall.function2("dtx" 300,"Element=Mendelevium. Atomic number=101. Atomic radius=? Atomic weight=258.") ldcall.function2("dtx" 320,"Density=? First outer shell=30. Second outer shell=9. Third outer shell=2.") ldcall.function2("dtx" 340,"Electronegativity(Pauling's)=1.30.") ElseIf lcb = Yb Then ldcall.function2("dtx" 300,"Element=Ytterbium. Atomic number=70. Atomic radius=1.94. Atomic weight=173.04.") ldcall.function2("dtx" 320,"Bonding radius=1.74. Density=6.9654. First outer shell=32. Second outer shell=8.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=1647(K). Melting point=1097(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=1.10.") ElseIf lcb = No Then ldcall.function2("dtx" 300,"Element=Nobelium. Atomic number=102. Atomic radius=? Atomic weight=259.") ldcall.function2("dtx" 320,"Density=? First outer shell=31. Second outer shell=9. Third outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=? Melting point=? Electronegativity(Pauling's)=1.30.") ElseIf lcb = Lu Then ldcall.function2("dtx" 300,"Element=Lutetium. Atomic number=71. Atomic radius=1.75. Atomic weight=174.967.") ldcall.function2("dtx" 320,"Bonding radius=1.56. Density=9.8404. First outer shell=32. Second outer shell=9.") ldcall.function2("dtx" 340,"Third outer shell=2. Boiling point=3668(K). Melting point=1936(K).") ldcall.function2("dtx" 360,"Electronegativity(Pauling's)=1.27.") ElseIf lcb = Lr Then ldcall.function2("dtx" 300,"Element=Lawrencium. Atomic number=103. Atomic radius=? Atomic weight=262.") ldcall.function2("dtx" 320,"Density=? First outer shell=32. Second outer shell=9. Third outer shell=2.") ldcall.function2("dtx" 340,"Boiling point=? Melting point=? Electronegativity(Pauling's)=?") EndIf EndSub Sub dtx 'GraphicsWindow.BrushColor="teal 'GraphicsWindow.FillRectangle (0 args[1]+35 900 50) 'GraphicsWindow.BrushColor="white Shapes.SetText (Sh[args[1]] args[2]) EndSub 'vcn292-0 End>LTF622-0.sb< Start>LTF622-1.sb< ttt= "Interactive Periodic Table-loading wiki imgs... GraphicsWindow.Title = ttt GraphicsWindow.BackgroundColor="teal args=0 GraphicsWindow.BrushColor="black Sub eset H = Controls.AddButton("H" ,0, 0) He= Controls.AddButton("He",510,0) Li= Controls.AddButton("Li",0, 30) Be= Controls.AddButton("Be",30, 30) B = Controls.AddButton("B" ,360,30) C = Controls.AddButton("C" ,390,30) N = Controls.AddButton("N" ,420,30) O = Controls.AddButton("O" ,450,30) F = Controls.AddButton("F" ,480,30) Ne= Controls.AddButton("Ne",510,30) Na= Controls.AddButton("Na",0, 60) Mg= Controls.AddButton("Mg",30, 60) Al= Controls.AddButton("Al",360,60) Si= Controls.AddButton("Si",390,60) P = Controls.AddButton("P" ,420,60) S = Controls.AddButton("S" ,450,60) Cl= Controls.AddButton("Cl",480,60) Ar= Controls.AddButton("Ar",510,60) K = Controls.AddButton("K" ,0, 90) Ca= Controls.AddButton("Ca",30, 90) Sc= Controls.AddButton("Sc",60, 90) Ti= Controls.AddButton("Ti",90, 90) V = Controls.AddButton("V" ,120,90) Cr= Controls.AddButton("Cr",150,90) Mn= Controls.AddButton("Mn",180,90) Fe= Controls.AddButton("Fe",210,90) Co= Controls.AddButton("Co",240,90) Ni= Controls.AddButton("Ni",270,90) Cu= Controls.AddButton("Cu",300,90) Zn= Controls.AddButton("Zn",330,90) Ga= Controls.AddButton("Ga",360,90) Ge= Controls.AddButton("Ge",390,90) As= Controls.AddButton("As",420,90) Se= Controls.AddButton("Se",450,90) Br= Controls.AddButton("Br",480,90) Kr= Controls.AddButton("Kr",510,90) Rb= Controls.AddButton("Rb",0, 120) Sr= Controls.AddButton("Sr",30, 120) Y = Controls.AddButton("Y", 60, 120) Zr= Controls.AddButton("Zr",90, 120) Nb= Controls.AddButton("Nb",120,120) Mo= Controls.AddButton("Mo",150,120) Tc= Controls.AddButton("Tc",180,120) Ru= Controls.AddButton("Ru",210,120) Rh= Controls.AddButton("Rh",240,120) Pd= Controls.AddButton("Pd",270,120) Ag= Controls.AddButton("Ag",300,120) Cd= Controls.AddButton("Cd",330,120) In= Controls.AddButton("In",360,120) Sn= Controls.AddButton("Sn",390,120) Sb= Controls.AddButton("Sb",420,120) Te= Controls.AddButton("Te",450,120) I = Controls.AddButton("I", 480,120) Xe= Controls.AddButton("Xe",510,120) Cs= Controls.AddButton("Cs",0, 150) Ba= Controls.AddButton("Ba",30, 150) La= Controls.AddButton("La",90, 240) Ce= Controls.AddButton("Ce",120,240) Pr= Controls.AddButton("Pr",150,240) Nd= Controls.AddButton("Nd",180,240) Pm= Controls.AddButton("Pm",210,240) Sm= Controls.AddButton("Sm",240,240) Eu= Controls.AddButton("Eu",270,240) Gd= Controls.AddButton("Gd",300,240) Tb= Controls.AddButton("Tb",330,240) Dy= Controls.AddButton("Dy",360,240) Ho= Controls.AddButton("Ho",390,240) Er= Controls.AddButton("Er",420,240) Tm= Controls.AddButton("Tm",450,240) Yb= Controls.AddButton("Yb",480,240) Lu= Controls.AddButton("Lu",510,240) Hf= Controls.AddButton("Hf",90, 150) Ta= Controls.AddButton("Ta",120,150) W = Controls.AddButton("W", 150,150) Re= Controls.AddButton("Re",180,150) Os= Controls.AddButton("Os",210,150) Ir= Controls.AddButton("Ir",240,150) Pt= Controls.AddButton("Pt",270,150) Au= Controls.AddButton("Au",300,150) Hg= Controls.AddButton("Hg",330,150) Tl= Controls.AddButton("Tl",360,150) Pb= Controls.AddButton("Pb",390,150) Bi= Controls.AddButton("Bi",420,150) Po= Controls.AddButton("Po",450,150) At= Controls.AddButton("At",480,150) Rn= Controls.AddButton("Rn",510,150) Fr= Controls.AddButton("Fr",0, 180) Ra= Controls.AddButton("Ra",30, 180) Ac= Controls.AddButton("Ac",90, 270) Th= Controls.AddButton("Th",120,270) Pa= Controls.AddButton("Pa",150,270) U = Controls.AddButton("U", 180,270) Np= Controls.AddButton("Np",210,270) Pu= Controls.AddButton("Pu",240,270) Am= Controls.AddButton("Am",270,270) Cm= Controls.AddButton("Cm",300,270) Bk= Controls.AddButton("Bk",330,270) Cf= Controls.AddButton("Cf",360,270) Es= Controls.AddButton("Es",390,270) Fm= Controls.AddButton("Fm",420,270) Md= Controls.AddButton("Md",450,270) No= Controls.AddButton("No",480,270) Lr= Controls.AddButton("Lr",510,270) Rf= Controls.AddButton("Rf",90, 180) Db= Controls.AddButton("Db",120,180) Sg= Controls.AddButton("Sg",150,180) Bh= Controls.AddButton("Bh",180,180) Hs= Controls.AddButton("Hs",210,180) Mt= Controls.AddButton("Mt",240,180) Ds= Controls.AddButton("Ds",270,180) Rg= Controls.AddButton("Rg",300,180) Cn= Controls.AddButton("Cn",330,180) Uut= Controls.AddButton("Nh",360,180) Fl= Controls.AddButton("Fl",390,180) Uup= Controls.AddButton("Mc",420,180) Lv= Controls.AddButton("Lv",450,180) Uus= Controls.AddButton("Ts",480,180) Uuo= Controls.AddButton("Og",510,180) EndSub eset() For ff=1 To 118 LDShapes.BrushColour("Button"+ff "transparent") LDEffect.DropShadow("Button"+ff "color=white") EndFor Sub iset f1="http://upload.wikimedia.org/wikipedia/commons/ tt="_and_1cm3_cube.jpg imm[1]=f1+"8/83/Hydrogen_discharge_tube@ imm[2]=f1+"8/82/Helium_discharge_tube@ imm[3]=f1+"a/ae/Lithium_paraffin@ imm[4]=f1+"0/0c/Be-140g@ imm[5]=f1+"1/19/Boron_R105@ imm[6]=f1+"f/f0/Graphite-and-diamond-with-scale@ imm[7]=f1+"d/d2/Liquidnitrogen@ imm[8]=f1+"c/c3/Liquid_oxygen_in_a_beaker_4@ imm[9]=f1+"9/91/Liquid_fluorine_tighter_crop@ imm[10]=f1+"4/46/Neon_discharge_tube@ imm[11]=f1+"2/27/Na_%28Sodium%29@ imm[12]=f1+"5/5c/CSIRO_ScienceImage_2893_`ised_magnesium@ imm[13]=f1+"5/5d/Aluminium-4@ imm[14]=f1+"e/e9/SiliconCroda@ imm[15]=f1+"8/88/PhosphComby@ imm[16]=f1+"4/44/Sulfur-sample@ imm[17]=f1+"f/f4/Chlorine_ampoule@ imm[18]=f1+"8/87/Argon_discharge_tube@ imm[19]=f1+"a/a4/Potassium-2@ imm[20]=f1+"9/96/Calcium_unter_Argon_Schutzgasatmosph%C3%A4re@ imm[21]=f1+"e/e6/Scandium_sublimed_dendritic~ imm[22]=f1+"d/db/Titan-`_bar.JPG imm[23]=f1+"9/98/Vanadium_etched@ imm[24]=f1+"0/08/Chromium_`s~ imm[25]=f1+"8/86/Mangan_1-crop@ imm[26]=f1+"a/ad/Iron_electrolytic~ imm[27]=f1+"a/a8/Kobalt_electrolytic~ imm[28]=f1+"5/57/Nickel_chunk@ imm[29]=f1+"f/f0/NatCopper@ imm[30]=f1+"f/f9/Zinc_fragment_sublimed~ imm[31]=f1+"9/92/Gallium_`s@ imm[32]=f1+"0/08/Poly`line-germanium@ imm[33]=f1+"7/7b/Arsen_1a@ imm[34]=f1+"4/47/SeBlackRed@ imm[35]=f1+"b/bf/Bromine_25ml_%28transparent%29.png imm[36]=f1+"5/50/Krypton_discharge_tube@ imm[37]=f1+"c/c9/Rb5.JPG imm[38]=f1+"4/41/Strontium_destilled_`s@ imm[39]=f1+"1/19/Yttrium_sublimed_dendritic~ imm[40]=f1+"9/92/Zirconium_`_bar~ imm[41]=f1+"f/f2/Niobium_`s~ imm[42]=f1+"3/32/Molybdenum_`ine_fragment~ imm[43]="https://upload.wikimedia.org/wikipedia/en/8/89/Technetium@ imm[44]=f1+"2/2c/Ruthenium_a_half_bar@ imm[45]=f1+"9/98/Rhodium_powder_pressed_melted@ imm[46]=f1+"d/d7/Palladium_%2846_Pd%29@ imm[47]=f1+"5/55/Silver_`@ imm[48]=f1+"b/b5/Cadmium-crystal_bar@ imm[49]=f1+"b/b8/Indium@ imm[50]=f1+"2/2b/Sn-Alpha-Beta@ imm[51]=f1+"5/5c/Antimony-4@ For ff=1 To Array.GetItemCount(imm) imm[ff]=ldtext.Replace( imm[ff] "~" tt) imm[ff]=ldtext.Replace( imm[ff] "`" "crystal") imm[ff]=ldtext.Replace( imm[ff] "@" ".jpg") ' TextWindow.WriteLine(imm[ff]) EndFor EndSub Sub dff For w1=1 To Array.GetItemCount(imm) if w1=35 Then xt=".png" else xt=".jpg" endif img["Button"+w1]=ImageList.LoadImage("e:\elm\el"+w1+xt) '<-----------modify to according elements pic dir. GraphicsWindow.Title=ttt+w1 EndFor hrr[H ]="Vodik hrr[He]="Helij hrr[li]="Litij hrr[Be]="Berilij hrr[b ]="Bor hrr[c ]="Ugljik hrr[n ]="Dušik hrr[o ]="Kisik hrr[f ]="Fluor hrr[ne]="Neon hrr[na]="Natrij hrr[mg]="Magnezij hrr[al]="Aluminij hrr[Si]="Silicij hrr[p ]="Fosfor hrr[s ]="Sumpor hrr[cl]="Klor hrr[k ]="Kalij hrr[ca]="Kalcij hrr[sc]="Skandij hrr[ti]="Titan hrr[v ]="Vanadij hrr[cr]="Krom hrr[mn]="Mangan hrr[Fe]="Željezo hrr[Co]="Kobalt hrr[ni]="Nikal hrr[Cu]="Bakar hrr[hg]="Živa hrr[au]="Zlato hrr[ag]="Srebro hrr[sn]="Kositar hrr[pb]="Olovo srr[pb]="Olovo srr[sn]="Kalaj srr[ag]="Srebro srr[au]="Zlato srr[hg]="Živa srr[h ]="Vodonik srr[he]="Helij srr[li]="Litij srr[Be]="Berilij srr[b ]="Bor srr[c ]="Ugljik srr[n ]="Azot srr[o ]="Kiseonik srr[f ]="Fluor srr[ne]="Neon srr[na]="Natrij srr[mg]="Magnezij srr[al]="Aluminij srr[Si]="Silikon srr[p ]="Fosfor srr[s ]="Sumpor srr[cl]="Hlor srr[k ]="Kalij srr[ca]="Kalcij srr[sc]="Skandij srr[ti]="Titan srr[v ]="Vanadij srr[cr]="Hrom srr[mn]="Mangan srr[Fe]="Željezo srr[Co]="Kobalt srr[ni]="Nikal srr[Cu]="Bakar EndSub iset() dff() GraphicsWindow.Title = "Interactive Periodic Table ss=LDShapes.GetAllShapes () For x=1 To Array.GetItemCount (ss) LDShapes.SetSize (ss[x] 28 28) Shapes.Move (ss[x] ldShapes.GetLeft(ss[x])+30 ldShapes.GetTop (ss[x])+30) EndFor Controls.ButtonClicked = OnButtonClick GraphicsWindow.PenWidth=0 rr=Shapes.AddRectangle(GraphicsWindow.Width 110) Shapes.Move(rr 0 335) LDShapes.BrushColour(rr "#99ffffff") sh[300]=Shapes.AddText("11") sh[320]=Shapes.AddText("11") sh[340]=Shapes.AddText("11") sh[360]=Shapes.AddText("11") Shapes.Move(sh[300] 20 340) Shapes.Move(sh[320] 20 360) Shapes.Move(sh[340] 20 380) Shapes.Move(sh[360] 20 400) int="true lcb=Na OnButtonClick() Sub OnButtonClick If int Then int="false Else lcb=Controls.LastClickedButton EndIf LDGraphicsWindow.BackgroundImage(img[lcb]) If lcb = H Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Hydrogen" hrr[lcb] srr[lcb] )+" | @an:1 | @ar:0.37 | @br:0.32") ldcall.function2("dtx" 320,"@aw:1.00794 | @de:0.0899 | @fs:1 | @bp:20.268") ldcall.function2("dtx" 340,"@mp:14.025 | @np:2.10") ElseIf lcb = Li Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Lithium" hrr[lcb] srr[lcb] )+" | @an:3 | @ar:1.52 | @br:1.23") ldcall.function2("dtx" 320,"@aw:6.941 | @de:0.534 | @fs:1 | @bp:1615") ldcall.function2("dtx" 340, "@mp:453.7 | @np:0.98") ElseIf lcb = Na Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Sodium" hrr[lcb] srr[lcb] )+" | @an:11 | @ar:1.90 | @br:1.23") ldcall.function2("dtx" 320,"@aw:22.98977 | @de:0.97 | @fs:1 | @bp:1156") ldcall.function2("dtx" 340,"@mp:371 | @np:0.93") ElseIf lcb = K Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Potassium" hrr[lcb] srr[lcb] )+" | @an:19 | @ar:2.35 | @br:2.03") ldcall.function2("dtx" 320,"@aw:39.0983 | @de:0.86 | @fs:8 | @ss:1") ldcall.function2("dtx" 340,"@bp:1032 | @mp:336.35 | @np:0.82") ElseIf lcb = Rb Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Rubidium" hrr[lcb] srr[lcb] )+" | @an:37 | @ar:2.48 | @br:2.16") ldcall.function2("dtx" 320,"@aw:85.4678 | @de:1.532 | @fs:8 | @ss:1") ldcall.function2("dtx" 340,"@bp:961 | @mp:312.64 | @np:0.82") ElseIf lcb = Cs Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Cesium" hrr[lcb] srr[lcb] )+" | @an:55 | @ar:2.67 | @br:2.35") ldcall.function2("dtx" 320,"@aw:132.90545.@de:1.8785 | @fs:18") ldcall.function2("dtx" 340,"@ss:8 | @3s:1 | @bp:944") ldcall.function2("dtx" 360,"@mp:301.55 | @np:0.79") ElseIf lcb = Fr Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Francium" hrr[lcb] srr[lcb] )+" | @an:87 | @ar:2.70 | @aw:223") ldcall.function2("dtx" 320,"@de:2.41 | @fs:18 | @ss:8 | @3s:1") ldcall.function2("dtx" 340,"@bp:950 | @mp:300.2 | @np:0.70") ElseIf lcb = Be Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Beryllium" hrr[lcb] srr[lcb] )+" | @an:4 | @ar:1.12 | @br:0.90") ldcall.function2("dtx" 320,"@aw:9.01218 | @de:1.85 | @fs:2 | @bp:2745") ldcall.function2("dtx" 340,"@mp:1560 | @np:1.57") ElseIf lcb = Mg Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Magnesium" hrr[lcb] srr[lcb] )+" | @an:12 | @ar:1.60 | @br:1.36") ldcall.function2("dtx" 320,"@aw:24.3050 | @de:1.74 | @fs:2 | @bp:1363") ldcall.function2("dtx" 340,"@mp:922 | @np:1.31") ElseIf lcb = Ca Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Calcium" hrr[lcb] srr[lcb] )+" | @an:20 | @ar:1.97 | @br:1.74") ldcall.function2("dtx" 320,"@aw:40.078 | @de:1.54 | @fs:8 | @ss:2") ldcall.function2("dtx" 340,"@bp:1757 | @mp:1112 | @np:1.00") ElseIf lcb = Sr Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Strontium" hrr[lcb] srr[lcb] )+" | @an:38 | @ar:2.15 | @br:1.91") ldcall.function2("dtx" 320,"@aw:87.62 | @de:2.6 | @fs:8 | @ss:2") ldcall.function2("dtx" 340,"@bp:1650 | @mp:1041 | @np:0.95") ElseIf lcb = Ba Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Barium" hrr[lcb] srr[lcb] )+" | @an:56 | @ar:2.22 | @br:1.98") ldcall.function2("dtx" 320,"@aw:137.327 | @de:3.51 | @fs:18 | @ss:8") ldcall.function2("dtx" 340,"@3s:2 | @bp:2171 | @mp:1002 | @np:0.89") ElseIf lcb = Ra Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Radium" hrr[lcb] srr[lcb] )+" | @an:88 | @ar:2.33 | @aw:226 | @de:5") ldcall.function2("dtx" 320,"@fs:18 | @ss:8 | @3s:2 | @bp:2010") ldcall.function2("dtx" 340,"@mp:973 | @np:0.89") ElseIf lcb = Sc Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Scandium" hrr[lcb] srr[lcb] )+" | @an:21 | @ar:1.62 | @br:1.44 | @de:2.9890") ldcall.function2("dtx" 320,"@fs:9 | @ss:2 | @bp:3104 | @mp:1812") ldcall.function2("dtx" 340,"@aw:44.95591 | @np:1.36") ElseIf lcb = Y Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Yttrium" hrr[lcb] srr[lcb] )+" | @an:39 | @ar:1.78 | @br:1.62 | @de:4.4689") ldcall.function2("dtx" 320," @aw:88.90585 | @fs:9 | @ss:2 | @bp:3611") ldcall.function2("dtx" 340,"@mp:1799 | @np:1.22") ElseIf lcb = Ti Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Titanium" hrr[lcb] srr[lcb] )+" | @an:22 | @ar:1.45 | @aw:47.867") ldcall.function2("dtx" 320,"@br:1.32 | @de:4.54 | @fs:10 | @ss:2") ldcall.function2("dtx" 340,"@bp:3562 | @mp:1943.@np:1.54") ElseIf lcb = Zr Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Zirconium" hrr[lcb] srr[lcb] )+" | @an:40 | @ar:1.60 | @aw:91.224") ldcall.function2("dtx" 320,"@br:1.45 | @de:6.49 | @fs:10 | @ss:2") ldcall.function2("dtx" 340,"@bp:4682 | @mp:2125 | @np:1.33") ElseIf lcb = Hf Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Hafnium" hrr[lcb] srr[lcb] )+" | @an:72 | @ar:1.67 | @aw:178.49") ldcall.function2("dtx" 320,"@br:1.44 | @de:13.31 | @fs:32 | @ss:10") ldcall.function2("dtx" 340,"@3s:2 | @bp:4876 | @mp:2500") ldcall.function2("dtx" 360,"@np:1.30") ElseIf lcb = Rf Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Rutherfordium" hrr[lcb] srr[lcb] )+" | @an:104 | @ar:? | @br:?") ldcall.function2("dtx" 320,"@aw:261 | @de:17 | @fs:? | @bp:?") ldcall.function2("dtx" 340,"@aw:261 | @mp:? | Electronegativity=?") ElseIf lcb = V Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Vanadium" hrr[lcb] srr[lcb] )+" | @an:23 | @ar:1.34 | @aw:50.9415") ldcall.function2("dtx" 320,"@br:1.22 | @de:5.96 | @fs:11 | @ss:2") ldcall.function2("dtx" 340,"@bp:3682 | @mp:2175 | @np:1.63") ElseIf lcb = Nb Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Niobium" hrr[lcb] srr[lcb] )+" | @an:41 | @ar:1.46 | @aw:92.90638") ldcall.function2("dtx" 320,"@br:1.34 | @de:8.57 | @fs:12 | @ss:2") ldcall.function2("dtx" 340,"@bp:5017 | @mp:2740 | @np:1.60") ElseIf lcb = Ta Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Tantalum" hrr[lcb] srr[lcb] )+" | @an:73 | @ar:1.49 | @aw:180.9479") ldcall.function2("dtx" 320,"@br:1.34 | @de:16.6 | @fs:32 | @ss:11") ldcall.function2("dtx" 340,"@3s:2 | @bp:5731 | @mp:3287") ldcall.function2("dtx" 360,"@np:1.50") ElseIf lcb = Db Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Dubnium" hrr[lcb] srr[lcb] )+" | @an:105 | @ar:? | @aw:262") ldcall.function2("dtx" 320,"@br:? | @de:21.6 | @fs:? | @bp:?") ldcall.function2("dtx" 340,"@mp:? | @np:?") ElseIf lcb = Cr Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Chromium" hrr[lcb] srr[lcb] )+" | @an:24 | @ar:1.30 | @aw:51.9961") ldcall.function2("dtx" 320,"@br:1.18 | @de:7.20 | @fs:13 | @ss:1") ldcall.function2("dtx" 340,"@bp:2945 | @mp:2130 | @np:1.66") ElseIf lcb = Mo Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Molybdenum" hrr[lcb] srr[lcb] )+" | @an:42 | @ar:1.39 | @aw:95.94") ldcall.function2("dtx" 320,"@br:1.30 | @de:10.2 | @fs:13 | @ss:1") ldcall.function2("dtx" 340,"@bp:4912, @mp:2890 | @np:2.16") ElseIf lcb = W Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Tungsten" hrr[lcb] srr[lcb] )+" | @an:74 | @ar:1.41 | @aw:183.84") ldcall.function2("dtx" 320,"@br:1.30 | @de:19.35 | @fs:32 | @ss:12") ldcall.function2("dtx" 340,"@3s:2 | @bp:5828 | @mp:3680") ldcall.function2("dtx" 360,"@np: 2.36") ElseIf lcb = Sg Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Seaborgium" hrr[lcb] srr[lcb] )+" | @an:106 | @ar:? | @aw:266") ldcall.function2("dtx" 320,"@br:? | @de:23.2 | First outer shell-? | @bp:?") ldcall.function2("dtx" 340,"@mp:? | @np:?") ElseIf lcb = Mn Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Manganese" hrr[lcb] srr[lcb] )+" | @an:25 | @ar:1.35 | @aw:54.93805") ldcall.function2("dtx" 320,"@br:1.17 | @de:7.20 | @fs:13 | @ss:2") ldcall.function2("dtx" 340,"@bp:2335 | @mp:1517 | @np:1.55") ElseIf lcb = Tc Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Technetium" hrr[lcb] srr[lcb] )+" | @an:43 | @ar:1.36 | @aw:98") ldcall.function2("dtx" 320,"@br:1.27 | @de:11.50 | @fs:13 | @ss:2") ldcall.function2("dtx" 340,"@bp:4538 | @mp:2473 | @np:1.90") ElseIf lcb = Re Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Rhenium" hrr[lcb] srr[lcb] )+" | @an:75 | @ar:1.37 | @aw:186.207") ldcall.function2("dtx" 320,"@br:1.28 | @de:20.53 | @fs:32 | @ss:13") ldcall.function2("dtx" 340,"@3s:2 | @bp:5869 | @mp:3453") ldcall.function2("dtx" 360,"@np:1.90") ElseIf lcb = Bh Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Bohrium" hrr[lcb] srr[lcb] )+" | @an:107 | @ar:? | @aw:264") ldcall.function2("dtx" 320,"@br:? | @de:27.2 | @fs:? | @bp:?") ldcall.function2("dtx" 340,"@mp:? | @np:?") ElseIf lcb = Fe Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Iron" hrr[lcb] srr[lcb] )+" | @an:26 | @ar:1.26 | @aw:55.845") ldcall.function2("dtx" 320,"@br:1.17 | @de:7.86 | @fs:14 | @ss:2") ldcall.function2("dtx" 340,"@bp:3135 | @mp:1809 | @np:1.83") ElseIf lcb = Ru Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Ruthenium" hrr[lcb] srr[lcb] )+" | @an:44 | @ar:1.34 | @aw:101.07") ldcall.function2("dtx" 320,"@br:1.25 | @de:12.30 | @fs:15 | @ss:1") ldcall.function2("dtx" 340,"@bp:4423 | @mp:2523 | @np:2.20") ElseIf lcb = Os Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Osmium" hrr[lcb] srr[lcb] )+" | @an:76 | @ar:1.35 | @aw:190.23") ldcall.function2("dtx" 320,"@br:1.26 | @de:22.48 | @fs:32 | @ss:14") ldcall.function2("dtx" 340,"@3s:2 | @bp:5285 | @mp:3300") ldcall.function2("dtx" 360,"@np:2.20") ElseIf lcb = Hs Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Hassium" hrr[lcb] srr[lcb] )+" | @an:108 | @ar:? @aw:269") ldcall.function2("dtx" 320,"@br:? @de:28.6 | @fs:? @bp:?") ldcall.function2("dtx" 340,"@mp:? @np:?") ElseIf lcb = Co Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Cobalt" hrr[lcb] srr[lcb] )+" | @an:27 | @ar:1.25 | @aw:58.93320") ldcall.function2("dtx" 320,"@br:1.16 | @de:8.9 | @fs:15 | @ss:2") ldcall.function2("dtx" 340,"@bp:3201 | @mp:1768 | @np:1.88") ElseIf lcb = Rh Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Rhodium" hrr[lcb] srr[lcb] )+" | @an:45 | @ar:1.34 | @aw:102.90550") ldcall.function2("dtx" 320,"@br:1.25 | @de:12.4 | @fs:16 | @ss:1") ldcall.function2("dtx" 340,"@bp:3970 | @mp:2236 | @np:2.28") ElseIf lcb = Ir Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Iridium" hrr[lcb] srr[lcb] )+" | @an:77 | @ar:1.36 | @aw:192.217") ldcall.function2("dtx" 320,"@br:1.27 | @de:22.421 | @fs:32 | @ss:15") ldcall.function2("dtx" 340,"@3s:2 | @bp:4701 | @mp:2716") ldcall.function2("dtx" 360,"@np:2.20") ElseIf lcb = Mt Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Meitnerium" hrr[lcb] srr[lcb] )+" | @an:109 | @ar:? @aw:268") ldcall.function2("dtx" 320,"@br:? @de:28.2 | @fs:? | @bp:?") ldcall.function2("dtx" 340,"@mp:? @np:?") ElseIf lcb = Ni Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Nickel" hrr[lcb] srr[lcb] )+" | @an:28 | @ar:1.24 | @aw:58.6934") ldcall.function2("dtx" 320,"@br:1.15 | @de:8.90 | @fs:16 | @ss:2") ldcall.function2("dtx" 340,"@bp:3187 | @mp:1726 | @np:1.91") ElseIf lcb = Pd Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Palladium" hrr[lcb] srr[lcb] )+" | @an:46 | @ar:1.37 | @aw:106.42") ldcall.function2("dtx" 320,"@br:1.28 | @de:12.02 | @fs:18 | @ss:0") ldcall.function2("dtx" 340,"@bp:3236 | @mp:1825 | @np:2.20") ElseIf lcb = Pt Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Platinum" hrr[lcb] srr[lcb] )+" | @an:78 | @ar:1.39 | @aw:195.078") ldcall.function2("dtx" 320,"@br:1.30 | @de:21.45 | @fs:32 | @ss:17") ldcall.function2("dtx" 340,"@3s:1 | @bp:4100 | @mp:2045") ldcall.function2("dtx" 360,"@np:2.28") ElseIf lcb = Ds Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Darmstadtium" hrr[lcb] srr[lcb] )+" | @an:110 | @ar:? @aw:271") ldcall.function2("dtx" 320,"@br:? @de:27.4 | @fs:? @bp:? @mp:?") ldcall.function2("dtx" 340,"@np:?") ElseIf lcb = Cu Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Copper" hrr[lcb] srr[lcb] )+" | @an:29 | @ar:1.28 | @aw:63.546") ldcall.function2("dtx" 320,"@br:1.17 | @de:8.92 | @fs:18 | @ss:1") ldcall.function2("dtx" 340,"@bp:3836 | @mp:1357.6 | @np:1.90") ElseIf lcb = Ag Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Silver" hrr[lcb] srr[lcb] )+" | @an:47 | @ar:1.44 | @aw:107.8682") ldcall.function2("dtx" 320,"@br:1.34 | @de:10.5 | @fs:18 | @ss:1") ldcall.function2("dtx" 340,"@bp:2436 | @mp:1234 | @np:1.93") ElseIf lcb = Au Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Gold" hrr[lcb] srr[lcb] )+" | @an:79 | @ar:1.46 | @aw:196.9655") ldcall.function2("dtx" 320,"@br:1.34 | @de:18.88 | @fs:32 | @ss:18") ldcall.function2("dtx" 340,"@3s:1 | @bp:3130 | @mp:1337.58") ldcall.function2("dtx" 360,"@np:2.54") ElseIf lcb = Rg Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Roentgenium" hrr[lcb] srr[lcb] )+" | @an:111 | @ar:? @aw:272") ldcall.function2("dtx" 320,"@br:? @de:24.4 | @fs:? | @bp:?") ldcall.function2("dtx" 340,"@mp:? @np:?") ElseIf lcb = Zn Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Zinc" hrr[lcb] srr[lcb] )+" | @an:30 | @ar:1.38 | @aw:65.39") ldcall.function2("dtx" 320,"@br:1.25 | @de:7.14 | @fs:18 | @ss:2") ldcall.function2("dtx" 340,"@bp:1180 | @mp:692.73 | @np:1.65") ElseIf lcb = Cd Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Cadmium" hrr[lcb] srr[lcb] )+" | @an:48 | @ar:1.71 | @aw:112.411") ldcall.function2("dtx" 320,"@br:1.48 | @de:8.642 | @fs:18 | @ss:2") ldcall.function2("dtx" 340,"@bp:1040 | @mp:594.18 | @np:1.69") ElseIf lcb = Hg Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Mercury" hrr[lcb] srr[lcb] )+" | @an:80 | @ar:1.60 | @aw:200.59") ldcall.function2("dtx" 320,"@br:1.49 | @de:13.594 | @fs:32 | @ss:18") ldcall.function2("dtx" 340,"@3s:2 | @bp:630 | @mp:234.28") ldcall.function2("dtx" 360,"@np:2.00") ElseIf lcb = Cn Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Copernicium" hrr[lcb] srr[lcb] )+" | @an:112 | @ar:? @aw:277") ldcall.function2("dtx" 320,"@br:? @de:16.8 | @fs:? @bp:?") ldcall.function2("dtx" 340,"@mp:? @np:?") ElseIf lcb = B Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Boron" hrr[lcb] srr[lcb] )+" | @an:5 | @ar:0.98 | @aw:10.811") ldcall.function2("dtx" 320,"@br:0.82 | @de:2.34 | @fs:3 | @bp:4275") ldcall.function2("dtx" 340,"@mp:2300 | @np:2.04") ElseIf lcb = Al Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Aluminium" hrr[lcb] srr[lcb] )+" | @an:13 | @ar:1.43 | @aw:26.98154") ldcall.function2("dtx" 320,"@br:1.18 | @de:2.702 | @fs:3 | @bp:2740") ldcall.function2("dtx" 340,"@mp:933.25 | @np:1.61") ElseIf lcb = Ga Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Gallium" hrr[lcb] srr[lcb] )+" | @an:31 | @ar:1.41 | @aw:69.723") ldcall.function2("dtx" 320,"@br:1.26 | @de:5.904 | @fs:18 | @ss:3") ldcall.function2("dtx" 340,"@bp:2478 | @mp:302.9 | @np:1.81") ElseIf lcb = In Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Indium" hrr[lcb] srr[lcb] )+" | @an:49 | @ar:1.66 | @aw:114.818") ldcall.function2("dtx" 320,"@br:1.44 | @de:7.30 | @fs:18 | @ss:3") ldcall.function2("dtx" 340,"@bp:2346 | @mp:429.76 | @np:1.78") ElseIf lcb = Tl Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Thallium" hrr[lcb] srr[lcb] )+" | @an:81 | @ar:1.71 | @aw:204.3833") ldcall.function2("dtx" 320,"@br:1.48 | @de:11.85 | @fs:32 | @ss:18") ldcall.function2("dtx" 340,"@3s:3 | @bp:1746 | @mp:577") ldcall.function2("dtx" 360,"@np:2.04") ElseIf lcb = Uut Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Nihonium" hrr[lcb] srr[lcb] )+" | @an:113 | @ar:? @aw:?") ldcall.function2("dtx" 320,"@br:? @de:16? @fs:? @bp:?") ldcall.function2("dtx" 340,"@mp:? @np:?") ElseIf lcb = C Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Carbon" hrr[lcb] srr[lcb] )+" | @an:6 | @ar:0.91 | @aw:12.0107") ldcall.function2("dtx" 320,"@br:0.77 | @de:2.25 | @fs:4 | @bp:5100") ldcall.function2("dtx" 340,"@mp:3823 | @np:2.55") ElseIf lcb = Si Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Silicon" hrr[lcb] srr[lcb] )+" | @an:14 | @ar:1.32 | @aw:28.0855") ldcall.function2("dtx" 320,"@br:1.11 | @de:2.33 | @fs:4 | @bp:3540") ldcall.function2("dtx" 340,"@mp:1685 | @np:1.90") ElseIf lcb = Ge Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Germanium" hrr[lcb] srr[lcb] )+" | @an:32 | @ar:1.37 | @aw:72.61") ldcall.function2("dtx" 320,"@br:1.22 | @de:5.35 | @fs:18 | @ss:4") ldcall.function2("dtx" 340,"@bp:3107 | @mp:1210.4 | @np:2.01") ElseIf lcb = Sn Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Tin" hrr[lcb] srr[lcb] )+" | @an:50 | @ar:1.62 | @aw:118.710") ldcall.function2("dtx" 320,"@br:1.41 | @de:7.28 | @fs:18 | @ss:4") ldcall.function2("dtx" 340,"@bp:2876 | @mp:505.06 | @np:1.96") ElseIf lcb = Pb Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Lead" hrr[lcb] srr[lcb] )+" | @an:82 | @ar:1.75 | @aw:207.2") ldcall.function2("dtx" 320,"@br:1.47 | @de:11.3437 | @fs:32 | @ss:18") ldcall.function2("dtx" 340,"@3s:4 | @bp:2023 | @mp:600.6") ldcall.function2("dtx" 360,"@np:2.33") ElseIf lcb = Fl Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Flerovium" hrr[lcb] srr[lcb] )+" | @an:114 | @ar:? @aw:289") ldcall.function2("dtx" 320,"@br:? @de:14 | @fs:? @bp:?") ldcall.function2("dtx" 340,"@mp:? @np:?") ElseIf lcb = N Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Nitrogen" hrr[lcb] srr[lcb] )+" | @an:7 | @ar:0.92 | @aw:10.00674") ldcall.function2("dtx" 320,"@br:0.75 | @de:1.2506 | @fs:5 | @bp:77.35") ldcall.function2("dtx" 340,"@mp:63.14 | @np:3.04") ElseIf lcb = P Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Phosphorus" hrr[lcb] srr[lcb] )+" | @an:15 | @ar:1.28 | @aw:30.97376") ldcall.function2("dtx" 320,"@br:1.06 | @de:1.82 | @fs:5 | @bp:550") ldcall.function2("dtx" 340,"@mp:317.3 | @np:2.19") ElseIf lcb = As Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Arsenic" hrr[lcb] srr[lcb] )+" | @an:33 | @ar:1.39 | @aw:74.92160") ldcall.function2("dtx" 320,"@br:1.20 | @de:5.727 | @fs:18 | @ss:5") ldcall.function2("dtx" 340,"@bp:886 | @mp:1091 | @np:2.18") ElseIf lcb = Sb Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Antimony" hrr[lcb] srr[lcb] )+" | @an:51 | @ar:1.59 | @aw:121.760") ldcall.function2("dtx" 320,"@br:1.40 | @de:6.684 | @fs:18 | @ss:5") ldcall.function2("dtx" 340,"@bp:1860 | @mp:904 | @np:2.05") ElseIf lcb = Bi Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Bismuth" hrr[lcb] srr[lcb] )+" | @an:83 | @ar:1.70 | @aw:208.98038") ldcall.function2("dtx" 320,"@br:1.46 | @de:9.80 | @fs:32 | @ss:18") ldcall.function2("dtx" 340,"@3s:5 | @bp:1837 | @mp:544.52") ldcall.function2("dtx" 360,"@np:2.02") ElseIf lcb = Uup Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Moscovium" hrr[lcb] srr[lcb] )+" | @an:115 | @ar:? @aw:?") ldcall.function2("dtx" 320,"@br:? @de:13.5? @fs:? @bp:?") ldcall.function2("dtx" 340,"@mp:? @np:?") ElseIf lcb = O Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Oxygen" hrr[lcb] srr[lcb] )+" | @an:8 | @ar:0.65 | @aw:15.9994") ldcall.function2("dtx" 320,"@br:0.73 | @de:1.429 | @fs:6 | @bp:90.18") ldcall.function2("dtx" 340,"@mp:50.35 | @np:3.44") ElseIf lcb = S Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Sulfur" hrr[lcb] srr[lcb] )+" | @an:16 | @ar:1.27 | @aw:32.066") ldcall.function2("dtx" 320,"@br:1.02 | @de:2.07 | @fs:6 | @bp:717.75") ldcall.function2("dtx" 340,"@mp:388.36 | @np:2.58") ElseIf lcb = Se Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Selenium" hrr[lcb] srr[lcb] )+" | @an:34 | @ar:1.40 | @aw:78.96") ldcall.function2("dtx" 320,"@br:1.16 | @de:4.81 | @fs:18 | @ss:6") ldcall.function2("dtx" 340,"@bp:958 | @mp:494 | @np:2.55") ElseIf lcb = Te Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Tellurium" hrr[lcb] srr[lcb] )+" | @an:52 | @ar:1.42 | @aw:127.60") ldcall.function2("dtx" 320,"@br:1.36 | @de:6.25 | @fs:18 | @ss:6") ldcall.function2("dtx" 340,"@bp:1261 | @mp:722.65 | @np:2.10") ElseIf lcb = Po Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Polonium" hrr[lcb] srr[lcb] )+" | @an:84 | @ar:1.67 | @aw:209") ldcall.function2("dtx" 320,"@br:1.46 | @de:9.4 | @fs:32 | @ss:18") ldcall.function2("dtx" 340,"@3s:6 | @bp:1235 | @mp:527") ldcall.function2("dtx" 360,"@np:2.00") ElseIf lcb = Lv Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Livermorium" hrr[lcb] srr[lcb] )+" | @an:116 | @ar:? @aw:289") ldcall.function2("dtx" 320,"@br:? @de:12.9 | @fs:? @bp:?") ldcall.function2("dtx" 340,"@mp:? @np:?") ElseIf lcb = F Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Flourine" hrr[lcb] srr[lcb] )+" | @an:9 | @ar:0.57 | @aw:18.99840") ldcall.function2("dtx" 320,"@br:0.72 | @de:1.696 | @fs:7 | @bp:84.95") ldcall.function2("dtx" 340,"@mp:53.48 | @np:3.98") ElseIf lcb = Cl Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Chlorine" hrr[lcb] srr[lcb] )+" | @an:17 | @ar:0.97 | @aw:35.4527") ldcall.function2("dtx" 320,"@br:0.99 | @de:3.214 | @fs:7 | @bp:239.1") ldcall.function2("dtx" 340,"@mp:172.16 | @np:3.16") ElseIf lcb = Br Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Bromine" hrr[lcb] srr[lcb] )+" | @an:35 | @ar:1.12 | @aw:79.904") ldcall.function2("dtx" 320,"@br:1.14 | @de:3.119 | @fs:18 | @ss:7") ldcall.function2("dtx" 340,"@bp:332.25 | @mp:265.9 | @np:2.96") ElseIf lcb = I Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Iodine" hrr[lcb] srr[lcb] )+" | @an:53 | @ar:1.32 | @aw:126.90447") ldcall.function2("dtx" 320,"@br:1.33 | @de:4.93 | @fs:18 | @ss:7") ldcall.function2("dtx" 340,"@bp:458.4 | @mp:386.7 | @np:2.66") ElseIf lcb = At Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Astatine" hrr[lcb] srr[lcb] )+" | @an:85 | @ar:1.45 | @aw:210") ldcall.function2("dtx" 320,"@br:1.45 | @de:? @fs:32 | @ss:19") ldcall.function2("dtx" 340,"@3s:7 | @bp:610 | @mp:575") ElseIf lcb = Uus Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Tennessine" hrr[lcb] srr[lcb] )+" | @an:117 | @ar:? @aw:?") ldcall.function2("dtx" 320,"@br:? @de:? First outer shell? @bp:?") ldcall.function2("dtx" 340,"@mp:? @np:?") ElseIf lcb = He Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Helium" hrr[lcb] srr[lcb] )+" | @an:2 | @ar:0.50 | @aw:4.00260") ldcall.function2("dtx" 320,"@br:0.93 | @de:0.1785 | @fs:2 | @bp:4.215") ldcall.function2("dtx" 340,"@mp:0.95 | @np:0") ElseIf lcb = Ne Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Neon" hrr[lcb] srr[lcb] )+" | @an:10 | @ar:0.51 | @aw:20.1797") ldcall.function2("dtx" 320,"@br:0.71 | @de:0.9002 | @fs:8 | @bp:27.096") ldcall.function2("dtx" 340,"@mp:24.553 | @np:0") ElseIf lcb = Ar Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Argon" hrr[lcb] srr[lcb] )+" | @an:18 | @ar:0.88 | @aw:39.948") ldcall.function2("dtx" 320,"@br:0.98 | @de:1.784 | @fs:8 | @bp:87.3") ldcall.function2("dtx" 340,"@mp:83.81 | @np:0") ElseIf lcb = Kr Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Krypton" hrr[lcb] srr[lcb] )+" | @an:36 | @ar:1.03 | @aw:1.12") ldcall.function2("dtx" 320,"@br:1.12 | @de:3.733 | @fs:18 | @ss:8") ldcall.function2("dtx" 340,"@bp:119.8 | @mp:115.78 | @np:0") ElseIf lcb = Xe Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Xenon" hrr[lcb] srr[lcb] )+" | @an:54 | @ar:1.54 | @aw:131.29") ldcall.function2("dtx" 320,"@br:1.31 | @de:5.887 | @fs:18 | @ss:8") ldcall.function2("dtx" 340,"@bp:165.03 | @mp:161,36 | @np:2.60") ElseIf lcb = Rn Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Radon" hrr[lcb] srr[lcb] )+" | @an:86 | @ar:1.34 | @aw:222") ldcall.function2("dtx" 320,"@de:9.73 | @fs:32 | @ss:18 | @3s:8") ldcall.function2("dtx" 340,"@bp:211 | @mp:202.@np:0") ElseIf lcb = Uuo Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Oganesson" hrr[lcb] srr[lcb] )+" | @an:118 | @ar:? @aw:293") ldcall.function2("dtx" 320,"@br:? @de:? @fs:? @bp:? @mp:?") ldcall.function2("dtx" 340,"@np:?") ElseIf lcb = La Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Lanthanum" hrr[lcb] srr[lcb] )+" | @an:57 | @ar:1.38 | @aw:138.9055") ldcall.function2("dtx" 320,"@br:1.69 | @de:6.1453 | @fs:18 | @ss:9") ldcall.function2("dtx" 340,"@3s:2 | @bp:3730 | @mp:1193") ldcall.function2("dtx" 360,"@np:1.10") ElseIf lcb = Ac Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Actinium" hrr[lcb] srr[lcb] )+" | @an:89 | @ar:1.88 | @aw:227") ldcall.function2("dtx" 320,"@de:10.07 | @fs:18 | @ss:9 | @3s:2") ldcall.function2("dtx" 340,"@bp:3473 | @mp:1323 | @np:1.10") ElseIf lcb = Ce Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Cerium" hrr[lcb] srr[lcb] )+" | @an:58 | @ar:1.81 | @aw:140.116") ldcall.function2("dtx" 320,"@br:1.65 | @de:6.657 | @fs:20 | @ss:8") ldcall.function2("dtx" 340,"@3s:2 | @bp:3699 | @mp:1071") ldcall.function2("dtx" 360,"@np:1.12") ElseIf lcb = Th Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Thorium" hrr[lcb] srr[lcb] )+" | @an:90 | @ar:1.80 | @aw:232.0381") ldcall.function2("dtx" 320,"@br:1.65 | @de:11.7 | @fs:18 | @ss:10") ldcall.function2("dtx" 340,"@3s:2 | @bp:5061 | @mp:2028") ldcall.function2("dtx" 360,"@np:1.30") ElseIf lcb = Pr Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Praseodymium" hrr[lcb] srr[lcb] )+" | @an:59 | @ar:1.82 | @aw:140.90765") ldcall.function2("dtx" 320,"@br:1.65 | @de:6.773 | @fs:21 | @ss:8") ldcall.function2("dtx" 340,"@3s:2 | @bp:3785 | @mp:1204") ldcall.function2("dtx" 360,"@np:1.13") ElseIf lcb = Pa Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Protactinum" hrr[lcb] srr[lcb] )+" | @an:91 | @ar:1.61 | @aw:231.03588") ldcall.function2("dtx" 320,"@de:15.37 | @fs:20 | @ss:9 | @3s:2") ldcall.function2("dtx" 340,"@bp:4500 | @mp:1825 | @np:1.50") ElseIf lcb = Nd Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Neodymium" hrr[lcb] srr[lcb] )+" | @an:60 | @ar:1.82 | @aw:144.24") ldcall.function2("dtx" 320,"@br:1.64 | @de:7.004 | @fs:22 | @ss:8") ldcall.function2("dtx" 340,"@3s:2 | @bp:3341 | @mp:1289") ldcall.function2("dtx" 360,"@np:1.14") ElseIf lcb = U Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Uranium" hrr[lcb] srr[lcb] )+" | @an:92 | @ar:1.38 | @aw:238.0289") ldcall.function2("dtx" 320,"@br:1.42 | @de:19.05 | @fs:21 | @ss:9") ldcall.function2("dtx" 340,"@3s:2 | @bp:4407 | @mp:1405") ldcall.function2("dtx" 360,"@np:1.38") ElseIf lcb = Pm Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Promethium" hrr[lcb] srr[lcb] )+" | @an:61 | @ar:1.63 | @aw:145") ldcall.function2("dtx" 320,"@br:1.63 | @de:7.22 | @fs:23 | @ss:8") ldcall.function2("dtx" 340,"@3s:2 | @bp:2733 | @mp:1441") ldcall.function2("dtx" 360,"@np:1.13") ElseIf lcb = Np Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Neptunium" hrr[lcb] srr[lcb] )+" | @an:93 | @ar:1.30 | @aw:237") ldcall.function2("dtx" 320,"@de:20.45 | @fs:22 | @ss:9 | @3s:2") ldcall.function2("dtx" 340,"@bp:4175 | @mp:910 | @np:1.36") ElseIf lcb = Sm Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Samarium" hrr[lcb] srr[lcb] )+" | @an:62 | @ar:1.81 | @aw:150.36") ldcall.function2("dtx" 320,"@br:1.62 | @de:7.520 | @fs:24 | @ss:8") ldcall.function2("dtx" 340,"@3s:2 | @bp:2064 | @mp:1345") ldcall.function2("dtx" 360,"@np:1.17") ElseIf lcb = Pu Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Plutonium" hrr[lcb] srr[lcb] )+" | @an:94 | @ar:1.51 | @aw:244") ldcall.function2("dtx" 320,"@de:19.84 | @fs:23 | @ss:9 | @3s:2") ldcall.function2("dtx" 340,"@bp:3503 | @mp:913 | @np:1.28") ElseIf lcb = Eu Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Europium" hrr[lcb] srr[lcb] )+" | @an:63 | @ar:1.99 | @aw:151.964") ldcall.function2("dtx" 320,"@br:1.85 | @de:5.2434 | @fs:25 | @ss:8") ldcall.function2("dtx" 340,"@3s:2 | @bp:1870 | @mp:1090") ldcall.function2("dtx" 360,"@np:1.20") ElseIf lcb = Am Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Americium" hrr[lcb] srr[lcb] )+" | @an:95 | @ar:1.84 | @aw:243") ldcall.function2("dtx" 320,"@de:13.67 | @fs:25 | @ss:8 | @3s:2") ldcall.function2("dtx" 340,"@bp:2880 | @mp:1268") ElseIf lcb = Gd Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Gadolinium" hrr[lcb] srr[lcb] )+" | @an:64 | @ar:1.80 | @aw:157.25") ldcall.function2("dtx" 320,"@br:1.61 | @de:7.9004 | @fs:25 | @ss:9") ldcall.function2("dtx" 340,"@3s:2 | @bp:3539 | @mp:1585") ldcall.function2("dtx" 360,"@np:1.20") ElseIf lcb = Cm Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Curium" hrr[lcb] srr[lcb] )+" | @an:96 | @ar:? @aw:247") ldcall.function2("dtx" 320,"@de:13.51 | @fs:25 | @ss:9 | @3s:2") ldcall.function2("dtx" 340,"@np:1.30") ElseIf lcb = Tb Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Terbium" hrr[lcb] srr[lcb] )+" | @an:65 | @ar:1.80 | @aw:158.92534") ldcall.function2("dtx" 320,"@br:1.59 | @de:8.2294 | @fs:27 | @ss:8") ldcall.function2("dtx" 340,"@3s:2 | @bp:3496 | @mp:1630") ldcall.function2("dtx" 360,"@np:1.10") ElseIf lcb = Bk Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Berkelium" hrr[lcb] srr[lcb] )+" | @an:97 | @ar:? @aw:247") ldcall.function2("dtx" 320,"@de:14 | @fs:26 | @ss:9 | @3s:2") ldcall.function2("dtx" 340,"@bp:? @mp:? @np:1.30") ElseIf lcb = Dy Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Dysprosium" hrr[lcb] srr[lcb] )+" | @an:66 | @ar:1.80 | @aw:162.50") ldcall.function2("dtx" 320,"@br:1.59 | @de:8.5500 | @fs:28 | @ss:8") ldcall.function2("dtx" 340,"@3s:2 | @bp:2835 | @mp:1682") ldcall.function2("dtx" 360,"@np:1.22") ElseIf lcb = Cf Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Californium" hrr[lcb] srr[lcb] )+" | @an:98 | @ar:? @aw:251") ldcall.function2("dtx" 320,"@de:15.1 | @fs:27 | @ss:9 | @3s:2") ldcall.function2("dtx" 340,"@bp:? @mp:? @np:1.30") ElseIf lcb = Ho Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Holmium" hrr[lcb] srr[lcb] )+" | @an:67 | @ar:1.79 | @aw:164.93032") ldcall.function2("dtx" 320,"@br:1.58 | @de:8.7947 | @fs:29 | @ss:8") ldcall.function2("dtx" 340,"@3s:2 | @bp:2968 | @mp:1743") ldcall.function2("dtx" 360,"@np:1.23") ElseIf lcb = Es Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Einsteinium" hrr[lcb] srr[lcb] )+" | @an:99 | @ar:? @aw:252") ldcall.function2("dtx" 320,"@de:? @fs:28 | @ss:9 | @3s:2") ldcall.function2("dtx" 340,"@np:1.30") ElseIf lcb = Er Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Erbium" hrr[lcb] srr[lcb] )+" | @an:68 | @ar:1.78 | @aw:167.26") ldcall.function2("dtx" 320,"@br:1.78 | @de:9.006 | @fs:30 | @ss:8") ldcall.function2("dtx" 340,"@3s:2 | @bp:3136 | @mp:1795") ldcall.function2("dtx" 360,"@np:1.24") ElseIf lcb = Fm Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Fermium" hrr[lcb] srr[lcb] )+" | @an:100 | @ar:? @aw:257") ldcall.function2("dtx" 320,"@de:? @fs:29 | @ss:9 | @3s:2") ldcall.function2("dtx" 340,"@bp:? @mp:? @np:1.30") ElseIf lcb = Tm Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Thulium" hrr[lcb] srr[lcb] )+" | @an:69 | @ar:1.77 | @aw:168.93421") ldcall.function2("dtx" 320,"@br:1.56 | @de:9.3208 | @fs:31 | @ss:8") ldcall.function2("dtx" 340,"@3s:2 | @bp:2220 | @mp:1818") ldcall.function2("dtx" 360,"@np:1.25") ElseIf lcb = Md Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Mendelevium" hrr[lcb] srr[lcb] )+" | @an:101 | @ar:? @aw:258") ldcall.function2("dtx" 320,"@de:? @fs:30 | @ss:9 | @3s:2") ldcall.function2("dtx" 340,"@np:1.30") ElseIf lcb = Yb Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Ytterbium" hrr[lcb] srr[lcb] )+" | @an:70 | @ar:1.94 | @aw:173.04") ldcall.function2("dtx" 320,"@br:1.74 | @de:6.9654 | @fs:32 | @ss:8") ldcall.function2("dtx" 340,"@3s:2 | @bp:1647 | @mp:1097") ldcall.function2("dtx" 360,"@np:1.10") ElseIf lcb = No Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Nobelium" hrr[lcb] srr[lcb] )+" | @an:102 | @ar:? @aw:259") ldcall.function2("dtx" 320,"@de:? @fs:31 | @ss:9 | @3s:2") ldcall.function2("dtx" 340,"@bp:? @mp:? @np:1.30") ElseIf lcb = Lu Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Lutetium" hrr[lcb] srr[lcb] )+" | @an:71 | @ar:1.75 | @aw:174.967") ldcall.function2("dtx" 320,"@br:1.56 | @de:9.8404 | @fs:32 | @ss:9") ldcall.function2("dtx" 340,"@3s:2 | @bp:3668 | @mp:1936") ldcall.function2("dtx" 360,"@np:1.27") ElseIf lcb = Lr Then ldcall.function2("dtx" 300,"@el:"+ldcall.function3("csr" "Lawrencium" hrr[lcb] srr[lcb] )+" | @an:103 | @ar:? @aw:262") ldcall.function2("dtx" 320,"@de:? @fs:32 | @ss:9 | @3s:2") ldcall.function2("dtx" 340,"@bp:? @mp:? @np:?") EndIf EndSub Sub dtx 'GraphicsWindow.BrushColor="teal 'GraphicsWindow.FillRectangle (0 args[1]+35 900 50) 'GraphicsWindow.BrushColor="white rtt=args[2] rtt=LDText.Replace(rtt "@el" "Element") rtt=LDText.Replace(rtt "@an" "Atomic nr") rtt=LDText.Replace(rtt "@aw" "At. weight") rtt=LDText.Replace(rtt "@ar" "At. radius") rtt=LDText.Replace(rtt "?" "? | ") rtt=LDText.Replace(rtt "| |" "|") rtt=LDText.Replace(rtt "@de" "Density") rtt=LDText.Replace(rtt "@fs" "1st Out.Shell") rtt=LDText.Replace(rtt "@ss" "2nd Out.Shell") rtt=LDText.Replace(rtt "@3s" "3rd Out.Shell") rtt=LDText.Replace(rtt "@br" "Bonding radius") rtt=LDText.Replace(rtt "@bp" "Boiling Pt.[K]") rtt=LDText.Replace(rtt "@mp" "Melting Pt.[K]") rtt=LDText.Replace(rtt "@np" "Electroneg.(Pauling's)") Shapes.SetText (Sh[args[1]] rtt) If args[1]=300 Then Shapes.SetText (Sh[320] " ") Shapes.SetText (Sh[340] " ") Shapes.SetText (Sh[360] " ") EndIf EndSub Sub csr If args[2]=args[3] Then Return=args[1]+"/"+args[2] ElseIf args[2]="" Then Return=args[1]+"/"+LDText.Replace(LDText.Replace(LDText.Replace(LDText.Replace(args[1] "ium" "ij") "ll" "l") "y" "i") "x" "ks") Else Return=args[1]+"/"+args[2]+"/"+args[3] EndIf EndSub End>LTF622-1.sb< Start>LTH412-0.sb< '' Create some text that rotates in a circle // Challenge of the Month - July 2016 LTH412 ' original Fermat's spiral Challenge of the Month - June 2016 by NaochanON QSF666 _text="Challenge of the Month - July 2016 Graphics Challenge by NaochanON" GraphicsWindow.Show() GraphicsWindow.Width=800 GraphicsWindow.Height=700 GraphicsWindow.Left=5 GraphicsWindow.Top=5 GraphicsWindow.BrushColor="Red" base=0.0000000001 ' to avoid zero dividion // Math.Arctan( zero ) stp=0.05 a=70 X0=400 Y0=350 NN=0 For s=0 To 25 Step stp r= Math.SquareRoot(a*a*s) X=X0+r*math.Cos(-s) Y=Y0+r*math.Sin(-s) If Math.Remainder(s,stp*5)=0 then NN=NN+1 GraphicsWindow.FontSize=8+s mes[nn]= Shapes.AddText(text.GetSubText(_text,NN,1)) Shapes.Move(mes[NN],x,y) Shapes.Rotate(mes[NN],-Math.GetDegrees(s)-90) EndIf EndFor GraphicsWindow.BrushColor="Blue" MM=0 For s=0 To 25 Step stp r= Math.SquareRoot(a*a*s) X=X0+r*math.Cos(-s-3.14192) Y=Y0+r*math.Sin(-s-3.14192) If Math.Remainder(s,stp*5)=0 then MM=MM+1 GraphicsWindow.FontSize=8+s mes2[MM]= Shapes.AddText(text.GetSubText(_text,MM,1)) Shapes.Move(mes2[MM],x,y) Shapes.Rotate(mes2[MM],-Math.GetDegrees(s-3.14192)-90) EndIf EndFor End>LTH412-0.sb< Start>LTN020.sb< 'mahreen miangul 'randomizewindow GraphicsWindow.BackgroundColor = "steelblue" GraphicsWindow.Width = 1000 GraphicsWindow.Height = 400 GraphicsWindow.FontSize = 20 For i = 1 To 1000 GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor() x = Math.GetRandomNumber(1040) y = Math.GetRandomNumber(480) GraphicsWindow.drawboundtext(x, y, 600, "👹") EndFor End>LTN020.sb< Start>LTN722-0.sb< While "True" mx = GraphicsWindow.MouseX my = GraphicsWindow.MouseY GraphicsWindow.SetPixel(mx, my, "Black") TextWindow.WriteLine("(" + (mx) + "," + (my) + ")") Program.Delay(100) EndWhile End>LTN722-0.sb< Start>LTN722.sb< gx = GraphicsWindow.Left gy = GraphicsWindow.Top While "True" mx = Mouse.MouseX my = Mouse.MouseY GraphicsWindow.SetPixel(mx-gx, my-gy, "Black") TextWindow.WriteLine("(" + (mx-gx) + "," + (my-gy) + ")") EndWhile End>LTN722.sb< Start>LTP201.sb< For i = 1 To 12 GraphicsWindow.DrawText(295+125*Math.Sin(Math.GetRadians(i*30)),195-125*Math.Cos(Math.GetRadians(i*30)),i) EndFor Shapes.Move(Shapes.AddLine(0,0,0,-70),300,200) ' hour hand Shapes.Move(Shapes.AddLine(0,0,0,-90),300,200) ' minute hand Shapes.Move(Shapes.AddLine(0,0,0,-110),300,200) ' second hand While "True" Shapes.Rotate("Line1",(30*Clock.Hour)+(0.5*Clock.Minute)) Shapes.Rotate("Line2",(Clock.Minute*6)+(0.1*Clock.Second)) Shapes.Rotate("Line3",(Clock.Second*6)) EndWhile End>LTP201.sb< Start>LTP633.sb< '======================================== 'PROGRAM TO PERFORM BASIC ARITHMETIC '======================================== While ("True") getInput() doSum() TextWindow.WriteLine(num[1]+operation+num[2]+"="+result) 'Wait for a key press to have another go TextWindow.Pause() TextWindow.Clear() EndWhile '======================================== 'SUBROUTINES '======================================== Sub getInput count = 1 While (count <= 2) TextWindow.WriteLine("Enter a number") num[count] = TextWindow.ReadNumber() 'Only a number is valid entry here count = count+1 EndWhile TextWindow.WriteLine("Enter an operation (+,-,*,/)") operation = "" While (operation <> "+" And operation <> "-" And operation <> "*" And operation <> "/") operation = Textwindow.Read() EndWhile EndSub Sub doSum If (operation = "+") Then result = num[1] + num[2] ElseIf (operation = "-") Then result = num[1] - num[2] ElseIf (operation = "/") Then result = num[1] / num[2] ElseIf (operation = "*") Then result = num[1] * num[2] EndIf EndSub End>LTP633.sb< Start>LTQ978.sb< GraphicsWindow.BackgroundColor ="teal GraphicsWindow.Width =1300 GraphicsWindow.Height=700 GraphicsWindow.Left=10 GraphicsWindow.Top=10 GraphicsWindow.BrushColor="white GraphicsWindow.Title="FontEffects tt= LDText.Split ("G H O S T B U S T E R S" " ") ff=ldtext.Split("Arial;Calibri;Corbel;Engravers MT;Jokerman;Maiandra GD;Rockwell" ";") fx=array.GetItemCount (ff) GraphicsWindow.FontName="Arial GraphicsWindow.FontSize =77 For x=1 To Array.GetItemCount (tt) tx[x]=Shapes.AddText (tt[x]) ldShapes.centre (tx[x] 50+x*70 50) LDShapes.AnimateOpacity (tx[x] 1500 0) Program.Delay (250) EndFor Timer.Interval=500 Timer.Tick=ttt Sub ttt h=Math.GetRandomNumber (12) c=math.GetRandomNumber (fx) LDShapes.Font (tx[h] ff[c] 150 "false" "false") ldShapes.centre (tx[h] 50+h*70 200) LDShapes.PenColour (tx[h] LDColours.HSLtoRGB (Math.GetRandomNumber (359) 1 .75)) EndSub End>LTQ978.sb< Start>LTT372-0.sb< For x = 1 To 3 For y=1 To 3 Step 1 For z=1 To 3 Step 1 TextWindow.Write("Enter Value: ") Data=TextWindow.Read() Array.SetValue("MyArray",x+","+y+","+z,Data) endfor endfor EndFor TextWindow.WriteLine(Array.GetItemCount("MyArray")) For x = 1 To 3 For y=1 To 3 Step 1 For z=1 To 3 Step 1 Data=Array.GetValue("MyArray",x+","+y+","+z) TextWindow.WriteLine(Data) endfor endfor EndFor End>LTT372-0.sb< Start>LTT372.sb< For x = 1 To 3 For y=.01 To .03 Step .01 For z=.0001 To .0003 Step .0001 TextWindow.Write("Enter Value: ") Data=TextWindow.Read() Array.SetValue("MyArray",x+y+z,Data) endfor endfor EndFor TextWindow.WriteLine(Array.GetItemCount("MyArray")) For x = 1 To 3 For y=.01 To .03 Step .01 For z=.0001 To .0003 Step .0001 Data=Array.GetValue("MyArray",x+y+z) TextWindow.WriteLine(Data) endfor endfor EndFor End>LTT372.sb< Start>LTZ487.sb< eNq1nQdAU1cXgMlCCCJ7KyB7KCoBRUUJQwRFQYaAkxAeEAkJJkHBVjRQtXW0tta9sNa6cLSOaq0S /1pr3bXOqi3OqtXirlrHf899Sch4QZLGKPCS3HfO9849775z7rs5sbAtIybxKydMFEhl4soKC+vI CA7HV1AoEVuwJvJkhMSCPaBCwPeV8URlERYWFjT0w0A/FtZ1uTT2ND7NVsIrElRKXQQigSwTb9rx xUKhoIjwkUkEJSWEJJ4vE4hFYyPtxJUyoUBEeIhFWbxyYij6GRvpIJAmVAqFhMwG9or3Uu5DvtlO QhTh1xNtSiQEIcLbSXbSysJEtGFdKKwk7MQVPL5AVm3DE5UICS+xaKBEXCkqShHIxkbi5gluGiLt igiRFLV2kxBSmUBWCWBuGvt0KhWUlArRjyxZLBk03KFYIsDwXlqH0rl8LD5EqYDctcKl5Yj8tSSI BSKZHZ8QITvmKf/muyBVEl4JrxDhCqSJaB8JL1nMR3ZD70p4ApGTQJqKjCkjitwkYhnqg3g4NPRq Fk9UVCiuspZVVxAuSMbEeFH1RF41emeACMQVOYDgvPTiYhf0UpFABi/i1/LRa+H8UoJfRhQlaqEj +2chHQK+P6krXSJAmDw4TFbctfyw3xp83FlT3rx50wQdz7Sk0+kMSxpTPpnBTGDQmWFM+RSmBX7J g9mOTmfaMC2ZqPUbOp3Fzdw/886GDRtYii4RKaPO7WagfelqWXRL20SBhC8kGAxW3JYc9MizQFt3 d1/0O3ljKqOlIZvGirvx69VLQ5bKNUEYSpBRDKY8BZGI2kQS3h/92bBRh2SUNsPFqeDgFpoMMxg0 W/DwvB7kHw6rqgerKhI/ySdfy49kVXHILQ6rugerOpJVTT7Pi2RaWrHbd7B3dHZ19+zo7esXEBQS 1iWie2RUz5g+sf25CUnJKYPShmZkZg/PG6FW2rLBzVz6+tmwv6ahjUbLSTsW/E7Z5sbEY+l/9G15 RdHFN/W7MdGJLEXXAPZdzpVn6JWoA0vXXMsyuUMVoYpOvjORnMnbXB3X/apjRodsiQCfhmDOHd2y m37tAua8fz5xZNwDrqY5p3NojGobsE0u/p3CmMgoZVTZCqTZaJwxylqKLnPAYwooTBL3oG5/jzMN u1hxB7v9XPhyARcdwbkf6+M/6kXXcKA2HfiLY35rouYiZbz35iJbol01D9wpk+DLVEfeeGfjwbXN y6eiI2++12E4013Lma1ZitDahXO0OqoF+PHOx4TVH7dYcUeKRnRssIJe3Tuq5nhYpibwFOTxeYhY boW2WY3nchcJH77ZZYj85uGSRbGOSOvg4xdcZ4TrkMstgbhpg6CzdAwibrxSvtcjIcZChzhs3un0 7lX+bSR++L0il7eCruFbOsR3Pnx1puc8hQHirI5h6xEN0jraZsk/vk6UxE82JT1qV8tFW9Pf7388 rECPOH0PeiioiK+OiY57/149i2sh2ep7YOk6RLz2wTAHB3uDNjbsFt+lT8+Y85qlCIknvl0dMljn fMCocQfTvK0/3oxOhMYH7OBFsU66qB5/w+M+FeotPA4hm9KtPkSP2SxFReRE9KhqzX8dmXbMdgwA tQDQxwhJUdEF78ZSuAiPoscxKlD1mNCypQP6Pz/08G8bqFhBKmr1RLPTtCgGFW/HuyFQLpbYRlCG Jmjj1tDFixcvsdAHZbKZbBY3YfLjmnsDAgw7aFzhx75fPRhDwfgAej3pFd6fxXVqzEeKFlExcuNk 93InHWnPYClsj2/jcDjdqRiXGWQcONpkxvvAmHpZi3EuJWP0dm1GX+PsmJFkkzFj22pTGJuBcdgH eP/W7WjDSlm8vSfXVDtmbjeZ8W88GD3WYqS0o8Jj8shtgdebTLVjjrPJjPeAcXj22+2o6LZv04XP Hla0bkfDjGmdTPbHu8A4dHkbzpkQwW+bnyxwN8TIDQrLRaNYJdUA1HwZHgoUKUIUl1PAUiSsbJ+G hhLEAQMQHQ9AdGYCXT0A0S1tcIKjHi4ZQPsXGvQUCWMzPkUXBKTxDB0Neb6U4/qPDuhhDwHOjho0 gD/QjVlND57v4DPYPTl932ZXliJmVuNGceC3FCFr4y95/aIaCiDSuPHPk/LrO5vMFzbrMDjdP5W3 Yha6ErfCcOSZoEv6AC0zsKgC1ZRjEWW23Y4i8U79xKen11C1SS3wdbF2660RzMZ8oBgRyT/HUvS2 rH/UqQ8HvfLxq8Nn+/xhsoFd6l6sXnwWydlWadV++WodA0+Agzvxd+DQJDn08Z2/V9HmbS/QuSTG 7PmoQ9meG22LPVOT9nx3t6y7EbEnyTnzcOO2/deQsjX5A6wa0ynjoYdfLR987FMFAr0dHrLK7XaT Dmiv6D8TN8b82rYILtXudhVrU7EpMSdJXPhj6uKTN5FWz9rbH88+Qkn81+DLDt7XIYK71e2L4xHF 9brE+6Z9uXTawDYST1r/r7vXa1NiTpL42LSjDXE1SOvqzoNqLsRREr949frO5QG+aOuoeIRiXoFu XN9rWfWIK8GubYs5U244dZw16ZpRMSeJan1iBlu2j6XoOX9o3unLI6nGpsYDvb/e4SOAmPNxmafk m7AMHVSucEPp57/4UPotHkCHIyurYrqOxbTmXktHao6kvnT4gV9MtEvIoSPBryBW0x36LwGw99yG xVeTLZHSjlgpBm686bPv9LqHmarBdG+Hc3+cykfACosK98AR0R/A9cCp9wG7oA8PYeD4R0uXWSqo Lk/IupDTb0DWdSym3f3d/6GmUX0Z8KNLyrBk9FSP+yw1qj/H4qnY4TmgrkhO/rqMRP1n8MxbNHGp yravpNZfhLvMRai0iU0Hw+MkyLZaqLF1wv2zH78FtfPlDQv83p/VFlQ5mwI1nNwfqXOLcBP2WqlE Hffs1LEPH6gu+u5rNjWW/3QVbTGdv73I2+WsiUpjcdt9+iJHzFlJdX0wBEPZw8UMtPkCsXR+Q6ZG qIFqWuUHPJmigJ51Ac8q1jXX+Am3R+XJ2+aK/SLODv2mts6gK3Kt/cZMrDjWwYAr9ts99fnorhEA ipUqjVZ/2XnCp/1URou++30lrUse2rLZPSO49KYtuKLP4f27U1bmYODk8wVvjn30lv7teSD8yxXR DQb7V01qoH/7kvsDap3NhqooSlTOs8n01+vq0Rb7633TF17yBdtqosYvvxF5YstbUCNFZ44Wbw8y GbUXuT+cNSmfXJ40Qom6wKXhzYFAdfyZuuPp4UepaMuqkVNb8rWTJqoRrqgBQ9nDB7qEcGbeQSxB R14uWpWsZFk31+VIt72kRyqinzmfoB3KhA4WvLpZUrVNx2pOKaS3UYQlnbFH5rDiTqo8MiHE5UxO TrbGlcedgf7Tme4o/aY4YY7gDDJTATJZCsdDBrNcLpfAU5Voy61ebz4SML3h/UVUJ84v+DRsQrHH VBVmGGh8bRxmQizeCWEewKooMRPeg/caAHMZbqWL2d0IzOQMEzCTC1WYZw1jxm7E07uAuZkSMxdY nrWt05OX4v5rM+YBwEw5WBaG56Adz2FVlJi9rpNdjTC34Fa6mBEAP7eN1lwBGtcZh5m8Fe+EME9j VdTWtAcNTMBswK10MblGYA46YALmoLMqzJuGMTkH1Jj7KDGN6fTBrsZ1+l7AHBLfhk7vesmMnT7Y wzhrYszB4W3odI6nGTs9Pc4EzPRhbej0wGWgwcpgp/t3go7NoOp0/zO402HCI/4yqFqvEWlYQExD h9BcnsKkCHbJkT0PXw4QYR98daUe2QtwXAOEjriV9jyHwj8Q3k97C2HyMFCVZQQhOQwdUY2WgwyP lr0uqEdLP3K0NIVw0FFjCclzJrkNhF0PwntbqQlprLhfS5o/s/b9kRV3ades6T2rIlr8DIUWFgwl Ayuu8YPtP2zw8NV3uG24O79TdmdgP+w0FJMw3LiXqgtg8HrcSGcS5j+TfAMkA6y/Sp2X1xeRRL65 tC1WQUky+qP/RXz5O5CswI3MTfI1JhnhkXVhJ+qewAHJ238/w6Ui6f/96k2r/gT/Cf4aNzI3yVZM sn79Ibfd1xFJnwexsd9vpSTpVPtj4JXZQPIVbmRuki2Y5NH5bI5VH0RSPmZvbiVl7/T7KLChOakJ SC7gRuYm2Ywv34mlh8bb+CESvnXSjtHdqUhi7zAPSOPsgeQEbmRukk2YZN7FU98KriGSyoyOTU8o eyc21XvLTfnHQHIFNzI3SQMmuSZMfiI8ikjGvfiy/2VfKpK+61/9NO6974HkLG5kbpKNQDKQ88ew vkdQ1h44Of79cZXrKEms3b65vK8/kNzGjcxNsgGT1Il/rD4uQySSu4xDo92pSPoInh7m7RICye+4 kblJ1mOSX6+eUHTthUimRV589GQRFUnvn+13nH5xE0ge4EbmJlmHL43+0sTX3TshkkmX+cMuW1GS hDYfy3viCSQ3cSNzk6zFJOWrTnrUSBHJpkHXhQsoeydm/mc7/PJEcN/EAzcyN8lXmGRvZFKufBQi +eJJ2eHJU6lIej0df/SrzGVA0gE3MjfJGjzxabtm6PImb0SyIzbxqas9JUnOrF0e892BpDNuZG6S L4Ek8eLMHoxxw1iKgK/an2KFUY4n3EtNz9dy88FPHHEjc5OsxvFJuOea+PLeiGTpt/l8h7mUJHMy pgn6jQeSdriRuUm+wCSVqT1G7fkEkRwP+G3y4XpKksTOz4c0ewFJH9xId2HMK0ORuSoLg6gyfYbu jEvLbRTK1GEVTh0WKiM5nxeGA/OAaaqw109AhnLaYW/oibYAxv873zjAejzZYjNfCbjCMGBCwxll 5uDXVw/QHH25EqMc+nn3ulFx6Ew7vWVgzflDVH0Z37xqPH1oGZxpXNzI3F61Ap9p7iO63hwbhEgO 5x+/pKCMZuLr7V8eGPwBkPTEjcxNshyTlB6L6bL3NiK5VL/WKm8XJUn68oeT7+4HkhTcyNwkyzDJ rtEN4xQnEcmpwRHF3BBKEgvbmrjbvwFJf9zI3CRLsZ/UvXLZ8r9JiISoObp2KOWInBAlcn5xqzuc 87/gRuYmWYKvDSeVHhu0EPni4ftUJNEnEq4yl51FW6EM3MjcJIvxvJSv0mODZj+07PlNASVJ987P P1wIMxQhz3Ajc5MswiQVSo8NWhnze+GgJiqSqE/6Xv/3Qi3YxAY3MjfJQkyiUHps0OfXCEUkZRbN ue/5csqv24HEAjcyN8kC7CezlB4bFOLGpHFjqEh65l0KfXKyAHrnc9zIAIn+soM2kszHM242qjzN 32CexhmhztM+aS1PM5nkc0wyUpWnRRvM0yJ3q/O0Va3laSaTzMMkG1V5WpjBPC3SQ52nLWgtTzOZ 5DNM8q8qT+tnME/rUa3O09a3lqeZTPIpkKQNVuVpkQbztO4X1HnaitbyNJNJ5mKSpao8bYDBPK17 b3We9nVreZrJJJ9gkr9UeVofg3laN84fS76+E4XnfVrL00wm+RhPVUar8rRyg3lahE3guKStl/C8 T2t5mskkczDJNFWeVmgwT+ty9NritDUxQHK8tTzNZJLZmOSMKk+rNJinhc9yq+CE4ajgSmt5mskk s/Ciw0WqqCDXYFQQUjPtgHVvmL0N+aG1qMBkkpmY5JYqKkgzGBUEcxMfOUTAaB+yq7WowGSSj3Ae FKOKCsYajAoCX0/8+Z9tcKMn5EhrUYHJJB9ikg9VUUG2waggQBH97M3aUiBRtBYVmEwyA/dOliqO vWUwKgj9dFfWX/UKIMnWiwpQaugMGxb2bbuVmLEbPo60sc03v6bj5dLHm7h4JaRzAVZFmSDSyEUd aMsjBrfSxdwJ769r2z26jO+a4oy544kxM37AOyFVo7AqSkwPnGhDjOURhVvpYh4yAjPzmAmYmWdV mCKDmI2vsTWnAmYyJeZ9fKuxbZ2e+agA+q/NmFMAM9tqx3wQo3CuwKoo13Z7HlLdP/ZIIe996mAe JFf6tM2aj0FjtnGYma/wTkiV0ODkhYLZDesCzCTSS3UwzxuBmdPOBMwcexVmjWHMwNXkPXiEOZwS 05hOz+neZFSnV+EF/cnRb+/0bhlm7PScyGijrIkxc/pGv73Tg/5RW/O/d3ruABMwc4dGv73TOT+B rpcGO93/Np4ZfMsN74zPcccZccObHNl/UX461ekUvqlNPbLnqIZM9w3krW+dW/J4tWT2Wwgzj7NB lRGE5DBkU0COlk5XDY6WCs+HqmuP+3fkaGkKYY7NTCMJyXMmpenthN0IctKUktAc4YQID4Z0ZXcG WeMuo/qw8dNxoB+HE5Vkv5o5sCnHJGFZAT83QCj+GtYDnKQiufUgZsDppXCNCxmHG5mbRIhJMmev v3txCrKJA6wHoAr24n4YdvbkowYY0UIm40bmJinDJJOyr9tceohILGE9ANWt+sbffYbunLEck0hw I3OTjMMkK4VhHh+gNDaoN6wHoOqdxvvH1vSw+QaTrMGNzE0iwCQ/RRXFTPsUkXSDeSaqJR2NLxq3 7Tpqh0mW4kbmJinFJM3lt0duh96Jh3kmqt5R0EvYU488gnEmZBNuZG6SEvzJP7ee/pN2FiOSnjDP RDVBp2hX4HCgwc8XSL7AjcxNUoxJ4sTrlt84iEhSYZ6JaoJO0b4kQeDYAZPswI3MTUJgkpJeV7// sw8i6Q/zTFQTdAr7rQFnq71hjA3ZgBuZm6QIk3wyvqTJdRkiGQbzTFS3GxVOnL0hDc4VQLIXNzI3 CR+TfNt71Rv3DogkGeaZqKY7FC5buYeXhc8Fkm9wI3OTFGKSSxm32jdC71TDPBNl77jTdoRPWIF7 5wZuZG4SHg4XmB5+4YrNiEQE80xUt6UVnjUxx4p3YJv8hhuZm6QAk3TJXDv0vh0ikcM8E6VNOtF+ 8Vm8EY8n93Ajc5OMxUHevAHu8h0hsOAG1gNQTvhbe9stkbHq8YIb3MjcJGMwyR7bzPqd6NwJLIH1 AJS36pmBVsPnnYPxJPhX3MjcJKMxSVPAos2jDyGSJbAegGpki3vDjAvde40LvWOJG+lWevjZUGSu eU8+V0DGvW2+Jz8Kpw7j2WQk50sqoQwqo7JwWIsA/aPJ5QPaYW/Y0rYAZqweZBzgSDzZsnGQEnCp QUCuVwfVUln/dnqA5ujLEbgvra9fOh3hi860elgPQBXNcF0CbT50lMLoE9oeNzK3V+Vjkh6bXB91 m4dIFsB6AMoFqo7rZtz0GwX+HUrHjcxNkodJ8m8ucx3zGJGsg/UAlMtC7QOa5zUXw7RvqDNuZG6S XEwi33w2uqAUkayA9QCUo49Nxrlrr5fD6BPKxo3MTTIcu+yfNTPPXemHSHrAegDKm3xugyvWnovH Ocly3MjcJDn42jBH6bHBfOSLRyyorg2d50zq+/QgrAgKPYEbmZskG5PsUHpscB7M/FdQkfgd+b79 37/cB5IDuJG5SbIwyWWlxwaXwcw/1S0TRYDthz2t0mBKJ/QcbmRukkw8u8RSemxwAcz8U2XRisDB h9tZ5C0CkqO4kblJhmGblKk89jHM/FONJwrfSQMbnMfCVSq0ADcyN0kGtkm4Mk8LbDaUpymCJj6d 6CGHWdaQke8kT0vHJFmqPI1mME8L3v2/+siXt4Ck/J3kaUMxyXvKPC3wqcE8LeQZc3y41YdAUvhO 8rQhmGS1Kk+zNpinhfU+uSSpDpNUvpM8LQ2THFHmaYGvDeZp4VWOZbGfhOB5n3eSpw3GJI9UeZqD wTyty+7fPx/OjsHzPu8kTxuEJwi9VHmapcE8reszX2KoyyE87/NO8rRUTMJV5Wm9DeZp3Xx/m78n HffOmneSp6VgklJVnhZhME/r3u1jTv6mIiBZ8k7ytIGYZK4qT4s3mKd1PykbeHMcHk82vZM8LRmT PFBFBf4Go4LI4Xs7/cvvAqP9J+8kKhiAsw8PVVTgbjAqiHzyu+XEUnwt/uCdRAVJmCReFRWEG4wK OAsOeDGD3geShe8kKkjEJAJVVOBrMCqIir7BmNolDUhmv5OoIAH7yQlVVLDdYFTQ45j/WXY3HFH7 6kUFHzjRcO3LfC8pnyckcgWy0hFicbl/kUBaIeRVDyaqMySEVEoUTcLN8t53aXlHbtFJWZE2W1zJ LyWkXjzhRF61dLhAKigUEm7lY2VElSxZQAiLVOVv0wRSmZzu6GoN79RYSwWTiI5VdgJRskQsklHW H9WApagg4cviBuIbdG+QzdgzODT/cnGllMgtJQihshyt6lDipRk8qXSiWFLkAHV3oaaunZQvEQuF Kcq/w12khBBqaKLdnKSlPEmFCB26i1RWLSSykESZE1AnioViiQPIyZXwKrx4IpkgXijgSbOrKwin 8kqhTADlhQc5lPOqEpEMaTBplKxS8cQsLF4gFjnwKmXiLHTwLoU8flkJLvzr07KJVdgWIhWExElW KuCXAYgb+QJ+MxQdZKaAX5oNQEJBRaGYJyny4otFUFoYHb5ARvgXEcU8hANNksWScp5M7u1ClBcS RcnI1lK3EomgKFkgA2yHUlm5ENr14vH5SJOgEB2DrDq1vEJIlKsK8bogu6gq/KLNVKSqyqkYSgZD 3VEPbHfl+24IBEw1hBBVBhaJK9FrCJJfpnzbCRf5RSJH2GKny/Pi85D7xEsTBLJyXgX5Yn5ncQVv fCWRoLaKtYhXTriQXQUq7YoFQhkhkTohmaKiIeIiwkkm4YmkxehgXbCM3gPRMdrwhBWlPJuJgiJZ qXU5T1pmN4H0z25aB5shEVcQEpmAkJL6R9iWElBAWU6vYkxSE+ept/IdVFsMOjpnmTR01sK5a2kr AmML6ZZ2RdWIWMCHIjTWIrGIoDPrYIUInkmhs2s5NDula0KJaLHEroyQiASiEi8hIUPHlQUlpUUl TujICQm4FFg9SyaukNrKeJISQtauUiJEBycoEbkIiWLZEPSiQGQnJHhFaDfrQjE66yRwBOQbtgIZ asu3LkZdI/d1KxSK+WXQhyKZbSEufW0rwM8sbfBb5P1OaxrNEv5ZgwLMDQdjEy8R8ITMDvippU85 r4zwxUcg9RUXF6P3KwRVhNBSXhab4RufljpwaD+/tAHJ2X79Y5PTh2b7JscnDujnh2X4+WaljkBP ekT5+Samp6Vn9vPz744ffr5pA7KzB2RmZcQnpg4d2M8PvTJ4QOZQ5XZ/HaWx3UB0/9huGf1pdFwZ lcaggaXRL3QMXgKRVMYT8YmekTExPWlwWLWO7EQaOknRQFDFSbIlN8KRC0gr4BydQCCHGEeerZ2w nmyVb9HYfBpLVs3gMQoZfEYRS1bF4k6YjSuGMsETkFIWt3DVYihlSGPLnWhuuGx4enGxlJDVerph fySfuUDxcHKzE2wOgeGjQiggJD54n5bnXhKiqOWZE3pG7uaDpbW8g/VjBvwP/YU/cl9kDsAqqCmG h5qvhVy5nyVqFHcuds+ePd/jp7UJLG4YvtXfwAxgWqAr7FhyolG75DI62TN4EhmeSspRfXzJAw/M L+laU6Vc9/OGCtsoSy1laFRyDbrSQFbKNlw/Ueey2Bsui8H/0Mn9PfMMlraJO7xBefc77k0OxZQp 15dc7NBGUKyR1hpojbpqEQ2DQsGfkPa5uLgU13c/Fkld4xG/xVVv6a6Y/avHpZr/3fmEqmrRW6rd csBYkRvDwcYsRXwHKmPh+e8baoQz+gjWLEVCf9iT1sZSbufy0St8w/WzPDr/m53U1V2/cyOB1wed 1xYWKIeK/9uCtDl6Ne62ch+lzX6Dvl0PSxuwJ1jY4/pZ4yaF5sSMwcBOJNVbSrlh0gmGi1KpSPWL UmFU/zJw3z06qM+Org8+YcNRre97hissdddApWuj4qU2DW9B9XMFT8oyGbULuT9CfQSWyVWi3nVz XBpwQHWXwW2KaoESHfdqhSaqMfWzWmCoetgbm30MYrmlLpSvLuV2GY8/CvUy06265orB+7SxlNtg 8P31rZRya9UV+505ixcTaYKy4p5ruaIiGmOu1wCGqf8L70/hdD6FgTsYGBC1S7k1yeGlVuqjtd6/ fcn9W0fl7AAD5WvbVhO1TWdN5Cww6maTUXuR++ucNc/dOHePjX2tQo1QwHuW2meNCtWoUm6tumK/ pqlvcBmY+Gv40JUsoZtzFh1ZoCrlhq2WpbE8TgvlP9Tg9QYEjoUc+4cicWXs/qZFf+mPz0yoDXv5 0c4Bq/QmAf5D8V0d5XyqCxSpnGnx1nK7keOG9VzOEKKNp2Ju+NaTVG04c6Nmfn4qWaPcbuLSvR4J vf5FG5c2Ed+uDkUb9Rd/+dx/iqm2jHzxMufnc7VIzja3im7ZVyjK7cYtcFx3ftUzMOm1+9N3Trmm W/Iu8dvO0jHX6W0rt8vJLzs7clKUEeV2SbPf+OiPO8FLkLIG64/RoVOWgr27yutV0iO4KF/tSvUV DwmPM+a8/qK6bcVrI5t/Qq1XmVJulySeX4McsB5pvbmi4H5aJSXx1ZX7JhzaDhVhm7tSfcVDYgw0 2NY2Ys6PKcO/ufiLKeV2MXHUuDfPL/qdRFrD7n1aKtlCSfx0bfPyb7oC8SXOlafjs/SIgyGOXtq2 cruRSzwh6Daq3C7pttfmiRbOyUDG/ZLpPk+2jzJM/B6OYiug/nMneFGso9bc1zQ+za0Cvl1JlFVB EEXMTsonMgkhKpGVWnkQODfPwK+68CQSXjXO8B2dO7i6e3q7CaRJMGkiriaKAuzg23oExcUdo/D3 LaVhCV4wpZEu5QuEQp6MsOZVCaRepI4k8UTRYKK6E7RNVbdX0uRUoLdcKlDuEIn12aEsrVQsyVP+ zZd3tCsfOw6+waiz9lzT2Ei8Vw+8l9zVBj/BvyM155GY3gz0n8G0hvOOPPHkU+hoKwx/2wOL6zxi zNniVVV0tj+tSo6G9k+XPjqTObUHK6759c/X994cwwxpucilM61YigqmCH9ThsJ5L1R7/92SBmlW O6YF257tqNkrnTIkAmk5fKsR/gamt365RZ0TTTWfpvrmJYE0m3yBKKqtqrOqY9e1l3es61BnX+co d61zrnPVPFQIklxZ3FTnh7nNZ9Dg2Wvy/LwgTy+SzwHxBbAjNPlcklGaXqRiazwxqnbJlI3gPueW rH9aXc3VzNu6gnB7/XLllo4g3BEJD2L7aQqv86asXK4n06F1mQGmyHREMjN+uOuUvQ7JXP3lqHsV J0iZTkhmCDtIX+bNI9O2TDkNqeCtx7OWb/Zo0pMJhvXbMj6y/QuWoufftjUFJ7aQhnVGMsO0DUvK PDv72N8jT8HX2dzbl8G5yfbVk+mMZK4K6n0zORN1Fjdge7rdH6RMFySzCztMX+YTSfvPvH3q0da1 9wQTvJlaMmulNAep8nyWu8o72khLeRVEHyeBNIEnFIrFolgnWamkUipDZ5wtPltFLrgJPoV8tc4a O5gJYEeoC33TVZW+c5FOZAx14Kj5/UPZWDohkVIV/56rifoBg4YJEnPt8J/EXDdy/BkiloklLuXw OzEXcfrgzTTxRJg6LhfIyOc5FRXK52RTPKR5kZtKA7iRMrCQ2klvO3UYaEgOZr1pJqeSWVOUG0xv 9C+QznTTrx9uWQMd5Yk6qie7u2Ylca9MYoJYWCkjVCeWflVxTUtEgyNQqbZD/5BqTxbXaU9OL4dQ qGzsRlyMTmORPuKOVEeye6IR64V/QD9//w7IR7iQWVjO3rPlmH8UfHBs6x82v32WbaQ63fLjpDoP pC4K1LUUIsfq9AuRG6POXb+EuKa6SM1i4lidfjFxbXVoYA800I/BdKaXfvFtsh+9kbr+7BjN2tak Or0y3HpHF2jg6JA6bxaX22vc9QunvcCY9kediYfk0XVE6vqw+4O6xa92/zpktEpdzMrLV/rMBVex fe+9c5d8nhupTrdeN6muE1IXS6rTPjq9yt3GqOuoX3NbU10fzerbpDq96tvGuIoHioLWT+1Z2m8U UuexR7b1sw801UWBuo92vfTs0FWlLvCHVRu6T/8WbVmWBA/2P3fGGHU++oWnSXUoZ2QnsLlaYzOX sgS1kep0C0iT6jojdUlU6vRKSWuqC2QyGUxHNKj5M90Z5IfTUGgJn1CDErEsrsMm1r52P9Uz2KEo zlHdP2PKuS2hjpyLAp8WEzAupS8cMmeupdyqxQaZWlDu2jawnY13YGhBtSOhAgxAzR/8XfnxAgSF J671adQWYrpbL/lz+kklDWkiCpoWE9kewjswjOgRP/0i1GSP+CN1Kexkih7RLUdNN06dbjFpUl0A UjeISp1eWWlKBwihsPWBNjpAqIYJGC+hP6cqTU7aIJvC5Gob2DbgHSgdINQAVKsOEKphIWYM9KdC SUOaiIKmxUS2t/AOxjhAoH5BarJHgpC6oew0ih7x/A8OEKhfWJpUF4zUZVCp0ysxTaeydVcKW+9t owOEaZhA2wFIGwynMLlnqw7AIqEiDEC16gBhGhbSdgDSRBQ0LSYywQHy9MsIkD2Sj9TJo9jySP0+ 0SspQDdOoW5BAFLhCFDYk0qhfnEAbSdwZjCdkb0LKew9vY1OwNMwQ7v20KdblWZX2SFJ3/AtdrAf E3zkq4PnGVRYfANYrboBT8NK7VKgV+8reVRm0ufRMJP9+8xj0h+qjHGEkfqlBch+GQUK+7DlMXr9 ol9mgG6cQt0iAaTC0aAwllKhXsEASkcoobD4lDY6QqGGGdp1AUeoVxpeZYdkPcNr2MFeBI5wktIR Sg1gteoIhRpWalcKjtCk5FGZiYKnxUz2s8ERKoxxhDH65QbIfhkLCrlseX/9ftErPUA3TqFu4QBS YQEoTKBUqFdEgNIRhBQWr2qjI/A1zKDtCCo7pOgbvsUOrTlCuQGsVh2Br2ElbUdQmYmCp8VMFI6A p2cs4Yuum/7+ob8PSxHmgO+ukMZHP2wmu4Pe9EzczswlKaPOw5zHAXJ6W2/Kx0Lv66svklNT6C22 JZuuL1P3G6yn6smktS6TaYpM+BD05Z93nX71CMkc49B4Op1DymQgmVZsS/2pqfPZ/lPWrQCZzTvH IzvoywR7Hmx8r2hER5Yi5OF1+p72j0h7MpFMNoU9Gz+HOwkVYM+bL8fVPL+oL5PJ4maxXvyxb8Ih liJ0oaNo4ZwsUiYLyWzPZuvLvN8ZOkmBti5I29XyN2r1UQ/lxFcH9bcq01Vfq5wIE1+WlBNfdV2o vmGZq33eIW9mIdeWd4aFIeTKEPkUOl05Ed2bFfey4atVlrkz4NRrbH71s6//xS2sxoXHdxMZSU90 PV7uyOKG0PDSGBa30z18Z5I8bjnMcdb2ZNdG6bl8HFmgB7rogYXedzn1gEkQSzmbHQuFFsOmd316 Ex0719W+9PHcYqSTzuzEanzeOdr2zr0IyLWnDCn5LjBfefCKwCt/b7Hk+0Cuvb55J3Mm/pIP66sz ZWH/srRFrw2bzoGPXYLo8+/7fUwl2nV/SM5lteh99NXiDr+A6PqJgfmrbhsUvSKcGBBVCKJ9HOz7 xSygEL3Yu3yHPFQtevO4/ce9r4Ho9uzNX11y0xT9tskkuYv+UhRyNkkOc3O1XHZtH811KXh01l+X YsyUi9ydxXXusll5cxyv08hRdrsrqIxFWtFRPvuC9SpnRooqJrV6oxp5yUUbGcaq1F3FolTpBir7 Y5UtS1rIqFRvSYtRKl31V6PoqIzVXJpCXvb0lqZoqXzLBK/cQ38th7IvYa6uNoVdm6C5WkI5Oai7 sMOYS7u8I4vLHQDVtofrGhZmlWuTkFZQ6eX1vP52jHqCEFddo7Vi2Leo1F0GolTpBSqTlSq1j1Jv TYhRKj31l3PoqEzSXNtBqtRb22GU+7ihoeDHs/jTzor4+1RH2R9Uss/1/XNDO3X4jD81PQJUhukd pXqUqU1Gss+ABdEVUBH/mKwXBMOM3Eu9CAmEW5StnbGfox5nskHkThBOqM5Arp9ygYi28B/IVT6t C4+2ePJgt1o4/mq7b9oi/Du18L8MCveM3VTXyVIt3FslnHZGTzi+Asv9keDnF+wLh5xmKRLd4crX SWlumFWvTWPXDtePQJbAfX58r/rqEXFyxsf6kZK8k2q1xlT1ag0yBJH7gNyh7NpB+nJh7cYXFhpr N/Tler9VbppJcn1YXM7492PWDwlAcjd281y5b6JSLkyX1mYg0frRyKX+x8OyUkHulafUURPYl+OS lXBzLwpxEk7yN+aX/6m0L0x81mZS2bdx+ynYAez7EK9CUOjL7cziRjlyT6d3r0Jyn6NOmPNGKdcP 5GYj0fpyH8CKk3ZwU/NONax1mUoVPdUOV69YoKuWLOyB8Akdi+H4SWf5gnb8JGfQ3GSERMITiOAD C24tn5UYqLGdgD9QYlci4U0QyKo1Plvhodq3lCjX3DkTxfKTYeEFHdDRv8mJAsv2B5yzLeK5Fhb/ ByKO5/c=eNq1nQdAU1cXgMlCCCJ7KyB7KCoBRUUJQwRFQYaAkxAeEAkJJkHBVjRQtXW0tta9sNa6cLSOaq0S /1pr3bXOqi3OqtXirlrHf899Sch4QZLGKPCS3HfO9849775z7rs5sbAtIybxKydMFEhl4soKC+vI CA7HV1AoEVuwJvJkhMSCPaBCwPeV8URlERYWFjT0w0A/FtZ1uTT2ND7NVsIrElRKXQQigSwTb9rx xUKhoIjwkUkEJSWEJJ4vE4hFYyPtxJUyoUBEeIhFWbxyYij6GRvpIJAmVAqFhMwG9or3Uu5DvtlO QhTh1xNtSiQEIcLbSXbSysJEtGFdKKwk7MQVPL5AVm3DE5UICS+xaKBEXCkqShHIxkbi5gluGiLt igiRFLV2kxBSmUBWCWBuGvt0KhWUlArRjyxZLBk03KFYIsDwXlqH0rl8LD5EqYDctcKl5Yj8tSSI BSKZHZ8QITvmKf/muyBVEl4JrxDhCqSJaB8JL1nMR3ZD70p4ApGTQJqKjCkjitwkYhnqg3g4NPRq Fk9UVCiuspZVVxAuSMbEeFH1RF41emeACMQVOYDgvPTiYhf0UpFABi/i1/LRa+H8UoJfRhQlaqEj +2chHQK+P6krXSJAmDw4TFbctfyw3xp83FlT3rx50wQdz7Sk0+kMSxpTPpnBTGDQmWFM+RSmBX7J g9mOTmfaMC2ZqPUbOp3Fzdw/886GDRtYii4RKaPO7WagfelqWXRL20SBhC8kGAxW3JYc9MizQFt3 d1/0O3ljKqOlIZvGirvx69VLQ5bKNUEYSpBRDKY8BZGI2kQS3h/92bBRh2SUNsPFqeDgFpoMMxg0 W/DwvB7kHw6rqgerKhI/ySdfy49kVXHILQ6rugerOpJVTT7Pi2RaWrHbd7B3dHZ19+zo7esXEBQS 1iWie2RUz5g+sf25CUnJKYPShmZkZg/PG6FW2rLBzVz6+tmwv6ahjUbLSTsW/E7Z5sbEY+l/9G15 RdHFN/W7MdGJLEXXAPZdzpVn6JWoA0vXXMsyuUMVoYpOvjORnMnbXB3X/apjRodsiQCfhmDOHd2y m37tAua8fz5xZNwDrqY5p3NojGobsE0u/p3CmMgoZVTZCqTZaJwxylqKLnPAYwooTBL3oG5/jzMN u1hxB7v9XPhyARcdwbkf6+M/6kXXcKA2HfiLY35rouYiZbz35iJbol01D9wpk+DLVEfeeGfjwbXN y6eiI2++12E4013Lma1ZitDahXO0OqoF+PHOx4TVH7dYcUeKRnRssIJe3Tuq5nhYpibwFOTxeYhY boW2WY3nchcJH77ZZYj85uGSRbGOSOvg4xdcZ4TrkMstgbhpg6CzdAwibrxSvtcjIcZChzhs3un0 7lX+bSR++L0il7eCruFbOsR3Pnx1puc8hQHirI5h6xEN0jraZsk/vk6UxE82JT1qV8tFW9Pf7388 rECPOH0PeiioiK+OiY57/149i2sh2ep7YOk6RLz2wTAHB3uDNjbsFt+lT8+Y85qlCIknvl0dMljn fMCocQfTvK0/3oxOhMYH7OBFsU66qB5/w+M+FeotPA4hm9KtPkSP2SxFReRE9KhqzX8dmXbMdgwA tQDQxwhJUdEF78ZSuAiPoscxKlD1mNCypQP6Pz/08G8bqFhBKmr1RLPTtCgGFW/HuyFQLpbYRlCG Jmjj1tDFixcvsdAHZbKZbBY3YfLjmnsDAgw7aFzhx75fPRhDwfgAej3pFd6fxXVqzEeKFlExcuNk 93InHWnPYClsj2/jcDjdqRiXGWQcONpkxvvAmHpZi3EuJWP0dm1GX+PsmJFkkzFj22pTGJuBcdgH eP/W7WjDSlm8vSfXVDtmbjeZ8W88GD3WYqS0o8Jj8shtgdebTLVjjrPJjPeAcXj22+2o6LZv04XP Hla0bkfDjGmdTPbHu8A4dHkbzpkQwW+bnyxwN8TIDQrLRaNYJdUA1HwZHgoUKUIUl1PAUiSsbJ+G hhLEAQMQHQ9AdGYCXT0A0S1tcIKjHi4ZQPsXGvQUCWMzPkUXBKTxDB0Neb6U4/qPDuhhDwHOjho0 gD/QjVlND57v4DPYPTl932ZXliJmVuNGceC3FCFr4y95/aIaCiDSuPHPk/LrO5vMFzbrMDjdP5W3 Yha6ErfCcOSZoEv6AC0zsKgC1ZRjEWW23Y4i8U79xKen11C1SS3wdbF2660RzMZ8oBgRyT/HUvS2 rH/UqQ8HvfLxq8Nn+/xhsoFd6l6sXnwWydlWadV++WodA0+Agzvxd+DQJDn08Z2/V9HmbS/QuSTG 7PmoQ9meG22LPVOT9nx3t6y7EbEnyTnzcOO2/deQsjX5A6wa0ynjoYdfLR987FMFAr0dHrLK7XaT Dmiv6D8TN8b82rYILtXudhVrU7EpMSdJXPhj6uKTN5FWz9rbH88+Qkn81+DLDt7XIYK71e2L4xHF 9brE+6Z9uXTawDYST1r/r7vXa1NiTpL42LSjDXE1SOvqzoNqLsRREr949frO5QG+aOuoeIRiXoFu XN9rWfWIK8GubYs5U244dZw16ZpRMSeJan1iBlu2j6XoOX9o3unLI6nGpsYDvb/e4SOAmPNxmafk m7AMHVSucEPp57/4UPotHkCHIyurYrqOxbTmXktHao6kvnT4gV9MtEvIoSPBryBW0x36LwGw99yG xVeTLZHSjlgpBm686bPv9LqHmarBdG+Hc3+cykfACosK98AR0R/A9cCp9wG7oA8PYeD4R0uXWSqo Lk/IupDTb0DWdSym3f3d/6GmUX0Z8KNLyrBk9FSP+yw1qj/H4qnY4TmgrkhO/rqMRP1n8MxbNHGp yravpNZfhLvMRai0iU0Hw+MkyLZaqLF1wv2zH78FtfPlDQv83p/VFlQ5mwI1nNwfqXOLcBP2WqlE Hffs1LEPH6gu+u5rNjWW/3QVbTGdv73I2+WsiUpjcdt9+iJHzFlJdX0wBEPZw8UMtPkCsXR+Q6ZG qIFqWuUHPJmigJ51Ac8q1jXX+Am3R+XJ2+aK/SLODv2mts6gK3Kt/cZMrDjWwYAr9ts99fnorhEA ipUqjVZ/2XnCp/1URou++30lrUse2rLZPSO49KYtuKLP4f27U1bmYODk8wVvjn30lv7teSD8yxXR DQb7V01qoH/7kvsDap3NhqooSlTOs8n01+vq0Rb7633TF17yBdtqosYvvxF5YstbUCNFZ44Wbw8y GbUXuT+cNSmfXJ40Qom6wKXhzYFAdfyZuuPp4UepaMuqkVNb8rWTJqoRrqgBQ9nDB7qEcGbeQSxB R14uWpWsZFk31+VIt72kRyqinzmfoB3KhA4WvLpZUrVNx2pOKaS3UYQlnbFH5rDiTqo8MiHE5UxO TrbGlcedgf7Tme4o/aY4YY7gDDJTATJZCsdDBrNcLpfAU5Voy61ebz4SML3h/UVUJ84v+DRsQrHH VBVmGGh8bRxmQizeCWEewKooMRPeg/caAHMZbqWL2d0IzOQMEzCTC1WYZw1jxm7E07uAuZkSMxdY nrWt05OX4v5rM+YBwEw5WBaG56Adz2FVlJi9rpNdjTC34Fa6mBEAP7eN1lwBGtcZh5m8Fe+EME9j VdTWtAcNTMBswK10MblGYA46YALmoLMqzJuGMTkH1Jj7KDGN6fTBrsZ1+l7AHBLfhk7vesmMnT7Y wzhrYszB4W3odI6nGTs9Pc4EzPRhbej0wGWgwcpgp/t3go7NoOp0/zO402HCI/4yqFqvEWlYQExD h9BcnsKkCHbJkT0PXw4QYR98daUe2QtwXAOEjriV9jyHwj8Q3k97C2HyMFCVZQQhOQwdUY2WgwyP lr0uqEdLP3K0NIVw0FFjCclzJrkNhF0PwntbqQlprLhfS5o/s/b9kRV3ades6T2rIlr8DIUWFgwl Ayuu8YPtP2zw8NV3uG24O79TdmdgP+w0FJMw3LiXqgtg8HrcSGcS5j+TfAMkA6y/Sp2X1xeRRL65 tC1WQUky+qP/RXz5O5CswI3MTfI1JhnhkXVhJ+qewAHJ238/w6Ui6f/96k2r/gT/Cf4aNzI3yVZM sn79Ibfd1xFJnwexsd9vpSTpVPtj4JXZQPIVbmRuki2Y5NH5bI5VH0RSPmZvbiVl7/T7KLChOakJ SC7gRuYm2Ywv34mlh8bb+CESvnXSjtHdqUhi7zAPSOPsgeQEbmRukk2YZN7FU98KriGSyoyOTU8o eyc21XvLTfnHQHIFNzI3SQMmuSZMfiI8ikjGvfiy/2VfKpK+61/9NO6974HkLG5kbpKNQDKQ88ew vkdQ1h44Of79cZXrKEms3b65vK8/kNzGjcxNsgGT1Il/rD4uQySSu4xDo92pSPoInh7m7RICye+4 kblJ1mOSX6+eUHTthUimRV589GQRFUnvn+13nH5xE0ge4EbmJlmHL43+0sTX3TshkkmX+cMuW1GS hDYfy3viCSQ3cSNzk6zFJOWrTnrUSBHJpkHXhQsoeydm/mc7/PJEcN/EAzcyN8lXmGRvZFKufBQi +eJJ2eHJU6lIej0df/SrzGVA0gE3MjfJGjzxabtm6PImb0SyIzbxqas9JUnOrF0e892BpDNuZG6S L4Ek8eLMHoxxw1iKgK/an2KFUY4n3EtNz9dy88FPHHEjc5OsxvFJuOea+PLeiGTpt/l8h7mUJHMy pgn6jQeSdriRuUm+wCSVqT1G7fkEkRwP+G3y4XpKksTOz4c0ewFJH9xId2HMK0ORuSoLg6gyfYbu jEvLbRTK1GEVTh0WKiM5nxeGA/OAaaqw109AhnLaYW/oibYAxv873zjAejzZYjNfCbjCMGBCwxll 5uDXVw/QHH25EqMc+nn3ulFx6Ew7vWVgzflDVH0Z37xqPH1oGZxpXNzI3F61Ap9p7iO63hwbhEgO 5x+/pKCMZuLr7V8eGPwBkPTEjcxNshyTlB6L6bL3NiK5VL/WKm8XJUn68oeT7+4HkhTcyNwkyzDJ rtEN4xQnEcmpwRHF3BBKEgvbmrjbvwFJf9zI3CRLsZ/UvXLZ8r9JiISoObp2KOWInBAlcn5xqzuc 87/gRuYmWYKvDSeVHhu0EPni4ftUJNEnEq4yl51FW6EM3MjcJIvxvJSv0mODZj+07PlNASVJ987P P1wIMxQhz3Ajc5MswiQVSo8NWhnze+GgJiqSqE/6Xv/3Qi3YxAY3MjfJQkyiUHps0OfXCEUkZRbN ue/5csqv24HEAjcyN8kC7CezlB4bFOLGpHFjqEh65l0KfXKyAHrnc9zIAIn+soM2kszHM242qjzN 32CexhmhztM+aS1PM5nkc0wyUpWnRRvM0yJ3q/O0Va3laSaTzMMkG1V5WpjBPC3SQ52nLWgtTzOZ 5DNM8q8qT+tnME/rUa3O09a3lqeZTPIpkKQNVuVpkQbztO4X1HnaitbyNJNJ5mKSpao8bYDBPK17 b3We9nVreZrJJJ9gkr9UeVofg3laN84fS76+E4XnfVrL00wm+RhPVUar8rRyg3lahE3guKStl/C8 T2t5mskkczDJNFWeVmgwT+ty9NritDUxQHK8tTzNZJLZmOSMKk+rNJinhc9yq+CE4ajgSmt5mskk s/Ciw0WqqCDXYFQQUjPtgHVvmL0N+aG1qMBkkpmY5JYqKkgzGBUEcxMfOUTAaB+yq7WowGSSj3Ae FKOKCsYajAoCX0/8+Z9tcKMn5EhrUYHJJB9ikg9VUUG2waggQBH97M3aUiBRtBYVmEwyA/dOliqO vWUwKgj9dFfWX/UKIMnWiwpQaugMGxb2bbuVmLEbPo60sc03v6bj5dLHm7h4JaRzAVZFmSDSyEUd aMsjBrfSxdwJ769r2z26jO+a4oy544kxM37AOyFVo7AqSkwPnGhDjOURhVvpYh4yAjPzmAmYmWdV mCKDmI2vsTWnAmYyJeZ9fKuxbZ2e+agA+q/NmFMAM9tqx3wQo3CuwKoo13Z7HlLdP/ZIIe996mAe JFf6tM2aj0FjtnGYma/wTkiV0ODkhYLZDesCzCTSS3UwzxuBmdPOBMwcexVmjWHMwNXkPXiEOZwS 05hOz+neZFSnV+EF/cnRb+/0bhlm7PScyGijrIkxc/pGv73Tg/5RW/O/d3ruABMwc4dGv73TOT+B rpcGO93/Np4ZfMsN74zPcccZccObHNl/UX461ekUvqlNPbLnqIZM9w3krW+dW/J4tWT2Wwgzj7NB lRGE5DBkU0COlk5XDY6WCs+HqmuP+3fkaGkKYY7NTCMJyXMmpenthN0IctKUktAc4YQID4Z0ZXcG WeMuo/qw8dNxoB+HE5Vkv5o5sCnHJGFZAT83QCj+GtYDnKQiufUgZsDppXCNCxmHG5mbRIhJMmev v3txCrKJA6wHoAr24n4YdvbkowYY0UIm40bmJinDJJOyr9tceohILGE9ANWt+sbffYbunLEck0hw I3OTjMMkK4VhHh+gNDaoN6wHoOqdxvvH1vSw+QaTrMGNzE0iwCQ/RRXFTPsUkXSDeSaqJR2NLxq3 7Tpqh0mW4kbmJinFJM3lt0duh96Jh3kmqt5R0EvYU488gnEmZBNuZG6SEvzJP7ee/pN2FiOSnjDP RDVBp2hX4HCgwc8XSL7AjcxNUoxJ4sTrlt84iEhSYZ6JaoJO0b4kQeDYAZPswI3MTUJgkpJeV7// sw8i6Q/zTFQTdAr7rQFnq71hjA3ZgBuZm6QIk3wyvqTJdRkiGQbzTFS3GxVOnL0hDc4VQLIXNzI3 CR+TfNt71Rv3DogkGeaZqKY7FC5buYeXhc8Fkm9wI3OTFGKSSxm32jdC71TDPBNl77jTdoRPWIF7 5wZuZG4SHg4XmB5+4YrNiEQE80xUt6UVnjUxx4p3YJv8hhuZm6QAk3TJXDv0vh0ikcM8E6VNOtF+ 8Vm8EY8n93Ajc5OMxUHevAHu8h0hsOAG1gNQTvhbe9stkbHq8YIb3MjcJGMwyR7bzPqd6NwJLIH1 AJS36pmBVsPnnYPxJPhX3MjcJKMxSVPAos2jDyGSJbAegGpki3vDjAvde40LvWOJG+lWevjZUGSu eU8+V0DGvW2+Jz8Kpw7j2WQk50sqoQwqo7JwWIsA/aPJ5QPaYW/Y0rYAZqweZBzgSDzZsnGQEnCp QUCuVwfVUln/dnqA5ujLEbgvra9fOh3hi860elgPQBXNcF0CbT50lMLoE9oeNzK3V+Vjkh6bXB91 m4dIFsB6AMoFqo7rZtz0GwX+HUrHjcxNkodJ8m8ucx3zGJGsg/UAlMtC7QOa5zUXw7RvqDNuZG6S XEwi33w2uqAUkayA9QCUo49Nxrlrr5fD6BPKxo3MTTIcu+yfNTPPXemHSHrAegDKm3xugyvWnovH Ocly3MjcJDn42jBH6bHBfOSLRyyorg2d50zq+/QgrAgKPYEbmZskG5PsUHpscB7M/FdQkfgd+b79 37/cB5IDuJG5SbIwyWWlxwaXwcw/1S0TRYDthz2t0mBKJ/QcbmRukkw8u8RSemxwAcz8U2XRisDB h9tZ5C0CkqO4kblJhmGblKk89jHM/FONJwrfSQMbnMfCVSq0ADcyN0kGtkm4Mk8LbDaUpymCJj6d 6CGHWdaQke8kT0vHJFmqPI1mME8L3v2/+siXt4Ck/J3kaUMxyXvKPC3wqcE8LeQZc3y41YdAUvhO 8rQhmGS1Kk+zNpinhfU+uSSpDpNUvpM8LQ2THFHmaYGvDeZp4VWOZbGfhOB5n3eSpw3GJI9UeZqD wTyty+7fPx/OjsHzPu8kTxuEJwi9VHmapcE8reszX2KoyyE87/NO8rRUTMJV5Wm9DeZp3Xx/m78n HffOmneSp6VgklJVnhZhME/r3u1jTv6mIiBZ8k7ytIGYZK4qT4s3mKd1PykbeHMcHk82vZM8LRmT PFBFBf4Go4LI4Xs7/cvvAqP9J+8kKhiAsw8PVVTgbjAqiHzyu+XEUnwt/uCdRAVJmCReFRWEG4wK OAsOeDGD3geShe8kKkjEJAJVVOBrMCqIir7BmNolDUhmv5OoIAH7yQlVVLDdYFTQ45j/WXY3HFH7 6kUFHzjRcO3LfC8pnyckcgWy0hFicbl/kUBaIeRVDyaqMySEVEoUTcLN8t53aXlHbtFJWZE2W1zJ LyWkXjzhRF61dLhAKigUEm7lY2VElSxZQAiLVOVv0wRSmZzu6GoN79RYSwWTiI5VdgJRskQsklHW H9WApagg4cviBuIbdG+QzdgzODT/cnGllMgtJQihshyt6lDipRk8qXSiWFLkAHV3oaaunZQvEQuF Kcq/w12khBBqaKLdnKSlPEmFCB26i1RWLSSykESZE1AnioViiQPIyZXwKrx4IpkgXijgSbOrKwin 8kqhTADlhQc5lPOqEpEMaTBplKxS8cQsLF4gFjnwKmXiLHTwLoU8flkJLvzr07KJVdgWIhWExElW KuCXAYgb+QJ+MxQdZKaAX5oNQEJBRaGYJyny4otFUFoYHb5ARvgXEcU8hANNksWScp5M7u1ClBcS RcnI1lK3EomgKFkgA2yHUlm5ENr14vH5SJOgEB2DrDq1vEJIlKsK8bogu6gq/KLNVKSqyqkYSgZD 3VEPbHfl+24IBEw1hBBVBhaJK9FrCJJfpnzbCRf5RSJH2GKny/Pi85D7xEsTBLJyXgX5Yn5ncQVv fCWRoLaKtYhXTriQXQUq7YoFQhkhkTohmaKiIeIiwkkm4YmkxehgXbCM3gPRMdrwhBWlPJuJgiJZ qXU5T1pmN4H0z25aB5shEVcQEpmAkJL6R9iWElBAWU6vYkxSE+ept/IdVFsMOjpnmTR01sK5a2kr AmML6ZZ2RdWIWMCHIjTWIrGIoDPrYIUInkmhs2s5NDula0KJaLHEroyQiASiEi8hIUPHlQUlpUUl TujICQm4FFg9SyaukNrKeJISQtauUiJEBycoEbkIiWLZEPSiQGQnJHhFaDfrQjE66yRwBOQbtgIZ asu3LkZdI/d1KxSK+WXQhyKZbSEufW0rwM8sbfBb5P1OaxrNEv5ZgwLMDQdjEy8R8ITMDvippU85 r4zwxUcg9RUXF6P3KwRVhNBSXhab4RufljpwaD+/tAHJ2X79Y5PTh2b7JscnDujnh2X4+WaljkBP ekT5+Samp6Vn9vPz744ffr5pA7KzB2RmZcQnpg4d2M8PvTJ4QOZQ5XZ/HaWx3UB0/9huGf1pdFwZ lcaggaXRL3QMXgKRVMYT8YmekTExPWlwWLWO7EQaOknRQFDFSbIlN8KRC0gr4BydQCCHGEeerZ2w nmyVb9HYfBpLVs3gMQoZfEYRS1bF4k6YjSuGMsETkFIWt3DVYihlSGPLnWhuuGx4enGxlJDVerph fySfuUDxcHKzE2wOgeGjQiggJD54n5bnXhKiqOWZE3pG7uaDpbW8g/VjBvwP/YU/cl9kDsAqqCmG h5qvhVy5nyVqFHcuds+ePd/jp7UJLG4YvtXfwAxgWqAr7FhyolG75DI62TN4EhmeSspRfXzJAw/M L+laU6Vc9/OGCtsoSy1laFRyDbrSQFbKNlw/Ueey2Bsui8H/0Mn9PfMMlraJO7xBefc77k0OxZQp 15dc7NBGUKyR1hpojbpqEQ2DQsGfkPa5uLgU13c/Fkld4xG/xVVv6a6Y/avHpZr/3fmEqmrRW6rd csBYkRvDwcYsRXwHKmPh+e8baoQz+gjWLEVCf9iT1sZSbufy0St8w/WzPDr/m53U1V2/cyOB1wed 1xYWKIeK/9uCtDl6Ne62ch+lzX6Dvl0PSxuwJ1jY4/pZ4yaF5sSMwcBOJNVbSrlh0gmGi1KpSPWL UmFU/zJw3z06qM+Org8+YcNRre97hissdddApWuj4qU2DW9B9XMFT8oyGbULuT9CfQSWyVWi3nVz XBpwQHWXwW2KaoESHfdqhSaqMfWzWmCoetgbm30MYrmlLpSvLuV2GY8/CvUy06265orB+7SxlNtg 8P31rZRya9UV+505ixcTaYKy4p5ruaIiGmOu1wCGqf8L70/hdD6FgTsYGBC1S7k1yeGlVuqjtd6/ fcn9W0fl7AAD5WvbVhO1TWdN5Cww6maTUXuR++ucNc/dOHePjX2tQo1QwHuW2meNCtWoUm6tumK/ pqlvcBmY+Gv40JUsoZtzFh1ZoCrlhq2WpbE8TgvlP9Tg9QYEjoUc+4cicWXs/qZFf+mPz0yoDXv5 0c4Bq/QmAf5D8V0d5XyqCxSpnGnx1nK7keOG9VzOEKKNp2Ju+NaTVG04c6Nmfn4qWaPcbuLSvR4J vf5FG5c2Ed+uDkUb9Rd/+dx/iqm2jHzxMufnc7VIzja3im7ZVyjK7cYtcFx3ftUzMOm1+9N3Trmm W/Iu8dvO0jHX6W0rt8vJLzs7clKUEeV2SbPf+OiPO8FLkLIG64/RoVOWgr27yutV0iO4KF/tSvUV DwmPM+a8/qK6bcVrI5t/Qq1XmVJulySeX4McsB5pvbmi4H5aJSXx1ZX7JhzaDhVhm7tSfcVDYgw0 2NY2Ys6PKcO/ufiLKeV2MXHUuDfPL/qdRFrD7n1aKtlCSfx0bfPyb7oC8SXOlafjs/SIgyGOXtq2 cruRSzwh6Daq3C7pttfmiRbOyUDG/ZLpPk+2jzJM/B6OYiug/nMneFGso9bc1zQ+za0Cvl1JlFVB EEXMTsonMgkhKpGVWnkQODfPwK+68CQSXjXO8B2dO7i6e3q7CaRJMGkiriaKAuzg23oExcUdo/D3 LaVhCV4wpZEu5QuEQp6MsOZVCaRepI4k8UTRYKK6E7RNVbdX0uRUoLdcKlDuEIn12aEsrVQsyVP+ zZd3tCsfOw6+waiz9lzT2Ei8Vw+8l9zVBj/BvyM155GY3gz0n8G0hvOOPPHkU+hoKwx/2wOL6zxi zNniVVV0tj+tSo6G9k+XPjqTObUHK6759c/X994cwwxpucilM61YigqmCH9ThsJ5L1R7/92SBmlW O6YF257tqNkrnTIkAmk5fKsR/gamt365RZ0TTTWfpvrmJYE0m3yBKKqtqrOqY9e1l3es61BnX+co d61zrnPVPFQIklxZ3FTnh7nNZ9Dg2Wvy/LwgTy+SzwHxBbAjNPlcklGaXqRiazwxqnbJlI3gPueW rH9aXc3VzNu6gnB7/XLllo4g3BEJD2L7aQqv86asXK4n06F1mQGmyHREMjN+uOuUvQ7JXP3lqHsV J0iZTkhmCDtIX+bNI9O2TDkNqeCtx7OWb/Zo0pMJhvXbMj6y/QuWoufftjUFJ7aQhnVGMsO0DUvK PDv72N8jT8HX2dzbl8G5yfbVk+mMZK4K6n0zORN1Fjdge7rdH6RMFySzCztMX+YTSfvPvH3q0da1 9wQTvJlaMmulNAep8nyWu8o72khLeRVEHyeBNIEnFIrFolgnWamkUipDZ5wtPltFLrgJPoV8tc4a O5gJYEeoC33TVZW+c5FOZAx14Kj5/UPZWDohkVIV/56rifoBg4YJEnPt8J/EXDdy/BkiloklLuXw OzEXcfrgzTTxRJg6LhfIyOc5FRXK52RTPKR5kZtKA7iRMrCQ2klvO3UYaEgOZr1pJqeSWVOUG0xv 9C+QznTTrx9uWQMd5Yk6qie7u2Ylca9MYoJYWCkjVCeWflVxTUtEgyNQqbZD/5BqTxbXaU9OL4dQ qGzsRlyMTmORPuKOVEeye6IR64V/QD9//w7IR7iQWVjO3rPlmH8UfHBs6x82v32WbaQ63fLjpDoP pC4K1LUUIsfq9AuRG6POXb+EuKa6SM1i4lidfjFxbXVoYA800I/BdKaXfvFtsh+9kbr+7BjN2tak Or0y3HpHF2jg6JA6bxaX22vc9QunvcCY9kediYfk0XVE6vqw+4O6xa92/zpktEpdzMrLV/rMBVex fe+9c5d8nhupTrdeN6muE1IXS6rTPjq9yt3GqOuoX3NbU10fzerbpDq96tvGuIoHioLWT+1Z2m8U UuexR7b1sw801UWBuo92vfTs0FWlLvCHVRu6T/8WbVmWBA/2P3fGGHU++oWnSXUoZ2QnsLlaYzOX sgS1kep0C0iT6jojdUlU6vRKSWuqC2QyGUxHNKj5M90Z5IfTUGgJn1CDErEsrsMm1r52P9Uz2KEo zlHdP2PKuS2hjpyLAp8WEzAupS8cMmeupdyqxQaZWlDu2jawnY13YGhBtSOhAgxAzR/8XfnxAgSF J671adQWYrpbL/lz+kklDWkiCpoWE9kewjswjOgRP/0i1GSP+CN1Kexkih7RLUdNN06dbjFpUl0A UjeISp1eWWlKBwihsPWBNjpAqIYJGC+hP6cqTU7aIJvC5Gob2DbgHSgdINQAVKsOEKphIWYM9KdC SUOaiIKmxUS2t/AOxjhAoH5BarJHgpC6oew0ih7x/A8OEKhfWJpUF4zUZVCp0ysxTaeydVcKW+9t owOEaZhA2wFIGwynMLlnqw7AIqEiDEC16gBhGhbSdgDSRBQ0LSYywQHy9MsIkD2Sj9TJo9jySP0+ 0SspQDdOoW5BAFLhCFDYk0qhfnEAbSdwZjCdkb0LKew9vY1OwNMwQ7v20KdblWZX2SFJ3/AtdrAf E3zkq4PnGVRYfANYrboBT8NK7VKgV+8reVRm0ufRMJP9+8xj0h+qjHGEkfqlBch+GQUK+7DlMXr9 ol9mgG6cQt0iAaTC0aAwllKhXsEASkcoobD4lDY6QqGGGdp1AUeoVxpeZYdkPcNr2MFeBI5wktIR Sg1gteoIhRpWalcKjtCk5FGZiYKnxUz2s8ERKoxxhDH65QbIfhkLCrlseX/9ftErPUA3TqFu4QBS YQEoTKBUqFdEgNIRhBQWr2qjI/A1zKDtCCo7pOgbvsUOrTlCuQGsVh2Br2ElbUdQmYmCp8VMFI6A p2cs4Yuum/7+ob8PSxHmgO+ukMZHP2wmu4Pe9EzczswlKaPOw5zHAXJ6W2/Kx0Lv66svklNT6C22 JZuuL1P3G6yn6smktS6TaYpM+BD05Z93nX71CMkc49B4Op1DymQgmVZsS/2pqfPZ/lPWrQCZzTvH IzvoywR7Hmx8r2hER5Yi5OF1+p72j0h7MpFMNoU9Gz+HOwkVYM+bL8fVPL+oL5PJ4maxXvyxb8Ih liJ0oaNo4ZwsUiYLyWzPZuvLvN8ZOkmBti5I29XyN2r1UQ/lxFcH9bcq01Vfq5wIE1+WlBNfdV2o vmGZq33eIW9mIdeWd4aFIeTKEPkUOl05Ed2bFfey4atVlrkz4NRrbH71s6//xS2sxoXHdxMZSU90 PV7uyOKG0PDSGBa30z18Z5I8bjnMcdb2ZNdG6bl8HFmgB7rogYXedzn1gEkQSzmbHQuFFsOmd316 Ex0719W+9PHcYqSTzuzEanzeOdr2zr0IyLWnDCn5LjBfefCKwCt/b7Hk+0Cuvb55J3Mm/pIP66sz ZWH/srRFrw2bzoGPXYLo8+/7fUwl2nV/SM5lteh99NXiDr+A6PqJgfmrbhsUvSKcGBBVCKJ9HOz7 xSygEL3Yu3yHPFQtevO4/ce9r4Ho9uzNX11y0xT9tskkuYv+UhRyNkkOc3O1XHZtH811KXh01l+X YsyUi9ydxXXusll5cxyv08hRdrsrqIxFWtFRPvuC9SpnRooqJrV6oxp5yUUbGcaq1F3FolTpBir7 Y5UtS1rIqFRvSYtRKl31V6PoqIzVXJpCXvb0lqZoqXzLBK/cQ38th7IvYa6uNoVdm6C5WkI5Oai7 sMOYS7u8I4vLHQDVtofrGhZmlWuTkFZQ6eX1vP52jHqCEFddo7Vi2Leo1F0GolTpBSqTlSq1j1Jv TYhRKj31l3PoqEzSXNtBqtRb22GU+7ihoeDHs/jTzor4+1RH2R9Uss/1/XNDO3X4jD81PQJUhukd pXqUqU1Gss+ABdEVUBH/mKwXBMOM3Eu9CAmEW5StnbGfox5nskHkThBOqM5Arp9ygYi28B/IVT6t C4+2ePJgt1o4/mq7b9oi/Du18L8MCveM3VTXyVIt3FslnHZGTzi+Asv9keDnF+wLh5xmKRLd4crX SWlumFWvTWPXDtePQJbAfX58r/rqEXFyxsf6kZK8k2q1xlT1ag0yBJH7gNyh7NpB+nJh7cYXFhpr N/Tler9VbppJcn1YXM7492PWDwlAcjd281y5b6JSLkyX1mYg0frRyKX+x8OyUkHulafUURPYl+OS lXBzLwpxEk7yN+aX/6m0L0x81mZS2bdx+ynYAez7EK9CUOjL7cziRjlyT6d3r0Jyn6NOmPNGKdcP 5GYj0fpyH8CKk3ZwU/NONax1mUoVPdUOV69YoKuWLOyB8Akdi+H4SWf5gnb8JGfQ3GSERMITiOAD C24tn5UYqLGdgD9QYlci4U0QyKo1Plvhodq3lCjX3DkTxfKTYeEFHdDRv8mJAsv2B5yzLeK5Fhb/ ByKO5/c=eNq1nQdAU1cXgMlCCCJ7KyB7KCoBRUUJQwRFQYaAkxAeEAkJJkHBVjRQtXW0tta9sNa6cLSOaq0S /1pr3bXOqi3OqtXirlrHf899Sch4QZLGKPCS3HfO9849775z7rs5sbAtIybxKydMFEhl4soKC+vI CA7HV1AoEVuwJvJkhMSCPaBCwPeV8URlERYWFjT0w0A/FtZ1uTT2ND7NVsIrElRKXQQigSwTb9rx xUKhoIjwkUkEJSWEJJ4vE4hFYyPtxJUyoUBEeIhFWbxyYij6GRvpIJAmVAqFhMwG9or3Uu5DvtlO QhTh1xNtSiQEIcLbSXbSysJEtGFdKKwk7MQVPL5AVm3DE5UICS+xaKBEXCkqShHIxkbi5gluGiLt igiRFLV2kxBSmUBWCWBuGvt0KhWUlArRjyxZLBk03KFYIsDwXlqH0rl8LD5EqYDctcKl5Yj8tSSI BSKZHZ8QITvmKf/muyBVEl4JrxDhCqSJaB8JL1nMR3ZD70p4ApGTQJqKjCkjitwkYhnqg3g4NPRq Fk9UVCiuspZVVxAuSMbEeFH1RF41emeACMQVOYDgvPTiYhf0UpFABi/i1/LRa+H8UoJfRhQlaqEj +2chHQK+P6krXSJAmDw4TFbctfyw3xp83FlT3rx50wQdz7Sk0+kMSxpTPpnBTGDQmWFM+RSmBX7J g9mOTmfaMC2ZqPUbOp3Fzdw/886GDRtYii4RKaPO7WagfelqWXRL20SBhC8kGAxW3JYc9MizQFt3 d1/0O3ljKqOlIZvGirvx69VLQ5bKNUEYSpBRDKY8BZGI2kQS3h/92bBRh2SUNsPFqeDgFpoMMxg0 W/DwvB7kHw6rqgerKhI/ySdfy49kVXHILQ6rugerOpJVTT7Pi2RaWrHbd7B3dHZ19+zo7esXEBQS 1iWie2RUz5g+sf25CUnJKYPShmZkZg/PG6FW2rLBzVz6+tmwv6ahjUbLSTsW/E7Z5sbEY+l/9G15 RdHFN/W7MdGJLEXXAPZdzpVn6JWoA0vXXMsyuUMVoYpOvjORnMnbXB3X/apjRodsiQCfhmDOHd2y m37tAua8fz5xZNwDrqY5p3NojGobsE0u/p3CmMgoZVTZCqTZaJwxylqKLnPAYwooTBL3oG5/jzMN u1hxB7v9XPhyARcdwbkf6+M/6kXXcKA2HfiLY35rouYiZbz35iJbol01D9wpk+DLVEfeeGfjwbXN y6eiI2++12E4013Lma1ZitDahXO0OqoF+PHOx4TVH7dYcUeKRnRssIJe3Tuq5nhYpibwFOTxeYhY boW2WY3nchcJH77ZZYj85uGSRbGOSOvg4xdcZ4TrkMstgbhpg6CzdAwibrxSvtcjIcZChzhs3un0 7lX+bSR++L0il7eCruFbOsR3Pnx1puc8hQHirI5h6xEN0jraZsk/vk6UxE82JT1qV8tFW9Pf7388 rECPOH0PeiioiK+OiY57/149i2sh2ep7YOk6RLz2wTAHB3uDNjbsFt+lT8+Y85qlCIknvl0dMljn fMCocQfTvK0/3oxOhMYH7OBFsU66qB5/w+M+FeotPA4hm9KtPkSP2SxFReRE9KhqzX8dmXbMdgwA tQDQxwhJUdEF78ZSuAiPoscxKlD1mNCypQP6Pz/08G8bqFhBKmr1RLPTtCgGFW/HuyFQLpbYRlCG Jmjj1tDFixcvsdAHZbKZbBY3YfLjmnsDAgw7aFzhx75fPRhDwfgAej3pFd6fxXVqzEeKFlExcuNk 93InHWnPYClsj2/jcDjdqRiXGWQcONpkxvvAmHpZi3EuJWP0dm1GX+PsmJFkkzFj22pTGJuBcdgH eP/W7WjDSlm8vSfXVDtmbjeZ8W88GD3WYqS0o8Jj8shtgdebTLVjjrPJjPeAcXj22+2o6LZv04XP Hla0bkfDjGmdTPbHu8A4dHkbzpkQwW+bnyxwN8TIDQrLRaNYJdUA1HwZHgoUKUIUl1PAUiSsbJ+G hhLEAQMQHQ9AdGYCXT0A0S1tcIKjHi4ZQPsXGvQUCWMzPkUXBKTxDB0Neb6U4/qPDuhhDwHOjho0 gD/QjVlND57v4DPYPTl932ZXliJmVuNGceC3FCFr4y95/aIaCiDSuPHPk/LrO5vMFzbrMDjdP5W3 Yha6ErfCcOSZoEv6AC0zsKgC1ZRjEWW23Y4i8U79xKen11C1SS3wdbF2660RzMZ8oBgRyT/HUvS2 rH/UqQ8HvfLxq8Nn+/xhsoFd6l6sXnwWydlWadV++WodA0+Agzvxd+DQJDn08Z2/V9HmbS/QuSTG 7PmoQ9meG22LPVOT9nx3t6y7EbEnyTnzcOO2/deQsjX5A6wa0ynjoYdfLR987FMFAr0dHrLK7XaT Dmiv6D8TN8b82rYILtXudhVrU7EpMSdJXPhj6uKTN5FWz9rbH88+Qkn81+DLDt7XIYK71e2L4xHF 9brE+6Z9uXTawDYST1r/r7vXa1NiTpL42LSjDXE1SOvqzoNqLsRREr949frO5QG+aOuoeIRiXoFu XN9rWfWIK8GubYs5U244dZw16ZpRMSeJan1iBlu2j6XoOX9o3unLI6nGpsYDvb/e4SOAmPNxmafk m7AMHVSucEPp57/4UPotHkCHIyurYrqOxbTmXktHao6kvnT4gV9MtEvIoSPBryBW0x36LwGw99yG xVeTLZHSjlgpBm686bPv9LqHmarBdG+Hc3+cykfACosK98AR0R/A9cCp9wG7oA8PYeD4R0uXWSqo Lk/IupDTb0DWdSym3f3d/6GmUX0Z8KNLyrBk9FSP+yw1qj/H4qnY4TmgrkhO/rqMRP1n8MxbNHGp yravpNZfhLvMRai0iU0Hw+MkyLZaqLF1wv2zH78FtfPlDQv83p/VFlQ5mwI1nNwfqXOLcBP2WqlE Hffs1LEPH6gu+u5rNjWW/3QVbTGdv73I2+WsiUpjcdt9+iJHzFlJdX0wBEPZw8UMtPkCsXR+Q6ZG qIFqWuUHPJmigJ51Ac8q1jXX+Am3R+XJ2+aK/SLODv2mts6gK3Kt/cZMrDjWwYAr9ts99fnorhEA ipUqjVZ/2XnCp/1URou++30lrUse2rLZPSO49KYtuKLP4f27U1bmYODk8wVvjn30lv7teSD8yxXR DQb7V01qoH/7kvsDap3NhqooSlTOs8n01+vq0Rb7633TF17yBdtqosYvvxF5YstbUCNFZ44Wbw8y GbUXuT+cNSmfXJ40Qom6wKXhzYFAdfyZuuPp4UepaMuqkVNb8rWTJqoRrqgBQ9nDB7qEcGbeQSxB R14uWpWsZFk31+VIt72kRyqinzmfoB3KhA4WvLpZUrVNx2pOKaS3UYQlnbFH5rDiTqo8MiHE5UxO TrbGlcedgf7Tme4o/aY4YY7gDDJTATJZCsdDBrNcLpfAU5Voy61ebz4SML3h/UVUJ84v+DRsQrHH VBVmGGh8bRxmQizeCWEewKooMRPeg/caAHMZbqWL2d0IzOQMEzCTC1WYZw1jxm7E07uAuZkSMxdY nrWt05OX4v5rM+YBwEw5WBaG56Adz2FVlJi9rpNdjTC34Fa6mBEAP7eN1lwBGtcZh5m8Fe+EME9j VdTWtAcNTMBswK10MblGYA46YALmoLMqzJuGMTkH1Jj7KDGN6fTBrsZ1+l7AHBLfhk7vesmMnT7Y wzhrYszB4W3odI6nGTs9Pc4EzPRhbej0wGWgwcpgp/t3go7NoOp0/zO402HCI/4yqFqvEWlYQExD h9BcnsKkCHbJkT0PXw4QYR98daUe2QtwXAOEjriV9jyHwj8Q3k97C2HyMFCVZQQhOQwdUY2WgwyP lr0uqEdLP3K0NIVw0FFjCclzJrkNhF0PwntbqQlprLhfS5o/s/b9kRV3ades6T2rIlr8DIUWFgwl Ayuu8YPtP2zw8NV3uG24O79TdmdgP+w0FJMw3LiXqgtg8HrcSGcS5j+TfAMkA6y/Sp2X1xeRRL65 tC1WQUky+qP/RXz5O5CswI3MTfI1JhnhkXVhJ+qewAHJ238/w6Ui6f/96k2r/gT/Cf4aNzI3yVZM sn79Ibfd1xFJnwexsd9vpSTpVPtj4JXZQPIVbmRuki2Y5NH5bI5VH0RSPmZvbiVl7/T7KLChOakJ SC7gRuYm2Ywv34mlh8bb+CESvnXSjtHdqUhi7zAPSOPsgeQEbmRukk2YZN7FU98KriGSyoyOTU8o eyc21XvLTfnHQHIFNzI3SQMmuSZMfiI8ikjGvfiy/2VfKpK+61/9NO6974HkLG5kbpKNQDKQ88ew vkdQ1h44Of79cZXrKEms3b65vK8/kNzGjcxNsgGT1Il/rD4uQySSu4xDo92pSPoInh7m7RICye+4 kblJ1mOSX6+eUHTthUimRV589GQRFUnvn+13nH5xE0ge4EbmJlmHL43+0sTX3TshkkmX+cMuW1GS hDYfy3viCSQ3cSNzk6zFJOWrTnrUSBHJpkHXhQsoeydm/mc7/PJEcN/EAzcyN8lXmGRvZFKufBQi +eJJ2eHJU6lIej0df/SrzGVA0gE3MjfJGjzxabtm6PImb0SyIzbxqas9JUnOrF0e892BpDNuZG6S L4Ek8eLMHoxxw1iKgK/an2KFUY4n3EtNz9dy88FPHHEjc5OsxvFJuOea+PLeiGTpt/l8h7mUJHMy pgn6jQeSdriRuUm+wCSVqT1G7fkEkRwP+G3y4XpKksTOz4c0ewFJH9xId2HMK0ORuSoLg6gyfYbu jEvLbRTK1GEVTh0WKiM5nxeGA/OAaaqw109AhnLaYW/oibYAxv873zjAejzZYjNfCbjCMGBCwxll 5uDXVw/QHH25EqMc+nn3ulFx6Ew7vWVgzflDVH0Z37xqPH1oGZxpXNzI3F61Ap9p7iO63hwbhEgO 5x+/pKCMZuLr7V8eGPwBkPTEjcxNshyTlB6L6bL3NiK5VL/WKm8XJUn68oeT7+4HkhTcyNwkyzDJ rtEN4xQnEcmpwRHF3BBKEgvbmrjbvwFJf9zI3CRLsZ/UvXLZ8r9JiISoObp2KOWInBAlcn5xqzuc 87/gRuYmWYKvDSeVHhu0EPni4ftUJNEnEq4yl51FW6EM3MjcJIvxvJSv0mODZj+07PlNASVJ987P P1wIMxQhz3Ajc5MswiQVSo8NWhnze+GgJiqSqE/6Xv/3Qi3YxAY3MjfJQkyiUHps0OfXCEUkZRbN ue/5csqv24HEAjcyN8kC7CezlB4bFOLGpHFjqEh65l0KfXKyAHrnc9zIAIn+soM2kszHM242qjzN 32CexhmhztM+aS1PM5nkc0wyUpWnRRvM0yJ3q/O0Va3laSaTzMMkG1V5WpjBPC3SQ52nLWgtTzOZ 5DNM8q8qT+tnME/rUa3O09a3lqeZTPIpkKQNVuVpkQbztO4X1HnaitbyNJNJ5mKSpao8bYDBPK17 b3We9nVreZrJJJ9gkr9UeVofg3laN84fS76+E4XnfVrL00wm+RhPVUar8rRyg3lahE3guKStl/C8 T2t5mskkczDJNFWeVmgwT+ty9NritDUxQHK8tTzNZJLZmOSMKk+rNJinhc9yq+CE4ajgSmt5mskk s/Ciw0WqqCDXYFQQUjPtgHVvmL0N+aG1qMBkkpmY5JYqKkgzGBUEcxMfOUTAaB+yq7WowGSSj3Ae FKOKCsYajAoCX0/8+Z9tcKMn5EhrUYHJJB9ikg9VUUG2waggQBH97M3aUiBRtBYVmEwyA/dOliqO vWUwKgj9dFfWX/UKIMnWiwpQaugMGxb2bbuVmLEbPo60sc03v6bj5dLHm7h4JaRzAVZFmSDSyEUd aMsjBrfSxdwJ769r2z26jO+a4oy544kxM37AOyFVo7AqSkwPnGhDjOURhVvpYh4yAjPzmAmYmWdV mCKDmI2vsTWnAmYyJeZ9fKuxbZ2e+agA+q/NmFMAM9tqx3wQo3CuwKoo13Z7HlLdP/ZIIe996mAe JFf6tM2aj0FjtnGYma/wTkiV0ODkhYLZDesCzCTSS3UwzxuBmdPOBMwcexVmjWHMwNXkPXiEOZwS 05hOz+neZFSnV+EF/cnRb+/0bhlm7PScyGijrIkxc/pGv73Tg/5RW/O/d3ruABMwc4dGv73TOT+B rpcGO93/Np4ZfMsN74zPcccZccObHNl/UX461ekUvqlNPbLnqIZM9w3krW+dW/J4tWT2Wwgzj7NB lRGE5DBkU0COlk5XDY6WCs+HqmuP+3fkaGkKYY7NTCMJyXMmpenthN0IctKUktAc4YQID4Z0ZXcG WeMuo/qw8dNxoB+HE5Vkv5o5sCnHJGFZAT83QCj+GtYDnKQiufUgZsDppXCNCxmHG5mbRIhJMmev v3txCrKJA6wHoAr24n4YdvbkowYY0UIm40bmJinDJJOyr9tceohILGE9ANWt+sbffYbunLEck0hw I3OTjMMkK4VhHh+gNDaoN6wHoOqdxvvH1vSw+QaTrMGNzE0iwCQ/RRXFTPsUkXSDeSaqJR2NLxq3 7Tpqh0mW4kbmJinFJM3lt0duh96Jh3kmqt5R0EvYU488gnEmZBNuZG6SEvzJP7ee/pN2FiOSnjDP RDVBp2hX4HCgwc8XSL7AjcxNUoxJ4sTrlt84iEhSYZ6JaoJO0b4kQeDYAZPswI3MTUJgkpJeV7// sw8i6Q/zTFQTdAr7rQFnq71hjA3ZgBuZm6QIk3wyvqTJdRkiGQbzTFS3GxVOnL0hDc4VQLIXNzI3 CR+TfNt71Rv3DogkGeaZqKY7FC5buYeXhc8Fkm9wI3OTFGKSSxm32jdC71TDPBNl77jTdoRPWIF7 5wZuZG4SHg4XmB5+4YrNiEQE80xUt6UVnjUxx4p3YJv8hhuZm6QAk3TJXDv0vh0ikcM8E6VNOtF+ 8Vm8EY8n93Ajc5OMxUHevAHu8h0hsOAG1gNQTvhbe9stkbHq8YIb3MjcJGMwyR7bzPqd6NwJLIH1 AJS36pmBVsPnnYPxJPhX3MjcJKMxSVPAos2jDyGSJbAegGpki3vDjAvde40LvWOJG+lWevjZUGSu eU8+V0DGvW2+Jz8Kpw7j2WQk50sqoQwqo7JwWIsA/aPJ5QPaYW/Y0rYAZqweZBzgSDzZsnGQEnCp QUCuVwfVUln/dnqA5ujLEbgvra9fOh3hi860elgPQBXNcF0CbT50lMLoE9oeNzK3V+Vjkh6bXB91 m4dIFsB6AMoFqo7rZtz0GwX+HUrHjcxNkodJ8m8ucx3zGJGsg/UAlMtC7QOa5zUXw7RvqDNuZG6S XEwi33w2uqAUkayA9QCUo49Nxrlrr5fD6BPKxo3MTTIcu+yfNTPPXemHSHrAegDKm3xugyvWnovH Ocly3MjcJDn42jBH6bHBfOSLRyyorg2d50zq+/QgrAgKPYEbmZskG5PsUHpscB7M/FdQkfgd+b79 37/cB5IDuJG5SbIwyWWlxwaXwcw/1S0TRYDthz2t0mBKJ/QcbmRukkw8u8RSemxwAcz8U2XRisDB h9tZ5C0CkqO4kblJhmGblKk89jHM/FONJwrfSQMbnMfCVSq0ADcyN0kGtkm4Mk8LbDaUpymCJj6d 6CGHWdaQke8kT0vHJFmqPI1mME8L3v2/+siXt4Ck/J3kaUMxyXvKPC3wqcE8LeQZc3y41YdAUvhO 8rQhmGS1Kk+zNpinhfU+uSSpDpNUvpM8LQ2THFHmaYGvDeZp4VWOZbGfhOB5n3eSpw3GJI9UeZqD wTyty+7fPx/OjsHzPu8kTxuEJwi9VHmapcE8reszX2KoyyE87/NO8rRUTMJV5Wm9DeZp3Xx/m78n HffOmneSp6VgklJVnhZhME/r3u1jTv6mIiBZ8k7ytIGYZK4qT4s3mKd1PykbeHMcHk82vZM8LRmT PFBFBf4Go4LI4Xs7/cvvAqP9J+8kKhiAsw8PVVTgbjAqiHzyu+XEUnwt/uCdRAVJmCReFRWEG4wK OAsOeDGD3geShe8kKkjEJAJVVOBrMCqIir7BmNolDUhmv5OoIAH7yQlVVLDdYFTQ45j/WXY3HFH7 6kUFHzjRcO3LfC8pnyckcgWy0hFicbl/kUBaIeRVDyaqMySEVEoUTcLN8t53aXlHbtFJWZE2W1zJ LyWkXjzhRF61dLhAKigUEm7lY2VElSxZQAiLVOVv0wRSmZzu6GoN79RYSwWTiI5VdgJRskQsklHW H9WApagg4cviBuIbdG+QzdgzODT/cnGllMgtJQihshyt6lDipRk8qXSiWFLkAHV3oaaunZQvEQuF Kcq/w12khBBqaKLdnKSlPEmFCB26i1RWLSSykESZE1AnioViiQPIyZXwKrx4IpkgXijgSbOrKwin 8kqhTADlhQc5lPOqEpEMaTBplKxS8cQsLF4gFjnwKmXiLHTwLoU8flkJLvzr07KJVdgWIhWExElW KuCXAYgb+QJ+MxQdZKaAX5oNQEJBRaGYJyny4otFUFoYHb5ARvgXEcU8hANNksWScp5M7u1ClBcS RcnI1lK3EomgKFkgA2yHUlm5ENr14vH5SJOgEB2DrDq1vEJIlKsK8bogu6gq/KLNVKSqyqkYSgZD 3VEPbHfl+24IBEw1hBBVBhaJK9FrCJJfpnzbCRf5RSJH2GKny/Pi85D7xEsTBLJyXgX5Yn5ncQVv fCWRoLaKtYhXTriQXQUq7YoFQhkhkTohmaKiIeIiwkkm4YmkxehgXbCM3gPRMdrwhBWlPJuJgiJZ qXU5T1pmN4H0z25aB5shEVcQEpmAkJL6R9iWElBAWU6vYkxSE+ept/IdVFsMOjpnmTR01sK5a2kr AmML6ZZ2RdWIWMCHIjTWIrGIoDPrYIUInkmhs2s5NDula0KJaLHEroyQiASiEi8hIUPHlQUlpUUl TujICQm4FFg9SyaukNrKeJISQtauUiJEBycoEbkIiWLZEPSiQGQnJHhFaDfrQjE66yRwBOQbtgIZ asu3LkZdI/d1KxSK+WXQhyKZbSEufW0rwM8sbfBb5P1OaxrNEv5ZgwLMDQdjEy8R8ITMDvippU85 r4zwxUcg9RUXF6P3KwRVhNBSXhab4RufljpwaD+/tAHJ2X79Y5PTh2b7JscnDujnh2X4+WaljkBP ekT5+Samp6Vn9vPz744ffr5pA7KzB2RmZcQnpg4d2M8PvTJ4QOZQ5XZ/HaWx3UB0/9huGf1pdFwZ lcaggaXRL3QMXgKRVMYT8YmekTExPWlwWLWO7EQaOknRQFDFSbIlN8KRC0gr4BydQCCHGEeerZ2w nmyVb9HYfBpLVs3gMQoZfEYRS1bF4k6YjSuGMsETkFIWt3DVYihlSGPLnWhuuGx4enGxlJDVerph fySfuUDxcHKzE2wOgeGjQiggJD54n5bnXhKiqOWZE3pG7uaDpbW8g/VjBvwP/YU/cl9kDsAqqCmG h5qvhVy5nyVqFHcuds+ePd/jp7UJLG4YvtXfwAxgWqAr7FhyolG75DI62TN4EhmeSspRfXzJAw/M L+laU6Vc9/OGCtsoSy1laFRyDbrSQFbKNlw/Ueey2Bsui8H/0Mn9PfMMlraJO7xBefc77k0OxZQp 15dc7NBGUKyR1hpojbpqEQ2DQsGfkPa5uLgU13c/Fkld4xG/xVVv6a6Y/avHpZr/3fmEqmrRW6rd csBYkRvDwcYsRXwHKmPh+e8baoQz+gjWLEVCf9iT1sZSbufy0St8w/WzPDr/m53U1V2/cyOB1wed 1xYWKIeK/9uCtDl6Ne62ch+lzX6Dvl0PSxuwJ1jY4/pZ4yaF5sSMwcBOJNVbSrlh0gmGi1KpSPWL UmFU/zJw3z06qM+Org8+YcNRre97hissdddApWuj4qU2DW9B9XMFT8oyGbULuT9CfQSWyVWi3nVz XBpwQHWXwW2KaoESHfdqhSaqMfWzWmCoetgbm30MYrmlLpSvLuV2GY8/CvUy06265orB+7SxlNtg 8P31rZRya9UV+505ixcTaYKy4p5ruaIiGmOu1wCGqf8L70/hdD6FgTsYGBC1S7k1yeGlVuqjtd6/ fcn9W0fl7AAD5WvbVhO1TWdN5Cww6maTUXuR++ucNc/dOHePjX2tQo1QwHuW2meNCtWoUm6tumK/ pqlvcBmY+Gv40JUsoZtzFh1ZoCrlhq2WpbE8TgvlP9Tg9QYEjoUc+4cicWXs/qZFf+mPz0yoDXv5 0c4Bq/QmAf5D8V0d5XyqCxSpnGnx1nK7keOG9VzOEKKNp2Ju+NaTVG04c6Nmfn4qWaPcbuLSvR4J vf5FG5c2Ed+uDkUb9Rd/+dx/iqm2jHzxMufnc7VIzja3im7ZVyjK7cYtcFx3ftUzMOm1+9N3Trmm W/Iu8dvO0jHX6W0rt8vJLzs7clKUEeV2SbPf+OiPO8FLkLIG64/RoVOWgr27yutV0iO4KF/tSvUV DwmPM+a8/qK6bcVrI5t/Qq1XmVJulySeX4McsB5pvbmi4H5aJSXx1ZX7JhzaDhVhm7tSfcVDYgw0 2NY2Ys6PKcO/ufiLKeV2MXHUuDfPL/qdRFrD7n1aKtlCSfx0bfPyb7oC8SXOlafjs/SIgyGOXtq2 cruRSzwh6Daq3C7pttfmiRbOyUDG/ZLpPk+2jzJM/B6OYiug/nMneFGso9bc1zQ+za0Cvl1JlFVB EEXMTsonMgkhKpGVWnkQODfPwK+68CQSXjXO8B2dO7i6e3q7CaRJMGkiriaKAuzg23oExcUdo/D3 LaVhCV4wpZEu5QuEQp6MsOZVCaRepI4k8UTRYKK6E7RNVbdX0uRUoLdcKlDuEIn12aEsrVQsyVP+ zZd3tCsfOw6+waiz9lzT2Ei8Vw+8l9zVBj/BvyM155GY3gz0n8G0hvOOPPHkU+hoKwx/2wOL6zxi zNniVVV0tj+tSo6G9k+XPjqTObUHK6759c/X994cwwxpucilM61YigqmCH9ThsJ5L1R7/92SBmlW O6YF257tqNkrnTIkAmk5fKsR/gamt365RZ0TTTWfpvrmJYE0m3yBKKqtqrOqY9e1l3es61BnX+co d61zrnPVPFQIklxZ3FTnh7nNZ9Dg2Wvy/LwgTy+SzwHxBbAjNPlcklGaXqRiazwxqnbJlI3gPueW rH9aXc3VzNu6gnB7/XLllo4g3BEJD2L7aQqv86asXK4n06F1mQGmyHREMjN+uOuUvQ7JXP3lqHsV J0iZTkhmCDtIX+bNI9O2TDkNqeCtx7OWb/Zo0pMJhvXbMj6y/QuWoufftjUFJ7aQhnVGMsO0DUvK PDv72N8jT8HX2dzbl8G5yfbVk+mMZK4K6n0zORN1Fjdge7rdH6RMFySzCztMX+YTSfvPvH3q0da1 9wQTvJlaMmulNAep8nyWu8o72khLeRVEHyeBNIEnFIrFolgnWamkUipDZ5wtPltFLrgJPoV8tc4a O5gJYEeoC33TVZW+c5FOZAx14Kj5/UPZWDohkVIV/56rifoBg4YJEnPt8J/EXDdy/BkiloklLuXw OzEXcfrgzTTxRJg6LhfIyOc5FRXK52RTPKR5kZtKA7iRMrCQ2klvO3UYaEgOZr1pJqeSWVOUG0xv 9C+QznTTrx9uWQMd5Yk6qie7u2Ylca9MYoJYWCkjVCeWflVxTUtEgyNQqbZD/5BqTxbXaU9OL4dQ qGzsRlyMTmORPuKOVEeye6IR64V/QD9//w7IR7iQWVjO3rPlmH8UfHBs6x82v32WbaQ63fLjpDoP pC4K1LUUIsfq9AuRG6POXb+EuKa6SM1i4lidfjFxbXVoYA800I/BdKaXfvFtsh+9kbr+7BjN2tak Or0y3HpHF2jg6JA6bxaX22vc9QunvcCY9kediYfk0XVE6vqw+4O6xa92/zpktEpdzMrLV/rMBVex fe+9c5d8nhupTrdeN6muE1IXS6rTPjq9yt3GqOuoX3NbU10fzerbpDq96tvGuIoHioLWT+1Z2m8U UuexR7b1sw801UWBuo92vfTs0FWlLvCHVRu6T/8WbVmWBA/2P3fGGHU++oWnSXUoZ2QnsLlaYzOX sgS1kep0C0iT6jojdUlU6vRKSWuqC2QyGUxHNKj5M90Z5IfTUGgJn1CDErEsrsMm1r52P9Uz2KEo zlHdP2PKuS2hjpyLAp8WEzAupS8cMmeupdyqxQaZWlDu2jawnY13YGhBtSOhAgxAzR/8XfnxAgSF J671adQWYrpbL/lz+kklDWkiCpoWE9kewjswjOgRP/0i1GSP+CN1Kexkih7RLUdNN06dbjFpUl0A UjeISp1eWWlKBwihsPWBNjpAqIYJGC+hP6cqTU7aIJvC5Gob2DbgHSgdINQAVKsOEKphIWYM9KdC SUOaiIKmxUS2t/AOxjhAoH5BarJHgpC6oew0ih7x/A8OEKhfWJpUF4zUZVCp0ysxTaeydVcKW+9t owOEaZhA2wFIGwynMLlnqw7AIqEiDEC16gBhGhbSdgDSRBQ0LSYywQHy9MsIkD2Sj9TJo9jySP0+ 0SspQDdOoW5BAFLhCFDYk0qhfnEAbSdwZjCdkb0LKew9vY1OwNMwQ7v20KdblWZX2SFJ3/AtdrAf E3zkq4PnGVRYfANYrboBT8NK7VKgV+8reVRm0ufRMJP9+8xj0h+qjHGEkfqlBch+GQUK+7DlMXr9 ol9mgG6cQt0iAaTC0aAwllKhXsEASkcoobD4lDY6QqGGGdp1AUeoVxpeZYdkPcNr2MFeBI5wktIR Sg1gteoIhRpWalcKjtCk5FGZiYKnxUz2s8ERKoxxhDH65QbIfhkLCrlseX/9ftErPUA3TqFu4QBS YQEoTKBUqFdEgNIRhBQWr2qjI/A1zKDtCCo7pOgbvsUOrTlCuQGsVh2Br2ElbUdQmYmCp8VMFI6A p2cs4Yuum/7+ob8PSxHmgO+ukMZHP2wmu4Pe9EzczswlKaPOw5zHAXJ6W2/Kx0Lv66svklNT6C22 JZuuL1P3G6yn6smktS6TaYpM+BD05Z93nX71CMkc49B4Op1DymQgmVZsS/2pqfPZ/lPWrQCZzTvH IzvoywR7Hmx8r2hER5Yi5OF1+p72j0h7MpFMNoU9Gz+HOwkVYM+bL8fVPL+oL5PJ4maxXvyxb8Ih liJ0oaNo4ZwsUiYLyWzPZuvLvN8ZOkmBti5I29XyN2r1UQ/lxFcH9bcq01Vfq5wIE1+WlBNfdV2o vmGZq33eIW9mIdeWd4aFIeTKEPkUOl05Ed2bFfey4atVlrkz4NRrbH71s6//xS2sxoXHdxMZSU90 PV7uyOKG0PDSGBa30z18Z5I8bjnMcdb2ZNdG6bl8HFmgB7rogYXedzn1gEkQSzmbHQuFFsOmd316 Ex0719W+9PHcYqSTzuzEanzeOdr2zr0IyLWnDCn5LjBfefCKwCt/b7Hk+0Cuvb55J3Mm/pIP66sz ZWH/srRFrw2bzoGPXYLo8+/7fUwl2nV/SM5lteh99NXiDr+A6PqJgfmrbhsUvSKcGBBVCKJ9HOz7 xSygEL3Yu3yHPFQtevO4/ce9r4Ho9uzNX11y0xT9tskkuYv+UhRyNkkOc3O1XHZtH811KXh01l+X YsyUi9ydxXXusll5cxyv08hRdrsrqIxFWtFRPvuC9SpnRooqJrV6oxp5yUUbGcaq1F3FolTpBir7 Y5UtS1rIqFRvSYtRKl31V6PoqIzVXJpCXvb0lqZoqXzLBK/cQ38th7IvYa6uNoVdm6C5WkI5Oai7 sMOYS7u8I4vLHQDVtofrGhZmlWuTkFZQ6eX1vP52jHqCEFddo7Vi2Leo1F0GolTpBSqTlSq1j1Jv TYhRKj31l3PoqEzSXNtBqtRb22GU+7ihoeDHs/jTzor4+1RH2R9Uss/1/XNDO3X4jD81PQJUhukd pXqUqU1Gss+ABdEVUBH/mKwXBMOM3Eu9CAmEW5StnbGfox5nskHkThBOqM5Arp9ygYi28B/IVT6t C4+2ePJgt1o4/mq7b9oi/Du18L8MCveM3VTXyVIt3FslnHZGTzi+Asv9keDnF+wLh5xmKRLd4crX SWlumFWvTWPXDtePQJbAfX58r/rqEXFyxsf6kZK8k2q1xlT1ag0yBJH7gNyh7NpB+nJh7cYXFhpr N/Tler9VbppJcn1YXM7492PWDwlAcjd281y5b6JSLkyX1mYg0frRyKX+x8OyUkHulafUURPYl+OS lXBzLwpxEk7yN+aX/6m0L0x81mZS2bdx+ynYAez7EK9CUOjL7cziRjlyT6d3r0Jyn6NOmPNGKdcP 5GYj0fpyH8CKk3ZwU/NONax1mUoVPdUOV69YoKuWLOyB8Akdi+H4SWf5gnb8JGfQ3GSERMITiOAD C24tn5UYqLGdgD9QYlci4U0QyKo1Plvhodq3lCjX3DkTxfKTYeEFHdDRv8mJAsv2B5yzLeK5Fhb/ ByKO5/c=eNq1nQdAU1cXgMlCCCJ7KyB7KCoBRUUJQwRFQYaAkxAeEAkJJkHBVjRQtXW0tta9sNa6cLSOaq0S /1pr3bXOqi3OqtXirlrHf899Sch4QZLGKPCS3HfO9849775z7rs5sbAtIybxKydMFEhl4soKC+vI CA7HV1AoEVuwJvJkhMSCPaBCwPeV8URlERYWFjT0w0A/FtZ1uTT2ND7NVsIrElRKXQQigSwTb9rx xUKhoIjwkUkEJSWEJJ4vE4hFYyPtxJUyoUBEeIhFWbxyYij6GRvpIJAmVAqFhMwG9or3Uu5DvtlO QhTh1xNtSiQEIcLbSXbSysJEtGFdKKwk7MQVPL5AVm3DE5UICS+xaKBEXCkqShHIxkbi5gluGiLt igiRFLV2kxBSmUBWCWBuGvt0KhWUlArRjyxZLBk03KFYIsDwXlqH0rl8LD5EqYDctcKl5Yj8tSSI BSKZHZ8QITvmKf/muyBVEl4JrxDhCqSJaB8JL1nMR3ZD70p4ApGTQJqKjCkjitwkYhnqg3g4NPRq Fk9UVCiuspZVVxAuSMbEeFH1RF41emeACMQVOYDgvPTiYhf0UpFABi/i1/LRa+H8UoJfRhQlaqEj +2chHQK+P6krXSJAmDw4TFbctfyw3xp83FlT3rx50wQdz7Sk0+kMSxpTPpnBTGDQmWFM+RSmBX7J g9mOTmfaMC2ZqPUbOp3Fzdw/886GDRtYii4RKaPO7WagfelqWXRL20SBhC8kGAxW3JYc9MizQFt3 d1/0O3ljKqOlIZvGirvx69VLQ5bKNUEYSpBRDKY8BZGI2kQS3h/92bBRh2SUNsPFqeDgFpoMMxg0 W/DwvB7kHw6rqgerKhI/ySdfy49kVXHILQ6rugerOpJVTT7Pi2RaWrHbd7B3dHZ19+zo7esXEBQS 1iWie2RUz5g+sf25CUnJKYPShmZkZg/PG6FW2rLBzVz6+tmwv6ahjUbLSTsW/E7Z5sbEY+l/9G15 RdHFN/W7MdGJLEXXAPZdzpVn6JWoA0vXXMsyuUMVoYpOvjORnMnbXB3X/apjRodsiQCfhmDOHd2y m37tAua8fz5xZNwDrqY5p3NojGobsE0u/p3CmMgoZVTZCqTZaJwxylqKLnPAYwooTBL3oG5/jzMN u1hxB7v9XPhyARcdwbkf6+M/6kXXcKA2HfiLY35rouYiZbz35iJbol01D9wpk+DLVEfeeGfjwbXN y6eiI2++12E4013Lma1ZitDahXO0OqoF+PHOx4TVH7dYcUeKRnRssIJe3Tuq5nhYpibwFOTxeYhY boW2WY3nchcJH77ZZYj85uGSRbGOSOvg4xdcZ4TrkMstgbhpg6CzdAwibrxSvtcjIcZChzhs3un0 7lX+bSR++L0il7eCruFbOsR3Pnx1puc8hQHirI5h6xEN0jraZsk/vk6UxE82JT1qV8tFW9Pf7388 rECPOH0PeiioiK+OiY57/149i2sh2ep7YOk6RLz2wTAHB3uDNjbsFt+lT8+Y85qlCIknvl0dMljn fMCocQfTvK0/3oxOhMYH7OBFsU66qB5/w+M+FeotPA4hm9KtPkSP2SxFReRE9KhqzX8dmXbMdgwA tQDQxwhJUdEF78ZSuAiPoscxKlD1mNCypQP6Pz/08G8bqFhBKmr1RLPTtCgGFW/HuyFQLpbYRlCG Jmjj1tDFixcvsdAHZbKZbBY3YfLjmnsDAgw7aFzhx75fPRhDwfgAej3pFd6fxXVqzEeKFlExcuNk 93InHWnPYClsj2/jcDjdqRiXGWQcONpkxvvAmHpZi3EuJWP0dm1GX+PsmJFkkzFj22pTGJuBcdgH eP/W7WjDSlm8vSfXVDtmbjeZ8W88GD3WYqS0o8Jj8shtgdebTLVjjrPJjPeAcXj22+2o6LZv04XP Hla0bkfDjGmdTPbHu8A4dHkbzpkQwW+bnyxwN8TIDQrLRaNYJdUA1HwZHgoUKUIUl1PAUiSsbJ+G hhLEAQMQHQ9AdGYCXT0A0S1tcIKjHi4ZQPsXGvQUCWMzPkUXBKTxDB0Neb6U4/qPDuhhDwHOjho0 gD/QjVlND57v4DPYPTl932ZXliJmVuNGceC3FCFr4y95/aIaCiDSuPHPk/LrO5vMFzbrMDjdP5W3 Yha6ErfCcOSZoEv6AC0zsKgC1ZRjEWW23Y4i8U79xKen11C1SS3wdbF2660RzMZ8oBgRyT/HUvS2 rH/UqQ8HvfLxq8Nn+/xhsoFd6l6sXnwWydlWadV++WodA0+Agzvxd+DQJDn08Z2/V9HmbS/QuSTG 7PmoQ9meG22LPVOT9nx3t6y7EbEnyTnzcOO2/deQsjX5A6wa0ynjoYdfLR987FMFAr0dHrLK7XaT Dmiv6D8TN8b82rYILtXudhVrU7EpMSdJXPhj6uKTN5FWz9rbH88+Qkn81+DLDt7XIYK71e2L4xHF 9brE+6Z9uXTawDYST1r/r7vXa1NiTpL42LSjDXE1SOvqzoNqLsRREr949frO5QG+aOuoeIRiXoFu XN9rWfWIK8GubYs5U244dZw16ZpRMSeJan1iBlu2j6XoOX9o3unLI6nGpsYDvb/e4SOAmPNxmafk m7AMHVSucEPp57/4UPotHkCHIyurYrqOxbTmXktHao6kvnT4gV9MtEvIoSPBryBW0x36LwGw99yG xVeTLZHSjlgpBm686bPv9LqHmarBdG+Hc3+cykfACosK98AR0R/A9cCp9wG7oA8PYeD4R0uXWSqo Lk/IupDTb0DWdSym3f3d/6GmUX0Z8KNLyrBk9FSP+yw1qj/H4qnY4TmgrkhO/rqMRP1n8MxbNHGp yravpNZfhLvMRai0iU0Hw+MkyLZaqLF1wv2zH78FtfPlDQv83p/VFlQ5mwI1nNwfqXOLcBP2WqlE Hffs1LEPH6gu+u5rNjWW/3QVbTGdv73I2+WsiUpjcdt9+iJHzFlJdX0wBEPZw8UMtPkCsXR+Q6ZG qIFqWuUHPJmigJ51Ac8q1jXX+Am3R+XJ2+aK/SLODv2mts6gK3Kt/cZMrDjWwYAr9ts99fnorhEA ipUqjVZ/2XnCp/1URou++30lrUse2rLZPSO49KYtuKLP4f27U1bmYODk8wVvjn30lv7teSD8yxXR DQb7V01qoH/7kvsDap3NhqooSlTOs8n01+vq0Rb7633TF17yBdtqosYvvxF5YstbUCNFZ44Wbw8y GbUXuT+cNSmfXJ40Qom6wKXhzYFAdfyZuuPp4UepaMuqkVNb8rWTJqoRrqgBQ9nDB7qEcGbeQSxB R14uWpWsZFk31+VIt72kRyqinzmfoB3KhA4WvLpZUrVNx2pOKaS3UYQlnbFH5rDiTqo8MiHE5UxO TrbGlcedgf7Tme4o/aY4YY7gDDJTATJZCsdDBrNcLpfAU5Voy61ebz4SML3h/UVUJ84v+DRsQrHH VBVmGGh8bRxmQizeCWEewKooMRPeg/caAHMZbqWL2d0IzOQMEzCTC1WYZw1jxm7E07uAuZkSMxdY nrWt05OX4v5rM+YBwEw5WBaG56Adz2FVlJi9rpNdjTC34Fa6mBEAP7eN1lwBGtcZh5m8Fe+EME9j VdTWtAcNTMBswK10MblGYA46YALmoLMqzJuGMTkH1Jj7KDGN6fTBrsZ1+l7AHBLfhk7vesmMnT7Y wzhrYszB4W3odI6nGTs9Pc4EzPRhbej0wGWgwcpgp/t3go7NoOp0/zO402HCI/4yqFqvEWlYQExD h9BcnsKkCHbJkT0PXw4QYR98daUe2QtwXAOEjriV9jyHwj8Q3k97C2HyMFCVZQQhOQwdUY2WgwyP lr0uqEdLP3K0NIVw0FFjCclzJrkNhF0PwntbqQlprLhfS5o/s/b9kRV3ades6T2rIlr8DIUWFgwl Ayuu8YPtP2zw8NV3uG24O79TdmdgP+w0FJMw3LiXqgtg8HrcSGcS5j+TfAMkA6y/Sp2X1xeRRL65 tC1WQUky+qP/RXz5O5CswI3MTfI1JhnhkXVhJ+qewAHJ238/w6Ui6f/96k2r/gT/Cf4aNzI3yVZM sn79Ibfd1xFJnwexsd9vpSTpVPtj4JXZQPIVbmRuki2Y5NH5bI5VH0RSPmZvbiVl7/T7KLChOakJ SC7gRuYm2Ywv34mlh8bb+CESvnXSjtHdqUhi7zAPSOPsgeQEbmRukk2YZN7FU98KriGSyoyOTU8o eyc21XvLTfnHQHIFNzI3SQMmuSZMfiI8ikjGvfiy/2VfKpK+61/9NO6974HkLG5kbpKNQDKQ88ew vkdQ1h44Of79cZXrKEms3b65vK8/kNzGjcxNsgGT1Il/rD4uQySSu4xDo92pSPoInh7m7RICye+4 kblJ1mOSX6+eUHTthUimRV589GQRFUnvn+13nH5xE0ge4EbmJlmHL43+0sTX3TshkkmX+cMuW1GS hDYfy3viCSQ3cSNzk6zFJOWrTnrUSBHJpkHXhQsoeydm/mc7/PJEcN/EAzcyN8lXmGRvZFKufBQi +eJJ2eHJU6lIej0df/SrzGVA0gE3MjfJGjzxabtm6PImb0SyIzbxqas9JUnOrF0e892BpDNuZG6S L4Ek8eLMHoxxw1iKgK/an2KFUY4n3EtNz9dy88FPHHEjc5OsxvFJuOea+PLeiGTpt/l8h7mUJHMy pgn6jQeSdriRuUm+wCSVqT1G7fkEkRwP+G3y4XpKksTOz4c0ewFJH9xId2HMK0ORuSoLg6gyfYbu jEvLbRTK1GEVTh0WKiM5nxeGA/OAaaqw109AhnLaYW/oibYAxv873zjAejzZYjNfCbjCMGBCwxll 5uDXVw/QHH25EqMc+nn3ulFx6Ew7vWVgzflDVH0Z37xqPH1oGZxpXNzI3F61Ap9p7iO63hwbhEgO 5x+/pKCMZuLr7V8eGPwBkPTEjcxNshyTlB6L6bL3NiK5VL/WKm8XJUn68oeT7+4HkhTcyNwkyzDJ rtEN4xQnEcmpwRHF3BBKEgvbmrjbvwFJf9zI3CRLsZ/UvXLZ8r9JiISoObp2KOWInBAlcn5xqzuc 87/gRuYmWYKvDSeVHhu0EPni4ftUJNEnEq4yl51FW6EM3MjcJIvxvJSv0mODZj+07PlNASVJ987P P1wIMxQhz3Ajc5MswiQVSo8NWhnze+GgJiqSqE/6Xv/3Qi3YxAY3MjfJQkyiUHps0OfXCEUkZRbN ue/5csqv24HEAjcyN8kC7CezlB4bFOLGpHFjqEh65l0KfXKyAHrnc9zIAIn+soM2kszHM242qjzN 32CexhmhztM+aS1PM5nkc0wyUpWnRRvM0yJ3q/O0Va3laSaTzMMkG1V5WpjBPC3SQ52nLWgtTzOZ 5DNM8q8qT+tnME/rUa3O09a3lqeZTPIpkKQNVuVpkQbztO4X1HnaitbyNJNJ5mKSpao8bYDBPK17 b3We9nVreZrJJJ9gkr9UeVofg3laN84fS76+E4XnfVrL00wm+RhPVUar8rRyg3lahE3guKStl/C8 T2t5mskkczDJNFWeVmgwT+ty9NritDUxQHK8tTzNZJLZmOSMKk+rNJinhc9yq+CE4ajgSmt5mskk s/Ciw0WqqCDXYFQQUjPtgHVvmL0N+aG1qMBkkpmY5JYqKkgzGBUEcxMfOUTAaB+yq7WowGSSj3Ae FKOKCsYajAoCX0/8+Z9tcKMn5EhrUYHJJB9ikg9VUUG2waggQBH97M3aUiBRtBYVmEwyA/dOliqO vWUwKgj9dFfWX/UKIMnWiwpQaugMGxb2bbuVmLEbPo60sc03v6bj5dLHm7h4JaRzAVZFmSDSyEUd aMsjBrfSxdwJ769r2z26jO+a4oy544kxM37AOyFVo7AqSkwPnGhDjOURhVvpYh4yAjPzmAmYmWdV mCKDmI2vsTWnAmYyJeZ9fKuxbZ2e+agA+q/NmFMAM9tqx3wQo3CuwKoo13Z7HlLdP/ZIIe996mAe JFf6tM2aj0FjtnGYma/wTkiV0ODkhYLZDesCzCTSS3UwzxuBmdPOBMwcexVmjWHMwNXkPXiEOZwS 05hOz+neZFSnV+EF/cnRb+/0bhlm7PScyGijrIkxc/pGv73Tg/5RW/O/d3ruABMwc4dGv73TOT+B rpcGO93/Np4ZfMsN74zPcccZccObHNl/UX461ekUvqlNPbLnqIZM9w3krW+dW/J4tWT2Wwgzj7NB lRGE5DBkU0COlk5XDY6WCs+HqmuP+3fkaGkKYY7NTCMJyXMmpenthN0IctKUktAc4YQID4Z0ZXcG WeMuo/qw8dNxoB+HE5Vkv5o5sCnHJGFZAT83QCj+GtYDnKQiufUgZsDppXCNCxmHG5mbRIhJMmev v3txCrKJA6wHoAr24n4YdvbkowYY0UIm40bmJinDJJOyr9tceohILGE9ANWt+sbffYbunLEck0hw I3OTjMMkK4VhHh+gNDaoN6wHoOqdxvvH1vSw+QaTrMGNzE0iwCQ/RRXFTPsUkXSDeSaqJR2NLxq3 7Tpqh0mW4kbmJinFJM3lt0duh96Jh3kmqt5R0EvYU488gnEmZBNuZG6SEvzJP7ee/pN2FiOSnjDP RDVBp2hX4HCgwc8XSL7AjcxNUoxJ4sTrlt84iEhSYZ6JaoJO0b4kQeDYAZPswI3MTUJgkpJeV7// sw8i6Q/zTFQTdAr7rQFnq71hjA3ZgBuZm6QIk3wyvqTJdRkiGQbzTFS3GxVOnL0hDc4VQLIXNzI3 CR+TfNt71Rv3DogkGeaZqKY7FC5buYeXhc8Fkm9wI3OTFGKSSxm32jdC71TDPBNl77jTdoRPWIF7 5wZuZG4SHg4XmB5+4YrNiEQE80xUt6UVnjUxx4p3YJv8hhuZm6QAk3TJXDv0vh0ikcM8E6VNOtF+ 8Vm8EY8n93Ajc5OMxUHevAHu8h0hsOAG1gNQTvhbe9stkbHq8YIb3MjcJGMwyR7bzPqd6NwJLIH1 AJS36pmBVsPnnYPxJPhX3MjcJKMxSVPAos2jDyGSJbAegGpki3vDjAvde40LvWOJG+lWevjZUGSu eU8+V0DGvW2+Jz8Kpw7j2WQk50sqoQwqo7JwWIsA/aPJ5QPaYW/Y0rYAZqweZBzgSDzZsnGQEnCp QUCuVwfVUln/dnqA5ujLEbgvra9fOh3hi860elgPQBXNcF0CbT50lMLoE9oeNzK3V+Vjkh6bXB91 m4dIFsB6AMoFqo7rZtz0GwX+HUrHjcxNkodJ8m8ucx3zGJGsg/UAlMtC7QOa5zUXw7RvqDNuZG6S XEwi33w2uqAUkayA9QCUo49Nxrlrr5fD6BPKxo3MTTIcu+yfNTPPXemHSHrAegDKm3xugyvWnovH Ocly3MjcJDn42jBH6bHBfOSLRyyorg2d50zq+/QgrAgKPYEbmZskG5PsUHpscB7M/FdQkfgd+b79 37/cB5IDuJG5SbIwyWWlxwaXwcw/1S0TRYDthz2t0mBKJ/QcbmRukkw8u8RSemxwAcz8U2XRisDB h9tZ5C0CkqO4kblJhmGblKk89jHM/FONJwrfSQMbnMfCVSq0ADcyN0kGtkm4Mk8LbDaUpymCJj6d 6CGHWdaQke8kT0vHJFmqPI1mME8L3v2/+siXt4Ck/J3kaUMxyXvKPC3wqcE8LeQZc3y41YdAUvhO 8rQhmGS1Kk+zNpinhfU+uSSpDpNUvpM8LQ2THFHmaYGvDeZp4VWOZbGfhOB5n3eSpw3GJI9UeZqD wTyty+7fPx/OjsHzPu8kTxuEJwi9VHmapcE8reszX2KoyyE87/NO8rRUTMJV5Wm9DeZp3Xx/m78n HffOmneSp6VgklJVnhZhME/r3u1jTv6mIiBZ8k7ytIGYZK4qT4s3mKd1PykbeHMcHk82vZM8LRmT PFBFBf4Go4LI4Xs7/cvvAqP9J+8kKhiAsw8PVVTgbjAqiHzyu+XEUnwt/uCdRAVJmCReFRWEG4wK OAsOeDGD3geShe8kKkjEJAJVVOBrMCqIir7BmNolDUhmv5OoIAH7yQlVVLDdYFTQ45j/WXY3HFH7 6kUFHzjRcO3LfC8pnyckcgWy0hFicbl/kUBaIeRVDyaqMySEVEoUTcLN8t53aXlHbtFJWZE2W1zJ LyWkXjzhRF61dLhAKigUEm7lY2VElSxZQAiLVOVv0wRSmZzu6GoN79RYSwWTiI5VdgJRskQsklHW H9WApagg4cviBuIbdG+QzdgzODT/cnGllMgtJQihshyt6lDipRk8qXSiWFLkAHV3oaaunZQvEQuF Kcq/w12khBBqaKLdnKSlPEmFCB26i1RWLSSykESZE1AnioViiQPIyZXwKrx4IpkgXijgSbOrKwin 8kqhTADlhQc5lPOqEpEMaTBplKxS8cQsLF4gFjnwKmXiLHTwLoU8flkJLvzr07KJVdgWIhWExElW KuCXAYgb+QJ+MxQdZKaAX5oNQEJBRaGYJyny4otFUFoYHb5ARvgXEcU8hANNksWScp5M7u1ClBcS RcnI1lK3EomgKFkgA2yHUlm5ENr14vH5SJOgEB2DrDq1vEJIlKsK8bogu6gq/KLNVKSqyqkYSgZD 3VEPbHfl+24IBEw1hBBVBhaJK9FrCJJfpnzbCRf5RSJH2GKny/Pi85D7xEsTBLJyXgX5Yn5ncQVv fCWRoLaKtYhXTriQXQUq7YoFQhkhkTohmaKiIeIiwkkm4YmkxehgXbCM3gPRMdrwhBWlPJuJgiJZ qXU5T1pmN4H0z25aB5shEVcQEpmAkJL6R9iWElBAWU6vYkxSE+ept/IdVFsMOjpnmTR01sK5a2kr AmML6ZZ2RdWIWMCHIjTWIrGIoDPrYIUInkmhs2s5NDula0KJaLHEroyQiASiEi8hIUPHlQUlpUUl TujICQm4FFg9SyaukNrKeJISQtauUiJEBycoEbkIiWLZEPSiQGQnJHhFaDfrQjE66yRwBOQbtgIZ asu3LkZdI/d1KxSK+WXQhyKZbSEufW0rwM8sbfBb5P1OaxrNEv5ZgwLMDQdjEy8R8ITMDvippU85 r4zwxUcg9RUXF6P3KwRVhNBSXhab4RufljpwaD+/tAHJ2X79Y5PTh2b7JscnDujnh2X4+WaljkBP ekT5+Samp6Vn9vPz744ffr5pA7KzB2RmZcQnpg4d2M8PvTJ4QOZQ5XZ/HaWx3UB0/9huGf1pdFwZ lcaggaXRL3QMXgKRVMYT8YmekTExPWlwWLWO7EQaOknRQFDFSbIlN8KRC0gr4BydQCCHGEeerZ2w nmyVb9HYfBpLVs3gMQoZfEYRS1bF4k6YjSuGMsETkFIWt3DVYihlSGPLnWhuuGx4enGxlJDVerph fySfuUDxcHKzE2wOgeGjQiggJD54n5bnXhKiqOWZE3pG7uaDpbW8g/VjBvwP/YU/cl9kDsAqqCmG h5qvhVy5nyVqFHcuds+ePd/jp7UJLG4YvtXfwAxgWqAr7FhyolG75DI62TN4EhmeSspRfXzJAw/M L+laU6Vc9/OGCtsoSy1laFRyDbrSQFbKNlw/Ueey2Bsui8H/0Mn9PfMMlraJO7xBefc77k0OxZQp 15dc7NBGUKyR1hpojbpqEQ2DQsGfkPa5uLgU13c/Fkld4xG/xVVv6a6Y/avHpZr/3fmEqmrRW6rd csBYkRvDwcYsRXwHKmPh+e8baoQz+gjWLEVCf9iT1sZSbufy0St8w/WzPDr/m53U1V2/cyOB1wed 1xYWKIeK/9uCtDl6Ne62ch+lzX6Dvl0PSxuwJ1jY4/pZ4yaF5sSMwcBOJNVbSrlh0gmGi1KpSPWL UmFU/zJw3z06qM+Org8+YcNRre97hissdddApWuj4qU2DW9B9XMFT8oyGbULuT9CfQSWyVWi3nVz XBpwQHWXwW2KaoESHfdqhSaqMfWzWmCoetgbm30MYrmlLpSvLuV2GY8/CvUy06265orB+7SxlNtg 8P31rZRya9UV+505ixcTaYKy4p5ruaIiGmOu1wCGqf8L70/hdD6FgTsYGBC1S7k1yeGlVuqjtd6/ fcn9W0fl7AAD5WvbVhO1TWdN5Cww6maTUXuR++ucNc/dOHePjX2tQo1QwHuW2meNCtWoUm6tumK/ pqlvcBmY+Gv40JUsoZtzFh1ZoCrlhq2WpbE8TgvlP9Tg9QYEjoUc+4cicWXs/qZFf+mPz0yoDXv5 0c4Bq/QmAf5D8V0d5XyqCxSpnGnx1nK7keOG9VzOEKKNp2Ju+NaTVG04c6Nmfn4qWaPcbuLSvR4J vf5FG5c2Ed+uDkUb9Rd/+dx/iqm2jHzxMufnc7VIzja3im7ZVyjK7cYtcFx3ftUzMOm1+9N3Trmm W/Iu8dvO0jHX6W0rt8vJLzs7clKUEeV2SbPf+OiPO8FLkLIG64/RoVOWgr27yutV0iO4KF/tSvUV DwmPM+a8/qK6bcVrI5t/Qq1XmVJulySeX4McsB5pvbmi4H5aJSXx1ZX7JhzaDhVhm7tSfcVDYgw0 2NY2Ys6PKcO/ufiLKeV2MXHUuDfPL/qdRFrD7n1aKtlCSfx0bfPyb7oC8SXOlafjs/SIgyGOXtq2 cruRSzwh6Daq3C7pttfmiRbOyUDG/ZLpPk+2jzJM/B6OYiug/nMneFGso9bc1zQ+za0Cvl1JlFVB EEXMTsonMgkhKpGVWnkQODfPwK+68CQSXjXO8B2dO7i6e3q7CaRJMGkiriaKAuzg23oExcUdo/D3 LaVhCV4wpZEu5QuEQp6MsOZVCaRepI4k8UTRYKK6E7RNVbdX0uRUoLdcKlDuEIn12aEsrVQsyVP+ zZd3tCsfOw6+waiz9lzT2Ei8Vw+8l9zVBj/BvyM155GY3gz0n8G0hvOOPPHkU+hoKwx/2wOL6zxi zNniVVV0tj+tSo6G9k+XPjqTObUHK6759c/X994cwwxpucilM61YigqmCH9ThsJ5L1R7/92SBmlW O6YF257tqNkrnTIkAmk5fKsR/gamt365RZ0TTTWfpvrmJYE0m3yBKKqtqrOqY9e1l3es61BnX+co d61zrnPVPFQIklxZ3FTnh7nNZ9Dg2Wvy/LwgTy+SzwHxBbAjNPlcklGaXqRiazwxqnbJlI3gPueW rH9aXc3VzNu6gnB7/XLllo4g3BEJD2L7aQqv86asXK4n06F1mQGmyHREMjN+uOuUvQ7JXP3lqHsV J0iZTkhmCDtIX+bNI9O2TDkNqeCtx7OWb/Zo0pMJhvXbMj6y/QuWoufftjUFJ7aQhnVGMsO0DUvK PDv72N8jT8HX2dzbl8G5yfbVk+mMZK4K6n0zORN1Fjdge7rdH6RMFySzCztMX+YTSfvPvH3q0da1 9wQTvJlaMmulNAep8nyWu8o72khLeRVEHyeBNIEnFIrFolgnWamkUipDZ5wtPltFLrgJPoV8tc4a O5gJYEeoC33TVZW+c5FOZAx14Kj5/UPZWDohkVIV/56rifoBg4YJEnPt8J/EXDdy/BkiloklLuXw OzEXcfrgzTTxRJg6LhfIyOc5FRXK52RTPKR5kZtKA7iRMrCQ2klvO3UYaEgOZr1pJqeSWVOUG0xv 9C+QznTTrx9uWQMd5Yk6qie7u2Ylca9MYoJYWCkjVCeWflVxTUtEgyNQqbZD/5BqTxbXaU9OL4dQ qGzsRlyMTmORPuKOVEeye6IR64V/QD9//w7IR7iQWVjO3rPlmH8UfHBs6x82v32WbaQ63fLjpDoP pC4K1LUUIsfq9AuRG6POXb+EuKa6SM1i4lidfjFxbXVoYA800I/BdKaXfvFtsh+9kbr+7BjN2tak Or0y3HpHF2jg6JA6bxaX22vc9QunvcCY9kediYfk0XVE6vqw+4O6xa92/zpktEpdzMrLV/rMBVex fe+9c5d8nhupTrdeN6muE1IXS6rTPjq9yt3GqOuoX3NbU10fzerbpDq96tvGuIoHioLWT+1Z2m8U UuexR7b1sw801UWBuo92vfTs0FWlLvCHVRu6T/8WbVmWBA/2P3fGGHU++oWnSXUoZ2QnsLlaYzOX sgS1kep0C0iT6jojdUlU6vRKSWuqC2QyGUxHNKj5M90Z5IfTUGgJn1CDErEsrsMm1r52P9Uz2KEo zlHdP2PKuS2hjpyLAp8WEzAupS8cMmeupdyqxQaZWlDu2jawnY13YGhBtSOhAgxAzR/8XfnxAgSF J671adQWYrpbL/lz+kklDWkiCpoWE9kewjswjOgRP/0i1GSP+CN1Kexkih7RLUdNN06dbjFpUl0A UjeISp1eWWlKBwihsPWBNjpAqIYJGC+hP6cqTU7aIJvC5Gob2DbgHSgdINQAVKsOEKphIWYM9KdC SUOaiIKmxUS2t/AOxjhAoH5BarJHgpC6oew0ih7x/A8OEKhfWJpUF4zUZVCp0ysxTaeydVcKW+9t owOEaZhA2wFIGwynMLlnqw7AIqEiDEC16gBhGhbSdgDSRBQ0LSYywQHy9MsIkD2Sj9TJo9jySP0+ 0SspQDdOoW5BAFLhCFDYk0qhfnEAbSdwZjCdkb0LKew9vY1OwNMwQ7v20KdblWZX2SFJ3/AtdrAf E3zkq4PnGVRYfANYrboBT8NK7VKgV+8reVRm0ufRMJP9+8xj0h+qjHGEkfqlBch+GQUK+7DlMXr9 ol9mgG6cQt0iAaTC0aAwllKhXsEASkcoobD4lDY6QqGGGdp1AUeoVxpeZYdkPcNr2MFeBI5wktIR Sg1gteoIhRpWalcKjtCk5FGZiYKnxUz2s8ERKoxxhDH65QbIfhkLCrlseX/9ftErPUA3TqFu4QBS YQEoTKBUqFdEgNIRhBQWr2qjI/A1zKDtCCo7pOgbvsUOrTlCuQGsVh2Br2ElbUdQmYmCp8VMFI6A p2cs4Yuum/7+ob8PSxHmgO+ukMZHP2wmu4Pe9EzczswlKaPOw5zHAXJ6W2/Kx0Lv66svklNT6C22 JZuuL1P3G6yn6smktS6TaYpM+BD05Z93nX71CMkc49B4Op1DymQgmVZsS/2pqfPZ/lPWrQCZzTvH IzvoywR7Hmx8r2hER5Yi5OF1+p72j0h7MpFMNoU9Gz+HOwkVYM+bL8fVPL+oL5PJ4maxXvyxb8Ih liJ0oaNo4ZwsUiYLyWzPZuvLvN8ZOkmBti5I29XyN2r1UQ/lxFcH9bcq01Vfq5wIE1+WlBNfdV2o vmGZq33eIW9mIdeWd4aFIeTKEPkUOl05Ed2bFfey4atVlrkz4NRrbH71s6//xS2sxoXHdxMZSU90 PV7uyOKG0PDSGBa30z18Z5I8bjnMcdb2ZNdG6bl8HFmgB7rogYXedzn1gEkQSzmbHQuFFsOmd316 Ex0719W+9PHcYqSTzuzEanzeOdr2zr0IyLWnDCn5LjBfefCKwCt/b7Hk+0Cuvb55J3Mm/pIP66sz ZWH/srRFrw2bzoGPXYLo8+/7fUwl2nV/SM5lteh99NXiDr+A6PqJgfmrbhsUvSKcGBBVCKJ9HOz7 xSygEL3Yu3yHPFQtevO4/ce9r4Ho9uzNX11y0xT9tskkuYv+UhRyNkkOc3O1XHZtH811KXh01l+X YsyUi9ydxXXusll5cxyv08hRdrsrqIxFWtFRPvuC9SpnRooqJrV6oxp5yUUbGcaq1F3FolTpBir7 Y5UtS1rIqFRvSYtRKl31V6PoqIzVXJpCXvb0lqZoqXzLBK/cQ38th7IvYa6uNoVdm6C5WkI5Oai7 sMOYS7u8I4vLHQDVtofrGhZmlWuTkFZQ6eX1vP52jHqCEFddo7Vi2Leo1F0GolTpBSqTlSq1j1Jv TYhRKj31l3PoqEzSXNtBqtRb22GU+7ihoeDHs/jTzor4+1RH2R9Uss/1/XNDO3X4jD81PQJUhukd pXqUqU1Gss+ABdEVUBH/mKwXBMOM3Eu9CAmEW5StnbGfox5nskHkThBOqM5Arp9ygYi28B/IVT6t C4+2ePJgt1o4/mq7b9oi/Du18L8MCveM3VTXyVIt3FslnHZGTzi+Asv9keDnF+wLh5xmKRLd4crX SWlumFWvTWPXDtePQJbAfX58r/rqEXFyxsf6kZK8k2q1xlT1ag0yBJH7gNyh7NpB+nJh7cYXFhpr N/Tler9VbppJcn1YXM7492PWDwlAcjd281y5b6JSLkyX1mYg0frRyKX+x8OyUkHulafUURPYl+OS lXBzLwpxEk7yN+aX/6m0L0x81mZS2bdx+ynYAez7EK9CUOjL7cziRjlyT6d3r0Jyn6NOmPNGKdcP 5GYj0fpyH8CKk3ZwU/NONax1mUoVPdUOV69YoKuWLOyB8Akdi+H4SWf5gnb8JGfQ3GSERMITiOAD C24tn5UYqLGdgD9QYlci4U0QyKo1Plvhodq3lCjX3DkTxfKTYeEFHdDRv8mJAsv2B5yzLeK5Fhb/ ByKO5/c=eNq1nQdAU1cXgMlCCCJ7KyB7KCoBRUUJQwRFQYaAkxAeEAkJJkHBVjRQtXW0tta9sNa6cLSOaq0S /1pr3bXOqi3OqtXirlrHf899Sch4QZLGKPCS3HfO9849775z7rs5sbAtIybxKydMFEhl4soKC+vI CA7HV1AoEVuwJvJkhMSCPaBCwPeV8URlERYWFjT0w0A/FtZ1uTT2ND7NVsIrElRKXQQigSwTb9rx xUKhoIjwkUkEJSWEJJ4vE4hFYyPtxJUyoUBEeIhFWbxyYij6GRvpIJAmVAqFhMwG9or3Uu5DvtlO QhTh1xNtSiQEIcLbSXbSysJEtGFdKKwk7MQVPL5AVm3DE5UICS+xaKBEXCkqShHIxkbi5gluGiLt igiRFLV2kxBSmUBWCWBuGvt0KhWUlArRjyxZLBk03KFYIsDwXlqH0rl8LD5EqYDctcKl5Yj8tSSI BSKZHZ8QITvmKf/muyBVEl4JrxDhCqSJaB8JL1nMR3ZD70p4ApGTQJqKjCkjitwkYhnqg3g4NPRq Fk9UVCiuspZVVxAuSMbEeFH1RF41emeACMQVOYDgvPTiYhf0UpFABi/i1/LRa+H8UoJfRhQlaqEj +2chHQK+P6krXSJAmDw4TFbctfyw3xp83FlT3rx50wQdz7Sk0+kMSxpTPpnBTGDQmWFM+RSmBX7J g9mOTmfaMC2ZqPUbOp3Fzdw/886GDRtYii4RKaPO7WagfelqWXRL20SBhC8kGAxW3JYc9MizQFt3 d1/0O3ljKqOlIZvGirvx69VLQ5bKNUEYSpBRDKY8BZGI2kQS3h/92bBRh2SUNsPFqeDgFpoMMxg0 W/DwvB7kHw6rqgerKhI/ySdfy49kVXHILQ6rugerOpJVTT7Pi2RaWrHbd7B3dHZ19+zo7esXEBQS 1iWie2RUz5g+sf25CUnJKYPShmZkZg/PG6FW2rLBzVz6+tmwv6ahjUbLSTsW/E7Z5sbEY+l/9G15 RdHFN/W7MdGJLEXXAPZdzpVn6JWoA0vXXMsyuUMVoYpOvjORnMnbXB3X/apjRodsiQCfhmDOHd2y m37tAua8fz5xZNwDrqY5p3NojGobsE0u/p3CmMgoZVTZCqTZaJwxylqKLnPAYwooTBL3oG5/jzMN u1hxB7v9XPhyARcdwbkf6+M/6kXXcKA2HfiLY35rouYiZbz35iJbol01D9wpk+DLVEfeeGfjwbXN y6eiI2++12E4013Lma1ZitDahXO0OqoF+PHOx4TVH7dYcUeKRnRssIJe3Tuq5nhYpibwFOTxeYhY boW2WY3nchcJH77ZZYj85uGSRbGOSOvg4xdcZ4TrkMstgbhpg6CzdAwibrxSvtcjIcZChzhs3un0 7lX+bSR++L0il7eCruFbOsR3Pnx1puc8hQHirI5h6xEN0jraZsk/vk6UxE82JT1qV8tFW9Pf7388 rECPOH0PeiioiK+OiY57/149i2sh2ep7YOk6RLz2wTAHB3uDNjbsFt+lT8+Y85qlCIknvl0dMljn fMCocQfTvK0/3oxOhMYH7OBFsU66qB5/w+M+FeotPA4hm9KtPkSP2SxFReRE9KhqzX8dmXbMdgwA tQDQxwhJUdEF78ZSuAiPoscxKlD1mNCypQP6Pz/08G8bqFhBKmr1RLPTtCgGFW/HuyFQLpbYRlCG Jmjj1tDFixcvsdAHZbKZbBY3YfLjmnsDAgw7aFzhx75fPRhDwfgAej3pFd6fxXVqzEeKFlExcuNk 93InHWnPYClsj2/jcDjdqRiXGWQcONpkxvvAmHpZi3EuJWP0dm1GX+PsmJFkkzFj22pTGJuBcdgH eP/W7WjDSlm8vSfXVDtmbjeZ8W88GD3WYqS0o8Jj8shtgdebTLVjjrPJjPeAcXj22+2o6LZv04XP Hla0bkfDjGmdTPbHu8A4dHkbzpkQwW+bnyxwN8TIDQrLRaNYJdUA1HwZHgoUKUIUl1PAUiSsbJ+G hhLEAQMQHQ9AdGYCXT0A0S1tcIKjHi4ZQPsXGvQUCWMzPkUXBKTxDB0Neb6U4/qPDuhhDwHOjho0 gD/QjVlND57v4DPYPTl932ZXliJmVuNGceC3FCFr4y95/aIaCiDSuPHPk/LrO5vMFzbrMDjdP5W3 Yha6ErfCcOSZoEv6AC0zsKgC1ZRjEWW23Y4i8U79xKen11C1SS3wdbF2660RzMZ8oBgRyT/HUvS2 rH/UqQ8HvfLxq8Nn+/xhsoFd6l6sXnwWydlWadV++WodA0+Agzvxd+DQJDn08Z2/V9HmbS/QuSTG 7PmoQ9meG22LPVOT9nx3t6y7EbEnyTnzcOO2/deQsjX5A6wa0ynjoYdfLR987FMFAr0dHrLK7XaT Dmiv6D8TN8b82rYILtXudhVrU7EpMSdJXPhj6uKTN5FWz9rbH88+Qkn81+DLDt7XIYK71e2L4xHF 9brE+6Z9uXTawDYST1r/r7vXa1NiTpL42LSjDXE1SOvqzoNqLsRREr949frO5QG+aOuoeIRiXoFu XN9rWfWIK8GubYs5U244dZw16ZpRMSeJan1iBlu2j6XoOX9o3unLI6nGpsYDvb/e4SOAmPNxmafk m7AMHVSucEPp57/4UPotHkCHIyurYrqOxbTmXktHao6kvnT4gV9MtEvIoSPBryBW0x36LwGw99yG xVeTLZHSjlgpBm686bPv9LqHmarBdG+Hc3+cykfACosK98AR0R/A9cCp9wG7oA8PYeD4R0uXWSqo Lk/IupDTb0DWdSym3f3d/6GmUX0Z8KNLyrBk9FSP+yw1qj/H4qnY4TmgrkhO/rqMRP1n8MxbNHGp yravpNZfhLvMRai0iU0Hw+MkyLZaqLF1wv2zH78FtfPlDQv83p/VFlQ5mwI1nNwfqXOLcBP2WqlE Hffs1LEPH6gu+u5rNjWW/3QVbTGdv73I2+WsiUpjcdt9+iJHzFlJdX0wBEPZw8UMtPkCsXR+Q6ZG qIFqWuUHPJmigJ51Ac8q1jXX+Am3R+XJ2+aK/SLODv2mts6gK3Kt/cZMrDjWwYAr9ts99fnorhEA ipUqjVZ/2XnCp/1URou++30lrUse2rLZPSO49KYtuKLP4f27U1bmYODk8wVvjn30lv7teSD8yxXR DQb7V01qoH/7kvsDap3NhqooSlTOs8n01+vq0Rb7633TF17yBdtqosYvvxF5YstbUCNFZ44Wbw8y GbUXuT+cNSmfXJ40Qom6wKXhzYFAdfyZuuPp4UepaMuqkVNb8rWTJqoRrqgBQ9nDB7qEcGbeQSxB R14uWpWsZFk31+VIt72kRyqinzmfoB3KhA4WvLpZUrVNx2pOKaS3UYQlnbFH5rDiTqo8MiHE5UxO TrbGlcedgf7Tme4o/aY4YY7gDDJTATJZCsdDBrNcLpfAU5Voy61ebz4SML3h/UVUJ84v+DRsQrHH VBVmGGh8bRxmQizeCWEewKooMRPeg/caAHMZbqWL2d0IzOQMEzCTC1WYZw1jxm7E07uAuZkSMxdY nrWt05OX4v5rM+YBwEw5WBaG56Adz2FVlJi9rpNdjTC34Fa6mBEAP7eN1lwBGtcZh5m8Fe+EME9j VdTWtAcNTMBswK10MblGYA46YALmoLMqzJuGMTkH1Jj7KDGN6fTBrsZ1+l7AHBLfhk7vesmMnT7Y wzhrYszB4W3odI6nGTs9Pc4EzPRhbej0wGWgwcpgp/t3go7NoOp0/zO402HCI/4yqFqvEWlYQExD h9BcnsKkCHbJkT0PXw4QYR98daUe2QtwXAOEjriV9jyHwj8Q3k97C2HyMFCVZQQhOQwdUY2WgwyP lr0uqEdLP3K0NIVw0FFjCclzJrkNhF0PwntbqQlprLhfS5o/s/b9kRV3ades6T2rIlr8DIUWFgwl Ayuu8YPtP2zw8NV3uG24O79TdmdgP+w0FJMw3LiXqgtg8HrcSGcS5j+TfAMkA6y/Sp2X1xeRRL65 tC1WQUky+qP/RXz5O5CswI3MTfI1JhnhkXVhJ+qewAHJ238/w6Ui6f/96k2r/gT/Cf4aNzI3yVZM sn79Ibfd1xFJnwexsd9vpSTpVPtj4JXZQPIVbmRuki2Y5NH5bI5VH0RSPmZvbiVl7/T7KLChOakJ SC7gRuYm2Ywv34mlh8bb+CESvnXSjtHdqUhi7zAPSOPsgeQEbmRukk2YZN7FU98KriGSyoyOTU8o eyc21XvLTfnHQHIFNzI3SQMmuSZMfiI8ikjGvfiy/2VfKpK+61/9NO6974HkLG5kbpKNQDKQ88ew vkdQ1h44Of79cZXrKEms3b65vK8/kNzGjcxNsgGT1Il/rD4uQySSu4xDo92pSPoInh7m7RICye+4 kblJ1mOSX6+eUHTthUimRV589GQRFUnvn+13nH5xE0ge4EbmJlmHL43+0sTX3TshkkmX+cMuW1GS hDYfy3viCSQ3cSNzk6zFJOWrTnrUSBHJpkHXhQsoeydm/mc7/PJEcN/EAzcyN8lXmGRvZFKufBQi +eJJ2eHJU6lIej0df/SrzGVA0gE3MjfJGjzxabtm6PImb0SyIzbxqas9JUnOrF0e892BpDNuZG6S L4Ek8eLMHoxxw1iKgK/an2KFUY4n3EtNz9dy88FPHHEjc5OsxvFJuOea+PLeiGTpt/l8h7mUJHMy pgn6jQeSdriRuUm+wCSVqT1G7fkEkRwP+G3y4XpKksTOz4c0ewFJH9xId2HMK0ORuSoLg6gyfYbu jEvLbRTK1GEVTh0WKiM5nxeGA/OAaaqw109AhnLaYW/oibYAxv873zjAejzZYjNfCbjCMGBCwxll 5uDXVw/QHH25EqMc+nn3ulFx6Ew7vWVgzflDVH0Z37xqPH1oGZxpXNzI3F61Ap9p7iO63hwbhEgO 5x+/pKCMZuLr7V8eGPwBkPTEjcxNshyTlB6L6bL3NiK5VL/WKm8XJUn68oeT7+4HkhTcyNwkyzDJ rtEN4xQnEcmpwRHF3BBKEgvbmrjbvwFJf9zI3CRLsZ/UvXLZ8r9JiISoObp2KOWInBAlcn5xqzuc 87/gRuYmWYKvDSeVHhu0EPni4ftUJNEnEq4yl51FW6EM3MjcJIvxvJSv0mODZj+07PlNASVJ987P P1wIMxQhz3Ajc5MswiQVSo8NWhnze+GgJiqSqE/6Xv/3Qi3YxAY3MjfJQkyiUHps0OfXCEUkZRbN ue/5csqv24HEAjcyN8kC7CezlB4bFOLGpHFjqEh65l0KfXKyAHrnc9zIAIn+soM2kszHM242qjzN 32CexhmhztM+aS1PM5nkc0wyUpWnRRvM0yJ3q/O0Va3laSaTzMMkG1V5WpjBPC3SQ52nLWgtTzOZ 5DNM8q8qT+tnME/rUa3O09a3lqeZTPIpkKQNVuVpkQbztO4X1HnaitbyNJNJ5mKSpao8bYDBPK17 b3We9nVreZrJJJ9gkr9UeVofg3laN84fS76+E4XnfVrL00wm+RhPVUar8rRyg3lahE3guKStl/C8 T2t5mskkczDJNFWeVmgwT+ty9NritDUxQHK8tTzNZJLZmOSMKk+rNJinhc9yq+CE4ajgSmt5mskk s/Ciw0WqqCDXYFQQUjPtgHVvmL0N+aG1qMBkkpmY5JYqKkgzGBUEcxMfOUTAaB+yq7WowGSSj3Ae FKOKCsYajAoCX0/8+Z9tcKMn5EhrUYHJJB9ikg9VUUG2waggQBH97M3aUiBRtBYVmEwyA/dOliqO vWUwKgj9dFfWX/UKIMnWiwpQaugMGxb2bbuVmLEbPo60sc03v6bj5dLHm7h4JaRzAVZFmSDSyEUd aMsjBrfSxdwJ769r2z26jO+a4oy544kxM37AOyFVo7AqSkwPnGhDjOURhVvpYh4yAjPzmAmYmWdV mCKDmI2vsTWnAmYyJeZ9fKuxbZ2e+agA+q/NmFMAM9tqx3wQo3CuwKoo13Z7HlLdP/ZIIe996mAe JFf6tM2aj0FjtnGYma/wTkiV0ODkhYLZDesCzCTSS3UwzxuBmdPOBMwcexVmjWHMwNXkPXiEOZwS 05hOz+neZFSnV+EF/cnRb+/0bhlm7PScyGijrIkxc/pGv73Tg/5RW/O/d3ruABMwc4dGv73TOT+B rpcGO93/Np4ZfMsN74zPcccZccObHNl/UX461ekUvqlNPbLnqIZM9w3krW+dW/J4tWT2Wwgzj7NB lRGE5DBkU0COlk5XDY6WCs+HqmuP+3fkaGkKYY7NTCMJyXMmpenthN0IctKUktAc4YQID4Z0ZXcG WeMuo/qw8dNxoB+HE5Vkv5o5sCnHJGFZAT83QCj+GtYDnKQiufUgZsDppXCNCxmHG5mbRIhJMmev v3txCrKJA6wHoAr24n4YdvbkowYY0UIm40bmJinDJJOyr9tceohILGE9ANWt+sbffYbunLEck0hw I3OTjMMkK4VhHh+gNDaoN6wHoOqdxvvH1vSw+QaTrMGNzE0iwCQ/RRXFTPsUkXSDeSaqJR2NLxq3 7Tpqh0mW4kbmJinFJM3lt0duh96Jh3kmqt5R0EvYU488gnEmZBNuZG6SEvzJP7ee/pN2FiOSnjDP RDVBp2hX4HCgwc8XSL7AjcxNUoxJ4sTrlt84iEhSYZ6JaoJO0b4kQeDYAZPswI3MTUJgkpJeV7// sw8i6Q/zTFQTdAr7rQFnq71hjA3ZgBuZm6QIk3wyvqTJdRkiGQbzTFS3GxVOnL0hDc4VQLIXNzI3 CR+TfNt71Rv3DogkGeaZqKY7FC5buYeXhc8Fkm9wI3OTFGKSSxm32jdC71TDPBNl77jTdoRPWIF7 5wZuZG4SHg4XmB5+4YrNiEQE80xUt6UVnjUxx4p3YJv8hhuZm6QAk3TJXDv0vh0ikcM8E6VNOtF+ 8Vm8EY8n93Ajc5OMxUHevAHu8h0hsOAG1gNQTvhbe9stkbHq8YIb3MjcJGMwyR7bzPqd6NwJLIH1 AJS36pmBVsPnnYPxJPhX3MjcJKMxSVPAos2jDyGSJbAegGpki3vDjAvde40LvWOJG+lWevjZUGSu eU8+V0DGvW2+Jz8Kpw7j2WQk50sqoQwqo7JwWIsA/aPJ5QPaYW/Y0rYAZqweZBzgSDzZsnGQEnCp QUCuVwfVUln/dnqA5ujLEbgvra9fOh3hi860elgPQBXNcF0CbT50lMLoE9oeNzK3V+Vjkh6bXB91 m4dIFsB6AMoFqo7rZtz0GwX+HUrHjcxNkodJ8m8ucx3zGJGsg/UAlMtC7QOa5zUXw7RvqDNuZG6S XEwi33w2uqAUkayA9QCUo49Nxrlrr5fD6BPKxo3MTTIcu+yfNTPPXemHSHrAegDKm3xugyvWnovH Ocly3MjcJDn42jBH6bHBfOSLRyyorg2d50zq+/QgrAgKPYEbmZskG5PsUHpscB7M/FdQkfgd+b79 37/cB5IDuJG5SbIwyWWlxwaXwcw/1S0TRYDthz2t0mBKJ/QcbmRukkw8u8RSemxwAcz8U2XRisDB h9tZ5C0CkqO4kblJhmGblKk89jHM/FONJwrfSQMbnMfCVSq0ADcyN0kGtkm4Mk8LbDaUpymCJj6d 6CGHWdaQke8kT0vHJFmqPI1mME8L3v2/+siXt4Ck/J3kaUMxyXvKPC3wqcE8LeQZc3y41YdAUvhO 8rQhmGS1Kk+zNpinhfU+uSSpDpNUvpM8LQ2THFHmaYGvDeZp4VWOZbGfhOB5n3eSpw3GJI9UeZqD wTyty+7fPx/OjsHzPu8kTxuEJwi9VHmapcE8reszX2KoyyE87/NO8rRUTMJV5Wm9DeZp3Xx/m78n HffOmneSp6VgklJVnhZhME/r3u1jTv6mIiBZ8k7ytIGYZK4qT4s3mKd1PykbeHMcHk82vZM8LRmT PFBFBf4Go4LI4Xs7/cvvAqP9J+8kKhiAsw8PVVTgbjAqiHzyu+XEUnwt/uCdRAVJmCReFRWEG4wK OAsOeDGD3geShe8kKkjEJAJVVOBrMCqIir7BmNolDUhmv5OoIAH7yQlVVLDdYFTQ45j/WXY3HFH7 6kUFHzjRcO3LfC8pnyckcgWy0hFicbl/kUBaIeRVDyaqMySEVEoUTcLN8t53aXlHbtFJWZE2W1zJ LyWkXjzhRF61dLhAKigUEm7lY2VElSxZQAiLVOVv0wRSmZzu6GoN79RYSwWTiI5VdgJRskQsklHW H9WApagg4cviBuIbdG+QzdgzODT/cnGllMgtJQihshyt6lDipRk8qXSiWFLkAHV3oaaunZQvEQuF Kcq/w12khBBqaKLdnKSlPEmFCB26i1RWLSSykESZE1AnioViiQPIyZXwKrx4IpkgXijgSbOrKwin 8kqhTADlhQc5lPOqEpEMaTBplKxS8cQsLF4gFjnwKmXiLHTwLoU8flkJLvzr07KJVdgWIhWExElW KuCXAYgb+QJ+MxQdZKaAX5oNQEJBRaGYJyny4otFUFoYHb5ARvgXEcU8hANNksWScp5M7u1ClBcS RcnI1lK3EomgKFkgA2yHUlm5ENr14vH5SJOgEB2DrDq1vEJIlKsK8bogu6gq/KLNVKSqyqkYSgZD 3VEPbHfl+24IBEw1hBBVBhaJK9FrCJJfpnzbCRf5RSJH2GKny/Pi85D7xEsTBLJyXgX5Yn5ncQVv fCWRoLaKtYhXTriQXQUq7YoFQhkhkTohmaKiIeIiwkkm4YmkxehgXbCM3gPRMdrwhBWlPJuJgiJZ qXU5T1pmN4H0z25aB5shEVcQEpmAkJL6R9iWElBAWU6vYkxSE+ept/IdVFsMOjpnmTR01sK5a2kr AmML6ZZ2RdWIWMCHIjTWIrGIoDPrYIUInkmhs2s5NDula0KJaLHEroyQiASiEi8hIUPHlQUlpUUl TujICQm4FFg9SyaukNrKeJISQtauUiJEBycoEbkIiWLZEPSiQGQnJHhFaDfrQjE66yRwBOQbtgIZ asu3LkZdI/d1KxSK+WXQhyKZbSEufW0rwM8sbfBb5P1OaxrNEv5ZgwLMDQdjEy8R8ITMDvippU85 r4zwxUcg9RUXF6P3KwRVhNBSXhab4RufljpwaD+/tAHJ2X79Y5PTh2b7JscnDujnh2X4+WaljkBP ekT5+Samp6Vn9vPz744ffr5pA7KzB2RmZcQnpg4d2M8PvTJ4QOZQ5XZ/HaWx3UB0/9huGf1pdFwZ lcaggaXRL3QMXgKRVMYT8YmekTExPWlwWLWO7EQaOknRQFDFSbIlN8KRC0gr4BydQCCHGEeerZ2w nmyVb9HYfBpLVs3gMQoZfEYRS1bF4k6YjSuGMsETkFIWt3DVYihlSGPLnWhuuGx4enGxlJDVerph fySfuUDxcHKzE2wOgeGjQiggJD54n5bnXhKiqOWZE3pG7uaDpbW8g/VjBvwP/YU/cl9kDsAqqCmG h5qvhVy5nyVqFHcuds+ePd/jp7UJLG4YvtXfwAxgWqAr7FhyolG75DI62TN4EhmeSspRfXzJAw/M L+laU6Vc9/OGCtsoSy1laFRyDbrSQFbKNlw/Ueey2Bsui8H/0Mn9PfMMlraJO7xBefc77k0OxZQp 15dc7NBGUKyR1hpojbpqEQ2DQsGfkPa5uLgU13c/Fkld4xG/xVVv6a6Y/avHpZr/3fmEqmrRW6rd csBYkRvDwcYsRXwHKmPh+e8baoQz+gjWLEVCf9iT1sZSbufy0St8w/WzPDr/m53U1V2/cyOB1wed 1xYWKIeK/9uCtDl6Ne62ch+lzX6Dvl0PSxuwJ1jY4/pZ4yaF5sSMwcBOJNVbSrlh0gmGi1KpSPWL UmFU/zJw3z06qM+Org8+YcNRre97hissdddApWuj4qU2DW9B9XMFT8oyGbULuT9CfQSWyVWi3nVz XBpwQHWXwW2KaoESHfdqhSaqMfWzWmCoetgbm30MYrmlLpSvLuV2GY8/CvUy06265orB+7SxlNtg 8P31rZRya9UV+505ixcTaYKy4p5ruaIiGmOu1wCGqf8L70/hdD6FgTsYGBC1S7k1yeGlVuqjtd6/ fcn9W0fl7AAD5WvbVhO1TWdN5Cww6maTUXuR++ucNc/dOHePjX2tQo1QwHuW2meNCtWoUm6tumK/ pqlvcBmY+Gv40JUsoZtzFh1ZoCrlhq2WpbE8TgvlP9Tg9QYEjoUc+4cicWXs/qZFf+mPz0yoDXv5 0c4Bq/QmAf5D8V0d5XyqCxSpnGnx1nK7keOG9VzOEKKNp2Ju+NaTVG04c6Nmfn4qWaPcbuLSvR4J vf5FG5c2Ed+uDkUb9Rd/+dx/iqm2jHzxMufnc7VIzja3im7ZVyjK7cYtcFx3ftUzMOm1+9N3Trmm W/Iu8dvO0jHX6W0rt8vJLzs7clKUEeV2SbPf+OiPO8FLkLIG64/RoVOWgr27yutV0iO4KF/tSvUV DwmPM+a8/qK6bcVrI5t/Qq1XmVJulySeX4McsB5pvbmi4H5aJSXx1ZX7JhzaDhVhm7tSfcVDYgw0 2NY2Ys6PKcO/ufiLKeV2MXHUuDfPL/qdRFrD7n1aKtlCSfx0bfPyb7oC8SXOlafjs/SIgyGOXtq2 cruRSzwh6Daq3C7pttfmiRbOyUDG/ZLpPk+2jzJM/B6OYiug/nMneFGso9bc1zQ+za0Cvl1JlFVB EEXMTsonMgkhKpGVWnkQODfPwK+68CQSXjXO8B2dO7i6e3q7CaRJMGkiriaKAuzg23oExcUdo/D3 LaVhCV4wpZEu5QuEQp6MsOZVCaRepI4k8UTRYKK6E7RNVbdX0uRUoLdcKlDuEIn12aEsrVQsyVP+ zZd3tCsfOw6+waiz9lzT2Ei8Vw+8l9zVBj/BvyM155GY3gz0n8G0hvOOPPHkU+hoKwx/2wOL6zxi zNniVVV0tj+tSo6G9k+XPjqTObUHK6759c/X994cwwxpucilM61YigqmCH9ThsJ5L1R7/92SBmlW O6YF257tqNkrnTIkAmk5fKsR/gamt365RZ0TTTWfpvrmJYE0m3yBKKqtqrOqY9e1l3es61BnX+co d61zrnPVPFQIklxZ3FTnh7nNZ9Dg2Wvy/LwgTy+SzwHxBbAjNPlcklGaXqRiazwxqnbJlI3gPueW rH9aXc3VzNu6gnB7/XLllo4g3BEJD2L7aQqv86asXK4n06F1mQGmyHREMjN+uOuUvQ7JXP3lqHsV J0iZTkhmCDtIX+bNI9O2TDkNqeCtx7OWb/Zo0pMJhvXbMj6y/QuWoufftjUFJ7aQhnVGMsO0DUvK PDv72N8jT8HX2dzbl8G5yfbVk+mMZK4K6n0zORN1Fjdge7rdH6RMFySzCztMX+YTSfvPvH3q0da1 9wQTvJlaMmulNAep8nyWu8o72khLeRVEHyeBNIEnFIrFolgnWamkUipDZ5wtPltFLrgJPoV8tc4a O5gJYEeoC33TVZW+c5FOZAx14Kj5/UPZWDohkVIV/56rifoBg4YJEnPt8J/EXDdy/BkiloklLuXw OzEXcfrgzTTxRJg6LhfIyOc5FRXK52RTPKR5kZtKA7iRMrCQ2klvO3UYaEgOZr1pJqeSWVOUG0xv 9C+QznTTrx9uWQMd5Yk6qie7u2Ylca9MYoJYWCkjVCeWflVxTUtEgyNQqbZD/5BqTxbXaU9OL4dQ qGzsRlyMTmORPuKOVEeye6IR64V/QD9//w7IR7iQWVjO3rPlmH8UfHBs6x82v32WbaQ63fLjpDoP pC4K1LUUIsfq9AuRG6POXb+EuKa6SM1i4lidfjFxbXVoYA800I/BdKaXfvFtsh+9kbr+7BjN2tak Or0y3HpHF2jg6JA6bxaX22vc9QunvcCY9kediYfk0XVE6vqw+4O6xa92/zpktEpdzMrLV/rMBVex fe+9c5d8nhupTrdeN6muE1IXS6rTPjq9yt3GqOuoX3NbU10fzerbpDq96tvGuIoHioLWT+1Z2m8U UuexR7b1sw801UWBuo92vfTs0FWlLvCHVRu6T/8WbVmWBA/2P3fGGHU++oWnSXUoZ2QnsLlaYzOX sgS1kep0C0iT6jojdUlU6vRKSWuqC2QyGUxHNKj5M90Z5IfTUGgJn1CDErEsrsMm1r52P9Uz2KEo zlHdP2PKuS2hjpyLAp8WEzAupS8cMmeupdyqxQaZWlDu2jawnY13YGhBtSOhAgxAzR/8XfnxAgSF J671adQWYrpbL/lz+kklDWkiCpoWE9kewjswjOgRP/0i1GSP+CN1Kexkih7RLUdNN06dbjFpUl0A UjeISp1eWWlKBwihsPWBNjpAqIYJGC+hP6cqTU7aIJvC5Gob2DbgHSgdINQAVKsOEKphIWYM9KdC SUOaiIKmxUS2t/AOxjhAoH5BarJHgpC6oew0ih7x/A8OEKhfWJpUF4zUZVCp0ysxTaeydVcKW+9t owOEaZhA2wFIGwynMLlnqw7AIqEiDEC16gBhGhbSdgDSRBQ0LSYywQHy9MsIkD2Sj9TJo9jySP0+ 0SspQDdOoW5BAFLhCFDYk0qhfnEAbSdwZjCdkb0LKew9vY1OwNMwQ7v20KdblWZX2SFJ3/AtdrAf E3zkq4PnGVRYfANYrboBT8NK7VKgV+8reVRm0ufRMJP9+8xj0h+qjHGEkfqlBch+GQUK+7DlMXr9 ol9mgG6cQt0iAaTC0aAwllKhXsEASkcoobD4lDY6QqGGGdp1AUeoVxpeZYdkPcNr2MFeBI5wktIR Sg1gteoIhRpWalcKjtCk5FGZiYKnxUz2s8ERKoxxhDH65QbIfhkLCrlseX/9ftErPUA3TqFu4QBS YQEoTKBUqFdEgNIRhBQWr2qjI/A1zKDtCCo7pOgbvsUOrTlCuQGsVh2Br2ElbUdQmYmCp8VMFI6A p2cs4Yuum/7+ob8PSxHmgO+ukMZHP2wmu4Pe9EzczswlKaPOw5zHAXJ6W2/Kx0Lv66svklNT6C22 JZuuL1P3G6yn6smktS6TaYpM+BD05Z93nX71CMkc49B4Op1DymQgmVZsS/2pqfPZ/lPWrQCZzTvH IzvoywR7Hmx8r2hER5Yi5OF1+p72j0h7MpFMNoU9Gz+HOwkVYM+bL8fVPL+oL5PJ4maxXvyxb8Ih liJ0oaNo4ZwsUiYLyWzPZuvLvN8ZOkmBti5I29XyN2r1UQ/lxFcH9bcq01Vfq5wIE1+WlBNfdV2o vmGZq33eIW9mIdeWd4aFIeTKEPkUOl05Ed2bFfey4atVlrkz4NRrbH71s6//xS2sxoXHdxMZSU90 PV7uyOKG0PDSGBa30z18Z5I8bjnMcdb2ZNdG6bl8HFmgB7rogYXedzn1gEkQSzmbHQuFFsOmd316 Ex0719W+9PHcYqSTzuzEanzeOdr2zr0IyLWnDCn5LjBfefCKwCt/b7Hk+0Cuvb55J3Mm/pIP66sz ZWH/srRFrw2bzoGPXYLo8+/7fUwl2nV/SM5lteh99NXiDr+A6PqJgfmrbhsUvSKcGBBVCKJ9HOz7 xSygEL3Yu3yHPFQtevO4/ce9r4Ho9uzNX11y0xT9tskkuYv+UhRyNkkOc3O1XHZtH811KXh01l+X YsyUi9ydxXXusll5cxyv08hRdrsrqIxFWtFRPvuC9SpnRooqJrV6oxp5yUUbGcaq1F3FolTpBir7 Y5UtS1rIqFRvSYtRKl31V6PoqIzVXJpCXvb0lqZoqXzLBK/cQ38th7IvYa6uNoVdm6C5WkI5Oai7 sMOYS7u8I4vLHQDVtofrGhZmlWuTkFZQ6eX1vP52jHqCEFddo7Vi2Leo1F0GolTpBSqTlSq1j1Jv TYhRKj31l3PoqEzSXNtBqtRb22GU+7ihoeDHs/jTzor4+1RH2R9Uss/1/XNDO3X4jD81PQJUhukd pXqUqU1Gss+ABdEVUBH/mKwXBMOM3Eu9CAmEW5StnbGfox5nskHkThBOqM5Arp9ygYi28B/IVT6t C4+2ePJgt1o4/mq7b9oi/Du18L8MCveM3VTXyVIt3FslnHZGTzi+Asv9keDnF+wLh5xmKRLd4crX SWlumFWvTWPXDtePQJbAfX58r/rqEXFyxsf6kZK8k2q1xlT1ag0yBJH7gNyh7NpB+nJh7cYXFhpr N/Tler9VbppJcn1YXM7492PWDwlAcjd281y5b6JSLkyX1mYg0frRyKX+x8OyUkHulafUURPYl+OS lXBzLwpxEk7yN+aX/6m0L0x81mZS2bdx+ynYAez7EK9CUOjL7cziRjlyT6d3r0Jyn6NOmPNGKdcP 5GYj0fpyH8CKk3ZwU/NONax1mUoVPdUOV69YoKuWLOyB8Akdi+H4SWf5gnb8JGfQ3GSERMITiOAD C24tn5UYqLGdgD9QYlci4U0QyKo1Plvhodq3lCjX3DkTxfKTYeEFHdDRv8mJAsv2B5yzLeK5Fhb/ ByKO5/c= End>LTZ487.sb< Start>LTZ946.sb< LDScrollBars.Add(GraphicsWindow.Width 8000) GraphicsWindow.BackgroundColor="teal GraphicsWindow.PenWidth=0 GraphicsWindow.BrushColor="white For rw=1 To 330 For t=0 To 1 For f=1 To 4 rr[rw][f]=Shapes.AddRectangle(3 25) Shapes.Move(rr[rw][f] 200+f*25+t*82+LDMath.Sin(rw*4.5)*20 10+rw*24) If Math.Remainder(rw 2)=0 Then If Text.IsSubText(text.GetSubText("32" t+1 1) f) Then Shapes.HideShape( rr[rw][f]) EndIf EndIf EndFor EndFor EndFor args=0 arrz=LDText.Split("↑ ↙ ↘ ← →" " ") ldcall.Function2("splmm" 80 7500) ldcall.Function2("sparw" 1 7000) ldcall.Function2("splmm" 60 6500) ldcall.Function2("splmm" 50 5500) ldcall.Function2("spmmn" 40 5000) ldcall.Function2("splmm" 90 4500) ldcall.Function2("spelm" 90 4000) ldcall.Function2("sparw" 5 500) ldcall.Function2("splmm" " " 10) Sub splmm ee=Shapes.AddEllipse(70 70) LDEffect.DropShadow(ee "darkblue") LDShapes.PenWidth(ee 8) LDShapes.PenColour(ee "red") LDShapes.BrushColour(ee "white") LDShapes.Move(ee 400 args[2]) GraphicsWindow.BrushColor="black sp=Shapes.AddText(args[1]) LDShapes.Font(sp "Geometr706 BlkCn BT" 40 "TRUE" "false") LDShapes.Centre(sp 435 args[2]+35) EndSub Sub sparw ee=Shapes.AddEllipse(70 70) LDEffect.DropShadow(ee "darkblue") LDShapes.PenWidth(ee 0) LDShapes.BrushColour(ee "blue") LDShapes.Move(ee 400 args[2]) GraphicsWindow.BrushColor="white sp=Shapes.AddText(arrz[args[1]]) LDShapes.Font(sp "calibri" 50 "TRUE" "false") LDShapes.Centre(sp 435 args[2]+35) EndSub Sub spelm ee=Shapes.AddEllipse(70 70) LDEffect.DropShadow(ee "darkblue") LDShapes.PenWidth(ee 0) LDShapes.BrushColour(ee "white") LDShapes.Move(ee 400 args[2]) ll=Shapes.AddLine(0 0 0 70) LDShapes.PenWidth(ll 9) LDShapes.penColour(ll "gray") Shapes.Move(ll 435 args[2]) Shapes.Rotate(ll 45) GraphicsWindow.BrushColor="black sp=Shapes.AddText(args[1]) LDShapes.Font(sp "Geometr706 BlkCn BT" 40 "TRUE" "false") LDShapes.Centre(sp 435 args[2]+35) EndSub Sub spmmn ee=Shapes.AddEllipse(70 70) LDEffect.DropShadow(ee "darkblue") LDShapes.PenWidth(ee 0) LDShapes.BrushColour(ee "blue") LDShapes.Move(ee 400 args[2]) GraphicsWindow.BrushColor="white sp=Shapes.AddText(args[1]) LDShapes.Font(sp "Geometr706 BlkCn BT" 40 "TRUE" "false") LDShapes.Centre(sp 435 args[2]+35) EndSub x=7500 GraphicsWindow.MouseDown=mmd GraphicsWindow.MouseMove=mmd GraphicsWindow.MouseUp=mmu Sub mmd If Mouse.IsLeftButtonDown Then spp=spp+.05 If spp>15 Then spp=15 EndIf EndIf GraphicsWindow.Title="Speed km/h: "+(math.floor(spp*7)+30) EndSub Sub mmu spp=0 EndSub While x>0 ' LDScrollBars.VerticalScroll=x LDGraphicsWindow.Reposition( 1 1, -LDMath.Sin(x/15)*200, -x LDMath.Sin(x/15)*3) Program.Delay(23) x=x-(5+spp) 'GraphicsWindow.Title=x EndWhile End>LTZ946.sb< Start>LVF292.sb< ' Challenge of the month Feb 2013 Shape of butterfly 2013/02/04 By NaochanON GUI() move() Sub move X1= 100+Math.GetRandomNumber(500) Y1= 100+Math.GetRandomNumber(100) For i=1 to NMAX shapes.Animate(shape[i],shapes.GetLeft(shape[i])+(X1-x0),shapes.GetTop(shape[i])+ (Y1-Y0),3000) endfor EndSub Sub GUI GraphicsWindow.BackgroundColor="#FFFFF0" GraphicsWindow.Hide() '--------------------------------- Left wing ------------------------------------------------------------------------- GraphicsWindow.BrushColor="#0000CD" 'Navy" '#1E90FF" ' 1E90FF 4682B4 #4682B4 GraphicsWindow.PenColor="#0000CD" GraphicsWindow.Width=900 GraphicsWindow.Height=600 shape[1]=Shapes.AddEllipse(20,140) Shapes.Move(shape[1],15,0) shapes.Rotate(shape[1],-20) shape[2]=Shapes.AddTriangle(0,0,60,0,52,140) shape[3]=Shapes.AddTriangle(60,0,132,60,52,140) shape[4]=Shapes.AddTriangle(132,60,52,140,180,140) shape[5]=Shapes.AddTriangle(180,140,92,140,148,212) shape[6]=Shapes.AddTriangle(92,140,60,172,148,212) shape[7]=Shapes.AddTriangle(60,172,128,292,148,212) shape[8]=Shapes.AddTriangle(60,172,68,252,128,292) shape[9]=Shapes.AddEllipse(16,80) Shapes.Move(shape[9],68,252) shapes.Rotate(shape[9],30) '---------------------------------------------------------------------------------------------------------- GraphicsWindow.BrushColor="Red" GraphicsWindow.PenColor="Red" shape[10]=Shapes.AddLine(164,12,180,72) shape[13]=Shapes.AddEllipse(8,8) Shapes.Move(shape[13],172,68) '---------------------------------------------------------------------------------------------------------- GraphicsWindow.BrushColor="Yellow" GraphicsWindow.PenColor="Yellow" shape[14]=Shapes.AddEllipse(16,16) Shapes.Move(shape[14],20,4) shape[15]=Shapes.AddEllipse(24,24) Shapes.Move(shape[15],24,28) shape[16]=Shapes.AddEllipse(24,24) Shapes.Move(shape[16],36,68) shape[17]=Shapes.AddEllipse(16,16) Shapes.Move(shape[17],56,104) shape[18]= Shapes.AddEllipse(8,8) Shapes.Move(shape[18],80,120) shape[19]=Shapes.AddRectangle(8,8) Shapes.Move(shape[19],72,174) shapes.Rotate(shape[19],45) shape[20]=Shapes.AddRectangle(16,16) Shapes.Move(shape[20],80,208) shapes.Rotate(shape[20],45) shape[21]= Shapes.AddRectangle(16,16) Shapes.Move(shape[21],96,240) shapes.Rotate(shape[21],45) shape[22]= Shapes.AddRectangle(10,10) Shapes.Move(shape[22],118,268) shapes.Rotate(shape[22],45) shape[27]= Shapes.AddEllipse(12,12) Shapes.Move(shape[27],72,284) '---------------------------------------------------------------------------------------------------------- GraphicsWindow.BrushColor="Khaki" GraphicsWindow.PenColor="Khaki" shape[23]= Shapes.AddEllipse(12,80) Shapes.Move(shape[23],105,42) shapes.Rotate(shape[23],-50) shape[24]= Shapes.AddEllipse(8,60) Shapes.Move(shape[24],110,80) shapes.Rotate(shape[24],-74) shape[25]= Shapes.AddEllipse(8,48) Shapes.Move(shape[25],128,128) shapes.Rotate(shape[25],66) shape[26]= Shapes.AddEllipse(8,60) Shapes.Move(shape[26],144,148) shapes.Rotate(shape[26],33) '--------------------------------- Right wing --------------------------------------------------------------- GraphicsWindow.BrushColor="#0000CD" 'Navy" '#1E90FF" ' 1E90FF 4682B4 #4682B4 GraphicsWindow.PenColor="#0000CD" GraphicsWindow.Width=1000 GraphicsWindow.Height=700 shape[31]=Shapes.AddEllipse(20,140) Shapes.Move(shape[31],368-15-20,0) shapes.Rotate(shape[31],20) shape[32]=Shapes.AddTriangle(368,0,368-60,0,368-52,140) shape[33]=Shapes.AddTriangle(368-60,0,368-132,60,368-52,140) shape[34]=Shapes.AddTriangle(368-132,60,368-52,140,368-180,140) shape[35]=Shapes.AddTriangle(368-180,140,368-92,140,368-148,212) shape[36]=Shapes.AddTriangle(368-92,140,368-60,172,368-148,212) shape[37]=Shapes.AddTriangle(368-60,172,368-128,292,368-148,212) shape[38]=Shapes.AddTriangle(368-60,172,368-68,252,368-128,292) shape[39]=Shapes.AddEllipse(16,80) Shapes.Move(shape[39],368-68-8,252) shapes.Rotate(shape[39],-30) '---------------------------------------------------------------------------------------------------------- GraphicsWindow.BrushColor="Red" GraphicsWindow.PenColor="Red" shape[40]=Shapes.AddLine(368-164,12,368-180,72) shape[43]=Shapes.AddEllipse(8,8) Shapes.Move(shape[43],368-172-8,68) '---------------------------------------------------------------------------------------------------------- GraphicsWindow.BrushColor="Yellow" GraphicsWindow.PenColor="Yellow" shape[44]=Shapes.AddEllipse(16,16) Shapes.Move(shape[44],368-20-16,4) shape[45]=Shapes.AddEllipse(24,24) Shapes.Move(shape[45],368-24-24,28) shape[46]=Shapes.AddEllipse(24,24) Shapes.Move(shape[46],368-36-24,68) shape[47]=Shapes.AddEllipse(16,16) Shapes.Move(shape[47],368-56-16,104) shape[48]= Shapes.AddEllipse(8,8) Shapes.Move(shape[48],368-80-8,120) shape[49]=Shapes.AddRectangle(8,8) Shapes.Move(shape[49],368-72-8,174) shapes.Rotate(shape[49],-45) shape[50]=Shapes.AddRectangle(16,16) Shapes.Move(shape[50],368-80-16,208) shapes.Rotate(shape[50],-45) shape[51]= Shapes.AddRectangle(16,16) Shapes.Move(shape[51],368-96-16,240) shapes.Rotate(shape[51],-45) shape[52]= Shapes.AddRectangle(10,10) Shapes.Move(shape[52],368-118-10,268) shapes.Rotate(shape[52],-45) shape[57]= Shapes.AddEllipse(12,12) Shapes.Move(shape[57],368-72-6,284) '---------------------------------------------------------------------------------------------------------- GraphicsWindow.BrushColor="Khaki" GraphicsWindow.PenColor="Khaki" shape[53]= Shapes.AddEllipse(12,80) Shapes.Move(shape[53],368-105-6,42) shapes.Rotate(shape[53],50) shape[54]= Shapes.AddEllipse(8,60) Shapes.Move(shape[54],368-110-4,80) shapes.Rotate(shape[54],74) shape[55]= Shapes.AddEllipse(8,48) Shapes.Move(shape[55],368-128-4,128) shapes.Rotate(shape[55],-66) shape[56]= Shapes.AddEllipse(8,60) Shapes.Move(shape[56],368-144-4,148) shapes.Rotate(shape[56],-33) '---------------------------------------------------------------------------------------------------------- GraphicsWindow.BrushColor="#9ACD32" ' FF8C00 9ACD32 CD853F GraphicsWindow.PenColor="Gray" shape[11]=Shapes.AddEllipse(24,80) Shapes.Move(shape[11],172,68) shape[12]=Shapes.AddEllipse(28,88) Shapes.Move(shape[12],172,136) '---------------------------------------------------------------------------------------------------------- X0= 100+Math.GetRandomNumber(500) Y0= 500+Math.GetRandomNumber(1000) NMAX=60 For i=1 to NMAX shapes.Move(shape[i],shapes.GetLeft(shape[i])+X0,shapes.GetTop(shape[i])+ Y0) endfor GraphicsWindow.Show() EndSub End>LVF292.sb< Start>LVF712.sb< ' A-HA experience By NaochanON GraphicsWindow.MouseDown=Check Controls.ButtonClicked=PlayAgain init() ' Initial View PlayAgain() ' Load picture & change color & count time While "True" Ptime() ' count time endwhile Sub PlayAgain sremove() ' remove message Url_Photo() ' Gets a photo from Flickr or User's file t0=clock.ElapsedMilliseconds Change_Color() ' change color in box size 100*60 dots EndSub Sub Change_Color Lmargin=Math.GetRandomNumber(10)*100 ' random position -X Tmargin=Math.GetRandomNumber(6)*100 ' random position -Y For J=1 To 60 Step 2 Ptime() For i=1 To 100 Step 2 CLR= GraphicsWindow.GetPixel(Lmargin+i,Tmargin+j) ' gets pixel -color NCLR=text.GetSubText(CLR,1,5)+"77" ' changes Blue code GraphicsWindow.SetPixel(Lmargin+i,Tmargin+j,NCLR) ' change its color EndFor EndFor EndSub Sub Ptime dtime=Math.Round((clock.ElapsedMilliseconds-t0)/1000) Shapes.SetText(stime,dtime+" sec") EndSub Sub sremove Shapes.Move(smsgOK,Math.GetRandomNumber(1000),-200) Shapes.Move(smsgNG,Math.GetRandomNumber(1000),-200) EndSub Sub check sremove() MX= GraphicsWindow.MouseX MY= GraphicsWindow.MouseY If Math.abs(MX-Lmargin)<100 And Math.abs(MY-Tmargin)<60 Then ' Hit Sound.PlayChime() Shapes.animate(smsgOK,MX,MY,500) PlayAgain() Else Shapes.animate(smsgNG,MX,MY,500) Sound.PlayClickAndWait() EndIf EndSub Sub init GW=1300 GH=700 GraphicsWindow.Left=20 GraphicsWindow.Top=10 GraphicsWindow.Width=GW GraphicsWindow.Height=GH GraphicsWindow.Show() GraphicsWindow.BrushColor="Yellow" GraphicsWindow.FontSize=24 smsgOK=shapes.AddText("Congratulation! You are right!") Shapes.Move(smsgOK,200,-200) smsgNG=shapes.AddText("Boooo! You are wrong!" ) Shapes.Move(smsgNG,200,-200) next= Controls.AddButton("Play Again",20,20) Controls.SetSize(next,150,50) stime=Shapes.AddText(" ") Shapes.Move(stime,50,100) EndSub Sub Url_Photo 'url="http://farm4.static.flickr.com/3152/2668377616_c14dc5a823.jpg" ' url= Flickr.GetRandomPicture("Flower") ' PX=ImageList.LoadImage(url) GraphicsWindow.DrawResizedImage(PX,0,0,GW,GH) GraphicsWindow.Title=url Endsub End>LVF712.sb< Start>LVG581.sb< Path= "http://imode.free.fr/images1942/" ' Game area controls gameWidth = 640 gameHeight = 480 fps = 50 bgs = 2 'backgroundspeed Player_Lives = 10 nbrisland = 5 'nomber of island images islandcount = 5 'nomber of island in the wall field ' Window title 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>LVG581.sb< Start>LVG886.sb< ' Truth Table 0.1 ' Copyright (c) 2013 Nonki Takahashi. All rights reserved. ' ' History: ' 0.1 2013-09-27 Created. Init() x0 = 10 y0 = 10 DrawNot() y0 = y0 + 10 + dy * 3 op = "And" DrawBinaryOp() y0 = y0 + 10 + dy * 5 op = "Or" DrawBinaryOp() y0 = y0 + 10 + dy * 5 op = "Xor" DrawBinaryOp() Sub Init GraphicsWindow.Title = "Truth Table 0.1" Not = "True=False;False=True;" Xor["True"] = "True=False;False=True;" Xor["False"] = "True=True;False=False;" dx = 80 dy = 20 ox = 10 oy = 2 GraphicsWindow.PenWidth = 1 GraphicsWindow.PenColor = "DimGray" GraphicsWindow.BrushColor = "Black" EndSub Sub DrawNot head = "1=p;2=Not p;" p = "1=True;2=False;" x1 = x0 + dx * 2 y1 = y0 + dy * 3 For i = 1 To 3 x = x0 + (i - 1) * dx GraphicsWindow.DrawLine(x, y0, x, y1) If i <= 2 Then GraphicsWindow.DrawText(x + ox, y0 + oy, head[i]) EndIf EndFor For i = 1 To 4 y = y0 + (i - 1) * dy GraphicsWindow.DrawLine(x0, y, x1, y) If i <= 2 Then GraphicsWindow.DrawText(x0 + ox, y + dy + oy, p[i]) GraphicsWindow.DrawText(x0 + dx + ox, y + dy + oy, Not[p[i]]) EndIf EndFor EndSub Sub DrawBinaryOp head = "1=p;2=q;3=p " + op + " q;" p = "1=True;2=True;3=False;4=False;" q = "1=True;2=False;3=True;4=False;" x1 = x0 + dx * 3 y1 = y0 + dy * 5 For i = 1 To 4 x = x0 + (i - 1) * dx GraphicsWindow.DrawLine(x, y0, x, y1) If i <= 3 Then GraphicsWindow.DrawText(x + ox, y0 + oy, head[i]) EndIf EndFor For i = 1 To 6 y = y0 + (i - 1) * dy GraphicsWindow.DrawLine(x0, y, x1, y) If i <= 4 Then GraphicsWindow.DrawText(x0 + ox, y + dy + oy, p[i]) GraphicsWindow.DrawText(x0 + dx + ox, y + dy + oy, q[i]) BinaryOp() GraphicsWindow.DrawText(x0 + 2 * dx + 10, y + dy + 1, r) EndIf EndFor EndSub Sub BinaryOp If op = "And" Then If p[i] And q[i] Then r = "True" Else r = "False" EndIf ElseIf op = "Or" Then If p[i] Or q[i] Then r = "True" Else r = "False" EndIf ElseIf op = "Xor" Then r = Xor[p[i]][q[i]] EndIf EndSub End>LVG886.sb< Start>LVK696.sb< args=0 LDUtilities.FixFlickr () GraphicsWindow.PenWidth =1 GraphicsWindow.BackgroundColor="darkblue GraphicsWindow.PenColor="cyan pall="Farnesina ii=imagelist.LoadImage (Flickr.GetRandomPicture (pall)) GraphicsWindow.Title=pall tx= Shapes.AddText ("Farnesina") LDShapes.Font (tx "vivaldi" 20 "false" "false") ldShapes.Centre (tx 180 160) While "true i=i+1.5 If Math.Remainder (i 180)=0 Then ii=imagelist.LoadImage (Flickr.GetRandomPicture (pall)) mo=mo+1 endif If Math.Remainder( mo 2)=0 then ff=math.Abs(LDMath.Sin (i))+.6 GraphicsWindow.PenWidth =math.Abs(LDMath.Sin (i))*9 Else ff=1 endif GraphicsWindow.PenColor=LDColours.HSLtoRGB (Math.Remainder (i 180) 1 .6) pldrw() If Math.Remainder( mo 2)=0 then ff=math.Abs(LDMath.Sin (i))+.6 GraphicsWindow.PenWidth =math.Abs(LDMath.Sin (i))*3 GraphicsWindow.PenColor="darkblue pldrw() endif GraphicsWindow.PenWidth =1 If Math.Remainder( mo 2)=1 then ff=math.Abs(LDMath.Sin (i))+.6 Else ff=1 endif LDShapes.penColour (tx GraphicsWindow.PenColor ) Shapes.Zoom (tx ff*5 3*ff) Program.Delay (25) If Math.Remainder( mo 2)=0 then GraphicsWindow.PenColor="darkblue ff=math.Abs(LDMath.Sin (i))+.6 GraphicsWindow.PenWidth =math.Abs(LDMath.Sin (i))*11 pldrw () else GraphicsWindow.DrawResizedImage (ii 0 0 GraphicsWindow.Width GraphicsWindow.Height) 'GraphicsWindow.BrushColor="darkblue 'GraphicsWindow.FillRectangle (0 0 330 230) endif endwhile Sub pldrw LDCall.Function2 ("vdrw" 35+45*ff 100) LDCall.Function2 ("idrw" 35+59*ff 100) LDCall.Function2 ("ldrw" 35+65*ff 100) LDCall.Function2 ("ldrw" 35+71*ff 100) LDCall.Function2 ("adrw" 35+80*ff 100) EndSub Sub ldrw LDCall.Function4("aline" args[1] args[2] 50*ff, -75) EndSub Sub lldrw oc= GraphicsWindow.PenColor GraphicsWindow.penColor=GraphicsWindow.BackgroundColor LDCall.Function4("aline" args[1] args[2] 40*ff, -75) GraphicsWindow.PenColor=oc LDCall.Function4("aline" mm[1] mm[2] 10*ff, -75) EndSub Sub odrw GraphicsWindow.DrawEllipse (args[1] args[2]-30*ff 28*ff 28*ff) EndSub Sub vdrw s115=args[1] s100=args[2] LDCall.Function4("aline" s115 s100 55*ff, -65) LDCall.Function4("aline" s115 s100 55*ff, -110) endsub Sub idrw s115=args[1] s100=args[2] LDCall.Function4("aline" s115 s100 30*ff, -75) endsub Sub adrw s115=args[1] s100=args[2] GraphicsWindow.DrawEllipse (s115 s100-30*ff 28*ff 28*ff) LDCall.Function4("aline" s115+22*ff s100 30*ff, -75) endsub Sub pdrw s115=args[1] s100=args[2] GraphicsWindow.DrawEllipse (s115 s100-30*ff 28*ff 28*ff) LDCall.Function4("aline" s115+8*ff s100-30*ff, 50*ff, 180-75) endsub Sub ddrw s115=args[1] s100=args[2] GraphicsWindow.DrawEllipse (s115 s100-30*ff 28*ff 28*ff) LDCall.Function4("aline" s115+22*ff s100 50*ff, -75) endsub Sub zdrw s115=args[1] s100=args[2] LDCall.Function4("aline" s115 s100 30*ff, -55) GraphicsWindow.DrawLine (mm[1] mm[2] mm[1]-13*ff mm[2]) GraphicsWindow.DrawLine (s115 s100 s115+15*ff s100) endsub Sub aline mm= LDMath.Convert2Cartesian (args[1] args[2] args[3] args[4]) GraphicsWindow.DrawLine (args[1] args[2] mm[1] mm[2]) EndSub End>LVK696.sb< Start>LVP196-0.sb< ' Dice Probability ' Versioin 0.2a ' Copyright © 2018 Nonki Takahashi. The MIT License. ' Program ID LVP196-0 title = "Dice Probability 0.2a" GraphicsWindow.Title = title Form() Controls.ButtonClicked = OnButtonClicked Timer.Tick = OnTick Timer.Interval = 1000 Timer.Pause() While "True" If buttonClicked Then nDice = Controls.GetTextBoxText(tboxDice) case = Controls.GetTextBoxText(tboxCase) Timer.Resume() t = Clock.ElapsedMilliseconds DrawGraph() t = Math.Floor((Clock.ElapsedMilliseconds - t) / 1000) Timer.Pause() GraphicsWindow.Title = title + " | " + t + "s" buttonClicked = "False" Else Program.Delay(200) EndIf EndWhile Sub Dec2Sen ' Decimal to senary conversion ' param dec - decimal ' param sen - senary Stack.PushValue("local", dec) sen = "" While 0 < dec rem = Math.Remainder(dec, 6) sen = Text.Append(rem, sen) dec = Math.Floor(dec / 6) EndWhile dec = Stack.PopValue("local") EndSub Sub DrawGraph ' param nDice score = "" emax = Math.Power(6, nDice) - 1 For each = 0 To emax dec = each Dec2Sen() s = 0 For d = 1 To nDice len = Text.GetLength(sen) If len < d Then s = s + 1 Else s = s + Text.GetSubText(sen, d, 1) + 1 EndIf EndFor score[s] = score[s] + 1 EndFor ParseCase() count = "" n = Array.GetItemCount(score) index = Array.GetAllIndices(score) max = 0 For i = 1 To n s = index[i] If max < score[s] Then max = score[s] EndIf If (op = "<=") And (s <= right) Then count[s] = "True" ElseIf (op = ">=") And (s >= right) Then count[s] = "True" ElseIf (op = "<>") And (s <> right) Then count[s] = "True" ElseIf (op = "<") And (s < right) Then count[s] = "True" ElseIf (op = ">") And (s > right) Then count[s] = "True" ElseIf (op = "=") And (s = right) Then count[s] = "True" EndIf EndFor w = Math.Floor(gw / (n + 1)) x1 = Math.Floor((gw - (n * (w + 1))) / 2) x2 = x1 + (n * (w + 1)) y1 = gh y2 = 40 i = 1 GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle(0, 36, gw , gh - 36) match = 0 For x = x1 To x2 Step w + 1 s = index[i] h = Math.Floor(score[s] * (y1 - y2) / max) y = y1 - h If count[s] Then GraphicsWindow.BrushColor = "Blue" match = match + score[s] Else GraphicsWindow.BrushColor = "Gray" EndIf GraphicsWindow.FillRectangle(x, y, w, h) i = i + 1 EndFor prob = Math.Floor(match / (emax + 1) * 1000) / 10 Shapes.SetText(txtProb, "P = " + prob + "%") EndSub Sub Form gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BrushColor = "LightGray" GraphicsWindow.FillRectangle(0, 0, gw, 36) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(10, 10, "Number of dice") tboxDice = Controls.AddTextBox(110, 7) Controls.SetSize(tboxDice, 50, 20) GraphicsWindow.DrawText(170, 10, "Case") tboxCase = Controls.AddTextBox(210, 7) Controls.AddButton("OK", 380, 5) txtProb = Shapes.AddText("P = 0%") Shapes.Move(txtProb, 520, 40) EndSub Sub OnButtonClicked buttonClicked = "True" EndSub Sub OnTick p = Math.Floor(each / emax * 1000) / 10 l = Math.Floor((Clock.ElapsedMilliseconds - t) / 1000) GraphicsWindow.Title = title + " | " + l + "s (" + p + "%)" EndSub Sub ParseCase ' param case ' return op - the operation ' return right - the number as the right operand If Text.IsSubText(case, "<=") Then op = "<=" ParseLeft() ParseRight() If right = "score" Then right = left op = ">=" left = "score" EndIf ElseIf Text.IsSubText(case, ">=") Then op = ">=" ParseLeft() ParseRight() If right = "score" Then right = left op = "<=" left = "score" EndIf ElseIf Text.IsSubText(case, "<>") Then op = "<>" ParseLeft() ParseRight() If right = "score" Then right = left left = "score" EndIf ElseIf Text.IsSubText(case, "<") Then op = "<" ParseLeft() ParseRight() If right = "score" Then right = left op = ">" left = "score" EndIf ElseIf Text.IsSubText(case, ">") Then op = ">" ParseLeft() ParseRight() If right = "score" Then right = left op = "<" left = "score" EndIf ElseIf Text.IsSubText(case, "=") Then op = "=" ParseLeft() ParseRight() If right = "score" Then right = left left = "score" EndIf EndIf EndSub Sub ParseLeft ' param case - the text to parse ' param op - the operator ' return pOp - the pointer to the operator ' return left - the left operand pOp = Text.GetIndexOf(case, op) txt = Text.GetSubText(case, 1, pOp - 1) Trim() left = txt EndSub Sub ParseRight ' param case - the text to parse ' param op - the operator ' param pOp - the pointer to the operator ' return right - the right operand txt = Text.GetSubTextToEnd(case, pOp + Text.GetLength(op)) Trim() right = txt EndSub Sub Trim ' param txt ' return txt While Text.StartsWith(txt, " ") txt = Text.GetSubTextToEnd(txt, 2) EndWhile While Text.EndsWith(txt, " ") txt = Text.GetSubText(txt, 1, Text.GetLength(txt) - 1) EndWhile EndSub End>LVP196-0.sb< Start>LVP196.sb< ' Dice Probability ' Versioin 0.1a ' Copyright © 2018 Nonki Takahashi. The MIT License. title = "Dice Probability" GraphicsWindow.Title = title Form() Controls.ButtonClicked = OnButtonClicked Timer.Tick = OnTick Timer.Interval = 1000 Timer.Pause() While "True" If buttonClicked Then nDice = Controls.GetTextBoxText(tboxDice) Timer.Resume() t = Clock.ElapsedMilliseconds DrawGraph() t = Math.Floor((Clock.ElapsedMilliseconds - t) / 1000) Timer.Pause() GraphicsWindow.Title = title + " | " + t + "s" buttonClicked = "False" Else Program.Delay(200) EndIf EndWhile Sub Dec2Sen ' Decimal to senary conversion ' param dec - decimal ' param sen - senary Stack.PushValue("local", dec) sen = "" While 0 < dec rem = Math.Remainder(dec, 6) sen = Text.Append(rem, sen) dec = Math.Floor(dec / 6) EndWhile dec = Stack.PopValue("local") EndSub Sub DrawGraph ' param nDice score = "" cmax = Math.Power(6, nDice) - 1 For case = 0 To cmax dec = case Dec2Sen() s = 0 For d = 1 To nDice len = Text.GetLength(sen) If len < d Then s = s + 1 Else s = s + Text.GetSubText(sen, d, 1) + 1 EndIf EndFor score[s] = score[s] + 1 EndFor n = Array.GetItemCount(score) index = Array.GetAllIndices(score) max = 0 For i = 1 To n s = index[i] If max < score[s] Then max = score[s] EndIf EndFor w = Math.Floor(gw / (n + 1)) x1 = Math.Floor((gw - (n * (w + 1))) / 2) x2 = x1 + (n * (w + 1)) y1 = gh y2 = 40 i = 1 GraphicsWindow.BrushColor = "White" GraphicsWindow.FillRectangle(0, 36, gw , gh - 36) GraphicsWindow.BrushColor = "Blue" For x = x1 To x2 Step w + 1 s = index[i] h = Math.Floor(score[s] * (y1 - y2) / max) y = y1 - h GraphicsWindow.FillRectangle(x, y, w, h) i = i + 1 EndFor EndSub Sub Form gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BrushColor = "LightGray" GraphicsWindow.FillRectangle(0, 0, gw, 36) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(10, 10, "Number of dice") tboxDice = Controls.AddTextBox(110, 7) Controls.SetSize(tboxDice, 50, 22) Controls.AddButton("OK", 170, 5) EndSub Sub OnButtonClicked buttonClicked = "True" EndSub Sub OnTick p = Math.Floor(case / cmax * 1000) / 10 l = Math.Floor((Clock.ElapsedMilliseconds - t) / 1000) GraphicsWindow.Title = title + " | " + l + "s (" + p + "%)" EndSub End>LVP196.sb< Start>LVP751.sb< GraphicsWindow.Show() GraphicsWindow.KeyDown=OnKeyDown GraphicsWindow.KeyUp=OnKeyUp Sub repaint GraphicsWindow.BrushColor="White" GraphicsWindow.FillRectangle(100,100,200,200) GraphicsWindow.FillRectangle(300,100,200,200) GraphicsWindow.PenColor="Red" GraphicsWindow.DrawLine(350,150,350+50*DeltaX1,150+50*DeltaY1) GraphicsWindow.DrawLine(150,150,150+50*DeltaX2,150+50*DeltaY2) EndSub Sub OnKeyUp LastKey=GraphicsWindow.LastKey If LastKey="Up" Then DeltaY1=0 EndIf If LastKey="Down" Then DeltaY1=0 EndIf If LastKey="Left" Then DeltaX1=0 EndIf If LastKey="Right" Then DeltaX1=0 EndIf If LastKey="W" Then DeltaY2=0 EndIf If LastKey="S" Then DeltaY2=0 EndIf If LastKey="A" Then DeltaX2=0 EndIf If LastKey="D" Then DeltaX2=0 EndIf repaint() EndSub Sub OnKeyDown LastKey=GraphicsWindow.LastKey If LastKey="Up" Then DeltaY1=-1 EndIf If LastKey="Down" Then DeltaY1=1 EndIf If LastKey="Left" Then DeltaX1=-1 EndIf If LastKey="Right" Then DeltaX1=1 EndIf If LastKey="W" Then DeltaY2=-1 EndIf If LastKey="S" Then DeltaY2=1 EndIf If LastKey="A" Then DeltaX2=-1 EndIf If LastKey="D" Then DeltaX2=1 EndIf repaint() EndSub End>LVP751.sb< Start>LVT573.sb< ' SmallBasic Version 1.2 ' Program: CalcTable ' Changelog: ' Author: Pappa Lapub ' Website: https://social.msdn.microsoft.com/Forums/en-US/1ec4f217-bec3-4c07-a4b3-c618caf15ed0/calc-table-problem ' ImportURL: http://smallbasic.com/program/? ' Extension: LitDev ' Comment: LDControls.AddDataView(w,h, arrTitles) h .. größer setzen, und später erst anpassen ' ' Variables: ' ToDo: ' ================================================================================ '' nCols (Spalten-) und nRows (Zeilenanzahl) VARIIERBAR !! nRows = 28 CreateData() 'arrCols = "1=Tablename;2=Names;" 'nCols = Array.GetItemCount(arrCols) nCols = 3 '' Spaltenanzahl For n = 1 To nCols 'arrCols[n] = "Heading"+n arrCols[Array.GetItemCount(arrCols)+1] = "Heading"+n EndFor gw = GraphicsWindow.Width gh = GraphicsWindow.Height dv = LDControls.AddDataView(200,gh, arrCols) GraphicsWindow.KeyDown = OnKeyDown 'UpdateDataView() UpdateRows() ' For n = 1 To nRows ' LDControls.DataViewSetRow(dv, n, "1="+data[n]) ' EndFor 'Controls.SetSize(dv, gw,gh) ' gw-10,gh-10 ' ////////// SUB \\\\\\\\\\ Sub CreateData For i = 1 To nRows str = Text.Append(str, Text.GetCharacter(64 + Math.GetRandomNumber(58))) data[i] = str EndFor EndSub Sub UpdateDataView For n = 1 To nRows 'row[1] = data[n] LDControls.DataViewSetRow(dv, n, "1="+data[n]) ' row) EndFor EndSub Sub UpdateRows For n = 1 To nRows For r = 1 To nCols row[r] = data[n] EndFor LDControls.DataViewSetRow(dv, n, row) EndFor EndSub ' ////////// EVENT \\\\\\\\\\ Sub OnKeyDown Program.End() EndSub End>LVT573.sb< Start>LVT578.sb< ' Sort 0.1 ' Copyright (c) 2013 Nonki Takahashi. All right reserved. ' ' History: ' 2013/02/04 Created. ' GraphicsWindow.Title = "Sort 0.1" GraphicsWindow.BackgroundColor = "LightGray" GraphicsWindow.BrushColor = "Black" CRLF = Text.GetCharacter(13) + Text.GetCharacter(10) InitArray() GetArrayToBuf() GraphicsWindow.DrawText(10, 10, "Original Array") original = Controls.AddMultiLineTextBox(10, 30) Controls.SetSize(original, 295, 355) Controls.SetTextBoxText(original, buf) GraphicsWindow.DrawText(315, 10, "Sorted Array") sorted = Controls.AddMultiLineTextBox(315, 30) Controls.SetSize(sorted, 295, 355) Controls.AddButton("Sort", 10, 400) Controls.ButtonClicked = OnButtonClicked Sub Compare ' param txt[i1] ' param txt[i2] ' returns eq ="True" if txt[i1] = txt[i2] ' returns gt = "True" if txt[i1] > txt[i2] ' returns lt = "True" if txt[i1] < txt[i2] eq = "False" gt = "False" lt = "False" txt1 = Text.ConvertToLowerCase(txt[i1]) txt2 = Text.ConvertToLowerCase(txt[i2]) len1 = Text.GetLength(txt1) len2 = Text.GetLength(txt2) len = Math.Min(len1, len2) For p = 1 To len c1 = Text.GetCharacterCode(Text.GetSubText(txt1, p, 1)) c2 = Text.GetCharacterCode(Text.GetSubText(txt2, p, 1)) If c1 > c2 Then gt = "True" p = len + 1 ' break ElseIf c1 < c2 Then lt = "True" p = len + 1 ' break Else c1 = Text.GetCharacterCode(Text.GetSubText(txt[i1], p, 1)) c2 = Text.GetCharacterCode(Text.GetSubText(txt[i2], p, 1)) If c1 > c2 Then gt = "True" p = len + 1 ' break ElseIf c1 < c2 Then lt = "True" p = len + 1 ' break EndIf EndIf EndFor If gt = "False" And lt = "False" Then If len1 > len2 Then gt = "True" ElseIf len1 < len2 Then lt = "True" Else eq = "True" EndIf EndIf EndSub Sub GetArrayFromTextBox txt = "" i = 0 buf = Controls.GetTextBoxText(original) While Text.GetLength(buf) > 0 p = Text.GetIndexOf(buf, CRLF) i = i + 1 If p = 0 Then txt[i] = Text.GetSubTextToEnd(buf, 1) buf = "" ElseIf p = 1 Then txt[i] = "" buf = Text.GetSubTextToEnd(buf, p + 2) Else txt[i] = Text.GetSubText(buf, 1, p - 1) buf = Text.GetSubTextToEnd(buf, p + 2) EndIf EndWhile EndSub Sub GetArrayToBuf buf = "" index = Array.GetAllIndices(txt) count = Array.GetItemCount(txt) For i = 1 To index[count] buf = buf + txt[i] + CRLF EndFor EndSub Sub GetSortedArrayToBuf buf = "" i = 0 While order[i] <> "" i = order[i] buf = buf + txt[i] + CRLF EndWhile EndSub Sub InitArray txt = "1=Z;2=t;3=q;4=aa;6=C;7=b;8=a;9=A;" EndSub Sub OnButtonClicked GetArrayFromTextBox() Sort() GetSortedArrayToBuf() Controls.SetTextBoxText(sorted, buf) EndSub Sub Sort ' param txt[] - array to sort ' param order[] - index list for sorted array order = "" index = Array.GetAllIndices(txt) count = Array.GetItemCount(txt) order[0] = 1 For i1 = 2 To index[count] i2 = 0 While order[i2] <> "" lasti2 = i2 i2 = order[i2] Compare() If lt Then ' insert order[lasti2] = i1 order[i1] = i2 i2 = -1 ' break EndIf EndWhile If i2 <> -1 Then ' append order[i2] = i1 EndIf EndFor EndSub End>LVT578.sb< Start>LVV705.sb< 'Images for this program can be downloaded from here: 'https://docs.google.com/open?id=0B4QdGY5z0AOfM2FmNjk3MGUtM2E4OC00OWJkLWJhZDAtODhhNzIxNzE5MTM2 'Initialise graphics window GraphicsWindow.Hide() gw = 1024 gh = 768 GraphicsWindow.CanResize = "False" GraphicsWindow.Top = (Desktop.Height-gh)/2 GraphicsWindow.Left = (Desktop.Width-gw)/2 GraphicsWindow.Title = "Carom Billiards" GraphicsWindow.Width = gw GraphicsWindow.Height = gh Path = Program.Directory background = ImageList.LoadImage( Path + "/hatter2.png") GraphicsWindow.DrawImage(background, 0, 0) 'GraphicsWindow.BackgroundColor="#008000" GraphicsWindow.Show() GraphicsWindow.KeyDown=onKeyDown GraphicsWindow.MouseDown=onMouseDown GraphicsWindow.MouseUp=onMouseUp GraphicsWindow.MouseMove=OnMouseMove mozgat=1 lokes=2 kiiras=3 dt=0.5 atmero=40 sugar=atmero/2 N=4 'labdaszám ' fmstate=0 ha hiba 'fmstate=3 ha érvényes a lökés, vagyis poén lett labda[1]=Shapes.AddImage(Path +"/afgolyo.png") labda[2]=Shapes.AddImage(Path +"/asgolyo.png") labda[3]=Shapes.AddImage(Path +"/apgolyo.png") labda[4]=Shapes.AddImage(Path +"/apgolyo.png") bf=112 jf=912 af=584 ff=184 balfal=bf+sugar jobbfal=jf-sugar alsofal=af-sugar felsofal=ff+sugar Kezd: startgame() While("True") If allapot=mozgat Then utkozes()' leadminisztrálja az esetleges ütközést ene=0 For i=1 To N x[i]=x[i]+vx[i]*dt 'kiszámolja a golyó x helyzetét y[i]=y[i]+vy[i]*dt 'kiszámolja a golyó y helyzetét visszapattan() 'ellenőrzi és kezeli a visszapattanást Shapes.Move(labda[i],x[i]-sugar,y[i]-sugar) 'súrlódás adminisztrálása v=Math.SquareRoot(vx[i]*vx[i]+vy[i]*vy[i]) If (v-epsilon)> 0 then vx[i]=(v-epsilon)*vx[i]/v vy[i]=(v-epsilon)*vy[i]/v else vx[i]=0 vy[i]=0 endif ene=ene+v*v endFor '*********************************************** ' GraphicsWindow.BrushColor="#008000" ' GraphicsWindow.FillRectangle(0,0,200,20) ' GraphicsWindow.BrushColor="Black" ' GraphicsWindow.DrawText(5,5,"fmstate: "+fmstate) '********************************************* energia=ene If energia=0 then allapot=kiiras EndIf Program.Delay(kesl) EndIf If allapot=kiiras Then GraphicsWindow.FontSize=20 GraphicsWindow.FontName="Arial" GraphicsWindow.FontBold="False" GraphicsWindow.BrushColor="#000050" GraphicsWindow.FillRectangle(362,650,300,60) GraphicsWindow.PenColor="#007F7F" GraphicsWindow.PenWidth=1 Shapes.AddLine(362,650,662,650) Shapes.AddLine(362,650,362,710) GraphicsWindow.PenColor="Black" Shapes.AddLine(362,710,662,710) Shapes.AddLine(662,650,662,710) GraphicsWindow.PenWidth=3 If fmstate=4 then If sargatert=1 then score=score+1000 GraphicsWindow.BrushColor="#FFFF00" GraphicsWindow.DrawText(400,655,"OK! Got +1000 points") Else score=score+5000 GraphicsWindow.BrushColor="#FFFF00" GraphicsWindow.DrawText(400,655,"Well done! Got +5000 points") endif GraphicsWindow.BrushColor="#00FFFF" GraphicsWindow.DrawText(420,685,"Score: "+score ) else score=score-1000 GraphicsWindow.BrushColor="#FF0000" GraphicsWindow.DrawText(420,655,"Foul! -1000 points") GraphicsWindow.BrushColor="#00FFFF" GraphicsWindow.DrawText(420,685,"Score: "+score ) endif allapot=lokes EndIf If allapot=lokes Then GraphicsWindow.PenWidth=3 dakohossz=Math.SquareRoot((xm-x[1])*(xm-x[1])+(ym-y[1])*(ym-y[1])) If dakohossz<100 Then dakox=xm-x[1] dakoy=ym-y[1] vonal=Shapes.AddLine(x[1],y[1],xm,ym) Else dakox=100*(xm-x[1])/dakohossz dakoy=100*(ym-y[1])/dakohossz vonal=Shapes.AddLine(x[1],y[1],x[1]+dakox,y[1]+dakoy) EndIf Program.Delay(50) Shapes.Remove(vonal) GraphicsWindow.PenWidth=1 EndIf EndWhile Sub StartGame GraphicsWindow.BrushColor="#FF0000" GraphicsWindow.PenWidth=1 fmstate=1 'szabályt követő véges állapotú gép kezdőállapotának beállítása ' fmstate<>4 ha hiba 'fmstate=4 ha érvényes a lökés epsilon=0.001 energia=0 sargatert=0 kesl=5 allapot=lokes score=0 GraphicsWindow.DrawRectangle(bf,ff,jf-bf,af-ff) x[1]=200 x[2]=300 x[3]=400 x[4]=500 y[1]=384 y[2]=384 y[3]=384 y[4]=384 For i=1 to N vx[i]=0 vy[i]=0 Shapes.Move(labda[i],x[i]-sugar,y[i]-sugar) EndFor infoscreen() szabaly() GraphicsWindow.FontSize=20 GraphicsWindow.FontName="Arial" GraphicsWindow.FontBold="False" GraphicsWindow.BrushColor="#000050" GraphicsWindow.FillRectangle(362,650,300,60) GraphicsWindow.PenColor="#007F7F" GraphicsWindow.PenWidth=1 Shapes.AddLine(362,650,662,650) Shapes.AddLine(362,650,362,710) GraphicsWindow.PenColor="Black" Shapes.AddLine(362,710,662,710) Shapes.AddLine(662,650,662,710) GraphicsWindow.BrushColor="#00FFFF" GraphicsWindow.DrawText(420,685,"Score: "+score ) GraphicsWindow.PenWidth=3 EndSub Sub OnKeyDown bill = GraphicsWindow.LastKey If bill="Up" Then If kesl>1 then kesl=kesl-1 endif infoscreen() EndIf If bill="Down" Then If kesl<5 then kesl=kesl+1 endif infoscreen() EndIf If bill="Left" Then If epsilon>0.001 then epsilon=epsilon-0.0001 endif infoscreen() EndIf If bill="Right" Then If epsilon<0.003 then epsilon=epsilon+0.0001 endif infoscreen() EndIf If bill="F1" Then epsilon=0.001 infoscreen() EndIf If bill="F2" Then epsilon=0.002 infoscreen() EndIf If bill="F3" Then epsilon=0.003 infoscreen() EndIf If bill="Back" Then Startgame() EndIf If bill="Escape" Then Program.End() EndIf EndSub Sub OnMouseMove xm = GraphicsWindow.MouseX ym = GraphicsWindow.MouseY EndSub Sub OnMouseDown if allapot=lokes then EndIf EndSub Sub OnMouseUp If allapot=lokes Then allapot=mozgat vx[1]=-dakox/25 vy[1]=-dakoy/25 'kiírás törlése GraphicsWindow.FontSize=20 GraphicsWindow.FontName="Arial" GraphicsWindow.FontBold="False" GraphicsWindow.BrushColor="#000050" GraphicsWindow.FillRectangle(362,650,300,60) GraphicsWindow.PenColor="#007F7F" GraphicsWindow.PenWidth=1 Shapes.AddLine(362,650,662,650) Shapes.AddLine(362,650,362,710) GraphicsWindow.PenColor="Black" Shapes.AddLine(362,710,662,710) Shapes.AddLine(662,650,662,710) GraphicsWindow.BrushColor="#00FFFF" GraphicsWindow.DrawText(420,685,"Score: "+score ) GraphicsWindow.PenWidth=3 fmstate=1 'végesautomata kezdőállásba sargatert=0 'a sarga érintését űjból állítjuk allapot=mozgat endif EndSub Sub visszapattan For i1=1 To N If x[i1]jobbfal Then x[i1]=2*jobbfal-x[i1] vx[i1]=-vx[i1] EndIf If y[i1]>alsofal Then y[i1]=2*alsofal-y[i1] vy[i1]=-vy[i1] EndIf If y[i1]LVV705.sb< Start>LVX011.sb< Ball_Diameter = 40 GraphicsWindow.Title = "Bouncing Balls" Run = 0 GraphicsWindow.MouseDown = MouseDown Controls.ButtonClicked = Init GraphicsWindow.BrushColor = "Black" GraphicsWindow.FontSize = 40 GraphicsWindow.DrawText(5,5,"Enter Initial amount of balls") GraphicsWindow.FontSize = 100 textbox = Controls.AddTextBox(40,100) Controls.SetSize(textbox, GraphicsWindow.Width - 80,130) button = Controls.AddButton("Start",40,250) Controls.SetSize(button , GraphicsWindow.Width - 80,130) Sub Init Ball_Number = Controls.GetTextBoxText(textbox) GraphicsWindow.Clear() GraphicsWindow.FontSize = 14 GraphicsWindow.DrawText(5,5,"To add a ball, Left Click.") GraphicsWindow.DrawText(5,25,"To remove a ball, Right Click.") BallText = Shapes.AddText("Number of balls: " + Ball_Number) Shapes.Move(balltext,5,45) For i = 1 To Ball_Number GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor() Ball[i] = Shapes.AddEllipse(Ball_Diameter, Ball_Diameter) Ball_X[i] = (Math.GetRandomNumber(GraphicsWindow.Width - Ball_Diameter)) Ball_Y[i] = (Math.GetRandomNumber(GraphicsWindow.Height - Ball_Diameter)) Ball_vX[i] = Math.GetRandomNumber(6) - 2 Ball_vY[i] = Math.GetRandomNumber(6) - 2 EndFor Run = 1 While "True" Shapes.SetText(BallText,"Number of balls: " + Ball_Number) MoveBalls() BounceCheck() CollisionCheck() Program.Delay(5) EndWhile endsub Sub MoveBalls For i = 1 To Ball_Number Ball_X[i] = Ball_X[i] + Ball_vX[i] Ball_Y[i] = Ball_Y[i] + Ball_vY[i] Shapes.Move(Ball[i], Ball_X[i], Ball_Y[i]) EndFor energyInc = 0 EndSub Sub BounceCheck For i = 1 To Ball_Number If (Ball_X[i] + Ball_Diameter) > GraphicsWindow.Width Then Ball_vX[i] = -Ball_vX[i] EndIf If (Ball_X[i]) < 0 Then Ball_vX[i] = -Ball_vX[i] EndIf If (Ball_Y[i] + Ball_Diameter) > Graphicswindow.Height then Ball_vY[i] = -Ball_vY[i] EndIf If Ball_Y[i] < 0 Then Ball_vY[i] = -Ball_vY[i] EndIf EndFor EndSub Sub AddBall num = Ball_Number + 1 GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor() Ball[num] = Shapes.AddEllipse(Ball_Diameter, Ball_Diameter) If addBallAtMouse = "True" then Ball_X[num] = GraphicsWindow.MouseX Ball_Y[num] = GraphicsWindow.MouseY addBallAtMouse = "False" Else Ball_X[num] = (Math.GetRandomNumber(GraphicsWindow.Width - Ball_Diameter)) Ball_Y[num] = (Math.GetRandomNumber(GraphicsWindow.Height - Ball_Diameter)) EndIf Ball_vX[num] = Math.GetRandomNumber(6) - 2 Ball_vY[num] = Math.GetRandomNumber(6) - 2 Ball_Number = Ball_Number + 1 EndSub Sub CollisionCheck For i = 1 To (Ball_Number - 1) For j = i+1 To Ball_Number dx = Ball_X[i] - Ball_X[j] dy = Ball_Y[i] - Ball_Y[j] Distance = Math.SquareRoot(dx * dx + dy * dy) If Distance < Ball_Diameter Then Cx = (Ball_vX[i]+ball_vX[j])/2 Cy = (Ball_vY[i]+ball_vY[j])/2 Relative_vX[i] = Ball_vX[i] - Cx Relative_vY[i] = Ball_vY[i] - Cy Relative_vX[j] = Ball_vX[j] - Cx Relative_vY[j] = Ball_vY[j] - Cy Nx = dx / Distance Ny = dy / Distance L[i] = Nx * Relative_vX[i] + Ny * Relative_vY[i] L[j] = Nx * Relative_vX[j] + Ny * Relative_vY[j] Relative_vX[i] = Relative_vX[i] - (2 * L[i] * Nx) Relative_vY[i] = Relative_vY[i] - (2 * L[i] * Ny) Relative_vX[j] = Relative_vX[j] - (2 * L[j] * Nx) Relative_vY[j] = Relative_vY[j] - (2 * L[j] * Ny) Ball_vX[i] = (Relative_vX[i] + Cx) Ball_vY[i] = (Relative_vY[i] + Cy) Ball_vX[j] = (Relative_vX[j] + Cx) Ball_vY[j] = (Relative_vY[j] + Cy) EndIf EndFor EndFor EndSub Sub MouseDown If Run <> 0 then If Mouse.IsLeftButtonDown = "True" Then addBallAtMouse = "True" AddBall() ElseIf Mouse.IsRightButtonDown = "True" and Ball_Number <> 1 then Ball_Number = Ball_Number - 1 Shapes.Remove(Ball[Ball_Number + 1]) EndIf EndIf EndSub End>LVX011.sb< Start>LVX800.sb< ' Small Basic Command List, how to use. ' This is not sufficient. Please confirm this yourself. By NaochanON . 2011/8/9 ' $ mark shows error occurred on my PC(NaochanON). Check it on your PC. ' '
' $ Aero IsDesktopVisible error occurred on my PC ' $ Aero IsFlashing error occurred on my PC ' $ Aero IsSevenOrNewer error occurred on my PC ' $ Aero IsTaskbarVisible error occurred on my PC ' $ Aero IsVistaOrNewer error occurred on my PC ' Aero LastClickedThumbButton not checked yet ' Aero CreateThumbButton not checked yet ' Aero ExpandGlass not checked yet ' Aero SetOverlayIcon not checked yet ' Aero SetTaskbarProgressbarSta not checked yet ' Aero SetThumbButtons not checked yet ' Aero ShowTaskDialog not checked yet ' Aero ThumbButtonClick not checked yet ' Array ContainsIndex not checked yet ' Array ContainsValue not checked yet ' Array GetAllIndices not checked yet ' Array GetItemCount not checked yet ' $ Array GetValue not appeared on intellisense ' Array IsArray not checked yet ' $ Array RemoveValue not appeared on intellisense ' $ Array SetValue not appeared on intellisense ' ClipBoard ContainsImage textwindow.WriteLine(Clipboard.ContainsImage) ' ClipBoard ContainsText textwindow.WriteLine(Clipboard.ContainsText) ' ClipBoard Clear Clipboard.Clear() ' ClipBoard GetImage a=shapes.AddImage( Clipboard.GetImage() ) ' ClipBoard GetText textwindow.WriteLine(Clipboard.Gettext()) ' ClipBoard SetImage Clipboard.SetImage("c:/flower.bmp") ' ClipBoard SetText Clipboard.SetText("Hellow") ' ClockPlus BinaryTime not checked yet ' Clock Date today=Clock.Date --> (2011/08/06) ' ClockPlus Date same as above mentioned ' Clock Day day=Clock.Day --> (6) ' ClockPlus Day same as above mentioned ' ClockPlus DaysInMont a=Clockplus.DaysInMont(6,2011) --> (30) ' Clock ElapsedMilliseconds a=Clock.ElapsedMilliseconds ' ClockPlus ElapsedMillisecond same as above mentioned ' Clock Hour Hour=Clock.Hour --> (20) ' ClockPlus Hour same as above mentioned ' ClockPlus isDaylightsavingTime a=ClockPlus.IsDaylightSavingTime --> False ' ClockPlus IsLeapYear a=ClockPlus.IsLeapYear(2011) --> False ' Clock Millisecond msecond=Clock.millisecond --> (173) ' ClockPlus Millisecond same as above mentioned ' Clock Minute minute=clock.minute --> (46) ' ClockPlus Minute same as above mentioned ' Clock Month Month=clock.month --> (8) ' ClockPlus Month same as above mentioned ' Clock Second second=clock.second --> (34) ' ClockPlus Second same as above mentioned ' Clock Time time=clock.time --> (20:46:34) ' ClockPlus Time same as above mentioned ' ClockPlus TimeAndDate a=ClockPlus.TimeAndDate ' ClockPlus TimeZone a=ClockPlus.TimeZone ' Clock WeekDay a=ClockPlus.WeekDay --> (Saturday) ' ClockPlus WeekDay same as above mentioned ' Clock Year a=Clock.Year --> (2011) ' ClockPlus Year same as above mentioned ' CMD LastError TextWindow.WriteLine(CMD.LastError) ' CMD LastExitCode TextWindow.WriteLine(CMD.LastExitCode) ' CMD RunCMDCommand not checked yet ' $ CMD RunCMDorBatFile CMDRunCMDorBatFile("print.bat") --> Process.start("print.bat") ' Colour AliceBlue GraphicsWindow.BrushColor=Colour.AliceBlue ' Colour AntiqueWhite same as above mentioned ' Colour Aqua same as above mentioned ' Colour Aquamarine same as above mentioned ' Colour Azure same as above mentioned ' Colour Beige same as above mentioned ' Colour Bisque same as above mentioned ' Colour Black same as above mentioned ' Colour BlanchedAlmond same as above mentioned ' Colour Blue same as above mentioned ' Colour BlueViolet same as above mentioned ' Colour Brown same as above mentioned ' Colour BurlyWood same as above mentioned ' Colour CadetBlue same as above mentioned ' Colour Chartreuse same as above mentioned ' Colour Chocolate same as above mentioned ' Colour Coral same as above mentioned ' Colour CornflowerBlue same as above mentioned ' Colour Cornsilk same as above mentioned ' Colour Crimson same as above mentioned ' Colour Cyan same as above mentioned ' Colour DarkBlue same as above mentioned ' Colour DarkCyan same as above mentioned ' Colour DarkGoldenrod same as above mentioned ' Colour DarkGray same as above mentioned ' Colour DarkGreen same as above mentioned ' Colour DarkKhaki same as above mentioned ' Colour DarkMagenta same as above mentioned ' Colour DarkOliveGreen same as above mentioned ' Colour DarkOrange same as above mentioned ' Colour DarkOrchid same as above mentioned ' Colour DarkRed same as above mentioned ' Colour DarkSalmon same as above mentioned ' Colour DarkSeaGreen same as above mentioned ' Colour DarkSlateBlue same as above mentioned ' Colour DarkSlateGray same as above mentioned ' Colour DarkTurquoise same as above mentioned ' Colour DarkViolet same as above mentioned ' Colour DeepPink same as above mentioned ' Colour DeepSkyBlue same as above mentioned ' Colour DimGray same as above mentioned ' Colour DodgerBlue same as above mentioned ' Colour FireBrick same as above mentioned ' Colour FloralWhite same as above mentioned ' Colour ForestGreen same as above mentioned ' Colour Fuchsia same as above mentioned ' Colour Gainsboro same as above mentioned ' Colour GhostWhite same as above mentioned ' Colour Gold same as above mentioned ' Colour Goldenrod same as above mentioned ' Colour Gray same as above mentioned ' Colour Green same as above mentioned ' Colour GreenYellow same as above mentioned ' Colour Honeydew same as above mentioned ' Colour HotPink same as above mentioned ' Colour IndianRed same as above mentioned ' Colour Indigo same as above mentioned ' Colour Ivory same as above mentioned ' Colour Khaki same as above mentioned ' Colour Lavender same as above mentioned ' Colour LavenderBlush same as above mentioned ' Colour LawnGreen same as above mentioned ' Colour LemonChiffon same as above mentioned ' Colour LightBlue same as above mentioned ' Colour LightCoral same as above mentioned ' Colour LightCyan same as above mentioned ' Colour LightGoldenrodYellow same as above mentioned ' Colour LightGray same as above mentioned ' Colour LightGreen same as above mentioned ' Colour LightPink same as above mentioned ' Colour LightSalmon same as above mentioned ' Colour LightSeaGreen same as above mentioned ' Colour LightSkyBlue same as above mentioned ' Colour LightSlateGray same as above mentioned ' Colour LightSteelBlue same as above mentioned ' Colour LightYellow same as above mentioned ' Colour Lime same as above mentioned ' Colour LimeGreen same as above mentioned ' Colour Linen same as above mentioned ' Colour Magenta same as above mentioned ' Colour Maroon same as above mentioned ' Colour MediumAquamarine same as above mentioned ' Colour MediumBlue same as above mentioned ' Colour MediumOrchid same as above mentioned ' Colour MediumPurple same as above mentioned ' Colour MediumSeaGreen same as above mentioned ' Colour MediumSlateBlue same as above mentioned ' Colour MediumSpringGreen same as above mentioned ' Colour MediumTurquoise same as above mentioned ' Colour MediumVioletRed same as above mentioned ' Colour MidnightBlue same as above mentioned ' Colour MintCream same as above mentioned ' Colour MistyRose same as above mentioned ' Colour Moccasin same as above mentioned ' Colour NavajoWhite same as above mentioned ' Colour Navy same as above mentioned ' Colour OldLace same as above mentioned ' Colour Olive same as above mentioned ' Colour OliveDrab same as above mentioned ' Colour Orange same as above mentioned ' Colour OrangeRed same as above mentioned ' Colour Orchid same as above mentioned ' Colour PaleGoldenrod same as above mentioned ' Colour PaleGreen same as above mentioned ' Colour PaleTurquoise same as above mentioned ' Colour PaleVioletRed same as above mentioned ' Colour PapayaWhip same as above mentioned ' Colour PeachPuff same as above mentioned ' Colour Peru same as above mentioned ' Colour Pink same as above mentioned ' Colour Plum same as above mentioned ' Colour PowderBlue same as above mentioned ' Colour Purple same as above mentioned ' Colour Red same as above mentioned ' Colour RosyBrown same as above mentioned ' Colour RoyalBlue same as above mentioned ' Colour SaddleBrown same as above mentioned ' Colour Salmon same as above mentioned ' Colour SandyBrown same as above mentioned ' Colour SeaGreen same as above mentioned ' Colour Seashell same as above mentioned ' Colour Sienna same as above mentioned ' Colour Silver same as above mentioned ' Colour SkyBlue same as above mentioned ' Colour SlateBlue same as above mentioned ' Colour SlateGray same as above mentioned ' Colour Snow same as above mentioned ' Colour SpringGreen same as above mentioned ' Colour SteelBlue same as above mentioned ' Colour Tan same as above mentioned ' Colour Teal same as above mentioned ' Colour Thistle same as above mentioned ' Colour Tomato same as above mentioned ' Colour Turquoise same as above mentioned ' Colour Violet same as above mentioned ' Colour Wheat same as above mentioned ' Colour White same as above mentioned ' Colour WhiteSmoke same as above mentioned ' CommPort AvailablePort A=CommPort.AvailablePorts() --> (3) ' CommPort ClosePort CommPort.ClosePort() ' CommPort OpenPort CommPort.OpenPort("Com3",9600) ' CommPort RXAll C=CommPort.RXAll() ' CommPort RXByte C=CommPort.RXByte() ' CommPort RXChar C=CommPort.RxChar() --> (5) See Forum ' CommPort SetHandShake CommPort.SetHandshake("H") ' CommPort Txbyte CommPort.TXByte(databyte) ' CommPort TXString CommPort.TXString(":HEADER OFF") ' Controls LastClickedButton lastButton = Controls.LastClickedButton ' Controls LastTypedTextBox not checked yet ' Controls AddButton SD = Controls.AddButton("Save Data",200,40) FDJ361 ' Controls AddMultilineTextBox M_txtbox = Controls.AddmultiLineTextBox(10,40) ' Controls AddTextBox txtbox1=Controls.AddTextBox(100,55) ' Controls GetButtonCaption a=controls.GetButtonCaption(save) ' Controls GetTextBoxText A=Controls.GetTextBoxText("Test") TVS225 ' Controls HideControl Controls.HideControl(t) ' Controls Move Controls.Move(myshape, 200, 100) ' Controls Remove Controls.Remove(myshape) ' Controls SetButtonCaption controls.SetButtonCaption(SD,"Receive Data") ' Controls SetSize Controls.SetSize(SD,200,25) ' Controls SetTextBoxText Controls.SetTextBoxText(txtbox1, "1line text") TVS225 ' Controls ShowControl Controls.ShowControl(M_textbox) <-- if hide ' Controls ButtonClicked Controls.ButtonClicked = OnButtonClicked ' Controls TextTyped Controls.texttyped = OnTextTyped ' DataExtension Version TextWindow.WriteLine(DataExtension.Version) ' DataExtension CheckForUpdates a=DataExtension.CheckForUpdates() --> False ' DataExtension SetImageOfTurtle DataExtension.SetImageOfTurtle(Image) ' DataExtension ShowAbout dataextension.ShowAbout() ' DataExtension ThrowException dataextension.ThrowException("Error") ' Debug BackgroundColor not checked yet ' Debug LastMessage not checked yet ' Debug MaxArraySize not checked yet ' Debug OutputToDebugView not checked yet ' Debug Stack not checked yet ' Debug Variables not checked yet ' Debug Write not checked yet ' Debug WritingMessage not checked yet ' DeskTop Height DH=Desktop.Height ' DeskTop Width DW=Desktop.Width ' DeskTop SetWallPaper Desktop.SetWallPaper("Nature.jpg") ' Dialogs LastFontName not checked yet ' Dialogs LastFontSize not checked yet ' Dialogs AskForColor BrushColor = Dialogs.AskForColor() FDJ361 ' Dialogs AskForDirectory File_Directory = Dialogs.AskForDirectory() ' Dialogs AskForFile A=Dialogs.AskForFile("*.*") GFK353 ' Dialogs AskForFiles A=Dialogs.AskForFiles("*.txt") ' Dialogs AskForFont dialogs.AskForFont() ' Dialogs AskForSaveLocation a=dialogs.AskForSaveLocation("*.txt") ' Dialogs AskForTextLine a=dialogs.AskForTextLine("Time?","Time") ' Dialogs ShowMessageBox Dialogs.ShowMessegeBox(Text, Title, Buttons, Theme) ' Dictionary GetDefinition a=Dictionary.GetDefinition("Mountain") ' Dictionary GetDefinitionInFrench a=Dictionary.GetDefinitioninFrench("fleur") ' EventTest DisplaySettings not checked yet ' FilePlus AddAttiribute FilePlus.AddAttiribute("D:/SB/test.txt","ReadOnly") ' The following line could be harmful and has been automatically commented. ' ' File AppendContents File.AppendContents("Test.txt","Flower") ' FilePlus AppendContents same as above mentioned ' FilePlus CompressFile FilePlus.CompressFile("D:/SB/test.txt","e:/Ziptest.lzh") ' FilePlus ContainsAttiribute a=FilePlus.ContainsAttiribute("D:/SB/test.txt","Hidden") ' FilePlus CopyDirectory FilePlus.CopyDirectory("D:/SB/","H:/") ' The following line could be harmful and has been automatically commented. ' ' File CopyFile File.CopyFile("C:/Test.txt","F:/Test2.txt") ' FilePlus CopyFile same as above mentioned ' The following line could be harmful and has been automatically commented. ' ' File CreateDirectory File.CreateDirectory("D:/SB") ' FilePlus CreateDirectory same as above mentioned ' FilePlus DecompressFile FilePlus.DecompressFile("e:/Ziptest.lzh","D:/SB/test3.txt") ' The following line could be harmful and has been automatically commented. ' ' File DeleteDirectory File.DeleteDirectory("D:/SB") ' FilePlus DeleteDirectory same as above mentioned ' The following line could be harmful and has been automatically commented. ' ' File DeleteFile File.DeleteFile("D:/SB/test.txt") TXZ747 ' FilePlus DeleteFile same as above mentioned ' FilePlus DirectoryExists textwindow.WriteLine(FilePlus.DirectoryExists("f:/SB")) ' FilePlus FileExists a=FilePlus.DirectoryExists("D:/SmallBasic") ' FilePlus GetAllFiles a=FilePlus.GetAllFiles("f:") ' The following line could be harmful and has been automatically commented. ' ' File GetDirectories a=File.GetDirectories("C:/programdata") ' FilePlus GetDirectories same as above mentioned ' FilePlus GetFileExtension a=FilePlus.GetFileExtension (Fpath1) ' FilePlus GetFileName a=FilePlus.GetFileName(Fpath1) ' The following line could be harmful and has been automatically commented. ' ' File GetFiles a=File.Getfiles("H:") ' FilePlus GetFiles same as above mentioned ' FilePlus GetNumberOfLines a=FilePlus.GetNumberOfLines ' FilePlus GetParentDirectory not checked yet ' The following line could be harmful and has been automatically commented. ' ' File GetSettingsFilePath a=File.GetSettingsFilePath() ' FilePlus GetSettingsFilePath same as above mentioned ' The following line could be harmful and has been automatically commented. ' ' File GetTemporaryFilePath a=File.GetTemporaryFilePath() ' FilePlus GetTemporaryFilePath same as above mentioned ' FilePlus INIRead not checked yet ' FilePlus INIWrite not checked yet ' The following line could be harmful and has been automatically commented. ' ' File InsertLine File.InsertLine("C:/Test.txt",5,"Nature") ' FilePlus InsertLine same as above mentioned ' The following line could be harmful and has been automatically commented. ' ' File LastError TextWindow.WriteLine(File.LastError) ' FilePlus LastError not checked yet ' FilePlus MoveFile FilePlus.MoveFile(Fpath1,Fpath2) ' The following line could be harmful and has been automatically commented. ' ' File ReadContents Data_B=File.ReadContents("H:/DATA/Prog.txt") ' FilePlus ReadContents same as above mentioned ' FilePlus ReadFileToArray data[n]=FilePlus.ReadFileToArray("D:/test.txt") ' The following line could be harmful and has been automatically commented. ' ' File ReadLine a=File.ReadLine("E:/Prog/Test.txt",6) ' FilePlus ReadLine same as above mentioned ' FilePlus RemoveAttiribute not checked yet ' The following line could be harmful and has been automatically commented. ' ' File WriteContents File.WriteContents(""D:/SB/Test.txt", Data_B) ' FilePlus WriteContents same as above mentioned ' The following line could be harmful and has been automatically commented. ' ' File WriteLine File.WriteLine("C:/Test.txt",11,"Mountain") TXZ747 ' FilePlus WriteLine same as above mentioned ' Flickr GetPictureOfMoment url=Flickr.GetPictureOfMoment() ' Flickr GetRandomPicture url=Flickr.GetRandomPicture("Disny") QVK058 ' GameController BatteryLevel "GameController works with X-BOX" ' GameController BatteryType "GameController works with X-BOX" ' GameController IsConnected "GameController works with X-BOX" ' GameController LeftStickX "GameController works with X-BOX" ' GameController LeftStickY "GameController works with X-BOX" ' GameController RightStickX "GameController works with X-BOX" ' GameController RightStickY "GameController works with X-BOX" ' GameController ValuesChanged "GameController works with X-BOX" ' GameController IsButtonDown "GameController works with X-BOX" ' GameController SetVibratation "GameController works with X-BOX" ' GameController UpdateValues "GameController works with X-BOX" ' GameControls AddButton GBtn1= GameControls.AddButton("start",100,20,50,25) ' GameControls AddCheckBox GChk1= GameControls.AddCheckBox("OK?",100,50) ' GameControls AddEllipse GameControls.AddEllipse(200,80,30,20) ' GameControls AddImage GameControls.AddImage(Shapes.AddRectangle(30,20),50,70) ' GameControls AddLine GameControls.AddLine(20,30,30,60) ' GameControls AddMultilineTextBox Mtxt=GameControls.AddMultilineTextBox("test",100,50,180,20) ' GameControls AddPasswordBox PSWD1=GameControls.AddPasswordBox("PSWD",100,50,180,20) ' GameControls AddPolygon not checked yet ' GameControls AddProgressBar PSWD1=GameControls.AddProgressBar(30,100,150,180,20) ' GameControls AddRadioButton RBTN1=GameControls.AddRadioButton("Button",180,20) ' GameControls AddRectangle RECT1=GameControls.AddRectangle(100,150,180,20) ' GameControls AddSlider SLD1=GameControls.AddSlider(60,500,50,180,20) ' GameControls AddText TXT1=GameControls.AddText("test",60,300,"coorie new",15,"true","true") ' GameControls AddTextBox TXBT1=GameControls.AddTextBox("test",60,300,100,20) ' GameControls AddTriangle Tri1=GameControls.AddTriangle(70,70,70,100,120,80) ' GameControls AddWebBrowser url1=GameControls.AddWebBrowser(70,100,500,400,url) ' GameControls Animate not checked yet ' GameControls AnimateProperty not checked yet ' GameControls GetEnabled not checked yet ' GameControls GetFocus not checked yet ' GameControls GetHeight not checked yet ' GameControls GetOpacity not checked yet ' GameControls GetText not checked yet ' GameControls GetValue not checked yet ' GameControls GetVisibility not checked yet ' GameControls GetWidth not checked yet ' GameControls GetX not checked yet ' GameControls GetY not checked yet ' GameControls GetZ not checked yet ' GameControls RegisterFocusGotEvent not checked yet ' GameControls RegisterFocusLostEvent not checked yet ' GameControls RegisterKeyDownEvent not checked yet ' GameControls RegisterKeyUpEvent not checked yet ' GameControls RegisterMouseDownEvent GameControls.RegisterMouseDownEvent(open_btn, "open") GFK353 ' GameControls RegisterMouseEnterEvent not checked yet ' GameControls RegisterMouseLeaveEvent not checked yet ' GameControls RegisterMouseMoveEvent not checked yet ' GameControls RegisterMouseUpEvent not checked yet ' GameControls RegisterMouseWheelEvent not checked yet ' GameControls RegisterValueChangedEven not checked yet ' GameControls Remove GameControls.Remove(mediaplayer) GFK353 ' GameControls Rotate not checked yet ' GameControls SetColors not checked yet ' GameControls SetEnabled not checked yet ' GameControls SetFocus not checked yet ' GameControls SetFont not checked yet ' GameControls SetOpacity not checked yet ' GameControls SetPosition not checked yet ' GameControls SetSize not checked yet ' GameControls SetText not checked yet ' GameControls SetToolTip not checked yet ' GameControls SetValue not checked yet ' GameControls SetVisibility not checked yet ' GameControls Zoom not checked yet End>LVX800.sb< Start>LWB173.sb< ' N Pointed Star ' Version 0.1 ' for Challenge of the Month - October/November 2015 ' Copyright © 2015 Nonki Takahashi. The MIT License. ' GraphicsWindow.Title = "N Pointed Star 0.1" Init() Form() Controls.ButtonClicked = OnButtonClicked While "True" If clicked Then If Controls.LastClickedButton = btnMove Then angle = Controls.GetTextBoxText(tboxAngle) If angle <> "" Then DrawStar() EndIf Else For n = 3 To nMax Step 2 a = 360 / n b = (360 - a) / 4 angle = Math.Floor(2 * b * 100) / 100 DrawStar() EndFor EndIf clicked = "False" Else Program.Delay(200) EndIf EndWhile Sub DrawStar ' param angle GraphicsWindow.Clear() Form() tx = Turtle.X ty = Turtle.Y Turtle.Move(100) Turtle.Turn(angle) p = 1 d["x"] = Math.Abs(Turtle.X - tx) d["y"] = Math.Abs(Turtle.Y - ty) While 1 <= d["x"] Or 1 <= d["y"] Turtle.Move(100) Turtle.Turn(angle) p = p + 1 d["x"] = Math.Abs(Turtle.X - tx) d["y"] = Math.Abs(Turtle.Y - ty) If pMax < p Then d = "" ' exit while EndIf EndWhile If p <= pMax Then log = log + "angle=" + angle + " -> " + p + " pointed" + CRLF Controls.SetTextBoxText(tboxLog, log) EndIf EndSub Sub Form GraphicsWindow.DrawText(10, 16, "Angle") tboxAngle = Controls.AddTextBox(50, 12) btnMove = Controls.AddButton("Move", 220, 10) Controls.AddButton("Auto", 270, 10) tboxLog = Controls.AddMultiLineTextBox(10, 40) Controls.SetSize(tboxLog, 200, 360) Controls.SetTextBoxText(tboxLog, log) Turtle.Show() EndSub Sub Init CRLF = Text.GetCharacter(13) + Text.GetCharacter(10) gw = 598 gh = 428 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BackgroundColor = "#EEEEEE" GraphicsWindow.BrushColor = "Black" nMax = 20 pMax = 360 Turtle.Speed = 10 EndSub Sub OnButtonClicked clicked = "True" EndSub End>LWB173.sb< Start>LWB937.sb< 'Making a moving duck - Monthly Challenge Aug2013 SetGW() Xorg = gw / 2 'centre of the GW Yorg = gh / 2 ' Table key: W = width; H = height; RX = X relative to the body; RY = Y rel to body; R = rotate angle" DS[1] = "W=60;H=25;RX=0;RY=0;R=0" 'BODY DS[2] = "W=20;H=18;RX=70;RY=-5;R=0" 'HEAD DS[3] = "W=28;H=8;RX=50;RY=2;R=-10" 'NECK DS[4] = "W=22;H=5;RX=77;RY=0;R=-0" 'BEAK For i = 1 To 4 X[i] = DS[i]["RX"] - 22-77 'moves duck off screen left (beak Width & RelX) Y[i] = Yorg + DS[i]["RY"] duckShape[i] = Shapes.AddEllipse(DS[i]["W"], DS[i]["H"]) Shapes.Move(duckShape[i], X[i], Y[i]) Shapes.Rotate(duckShape[i], DS[i]["R"]) EndFor While "True" For i = 1 To 4 X[i] = X[i] + 1 Shapes.Move(duckShape[i], X[i], Y[i]) EndFor If X[1] > gw Then For i = 1 To 4 X[i] = DS[i]["RX"] - 22-77 'moves duck off screen left (beak Width & RelX) EndFor EndIf Program.Delay(5) EndWhile Sub SetGW gw = 1100 gh = 580 GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.Left = (Desktop.Width - gw) / 2 GraphicsWindow.Top = (Desktop.Height - gh) / 3 GraphicsWindow.PenWidth = 0 EndSub End>LWB937.sb< Start>LWC709.sb< ' SmallBasic Version 1.0 ' Funktion: IsUnicode ' Autor: Pappa Lapub ' Herkunft: ' ImportURL: http://smallbasic.com/program/? ' Extension: LitDev (DataExt mit FilePlus.FileExists) ' Kommentar: ' ' Variablen: ' ' -------------------------------------------------------------------------------- ' http://stackoverflow.com/questions/1410334/filesystemobject-reading-unicode-files ' auto-detect and read unicode files with FSO (assuming they are little-endian and contain the BOM) QU = Text.GetCharacter(34) TAB = Text.GetCharacter(9) ' The following line could be harmful and has been automatically commented. ' VBSDir = LDFile.TempFolder+"\SB\" VBSFile = "IsUnicode.vbs" VBSPath = VBSDir+VBSFile BackFile = "IsUnicode.txt" BackPath = VBSDir+BackFile ReadArgs() ' The following line could be harmful and has been automatically commented. ' If LDFile.Length(VBSPath) <= 0 Then ' Datei existiert NICHT WriteVB() EndIf RunVB() Program.Delay(500) ' The following line could be harmful and has been automatically commented. ' If LDFile.Length(BackPath) > 0 Then ' Datei existiert mit Inhalt TextRead() Else Value = "FAILED" EndIf TextWindow.WriteLine(Value) ' ///// SUBs \\\\\ Sub ReadArgs If Program.ArgumentCount <> 1 OR Text.IsSubText(Program.GetArgument(1),"?") Then SBLF = Text.GetCharacter(10) HelpTxt = "Prüft angegebene Datei auf 'UniCode' Codierung (per VBS)." + SBLF ' The following line could be harmful and has been automatically commented. ' HelpTxt = HelpTxt + "Syntax: " + LDFile.GetFile(File.GetSettingsFilePath()) + ".exe TextDatei [-?,/?]" + SBLF HelpTxt = HelpTxt + "-------" + SBLF TextWindow.WriteLine(HelpTxt) TextWindow.Pause() Program.End() Else ' The following line could be harmful and has been automatically commented. ' If LDFile.Length(Program.GetArgument(1)) > -1 Then ' Datei existiert (ev. auch leer) TextFile = Program.GetArgument(1) Else Value = "FAILED" TextWindow.WriteLine(Value) TextWindow.Pause() Program.End() EndIf EndIf EndSub Sub RunVB LDProcess.Start(VBSPath, QU + TextFile + QU ) EndSub Sub TextRead ' The following line could be harmful and has been automatically commented. ' Value = File.ReadContents(BackPath) EndSub Sub WriteVB ' The following line could be harmful and has been automatically commented. ' Self = Text.Replace(File.GetSettingsFilePath(),".settings",".exe") ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, "' siehe: " + Self) ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, "' Aufruf: " + VBSFile + " TextDatei" + TAB + "gibt True/False zurück") ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, "Option Explicit") ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, "Dim FSO, Stream, strTxtFile, IsUnicodeTxt, f, intAsc1Chr, intAsc2Chr") ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, "' IsUnicodeTxt = Replace(WScript.ScriptFullName, WScript.ScriptName," + QU + BackFile + QU +")") ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, "IsUnicodeTxt = " + QU + BackPath + QU) ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, "Set FSO = CreateObject(" + QU + "Scripting.FileSystemObject" + QU + ")") ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, "strTxtFile = FSO.GetAbsolutePathName(WScript.Arguments(0))") ' The following line could be harmful and has been automatically commented. ' ' File.AppendContents(VBSPath, "If Not FSO.FileExists(strTxtFile) Then") ' The following line could be harmful and has been automatically commented. ' ' File.AppendContents(VBSPath, "RetVal = " + QU + "FAILED" + QU) ' The following line could be harmful and has been automatically commented. ' ' File.AppendContents(VBSPath, "Set FSO = Nothing") ' The following line could be harmful and has been automatically commented. ' ' File.AppendContents(VBSPath, "WScript.Quit") ' The following line could be harmful and has been automatically commented. ' ' File.AppendContents(VBSPath, "End If") ' The following line could be harmful and has been automatically commented. ' ' File.AppendContents(VBSPath, "Set Stream = FSO.OpenTextFile(ScriptFolderObject.Path & " + QU + "\" +QU + " & FileName, 1, False)") ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, "Set Stream = FSO.OpenTextFile(strTxtFile, 1, False)") ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, "intAsc1Chr = Asc(Stream.Read(1))") ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, "intAsc2Chr = Asc(Stream.Read(1))") ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, "Stream.Close") ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, "Set Stream = Nothing") ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, "Set f = FSO.OpenTextFile(IsUnicodeTxt, 2, True)") ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, "") ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, "If intAsc1Chr = 255 And intAsc2Chr = 254 Then") ' The following line could be harmful and has been automatically commented. ' ' File.AppendContents(VBSPath, "OpenAsUnicode = True") ' The following line could be harmful and has been automatically commented. ' ' File.AppendContents(VBSPath, "RetVal = " + QU + "True" + QU) ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, TAB + "f.Write " + QU + "True" + QU) ' The following line could be harmful and has been automatically commented. ' ' File.AppendContents(VBSPath, "WScript.Echo " + QU + "Ist UNICODE Datei." + QU) ' The following line could be harmful and has been automatically commented. ' ' File.AppendContents(VBSPath, "WScript.Echo intAsc1Chr & " + QU + "," + QU + " & intAsc2Chr") ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, "Else") ' The following line could be harmful and has been automatically commented. ' ' File.AppendContents(VBSPath, "OpenAsUnicode = False") ' The following line could be harmful and has been automatically commented. ' ' File.AppendContents(VBSPath, "RetVal = " + QU + "False" + QU) ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, TAB + "f.Write " + QU + "False" + QU) ' The following line could be harmful and has been automatically commented. ' ' File.AppendContents(VBSPath, "WScript.Echo " + QU + "KEINE Unicode Datei." + QU) ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, "End If") ' The following line could be harmful and has been automatically commented. ' ' File.AppendContents(VBSPath, "' Get script content") ' The following line could be harmful and has been automatically commented. ' ' File.AppendContents(VBSPath, "Set Stream = FSO.OpenTextFile(ScriptFolderObject.Path & " + QU + "\" + QU + " & FileName, 1, 0, OpenAsUnicode)") ' The following line could be harmful and has been automatically commented. ' ' File.AppendContents(VBSPath, "TextContent = Stream.ReadAll()") ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, "f.Close") ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, "Set f = Nothing") ' The following line could be harmful and has been automatically commented. ' File.AppendContents(VBSPath, "Set FSO = Nothing") EndSub End>LWC709.sb< Start>LWF090.sb< TextWindow.WriteLine("how many questions do you want?") iQuestion = TextWindow.ReadNumber() for i= 1 To iQuestion iNum = Math.GetRandomNumber(10) iNum2 = Math.GetRandomNumber(10) TextWindow.WriteLine("Try and Solve this...") textWindow.WriteLine(iNum + "x" + iNum2) timeLimit = 10 'Time limit in seconds ticks = 0 'Count of elapsed seconds Timer.Interval = 1000 'Check every second Timer.Tick = OnTick 'Timer event subroutine iAnswer = TextWindow.ReadNumber() Timer.Pause() 'Stop timer we are done with it If (ticks < timeLimit) Then if iAnswer = (iNum*iNum2) Then TextWindow.WriteLine("Well done, that was correct!") iScore = iScore + 1 Else TextWindow.WriteLine ("Sorry incorrect" + ",the answer is " + iNum*iNum2 ) EndIf Else TextWindow.WriteLine("Ran out of time!") EndIf EndFor TextWindow.WriteLine("Your score is " + 0.01*Math.Round(iScore / iQuestion *10000) + "%" ) Sub OnTick ticks = ticks+1 'Record next tick If (ticks < timeLimit) Then 'Run out of time TextWindow.Title = (timeLimit-ticks) + " seconds left" Else TextWindow.Title = "Time up" EndIf EndSub End>LWF090.sb< Start>LWH275.sb< ' Dump v0.1 ' CR = 13 LF = 10 TextWindow.Write("File name? ") sFile = TextWindow.Read() ' The following line could be harmful and has been automatically commented. ' sBuf = File.ReadContents(sFile) iDec = Text.GetLength(sBuf) TextWindow.Write("File length = " + iDec + " (") InitDec2Hex() Dec2Hex() TextWindow.WriteLine(sHex + "h) [bytes]") iPtr = 1 c = " " While c <> "" If Math.Remainder(iPtr, 16 * 8) = 1 Then TextWindow.WriteLine("") TextWindow.WriteLine(" +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +A +B +C +D +E +F 0123456789ABCDEF") TextWindow.WriteLine(" -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ----------------") EndIf iDec = Math.Floor((iPtr - 1) / 16) Dec2Hex() If Text.GetLength(sHex) = 1 Then TextWindow.Write("00") ElseIf Text.GetLength(sHex) = 2 Then TextWindow.Write("0") EndIf TextWindow.Write(sHex) TextWindow.Write("0 ") iSave = iPtr For i = 1 To 16 c = Text.GetSubText(sBuf, iPtr, 1) If c = "" Then sHex = " " Else iDec = Text.GetCharacterCode(c) Dec2Hex() If Text.GetLength(sHex) = 1 Then sHex = "0" + sHex EndIf EndIf TextWindow.Write(sHex + " ") iPtr = iPtr + 1 EndFor TextWindow.Write(" ") iPtr = iSave For i = 1 To 16 c = Text.GetSubText(sBuf, iPtr, 1) iDec = Text.GetCharacterCode(c) If iDec = CR Or iDec = LF Then TextWindow.Write(".") Else TextWindow.Write(c) EndIf iPtr = iPtr + 1 EndFor TextWindow.WriteLine("") EndWhile ' ' Initialize for subroutine Dec2Hex ' out: iBase ' out: sDigits Sub InitDec2Hex iBase = 16 sDigits="0123456789ABCDEF" EndSub ' ' Decimal to Hexadecimal conversion ' in: iBase ' in: sDigits ' in: integer iDec ' work: integer n, d ' out: string sHex Sub Dec2Hex sHex = "" n = iDec loop: d = n - Math.Floor(n / iBase) * iBase sHex = Text.Append(Text.GetSubText(sDigits, d + 1, 1), sHex) n = Math.Floor(n / iBase) If n > 0 Then Goto loop EndIf EndSub End>LWH275.sb< Start>LWN233.sb< AuswahlBeispiel() Sub AuswahlBeispiel Controls.ButtonClicked = BC0 GraphicsWindow.Height = 110 GraphicsWindow.Width = 110 GraphicsWindow.BackgroundColor = "Gray" GraphicsWindow.Title = "" M1 = Controls.AddButton("Möglichkeit 1", 10, 10) M2 = Controls.AddButton("Möglichkeit 2", 10, 60) EndSub Sub BC0 LCB = Controls.LastClickedButton If LCB = M1 Then GraphicsWindow.Clear() Moglichkeit1() ElseIf LCB = M2 Then GraphicsWindow.Clear() Moglichkeit2() EndIf EndSub 'MÖGLICHKEIT 1_____________________________________________________________________________________ Sub Moglichkeit1 Controls.ButtonClicked = BC1 Timer.Tick = Zeit GraphicsWindow.Height = 40 GraphicsWindow.Width = 250 GraphicsWindow.BackgroundColor = "Gray" Zeitbox = Controls.AddTextBox(10, 10) Controls.SetSize(Zeitbox, 100, 21) Akzeptierenbutton = Controls.AddButton("Ereignis auslösen", 120, 10) EndSub Sub BC1 LCB = Controls.LastClickedButton If LCB = Akzeptierenbutton Then ZeitdauerSek = Controls.GetTextBoxText(Zeitbox)'Zeit in Sekunden wird abgelesen ZeitdauerMil = ZeitdauerSek*1000'Zeit in Milisekunden | Das Timer - Ereignis rechnet mit Milisekunden! Deswegen muss man den Sekundenwert umwandeln. Timer.Interval = ZeitdauerMil 'Hiermit wird ein Interval gestartet. Das bedeutet, dass im regelmäßigen Abstand von xSekunden das Ereignis ausgeführt wird. EndIf EndSub Sub Zeit If ZeitdauerSek < 3 Then'Durch die If's wird bestimmt was passiert wenn der Wert (in diesem Fall) kleiner, größer und genau 3 ist. Die Zahl mit der die Zeit verglichen werden soll, kann beliebig verändert werden. GraphicsWindow.ShowMessage("Die eingegebene Zeit ist kleiner als 3 Sekunden.", "Möglichkeit 1") ElseIf ZeitdauerSek > 3 Then GraphicsWindow.ShowMessage("Die eingegebene Zeit ist größer als 3 Sekunden.", "Möglichkeit 2") ElseIf ZeitdauerSek = 3 Then GraphicsWindow.ShowMessage("Die eingegebene Zeit beträgt genau 3 Sekunden.", "Möglichkeit 3") EndIf EndSub 'MÖGLICHKEIT 2_____________________________________________________________________________________ Sub Moglichkeit2 Controls.ButtonClicked = BC2 GraphicsWindow.Height = 40 GraphicsWindow.Width = 250 GraphicsWindow.BackgroundColor = "Gray" Zeitbox = Controls.AddTextBox(10, 10) Controls.SetSize(Zeitbox, 100, 21) Akzeptierenbutton = Controls.AddButton("Ereignis auslösen", 120, 10) EndSub Sub BC2 LCB = Controls.LastClickedButton If LCB = Akzeptierenbutton Then ZeitdauerSek = Controls.GetTextBoxText(Zeitbox)'Zeit in Sekunden wird abgelesen Auswertung() EndIf EndSub Sub Auswertung If ZeitdauerSek < 3 Then'Durch die If's wird bestimmt was passiert wenn der Wert (in diesem Fall) kleiner, größer und genau 3 ist. Die Zahl mit der die Zeit verglichen werden soll, kann beliebig verändert werden. GraphicsWindow.ShowMessage("Die eingegebene Zeit ist kleiner als 3 Sekunden.", "Möglichkeit 1") ElseIf ZeitdauerSek > 3 Then GraphicsWindow.ShowMessage("Die eingegebene Zeit ist größer als 3 Sekunden.", "Möglichkeit 2") ElseIf ZeitdauerSek = 3 Then GraphicsWindow.ShowMessage("Die eingegebene Zeit beträgt genau 3 Sekunden.", "Möglichkeit 3") EndIf EndSub End>LWN233.sb< Start>LWP757-1.sb< 'product by Thaelmann-Pioniere GraphicsWindow.Title="Molecular Challenge-Carbon tetrachloride(CCl4)" GraphicsWindow.Width=800 GraphicsWindow.Height=500 GraphicsWindow.BrushColor="black" rofCl=50' The "Cl" means "Chlorine" rofC=30' The "r" means "radius". The "r" in "rofCl" means the same. The "C" means "Carbon". xofC=320+rofC' "x" means the x coordinate of the center point of the carbon atom yofC=240+rofC' "y" means the y coordinate of the center point of the carbon atom GraphicsWindow.FillEllipse(320,240,rofC*2,rofC*2)'carbon atom GraphicsWindow.BrushColor="green" GraphicsWindow.FillEllipse(xofC+160-rofCl,yofC-rofC*2,rofCl*2,rofCl*2)'Chlorine atom on the right GraphicsWindow.FillEllipse(xofC-160-rofCl,yofC-rofC*2,rofCl*2,rofCl*2)'Chlorine atom on the left GraphicsWindow.FillEllipse(xofC-rofCl,yofC-160-rofC*2,rofCl*2,rofCl*2)'Chlorine atom from above GraphicsWindow.FillEllipse(xofC-rofCl,yofC+160-rofC*2,rofCl*2,rofCl*2)'Chlorine atom below GraphicsWindow.PenColor="black" Turtle.Speed=10 Turtle.PenUp() Turtle.MoveTo(xofC,yofC) direction=0 GraphicsWindow.PenWidth=20 For i = 1 To 4 Turtle.Angle=direction Turtle.PenDown() GraphicsWindow.PenColor="black" Turtle.Move(45+rofC) GraphicsWindow.PenColor="green" Turtle.Move(45) Turtle.PenUp() Turtle.MoveTo(xofC,yofC) direction=direction+90 Turtle.PenDown() EndFor Turtle.Hide() End>LWP757-1.sb< Start>LWP757-3.sb< 'product by Thaelmann-Pioniere GraphicsWindow.Title="Molecular Challenge-Carbon tetrachloride(CCl4)" GraphicsWindow.Width=800 GraphicsWindow.Height=500 GraphicsWindow.BrushColor="black" rofCl=50' The "Cl" means "Chlorine" rofC=30' The "r" means "radius". The "r" in "rofCl" means the same. The "C" means "Carbon". xofC=320+rofC' "x" means the x coordinate of the center point of the carbon atom yofC=240+rofC' "y" means the y coordinate of the center point of the carbon atom GraphicsWindow.FillEllipse(320,240,rofC*2,rofC*2)'carbon atom GraphicsWindow.BrushColor="green" GraphicsWindow.FillEllipse(xofC+160-rofCl,yofC-rofCl,rofCl*2,rofCl*2)'Chlorine atom on the right GraphicsWindow.FillEllipse(xofC-160-rofCl,yofC-rofCl,rofCl*2,rofCl*2)'Chlorine atom on the left GraphicsWindow.FillEllipse(xofC-rofCl,yofC-160-rofCl,rofCl*2,rofCl*2)'Chlorine atom from above GraphicsWindow.FillEllipse(xofC-rofCl,yofC+160-rofCl,rofCl*2,rofCl*2)'Chlorine atom below GraphicsWindow.PenColor="black" Turtle.Speed=10 Turtle.PenUp() Turtle.MoveTo(xofC,yofC) direction=0 GraphicsWindow.PenWidth=20 For i = 1 To 4 Turtle.Angle=direction Turtle.PenDown() GraphicsWindow.PenColor="black" Turtle.Move(45+rofC) GraphicsWindow.PenColor="green" Turtle.Move(45) Turtle.PenUp() Turtle.MoveTo(xofC,yofC) direction=direction+90 Turtle.PenDown() EndFor Turtle.Hide() End>LWP757-3.sb< Start>LWP757.sb< GraphicsWindow.Title="Molecular Challenge-Carbon tetrachloride(CCl4)" GraphicsWindow.Width=800 GraphicsWindow.Height=500 GraphicsWindow GraphicsWindow.BrushColor="black" GraphicsWindow.FillEllipse(320,240,60,60)'carbon atom' GraphicsWindow.PenColor="green" GraphicsWindow.BrushColor="green" GraphicsWindow.FillEllipse(470,220,100,100)'Chlorine atom on the right' GraphicsWindow.FillEllipse(130,220,100,100)'Chlorine atom on the left' GraphicsWindow.FillEllipse(300,50,100,100)'Chlorine atom from above' GraphicsWindow.FillEllipse(300,380,100,100)'Chlorine atom below' GraphicsWindow.PenColor="black" GraphicsWindow.PenWidth=10 Turtle.Speed=10 Turtle.PenUp() Turtle.MoveTo(320,270) Turtle.PenDown() Turtle.Angle=-90 Turtle.Move(45) GraphicsWindow.PenColor="green" Turtle.Move(45) Turtle.Turn(180) Turtle.PenUp() Turtle.Move(150) Turtle.PenDown() GraphicsWindow.PenColor="black" Turtle.Move(45) GraphicsWindow.PenColor="green" Turtle.Move(45) Turtle.PenUp() Turtle.MoveTo(350,270) Turtle.Angle=0 Turtle.Move(30) Turtle.PenDown() GraphicsWindow.PenColor="black" Turtle.Move(45) GraphicsWindow.PenColor="green" Turtle.Move(45) Turtle.Turn(180) Turtle.PenUp() Turtle.Move(150) Turtle.PenDown() GraphicsWindow.PenColor="black" Turtle.Move(45) GraphicsWindow.PenColor="green" Turtle.Move(45) Turtle.PenUp() End>LWP757.sb< Start>LWQ116.sb< 'JFH819 TextWindow.WriteLine("What is your First name?") ddd=TextWIndow.Read() TextWindow.WriteLine("What is your Last name?") yyy=TextWIndow.Read() 'make a sell feature' 'levels and xp' While (1000000<>x) TextWindow.ForegroundColor="cyan" 'You can use a subroutine to change the value of a variable you declared early in the program to a specific or random variable under certain conditions. mainmenu: TextWindow.ForegroundColor="green" p=1 d=d+p TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.WriteLine("Day:"+d) TextWindow.WriteLine("Today is: " + Clock.Date + ".") TextWindow.WriteLine("The current time is: " + Clock.Time + ".") TextWindow.WriteLine("The current day of the week is: " + Clock.Weekday + ".") TextWindow.ForegroundColor="cyan" TextWindow.WriteLine(" This is a Card Fighting RPG") TextWindow.WriteLine("you will choose a card and then fight other cards of other elements") TextWindow.WriteLine("This is the MainMenu") TextWindow.WriteLine(" P.S answer without Capitals User:"+ddd+" "+ yyy ) TextWindow.ForegroundColor="cyan" TextWindow.WriteLine(" Options") TextWindow.WriteLine("Plz Read This (Help)") TextWindow.WriteLine("(Battle)") TextWindow.WriteLine("(Cards)") TextWindow.WriteLine("(Leader boards)") TextWindow.WriteLine("(player stats)") TextWindow.ForegroundColor="green" TextWindow.WriteLine(" Money:"+m) TextWindow.WriteLine("exp:"+exp2+"/"+eexp) TextWindow.WriteLine("LvL:"+a) TextWindow.ForegroundColor="cyan" TextWindow.WriteLine("(Get a Job)") TextWindow.WriteLine("(trophies)") TextWindow.WriteLine("(special store items)") TextWindow.WriteLine("(store)") TextWindow.WriteLine("(Special store)") TextWindow.WriteLine(" ") TextWindow.WriteLine(" ") x=TextWindow.Read() If(x="cards")then Goto cards ElseIf(x="bank")then Goto bank ElseIf(x="battle")then Goto battle2 ElseIf(x="job")then Goto job ElseIf(x="store")then Goto store ElseIf(x="trophies")then Goto trophies ElseIf(x="cheat")then Goto cheat ElseIf(x="cheat2")then Goto cheat2 ElseIf(x="exp")then Goto exp13 ElseIf(x="help")then Goto help ElseIf(x="leader boards")then Goto leaderboards ElseIf(x="special store")then Goto specialstore ElseIf(x="special store items")then Goto specialstoreitems 'ElseIf(x="player stats" or x="playerstats")then ' Goto stats TextWindow.WriteLine("") bank: TextWindow.WriteLine("Your Total balence is:"+m) TextWindow.WriteLine("(Mainmenu)") x=TextWIndow.Read() If(x="mainmenu")then Goto exp13 startz: v=Math.GetRandomNumber (250) exp=Math.GetRandomNumber(100) items=Math.GetRandomNumber (1000) m=m+v TextWindow.WriteLine("You received $"+ v) exp2=exp2+exp TextWindow.WriteLine("You received "+exp+" exp") TextWindow.WriteLine(" ") TextWindow.WriteLine("Press (Exit) to exit battle") x=TextWindow.Read() TextWindow.WriteLine("Wow what a battle!") TextWindow.WriteLine("Press (mainmenu)") x=TextWindow.Read() If(x="mainmenu")then Goto exp13 battle2: TextWindow.WriteLine("The three starting cards are the (fire) (Ice) and (earth)") TextWindow.WriteLine("Which Card would you like to choose?") x=TextWindow.Read() If(x="fire") Then TextWindow.ForegroundColor="red" TextWindow.WriteLine("You have chosen Fire") TextWindow.WriteLine("what would you like to do?") TextWindow.WriteLine("fight") ElseIf(x="ice") then TextWindow.ForegroundColor="blue" TextWindow.WriteLine("You have chosen Ice") TextWindow.WriteLine("what would you like to do?") TextWindow.WriteLine("fight") ElseIf(x="earth") then TextWindow.ForegroundColor="green" TextWindow.WriteLine("You have chosen Earth") TextWindow.WriteLine("what would you like to do?") TextWindow.WriteLine("fight") EndIf TextWindow.ForegroundColor="cyan" x=TextWindow.Read() If(x="fight") Then TextWindow.WriteLine("(start when ready)") EndIf x=TextWindow.Read() If(x="start")then y=Math.GetRandomNumber (300) If(y>0 And y<100)then TextWindow.ForegroundColor="red" TextWindow.WriteLine("You will be fighting a (Fire) card") Goto starta ElseIf(y>101 And y<200)then TextWindow.ForegroundColor="blue" TextWindow.WriteLine("You will be fighting an (Ice) card") Goto startb ElseIf(y>201 And y<300)then TextWindow.ForegroundColor="green" TextWindow.WriteLine("You will be fighting an (earth) card") Goto startc 'Fire card' starta: TextWindow.ForegroundColor="cyan" TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then h=100 z=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+z) l=h-z If (l=h-z) then TextWindow.WriteLine("The opponents card now has:"+l) Goto startaa startaa: u=100 z=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+z) p=u-z If (p=u-z) then TextWindow.WriteLine("Your card now has:"+p) TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) w=l-r If (w=l-r) then TextWindow.WriteLine("The opponents card now has:"+w) Goto startaaa startaaa: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) q=p-r If (q=p-r) then TextWindow.WriteLine("Your card now has:"+q) TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) l=w-r If (l=w-r) then TextWindow.WriteLine("The opponents card now has:"+l) Goto startaab startaab: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) p=q-r If (p=q-r) then TextWindow.WriteLine("Your card now has:"+p) TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) w=l-r If (w=l-r) then TextWindow.WriteLine("The opponents card now has:"+w) Goto startabb startabb: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) q=p-r If (q=p-r) then TextWindow.WriteLine("Your card now has:"+q) If(q<0)then TextWindow.WriteLine("You Lose") Goto startz ElseIf(w<0)then TextWindow.WriteLine("You Win") Goto startz ElseIf(w<0 And q<0)then TextWindow.WriteLine("It was a Tie!, both cards died") Goto startz EndIf TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) l=w-r If (l=w-r) then TextWindow.WriteLine("The opponents card now has:"+l) Goto startaac startaac: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) p=q-r If (p=q-r) then TextWindow.WriteLine("Your card now has:"+p) If(p<0)then TextWindow.WriteLine("You Lose") Goto startz ElseIf(l<0)then TextWindow.WriteLine("You Win") Goto startz ElseIf(l<0 And p<0)then TextWindow.WriteLine("It was a Tie!, both cards died") Goto startz EndIf TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) w=l-r If (w=l-r) then TextWindow.WriteLine("The opponents card now has:"+w) Goto startacc startacc: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) q=p-r If (q=p-r) then TextWindow.WriteLine("Your card now has:"+q) If(q<0)then TextWindow.WriteLine("You Lose") Goto startz ElseIf(w<0)then TextWindow.WriteLine("You Win") Goto startz ElseIf(w<0 And q<0)then TextWindow.WriteLine("It was a Tie!, both cards died") Goto startz EndIf TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) l=w-r If (l=w-r) then TextWindow.WriteLine("The opponents card now has:"+l) Goto startaad startaad: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) p=q-r If (p=q-r) then TextWindow.WriteLine("Your card now has:"+p) If(p<0)then TextWindow.WriteLine("You Lose") Goto startz ElseIf(l<0)then TextWindow.WriteLine("You Win") Goto startz ElseIf(l<0 And p<0)then TextWindow.WriteLine("It was a Tie!, both cards died") Goto startz EndIf TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) w=l-r If (w=l-r) then TextWindow.WriteLine("The opponents card now has:"+w) Goto startadd startadd: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) q=p-r If (q=p-r) then TextWindow.WriteLine("Your card now has:"+q) If(q<0)then TextWindow.WriteLine("You Lose") Goto startz ElseIf(w<0)then TextWindow.WriteLine("You Win") Goto startz ElseIf(w<0 And q<0)then TextWindow.WriteLine("It was a Tie!, both cards died") Goto startz EndIf TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) l=w-r If (l=w-r) then TextWindow.WriteLine("The opponents card now has:"+l) Goto startaae startaae: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) p=q-r If (p=q-r) then TextWindow.WriteLine("Your card now has:"+p) If(p<0)then TextWindow.WriteLine("You Lose") Goto startz ElseIf(l<0)then TextWindow.WriteLine("You Win") Goto startz ElseIf(l<0 And p<0)then TextWindow.WriteLine("It was a Tie!, both cards died") Goto startz EndIf TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) w=l-r If (w=l-r) then TextWindow.WriteLine("The opponents card now has:"+w) Goto startaee startaee: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) q=p-r If (q=p-r) then TextWindow.WriteLine("Your card now has:"+q) If(q<0)then TextWindow.WriteLine("You Lose") Goto startz ElseIf(w<0)then TextWindow.WriteLine("You Win") Goto startz ElseIf(w<0 And q<0)then TextWindow.WriteLine("It was a Tie!, both cards died") Goto startz 'Ice Card' startb: TextWindow.ForegroundColor="cyan" TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then h=100 z=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+z) l=h-z If (l=h-z) then TextWindow.WriteLine("The opponents card now has:"+l) Goto startggg startggg: u=100 z=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+z) p=u-z If (p=u-z) then TextWindow.WriteLine("Your card now has:"+p) TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) w=l-r If (w=l-r) then TextWindow.WriteLine("The opponents card now has:"+w) Goto startggh startggh: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) q=p-r If (q=p-r) then TextWindow.WriteLine("Your card now has:"+q) TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) l=w-r If (l=w-r) then TextWindow.WriteLine("The opponents card now has:"+l) Goto starthhh starthhh: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) p=q-r If (p=q-r) then TextWindow.WriteLine("Your card now has:"+p) TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) w=l-r If (w=l-r) then TextWindow.WriteLine("The opponents card now has:"+w) Goto starthhi starthhi: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) q=p-r If (q=p-r) then TextWindow.WriteLine("Your card now has:"+q) If(q<0)then TextWindow.WriteLine("You Lose") Goto startz ElseIf(w<0)then TextWindow.WriteLine("You Win") Goto startz ElseIf(w<0 And q<0)then TextWindow.WriteLine("It was a Tie!, both cards died") Goto startz EndIf TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) l=w-r If (l=w-r) then TextWindow.WriteLine("The opponents card now has:"+l) Goto starthii starthii: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) p=q-r If (p=q-r) then TextWindow.WriteLine("Your card now has:"+p) If(p<0)then TextWindow.WriteLine("You Lose") Goto startz ElseIf(l<0)then TextWindow.WriteLine("You Win") Goto startz ElseIf(l<0 And p<0)then TextWindow.WriteLine("It was a Tie!, both cards died") Goto startz EndIf TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) w=l-r If (w=l-r) then TextWindow.WriteLine("The opponents card now has:"+w) Goto startiii startiii: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) q=p-r If (q=p-r) then TextWindow.WriteLine("Your card now has:"+q) If(q<0)then TextWindow.WriteLine("You Lose") Goto startz ElseIf(w<0)then TextWindow.WriteLine("You Win") Goto startz ElseIf(w<0 And q<0)then TextWindow.WriteLine("It was a Tie!, both cards died") Goto startz EndIf TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) l=w-r If (l=w-r) then TextWindow.WriteLine("The opponents card now has:"+l) Goto startiij startiij: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) p=q-r If (p=q-r) then TextWindow.WriteLine("Your card now has:"+p) If(p<0)then TextWindow.WriteLine("You Lose") Goto startz ElseIf(l<0)then TextWindow.WriteLine("You Win") Goto startz ElseIf(l<0 And p<0)then TextWindow.WriteLine("It was a Tie!, both cards died") Goto startz EndIf TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) w=l-r If (w=l-r) then TextWindow.WriteLine("The opponents card now has:"+w) Goto startijj startijj: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) q=p-r If (q=p-r) then TextWindow.WriteLine("Your card now has:"+q) If(q<0)then TextWindow.WriteLine("You Lose") Goto startz ElseIf(w<0)then TextWindow.WriteLine("You Win") Goto startz ElseIf(w<0 And q<0)then TextWindow.WriteLine("It was a Tie!, both cards died") Goto startz EndIf TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) l=w-r If (l=w-r) then TextWindow.WriteLine("The opponents card now has:"+l) Goto startjjj startjjj: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) p=q-r If (p=q-r) then TextWindow.WriteLine("Your card now has:"+p) If(p<0)then TextWindow.WriteLine("You Lose") Goto startz ElseIf(l<0)then TextWindow.WriteLine("You Win") Goto startz ElseIf(l<0 And p<0)then TextWindow.WriteLine("It was a Tie!, both cards died") Goto startz EndIf TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) w=l-r If (w=l-r) then TextWindow.WriteLine("The opponents card now has:"+w) Goto startjjk startjjk: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) q=p-r If (q=p-r) then TextWindow.WriteLine("Your card now has:"+q) If(q<0)then TextWindow.WriteLine("You Lose") Goto startz ElseIf(w<0)then TextWindow.WriteLine("You Win") Goto startz ElseIf(w<0 And q<0)then TextWindow.WriteLine("It was a Tie!, both cards died") Goto startz 'Earth Card' startc: TextWindow.ForegroundColor="cyan" TextWindow.WriteLine("(a) to Attack") x=TextWindow.Read() If(x="a") then h=100 z=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+z) l=h-z If (l=h-z) then TextWindow.WriteLine("The opponents card now has:"+l) Goto startm startm: u=100 z=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+z) p=u-z If (p=u-z) then TextWindow.WriteLine("Your card now has:"+p) TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) w=l-r If (w=l-r) then TextWindow.WriteLine("The opponents card now has:"+w) Goto startmm startmm: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) q=p-r If (q=p-r) then TextWindow.WriteLine("Your card now has:"+q) TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) l=w-r If (l=w-r) then TextWindow.WriteLine("The opponents card now has:"+l) Goto startmmm startmmm: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) p=q-r If (p=q-r) then TextWindow.WriteLine("Your card now has:"+p) TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) w=l-r If (w=l-r) then TextWindow.WriteLine("The opponents card now has:"+w) Goto startmmn startmmn: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) q=p-r If (q=p-r) then TextWindow.WriteLine("Your card now has:"+q) If(q<0)then TextWindow.WriteLine("You Lose") Goto startz ElseIf(w<0)then TextWindow.WriteLine("You Win") Goto startz ElseIf(w<0 And q<0)then TextWindow.WriteLine("It was a Tie!, both cards died") Goto startz EndIf TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) l=w-r If (l=w-r) then TextWindow.WriteLine("The opponents card now has:"+l) Goto startmnn startmnn: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) p=q-r If (p=q-r) then TextWindow.WriteLine("Your card now has:"+p) If(p<0)then TextWindow.WriteLine("You Lose") Goto startz ElseIf(l<0)then TextWindow.WriteLine("You Win") Goto startz ElseIf(l<0 And p<0)then TextWindow.WriteLine("It was a Tie!, both cards died") Goto startz EndIf TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) w=l-r If (w=l-r) then TextWindow.WriteLine("The opponents card now has:"+w) Goto startnnn startnnn: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) q=p-r If (q=p-r) then TextWindow.WriteLine("Your card now has:"+q) If(q<0)then TextWindow.WriteLine("You Lose") Goto startz ElseIf(w<0)then TextWindow.WriteLine("You Win") Goto startz ElseIf(w<0 And q<0)then TextWindow.WriteLine("It was a Tie!, both cards died") Goto startz EndIf TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) l=w-r If (l=w-r) then TextWindow.WriteLine("The opponents card now has:"+l) Goto startnno startnno: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) p=q-r If (p=q-r) then TextWindow.WriteLine("Your card now has:"+p) If(p<0)then TextWindow.WriteLine("You Lose") Goto startz ElseIf(l<0)then TextWindow.WriteLine("You Win") Goto startz ElseIf(l<0 And p<0)then TextWindow.WriteLine("It was a Tie!, both cards died") Goto startz EndIf TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) w=l-r If (w=l-r) then TextWindow.WriteLine("The opponents card now has:"+w) Goto startnoo startnoo: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) q=p-r If (q=p-r) then TextWindow.WriteLine("Your card now has:"+q) If(q<0)then TextWindow.WriteLine("You Lose") Goto startz ElseIf(w<0)then TextWindow.WriteLine("You Win") Goto startz ElseIf(w<0 And q<0)then TextWindow.WriteLine("It was a Tie!, both cards died") Goto startz EndIf TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) l=w-r If (l=w-r) then TextWindow.WriteLine("The opponents card now has:"+l) Goto startooo startooo: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) p=q-r If (p=q-r) then TextWindow.WriteLine("Your card now has:"+p) If(p<0)then TextWindow.WriteLine("You Lose") Goto startz ElseIf(l<0)then TextWindow.WriteLine("You Win") Goto startz ElseIf(l<0 And p<0)then TextWindow.WriteLine("It was a Tie!, both cards died") Goto startz EndIf TextWindow.WriteLine("(vb) to Attack") x=TextWindow.Read() If(x="vb") then r=Math.GetRandomNumber (30) TextWindow.WriteLine("You did:"+r) w=l-r If (w=l-r) then TextWindow.WriteLine("The opponents card now has:"+w) Goto startoop startoop: r=Math.GetRandomNumber (30) TextWindow.WriteLine("Your opponent did:"+r) q=p-r If (q=p-r) then TextWindow.WriteLine("Your card now has:"+q) If(q<0)then TextWindow.WriteLine("You Lose") Goto startz ElseIf(w<0)then TextWindow.WriteLine("You Win") Goto startz ElseIf(w<0 And q<0)then TextWindow.WriteLine("It was a Tie!, both cards died") Goto startz cards: TextWindow.WriteLine("1(Fire) 2(Ice) 3(Earth)") x=TextWindow.Read() If(x=1) Then Goto gh ElseIf(x=2) then Goto hg ElseIf(x=3) then Goto hhg gh: TextWindow.WriteLine(" Stats") TextWindow.WriteLine("HP:100") TextWindow.WriteLine("MP:80") TextWindow.WriteLine("Damage: 1-30") TextWindow.WriteLine("Movment:5 KP/H") TextWindow.WriteLine("Evade 12%") TextWindow.WriteLine("(MainMenu)") x=TextWindow.Read() If(x="mainmenu") then Goto mainmenu hg: TextWindow.WriteLine(" Stats") TextWindow.WriteLine("HP:100") TextWindow.WriteLine("MP:70") TextWindow.WriteLine("Damage: 1-30") TextWindow.WriteLine("Movment:7 KP/H") TextWindow.WriteLine("Evade 10%") TextWindow.WriteLine("(MainMenu)") x=TextWindow.Read() If(x="mainmenu") then Goto mainmenu hhg: TextWindow.WriteLine(" Stats") TextWindow.WriteLine("HP:110") TextWindow.WriteLine("MP:50") TextWindow.WriteLine("Damage: 1-30") TextWindow.WriteLine("Movment:4 KP/H") TextWindow.WriteLine("Evade 9%") TextWindow.WriteLine("(MainMenu)") x=TextWindow.Read() If(x="mainmenu") then Goto mainmenu job: TextWindow.WriteLine("What job would you like to take") TextWindow.WriteLine(" Options") TextWindow.WriteLine("Miner") TextWindow.WriteLine("Worker") TextWindow.WriteLine("Teacher") x=TextWindow.Read() If(x="miner")then Goto miner ElseIf(x="worker")then Goto worker ElseIf(x="teacher")then Goto teacher miner: TextWindow.WriteLine("You chose to be a miner") TextWindow.WriteLine("repeat after me to do your job") TextWindow.WriteLine("Press (go) to start") x=TextWindow.Read() If(x="go")then TextWindow.WriteLine("---mine") x=TextWindow.Read() If(x="mine")then TextWindow.WriteLine("---mine") x=TextWindow.Read() If(x="mine")then TextWindow.WriteLine("---mine") x=TextWindow.Read() If(x="mine")then TextWindow.WriteLine("---mine") x=TextWindow.Read() If(x="mine")then TextWindow.WriteLine("---mine") x=TextWindow.Read() If(x="mine")then TextWindow.WriteLine("You just made $125") j=125 If(j=125)then vas=Math.GetRandomNumber(100) exp2=exp2+vas m=m+j TextWindow.WriteLine("You got "+vas+" exp") TextWindow.WriteLine("You currently have $:"+m) TextWindow.WriteLine("Press (mainmenu)") x=TextWindow.Read() If(x="mainmenu")then Goto exp13 worker: TextWindow.WriteLine("You chose to be a Office Worker") TextWindow.WriteLine("repeat after me to do your job") TextWindow.WriteLine("Press (go) to start") x=TextWindow.Read() If(x="go")then TextWindow.WriteLine("---work") x=TextWindow.Read() If(x="work")then TextWindow.WriteLine("---work") x=TextWindow.Read() If(x="work")then TextWindow.WriteLine("---work") x=TextWindow.Read() If(x="work")then TextWindow.WriteLine("---work") x=TextWindow.Read() If(x="work")then TextWindow.WriteLine("---work") x=TextWindow.Read() If(x="work")then TextWindow.WriteLine("You just made $140") i=140 If(i=140)then fgr=Math.GetRandomNumber(100) exp2=exp2+fgr m=m+i TextWindow.WriteLine("You got "+fgr+" exp") TextWindow.WriteLine("You currently have $:"+m) TextWindow.WriteLine("Press (mainmenu)") x=TextWindow.Read() If(x="mainmenu")then Goto exp13 teacher: TextWindow.WriteLine("You chose to be a Teacher") TextWindow.WriteLine("repeat after me to do your job") TextWindow.WriteLine("Press (go) to start") x=TextWindow.Read() If(x="go")then TextWindow.WriteLine("---teach") x=TextWindow.Read() If(x="teach")then TextWindow.WriteLine("---teach") x=TextWindow.Read() If(x="teach")then TextWindow.WriteLine("---teach") x=TextWindow.Read() If(x="teach")then TextWindow.WriteLine("---teach") x=TextWindow.Read() If(x="teach")then TextWindow.WriteLine("---teach") x=TextWindow.Read() If(x="teach")then TextWindow.WriteLine("You just made $150") o=150 If(o=150) then vfg=Math.GetRandomNumber(100) exp2=exp2+vfg m=m+o TextWindow.WriteLine("You got "+vfg+" exp") TextWindow.WriteLine("You currently have $:"+m) TextWindow.WriteLine("Press (mainmenu)") x=TextWindow.Read() If(x="mainmenu")then Goto exp13 store: TextWindow.WriteLine("Welcome to the General store") TextWindow.WriteLine("what would you like to buy?") TextWindow.WriteLine(" Options") TextWindow.WriteLine("(1) Golden trophy $1000") TextWindow.WriteLine("(2) Silver trophy $800") TextWindow.WriteLine("(3) Bronze trophy $500") x=TextWindow.Read() If(x=1 And m>=1000)then Goto golden ElseIf(x=1 And m<1000)then Goto goldena ElseIf(x=2 And m>=800)then Goto silver ElseIf(x=2 And m<800)then Goto silvera ElseIf(x=3 And m>=500)then Goto bronze ElseIf(x=3 And m<500)then Goto bronzea goldena: TextWindow.WriteLine("Error, you only have $:"+m) TextWindow.WriteLine("If there is no number it means you dont have any money") TextWindow.WriteLine(" main menu") x=TextWindow.Read() If(x="mainmenu")then Goto mainmenu silvera: TextWindow.WriteLine("Error, you only have $:"+m) TextWindow.WriteLine("If there is no number it means you dont have any money") TextWindow.WriteLine(" main menu") x=TextWindow.Read() If(x="mainmenu")then Goto mainmenu bronzea: TextWindow.WriteLine("Error, you only have $:"+m) TextWindow.WriteLine("If there is no number it means you dont have any money") TextWindow.WriteLine(" main menu") x=TextWindow.Read() If(x="mainmenu")then Goto mainmenu golden: TextWindow.WriteLine("You bought the Golden trophy") b=1 j2=j2+b m=m-1000 TextWindow.WriteLine("You currently have $:"+m) TextWindow.WriteLine("Press (mainmenu)") x=TextWindow.Read() If(x="mainmenu")then Goto mainmenu silver: TextWindow.WriteLine("You bought the Silver trophy") p=1 a2=a2+p m=m-800 TextWindow.WriteLine("You currently have $:"+m) TextWindow.WriteLine("Press (mainmenu)") x=TextWindow.Read() If(x="mainmenu")then Goto mainmenu bronze: TextWindow.WriteLine("You bought the Bronze trophy") l=1 r2=r2+l m=m-500 TextWindow.WriteLine("You currently have $:"+m) TextWindow.WriteLine("Press (mainmenu)") x=TextWindow.Read() If(x="mainmenu")then Goto mainmenu trophies: TextWindow.WriteLine("Golden trophies:"+j2) TextWindow.WriteLine("") TextWindow.WriteLine("Silver trophies:"+a2) TextWindow.WriteLine("") TextWindow.WriteLine("Bronze trophies:"+r2) TextWindow.WriteLine("(Mainmenu)") x=TextWindow.Read() If(x="mainmenu")then Goto mainmenu exp13: If(exp2>0 And exp2<=80)then Goto exp100 ElseIf(exp2>80 And exp2<=150)then Goto exp200 ElseIf(exp2>150 And exp2<=280)then Goto exp300 ElseIf(exp2>280 And exp2<=400)then Goto exp400 ElseIf(exp2>400 And exp2<=540)then Goto exp500 ElseIf(exp2>540 And exp2<=700)then Goto exp600 ElseIf(exp2>700 And exp2<=900)then Goto exp700 ElseIf(exp2>900 And exp2<=1150)then Goto exp800 ElseIf(exp2>1150 And exp2<=1400)then Goto exp900 ElseIf(exp2>1400 And exp2<=1700)then Goto exp000 ElseIf(exp2>1700 And exp2<=2000)then Goto exp010 exp100: a=0 eexp=80 Goto mainmenu exp200: a=1 eexp=150 Goto mainmenu exp300: a=2 eexp=280 goto mainmenu exp400: a=3 eexp=400 Goto mainmenu exp500: a=4 eexp=540 Goto mainmenu exp600: a=5 eexp=700 Goto mainmenu exp700: a=6 eexp=900 Goto mainmenu exp800: a=7 eexp=1150 Goto mainmenu exp900: a=8 eexp=1400 Goto mainmenu exp000: a=9 eexp=1700 Goto mainmenu exp010: a=10 eexp=2000 Goto mainmenu cheat: m=m+10000 Goto mainmenu cheat2: exp2=exp2+200 Goto exp13 help: TextWindow.WriteLine("This is a multi purpose program") TextWindow.WriteLine("it is mainly about money and fighting") TextWindow.WriteLine(" Here are all the features") TextWindow.WriteLine("fighting for money and exp") TextWindow.WriteLine("an exp system, you can lvl up") TextWindow.WriteLine("a money system, you can gain money") TextWindow.WriteLine("you can spend money on different types of trophies") TextWindow.WriteLine(" there is a clock at the top of the main menu") TextWindow.WriteLine("their is also a day counter") TextWindow.WriteLine("you can check you cards starts in the cards section") TextWindow.WriteLine("you can get a job and you will be paid for you efforts") TextWindow.WriteLine("Their is a special store where you buy new items with trophies") TextWindow.WriteLine("(mainmenu)") x=TextWindow.Read() If(x="mainmenu")then Goto exp13 Goto exp13 'stats: ' TextWindow.WriteLine("Welcome to Your Stats") 'TextWindow.WriteLine("You will receive (5) skill points every lvl") 'TextWindow.WriteLine(" Skills ") 'TextWindow.WriteLine("Strength:"+aaa) 'TextWindow.WriteLine("Stamina:"+bbb) 'TextWindow.WriteLine("Health:"+ccc) 'TextWindow.WriteLine("Mana:"+ddd) 'TextWindow.WriteLine("Agility:"+eee) gg=0 ff=0 leaderboards: TextWindow.WriteLine(" Leader Boards") TextWindow.WriteLine("Money: "+m) TextWindow.WriteLine("Exp: "+exp2) TextWindow.WriteLine("(mainmenu)") x=TextWindow.Read() If(x="mainmenu")then Goto mainmenu specialstore: TextWindow.WriteLine("Special Store") TextWindow.WriteLine("You can Buy special items with trophies") TextWindow.WriteLine(" You currently have ") TextWindow.WriteLine("Golden trophies:"+j2) TextWindow.WriteLine("") TextWindow.WriteLine("Silver trophies:"+a2) TextWindow.WriteLine("") TextWindow.WriteLine("Bronze trophies:"+r2) TextWindow.WriteLine("") TextWindow.WriteLine("Would you like to buy somthing from the special shop?") TextWindow.WriteLine("(yes) (No)") x=TextWindow.Read() If(x="yes")then TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.WriteLine("") TextWindow.WriteLine("Special shop") TextWindow.WriteLine("Which one would you like to buy?") TextWindow.WriteLine("") TextWindow.WriteLine("(1) Golden necklace $2 Gold") TextWindow.WriteLine("(2) Hammer of Wrath $3 Silver") TextWindow.WriteLine("(3) Ak-47 $1 Gold, $ 1 Silver, $ 1 Bronze") TextWindow.WriteLine("(4) Mini-UZi $2 Silver, $1 Bronze") TextWindow.WriteLine("(5) Diamond $5 Bronze") x=TextWindow.Read() If(x=1 And j2>=2) then Goto gold Elseif(x=1 And j2<2)then Goto golda ElseIf(x=2 And a2>=3)then Goto hammer ElseIf(x=2 And a2<3)then Goto hammera ElseIf(x=3 And j2>=1 And a2>=1 And r2>=1)then Goto ak ElseIf(x=3 And j2<1 And a2<1 And r2<1)then Goto aka ElseIf(x=4 And a2>=2 And r2>=1)then Goto mini ElseIf(x=4 And a2<2 And r2<1)then Goto minia ElseIf(x=5 And r2>=5)then Goto diamond ElseIf(x=5 And r2<5)then Goto diamonda gold: vvvv=1 gg2=gg2+vvvv ccc=2 j2=j2-ccc TextWindow.WriteLine("You Bought a Gold Necklace") x=TextWindow.Read() Goto mainmenu golda: TextWindow.WriteLine("ERROR, not enough money") x=TextWindow.Read() Goto mainmenu hammer: aaaa=1 hhh2=hhh2+aaaa ccc=3 a2=a2-ccc TextWindow.WriteLine("You Bought a Hammer of Wrath") x=TextWindow.Read() Goto mainmenu hammera: TextWindow.WriteLine("ERROR, not enough money") x=TextWindow.Read() Goto mainmenu ak: kkkk=1 lll2=lll2+kkkk ccc=1 kkk=1 ppp=1 a2=a2-ccc j2=j2-kkk r2=r2-ppp TextWindow.WriteLine("You Bought an AK-47") x=TextWindow.Read() Goto mainmenu aka: TextWindow.WriteLine("ERROR, not enough money") x=TextWindow.Read() Goto mainmenu mini: uuuu=1 pppp2=pppp2+uuuu zzz=2 yyy=1 a2=a2-zzz r2=r2-yyy TextWindow.WriteLine("You Bought a Mini-UZi") x=TextWindow.Read() Goto mainmenu minia: TextWindow.WriteLine("ERROR, not enough money") x=TextWindow.Read() Goto mainmenu Goto mainmenu diamond: qqqq=1 rrrr2=rrrr2+qqqq eee=5 r2=r2-eee TextWindow.WriteLine("You Bought a Diamond") x=TextWindow.Read() Goto mainmenu diamonda: TextWindow.WriteLine("ERROR, not enough money") x=TextWindow.Read() Goto mainmenu specialstoreitems: TextWindow.WriteLine(" Your special store items ") TextWindow.WriteLine(" Gold necklace: "+gg2) TextWindow.WriteLine(" Hammer of Wrath: "+hhh2) TextWindow.WriteLine(" AK-47: "+lll2) TextWindow.WriteLine(" Mini-UZI: "+pppp2) TextWindow.WriteLine(" Diamond: "+rrrr2) x=TextWindow.Read() Goto mainmenu If(items>0 And items<=500)then Goto itemsa ElseIf(items>500 And items<=700)then Goto itemsb ElseIf(items>700 And items<=1000)then Goto itemsc itemsa: itemsaa=itemsaa+items itemsb: itemsc: EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndIf EndWhile End>LWQ116.sb< Start>LWQ467-0.sb< ' Challenge of the month March 2013 Metronome 2013/03/04 By NaochanON ' LWQ467-0 GUI() Controls.ButtonClicked=Onclicked While "true" while rotate="true" N=N+PM Shapes.SetText(msg,"Pitch="+WY) ' show pitch '------------------------------------------------------------------------- 'TL=BH*0.7 NewTX=TL/2*math.Sin(Math.GetRadians(N))+tx+TW/2 NewTY=TL/2*(1- math.cos(Math.GetRadians(N)))+ty Shapes.Move(tact[1],NewTX,NewTY) ' move tact Shapes.Rotate(tact[1],N) '------------------------------------------------------------------------- WL=TL-WY+TL2/2 NewWX=WL*math.Sin(Math.GetRadians(N))+tx-TW2/2+TW NewWY=ty+TL-WL*math.cos(Math.GetRadians(N))-TL2/2 Shapes.Move(tact[2],NewWX,NewWY) ' move weight Shapes.Rotate(tact[2],N) '------------------------------------------------------------------------- dt=(200-wy)*0.2 Program.Delay(dt) ' timing delay '------------------------------------------------------------------------- If Math.Abs(N)>50 Then ' turning if N=+50 or -50 PM=-PM If PM=-1 then Sound.PlayClick() EndIf EndIf endwhile Program.Delay(100) endwhile Sub onclicked cap=Controls.GetButtonCaption(Controls.LastClickedButton) If cap="Go!" Then rotate="true" Controls.SetButtonCaption(btn,"Stop") ElseIf cap="Stop" then Controls.SetButtonCaption(btn,"Go!") rotate="false" N=0 TactPosition() elseif cap="+" then WY=WY+5 If WY>200 then WY=200 EndIf TactPosition() elseif cap="-" then WY=WY-5 If WY<60 then WY=60 EndIf TactPosition() EndIf EndSub Sub GUI GraphicsWindow.Title=" Small Metronome !! " x0=150 ' position X y0=100 ' position Y BW=100 ' Width BH=400 ' Height WY=170 ' weight position TW=6 ' tact width TL=BH*0.7 ' tact height TW2=40 ' weight Width TL2=20 ' weight height '------------------------------------------------------------------------- GraphicsWindow.Width=BW*5 GraphicsWindow.Height=Y0+BH+20 GraphicsWindow.BackgroundColor="lightcyan" GraphicsWindow.FontSize=20 btn= Controls.AddButton("Go!",x0+1.5*BW,BH-50) ' Go! or Stop button PBTN=Controls.AddButton("+",x0+1.5*BW,BH+50) ' Plus pitch button Controls.SetSize(PBTN,50,40) MBTN=Controls.AddButton("-",x0+1.5*BW,BH) ' Minus Pitch button Controls.SetSize(MBTN,50,40) '------------------------------------------------------------------------- msg= Shapes.AddText("Pitch= ") ' message Shapes.Move(msg,x0,20) '------------------------------------------------------------------------- GraphicsWindow.BrushColor="Darkgreen" GraphicsWindow.PenColor="Lime" body[1]=Shapes.AddEllipse(BW,BH) ' body Shapes.Move(body[1],x0,y0) GraphicsWindow.BrushColor="Azure" body[2]=Shapes.AddEllipse(BW*0.9,BH*0.9) Shapes.Move(body[2],Shapes.GetLeft(body[1])+5,Shapes.GetTop(body[1])+10) '------------------------------------------------------------------------- GraphicsWindow.PenColor="Red" tact[1]=Shapes.AddRectangle(TW,TL) ' tact w=6 GraphicsWindow.BrushColor="Darkgray" GraphicsWindow.PenColor="gray" tact[2]=Shapes.AddRectangle(TW2,TL2) TactPosition() '------------------------------------------------------------------------- GraphicsWindow.BrushColor="darkgreen" body[3]=Shapes.AddRectangle(BW,BH/3) ' base Shapes.Move(body[3],Shapes.GetLeft(body[1]),Shapes.GetTop(body[1])+BH/3*2) Shapes.SetOpacity(body[3],90) '------------------------------------------------------------------------- tx= Shapes.GetLeft(tact[1]) ' tact position X ty= Shapes.GetTop(tact[1]) ' tact position Y rotate="false" PM=1 ' Plus Minus EndSub Sub TactPosition Shapes.Move(tact[1],Shapes.GetLeft(body[1])+BW/2-tw/2,Shapes.GetTop(body[1])+20) Shapes.Rotate(tact[1],N) Shapes.Move(tact[2],Shapes.GetLeft(tact[1])-Tw2/2+TW/2,Shapes.GetTop(tact[1])+WY-TL2/2) Shapes.Rotate(tact[2],N) endsub End>LWQ467-0.sb< Start>LWQ763.sb< dw=1200 dh=900 aa=130 ya=300 r35=600 f4=10 LDUtilities.ShowErrors="false LDUtilities.ShowNoShapeErrors="false GraphicsWindow.Width =dw GraphicsWindow.Height=dh GraphicsWindow.Left=1 GraphicsWindow.Top =11 TextWindow.Show () TextWindow.Left =1220 TextWindow.Top=10 args=0 kk=1 pzz="1 1|18 1|1 2|2 2|13 2|14 2|15 2|16 2|17 2|18 2|1 3|2 3|13 3|14 3|15 3|16 3|17 3|18 3|1 4|2 4|3 4|4 4|5 4|6 4|7 4|8 4|9 4|10 4|11 4|12 4|13 4|14 4|15 4|16 4|17 4|18 4|1 5|2 5|3 5|4 5|5 5|6 5|7 5|8 5|9 5|10 5|11 5|12 5|13 5|14 5|15 5|16 5|17 5|18 5|1 6|2 6|2.01 6|2.02 6|2.03 6|2.04 6|2.05 6|2.06 6|2.07 6|2.08 6|2.09 6|2.10 6|2.11 6|2.12 6|2.13 6|2.14 6|3 6|4 6|5 6|6 6|7 6|8 6|9 6|10 6|11 6|12 6|13 6|14 6|15 6|16 6|17 6|18 6|1 7|2 7|2.01 7|2.02 7|2.03 7|2.04 7|2.05 7|2.06 7|2.07 7|2.08 7|2.09 7|2.10 7|2.11 7|2.12 7|2.13 7|2.14 7|3 7|4 7|5 7|6 7|7 7|8 7|9 7|10 7|11 7|12 7|13 7|14 7|15 7|16 7|17 7|18 7 pzm=ldtext.Split (pzz "|") elm="H Hydrogen c. hydro+gen:water-forming|He Hel~ a. helios:sun|Li Lith~ w. lithos:stone|Be Beryll~ n. beryl (mineral)|B Boron n. borax (mineral)|C Carbon w. carbo:coal|N Nitrogen c. nitron+gen:niter-forming|O Oxygen c. oxy+gen:acid-forming|F Fluorine w. fluere:to flow|Ne Neon w. neos:new|Na Sod~ w. soda:natr~ |Mg Magnes~ g. Magnesia, district in Greece|Al Al`in~ w. al`ina, a compound (orig. al`in`)|Si Silicon w. silex:flint (orig. silic~)|P Phosphorus w. phoosphoros:carrying light|S Sulfur w. sulphur:fire and brimstone|Cl Chlorine r. chloros:greenish yellow|Ar Argon w. argos:idle|K Potass~ w. potassa:kal~|Ca Calc~ w. calx:lime|Sc Scand~ g. Scandia:Scandinavia|Ti Titan~ m. Titans:the sons of the Earth|V Vanad~ w. Vanadis, an Old Norse name|Cr Chrom~ w. chroma:color|Mn Manganese w. corrupted from magnesia negra|Fe Iron w. ferr`|Co Cobalt w. Kobold:goblin|Ni Nickel w. kopparnickel, cont.nickel|Cu Copper w. cupr`|Zn Zinc w. Zink|Ga Gall~ g. Gallia:France|Ge German~ g. Germania:Germany|As Arsenic w. arsenic`|Se Selen~ a. selene:moon |Br Bromine w. bromos:stench|Kr Krypton w. kryptos:hidden|Rb Rubid~ r. rubidus:deep red|Sr Stront~ g. Strontian, Scotland|Y Yttr~ g. Ytterby, Sweden|Zr Zircon~ r. Zargun:gold-colored|Nb Niob~ m. Niobe, daughter of king Tantalus|Mo Molybden` w. molybdos:lead|Tc Technet~ w. tekhnètos:artificial|Ru Ruthen~ g. Ruthenia:Russia|Rh Rhod~ r. rhodos:rose coloured|Pd Pallad~ a. Pallas, asteroid|Ag Silver w. argent`|Cd Cadm~ m. cadmia:King Kadmos|In Ind~ r. indigo|Sn Tin w. stann`|Sb Antimony c. stibi`, composed from anti+monos, against+alone|Te Tellur~ a. tellus:earth|I Iodine r. iode (after ioeides:violet)|Xe Xenon w. xenos:strange|Cs Caes~ r. caesius:sky blue|Ba Bar~ w. barys:heavy|La Lanthan` w. lanthanein:to lie hidden|Ce Cer~ a. Ceres, asteroid|Pr Praseodym~ c. praseios+didymos:green twin|Nd Neodym~ c. neos+didymos:new twin|Pm Prometh~ m. Prometheus, Greek myth.|Sm Samar~ n. Samarskite, mineral|Eu Europ~ g. Europe|Gd Gadolin~ p. Johan Gadolin, chem.|Tb Terb~ g. Ytterby, Sweden|Dy Dyspros~ c. dysprositos:hard to get|Ho Holm~ g. Holmia:Stockholm|Er Erb~ g. Ytterby, Sweden|Tm Thul~ g. Thule:Scandinavia |Yb Ytterb~ g. Ytterby, Sweden|Lu Lutet~ g. Lutetia:Paris|Hf Hafn~ g. Hafnia:Copenhagen |Ta Tantal` m. King Tantalus, father of Niobe|W Tungsten c. tung sten:heavy stone (W:wolframite)|Re Rhen~ g. Rhenus:river Rhine|Os Osm~ w. osmè =smell|Ir Irid~ m. Iris, goddess of the rainbow|Pt Platin` w. platina:little silver|Au Gold w. aur`|Hg Mercury c. mercurius, hydr+argyros:water+silver|Tl Thall~ c. thallos:green twig|Pb Lead w. pl`b` |Bi Bismuth w. old German: 'white mass'|Po Polon~ g. Polonia:Poland|At Astatine w. astatos:unstable|Rn Radon w. from rad~|Fr Franc~ g. Francia:France|Ra Rad~ w. radius:ray|Ac Actin~ w. aktis:ray|Th Thor~ m. Thor, Scand. god of thunder|Pa Protactin~ c. protos:first+actin~|U Uran~ a. Uranus, planet|Np Neptun~ a. Neptune, planet|Pu Pluton~ a. Pluto, dwarf planet|Am Americ~ g. The Americas|Cm Cur~ p. Pierre+Marie Curie|Bk Berkel~ g. Berkeley, California|Cf Californ~ g. California|Es Einstein~ p. Albert Einstein, phys.|Fm Ferm~ p. Enrico Fermi, phys.|Md Mendelev~ p. Dmitri Mendeleev, chem.|No Nobel~ p. Alfred Nobel, chem.|Lr Lawrenc~ p. Ernest O. Lawrence, phys.|Rf Rutherford~ p. Ernest Rutherford, chem. / phys.|Db Dubn~ g. Dubna, Russia|Sg Seaborg~ p. Glenn T. Seaborg, scient.|Bh Bohr~ p. Niels Bohr, phys.|Hs Hass~ g. Hesse, Germany |Mt Meitner~ p. Lise Meitner, phys.|Ds Darmstadt~ g. Darmstadt, Germ.|Rg Roentgen~ p. Wilhelm C. Röntgen, phys.|Cn Copernic~ p. Nicolaus Copernicus, astr.|Nh Nihon~ g. Japan:Nihon|Fl Flerov~ p. Georgy Flyorov, phys.|Mc Moscov~ g. Moscow Oblast, Russia|Lv Livermor~ g. Lawrence Livermore lab.|Ts Tennessine g. Tennessee, USA|Og Oganesson p. Yuri Oganessian, phys. elm=ldtext.Replace(elm "`" "um") elm=ldtext.Replace(elm "~" "ium") c8=text.GetCharacter(9) elm=ldtext.Replace(elm c8+c8 c8) elm=ldtext.Replace(elm ":" " = ") ell=ldtext.Split (elm "|") lln=ldtext.Split ("3 3 4 14" " ") ae=ldarray.Create (120) For x=1 to 118 li=ldtext.Split (ell[x] c8) LDArray.SetValue (ae x li[3]+"|"+li[1]+"|"+x+"|"+li[2]+"|"+li[4]) endfor LDArray.Sort (ae) be=LDArray.CopyToSBArray(ae) oll="a." For x=1 to 118 li=ldtext.Split (be[x] "|") If li[1]=oll Then lcc=lcc+1 Else TextWindow.WriteLine (lcc+"======") oll=li[1] lcc=1 endif For f=1 to 4 TextWindow.Write (LDCall.Function2("tab" li[f] lln[f])) endfor TextWindow.WriteLine (li[5]) endfor TextWindow.WriteLine (lcc+"======") Sub tab return=text.GetSubText (args[1]+" " 1 args[2]) EndSub Sub tabr return=text.GetSubTextToEnd (" " Text.GetLength (args[1]) )+args[1] EndSub cdf="aa=1\=@111\;2\=@37\;3\=@117\;4\=@94\;5\=@90\;;bb=1\=@111\;2\=@34\;3\=@37\;4\=@49\;5\=@71\;6\=@81\;7\=@93\;8\=@115\;9\=@125\;10\=@122\;; cdf=cdf+"pp=1\=@111\;2\=@34\;3\=@37\;4\=@49\;5\=@71\;6\=@81\;7\=@78\;;rr=1\=@111\;2\=@34\;3\=@37\;4\=@49\;5\=@71\;6\=@81\;7\=@78\;8\=@80\;9\=@115\;; cdf=cdf+"ss=1\=@49\;2\=@37\;3\=@35\;4\=@45\;5\=@67\;6\=@79\;7\=@81\;8\=@93\;9\=@115\;10\=@125\;11\=@123\;12\=@111\;;cc=1\=@49\;2\=@37\;3\=@35\;4\=@45\;5\=@100\;6\=@112\;7\=@114\;8\=@104\;; cdf=cdf+"ee=1\=@49\;2\=@37\;3\=@35\;4\=@45\;5\=@67\;6\=@79\;7\=@89\;8\=@111\;9\=@123\;10\=@125\;11\=@115\;;hh=1\=@34\;2\=@111\;3\=@78\;4\=@82\;5\=@38\;6\=@115\;; cdf=cdf+"tt=1\=@38\;2\=@34\;3\=@36\;4\=@113\;;ff=1\=@38\;2\=@34\;3\=@111\;4\=@78\;5\=@81\;;dd=1\=@34\;2\=@37\;3\=@49\;4\=@104\;5\=@114\;6\=@111\;7\=@45\;;gg=1\=@49\;2\=@37\;3\=@35\;4\=@45\;5\=@100\;6\=@112\;7\=@114\;8\=@104\;9\=@82\;10\=@80\;; cdf=cdf+"ii=1\=@34\;2\=@111\;;jj=1\=@100\;2\=@112\;3\=@114\;4\=@104\;5\=@38\;6\=@35\;;kk=1\=@37\;2\=@78\;3\=@115\;;ll=1\=@34\;2\=@111\;3\=@114\;; cdf=cdf+"mm=1\=@111\;2\=@35\;3\=@81\;4\=@39\;5\=@117\;;nn=1\=@111\;2\=@34\;3\=@115\;4\=@38\;;oo=1\=@45\;2\=@35\;3\=@38\;4\=@50\;5\=@105\;6\=@115\;7\=@112\;8\=@100\;9\=@45\;; cdf=cdf+"uu=1\=@34\;2\=@100\;3\=@112\;4\=@115\;5\=@105\;6\=@39\;;vv=1\=@34\;2\=@113\;3\=@38\;;zz=1\=@34\;2\=@38\;3\=@111\;4\=@115\;; cdf=cdf+"yy=1\=@34\;2\=@69\;3\=@38\;;xx=1\=@39\;2\=@111\;;ww=1\=@34\;2\=@112\;3\=@69\;4\=@114\;5\=@38\;; cdf=cdf+"y0=1\=@69\;2\=@113\;;x0=1\=@35\;2\=@117\;; cdf=cdf+"a1=1\=@115\;2\=@82\;3\=@70\;4\=@68\;5\=@78\;6\=@100\;7\=@112\;8\=@114\;9\=@104\;; cdf=cdf+"o1=1\=@68\;2\=@78\;3\=@100\;4\=@112\;5\=@114\;6\=@104\;7\=@82\;8\=@70\;9\=@68\;; cdf=cdf+"e1=1\=@89\;2\=@93\;3\=@82\;4\=@70\;5\=@68\;6\=@78\;7\=@100\;8\=@112\;9\=@115\;;i1=1\=@68\;2\=@69\;3\=@113\;; cdf=cdf+"l1=1\=@35\;2\=@36\;3\=@102\;4\=@114\;5\=@115\;;t1=1\=@36\;2\=@69\;3\=@68\;4\=@70\;5\=@69\;6\=@102\;7\=@114\;8\=@115\;; cdf=cdf+"b1=1\=@78\;2\=@68\;3\=@70\;4\=@82\;5\=@104\;6\=@114\;7\=@111\;8\=@34\;; cdf=cdf+"c1=1\=@82\;2\=@70\;3\=@68\;4\=@78\;5\=@100\;6\=@112\;7\=@114\;8\=@104\;; cdf=cdf+"d1=1\=@38\;2\=@115\;3\=@112\;4\=@100\;5\=@78\;6\=@68\;7\=@71\;; cdf=cdf+"p1=1\=@100\;2\=@112\;3\=@114\;4\=@104\;5\=@82\;6\=@70\;7\=@68\;8\=@78\;9\=@144\;; cdf=cdf+"u1=1\=@67\;2\=@100\;3\=@112\;4\=@114\;5\=@104\;6\=@71\;;v1=1\=@67\;2\=@113\;3\=@71\;; cdf=cdf+"w1=1\=@67\;2\=@112\;3\=@91\;4\=@114\;5\=@71\;;n1=1\=@111\;2\=@67\;3\=@70\;4\=@82\;5\=@115\;; cdf=cdf+"m1=1\=@111\;2\=@67\;3\=@68\;4\=@80\;5\=@70\;6\=@82\;7\=@115\;;z1=1\=@67\;2\=@71\;3\=@111\;4\=@115\;; cdf=cdf+"r1=1\=@111\;2\=@67\;3\=@69\;4\=@81\;;s1=1\=@71\;2\=@59\;3\=@57\;4\=@67\;5\=@78\;6\=@92\;7\=@104\;8\=@115\;9\=@125\;10\=@123\;11\=@111\;; cdf=cdf+"g1=1\=@104\;2\=@114\;3\=@112\;4\=@100\;5\=@78\;6\=@68\;7\=@71\;8\=@137\;9\=@147\;10\=@145\;11\=@133\;; cdf=cdf+"q1=1\=@104\;2\=@114\;3\=@112\;4\=@100\;5\=@78\;6\=@68\;7\=@70\;8\=@82\;9\=@148\;; cdf=cdf+"j1=1\=@70\;2\=@71\;3\=@137\;4\=@147\;5\=@145\;6\=@133\;;h1=1\=@34\;2\=@111\;; cdf=cdf+"h2=1\=@67\;2\=@69\;3\=@81\;4\=@114\;;k2=1\=@70\;2\=@89\;3\=@114\;; cdf=cdf+"f1=1\=@38\;2\=@36\;3\=@46\;4\=@112\;;f2=1\=@67\;2\=@70\;;y1=1\=@67\;2\=@100\;3\=@112\;4\=@115\;; cdf=cdf+"y2=1\=@71\;2\=@137\;3\=@147\;4\=@144\;;x1=1\=@115\;2\=@67\;;x2=1\=@71\;2\=@111\;; chrs=LDText.Replace(cdf "@" "Ellipse") GraphicsWindow.Title="cc:"+Array.GetItemCount (chrs) GraphicsWindow.BackgroundColor="teal 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,10,1,10, -1, -1, -1, "","","") i=1 di=1 cmt=ldtext.Split ("aa bb cc dd ee ff gg hh ii jj kk ll mm nn oo pp rr ss tt uu vv ww xx yy zz y0 x0" " ") cm2=ldtext.Split ("a1:0 b1:0 c1:0 d1:0 e1:0 f1:f2 g1:0 h1:h2 i1:0 j1:0 h1:k2 l1:0 m1:0 n1:0 o1:0 p1:0 q1:0 r1:0 s1:0 t1:t2 u1:0 v1:0 w1:0 x1:x2 y1:y2 z1:0" " ") LDShapes.ShapeEvent=shee GraphicsWindow.PenWidth=0 LDEvents.MouseWheel=mww mov="false For y=0 To 14 For x=0 To 10 If x<8 And y<11 And y>2 Then GraphicsWindow.BrushColor ="gold Else GraphicsWindow.BrushColor ="orange endif ee[i]=Shapes.AddEllipse(14 14) Shapes.move (ee[i] x*30+25-y*10+150 y*30+65) Shapes.HideShape (ee[i]) LDShapes.SetShapeEvent (ee[i]) i=i+1 EndFor EndFor GraphicsWindow.BrushColor="darkblue rtm="true 'bt=0 While "true If rtm Then rtm="false aa=130 mww() For xx=1 to 118 xd=0 li=ldtext.Split (ell[xx] c8) c1=text.GetSubText (li[1] 1 1) If Text.GetLength (li[1])>1 then c2=Text.GetSubTextToEnd (li[1] 2) Else c2=0 endif GraphicsWindow.Title=xx+": "+li[2] cdd=Text.GetCharacterCode (c1) If cdd>81 then cdd=cdd-1 endif LDCall.Function ("shuc" cdd-64) xd=xd+30 If c2=0 then 'nil else LDCall.Function ("shlc" Text.GetCharacterCode (c2)-96) endif ' mww() Program.Delay (250) pzc=ldtext.Split(pzm[xx] c8) If LDMath.Truncate (pzc[1])-pzc[1]<>0 then zp=zp-12 else zp=0 endif lx=(pzc[1]-9)*38 ly=(8-pzc[2])*28 For k=1 to kk LD3DView.SetCentre (view3D tb[k] lx ly, zp "R1R2R3") LD3DView.TranslateGeometry (view3D tb[k] lx ly, zp ) Program.Delay (50) LD3DView.AnimateRotation (view3D tb[k] 0 1 0 0 360 3 1) endfor kk=1 tb=0 endfor EndIf Program.Delay (11) endwhile Sub rsttgr GraphicsWindow.BrushColor ="teal GraphicsWindow.FillRectangle (0 0 320 550) i=1 ddt="" di=1 For y=0 To 14 For x=0 To 10 If x<8 And y<11 And y>2 Then LDShapes.BrushColour (ee[i] "gold") Else LDShapes.BrushColour (ee[i] "orange") endif i=i+1 endfor endfor EndSub Sub shlc occ=ldtext.Split (cm2[args[1]] ":") If occ[2]=0 then df=1 Else df=2 endif For ft= 1 to df oc=chrs[occ[ft]] ox=ldShapes.GetLeft (oc[1])/f4 oy=ldShapes.Gettop (oc[1])/f4 ttx=(ox+xd/2+xss)+":"+(10-oy)+":0: For t=2 to Array.GetItemCount(oc) ox=ldShapes.GetLeft (oc[t-1])/f4 oy=ldShapes.Gettop (oc[t-1])/f4 nx=ldShapes.GetLeft (oc[t])/f4 ny=ldShapes.Gettop (oc[t])/f4 ttx=ttx+(xd/2+nx+xss)+":"+(10-ny)+":0: endfor tb[kk]= LD3DView.AddTube (view3D ttx 2 15 "Gold" "D") kk=kk+1 endfor endsub Sub shuc ik=args[1] xss=0 If ik=11 Then 'K ff=2 pt=0 pt[1]=9 pt[2]=11 ElseIf ik=24 then 'Y ff=2 pt=0 pt[1]=24 pt[2]=26 ElseIf ik=23 then 'X ff=2 pt=0 pt[1]=23 pt[2]=27 xss=5 Else pt=0 pt[1]=ik ff=1 If ik=13 Then 'M xss=5 ElseIf ik=1 then 'A xss=6 endif endif For fi=1 To ff oc=chrs[cmt[pt[fi]]] ox=ldShapes.GetLeft (oc[1])/f4 oy=ldShapes.Gettop (oc[1])/f4 ttx=(ox+xd/2)+":"+(10-oy)+":0: For t=2 to Array.GetItemCount(oc) pp=(t-1) ox=ldShapes.GetLeft (oc[pp])/f4 oy=ldShapes.Gettop (oc[pp])/f4 pp=t nx=ldShapes.GetLeft (oc[pp])/f4 ny=ldShapes.Gettop (oc[pp])/f4 ttx=ttx+(xd/2+nx)+":"+(10-ny)+":0: endfor tb[kk]=LD3DView.AddTube (view3D ttx 2 15 "Gold" "D") kk=kk+1 endfor EndSub Sub rdrw GraphicsWindow.BrushColor ="teal GraphicsWindow.FillRectangle (0 0 320 550) For r=2 To di-1 GraphicsWindow.PenColor ="white GraphicsWindow.PenWidth =8 GraphicsWindow.DrawLine (ldShapes.GetLeft (ddt[r])+7 ldShapes.Gettop (ddt[r])+7 ldShapes.GetLeft (ddt[r-1])+7 ldShapes.Gettop (ddt[r-1])+8) EndFor EndSub Sub shee ls=ldshapes.LastEventShape lt= LDShapes.LastEventType If Mouse.IsLeftButtonDown And lt="MouseDown" Then LDShapes.BrushColour (ls "red") ddt[di]=ls di=di+1 rdrw() endif If Mouse.IsrightButtonDown And lt="MouseDown" And di>0 Then di=di-1 rdrw() endif EndSub Sub mww lky=GraphicsWindow.LastKey If lky="Space" then If mov Then yp=yp+ LDEvents.LastMouseWheelDelta/20 else ya=ya+ LDEvents.LastMouseWheelDelta GraphicsWindow.Title ="Y:"+ya endif elseIf lky="LeftCtrl" then If mov then xp=xp+ LDEvents.LastMouseWheelDelta/20 else r35=r35+ LDEvents.LastMouseWheelDelta*5 GraphicsWindow.Title ="Zm:"+r35 endif elseif lky="D1" then LD3DView.AutoControl ("true" "true", -1 .25) Else aa=aa+ LDEvents.LastMouseWheelDelta*5 GraphicsWindow.Title ="a:"+aa endif px= LDMath.Cos(aa) py= LDMath.sin (aa) LD3DView.ResetCamera(view3D, px*r35,ya,py*r35, -px, -.5, -py, "","","") EndSub End>LWQ763.sb< Start>LWS487.sb< TextWindow.Write("Add up all the multiples of 3 and 5 below which number? :") input = TextWindow.Read() n3 = Math.Floor((input-1)/3) n5 = Math.Floor((input-1)/5) sum3 = 3 * n3 * (n3 + 1) / 2 sum5 = 5 * n5 * (n5 + 1) / 2 n15 = math.Floor(input/15) sum15 = 15 * n15 * (n15 + 1) / 2 answer = sum3 + sum5 - sum15 TextWindow.Clear() TextWindow.WriteLine("The answer is :" + answer) End>LWS487.sb< Start>LWV332-0.sb< 'Arrow-button Program.Delay Mydir=Program.directory 'TextWindow.WriteLine("Mydir = "+Mydir) 'TextWindow.WriteLine("FirstImage = "+Mydir+"\1.jpg") w = 350 h = 290 GraphicsWindow.CanResize = "False" GraphicsWindow.Width = w GraphicsWindow.Height = h GraphicsWindow.Top = (Desktop.Height-h) / 2 GraphicsWindow.Left = (Desktop.Width-w) / 2 GraphicsWindow.FontSize = 15 flag=0 ''WhT 'xxxxxxxxxxxxxx MAIN PROGRAM xxxxxxxxxxxxxxx CreateGUI() CreateImageBox() GraphicsWindow.MouseDown=MouseDown ''WhT 'waiting for input and will execute each time the ButtonDown subroutine 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Sub CreateImageBox GraphicsWindow.DrawRectangle(90,10,100,160) for i=1 to 3 ' TextWindow.writeline("Image : "+Mydir+"\"+i+".jpg") GraphicsWindow.DrawResizedImage(Mydir+"\"+i+".jpg", 90,10, 100,160) if i<3 then Program.Delay(1500) endif endfor GraphicsWindow.DrawText( 40,180, "Hit green arrow to see 4, 5, 6") endsub Sub CreateGUI GraphicsWindow.PenColor="black" ''WhT GraphicsWindow.PenWidth=2 ''WhT GraphicsWindow.DrawEllipse(110,210,60,40) ''WhT GraphicsWindow.BrushColor="lightgray" ''WhT GraphicsWindow.FillEllipse(110,210,60,40) ''WhT GraphicsWindow.BrushColor="green" GraphicsWindow.FillTriangle(130,240,150,240,140,220) ''WhT EndSub 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Sub MouseDown ''WhT mx=GraphicsWindow.MouseX my=GraphicsWindow.MouseY If mx>110 and mx<170 and my>210 and my<250 Then If flag=0 Then GraphicsWindow.BrushColor="red" flag=1 Else GraphicsWindow.BrushColor="green" flag=0 EndIf GraphicsWindow.FillTriangle(130,240,150,240,140,220) Sound.PlayClick() ScreensFlow() EndIf EndSub ''WhT Sub ScreensFlow For i=4 to 6 ' TextWindow.writeline("Image : "+Mydir+"\"+i+".jpg") GraphicsWindow.DrawResizedImage(Mydir+"\"+i+".jpg", 90,10, 100,160) x=0 ''EA While x<10000 ''EA GraphicsWindow.DrawText(1,1," ") ''EA x=x+1 ''EA Endwhile ''EA EndFor mouseflag=0 endsub 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx End>LWV332-0.sb< Start>LWX164.sb< GraphicsWindow.BackgroundColor="darkblue GraphicsWindow.Width=800 GraphicsWindow.Height =800 GraphicsWindow.Title ="Mathflowers While "true f10= 5+Math.GetRandomNumber(10)*10 for r25=5 to 15 GraphicsWindow.PenColor=LDColours.HSLtoRGB (math.Remainder (r25*3 360) 1 .6) for x=0 to 360 Step .1 cy=ldmath.Sin(x)*150+400+ldmath.cos(x*f10)*r25 cx=ldmath.cos(x)*150+400+ldmath.sin(x*f10)*r25 If x>0 then GraphicsWindow.DrawLine (ox oy cx cy) endif ox=cx oy=cy EndFor EndFor ldGraphicsWindow.FloodFill (400 400 LDColours.HSLtoRGB (Math.GetRandomNumber (360) 0.7 0.4)) gr=LDShapes.BrushGradient ("2=Yellow;1=White","") LDShapes.BrushEllipse (gr 380 380 40 40) Program.Delay (3555) GraphicsWindow.Clear () EndWhile End>LWX164.sb< Start>LWX427-0.sb< GraphicsWindow.BackgroundColor="#113399" image=ImageList.LoadImage("http://www.clker.com/cliparts/e/a/6/1/11949848261501331721money.svg.thumb.png") dollars=Shapes.AddImage(image) For intro = 1 to 3 v=math.GetRandomNumber(400) For t = 1 to 100 Shapes.Move(dollars,v+t,v+t) Shapes.Zoom(dollars,t/10,t/10) Shapes.Rotate(dollars,t/0.1) Program.Delay(20) endfor endfor GraphicsWindow.Clear() LDUtilities.ShowErrors="false dss="false nn[0]=0 GraphicsWindow.Title ="Wheel of Fortune vv=0 i=0 ii=0 GraphicsWindow.MouseDown=mdd GraphicsWindow.BrushColor ="white GraphicsWindow.FontName ="calibri GraphicsWindow.FontSize=22 GraphicsWindow .DrawText (10 390 "Press board to start spinning...") For a= 0 To 345 Step 15 GraphicsWindow.PenWidth=0 If i=0 Then GraphicsWindow.BrushColor ="black else GraphicsWindow.BrushColor=LDColours.HSLtoRGB (a, 1, .45) endif tt=Shapes.AddTriangle (200 0 250 0 225 200) LDShapes.ZIndex (tt, -100) While Array.ContainsValue (nn vv) And i>0 vv=(Math.GetRandomNumber (30)-1)*50 EndWhile nn[i]=vv t[i]=shapes.AddText(nn[i]) LDShapes.PenColour (t[i] "white") a1=a-90 Shapes.Rotate (t[i], a1) LDShapes.RotateAbout (tt 224 188 a) 'LDShapes.RotateAbout (t 225 185 a) Shapes.Move (t[i] ldMath.Cos(a1)*150+210 LDMath.Sin(a1)*150+180) LDShapes.ZIndex (t[i] 100) i=i+1 EndFor Sub mdd If dss Then else ss=Math.GetRandomNumber (24) For aa=a0 To a0+720+ss*15 Step 5 LDGraphicsWindow.Reposition (.8 .8 90 0 aa) Program.Delay (5) notes=("O8 L64 B#") instr=LDMusic.Woodblock LDMusic.PlayMusic2(notes,instr,95,100,1,1) EndFor a0=a0+ss*15 ii=ii+ss e=24-math.Remainder (ii+18 24) e=math.Remainder (e 24) ee=nn[e] If ee=0 Then sc=0 endif For r=1 To 3 LDShapes.penColour(t[e] "red") Program.Delay (255) LDShapes.penColour(t[e] "white") Program.Delay (255) EndFor dss="true endif EndSub While "true If dss Then sk=sc For f=1 To 20 sk=sk+ee/20 GraphicsWindow.Title="Score: "+math.Floor (sk) Program.Delay (44) EndFor sc=sc+ee GraphicsWindow.Title="Score: "+sc dss="false EndIf Program.Delay (2) EndWhile End>LWX427-0.sb< Start>LWX427.sb< GraphicsWindow.BackgroundColor="teal LDUtilities.ShowErrors="false dss="false nn[0]=0 GraphicsWindow.Title ="Wheel of Fortune vv=0 i=0 ii=0 GraphicsWindow.MouseDown=mdd GraphicsWindow.BrushColor ="white GraphicsWindow.FontName ="calibri GraphicsWindow.FontSize=22 GraphicsWindow .DrawText (10 390 "Press board to start spinning...") For a= 0 To 345 Step 15 GraphicsWindow.PenWidth=0 If i=0 Then GraphicsWindow.BrushColor ="black else GraphicsWindow.BrushColor=LDColours.HSLtoRGB (Math.GetRandomNumber (19)*18 1 .45) endif tt=Shapes.AddTriangle (200 0 250 0 225 200) LDShapes.ZIndex (tt, -100) While Array.ContainsValue (nn vv) And i>0 vv=(Math.GetRandomNumber (30)-1)*50 EndWhile nn[i]=vv t[i]=shapes.AddText(nn[i]) LDShapes.PenColour (t[i] "white") a1=a-90 Shapes.Rotate (t[i], a1) LDShapes.RotateAbout (tt 224 188 a) 'LDShapes.RotateAbout (t 225 185 a) Shapes.Move (t[i] ldMath.Cos(a1)*150+210 LDMath.Sin(a1)*150+180) LDShapes.ZIndex (t[i] 100) i=i+1 EndFor Sub mdd If dss Then else ss=Math.GetRandomNumber (24) For aa=a0 To a0+720+ss*15 Step 5 LDGraphicsWindow.Reposition (.8 .8 90 0 aa) Program.Delay (15) EndFor a0=a0+ss*15 ii=ii+ss e=24-math.Remainder (ii+18 24) e=math.Remainder (e 24) ee=nn[e] If ee=0 Then sc=0 endif For r=1 To 3 LDShapes.penColour(t[e] "red") Program.Delay (255) LDShapes.penColour(t[e] "white") Program.Delay (255) EndFor dss="true endif EndSub While "true If dss Then sk=sc For f=1 To 20 sk=sk+ee/20 GraphicsWindow.Title="Score: "+math.Floor (sk) Program.Delay (44) EndFor sc=sc+ee GraphicsWindow.Title="Score: "+sc dss="false EndIf Program.Delay (2) EndWhile End>LWX427.sb< Start>LWZ091.sb< Shapes.AddEllipse(10,10) GraphicsWindow.Width =1500 GraphicsWindow.Height =900 gg=LDShapes.BrushGradient ("1=#00bbaa;2=#008080;3=#000080","DD") LDGraphicsWindow.BackgroundBrushGradient(gg) t_x=30 t_y=700 lcc=LDText.Split("0 0 0 0 0 0 0 0 0 0 0 0 0 0"," ") lcc="1=-30;2=-30;3=-60;4=0;5=-30;6=-30;7=-30;8=-30;9=0;10=0;11=0;12=0;13=0;14=0;0=-12;" Turtle.Speed=10 Turtle.PenUp () mtyp=ldtext.Split ("Boldness Midline Width Height Seriph BottomWd PenWd MoveCh"," ") flmd=1'----fills shdw=0'----shdws hsb =0'----clrz pwd =1'----lin wid sscl=0.3 scl=sscl sii=1 inw=0 t_Angle =0 t_PenDown () penn="True aa=30 tc=0 ctx=0 cty=0 dd=0 vmir=0 ymr=140 isp=1 ss=-0.5 ii=10 sm="False mem="1=152;2=320;3=74;4=683;5=35;6=670;7=25; chdef() Controls.ButtonClicked=btts GraphicsWindow.PenWidth=3 'c1=LDDialogs.Colour() args=0 sc=0 t_x=30 dang=0 t_Angle =0 cc="" GraphicsWindow.Clear () drgrd() lnnt=Controls.AddTextBox(1000,10) bbt=Controls.AddButton ("List",900,10) Controls.SetTextBoxText(lnnt,1) t_x=30 t_y=590 lll=0 txd="the flee felt left" yz=900 mem[1]=math.Round (mem[1]*1.25) For z=890 to 100 step -260 For x=1 To 18 GraphicsWindow.PenWidth=1 GraphicsWindow.PenColor="#777777 ldcall.Function3( "dch",chh[Text.GetSubText(txd,x,1)],-60+mem[3]*1.1*x-lcc[x],yz) endfor xff=6 mem[2]=mem[2]-xff*10 mem[6]=mem[6]-xff*20 mem[4]=mem[4]-xff*20 mem[1]=math.Round (mem[1]*0.85) yz=yz-mem[4]/2.5-30 endfor GraphicsWindow.FontName="TypoUpright BT" GraphicsWindow.FontSize=90 GraphicsWindow.BrushColor="Orange GraphicsWindow.DrawText (50,40,"Once uppon a time, there was a small flee...") mem[1]=math.Round (mem[1]*1.6) LDEvents.MouseWheel=mww ssl=LDControls.AddSlider(30,150,"V") ssh=LDControls.AddSlider(250,30,"H") Controls.Move (ssh,50,10) LDControls.SliderChanged=sllv Sub btts txb=Controls.AddMultiLineTextBox (20,20) Controls.SetTextBoxText (txb,lcc+ESLText.CRLF+mem ) EndSub Sub mww If inw=0 Then inw=1 GraphicsWindow.BrushColor="#557788 GraphicsWindow.FillRectangle (30,30,1600,1200) If sii=7 Then pww= GraphicsWindow.PenWidth pww=pww+LDEvents.LastMouseWheelDelta If pww<1 Then pww=1 endif GraphicsWindow.PenWidth=pww ElseIf sii=8 and nmv=0 then ct=Controls.GetTextBoxText(lnnt) lns= MathPlus.ToNumber ( ct) md=LDEvents.LastMouseWheelDelta*6 GraphicsWindow.Title=ct For xz=0 to lns-1 lcc[sih+xz]=lcc[sih+xz]+ md endfor else If sii=4 Then mem[2]=mem[2]+ LDEvents.LastMouseWheelDelta*10 mem[6]=mem[6]+ LDEvents.LastMouseWheelDelta*20 mem[4]=mem[4]+ LDEvents.LastMouseWheelDelta*20 Else mem[sii]=mem[sii]+ LDEvents.LastMouseWheelDelta*4 endif endif pmm=0 mi=0 txd="the flee felt left" For x=1 To 18 If x= sih and sii=8 Then GraphicsWindow.PenWidth=5 GraphicsWindow.PenColor="Red Else GraphicsWindow.PenWidth=1 GraphicsWindow.PenColor="#777777 endif ldcall.Function3( "dch",chh[Text.GetSubText(txd,x,1)],-60+mem[3]*1.1*x-lcc[x],590) endfor inw=0 nmv=0 endif EndSub Sub dch stx=args[1] dorepl () t_Angle =0 t_x=args[2] t_y=args[3] mi=0 pmm=0 drwch() pshw () EndSub Sub sllv sii= LDControls.SliderGetValue(ssl) sii=1+math.Round (sii/100*7) GraphicsWindow.Title=mtyp[sii] sih= LDControls.SliderGetValue(ssh) sih=math.Round (sih/100*20) If sii=8 then nmv=1 mww() EndIf 'GraphicsWindow.Title=sih EndSub Sub drgrd GraphicsWindow.PenWidth=1 GraphicsWindow.PenColor="#777777 For x=0 To 70 GraphicsWindow.DrawLine(x*20,0,x*20,800) EndFor For x=0 To 40 GraphicsWindow.DrawLine(0,x*20,1700,x*20) EndFor EndSub Sub dorepl linee=stx While Text.IsSubText (linee,"%") If Text.IsSubText (linee,"%1") Then linee=LDText.Replace (linee,"%1",mem[1]) elseIf Text.IsSubText (linee,"%2") Then linee=LDText.Replace (linee,"%2",mem[2]) elseIf Text.IsSubText (linee,"%3") Then linee=LDText.Replace (linee,"%3",mem[3]) elseIf Text.IsSubText (linee,"%4") Then linee=LDText.Replace (linee,"%4",mem[4]) elseIf Text.IsSubText (linee,"%5") Then linee=LDText.Replace (linee,"%5",mem[5]) elseIf Text.IsSubText (linee,"%6") Then linee=LDText.Replace (linee,"%6",mem[6]) elseIf Text.IsSubText (linee,"%7") Then linee=LDText.Replace (linee,"%7",mem[7]) EndIf stx=linee EndWhile endsub Sub drwch '------------------------------draws chars ox=t_x oy=t_y ldcall.Function ("t_move",0) spp=0 'TextWindow.WriteLine(stx) td=ldtext.Split(stx,";") t_pendown () For xi=1 to Array.GetItemCount (td) linee=td[xi] If Text.StartsWith(linee, "U") Then T_PenUp() ElseIf Text.StartsWith(linee, "D") Then T_PenDown() elseif Text.StartsWith(linee, "C") Then dist = Text.GetSubTextToEnd(linee, 2) dd=Math.abs(dist) For h=0 to dd step dd/dist*5 LDCall.Function("t_turn",5) ldcall.Function ("t_move",1) endfor elseif Text.StartsWith(linee, "S") Then scl = scl*Text.GetSubTextToEnd(linee, 3) If scl=0 then scl=sscl endif elseif Text.StartsWith(linee, "F") Then dist = Text.GetSubTextToEnd(linee, 3) ldcall.Function ("t_move",math.Floor (dist*scl)) ElseIf Text.StartsWith(linee, "R") Then dist = Text.GetSubTextToEnd(linee, 3) t_Angle =t_Angle +dist ElseIf Text.StartsWith(linee, "A") Then dist = Text.GetSubTextToEnd(linee, 3) t_Angle =dist ElseIf Text.StartsWith(linee, "L") Then dist = Text.GetSubTextToEnd(linee, 3) t_Angle =t_Angle -dist else endif xx: endfor t_penup () Endsub Sub ctpos Turtle.Angle=dang Turtle.x=t_x Turtle.y=t_y Turtle.Move(cty) Turtle.TurnRight () Turtle.Move(ctx) t_x=Turtle.X t_y=turtle.y endsub Sub t_Turn t_Angle =t_Angle +args[1] EndSub sub t_Move ds=args[1] mm=LDMath.Convert2Cartesian (t_x,t_y,ds, t_Angle-90 ) If penn then GraphicsWindow.DrawLine (math.Round(t_x),math.Round(t_y),math.Round (mm[1]),math.Round (mm[2])) endif t_x= (mm[1]) t_y= (mm[2]) mi=mi+1 pmm[mi][1]=t_x pmm[mi][2]= t_y EndSub Sub t_TurnRight t_Angle =t_Angle +90 EndSub Sub t_TurnLeft t_Angle =t_Angle -90 EndSub Sub t_pendown penn="True EndSub Sub t_penup penn="Fale EndSub Sub pshw rc1= LDColours.HSLtoRGB(Math.GetRandomNumber(30),1,0.8) bcc= LDText.Split(Rc1+" Yellow Cyan"," ") bgp= LDShapes.BrushGradient (bcc,"DD") If flmd=1 then LDShapes.BrushGradientPolygon(bgp,pmm) endif EndSub Sub chdef 'chh["Ldf"]="184 130 130 303 35 290 25 chh["A"]="R 57;F 27;L 21;F 41;L 11;F 345;R 131;F 350;L 10;F 25;L 31;F 19;R 4;F 21;L 209;F 174;R 163;F 35;L 51;F 16;L 45;F 232;L 132;F 132;R 244;F 94;R 60;F 23;L 239;F 113;L 66;F 55;L 21;F 20;R 322;F 19;L 33;F 40;L 202;F 122 chh["H0"]="R 70;F 35;L 20;F 17;L 49;F %4;L 32;F 18;L 38;F 16;R 3;F 27;R 156;F %1; chh["H0"]=chh["H0"]+"L 205;F 26;L 4;F 25;L 37;F 10;L 24;F %2;R 270;F %3;L 90;F %2;L 37;F 17;L 23;F 29;R 151;F %1; chh["H0"]=chh["H0"]+"L 207;F 31;L 9;F 22;L 54;F %4;R 312;F 21;L 28;F 30;L 196;F %1;R 153;F 46;L 42;F 20;L 19;F %2;L 90;F %2;L 90;F %3; chh["H0"]=chh["H0"]+"R 328;F 19;L 26;F 17;L 16;F 26;L 197;F %1 srg="F %5;L 20;F 10; slf="F 16;L 30;F %5; hd1="F %2;L 90;F %3;L 90;F %2; ibg="R 70;"+srg+"A 0;F %4; ien="L 40;"+slf+"A chh["H"]=ibg chh["H"]=chh["H"]+ien+" 90;F %1;L 206;" chh["H"]=chh["H"]+srg+"A 180;"+hd1 chh["H"]=chh["H"]+ien+" 90;F %1;L 206;" chh["H"]=chh["H"]+srg+"A 180;F %4;" chh["H"]=chh["H"]+ien+" 270;F %1;L 206;" chh["H"]=chh["H"]+srg+"A 0;"+hd1 chh["H"]=chh["H"]+ien+" 270;F %1; chh["I"]=ibg+ien+" 90;F %1;"+"L 205;"+srg+"A 180;F %4;"+ien+" 270;F %1 chh["L"]=ibg+ien+"90;F %1;L 205;"+srg+"A 180;F %6;L 90;F %3;"+srg+"A 180;F 30;R 90;F %3" chh["F"]=ibg+ien+"90;F %1;F %3;R 90;F %7;A 270;F %3;F 32;L 90;F %2;L 90;F %3;R 90;F %7;R 90;F %3;L 90;F %2;F 9;" +ien+" 270;F %1 chh["E"]=ibg+ien+"90;F %1;F %3;R 90;F %7;A 270;F %3;F 32;L 90;F %2;L 90;F %3;R 90;F %7;R 90;F %3;L 90;F %2;L 90;F %3;"+srg+"A 180;F 30;R 90;F %3" chh["T"]="R 70;"+srg+"A 0;S 0.995;F %4;S 0;L 90;S 0.6;F %1;R 90;S 0;F %7;A 90;S 0.6;F %1;S 0;S 0.6;F %1;S 0;S 0.6;F %1;S 0;R 90;F %7;A 270;S 0.6;F %1;S 0;A 180;S 0.995;F %4;S 0;" +ien+" 270;F %1 endsub End>LWZ091.sb< Start>LWZ214.sb< args=0 txmm="false lwq="1=1\=# $ w w $ #\;2\=# $ #\;3\=# #\;4\=# #\;5\=# *$ * #\;6\=#\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=~~~~\\\=~~~~\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=#\;7\=# $#\;8\=#\\\=\\\=\\\= #\;9\=# 1 ### * #\;10\=#\\\=\\\=\\\=\\\= -------------------- #\;11\=# \\\=\\\=#\;12\=# #\;13\=# * ###~~~~~\\\=\\\=\\\=#\;14\=# \\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\= EE#\;15\=# EE#\;16\=#\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=#\;17\= The Central Cavern L01\;18\=~\;19\=~\;20\=~\;;2=1\=# #############\;2\=# $ $ *#\;3\=# #\;4\=# ~~~\\\= #\;5\=# 1 #\;6\=#\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\= # #\;7\=# \\\=\\\=\\\=\\\=#~~# #\;8\=#\\\=~~~~~ #$ # #\;9\=# #~~# #\;10\=# $ \\\=\\\=\\\=\\\=\\\=\\\=\\\= #~~# #\;11\=# ~~~~ #~~# #\;12\=# ---- #~~# #\;13\=# \\\=\\\=\\\=\\\= $ #~~# #\;14\=# ~~~~ EE#\;15\=# 2 EE#\;16\=#\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=#\;17\= The Cold Room L02\;18\=~\;19\=~\;20\=~\;;3=1\=# $ w $ j $ w #\;2\=# w #\;3\=# #\;4\=# #\;5\=# 1 2 #\;6\=#\\\=\\\=\\\=\\\=~~~~~~~~~~~~~~~~~~~~~~~~~~#\;7\=# $ $#\;8\=#\\\=\\\=\\\=\\\=\\\=\\\= \\\=\\\=\\\=\\\=#\;9\=#j #\;10\=#j ------ #\;11\=#j \\\=\\\=\\\=\\\=\\\=\\\=#\;12\=#w \\\=\\\=\\\=\\\=\\\= EE#\;13\=# \\\=\\\=\\\=\\\=\\\=\\\= EE#\;14\=# \\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=#\;15\=# 3 #\;16\=#\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=#\;17\= The Menagerie L03\;18\=~\;19\=~\;20\=~\;;4=1\=#$ w ##################\;2\=# $ $ EE#\;3\=# EE#\;4\=# \\\=\\\=\\\=\\\=\\\=\\\= #\;5\=# \\\=\\\=\\\=\\\=#\;6\=#\\\= \\\= \\\= #\;7\=# \\\=\\\= $ \\\=\\\=\\\= $#\;8\=#~~~ #\;9\=# \\\=\\\= \\\=\\\=\\\= #\;10\=# \\\=\\\=\\\= #\;11\=#--- \\\=#\;12\=# \\\=\\\=\\\= \\\=\\\=\\\= #\;13\=# \\\=\\\= w \\\=\\\=\\\=#\;14\=# \\\=\\\= #\;15\=# 1 2 #\;16\=#\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=#\;17\= Abandoned Uranium Wrkngs L04\;18\=~\;19\=~\;20\=~\;;5=1\=0;6=1\=# EE#\;2\=# EE#\;3\=# #\;4\=# #\;5\=# w #\;6\=# \\\=\\\=\\\= \\\=\\\= \\\=\\\=\\\=\\\=\\\= #\;7\=# \\\=\\\= $#$ \\\=\\\=\\\=#\;8\=# # $#\;9\=# \\\=\\\=\\\=\\\=\\\= #\;10\=#\\\=\\\= 1 2 #\;11\=#$ \\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=#\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\= #\;12\=# $ #w #\;13\=# * # \\\=\\\=\\\=#\;14\=# ---- \\\=\\\= #\;15\=# 3 4 #\;16\=#\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=#\;17\= Processing Plant L06\;18\=~\;19\=~\;20\=~\;;7=1\=# ##################\;2\=# #\;3\=# 2 #\;4\=# \\\=\\\=#@@@@@@@@@@@@$#\;5\=# #@@@@@@@@@@@@@#\;6\=# ----- \\\=\\\=\\\=#@@@@@@@@@@*@@#\;7\=#\\\=\\\=\\\= #@@$@@@@@@@@@@#\;8\=# #@@@@@@@@@$@@@#\;9\=#\\\= #@@@@@*@@@@@@@#\;10\=# 1 \\\=\\\=\\\=#@@@@@@@@@@@@@#\;11\=#\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\= #@$@@@@@@@@*@@#\;12\=# #@@@@@@@@@@@@$#\;13\=# ####@@@@@*@@@@@@@#\;14\=# \\\=\\\=\\\= #EE #\;15\=# #EE 3 #\;16\=#\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=##################\;17\= The Vat L07\;18\=~\;19\=~\;20\=~\;;8=1\=# w j w #j # #\;2\=# 1 # # #\;3\=# $ \\\=\\\=# \\\=\\\=#\;4\=# # #\;5\=# # #\;6\=#\\\=\\\=\\\= \\\=\\\=\\\=\\\=\\\=\\\= #\\\=\\\= #\;7\=# $ # \\\=\\\=\\\=\\\= \\\=#\;8\=# \\\=\\\=\\\= # \\\= #\;9\=# $ \\\=\\\=\\\= # 2 #\;10\=# #\\\=\\\=\\\=\\\=\\\= #\;11\=#\\\= \\\=\\\=\\\= # \\\=\\\=\\\=\\\=#\;12\=# \\\=\\\= # #\;13\=# \\\=\\\= 3 # \\\=\\\=\\\=\\\=\\\= #\;14\=# ---#EE#\\\=\\\= $ #\;15\=# 4 #EE# * #\;16\=#\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=#\;17\=Min.Willy meets theKongBeast L08\;18\=~\;19\=~\;20\=~\;;9=1\=#EE# #\;2\=#EE $ #\;3\=# #\;4\=# #\;5\=# 5 #\;6\=#\\\=\\\=\\\=\\\= \\\=\\\=\\\= \\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\= \\\=\\\=\\\= \\\=\\\= #\;7\=# #\;8\=# \\\=\\\=#\;9\=# \\\=\\\= \\\=\\\=\\\= -------- #\;10\=# \\\=\\\=\\\= \\\=\\\= #\;11\=#\\\=\\\= #\;12\=# 6 #\;13\=# \\\=\\\=11\\\=\\\=\\\=22\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=33\\\=\\\=\\\=44\\\=\\\= #\;14\=# \\\=\\\=#\;15\=# #\;16\=#\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=#\;17\= Wacky Amoebatrons L09\;18\=~\;19\=~\;20\=~\;;10=1\=# w \\\=\\\=\\\=# w w\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=#\;2\=# $ # w $#\;3\=#\\\=\\\=\\\=\\\=\\\=\\\= # $ \\\=\\\=\\\=\\\=#\;4\=# w # #\;5\=# #\\\=\\\=\\\=\\\= #\;6\=# \\\=~~~~~~~# \\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=#\;7\=#\\\=\\\=\\\=\\\= $ # 3 #\;8\=# #\\\=\\\=\\\=\\\=\\\=\\\=\\\=~~~ #\;9\=#\\\=\\\=\\\=\\\=\\\= 1 # #\;10\=#w \\\=\\\=\\\=\\\=\\\=\\\=\\\=# \\\=\\\=#\;11\=#\\\=\\\=\\\=\\\=~~ #\\\=\\\=\\\=\\\=\\\=\\\=\\\= w#\;12\=# 2 # w~~~ #\;13\=# HHHHHHHHHH #\;14\=#\\\=\\\=\\\= EE \\\=\\\=\\\=#\;15\=# EE #\;16\=HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH\;17\= The Endorian Forest L10\;18\=~\;19\=~\;20\=~\;;11=1\=####### | $ #\;2\=#EE * $#\;3\=#EE #\;4\=# #\;5\=#$ 5 #\;6\=# \\\=\\\=\\\=\\\=\\\=\\\= 22 \\\=\\\=_______\\\=\\\= #\;7\=# $ | 44 \\\=\\\=#\;8\=# | #\;9\=#\\\=\\\= -- 6 | \\\=\\\=#\;10\=# \\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\= * #\;11\=# | | \\\= #\;12\=# ~~~\\\= | * #\;13\=# * 33 \\\=\\\=\\\=#\;14\=#\\\=\\\=11 \\\=\\\=\\\= $#\;15\=# 7 #\;16\=#\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=#\;17\=Attck of The Mutant Telephns L11\;18\=~\;19\=~\;20\=~\;;12=1\=# w j w #j # #\;2\=# #\;3\=# ~~ #\;4\=# $ #\;5\=# #\;6\=#\\\=\\\=\\\= ~~~~~# #~~~~~~\\\=\\\=$ #\;7\=# $ # # \\\=#\;8\=# \\\=\\\= # $# 3 #\;9\=# \\\= # # \\\=\\\=\\\=\\\=\\\=\\\=#\;10\=# \\\=\\\=\\\=\\\=# # #\;11\=# \\\= #\\\=\\\=\\\= #\;12\=# # \\\=\\\= #\;13\=#\\\=\\\=\\\=\\\=\\\=\\\= 2 # * * #\;14\=# \\\=\\\=\\\=#EE#-----------$ #\;15\=# 1 #EE# #\;16\=#\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=####\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=#\;17\=Ret. of the Alien Kong Beast L12\;18\=~\;19\=~\;20\=~\;;13=1\=################################\;2\=# H #\;3\=# H 2 #\;4\=# H \\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\= $\\\=\\\=\\\=\\\=#\;5\=# H #\;6\=# H 3 #\;7\=# H \\\=\\\= \\\=\\\=\\\=\\\= \\\=\\\=\\\=\\\=\\\= \\\=\\\=\\\=\\\= \\\=#\;8\=# H #\;9\=# H 4 #\;10\=# H \\\=\\\=\\\=\\\=\\\= \\\=\\\=\\\= $\\\=\\\=\\\=\\\=\\\= $\\\=\\\=\\\=\\\=#\;11\=# H 1 #\;12\=# H 5 #\;13\=# H \\\=\\\=\\\= $\\\=\\\=\\\= \\\=\\\=\\\=\\\= \\\=\\\=\\\=\\\= \\\=\\\=#\;14\=#EEH #\;15\=#EEH #\;16\=#\\\=\\\=--------------------------\\\=\\\=#\;17\= Ore Refinery L13\;18\=~\;19\=~\;20\=~\;;14=1\=0;15=1\=# ## ##\;2\=# #\;3\=# $ #\;4\=#EE ----------------\\\=\\\=\\\=\\\=\\\= #\;5\=#EE | | #\;6\=#\\\=\\\=\\\=\\\=\\\= * | #\;7\=# $ \\\=\\\= | #\;8\=# \\\= \\\=\\\= | #\;9\=# \\\=\\\= \\\=\\\= | #\;10\=# \\\=\\\= | #\;11\=#\\\=\\\= \\\=\\\= * #\;12\=# \\\=\\\= #\;13\=# \\\=\\\=\\\= \\\=\\\= #\;14\=# \\\=\\\= #\;15\=# $ #\;16\=#\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=#\;17\= The Bank L15\;18\=~\;19\=~\;20\=~\;;16=1\=#$ #\;2\=# #\;3\=# $#\;4\=# #\;5\=# #\;6\=#\\\= \\\= #EE# \\\=\\\=\\\= #\;7\=# #EE## 1#\;8\=# \\\= # $### \\\=\\\=\\\=\\\=\\\=\\\=#\;9\=# # #### 2 #\;10\=#~~------------------------ #\;11\=# $ #\;12\=# 3 ##\\\=\\\= \\\= #\;13\=#\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\= #\;14\=# \\\= \\\= #\;15\=# 4 *** #\;16\=#\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=#\;17\= The 16th Cavern L16\;18\=~\;19\=~\;20\=~\;;17=1\=0;18=1\=# #EE#\;2\=# $ EE#\;3\=# #\;4\=# #\;5\=# 5 #\;6\=# \\\=\\\= \\\=\\\=\\\= \\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\= \\\=\\\=\\\= \\\=\\\=\\\=\\\=#\;7\=# #\;8\=#\\\=\\\= 6 #\;9\=# \\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\= \\\=\\\=\\\= \\\=\\\= #\;10\=# \\\=\\\= \\\=\\\=\\\= #\;11\=# \\\=\\\=#\;12\=# 7 #\;13\=# \\\=\\\=11\\\=\\\=\\\=22\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=33\\\=\\\=\\\=44\\\=\\\= #\;14\=#\\\=\\\= #\;15\=# 8 #\;16\=#\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=#\;17\= Amoebatrons Revenge L18\;18\=~\;19\=~\;20\=~\;;19=1\=0;20=1\=,`````,((((( (((((. .(((((#\;2\=,`````,(( (( (((((: :(((**#\;3\=,``F`,...... .+.+.: : **#\;4\=(,,F,........(((,,,,,,:::: (*#\;5\=( (F(........,,,################\;6\=(,,F,........'#####EE# $ #\;7\=###################EE# $#\;8\=################### # #\;9\=# \\\=\\\=#\;10\=# #\;11\=#---------------------- 1 ~ #\;12\=# *$ * $ * $ * \\\= #\;13\=#\\\=\\\= #\;14\=# \\\=\\\= #\;15\=# 2 #\;16\=#\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=\\\=#\;17\= The Final Barrier L20\;18\=~\;19\=~\;20\=~\;; dir="c:\almdom\sb\ ii=ImageList.LoadImage(dir+"mmin.png") LDImage.MakeTransparent(II "BLACK") Mmc=ii'LDImage.SplitImage(ii 16 9) wd=1 II=ImageList.LoadImage(dir+"man_pu.png") LDImage.MakeTransparent(ii "black") mmp=LDImage.SplitImage(ii 1 20) II=ImageList.LoadImage(dir+"mm_tiles.png") LDImage.MakeTransparent(ii "black") mm=LDImage.SplitImage(ii 8 20) chr[1][1]="9;1 chr[2][1]="6;2 chr[2][2]="7;2 chr[4][1]="4;3 chr[4][2]="5;3 For f=2 To 5 chr[13][F]="16;6 EndFor chr[13][1]="11;6 chr[20][1]="11;6 chr[20][2]="5;5 Sub fset ln=lwq[args[1]] If txmm Then wll="▓" mss="▒" lll="▀" ff=LDText.Replace(ff "#" wll) ff=LDText.Replace(ff "E" "░") ff=LDText.Replace(ff "=" lll) ff=LDText.Replace(ff "@" mss) 'ff=LDText.Replace(ff "%" "$") ff=LDText.Replace(ff "-" "▬") ff=LDText.Replace(ff "~" "▼") EndIf ' ln=LDText.Split(ff Text.GetCharacter(13)+Text.GetCharacter(10)) EndSub If txmm Then TextWindow.BackgroundColor="darkblue TextWindow.Clear() LDTextWindow.Encoding="Unicode" EndIf '19 5 14 17 Sub drawbb cl=TextWindow.CursorLeft For x=1 To 16 For d=1 To 2 For c=1 To 32 TextWindow.BackgroundColor="darkblue TextWindow.ForegroundColor="white cc=text.GetSubText (ln[x] c 1) If d=2 and (cc=lll or cc="▬" or cc="▼") Then cc=" " EndIf If cc=wll Then TextWindow.ForegroundColor="blue TextWindow.BackgroundColor="cyan ElseIf cc=mss or cc="$" Then TextWindow.ForegroundColor="red ElseIf cc=lll Then TextWindow.ForegroundColor="yellow EndIf TextWindow.Write(cc) TextWindow.Write(cc) EndFor TextWindow.CursorTop=TextWindow.CursorTop+1 TextWindow.CursorLeft=cl EndFor EndFor TextWindow.CursorLeft=cl+2 TextWindow.CursorTop=TextWindow.CursorTop-1 TextWindow.Write(ln[17]) EndSub ww=LDText.Split("01 02 03 04 06 07 08 09 10 11 12 13 15 16 18 20" " ") rw=1 ct=0 'While rw<= Array.GetItemCount(ww) llw=ww[rw] LDCall.Function("fset" llw*1) If txmm Then TextWindow.CursorTop=ct TextWindow.CursorLeft=5 drawbb() rw=rw+1 LDCall.Function("fset" llw) TextWindow.CursorTop=ct TextWindow.CursorLeft=75 drawbb() ct=ct+34 Else GraphicsWindow.Clear() dd=25 id=1 ldrw() Timer.Interval=100 Timer.Tick=ttt wly=ldShapes.AddAnimatedImage(mmc "false" 16 9) LDShapes.AnimationPause(wly) LDShapes.AnimationSet(wly 1) Shapes.Move(wly 30 275) LDShapes.ReSize(wly 40 40) GraphicsWindow.KeyDown=kkk GraphicsWindow.KeyUp=kuu 'GraphicsWindow.ShowMessage(ln[17] "lvl:"+llw ) ' Timer.Pause() EndIf ' rw=rw+1 'EndWhile Sub kkk lk=GraphicsWindow.LastKey If lk="Left" Then ann="true wsd=4 wd=-1 ElseIf lk="Right" Then ann="true wd=1 wsd=0 ElseIf lk="Up" and rlky Then rlky="false Shapes.Move(wly Shapes.GetLeft(wly) Shapes.GetTop(wly)-52) mdd="true EndIf EndSub Sub kuu ann="false rlky="true EndSub Sub ttt is=is+id If ann Then ws=ws+wd If ws>4 Then ws=1 LDShapes.Move(wly Shapes.GetLeft(wly)+25 Shapes.GetTop(wly)) ElseIf ws<1 Then ws=4 LDShapes.Move(wly Shapes.GetLeft(wly)-25 Shapes.GetTop(wly)) EndIf LDShapes.AnimationSet(wly ws+wsd) EndIf If mdd Then ppx= GraphicsWindow.GetPixel(Shapes.GetLeft(wly) Shapes.GetTop(wly)+47) If ppx=bcc Then LDShapes.Move(wly Shapes.GetLeft(wly) Shapes.GetTop(wly)+3) Else mdd="false EndIf EndIf If is>4 and id>0 Then is=1 If gl>290 Then dd=-dd as=4-as id=-id Shapes.Move(imm Shapes.GetLeft(imm)+50 Shapes.GetTop(imm)) EndIf Shapes.Move(imm Shapes.GetLeft(imm)+dd Shapes.GetTop(imm)) ElseIf id<0 and is<1 Then is=4 If gl<200 Then dd=-dd as=4-as id=-id Shapes.Move(imm Shapes.GetLeft(imm)-50 Shapes.GetTop(imm)) EndIf Shapes.Move(imm Shapes.GetLeft(imm)+dd Shapes.GetTop(imm)) EndIf gl=Shapes.GetLeft(imm) LDShapes.AnimationSet(imm lv[1]+(lv[2]-1)*16+is-1+as) 'GraphicsWindow.Title=gl+" | "+dd EndSub Sub ldrw GraphicsWindow.BackgroundColor="teal GraphicsWindow.Width=800 GraphicsWindow.Height=500 GraphicsWindow.Left=5 GraphicsWindow.Top=5 lm=llw*1 bcc="#000066 GraphicsWindow.BrushColor=bcc GraphicsWindow.FillRectangle(20 20 640 320) bb=LDImage.Copy( mm[4][lm]) LDImage.ReplaceColour(bb "white" "gold" 20) bb1=LDImage.Copy( mm[2][lm]) LDImage.ReplaceColour(bb1 "white" "red" 20) bb2=LDImage.Copy( mm[3][lm]) LDImage.ReplaceColour(bb2 "white" "darkred" 20) bb6=LDImage.Copy( mm[8][lm]) LDImage.ReplaceColour(bb2 "white" "gold" 20) bb5=LDImage.Copy( mm[7][lm]) LDImage.ReplaceColour(bb5 "white" LDColours.HSLtoRGB(180 .8 .7) 20) bb3=LDImage.Copy( mm[5][lm]) LDImage.ReplaceColour(bb3 "white" "cyan" 20) bbx=LDImage.Copy( mm[4][15]) bb4=LDImage.Copy( mm[6][lm]) LDImage.ReplaceColour(bb4 "white" "lime" 20) For y=1 To 16 For c=1 To 32 ch=Text.GetSubText(ln[y] c 1) If ch="#" Then GraphicsWindow.BrushColor="darkred GraphicsWindow.FillRectangle(c*20 y*20 20 20) GraphicsWindow.DrawResizedImage(bb c*20 y*20 20 20) ElseIf ch="=" Then GraphicsWindow.DrawResizedImage(bb1 c*20 y*20 20 20) ElseIf ch="-" Then GraphicsWindow.DrawResizedImage(bb3 c*20 y*20 20 20) ElseIf ch="~" or ch="@" Then GraphicsWindow.DrawResizedImage(bb2 c*20 y*20 20 20) ElseIf ch="w" Then GraphicsWindow.DrawResizedImage(bb5 c*20 y*20 20 20) ElseIf ch="j" or ch="H" Then GraphicsWindow.DrawResizedImage(bb6 c*20 y*20 20 20) ElseIf ch="$" Then GraphicsWindow.DrawResizedImage(mmp[1][lm] c*20 y*20 15 15) ElseIf ch="*" Then GraphicsWindow.DrawResizedImage(bb4 c*20 y*20 20 20) ElseIf ch="E" Then GraphicsWindow.DrawResizedImage(bbx c*20 y*20 20 20) ElseIf ch*1>=1 Then lv=LDText.Split(chr[lm][ch*1] ";") imm=ldShapes.AddAnimatedImage(mmc "false" 16 9) LDShapes.AnimationPause(imm) LDShapes.AnimationSet(imm lv[1]+(lv[2]-1)*16) shapes.move(imm c*20 y*20-20) LDShapes.ReSize(imm 40 40) EndIf EndFor EndFor EndSub End>LWZ214.sb< Start>LXD666.sb< ' Game area controls gameWidth = 640 gameHeight = 480 fps = 50 bgs = 2 'backgroundspeed Player_Lives = 10 nbrisland = 5 'nomber of island images islandcount = 5 'nomber of island in the wall field ' Window title 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" ' 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>LXD666.sb< Start>LXF420.sb< 'Pong Game Sample without ball 'Created by Oskariok 'use up and down arrows to move left paddle 'use w and s keys to move right paddle Main() Sub Main CreateGame() 'Main Loop While "True" If MovingUpRightPad = "true" Then RightPaddleY = RightPaddleY - PadMovement NeedMoveRightPad = "true" EndIf If MovingDownRightPad = "true" Then RightPaddleY = RightPaddleY + PadMovement NeedMoveRightPad = "true" EndIf If MovingUpLeftPad = "true" Then LeftPaddleY = LeftPaddleY - PadMovement NeedMoveLeftPad = "true" EndIf If MovingDownLeftPad = "true" Then LeftPaddleY = LeftPaddleY + PadMovement NeedMoveLeftPad = "true" EndIf SetPaddleYLimits() If NeedMoveLeftPad = "true" Then MoveLeftPad() EndIf If NeedMoveRightPad = "true" Then MoveRightPad() EndIf EndWhile EndSub Sub MoveLeftPad Shapes.Animate(LeftPaddle,5,LeftPaddleY,0) NeedMoveLeftPad = "false" EndSub Sub MoveRightPad Shapes.Animate(RightPaddle,GraphicsWindow.Width-25,RightPaddleY,0) NeedMoveRightPad = "false" EndSub Sub SetPaddleYLimits If LeftPaddleY > GraphicsWindow.Height - 125 Then LeftPaddleY = GraphicsWindow.Height - 125 EndIf If LeftPaddleY < 85 Then LeftPaddleY = 85 EndIf If RightPaddleY > GraphicsWindow.Height - 125 Then RightPaddleY = GraphicsWindow.Height - 125 EndIf If RightPaddleY < 85 Then RightPaddleY = 85 EndIf EndSub Sub CreateGame CrateWindow() CreatePads() 'Set all moving false MovingUpRightPad = "false" MovingDownRightPad = "false" MovingUpLeftPad = "false" MovingDownLeftPad = "false" 'set NeedMovePads to false NeedMoveRightPad = "false" NeedMoveLeftPad = "false" 'In Small Basic GraphicsWindowlastkey is only "A" or "Z "not "a" or "z" 'Set MoveUpRightPadKey as W Key MoveUpRightPadKey = "W" 'Set MoveDownRightPadKey as S Key MoveDownRightPadKey = "S" 'Set MoveUpLeftPadKey as Up arrow MoveUpLeftPadKey = "Up" 'Set MoveDownLeftPadKey as Down arrow MoveDownLeftPadKey = "Down" 'Set movement for Pads PadMovement = 0.3 'Set Paddle Positions RightPaddleY = GraphicsWindow.Height/2-45 LeftPaddleY = GraphicsWindow.Height/2-45 EndSub Sub CrateWindow GraphicsWindow.Show() GraphicsWindow.BackgroundColor = "#000000" GraphicsWindow.Height = 600 GraphicsWindow.Width = 800 GraphicsWindow.Left = Desktop.Width/2-GraphicsWindow.Width/2 GraphicsWindow.Top = Desktop.Height/2-GraphicsWindow.Height/2 GraphicsWindow.CanResize = "false" GraphicsWindow.KeyDown = OnKeyDown GraphicsWindow.KeyUp = OnKeyUp GraphicsWindow.Title = "Pong" GraphicsWindow.PenColor = "#ffffff" GraphicsWindow.PenWidth = 2 GraphicsWindow.DrawLine(0,80,GraphicsWindow.Width+100,80) GraphicsWindow.DrawLine(GraphicsWindow.Width/2-1,80,GraphicsWindow.Width/2-1,GraphicsWindow.Height+100) EndSub Sub CreatePads GraphicsWindow.PenColor = "#ffffff" GraphicsWindow.BrushColor = "#000000" LeftPaddle = Shapes.AddRectangle(20,120) RightPaddle = Shapes.AddRectangle(20,120) Shapes.Move(LeftPaddle, 5,GraphicsWindow.Height/2-45) Shapes.Move(RightPaddle,GraphicsWindow.Width-25 ,GraphicsWindow.Height/2-45) EndSub Sub OnKeyDown Key = GraphicsWindow.LastKey If (Key = MoveUpLeftPadKey) Then MovingUpLeftPad = "true" EndIf If (Key = MoveUpRightPadKey) Then MovingUpRightPad = "true" EndIf If (Key = MoveDownLeftPadKey) Then MovingDownLeftPad = "true" EndIf If (Key = MoveDownRightPadKey) Then MovingDownRightPad = "true" EndIf EndSub Sub OnKeyUp Key = GraphicsWindow.LastKey If (Key = MoveUpLeftPadKey) Then MovingUpLeftPad = "false" EndIf If (Key = MoveUpRightPadKey) Then MovingUpRightPad = "false" EndIf If (Key = MoveDownLeftPadKey) Then MovingDownLeftPad = "false" EndIf If (Key = MoveDownRightPadKey) Then MovingDownRightPad = "false" EndIf EndSub End>LXF420.sb< Start>LXF935.sb< ' Program by Yvan Leduc , ' Claude Debussy 1er Arabesque for piano on Small Basic ' RSQ907, GTS929, image1=imagelist.LoadImage( "https://social.msdn.microsoft.com/Forums/getfile/923041") image2=imagelist.LoadImage( "https://social.msdn.microsoft.com/Forums/getfile/923039") GraphicsWindow.Top =0 GraphicsWindow.left =0 GraphicsWindow.Height=768 GraphicsWindow.Width=1366 GraphicsWindow.DrawImage(image1,10,10) GraphicsWindow.DrawImage(image2,900,400) GraphicsWindow.fontname="AR Decode" GraphicsWindow.FontSize=150 GraphicsWindow.BrushColor="#E7D3AD" GraphicsWindow.DrawboundText(600,100,1300,"1er Arabesque") GraphicsWindow.FontSize=60 GraphicsWindow.BrushColor="#E7B3AB" GraphicsWindow.DrawboundText(800,250,1300,"Claude Debussy") ' KEY SIGNATURE 3/8 For M = 1 To 10 Read_Measure() For T = 1 TO 12 sound.PlayMusic (chord[t]+cs[t]+cf[t]) chord[t]="" cf[t]="" cs[t]="" ENDFOR ENDFOR ' L2=RONDE L4=BLANCHE L8=NOIRE L16=CROCHE ' debussy 1er arabesque ' do# re# fa# sol# SUB Read_Measure If (M=1) then ' measure 1 cs[1]="O5L9 C#" cs[2]="O5L9 E" cs[3]="O5L9A" cs[4]="O6L9 C#" cs[5]="O6L9 E" cs[6]="O6L9 F#" cs[7]="O6L9 G#" cs[8]="O6L9 D#" cs[9]="O5L9 B" cs[10]="O5L9 G#" cs[11]="O5L9 D#" cs[12]="O4L9 B" ElseIf (M=2) then ' measure 2 cs[1]="O4L9 A" cs[2]="O5L9 C#" cs[3]="O5L9 F#" cs[4]="O5L9 A" cs[5]="O6L9 C#" cs[6]="O6L9 D#" cs[7]="O6L9 E" cs[8]="O5L9 B" cs[9]="O5L9 G#" cs[10]="O5L9 E" cs[11]="O4L9 B" cs[12]="O4L9 G#" ElseIf (M=3) then cf[1]="O4L9 F#" cf[2]="O4L9 A" cf[3]="O5L9 C#" chord[4]="O5L64 C#"+"O6L64 C#" cs[4]="O6L9 c#" cs[5]="O5L9 F#" cs[6]="O5L9 A" chord[7]="O4L64 E"+"O6L64 F#" cs[7]="O6L9 F# cf[8]="O4L9 A" cf[9]="O5L9 C#" chord[10]="O5L64 C#"+"O6L64 C#" cs[10]="O6L9 c#" cs[11]="O5L9 F#" cs[12]="O5L9 A" ElseIf (M=4) then chord[1]="O4L64 D#"+"O5L64 A" cs[1]="O6L9 c#" cf[2]="O4L9 A" cf[3]="O5L9 C#" chord[4]="O5L64 C#"+"O6L64 C#" cs[4]="O6L9 c#" cs[5]="O5L9 F#" cs[6]="O5L9 A" chord[7]="O4L64 C#"+"O5L64 A" cs[7]="O6L8 F# cf[8]="O4L9 A" cf[9]="O5L9 E" chord[10]="O5L64 E"+"O6L64 A" cs[10]="O6L9 A" cs[11]="O5L8 A" cs[12]="O6L8 C#" ElseIf (M=5) then chord[1]="O4L64 D#"+"O6L64 A" cf[1]="O3L7 B" cf[2]="O4L7 F#" cf[3]="O4L7 A" chord[4]="O5L64 C#"+"O6L64 A" cs[4]="O6L7 A" cs[5]="O5L7 D#" cs[6]="O5L7 F#" cs[7]="O5L7 A" cs[8]="O6L7 C#" cs[9]="O6L7 D#" chord[10]="O6L64 C#"+"O6L64 A" cs[10]="O6L6 A" chord[11]="O5L64 B"+"O6L64 G#" cs[11]="O6L5 G#" chord[12]="O5L64 A"+"O6L64 F#" cs[12]="O6L4 F#" ElseIf (M=6) then ' 12 notes de durée de 9 mais ici 8 basses = 9/12*8 =6 cf[1]="O3L9 E" cf[2]="O3L9 B" cf[3]="O4L9 E" cf[4]="O4L9 G#" cf[5]="O4L9 B" cf[6]="O4L9 G#" cf[7]="O4L9 E" cf[8]="O3L11 B" trio_6() ElseIf (M=7) then cf[1]="O3L9 E" cf[2]="O4L9 c#" cf[3]="O4L9 E" cf[4]="O4L9 G#" cf[5]="O5L9 c#" cf[6]="O4L9 G#" cf[7]="O4L9 E" cf[8]="O4L11 c#" trio_7() ElseIf (M=8) then chord[1]="O3l64 E"+"O4L64 B" cf[1]="O4L9 B" cf[2]="O3L9 B" cf[3]="O4L9 E" cf[4]="O4L9 G#" cf[5]="O4L9 B" cf[6]="O4L9 G#" cf[7]="O4L9 E" cf[8]="O3L11 B" trio_6() ' meme que mesure 6 ElseIf (M=9) then cf[1]="O3L9 E" cf[2]="O4L9 c#" cf[3]="O4L9 E" cf[4]="O4L9 G#" cf[5]="O5L9 c#" cf[6]="O4L9 G#" cf[7]="O4L9 E" cf[8]="O4L11 c#" trio_7() ' meme ue mesure 7 ElseIf (M=10) then cf[1]="O3L9 F#" cf[2]="O4L9 c#" cf[3]="O4L9 E" cf[4]="O4L9 F#" cf[5]="O3L9 E" cf[6]="O4L9 F#" cf[7]="O4L9 E" cf[8]="O4L11 c#" trio_10() EndIf EndSub sub trio_6 cs[1]="O6L24 E" cs[2]="O6L24 F#" cs[3]="O6L24 C#" cs[4]="O6L24 E" cs[5]="O5L24 B" cs[6]="O6L24 C#" cs[7]="O5L24 G#" cs[8]="O5L24 B" cs[9]="O5L8 F#" EndSub sub trio_7 cs[1]="O5L24 G#" cs[2]="O5L24 E" cs[3]="O5L24 G#" cs[4]="O5L24 D#" cs[5]="O1L24 C" ' simulation d'une note sourde pour respecté mes temps de notes cs[6]="O1L24 C" cs[7]="O1L24 C" cs[8]="O4L24 C#" cs[9]="O1L8 C" EndSub sub trio_10 cs[1]="O4L36 B" cs[2]="O4L36 A" cs[3]="O5L36 B" cs[4]="O5L24 C#" cs[5]="O1L24 C" ' simulation d'une note sourde pour respecté mes temps de notes cs[6]="O1L24 C" cs[7]="O1L24 C" cs[8]="O1L24 C" cs[9]="O1L8 C" EndSub End>LXF935.sb< Start>LXJ881-0.sb< GraphicsWindow.Left=0 GraphicsWindow.Top=0 GraphicsWindow.Width=1200 GraphicsWindow.Height=900 LDUtilities.ShowErrors="false GraphicsWindow.title="3D-CubesHouse view3D = LD3DView.AddView(900,900,"true") LD3DView.AddDirectionalLight (view3D,"#77aaaaaa",-1 ,-1 ,-1) LD3DView.AutoControl2 (1 1) LD3DView.AddspotLight(view3D,"white",5,25, 5 ,-1 ,-1 ,-1 90 150) LD3DView.AddAmbientLight(view3D,"#77555555") LD3DView.ResetCamera(view3D,100,100,100, -1, -1, -1, "","","") GraphicsWindow.BackgroundColor= LDColours.HSLtoRGB (210, 0.88, 0.44) f1=2 inn () For z=0 To 11 For _y1=0 to 12 For _x1=1 to 29 bb=text.GetSubText (block [11-z][12-_y1] _x1 1) If bb=" " Then else o3d=ld3dview.addcube (view3d, 2 ccc[bb] "d") LD3DView.TranslateGeometry (view3d o3d f1*_x1,f1*z f1*_y1 ) EndIf Endfor Endfor endfor LDEvents.MouseWheel=mww ya=21 r35=55 While "true For aa=0 To -1 Step .5 px= LDMath.Cos(aa) py= LDMath.sin (aa) LD3DView.ResetCamera(view3D, px*r35,ya,py*r35, -px, -.5, -py, "","","") Program.Delay (22) EndFor EndWhile Sub mww ya=ya+ LDEvents.LastMouseWheelDelta*3 endsub Sub inn ccc["x"]="white ccc["r"]="orange ccc["d"]="darkred ccc["w"]="#aa00cccc ccc["p"]="red ccc["O"]="gray block[0][12] = " " block[0][11] = " XXX " block[0][10] = " X X " block[0] [9] = " XXX " block[0] [8] = " " block[0] [7] = "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRR" block[0] [6] = " R " block[0] [5] = " R " block[0] [4] = " R " block[0] [3] = " R " block[0] [2] = " R " block[0] [1] = " R " block[0] [0] = " R " block[1][12] = " " block[1][11] = " XXX " block[1][10] = " X X " block[1][9] = " XXX " block[1][8] = "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRR" block[1][7] = " X X X X " block[1][6] = "RRRRR RRRRRRRRRRRRRRRRRRRRRRRR" block[1][5] = " R R PPPP PPPP PPPP " block[1][4] = " R R " block[1][3] = " R R " block[1][2] = " R R " block[1][1] = " RXR " block[1][0] = " R R " block[2][12] = " " block[2][11] = " XXX " block[2][10] = " X X " block[2][9] = "RRRRXXXRRRRRRRRRRRRRRRRRRRRRRR" block[2][8] = " X X X X " block[2][7] = " X X X X " block[2][6] = " X X " block[2][5] = "RRRR RRRRRRRRRRRRRRRRRRRRRRR" block[2][4] = " R R PPPP PPPP PPPP " block[2][3] = " R R " block[2][2] = " R R " block[2][1] = " RXXXR " block[2][0] = " R R " block[3][12] = " " block[3][11] = " XXX " block[3][10] = "RRRRX XRRRRRRRRRRRRRRRRRRRRRRR" block[3][9] = " X XXX X X X " block[3][8] = " X X X X " block[3][7] = " X X X X " block[3][6] = " X X " block[3][5] = " X X " block[3][4] = "RRR RRRRRRRRRRRRRRRRRRRRRR" block[3][3] = " R R PPPP PPPP PPPP " block[3][2] = " R R " block[3][1] = " RXXXXXR " block[3][0] = " R R " block[4][12] = " " block[4][11] = "RRRRXXXRRRRRRRRRRRRRRRRRRRRRRR" block[4][10] = " X XX XX X X X " block[4][9] = " X XXXXX X X X " block[4][8] = " X X X X " block[4][7] = " X X X X " block[4][6] = " X X " block[4][5] = " X X " block[4][4] = " X X " block[4][3] = "RR RRRRRRRRRRRRRRRRRRRRR" block[4][2] = " R R " block[4][1] = " RXXXXXXXR " block[4][0] = " R R " block[5][12] = "RRRRRRRRRRRRRRRRRRRRRRRRRRRRRR" block[5][11] = " XXXXXXXXXXXXXXXXXXXXXXXXXXXX " block[5][10] = " XXX XXX X X " block[5][9] = " XXXXXXXXX X X " block[5][8] = " X X X X " block[5][7] = " X X X X " block[5][6] = " X X " block[5][5] = " X X " block[5][4] = " X X " block[5][3] = "RX XXXXXXXXXXXXXXXXXXXX " block[5][2] = "RX XRRRRRRRRRRRRRRRRRRRR" block[5][1] = "RXXXXXXXXXR " block[5][0] = "R R " block[6][12] = " " block[6][11] = " XXXXXXXXXXXX XXXXXX XXXX " block[6][10] = " X X WWW X WWW X " block[6][9] = " XXX XXX X X " block[6][8] = " X X X W " block[6][7] = " X X X W " block[6][6] = " X W " block[6][5] = " W X " block[6][4] = " W WWWW WWWW X " block[6][3] = " W XXXX XXXX XXXX " block[6][2] = " X DDD X " block[6][1] = " XXX XXX " block[6][0] = " " For z = 7 To 9 block[z] = block[6] EndFor block[10][12] = " " block[10][11] = " XXXXXXXXXXXXXXXXXXXXXXXXXXXX " block[10][10] = " XOOOOOOOX X X " block[10][9] = " XXXXXXXXX X X " block[10][8] = " X X X X " block[10][7] = " X X X X " block[10][6] = " X X " block[10][5] = " X X " block[10][4] = " X X " block[10][3] = " X XXXXXXXXXXXXXXXXXXXX " block[10][2] = " X DDD X " block[10][1] = " XXX XXX " block[10][0] = " " block[11][12] = " " block[11][11] = " XXXXXXXXXXXXXXXXXXXXXXXXXXXX " block[11][10] = " XOOOOOOOXFFFFFFFFXFFFFFFFFFX " block[11][9] = " XXXXXXXXXFFFFFFFFXFFFFFFFFFX " block[11][8] = " XFFFFFFFXFFFFFFFFXFFFFFFFFFX " block[11][7] = " XFFFFFFFXFFFFFFFFXFFFFFFFFFX " block[11][6] = " XFFFFFFFFFFFFFFFFFFFFFFFFFFX " block[11][5] = " XFFFFFFFFFFFFFFFFFFFFFFFFFFX " block[11][4] = " XFFFFFFFFFFFFFFFFFFFFFFFFFFX " block[11][3] = " XFFFFFFFXXXXXXXXXXXXXXXXXXXX " block[11][2] = " XFFDDDFFX " block[11][1] = " XXX XXX " block[11][0] = " " EndSub End>LXJ881-0.sb< Start>LXJ881.sb< GraphicsWindow.Left=0 GraphicsWindow.Top=0 GraphicsWindow.Width=1200 GraphicsWindow.Height=900 GraphicsWindow.title="3d-cubes view3D = LD3DView.AddView(900,900,"true") LD3DView.AddDirectionalLight (view3D,"#77aaaaaa",-1 ,-1 ,-1) 'LD3DView.AutoControl ("true" "true", -1 .5) LD3DView.AddspotLight(view3D,"white",5,25, 5 ,-1 ,-1 ,-1 90 150) LD3DView.AddAmbientLight(view3D,"#77555555") LD3DView.ResetCamera(view3D,10,10,10, -1, -1, -1, "","","") GraphicsWindow.BackgroundColor= LDColours.HSLtoRGB (210, 0.88, 0.44) clr=ldtext.Split ("red orange yellow green blue white" " ") f1=5.03 For z=0 To 2 Step 2 For _x1=0 to 2 For _y1=0 to 2 o3d[z/2+1][_x1][_y1]=ld3dview.addcube (view3d, 4.7 clr[z/2+1] "d") LD3DView.TranslateGeometry (view3d o3d[z/2+1][_x1][_y1] f1*_x1, f1*_y1,f1*z ) Endfor Endfor endfor f1=5.1 f11=4.98 For z=0 To 2 Step 2 For _x1=0 to 2 For _y1=0 to 2 o3d[z/2+3][_x1][_y1]=ld3dview.addcube (view3d, 4.7 clr[z/2+3] "d") LD3DView.TranslateGeometry (view3d o3d[z/2+3][_x1][_y1] f11*_x1+.05,f1*z-0.05, .05+f11*_y1 ) Endfor Endfor endfor For z=0 To 2 Step 2 For _x1=0 to 2 For _y1=0 to 2 o3d[z/2+5][_x1][_y1]=ld3dview.addcube (view3d, 4.7 clr[z/2+5] "d") LD3DView.TranslateGeometry (view3d o3d[z/2+5][_x1][_y1] f1*z-.05 f11*_x1+.05, .05+f11*_y1 ) Endfor Endfor endfor LD3DView.AnimateRotation(view3D o3d [1][1][1] 0 1 0 0 360 2,-1) LD3DView.AnimateRotation(view3D o3d [2][1][1] 0 1 0 0 360 2,-1) LD3DView.AnimateRotation(view3D o3d [3][1][1] 0 0 1 0 360 2,-1) LD3DView.AnimateRotation(view3D o3d [4][1][1] 0 0 1 0 360 2,-1) LD3DView.AnimateRotation(view3D o3d [5][1][1] 0 1 0 0 360 2,-1) LD3DView.AnimateRotation(view3D o3d [6][1][1] 0 1 0 0 360 2,-1) LDEvents.MouseWheel=mww ya=21 r35=55 While "true For aa=0 To 360 Step .5 px= LDMath.Cos(aa) py= LDMath.sin (aa) LD3DView.ResetCamera(view3D, px*r35,ya,py*r35, -px, -.5, -py, "","","") Program.Delay (22) EndFor EndWhile Sub mww ya=ya+ LDEvents.LastMouseWheelDelta*3 endsub End>LXJ881.sb< Start>LXK869.sb< ' SmallBasic Version 1.0 ' Funktion: Regular Triangle ' Autor: Pappa Lapub ' Herkunft: http://social.msdn.microsoft.com/Forums/en-US/80e1f722-5266-4c1d-bb68-1b4e614afeaa/challenge-of-the-month-july-2014 ' ImportURL: http://smallbasic.com/program/?(NDK700) ' Extension: (LitDev) ' Kommentar: Community Suggestions (by Nonki), 3. Draw a picture of a regular triangle ' H = a * cos(30) = a * sin(60) = a/2 * tan(60) = a/2 * sqr(3) ' Variablen: triSide .. Initial Side length for triangle ' ' -------------------------------------------------------------------------------- triSide = 100 TBLeft = 10 TBTop = 10 TBWidth = 80 ' 3 digits at FontSize = 24 TBHeight = 44 GraphicsWindow.Title = "Select side length for regular triangle" GraphicsWindow.BrushColor = "Black" Draw = Controls.AddButton("Draw",TBLeft + TBWidth + 10,TBTop) Controls.SetSize(Draw,TBHeight,TBHeight) AddSpinControl() GraphicsWindow.PenWidth = 0 'GraphicsWindow.PenColor = GraphicsWindow.GetRandomColor() GraphicsWindow.BrushColor = GraphicsWindow.GetRandomColor() lastSide = triSide factH = 0.5 * Math.SquareRoot(3) Tri = Shapes.AddTriangle(0,0, triSide,0, triSide/2,triSide*factH) Shapes.Rotate(Tri,180) Shapes.Move(Tri,(GraphicsWindow.Width-triSide)/2, (GraphicsWindow.Height-triSide)/2) 'Shapes.Rotate(Tri,180) Shapes.Zoom(Tri, 1, factH) Controls.ButtonClicked = OnButtonClick Controls.TextTyped = OnTextBoxType ' ///// SUBs \\\\\ Sub AddSpinControl TBRight = TBLeft + TBWidth btnWidth = 20 ' FontSize = 9 btnHeight = (TBHeight-2)/2 ' FontSize = 9 Delta = 2 ' Delta Up/Down GraphicsWindow.FontSize = 24 TB = Controls.AddTextBox(TBLeft,TBTop) Controls.SetSize(TB,TBWidth,TBHeight) Controls.SetTextBoxText(TB,triSide) GraphicsWindow.FontSize = 9 SpinUp = Controls.AddButton("▲",TBRight-btnWidth,TBTop+1) Controls.SetSize(SpinUp,btnWidth,btnHeight) ' LDShapes.SetImage(SpinUp, Program.Directory + "\Buttons\SpinUp.png") ' for lower button height (Img: 13x7 Pxl) SpinDown = Controls.AddButton("▼",TBRight-btnWidth,TBTop+btnHeight+1) Controls.SetSize(SpinDown,btnWidth,btnHeight) ' LDShapes.SetImage(SpinDown, Program.Directory + "\Buttons\SpinDown.png") ' for lower button height (Img: 13x7 Pxl) EndSub Sub DrawTriangle Rel = triSide/lastSide ' LDShapes.BrushColour(Tri, GraphicsWindow.GetRandomColor()) ' for different colors Shapes.Zoom(Tri, Rel, Rel * factH) EndSub ' ////////// EVENTs \\\\\\\\\\ Sub OnButtonClick If Controls.LastClickedButton = SpinUp And triSide <= GraphicsWindow.Width Then triSide = triSide + Delta Controls.SetTextBoxText(TB,triSide) ElseIf Controls.LastClickedButton = SpinDown And triSide > Delta Then triSide = Math.Abs(triSide - Delta) Controls.SetTextBoxText(TB,triSide) ElseIf Controls.LastClickedButton = Draw Then DrawTriangle() EndIf EndSub Sub OnTextBoxType If Controls.LastTypedTextBox = TB Then 'Controls.SetTextBoxText(TB, triSide) ' for ReadOnly TextBox If Controls.GetTextBoxText(TB) + 0 <> Controls.GetTextBoxText(TB) Or Controls.GetTextBoxText(TB) >= GraphicsWindow.Width Then Controls.SetTextBoxText(TB, triSide) Else triSide = Controls.GetTextBoxText(TB) EndIf EndIf EndSub End>LXK869.sb< Start>LXM256.sb< boxwid = 200 boxhei = 20 boxpx = 100 boxpy = 30 textpy = 70 textpx = 40 tx = 50 ty = 150 GraphicsWindow.Title = "Password controls" GraphicsWindow.BackgroundColor = "Gainsboro" GraphicsWindow.MouseDown = Click GraphicsWindow.BrushColor = "silver" GraphicsWindow.fillRectangle(boxpx,boxpy,boxwid,boxhei) GraphicsWindow.DrawRectangle(boxpx,boxpy,boxwid,boxhei) GraphicsWindow.BrushColor = "GRAY" GraphicsWindow.DrawText(boxpx-80,boxpy+3,"PASSWORD:") GraphicsWindow.BrushColor = "BLACK" GraphicsWindow.DrawText(textpx,textpy,"1. Click in the box to type password") GraphicsWindow.DrawText(textpx,textpy+15,"2. Hit return and password is entered") Sub Click mx = GraphicsWindow.MouseX my = GraphicsWindow.Mousey If mx > boxpx And mx < (boxpx+boxwid) Then If my >boxpy And my < (boxpy+boxhei) Then entry() Else null() EndIf Else null() EndIf EndSub Sub entry GraphicsWindow.KeyDown = Key LINE = Shapes.AddLine(boxpx+10,boxpy+3,boxpx+10,boxpy+15) EndSub Sub Key New = GraphicsWindow.LastKey If New = "Back" Then Shapes.Remove(circ[pass]) lend = Text.GetLength(string) string = Text.GetSubText(string,1,lend-1) Shapes.Move(LINE,(16*PASS)-16,0) pass = pass -1 Else If New = "Return" Then password=string For i = 0 To pass Shapes.Remove(circ[i]) EndFor Shapes.Remove(line) pass=0 string="" GraphicsWindow.DrawText(tx,ty," Password : "+password) ty = ty + 20 Else pass = pass + 1 circ[pass]=Shapes.AddEllipse(12,12) Shapes.Move(LINE,16*PASS,0) Shapes.Move(circ[pass],boxpx-10+(pass*16),boxpy+3) String = String+New EndIf EndIf EndSub Sub off GraphicsWindow.KeyDown = null EndSub Sub null Shapes.Remove(line) off() EndSub End>LXM256.sb< Start>LXR983.sb< ' The following line could be harmful and has been automatically commented. ' AC = LDFile.GetAllDirectories("C:/") ' The following line could be harmful and has been automatically commented. ' AE = LDFile.GetAllDirectories("E:/") IAC = Array.GetItemCount(AC) For i = 1 To IAC TextWindow.WriteLine(AC[i]) EndFor IAE = Array.GetItemCount(AC) For i = 1 To IAE TextWindow.WriteLine(AC[i]) EndFor End>LXR983.sb< Start>LXZ493.sb< 'This Program use the LD- and ESL-Extentions. 'Its generate a small basic program with the following name. NameOfFile = "E:\Programs SB\0000 Generate.sb" Init() Main() Program.End() Sub Main StartSBProgram() ShowColours() MainLoop = T While MainLoop = T GetColour() SetColour() EndWhile 'MainLoop EndSBProgram() For i = 1 to LI Controls.HideControl(CB[i]) EndFor Wait4End = T While Wait4End = T If OBC = T Then Wait4End = F EndIf EndWhile EndSub 'Main Sub GetColour WaitCB = T While WaitCB = T If OKU = T Then OKU = F KeyPressReaction() ShowShape() EndIf If OBC = T Then OBC = F WaitCB = F ButtonClickReaction() EndIf EndWhile 'WaitCB EndSub 'GetColour Sub KeyPressReaction Art = GraphicsWindow.LastKey If Text.ConvertToLowerCase (Art) = "d" Then Art = "DD" ElseIf Text.ConvertToLowerCase (Art) = "u" Then Art = "DU" ElseIf Text.ConvertToLowerCase (Art) = "h" Then Art = "H" ElseIf Text.ConvertToLowerCase (Art) = "v" Then Art = "V" ElseIf Text.ConvertToLowerCase (Art) = "r" Then Art = "" EndIf EndSub 'KeyPressReaction Sub ButtonClickReaction LBC = Controls.LastClickedButton If LBC = End Then LBC = "" WaitCB = F MainLoop = F OBC = F OKU = F Else For i = 1 To LI If LBC = CB[i] Then CI = i i = LI WaitCB = F EndIf EndFor EndIf EndSub 'ButtonClickReaction Sub SetColour GI = GI + 1 gradient[GI] = Co[CI] Indexes[GI] = CI ShowShape() PI = PI + 1 Start = PI P[PI] = "GI = GI + 1 " + LineEnd PI = PI + 1 P[PI] = "gradient[GI] = " + Text.GetCharacter(34) + gradient[GI] + Text.GetCharacter(34) + " ' " + Cn[CI] + LineEnd ShowProgram() EndSub 'SetColour Sub ShowShape brush = LDShapes.BrushGradient(gradient,Art) LDShapes.BrushGradientRoundedRectangle(brush,20,215,670,370,20) EndSub 'ShowShape Sub ShowProgram For i = Start To PI TT = TT + P[i] EndFor Controls.SetTextBoxText(MLTB, TT) EndSub 'ShowProgram Sub ShowColours x1[1] = 0 x2[1] = 0 x3[1] = 50 x4[1] = 30 For i = 1 To Array.GetItemCount(Co) GraphicsWindow.BrushColor = Co[i] If x1[1] + x3[1] > GW Then x2[1] = x2[1] + x4[1] x1[1] = 0 EndIf GraphicsWindow.FillRectangle(x1[1],x2[1],x3[1],x4[1]) GraphicsWindow.BrushColor = Co[i] 'CB[i] = Controls.AddButton(Cn[i], x1[1] + 4, x2[1]+2) CB[i] = Controls.AddButton("■", x1[1] +16, x2[1]+2) x1[1] = x1[1] + x3[1] EndFor EndSub 'ShowColours Sub Init 'EVENTS Controls.ButtonClicked = OnButtonCliecked GraphicsWindow.KeyUp = OnKeyUp Gt = 0 Gl = 0 GW = Desktop.Width Gh = Desktop.Height GraphicsWindow.BackgroundColor = LDColours.White GraphicsWindow.Top = Gt GraphicsWindow.Left = Gl GraphicsWindow.Width = GW GraphicsWindow.Height = Gh GraphicsWindow.Show() T = "True" F = "False" Cn[1] = "AliceBlue " Cn[2] = "AntiqueWhite " Cn[3] = "Aqua " Cn[4] = "Aquamarine " Cn[5] = "Azure " Cn[6] = "Beige " Cn[7] = "Bisque " Cn[8] = "Black " Cn[9] = "BlanchedAlmond " Cn[10] = "Blue " Cn[11] = "BlueViolet " Cn[12] = "Brown " Cn[13] = "BurlyWood " Cn[14] = "CadetBlue " Cn[15] = "Chartreuse " Cn[16] = "Chocolate " Cn[17] = "Coral " Cn[18] = "CornflowerBlue " Cn[19] = "Cornsilk " Cn[20] = "Crimson " Cn[21] = "Cyan " Cn[22] = "DarkBlue " Cn[23] = "DarkCyan " Cn[24] = "DarkGoldenrod " Cn[25] = "DarkGray " Cn[26] = "DarkGreen " Cn[27] = "DarkKhaki " Cn[28] = "DarkMagenta " Cn[29] = "DarkOliveGreen " Cn[30] = "DarkOrange " Cn[31] = "DarkOrchid " Cn[32] = "DarkRed " Cn[33] = "DarkSalmon " Cn[34] = "DarkSeaGreen " Cn[35] = "DarkSlateBlue " Cn[36] = "DarkSlateGray " Cn[37] = "DarkTurquoise " Cn[38] = "DarkViolet " Cn[39] = "DeepPink " Cn[40] = "DeepSkyBlue " Cn[41] = "DimGray " Cn[42] = "DodgerBlue " Cn[43] = "FireBrick " Cn[44] = "FloralWhite " Cn[45] = "ForestGreen " Cn[46] = "Fuchsia " Cn[47] = "Gainsboro " Cn[48] = "GhostWhite " Cn[49] = "Gold " Cn[50] = "Goldenrod " Cn[51] = "Gray " Cn[52] = "Green " Cn[53] = "GreenYellow " Cn[54] = "Honeydew " Cn[55] = "HotPink " Cn[56] = "IndianRed " Cn[57] = "Indigo " Cn[58] = "Ivory " Cn[59] = "Khaki " Cn[60] = "Lavender " Cn[61] = "LavenderBlush " Cn[62] = "LawnGreen " Cn[63] = "LemonChiffon " Cn[64] = "LightBlue " Cn[65] = "LightCoral " Cn[66] = "LightCyan " Cn[67] = "LightGoldenrodYellow" Cn[68] = "LightGray " Cn[69] = "LightGreen " Cn[70] = "LightPink " Cn[71] = "LightSalmon " Cn[72] = "LightSeaGreen " Cn[73] = "LightSkyBlue " Cn[74] = "LightSlateGray " Cn[75] = "LightSteelBlue " Cn[76] = "LightYellow " Cn[77] = "Lime " Cn[78] = "LimeGreen " Cn[79] = "Linen " Cn[80] = "Magenta " Cn[81] = "Maroon " Cn[82] = "MediumAquamarine " Cn[83] = "MediumBlue " Cn[84] = "MediumOrchid " Cn[85] = "MediumPurple " Cn[86] = "MediumSeaGreen " Cn[87] = "MediumSlateBlue " Cn[88] = "MediumSpringGreen " Cn[89] = "MediumTurquoise " Cn[90] = "MediumVioletRed " Cn[91] = "MidnightBlue " Cn[92] = "MintCream " Cn[93] = "MistyRose " Cn[94] = "Moccasin " Cn[95] = "NavajoWhite " Cn[96] = "Navy " Cn[97] = "OldLace " Cn[98] = "Olive " Cn[99] = "OliveDrab " Cn[100] = "Orange " Cn[101] = "OrangeRed " Cn[102] = "Orchid " Cn[103] = "PaleGoldenrod " Cn[104] = "PaleGreen " Cn[105] = "PaleTurquoise " Cn[106] = "PaleVioletRed " Cn[107] = "PapayaWhip " Cn[108] = "PeachPuff " Cn[109] = "Peru " Cn[110] = "Pink " Cn[111] = "Plum " Cn[112] = "PowderBlue " Cn[113] = "Purple " Cn[114] = "Red " Cn[115] = "RosyBrown " Cn[116] = "RoyalBlue " Cn[117] = "SaddleBrown " Cn[118] = "Salmon " Cn[119] = "SandyBrown " Cn[120] = "SeaGreen " Cn[121] = "Seashell " Cn[122] = "Sienna " Cn[123] = "Silver " Cn[124] = "SkyBlue " Cn[125] = "SlateBlue " Cn[126] = "SlateGray " Cn[127] = "Snow " Cn[128] = "SpringGreen " Cn[129] = "SteelBlue " Cn[130] = "Tan " Cn[131] = "Teal " Cn[132] = "Thistle " Cn[133] = "Tomato " Cn[134] = "Turquoise " Cn[135] = "Violet " Cn[136] = "Wheat " Cn[137] = "White " Cn[138] = "WhiteSmoke " Cn[139] = "Yellow " Cn[140] = "YellowGreen " Co[1] = LDColours.AliceBlue Co[2] = LDColours.AntiqueWhite Co[3] = LDColours.Aqua Co[4] = LDColours.Aquamarine Co[5] = LDColours.Azure Co[6] = LDColours.Beige Co[7] = LDColours.Bisque Co[8] = LDColours.Black Co[9] = LDColours.BlanchedAlmond Co[10] = LDColours.Blue Co[11] = LDColours.BlueViolet Co[12] = LDColours.Brown Co[13] = LDColours.BurlyWood Co[14] = LDColours.CadetBlue Co[15] = LDColours.Chartreuse Co[16] = LDColours.Chocolate Co[17] = LDColours.Coral Co[18] = LDColours.CornflowerBlue Co[19] = LDColours.Cornsilk Co[20] = LDColours.Crimson Co[21] = LDColours.Cyan Co[22] = LDColours.DarkBlue Co[23] = LDColours.DarkCyan Co[24] = LDColours.DarkGoldenrod Co[25] = LDColours.DarkGray Co[26] = LDColours.DarkGreen Co[27] = LDColours.DarkKhaki Co[28] = LDColours.DarkMagenta Co[29] = LDColours.DarkOliveGreen Co[30] = LDColours.DarkOrange Co[31] = LDColours.DarkOrchid Co[32] = LDColours.DarkRed Co[33] = LDColours.DarkSalmon Co[34] = LDColours.DarkSeaGreen Co[35] = LDColours.DarkSlateBlue Co[36] = LDColours.DarkSlateGray Co[37] = LDColours.DarkTurquoise Co[38] = LDColours.DarkViolet Co[39] = LDColours.DeepPink Co[40] = LDColours.DeepSkyBlue Co[41] = LDColours.DimGray Co[42] = LDColours.DodgerBlue Co[43] = LDColours.FireBrick Co[44] = LDColours.FloralWhite Co[45] = LDColours.ForestGreen Co[46] = LDColours.Fuchsia Co[47] = LDColours.Gainsboro Co[48] = LDColours.GhostWhite Co[49] = LDColours.Gold Co[50] = LDColours.Goldenrod Co[51] = LDColours.Gray Co[52] = LDColours.Green Co[53] = LDColours.GreenYellow Co[54] = LDColours.Honeydew Co[55] = LDColours.HotPink Co[56] = LDColours.IndianRed Co[57] = LDColours.Indigo Co[58] = LDColours.Ivory Co[59] = LDColours.Khaki Co[60] = LDColours.Lavender Co[61] = LDColours.LavenderBlush Co[62] = LDColours.LawnGreen Co[63] = LDColours.LemonChiffon Co[64] = LDColours.LightBlue Co[65] = LDColours.LightCoral Co[66] = LDColours.LightCyan Co[67] = LDColours.LightGoldenrodYellow Co[68] = LDColours.LightGray Co[69] = LDColours.LightGreen Co[70] = LDColours.LightPink Co[71] = LDColours.LightSalmon Co[72] = LDColours.LightSeaGreen Co[73] = LDColours.LightSkyBlue Co[74] = LDColours.LightSlateGray Co[75] = LDColours.LightSteelBlue Co[76] = LDColours.LightYellow Co[77] = LDColours.Lime Co[78] = LDColours.LimeGreen Co[79] = LDColours.Linen Co[80] = LDColours.Magenta Co[81] = LDColours.Maroon Co[82] = LDColours.MediumAquamarine Co[83] = LDColours.MediumBlue Co[84] = LDColours.MediumOrchid Co[85] = LDColours.MediumPurple Co[86] = LDColours.MediumSeaGreen Co[87] = LDColours.MediumSlateBlue Co[88] = LDColours.MediumSpringGreen Co[89] = LDColours.MediumTurquoise Co[90] = LDColours.MediumVioletRed Co[91] = LDColours.MidnightBlue Co[92] = LDColours.MintCream Co[93] = LDColours.MistyRose Co[94] = LDColours.Moccasin Co[95] = LDColours.NavajoWhite Co[96] = LDColours.Navy Co[97] = LDColours.OldLace Co[98] = LDColours.Olive Co[99] = LDColours.OliveDrab Co[100] = LDColours.Orange Co[101] = LDColours.OrangeRed Co[102] = LDColours.Orchid Co[103] = LDColours.PaleGoldenrod Co[104] = LDColours.PaleGreen Co[105] = LDColours.PaleTurquoise Co[106] = LDColours.PaleVioletRed Co[107] = LDColours.PapayaWhip Co[108] = LDColours.PeachPuff Co[109] = LDColours.Peru Co[110] = LDColours.Pink Co[111] = LDColours.Plum Co[112] = LDColours.PowderBlue Co[113] = LDColours.Purple Co[114] = LDColours.Red Co[115] = LDColours.RosyBrown Co[116] = LDColours.RoyalBlue Co[117] = LDColours.SaddleBrown Co[118] = LDColours.Salmon Co[119] = LDColours.SandyBrown Co[120] = LDColours.SeaGreen Co[121] = LDColours.Seashell Co[122] = LDColours.Sienna Co[123] = LDColours.Silver Co[124] = LDColours.SkyBlue Co[125] = LDColours.SlateBlue Co[126] = LDColours.SlateGray Co[127] = LDColours.Snow Co[128] = LDColours.SpringGreen Co[129] = LDColours.SteelBlue Co[130] = LDColours.Tan Co[131] = LDColours.Teal Co[132] = LDColours.Thistle Co[133] = LDColours.Tomato Co[134] = LDColours.Turquoise Co[135] = LDColours.Violet Co[136] = LDColours.Wheat Co[137] = LDColours.White Co[138] = LDColours.WhiteSmoke Co[139] = LDColours.Yellow Co[140] = LDColours.YellowGreen LI = Array.GetItemCount(Co) GraphicsWindow.DrawText(10, 600, "Please click to the colour button. Please press key d, u, h, v or r to change the art of gradient.") MLTB = Controls.AddMultiLineTextBox(800,250) Controls.SetSize(MLTB, 500,400) GraphicsWindow.BrushColor = "LightBlue" GraphicsWindow.FillRectangle(797, 217, 506, 30) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawRectangle(797, 217, 506, 30) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(800,220, "Generate Programcode for "+NameOfFile ) GraphicsWindow.DrawRectangle(797, 247, 506, 406) End = Controls.AddButton(" E N D ", Gw/2 - 50, Gh - 150) EndSub 'Init Sub OnButtonCliecked OBC = T EndSub Sub OnKeyUp OKU = T EndSub Sub StartSBProgram GraphicsWindow.FontName = "Courier" LineEnd = Text.GetCharacter(13) P[1] = "Gt = 0 " + LineEnd P[2] = "Gl = 0 " + LineEnd P[3] = "GW = Desktop.Width " + LineEnd P[4] = "Gh = Desktop.Height " + LineEnd P[5] = "GraphicsWindow.Top = Gt " + LineEnd P[6] = "GraphicsWindow.Left = Gl " + LineEnd P[7] = "GraphicsWindow.Width = GW " + LineEnd P[8] = "GraphicsWindow.Height = Gh " + LineEnd P[9] = "GraphicsWindow.Show() " + LineEnd PI = 9 ShowProgram() EndSub 'StartSBProgram Sub EndSBProgram PI = PI + 1 P[PI] = "Art = " + Text.GetCharacter(34) + Art + Text.GetCharacter(34) + LineEnd PI = PI + 1 P[PI] = "brush = LDShapes.BrushGradient(gradient,Art) " + LineEnd PI = PI + 1 P[PI] = "LDShapes.BrushGradientRoundedRectangle(brush,Gt,Gl,Gw,Gh,20)" + LineEnd ShowProgram() For i = 1 To PI Progtext = Progtext + P[i] EndFor ' The following line could be harmful and has been automatically commented. ' ESLFile.Write(NameOfFile, Progtext) brush = LDShapes.BrushGradient(gradient,Art) LDShapes.BrushGradientRoundedRectangle(brush,Gt, Gl, Gw, Gh,20) GraphicsWindow.BrushColor = "LightBlue" GraphicsWindow.FillRectangle(797, 217, 506, 30) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawRectangle(797, 217, 506, 30) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawText(800,220, "Generate Programcode for "+NameOfFile ) GraphicsWindow.DrawRectangle(797, 247, 506, 406) EndSub 'EndSBProgram End>LXZ493.sb< Start>LZB311.sb< 'Small Challenge 3 'Write a program to calculate triangular numbers. 'Triangular Number Sequence in graphicsWindow initGUI() formGUI() Controls.ButtonClicked = onButtonClicked Sub onButtonClicked Sound.PlayClickAndWait() If Controls.LastClickedButton = calcButton Then answerCalc() ElseIf Controls.LastClickedButton = clearButton Then clearBoxes() ElseIf Controls.LastClickedButton = endButton Then endProgram() EndIf EndSub Sub endProgram Program.End() EndSub Sub clearBoxes Controls.SetTextBoxText(numBox, "") Controls.SetTextBoxText(answerBox, "") EndSub Sub answerCalc num = Controls.GetTextBoxText(numBox) answer = num*(num+1)/2 Controls.SetTextBoxText(answerBox, answer) EndSub Sub formGUI formFont() GraphicsWindow.DrawText(15, 15, "Enter number:") inputFont() numBox = Controls.AddTextBox(15, 35) Controls.SetSize(numBox, 150, 30) buttonFont() calcButton = Controls.AddButton("Calculate", 185, 35) 'buttons clearButton = Controls.AddButton("Clear", 300, 35) endButton = Controls.AddButton("End Program", 570, 350) formFont() GraphicsWindow.DrawText(365, 15, "Answer:") inputFont() answerBox = Controls.AddTextBox(365, 35) Controls.SetSize(answerBox, 320, 30) EndSub Sub initGUI GraphicsWindow.Title = "Triangular Numbers" gww = 700 gwh = 400 GraphicsWindow.Left = (Desktop.Width - gww) / 2 GraphicsWindow.Top = (Desktop.Height - gwh) / 2 - 35 GraphicsWindow.Width = gww GraphicsWindow.Height = gwh GraphicsWindow.BackgroundColor = "black" EndSub '=================Fonts======================================= Sub formFont GraphicsWindow.BrushColor = "Chartreuse" GraphicsWindow.FontName = "Eras ITC" GraphicsWindow.FontBold = "false" GraphicsWindow.FontSize = 16 EndSub Sub buttonFont GraphicsWindow.BrushColor = "Blue" EndSub Sub inputFont GraphicsWindow.BrushColor = "Black" EndSub End>LZB311.sb< Start>LZF101.sb< A1 = 1 new: n = 1 A1 = A1 +1 MAXF = 30 sz = Math.GetRandomNumber(20) sz = sz + 20 p1 = Math.GetRandomNumber(400) p2 = Math.GetRandomNumber(400) If A1 > 30 Then Goto End1 EndIf start: n = n +1 If n > 150 Then GraphicsWindow.brushColor = "Brown" GraphicsWindow.fillEllipse(p1-((sz/2)/2),p2-((sz/2)/2),sz/2,sz/2) GraphicsWindow.brushColor = "BROWN" newshape = Shapes.AddEllipse(sz*2,sz*2) Shapes.SetOpacity(newshape,10) Shapes.Move(newshape,p1-(sz),p2-(sz)) GraphicsWindow.fillEllipse(p1-((sz/2)/2),p2-((sz/2)/2),sz/2,sz/2) Goto new EndIf num1 = Math.GetRandomNumber(sz) pos = Math.SquareRoot((sz*sz)-(num1*num1)) may1 = Math.GetRandomNumber(2) may2 = Math.GetRandomNumber(2) If may1 = 1 then pos = (0-pos) EndIf If may2 = 1 then num1 = (0-num1) EndIf num1 = num1 + (p1) pos = pos + (p2) colp = Math.GetRandomNumber(4) col[1] = "yellow" col[2] = "gold" col[3] = "orange" col[4] = "darkorange" GraphicsWindow.PenColor = col[colp] GraphicsWindow.DrawLine(num1,pos,p1,p2) Goto start END1: TextWindow.Pause() End>LZF101.sb< Start>LZG002.sb< GraphicsWindow.BrushColor="black" For X=1 To 25 Step 2 For y=1 To 25 Step 2 GraphicsWindow.FillEllipse(x*20,y*20,4,4) dots[y] = Shapes.AddEllipse(4,4) Shapes.Move(dots[y], x*20,y*20) EndFor EndFor GraphicsWindow.mousedown=OnMouseDown GraphicsWindow.MouseUp=OnMouseUp GraphicsWindow.mouseMove=OnMouseMove Sub OnMouseDown ingedrukt=1 startx=GraphicsWindow.MouseX starty=GraphicsWindow.MouseY xnummer=math.round((startx-20)/40)+0 startx=20+xnummer*40 ynummer=math.round((starty-20)/40)+0 starty=20+ynummer*40 endsub Sub OnMouseUp ingedrukt=0 endsub Sub OnMouseMove If ingedrukt=1 then 'maak scherm leeg ' GraphicsWindow.Clear() Shapes.HideShape(line[j]) 'teken alles opnieuw x=GraphicsWindow.MouseX y=GraphicsWindow.MouseY xnummer=math.round((x-20)/40)+0 x=20+xnummer*40 ynummer=math.round((y-20)/40)+0 y=20+ynummer*40 'graphicswindow.DrawLine(startx,starty,x,y) j=j+1 line[j] = Shapes.AddLine(startx,starty,x,y) endif endsub End>LZG002.sb< Start>LZJ947.sb< GraphicsWindow.BackgroundColor="tan GraphicsWindow.PenWidth=0 fff="33405033303323301010121041106010707073707070707010101010101010101010101010101010101010101010101010101010101010101010101010101010 fff="40104010401040101040104010401040401040104010401010401040104010404010401040104010104010401040104040104010401040101040104010401040 fff="42114011421140111040104010401040421042104210421011401140114011404110431041104312114211421142114240104211401042101142114011421140 II[1]= LDShapes.BrushImage(ImageList.LoadImage("e:\ll.png")) II[2]= LDShapes.BrushImage(ImageList.LoadImage("e:\is.png")) II[3]= LDShapes.BrushImage(ImageList.LoadImage("e:\kt.png")) II[4]= LDShapes.BrushImage(ImageList.LoadImage("e:\yy.png")) II[5]= LDShapes.BrushImage(ImageList.LoadImage("e:\rr.png")) II[6]= LDShapes.BrushImage(ImageList.LoadImage("e:\kx.png")) II[7]= LDShapes.BrushImage(ImageList.LoadImage("e:\nn.png")) For y=1 To 8 For x=1 To 8 s=Shapes.AddRectangle(40 40) Shapes.Move(s x*40 y*40) cc=1 LDShapes.BrushShape(s ii[cc]) st[s]=cc LDShapes.SetShapeEvent(s) EndFor EndFor readff() LDShapes.ShapeEvent=see GraphicsWindow.Title="Shaper args=0 bb1=Controls.AddButton(" clr " 1 1) bb2=Controls.AddButton(" lst " 55 1) bb3=Controls.AddButton(" fst " 115 1) Controls.ButtonClicked=bcc Sub bcc ss=LDShapes.GetAllShapes() If Controls.LastClickedButton=bb1 Then For f=1 To 64 LDShapes.BrushShape(ss[f] ii[1]) If aa[ss[f]]<>0 Then aa[ss[f]]=0 Shapes.Rotate(ss[f] 0) EndIf EndFor ElseIf Controls.LastClickedButton=bb3 Then fff=FCDialogs.AskForTextLine("Str:") readff() Else TextWindow.Clear() For f=1 To 64 ff=ss[f] TextWindow.Write(st[ff]) TextWindow.write(aa[ff]/90) EndFor EndIf EndSub Sub see ls=LDShapes.LastEventShape If LDShapes.LastEventType="MouseDown" Then If Mouse.IsRightButtonDown Then tc=tc+1 If tc>7 Then tc=1 EndIf st[ls]=tc LDShapes.BrushShape(ls ii[tc]) Else aa[ls]=aa[ls]+90 If aa[ls]>=360 Then aa[ls]=0 EndIf Shapes.Rotate(ls aa[ls]) EndIf EndIf EndSub Sub readff ss=LDShapes.GetAllShapes() For f=0 To 63 t=Text.GetSubText(fff f*2+1 1 ) r=Text.GetSubText(fff f*2+2 1) rf=ss[f+1] LDShapes.BrushShape(ss[f+1] ii[t]) Shapes.Rotate(ss[f+1] r*90) aa[rf]=r*90 st[rf]=t EndFor EndSub End>LZJ947.sb< Start>LZL364.sb< 'Initialise graphics window GraphicsWindow.Hide() gw = 800 gh = 600 GraphicsWindow.CanResize = "False" GraphicsWindow.Top = (Desktop.Height-gh)/2 GraphicsWindow.Left = (Desktop.Width-gw)/2 GraphicsWindow.Title = "Fruit Machine 2" GraphicsWindow.Width = gw GraphicsWindow.Height = gh GraphicsWindow.BackgroundColor = "LightBlue" Rand1 = 0 i = 0 'Show window GraphicsWindow.Show() 'Reduce f0r menu gw = gw-200 GraphicsWindow.MouseDown = OnMouseDown delay1=500 'Draw vertical line and menu GraphicsWindow.PenColor = "Black" GraphicsWindow.DrawLine(gw,0,gw,gh) GraphicsWindow.BrushColor = "Black" GraphicsWindow.DrawBoundText(gw+15,580,50,"RESPIN") GraphicsWindow.DrawBoundText(gw+115,580,50,"QUIT")'Label Spinrolls() 'MAIN LOOP ( ui thread) DO ALL SCREEN DRAWS AND USSUALLY PROCESSING HERE While "True" If mouseDown Then Spinrolls() mouseDown = "False" EndIf Program.Delay(15) EndWhile Sub Spinrolls Rand1 = 0 i = 0 For i = 0 To 10 'Rand1 GraphicsWindow.BrushColor = "Red" GraphicsWindow.DrawBoundText(gw+115,220,70,"Rand1") GraphicsWindow.DrawText(gw+115,240,Rand1) Rand1 = Rand1+1 GraphicsWindow.DrawBoundText(gw+115,320,70,"i") GraphicsWindow.DrawText(gw+115,340,i) Program.Delay(delay1) If i < 10 Then 'Clear contents of i and Rand1 until i=10 GraphicsWindow.BrushColor = "LightBlue" GraphicsWindow.FillRectangle(gw+115,240,70,20) GraphicsWindow.FillRectangle(gw+115,340,70,20) EndIf EndFor EndSub Sub OnMouseDown 'THIS AN EVENT HANDLER. USSUALLY JUST SET A FLAG e.g. mouseDown = "true" 'the flag will be read by the Main Loop xm = GraphicsWindow.MouseX ym = GraphicsWindow.MouseY 'Respin button If (xm > gw+15 And xm < gw+85) Then If (ym > 580 And ym < 595) Then mouseDown = "True" 'Spinrolls() 'Calling this in the Main loop aka UI thread 'Add marker 'start' ' GraphicsWindow.BrushColor = "Blue" ' GraphicsWindow.DrawBoundText(gw+115,50,70,"Start1") 'Rand1 = 0 'i = 0 'delay1=500 ' delay timer 'Stop1 = 0 'Spinrolls() EndIf EndIf 'Stop button If (xm > gw+115 And xm < gw+185) Then If (ym > 580 And ym < 595) Then iend = "True" EndIf If (iend) Then Program.End() EndIf EndIf EndSub End>LZL364.sb< Start>LZL400.sb< 'My Maze Maker 'By Tucker S 'Oak View Middle School 'Version I forgot To keep track :) 'READ ALL OF THE GREEN STUFF HERE! 'This is designed To be random, not hard. '(O,O) is top left corner. 'Move with WASD or with the arrow keys. ' ss is start, ee is end. If you don't see this, you will after playing with the settings. ' Plus signs and exclamation points/tildes indicate walls and borders. 'All paths and walls are two characters wide. 'This is very complicated, If you want To look at the code Then it may be hard To understand. 'Questions, comments, or concerns? Contact me at thshea@gm.sbac.edu <---BUT If you share this program with a friend out side of the school district, DELETE THIS LINE! If their email doesn't end with @gm.sbac.edu , they are not in the school district! 'Feel free To share this program with people you know, but do not give out my email without first reading the above line. 'SETTINGS 'Use MazeX and MazeY To change maze size 'With large mazes, you will have To go fullscreen For the graphicswindow To work correctly. 'Add one To the value For maze size with borders and subtract one For maze size without borders. This is because this is counted in computer numbers, starting at 0 instead of 1. MazeX = 6 'The legnth of the maze in blocks from 0. It MUST be an even number greater than 0. MazeY = 6 'The legnth of the maze in blocks from 0. It MUST be an even number greater than 0. gridlines = "false" 'Controls whether a grid is made or If the maze is made without a grid behind it. Possible values are "true" and "false". Textoutput = "true" 'Controls whether the maze gives a textwindow output. Possible values are "true" or "false". Speed = 10 'Controls the speed at which the maze is generated. Possible values are between 1 and 10, inclusive. topleftX = 25 'Controls where the top left corner is on the X axis. 10 is recommended. topleftY = 25 'Controls where the top left corner is on the Y axis. 10 is recommended. CellsizeX = 10 'Controls how large the grid cells are on the X axis. Anything 25 or less is recommended. Actual results will vary with maze size. CellsizeY = 10 'Controls how large the grid cells are on the Y axis. Anything 25 or less is recommended. Actual results will vary with maze size. mazegendelay = 1500 'Controls how long it takes To print the maze. Multiplying the maze size in blocks squared by this will equal the amount of time it will take To generate the maze with gridlines and Textoutput equal To false. Change this If you can't get the graphicswindow To fullscreen fast enough. solvespeed = 100 'Controls how much of a delay, in ms, For the solve character To move. playerXsize = 8 'Controls the size of the player object on the X axis, in pixels. playerYsize = 8 'Controls the size of the player object on the Y axis, in pixels. movelatency = 20 'Controls the latency given after a move in ms. A larger number will provide less movement glitches, but will increase the delay until you can next move. 'Do not mess with anything after this line without either knowing what you are doing or have the undo button at the ready! currentXpos = 0 currentYpos = 0 solved = "nope" repeat = "n" Baseoffset = 30 B64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" For Basecoversions = 0 To 63 BintoBase[Basecoversions] = Text.GetSubText(B64, Basecoversions, 1) EndFor beginning() 'Main Game loop While ("True") If (clicked) Then clicked = "False" Controls.Remove("rand") Controls.Remove("seed") GraphicsWindow.Clear() GraphicsWindow.Hide() If Controls.LastClickedButton = rand Then initgraphics() randgen() makegraphics() initsolve() dosolve() ElseIf Controls.LastClickedButton = seed Then initgraphics() 'seedgen() makegraphics() initsolve() dosolve() ElseIf Controls.LastClickedButton = rep Then beginning() ElseIf Controls.LastClickedButton = end Then End() EndIf EndIf Program.Delay(20) EndWhile Sub beginning GraphicsWindow.Width = 775 GraphicsWindow.Height = 500 GraphicsWindow.Title = "My Maze Maker by Tucker S" GraphicsWindow.BackgroundColor = GraphicsWindow.GetColorFromRGB(0, 204, 0) GraphicsWindow.PenColor = GraphicsWindow.GetColorFromRGB(0, 102, 204) GraphicsWindow.FontSize = 48 GraphicsWindow.DrawBoundText(200, 100, 400, "My Maze Maker") GraphicsWindow.FontSize = 24 GraphicsWindow.PenColor = GraphicsWindow.GetColorFromRGB(0, 153, 255) GraphicsWindow.DrawBoundText(300, 150, 250, "by Tucker S") GraphicsWindow.FontSize = 15 GraphicsWindow.BrushColor = GraphicsWindow.GetColorFromRGB(255, 102, 0) rand = Controls.AddButton("Random Generation", 200, 250) seed = Controls.AddButton("From-Seed Generation", 375, 250) Controls.ButtonClicked = Click EndSub Sub Click clicked = "True" EndSub Sub end GraphicsWindow.Width = 775 GraphicsWindow.Height = 500 GraphicsWindow.Title = "My Maze Maker by Tucker S" GraphicsWindow.BackgroundColor = GraphicsWindow.GetColorFromRGB(0, 204, 0) GraphicsWindow.PenColor = GraphicsWindow.GetColorFromRGB(0, 102, 204) GraphicsWindow.FontSize = 48 GraphicsWindow.DrawBoundText(200, 100, 400, "My Maze Maker") GraphicsWindow.FontSize = 24 GraphicsWindow.PenColor = GraphicsWindow.GetColorFromRGB(0, 153, 255) GraphicsWindow.DrawBoundText(275, 170, 350, "You beat the maze!") GraphicsWindow.FontSize = 20 GraphicsWindow.BrushColor = GraphicsWindow.GetColorFromRGB(51, 51, 204) GraphicsWindow.DrawBoundText(20, 210, 140, "Seed:") GraphicsWindow.FontSize = 20 GraphicsWindow.DrawBoundText(20, 235, 250, "seedbinval") GraphicsWindow.FontSize = 15 GraphicsWindow.BrushColor = GraphicsWindow.GetColorFromRGB(255, 102, 0) rep = Controls.AddButton("Play Again", 275, 280) end = Controls.AddButton("Close", 375, 280) EndSub Sub randgen If Textoutput = "true" Then TextWindow.WriteLine(currentXpos+","+currentYpos) EndIf For MakeMaze1Y = 0 To MazeY For MakeMaze1X = 0 To MazeX If MakeMaze1X = 0 or MakeMaze1X = MazeX or MakeMaze1Y = 0 or MakeMaze1Y = MazeY Then Mazeblock[MakeMaze1X][MakeMaze1Y] = "!~" Else Mazeblock[MakeMaze1X][MakeMaze1Y] = "++" EndIf EndFor EndFor MazestartX = ((Math.GetRandomNumber((MazeX/2))*2)-1) MazestartY = 0 Mazeblock[MazestartX][MazestartY] = "ss" Mazeblock[MazestartX][MazestartY+1] = " " currentXpos = MazestartX currentYpos = MazestartY+1 MazeendX = ((Math.GetRandomNumber((MazeX/2))*2)-1) MazeendY = MazeY Mazeblock[MazeendX][MazeendY] = "ee" If Textoutput = "true" Then TextWindow.WriteLine(currentXpos+","+currentYpos) EndIf currentstatus = "OK" dropBreadcrumb() dropBreadcrumb() lastdirectionmoved = "south" moveresult = "success" While currentstatus = "OK" trytomove() after: If Textoutput = "true" Then TextWindow.WriteLine(currentXpos+","+currentYpos) EndIf northerror = 0 easterror = 0 southerror = 0 westerror = 0 If Textoutput = "true" Then TextWindow.WriteLine("MOVED") EndIf If currentXpos = MazestartX And currentYpos = 1 Then currentstatus = "ERROR" If Textoutput = "true" Then TextWindow.WriteLine("SYSFINISHED") EndIf Else If moveresult = "fail" Then Backtrack() moveresult = "success" If Textoutput = "true" Then TextWindow.WriteLine("BACKTRACKED") TextWindow.WriteLine("Crumb POPPED") EndIf ElseIf moveresult = "success" Then dropBreadcrumb() EndIf EndIf EndWhile If Textoutput = "true" Then TextWindow.WriteLine("WRITING") TextWindow.WriteLine("") TextWindow.WriteLine("") For PrintY = 0 To MazeY For PrintX = 0 To MazeX TextWindow.Write(Mazeblock[PrintX][PrintY]) EndFor TextWindow.WriteLine("") EndFor EndIf EndSub 'Program.End() 'Now For the subprograms... Sub dropBreadcrumb Stack.PushValue("BreadcrumbX", currentXpos) Stack.PushValue("BreadcrumbY", currentYpos) If Textoutput = "true" Then TextWindow.WriteLine("Crumb PUSHED") EndIf EndSub Sub trytomove If northerror = "YES" And easterror = "YES" And southerror = "YES" And westerror = "YES" Then moveresult = "fail" northerror = 0 easterror = 0 southerror = 0 westerror = 0 If Textoutput = "true" Then TextWindow.WriteLine("FINAL FAIL") EndIf Goto after Else nextwaytomove = 0 nextwaytomove = (Math.GetRandomNumber(4)) If Textoutput = "true" Then TextWindow.WriteLine(nextwaytomove) TextWindow.WriteLine(nextwaytomove) EndIf If nextwaytomove = 1 Then If Textoutput = "true" Then TextWindow.WriteLine("11") EndIf If currentYpos-2 = -1 Or Mazeblock[currentXpos][currentYpos-2] = " " Or Mazeblock[currentXpos][currentYpos-1] = "!~" Or Mazeblock[currentXpos][currentYpos-1] = "ss" Then northerror = "YES" If Textoutput = "true" Then TextWindow.WriteLine("NORTH FAIL") EndIf trytomove() Else appendY = currentYpos-1 If Textoutput = "true" Then TextWindow.WriteLine(currentYpos) TextWindow.WriteLine(appendY) EndIf Mazeblock[currentXpos][appendY] = " " appendY = appendY-1 Mazeblock[currentXpos][appendY] = " " If Textoutput = "true" Then TextWindow.WriteLine("NORTH") EndIf currentYpos = currentYpos-2 EndIf ElseIf nextwaytomove = 2 Then If Textoutput = "true" Then TextWindow.WriteLine("22") EndIf If currentXpos+2 = MazeX+1 Or Mazeblock[currentXpos+2][currentYpos] = " " Or Mazeblock[currentXpos+1][currentYpos] = "!~" Then easterror = "YES" If Textoutput = "true" Then TextWindow.WriteLine("EAST FAIL") EndIf trytomove() Else appendX = currentXpos+1 Mazeblock[appendX][currentYpos] = " " appendX = appendX+1 Mazeblock[appendX][currentYpos] = " " If Textoutput = "true" Then TextWindow.WriteLine("EAST") EndIf currentXpos = currentXpos+2 EndIf ElseIf nextwaytomove = 3 Then If Textoutput = "true" Then TextWindow.WriteLine("33") EndIf If currentYpos+2 = MazeY+1 Or Mazeblock[currentXpos][currentYpos+2] = " " Or Mazeblock[currentXpos][currentYpos+1] = "!~" Or Mazeblock[currentXpos][currentYpos+1] = "ee" Then southerror = "YES" If Textoutput = "true" Then TextWindow.WriteLine("SOUTH FAIL") EndIf trytomove() Else appendY = currentYpos+1 Mazeblock[currentXpos][appendY] = " " appendY = appendY+1 Mazeblock[currentXpos][appendY] = " " currentYpos = currentYpos+2 If Textoutput = "true" Then TextWindow.WriteLine("SOUTH") EndIf EndIf ElseIf nextwaytomove = 4 Then If Textoutput = "true" Then TextWindow.WriteLine("44") EndIf If currentXpos-2 = -1 Or Mazeblock[currentXpos-2][currentYpos] = " " Or Mazeblock[currentXpos-1][currentYpos] = "!~" Then westerror = "YES" If Textoutput = "true" Then TextWindow.WriteLine("WEST FAIL") EndIf trytomove() Else appendX = currentXpos-1 Mazeblock[appendX][currentYpos] = " " appendX = appendX-1 Mazeblock[appendX][currentYpos] = " " If Textoutput = "true" Then TextWindow.WriteLine("WEST") EndIf currentXpos = currentXpos-2 EndIf EndIf EndIf EndSub Sub Backtrack lastbreadcrumbX = Stack.PopValue("BreadcrumbX") lastbreadcrumbY = Stack.PopValue("BreadcrumbY") currentXpos = lastbreadcrumbX currentYpos = lastbreadcrumbY EndSub 'Initgraphics Sub initgraphics GraphicsWindow.Show() GraphicsWindow.BackgroundColor = "white" GraphicsWindow.Width = ((MazeX + 1) * CellsizeX) + (topleftX * 2.5) GraphicsWindow.Height = ((MazeY + 1) * CellsizeY) + (topleftY * 2.5) + Baseoffset Turtle.Speed = Speed Turtle.X = topleftX StartposX = Turtle.X Turtle.Y = topleftY StartposY = Turtle.Y SizeX = MazeX GraphsizeX = SizeX + 1 SizeY = MazeY GraphsizeY = SizeY + 1 EndSub Sub makegraphics If gridlines = "true" Then For Graphdown = 0 To GraphsizeX Turtle.X = StartposX + Graphdown * CellsizeX Turtle.Y = StartposY Turtle.MoveTo(StartposX + Graphdown * CellsizeX, StartposY + GraphsizeY * CellsizeY) Program.Delay(100) EndFor For Graphright = 0 To GraphsizeY Turtle.X = StartposX Turtle.Y = StartposY + Graphright * CellsizeY Turtle.MoveTo(StartposX + GraphsizeX * CellsizeX, StartposY + Graphright * CellsizeY) Program.Delay(100) EndFor EndIf Turtle.Hide() For PointonY = 0 To SizeY TextWindow.WriteLine("Y>" + PointonY) For PointonX = 0 To SizeX TextWindow.WriteLine("X>" + PointonX) If Mazeblock[PointonX][PointonY] = "++" Then GraphicsWindow.BrushColor = "dark gray" GraphicsWindow.FillRectangle((PointonX) * CellsizeX + StartposX, (PointonY) * CellsizeY + StartposY, CellsizeX, CellsizeY) TextWindow.WriteLine(Mazeblock[PointonX][PointonY]) ElseIf Mazeblock[PointonX][PointonY] = "!~" Then GraphicsWindow.BrushColor = "black" GraphicsWindow.FillRectangle((PointonX) * CellsizeX + StartposX, (PointonY) * CellsizeY + StartposY, CellsizeX, CellsizeY) TextWindow.WriteLine(Mazeblock[PointonX][PointonY]) ElseIf Mazeblock[PointonX][PointonY] = "ss" Then GraphicsWindow.BrushColor = "green" GraphicsWindow.FillRectangle((PointonX) * CellsizeX + StartposX, (PointonY) * CellsizeY + StartposY, CellsizeX, CellsizeY) TextWindow.WriteLine(Mazeblock[PointonX][PointonY]) ElseIf Mazeblock[PointonX][PointonY] = "ee" Then GraphicsWindow.BrushColor = "red" GraphicsWindow.FillRectangle((PointonX) * CellsizeX + StartposX, (PointonY) * CellsizeY + StartposY, CellsizeX, CellsizeY) TextWindow.WriteLine(Mazeblock[PointonX][PointonY]) EndIf 'Program.Delay(mazegendelay) EndFor EndFor EndSub Sub initsolve playerXoffset = (CellsizeX - playerXsize) / 2 playerYoffset = (CellsizeY - playerYsize) / 2 playerX = ((MazestartX*CellsizeX)+topleftX) playerY = ((MazestartY*CellsizeY)+topleftY) playerblockX = MazestartX playerblockY = MazestartY mycircle = Shapes.AddEllipse(playerXsize, playerYsize) Shapes.Move(mycircle, playerX + playerXoffset, playerY + playerYoffset) EndSub Sub dosolve While solved = "nope" GraphicsWindow.KeyDown = keypressed GraphicsWindow.KeyUp = keyreleased If playerblockX = MazeendX And playerblockY = MazeendY Then solved = "very much so" EndIf If ifkeydown = "y" And repeat = "n" And solved = "nope" Then repeat = "y" If GraphicsWindow.LastKey = "Up" Or GraphicsWindow.LastKey = "W" Then dir = 0 ElseIf GraphicsWindow.LastKey = "Right" Or GraphicsWindow.LastKey = "D" Then dir = 1 ElseIf GraphicsWindow.LastKey = "Down" Or GraphicsWindow.LastKey = "S" Then dir = 2 ElseIf GraphicsWindow.LastKey = "Left" Or GraphicsWindow.LastKey = "A" Then dir = 3 EndIf playermove() Shapes.Animate(mycircle, playerX + playerXoffset, playerY + playerYoffset, solvespeed) Program.Delay(movelatency) EndIf EndWhile EndSub Sub keypressed ifkeydown = "y" If Textoutput = "true" Then TextWindow.WriteLine("keypressed") EndIf EndSub Sub keyreleased ifkeydown = "n" repeat = "n" EndSub Sub Playermove If dir = 0 Then If Mazeblock[playerblockX][playerblockY - 1] = " " Then playerblockY = playerblockY - 2 playerY = playerY - CellsizeY * 2 ElseIf Mazeblock[playerblockX][playerblockY - 1] = "ss" Then playerblockY = playerblockY - 1 playerY = playerY - CellsizeY EndIf ElseIf dir = 1 Then If Mazeblock[playerblockX + 1][playerblockY] = " " Then playerblockX = playerblockX + 2 playerX = playerX + CellsizeX * 2 EndIf ElseIf dir = 2 Then If Mazeblock[playerblockX][playerblockY] = "ss" or Mazeblock[playerblockX][playerblockY + 1] = "ee" Then playerblockY = playerblockY + 1 playerY = playerY + CellsizeY ElseIf Mazeblock[playerblockX][playerblockY + 1] = " " Then playerblockY = playerblockY + 2 playerY = playerY + CellsizeY * 2 EndIf ElseIf dir = 3 Then If Mazeblock[playerblockX - 1][playerblockY] = " " Then playerblockX = playerblockX - 2 playerX = playerX - CellsizeX * 2 EndIf EndIf EndSub End>LZL400.sb< Start>LZL461.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.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" '------------------------------------------------------------ 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 = "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) 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) '********************************************************** cslike = Shapes.GetTop(image) GraphicsWindow.Title =cslike '************************************************************ 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) '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ '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) '[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ '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 '+++++++++++++++++++++++++++++++++++++++++++ '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 '++++++++++++++++++++++++ ++++++++++++++++ '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 '+++++++++++++++++++++++++++++++++++++++++++++++++++++ ' 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 '+++++++++++++++++++++++++++++++++++++++++++++ '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) '++++++++++++++++++++++++++++++++++++++++ '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 '+++++++++++++++++++++++++++++++++++++++++ '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 '++++++++++++++++++++++++++++++++++++++++++++++++++ '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 '+++++++++++++++++++++++++++++++++++++++++++++++ '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 '+++++++++++++++++++++++++++++++++++++++++ '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 '+++++++++++++++++++++++++++++++++++++++++ 'SIJALICA ElseIf Controls.LastClickedButton = button8 Then imagepath = "C:\SB\SI2.jpg" image=Shapes.AddImage(imagepath) Shapes.Move(image, 120, 120) MPX=0 MPY=-8 '+++++++++++++++++++++++++++++++++++++++++ '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 '++++++++++++++++++++++++++++++++++++++++++++++++ '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 '++++++++++++++++++++++++++++++++++++++++++++++++++ '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 '+++++++++++++++++++++++++++++++++++++++++++++ '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 '+++++++++++++++++++++++++++++++++++++++++++ '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 '++++++++++++++++++++++++++++++++++++++++++++++++ '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 '++++++++++++++++++++++++++++++++++++ '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 '++++++++++++++++++++++++++++++++++++ '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 '+++++++++++++++++++++++++++++++++++ '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 '++++++++++++++++++++++++++++++++++++++ ' 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 '++++++++++++++++++++++++++++++++++++++++++ '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 '================================================================= '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) '-------------------------------------------------------------------------------------------- '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" '--------------------------------------------------------------------- '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" '------------------------------------------------------------------------------------- '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 '++++++++++++++++++++++++++++++++++++++++++++ ' BRISE SLIKE ElseIf Controls.LastClickedButton = button4 Then Shapes.Remove(image) y=Qy OB[1]="EL IZBRISAN" '+++++++++++++++++++++++++++++++++++++++++++ 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) 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 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 End>LZL461.sb< Start>LZM428.sb< GraphicsWindow.BackgroundColor="teal rb=ldControls.AddRichTextBox (700 700) LDControls.RichTextBoxFontFamily ="Lucida console LDControls.RichTextBoxFontBackground="lightgray LDControls.RichTextBoxFontSize=14 LDControls.RichTextBoxDefault (rb) Controls.Move (rb 15 15) GraphicsWindow.Width=1200 GraphicsWindow.Height=800 GraphicsWindow.Title ="NewBasic v0.1 GraphicsWindow.FontBold="true GraphicsWindow.FontName ="Liberation sans GraphicsWindow.FontSize=14 GraphicsWindow.BrushColor="White txx="#bg /hu/ /sa/ /lg/ | bckgrnd clr 0-360 0-100 0-100~#fg\pc /hu /sa /lg | forgrnd/pen clr 0-360 0-100 0-100~ txx=txx+"#gw /lt/ /tp/ /wd/ /ht/ | grwnd size/pos~ txx=txx+"#rp /ttf/ /ttr/ | replaces text with ~ txx=txx+"#ff /vv/ /st/ /en/ /stp/...`ff | for vv=st to en step stp ... Endfor~ txx=txx+"#if /cnd/ #tt #ef #ee `ii~ txx=txx+"#wh /cnd/ ... `ww | while ... endwh.~ txx=txx+"#sb ... `ss | Sub ... Endsub~ txx=txx+"#rr /n/ ...`rr [rpt] | repeats ... n times [indic. by rpt]~ txx=txx+"~spec.consts:~`y` = true / `n` = false ~`g` = graph.window~`t` = textwindow~`s` = shapes~`a` = array~`c` = controls~`f` = file~`p` = prog.~`x` = text~\\ = LD xtension~ txx=txx+"!n> /fnm/ /p1/ /p2/ ... /pn/ | call func w args 1..n nln=text.GetCharacter (13)+Text.GetCharacter(10) txx=LDText.Replace (txx "~" nln) GraphicsWindow.DrawBoundText (850 10 330 txx) GraphicsWindow.BrushColor="black bt1=Controls.AddButton ("Convert to SB" 10 750) bt2=Controls.AddButton ("EXEC" 140 750) Controls.ButtonClicked=cbc err[1]="Number or args different than required."+nln+"Missing args will be null, other ignored." ss=", " args=0 Sub getpp pp=ldtext.Split (cl " ") pc=array.GetItemCount (pp) endsub Sub repcc nn=text.GetCharacter (34) txt="not="+nn+"true=false;false=true"+nln+txt txt=ldtext.Replace (txt "\\" "LD") txt=ldtext.Replace (txt "`y`" nn+"true"+nn) txt=ldtext.Replace (txt "`n`" nn+"false"+nn) txt=ldtext.Replace (txt "`g`" "GraphicsWindow.") txt=ldtext.Replace (txt "`t`" "TextWindow.") txt=ldtext.Replace (txt "`s`" "Shapes.") txt=ldtext.Replace (txt "`c`" "Controls.") ' The following line could be harmful and has been automatically commented. ' txt=ldtext.Replace (txt "`f`" "File.") txt=ldtext.Replace (txt "`a`" "Array.") txt=ldtext.Replace (txt "`p`" "Program.") txt=ldtext.Replace (txt "`x`" "Text.") txt=ldtext.Replace (txt "``ln" "Text.GetLength(") txt=ldtext.Replace (txt "``tc" "Text.GetCharacter(") txt=ldtext.Replace (txt "``ac" "Array.GetItemCount(") txt=ldtext.Replace (txt "`\" "Math.Remainder (") EndSub Sub cbc If Controls.LastClickedButton=bt1 then pl=2 bc=0 dac ="false l1=ldlist.CreateFromValues (LDText.Split ("#bg #fg #pc" " ")) lc1=LDText.Split (ldtext.Replace ("g#BackgroundColor g#ForegroundColor g#PenColor" "g#" "GraphicsWindow.") " ") ar=LDText.Split ("'prog.list '*******Endprg." " ") prg=LDList.CreateFromValues (ar) frl= ldlist.CreateFromValues("1=1") txt= LDControls.RichTextBoxGetText (rb) repcc() tt=ldtext.Split (txt nln) For xx=1 To Array.GetItemCount (tt) cl=text.ConvertToLowerCase (ldtext.Trim (tt[xx])) oc=tt[xx] if Text.StartsWith (cl "#bg") Or Text.StartsWith (cl "#fg") Or Text.StartsWith (cl "#pc") Then getpp() If pc<>4 Then GraphicsWindow.ShowMessage (err[1]+nln+cl "Warning line:"+xx) endif ii=LDList.IndexOf(l1 pp[1]) oc=lc1[ii]+"= LDColours.HSLtoRGB ("+pp[2]+ss+pp[3]/100+ss+pp[4]/100+")" elseif Text.StartsWith (cl "#gw") Then getpp() LDCall.Function ("ladd" "GraphicsWindow.Left="+pp[2]) LDCall.Function ("ladd" "GraphicsWindow.Top="+pp[3]) LDCall.Function ("ladd" "GraphicsWindow.Width="+pp[4]) LDCall.Function ("ladd" "GraphicsWindow.Height="+pp[5]) Goto nxt elseif Text.StartsWith (cl "#wh") or text.StartsWith (cl "#rr") Then obc=bc bc=bc+1 getpp() If text.StartsWith (cl "#rr") Then oc="rpt["+bc+"]= "+pp[2]+nln cbc=obc gsp() oc=oc+isp+"WHILE rpt["+bc+"]>0 else oc="WHILE "+pp[2] endif dac="true elseif Text.StartsWith (cl "`ww") Then bc=bc-1 oc="EndWHILE"+nln elseif Text.StartsWith (cl "`ff") Then bc=bc-1 oc="EndFOR"+nln elseif Text.StartsWith (cl "`rr") Then oc="rpt["+bc+"]= "+"rpt["+bc+"]-1" LDList.InsertAt (prg pl isp+oc) pl=pl+1 bc=bc-1 oc="EndWHILE"+nln elseif Text.StartsWith (cl "#ff") Then obc=bc getpp() bc=bc+1 dac="true ddt="" qq=pp[2] If Text.StartsWith (qq ".") or Text.StartsWith (qq "0") or Text.StartsWith (qq "9") or Text.StartsWith (qq "8") or Text.StartsWith (qq "7") or Text.StartsWith (qq "6") or Text.StartsWith (qq "5") or Text.StartsWith (qq "4") or Text.StartsWith (qq "3") or Text.StartsWith (qq "2") or Text.StartsWith (qq "1") then ppv="_x"+"_"+bc oc="FOR "+ppv+" = "+pp[2]+" to "+pp[3] If pp[4]="" or pp[4]=1 then else oc=oc+" STEP "+pp[4] endif oc=oc+"'<~~~~auto added FOR var else If LDList.Contains (frl pp[2]) then pp[2]=pp[2]+"_"+bc ddt="'<----warning! FOR var duplicated, thus changed to new one EndIf LDList.Add (frl pp[2]) oc="FOR "+pp[2]+" = "+pp[3]+" to "+pp[4] If pp[5]="" or pp[5]=1 then else oc=oc+" STEP "+pp[5] endif oc=oc+ddt endif elseif Text.StartsWith (cl "#rp") Then getpp() txt=LDText.Replace (txt pp[2] pp[3]) tt=ldtext.Split (txt nln) 'GraphicsWindow.ShowMessage (txt "result") Goto nxt endif if dac Then dac="false cbc=obc Else cbc=bc endif gsp() LDList.InsertAt (prg pl isp+oc) pl=pl+1 nxt: EndFor If bc<>0 Then GraphicsWindow.ShowMessage ("Uneven block count. Prog can't start!" "Fatal err") endif TextWindow.Write ("Output:") ary=ldarray.CreateFromValues (LDList.ToArray(prg)) for x=1 to LDArray.Count(ary) TextWindow.WriteLine (LDArray.GetValue (ary x)) txo=txo+LDArray.GetValue (ary x)+nln endfor LDClipboard.SetText (txo) endif EndSub Sub gsp isp="" If cbc>0 Then isp=text.GetSubText (" " 1 cbc*3) endif EndSub Sub ladd LDList.InsertAt (prg pl args[1]) pl=pl+1 EndSub End>LZM428.sb< Start>LZM447-0.sb< GraphicsWindow.BrushColor = "Red" GraphicsWindow.Width = 600 GraphicsWindow.Height = 600 UpperArm = Shapes.AddRectangle(20,20) Center_X = 300 Center_Y = 300 'GraphicsWindow.BrushColor = "Blue" 'ForeArm = Shapes.AddRectangle(20,20) 'GraphicsWindow.BrushColor = "Blue" 'Hand = Shapes.AddRectangle(50,20) 'GraphicsWindow.BrushColor = "LightGreen" 'GraphicsWindow.PenWidth = 0 'Axis1 = Shapes.AddEllipse(10,10) 'Shapes.Move(Axis1,UpperArm_X-5,UpperArm_Y-5) Pi = Math.Pi While "True" Mouse_X = GraphicsWindow.MouseX Mouse_Y = GraphicsWindow.MouseY UpperArm_Angle = UpperArm_Angle + 5 UpperArm_Angle2 = Pi * UpperArm_Angle / 180.0 UpperArm_X = Center_X+20*Math.Cos(UpperArm_Angle2) UpperArm_Y = Center_Y+20*Math.Sin(UpperArm_Angle2) Shapes.Move(UpperArm,UpperArm_X,UpperArm_Y) GraphicsWindow.SetPixel(UpperArm_X,UpperArm_Y,"Blue") 'ForeArm_Angle = Pi*(UpperArm_Angle*2/180-0.5) 'ForeArm_X = UpperArm_X+50*Math.Cos(ForeArm_Angle) 'ForeArm_Y = UpperArm_Y+50*Math.Sin(ForeArm_Angle) 'Shapes.Move(ForeArm,ForeArm_X,ForeArm_Y) 'Hand_X = Mouse_X - 10 ' Hand_Y = Mouse_Y - 10 ' Shapes.Move(Hand,Hand_X,Hand_Y) Program.Delay(25) endwhile End>LZM447-0.sb< Start>LZM447.sb< GraphicsWindow.BrushColor = "Red" UpperArm = Shapes.AddRectangle(20,20) UpperArm_X = 300 UpperArm_Y = 300 'GraphicsWindow.BrushColor = "Blue" 'ForeArm = Shapes.AddRectangle(20,20) 'GraphicsWindow.BrushColor = "Blue" 'Hand = Shapes.AddRectangle(50,20) 'GraphicsWindow.BrushColor = "LightGreen" 'GraphicsWindow.PenWidth = 0 'Axis1 = Shapes.AddEllipse(10,10) 'Shapes.Move(Axis1,UpperArm_X-5,UpperArm_Y-5) Pi = Math.Pi While "True" Mouse_X = GraphicsWindow.MouseX Mouse_Y = GraphicsWindow.MouseY UpperArm_Angle = UpperArm_Angle + 5 UpperArm_Angle2 = Pi*(UpperArm_Angle/180-0.5) UpperArm_X = UpperArm_X+20*Math.Cos(UpperArm_Angle2) UpperArm_Y = UpperArm_Y+20*Math.Sin(UpperArm_Angle2) Shapes.Move(UpperArm,UpperArm_X,UpperArm_Y) GraphicsWindow.SetPixel(UpperArm_X,UpperArm_Y,"Blue") 'ForeArm_Angle = Pi*(UpperArm_Angle*2/180-0.5) 'ForeArm_X = UpperArm_X+50*Math.Cos(ForeArm_Angle) 'ForeArm_Y = UpperArm_Y+50*Math.Sin(ForeArm_Angle) 'Shapes.Move(ForeArm,ForeArm_X,ForeArm_Y) 'Hand_X = Mouse_X - 10 ' Hand_Y = Mouse_Y - 10 ' Shapes.Move(Hand,Hand_X,Hand_Y) Program.Delay(25) endwhile End>LZM447.sb< Start>LZN025-0.sb< ' TRON 0.2 - light cycle game ' ' History: ' 0.2 11/06/2013 Human vs humen version. (LZN025-0) ' 0.1a 03/06/2013 Created as alpha version. (LZN025) ' title = "TRON 0.2" GraphicsWindow.Title = title GraphicsWindow.BackgroundColor = "Black" Init() DrawTRON() ClearTRON() DrawGrid() DrawCycles() GraphicsWindow.KeyDown = OnKeyDown Timer.Interval = 1000 / 24 Timer.Tick = OnTick Sub Player1_Move If dy = "Up" Then ry = ry - 1 ElseIf dy = "Down" Then ry = ry + 1 ElseIf dy = "Left" Then cy = cy - 1 ElseIf dy = "Right" Then cy = cy + 1 EndIf EndSub Sub Player2_Move If dc = "Up" Then rc = rc - 1 ElseIf dc = "Down" Then rc = rc + 1 ElseIf dc = "Left" Then cc = cc - 1 ElseIf dc = "Right" Then cc = cc + 1 EndIf EndSub Sub OnKeyDown key = GraphicsWindow.LastKey If key = "Up" Or key = "Down" Or key = "Left" Or key = "Right" Then dc = key ElseIf key = "S" Then dy = "Up" ElseIf key = "D" Then dy = "Down" ElseIf key = "A" Then dy = "Left" ElseIf key = "F" Then dy = "Right" EndIf EndSub Sub OnTick Player1_Move() Player2_Move() DrawCycles() EndSub Sub ClearTRON For op = 0 To 100 Shapes.SetOpacity(mask, op) Program.Delay(10) EndFor GraphicsWindow.Clear() Shapes.Remove(mask) EndSub Sub DrawArc GraphicsWindow.PenColor = param["pc"] GraphicsWindow.PenWidth = param["pw"] If param["a1"] < param["a2"] Then da = 0.3 Else da = -0.3 EndIf a1 = "" For a = param["a1"] To param["a2"] Step da a2 = Math.GetRadians(a) x2 = param["x"] + param["r"] * Math.Cos(a2) y2 = param["y"] + param["r"] * Math.Sin(a2) If a1 <> "" Then GraphicsWindow.DrawLine(x1, y1, x2, y2) EndIf a1 = a2 x1 = x2 y1 = y2 EndFor EndSub Sub DrawCircle GraphicsWindow.PenColor = param["pc"] GraphicsWindow.PenWidth = param["pw"] GraphicsWindow.DrawEllipse(param["x"] - param["r"], param["y"] - param["r"], param["r"] * 2, param["r"] * 2) EndSub Sub DrawCycles If (map[cc][rc] = "") Or ((lastcc = cc) And (lastrc = rc)) Then map[cc][rc] = 1 GraphicsWindow.BrushColor = "Cyan" GraphicsWindow.FillRectangle(cc * size, rc * size, size, size) lastcc = cc lastrc = rc ElseIf map[cc][rc] = 1 Then GraphicsWindow.BrushColor = "DarkCyan" GraphicsWindow.FillRectangle(lastcc * size, lastrc * size, size, size) scorey = scorey + 1 GraphicsWindow.Title = title + " - score " + scorey + ":" + scorec dc = "" Timer.Interval = 3000 If 10 <= scorey Then Timer.Tick = GameEnd Else Timer.Tick = Restart EndIf EndIf If (map[cy][ry] = "") Or ((lastcy = cy) And (lastry = ry)) Then map[cy][ry] = 1 GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.FillRectangle(cy * size, ry * size, size, size) lastcy = cy lastry = ry ElseIf map[cy][ry] = 1 Then GraphicsWindow.BrushColor = "Olive" GraphicsWindow.FillRectangle(lastcy * size, lastry * size, size, size) scorec = scorec + 1 GraphicsWindow.Title = title + " - score " + scorey + ":" + scorec dy = "" Timer.Interval = 3000 If 10 <= scorec Then Timer.Tick = GameEnd Else Timer.Tick = Restart EndIf EndIf EndSub Sub GameEnd GraphicsWindow.Clear() If scorey = 10 And scorec = 10 Then resulty = "DRAW" resultc = "DRAW" ElseIf scorey = 10 Then resulty = "WIN" resultc = "LOSE" ElseIf scorec = 10 Then resulty = "LOSE" resultc = "WIN" EndIf param = "x=150;y=100;text=PLAYER 1 "+resulty+" : SCORE "+scorey+";bc=Yellow;fn=Arial;fs=18;" DrawText() param = "x=150;y=150;text=PLAYER 2 "+resultc+" : SCORE "+scorec+";bc=Cyan;fn=Arial;fs=18;" DrawText() scorec = 0 scorey = 0 GraphicsWindow.Title = title + " - score " + scorey + ":" + scorec Timer.Interval = 5000 Timer.Tick = Restart EndSub Sub DrawGrid GraphicsWindow.PenWidth = 2 GraphicsWindow.PenColor = "DimGray" For x = 0 To gw Step size * gap GraphicsWindow.DrawLine(x, 0, x, gh) EndFor For y = 0 To gh Step size * gap GraphicsWindow.DrawLine(0, y, gw, y) EndFor EndSub Sub DrawLine GraphicsWindow.PenColor = param["pc"] GraphicsWindow.PenWidth = param["pw"] GraphicsWindow.DrawLine(param["x1"], param["y1"], param["x2"], param["y2"]) EndSub Sub DrawRect GraphicsWindow.PenColor = param["pc"] GraphicsWindow.PenWidth = param["pw"] GraphicsWindow.DrawRectangle(param["x"], param["y"], param["width"], param["height"]) EndSub Sub DrawText GraphicsWindow.BrushColor = param["bc"] GraphicsWindow.FontBold = param["fb"] GraphicsWindow.FontItalic = param["fi"] GraphicsWindow.FontName = param["fn"] GraphicsWindow.FontSize = param["fs"] GraphicsWindow.DrawText(param["x"], param["y"], param["text"]) EndSub Sub DrawTRON GraphicsWindow.BrushColor = "Black" mask = Shapes.AddRectangle(gw, gh) param = "x1=124;y1=120;x2=476;y2=120;pc=#009900;pw=2;" DrawLine() ' horizontal line param = "x1=340;y1=64;x2=340;y2=176;pc=#009900;pw=2;" DrawLine() ' vertical line param = "x=124;y=64;width=352;height=112;pc=#990033;pw=4;" DrawRect() ' frame param = "x1=140;y1=82;x2=222;y2=82;pc=#990033;pw=4;" DrawLine() ' T param = "x1=142;y1=83;x2=142;y2=100;pc=#990033;pw=4;" DrawLine() ' T param = "x1=220;y1=83;x2=220;y2=100;pc=#990033;pw=4;" DrawLine() ' T param = "x1=140;y1=100;x2=162;y2=100;pc=#990033;pw=4;" DrawLine() ' T param = "x1=196;y1=100;x2=222;y2=100;pc=#990033;pw=4;" DrawLine() ' T param = "x1=160;y1=100;x2=160;y2=160;pc=#990033;pw=4;" DrawLine() ' T param = "x1=198;y1=100;x2=198;y2=160;pc=#990033;pw=4;" DrawLine() ' T param = "x1=160;y1=158;x2=198;y2=158;pc=#990033;pw=4;" DrawLine() ' T param = "x=220;y=120;width=18;height=38;pc=#990033;pw=4;" DrawRect() ' R param = "x1=232;y1=83;x2=232;y2=100;pc=#990033;pw=4;" DrawLine() ' R param = "x1=230;y1=82;x2=260;y2=82;pc=#990033;pw=4;" DrawLine() ' R param = "x1=230;y1=100;x2=260;y2=100;pc=#990033;pw=4;" DrawLine() ' R param = "x=260;y=120;r=20;a1=0;a2=-90;pc=#990033;pw=4;" DrawArc() ' R param = "x=260;y=120;r=38;a1=0;a2=-90;pc=#990033;pw=4;" DrawArc() ' R param = "x1=277;y1=120;x2=300;y2=120;pc=#990033;pw=4;" DrawLine() ' R param = "x1=240;y1=120;x2=278;y2=158;pc=#990033;pw=4;" DrawLine() ' R param = "x1=262;y1=120;x2=300;y2=158;pc=#990033;pw=4;" DrawLine() ' R param = "x1=240;y1=120;x2=263;y2=120;pc=#990033;pw=4;" DrawLine() ' R param = "x1=276;y1=158;x2=302;y2=158;pc=#990033;pw=4;" DrawLine() ' R param = "x=340;y=120;r=20;pc=#990033;pw=4;" DrawCircle() ' O param = "x=340;y=120;r=40;pc=#990033;pw=4;" DrawCircle() ' O param = "x1=380;y1=82;x2=460;y2=158;pc=#990033;pw=4;" DrawLine() ' N param = "x1=396;y1=118;x2=418;y2=118;pc=#990033;pw=4;" DrawLine() ' N param = "x1=380;y1=82;x2=380;y2=160;pc=#990033;pw=4;" DrawLine() ' N param = "x1=398;y1=120;x2=398;y2=160;pc=#990033;pw=4;" DrawLine() ' N param = "x1=378;y1=158;x2=400;y2=158;pc=#990033;pw=4;" DrawLine() ' N param = "x1=438;y1=82;x2=460;y2=82;pc=#990033;pw=4;" DrawLine() ' N param = "x1=440;y1=82;x2=440;y2=120;pc=#990033;pw=4;" DrawLine() ' N param = "x1=458;y1=82;x2=458;y2=158;pc=#990033;pw=4;" DrawLine() ' N param = "x1=420;y1=122;x2=442;y2=122;pc=#990033;pw=4;" DrawLine() ' N param = "x=150;y=250;text=PLAYER 1 : USE A S D F KEYS;bc=Yellow;fn=Arial;fs=18;" DrawText() param = "x=150;y=300;text=PLAYER 2 : USE ← ↑ ↓ → KEYS;bc=Cyan;fn=Arial;fs=18;" DrawText() For op = 100 To 0 Step -1 Shapes.SetOpacity(mask, op) Program.Delay(100) EndFor EndSub Sub Init gw = GraphicsWindow.Width gh = GraphicsWindow.Height size = 6 gap = 10 cols = Math.Floor(gw / size / gap) * gap gw = cols * size GraphicsWindow.Width = gw rows = Math.Floor(gh / size / gap) * gap gh = rows * size GraphicsWindow.Height = gh cy = gap * 2 - 1 scorey = 0 scorec = 0 lastcy = cy ry = Math.Floor(rows / 2) lastry = ry cc = cols - gap * 2 lastcc = cc rc = Math.Floor(rows / 2) lastrc = rc map = "" For c = 0 To cols - 1 map[c][-1] = 1 map[c][rows] = 1 EndFor For r = 0 To rows - 1 map[-1][r] = 1 map[cols][r] = 1 EndFor dy = "Right" dc = "Left" EndSub Sub Restart dy = "Right" dc = "Left" cy = gap * 2 - 1 lastcy = cy ry = Math.Floor(rows / 2) lastry = ry cc = cols - gap * 2 lastcc = cc rc = Math.Floor(rows / 2) lastrc = rc GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(0, 0, gw, gh) DrawGrid() DrawCycles() map = "" For c = 0 To cols - 1 map[c][-1] = 1 map[c][rows] = 1 EndFor For r = 0 To rows - 1 map[-1][r] = 1 map[cols][r] = 1 EndFor Timer.Interval = 1000 / 24 Timer.Tick = OnTick EndSub Sub Dummy OnTick = "" EndSub End>LZN025-0.sb< Start>LZN025.sb< ' TRON - light cycle game ' title = "TRON 0.1a" GraphicsWindow.Title = title GraphicsWindow.BackgroundColor = "Black" Init() DrawTRON() ClearTRON() DrawGrid() DrawCycles() GraphicsWindow.KeyDown = OnKeyDown Timer.Interval = 1000 / 24 Timer.Tick = OnTick Sub MoveAI dy = "Right" If dy = "Up" Then ry = ry - 1 ElseIf dy = "Down" Then ry = ry + 1 ElseIf dy = "Left" Then cy = cy - 1 ElseIf dy = "Right" Then cy = cy + 1 EndIf EndSub Sub MoveHuman If dc = "Up" Then rc = rc - 1 ElseIf dc = "Down" Then rc = rc + 1 ElseIf dc = "Left" Then cc = cc - 1 ElseIf dc = "Right" Then cc = cc + 1 EndIf EndSub Sub OnKeyDown dc = GraphicsWindow.LastKey EndSub Sub OnTick MoveAI() MoveHuman() DrawCycles() EndSub Sub ClearTRON For op = 0 To 100 Shapes.SetOpacity(mask, op) Program.Delay(10) EndFor GraphicsWindow.Clear() Shapes.Remove(mask) EndSub Sub DrawArc GraphicsWindow.PenColor = param["pc"] GraphicsWindow.PenWidth = param["pw"] If param["a1"] < param["a2"] Then da = 0.3 Else da = -0.3 EndIf a1 = "" For a = param["a1"] To param["a2"] Step da a2 = Math.GetRadians(a) x2 = param["x"] + param["r"] * Math.Cos(a2) y2 = param["y"] + param["r"] * Math.Sin(a2) If a1 <> "" Then GraphicsWindow.DrawLine(x1, y1, x2, y2) EndIf a1 = a2 x1 = x2 y1 = y2 EndFor EndSub Sub DrawCircle GraphicsWindow.PenColor = param["pc"] GraphicsWindow.PenWidth = param["pw"] GraphicsWindow.DrawEllipse(param["x"] - param["r"], param["y"] - param["r"], param["r"] * 2, param["r"] * 2) EndSub Sub DrawCycles If (map[cc][rc] = "") Or ((lastcc = cc) And (lastrc = rc)) Then map[cc][rc] = 1 GraphicsWindow.BrushColor = "Cyan" GraphicsWindow.FillRectangle(cc * size, rc * size, size, size) lastcc = cc lastrc = rc ElseIf map[cc][rc] = 1 Then GraphicsWindow.BrushColor = "DarkCyan" GraphicsWindow.FillRectangle(lastcc * size, lastrc * size, size, size) scorey = scorey + 1 GraphicsWindow.Title = title + " - score " + scorey + ":" + scorec dc = "" Timer.Interval = 3000 Timer.Tick = Restart EndIf If (map[cy][ry] = "") Or ((lastcy = cy) And (lastry = ry)) Then map[cy][ry] = 1 GraphicsWindow.BrushColor = "Yellow" GraphicsWindow.FillRectangle(cy * size, ry * size, size, size) lastcy = cy lastry = ry ElseIf map[cy][ry] = 1 Then GraphicsWindow.BrushColor = "Olive" GraphicsWindow.FillRectangle(lastcy * size, lastry * size, size, size) scorec = scorec + 1 GraphicsWindow.Title = title + " - score " + scorey + ":" + scorec dy = "" Timer.Interval = 3000 Timer.Tick = Restart EndIf EndSub Sub DrawGrid GraphicsWindow.PenWidth = 2 GraphicsWindow.PenColor = "DimGray" For x = 0 To gw Step size * gap GraphicsWindow.DrawLine(x, 0, x, gh) EndFor For y = 0 To gh Step size * gap GraphicsWindow.DrawLine(0, y, gw, y) EndFor EndSub Sub DrawLine GraphicsWindow.PenColor = param["pc"] GraphicsWindow.PenWidth = param["pw"] GraphicsWindow.DrawLine(param["x1"], param["y1"], param["x2"], param["y2"]) EndSub Sub DrawRect GraphicsWindow.PenColor = param["pc"] GraphicsWindow.PenWidth = param["pw"] GraphicsWindow.DrawRectangle(param["x"], param["y"], param["width"], param["height"]) EndSub Sub DrawTRON GraphicsWindow.BrushColor = "Black" mask = Shapes.AddRectangle(gw, gh) param = "x1=124;y1=120;x2=476;y2=120;pc=#009900;pw=2;" DrawLine() ' horizontal line param = "x1=340;y1=64;x2=340;y2=176;pc=#009900;pw=2;" DrawLine() ' vertical line param = "x=124;y=64;width=352;height=112;pc=#990033;pw=4;" DrawRect() ' frame param = "x1=140;y1=82;x2=222;y2=82;pc=#990033;pw=4;" DrawLine() ' T param = "x1=142;y1=83;x2=142;y2=100;pc=#990033;pw=4;" DrawLine() ' T param = "x1=220;y1=83;x2=220;y2=100;pc=#990033;pw=4;" DrawLine() ' T param = "x1=140;y1=100;x2=162;y2=100;pc=#990033;pw=4;" DrawLine() ' T param = "x1=196;y1=100;x2=222;y2=100;pc=#990033;pw=4;" DrawLine() ' T param = "x1=160;y1=100;x2=160;y2=160;pc=#990033;pw=4;" DrawLine() ' T param = "x1=198;y1=100;x2=198;y2=160;pc=#990033;pw=4;" DrawLine() ' T param = "x1=160;y1=158;x2=198;y2=158;pc=#990033;pw=4;" DrawLine() ' T param = "x=220;y=120;width=18;height=38;pc=#990033;pw=4;" DrawRect() ' R param = "x1=232;y1=83;x2=232;y2=100;pc=#990033;pw=4;" DrawLine() ' R param = "x1=230;y1=82;x2=260;y2=82;pc=#990033;pw=4;" DrawLine() ' R param = "x1=230;y1=100;x2=260;y2=100;pc=#990033;pw=4;" DrawLine() ' R param = "x=260;y=120;r=20;a1=0;a2=-90;pc=#990033;pw=4;" DrawArc() ' R param = "x=260;y=120;r=38;a1=0;a2=-90;pc=#990033;pw=4;" DrawArc() ' R param = "x1=277;y1=120;x2=300;y2=120;pc=#990033;pw=4;" DrawLine() ' R param = "x1=240;y1=120;x2=278;y2=158;pc=#990033;pw=4;" DrawLine() ' R param = "x1=262;y1=120;x2=300;y2=158;pc=#990033;pw=4;" DrawLine() ' R param = "x1=240;y1=120;x2=263;y2=120;pc=#990033;pw=4;" DrawLine() ' R param = "x1=276;y1=158;x2=302;y2=158;pc=#990033;pw=4;" DrawLine() ' R param = "x=340;y=120;r=20;pc=#990033;pw=4;" DrawCircle() ' O param = "x=340;y=120;r=40;pc=#990033;pw=4;" DrawCircle() ' O param = "x1=380;y1=82;x2=460;y2=158;pc=#990033;pw=4;" DrawLine() ' N param = "x1=396;y1=118;x2=418;y2=118;pc=#990033;pw=4;" DrawLine() ' N param = "x1=380;y1=82;x2=380;y2=160;pc=#990033;pw=4;" DrawLine() ' N param = "x1=398;y1=120;x2=398;y2=160;pc=#990033;pw=4;" DrawLine() ' N param = "x1=378;y1=158;x2=400;y2=158;pc=#990033;pw=4;" DrawLine() ' N param = "x1=438;y1=82;x2=460;y2=82;pc=#990033;pw=4;" DrawLine() ' N param = "x1=440;y1=82;x2=440;y2=120;pc=#990033;pw=4;" DrawLine() ' N param = "x1=458;y1=82;x2=458;y2=158;pc=#990033;pw=4;" DrawLine() ' N param = "x1=420;y1=122;x2=442;y2=122;pc=#990033;pw=4;" DrawLine() ' N For op = 100 To 0 Step -1 Shapes.SetOpacity(mask, op) Program.Delay(10) EndFor EndSub Sub Init gw = GraphicsWindow.Width gh = GraphicsWindow.Height size = 6 gap = 10 cols = Math.Floor(gw / size / gap) * gap gw = cols * size GraphicsWindow.Width = gw rows = Math.Floor(gh / size / gap) * gap gh = rows * size GraphicsWindow.Height = gh cy = gap * 2 - 1 scorey = 0 scorec = 0 lastcy = cy ry = Math.Floor(rows / 2) lastry = ry cc = cols - gap * 2 lastcc = cc rc = Math.Floor(rows / 2) lastrc = rc map = "" For c = 0 To cols - 1 map[c][-1] = 1 map[c][rows] = 1 EndFor For r = 0 To rows - 1 map[-1][r] = 1 map[cols][r] = 1 EndFor EndSub Sub Restart dy = "Right" dc = "" cy = gap * 2 - 1 lastcy = cy ry = Math.Floor(rows / 2) lastry = ry cc = cols - gap * 2 lastcc = cc rc = Math.Floor(rows / 2) lastrc = rc GraphicsWindow.BrushColor = "Black" GraphicsWindow.FillRectangle(0, 0, gw, gh) DrawGrid() DrawCycles() map = "" For c = 0 To cols - 1 map[c][-1] = 1 map[c][rows] = 1 EndFor For r = 0 To rows - 1 map[-1][r] = 1 map[cols][r] = 1 EndFor Timer.Interval = 1000 / 24 Timer.Tick = OnTick EndSub Sub Dummy OnTick = "" EndSub End>LZN025.sb< Start>LZN533.sb< GraphicsWindow.BackgroundColor="tan GraphicsWindow.PenWidth=3 GraphicsWindow.Width=400 GraphicsWindow.Height=500 GraphicsWindow.Left=5 GraphicsWindow.Top=5 Turtle.Speed=10 dfc="black args=0 GraphicsWindow.Title="Turtle-drawn Nonki GraphicsWindow.MouseMove=mmw ee=Shapes.AddEllipse(9 9) e1=Shapes.AddEllipse(9 9) sub mmw mousex=GraphicsWindow.MouseX mousey=GraphicsWindow.MouseY rr=LDMath.Convert2Radial (mousex mousey 150 200) r1=LDMath.Convert2Radial (mousex mousey 250 200) dd=Math.SquareRoot((mousex-200)*(mousex-200)+(mousey-200)*(mousey-200)) If dd>10 Then dd=10 EndIf pp=LDMath.Convert2Cartesian(150 200 dd rr[2]+180) pp1=LDMath.Convert2Cartesian(250 200 dd r1[2]+180) Shapes.Move(ee pp[1]-5 pp[2]-5) Shapes.Move(e1 pp1[1]-5 pp1[2]-5) EndSub hh="200,145,167,88,153,139,132,110,127,167,114,153 hr=LDText.Split(hh ",") For x=1 To 12 Step 2 If x>1 Then Turtle.PenDown() Else Turtle.PenUp() EndIf Turtle.MoveTo(hr[x] hr[x+1]) EndFor For x=1 To 12 Step 2 If x>1 Then Turtle.PenDown() Else Turtle.PenUp() EndIf Turtle.MoveTo(400-hr[x] hr[x+1]) EndFor Turtle.Angle=0 f10=10 LDCall.Function5( "edrw", -2 20 200 200 "90 140") LDCall.Function5( "edrw", 0 18 200 270 "40 20") LDCall.Function5( "edrw", 0 37 250 200 "13 25") LDCall.Function5( "edrw", 0 37 150 200 "13 25") LDCall.Function5( "edrwa", 22 43 295 200 "13 25 20") LDCall.Function5( "edrwa", 11 33 105 200 "13 25 -20") LDCall.Function5( "edrw" 20 34 161 180 "35 20") Turtle.Angle=180 Turtle.Move(68) Turtle.TurnLeft() Turtle.Move(11) Turtle.TurnLeft() Turtle.Move(68) LDCall.Function5( "edrw" 20 34 239 180 "35 20") Turtle.Hide() Sub edrw ss=args[1] aa=LDText.Split(args[5] " ") If aa[3]="" Then GraphicsWindow.PenColor=dfc Else GraphicsWindow.PenColor=aa[3] EndIf For x=ss To args[2] If x>ss Then Turtle.PenDown() Else Turtle.PenUp() EndIf Turtle.MoveTo(args[3]+ldmath.cos(x*f10)*aa[1] args[4]+aa[2]*ldmath.sin(x*f10)) EndFor EndSub Sub edrwa ss=args[1] aa=LDText.Split(args[5] " ") If aa[4]="" Then GraphicsWindow.PenColor=dfc Else GraphicsWindow.PenColor=aa[4] EndIf For x=ss To args[2] If x>ss Then Turtle.PenDown() Else Turtle.PenUp() EndIf px=args[3]+ldmath.cos(x*f10)*aa[1] py=args[4]+aa[2]*ldmath.sin(x*f10) jj=LDMath.Rotate(args[3] args[4] px py aa[3]) Turtle.MoveTo(jj[1] jj[2]) EndFor EndSub End>LZN533.sb< Start>LZQ038-0.sb< ' rotating NEPTUNE 'SIMULATION ' PROGRAM NO: GraphicsWindow.TOP=0 GraphicsWindow.LEFT=0 GraphicsWindow.Width=1366 GraphicsWindow.Height=768 GraphicsWindow.Title ="SIMULATION PLANET" colors() GraphicsWindow.BackgroundColor=dblue view3D = LD3DView.AddView(900,600,"true") LD3DView.AddDirectionalLight (view3D,blue,45,-90,10) sl=LD3DView.AddspotLight(view3D,magenta1,25,25,25,-1,-1,-1,5,150) LD3DView.ResetCamera(view3D,-30,15,30, 5, 0, -3, "","","") args=0 q=1 y=1 x=1 cc=LD3DView.AddSphere (view3D,5.5 ,40,cyan,"D") LD3DView.TranslateGeometry (view3D, cc, x*2, q*2, y*2) Timer.Interval=150 ya=12 r35=20 mo=5 Timer.Pause () ptm="true While "true For aa=0 To 360 Step 0.5 px= LDMath.Cos(aa) py= LDMath.sin (aa) Timer.Pause () ptm="true LD3DView.ResetCamera(view3D, px*r35,ya,py*r35, -px, -0.5, -py, "","","") Program.Delay (100) EndFor EndWhile Sub colors dblue=GraphicsWindow.GetColorFromRGB(0,0,25) dgreen=GraphicsWindow.GetColorFromRGB(0,25,0) magenta1=GraphicsWindow.GetColorFromRGB(150,100,250) cyan=GraphicsWindow.GetColorFromRGB(50,250,225) blue=GraphicsWindow.GetColorFromRGB(150,150,250) magenta=GraphicsWindow.GetColorFromRGB(250,50,250) EndSub End>LZQ038-0.sb< Start>LZQ038.sb< GraphicsWindow.Width=1600 GraphicsWindow.Height=900 GraphicsWindow.Top =10 GraphicsWindow.Left=10 GraphicsWindow.Title ="3D Objects Lab GraphicsWindow.BackgroundColor="teal view3D = LD3DView.AddView(900,900,"true") LD3DView.AddDirectionalLight (view3D,"#77aaaaaa",-1 ,-1 ,-1) LD3DView.AutoControl ("true" "true", -1 .5) sl=LD3DView.AddspotLight(view3D,"white",5,25, 5 ,-1 ,-1 ,-1 90 150) LD3DView.AddAmbientLight(view3D,"#77555555") LD3DView.ResetCamera(view3D,-30,15,30, 5, 0, -3, "","","") args=0 For q=0 to 2 For y=0 to 2 For x=0 to 2 cc=LD3DView.AddSphere (view3D .5 40 "darkred" "D") cc1=LD3DView.AddSphere (view3D .45 40 "red" "D") LD3DView.TranslateGeometry (view3D cc x*2, q*2, y*2) LD3DView.TranslateGeometry (view3D cc1 x*2, q*2, y*2) cb[q][x][y]=cc endfor endfor endfor Timer.Interval=150 Timer.tick=ttt ya=12 r35=20 mo=5 Timer.Pause () ptm="true While "true For aa=0 To 360 Step .5 px= LDMath.Cos(aa) py= LDMath.sin (aa) 'GraphicsWindow.Title =GraphicsWindow.LastKey If text.IsSubText ("Space Back LeftCtrl LeftShift" GraphicsWindow.LastKey) Then aa=aa-.5 If ptm then Timer.Resume () endif ptm="false else Timer.Pause () ptm="true LD3DView.ResetCamera(view3D, px*r35,ya,py*r35, -px, -.5, -py, "","","") EndIf Program.Delay (22) EndFor EndWhile Sub mww If GraphicsWindow.LastKey ="Back" then r35=r35+ LDEvents.LastMouseWheelDelta*3 Else ya=ya+ LDEvents.LastMouseWheelDelta*3 EndIf 'GraphicsWindow.Title =ll endsub Sub ttt tc=tc+1 If Math.Remainder (tc 27)=0 Then mo=math.Remainder (mo+1 6) alloff() If mo=0 Then mo=1 endif GraphicsWindow.Title =mo endif if mo=1 then '---------------------------------------mode1 ts=math.Remainder (tc 27)+1 LDCall.Function ("gpos" ots) LD3DView.ModifyObject (view3D cb[gz][gx][gy] "S")' old lamp off LDCall.Function ("gpos" ts) LD3DView.ModifyObject (view3D cb[gz][gx][gy] "H")'lamp on ots=ts Elseif mo=2 then '----------------------------------------------mode 2 gz=math.Remainder (math.Floor (tc/3) 3) If gz<>oz then For x=0 To 2 For y=0 To 2 LD3DView.ModifyObject (view3D cb[oz][x][y] "S")'lamp off EndFor EndFor For x=0 To 2 For y=0 To 2 LD3DView.ModifyObject (view3D cb[gz][x][y] "H")'lamp on EndFor EndFor endif oz=gz Elseif mo=3 then '-------------------------------------------------mode3 gz=math.Remainder (math.Floor (tc/3) 3) If gz<>oz then For x=0 To 2 For y=0 To 2 LD3DView.ModifyObject (view3D cb[x][oz][y] "S")'lamp off EndFor EndFor For x=0 To 2 For y=0 To 2 LD3DView.ModifyObject (view3D cb[x][gz][y] "H")'lamp on EndFor EndFor endif oz=gz Elseif mo=4 then '--------------------------------------------------mode4 gz=math.Remainder (math.Floor (tc/3) 3) If gz<>oz then For x=0 To 2 For y=0 To 2 LD3DView.ModifyObject (view3D cb[y][x][oz] "S")'lamp off EndFor EndFor For x=0 To 2 For y=0 To 2 LD3DView.ModifyObject (view3D cb[y][x][gz] "H")'lamp on EndFor EndFor endif oz=gz Elseif mo=5 then '--------------------------------------------------mode5 alloff() LDCall.Function ("lset" "1 2 3 13 15 25 26 27") mo=mo+1 Elseif mo=6 then '--------------------------------------------------mode5 alloff() LDCall.Function ("lset" "4 5 6 13 15 22 23 24") mo=mo+1 Elseif mo=7 then '--------------------------------------------------mode5 alloff() LDCall.Function ("lset" "7 8 9 13 15 19 20 21") mo=mo+1 Elseif mo=8 then '--------------------------------------------------mode5 alloff() LDCall.Function ("lset" "10 11 12 13 15 16 17 18") mo=5 endif EndSub Sub lset qq=LDText.Split (args[1] " ") For r=1 To Array.GetItemCount (qq) LDCall.Function ("gpos" qq[r]-1) LD3DView.ModifyObject (view3D cb[gz][gx][gy] "H")'lamp on endfor EndSub Sub alloff For gz=0 To 2 For x=0 To 2 For y=0 To 2 LD3DView.ModifyObject (view3D cb[gz][x][y] "S")'lamp off EndFor EndFor endfor EndSub Sub gpos aa=args[1] gz=Math.Floor (aa/9) gy=math.floor ((aa-gz*9)/3) gx=math.Remainder (aa 3) EndSub End>LZQ038.sb< Start>LZS492.sb< ' mahreen miangul ' Animals October 2016 GraphicsWindow.Width = 1200 GraphicsWindow.Height = 420 GraphicsWindow.BackgroundColor = "olivedrab" ' Ant Shapes1_Init() s = 1 Shapes1_Add() Sub Shapes1_Init shX = 888 ' x offset shY = 244 ' y offset shape1 = "" shape1[1] = "func=rect;x=61;y=55;width=6;height=14;angle=330;bc=#000000;pc=#000000;pw=2;" shape1[2] = "func=rect;x=42;y=25;width=5;height=18;angle=338;bc=#000000;pc=#000000;pw=2;" shape1[3] = "func=rect;x=8;y=6;width=3;height=19;angle=241;bc=#000000;pc=#000000;pw=2;" shape1[4] = "func=rect;x=28;y=23;width=6;height=25;angle=294;bc=#000000;pc=#000000;pw=2;" shape1[5] = "func=rect;x=40;y=7;width=5;height=20;angle=358;bc=#000000;pc=#000000;pw=2;" shape1[6] = "func=rect;x=33;y=0;width=5;height=18;angle=241;bc=#000000;pc=#000000;pw=2;" shape1[7] = "func=ell;x=27;y=39;width=46;height=21;bc=#000000;pc=#000000;pw=2;" shape1[8] = "func=ell;x=36;y=76;width=54;height=7;angle=6;bc=#907D5B;pc=#5E635B;pw=2;" shape1[9] = "func=ell;x=19;y=86;width=25;height=4;angle=289;bc=#5E635B;pc=#5E635B;pw=2;" shape1[10] = "func=ell;x=13;y=97;width=19;height=3;angle=347;bc=#907D5B;pc=#5E635B;pw=2;" shape1[11] = "func=ell;x=169;y=104;width=26;height=6;angle=7;bc=#907D5B;pc=#5E635B;pw=2;" shape1[12] = "func=ell;x=107;y=75;width=46;height=6;angle=165;bc=#5E635B;pc=#5E635B;pw=2;" shape1[13] = "func=ell;x=138;y=84;width=43;height=9;angle=238;bc=#907D5B;pc=#5E635B;pw=2;" shape1[14] = "func=rect;x=16;y=10;width=5;height=20;angle=345;bc=#000000;pc=#000000;pw=2;" shape1[15] = "func=ell;x=37;y=43;width=11;height=11;bc=#E3D4D1;pc=#000000;pw=2;" shape1[16] = "func=ell;x=84;y=75;width=39;height=8;angle=152;bc=#5E635B;pc=#5E635B;pw=2;" shape1[17] = "func=ell;x=105;y=83;width=38;height=9;angle=257;bc=#907D5B;pc=#5E635B;pw=2;" shape1[18] = "func=ell;x=126;y=103;width=20;height=8;angle=24;bc=#907D5B;pc=#5E635B;pw=2;" shape1[19] = "func=ell;x=61;y=68;width=46;height=21;angle=12;bc=#000000;pc=#000000;pw=2;" shape1[20] = "func=ell;x=103;y=73;width=46;height=21;bc=#000000;pc=#000000;pw=2;" shape1[21] = "func=ell;x=149;y=63;width=73;height=34;angle=352;bc=#000000;pc=#000000;pw=2;" shape1[22] = "func=ell;x=38;y=74;width=54;height=7;angle=18;bc=#907D5B;pc=#5E635B;pw=2;" shape1[23] = "func=ell;x=12;y=87;width=48;height=7;angle=282;bc=#5E635B;pc=#5E635B;pw=2;" shape1[24] = "func=ell;x=0;y=112;width=30;height=5;angle=347;bc=#907D5B;pc=#5E635B;pw=2;" shape1[25] = "func=ell;x=109;y=76;width=39;height=8;angle=152;bc=#5E635B;pc=#5E635B;pw=2;" shape1[26] = "func=ell;x=91;y=96;width=56;height=8;angle=268;bc=#907D5B;pc=#5E635B;pw=2;" shape1[27] = "func=ell;x=119;y=128;width=30;height=5;angle=14;bc=#907D5B;pc=#5E635B;pw=2;" shape1[28] = "func=ell;x=83;y=75;width=39;height=8;angle=152;bc=#5E635B;pc=#5E635B;pw=2;" shape1[29] = "func=ell;x=123;y=99;width=79;height=9;angle=238;bc=#907D5B;pc=#5E635B;pw=2;" shape1[30] = "func=ell;x=181;y=134;width=30;height=5;angle=14;bc=#907D5B;pc=#5E635B;pw=2;" shape1[31] = "func=ell;x=15;y=52;width=14;height=5;angle=348;bc=#000000;pc=#000000;pw=2;" EndSub Sub Shapes1_Add For i = 1 To Array.GetItemCount(shape1) GraphicsWindow.PenWidth = shape1[i]["pw"]*s GraphicsWindow.PenColor = shape1[i]["pc"] GraphicsWindow.BrushColor = shape1[i]["bc"] If shape1[i]["func"] = "rect" Then shape1[i]["obj"] = Shapes.AddRectangle(shape1[i]["width"]*s, shape1[i]["height"]*s) ElseIf shape1[i]["func"] = "ell" Then shape1[i]["obj"] = Shapes.AddEllipse(shape1[i]["width"]*s, shape1[i]["height"]*s) ElseIf shape1[i]["func"] = "tri" Then shape1[i]["obj"] = Shapes.AddTriangle(shape1[i]["x1"]*s, shape1[i]["y1"]*s, shape1[i]["x2"]*s, shape1[i]["y2"]*s, shape1[i]["x3"]*s, shape1[i]["y3"]*s) ElseIf shape1[i]["func"] = "line" Then shape1[i]["obj"] = Shapes.AddLine(shape1[i]["x1"]*s, shape1[i]["y1"]*s, shape1[i]["x2"]*s, shape1[i]["y2"]*s) EndIf Shapes.Move(shape1[i]["obj"], shX + shape1[i]["x"]*s, shY + shape1[i]["y"]*s) Shapes.Rotate(shape1[i]["obj"], shape1[i]["angle"]) EndFor EndSub ' 2 ' Crab Shapes2_Init() s = 0.8 Shapes2_Add() Sub Shapes2_Init shX = 822 ' x offset shY = 0 ' y offset shape2 = "" shape2[1] = "func=rect;x=109;y=173;width=138;height=81;bc=#B55D1D;pc=#B55D1D;pw=2;" shape2[2] = "func=ell;x=96;y=173;width=26;height=80;bc=#B55D1D;pc=#B55D1D;pw=2;" shape2[3] = "func=ell;x=233;y=174;width=26;height=80;bc=#B55D1D;pc=#B55D1D;pw=2;" shape2[4] = "func=rect;x=253;y=172;width=58;height=14;angle=341;bc=#B55D1D;pc=#B55D1D;pw=2;" shape2[5] = "func=tri;x=341;y=130;x1=6;y1=0;x2=0;y2=87;x3=13;y3=87;angle=95;bc=#B5451D;pc=#B55D1D;pw=2;" shape2[6] = "func=rect;x=257;y=197;width=58;height=14;angle=356;bc=#B55D1D;pc=#B55D1D;pw=2;" shape2[7] = "func=tri;x=340;y=179;x1=7;y1=0;x2=0;y2=76;x3=14;y3=76;angle=113;bc=#B5451D;pc=#B55D1D;pw=2;" shape2[8] = "func=rect;x=256;y=219;width=48;height=16;angle=1;bc=#B55D1D;pc=#B55D1D;pw=2;" shape2[9] = "func=tri;x=317;y=210;x1=7;y1=0;x2=0;y2=53;x3=14;y3=53;angle=113;bc=#B5451D;pc=#B55D1D;pw=2;" shape2[10] = "func=rect;x=252;y=246;width=43;height=13;angle=15;bc=#B55D1D;pc=#B55D1D;pw=2;" shape2[11] = "func=tri;x=302;y=247;x1=6;y1=0;x2=0;y2=43;x3=12;y3=43;angle=124;bc=#B5451D;pc=#B55D1D;pw=2;" shape2[12] = "func=rect;x=215;y=150;width=7;height=25;bc=#B5451D;pc=#B55D1D;pw=2;" shape2[13] = "func=rect;x=226;y=148;width=8;height=0;bc=#B5451D;pc=#B55D1D;pw=2;" shape2[14] = "func=ell;x=205;y=135;width=20;height=20;bc=#000000;pc=#B55D1D;pw=2;" shape2[15] = "func=rect;x=135;y=150;width=7;height=25;bc=#B5451D;pc=#B55D1D;pw=2;" shape2[16] = "func=ell;x=125;y=131;width=20;height=20;bc=#000000;pc=#B55D1D;pw=2;" shape2[17] = "func=rect;x=241;y=149;width=72;height=14;angle=321;bc=#B55D1D;pc=#B55D1D;pw=2;" shape2[18] = "func=ell;x=194;y=73;width=137;height=61;angle=25;bc=#B5451D;pc=#B55D1D;pw=2;" shape2[19] = "func=tri;x=231;y=85;x1=8;y1=0;x2=0;y2=14;x3=16;y3=14;angle=31;bc=#FFFFFF;pc=#B55D1D;pw=2;" shape2[20] = "func=tri;x=216;y=77;x1=8;y1=0;x2=0;y2=14;x3=16;y3=14;angle=25;bc=#FFFFFF;pc=#B55D1D;pw=2;" shape2[21] = "func=tri;x=262;y=98;x1=8;y1=0;x2=0;y2=14;x3=16;y3=14;angle=26;bc=#FFFFFF;pc=#B55D1D;pw=2;" shape2[22] = "func=tri;x=276;y=106;x1=8;y1=0;x2=0;y2=14;x3=16;y3=14;angle=28;bc=#FFFFFF;pc=#B55D1D;pw=2;" shape2[23] = "func=tri;x=291;y=112;x1=8;y1=0;x2=0;y2=14;x3=16;y3=14;angle=22;bc=#FFFFFF;pc=#B55D1D;pw=2;" shape2[24] = "func=tri;x=247;y=92;x1=8;y1=0;x2=0;y2=14;x3=16;y3=14;angle=31;bc=#FFFFFF;pc=#B55D1D;pw=2;" shape2[25] = "func=rect;x=64;y=247;width=43;height=13;angle=339;bc=#B55D1D;pc=#B55D1D;pw=2;" shape2[26] = "func=tri;x=43;y=250;x1=6;y1=0;x2=0;y2=43;x3=12;y3=43;angle=236;bc=#B5451D;pc=#B55D1D;pw=2;" shape2[27] = "func=rect;x=49;y=223;width=48;height=16;angle=348;bc=#B55D1D;pc=#B55D1D;pw=2;" shape2[28] = "func=tri;x=19;y=216;x1=6;y1=0;x2=0;y2=55;x3=13;y3=55;angle=250;bc=#B5451D;pc=#B55D1D;pw=2;" shape2[29] = "func=rect;x=39;y=200;width=58;height=14;angle=357;bc=#B55D1D;pc=#B55D1D;pw=2;" shape2[30] = "func=tri;x=2;y=187;x1=6;y1=0;x2=0;y2=79;x3=12;y3=79;angle=243;bc=#B5451D;pc=#B55D1D;pw=2;" shape2[31] = "func=rect;x=43;y=179;width=58;height=14;angle=6;bc=#B55D1D;pc=#B55D1D;pw=2;" shape2[32] = "func=tri;x=0;y=153;x1=6;y1=0;x2=0;y2=89;x3=13;y3=89;angle=249;bc=#B5451D;pc=#B55D1D;pw=2;" shape2[33] = "func=rect;x=41;y=150;width=69;height=15;angle=37;bc=#B55D1D;pc=#B55D1D;pw=2;" shape2[34] = "func=ell;x=42;y=100;width=83;height=34;angle=140;bc=#B55D1D;pc=#B55D1D;pw=2;" shape2[35] = "func=line;x=99;y=98;x1=6;y1=0;x2=0;y2=15;pc=#FFFFFF;pw=2;" shape2[36] = "func=line;x=82;y=112;x1=19;y1=0;x2=0;y2=2;pc=#FFFFFF;pw=2;" shape2[37] = "func=line;x=83;y=113;x1=0;y1=0;x2=0;y2=18;pc=#FFFFFF;pw=2;" shape2[38] = "func=line;x=62;y=130;x1=0;y1=5;x2=20;y2=0;pc=#FFFFFF;pw=2;" shape2[39] = "func=line;x=158;y=43;x1=0;y1=0;x2=1;y2=0;pc=#FFFFFF;pw=2;" shape2[40] = "func=line;x=126;y=192;x1=0;y1=0;x2=15;y2=12;pc=#B5451D;pw=2;" shape2[41] = "func=line;x=139;y=205;x1=0;y1=0;x2=2;y2=15;pc=#B5451D;pw=2;" shape2[42] = "func=line;x=127;y=217;x1=14;y1=0;x2=0;y2=18;pc=#B5451D;pw=2;" shape2[43] = "func=line;x=210;y=192;x1=14;y1=0;x2=0;y2=9;pc=#B5451D;pw=2;" shape2[44] = "func=line;x=209;y=202;x1=0;y1=0;x2=0;y2=18;pc=#B5451D;pw=2;" shape2[45] = "func=line;x=210;y=221;x1=0;y1=0;x2=8;y2=11;pc=#B5451D;pw=2;" EndSub Sub Shapes2_Add For i = 1 To Array.GetItemCount(shape2) GraphicsWindow.PenWidth = shape2[i]["pw"]*s GraphicsWindow.PenColor = shape2[i]["pc"] GraphicsWindow.BrushColor = shape2[i]["bc"] If shape2[i]["func"] = "rect" Then shape2[i]["obj"] = Shapes.AddRectangle(shape2[i]["width"]*s, shape2[i]["height"]*s) ElseIf shape2[i]["func"] = "ell" Then shape2[i]["obj"] = Shapes.AddEllipse(shape2[i]["width"]*s, shape2[i]["height"]*s) ElseIf shape2[i]["func"] = "tri" Then shape2[i]["obj"] = Shapes.AddTriangle(shape2[i]["x1"]*s, shape2[i]["y1"]*s, shape2[i]["x2"]*s, shape2[i]["y2"]*s, shape2[i]["x3"]*s, shape2[i]["y3"]*s) ElseIf shape2[i]["func"] = "line" Then shape2[i]["obj"] = Shapes.AddLine(shape2[i]["x1"]*s, shape2[i]["y1"]*s, shape2[i]["x2"]*s, shape2[i]["y2"]*s) EndIf Shapes.Move(shape2[i]["obj"], shX + shape2[i]["x"]*s, shY + shape2[i]["y"]*s) Shapes.Rotate(shape2[i]["obj"], shape2[i]["angle"]) EndFor EndSub ' 3 'Gurilla Shapes3_Init() s = 1 Shapes3_Add() Sub Shapes3_Init shX = 444 ' x offset shY = 44 ' y offset shape3 = "" shape3[1] = "func=ell;x=98;y=44;width=110;height=71;bc=#834216;pw=0;" shape3[2] = "func=ell;x=51;y=247;width=75;height=23;angle=348;bc=#FDBC90;pc=#834216;pw=2;" shape3[3] = "func=ell;x=197;y=250;width=74;height=22;angle=11;bc=#FDBC90;pc=#834216;pw=2;" shape3[4] = "func=ell;x=113;y=253;width=20;height=22;bc=#FDBC90;pc=#834216;pw=2;" shape3[5] = "func=ell;x=191;y=255;width=18;height=20;bc=#FDBC90;pc=#834216;pw=2;" shape3[6] = "func=ell;x=40;y=260;width=13;height=16;bc=#FDBC90;pc=#834216;pw=2;" shape3[7] = "func=ell;x=47;y=264;width=16;height=18;bc=#FDBC90;pc=#834216;pw=2;" shape3[8] = "func=ell;x=261;y=267;width=13;height=13;bc=#FDBC90;pc=#834216;pw=2;" shape3[9] = "func=ell;x=252;y=269;width=13;height=15;bc=#FDBC90;pc=#834216;pw=2;" shape3[10] = "func=ell;x=81;y=190;width=36;height=67;angle=332;bc=#834216;pw=0;" shape3[11] = "func=ell;x=200;y=188;width=35;height=67;angle=20;bc=#834216;pw=0;" shape3[12] = "func=ell;x=76;y=175;width=62;height=43;bc=#834216;pw=0;" shape3[13] = "func=ell;x=171;y=178;width=60;height=40;bc=#834216;pw=0;" shape3[14] = "func=ell;x=112;y=139;width=82;height=76;bc=#834216;pw=0;" shape3[15] = "func=ell;x=75;y=99;width=81;height=72;bc=#834216;pw=0;" shape3[16] = "func=ell;x=149;y=96;width=82;height=74;bc=#834216;pw=0;" shape3[17] = "func=ell;x=5;y=87;width=107;height=55;angle=340;bc=#834216;pw=0;" shape3[18] = "func=ell;x=195;y=82;width=109;height=59;angle=25;bc=#834216;pw=0;" shape3[19] = "func=ell;x=0;y=126;width=43;height=76;angle=341;bc=#834216;pw=0;" shape3[20] = "func=ell;x=263;y=126;width=45;height=72;angle=17;bc=#834216;pw=0;" shape3[21] = "func=ell;x=33;y=176;width=39;height=35;bc=#FDBC90;pc=#834216;pw=2;" shape3[22] = "func=ell;x=239;y=176;width=41;height=37;bc=#FDBC90;pc=#834216;pw=2;" shape3[23] = "func=tri;x=113;y=0;x1=37;y1=0;x2=0;y2=76;x3=75;y3=76;bc=#834216;pw=0;" shape3[24] = "func=tri;x=148;y=5;x1=15;y1=0;x2=0;y2=43;x3=31;y3=43;bc=#834216;pw=0;" shape3[25] = "func=ell;x=110;y=46;width=58;height=41;angle=33;bc=#FDBC90;pw=0;" shape3[26] = "func=ell;x=138;y=47;width=61;height=41;angle=318;bc=#FDBC90;pw=0;" shape3[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;" shape3[28] = "func=ell;x=127;y=61;width=28;height=19;angle=349;bc=#FFFFFF;pc=#000000;pw=2;" shape3[29] = "func=ell;x=152;y=62;width=30;height=20;angle=16;bc=#FFFFFF;pc=#000000;pw=2;" shape3[30] = "func=ell;x=135;y=66;width=14;height=15;bc=#000000;pc=#000000;pw=2;" shape3[31] = "func=ell;x=158;y=67;width=14;height=15;bc=#000000;pc=#000000;pw=2;" shape3[32] = "func=ell;x=123;y=140;width=59;height=60;bc=#FCA76E;pc=#834216;pw=2;" shape3[33] = "func=ell;x=150;y=107;width=62;height=55;bc=#FCA76E;pw=0;" shape3[34] = "func=ell;x=94;y=107;width=64;height=53;bc=#FCA76E;pw=0;" shape3[35] = "func=ell;x=96;y=79;width=118;height=69;bc=#FDBC90;pc=#834216;pw=2;" shape3[36] = "func=ell;x=77;y=65;width=35;height=23;angle=38;bc=#FDBC90;pc=#834216;pw=2;" shape3[37] = "func=ell;x=194;y=63;width=36;height=23;angle=317;bc=#FDBC90;pc=#834216;pw=2;" shape3[38] = "func=ell;x=130;y=74;width=22;height=17;angle=15;bc=#FDBC90;pw=0;" shape3[39] = "func=ell;x=156;y=73;width=22;height=18;angle=348;bc=#FDBC90;pw=0;" shape3[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;" shape3[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;" shape3[42] = "func=rect;x=125;y=97;width=55;height=21;bc=#FFFFFF;pc=#000000;pw=2;" shape3[43] = "func=ell;x=135;y=78;width=15;height=9;angle=23;bc=#834216;pw=0;" shape3[44] = "func=ell;x=159;y=77;width=15;height=9;angle=339;bc=#834216;pw=0;" shape3[45] = "func=line;x=152;y=97;x1=0;y1=0;x2=0;y2=19;pc=#000000;pw=2;" shape3[46] = "func=line;x=137;y=98;x1=0;y1=0;x2=0;y2=19;pc=#000000;pw=2;" shape3[47] = "func=line;x=167;y=99;x1=0;y1=0;x2=0;y2=18;pc=#000000;pw=2;" EndSub Sub Shapes3_Add For i = 1 To Array.GetItemCount(shape3) GraphicsWindow.PenWidth = shape3[i]["pw"]*s GraphicsWindow.PenColor = shape3[i]["pc"] GraphicsWindow.BrushColor = shape3[i]["bc"] If shape3[i]["func"] = "rect" Then shape3[i]["obj"] = Shapes.AddRectangle(shape3[i]["width"]*s, shape3[i]["height"]*s) ElseIf shape3[i]["func"] = "ell" Then shape3[i]["obj"] = Shapes.AddEllipse(shape3[i]["width"]*s, shape3[i]["height"]*s) ElseIf shape3[i]["func"] = "tri" Then shape3[i]["obj"] = Shapes.AddTriangle(shape3[i]["x1"]*s, shape3[i]["y1"]*s, shape3[i]["x2"]*s, shape3[i]["y2"]*s, shape3[i]["x3"]*s, shape3[i]["y3"]*s) ElseIf shape3[i]["func"] = "line" Then shape3[i]["obj"] = Shapes.AddLine(shape3[i]["x1"]*s, shape3[i]["y1"]*s, shape3[i]["x2"]*s, shape3[i]["y2"]*s) EndIf Shapes.Move(shape3[i]["obj"], shX + shape3[i]["x"]*s, shY + shape3[i]["y"]*s) Shapes.Rotate(shape3[i]["obj"], shape3[i]["angle"]) EndFor EndSub ' 4 ' Rocket ' initialize shapes Shapes4_Init() ' add shapes s = 1 Shapes4_Add() angle = 0 Sub Shapes4_Init ' Shapes | Initialize shapes data ' return shX, shY - current position of shapes ' return shape - array of shapes shX = 40 ' x offset shY = 11'51.666664123535 ' y offset shape4[1] = "func=rect;x=20.516662597656;y=113.800010681153;width=109;height=181;bc=#FF0000;pc=#FF000000;pw=2;" shape4[2] = "func=tri;x=0;y=197.333335876465;x1=32;y1=0;x2=0;y2=74;x3=64;y3=74;angle=26;bc=#FFADAD;pc=#FF000000;pw=2;" shape4[3] = "func=tri;x=97;y=219.333335876465;x1=31;y1=0;x2=0;y2=79;x3=62;y3=79;angle=337;bc=#FFADAD;pc=#FF000000;pw=2;" shape4[4] = "func=line;x=75.366668701172;y=211.900016784668;x1=1.116668701172;y1=0.000000000000;x2=0.000000000000;y2=79.283325195313;pc=#FF000000;pw=2;" shape4[5] = "func=tri;x=40.116668701172;y=293.716667175293;x1=36;y1=0;x2=0;y2=30;x3=72;y3=30;bc=#FFADAD;pc=#FF000000;pw=2;" shape4[6] = "func=tri;x=13.783355712891;y=0.000000000000;x1=62;y1=0;x2=0;y2=115;x3=124;y3=115;bc=#FFADAD;pc=#FF000000;pw=2;" shape4[7] = "func=ell;x=52.116668701172;y=329.283317565918;width=45;height=102;bc=#FF0700;pc=#FF000000;pw=2;" shape4[8] = "func=ell;x=57.233337402344;y=341.333335876465;width=34;height=71;bc=#FF7E07;pc=#FF000000;pw=2;" shape4[9] = "func=ell;x=64.533332824707;y=355.583335876465;width=19;height=42;bc=#FFFF00;pc=#FF000000;pw=2;" shape4[10] = "func=rect;x=11;y=382.333335876465;width=141;height=43;bc=#FFFFFF;pc=#FFFFFF;pw=2;" EndSub Sub Shapes4_Add For i = 1 To Array.GetItemCount(shape4) GraphicsWindow.PenWidth = shape4[i]["pw"]*s GraphicsWindow.PenColor = shape4[i]["pc"] GraphicsWindow.BrushColor = shape4[i]["bc"] If shape4[i]["func"] = "rect" Then shape4[i]["obj"] = Shapes.AddRectangle(shape4[i]["width"]*s, shape4[i]["height"]*s) ElseIf shape4[i]["func"] = "ell" Then shape4[i]["obj"] = Shapes.AddEllipse(shape4[i]["width"]*s, shape4[i]["height"]*s) ElseIf shape4[i]["func"] = "tri" Then shape4[i]["obj"] = Shapes.AddTriangle(shape4[i]["x1"]*s, shape4[i]["y1"]*s, shape4[i]["x2"]*s, shape4[i]["y2"]*s, shape4[i]["x3"]*s, shape4[i]["y3"]*s) ElseIf shape4[i]["func"] = "line" Then shape4[i]["obj"] = Shapes.AddLine(shape4[i]["x1"]*s, shape4[i]["y1"]*s, shape4[i]["x2"]*s, shape4[i]["y2"]*s) EndIf Shapes.Move(shape4[i]["obj"], shX + shape4[i]["x"]*s, shY + shape4[i]["y"]*s) Shapes.Rotate(shape4[i]["obj"], shape4[i]["angle"]) EndFor EndSub ' 5 ' Duck Shapes5_Init() s = 1 Shapes5_Add() Sub Shapes5_Init ' Shapes | Initialize shapes data ' return shX, shY - current position of shapes ' return shape - array of shapes shX = 222 ' x offset shY = 10 ' y offset shape5 = "" shape5[1] = "func=tri;x=153;y=41;x1=47;y1=0;x2=0;y2=22;x3=95;y3=22;bc=red;pw=0;beck" shape5[2] = "func=ell;x=118;y=0;width=91;height=73;bc=blue;pw=0;" shape5[3] = "func=line;x=172;y=36;x1=0;y1=0;x2=22;y2=0;pc=red;pw=2;blink" shape5[4] = "func=ell;x=172;y=25;width=22;height=22;bc=pink;pw=0;eye" shape5[5] = "func=tri;x=132;y=58;x1=31;y1=0;x2=0;y2=45;x3=62;y3=45;bc=red;pw=0;neck" shape5[6] = "func=tri;x=0;y=80;x1=37;y1=0;x2=0;y2=32;x3=75;y3=32;angle=178;bc=red;pw=0;tail" shape5[7] = "func=line;x=91;y=134;x1=0;y1=0;x2=0;y2=36;pc=red;pw=8;Leg1" shape5[8] = "func=ell;x=33;y=72;width=164;height=82;bc=yellow;pw=0;body" shape5[9] = "func=tri;x=58;y=180;x1=46;y1=0;x2=0;y2=14;x3=93;y3=14;bc=red;pw=0;Leg3" shape5[10] = "func=line;x=90;y=169;x1=0;y1=0;x2=14;y2=15;pc=yellow;pw=8;Leg2" EndSub Sub Shapes5_Add For i = 1 To Array.GetItemCount(shape5) GraphicsWindow.PenWidth = shape5[i]["pw"]*s GraphicsWindow.PenColor = shape5[i]["pc"] GraphicsWindow.BrushColor = shape5[i]["bc"] If shape5[i]["func"] = "rect" Then shape5[i]["obj"] = Shapes.AddRectangle(shape5[i]["width"]*s, shape5[i]["height"]*s) ElseIf shape5[i]["func"] = "ell" Then shape5[i]["obj"] = Shapes.AddEllipse(shape5[i]["width"]*s, shape5[i]["height"]*s) ElseIf shape5[i]["func"] = "tri" Then shape5[i]["obj"] = Shapes.AddTriangle(shape5[i]["x1"]*s, shape5[i]["y1"]*s, shape5[i]["x2"]*s, shape5[i]["y2"]*s, shape5[i]["x3"]*s, shape5[i]["y3"]*s) ElseIf shape5[i]["func"] = "line" Then shape5[i]["obj"] = Shapes.AddLine(shape5[i]["x1"]*s, shape5[i]["y1"]*s, shape5[i]["x2"]*s, shape5[i]["y2"]*s) EndIf Shapes.Move(shape5[i]["obj"], shX + shape5[i]["x"]*s, shY + shape5[i]["y"]*s) Shapes.Rotate(shape5[i]["obj"], shape5[i]["angle"]) EndFor EndSub ' 6 ' Snowman 'GraphicsWindow.BackgroundColor = "#939393" ' Shapes | Initialize snowman's shapes data ' return shX, shY - current position of shapes ' return shape - array of shapes Shapes6_Init() s = 1 Shapes6_Add() Sub Shapes6_Init shX = 0 ' x offset shY = 77 ' y offset shape6 = "" shape6[1] = "func=rect;x=383;y=197;width=38;height=15;angle=29;bc=#68432C;pw=0;" shape6[2] = "func=rect;x=0;y=257;width=624;height=113;bc=#FFFFFF;pw=0;" shape6[3] = "func=ell;x=415;y=136;width=84;height=73;bc=#FFFFFF;pw=0;" shape6[4] = "func=ell;x=399;y=190;width=115;height=97;bc=#FFFFFF;pw=0;" shape6[5] = "func=rect;x=433;y=167;width=16;height=6;bc=#000000;pw=0;" shape6[6] = "func=rect;x=465;y=167;width=16;height=6;bc=#000000;pw=0;" shape6[7] = "func=ell;x=432;y=160;width=18;height=19;bc=#000000;pw=0;" shape6[8] = "func=ell;x=464;y=160;width=18;height=19;bc=#000000;pw=0;" shape6[9] = "func=rect;x=446;y=187;width=21;height=5;bc=#000000;pw=0;" EndSub Sub Shapes6_Add For i = 1 To Array.GetItemCount(shape6) GraphicsWindow.PenWidth = shape6[i]["pw"]*s GraphicsWindow.PenColor = shape6[i]["pc"] GraphicsWindow.BrushColor = shape6[i]["bc"] If shape6[i]["func"] = "rect" Then shape6[i]["obj"] = Shapes.AddRectangle(shape6[i]["width"]*s, shape6[i]["height"]*s) ElseIf shape6[i]["func"] = "ell" Then shape6[i]["obj"] = Shapes.AddEllipse(shape6[i]["width"]*s, shape6[i]["height"]*s) ElseIf shape6[i]["func"] = "tri" Then shape6[i]["obj"] = Shapes.AddTriangle(shape6[i]["x1"]*s, shape6[i]["y1"]*s, shape6[i]["x2"]*s, shape6[i]["y2"]*s, shape6[i]["x3"]*s, shape6[i]["y3"]*s) ElseIf shape6[i]["func"] = "line" Then shape6[i]["obj"] = Shapes.AddLine(shape6[i]["x1"]*s, shape6[i]["y1"]*s, shape6[i]["x2"]*s, shape6[i]["y2"]*s) EndIf Shapes.Move(shape6[i]["obj"], shX + shape6[i]["x"]*s, shY + shape6[i]["y"]*s) Shapes.Rotate(shape6[i]["obj"], shape6[i]["angle"]) EndFor EndSub GraphicsWindow.FontSize = 44 GraphicsWindow.BrushColor= "yellowgreen" miangulBOX = Shapes.Addtext("mussa-maina") Shapes.Move(miangulBOX, 10,333) GraphicsWindow.FontSize = 55 GraphicsWindow.BrushColor= "greenyellow" miangulBOX = Shapes.Addtext("miangul") Shapes.Move(miangulBOX, 366,344) End>LZS492.sb< Start>LZV237.sb< GraphicsWindow.BackgroundColor="black" GraphicsWindow.Title=("Moon Phase Calculator") GraphicsWindow.Width=200 GraphicsWindow.Height=250 GraphicsWindow.PenColor="white" GraphicsWindow.DrawLine(20,20,20,160) GraphicsWindow.DrawLine(180,20,180,160) GraphicsWindow.DrawLine(20,20,180,20) GraphicsWindow.DrawLine(20,160,180,160) If Clock.Month=1 Then form=0 Else form=form EndIf If Clock.Month=2 Then form=31 Else form=form EndIf If Clock.Month=3 Then form=59.25 Else form=form EndIf If Clock.Month=4 Then form=90.25 Else form=form EndIf If Clock.Month=5 Then form=120.25 Else form=form EndIf If Clock.Month=6 Then form=151.25 Else form=form EndIf If Clock.Month=7 Then form=181.25 Else form=form EndIf If Clock.Month=8 Then form=212.25 Else form=form EndIf If Clock.Month=9 Then form=243.25 Else form=form EndIf If Clock.Month=10 Then form=273.25 Else form=form EndIf If Clock.Month=11 Then form=304.25 Else form=form EndIf If Clock.Month=12 Then form=334.25 Else form=form EndIf date=clock.day year=clock.Year*365.25 total=date+form+year newmoon=734994.25 dayssince=total-newmoon dayssincelunar=dayssince/29.35059 Decimals = 2 dayssincelunar = Math.Floor(dayssincelunar * Math.Power(10, Decimals)) / Math.Power(10, Decimals) dayssincelunarcomplete=dayssincelunar-Math.Floor(dayssincelunar) Sub NumberSplit Number = Number * 1 DotPos = Text.GetIndexOf(Number ".") If DotPos > 0 Then Whole = Text.GetSubText(Number 1 DotPos-1) Fractional = Text.GetSubTextToEnd(Number DotPos+1) Else Whole = Number Fractional = "" If Whole = 0 Then If Number >= 0 Then Whole = "" Else Whole = "-" EndIf EndIf endif endsub Number = dayssincelunarcomplete NumberSplit() If Fractional >= 0 And Fractional <=4 Then phase ="newmoon" EndIf If Fractional >=4 And Fractional <=20 Then phase="waxing cresent" EndIf If Fractional >=21 And fractional <=29 Then phase="first quater" EndIf If Fractional >=29 and Fractional <=54 Then phase="waxing gibbous" EndIf If Fractional >=54 And Fractional <=61 Then phase="full moon" EndIf If Fractional >=61 And Fractional <=71 Then phase="waning gibbous" EndIf If Fractional >=71 And Fractional <=78 Then phase="third quater" EndIf If Fractional>=78 And Fractional <=96Then phase="waning cresent" EndIf If Fractional >=96 And Fractional <=100 Then phase="new moon" EndIf If Fractional>50 Then morethan50 = Fractional-50 morethan50fini=morethan50*2 morethan50finished=100-morethan50fini numberdoubled=100-numberdoubled lessthan50finished=0 endif if Fractional <50 Then lessthan50finished=Fractional*2 morethan50finished=0 EndIf finished=morethan50finished+lessthan50finished GraphicsWindow.DrawText(20,180,"Moon Illumination=") GraphicsWindow.DrawText(140,180,finished) GraphicsWindow.DrawText(157,180,"%") GraphicsWindow.DrawText(35,220,"date=") drawdate=Clock.Date GraphicsWindow.DrawText(75,220,drawdate) GraphicsWindow.DrawText(15,200,"Moon phase=") GraphicsWindow.DrawText(100,200,phase) image1="C:\Users\Wetton Children\Pictures\moon phase images for small basic\black background.jpg" image2="C:\Users\Wetton Children\Pictures\moon phase images for small basic\moon phase 8.jpg" image3="C:\Users\Wetton Children\Pictures\moon phase images for small basic\moon phase3.jpg" image4="C:\Users\Wetton Children\Pictures\moon phase images for small basic\moon phase 1.jpg" image5="C:\Users\Wetton Children\Pictures\alexs moon\copy of moon completely finished copy with less pixels for small basic copy.jpg" image6="C:\Users\Wetton Children\Pictures\moon phase images for small basic\moon phase 7 copy.jpg" image7="C:\Users\Wetton Children\Pictures\moon phase images for small basic\moon phase5.jpg" image8="C:\Users\Wetton Children\Pictures\moon phase images for small basic\moon phase 10.jpg" If phase="newmmon" Then GraphicsWindow.DrawImage(image1,20,20) EndIf If phase="waxing cresent" Then GraphicsWindow.DrawImage(image2,30,30) EndIf If phase="first quater" Then GraphicsWindow.DrawImage(image3,30,30) EndIf If phase="waxing gibbous" Then GraphicsWindow.DrawImage(image4,30,30) EndIf If phase="full moon" Then GraphicsWindow.DrawImage(image5,30,30) EndIf If phase="waning gibbous" then GraphicsWindow.DrawImage(image6,30,30) EndIf If phase="third quater" Then GraphicsWindow.DrawImage(image7,30,30) EndIf If phase="waning cresent" Then GraphicsWindow.DrawImage(image8,30,30) EndIf End>LZV237.sb< Start>LZX776.sb< Controls.ButtonClicked = OnButtonClicked Turtle.Speed = 9 GraphicsWindow.Height=600 GraphicsWindow.Width =600 Weiter = 0 While Weiter = 0 input() Draw() Controls.HideControl(BS) EndWhile Sub OnButtonClicked CButton = Controls.LastClickedButton If CButton = BC Then Weiter = 1 EndIf If CButton = BS Then Weiter = 0 EndIf If CButton = BE Then GraphicsWindow.Clear() Program.End() EndIf EndSub Sub Input GraphicsWindow.DrawText(1,1,"Number:") Number = Controls.AddTextBox(50, 1) BC = Controls.AddButton(" CONTINUE ", 200,550) BE = Controls.AddButton(" E N D ", 400,550) Controls.ShowControl(BC) Controls.ShowControl(BE) Weiter = 0 While Weiter = 0 Sides = Controls.GetTextBoxText(Number) EndWhile GraphicsWindow.Clear() Controls.ShowControl(BC) BS = Controls.AddButton(" S T O P ", 1,1) EndSub Sub Draw Turtle.Angle = 0 Turtle.PenUp() Turtle.MoveTo(300,300) Turtle.PenDown() Turtle.Show() length = 5 * sides angle = 360 / sides * Math.Pi While Weiter = 1 For j = 1 To sides Turtle.Move(length / sides) Turtle.PenUp() Turtle.Turn(angle / Sides / 2) Turtle.PenDown() EndFor Turtle.Turn(angle) EndWhile Turtle.Hide() EndSub End>LZX776.sb<