GRAPHER - not your ordinary drawing program. (for computer)
Grapher is written in BASIC256.
Main difference between normal drawing programs and Grapher: in a "standard" program, you'd click on Line and use the mouse to draw a line. In Grapher, you select Line, then enter in the coordinates for the line. It is menu based.
Here are some screenshots:
This is the main menu of Grapher:
-----
Here I am drawing a line:
-----
And here is the result:
-----
Here I am making a circle:
-----
And here is the result:
It doesn't automatically clear the drawing when you add a new shape, you have to press "6" (partial erase) or "7" (full erase) to erase.
Here's the code:
Code:
If you have any ideas, comments, or optimizations, please tell me!
A Python version should be coming soon.
Sorry I haven't uploaded the actual file yet. I will sometime. In the meantime, copy and paste the source code above. Thanks!
Grapher is written in BASIC256.
Main difference between normal drawing programs and Grapher: in a "standard" program, you'd click on Line and use the mouse to draw a line. In Grapher, you select Line, then enter in the coordinates for the line. It is menu based.
Here are some screenshots:
This is the main menu of Grapher:
-----
Here I am drawing a line:
-----
And here is the result:
-----
Here I am making a circle:
-----
And here is the result:
It doesn't automatically clear the drawing when you add a new shape, you have to press "6" (partial erase) or "7" (full erase) to erase.
Here's the code:
Code:
titlepg:
cls
color black
print "GRAPHER - By Spyro543"
print "Press the key the corresponds to what you want to do:"
print "1 - Draw Line"
print "2 - Draw Single Point"
print "3 - Draw Rectangle"
print "4 - Draw Circle"
print "5 - Draw Text"1
print "6 - Erase Partial"
print "7 - Erase All"
checkpg:
choice = key
if choice = asc("1") then
goto drawline
endif
if choice = asc("2") then
goto drawpoint
endif
if choice = asc("3") then
goto drawrect
endif
if choice = asc("4") then
goto drawcircle
endif
if choice = asc("5") then
goto drawtext
endif
if choice = asc("6") then
goto erasepart
endif
if choice = asc("7") then
goto eraseall
endif
goto checkpg
drawline:
cls
print "Draw a line:"
input "Start of line x-axis: ", x1
input "Start of line y-axis: ", y1
input "End of line x-axis: ", x2
input "End of line y-axis: ", y2
line(x1, y1, x2, y2)
goto titlepg
drawpoint:
cls
print "Draw a line:"
input "x-axis: ", x
input "y-axis: ", y
plot(x, y)
goto titlepg
drawrect:
cls
print "Draw a rectangle:"
input "x-axis: ", x1
input "y-axis: ", y1
input "Width: ", x2
input "Height: ", y2
rect(x1, y1, x2, y2)
goto titlepg
drawcircle:
cls
print "Draw a circle:"
input "x-axis: ", x
input "y-axis: ", y
input "Radius: ", r
circle(x, y, r)
goto titlepg
drawtext:
cls
print "Draw text:"
input "x-axis: ", x
input "y-axis: ", y
input "Text: ", t$
text(x, y, t$)
goto titlepg
erasepart:
cls
print "Partial erase:"
color clear
input "x-axis: ", x1
input "y-axis: ", y1
input "Width: ", x2
input "Height: ", y2
rect(x1, y1, x2, y2)
goto titlepg
eraseall:
cls
print "Erase all:"
input "Are you sure? [Y/N]", yn$
if yn$ = "Y" or yn$ = "y" then
clg
goto titlepg
else
if yn$ = "N" or yn$ = "n" then
goto titlepg
endif
endif
If you have any ideas, comments, or optimizations, please tell me!
A Python version should be coming soon.
Sorry I haven't uploaded the actual file yet. I will sometime. In the meantime, copy and paste the source code above. Thanks!