SHOW:
|
|
- or go back to the newest paste.
| 1 | using System; | |
| 2 | - | using System.Collections.Generic; |
| 2 | + | |
| 3 | - | using System.Linq; |
| 3 | + | using static System.Console; |
| 4 | - | using System.Text; |
| 4 | + | |
| 5 | - | using System.Threading.Tasks; |
| 5 | + | namespace Sandbox.Intelligenztest |
| 6 | {
| |
| 7 | - | namespace Intelligenztest |
| 7 | + | internal class Program |
| 8 | {
| |
| 9 | - | class Program |
| 9 | + | private static string ChooseLanguage() |
| 10 | {
| |
| 11 | - | static void Main(string[] args) |
| 11 | + | Clear(); |
| 12 | SetCursorPosition(45, 0); | |
| 13 | - | string Zahlenreihe = ""; |
| 13 | + | ForegroundColor = ConsoleColor.Blue; |
| 14 | - | string WasPasstNicht = ""; |
| 14 | + | WriteLine("Intelligenztest/Intelligence test");
|
| 15 | - | string Zahlenreihe2 = ""; |
| 15 | + | SetCursorPosition(5, 2); |
| 16 | - | string Zahlenreihe3 = ""; |
| 16 | + | WriteLine("Wählen Sie ihre Sprache/Choose your language");
|
| 17 | - | string PasstNicht = ""; |
| 17 | + | SetCursorPosition(5, 3); |
| 18 | WriteLine("a: Englisch/English");
| |
| 19 | - | string Sprache; |
| 19 | + | SetCursorPosition(5, 4); |
| 20 | WriteLine("b: Deutsch/German");
| |
| 21 | - | Console.SetCursorPosition(45, 0); |
| 21 | + | SetCursorPosition(5, 5); |
| 22 | - | Console.ForegroundColor = ConsoleColor.Blue; |
| 22 | + | Write("Sprache/language: ");
|
| 23 | - | Console.WriteLine("Intelligenztest/Intelligence test");
|
| 23 | + | return ReadLine(); |
| 24 | } | |
| 25 | - | Console.SetCursorPosition(5, 2); |
| 25 | + | |
| 26 | - | Console.WriteLine("Wählen Sie ihre Sprache/Choose your language");
|
| 26 | + | private static string[] Quiz(int language) |
| 27 | - | Console.SetCursorPosition(5, 3); |
| 27 | + | |
| 28 | - | Console.WriteLine("a: Englisch/English");
|
| 28 | + | string[,] questions = |
| 29 | - | Console.SetCursorPosition(5, 4); |
| 29 | + | |
| 30 | - | Console.WriteLine("b: Deutsch/German");
|
| 30 | + | { "Continue the sequence: 3-6-9-12-?", "Setze die Folgende Zahlenreihe fort: 3-6-9-12-?" },
|
| 31 | - | Console.SetCursorPosition(5, 5); |
| 31 | + | { "What doesn't fit?", "Was passt nicht?" },
|
| 32 | - | Console.Write("Sprache/language: ");
|
| 32 | + | { "Continue the sequence: 2-3-5-8-12-?", "Setze die Folgende Zahlenreihe fort: 2-3-5-8-12-?" },
|
| 33 | - | Sprache = Console.ReadLine(); |
| 33 | + | { "Continue the sequence: 2-5-11-23-47-?", "Setze die Folgende Zahlenreihe fort: 2-5-11-23-47-?" },
|
| 34 | { "What doesn't fit? 4; 5; 6; 8;", "Was passt nicht? 4; 5; 6; 8;" }
| |
| 35 | - | Console.Clear(); |
| 35 | + | }; |
| 36 | ||
| 37 | - | if (Sprache == "b") |
| 37 | + | string[,] possibleAnswers = |
| 38 | {
| |
| 39 | { "16", "22", "15", "14", "16", "22", "15", "14" },
| |
| 40 | { "Monitor", "Keyboard", "Mouse", "Cat", "Bildschirm", "Tastatur", "Maus", "Katze" },
| |
| 41 | - | Console.SetCursorPosition(5, 3); |
| 41 | + | { "18", "20", "14", "17", "18", "20", "14", "17" },
|
| 42 | - | Console.WriteLine("1. Setze die Folgende Zahlenreihe fort: 3-6-9-12-?");
|
| 42 | + | { "18", "20", "14", "17", "18", "20", "14", "17" },
|
| 43 | - | Console.SetCursorPosition(10, 4); |
| 43 | + | { "8", "4", "5", "6", "8", "4", "5", "6" }
|
| 44 | - | Console.WriteLine("a: 16");
|
| 44 | + | }; |
| 45 | - | Console.SetCursorPosition(10, 5); |
| 45 | + | |
| 46 | - | Console.WriteLine("b: 22");
|
| 46 | + | string[] answers = new string[questions.GetLength(0)]; |
| 47 | - | Console.SetCursorPosition(10, 6); |
| 47 | + | |
| 48 | - | Console.WriteLine("c: 15");
|
| 48 | + | for (int i = 0; i < questions.GetLength(0); i++) |
| 49 | - | Console.SetCursorPosition(10, 7); |
| 49 | + | |
| 50 | - | Console.WriteLine("d: 14");
|
| 50 | + | int y = 3; |
| 51 | - | Console.SetCursorPosition(5, 8); |
| 51 | + | SetCursorPosition(5, (i * 7) + y++); |
| 52 | - | Console.Write("Die Antwort ist: ");
|
| 52 | + | WriteLine($"{(char)('1' + i)}. {questions[i, language]}");
|
| 53 | - | Zahlenreihe = Console.ReadLine(); |
| 53 | + | |
| 54 | for (int letter = 0; letter < 4; letter++) | |
| 55 | - | Console.SetCursorPosition(5, 9); |
| 55 | + | {
|
| 56 | - | Console.WriteLine("===================================================");
|
| 56 | + | SetCursorPosition(10, (i * 7) + y++); |
| 57 | WriteLine($"{(char)('a' + letter)}: {possibleAnswers[i, (language * 4) + letter]}");
| |
| 58 | } | |
| 59 | - | Console.SetCursorPosition(5, 10); |
| 59 | + | Write((language == 0) ? "The answer is: " : "Die Antwort ist: "); |
| 60 | - | Console.WriteLine("2. Was passt nicht? Maus; Katze; Tastaur; Bildschirm");
|
| 60 | + | answers[i] = ReadLine(); |
| 61 | - | Console.SetCursorPosition(10, 11); |
| 61 | + | SetCursorPosition(5, (i * 7) + ++y); |
| 62 | - | Console.WriteLine("a: Bildschirm");
|
| 62 | + | WriteLine("===================================================");
|
| 63 | - | Console.SetCursorPosition(10, 12); |
| 63 | + | |
| 64 | - | Console.WriteLine("b: Tastaur");
|
| 64 | + | |
| 65 | - | Console.SetCursorPosition(10, 13); |
| 65 | + | return answers; |
| 66 | - | Console.WriteLine("c: Maus");
|
| 66 | + | |
| 67 | - | Console.SetCursorPosition(10, 14); |
| 67 | + | |
| 68 | - | Console.WriteLine("d: Katze");
|
| 68 | + | private static void Main(string[] args) |
| 69 | - | Console.SetCursorPosition(5, 15); |
| 69 | + | |
| 70 | - | Console.Write("Die Antwort ist: ");
|
| 70 | + | |
| 71 | - | WasPasstNicht = Console.ReadLine(); |
| 71 | + | |
| 72 | string Sprache = ""; | |
| 73 | - | Console.SetCursorPosition(5, 16); |
| 73 | + | |
| 74 | - | Console.WriteLine("===================================================");
|
| 74 | + | do |
| 75 | {
| |
| 76 | - | Console.SetCursorPosition(5, 17); |
| 76 | + | Sprache = ChooseLanguage().Trim().ToLower(); |
| 77 | - | Console.WriteLine("3. Setze die folgende Zahlenreihe fort: 2-3-5-8-12-?");
|
| 77 | + | } while (Sprache != "a" && Sprache != "b"); |
| 78 | - | Console.SetCursorPosition(10, 18); |
| 78 | + | Clear(); |
| 79 | - | Console.WriteLine("a: 18");
|
| 79 | + | |
| 80 | - | Console.SetCursorPosition(10, 19); |
| 80 | + | Quiz(Sprache == "a" ? 0 : 1); |
| 81 | - | Console.WriteLine("b: 20");
|
| 81 | + | |
| 82 | - | Console.SetCursorPosition(10, 20); |
| 82 | + | SetCursorPosition(5, 39); |
| 83 | - | Console.WriteLine("c: 14");
|
| 83 | + | |
| 84 | - | Console.SetCursorPosition(10, 21); |
| 84 | + | |
| 85 | - | Console.WriteLine("d: 17");
|
| 85 | + | ForegroundColor = ConsoleColor.Green; |
| 86 | - | Console.SetCursorPosition(5, 22); |
| 86 | + | WriteLine("Sie haben {0} von 5 Punkten erreicht", Punkte);
|
| 87 | - | Console.Write("Die Antwort ist: ");
|
| 87 | + | SetCursorPosition(5, 40); |
| 88 | - | Zahlenreihe2 = Console.ReadLine(); |
| 88 | + | Write("Super Leistung!", Punkte);
|
| 89 | ||
| 90 | - | Console.SetCursorPosition(5, 23); |
| 90 | + | |
| 91 | - | Console.WriteLine("===================================================");
|
| 91 | + | |
| 92 | if (Punkte == 4 || Punkte == 3) | |
| 93 | - | Console.SetCursorPosition(5, 24); |
| 93 | + | |
| 94 | - | Console.WriteLine("4. Setze die folgende Zahlenreihe fort: 2-5-11-23-47-?");
|
| 94 | + | ForegroundColor = ConsoleColor.Yellow; |
| 95 | - | Console.SetCursorPosition(10, 25); |
| 95 | + | WriteLine("Sie haben {0} von 5 Punkten erreicht", Punkte);
|
| 96 | - | Console.WriteLine("a: 18");
|
| 96 | + | SetCursorPosition(5, 40); |
| 97 | - | Console.SetCursorPosition(10, 26); |
| 97 | + | Write("Gut gemacht, doch das geht noch besser!", Punkte);
|
| 98 | - | Console.WriteLine("b: 20");
|
| 98 | + | |
| 99 | - | Console.SetCursorPosition(10, 27); |
| 99 | + | |
| 100 | - | Console.WriteLine("c: 14");
|
| 100 | + | |
| 101 | - | Console.SetCursorPosition(10, 28); |
| 101 | + | ForegroundColor = ConsoleColor.Red; |
| 102 | - | Console.WriteLine("d: 17");
|
| 102 | + | WriteLine("Sie haben {0} von 5 Punkten erreicht", Punkte);
|
| 103 | - | Console.SetCursorPosition(5, 29); |
| 103 | + | SetCursorPosition(5, 40); |
| 104 | - | Console.Write("Die Antwort ist: ");
|
| 104 | + | Write("Schlechte Leistung!", Punkte);
|
| 105 | - | Zahlenreihe3 = Console.ReadLine(); |
| 105 | + | |
| 106 | ||
| 107 | - | Console.SetCursorPosition(5, 30); |
| 107 | + | ReadKey(); |
| 108 | - | Console.WriteLine("===================================================");
|
| 108 | + | |
| 109 | } | |
| 110 | - | Console.SetCursorPosition(5, 31); |
| 110 | + | |
| 111 | - | Console.WriteLine("5. Was passt nicht? 2; 4; 5; 6; 8;");
|
| 111 | + |