Random Character Generator in Bash
- pmjdebruijn
- Posts: 13
- Joined: Wed Feb 15, 2012 2:58 pm
- Location: Netherlands
- Contact:
Random Character Generator in Bash
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
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
Re: Random Character Generator in Bash
UNIX?........So many memories come to mind. It also brings up Ubuntu which brings up so many nightmares.
- pmjdebruijn
- Posts: 13
- Joined: Wed Feb 15, 2012 2:58 pm
- Location: Netherlands
- Contact:
Re: Random Character Generator in Bash
I'm not really trying to open a can of "what OS is best" here... So please don't flamebait...wynteriii wrote:UNIX?........So many memories come to mind. It also brings up Ubuntu which brings up so many nightmares.
Re: Random Character Generator in Bash
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
The Dragonclaw Barony
Re: Random Character Generator in Bash
I'm not a ner.....well... that's beside the point.
- Solomoriah
- Site Admin
- Posts: 8834
- Joined: Thu Nov 13, 2008 8:15 pm
- Location: LaBelle, Missouri
- Contact:
Re: Random Character Generator in Bash
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
Re: Random Character Generator in Bash
NERD!!!!!!! Oh wait.. My tablet is also running Cyanogen 7..
BTW I cannot say enough good things about the Dice Bag app..
BTW I cannot say enough good things about the Dice Bag app..
Check out my BFRPG Campaign Setting
The Dragonclaw Barony
The Dragonclaw Barony
-
Sir Bedivere
- Posts: 998
- Joined: Thu May 27, 2010 10:46 pm
Re: Random Character Generator in Bash
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.
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.
Re: Random Character Generator in Bash
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.
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
Find Me:
https://mewe.com/i/robertsmoot
See my shirt designs:
https://www.teepublic.com/user/smoot-life
Re: Random Character Generator in Bash
You should know we nerds can't help ourselves when it comes to tech.pmjdebruijn wrote:I'm not really trying to open a can of "what OS is best" here... So please don't flamebait...wynteriii wrote:UNIX?........So many memories come to mind. It also brings up Ubuntu which brings up so many nightmares.
Who is online
Users browsing this forum: No registered users and 14 guests
