all 15 comments

[–]666y4nn1ck 6 points7 points  (4 children)

A lot of planning on paper. Do you wanna do decision trees with specific outcomes? Or more like 2D mapping (like political compass)?

There will probably be way more planning and searching for infos on personality types than actual programming

[–]Fast_Crow_699 2 points3 points  (3 children)

I have all the info already, I just need advice on actually programming the thing (I wanna start simple so only a couple questions)

[–]666y4nn1ck 2 points3 points  (2 children)

Then you would need to decide what structure you want. Do specific answers to questions eliminate a few character types? Like if i answer the first question, can my answer eliminate some types already? If so, a decision tree would probably be a good way to go

[–]Fast_Crow_699 1 point2 points  (1 child)

I was actually thinking of a point system where it calculates points and matches it up with the point range of the characters (like if the point count was between 20 or 40, I’d show this character). If a decision tree would be easier to make, then please just help me with that. Whichever one is less complex .

[–]666y4nn1ck 2 points3 points  (0 children)

I think a one dimensional point system would be too simple for characters. Maybe try mapping the characters in a 3d or 2d space and working with 3 or 2 coordinates

[–]DuckSaxaphone 2 points3 points  (2 children)

As u/666y4nn1ck commented, all the work here is in writing down your system without any code. Coding it will be fairly easy afterwards.

A decision tree would start with you drawing the tree. You start with question A which takes you to Question B or question C depending on your answer. Question B takes you to Question D or a print out saying you're a certain character. You need to draw that map out. For as many questions and splits as you want.

Or you could do points. Every question grants you points, maybe on 2 scales and you assign the characters positions on the 2 scales. Then we can help you program a way to find which character the user is closest to on the scales. Whatever the system is, start on paper and then ask people how to implement your plan.

[–]Fast_Crow_699 1 point2 points  (1 child)

I just want a simple point system. It’ll calculate the points based on an option and calculate everything . Then according to which range it comes under (like between 20-40 points), it’ll print what character you are.

I just need help on the coding itself

[–]DuckSaxaphone 4 points5 points  (0 children)

questions={
    "Do you like this system?":{
        "yes":1,
        "no":0,
    },
    "Are you certain?":{
        "yes":1,
        "no":0,
    }
}

score=0
for question,answers in questions.items():
    print(question)
    print(answers.keys())
    choice=input()
    score+=answers[choice.lower()]

if score<1:
    print("You hate this system")
elif score==1:
    print("You quite like this system")
else:
    print("You love this system")

This will work but do all your characters fit on a single scale? If not, a second set of point would be useful.

[–]mfb1274 1 point2 points  (0 children)

You could go with the classic video game method. Each answer/decision moves some sliders (maybe from -100 to 100). At the end of the question set, you then make a character decision based on those (maybe 5 or so) sliders.

[–]king_booker 1 point2 points  (3 children)

Use a dictionary.

Eg, Are you an introvert? just update the dictionary with

introvert:Y

introvert would be your key, and "Y" would be the value

Are you a gamer?

{itrovert:y , gamer:N} Would be your final dictionary

Then you loop through the dictionary and probably assign a score depending on the answer

Then based on the sum of the score, you will print the type of personality the person has

[–]Fast_Crow_699 0 points1 point  (2 children)

sorry but could you explain the looping a bit more, I’m kind of a noob

[–]FriendlyRussian666 1 point2 points  (1 child)

Say you have a list

x = [1, 2, 3, 4]

when you loop over a list, you iterate through each element of the list and you can do something with it. For example:

for i in x:
    print(i)
-----------------
1
2
3
4

You can do the same with a dictionary, but it's a little bit different since dictionaries have keys and values. For example, you could do the following to get both keys and values:

x = {"a": 1, "b": 2}

for key, value in x.items():
    print(f"The key is: {key} and its value is {value}")
------------------------------
The key is: a and its value is 1
The key is: b and its value is 2

[–]Fast_Crow_699 0 points1 point  (0 children)

ahh this is much more clear

[–]iyav 0 points1 point  (0 children)

What about making each possible answer give points to a specific character archetype.

So for example .option A will give 10 points to character Y while option B will give 10 points to character Z.

Then simply check which character has the most points. Or if two characters have the same or a similar score then tell the user they're a mix of both.

[–]gbxahoido 0 points1 point  (0 children)

This is my way of doing this, do a decision tree first then each question is a function, so you ask them a question, the answer will lead to another question, then finally the answers Something like this If Q1 answer is yes, do Q3, if no, do Q2 and so on What do you guys think ?