oEtG Forum

General Category => General Game Discussion => Topic started by: Chapuz on March 25, 2015, 06:13:26 pm

Title: NaNs in the Arena
Post by: Chapuz on March 25, 2015, 06:13:26 pm
Watching "NaN" makes the game see as it has an error. It's disgusting. Can they be replaced by something more elegant?

(http://i.imgur.com/dIT4Cni.jpg)
Title: Re: NaNs in the Arena
Post by: timpa on March 25, 2015, 06:34:04 pm
inactive is what should appear imo.

It's just a matter of making a check for NaN at this point
Title: Re: NaNs in the Arena
Post by: serprex on March 25, 2015, 06:45:44 pm
NaNs are your friend. The existential crisis of a number which is not a number will pass
Title: Re: NaNs in the Arena
Post by: Chapuz on March 25, 2015, 07:42:23 pm
It's bad for the non-programmer world
Title: Re: NaNs in the Arena
Post by: kirbylover314 on March 26, 2015, 05:35:44 am
I'm okay with them
Title: Re: NaNs in the Arena
Post by: timpa on March 26, 2015, 04:17:39 pm
wouldn't
if rank == NaN
{code to print 'inactive' instead of NaN}

do the trick?

A function print_sane(num, str) that takes a numerical value and a default string, checks if num is NaN, prints num as a string if num != NaN and str if num == NaN could be used to treat all instances where a number is to be printed and is expected to be NaN sometimes without it being a bug.
Title: Re: NaNs in the Arena
Post by: serprex on March 26, 2015, 05:08:48 pm
Fun fact: NaN == NaN returns false. You must use isNaN

That said, yes, easy fix. But I disagree it's necessary; NaN let's you know that you have a non numerical rank since you don't have a rank

It isn't super newbie unfriendly; if you've never submitted a deck, you won't be shown NaN
Title: Re: NaNs in the Arena
Post by: timpa on March 26, 2015, 05:39:20 pm
Fun fact: NaN == NaN returns false.

lol
Title: Re: NaNs in the Arena
Post by: cg on March 26, 2015, 05:58:17 pm
But I disagree it's necessary

95% of the potential pbase doesn't know what "NaN" means, so even if it would look good to make people interpret "your rank is non-numerical" as "you have been kicked out of the arena and are inactive", it does not convey "you have a non-numerical rank" - it conveys "here's some random meaningless jumble of upper and lower case letters somewhere where a number should be". It will appear to the average potential player to be a bug, even if it technically isn't.
Title: Re: NaNs in the Arena
Post by: Chapuz on March 27, 2015, 12:29:48 am
^ this
Besides, it looks like SUCH an easy fix!
Title: Re: NaNs in the Arena
Post by: serprex on March 27, 2015, 01:10:26 am
https://github.com/serprex/openEtG/commit/a0d22123be5d228efb5130b8772531e2e2050f6d