Awesome
Glava (Current Version: 1.6)
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|
toboolean
c|
toclass
C|
topublic class
d|
todouble
f|
tofloat
f(
tofor(
F(
toSystem.out.printf(
i|
toint
I|
toimport
m|
topublic static void main (String[] A) {
M|
toMath.
n|
tonew
N|
tonull
p|
topublic
p(
toSystem.out.print(
P(
toSystem.out.println(
r|
toreturn
s|
toString
t|
totry {
(WIP)v|
tovoid
z|
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
Main
class 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 = 0
int n = 1
double d = 0d
float f = 0f
String s = ""
String t = ""
String u = "abcdefghijklmnopqrstuvwxyz"
String U = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
char c = 'A'
boolean T = true
boolean F = false