// JavaScript code generated by DuoCode
GetBestMove = function(board, player, winner)
That line will garbage the global scope.. // JavaScript code generated by DuoCode
GetBestMove = function(board, player, winner)
That line will garbage the global scope..(Consider: the C# code has no main function, so, if we hid the GetBestMove definition from the rest of the webpage, it would never get called. The optimal Javascript compilation would be an empty string, and that's clearly not valuable.)
var AI = {
GetBestMove: function(....) { ... },
...
};
?Another thing, I had someone tell me once that according to Erik Meijer (of LINQ and Rx fame), years ago, Microsoft tried a C#-to-JS compiler too. It worked, but they had good reasons to drop the project anyway. Did you ever hear about that, do you know Microsoft's reasons for doing TypeScript instead? Are they still valid?