Computer Science Canada

I don't know what is wrong with my program can somebody plz help me

Author:  blizzard4800 [ Tue Jan 12, 2010 9:10 pm ]
Post subject:  I don't know what is wrong with my program can somebody plz help me

I don't know what is wrong with my program can somebody plz help me

This is my program


const MARGIN : int := 20

var christmas_place, black_dodge_caravan : int

var christmas_placeWidth, christmas_placeHeight : int

var black_dodge_caravanWidth, black_dodge_caravanHeight : int

var christmas_placeX, christmas_placeY : int

var black_dodge_caravanX, black_dodge_caravanY : int

var keys : array char of boolean

christmas_place := Pic.FileNew ("christmas place.bmp")

black_dodge_caravan := Pic.FileNew ("doge caravan.bmp")

setscreen ("graphics:maxx;maxy,position:middle;centre,nobuttonbar,title:test___thing_1")

locatexy (maxx,maxy)

put " Use the arrow keys to move the background."

delay (2000)

christmas_placeWidth := Pic.Width (christmas_place)

christmas_placeHeight := Pic.Height (christmas_place)

black_dodge_caravanWidth := Pic.Width (black_dodge_caravan)

black_dodge_caravanHeight := Pic.Height (black_dodge_caravan)

christmas_placeX := (christmas_placeWidth - maxx)

christmas_placeY := (christmas_placeHeight - maxy)

black_dodge_caravanX := (christmas_placeWidth - black_dodge_caravanWidth)

black_dodge_caravanY := (christmas_placeHeight - black_dodge_caravanHeight)

setscreen ("offscreenonly")

loop

Input.KeyDown (keys)

if keys (KEY_LEFT_ARROW) then
black_dodge_caravanX -= 1
elsif keys (KEY_RIGHT_ARROW) then
black_dodge_caravanX += 1
end if
if keys (KEY_UP_ARROW) then
black_dodge_caravanY += 1
elsif keys (KEY_DOWN_ARROW) then
black_dodge_caravanY -= 1
end if

if black_dodge_caravanX - MARGIN < 0 then
black_dodge_caravanX := MARGIN
elsif black_dodge_caravanX + black_dodge_caravanWidth > christmas_placeWidth - MARGIN then
black_dodge_caravanX := christmas_placeWidth - MARGIN - black_dodge_caravanWidth
end if

if black_dodge_caravanX - christmas_placeX < MARGIN then
christmas_placeX := black_dodge_caravanX - MARGIN
elsif (black_dodge_caravanX + black_dodge_caravanWidth) - christmas_placeX > maxx - MARGIN then
christmas_placeX := black_dodge_caravanX + black_dodge_caravanWidth - maxx + MARGIN
end if

if black_dodge_caravanY - christmas_placeY < MARGIN then
christmas_placeY := black_dodge_caravanY - MARGIN
elsif (black_dodge_caravanY + black_dodge_caravanHeight) - christmas_placeY > maxy - MARGIN then
christmas_placeY := black_dodge_caravanY + black_dodge_caravanHeight - maxy + MARGIN
end if

cls

Pic.Draw (christmas_place, -christmas_placeX, -christmas_placeY, picCopy)

Pic.Draw (black_dodge_caravan, black_dodge_caravanX - christmas_placeX, black_dodge_caravanY - christmas_placeY, picMerge)
View.Update
end loop

Author:  DemonWasp [ Tue Jan 12, 2010 10:36 pm ]
Post subject:  RE:I don\'t know what is wrong with my program can somebody plz help me

That's a very vague problem statement. What is your program supposed to do that it isn't, or else what is it doing that it isn't supposed to do?

If you want us to be able to run your code, you have to include your pictures as attachments, otherwise we can't run it.

Use the provided template when submitting questions about Turing to get better answers - put your code where it says "code goes here" and actually fill out the questionnaire. This will take you 5 minutes up-front, but save you hours in getting your response later.

Author:  blizzard4800 [ Wed Jan 13, 2010 10:28 am ]
Post subject:  RE:I don\'t know what is wrong with my program can somebody plz help me

ok
i did put the picture's in the same folder but it say's iligeal pic id

Author:  blizzard4800 [ Wed Jan 13, 2010 10:31 am ]
Post subject:  RE:I don\'t know what is wrong with my program can somebody plz help me

my program is sopposed to have a black doge caravan go to different places on the background

Author:  blizzard4800 [ Wed Jan 13, 2010 10:34 am ]
Post subject:  RE:I don\'t know what is wrong with my program can somebody plz help me

thank you for replying to my program

Author:  InFamous [ Wed Jan 13, 2010 10:44 am ]
Post subject:  RE:I don\'t know what is wrong with my program can somebody plz help me

I think thats blizzard4800 is soooo fat

Author:  blizzard4800 [ Wed Jan 13, 2010 10:49 am ]
Post subject:  RE:I don\'t know what is wrong with my program can somebody plz help me

You have a big Fourhead InFoumaous/Ahmed Hashi

Author:  Ktomislav [ Wed Jan 13, 2010 11:27 am ]
Post subject:  Re: I don't know what is wrong with my program can somebody plz help me

Upload your images so we could use it..
And use edit.. Upper right corner of your post.

Author:  blizzard4800 [ Thu Jan 14, 2010 10:28 am ]
Post subject:  RE:I don\'t know what is wrong with my program can somebody plz help me

ok i will

Author:  blizzard4800 [ Thu Jan 14, 2010 10:29 am ]
Post subject:  RE:I don\'t know what is wrong with my program can somebody plz help me

thank you

Author:  blizzard4800 [ Thu Jan 14, 2010 10:38 am ]
Post subject:  Re: I don't know what is wrong with my program can somebody plz help me

This is the entire fille

Author:  Ktomislav [ Thu Jan 14, 2010 11:50 am ]
Post subject:  Re: RE:I don\'t know what is wrong with my program can somebody plz help me

blizzard4800 @ 14.1.2010, 16:28 wrote:
ok i will

So why didn't you?

Author:  qmanjr5 [ Thu Jan 14, 2010 4:08 pm ]
Post subject:  RE:I don\'t know what is wrong with my program can somebody plz help me

roflmfao

Author:  Turing_Gamer [ Thu Jan 14, 2010 6:13 pm ]
Post subject:  Re: I don't know what is wrong with my program can somebody plz help me

Anyone heard of edit???

Author:  blizzard4800 [ Fri Jan 15, 2010 7:42 pm ]
Post subject:  RE:I don\'t know what is wrong with my program can somebody plz help me

no

Author:  blizzard4800 [ Fri Jan 15, 2010 7:42 pm ]
Post subject:  RE:I don\'t know what is wrong with my program can somebody plz help me

it say'a you can't edit something that has aldready been replied to

Author:  blizzard4800 [ Fri Jan 15, 2010 7:43 pm ]
Post subject:  RE:I don\'t know what is wrong with my program can somebody plz help me

but thank you

Author:  Turing_Gamer [ Sun Jan 17, 2010 3:14 pm ]
Post subject:  Re: I don't know what is wrong with my program can somebody plz help me

You could have edited those last 2 messages with the magic button here ----------------------------------------------------------------------------------------------------------^

Author:  mirhagk [ Mon Jan 18, 2010 10:34 am ]
Post subject:  RE:I don\'t know what is wrong with my program can somebody plz help me

you can edit something that hasnt been replied to. So that instead of triple posting you just click edit on your latest post and add the w/e in there. Don't triple post, just edit it.

Author:  ProgrammingFun [ Thu Jan 28, 2010 10:36 pm ]
Post subject:  RE:I don\'t know what is wrong with my program can somebody plz help me

and when posting your code, you can use the syntax tags i.e. "[ syntax="Turing"] Your code [/syntax]" without the outer quotes so it would look like:
Turing:

This is my code

Author:  Turing_Gamer [ Sat Jan 30, 2010 9:49 pm ]
Post subject:  Re: I don't know what is wrong with my program can somebody plz help me

BTW, sometimes when it says invalid picID, it means that the picture wasn't processed correctly.

Meaning that the picture has to be redone...

Unless I'm wrong


: