-
-
Save SocraticPhoenix/5f76a9075c2e6f036c16dc68b5dcf984 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
byte[] message = Tio.formatter() | |
.setInput("hello\n") | |
.setArgs("lol") | |
.setLang("shnap") | |
.setCode("println(sys.args[0]) println(sys.input())") | |
.format(); | |
TioQueryResponse queryResponse = Tio.query(message); | |
if (queryResponse.getResponse().isPresent()) { | |
TioResponse response = queryResponse.getResponse().get(); | |
System.out.println(response.get(TioResponse.Field.OUTPUT)); | |
System.out.println(); | |
System.out.println(response.get(TioResponse.Field.DEBUG)); | |
} else { | |
System.out.println("Response code: " + queryResponse.getCode()); | |
if (queryResponse.getError().isPresent()) { | |
System.out.println("Error: "); | |
queryResponse.getError().get().printStackTrace(System.out); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment