'=========================================================================== ' Subject: FLIP UPSIDE DOWN INT GET-ARRAY Date: 01-07-99 (12:34) ' Author: Jacob Wieles Code: QB, PDS, PB ' Origin: jacwls@worldonline.nl Packet: GRAPHICS.ABC '=========================================================================== 'program : T-B-INT.BAS (05-01-99) ' : Set a picture upside down with movement of data in ' an integer GET-array. 'which basic : PowerBASIC and - with remout $huge - Q(uick)BASIC 'auteur : Jacob Wieles $huge 'a must for PowerBASIC 3.5 defint a-z screen 12 xL=0 xR=311 yT=0 yB=419 x=xR-xL+1 y=yB-yT+1 locate 2,1 print" xL = 0 xR = 311" print" yT = 0 yB = 419" print print" x = xR-xL+1 =";x print" y = yB-yT+1 =";y locate 10,1 print" because x is a" print" multiple of eight :" print" reqsize = 2+x/8*2*y" print print" line(xL,yT)-(xR,yB),10,b" print" line(xL+x/2,0)-(xR,yB),10" print print" dim scrnarr(reqsize-1)." print" get (xL,yT)-(xR,yB),scrnarr" reqsize=2+x/8*2*y dim scrnarr(reqsize-1) line(xL,yT)-(xR,yB),10,b line(xL+x/2,0)-(xR,yB),10 get (xL,yT)-(xR,yB),scrnarr locate 20,2 color 10 while inkey$<>"":wend print"Hit a key for next." hitakey$=input$(1) cls color 14 locate 2,1 print" Hit a key for the 'up side down' picture with :" print print" epxl=x/8*2 'array elements per xline" print print" for i=1 to y\2 'lines upper half change" print" 'with lines lower half" print" for j=0 to epxl-1" print" swap scrnarr(2+(i-1)*epxl+j), scrnarr(reqsize-i*epxl+j)" print" next j" print" next i" print" cls print" put (96,0),scrnarr print color 10 print"Notes:" print print" x =";x,"y =";y print print" array elements per xline =";x/8*2 print" x-lines to change =";y\2 print print" scrnarr(0) =";scrnarr(0) print" scrnarr(1) =";scrnarr(1) while inkey$<>"":wend hitakey$=input$(1) cls epxl=x/8*2 'array elements per xline for i=1 to y\2 'lines upper half change for j=0 to epxl-1 'with lines lower half swap scrnarr(2+(i-1)*epxl+j), scrnarr(reqsize-i*epxl+j) next j next i cls put (96,0),scrnarr color 12 locate 4,14 while inkey$<>"":wend print"Hit a key for the end." hitakey$=input$(1) cls screen 0 print"Hit a key for the source."