This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
craftscomputer's profile picture

Drawing Programm

Started by craftscomputer, 25 March 2012 - 02:14 PM
craftscomputer #1
Posted 25 March 2012 - 04:14 PM
Hello everybody I've made a little drawing programm, sorry it's German, but i didn't want to translate it…
I will be pleased if somebody can make it better.
move with w a s d
beginning: press any key, now choose your drawing symbol,press Enter. Now press pfor draw and m for move ( you can change it later anytime)
press u to choose a other symbol, then press Enter.
(if this is bad English I'm sorry but I'm only 12 years old…)
so heres the code:




term.clear()
q = 1
height = 1
lenght = 1
term.setCursorPos(12, 13)
print ("Hallo: Als erstes bitte gleich dein Mal-zeichen eingeben, dannach drücke")
print ("den Modus: p für malen oder m für laufen|kann jederzeit geändert")
print ("werden| e für beenden, u für zeichen wechsel Press any key...")
while true do
event, fer, fer1 = os.pullEvent()
if event == "char" then
  break
end
end
while true do
y = read()
while q == 1 do
event, par, par1 = os.pullEvent()
  if event == "char" and par == "p" then
   x = 1
   break
  elseif event == "char" and par == "m" then
   x = 2
   break
  end
end

term.clear()

while true do
event, mo, mo1 = os.pullEvent()
  if event == "char" and mo == "d" then
   lenght = lenght+1
  elseif event == "char" and mo == "a" then
   lenght = lenght-1
  elseif event == "char" and mo == "w" then
   height = height-1
  elseif event == "char" and mo == "s" then
   height = height+1
  elseif event == "char" and mo == "e" then
   z = 1
   break
  elseif event == "char" and mo == "m" then
   x = 3
  elseif event == "char" and mo == "p" then
   x = 1
  elseif event == "char" and mo == "u" then
   y = read(" ")
  elseif event == "char" and mo == "c" then
   x = 2
  end
  term.setCursorPos(lenght, height)
   if x == 1 then
	print (y)
   end
end
if z == 1 then
  break
end


end
term.clear()
term.setCursorPos(1, 1)
schrolock #2
Posted 25 March 2012 - 04:55 PM
term.clear()
q = 1
height = 1
lenght = 1
term.setCursorPos(12, 13)
print ("Hello: First type the letter to choose your Mode")
print ("The Modes: p for drawing or m for walk|can be changed anytime|")
print ("e to exit, u to change the drawingmode Press any key…")
while true do
event, fer, fer1 = os.pullEvent()
if event == "char" then
break
end
end
while true do
y = read()
while q == 1 do
event, par, par1 = os.pullEvent()
if event == "char" and par == "p" then
x = 1
break
elseif event == "char" and par == "m" then
x = 2
break
end
end

term.clear()

while true do
event, mo, mo1 = os.pullEvent()
if event == "char" and mo == "d" then
lenght = lenght+1
elseif event == "char" and mo == "a" then
lenght = lenght-1
elseif event == "char" and mo == "w" then
height = height-1
elseif event == "char" and mo == "s" then
height = height+1
elseif event == "char" and mo == "e" then
z = 1
break
elseif event == "char" and mo == "m" then
x = 3
elseif event == "char" and mo == "p" then
x = 1
elseif event == "char" and mo == "u" then
y = read(" ")
elseif event == "char" and mo == "c" then
x = 2
end
term.setCursorPos(lenght, height)
if x == 1 then
print (y)
end
end
if z == 1 then
break
end


end
term.clear()
term.setCursorPos(1, 1)




PS: gute idee aber es passiert garnichts nachdem man den buchstaben angegeben hat
craftscomputer #3
Posted 25 March 2012 - 04:56 PM
sorry les den text noch mal du must dannach p drücken
schrolock #4
Posted 25 March 2012 - 06:06 PM
sorry les den text noch mal du must dannach p drücken

AAAAAHHHHHH ok aus dem text ging eher heraus das p zu einer der funktionen gehört :(/>/> ok

gute idee.
Wolvan #5
Posted 30 March 2012 - 01:57 PM
Nett :o/>/> Ich mag es :o/>/>
Mads #6
Posted 04 April 2012 - 01:28 PM
Advert said:
English only, please.
^^Quote from "Forum Guidelines"
Wolvan #7
Posted 04 April 2012 - 10:18 PM
Advert said:
English only, please.
^^Quote from "Forum Guidelines"
Basicly, we're just say thank you for your great work to him :)/>/>