English subtitles

← 01-40 Ace Low Straight Solution

Get Embed Code
1 Language

Showing Revision 1 created 04/23/2012 by Amara Bot.

  1. Well, here's what I came up with.
  2. Instead of returning the ranks directly,
  3. what I want to do is say under 1 condition,
  4. if the ranks is equal to this ace-high or ace-low straight, rather,
  5. then I want to fix it.
  6. Otherwise I want to leave it the same.
  7. If the ranks is equal to this ace low--and we'll fill in that later--
  8. if that's the case, then what I want to return
  9. is a fix, which is 5, 4, 3, 2, 1.
  10. This is the only time when I'm returning a 1 as a value.
  11. Up here we had 2 and above.
  12. There was no 1 that you could return.
  13. But now an ace, instead of being 14,
  14. we're going to count the ace as a 1,
  15. and we're going to do that only in the case
  16. when the ranks that we had so far was an ace, 2, 3, 4, 5,
  17. which according to the sorting would have come out as 14,
  18. 5, 4, 3, 2.
  19. And I got the syntax backwards here when I did the insertion,
  20. so what I want to say is return 5, 4, 3, 2, 1,
  21. which would be the correct ordering for where we want to put an ace
  22. if we had ace, 2, 3, 4, 5, as our hand.
  23. And for any other hand, just return the ranks as is.
  24. And my claim is that this will make everything work because
  25. now we've taken this one hand that was problematic,
  26. and we corrected it by making an ace be a 1 instead of a 14,
  27. and now all the other comparisons of ranks will work out properly.
  28. This will, in fact, be a straight because 5 - 1 is 4, and there's 5 different cards.
  29. And the high value in here will, in fact, be a 5 and not the ace.