
-----------------------------------
shakin cookie
Fri Jan 04, 2008 5:47 pm

Condensing Trouble
-----------------------------------
Hey guys (and girls),

I was wondering if someone could suggest to me  a way to condense my code.   I still have many choices to go (e.g. paint colour, hub caps), and was wondering if anyone could help.  It would be greatly appreciated.

Thanks.

-----------------------------------
HeavenAgain
Fri Jan 04, 2008 6:17 pm

RE:Condensing Trouble
-----------------------------------
well, you can consider drawing those cars on paint or something, so intead of drawing on turing with so many lines, just pic.draw and ta da :D
other than that... not much to improve o.o

-----------------------------------
shakin cookie
Fri Jan 04, 2008 7:56 pm

RE:Condensing Trouble
-----------------------------------
What exactly is the command to import a picture on paint to turing?

-----------------------------------
HeavenAgain
Fri Jan 04, 2008 8:05 pm

RE:Condensing Trouble
-----------------------------------
      var myCar:int := Pic.FileNew ("car.bmp")
      Pic.Draw (myCar, maxx div 2, maxy div 2, picCopy)
      delay (5000)
      cls
      Pic.Free (myCar)consider something like that?

-----------------------------------
shakin cookie
Fri Jan 04, 2008 8:52 pm

RE:Condensing Trouble
-----------------------------------
alright, ill try that.

So a seperate variable for each picture... I'm guessing that they are not global.

Okay.

-----------------------------------
shakin cookie
Fri Jan 04, 2008 8:59 pm

RE:Condensing Trouble
-----------------------------------
it says that the picture was not successfully created...  suggestions to the problem?

-----------------------------------
Sean
Fri Jan 04, 2008 9:13 pm

Re: Condensing Trouble
-----------------------------------
Either your version of turing does not support the picture, or you mispelled the name of the file.

Make sure to have extensions at end aswell.

Other then that, it could be an illegal interger value, 1000 is max it says sometimes.

-----------------------------------
shakin cookie
Fri Jan 04, 2008 9:47 pm

RE:Condensing Trouble
-----------------------------------
ah...

silly me, i misspelled the file name...

o, and by the way, i have shortened my code by 80 lines as a result of all the helpful pointers.  Thanks Heaven Again!

-----------------------------------
Gooie
Sat Jan 05, 2008 12:41 am

Re: RE:Condensing Trouble
-----------------------------------
ah...

silly me, i misspelled the file name...

o, and by the way, i have shortened my code by 80 lines as a result of all the helpful pointers.  Thanks Heaven Again!

Good Work!  :vi:

-----------------------------------
shakin cookie
Sat Jan 05, 2008 11:11 am

RE:Condensing Trouble
-----------------------------------
There is one issue:

i have three cars -9 models.

my ifs will look like this: if model=1 and colour=3 and hubCap=5 and bumper=2 then
 
is this inevitable?  Will i have to have 108 possibilities?!?  Someone please suggest something!

-----------------------------------
HeavenAgain
Sat Jan 05, 2008 11:18 am

RE:Condensing Trouble
-----------------------------------
well, now is the time to do it like this
draw your differnt modles on paint or w/e
draw your hubCap on paint.... bumpers... etc draw them all seperatly, and then just go like
draw the modle(i)
draw the hubcap(j)
draw the bumper (k).... etcetc then i think turing can drawfill, and your job is done (i am assuming you are using array for your pictures, if that is possibile)

-----------------------------------
Saad
Sat Jan 05, 2008 11:21 am

Re: Condensing Trouble
-----------------------------------
You could look into [url=http://www.compsci.ca/v2/viewtopic.php?t=9636]Records and Types, it would help in making the code better organised. Classes would be a better idea, but it's more advanced/

-----------------------------------
shakin cookie
Sat Jan 05, 2008 11:35 am

RE:Condensing Trouble
-----------------------------------
but the problem is that i have to display the car as each choice is made

Lke this:  Choose the model, show the model.
Choose the colour, show the model with the colour.
Choose the hub caps, show that woth the colour and the model.

-----------------------------------
HeavenAgain
Sat Jan 05, 2008 11:47 am

RE:Condensing Trouble
-----------------------------------
yep, thats what i mean, you draw them separately, and then just put all those separate pieces together to make the new car.
ok for example, you have letters A B C and also a b c
you wish to make a i dunno, word out of it, and so you take 1 letter out of the 2 group, separately! you dont make out all the combination, correct? hope you get what i mean :)

-----------------------------------
shakin cookie
Sat Jan 05, 2008 5:29 pm

RE:Condensing Trouble
-----------------------------------
ok, and thanks for helping me.  im going to donate bits to you.-)

-----------------------------------
shakin cookie
Sat Jan 05, 2008 6:08 pm

RE:Condensing Trouble
-----------------------------------
ok, here is my next problem:

can i have two pictures at the same time?

here is my coding.

var bumper : int
put "enter a bumper type."
put "1. Straight"
put "2. Bumpy"
get bumper

if bumper = 1 then
    var bumper1 : int := Pic.FileNew ("bumper1ISP.bmp")
    var carc10 : int := Pic.FileNew ("hummer4ISP.bmp")
    Pic.Draw (bumper1 and carc10, 10, -50, picCopy)
    Pic.Free (bumper1 and carc10)
end if

it is supposed to draw a hummer and a bumper, but says as an error:

ILLEGAL PICTURE ID NUMBER '7000'.  (7000 IS A LEGAL DIRECTORY STREAM).

what should i do?

-----------------------------------
Nick
Sat Jan 05, 2008 6:24 pm

RE:Condensing Trouble
-----------------------------------
you can't draw two pictures in the same line, instead

Pic.Draw(bumper1,10,-50,picCopy)
Pic.Draw(carc10,10,-50,picCopy

-----------------------------------
shakin cookie
Sat Jan 05, 2008 7:29 pm

RE:Condensing Trouble
-----------------------------------
but then the one overlaps the other...

i would like them to appear at the same time...

-----------------------------------
Nick
Sat Jan 05, 2008 7:31 pm

RE:Condensing Trouble
-----------------------------------
picMerge

-----------------------------------
Clayton
Sat Jan 05, 2008 7:32 pm

RE:Condensing Trouble
-----------------------------------
You can't just magically meld two pictures together either...

-----------------------------------
shakin cookie
Sat Jan 05, 2008 7:52 pm

RE:Condensing Trouble
-----------------------------------
what is the syntax for picMerge?

-----------------------------------
HeavenAgain
Sat Jan 05, 2008 7:55 pm

RE:Condensing Trouble
-----------------------------------
replace picCopy with picMerge

-----------------------------------
shakin cookie
Sat Jan 05, 2008 8:41 pm

RE:Condensing Trouble
-----------------------------------
okey-dokey

-----------------------------------
shakin cookie
Sat Jan 05, 2008 8:42 pm

RE:Condensing Trouble
-----------------------------------
Heaven Again... You...Rule...

+bits for you! (All but one of mine-)
