aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-09-30 16:46:18 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-09-30 16:46:18 -0400
commit8e354d0b3d76eac27fe2c533db275e21f983b8dd (patch)
tree84bc3966eeb12ff0053d0bbf9e3783806c747f42
parent4509eb5ac0a2150986933495cf0a3ae9a1d24e53 (diff)
Add more of Tino's tests
-rw-r--r--Testing/General/test-0.p27
-rw-r--r--Testing/General/test-1.p38
-rw-r--r--Testing/General/test-2.p38
-rw-r--r--Testing/General/test-3.p10
-rw-r--r--Testing/General/test-4.p8
-rw-r--r--Testing/General/test-5.p12
6 files changed, 133 insertions, 0 deletions
diff --git a/Testing/General/test-0.p b/Testing/General/test-0.p
new file mode 100644
index 0000000..838d264
--- /dev/null
+++ b/Testing/General/test-0.p
@@ -0,0 +1,27 @@
+program main(input);
+ var a: integer;
+ var b: array[1 .. 10] of real;
+ var x: real;
+ function foo(x: integer; y: real):integer;
+ begin
+ foo := foo(x-1) + 1;
+ x := 13
+ end;
+begin
+ if ( x > 3.14 and x < 0.0 ) then
+ x := 1.0
+ else
+ x := 0.0
+end.
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Testing/General/test-1.p b/Testing/General/test-1.p
new file mode 100644
index 0000000..27857a1
--- /dev/null
+++ b/Testing/General/test-1.p
@@ -0,0 +1,38 @@
+(* this is a sample test quiz Pascal program *)
+(* date: March 23, 2006 *)
+
+program main( input, output );
+
+ var x,y,z: integer;
+ var p,q: real;
+ var a: array [ 1..10 ] of integer;
+ var b: array [ 10..15 ] of real;
+
+ function foo( x: integer; c: real; y: integer; b: real ) : integer;
+
+ var p: integer;
+ var q: real;
+
+ procedure boo( z: real; k: integer );
+ begin (* boo *)
+ a[k] := y
+ end; (* boo *)
+
+ begin (* foo *)
+ boo( b[a[x+y]+1], foo( x,a,y,b ));
+ foo := foo( a[k-k], b[20], a[x-y], q )
+ end; (* foo *)
+
+begin
+ y := 5;
+ for x := 1 to (2*y) do
+ begin
+ a[x] := foo( 1, b[10], x, b[a[10]] );
+ if ( x <= 5 and x > 0 and x < y ) then
+ if ( a[x] < foo( a[1], 3.14, y+z*a[3], 2.13 )) then
+ y := a[x]
+ else
+ y := foo( a[x]+1, b[a[x]], a[a[x+1]], b[13+foo(1,2.3,4,5.6)] )
+ end
+end.
+
diff --git a/Testing/General/test-2.p b/Testing/General/test-2.p
new file mode 100644
index 0000000..511da8f
--- /dev/null
+++ b/Testing/General/test-2.p
@@ -0,0 +1,38 @@
+(* this is a sample test quiz Pascal program *)
+(* date: March 23, 2006 *)
+
+program main( input, output );
+
+ var x,y: integer;
+ var p,q: real;
+ var a: array [ 1..10 ] of integer;
+ var b: array [ 10..15 ] of real;
+
+ function foo( i: integer; u: real; j: integer; v: real ) : integer;
+
+ var k: integer;
+ var w: real;
+
+ procedure boo( r: real; s: integer );
+ begin (* boo *)
+ a[s] := j
+ end; (* boo *)
+
+ begin (* foo *)
+ boo( b[a[x+y]+i], foo( i,u,j,v ));
+ foo := foo( a[y-y], b[20+x*x], a[x-y], q-p )
+ end; (* foo *)
+
+begin
+ y := 5;
+ for x := 1 to ( 2 * y + a[x] ) do
+ begin
+ a[x] := foo( 1, b[x]+b[y], x, b[a[10]] );
+ if ( (x <= 5) and (x > 0) and (x < y) ) then
+ if ( a[x] < foo( a[1], 3.14, y+x*a[3], 2.13 )) then
+ y := a[x]
+ else
+ y := foo( a[x]+1, b[a[x]], a[a[x+1]], b[13+foo(1,2.3,4,5.6)] )
+ end
+end.
+
diff --git a/Testing/General/test-3.p b/Testing/General/test-3.p
new file mode 100644
index 0000000..b4cbf29
--- /dev/null
+++ b/Testing/General/test-3.p
@@ -0,0 +1,10 @@
+program main( input, output );
+ var a,b,c: integer;
+ function foo( x,y: integer ): integer;
+ begin
+ foo := x + foo( x, y )
+ end;
+begin
+ a := foo( b, c )
+end.
+
diff --git a/Testing/General/test-4.p b/Testing/General/test-4.p
new file mode 100644
index 0000000..434c548
--- /dev/null
+++ b/Testing/General/test-4.p
@@ -0,0 +1,8 @@
+program main( input, output );
+ var x, y: integer;
+begin
+ read(x);
+ y := (x + 1) * (x - 1);
+ write(y)
+end.
+
diff --git a/Testing/General/test-5.p b/Testing/General/test-5.p
new file mode 100644
index 0000000..b71a6b4
--- /dev/null
+++ b/Testing/General/test-5.p
@@ -0,0 +1,12 @@
+program main( input, output );
+ var x, y: integer;
+ function foo( x, y: integer ): integer;
+ begin
+ foo := x * x - y * y
+ end;
+begin
+ read(x);
+ y := foo( x+1, x-1 );
+ write(y)
+end.
+