From 74d6f5b5d7b341e12055ea73d3e3e0576fdc2b18 Mon Sep 17 00:00:00 2001 From: Mohammad Sajid Anwar Date: Tue, 6 Aug 2024 23:29:43 +0100 Subject: - Added solutions by Peter Meszaros. - Added solutions by Ulrich Rieke. - Added solutions by Steven Wilson. --- challenge-281/peter-meszaros/perl/ch-1.pl | 56 +++ challenge-281/peter-meszaros/perl/ch-2.pl | 88 ++++ challenge-281/peter-meszaros/tcl/ch-1.tcl | 60 +++ challenge-281/peter-meszaros/tcl/ch-2.tcl | 102 ++++ challenge-281/ulrich-rieke/cpp/ch-1.cpp | 43 ++ challenge-281/ulrich-rieke/cpp/ch-2.cpp | 80 +++ challenge-281/ulrich-rieke/haskell/ch-1.hs | 25 + challenge-281/ulrich-rieke/haskell/ch-2.hs | 40 ++ challenge-281/ulrich-rieke/perl/ch-1.pl | 52 ++ challenge-281/ulrich-rieke/perl/ch-2.pl | 54 ++ challenge-281/ulrich-rieke/raku/ch-1.raku | 35 ++ challenge-281/ulrich-rieke/raku/ch-2.raku | 47 ++ challenge-281/ulrich-rieke/rust/ch-1.rs | 35 ++ challenge-281/ulrich-rieke/rust/ch-2.rs | 61 +++ stats/pwc-current.json | 206 ++++---- stats/pwc-language-breakdown-2019.json | 632 +++++++++++------------ stats/pwc-language-breakdown-2020.json | 426 ++++++++-------- stats/pwc-language-breakdown-2021.json | 416 ++++++++-------- stats/pwc-language-breakdown-2022.json | 770 ++++++++++++++--------------- stats/pwc-language-breakdown-2023.json | 766 ++++++++++++++-------------- stats/pwc-language-breakdown-2024.json | 510 +++++++++---------- stats/pwc-language-breakdown-summary.json | 54 +- stats/pwc-leaders.json | 384 +++++++------- stats/pwc-summary-1-30.json | 106 ++-- stats/pwc-summary-121-150.json | 98 ++-- stats/pwc-summary-151-180.json | 104 ++-- stats/pwc-summary-181-210.json | 110 ++--- stats/pwc-summary-211-240.json | 106 ++-- stats/pwc-summary-241-270.json | 112 ++--- stats/pwc-summary-271-300.json | 104 ++-- stats/pwc-summary-301-330.json | 58 +-- stats/pwc-summary-31-60.json | 100 ++-- stats/pwc-summary-61-90.json | 30 +- stats/pwc-summary-91-120.json | 46 +- stats/pwc-summary.json | 54 +- stats/pwc-yearly-language-summary.json | 114 ++--- 36 files changed, 3448 insertions(+), 2636 deletions(-) create mode 100644 challenge-281/peter-meszaros/perl/ch-1.pl create mode 100644 challenge-281/peter-meszaros/perl/ch-2.pl create mode 100644 challenge-281/peter-meszaros/tcl/ch-1.tcl create mode 100644 challenge-281/peter-meszaros/tcl/ch-2.tcl create mode 100755 challenge-281/ulrich-rieke/cpp/ch-1.cpp create mode 100755 challenge-281/ulrich-rieke/cpp/ch-2.cpp create mode 100755 challenge-281/ulrich-rieke/haskell/ch-1.hs create mode 100755 challenge-281/ulrich-rieke/haskell/ch-2.hs create mode 100755 challenge-281/ulrich-rieke/perl/ch-1.pl create mode 100755 challenge-281/ulrich-rieke/perl/ch-2.pl create mode 100755 challenge-281/ulrich-rieke/raku/ch-1.raku create mode 100755 challenge-281/ulrich-rieke/raku/ch-2.raku create mode 100755 challenge-281/ulrich-rieke/rust/ch-1.rs create mode 100755 challenge-281/ulrich-rieke/rust/ch-2.rs diff --git a/challenge-281/peter-meszaros/perl/ch-1.pl b/challenge-281/peter-meszaros/perl/ch-1.pl new file mode 100644 index 0000000000..8cbcddaa71 --- /dev/null +++ b/challenge-281/peter-meszaros/perl/ch-1.pl @@ -0,0 +1,56 @@ +#!/usr/bin/env perl +# +=head1 Task 1: Check Color +Submitted by: Mohammad Sajid Anwar +You are given coordinates, a string that represents the coordinates of a square +of the chessboard as shown below: + +-+-+-+-+-+-+-+-+ + 8 | |#| |#| |#| |#| + 7 |#| |#| |#| |#| | + 6 | |#| |#| |#| |#| + 5 |#| |#| |#| |#| | + 4 | |#| |#| |#| |#| + 3 |#| |#| |#| |#| | + 2 | |#| |#| |#| |#| + 1 |#| |#| |#| |#| | + +-+-+-+-+-+-+-+-+ + a b c d e f g h +Write a script to return true if the square is light, and false if the square +is dark. +=head2 Example 1 + Input: $coordinates = "d3" + Output: true +=head2 Example 2 + Input: $coordinates = "g5" + Output: false +=head2 Example 3 + Input: $coordinates = "e6" + Output: true +=cut + +use strict; +use warnings; +use Test2::V0 -no_srand => 1; +use Data::Dumper; + +my $cases = [ + ['d3', 1, 'Example 1'], + ['g5', 0, 'Example 2'], + ['e6', 1, 'Example 3'], +]; + +sub check_color +{ + my $pos = shift; + + my ($x, $y) = split '', $pos; + + return (ord($x) + $y) % 2; +} + +for (@$cases) { + is(check_color($_->[0]), $_->[1], $_->[2]); +} +done_testing(); + +exit 0; diff --git a/challenge-281/peter-meszaros/perl/ch-2.pl b/challenge-281/peter-meszaros/perl/ch-2.pl new file mode 100644 index 0000000000..b708fd4754 --- /dev/null +++ b/challenge-281/peter-meszaros/perl/ch-2.pl @@ -0,0 +1,88 @@ +#!/usr/bin/env perl +# +=head1 Task 2: Knight's Move +Submitted by: Peter Campbell Smith +A Knight in chess can move from its current position to any square two rows or +columns plus one column or row away. So in the diagram below, if it starts a S, +it can move to any of the squares marked E. +Write a script which takes a starting position and an ending position and +calculates the least number of moves required. + +--+--+--+--+--+--+--+--+ + 8 |a8| | | | | | | | + 7 | | |E | |E | | | | + 6 | |E | | | |E | | | + 5 | | | |S | | | | | + 4 | |E | | | |E | | | + 3 | | |E | |E | | | | + 2 | | | | | | |g2| | + 1 | | | | | | | | | + +--+--+--+--+--+--+--+--+ + a b c d e f g h +=head2 Example 1 + Input: $start = 'g2', $end = 'a8' + Ouput: 4 + g2 -> e3 -> d5 -> c7 -> a8 +=head2 Example 2 + Input: $start = 'g2', $end = 'h2' + Ouput: 3 + g2 -> e3 -> f1 -> h2 +=cut + +use strict; +use warnings; +use Test2::V0 -no_srand => 1; +use Data::Dumper; + +my $cases = [ + [['g2', 'a8'], 4, 'Example 1'], + [['g2', 'h2'], 3, 'Example 2'], +]; + +sub knights_move +{ + my $s = $_[0]->[0]; + my $e = $_[0]->[1]; + + my @s = split '', $s; + my @e = split '', $e; + + $s[0] = ord($s[0]) - ord('a'); + $e[0] = ord($e[0]) - ord('a'); + $s[1]--; + $e[1]--; + + my $dx = [2, 2, -2, -2, 1, 1, -1, -1]; + my $dy = [1, -1, 1, -1, 2, -2, 2, -2]; + + my @queue = [$s[0], $s[1], 0]; + my $visited->[$s[0]]->[$s[1]] = 1; + + while (@queue) { + my $p = shift @queue; + my $x = $p->[0]; + my $y = $p->[1]; + my $v = $p->[2]; + if ($x == $e[0] && $y == $e[1]) { + return $v; + } + for my $i (0 .. 7) { + my $new_x = $p->[0] + $dx->[$i]; + my $new_y = $p->[1] + $dy->[$i]; + my $val = $v + 1; + if ($new_x >= 0 && $new_x <= 7 && + $new_y >= 0 && $new_y <= 7 && + not $visited->[$new_x]->[$new_y]) { + $visited->[$new_x]->[$new_y] = 1; + push @queue, [$new_x, $new_y, $val]; + } + } + } + return undef; +} + +for (@$cases) { + is(knights_move($_->[0]), $_->[1], $_->[2]); +} +done_testing(); + +exit 0; diff --git a/challenge-281/peter-meszaros/tcl/ch-1.tcl b/challenge-281/peter-meszaros/tcl/ch-1.tcl new file mode 100644 index 0000000000..29f6ff02ea --- /dev/null +++ b/challenge-281/peter-meszaros/tcl/ch-1.tcl @@ -0,0 +1,60 @@ +#!/usr/bin/env tclsh +# +# Task 1: Check Color +# +# Submitted by: Mohammad Sajid Anwar +# +# You are given coordinates, a string that represents the coordinates of a square +# of the chessboard as shown below: +# +# +-+-+-+-+-+-+-+-+ +# 8 | |#| |#| |#| |#| +# 7 |#| |#| |#| |#| | +# 6 | |#| |#| |#| |#| +# 5 |#| |#| |#| |#| | +# 4 | |#| |#| |#| |#| +# 3 |#| |#| |#| |#| | +# 2 | |#| |#| |#| |#| +# 1 |#| |#| |#| |#| | +# +-+-+-+-+-+-+-+-+ +# a b c d e f g h +# +# Write a script to return true if the square is light, and false if the square +# is dark. +# +# Example 1 +# +# Input: $coordinates = "d3" +# Output: true +# +# Example 2 +# +# Input: $coordinates = "g5" +# Output: false +# +# Example 3 +# +# Input: $coordinates = "e6" +# Output: true + +package require tcltest + +set cases { + {d3 1 "Example 1"} + {g5 0 "Example 2"} + {e6 1 "Example 3"} +} + +proc check_color {pos} { + set l [split $pos {}] + return [expr ([scan [lindex $l 0] %c] + [lindex $l 1]) % 2] +} + +tcltest::configure -verbose {pass} +foreach case $cases { + tcltest::test [lindex $case 2] {} { + check_color [lindex $case 0] + } [lindex $case 1] +} + +exit 0 diff --git a/challenge-281/peter-meszaros/tcl/ch-2.tcl b/challenge-281/peter-meszaros/tcl/ch-2.tcl new file mode 100644 index 0000000000..68f368cf9c --- /dev/null +++ b/challenge-281/peter-meszaros/tcl/ch-2.tcl @@ -0,0 +1,102 @@ +#!/usr/bin/env tclsh +# +# Task 2: Knight's Move +# +# Submitted by: Peter Campbell Smith +# +# A Knight in chess can move from its current position to any square two rows or +# columns plus one column or row away. So in the diagram below, if it starts a S, +# it can move to any of the squares marked E. +# +# Write a script which takes a starting position and an ending position and +# calculates the least number of moves required. +# +# +--+--+--+--+--+--+--+--+ +# 8 |a8| | | | | | | | +# 7 | | |E | |E | | | | +# 6 | |E | | | |E | | | +# 5 | | | |S | | | | | +# 4 | |E | | | |E | | | +# 3 | | |E | |E | | | | +# 2 | | | | | | |g2| | +# 1 | | | | | | | | | +# +--+--+--+--+--+--+--+--+ +# a b c d e f g h +# +# Example 1 +# +# Input: $start = 'g2', $end = 'a8' +# Ouput: 4 +# +# g2 -> e3 -> d5 -> c7 -> a8 +# +# Example 2 +# +# Input: $start = 'g2', $end = 'h2' +# Ouput: 3 +# +# g2 -> e3 -> f1 -> h2 +# + +package require tcltest +package require struct::queue +package require struct::matrix + +set cases { + {{g2 a8} 4 "Example 1"} + {{g2 h2} 3 "Example 2"} +} + +proc knights_move {params} { + + set s [split [lindex $params 0] {}] + set e [split [lindex $params 1] {}] + set sx [expr [scan [lindex $s 0] %c] - [scan "a" %c]] + set ex [expr [scan [lindex $e 0] %c] - [scan "a" %c]] + set sy [expr [lindex $s 1] - 1] + set ey [expr [lindex $e 1] - 1] + set dx {2 2 -2 -2 1 1 -1 -1} + set dy {1 -1 1 -1 2 -2 2 -2} + + set queue [::struct::queue] + $queue put [list $sx $sy 0] + + set visited [::struct::matrix] + $visited add rows 8 + $visited add columns 8 + + while {[$queue size]} { + set p [$queue get] + set x [lindex $p 0] + set y [lindex $p 1] + set v [lindex $p 2] + if {$x == $ex && $y == $ey} { + $queue destroy + $visited destroy + return $v + } + for {set i 0} {$i < 8} {incr i} { + set new_x [expr $x + [lindex $dx $i]] + set new_y [expr $y + [lindex $dy $i]] + set val [expr $v + 1] + if {$new_x >= 0 && $new_x <= 7 && + $new_y >= 0 && $new_y <= 7 && + [$visited get cell $new_x $new_y] != 1} { + $visited set cell $new_x $new_y 1 + $queue put [list $new_x $new_y $val] + } + } + } + $queue destroy + $visited destroy + return null +} + +tcltest::configure -verbose {pass} +foreach case $cases { + tcltest::test [lindex $case 2] {} { + knights_move [lindex $case 0] + } [lindex $case 1] +} + +exit 0 diff --git a/challenge-281/ulrich-rieke/cpp/ch-1.cpp b/challenge-281/ulrich-rieke/cpp/ch-1.cpp new file mode 100755 index 0000000000..756a211ba5 --- /dev/null +++ b/challenge-281/ulrich-rieke/cpp/ch-1.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +using namespace std::string_literals ; + +std::vector createLine( const std::string & start ) { + std::vector line ; + for ( int i = 0 ; i < 8 ; i++ ) { + if ( i % 2 == 0 ) + line.push_back( start ) ; + else { + if ( start == "light"s ) + line.push_back( "dark"s ) ; + else + line.push_back( "light"s ) ; + } + } + return line ; +} + +int main( ) { + std::cout << "Enter the coordinates of a field on a chess board!\n" ; + std::string field ; + std::cin >> field ; + std::string cols {"abcdefgh"} ; + std::string col { field.substr( 0 , 1 ) } ; + int colpos = cols.find( col ) ; + int row { std::stoi( field.substr( 1 , 1 ) ) } ; + std::vector baseline { createLine( "dark"s ) } ; + bool result = false ; + if ( row == 1 ) { + result = (baseline[colpos] == "light"s) ; + std::cout << std::boolalpha << result << '\n' ; + } + else { + std::string foot { baseline[ colpos ] } ; + std::vector col_line { createLine( foot ) } ; + result = (col_line[ row - 1 ] == "light"s) ; + std::cout << std::boolalpha << result << '\n' ; + } + return 0 ; +} diff --git a/challenge-281/ulrich-rieke/cpp/ch-2.cpp b/challenge-281/ulrich-rieke/cpp/ch-2.cpp new file mode 100755 index 0000000000..2af80967d2 --- /dev/null +++ b/challenge-281/ulrich-rieke/cpp/ch-2.cpp @@ -0,0 +1,80 @@ +#include +#include +#include +#include +#include +#include +#include + +std::vector split( const std::string & text , char delimiter ) { + std::istringstream istr { text } ; + std::string word ; + std::vector words ; + while ( std::getline( istr , word , delimiter ) ) { + words.push_back( word ) ; + } + return words ; +} + +//create all fields of a chess board +std::vector findAllFields( ) { + std::string cols {"abcdefgh"} ; + std::string rows {"12345678"} ; + std::vector board ; + for ( int i = 0 ; i < cols.length( ) ; i++ ) { + for ( int j = 0 ; j < rows.length( ) ; j++ ) { + std::string field { cols.substr( i , 1 ).append( rows.substr( j , 1 ) ) } ; + board.push_back( field ) ; + } + } + return board ; +} + +//all suitable fields on a chessboard are those that differ from the given field +// by an absolute difference of 2 in rows and of 1 in columns or vice versa +std::vector findTargets( const std::string & field , const + std::vector & board ) { + std::vector selected ; + static const std::string columns {"abcdefgh"} ; + static const std::string rows {"12345678"} ; + auto selector = [field]( const auto & f ) { + auto colfound = columns.find_first_of( field.substr( 0 , 1 ) ) ; + auto rowfound = rows.find_first_of( field.substr( 1 , 1 ) ) ; + auto fieldcol = columns.find_first_of( f.substr( 0 , 1 ) ) ; + auto fieldrow = rows.find_first_of( f.substr( 1 , 1 ) ) ; + auto coldiff = abs( colfound - fieldcol ) ; + auto rowdiff = abs( rowfound - fieldrow ) ; + return ( (coldiff == 1) && (rowdiff == 2)) || ( (coldiff == 2) && + (rowdiff == 1 )) ; + } ; + std::copy_if( board.begin( ) , board.end( ) , std::back_inserter( selected ) , + selector ) ; + return selected ; +} + +int main( ) { + std::cout << "Enter a source and a target field!\n" ; + std::string line ; + std::getline( std::cin, line ) ; + std::vector fields { split( line , ' ' ) } ; + std::vector chessboard { findAllFields( ) } ; + std::string sourceField { fields[ 0 ] } ; + std::string targetField { fields[ 1 ] } ; + std::vector targets = findTargets( sourceField , chessboard ) ; + int count = 1 ; + while ( std::find( targets.begin( ) , targets.end( ) , targetField ) == + targets.end( ) ) { + count++ ; + std::vector newTargets , elementTargets ; + for ( auto it = targets.begin( ) ; it != targets.end( ) ; it++ ) { + elementTargets = findTargets( *it , chessboard ) ; + for ( auto f : elementTargets ) + newTargets.push_back( f ) ; + elementTargets.clear( ) ; + } + for ( auto f : newTargets ) + targets.push_back( f ) ; + } + std::cout << count << '\n' ; + return 0 ; +} diff --git a/challenge-281/ulrich-rieke/haskell/ch-1.hs b/challenge-281/ulrich-rieke/haskell/ch-1.hs new file mode 100755 index 0000000000..ed267a395d --- /dev/null +++ b/challenge-281/ulrich-rieke/haskell/ch-1.hs @@ -0,0 +1,25 @@ +module Challenge281 + where +import Data.List ( findIndices , ( !! )) +import Data.Char ( digitToInt ) + +createLine :: String -> [String] +createLine base = if base == "light" then take 8 $ cycle ["light" , "dark"] + else take 8 $ cycle ["dark" , "light"] + +solution :: String -> Bool +solution field = + let baseline = createLine "dark" + columns = "abcdefgh" + row = digitToInt $ last field + col = head field + colindex = head $ findIndices ( == col ) columns + in if row == 1 then (baseline !! colindex) == "light" else ( createLine + ( baseline !! colindex ) !! ( row - 1 ) ) == "light" + + +main :: IO ( ) +main = do + putStrLn "Enter the coordinates of a chess field!" + field <- getLine + print $ solution field diff --git a/challenge-281/ulrich-rieke/haskell/ch-2.hs b/challenge-281/ulrich-rieke/haskell/ch-2.hs new file mode 100755 index 0000000000..85b360b52d --- /dev/null +++ b/challenge-281/ulrich-rieke/haskell/ch-2.hs @@ -0,0 +1,40 @@ +module Challenge281_2 + where +import Control.Applicative +import Data.Char ( digitToInt ) +import Data.Maybe ( fromJust ) + +chessboard :: [(Char , Int)] +chessboard = (,) <$> ['a'..'h'] <*> [1..8] + +convert :: String -> (Char , Int) +convert field = ( head field , digitToInt $ last field ) + +findSuitableTargets :: String -> [(Char , Int)] +findSuitableTargets field = + let converted = convert field + indexedCols = zip ['a'..'h'] [1 , 2 ..] + fieldCol = fromJust $ lookup ( fst converted ) indexedCols + fieldRow = snd converted + in filter (\p -> ((abs ( (fromJust $ lookup ( fst p ) indexedCols) - fieldCol ) == 2 ) + && ( abs ( fieldRow - snd p ) == 1 )) || (( abs ( (fromJust $ lookup ( fst p ) + indexedCols) - fieldCol ) == 1 ) && ( abs ( fieldRow - snd p ) == 2 ))) chessboard + +solution :: String -> String -> Int +solution from to = fst $ until (\p -> elem target ( snd p )) step (1 , findSuitableTargets + from ) + where + target :: (Char , Int) + target = convert to + toString :: (Char , Int) -> String + toString ( c , num ) = [c] ++ show num + step :: (Int , [(Char , Int)]) -> (Int , [(Char , Int)] ) + step ( count , associations ) = ( count + 1 , concat $ map (\p -> findSuitableTargets + ( toString p ) ) associations ) + +main :: IO ( ) +main = do + putStrLn "Enter a source and a target chess field, separated by blanks!" + line <- getLine + let [from , to] = words line + print $ solution from to diff --git a/challenge-281/ulrich-rieke/perl/ch-1.pl b/challenge-281/ulrich-rieke/perl/ch-1.pl new file mode 100755 index 0000000000..3ecc24160f --- /dev/null +++ b/challenge-281/ulrich-rieke/perl/ch-1.pl @@ -0,0 +1,52 @@ +#!/usr/bin/perl ; +use strict ; +use warnings ; +use feature 'say' ; + +sub createLine { + my $start = shift ; + my @line ; + for my $pos ( 0..7) { + if ( $pos % 2 == 0 ) { + push( @line, $start ) ; + } + else { + if ( $start eq "light" ) { + push( @line, "dark" ) ; + } + else { + push( @line , "light" ) ; + } + } + } + return @line ; +} + +say "Enter a field on a chessboard!" ; +my $field = ; +chomp $field ; +my $col = substr( $field, 0 , 1 ) ; +my $row = substr( $field , 1 , 1 ) ; +my $cols = "abcdefgh" ; +my @baseline = createLine( "dark" ) ; +my $result ; +if ( $row == 1 ) { + if ( $baseline[ index( $cols , $col ) ] eq "light" ) { + $result = "true" ; + } + else { + $result = "false" ; + } +} +else { + my $foot = $baseline[ index( $cols , $col ) ] ; + my @col_line = createLine( $foot ) ; + if ( $col_line[ $row - 1 ] eq "light" ) { + $result = "true" ; + } + else { + $result = "false" ; + } +} +say $result ; + diff --git a/challenge-281/ulrich-rieke/perl/ch-2.pl b/challenge-281/ulrich-rieke/perl/ch-2.pl new file mode 100755 index 0000000000..29210ed3d1 --- /dev/null +++ b/challenge-281/ulrich-rieke/perl/ch-2.pl @@ -0,0 +1,54 @@ +#!/usr/bin/perl ; +use strict ; +use warnings ; +use feature 'say' ; + +#find the target fields of the given knight field! Keep doing so for every target +#field until the target field we look for is in the array! + +#find possible target fields out of all chess fields possible! +sub findTargetFields { + my $field = shift ; + my $chessfields = shift ; + my $cols = "abcdefgh" ; + my $rows = "12345678" ; + my @targetFields = grep { (abs( index( $cols , substr( $field , 0 , 1 )) - + index( $cols , substr( $_ , 0 , 1 ) ) ) == 1 && ( abs( index( $rows , + substr( $field , 1 , 1 ) ) - index( $rows , substr( $_ , 1 , 1 ) )) + == 2 )) || ( abs( index( $cols , substr( $field , 0 , 1 ) ) - index( $cols , + substr($_ , 0 , 1 ))) == 2 && ( abs( index( $rows , substr( + $field , 1 , 1 ) ) - index( $rows , substr( $_ , 1 , 1 ) )) + == 1 )) } @$chessfields ; + return @targetFields ; +} + +say "Enter a start and a target field of a knight!" ; +my $line = ; +chomp $line ; +(my $start , my $target ) = split( /\s+/ , $line ) ; +#create all possible chess fields ; +my $cols = "abcdefgh" ; +my $rows = "12345678" ; +my @chessfields ; +for my $col( split( // , $cols ) ) { + for my $row ( split( // , $rows ) ) { + push( @chessfields , $col . $row ) ; + } +} +my %targetsFound ; +my $count = 1 ; +my @targetFields = findTargetFields( $start , \@chessfields ) ; +map { $targetsFound{$_}++ } @targetFields ; +while ( not ( exists( $targetsFound{ $target } ) ) ) { + $count++ ; + my @newTargets ; + for my $field ( keys %targetsFound ) { + my @currentTargets = findTargetFields( $field , \@chessfields ) ; + for my $el ( @currentTargets ) { + push( @newTargets , $el ) ; + } + } + map { $targetsFound{ $_}++ } @newTargets ; + @newTargets = ( ) ; +} +say $count ; diff --git a/challenge-281/ulrich-rieke/raku/ch-1.raku b/challenge-281/ulrich-rieke/raku/ch-1.raku new file mode 100755 index 0000000000..f24c61aef5 --- /dev/null +++ b/challenge-281/ulrich-rieke/raku/ch-1.raku @@ -0,0 +1,35 @@ +use v6 ; + +sub createLine( $start ) { + my @line ; + for (0..7) -> $pos { + if ( $pos %% 2 ) { + @line.push( $start ) ; + } + else { + if ( $start eq "light" ) { + @line.push( "dark" ) ; + } + else { + @line.push( "light" ) ; + } + } + } + return @line ; +} + +say "Enter the coordinates of a chess field!" ; +my $field = $*IN.get ; +my $cols = "abcdefgh" ; +my $col = $field.substr( 0 , 1 ) ; +my $row = $field.substr( 1 , 1 ).map( {.Int} ) ; +my @baseline = createLine( "dark" ) ; +my $result ; +if ( $row == 1 ) { + $result = @baseline[ $cols.index( $col ) ] eq "light" ; +} +else { + my @col_line = createLine( @baseline[ $cols.index( $col )] ) ; + $result = @col_line[ $row - 1 ] eq "light" ; +} +say $result ; diff --git a/challenge-281/ulrich-rieke/raku/ch-2.raku b/challenge-281/ulrich-rieke/raku/ch-2.raku new file mode 100755 index 0000000000..0e3e46e3cf --- /dev/null +++ b/challenge-281/ulrich-rieke/raku/ch-2.raku @@ -0,0 +1,47 @@ +use v6 ; + +#the basic idea is : find all possible target fields for a given source field! +#then, for every target field found , again create all new target fields until +#the initial target field is in it + +sub findTargets( @allFields , $start ) { + my $cols = "abcdefgh" ; + my $rows = "12345678" ; + my @targets = @allFields.grep( { abs($cols.index( $start.substr( 0 , 1 )) - + $cols.index($_.substr( 0 , 1))) == 1 && abs( $rows.index( $start.substr(1 , 1 )) - + $rows.index( $_.substr( 1 , 1 ) )) == 2 || ( abs( $cols.index( + $start.substr( 0 , 1 )) - $cols.index( $_.substr( 0 , 1 ))) == 2 && + (abs( $rows.index( $start.substr( 1 , 1 ) ) - $rows.index( $_.substr( 1 , 1 ))) + == 1 ) ) } ) ; + return @targets ; +} + +say "Enter a start and a target chess field!" ; +my $line = $*IN.get ; +(my $start , my $target ) = $line.words ; +my $cols = "abcdefgh" ; +my $rows = "12345678" ; +my @chessFields ; +for ($cols.comb) -> $column { + for ( $rows.comb) -> $row { + my $field = $column ~ $row ; + @chessFields.push( $field ) ; + } +} +my $count = 1 ; +my @newTargets = findTargets( @chessFields , $start ) ; +my $fieldSet = @newTargets.Set ; +while ( not ( $target (elem) $fieldSet ) ) { + $count++ ; + my @nextTargets ; + for @newTargets -> $tar { + my @elementsTargets = findTargets( @chessFields , $tar ) ; + for (@elementsTargets) -> $el { + @nextTargets.push( $el ) ; + } + @elementsTargets = ( ) ; + } + @newTargets = @nextTargets ; + $fieldSet = @newTargets.Set ; +} +say $count ; diff --git a/challenge-281/ulrich-rieke/rust/ch-1.rs b/challenge-281/ulrich-rieke/rust/ch-1.rs new file mode 100755 index 0000000000..3f83868afd --- /dev/null +++ b/challenge-281/ulrich-rieke/rust/ch-1.rs @@ -0,0 +1,35 @@ +use std::io ; + +fn main() { + println!("Enter a chess field!"); + let mut inline : String = String::new( ) ; + io::stdin( ).read_line( &mut inline ).unwrap( ) ; + let entered_line : &str = inline.as_str( ).trim( ) ; + let cols : &str = "abcdefgh" ; + let col : char = entered_line.chars( ).nth( 0 ).unwrap( ) ; + let row : u32 = entered_line.chars( ).nth( 1 ).unwrap( ).to_digit( 10 ).unwrap( ) ; + let first_pair : Vec<&str> = vec!["light" , "dark"] ; + let second_pair : Vec<&str> = vec!["dark" , "light"] ; + let colnum = cols.find( col ).unwrap( ) ; + let mut baseline_colors : Vec<&str> = Vec::new( ) ; + let it = second_pair.iter( ).cycle( ).take( 8 ) ; + it.for_each( | f | baseline_colors.push( f ) ) ; + let result : bool ; + if row == 1 { + result = baseline_colors.iter( ).nth( colnum ).unwrap( ) == &"light" ; + } + else { + let base_color : &str = baseline_colors[colnum] ; + let mut col_sequence : Vec<&str> = Vec::new( ) ; + if base_color == "light" { + let sec_it = first_pair.iter( ).cycle( ).take( 8 ) ; + sec_it.for_each( | f | col_sequence.push( f ) ) ; + } + else { + let it = second_pair.iter( ).cycle( ).take( 8 ) ; + it.for_each( | f | col_sequence.push( f ) ) ; + } + result = col_sequence[ (row - 1) as usize] == "light" ; + } + println!("{}" , result) ; +} diff --git a/challenge-281/ulrich-rieke/rust/ch-2.rs b/challenge-281/ulrich-rieke/rust/ch-2.rs new file mode 100755 index 0000000000..cdd6ec07c8 --- /dev/null +++ b/challenge-281/ulrich-rieke/rust/ch-2.rs @@ -0,0 +1,61 @@ +use std::io ; + +//find the target fields for a given start field +fn find_target_fields( from : String , fields : &Vec<(char , char)> ) + -> Vec { + let field : &str = &from[..] ; + let chess_cols : &str = "abcdefgh" ; + let chess_rows : &str = "12345678" ; + let col : char = field.chars( ).nth( 0 ).unwrap( ) ; + let row : char = field.chars( ).nth( 1 ).unwrap( ) ; + let colpos = chess_cols.find( col ).unwrap( ) ; + let rowpos = chess_rows.find( row ).unwrap( ) ; + let mut target_fields : Vec = Vec::new( ) ; + fields.into_iter( ).filter( | p | { + let pos1 = chess_cols.find( p.0 ).unwrap( ) ; + let pos2 = chess_rows.find( p.1).unwrap( ) ; + let coldiff : i8 = pos1 as i8 - colpos as i8 ; + let rowdiff : i8 = pos2 as i8 - rowpos as i8 ; + coldiff.abs( ) == 1 && rowdiff.abs( ) == 2 || + (coldiff.abs( ) == 2 && rowdiff.abs( ) == 1 ) + } ).map( | p | { + let mut a_field : String = String::new( ) ; + a_field.push( p.0 ) ; + a_field.push( p.1 ) ; + a_field + }).for_each( | f | target_fields.push( f ) ) ; + target_fields +} + +//it's a brute force approach... find the target fields for the start field, +// and after that , keep creating the target fields for every found field +//until the field given at the start is in it! +fn main() { + println!("Enter a source and a target chess field!"); + let mut inline : String = String::new( ) ; + io::stdin( ).read_line( &mut inline ).unwrap( ) ; + let entered_line : &str = inline.as_str( ).trim( ) ; + let entered_fields : Vec<&str> = entered_line.split_whitespace( ).collect( ) ; + let start_field : String = entered_fields[0].into( ) ; + let target : String = entered_fields[1].into( ) ; + let chess_cols : &str = "abcdefgh" ; + let chess_rows : &str = "12345678" ; + let mut all_fields : Vec<(char , char)> = Vec::new( ) ; + for c in chess_cols.chars( ) { + for r in chess_rows.chars( ) { + all_fields.push( (c , r ) ) ; + } + } + let mut count : usize = 1 ; + let mut target_fields : Vec = find_target_fields( start_field , + & all_fields ) ; + let mut targets = &target_fields[..] ; + while ! targets.contains( &target ) { + count += 1 ; + let new_targets : Vec = target_fields.iter( ).map( | s | + find_target_fields( s.to_string( ) , &all_fields )).flatten( ).collect( ) ; + target_fields = new_targets.clone( ) ; + targets = &target_fields[..] ; + } + println!("{}" , count ) ; +} diff --git a/stats/pwc-current.json b/stats/pwc-current.json index 3db976fa62..af688e0780 100644 --- a/stats/pwc-current.json +++ b/stats/pwc-current.json @@ -1,20 +1,6 @@ { - "xAxis" : { - "type" : "category" - }, - "tooltip" : { - "headerFormat" : "{series.name}
", - "pointFormat" : "{point.name}: {point.y:f}
", - "followPointer" : 1 - }, - "chart" : { - "type" : "column" - }, - "subtitle" : { - "text" : "[Champions: 16] Last updated at 2024-08-06 13:26:39 GMT" - }, - "legend" : { - "enabled" : 0 + "title" : { + "text" : "The Weekly Challenge - 281" }, "drilldown" : { "series" : [ @@ -29,8 +15,6 @@ "name" : "Alexander Karelas" }, { - "id" : "Dave Jacoby", - "name" : "Dave Jacoby", "data" : [ [ "Perl", @@ -40,59 +24,62 @@ "Blog", 1 ] - ] + ], + "id" : "Dave Jacoby", + "name" : "Dave Jacoby" }, { "id" : "David Ferrone", - "name" : "David Ferrone", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "David Ferrone" }, { + "name" : "E. Choroba", "data" : [ [ "Perl", 2 ] ], - "id" : "E. Choroba", - "name" : "E. Choroba" + "id" : "E. Choroba" }, { - "id" : "Feng Chang", - "name" : "Feng Chang", "data" : [ [ "Raku", 2 ] - ] + ], + "name" : "Feng Chang", + "id" : "Feng Chang" }, { "name" : "Jan Krnavek", - "id" : "Jan Krnavek", "data" : [ [ "Raku", 2 ] - ] + ], + "id" : "Jan Krnavek" }, { - "id" : "Kjetil Skotheim", - "name" : "Kjetil Skotheim", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "Kjetil Skotheim", + "id" : "Kjetil Skotheim" }, { + "id" : "Laurent Rosenfeld", "data" : [ [ "Perl", @@ -107,30 +94,30 @@ 1 ] ], - "name" : "Laurent Rosenfeld", - "id" : "Laurent Rosenfeld" + "name" : "Laurent Rosenfeld" }, { "id" : "Mariano Ortega", - "name" : "Mariano Ortega", "data" : [ [ "Perl", 2 ] - ] + ], + "name" : "Mariano Ortega" }, { "name" : "Mark Anderson", - "id" : "Mark Anderson", "data" : [ [ "Raku", 2 ] - ] + ], + "id" : "Mark Anderson" }, { + "id" : "Packy Anderson", "data" : [ [ "Perl", @@ -145,12 +132,10 @@ 1 ] ], - "name" : "Packy Anderson", - "id" : "Packy Anderson" + "name" : "Packy Anderson" }, { "name" : "Peter Campbell Smith", - "id" : "Peter Campbell Smith", "data" : [ [ "Perl", @@ -160,9 +145,21 @@ "Blog", 1 ] - ] + ], + "id" : "Peter Campbell Smith" + }, + { + "name" : "Peter Meszaros", + "data" : [ + [ + "Perl", + 2 + ] + ], + "id" : "Peter Meszaros" }, { + "id" : "Roger Bell_West", "data" : [ [ "Perl", @@ -173,10 +170,10 @@ 2 ] ], - "name" : "Roger Bell_West", - "id" : "Roger Bell_West" + "name" : "Roger Bell_West" }, { + "name" : "Thomas Kohler", "data" : [ [ "Perl", @@ -187,11 +184,23 @@ 2 ] ], - "name" : "Thomas Kohler", "id" : "Thomas Kohler" }, { - "name" : "W. Luis Mochan", + "id" : "Ulrich Rieke", + "data" : [ + [ + "Perl", + 2 + ], + [ + "Raku", + 2 + ] + ], + "name" : "Ulrich Rieke" + }, + { "id" : "W. Luis Mochan", "data" : [ [ @@ -202,66 +211,60 @@ "Blog", 1 ] - ] + ], + "name" : "W. Luis Mochan" }, { - "name" : "Wanderdoc", - "id" : "Wanderdoc", "data" : [ [ "Perl", 2 ] - ] + ], + "id" : "Wanderdoc", + "name" : "Wanderdoc" } ] }, - "plotOptions" : { - "series" : { - "borderWidth" : 0, - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - } - } - }, "yAxis" : { "title" : { "text" : "Total Solutions" } }, + "subtitle" : { + "text" : "[Champions: 18] Last updated at 2024-08-06 22:29:23 GMT" + }, "series" : [ { - "colorByPoint" : 1, "data" : [ { - "name" : "Alexander Karelas", "y" : 2, - "drilldown" : "Alexander Karelas" + "drilldown" : "Alexander Karelas", + "name" : "Alexander Karelas" }, { - "drilldown" : "Dave Jacoby", "name" : "Dave Jacoby", + "drilldown" : "Dave Jacoby", "y" : 3 }, { + "y" : 2, "drilldown" : "David Ferrone", - "name" : "David Ferrone", - "y" : 2 + "name" : "David Ferrone" }, { - "drilldown" : "E. Choroba", + "y" : 2, "name" : "E. Choroba", - "y" : 2 + "drilldown" : "E. Choroba" }, { + "drilldown" : "Feng Chang", "name" : "Feng Chang", - "y" : 2, - "drilldown" : "Feng Chang" + "y" : 2 }, { - "drilldown" : "Jan Krnavek", "y" : 2, + "drilldown" : "Jan Krnavek", "name" : "Jan Krnavek" }, { @@ -270,24 +273,24 @@ "y" : 2 }, { - "y" : 3, "name" : "Laurent Rosenfeld", - "drilldown" : "Laurent Rosenfeld" + "drilldown" : "Laurent Rosenfeld", + "y" : 3 }, { + "name" : "Mariano Ortega", "drilldown" : "Mariano Ortega", - "y" : 2, - "name" : "Mariano Ortega" + "y" : 2 }, { - "y" : 2, "name" : "Mark Anderson", - "drilldown" : "Mark Anderson" + "drilldown" : "Mark Anderson", + "y" : 2 }, { - "name" : "Packy Anderson", "y" : 5, - "drilldown" : "Packy Anderson" + "drilldown" : "Packy Anderson", + "name" : "Packy Anderson" }, { "drilldown" : "Peter Campbell Smith", @@ -295,30 +298,61 @@ "y" : 3 }, { - "drilldown" : "Roger Bell_West", + "y" : 2, + "name" : "Peter Meszaros", + "drilldown" : "Peter Meszaros" + }, + { "y" : 4, + "drilldown" : "Roger Bell_West", "name" : "Roger Bell_West" }, { - "drilldown" : "Thomas Kohler", "y" : 4, - "name" : "Thomas Kohler" + "name" : "Thomas Kohler", + "drilldown" : "Thomas Kohler" + }, + { + "drilldown" : "Ulrich Rieke", + "name" : "Ulrich Rieke", + "y" : 4 }, { - "name" : "W. Luis Mochan", "y" : 3, + "name" : "W. Luis Mochan", "drilldown" : "W. Luis Mochan" }, { + "drilldown" : "Wanderdoc", "name" : "Wanderdoc", - "y" : 2, - "drilldown" : "Wanderdoc" + "y" : 2 } ], - "name" : "The Weekly Challenge - 281" + "name" : "The Weekly Challenge - 281", + "colorByPoint" : 1 } ], - "title" : { - "text" : "The Weekly Challenge - 281" + "chart" : { + "type" : "column" + }, + "plotOptions" : { + "series" : { + "dataLabels" : { + "format" : "{point.y}", + "enabled" : 1 + }, + "borderWidth" : 0 + } + }, + "legend" : { + "enabled" : 0 + }, + "xAxis" : { + "type" : "category" + }, + "tooltip" : { + "headerFormat" : "{series.name}
", + "pointFormat" : "{point.name}: {point.y:f}
", + "followPointer" : 1 } } diff --git a/stats/pwc-language-breakdown-2019.json b/stats/pwc-language-breakdown-2019.json index 28ca1796bb..8e542545fd 100644 --- a/stats/pwc-language-breakdown-2019.json +++ b/stats/pwc-language-breakdown-2019.json @@ -1,22 +1,241 @@ { - "legend" : { - "enabled" : "false" - }, - "subtitle" : { - "text" : "Click the columns to drilldown the language breakdown. Last updated at 2024-08-06 13:26:39 GMT" - }, "plotOptions" : { "series" : { - "borderWidth" : 0, "dataLabels" : { "format" : "{point.y}", "enabled" : 1 - } + }, + "borderWidth" : 0 } }, + "chart" : { + "type" : "column" + }, + "series" : [ + { + "colorByPoint" : "true", + "name" : "The Weekly Challenge Languages", + "data" : [ + { + "drilldown" : "041", + "name" : "041", + "y" : 80 + }, + { + "y" : 77, + "drilldown" : "040", + "name" : "040" + }, + { + "name" : "039", + "drilldown" : "039", + "y" : 68 + }, + { + "drilldown" : "038", + "name" : "038", + "y" : 74 + }, + { + "y" : 70, + "name" : "037", + "drilldown" : "037" + }, + { + "y" : 70, + "drilldown" : "036", + "name" : "036" + }, + { + "name" : "035", + "drilldown" : "035", + "y" : 68 + }, + { + "drilldown" : "034", + "name" : "034", + "y" : 70 + }, + { + "y" : 113, + "drilldown" : "033", + "name" : "033" + }, + { + "drilldown" : "032", + "name" : "032", + "y" : 97 + }, + { + "name" : "031", + "drilldown" : "031", + "y" : 93 + }, + { + "drilldown" : "030", + "name" : "030", + "y" : 120 + }, + { + "y" : 83, + "drilldown" : "029", + "name" : "029" + }, + { + "name" : "028", + "drilldown" : "028", + "y" : 82 + }, + { + "y" : 64, + "name" : "027", + "drilldown" : "027" + }, + { + "name" : "026", + "drilldown" : "026", + "y" : 75 + }, + { + "drilldown" : "025", + "name" : "025", + "y" : 62 + }, + { + "name" : "024", + "drilldown" : "024", + "y" : 77 + }, + { + "name" : "023", + "drilldown" : "023", + "y" : 88 + }, + { + "y" : 72, + "drilldown" : "022", + "name" : "022" + }, + { + "drilldown" : "021", + "name" : "021", + "y" : 72 + }, + { + "y" : 100, + "drilldown" : "020", + "name" : "020" + }, + { + "drilldown" : "019", + "name" : "019", + "y" : 101 + }, + { + "y" : 82, + "drilldown" : "018", + "name" : "018" + }, + { + "y" : 83, + "drilldown" : "017", + "name" : "017" + }, + { + "drilldown" : "016", + "name" : "016", + "y" : 75 + }, + { + "name" : "015", + "drilldown" : "015", + "y" : 95 + }, + { + "y" : 98, + "name" : "014", + "drilldown" : "014" + }, + { + "y" : 85, + "drilldown" : "013", + "name" : "013" + }, + { + "y" : 90, + "name" : "012", + "drilldown" : "012" + }, + { + "drilldown" : "011", + "name" : "011", + "y" : 86 + }, + { + "y" : 69, + "name" : "010", + "drilldown" : "010" + }, + { + "y" : 79, + "name" : "009", + "drilldown" : "009" + }, + { + "name" : "008", + "drilldown" : "008", + "y" : 82 + }, + { + "y" : 71, + "drilldown" : "007", + "name" : "007" + }, + { + "name" : "006", + "drilldown" : "006", + "y" : 63 + }, + { + "drilldown" : "005", + "name" : "005", + "y" : 82 + }, + { + "name" : "004", + "drilldown" : "004", + "y" : 106 + }, + { + "y" : 91, + "name" : "003", + "drilldown" : "003" + }, + { + "drilldown" : "002", + "name" : "002", + "y" : 133 + }, + { + "y" : 165, + "drilldown" : "001", + "name" : "001" + } + ] + } + ], + "yAxis" : { + "title" : { + "text" : "Total Solutions" + } + }, + "subtitle" : { + "text" : "Click the columns to drilldown the language breakdown. Last updated at 2024-08-06 22:29:23 GMT" + }, "drilldown" : { "series" : [ { + "id" : "041", "data" : [ [ "Perl", @@ -31,12 +250,10 @@ 9 ] ], - "id" : "041", "name" : "041" }, { "name" : "040", - "id" : "040", "data" : [ [ "Perl", @@ -50,11 +267,10 @@ "Blog", 10 ] - ] + ], + "id" : "040" }, { - "id" : "039", - "name" : "039", "data" : [ [ "Perl", @@ -68,7 +284,9 @@ "Blog", 12 ] - ] + ], + "name" : "039", + "id" : "039" }, { "data" : [ @@ -90,7 +308,6 @@ }, { "id" : "037", - "name" : "037", "data" : [ [ "Perl", @@ -104,11 +321,11 @@ "Blog", 9 ] - ] + ], + "name" : "037" }, { "name" : "036", - "id" : "036", "data" : [ [ "Perl", @@ -122,7 +339,8 @@ "Blog", 11 ] - ] + ], + "id" : "036" }, { "data" : [ @@ -143,8 +361,6 @@ "id" : "035" }, { - "id" : "034", - "name" : "034", "data" : [ [ "Perl", @@ -158,11 +374,11 @@ "Blog", 11 ] - ] + ], + "name" : "034", + "id" : "034" }, { - "name" : "033", - "id" : "033", "data" : [ [ "Perl", @@ -176,7 +392,9 @@ "Blog", 10 ] - ] + ], + "id" : "033", + "name" : "033" }, { "data" : [ @@ -193,11 +411,10 @@ 10 ] ], - "id" : "032", - "name" : "032" + "name" : "032", + "id" : "032" }, { - "id" : "031", "name" : "031", "data" : [ [ @@ -212,11 +429,11 @@ "Blog", 9 ] - ] + ], + "id" : "031" }, { "name" : "030", - "id" : "030", "data" : [ [ "Perl", @@ -230,10 +447,10 @@ "Blog", 10 ] - ] + ], + "id" : "030" }, { - "name" : "029", "id" : "029", "data" : [ [ @@ -248,10 +465,10 @@ "Blog", 12 ] - ] + ], + "name" : "029" }, { - "id" : "028", "name" : "028", "data" : [ [ @@ -266,9 +483,11 @@ "Blog", 9 ] - ] + ], + "id" : "028" }, { + "id" : "027", "data" : [ [ "Perl", @@ -283,10 +502,10 @@ 9 ] ], - "name" : "027", - "id" : "027" + "name" : "027" }, { + "name" : "026", "data" : [ [ "Perl", @@ -301,12 +520,10 @@ 10 ] ], - "id" : "026", - "name" : "026" + "id" : "026" }, { "id" : "025", - "name" : "025", "data" : [ [ "Perl", @@ -320,11 +537,10 @@ "Blog", 12 ] - ] + ], + "name" : "025" }, { - "id" : "024", - "name" : "024", "data" : [ [ "Perl", @@ -338,7 +554,9 @@ "Blog", 11 ] - ] + ], + "name" : "024", + "id" : "024" }, { "data" : [ @@ -355,8 +573,8 @@ 12 ] ], - "name" : "023", - "id" : "023" + "id" : "023", + "name" : "023" }, { "data" : [ @@ -373,12 +591,11 @@ 10 ] ], - "id" : "022", - "name" : "022" + "name" : "022", + "id" : "022" }, { "id" : "021", - "name" : "021", "data" : [ [ "Perl", @@ -392,9 +609,11 @@ "Blog", 10 ] - ] + ], + "name" : "021" }, { + "name" : "020", "data" : [ [ "Perl", @@ -409,12 +628,9 @@ 13 ] ], - "name" : "020", "id" : "020" }, { - "name" : "019", - "id" : "019", "data" : [ [ "Perl", @@ -428,7 +644,9 @@ "Blog", 13 ] - ] + ], + "id" : "019", + "name" : "019" }, { "data" : [ @@ -450,7 +668,6 @@ }, { "name" : "017", - "id" : "017", "data" : [ [ "Perl", @@ -464,10 +681,10 @@ "Blog", 12 ] - ] + ], + "id" : "017" }, { - "name" : "016", "id" : "016", "data" : [ [ @@ -482,7 +699,8 @@ "Blog", 13 ] - ] + ], + "name" : "016" }, { "data" : [ @@ -503,8 +721,6 @@ "name" : "015" }, { - "id" : "014", - "name" : "014", "data" : [ [ "Perl", @@ -518,11 +734,11 @@ "Blog", 15 ] - ] + ], + "id" : "014", + "name" : "014" }, { - "id" : "013", - "name" : "013", "data" : [ [ "Perl", @@ -536,11 +752,12 @@ "Blog", 13 ] - ] + ], + "name" : "013", + "id" : "013" }, { "id" : "012", - "name" : "012", "data" : [ [ "Perl", @@ -554,11 +771,10 @@ "Blog", 11 ] - ] + ], + "name" : "012" }, { - "id" : "011", - "name" : "011", "data" : [ [ "Perl", @@ -572,9 +788,12 @@ "Blog", 10 ] - ] + ], + "id" : "011", + "name" : "011" }, { + "id" : "010", "data" : [ [ "Perl", @@ -589,12 +808,9 @@ 11 ] ], - "name" : "010", - "id" : "010" + "name" : "010" }, { - "name" : "009", - "id" : "009", "data" : [ [ "Perl", @@ -608,9 +824,12 @@ "Blog", 13 ] - ] + ], + "id" : "009", + "name" : "009" }, { + "id" : "008", "data" : [ [ "Perl", @@ -625,12 +844,9 @@ 12 ] ], - "id" : "008", "name" : "008" }, { - "id" : "007", - "name" : "007", "data" : [ [ "Perl", @@ -644,9 +860,12 @@ "Blog", 10 ] - ] + ], + "name" : "007", + "id" : "007" }, { + "id" : "006", "data" : [ [ "Perl", @@ -661,12 +880,10 @@ 7 ] ], - "name" : "006", - "id" : "006" + "name" : "006" }, { "id" : "005", - "name" : "005", "data" : [ [ "Perl", @@ -680,11 +897,10 @@ "Blog", 12 ] - ] + ], + "name" : "005" }, { - "name" : "004", - "id" : "004", "data" : [ [ "Perl", @@ -698,11 +914,11 @@ "Blog", 10 ] - ] + ], + "name" : "004", + "id" : "004" }, { - "id" : "003", - "name" : "003", "data" : [ [ "Perl", @@ -716,11 +932,11 @@ "Blog", 9 ] - ] + ], + "id" : "003", + "name" : "003" }, { - "id" : "002", - "name" : "002", "data" : [ [ "Perl", @@ -734,9 +950,12 @@ "Blog", 10 ] - ] + ], + "name" : "002", + "id" : "002" }, { + "name" : "001", "data" : [ [ "Perl", @@ -751,241 +970,22 @@ 12 ] ], - "id" : "001", - "name" : "001" + "id" : "001" } ] }, "title" : { "text" : "The Weekly Challenge Language" }, - "yAxis" : { - "title" : { - "text" : "Total Solutions" - } + "tooltip" : { + "headerFormat" : "", + "followPointer" : "true", + "pointFormat" : "Challenge {point.name}: {point.y:f}
" }, - "series" : [ - { - "name" : "The Weekly Challenge Languages", - "colorByPoint" : "true", - "data" : [ - { - "drilldown" : "041", - "y" : 80, - "name" : "041" - }, - { - "y" : 77, - "name" : "040", - "drilldown" : "040" - }, - { - "drilldown" : "039", - "name" : "039", - "y" : 68 - }, - { - "name" : "038", - "y" : 74, - "drilldown" : "038" - }, - { - "drilldown" : "037", - "y" : 70, - "name" : "037" - }, - { - "drilldown" : "036", - "name" : "036", - "y" : 70 - }, - { - "y" : 68, - "name" : "035", - "drilldown" : "035" - }, - { - "name" : "034", - "y" : 70, - "drilldown" : "034" - }, - { - "drilldown" : "033", - "name" : "033", - "y" : 113 - }, - { - "name" : "032", - "y" : 97, - "drilldown" : "032" - }, - { - "drilldown" : "031", - "name" : "031", - "y" : 93 - }, - { - "name" : "030", - "y" : 120, - "drilldown" : "030" - }, - { - "drilldown" : "029", - "name" : "029", - "y" : 83 - }, - { - "drilldown" : "028", - "y" : 82, - "name" : "028" - }, - { - "drilldown" : "027", - "name" : "027", - "y" : 64 - }, - { - "drilldown" : "026", - "name" : "026", - "y" : 75 - }, - { - "name" : "025", - "y" : 62, - "drilldown" : "025" - }, - { - "name" : "024", - "y" : 77, - "drilldown" : "024" - }, - { - "drilldown" : "023", - "name" : "023", - "y" : 88 - }, - { - "drilldown" : "022", - "name" : "022", - "y" : 72 - }, - { - "drilldown" : "021", - "y" : 72, - "name" : "021" - }, - { - "name" : "020", - "y" : 100, - "drilldown" : "020" - }, - { - "drilldown" : "019", - "y" : 101, - "name" : "019" - }, - { - "name" : "018", - "y" : 82, - "drilldown" : "018" - }, - { - "drilldown" : "017", - "name" : "017", - "y" : 83 - }, - { - "y" : 75, - "name" : "016", - "drilldown" : "016" - }, - { - "y" : 95, - "name" : "015", - "drilldown" : "015" - }, - { - "drilldown" : "014", - "name" : "014", - "y" : 98 - }, - { - "drilldown" : "013", - "y" : 85, - "name" : "013" - }, - { - "name" : "012", - "y" : 90, - "drilldown" : "012" - }, - { - "drilldown" : "011", - "y" : 86, - "name" : "011" - }, - { - "drilldown" : "010", - "y" : 69, - "name" : "010" - }, - { - "drilldown" : "009", - "y" : 79, - "name" : "009" - }, - { - "drilldown" : "008", - "name" : "008", - "y" : 82 - }, - { - "drilldown" : "007", - "y" : 71, - "name" : "007" - }, - { - "drilldown" : "006", - "y" : 63, - "name" : "006" - }, - { - "y" : 82, - "name" : "005", - "drilldown" : "005" - }, - { - "drilldown" : "004", - "y" : 106, - "name" : "004" - }, - { - "name" : "003", - "y" : 91, - "drilldown" : "003" - }, - { - "name" : "002", - "y" : 133, - "drilldown" : "002" - }, - { - "y" : 165, - "name" : "001", - "drilldown" : "001" - } - ] - } - ], "xAxis" : { "type" : "category" }, - "tooltip" : { - "followPointer" : "true", - "pointFormat" : "Challenge {point.name}: {point.y:f}
", - "headerFormat" : "" - }, - "chart" : { - "type" : "column" + "legend" : { + "enabled" : "false" } } diff --git a/stats/pwc-language-breakdown-2020.json b/stats/pwc-language-breakdown-2020.json index bc69392951..74148325ec 100644 --- a/stats/pwc-language-breakdown-2020.json +++ b/stats/pwc-language-breakdown-2020.json @@ -1,35 +1,11 @@ { - "xAxis" : { - "type" : "category" - }, - "chart" : { - "type" : "column" - }, - "tooltip" : { - "followPointer" : "true", - "pointFormat" : "Challenge {point.name}: {point.y:f}
", - "headerFormat" : "" - }, - "legend" : { - "enabled" : "false" - }, - "subtitle" : { - "text" : "Click the columns to drilldown the language breakdown. Last updated at 2024-08-06 13:26:39 GMT" - }, - "plotOptions" : { - "series" : { - "borderWidth" : 0, - "dataLabels" : { - "enabled" : 1, - "format" : "{point.y}" - } - } + "title" : { + "text" : "The Weekly Challenge Language" }, "drilldown" : { "series" : [ { "id" : "093", - "name" : "093",