Skip to content

Instantly share code, notes, and snippets.

@mmlac
Last active January 27, 2022 02:40
Show Gist options
  • Select an option

  • Save mmlac/00cd35e0306d95141ab5d00a61a018c3 to your computer and use it in GitHub Desktop.

Select an option

Save mmlac/00cd35e0306d95141ab5d00a61a018c3 to your computer and use it in GitHub Desktop.

Revisions

  1. mmlac revised this gist Mar 19, 2021. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ A Knight piece can only move in an L-like motion, going two fields in one
    direction and then one field 90 degrees to that, or one field in one
    direction and then two fields 90 degrees to that.

    Create a function that takes four integers X, Y, A, B, P as inputs.
    Create a function that takes five integers X, Y, A, B, P as inputs.
    Print out a human-readable representation of a completed sequence,
    as soon as one has been found, to the console until P have been found
    or the solution space is exhausted.
  2. mmlac created this gist Mar 5, 2021.
    18 changes: 18 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    Given a chess board of dimensions X by Y and a starting position of A and B,
    output the first P sequences of moves of a Knight piece that cover every field
    and return to the starting position.

    A Knight piece can only move in an L-like motion, going two fields in one
    direction and then one field 90 degrees to that, or one field in one
    direction and then two fields 90 degrees to that.

    Create a function that takes four integers X, Y, A, B, P as inputs.
    Print out a human-readable representation of a completed sequence,
    as soon as one has been found, to the console until P have been found
    or the solution space is exhausted.

    Use all cores available on a machine. Do not use "parallel" data structures
    or libraries that contain those, i.e. data structures that have functions
    built in to do parallel traversal.

    Describe the tradeoffs between a single-core solution and a multi-core solution.