Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #14 // tb/sol_lua_eval.java

Source file

package tb;

import net.luaos.tb.common.Solution;

/** treats input as Lua expression, evaluates it and returns result (as string) */
public class sol_lua_eval extends Solution {
  public String compute(String input) {
    // We need a full statement, not just an expression, so we add "return"
    String code = "return (" + input + ")";
    return sol_lua.callLuaSolution(sol_lua.createLuaEnvironment(), code, null);
  }
}

download  show line numbers   

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Image recognition results

Recognizer Recognition Result Visualize Recalc
#308 424 [visualize]

Snippet ID: #14
Snippet name: tb/sol_lua_eval.java
Eternal ID of this version: #14/1
Text MD5: a006981982f4337c3b46b52ae0751970
Author: stefan
Category:
Type: Source file
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified:
Source code size: 424 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 908 / 265
Referenced in: [show references]