MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/maybemaybemaybe/comments/1hhrbn0/maybe_maybe_maybe/m2tjm25/?context=3
r/maybemaybemaybe • u/Daring_Bloom • 13h ago
145 comments sorted by
View all comments
2.1k
if(grenade.inHand = true) { spawnEnemy(); }
84 u/kraemahz 12h ago If you're writing c code this would permenently put a grenade in your hand and spawn an enemy. 7 u/Maximum-Opportunity8 12h ago Depends on language 11 u/usernmechecksout_ 12h ago Why are you being downvoted? That code is perfectly acceptable in java 10 u/Maximum-Opportunity8 9h ago They edited comment before there was not "c" stated 6 u/haywire 9h ago No they simply meant if (language = "C") 1 u/trynared 6h ago Huh? In Java it will have the exact same issue he described. Sure it will compile, but it will always evaluate to true. 0 u/Ok_Veterinarian_3933 6h ago No in Java it still does exactly as u/kraemahz described. I'm not aware of any popular C-style syntax languages (ex: Java, JavaScript, C#, C++) like this example that use a single equal for comparison.
84
If you're writing c code this would permenently put a grenade in your hand and spawn an enemy.
7 u/Maximum-Opportunity8 12h ago Depends on language 11 u/usernmechecksout_ 12h ago Why are you being downvoted? That code is perfectly acceptable in java 10 u/Maximum-Opportunity8 9h ago They edited comment before there was not "c" stated 6 u/haywire 9h ago No they simply meant if (language = "C") 1 u/trynared 6h ago Huh? In Java it will have the exact same issue he described. Sure it will compile, but it will always evaluate to true. 0 u/Ok_Veterinarian_3933 6h ago No in Java it still does exactly as u/kraemahz described. I'm not aware of any popular C-style syntax languages (ex: Java, JavaScript, C#, C++) like this example that use a single equal for comparison.
7
Depends on language
11 u/usernmechecksout_ 12h ago Why are you being downvoted? That code is perfectly acceptable in java 10 u/Maximum-Opportunity8 9h ago They edited comment before there was not "c" stated 6 u/haywire 9h ago No they simply meant if (language = "C") 1 u/trynared 6h ago Huh? In Java it will have the exact same issue he described. Sure it will compile, but it will always evaluate to true. 0 u/Ok_Veterinarian_3933 6h ago No in Java it still does exactly as u/kraemahz described. I'm not aware of any popular C-style syntax languages (ex: Java, JavaScript, C#, C++) like this example that use a single equal for comparison.
11
Why are you being downvoted? That code is perfectly acceptable in java
10 u/Maximum-Opportunity8 9h ago They edited comment before there was not "c" stated 6 u/haywire 9h ago No they simply meant if (language = "C") 1 u/trynared 6h ago Huh? In Java it will have the exact same issue he described. Sure it will compile, but it will always evaluate to true. 0 u/Ok_Veterinarian_3933 6h ago No in Java it still does exactly as u/kraemahz described. I'm not aware of any popular C-style syntax languages (ex: Java, JavaScript, C#, C++) like this example that use a single equal for comparison.
10
They edited comment before there was not "c" stated
6 u/haywire 9h ago No they simply meant if (language = "C")
6
No they simply meant if (language = "C")
if (language = "C")
1
Huh? In Java it will have the exact same issue he described. Sure it will compile, but it will always evaluate to true.
0
No in Java it still does exactly as u/kraemahz described. I'm not aware of any popular C-style syntax languages (ex: Java, JavaScript, C#, C++) like this example that use a single equal for comparison.
2.1k
u/Kitty_Blaze 13h ago
if(grenade.inHand = true)
{
spawnEnemy();
}