oEtG Forum

NaNs in the Arena

Chapuz · 11 · 8499

Chapuz

  • Member
  • **
    • Posts: 506
Watching "NaN" makes the game see as it has an error. It's disgusting. Can they be replaced by something more elegant?



timpa

  • Member
  • **
    • Posts: 462
  • New to Elements
inactive is what should appear imo.

It's just a matter of making a check for NaN at this point
:chroma :gravity :time


serprex

  • Global Moderator
  • *****
    • Posts: 1543
NaNs are your friend. The existential crisis of a number which is not a number will pass


Chapuz

  • Member
  • **
    • Posts: 506

kirbylover314

  • The Meta of Christmas Past
  • Member
  • **
    • Posts: 381

timpa

  • Member
  • **
    • Posts: 462
  • New to Elements
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.
:chroma :gravity :time


serprex

  • Global Moderator
  • *****
    • Posts: 1543
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



cg

  • Heckler
  • Member
  • **
    • Posts: 406
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.
« Last Edit: March 26, 2015, 06:05:43 pm by cg »


Chapuz

  • Member
  • **
    • Posts: 506
^ this
Besides, it looks like SUCH an easy fix!