Random Character Generator in Bash

General topics, including off-topic discussion, goes here.
User avatar
pmjdebruijn
Posts: 13
Joined: Wed Feb 15, 2012 2:58 pm
Location: Netherlands
Contact:

Random Character Generator in Bash

Post Mon Feb 20, 2012 12:38 pm

I wrote a simple (incomplete) random character generator for BFRPG in Bash (as in UNIX Shell). I'm quite aware this isn't the most ideal way to do it, but it enabled me to do it quickly.

You can download it here:
http://files.pcode.nl/basicfantasy/bfrpggen/bfrpggen.sh
It should work fine on any modern UNIX machine, with Bash 4 and later. Windows users would need Cygwin or something like that.

However, I do have a set of 512 sample generated characters here (as plaintext files):
http://files.pcode.nl/basicfantasy/bfrpggen/samples/

The character generator has some heuristics to avoid boring/uninteresting characters to an extent:
1. It avoids same value characteristics.
2. All characteristics should total between 54 and 72 (all 3's or all 4's), to avoid too weak or powerful characters.
3. Single hit point character are avoided (D4 is at least 2 HP, D6 is at least 3 HP, D8 is at least 4 HP).
4. These heuristics can sometimes lockup the script (endless re-roll loop), fairly easily solved, but I've been too lazy.

The distribution of generated characters is fairly nice (from a set of 512):

HUMAN 130
DWARF 147
ELF 108
HALFLING 126

FIGHTER 141
CLERIC 134
MAGICUSER 77
THIEF 159
wynteriii
Posts: 96
Joined: Fri Feb 10, 2012 11:54 am

Re: Random Character Generator in Bash

Post Mon Feb 20, 2012 1:27 pm

UNIX?........So many memories come to mind. It also brings up Ubuntu which brings up so many nightmares.
User avatar
pmjdebruijn
Posts: 13
Joined: Wed Feb 15, 2012 2:58 pm
Location: Netherlands
Contact:

Re: Random Character Generator in Bash

Post Mon Feb 20, 2012 2:37 pm

wynteriii wrote:UNIX?........So many memories come to mind. It also brings up Ubuntu which brings up so many nightmares.
I'm not really trying to open a can of "what OS is best" here... So please don't flamebait...
User avatar
dymondy2k
Posts: 1578
Joined: Wed Jun 29, 2011 12:56 am

Re: Random Character Generator in Bash

Post Mon Feb 20, 2012 2:53 pm

I haven't used BASH since my college C class. Sounds like a cool little tool though. and I don't think he was trolling, I bet most of us nerds have had a love/hate relationship with Unix/Linux at some point.
Check out my BFRPG Campaign Setting
The Dragonclaw Barony
wynteriii
Posts: 96
Joined: Fri Feb 10, 2012 11:54 am

Re: Random Character Generator in Bash

Post Mon Feb 20, 2012 3:53 pm

I'm not a ner.....well... that's beside the point.
User avatar
Solomoriah
Site Admin
Posts: 8834
Joined: Thu Nov 13, 2008 8:15 pm
Location: LaBelle, Missouri
Contact:

Re: Random Character Generator in Bash

Post Mon Feb 20, 2012 11:48 pm

Well, I am a nerd. I'm posting this from my tablet, which I reloaded with CyanogenMod7 because the stock OS sucked. While I can see the attraction of bash, I do my own development in Python. (2.x because I hate 3.x... see, a real nerd).
My personal site: www.gonnerman.org
User avatar
dymondy2k
Posts: 1578
Joined: Wed Jun 29, 2011 12:56 am

Re: Random Character Generator in Bash

Post Tue Feb 21, 2012 1:06 am

NERD!!!!!!! Oh wait.. My tablet is also running Cyanogen 7..

BTW I cannot say enough good things about the Dice Bag app..
Check out my BFRPG Campaign Setting
The Dragonclaw Barony
Sir Bedivere
Posts: 998
Joined: Thu May 27, 2010 10:46 pm

Re: Random Character Generator in Bash

Post Tue Feb 21, 2012 8:35 pm

Hey, I like Ubuntu. After Mandrake was transmogrified into Mandriva, I switched over and thoroughly enjoyed it as my sole OS until my laptop screen broke. (Through no fault of the OS, I might add; the hinge that held it to the body broke, so the screen wouldn't stand up.)

EDIT: Oh yeah, since I'm commenting on an OS, I should include the legal fine print: The author's own enjoyment of above-mentioned OS does not imply, and neither should one infer from it, that it is the World's Best OS(TM), or even that it will work on your machine, with your peripherals, or your personality, much less that you will like it. The author disavows any intention to begin, stoke the embers of, continue, resume, end, or in any other way participate in an OS-related flame war, or any other kind of flame war, either here or at any site that may be linked from the original post or that may link into the original post, or any subsidiary posts, either now or in the future. Unless it is about Elves.
User avatar
SmootRK
Posts: 3881
Joined: Sun Mar 08, 2009 10:03 am
Location: Colorado Springs, CO
Contact:

Re: Random Character Generator in Bash

Post Tue Feb 21, 2012 9:58 pm

I like ubuntu as well. Occasionally I convince someone who has never used anything but windows to try it (and unless they are gamers) they usually like it too- especially the price.

I find it especially useful for making older gear useful again.
Is it really the end, not some crazy dream?

Find Me:
https://mewe.com/i/robertsmoot
See my shirt designs:
https://www.teepublic.com/user/smoot-life
wynteriii
Posts: 96
Joined: Fri Feb 10, 2012 11:54 am

Re: Random Character Generator in Bash

Post Wed Feb 22, 2012 12:30 pm

pmjdebruijn wrote:
wynteriii wrote:UNIX?........So many memories come to mind. It also brings up Ubuntu which brings up so many nightmares.
I'm not really trying to open a can of "what OS is best" here... So please don't flamebait...
You should know we nerds can't help ourselves when it comes to tech.
Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests