Beginner trying to code a personality type skill tree, stuck on the first array sequence

2BadBrockLee

Member
Joined
May 8, 2021
Messages
7
Programming Experience
Beginner
Hi, I have finally gotten the big picture behind coding, but am stuck on the individual functions and how they all activate and such, I'm coding an array with switch statements to place the types in dockets called houses with HouseNumbers, I'm trying to get it to fill out the charts automatically
from the first type you put in, plz help, lol.

1620503701715.png

1620503738298.png
 
Please post your code and errors in code tags, not screenshots. Screenshots are hard to read, specially on small devices like phones.
 
C#:
using System;
using System.Collections.Generic;

namespace Natal_Chart_Skill_Tree
{
    class Program
    {
        static void Main(string[] args)
            Char(INTP)
            var Introverted Thinking + Extraverted iNtuition + Introverted Sensing + Extraverted Feeling

            Docket
public override bool Equals(object obj)
        {
            return obj is Program program &&
                   EqualityComparer<int[]>.Default.Equals(Housenumbers, program.Housenumbers) &&
                   EqualityComparer<If>.Default.Equals(array, program.array);
        }

        int[Docket] Housenumbers[1, 2]
        {
            Console.WriteLine();
        }
             static string GetLetter int (letterOrder);
            string letterOrder;

            return

            switch (Type);
            {
                case 0:
                    letterOrder = Housenumbers[1]
                    break;
                case 1:
                    letterOrder = Housenumbers[2] switch last three letters
                    break;
                case 2:
                    letterOrder = Housenumbers[3] switch
            Get "Docket" if array.input = Char INTP


            char   ;
    }
    }
}
 
Last edited by a moderator:
In the future, please put your code in code tags. I edited your post #3 for you.

What book or tutorial did you use to "get the big picture of coding"? It looks like it was at much too high a level and you are now completely missing out on the fundamentals of C# programming like method scopes, variable declarations, arrays, etc. Right now your "code" looks like an ENFP or ESFP watched a 10 minute YouTube video about writing C# code and then said, "I know C#!"
 
Anyway, let start of with the Main() method needs curly braces around the body of the method. (Yes, C# 9.0 allows top level statements, but you aren't even using top level statements in the context of the code you presented above.)

Next, why do you think Char(INTP) is an array sequence?
 
I'm not claiming to be an expert, but literally no one else will help me, lol. So tyvm this is the first useful response I've gotten. I need help getting which functions go with which activators and such, and hey I watched like a few hours of tutorials ty. I'm using INTP as a term to be described the letters and functions of to be used and applying the described letter order and functions around the houses. Do you mean static void Main(string[] args)?
 
Last edited:
This is what I'm trying to get it to apply to pretty much. With an algorithm of how it goes around the houses. i.e. the HouseNumbers Case 0: stays the same basically, Case 1: switch last three letters, Case 2: use type with other supporting function with third function first etc.
 
Last edited:
Okay, based on your description of what you are trying to do in post #8, it doesn't sound like an array is appropriate structure to use. Arrays are data structures. What you are describing in post #8 is a multibranched logic for which you'll want a flow control structure.
 
Well I was thinking an array for keeping the information organized, but perhaps if it's in a flow structure it won't matter?



Like something tells me both are needed I just didn't place it correctly.



Or maybe with how it's implemented it's erroneous.



But in the same way that you code a "get" or really any function where you have to retrieve something, I would think there'd be a use for a base of knowledge of the values, especially given that later there would be stats ascribed by skill.
 
With the Myers-Briggs there are just 4 axis to measure: extroversion vs introversion, thinking vs feeling, sensing vs intuiting, judging vs perceiving. That means you can have a simple struct or class that has 4 booleans, or 4 integers, and be effectively able to record the personality type. Yes, you could keep those 4 booleans or integers in an array, but that is the old fashioned FORTRAN or COBOL way doing things. The modern C# object oriented approach is to actually have 4 separate well named fields.

Your code then can take an instance of these classes or structs, and examine each of its fields and decide what to do with what it finds in them. Yes, you could create a bitmap of the 4 booleans to come up with the 16 permutations and use that as jump table (e.g. an array with pointers to code to be executed next), but again, that is the old fashioned C way of doing things. In modern C#, the first preference would be to use a chain of if-else statements, or a C# 8.0 pattern matching switch statement. (The C# 8.0 compiler will just convert the switch statement into if-else's anyway.) Some people may setup a dictionary with the permutation values as the key and delegates to be executed to use a more data structure approach, but again it's not going to be an array. Only a really old school C programmer transitioning into C# would setup an array of delegates where the index into the array is the equivalent bitmap value -- but legibility of the code will really suffer, as well as, completely puzzle modern C# programmers as to why the author would be bending over backwards to not write idiomatic C# code.
 

Latest posts

Back
Top Bottom