Yoix ![]() |
http://www.research.att.com/sw/tools/yoix/ |
Description: | Yoix is a scripting language and interpreter written in pure Java. The language itself resembles a bit of both Java's and/or C's syntax, but is much more usable for scripting. |
Factorial | Michael Neumann |
/* * Calculate the factorial */ fac(n) { if (n > 1) return n * fac(n-1); else return 1; } yoix.stdio.printf("fac(6) = %d\n", fac(6)); |
Calculates the factorial. Results
720 . |
Hello World (1) | Michael Neumann |
// Hello World in Yoix import yoix.stdio.*; printf("Hello World\n"); |
Prints "Hello World" onto the
screen. |
Hello World (2) | Michael Neumann |
stdout.nextline = "Hello World";
|
Prints "Hello World" onto the
screen. |
Squares (1) | Michael Neumann |
int i; String str = ""; for (i = 1; i <= 10; i++) { str += toString(i*i) + " "; } yoix.stdio.printf(str + "\n"); |
Outputs the squares from 1 to
10. |
Squares (2) | Michael Neumann |
int i; Array arr = { 1,2,3,4,5,6,7,8,9,10 }; for (i = 0; i < arr@length; i++) { a[i] *= a[i]; } stdout.nextline = toString(a); |
Outputs the squares from 1 to
10. |