diff options
| author | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2019-04-15 00:32:36 +0100 |
|---|---|---|
| committer | Mohammad S Anwar <mohammad.anwar@yahoo.com> | 2019-04-15 00:32:36 +0100 |
| commit | 026df825447232e88fd7f7649e8b9130dac809f3 (patch) | |
| tree | d147261948300d1739aa23bd66b7eeee93f1019b | |
| parent | 48e898f0ff0ab4462405fc0cc2895330db69a4e3 (diff) | |
| download | perlweeklychallenge-club-026df825447232e88fd7f7649e8b9130dac809f3.tar.gz perlweeklychallenge-club-026df825447232e88fd7f7649e8b9130dac809f3.tar.bz2 perlweeklychallenge-club-026df825447232e88fd7f7649e8b9130dac809f3.zip | |
- Template folders for challenge 004.
72 files changed, 158 insertions, 0 deletions
diff --git a/challenge-004/abigail/README b/challenge-004/abigail/README new file mode 100644 index 0000000000..5f0d73ae16 --- /dev/null +++ b/challenge-004/abigail/README @@ -0,0 +1 @@ +Solution by Abigail diff --git a/challenge-004/adam-russell/README b/challenge-004/adam-russell/README new file mode 100644 index 0000000000..9420c9a781 --- /dev/null +++ b/challenge-004/adam-russell/README @@ -0,0 +1 @@ +Solution by Adam Russell diff --git a/challenge-004/ailbhe-tweedie/README b/challenge-004/ailbhe-tweedie/README new file mode 100644 index 0000000000..36d4034b70 --- /dev/null +++ b/challenge-004/ailbhe-tweedie/README @@ -0,0 +1 @@ +Solution by Ailbhe Tweedie diff --git a/challenge-004/alex-daniel/README b/challenge-004/alex-daniel/README new file mode 100644 index 0000000000..65550789bd --- /dev/null +++ b/challenge-004/alex-daniel/README @@ -0,0 +1 @@ +Solution by Alex Daniel. diff --git a/challenge-004/alexander-karelas/README b/challenge-004/alexander-karelas/README new file mode 100644 index 0000000000..3de9fce8d9 --- /dev/null +++ b/challenge-004/alexander-karelas/README @@ -0,0 +1 @@ +Solution by Alexander Karelas diff --git a/challenge-004/alexey-melezhik/README b/challenge-004/alexey-melezhik/README new file mode 100644 index 0000000000..ca7008f224 --- /dev/null +++ b/challenge-004/alexey-melezhik/README @@ -0,0 +1 @@ +Solution by Alexey Melezhik diff --git a/challenge-004/andrezgz/README b/challenge-004/andrezgz/README new file mode 100644 index 0000000000..f4fd0da88e --- /dev/null +++ b/challenge-004/andrezgz/README @@ -0,0 +1 @@ +Solution by Andrezgz diff --git a/challenge-004/antonio-gamiz/README b/challenge-004/antonio-gamiz/README new file mode 100644 index 0000000000..1f5ed5871a --- /dev/null +++ b/challenge-004/antonio-gamiz/README @@ -0,0 +1 @@ +Solution by Antonio Gamiz diff --git a/challenge-004/arne-sommer/README b/challenge-004/arne-sommer/README new file mode 100644 index 0000000000..b5d88e4df4 --- /dev/null +++ b/challenge-004/arne-sommer/README @@ -0,0 +1 @@ +Solution by Arne Sommer. diff --git a/challenge-004/arpad-toth/README b/challenge-004/arpad-toth/README new file mode 100644 index 0000000000..6661dd82c1 --- /dev/null +++ b/challenge-004/arpad-toth/README @@ -0,0 +1 @@ +Solution by Arpad Toth diff --git a/challenge-004/athanasius/README b/challenge-004/athanasius/README new file mode 100644 index 0000000000..cc357fda4a --- /dev/null +++ b/challenge-004/athanasius/README @@ -0,0 +1 @@ +Solution by Athanasius diff --git a/challenge-004/aubrey-quarcoo/README b/challenge-004/aubrey-quarcoo/README new file mode 100644 index 0000000000..8e63a2c1f5 --- /dev/null +++ b/challenge-004/aubrey-quarcoo/README @@ -0,0 +1 @@ +Solution by Aubrey Quarcoo diff --git a/challenge-004/bill-palmer/README b/challenge-004/bill-palmer/README new file mode 100644 index 0000000000..08ec849a41 --- /dev/null +++ b/challenge-004/bill-palmer/README @@ -0,0 +1 @@ +Solution by Bill Palmer. diff --git a/challenge-004/bob-kleemann/README b/challenge-004/bob-kleemann/README new file mode 100644 index 0000000000..78680e4035 --- /dev/null +++ b/challenge-004/bob-kleemann/README @@ -0,0 +1 @@ +Solution by Bob Kleemann diff --git a/challenge-004/cliveholloway/README b/challenge-004/cliveholloway/README new file mode 100644 index 0000000000..b69201296e --- /dev/null +++ b/challenge-004/cliveholloway/README @@ -0,0 +1 @@ +Solution by Clive Holloway diff --git a/challenge-004/daniel-mantovani/README b/challenge-004/daniel-mantovani/README new file mode 100644 index 0000000000..ed538216f2 --- /dev/null +++ b/challenge-004/daniel-mantovani/README @@ -0,0 +1 @@ +Solution by Daniel Mantovani diff --git a/challenge-004/dave-cross/README b/challenge-004/dave-cross/README new file mode 100644 index 0000000000..04b1b0623b --- /dev/null +++ b/challenge-004/dave-cross/README @@ -0,0 +1 @@ +Solution by Dave Cross diff --git a/challenge-004/dave-jacoby/README b/challenge-004/dave-jacoby/README new file mode 100644 index 0000000000..7c06689f16 --- /dev/null +++ b/challenge-004/dave-jacoby/README @@ -0,0 +1 @@ +Solution by Dave Jacoby diff --git a/challenge-004/david-kayal/README b/challenge-004/david-kayal/README new file mode 100644 index 0000000000..66f8615260 --- /dev/null +++ b/challenge-004/david-kayal/README @@ -0,0 +1 @@ +Solution by David Kayal diff --git a/challenge-004/doug-schrag/README b/challenge-004/doug-schrag/README new file mode 100644 index 0000000000..bf8a10ffb4 --- /dev/null +++ b/challenge-004/doug-schrag/README @@ -0,0 +1 @@ +Solution by Doug Schrag diff --git a/challenge-004/duncan-c-white/README b/challenge-004/duncan-c-white/README new file mode 100644 index 0000000000..d6a6cb2f04 --- /dev/null +++ b/challenge-004/duncan-c-white/README @@ -0,0 +1,8 @@ +I have investigated Challenge 1 (the Regular numbers) reasonably thoroughly, +building and comparing 4 iterative solutions to generate them. I also +investigated a Lazy List version, storing the tail of the list as a promise - +a function to call when you wanted the next head item, and the returned tail +is another promise - to generate the next item later when needed. However, +I couldn't get that to work so abandoned it:-) + +Challenge 2 (Pascal's Triangle) by contrast is pretty basic and simple-minded. diff --git a/challenge-004/eddy-hs/README b/challenge-004/eddy-hs/README new file mode 100644 index 0000000000..0ed51d222d --- /dev/null +++ b/challenge-004/eddy-hs/README @@ -0,0 +1 @@ +Solution by Eddy HS diff --git a/challenge-004/finley/README b/challenge-004/finley/README new file mode 100644 index 0000000000..f08a121076 --- /dev/null +++ b/challenge-004/finley/README @@ -0,0 +1 @@ +Solution by Finley diff --git a/challenge-004/fjwhittle/README b/challenge-004/fjwhittle/README new file mode 100644 index 0000000000..7dcc95e189 --- /dev/null +++ b/challenge-004/fjwhittle/README @@ -0,0 +1 @@ +Solution by Francis Whittle diff --git a/challenge-004/fred-zinn/README b/challenge-004/fred-zinn/README new file mode 100644 index 0000000000..17bac4f094 --- /dev/null +++ b/challenge-004/fred-zinn/README @@ -0,0 +1 @@ +Solution by Fred Zinn diff --git a/challenge-004/freddie-b/README b/challenge-004/freddie-b/README new file mode 100644 index 0000000000..823d7474b5 --- /dev/null +++ b/challenge-004/freddie-b/README @@ -0,0 +1 @@ +Solution by Freddie B diff --git a/challenge-004/gustavo-chaves/README b/challenge-004/gustavo-chaves/README new file mode 100644 index 0000000000..a66bbbf8a3 --- /dev/null +++ b/challenge-004/gustavo-chaves/README @@ -0,0 +1 @@ +Solution by Gustavo Chaves diff --git a/challenge-004/jacques-guinnebault/README b/challenge-004/jacques-guinnebault/README new file mode 100644 index 0000000000..9d3e7c037f --- /dev/null +++ b/challenge-004/jacques-guinnebault/README @@ -0,0 +1 @@ +Solution by Jacques Guinnebault. diff --git a/challenge-004/jaime/README b/challenge-004/jaime/README new file mode 100644 index 0000000000..5b29651691 --- /dev/null +++ b/challenge-004/jaime/README @@ -0,0 +1 @@ +Solution by Jaime Corchado. diff --git a/challenge-004/jaldhar-h-vyas/README b/challenge-004/jaldhar-h-vyas/README new file mode 100644 index 0000000000..7dce927eca --- /dev/null +++ b/challenge-004/jaldhar-h-vyas/README @@ -0,0 +1 @@ +Solution by Jaldhar H. Vyas diff --git a/challenge-004/james-smith/README.md b/challenge-004/james-smith/README.md new file mode 100644 index 0000000000..4a9b029e85 --- /dev/null +++ b/challenge-004/james-smith/README.md @@ -0,0 +1,74 @@ +Solution by James Smith + +I'm new to Perl 6 so looking for interesting (not necessarily optimal +solutions) to try out some of the cool features that Perl 6 gives over +Perl 5 - especially as it is basically a new language with new syntactic +sugar.... + +# Problem 2 + +Wierdly I think problem 2 is the easier one this week. + +I wrote this twice, the second solution I'm using minimizes memory +usage by extends the array rather than copying a new one. We just +loop through the array adding the next value to the current one +and then unshift the first 1 to the array. + +Can't see an easy neat way of doing it differently in Perl 5 and 6 - +but I do like + +1. the MAIN function in perl which clears up how CLI +parameters are pulled into the code and + +1. the arbitrary precision +integers... (no more "e+" notation) + +# Problem 1 + +## Perl 5 + +This was an interesting challenge - and still working out if I have +the optimal solution, again I'll write an iterator which gets the +next number and call this multiple times to get the list.... + +To find the next one we have to find the first number larger than the +current largest number in the list - which is a multiple of 5, 3 or 2 +of an entry already in the list... + +The loop we use is interesting as it contains `next`, `last` and `redo` +commands. Firstly how it works - we are looking for numbers whose +multiples are larger than the largest value. + +* so we start looping through the list looking for multiples of 5 (we +will get to a larger value first when multiplying by 5). We use `next` +here to short cut the loop until we have reached a larger value... + +* we then store this, and then continue with the next highest factor. + + * If there are no factors left we use `last` to exit the loop and + and "add" the value to the hamming array. + + * If there are factors left we need to continue the loop with the + new value - BUT - we need to re-check the current element from the + hamming array. We do this with `redo` which repeats the loop with + the same value... + +* once we have a new value we store it on the array and return it... + +This method means we only loop through less than once rather than +looping through for 2, 3 & 5.... + +## Perl 6 + +I'm new to Perl 6 and so looking for what features of the language +give me an advantage of Perl 5 which I've been programming for over +20 years now... + +So I looked at using a generator with lazy evaluation using +`lazy gather` and `take` to generate the values... Looks interesting +as a "programming construct" but again like last weeks use of +currying - does not particularly look efficient in this case. + + + + diff --git a/challenge-004/jeff/README b/challenge-004/jeff/README new file mode 100644 index 0000000000..d5f15f4a8e --- /dev/null +++ b/challenge-004/jeff/README @@ -0,0 +1 @@ +Solution by Jeff diff --git a/challenge-004/jeremy-carman/README b/challenge-004/jeremy-carman/README new file mode 100644 index 0000000000..3d08510e49 --- /dev/null +++ b/challenge-004/jeremy-carman/README @@ -0,0 +1 @@ +Solution by Jeremy Carman diff --git a/challenge-004/jim-bacon/README b/challenge-004/jim-bacon/README new file mode 100644 index 0000000000..8dcfd637a3 --- /dev/null +++ b/challenge-004/jim-bacon/README @@ -0,0 +1 @@ +Solution by Jim Bacon diff --git a/challenge-004/jj-merelo/README b/challenge-004/jj-merelo/README new file mode 100644 index 0000000000..d09838676b --- /dev/null +++ b/challenge-004/jj-merelo/README @@ -0,0 +1 @@ +Solution by JJ Merelo diff --git a/challenge-004/jo-christian-oterhals/README b/challenge-004/jo-christian-oterhals/README new file mode 100644 index 0000000000..eafff999fb --- /dev/null +++ b/challenge-004/jo-christian-oterhals/README @@ -0,0 +1 @@ +Solution by Jo Christian Oterhals diff --git a/challenge-004/joelle-maslak/README b/challenge-004/joelle-maslak/README new file mode 100644 index 0000000000..d12c7940c3 --- /dev/null +++ b/challenge-004/joelle-maslak/README @@ -0,0 +1 @@ +Solution by Joelle Maslak diff --git a/challenge-004/john-barrett/README b/challenge-004/john-barrett/README new file mode 100644 index 0000000000..a7ff0af641 --- /dev/null +++ b/challenge-004/john-barrett/README @@ -0,0 +1 @@ +Solution by John Barrett diff --git a/challenge-004/juan-caballero/README b/challenge-004/juan-caballero/README new file mode 100644 index 0000000000..bffe4b05c2 --- /dev/null +++ b/challenge-004/juan-caballero/README @@ -0,0 +1 @@ +Solution by Juan Caballero diff --git a/challenge-004/khalid/README b/challenge-004/khalid/README new file mode 100644 index 0000000000..1ca4211368 --- /dev/null +++ b/challenge-004/khalid/README @@ -0,0 +1 @@ +Solution by Khalid diff --git a/challenge-004/kian-meng-ang/README b/challenge-004/kian-meng-ang/README new file mode 100644 index 0000000000..a5f0359813 --- /dev/null +++ b/challenge-004/kian-meng-ang/README @@ -0,0 +1 @@ +Solution by Kian-Meng Ang diff --git a/challenge-004/kivanc-yazan/README b/challenge-004/kivanc-yazan/README new file mode 100644 index 0000000000..bc7f8ca509 --- /dev/null +++ b/challenge-004/kivanc-yazan/README @@ -0,0 +1 @@ +Solution by Kivanc Yazan diff --git a/challenge-004/lars-balker/README b/challenge-004/lars-balker/README new file mode 100644 index 0000000000..054649c9eb --- /dev/null +++ b/challenge-004/lars-balker/README @@ -0,0 +1 @@ +Solution by Lars Balker diff --git a/challenge-004/laurent-rosenfeld/README b/challenge-004/laurent-rosenfeld/README new file mode 100644 index 0000000000..f9c6e1437e --- /dev/null +++ b/challenge-004/laurent-rosenfeld/README @@ -0,0 +1 @@ +Solution by Laurent Rosenfeld diff --git a/challenge-004/magnus-woldrich/README b/challenge-004/magnus-woldrich/README new file mode 100644 index 0000000000..79cde2997c --- /dev/null +++ b/challenge-004/magnus-woldrich/README @@ -0,0 +1 @@ +Solution by Magnus Woldrich diff --git a/challenge-004/mark-senn/README b/challenge-004/mark-senn/README new file mode 100644 index 0000000000..f37c93431c --- /dev/null +++ b/challenge-004/mark-senn/README @@ -0,0 +1 @@ +Solution by Mark Senn diff --git a/challenge-004/martin-mugeni/README b/challenge-004/martin-mugeni/README new file mode 100644 index 0000000000..416ca98166 --- /dev/null +++ b/challenge-004/martin-mugeni/README @@ -0,0 +1 @@ +Solution by Martin Mugeni diff --git a/challenge-004/matt-latusek/README b/challenge-004/matt-latusek/README new file mode 100644 index 0000000000..e1dc8b6e16 --- /dev/null +++ b/challenge-004/matt-latusek/README @@ -0,0 +1 @@ +Solution by Matt Latusek. diff --git a/challenge-004/maxim-kolodyazhny/README b/challenge-004/maxim-kolodyazhny/README new file mode 100644 index 0000000000..e5b4df7154 --- /dev/null +++ b/challenge-004/maxim-kolodyazhny/README @@ -0,0 +1 @@ |
