Increased max mood and motive, resepctfully.

- Function for printing motives and mood
This commit is contained in:
Anthony Leland 2020-10-28 21:57:03 -04:00
parent 373170f98e
commit 9d74a1690e

View file

@ -23,21 +23,14 @@
], ],
"outputs": [] "outputs": []
}, },
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For this experiment, the current motives are randomized with a max of 10. If this were a game, the max would be 100 with a downward increment throughout the day."
]
},
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 1, "execution_count": 1,
"metadata": {}, "metadata": {},
"source": [ "source": [
"static Random rng = new Random();\n", "static Random rng = new Random();\n",
"static int MaxMood = 60;\n", "static int MaxMood = 600;\n",
"static int MaxMotive = 10;\n", "static int MaxMotive = 100;\n",
"\n", "\n",
"static int LimitToRange(this int val, int min, int max)\n", "static int LimitToRange(this int val, int min, int max)\n",
"{\n", "{\n",
@ -133,6 +126,16 @@
" {\n", " {\n",
" Social = CalcuateMotiveChange(Social, input);\n", " Social = CalcuateMotiveChange(Social, input);\n",
" }\n", " }\n",
"\n",
" public void ChangeEnergy(int input)\n",
" {\n",
" Energy = CalcuateMotiveChange(Energy, input);\n",
" }\n",
"\n",
" public void ChangeEnvironment(int input)\n",
" {\n",
" Environment = CalcuateMotiveChange(Environment, input);\n",
" }\n",
"}" "}"
], ],
"outputs": [] "outputs": []
@ -142,19 +145,15 @@
"execution_count": 1, "execution_count": 1,
"metadata": {}, "metadata": {},
"source": [ "source": [
"// Max a motive can be is 10. With all motives combined, the\n", "void PrintMotives(Motives motives)\n",
"// the max can be about 60. In-game, this is always going down\n", "{\n",
"// to whatever degree.\n", " Console.WriteLine($\"Hunger: {motives.Hunger}{Environment.NewLine}\" +\n",
"var motives = new Motives(hunger: rng.Next(MaxMotive), \n", " $\"Fun: {motives.Fun}{Environment.NewLine}\" +\n",
"bladder: rng.Next(MaxMotive), fun: rng.Next(MaxMotive), \n", " $\"Bladder: {motives.Bladder}{Environment.NewLine}\" +\n",
"energy: rng.Next(MaxMotive), environment: MaxMotive, \n", " $\"Social: {motives.Social}{Environment.NewLine}\" +\n",
"social: rng.Next(MaxMotive));\n", " $\"Environment: {motives.Environment}\");\n",
"Console.WriteLine($\"Hunger: {motives.Hunger}{Environment.NewLine}\" +\n", " Console.WriteLine($\"Mood: {motives.Mood}\");\n",
" $\"Fun: {motives.Fun}{Environment.NewLine}\" +\n", "}"
" $\"Bladder: {motives.Bladder}{Environment.NewLine}\" +\n",
" $\"Social: {motives.Social}{Environment.NewLine}\" +\n",
" $\"Environment: {motives.Environment}\");\n",
"Console.WriteLine($\"Mood: {motives.Mood}\");"
], ],
"outputs": [] "outputs": []
}, },
@ -163,15 +162,28 @@
"execution_count": 1, "execution_count": 1,
"metadata": {}, "metadata": {},
"source": [ "source": [
"motives.ChangeHunger(rng.Next(MaxMotive));\n", "var motives = new Motives(hunger: rng.Next(MaxMotive), \n",
"motives.ChangeFun(rng.Next(MaxMotive));\n", "bladder: rng.Next(MaxMotive), fun: rng.Next(MaxMotive), \n",
"motives.ChangeSocial(rng.Next(MaxMotive));\n", "energy: rng.Next(MaxMotive), environment: rng.Next(MaxMotive), \n",
"motives.ChangeBladder(rng.Next(MaxMotive));\n", "social: rng.Next(MaxMotive));\n",
"Console.WriteLine($\"New Hunger: {motives.Hunger}{Environment.NewLine}\" +\n", "\n",
" $\"New Fun: {motives.Fun}{Environment.NewLine}\" +\n", "PrintMotives(motives);"
" $\"New Bladder: {motives.Bladder}{Environment.NewLine}\" +\n", ],
" $\"New Social: {motives.Social}\");\n", "outputs": []
"Console.WriteLine($\"New Mood: {motives.Mood}\");" },
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"source": [
"motives.ChangeHunger(rng.Next(motives.Hunger, MaxMotive));\n",
"motives.ChangeFun(rng.Next(motives.Fun, MaxMotive));\n",
"motives.ChangeSocial(rng.Next(motives.Social, MaxMotive));\n",
"motives.ChangeBladder(rng.Next(motives.Bladder, MaxMotive));\n",
"motives.ChangeEnergy(rng.Next(motives.Energy, MaxMotive));\n",
"motives.ChangeEnvironment(rng.Next(motives.Environment, MaxMotive));\n",
"\n",
"PrintMotives(motives);"
], ],
"outputs": [] "outputs": []
} }