From 20c5ea20deddfc593dc6c5251b679f27922de1e2 Mon Sep 17 00:00:00 2001 From: Flummi Date: Mon, 11 Dec 2017 18:09:16 +0100 Subject: [PATCH] irgendwas mit es6 --- src/inc/trigger/lib/sandbox.mjs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/inc/trigger/lib/sandbox.mjs b/src/inc/trigger/lib/sandbox.mjs index 80f8633..9f37d9d 100644 --- a/src/inc/trigger/lib/sandbox.mjs +++ b/src/inc/trigger/lib/sandbox.mjs @@ -11,7 +11,7 @@ const hsimports = [ "Data.Ord", "Data.Set", "Data.String", "Data.Tuple", "Data.Word" ].map(imp => { return `import qualified ${imp}`; }).join("\r\n"); -function sandbox(lang, code) { +const sandbox = (lang, code) => { const langs = { cpp: { "LanguageChoice": "7", @@ -83,18 +83,18 @@ function sandbox(lang, code) { reject("Error!"); }) }); -} +}; -function bfgen(text) { +const bfgen = text => { let out = "+".repeat(10) + "["; let repeat = 0; for (let i = 0; i < text.length; i++) repeat = text.charCodeAt(i) - text.charCodeAt(i) % 10; - out += repeat > 10 ? '>' + "+".repeat(repeat / 10) : null; + out += repeat > 10 ? ">" + "+".repeat(repeat / 10) : null; out += "<".repeat(out.split(">").length - 1) + "-]"; for (let i = 0; i < text.length; i++) out += ">" + "+".repeat(text.charCodeAt(i) % 10) + "."; return out; -} +}; export { maxoutput, sandbox, bfgen, hsimports }; \ No newline at end of file