Page 1 of 1

Help with Turing!!

Posted: Mon Jan 05, 2004 5:33 pm
by Anonymous
I'm trying to make a paint program. I created a canvas using GUI but I don't know how to set a limit to it so that when I color it can't go out of the border. :grade11math:

Archived topic from Iceteks, old topic ID:1881, old post ID:15459

Help with Turing!!

Posted: Mon Jan 05, 2004 5:36 pm
by Red Squirrel
unfortunatly I can't help you with turing (I thought I posted a reply like an hour ago :unsure: ) but syb knows turing so should be able to help.

Is this class restricted to turing only or any other language, because I would suggest C++ or maybe assembly if you're a true geek as it's more "new". But turing is supost to be easier then C++ so you might be better off with that if you want something easier. I never programmed it but seen some code and it looks easy to understand.

Archived topic from Iceteks, old topic ID:1881, old post ID:15460

Help with Turing!!

Posted: Mon Jan 05, 2004 5:53 pm
by Anonymous
Unfortunately my class is restricted to Turing....

Archived topic from Iceteks, old topic ID:1881, old post ID:15461

Help with Turing!!

Posted: Mon Jan 05, 2004 6:43 pm
by Red Squirrel
If it's a turing class though, didn't you learn how to program it first?

Archived topic from Iceteks, old topic ID:1881, old post ID:15462

Help with Turing!!

Posted: Mon Jan 05, 2004 8:29 pm
by syb
I've had a post about a piant program too. tell me more about your problem. i am not sure i understand it.

Archived topic from Iceteks, old topic ID:1881, old post ID:15464

Help with Turing!!

Posted: Tue Jan 06, 2004 10:06 pm
by Anonymous
umm..i have a canvas made using gui but when i draw lines it goes all over the place so i want to limit the user inside the canvas when drawing.
This is what i have:
import GUI
View.Set ("graphics:700;500,nobuttonbar")
var canvas : int := GUI.CreateCanvas (100, 55, 560, 360)
%The color panel
drawfillbox (8, 55, 72, 85, 114)
drawfillbox (8, 85, 72, 115, 7)
drawfillbox (8, 115, 72, 145, 31)
drawfillbox (8, 145, 72, 175, 8)
drawfillbox (8, 175, 72, 205, 11)
drawfillbox (8, 205, 72, 235, 58)
drawfillbox (8, 235, 72, 265, 60)
drawfillbox (8, 265, 72, 295, 108)
drawfillbox (8, 295, 72, 325, 42)
drawfillbox (8, 325, 72, 355, 48)
drawfillbox (8, 355, 72, 385, 44)
drawfillbox (8, 385, 72, 415, 40)
drawfillbox (8, 415, 72, 445, 33)
Mouse.ButtonChoose ("singlebutton")
var x, y, b, col, thickness, window, window2 : int
window := Window.Open ("position:top;center,graphics:300;200")
put "How thick do you want the line to be?"
get thickness
Window.Close(window)
loop
Mouse.Where (x, y, b)
if x >= 8 and x <= 72 and y >= 55 and y <= 85 and b = 1 then
col := 114
elsif x >= 8 and x <= 72 and y >= 85 and y <= 115 and b = 1 then
col := 7
elsif x >= 8 and x <= 72 and y >= 115 and y <= 145 and b = 1 then
col := 31
elsif x >= 8 and x <= 72 and y >= 145 and y <= 175 and b = 1 then
col := 8
elsif x >= 8 and x <= 72 and y >= 175 and y <= 205 and b = 1 then
col := 11
elsif x >= 8 and x <= 72 and y >= 205 and y <= 235 and b = 1 then
col := 58
elsif x >= 8 and x <= 72 and y >= 235 and y <= 265 and b = 1 then
col := 60
elsif x >= 8 and x <= 72 and y >= 265 and y < 295 and b = 1 then
col := 108
elsif x >= 8 and x <= 72 and y >= 295 and y < 325 and b = 1 then
col := 42
elsif x >= 8 and x <= 72 and y >= 325 and y < 355 and b = 1 then
col := 48
elsif x >= 8 and x <= 72 and y >= 355 and y < 385 and b = 1 then
col := 44
elsif x >= 8 and x <= 72 and y >= 385 and y < 415 and b = 1 then
col := 40
elsif x >= 8 and x <= 72 and y >= 415 and y < 445 and b = 1 then
col := 33
delay (10)
end if
if b = 1 then
drawfilloval (x, y, thickness, thickness, col)
end if
end loop

Archived topic from Iceteks, old topic ID:1881, old post ID:15485