diff options
author | Mike Buland <mike@xagasoft.com> | 2013-04-15 15:28:12 -0600 |
---|---|---|
committer | Mike Buland <mike@xagasoft.com> | 2013-04-15 15:28:12 -0600 |
commit | f34eb76357fdfc314d6451fd11a2e4d6fcfce434 (patch) | |
tree | d4769ae51a1c703b0e55af0ef38a31991f9f7c3a /src/main.cpp | |
download | clic-f34eb76357fdfc314d6451fd11a2e4d6fcfce434.tar.gz clic-f34eb76357fdfc314d6451fd11a2e4d6fcfce434.tar.bz2 clic-f34eb76357fdfc314d6451fd11a2e4d6fcfce434.tar.xz clic-f34eb76357fdfc314d6451fd11a2e4d6fcfce434.zip |
Initial checkin.
This project will most likely just be stuck into libbu++, but I didn't
want to deal with building it all in windows.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..be49a1d --- /dev/null +++ b/src/main.cpp | |||
@@ -0,0 +1,54 @@ | |||
1 | #include "number.h" | ||
2 | #include "packedintarray.h" | ||
3 | |||
4 | #include <bu/sio.h> | ||
5 | using namespace Bu; | ||
6 | |||
7 | void packedtest1() | ||
8 | { | ||
9 | println("-==- Packed Int Test -==-"); | ||
10 | |||
11 | PackedIntArray a(4); | ||
12 | a.append( 3 ); | ||
13 | a.append( 9 ); | ||
14 | a.append( 5 ); | ||
15 | |||
16 | println("%1").arg( a.toString() ); | ||
17 | println("%1").arg( a.toBitString() ); | ||
18 | println("%1").arg( PackedIntArray(4, 10).toString() ); | ||
19 | |||
20 | PackedIntArray b(5); | ||
21 | for( int j = 0; j < 16; j++ ) | ||
22 | { | ||
23 | b.append( 21 ); | ||
24 | if( b[j] != 21 ) | ||
25 | { | ||
26 | println("Error at position %1").arg( j ); | ||
27 | println("Raw: %1 (%2)").arg( b.toBitString() ).arg( b.toString() ); | ||
28 | } | ||
29 | } | ||
30 | } | ||
31 | |||
32 | void numbertest1() | ||
33 | { | ||
34 | println("-==- Number test -==-"); | ||
35 | |||
36 | Number a("523"); | ||
37 | Number b("498"); | ||
38 | |||
39 | println("%1 + %2 = %3"). | ||
40 | arg( a.toString() ). | ||
41 | arg( b.toString() ). | ||
42 | arg( (a + b).toString() ); | ||
43 | } | ||
44 | |||
45 | int main( int argc, char *argv[] ) | ||
46 | { | ||
47 | println("CliC"); | ||
48 | |||
49 | packedtest1(); | ||
50 | // numbertest1(); | ||
51 | |||
52 | return 0; | ||
53 | } | ||
54 | |||