I'm trying to check whether a variable i'm using is even or odd using galaxy editor. I'm assuming I need to write up a custom equation, unless there's something in the editor I'm missing. Anyone have any ideas?
update: i was still having trouble after xenrathe's post so i msged him. i had been using it as a custom script, but as he pointed out, it's built into the editor under math so I didn't need to write it myself.
here's the msg for future reference in case any noob like me needs it in the future
"xenrathe
9 hours ago
As a custom script?
Sorry I should have been more clear, the Modulo function is already included in the editor
Set variable - Remainder = your_integer Modulo 2
"
@ErrorAsh
Yeah I know what it does, but I just learned about it. I needed to figure out how to figure out if a number was even or odd so I searched Google for said equation and briefly encountered it, but for some silly reason I didn't think Galaxy had it so I ignored it and looked for some other equation. Haha, welll yeah evidently I'm a noob a programmer, but I'm working on changing that!
I'm trying to check whether a variable i'm using is even or odd using galaxy editor. I'm assuming I need to write up a custom equation, unless there's something in the editor I'm missing. Anyone have any ideas?
@Daimon7: Go
If integer mod 2 = 0
integer = even
else
integer = odd
@xenrathe: Go
ah great, i didn't know about the mod command. thank you, sir
Do you understand what it does? Cause it can be handy sometimes and is a rather basic thing that a programmer should know :)
update: i was still having trouble after xenrathe's post so i msged him. i had been using it as a custom script, but as he pointed out, it's built into the editor under math so I didn't need to write it myself. here's the msg for future reference in case any noob like me needs it in the future
"xenrathe 9 hours ago As a custom script? Sorry I should have been more clear, the Modulo function is already included in the editor Set variable - Remainder = your_integer Modulo 2 "
@ErrorAsh Yeah I know what it does, but I just learned about it. I needed to figure out how to figure out if a number was even or odd so I searched Google for said equation and briefly encountered it, but for some silly reason I didn't think Galaxy had it so I ignored it and looked for some other equation. Haha, welll yeah evidently I'm a noob a programmer, but I'm working on changing that!