MasseGuillaume / ScalaKata

Moved
https://github.com/MasseGuillaume/ScalaKata2
121 stars 3 forks source link

Support passing initial code in query param #6

Closed eranation closed 11 years ago

eranation commented 11 years ago

This adds support to pass code via a query param. e.g.

http://scalatutorials.com/?code=var%20x%20%3D%201%20%2B%202%0Aprintln(x)%0Ax%20%3D%203%20*%204%0Aprintln(x)

opens the editor with this:

var x = 1 + 2
println(x)
x = 3 * 4
println(x)

There is a limit to the code length as it's passed via GET params, but it should support most use cases I think...

MasseGuillaume commented 11 years ago

https://github.com/MasseGuillaume/ScalaKata/commit/77e1af8296d9f7fc0b94696093e1b23e8b63af0e