Hacker News new | ask | show | jobs
by Amorymeltzer 2434 days ago
I've got a simple blackjack program[1] in bash that I occasionally play; it's ugly code, but it's pretty straightforward.

More directly, I wrote (perl) a blackjack tester[2] to quiz myself, as well as a simple output of basic strategy[3]. I haven't touched these in half a decade, but seem to work fine!

1: https://github.com/Amorymeltzer/dotfiles/blob/master/bin/bla...

2: https://github.com/Amorymeltzer/sandbox/blob/master/blackjac...

3: https://github.com/Amorymeltzer/sandbox/blob/master/basic_st... but I recommend running it as perl basic_strategy.pl | awk '{printf "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n", $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11;}'` for nicer output

1 comments

  perl basic_strategy.pl | column -t
Indeed, but the broader spacing from awk is easier on the eyes