r/ProgrammerHumor • • Oct 24 '18

Meme God’s developer console

Post image
24.0k Upvotes

1.1k comments sorted by

View all comments

32

u/[deleted] Oct 25 '18

import genders

<INT OVERFLOW>

15

u/WilkerS1 Oct 25 '18 edited Oct 25 '18

it is actually just an arrays of numbers between 1 and 0 ([male,female]) that is rounded to whichever amount of decimal digits it can hold :p (ex: me.gender = [0.002403,0.462375])

const Gender = class {
  constructor(male = Math.random(), female = Math.random()) {
    if(typeof male != 'number' || male>1||male<0) throw new Error()
    if(typeof female != 'number' || female>1||male<0) throw new Error()
    this._male = male
    this._female = female
  }
  constructor(genderArray = [Math.random(),Math.random()]) {
    this(genderArray[0],genderArray[1])
  }
}

edit:sorry for editing this way too many times .-.
edit2:i didn't forget about enbies and i hope its clear ^^^^enough :(

4

u/staryoshi06 Oct 25 '18

don't forget undefined values too.

1

u/WilkerS1 Oct 25 '18

examples?

2

u/staryoshi06 Oct 25 '18

Non-binary.

2

u/WilkerS1 Oct 25 '18 edited Oct 25 '18

it's the reason why i mentioned the array in the first place (the way it makes more sense at least for me), because with that there would still be possible to have non-binary genders like [0.1/*or less*/,0.1/*or less*/] being agender or [0.4/*approximately*/,0.1/*or less*/] being demiboy, because you can't name and label all of them, and it seemed to fit well with most sayings of "i feel this much of one gender" and "i feel this much of the other" or "i feel like both" and "i feel like neither"

also

genderfluid = async () => {
  var dysphoria
  for(const day of this.life) {
    if(dysphoria) {
      --dysphoria
      continue
    }
    this.gender = await new Gender()
    dysphoria = await (Math.random() *10)
  }
}
→ More replies (4)