Browse Source

Updated for polaris and added texts to gitignore

master
Christopher M. Mahoney - mahonec 3 years ago
parent
commit
d50d31557d
  1. 2
      .gitignore
  2. 1
      bit.txt
  3. 14
      jabber.c
  4. BIN
      kapow.txt
  5. 1
      out.txt
  6. 6
      wocky.c
  7. 1
      zap.txt

2
.gitignore

@ -1 +1,3 @@
bin/*
*.txt

1
bit.txt

@ -1 +0,0 @@
010010000110010101101100011011000110111100001010

14
jabber.c

@ -59,13 +59,15 @@ void jabber( FILE *ifp, FILE *ofp ) {
int index = 0;
int bits = 0;
for (int i = 0; i < sz; ++i) {
int i;
for (i = 0; i < sz; ++i) {
char c = buffer[i];
if (c == '0') {
if (cursor -> zero == NULL) {
// Print index
for (int j = bits - 1; j >= 0; --j) {
int j;
for (j = bits - 1; j >= 0; --j) {
fputc('0' + ((cursor -> index >> j) & 1), ofp);
}
@ -82,7 +84,8 @@ void jabber( FILE *ifp, FILE *ofp ) {
} else if (c == '1') {
if (cursor -> one == NULL) {
// Print index
for (int j = bits - 1; j >= 0; --j) {
int j;
for (j = bits - 1; j >= 0; --j) {
fputc('0' + ((cursor -> index >> j) & 1), ofp);
}
@ -110,13 +113,16 @@ void jabber( FILE *ifp, FILE *ofp ) {
}
// Final index
for (int j = bits - 1; j >= 0; --j) {
int j;
for (j = bits - 1; j >= 0; --j) {
fputc('0' + ((cursor -> index >> j) & 1), ofp);
}
//printTree(root, 0);
}
int rec[1];
//int rec[1000000];
void printTree(node * curr, int depth)
{

BIN
kapow.txt

1
out.txt

@ -1 +0,0 @@
Hello

6
wocky.c

@ -66,7 +66,8 @@ void wocky ( FILE *ifp, FILE *ofp ) {
int read = 0; // Number of bits currently read
char c;
for (int i = 0; i <= sz; ++i) {
int i;
for (i = 0; i <= sz; ++i) {
c = buffer[i];
if (read == length) {
// Print prefix at index
@ -76,7 +77,8 @@ void wocky ( FILE *ifp, FILE *ofp ) {
if (t_length == t_capacity) {
// Double capacity
element ** new_table = malloc(2 * t_capacity * sizeof(element*));
for (int j = 0; j < t_capacity; ++j) {
int j;
for (j = 0; j < t_capacity; ++j) {
new_table[j] = table[j];
}
free(table);

1
zap.txt

@ -1 +0,0 @@
0010101000110010101110011100011001001111101001010101101010100100100001
Loading…
Cancel
Save