[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 3 KB, 526x165, aliens.png [View same] [iqdb] [saucenao] [google]
5769136 No.5769136[DELETED]  [Reply] [Original]

Am I able to extend if statements over multiple lines like I can strings (pic related) in Java? I'm using Netbeans, I don't know if that matters. What I mean though is the syntax, my actual code has nothing to do with it.

>> No.5769142

Why don't you try it and see what happens?

>> No.5769147

>>5769142
Because the block of code it's in is causing a huge problem and I can't try it.

I'm recreating Space Invaders for my programming class, and what the block of code this nested if is in is doing is making the aliens travel straight off the screen forever, so I don't have the chance to shoot them. When I fix it I'll test it, but I'm just looking for an answer right now.

>> No.5769168
File: 210 KB, 1024x768, 1364158782401.jpg [View same] [iqdb] [saucenao] [google]
5769168

>>5769136
Why the fuck do you think any Jshit programming has anything to do with /sci/?

Enjoy your ban

>> No.5769244

>>5769168
>/sci/
>Science and Math
>computer science
>programming is considered a math elective in most, if not all, schools

Where am I wrong?

>> No.5769283

>>5769244
>>programming is considered a math elective in most, if not all, schools
HAHAHAHAHAHAHAHA no.

Just look at the top of /sci/, do you see a link to >>>/prog/ like there is on >>>/g/? If you're not coding in C++/Matlab/Mathematica/FORTRAN/Scheme/Python then you don't belong here.

>> No.5769291
File: 56 KB, 250x245, 1343095258516.png [View same] [iqdb] [saucenao] [google]
5769291

>>5769283
In all honesty, it was just a question. A simple yes or no answer would have been sufficient.

Also, excuse me for not being a whiz on the text boards.

>> No.5769299

>>5769291
Just try it with something else that won't make it break..

>> No.5769318

OP, you won't get help on any questions like this on /sci/. This is more of a /g/ question. It's also the reason that they have [code][code][/code] tags while we have <span class="math"><span class="math">[/spoiler] tags.[/spoiler]

>> No.5769322

>>5769318
Fuck I fucked that up. They have "code" tags, we have "math" tags.

Also programming is nowhere near math. It's simply not useful to us 99% of the time.

>> No.5769335 [DELETED] 

>>5769136
try removing that silly + sign.

>> No.5769337

>>5769136
try removing that silly + sign

>> No.5769380

>>5769136
Are you somehow incapable of just trying it with a toy example?

>> No.5769395

>>5769337
Unary + shouldn't cause any problems. Unnecessary, but it should compile.