+ 3

A sololearn Bug

why does it say stor../Playground// in this code https://code.sololearn.com/cA11A1826A8a It is indeed strange...

4th Apr 2021, 4:10 AM
Endro
Endro - avatar
1 Réponse
+ 1
It looks like the variable "what" is unaffected and something is translating or trying to hide file paths after. It seems fair to say that Sololearn has a bug in how they process standard output from the programs they run. Running this in Python also outputs "stor../Playground//" print("stor/elec/bio/med/") so this bug is probably affecting output from all types of Sololearn Playground codes. If that is done to prevent us from seeing file paths, that would be ineffective because I printed your string anyway. If it had some secret, you could see the original value anyway. I experimented with the code and commented my findings here: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { string what = "stor/elec/bio/med/";//I type this // The following loop outputs: s t o r / e l e c / b i o / m e d /.. foreach (char c in what) { Console.Write(" " + c); } Console.WriteLine(".."); Console.WriteLine(what);//it outputs stor../Playground// Console.WriteLine("elec/bio/med/");//it outputs elec/bio/med/ Console.WriteLine("/elec/bio/med/");//it outputs ../Playground// Console.WriteLine("/hello/world/hi/");//it outputs ../Playground// Console.WriteLine("stor/elec/bio/med/");//it outputs stor../Playground// Console.WriteLine("stor/" + "elec/bio/med/");//it outputs stor../Playground// Console.Write("stor/"); // it outputs stor Console.Write("elec/bio/med/");//it outputs ../Playground// Console.WriteLine("----"); Console.WriteLine(what.Contains("Playground"));//it denies it's existance Console.WriteLine(what.Contains("bio"));//it still believes the og value is true } } }
4th Apr 2021, 6:07 AM
Josh Greig
Josh Greig - avatar