# HG changeset patch # User Christian Urban # Date 1579899079 0 # Node ID b560f78781b9f53b8a4bfa929de80d0c8f6635c8 # Parent bfc8703b15278694bffa204824f29dcfcbb2d56f updated diff -r bfc8703b1527 -r b560f78781b9 coursework/cw04.tex --- a/coursework/cw04.tex Sat Dec 14 17:57:43 2019 +0000 +++ b/coursework/cw04.tex Fri Jan 24 20:51:19 2020 +0000 @@ -8,6 +8,9 @@ %https://github.com/Storyyeller/Krakatau %https://docs.oracle.com/javase/specs/jvms/se7/html/ +% Jasmin Tutorial +%http://saksagan.ceng.metu.edu.tr/courses/ceng444/link/jvm-cpm.html + \section*{Coursework 4 (Strand 1)} \noindent This coursework is worth 6\% and is due on 13 @@ -383,7 +386,7 @@ invokevirtual java/io/InputStream/read()I istore 2 iload 2 - ldc 10 ; the newline delimiter + ldc 10 ; the newline delimiter for Unix (Windows 13) isub ifeq Label2 iload 2 diff -r bfc8703b1527 -r b560f78781b9 handouts/ho01.tex --- a/handouts/ho01.tex Sat Dec 14 17:57:43 2019 +0000 +++ b/handouts/ho01.tex Fri Jan 24 20:51:19 2020 +0000 @@ -85,6 +85,10 @@ %You might also be surprised what %constraints programming languages impose about numbers: for example %123 in JSON is OK, but 0123 is not. +% +% The regex for JASON numbers is +% +% -?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)? Often we also face the problem that we are given a string, for example some user input, and we want to know whether it matches a particular diff -r bfc8703b1527 -r b560f78781b9 progs/hanoi.fun --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/progs/hanoi.fun Fri Jan 24 20:51:19 2020 +0000 @@ -0,0 +1,10 @@ +// towers of hanoi in Fun + +let rec hanoi = fun n a b c -> + if n != 0 then ( + hanoi (n - 1) a c b; + print_endline ("Move disk from pole " ^ (show a) ^ " to pole " ^ (show b)); + hanoi (n - 1) c b a + ) else ();; + +impure $ hanoi 4 1 2 3;; \ No newline at end of file