jason christoper hartley

September 21, 2012

Gender Ternary Math

Filed under: Uncategorized — Jason Christopher Hartley @ 10:56 pm
There are two buttons:
  • Female
  • Male
There are three states:
  • FEMALE
  • MALE
  • ID_RATHER_NOT_SAY

A selected button becomes unselected when pressed again.

Let:
  • ID_RATHER_NOT_SAY = 0
  • MALE = 1
  • FEMALE = 2
  • A = current gender
  • B = button pressed
Then:
    gender = Math.abs(A - B) + (A % B);
    
    

One Response to “Gender Ternary Math”

  1. Celeste Says:

    :-) Hi! Back in 2003 when I deployed to Iraq I found your blog. I was writing one, and I thought, ‘there must be someone out there doing the same.” It was your blog that helped me see things, or continue to feel the same way I was feeling.” I returned back to teaching, but I continued to look for you. Nothing. I was hoping that you were making yourself famous. I hope you are fine…after two more deployments, now I feel that I need to write. I have three novels in my head. I need the time. I need to stop being interrupted by people who want to get a piece of me…I should stop being selfish and should write. I hope you are writing. -Celeste

Leave a Reply