Skip to content

jasampler/lattice-path

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LatticePath

Console Java program to print in ASCII all the different paths from the 0,0 corner to the opposite corner in a grid of points. The option --pass allows to surpass the diagonal and the option --diag allows to use diagonal steps. The option --count prints a table with the number of all the different paths to each point of the grid.

> java -jar LatticePath.jar 
Error: Parameters: java LatticePath [--pass] [--diag] [--count] ROWS [COLUMNS]
> java -jar LatticePath.jar 2 3
o---o---o
        |
        o

o---o
    |
    o---o

> java -jar LatticePath.jar --pass 2 3
o---o---o
        |
        o

o---o
    |
    o---o

o
|
o---o---o

java -jar LatticePath.jar --diag 2 3
o---o---o
        |
        o

o---o
     '.
       'o

o---o
    |
    o---o

o
 '.
   'o---o

> java -jar LatticePath.jar --pass --diag 2 3
o---o---o
        |
        o

o---o
     '.
       'o

o---o
    |
    o---o

o
 '.
   'o---o

o
|
o---o---o

> java -jar LatticePath.jar --pass --diag --count 7
1        1        1        1        1        1        1
1        3        5        7        9       11       13
1        5       13       25       41       61       85
1        7       25       63      129      231      377
1        9       41      129      321      681     1289
1       11       61      231      681     1683     3653
1       13       85      377     1289     3653     8989

The following links offer more information about each type:

About

Console Java program to generate all possible paths between two points of a grid

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages