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

Username:   Password: 
 RegisterRegister   
 Need help with "shooting a projectile" and a "password menu"
Index -> Programming, Turing -> Turing Help
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Raknarg




PostPosted: Thu Jan 12, 2012 8:54 pm   Post subject: RE:Need help with "shooting a projectile" and a "password menu"

That wasnt the point. The point was that you're missing the subtlety of programming, where small differences, although they appear to be similar, are't exactly the same.

Can be confused with trolling.
Sponsor
Sponsor
Sponsor
sponsor
Aange10




PostPosted: Thu Jan 12, 2012 9:35 pm   Post subject: RE:Need help with "shooting a projectile" and a "password menu"

Turing:

var list : array 1 .. 10 of int := init(1,2,3,4,5,6,7,8,9,10)

list(Rand.Int(1,10)) := list(Rand.Int(1,10)) + 1
% vs
list(Rand.Int(1,10)) += 1


Is very interesting, but is that really a subtly in the increment operand, or common sense?

+= would definitely be superior in this situation, in my opinion. But as writing code myself, if I saw this problem, I would simply store (Rand.Int (1,10)) into a temp variable.
Raknarg




PostPosted: Thu Jan 12, 2012 9:53 pm   Post subject: RE:Need help with "shooting a projectile" and a "password menu"

In a lot of cases it wont make a difference, anyways.
evildaddy911




PostPosted: Fri Jan 13, 2012 4:36 pm   Post subject: RE:Need help with "shooting a projectile" and a "password menu"

its simply quicker to type
mirhagk




PostPosted: Fri Jan 13, 2012 6:03 pm   Post subject: RE:Need help with "shooting a projectile" and a "password menu"

and as Tony pointed out, technically could be slightly faster (although probably not if there is a good compiler *cough* not turing *cough*)
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 2 of 2  [ 20 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: