Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Commit f6f53d9

Browse files
authored
Merge pull request #5 from adityabharadwaj198/master
ran the small sample code
2 parents 434f30b + e6ef213 commit f6f53d9

29 files changed

+3668
-370
lines changed

README

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
2+
The examples directory contains a few small and not so small
3+
example programs which illustrate various aspects of the Cool
4+
programming language.
5+
6+
arith.cl Tests various aspects of arithmetic in Cool.
7+
8+
atoi.cl An implementation of the C function by the
9+
same name. It converts a String into an Int.
10+
11+
atoi_test.cl An example program using atoi.cl. Since you
12+
will most likely use atoi.cl in the first
13+
assignment, you should study this example.
14+
15+
list.cl A very simple program showing how to create a
16+
list data type for integers. It illustrates
17+
inheritance and dynamic dispatch.
18+
19+
book_list.cl Illustrates inheritance and in particular the
20+
mechanism of STATIC DISPATCH and the CASE
21+
statement.
22+
23+
cells.cl Models a one-dimensional cellular automaton.
24+
25+
cool.cl An short and obscure program.
26+
27+
io.cl Shows how to use the IO class. (input/output)
28+
29+
hairyscary.cl Exercises many of the obscure features of the
30+
language in obscure ways.
31+
32+
hello_world.cl The classic first program.
33+
34+
primes.cl An unusual prime number generator.
35+
36+
graph.cl A program reading descriptions of weighted-
37+
directed graphs from stdin in text format.
38+
39+
g1.graph A sample input to graph.cl
40+
41+
palindrome.cl Recognizes palindromes.
42+
43+
complex.cl Checks the = operator and cummulative effects of
44+
method calls via a complex number object.
45+
46+
life.cl The classic Game of Life
47+
48+
sort_list.cl A more complex example sorting lists of integers.
49+
50+

SampleInput.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
(* models one-dimensional cellular automaton on a circle of finite radius
2-
arrays are faked as Strings,
3-
X's respresent live cells, dots represent dead cells,
4-
no error checking is done *)
1+
52
class CellularAutomaton inherits IO {
63
population_map : String;
74

0 commit comments

Comments
 (0)