View Single Post
Old 12-05-2012, 11:12 PM   PM User | #8
triko
New Coder

 
Join Date: Oct 2012
Location: Italy
Posts: 72
Thanks: 3
Thanked 0 Times in 0 Posts
triko is an unknown quantity at this point
Quote:
Originally Posted by Old Pedant View Post
And we *GAVE* you the RIGHT ANSWER!!!

Code:
if ( col1.indexOf( ball ) >= 0 ) 
{
    // ball is in col1
} else if ( col2.indexOf( ball ) >= 0 ) {
    // ball is in col2
} else if ( col3.indexOf( ball ) >= 0 ) {
    // ball is in col3
} else ... other tests ...
The zero now, doesn't more important! ( So thanks for advice)
ok, but I have 60 splits xD, my teacher tell me, if the code have more and more string of the same code, you have a best solution!!!
Because write 60 split, it's hard!!!
isn't possible use one array that content all 60 split, and before start an FOR CYCLE for verify that into my array have the number???
I think every night about how to do!!!
triko is offline   Reply With Quote