API for IDE integration

Hi,

it would be great to have an API to write IDE integrations.

  • That way you can select a Game / Contest over the API
  • You get the default xcode or the last user code
  • You can write the code in your loved IDE (e.g. Visual Studio) with all Features you like
  • You can upload the code an get the result an a Link to the “Simulation”
  • With the link you can open a small browser window to check the outputs and the simulation

When you have such an API, the community will build several plugin for several IDEs and the progamming is more easier than in the brwoser.

5 Likes

The whole point of this website is that you use the website IDE, give it a chance.

@heicore1: Yes maybe one day, but we are not there yet (though I see it down on our priority list) . So many things to do, so little time :).

Thanks for your replay.
It was only an Idea.
The Browser IDE is not bad. But its also hard to reimplement all the feature a developer loves in his IDE.

You made a great job with this site.

1 Like

This is a HUGE idea !

It’s a great feature AND it could free a lot of your time if you not longer have to recreate eclipse… More time => more epic contests ! :slight_smile:

@CvxFous I think we as developers like to simplify things for ourselfs and make it comfortable.
Many of us are using highly customized development environments which help us in process of creating great code.
I really like your site editor vim-mode but nevertheless when I use it instead my comfortable vim setup I feel like my sonic screwdriver was replaced with a lump of metal.
So I think public API for integration is amazing idea.

1 Like

When I follow the scala course en coursera, their submission mechanism is exactly as what you described.

1 Like

For Visual Studio, I use an approach for game contests that help me a lot. I override the Console so it reads and compares from the test data provided. start developing all my code in VS and in the end move it in the coding game IDE. this is around one very simple class and have one line starting and the end of the main function, so remarking them is easy when you want to submit the code.

Another important concept is that you must write all your code on one script or file, even though I dont like that, but Im thinking to build a post build action to group all the code from my classes to a single file the copy and past it in the Online IDE, if there is such API it would make it more fun.

if any are interested here is my code (this is not tuned but only for fun)
public class ConsoleTesting
{

    public ConsoleTesting(string[] args)
    {
       

        var pathInput = System.IO.Path.Combine(Environment.CurrentDirectory, "Data", args[0]);
        var pathOutput = System.IO.Path.Combine(Environment.CurrentDirectory, "Data", args[1]);

        var pathResult = System.IO.Path.Combine(Environment.CurrentDirectory, "Data", "Result.txt");
        //  Console.SetIn(new StreamReader(path));

        try
        {
            Console.SetOut(new CodingForFunWriter(pathOutput));     
            Console.SetIn(new StreamReader(pathInput));
        }
        catch (IOException e)
        {
          Console.Error.WriteLine(e.Message);
        }
    }
    public void Closing()
    {
       // writer.Close();
        // Recover the standard output stream so that a 
        // completion message can be displayed.
        StreamWriter standardOutput = new StreamWriter(Console.OpenStandardOutput());
        standardOutput.AutoFlush = true;
        Console.SetOut(standardOutput);
        Console.WriteLine("==================================");

        Console.ReadKey();
    }
}
class CodingForFunWriter : TextWriter
{
    StreamReader CompareFile;
    public CodingForFunWriter(string Path)
    {

        CompareFile = new StreamReader(Path);

    }
    private TextWriter originalOut = Console.Out;

    public override void WriteLine(string value)
    {
        originalOut.WriteLine(value);

        var Expected = CompareFile.ReadLine();

        if (!value.Equals(Expected))
        {
            originalOut.WriteLine("Fail");
            originalOut.WriteLine("Found: " + value);
            originalOut.WriteLine("Expected: " + Expected);

            //  throw new Exception("Failed to get correct result");
        }
        else
            originalOut.WriteLine(value);
    }

    public override Encoding Encoding
    {
        get { throw new Exception("The method or operation is not implemented."); }
    }
}

then in your main
static void Main(string[] args)
{
var consoleTesting = new ConsoleTesting(args);
//start from here



//returning normal
consoleTesting.Closing();

1 Like

Would love to see this feature. Two very big advantages to this for me would be.

  1. Could use IDE from work to look like working while actually codingaming. This would help a bunch of us from my workplace who enjoy the site. Especially for doing contests between us.

  2. Open the door to Android (or other mobile OS) support via an existing IDE, or a custom user created one.