This repository contains a few simple programs as examples of computation in the snail programming language. These are useful both for understanding snail and also for basic test cases for an implementation of the language specification.
These are all positive test cases. That is, they should all scan, parse, and execute correctly. No negative test cases are provided in this current commit of the repository.
Descriptions of programs in this repository are provided below in alphabetical order.
arith.sl: a "menu-driven" interactive desktop calculator (includes an inlined version of atoi)array-sort.sl: an array example that includes sorting, dynamic allocation, and reversing.atoi.sl: an integer-to-string and string-to-integer class for snailcells.sl: simple cellular automaton simulatorcomplex.sl: a complex number arithmetic and equality regression testhello-int.sl: prints "9223372036854775807\n" to standard outputhello-world.sl: prints "Hello, world.\n" to standard outputlist.sl: a well-commented linked list exampleoh-no.sl: a torture regression test (called "hairy-scary" in Cool)primes.sl: a "methodless" program that enumerates all of the primes between 2 and 500. It is not a good example of object-oriented style, but shows of the expression-based-language features of snail.print-snail.sl: a more complicated "hello-world" that prints "snail\n"
These programs are released with the BSD 3-Clause open-source license. Please correctly attribute any derivatives of this work.
These programs are adapted from a set of example Cool programs released by Wes Weimer in 2007. Some of these programs were developed by others, who are directly attributed in the comments of each individual program.