From 6e2767e06650ef109b5e10386e54138d35160468 Mon Sep 17 00:00:00 2001 From: Matthew Slowe Date: Sat, 18 Aug 2018 15:49:31 +0100 Subject: [PATCH] removed C code as moved to another repo --- Makefile | 32 -------- src/Makefile | 12 --- src/a.out | Bin 16625 -> 0 bytes src/dir.c | 39 ---------- src/dir.h | 19 ----- src/dir.o | Bin 908 -> 0 bytes src/grid.c | 197 ------------------------------------------------- src/grid.h | 26 ------- src/grid.o | Bin 4504 -> 0 bytes src/rnd.c | 90 ---------------------- src/rnd.h | 7 -- src/rnd.o | Bin 1624 -> 0 bytes src/t | Bin 8342 -> 0 bytes src/t.c | 17 ----- src/tags | 49 ------------ src/wordsearch | Bin 13716 -> 0 bytes 16 files changed, 488 deletions(-) delete mode 100755 Makefile delete mode 100755 src/Makefile delete mode 100755 src/a.out delete mode 100755 src/dir.c delete mode 100755 src/dir.h delete mode 100755 src/dir.o delete mode 100755 src/grid.c delete mode 100755 src/grid.h delete mode 100755 src/grid.o delete mode 100755 src/rnd.c delete mode 100755 src/rnd.h delete mode 100755 src/rnd.o delete mode 100755 src/t delete mode 100755 src/t.c delete mode 100755 src/tags delete mode 100755 src/wordsearch diff --git a/Makefile b/Makefile deleted file mode 100755 index 5228043..0000000 --- a/Makefile +++ /dev/null @@ -1,32 +0,0 @@ -JAVA = /usr/bin/java -# JAVAFLAGS = -version # -classpath $(LIBS) -JAVAC = /usr/bin/javac -JFLAGS = -g # -classpath $(LIBS) - -SRCS = uk/org/mafoo/wordsearch/GridFactory.java \ - uk/org/mafoo/wordsearch/Bounds.java \ - uk/org/mafoo/wordsearch/CouldNotPlaceWordException.java \ - uk/org/mafoo/wordsearch/Direction.java \ - uk/org/mafoo/wordsearch/DistributedRandomNumberGenerator.java \ - uk/org/mafoo/wordsearch/Modes.java - -OBJS = ${SRCS:.java=.class} - -.SUFFIXES: .java .class - -all: build wordsearch.jar - -run: all - $(JAVA) uk.org.mafoo.wordsearch.GridFactory 15 15 - -.java.class: - $(JAVAC) $(JFLAGS) $< - -build: $(OBJS) - -clean: - rm -f $(OBJS) wordsearch.jar wordsearch.war - -wordsearch.jar: build - jar cf $@ $(OBJS) - cp wordsearch.jar war/WEB-INF/lib diff --git a/src/Makefile b/src/Makefile deleted file mode 100755 index 3a57958..0000000 --- a/src/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -CC=gcc -CFLAGS=-DDEBUG_GRID_MAIN -std=c99 -g -DEPS=dir.o rnd.o grid.o - -wordsearch: $(DEPS) - $(CC) -o wordsearch $(DEPS) $(CFLAGS) - -%.o: %.c - $(CC) -c -o $@ $< $(CFLAGS) - -clean: - rm $(DEPS) diff --git a/src/a.out b/src/a.out deleted file mode 100755 index 7878bcb494e736326dd336c5bcfa01c9a63a088f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16625 zcmeHOe{@vUoxgA9W%5EMlYvAFh1O9*i!J#9L<%CBKn4u*O9+Uf4wKAeW@Ivx&JTXH zpum8V4tSuo_Q&C@x^}f^7pvRdRaVv>Fe=*GU9{b9TX$R9#Ws|9PPS6Dtu_1k-23k2 zCD88noc(9d;m*15d%ySl^M3Drciy}2-g|<}78`~kbaDx|Aa;6>X*C1BFjG;QML<-D z>0&CN2UVms?*tEW00PWqs56n>$Q{5tc9|A)4RB`CP%Sfn5RheV^9#XDc>zcs>k8y2 zO^f+Pmk_IvX_s^qMJ?#HpfL{sXC|FCnB!0qhi&FI;LMt~>djo_YgIyg?SN@9?*WZj z({BbH=mm-TVP32T-Ra+ZsAHx)eQ!)AIvbOb`eY)N-`bE(H_TEr%96fh#adidJE(Ia zGG%L#89UN{;C}SZ_pVuRr2o{e=+7&jcy@K>$9-%!+?G0ItO6ncRMtIl(|;ak*_j$0 z$OM#~jUxVuG4usv@M&Z4gaZ$t{9y-9edv->B0i^t2|;}I7(6frZySSG0$+yyVQj{W zY9SEUF2-|?2(_;aWpj~4DwNMgBO+O z6HX@6T_P0f%5Ce7hB`wEqe^HBXL6yQa3UqTGtnrR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;a8#l8f5kb?-Aa+PJPR8FzT-y6AE_!Xu5g9KCj*D&XH-5vuoDm@6;-;`W9rPly_ zl>=`DuD>~v&hHoUqz|A0>25$BF9ZM72Y~ZC6#&L@mG}yvj<13E9wos}^oR4PPQ+i- z2q5wA0CKU0Bail+F)$rmG~@h-TwicqP*9^KLI>n2ClzL zP~T%?=uZQer>(&2hx~J6=-&md7pf`G|1$*OR&+nLw=EgTVECLi*dl`5eLi<9W{C z0oRHCj>D8V(jSw=<-qjv1tbI*KC?q1$ zOf;6r;*BPh>j`z?Z4?js7pV$`BI!^pneGfHLlL}KXG7uqR=g(jl|2`YG|ahX-b`q| z2vdl!Eb0X$gqMoUHXLN-D@!Eb(}Q|oK$uaPILvg&iGa#dnLSOjOF3&|f#np*uXN}zfBj=zm zLS*l-KLrLDI@#{e?%q&*i(Ew*ErM5En?(Om5b2Q&7sxyU9l(`&Snv?k;RnK jA`w^?jWc>!NY~_eQ)@`hbKWDa%@+R+m11h8 diff --git a/src/dir.c b/src/dir.c deleted file mode 100755 index ad37f48..0000000 --- a/src/dir.c +++ /dev/null @@ -1,39 +0,0 @@ -#include "dir.h" -#include "rnd.h" - -int directions[] = { - DIRECTION_N, - DIRECTION_NE, - DIRECTION_E, - DIRECTION_SE, - DIRECTION_S, - DIRECTION_SW, - DIRECTION_W, - DIRECTION_NW -}; - -int get_direction(int simple) -{ - if (simple) { - if (random_number(0, 1) == 0) { - return DIRECTION_E; - } else { - return DIRECTION_S; - } - } else { - return directions[random_number(0, NUM_DIRECTIONS)]; - } -} - -#ifdef DEBUG_DIR_MAIN -#include - -int main() -{ - int n = 32; - while (--n > 0) { - printf("%d\n", get_direction(1)); - } - return 0; -} -#endif diff --git a/src/dir.h b/src/dir.h deleted file mode 100755 index ff18361..0000000 --- a/src/dir.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef WORDSEARCH_DIR -#define WORDSEARCH_DIR - -enum direction { - DIRECTION_N, - DIRECTION_NE, - DIRECTION_E, - DIRECTION_SE, - DIRECTION_S, - DIRECTION_SW, - DIRECTION_W, - DIRECTION_NW -}; - -#define NUM_DIRECTIONS 8 - -int get_direction(int simple); - -#endif diff --git a/src/dir.o b/src/dir.o deleted file mode 100755 index b5c48b49bd7bb6c6ad63f0bc937e8e2fc3ba960a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 908 zcmaJYor4EOaR))Si>vArp!oxcA(9-+gE9y!X!k{Q5f~k{T5_*cePkU@ilZ zY1lCr?!j-XyW9iBIW&dV(*vtU!Cr*Gpjs+!mf~!{?=7Sr_c|DivmyCRilJKZBR|fl zzfvd_26@9m*SKSPgO1@ywOp??{Boqb;m2xNQC(e0c62OpjZdJ*x#r>Qc)Uo&ojR zy>C+p#VcR5$G*3U-FC6-9sG2*ey~bVm@4?C-WwPPr(t|gG3=fE_e)Q#Vf52$N$oi) zCp(eppo{0nLGpKf#P3WBkDae0FQ=$aZ1ib%4U8EUTw|6Ylb!?Tu+U%u-~hSA6uhHE iiif!!L|UmfgK|`@hoVhCtki27?$+K0O&P3w5cvm$A7R%3 diff --git a/src/grid.c b/src/grid.c deleted file mode 100755 index 94bb86d..0000000 --- a/src/grid.c +++ /dev/null @@ -1,197 +0,0 @@ -#include -#include -#include -#include -#include - -#include "rnd.h" -#include "dir.h" -#include "grid.h" - -enum exitcodes { - EXIT_WORDTOOLONG, -}; - -bounds *get_bounds(int height, int width, enum direction direction, int length) -{ - if (length > height || length > width) { - return NULL; - } - - length--; - - bounds *b = (bounds *) malloc(sizeof(bounds)); - - b->min_x = 0; - b->max_x = width-1; - b->min_y = 0; - b->max_y = height-1; - if (direction == DIRECTION_N || - direction == DIRECTION_NE || direction == DIRECTION_NW) { - b->min_y = length; - } - - if (direction == DIRECTION_W || - direction == DIRECTION_NW || direction == DIRECTION_SW) { - b->min_x = length; - } - - if (direction == DIRECTION_E || - direction == DIRECTION_NE || direction == DIRECTION_SE) { - b->max_x = width - length; - } - - if (direction == DIRECTION_S || - direction == DIRECTION_SW || direction == DIRECTION_SE) { - b->max_y = height - length; - } - - return b; -} - -int move_x(int x, enum direction d) { - if( - d == DIRECTION_E || - d == DIRECTION_NE || - d == DIRECTION_SE - ) { - x++; - } else if ( - d == DIRECTION_W || - d == DIRECTION_NW || - d == DIRECTION_SW - ) { - x--; - } - - return x; -} - -int move_y(int y, enum direction d) { - if( - d == DIRECTION_N || - d == DIRECTION_NE || - d == DIRECTION_NW - ) { - y--; - } else if ( - d == DIRECTION_S || - d == DIRECTION_SE || - d == DIRECTION_SW - ) { - y++; - } - - return y; -} - -char **make_grid(char **words, int height, int width, int simple, int count) -{ - char **grid = init_grid(NULL, height, width); - for(int i=0; imin_x, b->max_x); - y = random_number(b->min_y, b->max_y); - - char** tempgrid = init_grid(grid, height, width); - /* Now we have two copies of the grid, try to place the word... */ - int i; - for(i=0; i -int main() -{ - char *words[4] = { - "test", - "word", - "longer", - "verylong" - }; - char **grid = make_grid(words, 10, 10, 0, 4); - print_grid(grid, 4); -} -#endif diff --git a/src/grid.h b/src/grid.h deleted file mode 100755 index 2019bb9..0000000 --- a/src/grid.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef WORDSEARCH_GRID -#define WORDSEARCH_GRID - -#define WORDSEARCH_MAXTRIES 500 - -char **make_grid(char **words, int height, int width, int simple, int count); - -typedef struct bounds { - int min_y; - int max_y; - int min_x; - int max_x; -} bounds; - -/* returns NULL if cannot fit word; caller needs to free() the response */ -bounds *get_bounds(int height, int width, enum direction direction, int length); - -int place_word(char *word, char **grid, int height, int width, int simple); - -char **init_grid(char** old, int height, int width); -void free_grid(char** grid, int height); -int move_x(int x, enum direction d); -int move_y(int y, enum direction d); -void print_grid(char** grid, int height); - -#endif diff --git a/src/grid.o b/src/grid.o deleted file mode 100755 index 41aa031479812ca7d042e3ff5a905d056649983e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4504 zcmb7IZ){sv6~AuNH7jXe7#(9kmBwKEuLi=G%z!x?&iGJ*de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tc$ zdV|pG-qm`X_l|ncLodO4od3J@{)F|xx3TX{;6p+j|1A)E(6<7__pR?`AWEn|!5C(I zmT?S70e%VeH-V)02oSA*7aN-N{s+Wv z_PqzhC%*3{5T7f)SDF7UAkH!0J|MnueI?W}jvU|Lf%pyRyT_trU8xbL?-%-6ZIs83P08N->e1mbG zah!3O(aQ)><2Hf4@a_H%+-CYea8B)gJS4x(^an&EW-kSVM%N0-KV^B1={+nbCnVp` zbT`v#LeM>n#{kdW@8~KTpxP0_{w<;;y=VY;~_FD-)4qIFyRSW5UM&2%=$NG8mhP z&)Bi_%!{~o?8s~|nwSm>{GtxK2B|CT1pcRxniO_;E|Ox3z03q7Fl57IFm%QaO`ox+ q(m`BhEv(64Br3-2!|=;6!1$DiBK%0~FvU5`% -#include -#include - -#include "rnd.h" - - /* https://www.math.cornell.edu/~mec/2003-2004/cryptography/subs/frequencies.html */ - -#define ALPHABET_SIZE 26 -#define RND_MAXINT 10000 - -struct letter_frequency { - int p; /* pegged to 10000 rather than 1 */ - char c; -} letter_frequencies[] = { - { - 7, 'Z'}, { - 10, 'J'}, { - 11, 'Q'}, { - 17, 'X'}, { - 69, 'K'}, { - 111, 'V'}, { - 149, 'B'}, { - 182, 'P'}, { - 203, 'G'}, { - 209, 'W'}, { - 211, 'Y'}, { - 230, 'F'}, { - 261, 'M'}, { - 271, 'C'}, { - 288, 'U'}, { - 398, 'L'}, { - 432, 'D'}, { - 592, 'H'}, { - 602, 'R'}, { - 628, 'S'}, { - 695, 'N'}, { - 731, 'I'}, { - 768, 'O'}, { - 812, 'A'}, { - 910, 'T'}, { -1202, 'E'},}; - -/* from http://stackoverflow.com/questions/822323/how-to-generate-a-random-number-in-c */ -int random_number(int min_num, int max_num) -{ - static int initialised = 0; - int result = 0; - int low_num = 0; - int hi_num = 0; - if (min_num < max_num) { - low_num = min_num; - hi_num = max_num + 1; // this is done to include max_num in output. - } else { - low_num = max_num + 1; // this is done to include max_num in output. - hi_num = min_num; - } - if (!initialised) { - srand(time(NULL)); - initialised = 1; - } - result = (rand() % (hi_num - low_num)) + low_num; - return result; -} - -char get_random_letter() -{ - int rnd = random_number(0, RND_MAXINT); - for (int i = 0; i < ALPHABET_SIZE; i++) { - if (rnd < letter_frequencies[i].p) { - return letter_frequencies[i].c; - } - rnd -= letter_frequencies[i].p; - } - return '\0'; -} - -#ifdef DEBUG_RND_MAIN -#include - -int main() -{ - int n = 32; - while (--n > 0) { - printf("%c", get_random_letter()); - } - return 0; -} - -#endif diff --git a/src/rnd.h b/src/rnd.h deleted file mode 100755 index 624fcb9..0000000 --- a/src/rnd.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef WORDSEARCH_RND -#define WORDSEARCH_RND - -char get_random_letter(); -int random_number(int min_num, int max_num); - -#endif diff --git a/src/rnd.o b/src/rnd.o deleted file mode 100755 index 9003e0b15d8210b7e05746ae6eec4a0f3c06b8ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1624 zcmb7E-%Aux6u$n-er)apQWi-I3H@BbmtI8BbZRQM%y!EJxvaZmF1f3@GbDnbSkbhs z_|ij9(SIO4R1YDB(F#3i1Q7(i6$u;c!$ezbPT!fiRTPAAuBl_1(|7!!+!HMNZm&hG zMS8TCqY&6Z!AdqsFPgv)jnL-tSuT8Vm|owiSl)d7=OpYAOOCN0ckT>u%?NT7W}-e%B$ zSx7OyDAQS=F;Ot|d`32Dc1F%QlqE{(g=RhPP4A_?TrlKZO3qi&!iJn(-D8isK0-*y zPPG&)%R+>C?;b?kv|wbuk!!p%mhDcaiZV#Vc2j}ui9qhr&tDaxoDnip0n=DgreFK| z76)u=^d7oH^O@MM)MU*|N5o`9b~ipXVIDw|H%%{DN#o40s&*-*=Z}5Bfuv+pRBEn1#)jX>7W2-_7WO9fEn*toO)o&Vb{?Sn zxeU;;^Z+t&0T>3Z0uO=Hz%zjE@hxx`cn4eq-UHWxufQ3ARu6!^;C8SN90JdPJHd0{ z4lunp1>6hn25aCe;OF3r;7{OlV0t8%KqtX%;2AI-)>Awn+N*0%oDS4C+MICH4*wIc z74eGkZdNuXl}VoJ?X$>gz&O2x**`c%n9#>2YNUJR?Yp;$d6Y->)U7#rVx52TJkUf* z^*@kH{8{h<7$y0q!6?Z;4u+*QG_ErwqTPtvFpWBi7yxmiQ1 hrcsu|_yMW6bTtu)smV=3jj=>bi-m_`Ni|A)`wO&j{yYEx diff --git a/src/t b/src/t deleted file mode 100755 index ab0dbb59ce91798b1d9f14c1e990912b302d87c5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8342 zcmeHMe{fXA9p88N5)PAG0zsNctS5#+T5|y!88D!^gad;C5dvB*zFzKLawo}M=I$K? z2V3w2xw&R0Sf}a?)7F3bmo3cHb}~vGFbMvdY3fkRv`!nR&<3SbEEbrla{YYXzJ-^F z9s7Uw=KFTP`~B>9cfY&)z3zlr)Kem@aM?w;?Y@ z6=hAkfB^;2fK-Ay9pnXdg74g|`$*N`NtB`5CS*dOE$IU&B(c4yl5$_A5Wb)2K2i-D z)q&VAa`r)r10P4Z(Mdf|h8pF+zNX^(=*v%73c+rXjClj)~7=4&!Xh zo%4-92k`EZ)i(=K$bD8U7WW*nO2+4+GIz}P$cUp!X2m;ov@Fi^;mMlfJZg@!cywm+r(S&cwlq93fcH?0r<3g$o(tS z)sMLO;oG3DA%I8ja_M$$WSBi;ycaj+&*aY4oY3njD~`T3GWctXhRNFaqnADT*N=X5 zi#GbZ%UNyY6}#bks$qU*y{;O+_tr@M;^5)=MC@8Y1tME*>-UZC#1M~{uugmH0!H>? z6%362Z&3r8eRUv|U?69ApvlnL44x1@xEU5-o*&DH4;RAa`H{jCzWk}&xRwupkUy0V z4-c*`=EGz8EyuteeU&4~KXD{~*&c2F&y@$y=P%{ouRQpPcIDECgXOdHZx_PH9AF`Q z&HWtc{<)QY^ygb>Ml1$45Rd7Q2UrHa)ngxOwAv38cG6esvRudaka} zTfcDdm*p_v_*$R_b3POo96x%+v*)5UU#@duW&P6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