QBasic/3D Graphics

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Simple 3D Box

Redo:
cls
screen 1
Input "Enter the X-position?";K
Input "Enter the Y-position?";L
color 1
for i = 1 to 50 step 2   rem box
    a = k+i:b = l+i
    line (a,a)-(b,a)
    line (a,b)-(b,b)
    line (a,a)-(a,b)
    line (b,a)-(b,b)
next                            rem diagonals
line (k,k)-(a,a)
line (l,l)-(b,b)
line (l,k)-(b,a)
line (k,l)-(a,b)
Input"Do you want to redo? (Y/N)";ans$
if ucase$(ans$)="Y" then goto Redo
end