From 516d403dfb48af20039960271bd639fa50f0a340 Mon Sep 17 00:00:00 2001 From: James Smith Date: Wed, 23 Jun 2021 22:09:26 +0100 Subject: Update README.md --- challenge-118/james-smith/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/challenge-118/james-smith/README.md b/challenge-118/james-smith/README.md index 01fbce897c..f3a6bdf930 100644 --- a/challenge-118/james-smith/README.md +++ b/challenge-118/james-smith/README.md @@ -273,6 +273,7 @@ Rather than checking to see if a move from one square in a given direction ("tra So we use the logic above to generate an array where the "key" is the square number and the "value" is an array of square numbers that you can reach. This gives us the following code: + ```perl sub get_trans { my $q=[]; @@ -317,6 +318,9 @@ The array looks something like: [13,22] .... ] +``` + +The walk sub then becomes the simpler: ```perl sub walk_trans { -- cgit