Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- using Sys = Cosmos.System;
- namespace CosmosKernel1
- {
- public class Kernel : Sys.Kernel
- {
- public Dictionary<string, bool> alphabet = new Dictionary<string, bool>()
- {
- //none of these queries work
- //I originally added the entire alphabet because I thought its was an issue with certain characters
- {"a", true},
- {"b", true},
- {"c", true},
- {"d", true},
- {"e", true},
- {"f", true},
- {"g", true},
- {"h", true},
- {"i", true},
- {"j", true},
- {"k", true},
- {"l", true},
- {"m", true},
- {"n", true},
- {"o", true},
- {"p", true},
- {"q", true},
- {"r", true},
- {"s", true},
- {"t", true},
- {"u", true},
- {"v", true},
- {"w", true},
- {"x", true},
- {"y", true},
- {"z", true},
- {"power", true},
- {"del", true},
- //these queries work though
- {"powers", true},
- {"blue", true},
- {"rm", true},
- {"list", true},
- {"pwer", true},
- {"..", true}
- };
- protected override void BeforeRun()
- {
- Console.Clear();
- Console.WriteLine("Input a string to see if it is recognized in the dictionary.");
- }
- protected override void Run()
- {
- Console.Write("Input> ");
- string key = Console.ReadLine();
- Console.WriteLine($"Input Key \"{key}\" is in the dictionary: {alphabet.ContainsKey(key).ToString()}");
- //to confirm that key "a" is in the dictionary if a is the input
- if (key == "a")
- {
- Console.WriteLine("String Key \"a\" is in the Dictionary: " + alphabet.ContainsKey("a").ToString());
- if (alphabet.ContainsKey("a"))
- {
- Console.WriteLine("Key \"a\" value in dictionary: " + alphabet["a"].ToString());
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment