aboutsummaryrefslogtreecommitdiff
path: root/parex/evaltest.c
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-04-03 03:43:22 +0000
committerMike Buland <eichlan@xagasoft.com>2007-04-03 03:43:22 +0000
commitc613ec4abb31983babb6c87e637624a13ee60bd6 (patch)
treebe8cb278c3bace4ddc62bafe51cb7a113921ce05 /parex/evaltest.c
parenta8e7b44c9981dd5d65b0b97f1d2ee34927a0f2a5 (diff)
downloadlibbu++-c613ec4abb31983babb6c87e637624a13ee60bd6.tar.gz
libbu++-c613ec4abb31983babb6c87e637624a13ee60bd6.tar.bz2
libbu++-c613ec4abb31983babb6c87e637624a13ee60bd6.tar.xz
libbu++-c613ec4abb31983babb6c87e637624a13ee60bd6.zip
Deleted the egg example...it was annoying me.
Diffstat (limited to 'parex/evaltest.c')
-rw-r--r--parex/evaltest.c50
1 files changed, 0 insertions, 50 deletions
diff --git a/parex/evaltest.c b/parex/evaltest.c
deleted file mode 100644
index 7e8641e..0000000
--- a/parex/evaltest.c
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 * EVALTEST.C - part of the EGG system.
3 *
4 * Test program for the expression evaluator.
5 *
6 * By Shawn Hargreaves.
7 */
8
9
10#define USE_CONSOLE
11
12
13#include <stdlib.h>
14#include <stdio.h>
15#include <time.h>
16
17#include "egg.h"
18
19
20
21int main()
22{
23 char buf[256];
24 double result;
25 int error;
26
27 srand(time(NULL));
28
29 printf("\nTest program for the EGG expression evaluator module.\n\nEnter a formula, or a blank line to quit.\n\n\n");
30
31 for (;;) {
32 printf("> ");
33 fflush(stdout);
34
35 if (!fgets(buf, sizeof(buf), stdin) || (!buf[0]))
36 break;
37
38 result = evaluate(buf, &error, NULL);
39
40 if (error)
41 printf("\nError in expression!\n\n\n");
42 else
43 printf("\nevaluate(\"%s\") = %f\n\n\n", buf, result);
44 }
45
46 printf("\n\n");
47
48 return 0;
49}
50