You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pattern finder finds the pattern (in matrix form) given by user in big and complex matrix (considered as motif).
It provides the positions of required pattern in complex/big matrix(motif) in (i,j) format where i->index of row and j->index of column.
It also shows where is the pattern in given motif.
How to Run
A GCC C compiler with header files "stdio.h","stdbool.h","windows.h" is required for running the code.
Clone this repository or Copy source file in your project folder.
Compile the code using C compiler ( you can use this command in project folder -> gcc PatternFinder.c -o PatternFinder )
Run the executable file ( you can use this command after using command in same project folder -> ./PatternFinder )
Instructions
Input matrices of size : mxn (m,n>0) with elements in range 1-9.If you enter element <0 or >9 quality of final result will reduce.
Only pattern matrix can contain 0 element.
1-9 numbers represent tiles of different colors and 0 represents empty tile (this means 0 can be considered as any number in motif ).
Always, dimensions of motif should be greater than pattern matrix.
Use a compiler which supports initial for loop declarations (e.g. for(int i=0, ...)).
It is prefered that window in which you are running the code (e.g. Terminal) should be of black/dark background.
Input and Output
This program first shows necessary instructions then takes inputs for size of pattern matrix, elements in pattern matrix, size of motif, elements in motif.
After that it shows entered pattern, motif then total number and positions of pattern occurrences.
Improvement Areas
This program can be improved by reducing its complexity and by adding a feature so that it will give better output for 2 or more digit elements.