'SUPER BASIC GRAFICL PROGRAMMING LANGUAGE'MADE BY TARUDAHAT ' ' '       '         '         '       '       '        '       ' ' '      '        '        '      '        '        '       ' ' ' ''CODE WILL BE IMPROVED ACLS OPTION DEFINT COLOR 1 GCOLOR #BLACK SNDSTOP XSCREEN 2,1,2 DISPLAY 1 GPRIO -10 COLOR 1 BACKCOLOR RGB(240,240,240) DISPLAY 0 BACKCOLOR RGB(240,240,240) COLOR 1 LOAD "GRP4:_GRAP.",0'LOAD GRAPIC.S(SP) LOAD "GRP5:_GRAP.",0'LOAD GRAPIC.S(BG) GPRIO -10 ' DEBUG=FALSE ' 'FUNCS. DIM NAME$[1] DIM LO[0]'FOR BG DIM SC[1]'SEE CODE DIM C0DE$[1]' DIM TYPEA[1] DIM PX[1]'POSITION X DIM PY[2]'POSITION Y DIM SX[1]'SCALE X DIM SY[1]'SCALE Y VAR DIA VAR DONE VAR ANUMBER=1 VAR TYPE VAR CODE$ VAR I5 VAR I4 VAR I3 VAR I2 VAR I VAR A,B,C,GG,G VAR HIT VAR A$,B$,C$' VAR NO_RENDER=FALSE VAR H' VAR H2 VAR H3 VAR H4 VAR SCAN_Y VAR ARRAY_[0] VAR S'SCROLL VAR OOF$ VAR Y_ VAR Y_2 VAR Y_$ VAR Y_2$ VAR DO_PAGE=TRUE VAR PAGE=0 VAR FPS,Y3DIDY6QO,XVW82V11 VAR FINISH VAR HOI$ VAR _1=0'FOR ADDING 1 W/ PUSH VAR __$=""'FOR ADDING "" W/ PUSH VAR NOT_LOADING=TRUE VAR SAVE_NAME=TRUE DEF CHOCO I2 A$=C0DE$[I2] IF LEN(C0DE$[I2]) > 8 THEN H=LEN(C0DE$[I2]) H2=H-8 H=H-H2 IF SC[I2]==1 THEN A$=LEFT$(A$,H) ENDIF IF SC[I2]==2 THEN A$=LEFT$(A$,H) ENDIF A$=A$+"…" ENDIF IF LEN(C0DE$[I2]) > 6 AND SX[I2]==3 THEN H=LEN(C0DE$[I2]) H2=H-6 H=H-H2 IF SC[I2]==1 THEN A$=LEFT$(A$,H) ENDIF IF SC[I2]==2 THEN A$=LEFT$(A$,H) ENDIF A$=A$+"…" ENDIF END DEF PUT_BLOCK TYPE,CODE$ PUSH SC,_1'SEE CODE PUSH C0DE$,__$' PUSH TYPEA,_1 PUSH PX,_1'POSITION X PUSH PY,_1'POSITION Y PUSH SX,_1'SCALE X PUSH SY,_1'SCALE Y IF TYPE==1 OR TYPE==6 THEN SC[ANUMBER]=1 ELSEIF TYPE==4 OR TYPE==5 OR TYPE==9 THEN SC[ANUMBER]=2 ENDIF SPSET ANUMBER,TYPE SX[ANUMBER]=2 SY[ANUMBER]=2 SPHOME ANUMBER,16*2,16 SPCOL ANUMBER,TRUE UPDATE_ZOOM SPSCALE ANUMBER,SX[ANUMBER],SY[ANUMBER] PX[ANUMBER]=90 PY[ANUMBER]=50 SPOFS ANUMBER,PX[ANUMBER],PY[ANUMBER] UPDATE_ZOOM TYPEA[ANUMBER]=TYPE C0DE$[ANUMBER]=CODE$ IF NOT_LOADING==TRUE THEN INC ANUMBER DO_PAGE=TRUE END DEF RENDER_TEXT IF NOT_LOADING==TRUE THEN GCLS FOR I4=1 TO ANUMBER-1 CHOCO I4 IF SC[I4]==1 THEN IF SX[I4]<3 THEN GPUTCHR PX[I4]-45,PY[I4]-12,A$,SX[I4]-1,SY[I4]-1 ELSEIF SX[I4]==3 THEN GPUTCHR PX[I4]-65,PY[I4]-20,A$,SX[I4]-1,SY[I4]-1 ENDIF ELSEIF SC[I4]==2 THEN CHOCO I4 IF SX[I4]<3 THEN GPUTCHR PX[I4]-45,PY[I4]+8,A$,SX[I4]-1,SY[I4]-1 ELSEIF SX[I4]==3 THEN GPUTCHR PX[I4]-65,PY[I4]+10,A$,SX[I4]-1,SY[I4]-1 ENDIF ENDIF NEXT END DEF ZOOM B$ WAIT 2 IF B$ == "IN" THEN FOR I3=1 TO ANUMBER-1 INC SX[I3],1 INC SY[I3],1 IF SX[I3]==4 THEN SX[I3]=3 IF SY[I3]==4 THEN SY[I3]=3 Y_=SPUSED(I3) IF Y_==TRUE THEN SPSCALE I3,SX[I3],SY[I3] ENDIF RENDER_TEXT NEXT ELSEIF B$ == "OUT" THEN FOR I3=1 TO ANUMBER-1 DEC SX[I3],1 DEC SY[I3],1 IF SX[I3]==0 THEN SX[I3]=1 IF SY[I3]==0 THEN SY[I3]=1 Y_=SPUSED(I3) IF Y_==TRUE THEN SPSCALE I3,SX[I3],SY[I3] ENDIF RENDER_TEXT NEXT ENDIF END DEF UPDATE_ZOOM'I AM RLY BAD @ NAMING STUFF FOR I3=1 TO ANUMBER SX[I3]=SX[1] SY[I3]=SY[1] RENDER_TEXT Y_=SPUSED(I3) IF Y_==TRUE THEN SPSCALE I3,SX[I3],SY[I3] ENDIF NEXT END DEF CODESCROLL B$ FOR I=1 TO ANUMBER-1 IF B$=="UP" THEN INC S,1 IF NO_RENDER==TRUE THEN INC S,2 ELSEIF B$=="DOWN" THEN DEC S,1 IF NO_RENDER==TRUE THEN DEC S,2 ENDIF IF S>2 THEN S=2 IF S<-2 THEN S=-2 INC PY[I],S IF (PY[I]<-20 OR PY[I]>259) OR TYPEA[I]==0 THEN SPCLR I GOTO @NOPE ELSEIF PY[I]>-20 && PY[I]<259 THEN Y_=SPUSED(I) IF Y_==FALSE THEN SPSET I,TYPEA[I] SPHOME I,16*2,16 SPCOL I,TRUE SPSCALE I,SX[I],SY[I] ENDIF SPOFS I,PX[I],PY[I] ENDIF IF NO_RENDER==FALSE THEN RENDER_TEXT @NOPE NEXT END DEF UNDO IF ANUMBER>1 THEN DEC ANUMBER,1 PX[ANUMBER]=0 PY[ANUMBER]=0 REMOVE SC,ANUMBER REMOVE TYPEA,ANUMBER REMOVE C0DE$,ANUMBER SPCLR ANUMBER ELSEIF ANUMBER==0 THEN WAIT 0 ENDIF END DEF PUTFPS INC FPS,1 IF Y3DIDY6QO>XVW82V11 OR Y3DIDY6QO<XVW82V11 THEN LOCATE 33,28 ?"FPS:";FPS FPS=0 TMREAD OUT , ,Y3DIDY6QO ENDIF TMREAD OUT , ,XVW82V11 END DEF CONVERT DIA=DIALOG("Would you like to convert your program? "+CHR$(10)+"(The editor will restart after converting)",1,"Choice") IF DIA<0 THEN GOTO @K 'SETUP LOAD "PRG1:_FUNCS",0 FTW=PRGSIZE(1) PRGEDIT 1,FTW+1 SPSCALE 0,650,1 SPOFS 0,0,0 NO_RENDER=TRUE GCOLOR #BLACK GFILL 0,0,399,239 GCOLOR #WHITE GPUTCHR 30,90,"CONVERTING",3,3 GPUTCHR 266,100,"…",3,3 GPUTCHR 60,134,"Please wait.",2,2 GG=MIN(PY) IF GG<0 THEN G=ABS(GG) FOR I4=0 TO G+50 CODESCROLL "UP" NEXT ENDIF 'CONVERT WHILE DONE==FALSE HIT=SPHITSP(0,0,254) CODESCROLL "DOWN" IF C==HIT THEN GOTO @0_0 IF HIT>-1 THEN 'ADD NEEDED CODE TO CODE IF TYPEA[HIT]==5 THEN 'MAKE OOF Y_=RND(999999) Y_2=RND(999999) Y_$=STR$(Y_) Y_2$=STR$(Y_2) OOF$="EJ"+Y_$+"HR"+Y_2$+"I" C0DE$[HIT]="FOR "+OOF$+"="+C0DE$[HIT] ELSEIF TYPEA[HIT]==6 THEN C0DE$[HIT]="IF "+C0DE$[HIT]+" THEN" ELSEIF TYPEA[HIT]==9 THEN C0DE$[HIT]="ELSEIF "+C0DE$[HIT]+" THEN" ELSEIF TYPEA[HIT]==4 THEN C0DE$[HIT]="UNTIL "+C0DE$[HIT] ENDIF '____________ PRGSET C0DE$[HIT] C=HIT ENDIF @0_0 I4=MAX(PY) IF I4<=0 THEN DONE=TRUE WEND DIA=DIALOG("Would you like to SAVE the converted program?",1,"Choice") IF DIA>-1 THEN LINPUT "Enter a name for the program: ";C$ A=LEN(C$) IF A>=14 THEN H2=H-12 H=H-H2 A$=LEFT$(C$,H) C$=A$+"." ENDIF SAVE "PRG1:"+C$ ENDIF EXEC "SUPER_BASIC" @K END 'SORRY FOR HAVING TO MAKE THEM MULTIBLE FILES DEF SAVE_ DIA=DIALOG("Would you like to SAVE the program?",1,"Choice") IF DIA>-1 THEN LINPUT "Enter a name for the program: ";C$ 'MAKE NAME SMALLER IF NEEDED H=LEN(C$) IF H>=14 THEN H2=H-9 H=H-H2 C$=LEFT$(C$,H) C$=C$+"." ENDIF '----------------- PY[0]=ANUMBER PUSH NAME$,__$ SAVE "DAT:PY_"+C$,PY SAVE "DAT:TY_"+C$,TYPEA NAME$[LEN(NAME$)-1]=C$ SAVE "TXT:TX_"+C$,SAVE$(C0DE$) SAVE "TXT:_NAMES",SAVE$(NAME$) ENDIF DO_PAGE=TRUE END 'FROM 12. DEF SAVE$(ARRAY$[]) DIM STRING$ FOR I=0 TO LEN(ARRAY$)-1 INC STRING$,CHR$(LEN(ARRAY$[I])) INC STRING$,ARRAY$[I] NEXT RETURN STRING$ END DEF LOAD$(STRING$) DIM ARRAY$[0] FOR I=0 TO LEN(STRING$)-1 VAR LEN%=ASC(STRING$[I]) PUSH ARRAY$,MID$(STRING$,I+1,LEN%) INC I,LEN% NEXT RETURN ARRAY$ END '------- DEF LOAD_ IF CHKFILE("TXT:_NAMES")==TRUE THEN NAME$=LOAD$(LOAD("TXT:_NAMES",0)) I=1 WHILE 1 VSYNC B=BUTTON(2) IF (B AND #LEFT) THEN DEC I,1 ENDIF IF (B AND #RIGHT) THEN INC I,1 ENDIF IF I<1 THEN I=LEN(NAME$)-1 IF I>LEN(NAME$)-1 THEN I=1 GFILL 0,0,399,239,RGB(240,240,240) GCOLOR #BLACK GPUTCHR 83,99,NAME$[I],2,2 GPUTCHR 45,195,"Load Delete",2,2 GPUTCHR 50,230,"Press / to select a file." IF (B AND #A) THEN HOI$=NAME$[I] BREAK IF (B AND #X) THEN DELETE "DAT:PY_"+NAME$[I] DELETE "DAT:TY_"+NAME$[I] DELETE "TXT:TX_"+NAME$[I] REMOVE NAME$,I IF LEN(NAME$)>1 THEN SAVE "TXT:_NAMES",SAVE$(NAME$) ELSEIF LEN(NAME$)<=1 THEN DELETE "TXT:_NAMES" ENDIF GOTO @DELETED ENDIF WEND GCLS PUT_BLOCK 1,"" PUT_BLOCK 1,"" FOR I=1 TO ANUMBER+1 UNDO NEXT B$=RIGHT$(HOI$,10) C$="DAT:PY_"+B$ FOR I=0 TO LEN(PY)+1 PUSH SC,_1'SEE CODE PUSH PX,_1'POSITION X PUSH SX,_1'SCALE X PUSH SY,_1'SCALE X NEXT LOAD C$,PY,0 C$="DAT:TY_"+B$ LOAD C$,TYPEA,0 C$="TXT:TX_"+B$ C0DE$=LOAD$(LOAD(C$,0)) ANUMBER=PY[0] GCOLOR #BLACK GFILL 0,0,399,239 GCOLOR #WHITE GPUTCHR 59,90,"LOADING",3,3 GPUTCHR 223,98,"…",3,3 GPUTCHR 60,134,"Please wait.",2,2 GCOLOR RGB(25,25,25) NOT_LOADING=FALSE FOR WH_I=1 TO ANUMBER-1 PX[WH_I]=170 IF TYPEA[WH_I]==1 OR TYPEA[WH_I]==6 THEN SC[WH_I]=1 IF TYPEA[WH_I]==4 OR TYPEA[WH_I]==5 THEN SC[WH_I]=2 IF TYPEA[WH_I]==9 THEN SC[WH_I]=2 PUT_BLOCK TYPEA[WH_I],C0DE$[WH_I] CODESCROLL "UP" CODESCROLL "DOWN" NEXT 'CLEAR THAT ONE WEIRD GOST ISH BLOCK THING. SC[WH_I]=0 PX[WH_I]=0 PY[WH_I]=0 TYPEA[WH_I]=0 C0DE$[WH_I]="" SPCLR WH_I 'ALSO CLEAR ANUMBER OUT OF THE PY[] ARRAY PY[0]=0 NOT_LOADING=TRUE ELSEIF CHKFILE("TXT:_NAMES")==FALSE THEN DIA= DIALOG("No save data found.",0,"Notifcation",) ENDIF @DELETED END DEF REMOVE ARRAY_[],I IF !I THEN IF SHIFT(ARRAY_) THEN ENDIF ELSEIF LEN(ARRAY_)==I THEN IF POP(ARRAY_) THEN ENDIF ELSE COPY ARRAY_,I,ARRAY_,I+1,LEN(ARRAY_)-I-1 IF POP(ARRAY_) THEN ENDIF ENDIF END 'INTRO THING SPSET 0,4095 SPSCALE 0,2,2 DISPLAY 1 GPUTCHR 90,230,"© Szilàrd Csonka" DISPLAY 0 LOCATE 42,29 IF DEBUG==TRUE THEN ?"V. DEV." ELSE ?"V.1.1.0 ENDIF FOR I=0 TO 125 WAIT 1 IF BUTTON() THEN BEEP GOTO @SKIP_INTRO SPOFS 0,197,I,-152 INC I,2 NEXT BEEP WAIT 65 DISPLAY 1 FADE RGB(250,0,0,0),50 DISPLAY 0 FADE RGB(250,0,0,0),50 WAIT 65 DISPLAY 1 FADE RGB(0,205,205,205),50 DISPLAY 0 FADE RGB(0,205,205,205),50 @SKIP_INTRO CLS SPCLR 0 'SET SOME STUFF UP 'SET ALL BLOCK SPRITES UP SPDEF 1,16,5,16*4,22 SPDEF 2,16*5,5,16*4,22 SPDEF 3,16*9,5,16*4,22 SPDEF 4,16*5,37,16*4,30 SPDEF 5,16*9,37,16*4,29 SPDEF 6,16,37,16*4,22 SPDEF 7,16,69,16*4,22 SPDEF 8,16,101,16*4,22 SPDEF 9,16,133,16*4,30 IF CHKFILE("TXT:_NAMES")==TRUE THEN NAME$=LOAD$(LOAD("TXT:_NAMES",0)) ENDIF LOAD "DAT:_MENU",LO,0 BGLOAD 0,0,-15,64,64,LO'LOAD MINI LOGO GBOX 229,-1,450,186 GBOX 225,-1,450,190 GBOX 224,-1,450,191 DISPLAY 1 CLS GCOLOR RGB(25,25,25) BGLOAD 0,0,0,64,64,LO'LOAD MENU SPSET 0,0 SPHOME 0,8,8 SPCOL 0,TRUE LOAD "PRG3:_INFO",0 FTW=PRGSIZE(3) PRGEDIT 3,FTW PRGDEL 1 FTW=PRGSIZE(3) FTW=(FTW/20) DIM PAGE$[FTW] 'MAIN LOOP WHILE 1 VSYNC HIT=SPHITSP(0,0,254) B=BUTTON() TOUCH OUT TT,TX,TY IF DEBUG==TRUE THEN PUTFPS ENDIF IF TT>0 THEN SPOFS 0,TX,TY IF (B AND #UP) THEN CODESCROLL "UP" IF (B AND #DOWN) THEN CODESCROLL "DOWN" IF (BUTTON(2) AND #LEFT) THEN DO_PAGE=TRUE DEC PAGE,1 IF (BUTTON(2) AND #RIGHT) THEN DO_PAGE=TRUE INC PAGE,1 IF PAGE>FTW-1 THEN PAGE=0 ELSEIF PAGE<0 THEN PAGE=FTW-1 ENDIF IF (BUTTON(2) AND #X) THEN ZOOM "IN" IF (BUTTON(2) AND #Y) THEN ZOOM "OUT" IF TT>0 && TX<17 && TY>53 && TY<74 THEN LOAD_ IF TT>0 && TX<17 && TY>85 && TY<106 THEN SAVE_ IF TT>0 && TX<17 && TY>6 && TY<21 THEN WAIT 8 UNDO IF TT>0 && TX<17 && TY>116 && TY<140 THEN CONVERT IF TT>0 && TX<17 && TY>148 && TY<171 THEN LINPUT "Enter code to use: ";CODE$ PUT_BLOCK 1,CODE$ WAIT 15 ENDIF IF TT>0 && TY>180 && TX<17 && TY<203 THEN DIA=DIALOG("What kind of loop do you want to use?"+CHR$(10)*8+"REPEAT FROM",1,"Choice",) IF DIA==-1 THEN PUT_BLOCK 2,"REPEAT" LINPUT"Until when should the REPEAT loop continue?: UNTIL ";CODE$ PUT_BLOCK 4,CODE$ ELSEIF DIA==1 THEN LINPUT "Enter number to start counting FROM: ";CODE$ LINPUT "Enter number to count TO: ";B$ I2=VAL(CODE$) I3=VAL(B$) WHILE I3<=I2 LINPUT "Number to count to is to small please enter a bigger number: ";B$ ?"" ?"" ?"" I3=VAL(B$) WEND CODE$=CODE$+" to "+B$ PUT_BLOCK 5,CODE$ PUT_BLOCK 3,"NEXT" ENDIF WAIT 15 ENDIF IF TT>0 && TY>212 && TX<17 && TY<236 THEN DIA=DIALOG("What kind of IF statement do you want touse?"+CHR$(10)*6+"1 Sided Multi Sided"+CHR$(10)+"statement statement",1,"Choice",) IF DIA==-1 THEN'1 SIDED STATE. LINPUT "If ";CODE$ PUT_BLOCK 6," "+CODE$ PUT_BLOCK 8,"ENDIF" ELSEIF DIA==1 THEN'MULTI. SIDED STATE. DIA=DIALOG("Which part of the Multi sided IF statement would you like to be used?"+CHR$(10)*7+"Else Elseif",1,"Choice",) IF DIA==-1 THEN'ELSE PUT_BLOCK 7,"ELSE" ENDIF LINPUT "If ";CODE$ PUT_BLOCK 6," "+CODE$ IF DIA==1 THEN'ELSEIF LINPUT "Elseif ";CODE$ PUT_BLOCK 9,CODE$'ELSEIF ENDIF PUT_BLOCK 8,"ENDIF" ENDIF WAIT 15 ENDIF 'CLEAR SCREENS AND UPDATE IT DISPLAY 0 IF DO_PAGE==TRUE THEN CLS WHY=0 FOR UGH=1+PAGE*20 TO 20+PAGE*20 PRGEDIT 3,UGH LOCATE 28,1+WHY ?PRGGET$() INC WHY,1 NEXT DO_PAGE=FALSE CLS_AFTER=FALSE TOUCHING=0 ENDIF LOCATE 29,22 ? "PAGE:";PAGE+1;"/";FTW LOCATE 0,25 ?"" IF TT==44 THEN TOUCHING=1 IF TT>45 AND HIT>0 THEN IF TOUCHING==1 THEN LOCATE 1,25 ?"CODE:"+C0DE$[HIT] ENDIF CLS_AFTER=TRUE ENDIF IF TT==0 AND CLS_AFTER==TRUE THEN DO_PAGE=TRUE DISPLAY 1 'DRAG BOX IF HIT>-1 && TT>3 THEN PX[HIT]=TX PY[HIT]=TY SPOFS HIT,PX[HIT],PY[HIT] ENDIF 'DELETE A BOX IF HIT>-1 AND (B==#B) THEN SC[HIT]=0 PX[HIT]=0 PY[HIT]=0 TYPEA[HIT]=0 C0DE$[HIT]="" SPCLR HIT ENDIF RENDER_TEXT WEND