public void IsValidParentheses_Should_Return_True() { var str = "{}"; bool result = SuperString.IsValidParentheses(str); Assert.True(result, "str should be true"); }
void Start() { //PlayerPrefs.DeleteAll(); SAVED_CONTENT = new SuperString("http://stgame.vn|Pikachu 2016|ads_pika2016.png", "tads534"); LOAD_COUNT = new SuperInt(0, "tadsloadcount"); //GetADS(); //ParseCONTENT(SAVED_CONTENT.STR, true); //return; if (LOAD_COUNT.Get() == 0) { Debug.Log("loading new ads"); GetADS(); } else { Debug.Log("no: load saved ads"); LOAD_COUNT.PlusAndSave(1); if (LOAD_COUNT.Get() >= 5) { LOAD_COUNT.SetAndSave(0); } ParseCONTENT(SAVED_CONTENT.STR, true); } //AAdsLabel a = new AAdsLabel(null, null, null, null, null, null, null); //SerializedData }
public void IsValidParentheses_Should_Return_False() { var str = "(}"; bool result = SuperString.IsValidParentheses(str); Assert.False(result, "str should be false"); }
public UserInfo(string key, string user, string pass, int id) { KEY = key; USER = new SuperString(user, KEY + ":I"); PASS = new SuperString(pass, KEY + ":L"); ID = new SuperInt(id, KEY + ":F"); Save(); }
public UserInfo(string key) { KEY = key; USER = new SuperString("", KEY + ":I"); PASS = new SuperString("", KEY + ":L"); ID = new SuperInt(0, KEY + ":F"); Save(); }
static void Main(string[] args) { var str = "PAYPALISHIRING"; var rows = 3; string result = SuperString.ConvertToZigZag(str, rows); Console.WriteLine($"RESULT: {result}"); }
public SupeArayString(int n, string initv, string key) { N = n; STRINGS = new SuperString[N]; for (int i = 0; i < N; i++) { STRINGS[i] = new SuperString(initv, key + i); } }
public void Should_Return_ZigZag_String() { var str = "PAYPALISHIRING"; var rows = 3; string result = SuperString.ConvertToZigZag(str, rows); Assert.True(string.Equals(result, "PAHNAPLSIIGYIR")); }
public DeviceInfo(string key) { KEY = key; ID = new SuperString("", KEY + ":K"); MAC = new SuperString("", KEY + ":I"); NAME = new SuperString("", KEY + ":L"); INFO = new SuperString("", KEY + ":F"); SERVICE_UUID = new SuperString("", KEY + ":S"); Save(); }
public DeviceInfo(string key, string mac, string name, string service_uuid) { KEY = key; ID = new SuperString("", KEY + ":K"); MAC = new SuperString(mac, KEY + ":I"); NAME = new SuperString(name, KEY + ":L"); INFO = new SuperString("", KEY + ":F"); SERVICE_UUID = new SuperString("", KEY + ":S"); Save(); }
static void Main(string[] args) { var str = "(){}"; var result = SuperString.IsValidParentheses(str); if (result) { Console.WriteLine("The string has valid parentheses"); return; } Console.WriteLine("The string has no valid parentheses"); }
static void Main(string[] args) { SuperString c = new SuperString(); object o = c.goodnessSubstring(new string[] { }); if (o is IEnumerable) { foreach (object b in (IEnumerable)o) { System.Console.Out.WriteLine(b); } } else System.Console.Out.WriteLine(o); System.Console.In.ReadLine(); }
static void Main(string[] args) { Console.WriteLine("Введите количество СуперСтрок: "); int n = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Красава!"); SuperString[] NewString = new SuperString[n]; for (int counter = 1; counter <= n; counter++) { Console.WriteLine($"{counter} строка: "); NewString[counter - 1] = new SuperString(Console.ReadLine()); } Console.WriteLine("Введите количество синволов: "); int c = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Красава!"); for (int counter = 1; counter <= n; counter++) { if (NewString[counter - 1].Chars() == c) { Console.WriteLine($"{counter} строка: {NewString[counter - 1].str}"); } } Console.WriteLine("Введите слово: "); string word = Console.ReadLine(); Console.WriteLine("Красава!"); for (int counter = 1; counter <= n; counter++) { if (NewString[counter - 1].FindChars(word)) { Console.WriteLine($"{counter} строка: {NewString[counter - 1].str}"); } } Console.ReadLine(); for (int counter = 1; counter <= n; counter++) { Console.WriteLine(NewString[counter - 1].ToString()); } Console.ReadLine(); var SomeTypeSuperString = new { str = "123", number = 10 }; Console.ReadLine(); }
/// <summary> Desempaqueta lo que se haya mandado a la pila, para procesar cada expresión por aparte.</summary> void Unpackage() { #region 1. Stack no empty if (stack.Count == 0) { if (garbage.Count > 0) { regex = (string)garbage.Pop(); } else { regex = "?"; return; } } else { SuperString aux = (SuperString)stack.Peek(); regex = aux.data; } #endregion #region 2. Upload ultimo node if (!(ultimo.retornald() is null)) { if (ultimo.retornald().retornaDato().Equals("X") || ultimo.retornald().retornaDato().Equals("Y")) { SearchSide("right"); } else { SearchSide("left"); } } if (stack.Count > 0) { stack.Pop(); } #endregion #region 3. Check last index "*"or "+" BuiltSyntaticTreePlusAsteric("*"); BuiltSyntaticTreePlusAsteric("+"); #endregion #region Delete brackeys(if exists) DeleteBrackeysAndOtherShit(); #endregion }
/// <summary>Searches the side if is right or left sequence</summary> /// <param name="str">The string.</param> void SearchSide(string str) { object[] array; if (stack.Count > 0) { array = stack.ToArray(); for (int i = array.Length - 1; i >= 0; --i) { SuperString a = (SuperString)array[i]; if (a.side.Equals(str)) { if (fatherStack.Count == 0) { return; } ultimo = (Node)fatherStack.Pop(); if (str.Equals("right")) { ultimo = ultimo.retornald(); return; } if (str.Equals("left")) { ultimo = ultimo.retornali(); return; } } } } else if (garbage.Count > 0 || fatherStack.Count > 0) { ultimo = (Node)fatherStack.Pop(); if (str.Equals("right")) { ultimo = ultimo.retornald(); return; } if (str.Equals("left")) { ultimo = ultimo.retornali(); return; } } }
static void Main() { int o = 9; SuperString s = new SuperString(); s.LengthOfTheString("I have a cat", ref o); Console.Write("Введите символ, который хотите найти: "); string s1 = Console.ReadLine(); char p; s.IsThereSimbol("I have a cat", s1, out p); Console.WriteLine("Какой символ вы хотите заменить?"); string s2 = Console.ReadLine(); Console.WriteLine("На какой символ хотите заменить?"); string s3 = Console.ReadLine(); s.Change("I have a cat", s2, s3); Console.WriteLine(); SuperString st = new SuperString(); st.LengthOfTheString("You have a dog", ref o); Console.Write("Введите символ, который хотите найти: "); string s11 = Console.ReadLine(); st.IsThereSimbol("You have a dog", s11, out p); Console.WriteLine("Какой символ вы хотите заменить?"); string s22 = Console.ReadLine(); Console.WriteLine("На какой символ хотите заменить?"); string s33 = Console.ReadLine(); st.Change("You have a dog", s22, s33); Console.WriteLine(SuperString.GetInfo()); var v = new { Amount = 108, Message = "Hello" }; Console.WriteLine(v.Amount + v.Message); }
void Start() { SAVED_CONTENT = new SuperString("http://stgame.vn|Pikachu 2016|ads_pika2016.png", "tads534"); LOAD_COUNT = new SuperInt(0, "tadsloadcount"); if (LOAD_COUNT.Get() == 0) { Debug.Log("loading new ads"); GetADS(); } else { Debug.Log("no: load saved ads"); LOAD_COUNT.PlusAndSave(1); if (LOAD_COUNT.Get() >= 5) { LOAD_COUNT.SetAndSave(0); } ParseCONTENT(SAVED_CONTENT.STR, true); } }
//Иницализатор SuperString privateSuperString(string ArgStr, int Integer) { SuperString New = new SuperString(ArgStr, Integer); return(New); }