Imagine if you would, a head-to-head multiplayer battle in CodeCombat. The sides compete in a Starcraft-esque battle, each writing the code that determines the behaviour of their respective units. As far as I know, such a concept is more-or-less on the books for CodeCombat’s future.
However, creating such a system using the current UI would present a problem. As you and your opponent(s) write your respective code, you’ll obviously be wanting to test it. But if you just click the Cast button and your opponent’s code is run in its current state, chances are they’ll be halfway through typing a series of commands at the time, and your opponent’s code will return a syntax error or just be completely ineffectual.
I hence propose a system of multiple code ‘areas’. Each player could have a working area, where they can alter and improve their code. However, at the same time, they could have a functional, past copy of their code stored in an ‘active slot’, and it is this code that will be used when an opponent casts a spell to test their work. Having multiple ‘active slots’ could furthermore be useful for storing backups or running side-tests without having to comment out large blocks of code- It would be essentially analogous to keeping a bunch of backups in text docs.
I personally think a tab system (perhaps with each tab being an array entry?) that works in conjunction with the current drop-down system would be effective. It would be quite straightforward to have an option to set which tab as being your ‘active competitive slot’ at any one time. What do you guys think?