Computer Science Canada

i am in highschool, needing help from professionals.please..

Author:  sevendust [ Sun Dec 12, 2004 8:05 pm ]
Post subject:  i am in highschool, needing help from professionals.please..

i have a project in my Computer Programming Class,and i have never taken the class before ever, and i was late when joining it, because i transferred schools, anyways...i have this project that i am struggling with, heres the problem..

i cant figure out how to move the moon and all upwards, and get the chimney correct, and make the roof on the right not have the lines through it, if someone can help me with it, it would be muchly appreciated, or if someone can tutor me online with MSN or something through here. and one more thing, if u can help me simplify some of my commands in my program, that would be helpful also.

thanks

richard (newbe)

Author:  Cervantes [ Sun Dec 12, 2004 8:54 pm ]
Post subject: 

Drawing commands are simple. There is no difficult syntax, no difficult uses.

Know the difference between this:
code:

drawfillbox (100, 100, 400, 400, black)
drawfillbox (150, 150, 350, 350, white)

and this
code:

drawfillbox (150, 150, 350, 350, white)
drawfillbox (100, 100, 400, 400, black)


Though I haven't looked over your code much, I'd guess that's the problem you are having with your line through the roof. May also be the problem with your chimney. You're code is very uncommented though, so it's more difficult to help.
As for simplfying stuff, you could try use variables to store the position of your puffs of cloud, and of your moon. That way, you could make things simpler and also make the objects move more smoothly.

Author:  sevendust [ Sun Dec 12, 2004 9:03 pm ]
Post subject: 

i dont understand what you mean Cervantes, by storing variables...i am not a very bright student, another classmate assisted a few things with me in this project, but nothing i cudnt handle..umm another thing, the things u made , where abouts do i put them?

Author:  sevendust [ Sun Dec 12, 2004 9:05 pm ]
Post subject: 

Cervantes, those drawfillboxes u made for me, cud u put them into the code, because im not sure where to put them, thanks, that wud be helpful

Author:  Cervantes [ Sun Dec 12, 2004 9:07 pm ]
Post subject: 

Well, if by "the things u made", you mean the bits of code I posted, I'm scared.
Take those bits of code and put them in a new Turing program. one bit at a time (that means 2 lines at a time). Notice the difference.
Perhaps we should ignore the bit about storing information as variables for now.

Author:  sevendust [ Sun Dec 12, 2004 9:09 pm ]
Post subject: 

oh ok thank you

Author:  sevendust [ Sun Dec 12, 2004 9:16 pm ]
Post subject: 

thank you cervantes, that little push got me to fix the whole side of my house, now the chimney, and can u help me with the moon?

Author:  Cervantes [ Sun Dec 12, 2004 9:30 pm ]
Post subject: 

I don't know what you are trying to do with your moon. but I made this, using your code, to show you how to move it up, if that's what you wanted Confused
code:

var Y := 350
process mn
    loop
        drawfilloval (x2, Y + 30, 50, 50, 30)
        drawfilloval (x2 - 20, Y + 10, 5, 5, 28)
        drawfilloval (x2 - 11, Y + 30, 5, 5, 26)
        drawfilloval (x2 - 30, Y + 29, 5, 4, 28)
        drawfilloval (x2 - 4, Y, 4, 5, 27)
        drawfilloval (x2 + 26, Y + 40, 5, 2, 29)
        delay (100)
        x2 -= 1
        Y += 1
        drawfilloval (x2 + 1, 380, 50, 50, black)
        exit when x2 = 148
    end loop
end mn
fork mn

note how the moon leave's a gross looking trail behind it. You'll need to fix that up.

Author:  sevendust [ Sun Dec 12, 2004 9:32 pm ]
Post subject: 

thank you very much....how long have you been working with turing?

Author:  sevendust [ Sun Dec 12, 2004 9:39 pm ]
Post subject: 

heres the program once again, run it and can u try to figure out how to move the one version back over to that it covers the trail or the real grey moon please

Author:  sevendust [ Sun Dec 12, 2004 9:47 pm ]
Post subject: 

actually forget about the last attachment, now i cant figure out this one, it wont let the moon dissapear...help me please

Author:  Cervantes [ Sun Dec 12, 2004 9:59 pm ]
Post subject: 

It's hard, because you are using processes. Ordinarily, you'd just cls then redraw everything. But clsing in one process while a delay is going in another process would not be good. Either somewhow find a way to get rid of that streak behind the moon, or put it all in one main loop and use a cls.

Author:  sevendust [ Sun Dec 12, 2004 10:05 pm ]
Post subject: 

what is cls, and how do i use it?

Author:  Neo [ Sun Dec 12, 2004 10:15 pm ]
Post subject: 

cls is used to clear the screen. If you want to clear the moon trail without using cls you have to draw a black circle alittle bigger than the moon, behind the moon.

code:

process mn
    loop
        drawfilloval (x2 + 1, Y + 30, 51, 51, black)
        drawfilloval (x2, Y + 30, 50, 50, 30)
        drawfilloval (x2 - 20, Y + 10, 5, 5, 28)
        drawfilloval (x2 - 11, Y + 30, 5, 5, 26)
        drawfilloval (x2 - 30, Y + 29, 5, 4, 28)
        drawfilloval (x2 - 4, Y, 4, 5, 27)
        drawfilloval (x2 + 26, Y + 40, 5, 2, 29)
        delay (100)
        x2 -= 1
        Y += 1
        exit when x2 = 148
    end loop
end mn
[/quote]

Author:  Cervantes [ Sun Dec 12, 2004 10:19 pm ]
Post subject: 

Mind you, doing that would cause the moon to erase the stars.

Author:  sevendust [ Sun Dec 12, 2004 10:22 pm ]
Post subject: 

is there a way i can make the stars return, in any random order, or placed by myself??

Author:  Neo [ Sun Dec 12, 2004 10:25 pm ]
Post subject: 

Store the coordinates in an array and redraw them.

Author:  Cervantes [ Sun Dec 12, 2004 10:27 pm ]
Post subject: 

An array will work, but it is not the easiest of ways to go.
Trying taking a pic of the star's location at the start of your program (Pic.New I think) then using Pic.Draw in your moon process, before you draw your moon.

Author:  sevendust [ Sun Dec 12, 2004 10:27 pm ]
Post subject: 

how does it redraw them...and the commands you sent me Mr. Cervantes...didnt work on my moon

Author:  Neo [ Sun Dec 12, 2004 10:33 pm ]
Post subject: 

After you draw the house you want to take a picture of the house with Pic.New. Then redraw it in the loop.

Author:  sevendust [ Sun Dec 12, 2004 10:38 pm ]
Post subject: 

THANK YOU VERY MUCH , neo, looks awesome, just as i wanted it to be, thank you...

Author:  apomb [ Mon Dec 13, 2004 11:15 am ]
Post subject: 

um neo ... just to warn you before asiansensation comes along ... giving the whole program like that... not too safe (for yourself)

Author:  sevendust [ Mon Dec 13, 2004 12:31 pm ]
Post subject: 

i was just wondering...why wud it be unsafe for him to send the whole program...all he did was help the last few lines...

Author:  cool dude [ Mon Dec 13, 2004 1:50 pm ]
Post subject: 

because firstly the teacher could see and secondly compsci is a site for help not for code given so u could plagarize.

Author:  sevendust [ Mon Dec 13, 2004 4:54 pm ]
Post subject: 

ahhi c, thanks, ill remember that for future reference, if i am one to give help to others...as if lol
thanks
sevendust*

Author:  cool dude [ Mon Dec 13, 2004 5:50 pm ]
Post subject: 

by the ways forks and processes are very bad to use because its hard to get out of them.

Author:  AsianSensation [ Mon Dec 13, 2004 6:06 pm ]
Post subject: 

CompWiz333 wrote:
um neo ... just to warn you before asiansensation comes along ... giving the whole program like that... not too safe (for yourself)


I kinda had my doubts from the first post, the posts by sevendust seems more "asking for code" than "asking for help"

But I could just be paranoid.

So I'll watch until there is a definite sign of plagiarizing, then I'll do the necessary things.

Author:  sevendust [ Mon Dec 13, 2004 7:28 pm ]
Post subject: 

i need help with another thing on my project, i cant figure out how to make the lines stay for the bricks im making for the wall...heres the code , can anyone HELP me get it to stay and not disappear...the very last part is the bricks i cant get to stay, thanks

code:
setscreen ("graphics:800,650")
drawfill (1, 1, black, red)
var x, y, x2, y2 : int
x2 := 600
y2 := 450
drawfillbox (maxx, 0, 0, 300, green)
for i : 1 .. 200
    randint (x, 0, maxx)
    randint (y, 300, maxy)
    drawdot (x, y, white)
end for
% chimney
drawfillbox (130, 480, 165, 380, 23)
drawline (130, 480, 130, 410, grey)  %left
drawline (155, 480, 155, 439, grey)  %right
drawline (165, 450, 165, 480, grey)  %far right
drawline (165, 480, 160, 495, grey)
% front of house
drawfillbox (120, 400, 320, 211, red)
% lines for roof
drawline (100, 380, 215, 500, grey)  %left
drawline (340, 380, 215, 500, grey)  %right
drawline (120, 400, 320, 400, grey)  %bottom
drawline (420, 440, 300, 550, grey)  %far right
drawline (215, 500, 300, 550, grey)  %top
drawline (340, 380, 420, 440, grey)  %ledge
drawfill (360, 460, 115, grey)
% lines for left and right side of house
drawline (120, 211, 120, 400, grey)  %left
drawline (320, 211, 320, 400, grey)  %right
% line for bottom of house
drawline (120, 210, 320, 210, grey)
% filled in front roof
drawfill (250, 410, 115, grey)
% right side of house
drawline (320, 210, 400, 290, grey)  %bottom
drawline (400, 291, 400, 425, grey)  %right
drawfill (340, 350, red, grey)       %color
% door
drawfillbox (195, 212, 240, 280, brown)
% door border
drawline (195, 280, 195, 212, black)
drawline (240, 280, 240, 212, black)
drawline (195, 212, 240, 212, black)
drawline (195, 280, 240, 280, black)
% door knob
drawfilloval (199, 247, 2, 2, black)
% windows
drawfillbox (140, 320, 180, 360, black)
drawfillbox (250, 320, 290, 360, black)
% left window border
drawline (140, 360, 180, 360, white)
drawline (140, 320, 180, 320, white)
drawline (180, 320, 180, 360, white)
drawline (140, 320, 140, 360, white)
% right window border
drawline (250, 360, 290, 360, white)
drawline (250, 320, 290, 320, white)
drawline (290, 320, 290, 360, white)
drawline (250, 320, 250, 360, white)
% driveway


var house := Pic.New (0, 0, maxx, maxy)

% cloud 1
process cl1

    loop
        drawfilloval (120, 520, 20, 20, 23)
        drawfilloval (130, 530, 15, 15, 22)
        drawfilloval (110, 525, 15, 15, 21)
        delay (500)
        drawfilloval (120, 520, 20, 20, black)
        drawfilloval (130, 530, 15, 15, black)
        drawfilloval (110, 525, 15, 15, black)
        delay (1000)
    end loop
end cl1

% cloud 2
process cl2
    delay (1000)
    loop
        drawfilloval (70, 540, 20, 20, 23)
        drawfilloval (80, 550, 15, 15, 21)
        drawfilloval (55, 555, 15, 15, 22)
        delay (500)
        drawfilloval (70, 540, 20, 20, black)
        drawfilloval (80, 550, 15, 15, black)
        drawfilloval (55, 555, 15, 15, black)
        delay (1000)
    end loop
end cl2

% cloud 3
process cl3
    delay (500)
    loop
        drawfilloval (20, 577, 20, 20, 23)
        drawfilloval (30, 588, 15, 15, 21)
        drawfilloval (5, 585, 15, 15, 22)
        delay (500)
        drawfilloval (20, 577, 20, 20, black)
        drawfilloval (30, 588, 15, 15, black)
        drawfilloval (5, 585, 15, 15, black)
        delay (1000)
    end loop
end cl3

fork cl1
fork cl2
fork cl3


process mn
    setscreen ("offscreenonly")
    loop
        Pic.Draw (house, 0, 0, picCopy)
        drawfilloval (x2, y2 + 30, 50, 50, 30)
        drawfilloval (x2 - 20, y2 + 10, 5, 5, 28)
        drawfilloval (x2 - 11, y2 + 30, 5, 5, 26)
        drawfilloval (x2 - 30, y2 + 29, 5, 4, 28)
        drawfilloval (x2 - 4, y2, 4, 5, 27)
        drawfilloval (x2 + 26, y2 + 40, 5, 2, 29)
        delay (1000)
        x2 -= 1
        y2 += 1
        exit when x2 = 148
        View.Update
    end loop
end mn


fork mn

% bricks
var xx := 320
var yy := 400
var xy, yx : int := 0
loop
    drawline (xx, xy + 215, yy, yx + 295, grey)
    xy += 5
    yx += 5
    exit when xy = 345
    exit when yx = 135
end loop
drawline (xx, 350, 380, 410, grey)
drawline (xx, 355, 360, 395, grey)
drawline (xx, 360, 340, 380, grey)
drawline (xx, 365, 337, 382, grey)
drawline (xx, 370, 334, 384, grey)
drawline (xx, 375, 332, 387, grey)
drawline (xx, 380, 330, 390, grey)
drawline (xx, 385, 327, 392, grey)
drawline (xx, 390, 324, 394, grey)

Author:  Hikaru79 [ Mon Dec 13, 2004 7:47 pm ]
Post subject: 

AsianSensation wrote:
CompWiz333 wrote:
um neo ... just to warn you before asiansensation comes along ... giving the whole program like that... not too safe (for yourself)


I kinda had my doubts from the first post, the posts by sevendust seems more "asking for code" than "asking for help"

But I could just be paranoid.

So I'll watch until there is a definite sign of plagiarizing, then I'll do the necessary things.


Eh? AsianSensation is the local plagiarism Nazi? Surprised What do you do to 'em, AS? Twisted Evil

Author:  Neo [ Mon Dec 13, 2004 7:48 pm ]
Post subject: 

CompWiz333 wrote:
um neo ... just to warn you before asiansensation comes along ... giving the whole program like that... not too safe (for yourself)


Relax, I added 2 lines to his program and did not "give away the whole program". They werent even difficlut code to use, Pic.New and Pic.Draw Confused
No big deal.

Author:  sevendust [ Mon Dec 13, 2004 8:15 pm ]
Post subject: 

yes he did only give me 2 lines....and can anyone help me with my flikering lines for bricks please???...the code is up

Author:  sevendust [ Mon Dec 13, 2004 9:13 pm ]
Post subject: 

can anyone help me with my house....i am making bricks on the side and im trying to use a loop-end loop sequence with a exit when statement...and i cant figure out how to keep the lines there, they disappear...can u help me make them stay...code\/


code:
% bricks
var xx := 320
var yy := 400
var xy, yx : int := 0
loop
    drawline (xx, xy + 215, yy, yx + 295, grey)
    xy += 5
    yx += 5
    exit when xy = 345
    exit when yx = 135
end loop
drawline (xx, 350, 380, 410, grey)
drawline (xx, 355, 360, 395, grey)
drawline (xx, 360, 340, 380, grey)
drawline (xx, 365, 337, 382, grey)
drawline (xx, 370, 334, 384, grey)
drawline (xx, 375, 332, 387, grey)
drawline (xx, 380, 330, 390, grey)
drawline (xx, 385, 327, 392, grey)
drawline (xx, 390, 324, 394, grey)
thanks alot to the person who can help me figure out how to fix this

Author:  apomb [ Tue Dec 14, 2004 12:47 am ]
Post subject: 

neo wrote:
Relax, I added 2 lines to his program and did not "give away the whole program". They werent even difficlut code to use, Pic.New and Pic.Draw
No big deal.


exactly no big deal ... i just warned you and the right authority has stated a clear solution ... end of story

sevendust: continue on with your problem ... by the way, the second set of lines is drawing right over the other ones, try removing that part, i dont have turing on this computer, but i think that might work.

Author:  sevendust [ Tue Dec 14, 2004 8:27 pm ]
Post subject: 

u were wrong, i figured out what the problem was, i moved it upwards, out of a possible loop statement, and that fixed it
thanks anyways


: