Posted: Sun Dec 30, 2007 2:32 pm Post subject: Turing Paint
After getting bored of playing flash games for 7 days in a row.
I decided share more stuff out of the turing games I made last year.
This is a drawing program done in turing.
copy and paste into turing to use it.
it comes with a help and you wont miss it , so... ya
Have fun with it and happy new year
Turing:
var version :="1.2" var loadtime :=0.0 var mx, my, mc :int var selected :=255 var chosen :=1 var key :arraycharofboolean var actions :flexiblearray1.. 0ofint var ax1, ax2, ay1, ay2 :flexiblearray1.. 0ofint var step :flexiblearray1.. 0ofint var aColor :flexiblearray1.. 0ofint var thick :flexiblearray1.. 0ofint var toolName :array0.. 9ofstring:=init("erasor", "Line", "brush", "rectangle", "oval", "star", "mapleleaf", "fillshape", "fillblank", "no") var thickness :=1.0 var tool :=1 var name :="" View.Set("offscreenonly")
%var pass : string %get pass %assert pass = "thisisforjohn" proc help
var ch :char cls color(red) put"Welcome to Turing Paint " + version
put"Press 'h' at ANY TIME for HELP" put"" color(black) put"select colour at the bottom of the window" put"press '0'~'9' to select tools" put"press '+' and '-' to adjust line thickness" put"press 'z' to move 1 step back" put"press 's' to save and 'l' to load" put"press 'w' and 'q' to selection previous and next colour" put"" put"press any key to continue" View.Update
ch :=getchar end help
proc newAll
new actions, upper(actions) + 1 new ax1, upper(ax1) + 1 new ay1, upper(ay1) + 1 new ax2, upper(ax2) + 1 new ay2, upper(ay2) + 1 new aColor, upper(aColor) + 1 new thick, upper(thick) + 1
% proc save (name :string) var OUT :int open: OUT, name, put for i :1.. upper(ax1) put: OUT, ax1 (i) put: OUT, ay1 (i) put: OUT, ax2 (i) put: OUT, ay2 (i) put: OUT, actions (i) put: OUT, thick (i) put: OUT, aColor (i) endfor put"saved!!" delay(1000) close: OUT
end save
% proc load (name :string) for i :1.. upper(ax1) + 1
back
endfor var IN :int open: IN, name, get
newAll
loop get: IN, ax1 (upper(ax1)) get: IN, ay1 (upper(ay1)) get: IN, ax2 (upper(ax2)) get: IN, ay2 (upper(ay2)) get: IN, actions (upper(actions)) get: IN, thick (upper(thick)) get: IN, aColor (upper(aColor)) exitwheneof(IN)=true
newAll
endloop put"loaded!!" delay(1000) close: IN
end load
% proc checkKeys
Input.KeyDown(key) if key (chr(ord("+")))then
thickness +=0.2 elsif key (chr(ord("-")))and thickness > 1then
thickness -=0.2 elsif key (chr(ord("z")))then
back
put"canceled 1 move" View.Update delay(100) elsif key (chr(ord("h")))then
help
elsif key (chr(ord("s")))then cls View.Set("nooffscreenonly") put"File name(type 'cancel' to cancel)" get name
if name not= "cancel"then
save (name + ".txt") endif View.Set("offscreenonly") elsif key (chr(ord("l")))then cls View.Set("nooffscreenonly") put"File name(type 'cancel' to cancel)" get name
if name not= "cancel"then
load (name + ".txt") endif View.Set("offscreenonly") elsif key (chr(ord("q")))then if chosen > 0then
chosen -=1 endif elsif key (chr(ord("w")))then if chosen < 255then
chosen +=1 endif endif for i :0.. 9 if key (chr(ord(intstr(i))))then
tool := i
endif endfor end checkKeys
% real codes
help
loop cls mousewhere(mx, my, mc)
showStat
drawAll
showAll
checkKeys
% if mc =1and my > 20then new step, upper(step) + 1
step (upper(step)):=upper(ax1)
newAll
actions (upper(actions)):= tool
aColor (upper(aColor)):= chosen
ax1 (upper(ax1)):= mx
ay1 (upper(ay1)):= my
thick (upper(thick)):=round(thickness) loop
Posted: Sun Dec 30, 2007 8:53 pm Post subject: Lol
Wow, Xiao, LOL, you actually posted it!
So...
Where is that "Box" Tower Defence???
fishtastic
Posted: Sun Dec 30, 2007 8:59 pm Post subject: Re: Lol
yusong @ Sun Dec 30, 2007 7:53 pm wrote:
Where is that "Box" Tower Defence???
It will be uploaded when its done, And i will share the code
MihaiG
Posted: Sun Dec 30, 2007 9:02 pm Post subject: Re: Turing Paint
Dude, Xiao, i havent seen you in ages, whatsup man?
fishtastic
Posted: Sun Dec 30, 2007 9:04 pm Post subject: Re: Turing Paint
MihaiG @ Sun Dec 30, 2007 8:02 pm wrote:
Dude, Xiao, i havent seen you in ages, whatsup man?
who are you?
yusong
Posted: Sun Dec 30, 2007 9:10 pm Post subject: Re: Turing Paint
Dude, Xiao, it says MihaiG, who do you think it is?
it is probably Mihai!
LOL
And when are you going to be done "Box" Defence???
I want it now!
You said I could do some Beta testing!
MihaiG
Posted: Sun Dec 30, 2007 9:15 pm Post subject: Re: Turing Paint
Xiao, we had gr 10 math togehter with Ms. Schleuter,
dont you remember?
well i was on the opposite side of the room, man
its good to see you
fishtastic
Posted: Sun Dec 30, 2007 9:16 pm Post subject: Re: Turing Paint
yusong @ Sun Dec 30, 2007 8:10 pm wrote:
it is probably Mihai!
LOL
OIC
Sponsor Sponsor
fishtastic
Posted: Sun Dec 30, 2007 9:20 pm Post subject: Re: Turing Paint
MihaiG @ Sun Dec 30, 2007 8:15 pm wrote:
Xiao, we had gr 10 math togehter with Ms. Schleuter,
dont you remember?
well i was on the opposite side of the room, man
its good to see you
Ahhh... I think I remember now,
good to see you too!
yusong
Posted: Sun Dec 30, 2007 9:43 pm Post subject: Re: Turing Paint
Ms. Shleuter is like, the best math teacher ever!
Here classes are so easy!
And she doesn't even care if you do homework or not, that is sick, LOL!
So, Xiao, how about it?
The "Box" Defence thing??
Oh, and the INTSTR and STRINT stuff for my RPG is not working, how do i fix it???
Do they all have to be STRING or INT?
Saad
Posted: Sun Dec 30, 2007 11:12 pm Post subject: RE:Turing Paint
This topic has gone off-topic, if you want to talk someone then PM them. Remember this topic is about the Turing paint program.
On topic. This is an interesting program, i like how you stored actions allowing undo's, although you could make it better with more parameter passing and less global variables. Also you could make an action type which makes the code much neater.
Gooie
Posted: Mon Dec 31, 2007 1:51 am Post subject: Re: Turing Paint
I love it, it would be even cooler though if you got it going with two windows, one for tools, the other for canvas. Like The Gimp.
Dan
Posted: Mon Dec 31, 2007 2:04 am Post subject: Re: RE:Turing Paint
Saad @ 30th December 2007, 11:12 pm wrote:
This topic has gone off-topic, if you want to talk someone then PM them. Remember this topic is about the Turing paint program.
On topic. This is an interesting program, i like how you stored actions allowing undo's, although you could make it better with more parameter passing and less global variables. Also you could make an action type which makes the code much neater.
Saad is right, alot of the above should have been done threw PMs or other means. This topic will be locked if it keeps going off topic.
Computer Science CanadaHelp with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
fishtastic
Posted: Mon Dec 31, 2007 1:56 pm Post subject: Re: Turing Paint
Gooie @ Mon Dec 31, 2007 12:51 am wrote:
I love it, it would be even cooler though if you got it going with two windows, one for tools, the other for canvas. Like The Gimp.
Thanks !
you are the first person who replied something about the actual program.
about the gimp part, thinks it as Photoshop instead of gimp. Photoshop is as good a gimp right?
if you want to, you can change my code a bit to put the drawing part in a different window.
Sean
Posted: Tue Jan 01, 2008 10:17 am Post subject: Re: Turing Paint
Gooie, you got to post your version of paint that you came up with.
Then you could combine your codes into one, to attempt to make an easier paint program.