record array(a,b,c,d,e,f,g)
global F, f
global w, t

procedure p1()
   write(" ----> ",image() | "none")
   write("copy(1) ----> ",image(copy(1)) | "none")
   write("copy(\"abc\") ----> ",image(copy("abc")) | "none")
   write("copy('aabbcc') ----> ",image(copy('aabbcc')) | "none")
   write("copy(main) ----> ",image(copy(main)) | "none")
   write("copy([1,2,3]) ----> ",image(copy([1,2,3])) | "none")
   write("copy(table(0)) ----> ",image(copy(table(0))) | "none")
   write("copy() ----> ",image(copy()) | "none")
   write("copy(&input) ----> ",image(copy(&input)) | "none")
   write("w := copy(write) ----> ",image(w := copy(write)) | "none")
end

procedure p2()
   write("w(image(w)) ----> ",image(w(image(w))) | "none")
   write("copy(array()) ----> ",image(copy(array())) | "none")
   write("copy := copy(copy) ----> ",image(copy := copy(copy)) | "none")
   write("x := copy(array) ----> ",image(x := copy(array)) | "none")
   write("x := x(1,2,3,4,5,6,7) ----> ",image(x := x(1,2,3,4,5,6,7)) | "none")
   write("x[-4] ----> ",image(x[-4]) | "none")
   write("v := copy(c) ----> ",image(v := copy(c)) | "none")
   write("x := repl(\"123\",4) ----> ",image(x := repl("123",4)) | "none")
   write("t := table() ----> ",image(t := table()) | "none")
   write("every i := 1 to 100 do t[i] := i ----> ",image(every i := 1 to 100 do t[i] := i) | "none")
end

procedure p3()
   write("x := sort(t) ----> ",image(x := sort(t)) | "none")
   write("every write((!x)[2]) ----> ",image(every write((!x)[2])) | "none")
   write("every write(center(\"abcdef\",1 to 20,\" \" | \"0\" | \"=-\")) ----> ",image(every write(center("abcdef",1 to 20," " | "0" | "=-"))) | "none")
   write("every write(left(\"abcdef\",1 to 20,\" \" | \"0\" | \"=-\")) ----> ",image(every write(left("abcdef",1 to 20," " | "0" | "=-"))) | "none")
   write("every write(right(\"abcdef\",1 to 20,\" \" | \"0\" | \"=-\")) ----> ",image(every write(right("abcdef",1 to 20," " | "0" | "=-"))) | "none")
   write("center(\"\",20,repl(\"x.\",30)) ----> ",image(center("",20,repl("x.",30))) | "none")
   write("left(\"\",20,repl(\"x.\",30)) ----> ",image(left("",20,repl("x.",30))) | "none")
   write("right(\"\",20,repl(\"x.\",30)) ----> ",image(right("",20,repl("x.",30))) | "none")
   write("every write(repl(\"a\" | \"ab\" | \"ba\",1 to 5)) ----> ",image(every write(repl("a" | "ab" | "ba",1 to 5))) | "none")
   write("repl(\"\",0) ----> ",image(repl("",0)) | "none")
   write("repl(&cset,0) ----> ",image(repl(&cset,0)) | "none")
end

procedure p4()
   write("trim(&lcase) ----> ",image(trim(&lcase)) | "none")
   write("trim(&lcase,&lcase) ----> ",image(trim(&lcase,&lcase)) | "none")
   write("image(2) ----> ",image(image(2)) | "none")
   write("image('cab') ----> ",image(image('cab')) | "none")
   write("image(&lcase) ----> ",image(image(&lcase)) | "none")
   write("image('abcdefghijklmnopqrstuvwxyz') ----> ",image(image('abcdefghijklmnopqrstuvwxyz')) | "none")
   write("image(&input) ----> ",image(image(&input)) | "none")
end

procedure p5()
   write("image() ----> ",image(image()) | "none")
   write("image(&null) ----> ",image(image(&null)) | "none")
   write("image([1,2,3]) ----> ",image(image([1,2,3])) | "none")
   write("image([]) ----> ",image(image([])) | "none")
   write("image([,]) ----> ",image(image([,])) | "none")
   write("image(table()) ----> ",image(image(table())) | "none")
   write("image(table(3)) ----> ",image(image(table(3))) | "none")
   write("image(list(0)) ----> ",image(image(list(0))) | "none")
   write("image(set()) ----> ",image(image(set())) | "none")
   write("image(set([1,2,3,3,3,3,3,4])) ----> ",image(image(set([1,2,3,3,3,3,3,4]))) | "none")
   write("image(repl) ----> ",image(image(repl)) | "none")
end

procedure p6()
   write("image(main) ----> ",image(image(main)) | "none")
   write("image(repl(&lcase,10)) ----> ",image(image(repl(&lcase,10))) | "none")
   write("image(array) ----> ",image(image(array)) | "none")
   write("image(a) ----> ",image(image(a)) | "none")
   write("image(array) ----> ",image(image(array)) | "none")
   write("image(image) ----> ",image(image(image)) | "none")
   write("string(2) ----> ",image(string(2)) | "none")
   write("string(\"2\") ----> ",image(string("2")) | "none")
   write("string(\" 2\") ----> ",image(string(" 2")) | "none")
end

procedure p7()
   write("string(\"2 \") ----> ",image(string("2 ")) | "none")
   write("string(\"+2\") ----> ",image(string("+2")) | "none")
   write("string(\"-2\") ----> ",image(string("-2")) | "none")
   write("string(\"- 2\") ----> ",image(string("- 2")) | "none")
   write("string(\" -    2 \") ----> ",image(string(" -    2 ")) | "none")
   write("string(\"\") ----> ",image(string("")) | "none")
   write("string(\"--2\") ----> ",image(string("--2")) | "none")
   write("string(\" \") ----> ",image(string(" ")) | "none")
   write("string(\"-\") ----> ",image(string("-")) | "none")
   write("string(\"+\") ----> ",image(string("+")) | "none")
end

procedure p8()
   write("string(\"22222222222222222222222222222222222222222222222222222222222\") ----> ",image(string("22222222222222222222222222222222222222222222222222222222222")) | "none")
   write("string(\"7r4\") ----> ",image(string("7r4")) | "none")
   write("string(\"4r7\") ----> ",image(string("4r7")) | "none")
   write("string(\"4r 7\") ----> ",image(string("4r 7")) | "none")
   write("string(\"7r 4\") ----> ",image(string("7r 4")) | "none")
   write("string(\"16rff\") ----> ",image(string("16rff")) | "none")
end

procedure p9()
   write("string(\"36rcat\") ----> ",image(string("36rcat")) | "none")
   write("string(\"36Rcat\") ----> ",image(string("36Rcat")) | "none")
   write("string(\"36rCAT\") ----> ",image(string("36rCAT")) | "none")
   write("string(\"1r1\") ----> ",image(string("1r1")) | "none")
   write("string(\"2r0\") ----> ",image(string("2r0")) | "none")
   write("type(0) ----> ",image(type(0)) | "none")
   write("type(\"abc\") ----> ",image(type("abc")) | "none")
   write("type('aba') ----> ",image(type('aba')) | "none")
   write("type() ----> ",image(type()) | "none")
   write("type(&null) ----> ",image(type(&null)) | "none")
end

procedure p10()
   write("type([]) ----> ",image(type([])) | "none")
   write("type(table()) ----> ",image(type(table())) | "none")
   write("type(main) ----> ",image(type(main)) | "none")
   write("type(write) ----> ",image(type(write)) | "none")
   write("type(array()) ----> ",image(type(array())) | "none")
   write("type(array) ----> ",image(type(array)) | "none")
   write("type(f) ----> ",image(type(f)) | "none")
   write("cset(2) ----> ",image(cset(2)) | "none")
end

procedure p11()
   write("cset(\"2\") ----> ",image(cset("2")) | "none")
   write("cset(\" 2\") ----> ",image(cset(" 2")) | "none")
   write("cset(\"2 \") ----> ",image(cset("2 ")) | "none")
   write("cset(\"+2\") ----> ",image(cset("+2")) | "none")
   write("cset(\"-2\") ----> ",image(cset("-2")) | "none")
   write("cset(\"- 2\") ----> ",image(cset("- 2")) | "none")
   write("cset(\" -    2 \") ----> ",image(cset(" -    2 ")) | "none")
   write("cset(\"\") ----> ",image(cset("")) | "none")
   write("cset(\"--2\") ----> ",image(cset("--2")) | "none")
   write("cset(\" \") ----> ",image(cset(" ")) | "none")
   write("cset(\"-\") ----> ",image(cset("-")) | "none")
end

procedure p12()
   write("cset(\"+\") ----> ",image(cset("+")) | "none")
   write("cset(\"22222222222222222222222222222222222222222222222222222222222\") ----> ",image(cset("22222222222222222222222222222222222222222222222222222222222")) | "none")
   write("cset(\"7r4\") ----> ",image(cset("7r4")) | "none")
   write("cset(\"4r7\") ----> ",image(cset("4r7")) | "none")
   write("cset(\"4r 7\") ----> ",image(cset("4r 7")) | "none")
end

procedure p13()
   write("cset(\"7r 4\") ----> ",image(cset("7r 4")) | "none")
   write("cset(\"16rff\") ----> ",image(cset("16rff")) | "none")
   write("cset(\"36rcat\") ----> ",image(cset("36rcat")) | "none")
   write("cset(\"36Rcat\") ----> ",image(cset("36Rcat")) | "none")
   write("cset(\"36rCAT\") ----> ",image(cset("36rCAT")) | "none")
   write("cset(\"1r1\") ----> ",image(cset("1r1")) | "none")
   write("cset(\"2r0\") ----> ",image(cset("2r0")) | "none")
   write("every write(seq()) \\ 10 ----> ",image(every write(seq()) \ 10) | "none")
   write("every write(seq(2)) \\ 10 ----> ",image(every write(seq(2)) \ 10) | "none")
   write("every write(seq(-10)) \\ 10 ----> ",image(every write(seq(-10)) \ 10) | "none")
   write("every write(seq(,3)) \\ 10 ----> ",image(every write(seq(,3)) \ 10) | "none")
end

procedure p14()
end

procedure main()
   p1()
   p2()
   p3()
   p4()
   p5()
   p6()
   p7()
   p8()
   p9()
   p10()
   p11()
   p12()
   p13()
   p14()
end

procedure wf (v)
    writes(left(v,5)," ")
    end
