Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Lexicon
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public enum PartsOfSpeach { NonstaticNoun, StaticNoun, Pronoun, Verb, Adjective, Adverb, Conjunction, Preposition, Interjection } public class Program { static List<Word> LoadedWords = new List<Word>(); static int Selection = 0; static ConsoleKey LatestInput = ConsoleKey.Enter; public static void Main(string[] args) { Menu(); } static void Menu() { while(true) { //Console.Clear(); if(Selection == 0) Console.Write(">Open "); else Console.Write("-Open "); if(Selection == 1) Console.Write(">Save "); else Console.Write("-Save "); if(Selection == 2) Console.Write(">Save as "); else Console.Write("-Save as "); if(Selection == 3) Console.Write(">Upload "); else Console.Write("-Upload "); LatestInput = Console.ReadKey().Key; if(LatestInput == ConsoleKey.LeftArrow) if(Selection == 0) Selection = 3; else Selection--; if(LatestInput == ConsoleKey.RightArrow) if(Selection == 3) Selection = 0; else Selection++; } } static bool Load(string path) { //string[] Content = File.ReadAllLines(path); return false; } } public class Word { public string Root { get; private set; } public string Definition { get; private set; } public PartsOfSpeach Part { get; private set; } public string OtherInformation { get; private set; } public override string ToString() { return Root + "*" + Definition + "*" + (int)Part + "*" + OtherInformation; } public Word (string R, string D, PartsOfSpeach P) { Root = R; Definition = D; Part = P; } public Word (string R, string D, PartsOfSpeach P, string O) { Root = R; Definition = D; Part = P; OtherInformation = O; } public static Word LoadWord(string word) { int pos; string[] w = word.Split('*'); if(w.Length < 3) return null; if(int.TryParse(w[2], out pos) == false) return null; return new Word(w[0], w[1], (PartsOfSpeach)pos); } } }
run
|
edit
|
history
|
help
0
CODE
10857
Math v9.2
30272 Program Ex5 if else
Sort string collection by length
Ok
asdfghyjujn dsc
sdrfgthyuytgrfdwcd
mine
HDEFDCSA SS0546254