Computer Science Canada A very crude Blackjack. |
Author: | Mackie [ Sun Apr 06, 2008 9:49 pm ] | ||
Post subject: | A very crude Blackjack. | ||
Here is a very crude blackjack, I'm just trying to learn ruby, so I thought it would be a fun project to try out. It's pretty crude, I'm actually making a really cool deck class for super-accurate shuffling, and probability. I'd love feed back/things I did wrong. Trying to get out of the Turing mindset proves difficult.
|
Author: | wtd [ Mon Apr 07, 2008 12:42 am ] | ||||
Post subject: | RE:A very crude Blackjack. | ||||
|
Author: | wtd [ Mon Apr 07, 2008 11:03 am ] | ||
Post subject: | RE:A very crude Blackjack. | ||
Try making use of regular expressions instead of include? |
Author: | Mackie [ Mon Apr 07, 2008 1:16 pm ] | ||||||
Post subject: | Re: RE:A very crude Blackjack. | ||||||
wtd @ Mon Apr 07, 2008 12:42 am wrote:
Thanks wtd, I changed it, I just don't know if there is any advantage to the change. Is it just common practice to do it your way? wtd @ Mon Apr 07, 2008 11:03 am wrote:
Try making use of regular expressions instead of include? I had a feeling someone was going to mention that. I wasn't sure why regular expressions weren't working until later on, when i realized it added the eol character. |
Author: | wtd [ Mon Apr 07, 2008 2:09 pm ] | ||||
Post subject: | Re: RE:A very crude Blackjack. | ||||
Mackie @ Tue Apr 08, 2008 2:16 am wrote: wtd @ Mon Apr 07, 2008 12:42 am wrote:
Thanks wtd, I changed it, I just don't know if there is any advantage to the change. Is it just common practice to do it your way? Which is more self-documenting? |
Author: | ambok [ Tue Nov 16, 2010 7:48 am ] |
Post subject: | Re: A very crude Blackjack. |
if turnChoice.include?("1") : playerCards += [rand(10)] if total(playerCards) > 21 : playAgain = "2" end elsif turnChoice.include?("2") : playAgain = "2" end |
Author: | Insectoid [ Tue Nov 16, 2010 10:31 am ] |
Post subject: | RE:A very crude Blackjack. |
Check your date stamps bro. |