Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Condensing Trouble
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
shakin cookie




PostPosted: Fri Jan 04, 2008 5:47 pm   Post subject: 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.



AkivaReikenISP.t
 Description:

Download
 Filename:  AkivaReikenISP.t
 Filesize:  7.85 KB
 Downloaded:  70 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
HeavenAgain




PostPosted: Fri Jan 04, 2008 6:17 pm   Post subject: 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 Very Happy
other than that... not much to improve o.o
shakin cookie




PostPosted: Fri Jan 04, 2008 7:56 pm   Post subject: RE:Condensing Trouble

What exactly is the command to import a picture on paint to turing?
HeavenAgain




PostPosted: Fri Jan 04, 2008 8:05 pm   Post subject: RE:Condensing Trouble

code:
      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




PostPosted: Fri Jan 04, 2008 8:52 pm   Post subject: 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




PostPosted: Fri Jan 04, 2008 8:59 pm   Post subject: RE:Condensing Trouble

it says that the picture was not successfully created... suggestions to the problem?
Sean




PostPosted: Fri Jan 04, 2008 9:13 pm   Post subject: 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




PostPosted: Fri Jan 04, 2008 9:47 pm   Post subject: 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!
Sponsor
Sponsor
Sponsor
sponsor
Gooie




PostPosted: Sat Jan 05, 2008 12:41 am   Post subject: Re: RE:Condensing Trouble

shakin cookie @ January 4th, 9:47 pm wrote:
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! BooHoo
shakin cookie




PostPosted: Sat Jan 05, 2008 11:11 am   Post subject: 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




PostPosted: Sat Jan 05, 2008 11:18 am   Post subject: 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




PostPosted: Sat Jan 05, 2008 11:21 am   Post subject: Re: Condensing Trouble

You could look into 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




PostPosted: Sat Jan 05, 2008 11:35 am   Post subject: 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




PostPosted: Sat Jan 05, 2008 11:47 am   Post subject: 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 Smile
shakin cookie




PostPosted: Sat Jan 05, 2008 5:29 pm   Post subject: RE:Condensing Trouble

ok, and thanks for helping me. im going to donate bits to you.-)
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 24 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: