2020-04-23 14:28:18

Hi guys,
So I've been using some code in my games for awhile, that goes something like this. Is there a name for it? Example below.
int cheeseburgers=random(1,10);
void main()
{
speak("You have "+(cheeseburgers>=1?"plenty of cheeseburgers to eat":"to go buy more cheeseburgers! You're running low!");
Any help would be appreciated.

-----
YouTube
GitHub
Discord: @tunmi13#1880

2020-04-23 14:44:48

That's called the ternary operator.

2020-04-23 15:03:02

Thanks!

-----
YouTube
GitHub
Discord: @tunmi13#1880

2020-04-23 16:26:15

That is called the ternarie (sorry can't spell) opperator