Friday, December 11, 2009

Sample program 1

import "fact.o";

######This is a comment


#This will call the fact function
#and test the output against the 6

fact(3)->6;

fact(4) -> 24;

# : is the range operation
# {} is a group of expected outputs

fact(3:5) -> {6, 24, 120};

# no expected output just prints the result
fact(3:5);

# print messages to sdout
print "A message to stdout!";

# Grouped inputs along with grouped outputs
fact({2,4}) -> {2, 24};

No comments:

Post a Comment