Anyone remember these things?
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!
+-> Adult1 (75%) - 45% (Most Common) +-> Teen1 (60%) + | +-> Adult2 (25%) - 15% Child (100%) + | +-> Adult3 (90%) - 36% +-> Teen2 (40%) + +-> Adult4 (10%) - 4% (Super rare)
Joe was born. Joe grew into Teen2. Joe grew into Adult3. Joe died.