Sim name and personality bias
This commit is contained in:
parent
1e1a26aa8d
commit
e149e91853
2 changed files with 20 additions and 2 deletions
|
@ -2,17 +2,34 @@ var rng = new Random();
|
|||
|
||||
int totalPoints = 25;
|
||||
int[] points = new int[5]; // To store the personality points for Outgoing, Nice, Playful, Neat, and Active
|
||||
var name = GetUserInput("Enter the name of the Sim: ");
|
||||
var bias = GetUserInput("Choose a personality bias (Outgoing, Nice, Playful, Neat, Active): ");
|
||||
string[] personalities = { "Outgoing", "Nice", "Playful", "Neat", "Active" };
|
||||
|
||||
string GetUserInput(string prompt)
|
||||
{
|
||||
Console.Write(prompt);
|
||||
return Console.ReadLine();
|
||||
}
|
||||
|
||||
// Function to randomly allocate points
|
||||
void AllocatePoints()
|
||||
{
|
||||
int remainingPoints = totalPoints;
|
||||
int biasIndex = Array.IndexOf(personalities, bias);
|
||||
|
||||
// First, allocate points to each personality.
|
||||
for (int i = 0; i < points.Length; i++)
|
||||
{
|
||||
points[i] = rng.Next(0, 11); // Assign 0-10 points to each personality
|
||||
if (i == biasIndex)
|
||||
{
|
||||
points[i] = rng.Next(4, 11); // Assign 0-10 points to each personality
|
||||
}
|
||||
else
|
||||
{
|
||||
points[i] = rng.Next(0, 6);
|
||||
|
||||
}
|
||||
remainingPoints -= points[i];
|
||||
}
|
||||
|
||||
|
@ -34,6 +51,7 @@ void AllocatePoints()
|
|||
}
|
||||
|
||||
// Print the final personality points
|
||||
Console.WriteLine($"{name}'s Personality Points:");
|
||||
for (int i = 0; i < points.Length; i++)
|
||||
{
|
||||
Console.WriteLine($"{personalities[i]}: {points[i]} points");
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<Version>0.1.200</Version>
|
||||
<Version>0.1.210</Version>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
|
Reference in a new issue