Glava (Current Version: 1.6)
July 3, 2017 ยท View on GitHub
A Java dialect which is a golfing language. Thanks to PPCG.SE user ConorO'Brien for the new name.
Download the zip, the compiler is in the latest folder.
Run the jar with java -jar glava.jar C:\path\to\file.jg.
Shorthands added by Glava:
b|tobooleanc|toclassC|topublic classd|todoublef|tofloatf(tofor(F(toSystem.out.printf(i|tointI|toimportm|topublic static void main (String[] A) {M|toMath.n|tonewN|tonullp|topublicp(toSystem.out.print(P(toSystem.out.println(r|toreturns|toStringt|totry {(WIP)v|tovoidz|to import statements for commonly used classes (see below)#to[]$to={for array initialization
Other Cool Features:
- If you don't use the
z|shorthand anywhere in your code, Glava will automatically do it for you at the beginning of the file. - If you don't make a class, Glava will automatically surround the entire code in a
Mainclass to allow for running. See here for an example. - If you don't make a main method (
m|), Glava will automatically surround your code in one! - You can omit the last
",)s,}s, and]s at the end of the program because Glava will automatically fill them in for you! - Adding on to the previous feature, when the compiler has to add a
}to your code, it automatically places a semicolon (;) before it. - Multiline strings!
Default Import Statements:
java.util.*java.lang.*java.io.*java.awt.*javax.swing.*java.text.*java.util.regex.*
Pre-defined Variables:
int m = 0int n = 1double d = 0dfloat f = 0fString s = ""String t = ""String u = "abcdefghijklmnopqrstuvwxyz"String U = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"char c = 'A'boolean T = trueboolean F = false