Menu
News
All News
Dungeons & Dragons
Level Up: Advanced 5th Edition
Pathfinder
Starfinder
Warhammer
2d20 System
Year Zero Engine
Industry News
Reviews
Dragon Reflections
White Dwarf Reflections
Columns
Weekly Digests
Weekly News Digest
Freebies, Sales & Bundles
RPG Print News
RPG Crowdfunding News
Game Content
ENterplanetary DimENsions
Mythological Figures
Opinion
Worlds of Design
Peregrine's Nest
RPG Evolution
Other Columns
From the Freelancing Frontline
Monster ENcyclopedia
WotC/TSR Alumni Look Back
4 Hours w/RSD (Ryan Dancey)
The Road to 3E (Jonathan Tweet)
Greenwood's Realms (Ed Greenwood)
Drawmij's TSR (Jim Ward)
Community
Forums & Topics
Forum List
Latest Posts
Forum list
*Dungeons & Dragons
Level Up: Advanced 5th Edition
D&D Older Editions, OSR, & D&D Variants
*TTRPGs General
*Pathfinder & Starfinder
EN Publishing
*Geek Talk & Media
Search forums
Chat/Discord
Resources
Wiki
Pages
Latest activity
Media
New media
New comments
Search media
Downloads
Latest reviews
Search resources
EN Publishing
Store
EN5ider
Adventures in ZEITGEIST
Awfully Cheerful Engine
What's OLD is NEW
Judge Dredd & The Worlds Of 2000AD
War of the Burning Sky
Level Up: Advanced 5E
Events & Releases
Upcoming Events
Private Events
Featured Events
Socials!
EN Publishing
Twitter
BlueSky
Facebook
Instagram
EN World
BlueSky
YouTube
Facebook
Twitter
Twitch
Podcast
Features
Top 5 RPGs Compiled Charts 2004-Present
Adventure Game Industry Market Research Summary (RPGs) V1.0
Ryan Dancey: Acquiring TSR
Q&A With Gary Gygax
D&D Rules FAQs
TSR, WotC, & Paizo: A Comparative History
D&D Pronunciation Guide
Million Dollar TTRPG Kickstarters
Tabletop RPG Podcast Hall of Fame
Eric Noah's Unofficial D&D 3rd Edition News
D&D in the Mainstream
D&D & RPG History
About Morrus
Log in
Register
What's new
Search
Search
Search titles only
By:
Forums & Topics
Forum List
Latest Posts
Forum list
*Dungeons & Dragons
Level Up: Advanced 5th Edition
D&D Older Editions, OSR, & D&D Variants
*TTRPGs General
*Pathfinder & Starfinder
EN Publishing
*Geek Talk & Media
Search forums
Chat/Discord
Menu
Log in
Register
Install the app
Install
Upgrade your account to a Community Supporter account and remove most of the site ads.
Community
General Tabletop Discussion
*Pathfinder & Starfinder
Probability in Char. Gen.
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Charwoman Gene" data-source="post: 2174233" data-attributes="member: 5044"><p>My Java program got:</p><p></p><p>[sblock][code]</p><p>/////////////////////////////////////////////////////</p><p></p><p>class SCException extends Exception{</p><p> SCException(){ super();}</p><p> SCException(String desc){ super(desc);}</p><p> }</p><p></p><p>/////////////////////////////////////////////////////</p><p></p><p>class AbilityScores{</p><p> public static int mod(int score){</p><p> switch (score){</p><p> case 3: return -4;</p><p> case 4: ;</p><p> case 5: return -3;</p><p> case 6: ;</p><p> case 7: return -2;</p><p> case 8: ;</p><p> case 9: return -1;</p><p> case 10: ;</p><p> case 11: return 0;</p><p> case 12: ;</p><p> case 13: return 1;</p><p> case 14: ;</p><p> case 15: return 2;</p><p> case 16: ;</p><p> case 17: return 3;</p><p> case 18: return 4;</p><p> default: return -150;</p><p> }</p><p></p><p> }</p><p> public static int pbv(int score){</p><p> switch (score){</p><p> case 3: return -5;</p><p> case 4: return -4;</p><p> case 5: return -3;</p><p> case 6: return -2;</p><p> case 7: return -1;</p><p> case 8: return 0;</p><p> case 9: return 1;</p><p> case 10: return 2;</p><p> case 11: return 3;</p><p> case 12: return 4;</p><p> case 13: return 5;</p><p> case 14: return 6;</p><p> case 15: return 8;</p><p> case 16: return 10;</p><p> case 17: return 13;</p><p> case 18: return 16;</p><p> default: return -150;</p><p> }</p><p> }</p><p> public static double prob(int score){</p><p> switch (score){</p><p> case 3: return 1.0/1296.0;</p><p> case 4: return 4.0/1296.0;</p><p> case 5: return 10.0/1296.0;</p><p> case 6: return 21.0/1296.0;</p><p> case 7: return 38.0/1296.0;</p><p> case 8: return 62.0/1296.0;</p><p> case 9: return 91.0/1296.0;</p><p> case 10: return 122.0/1296.0;</p><p> case 11: return 148.0/1296.0;</p><p> case 12: return 167.0/1296.0;</p><p> case 13: return 172.0/1296.0;</p><p> case 14: return 160.0/1296.0;</p><p> case 15: return 131.0/1296.0;</p><p> case 16: return 94.0/1296.0;</p><p> case 17: return 54.0/1296.0;</p><p> case 18: return 21.0/1296.0;</p><p> default: return -150.0;</p><p> }</p><p> }</p><p> /*public static long prob(int score){</p><p> switch (score){</p><p> case 3: return 1;</p><p> case 4: return 4;</p><p> case 5: return 10;</p><p> case 6: return 21;</p><p> case 7: return 38;</p><p> case 8: return 62;</p><p> case 9: return 91;</p><p> case 10: return 122;</p><p> case 11: return 148;</p><p> case 12: return 167;</p><p> case 13: return 172;</p><p> case 14: return 160;</p><p> case 15: return 131;</p><p> case 16: return 94;</p><p> case 17: return 54;</p><p> case 18: return 21;</p><p> default: return -150;</p><p> }</p><p> }*/</p><p> </p><p> private class AbScInc{</p><p> public int[] scores;</p><p> </p><p> AbScInc(){</p><p> scores = new int[6];</p><p> int i;</p><p> for (i=0; i<6; i++){</p><p> scores[i]=3;</p><p> }</p><p> }</p><p> </p><p> public boolean inc() throws SCException{</p><p> // false means all 18's already</p><p> int i;</p><p> int tmp;</p><p> </p><p> for (i=0; i<6; i++){</p><p> tmp = scores[i];</p><p> if ((tmp < 3) || (tmp > 18)) throw new SCException("Bad Data");</p><p> if (tmp < 18){</p><p> scores[i] = tmp + 1;</p><p> return true;</p><p> }</p><p> else{</p><p> scores[i] = 3;</p><p> }</p><p> }</p><p> return false;</p><p> } </p><p> }</p><p> </p><p> private AbScInc ab;</p><p> </p><p> AbilityScores(){</p><p> ab = new AbScInc();</p><p> }</p><p> </p><p> public boolean next() throws SCException{</p><p> // false means all 18's already</p><p> return ab.inc();</p><p> }</p><p> public int getStr(){return ab.scores[0];}</p><p> public int getDex(){return ab.scores[1];}</p><p> public int getCon(){return ab.scores[2];}</p><p> public int getInt(){return ab.scores[3];}</p><p> public int getWis(){return ab.scores[4];}</p><p> public int getCha(){return ab.scores[5];} </p><p>}</p><p></p><p>/////////////////////////////////////////////////////</p><p></p><p>public class StatCalcDouble{</p><p> public static void main(String[] a){</p><p> AbilityScores stats = new AbilityScores();</p><p> long accepted = 0;</p><p> double totalModPBV = 0.0;</p><p> double totalModScore = 0.0;</p><p> double totalProb = 0.0;</p><p> double currentProb = 0.0;</p><p> //long totalProb = 0;</p><p> //long currentProb = 0;</p><p> boolean notDone = true;</p><p> boolean worthless;</p><p> </p><p> do {</p><p> int str = stats.getStr();</p><p> int dex = stats.getDex();</p><p> int con = stats.getCon();</p><p> int intl = stats.getInt();</p><p> int wis = stats.getWis();</p><p> int cha = stats.getCha();</p><p> int strMod = AbilityScores.mod(str);</p><p> int dexMod = AbilityScores.mod(dex);</p><p> int conMod = AbilityScores.mod(con);</p><p> int intMod = AbilityScores.mod(intl);</p><p> int wisMod = AbilityScores.mod(wis);</p><p> int chaMod = AbilityScores.mod(cha);</p><p> double strProb = AbilityScores.prob(str);</p><p> double dexProb = AbilityScores.prob(dex);</p><p> double conProb = AbilityScores.prob(con);</p><p> double intProb = AbilityScores.prob(intl);</p><p> double wisProb = AbilityScores.prob(wis);</p><p> double chaProb = AbilityScores.prob(cha);</p><p> /*long strProb = AbilityScores.prob(str);</p><p> long dexProb = AbilityScores.prob(dex);</p><p> long conProb = AbilityScores.prob(con);</p><p> long intProb = AbilityScores.prob(intl);</p><p> long wisProb = AbilityScores.prob(wis);</p><p> long chaProb = AbilityScores.prob(cha);*/</p><p> int strPbv = AbilityScores.pbv(str);</p><p> int dexPbv = AbilityScores.pbv(dex);</p><p> int conPbv = AbilityScores.pbv(con);</p><p> int intPbv = AbilityScores.pbv(intl);</p><p> int wisPbv = AbilityScores.pbv(wis);</p><p> int chaPbv = AbilityScores.pbv(cha);</p><p></p><p> if ((strMod + dexMod + conMod + intMod + wisMod + chaMod) < 0)</p><p> worthless = true;</p><p> else{</p><p> if ((str<14) && (dex<14) && (con<14) && (intl<14) && (wis<14) && (cha<14))</p><p> worthless = true;</p><p> else</p><p> worthless = false;</p><p> }</p><p> //////////////////////////</p><p> // if (wis>3) break;</p><p> //////////////////////////</p><p> currentProb = ( strProb</p><p> * dexProb</p><p> * conProb</p><p> * intProb</p><p> * wisProb</p><p> * chaProb);</p><p> </p><p> System.out.println( "Str: " + str</p><p> + " / Dex: " + dex</p><p> + " / Con: " + con</p><p> + " / Int: " + intl</p><p> + " / Wis: " + wis</p><p> + " / Cha: " + cha);</p><p> </p><p> if (!worthless){</p><p> accepted++;</p><p></p><p> totalModPBV += (strPbv * currentProb);</p><p> totalModPBV += (dexPbv * currentProb);</p><p> totalModPBV += (conPbv * currentProb);</p><p> totalModPBV += (intPbv * currentProb);</p><p> totalModPBV += (wisPbv * currentProb);</p><p> totalModPBV += (chaPbv * currentProb);</p><p> totalModScore += (str * currentProb);</p><p> totalModScore += (dex * currentProb);</p><p> totalModScore += (con * currentProb);</p><p> totalModScore += (intl * currentProb);</p><p> totalModScore += (wis * currentProb);</p><p> totalModScore += (cha * currentProb);</p><p> totalProb += currentProb;</p><p> }</p><p> else{</p><p> System.out.println("^^^^WORTHLESS^^^^");</p><p> }</p><p> </p><p> try{</p><p> notDone = stats.next();</p><p> }</p><p> catch (SCException e){</p><p> System.out.println("Bad Data");</p><p> }</p><p> }</p><p> while (notDone);</p><p> double avgPBV = totalModPBV / totalProb;</p><p> double avgScore = (totalModScore / totalProb) / 6;</p><p> System.out.println("Average Score for 4d6dl: " + avgScore);</p><p> System.out.println("Average Point Buy Value for 4d6dl: " + avgPBV);</p><p> }</p><p>}</p><p>[/code][/sblock]</p><p></p><p>Average Score for 4d6dl: 12.44796477197748</p><p>Average Point Buy Value for 4d6dl: 30.0556696948599 </p><p></p><p>The difference is probably due to my using double precision floats and long ints.</p><p></p><p>So, if you allow for the extra value of choosing your own scores, 28 pb is pretty fair.</p></blockquote><p></p>
[QUOTE="Charwoman Gene, post: 2174233, member: 5044"] My Java program got: [sblock][code] ///////////////////////////////////////////////////// class SCException extends Exception{ SCException(){ super();} SCException(String desc){ super(desc);} } ///////////////////////////////////////////////////// class AbilityScores{ public static int mod(int score){ switch (score){ case 3: return -4; case 4: ; case 5: return -3; case 6: ; case 7: return -2; case 8: ; case 9: return -1; case 10: ; case 11: return 0; case 12: ; case 13: return 1; case 14: ; case 15: return 2; case 16: ; case 17: return 3; case 18: return 4; default: return -150; } } public static int pbv(int score){ switch (score){ case 3: return -5; case 4: return -4; case 5: return -3; case 6: return -2; case 7: return -1; case 8: return 0; case 9: return 1; case 10: return 2; case 11: return 3; case 12: return 4; case 13: return 5; case 14: return 6; case 15: return 8; case 16: return 10; case 17: return 13; case 18: return 16; default: return -150; } } public static double prob(int score){ switch (score){ case 3: return 1.0/1296.0; case 4: return 4.0/1296.0; case 5: return 10.0/1296.0; case 6: return 21.0/1296.0; case 7: return 38.0/1296.0; case 8: return 62.0/1296.0; case 9: return 91.0/1296.0; case 10: return 122.0/1296.0; case 11: return 148.0/1296.0; case 12: return 167.0/1296.0; case 13: return 172.0/1296.0; case 14: return 160.0/1296.0; case 15: return 131.0/1296.0; case 16: return 94.0/1296.0; case 17: return 54.0/1296.0; case 18: return 21.0/1296.0; default: return -150.0; } } /*public static long prob(int score){ switch (score){ case 3: return 1; case 4: return 4; case 5: return 10; case 6: return 21; case 7: return 38; case 8: return 62; case 9: return 91; case 10: return 122; case 11: return 148; case 12: return 167; case 13: return 172; case 14: return 160; case 15: return 131; case 16: return 94; case 17: return 54; case 18: return 21; default: return -150; } }*/ private class AbScInc{ public int[] scores; AbScInc(){ scores = new int[6]; int i; for (i=0; i<6; i++){ scores[i]=3; } } public boolean inc() throws SCException{ // false means all 18's already int i; int tmp; for (i=0; i<6; i++){ tmp = scores[i]; if ((tmp < 3) || (tmp > 18)) throw new SCException("Bad Data"); if (tmp < 18){ scores[i] = tmp + 1; return true; } else{ scores[i] = 3; } } return false; } } private AbScInc ab; AbilityScores(){ ab = new AbScInc(); } public boolean next() throws SCException{ // false means all 18's already return ab.inc(); } public int getStr(){return ab.scores[0];} public int getDex(){return ab.scores[1];} public int getCon(){return ab.scores[2];} public int getInt(){return ab.scores[3];} public int getWis(){return ab.scores[4];} public int getCha(){return ab.scores[5];} } ///////////////////////////////////////////////////// public class StatCalcDouble{ public static void main(String[] a){ AbilityScores stats = new AbilityScores(); long accepted = 0; double totalModPBV = 0.0; double totalModScore = 0.0; double totalProb = 0.0; double currentProb = 0.0; //long totalProb = 0; //long currentProb = 0; boolean notDone = true; boolean worthless; do { int str = stats.getStr(); int dex = stats.getDex(); int con = stats.getCon(); int intl = stats.getInt(); int wis = stats.getWis(); int cha = stats.getCha(); int strMod = AbilityScores.mod(str); int dexMod = AbilityScores.mod(dex); int conMod = AbilityScores.mod(con); int intMod = AbilityScores.mod(intl); int wisMod = AbilityScores.mod(wis); int chaMod = AbilityScores.mod(cha); double strProb = AbilityScores.prob(str); double dexProb = AbilityScores.prob(dex); double conProb = AbilityScores.prob(con); double intProb = AbilityScores.prob(intl); double wisProb = AbilityScores.prob(wis); double chaProb = AbilityScores.prob(cha); /*long strProb = AbilityScores.prob(str); long dexProb = AbilityScores.prob(dex); long conProb = AbilityScores.prob(con); long intProb = AbilityScores.prob(intl); long wisProb = AbilityScores.prob(wis); long chaProb = AbilityScores.prob(cha);*/ int strPbv = AbilityScores.pbv(str); int dexPbv = AbilityScores.pbv(dex); int conPbv = AbilityScores.pbv(con); int intPbv = AbilityScores.pbv(intl); int wisPbv = AbilityScores.pbv(wis); int chaPbv = AbilityScores.pbv(cha); if ((strMod + dexMod + conMod + intMod + wisMod + chaMod) < 0) worthless = true; else{ if ((str<14) && (dex<14) && (con<14) && (intl<14) && (wis<14) && (cha<14)) worthless = true; else worthless = false; } ////////////////////////// // if (wis>3) break; ////////////////////////// currentProb = ( strProb * dexProb * conProb * intProb * wisProb * chaProb); System.out.println( "Str: " + str + " / Dex: " + dex + " / Con: " + con + " / Int: " + intl + " / Wis: " + wis + " / Cha: " + cha); if (!worthless){ accepted++; totalModPBV += (strPbv * currentProb); totalModPBV += (dexPbv * currentProb); totalModPBV += (conPbv * currentProb); totalModPBV += (intPbv * currentProb); totalModPBV += (wisPbv * currentProb); totalModPBV += (chaPbv * currentProb); totalModScore += (str * currentProb); totalModScore += (dex * currentProb); totalModScore += (con * currentProb); totalModScore += (intl * currentProb); totalModScore += (wis * currentProb); totalModScore += (cha * currentProb); totalProb += currentProb; } else{ System.out.println("^^^^WORTHLESS^^^^"); } try{ notDone = stats.next(); } catch (SCException e){ System.out.println("Bad Data"); } } while (notDone); double avgPBV = totalModPBV / totalProb; double avgScore = (totalModScore / totalProb) / 6; System.out.println("Average Score for 4d6dl: " + avgScore); System.out.println("Average Point Buy Value for 4d6dl: " + avgPBV); } } [/code][/sblock] Average Score for 4d6dl: 12.44796477197748 Average Point Buy Value for 4d6dl: 30.0556696948599 The difference is probably due to my using double precision floats and long ints. So, if you allow for the extra value of choosing your own scores, 28 pb is pretty fair. [/QUOTE]
Insert quotes…
Verification
Post reply
Community
General Tabletop Discussion
*Pathfinder & Starfinder
Probability in Char. Gen.
Top