1
\$\begingroup\$

Anyone remember these things?

enter image description here

Your challenge today is to make the shortest program that involves your pet growing into 1 of at least 7 different creatures.

Your creature will grow into different forms depending on a random percentage from an RNG and the name you give it (from STDIN or equivalent for your language) at each stage the two possible creatures it could develop in must differ. To determine how the name affects growth use the ascii codes for each character and math operations (as you please) that converts the name to a percentage. For example:

sum(ASCII value for chars in name) % 101 / 100
E.g. "Joe": (74 + 111 + 101) % 101 / 100 = 286 % 100 / 100 = 84 / 100 = 84%

This can then affect the growth like so: Rarity (as %) * Name (as %)
E.g. 40% * 84%* = 33.6% - This means there is a 33.6% chance it will advance into the rarer 
of the two possible creatures and a 66.4% it will advance to the other creature.

Your pets life has 4 stages Birth -> Teenager -> Adult -> Death"= Each stage must be printed to STDOUT.

Your can create random creature names for your pets but they must be at least 5 characters long (bonus points for creativity), you can also choose the rarity yourself.

This is code golf - usual rules apply - shortest program in bytes wins!

Example:

                             +-> Adult1 (75%) - 45% (Most Common)
             +-> Teen1 (60%) +
             |               +-> Adult2 (25%) - 15%
Child (100%) + 
             |               +-> Adult3 (90%) - 36%
             +-> Teen2 (40%) +
                             +-> Adult4 (10%) - 4% (Super rare)

Input:

Joe

Output:

Joe was born.
Joe grew into Teen2.
Joe grew into Adult3.
Joe died.
\$\endgroup\$

closed as unclear what you're asking by lirtosiast, feersum, Downgoat, user7486, Level River St Nov 9 '15 at 8:56

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    \$\begingroup\$ This is some deep predestination stuff we're getting into. \$\endgroup\$ – Mama Fun Roll Nov 8 '15 at 23:08
  • \$\begingroup\$ Welcome to PPCG. This spec isn't tight enough for codegolf. For example "math operations (as you please)" is open to abuse. I might chose to ignore the name totally (as I pleased) to make the code shorter, and just use the same probability for all names. YOU need to specify the way the name should be used. Species at least 5 characters long is fine, but note that (for example) a Ruby coldgolfer's idea of "creative" is "aaaaa" "aaaaaa" etc as these can be expressed as for example ?a*n· If you don't like that, say that each species must be a string and these are excluded from character count. \$\endgroup\$ – Level River St Nov 9 '15 at 9:08
  • \$\begingroup\$ Writing a good challenge is hard. Please stick around, answer a few questions, and consider posting your next challenge to the sandbox meta.codegolf.stackexchange.com/q/2140/15599 for feedback. \$\endgroup\$ – Level River St Nov 9 '15 at 9:10

Browse other questions tagged or ask your own question.