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.
Archived topic from Iceteks, old topic ID:1881, old post ID:15459
Help with Turing!!
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
Help with Turing!!
unfortunatly I can't help you with turing (I thought I posted a reply like an hour ago ) 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
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
Honk if you love Jesus, text if you want to meet Him!
Help with Turing!!
Unfortunately my class is restricted to Turing....
Archived topic from Iceteks, old topic ID:1881, old post ID:15461
Archived topic from Iceteks, old topic ID:1881, old post ID:15461
- Red Squirrel
- Posts: 29209
- Joined: Wed Dec 18, 2002 12:14 am
- Location: Northern Ontario
- Contact:
Help with Turing!!
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
Archived topic from Iceteks, old topic ID:1881, old post ID:15462
Honk if you love Jesus, text if you want to meet Him!
Help with Turing!!
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
Archived topic from Iceteks, old topic ID:1881, old post ID:15464
The wisdom of sight comes from the father of lights
Help with Turing!!
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
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