From 1a5ee1eb5296a02265f7c83b177f50a4761e01b8 Mon Sep 17 00:00:00 2001 From: boblied Date: Fri, 5 Mar 2021 06:47:38 -0600 Subject: PWC 102 Task 1, Rare Numbers --- challenge-102/bob-lied/perl/ch-1.pl | 154 ++++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100755 challenge-102/bob-lied/perl/ch-1.pl diff --git a/challenge-102/bob-lied/perl/ch-1.pl b/challenge-102/bob-lied/perl/ch-1.pl new file mode 100755 index 0000000000..4b9007cd1d --- /dev/null +++ b/challenge-102/bob-lied/perl/ch-1.pl @@ -0,0 +1,154 @@ +#!/usr/bin/env perl +# vim:set ts=4 sw=4 sts=4 et ai wm=0 nu: +#============================================================================= +# ch-1.pl +#============================================================================= +# Copyright (c) 2021, Bob Lied +#============================================================================= +# Perl Weekly Challenge 102, Task #1, Rare Numbers +# +# You are given a positive integer $N. +# Write a script to generate all Rare numbers of size $N if exists. +# http://www.shyamsundergupta.com/rare.htm +# The web site lists several constraints that can be used to limit the search. +# Also discussed at https://rosettacode.org/wiki/Talk:Rare_numbers +# Examples +# (a) 2 digits: 65 +# (b) 6 digits: 621770 +# (c) 9 digits: 281089082 +# +# From the reference web site: +# The numbers, which gives a perfect square on adding as well as subtracting +# its reverse are rare and hence termed as Rare Numbers. +# +# If R is a positive integer and R1 is the integer obtained from R by writing +# its decimal digits in reverse order, then if R + R1 and R - R1 both are +# perfect square then R is termed as Rare Number. +# +# So for R to be a Rare Number we must have +# R + R1 = X^2 and R - R1 = Y^2 +# +# For example: For R=65, R1=56 +# R+R1 = 65+56 = 121 = 11^2 AND R-R1 = 65 - 56 = 9 = 3^2 +# +#============================================================================= + +use strict; +use warnings; +use 5.020; + +use experimental qw/ signatures /; + +use Getopt::Long; + +my $doTest = 0; +my $verbose = 0; +GetOptions("test" => \$doTest, "verbose" => \&verbose); + +my $N = shift; + +# On my MacBook M1, perl 5.32, 8 takes about 7 seconds and 9 takes about 1:15 +# 10 is probably feasible, maybe 11 for the giftedly patient, but beyond that +# needs some kind of parallelism or an algorithm I wasn't able to think of. +die Usage() unless defined $N && $N > 1 && $N < 20; +warn "Expect this to take a long time ..." if $N > 8; + +# The last digit can never be 1,4,6,9 +my @mightBeRare = ( 1, 0, 1, 1, 0, 1, 0, 1, 1, 0 ); + +# A perfect square can never end in 2,3,7,8 +my @mightBeSquare = ( 1, 1, 0, 0, 1, 1, 1, 0, 0, 1 ); + +my $isNodd = $N % 2; # Optimization possible for even or odd digits. + +# Cache results of square root test here. +my %knownSquare; + +# For example, if N = 3, max is 1000, but we want 100 at a time. +my $scale = 10**($N-1); + +# Rare numbers can never start with an odd digit, so work on +# only groups that start with an even digit. +# Creates pairs of start and end. +my @boundary = map { [ $_ * 2 * $scale, $_ * 2 * $scale + $scale - 1 ] } 1..4; + +# Use faster integer math everywhere except where we need the square root. +use integer; + +for my $bound ( @boundary ) +{ + my $endOfRange = $bound->[1]; # Hoist array access out of loop processing. + R: for ( my $r = $bound->[0] ; $r <= $endOfRange ; $r++ ) + { + # say "$r ", scalar(time()) if $r % 10000000 == 0; # Progress mark + + # The last digit can never be 1,4,6,9 + next unless $mightBeRare[ $r%10 ]; + + my $r1; + $r1 = reverse($r); # String beats math + ##{ use integer; + ## my $n = $r; $r1 = 0; + ## while ( $n ) + ## { + ## $r1 = $r1 * 10 + $n%10; + ## $n /= 10; + ## } + ##} + + my $y2 = $r - $r1; + next if $y2 < 0; # No imaginary numbers. + next unless $mightBeSquare[ $y2 % 10]; + + my $x2 = $r + $r1; + next unless $mightBeSquare[ $x2 % 10]; + + # If R consist of odd number of digits, then R-R1 must be divisible by 11. + # Since R-R1 is always divisible by 9, So 1089 (33^2) must be a factor of Y2. + # + # If R consist of even number of digits, then R+R1 must be divisible by 11, + # So 121 must be a factor of X2. + if ( $isNodd ) + { + next if $y2 % 1089; + } + else + { + next if $x2 % 121; + } + + # Save the expensive square root computation for last. + + # Caching wasn't effective. Either the overhead of hash lookup was not + # much better than the cost of the sqrt function, or there aren't many + # cache hits. And memory could blow up for large N. + # if ( exists $knownSquare{$x2} ) + # { + # next unless $knownSquare{$x2}; + # } + # else + # { + # my $x = sqrt($x2); + # next unless ($knownSquare{$x2} = (int($x) == $x)); + # } + + # if ( exists $knownSquare{$y2} ) + # { + # next unless $knownSquare{$y2}; + # } + # else + # { + # my $y = sqrt($y2); + # next unless ($knownSquare{$y2} = (int($y) == $y)); + # } + + { no integer; + my $x = sqrt($x2); + next R unless int($x) == $x; + my $y = sqrt($y2); + next R unless int($y) == $y; + } + + say "R: $r"; + } +} -- cgit From 199d363b79e769bf8dc150bf37228395bfbb4d16 Mon Sep 17 00:00:00 2001 From: boblied Date: Fri, 5 Mar 2021 06:47:55 -0600 Subject: PWC 102 Task 1, Rare Numbers, in C --- challenge-102/bob-lied/c/ch-1.c | 82 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 challenge-102/bob-lied/c/ch-1.c diff --git a/challenge-102/bob-lied/c/ch-1.c b/challenge-102/bob-lied/c/ch-1.c new file mode 100644 index 0000000000..1ff39d59ec --- /dev/null +++ b/challenge-102/bob-lied/c/ch-1.c @@ -0,0 +1,82 @@ +/* vim:set ts=4 sw=4 sts=4 et ai wm=0 nu syntax=c: */ + +#include +#include +#include + +int verbose = 1; + +int mightBeRare[10] = { 1, 0, 1, 1, 0, 1, 0, 1, 1, 0 }; + +int mightBeSquare[10] = { 1, 1, 0, 0, 1, 1, 1, 0, 0, 1 }; + +long +reverse(long r) +{ + long r1 = 0; + while ( r ) + { + r1 = r1 * 10 + r%10; + r /= 10; + } + return r1; +} + + +int +main(int argc, char **argv) +{ + int N; + + N = atoi(argv[1]); + + int isNodd = N % 2; + + long scale = pow(10, (N-1)); + long endOfRange = pow(10, N); + + for ( long r = scale ; r < endOfRange ; r++ ) + { + // Rare numbers can never start with an odd digit. + if ( (r / scale ) % 2 ) + { + r += scale; + } + +// if ( r % 10000000 == 0 ) printf("%ld\n", r); + + if ( ! mightBeRare[ r % 10 ] ) + { + continue; + } + + long r1 = reverse(r); + + long y2 = r - r1; + if ( y2 < 0 ) continue; // Can't be a square + + long x2 = r + r1; + + if ( !( mightBeSquare[ x2%10] && mightBeSquare[ y2%10 ] ) ) continue; + + if ( isNodd ) + { + if ( y2 % 1089 ) continue; + } + else + { + if ( x2 % 121 ) continue; + } + + double x = sqrt(x2); + if ( x != (long)(x) ) continue; + + double y = sqrt(y2); + if ( y != (long)(y) ) continue; + + printf("N=%d R=%ld\n", N, r); + } + + + exit(0); +} -- cgit From dd79a8e231f498fd523607fee867983a267d920c Mon Sep 17 00:00:00 2001 From: E7-87-83 Date: Mon, 8 Mar 2021 13:51:19 +0800 Subject: add test data for my slow challenge-102 ch-1.pl --- challenge-102/cheok-yin-fung/perl/ch-1.pl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/challenge-102/cheok-yin-fung/perl/ch-1.pl b/challenge-102/cheok-yin-fung/perl/ch-1.pl index eab209da06..2a6a02127e 100644 --- a/challenge-102/cheok-yin-fung/perl/ch-1.pl +++ b/challenge-102/cheok-yin-fung/perl/ch-1.pl @@ -55,3 +55,17 @@ for my $k ($bN..$eN) { # reasonable time for length = 7 , # be patient for length = 8 (one term, which is palindromic) # over 2 min and killed for length = 9 ... + +=pod +// add on March 8th +$ time perl ch-1.pl 9 +200040002 +204060402 +242484242 +281089082 +291080192 + +real 10m21.188s +user 10m19.621s +sys 0m0.084s +=cut -- cgit From 7877e9b3bfc9828b587daf80fdc232d4604f5abf Mon Sep 17 00:00:00 2001 From: Yet Ebreo Date: Mon, 8 Mar 2021 23:22:45 +0800 Subject: Added perl solution ch102-2 --- challenge-102/yet-ebreo/perl/ch-2.pl | 37 ++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 challenge-102/yet-ebreo/perl/ch-2.pl diff --git a/challenge-102/yet-ebreo/perl/ch-2.pl b/challenge-102/yet-ebreo/perl/ch-2.pl new file mode 100644 index 0000000000..4197f1d406 --- /dev/null +++ b/challenge-102/yet-ebreo/perl/ch-2.pl @@ -0,0 +1,37 @@ +#! /usr/bin/perl + +use strict; +use warnings; +use feature qw(say); + + +# You are given a positive integer $N. + +# Write a script to produce Hash-counting string of that length. + +# The definition of a hash-counting string is as follows: + +# - the string consists only of digits 0-9 and hashes, ‘#’ +# - there are no two consecutive hashes: ‘##’ does not appear in your string +# - the last character is a hash +# - the number immediately preceding each hash (if it exists) is the position of that hash in the string, with the position being counted up from 1 +# It can be shown that for every positive integer N there is exactly one such length-N string. + +# Examples: +# (a) "#" is the counting string of length 1 +# (b) "2#" is the counting string of length 2 +# (c) "#3#" is the string of length 3 +# (d) "#3#5#7#10#" is the string of length 10 +# (e) "2#4#6#8#11#14#" is the string of length 14 + +my $N = $ARGV[0] || 2; +my $out = ""; + +while ($N) { + $out = ($N>1?"$N":"")."#$out"; + $N = $ARGV[0] - length $out; +} + + +say $out; + -- cgit From f7356b14dfd9d99bbd154ae71b77338a97025da1 Mon Sep 17 00:00:00 2001 From: Roger Bell_West Date: Mon, 8 Mar 2021 15:52:40 +0000 Subject: Solutions for challenge #103 --- challenge-103/roger-bell-west/perl/ch-1.pl | 24 ++++++++++++++ challenge-103/roger-bell-west/perl/ch-2.pl | 32 +++++++++++++++++++ challenge-103/roger-bell-west/python/ch-1.py | 22 +++++++++++++ challenge-103/roger-bell-west/python/ch-2.py | 31 ++++++++++++++++++ challenge-103/roger-bell-west/raku/ch-1.p6 | 22 +++++++++++++ challenge-103/roger-bell-west/raku/ch-2.p6 | 34 ++++++++++++++++++++ challenge-103/roger-bell-west/ruby/ch-1.rb | 28 +++++++++++++++++ challenge-103/roger-bell-west/ruby/ch-2.rb | 34 ++++++++++++++++++++ challenge-103/roger-bell-west/rust/ch-1.rs | 29 +++++++++++++++++ challenge-103/roger-bell-west/rust/ch-2.rs | 47 ++++++++++++++++++++++++++++ challenge-103/roger-bell-west/t2.csv | 7 +++++ 11 files changed, 310 insertions(+) create mode 100755 challenge-103/roger-bell-west/perl/ch-1.pl create mode 100755 challenge-103/roger-bell-west/perl/ch-2.pl create mode 100755 challenge-103/roger-bell-west/python/ch-1.py create mode 100755 challenge-103/roger-bell-west/python/ch-2.py create mode 100755 challenge-103/roger-bell-west/raku/ch-1.p6 create mode 100755 challenge-103/roger-bell-west/raku/ch-2.p6 create mode 100755 challenge-103/roger-bell-west/ruby/ch-1.rb create mode 100755 challenge-103/roger-bell-west/ruby/ch-2.rb create mode 100755 challenge-103/roger-bell-west/rust/ch-1.rs create mode 100644 challenge-103/roger-bell-west/rust/ch-2.rs create mode 100644 challenge-103/roger-bell-west/t2.csv diff --git a/challenge-103/roger-bell-west/perl/ch-1.pl b/challenge-103/roger-bell-west/perl/ch-1.pl new file mode 100755 index 0000000000..53d6dcaf63 --- /dev/null +++ b/challenge-103/roger-bell-west/perl/ch-1.pl @@ -0,0 +1,24 @@ +#! /usr/bin/perl + +use strict; +use warnings; + +use Test::More tests => 2; + +is(cz(2017),'Fire Rooster','example 1'); +is(cz(1938),'Earth Tiger','example 2'); + +sub cz { + my $yy=shift; + my $y=$yy; + if ($y<0) { + $y++; + } + $y%=60; + while ($y<0) { + $y+=60; + } + return join(' ', + [qw(Metal Water Wood Fire Earth)]->[int($y/2)%5], + [qw(Monkey Rooster Dog Pig Rat),'Water Buffalo',qw(Tiger Cat Dragon Snake Horse Goat)]->[$y%12]); +} diff --git a/challenge-103/roger-bell-west/perl/ch-2.pl b/challenge-103/roger-bell-west/perl/ch-2.pl new file mode 100755 index 0000000000..a99a672b78 --- /dev/null +++ b/challenge-103/roger-bell-west/perl/ch-2.pl @@ -0,0 +1,32 @@ +#! /usr/bin/perl + +use strict; +use warnings; + +use Test::More tests => 1; + +is(wp(1606134123,1614591276,'t2.csv'),'00:10:24 Les Miserables Episode 1: The Bishop (broadcast date: 1937-07-23)','example 1'); + +use Text::CSV_XS qw(csv); +use List::Util qw(sum); + +sub wp { + my $ts=shift; + my $tn=shift; + my $csvfile=shift; + my $td=($tn-$ts)*1000; + my $aoa=csv(in => $csvfile); + my $tp=sum(map {$_->[0]} @{$aoa}); + $td %= $tp; + foreach my $t (@{$aoa}) { + if ($td < $t->[0]) { + $td=int($td/1000); + my $h=int($td/3600); + my $m=int($td/60) % 60; + my $s=$td % 60; + return sprintf('%02d:%02d:%02d %s',$h,$m,$s,$t->[1]); + } else { + $td-=$t->[0]; + } + } +} diff --git a/challenge-103/roger-bell-west/python/ch-1.py b/challenge-103/roger-bell-west/python/ch-1.py new file mode 100755 index 0000000000..92708e26fa --- /dev/null +++ b/challenge-103/roger-bell-west/python/ch-1.py @@ -0,0 +1,22 @@ +#! /usr/bin/python3 + +def cz(yy): + y=int(yy) + if y<0: + y += 1 + y %= 60 + while y<0: + y += 60 + return " ".join([['Metal','Water','Wood','Fire','Earth'][int(y/2)%5],['Monkey','Rooster','Dog','Pig','Rat','Water Buffalo','Tiger','Cat','Dragon','Snake','Horse','Goat'][y%12]]) + +import unittest + +class TestCz(unittest.TestCase): + + def test_ex1(self): + self.assertEqual(cz(2017),'Fire Rooster','example 1') + + def test_ex2(self): + self.assertEqual(cz(1938),'Earth Tiger','example 2') + +unittest.main() diff --git a/challenge-103/roger-bell-west/python/ch-2.py b/challenge-103/roger-bell-west/python/ch-2.py new file mode 100755 index 0000000000..eb804da2eb --- /dev/null +++ b/challenge-103/roger-bell-west/python/ch-2.py @@ -0,0 +1,31 @@ +#! /usr/bin/python3 + +import csv +def wp(ts,tn,csvfile): + td=(tn-ts)*1000; + aoa=list() + with open(csvfile) as csvfile: + cr=csv.reader(csvfile) + for row in cr: + aoa.append(row) + tp=sum(int(t[0]) for t in aoa) + td %= tp + for t in aoa: + t[0]=int(t[0]) + if td < t[0]: + td=int(td/1000) + h=int(td/3600) + m=int(td/60) % 60 + s=td % 60 + return "{:02d}:{:02d}:{:02d} {:s}".format(h,m,s,t[1]) + else: + td -= t[0] + +import unittest + +class TestWp(unittest.TestCase): + + def test_ex1(self): + self.assertEqual(wp(1606134123,1614591276,'t2.csv'),'00:10:24 Les Miserables Episode 1: The Bishop (broadcast date: 1937-07-23)','example 1') + +unittest.main() diff --git a/challenge-103/roger-bell-west/raku/ch-1.p6 b/challenge-103/roger-bell-west/raku/ch-1.p6 new file mode 100755 index 0000000000..f75cbe4054 --- /dev/null +++ b/challenge-103/roger-bell-west/raku/ch-1.p6 @@ -0,0 +1,22 @@ +#! /usr/bin/perl6 + +use Test; + +plan 2; + +is(cz(2017),'Fire Rooster','example 1'); +is(cz(1938),'Earth Tiger','example 2'); + +sub cz($yy) { + my $y=$yy; + if ($y < 0) { + $y++; + } + $y%=60; + while ($y < 0) { + $y+=60; + } + return join(' ', + [qw|Metal Water Wood Fire Earth|].[floor($y/2)%5], + ['Monkey','Rooster','Dog','Pig','Rat','Water Buffalo','Tiger','Cat','Dragon','Snake','Horse','Goat'].[$y%12]); +} diff --git a/challenge-103/roger-bell-west/raku/ch-2.p6 b/challenge-103/roger-bell-west/raku/ch-2.p6 new file mode 100755 index 0000000000..5ed63d1a47 --- /dev/null +++ b/challenge-103/roger-bell-west/raku/ch-2.p6 @@ -0,0 +1,34 @@ +#! /usr/bin/perl6 + +use Test; + +plan 1; + +is(wp(1606134123,1614591276,'t2.csv'),'00:10:24 Les Miserables Episode 1: The Bishop (broadcast date: 1937-07-23)','example 1'); + +sub wp($ts,$tn,$csvfile) { + my $td=($tn-$ts)*1000; + my $fh=open :r,$csvfile; + my @aoa; + for $fh.lines { + .chomp; + my ($len,$title)=$_.comb(/<-[,]>+/,2); + $title ~~ s/^\"//; + $title ~~ s/\"$//; + @aoa.push([$len,$title]); + } + my $tp=sum(map {$_[0]},@aoa); + $td %= $tp; + for @aoa -> @t { + if ($td < @t[0]) { + $td=floor($td/1000); + my $h=floor($td/3600); + my $m=floor($td/60) % 60; + my $s=$td % 60; + return sprintf('%02d:%02d:%02d %s',$h,$m,$s,@t[1]); + } else { + $td-=@t[0]; + } + } +} + diff --git a/challenge-103/roger-bell-west/ruby/ch-1.rb b/challenge-103/roger-bell-west/ruby/ch-1.rb new file mode 100755 index 0000000000..7b335d9cbe --- /dev/null +++ b/challenge-103/roger-bell-west/ruby/ch-1.rb @@ -0,0 +1,28 @@ +#! /usr/bin/ruby + +def cz(yy) + y=yy + if y<0 then + y += 1 + end + y = y % 60 + while y<0 + y += 60 + end + return [['Metal','Water','Wood','Fire','Earth'][(y/2).floor%5], + ['Monkey','Rooster','Dog','Pig','Rat','Water Buffalo','Tiger','Cat','Dragon','Snake','Horse','Goat'][y%12]].join(' ') +end + +require 'test/unit' + +class TestCz < Test::Unit::TestCase + + def test_ex1 + assert_equal('Fire Rooster',cz(2017)) + end + + def test_ex2 + assert_equal('Earth Tiger',cz(1938)) + end + +end diff --git a/challenge-103/roger-bell-west/ruby/ch-2.rb b/challenge-103/roger-bell-west/ruby/ch-2.rb new file mode 100755 index 0000000000..85778e0927 --- /dev/null +++ b/challenge-103/roger-bell-west/ruby/ch-2.rb @@ -0,0 +1,34 @@ +#! /usr/bin/ruby + +require 'csv' + +def wp(ts,tn,csvfile) + td=(tn-ts)*1000 + aoa=Array.new + CSV.foreach(csvfile) do |row| + aoa.push([row[0].to_i,row[1]]) + end + tp=aoa.map{|t| t[0]}.sum + td=td%tp + aoa.each do |t| + if td String { + let mut y: i32=yy; + if y<0 { + y += 1; + } + y %= 60; + while y<0 { + y += 60; + } + let yu: usize=y as usize; + let mut out="".to_string(); + out.push_str(vec!["Metal","Water","Wood","Fire","Earth"][(yu/2)%5]); + out.push_str(" "); + out.push_str(vec!["Monkey","Rooster","Dog","Pig","Rat","Water Buffalo","Tiger","Cat","Dragon","Snake","Horse","Goat"][yu%12]); + return out; +} diff --git a/challenge-103/roger-bell-west/rust/ch-2.rs b/challenge-103/roger-bell-west/rust/ch-2.rs new file mode 100644 index 0000000000..c1b2015c9e --- /dev/null +++ b/challenge-103/roger-bell-west/rust/ch-2.rs @@ -0,0 +1,47 @@ +// Cargo.toml needs: +// [dependencies] +// csv = "1.1" + +use std::fs::File; + +#[test] +fn test_ex1() { + assert_eq!(wp(1606134123,1614591276,"t2.csv"),"00:10:24 Les Miserables Episode 1: The Bishop (broadcast date: 1937-07-23)"); +} + +pub struct Track { + length: i64, + title: String +} + +fn wp (ts: i64,tn: i64,csvfile: &str) -> String { + let mut td: i64=(tn-ts)*1000; + let file=File::open(&csvfile).unwrap(); + let mut rdr = csv::ReaderBuilder::new() + .has_headers(false) + .from_reader(file); + let mut aoa: Vec=vec![]; + for result in rdr.records() { + let record = result.unwrap(); + aoa.push(Track { + length: record.get(0).unwrap().parse::().unwrap(), + title: record.get(1).unwrap().to_string() + }); + } + let tp: i64=aoa.iter() + .map(|t| t.length) + .sum(); + td %= tp; + for t in aoa { + if td < t.length { + td=td/1000; + let h=td/3600; + let m=(td/60) % 60; + let s=td % 60; + return format!("{:02}:{:02}:{:02} {}",h,m,s,t.title); + } else { + td -= t.length; + } + } + return "".to_string(); +} diff --git a/challenge-103/roger-bell-west/t2.csv b/challenge-103/roger-bell-west/t2.csv new file mode 100644 index 0000000000..4d66b079d7 --- /dev/null +++ b/challenge-103/roger-bell-west/t2.csv @@ -0,0 +1,7 @@ +1709363,"Les Miserables Episode 1: The Bishop (broadcast date: 1937-07-23)" +1723781,"Les Miserables Episode 2: Javert (broadcast date: 1937-07-30)" +1723781,"Les Miserables Episode 3: The Trial (broadcast date: 1937-08-06)" +1678356,"Les Miserables Episode 4: Cosette (broadcast date: 1937-08-13)" +1646043,"Les Miserables Episode 5: The Grave (broadcast date: 1937-08-20)" +1714640,"Les Miserables Episode 6: The Barricade (broadcast date: 1937-08-27)" +1714640,"Les Miserables Episode 7: Conclusion (broadcast date: 1937-09-03)" -- cgit From 97b6868b492a7e9991c9e489b51b9da4aed2062e Mon Sep 17 00:00:00 2001 From: chirvasitua Date: Mon, 8 Mar 2021 11:06:35 -0500 Subject: 1st commit on 103_haskell --- challenge-103/stuart-little/haskell/ch-1.hs | 21 +++++++++++++++++ challenge-103/stuart-little/haskell/ch-2.hs | 36 +++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100755 challenge-103/stuart-little/haskell/ch-1.hs create mode 100755 challenge-103/stuart-little/haskell/ch-2.hs diff --git a/challenge-103/stuart-little/haskell/ch-1.hs b/challenge-103/stuart-little/haskell/ch-1.hs new file mode 100755 index 0000000000..695d6e2d62 --- /dev/null +++ b/challenge-103/stuart-little/haskell/ch-1.hs @@ -0,0 +1,21 @@ +#!/usr/bin/env runghc + +-- run