Update app.py
Browse files
app.py
CHANGED
|
@@ -12,13 +12,15 @@ from code_editor import code_editor
|
|
| 12 |
lang_map = {
|
| 13 |
"Python": ["python", "python", "# Don't Worry, You Can't Break It. We Promise.\nprint('Hello World')\n"],
|
| 14 |
"CPP": ["c_cpp", "cpp", "// Don't Worry, You Can't Break It. We Promise.\n// For Cpp, please make sure the program lasts at least 1 ms.\n"],
|
| 15 |
-
"Java": ["java", "java", "// Don't Worry, You Can't Break It. We Promise.\n"],
|
| 16 |
-
"JavaScript": ["javascript", "javascript", "// Don't Worry, You Can't Break It. We Promise.\n"],
|
| 17 |
-
"Golang": ["golang", "go", "// Don't Worry, You Can't Break It. We Promise.\n"],
|
| 18 |
"Ruby": ["ruby", "ruby", "# Don't Worry, You Can't Break It. We Promise.\nputs 'Hello World'\n"],
|
| 19 |
-
"Rust": ["rust", "rust", "// Don't Worry, You Can't Break It. We Promise.\nfn main() {\
|
| 20 |
}
|
| 21 |
|
|
|
|
|
|
|
| 22 |
def post_task(lang, code, libs=None, timeout=30, memory_profile=False):
|
| 23 |
url = 'https://monolith.cool/execute'
|
| 24 |
data = {'language': lang, 'code': code, 'libraries': libs, 'timeout': timeout, 'run_memory_profile': memory_profile}
|
|
|
|
| 12 |
lang_map = {
|
| 13 |
"Python": ["python", "python", "# Don't Worry, You Can't Break It. We Promise.\nprint('Hello World')\n"],
|
| 14 |
"CPP": ["c_cpp", "cpp", "// Don't Worry, You Can't Break It. We Promise.\n// For Cpp, please make sure the program lasts at least 1 ms.\n"],
|
| 15 |
+
"Java": ["java", "java", "// Don't Worry, You Can't Break It. We Promise.\nclass HelloWorld\n{\n\tpublic static void main(String[] args){System.out.println('Hello, World');}}\n"],
|
| 16 |
+
"JavaScript": ["javascript", "javascript", "// Don't Worry, You Can't Break It. We Promise.\nconsole.log('Hello World!');\n"],
|
| 17 |
+
"Golang": ["golang", "go", "// Don't Worry, You Can't Break It. We Promise.\npackage main\nimport 'fmt'\nfunc main() {\n\tfmt.Println('hello world')\n}\n"],
|
| 18 |
"Ruby": ["ruby", "ruby", "# Don't Worry, You Can't Break It. We Promise.\nputs 'Hello World'\n"],
|
| 19 |
+
"Rust": ["rust", "rust", "// Don't Worry, You Can't Break It. We Promise.\nfn main() {\n\tprintln!('Hello World!'); \n}\n"],
|
| 20 |
}
|
| 21 |
|
| 22 |
+
|
| 23 |
+
|
| 24 |
def post_task(lang, code, libs=None, timeout=30, memory_profile=False):
|
| 25 |
url = 'https://monolith.cool/execute'
|
| 26 |
data = {'language': lang, 'code': code, 'libraries': libs, 'timeout': timeout, 'run_memory_profile': memory_profile}
|