From 7c3628d24263d828b990af5eeac286e3ab7819af Mon Sep 17 00:00:00 2001 From: Luca Ferrari Date: Mon, 29 Jan 2024 09:55:32 +0100 Subject: PWC 254 Task 1 Raku done Task 2 Raku done Task 1 PL/Perl done Task 2 PL/Perl done Task 1 PL/PgSQL done Task 2 PL/PgSQL done Task 1 Python done Task 2 Python done Task 1 PL/Java done Task2 PL/java done --- challenge-252/luca-ferrari/java/ch-1.java | 15 ++++ challenge-252/luca-ferrari/postgresql/java/pom.xml | 84 ++++++++++++++++++++++ .../java/src/main/java/PWC252/Task1.java | 11 +++ challenge-253/luca-ferrari/pljava/ch-1.java | 40 +++++++++++ challenge-253/luca-ferrari/pljava/ch-2.java | 28 ++++++++ challenge-254/luca-ferrari/blog-1.txt | 1 + challenge-254/luca-ferrari/blog-10.txt | 1 + challenge-254/luca-ferrari/blog-2.txt | 1 + challenge-254/luca-ferrari/blog-3.txt | 1 + challenge-254/luca-ferrari/blog-4.txt | 1 + challenge-254/luca-ferrari/blog-5.txt | 1 + challenge-254/luca-ferrari/blog-6.txt | 1 + challenge-254/luca-ferrari/blog-7.txt | 1 + challenge-254/luca-ferrari/blog-8.txt | 1 + challenge-254/luca-ferrari/blog-9.txt | 1 + challenge-254/luca-ferrari/pljava/pom.xml | 6 +- .../luca-ferrari/pljava/src/main/java/Task1.java | 50 +++++++++++++ .../luca-ferrari/pljava/src/main/java/Task2.java | 69 ++++++++++++++++++ challenge-254/luca-ferrari/plperl/ch-1.plperl | 23 ++++++ challenge-254/luca-ferrari/plperl/ch-2.plperl | 27 +++++++ challenge-254/luca-ferrari/plpgsql/ch-1.sql | 24 +++++++ challenge-254/luca-ferrari/plpgsql/ch-2.sql | 50 +++++++++++++ challenge-254/luca-ferrari/python/ch-1.python | 26 +++++++ challenge-254/luca-ferrari/python/ch-2.python | 29 ++++++++ challenge-254/luca-ferrari/raku/ch-1.raku | 17 +++++ challenge-254/luca-ferrari/raku/ch-2.raku | 21 ++++++ 26 files changed, 527 insertions(+), 3 deletions(-) create mode 100644 challenge-252/luca-ferrari/java/ch-1.java create mode 100644 challenge-252/luca-ferrari/postgresql/java/pom.xml create mode 100644 challenge-252/luca-ferrari/postgresql/java/src/main/java/PWC252/Task1.java create mode 100644 challenge-253/luca-ferrari/pljava/ch-1.java create mode 100644 challenge-253/luca-ferrari/pljava/ch-2.java create mode 100644 challenge-254/luca-ferrari/blog-1.txt create mode 100644 challenge-254/luca-ferrari/blog-10.txt create mode 100644 challenge-254/luca-ferrari/blog-2.txt create mode 100644 challenge-254/luca-ferrari/blog-3.txt create mode 100644 challenge-254/luca-ferrari/blog-4.txt create mode 100644 challenge-254/luca-ferrari/blog-5.txt create mode 100644 challenge-254/luca-ferrari/blog-6.txt create mode 100644 challenge-254/luca-ferrari/blog-7.txt create mode 100644 challenge-254/luca-ferrari/blog-8.txt create mode 100644 challenge-254/luca-ferrari/blog-9.txt create mode 100644 challenge-254/luca-ferrari/pljava/src/main/java/Task1.java create mode 100644 challenge-254/luca-ferrari/pljava/src/main/java/Task2.java create mode 100644 challenge-254/luca-ferrari/plperl/ch-1.plperl create mode 100644 challenge-254/luca-ferrari/plperl/ch-2.plperl create mode 100644 challenge-254/luca-ferrari/plpgsql/ch-1.sql create mode 100644 challenge-254/luca-ferrari/plpgsql/ch-2.sql create mode 100644 challenge-254/luca-ferrari/python/ch-1.python create mode 100644 challenge-254/luca-ferrari/python/ch-2.python create mode 100644 challenge-254/luca-ferrari/raku/ch-1.raku create mode 100644 challenge-254/luca-ferrari/raku/ch-2.raku diff --git a/challenge-252/luca-ferrari/java/ch-1.java b/challenge-252/luca-ferrari/java/ch-1.java new file mode 100644 index 0000000000..18ba5f7aa1 --- /dev/null +++ b/challenge-252/luca-ferrari/java/ch-1.java @@ -0,0 +1,15 @@ +package PWC252; + +public class ch_1 { + public static void main( String argv[] ) { + int sum = 0; + for ( int i = 0; i < argv.length; i++ ) { + if ( agrv.length % i != 0 ) + continue; + + sum += Integer.parseInt( argv[ i ] ) ^ 2; + } + + System.out.println( sum ); + } +} diff --git a/challenge-252/luca-ferrari/postgresql/java/pom.xml b/challenge-252/luca-ferrari/postgresql/java/pom.xml new file mode 100644 index 0000000000..8975c014a2 --- /dev/null +++ b/challenge-252/luca-ferrari/postgresql/java/pom.xml @@ -0,0 +1,84 @@ + + 4.0.0 + + + + pwc + pwc252 + 0.0.1-SNAPSHOT + + + + Perl Weekly Challenge 252 + Implementation of the tasks in PL/Java + + + + + US-ASCII + + + + + + + org.postgresql + pljava-api + 1.6.6 + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.8.1 + + 9 + + + + org.apache.maven.plugins + maven-jar-plugin + 2.6 + + + + + + true + + + + + + + pljava.ddr + + + true + + + + + + + + + + diff --git a/challenge-252/luca-ferrari/postgresql/java/src/main/java/PWC252/Task1.java b/challenge-252/luca-ferrari/postgresql/java/src/main/java/PWC252/Task1.java new file mode 100644 index 0000000000..4714df0ad5 --- /dev/null +++ b/challenge-252/luca-ferrari/postgresql/java/src/main/java/PWC252/Task1.java @@ -0,0 +1,11 @@ +package PWC252; + +import org.postgresql.pljava.annotation.Function; + +public class Task1 { + + @Function + public static final int task1( int[] nums ) { + return 0; + } +} diff --git a/challenge-253/luca-ferrari/pljava/ch-1.java b/challenge-253/luca-ferrari/pljava/ch-1.java new file mode 100644 index 0000000000..51a2428a5b --- /dev/null +++ b/challenge-253/luca-ferrari/pljava/ch-1.java @@ -0,0 +1,40 @@ +//package PWC253; + +/** + * PL/Java implementation for PWC 253 + * Task 1 + * See + * + * To install into PostgreSQL execute: + + select sqlj.install_jar( 'file:///tmp/PWC253.1.jar', 'PWC253', true ); + select sqlj.set_classpath( 'public', 'PWC253' ); + + select task$tn_pljava(); + +*/ + +import org.postgresql.pljava.*; +import org.postgresql.pljava.annotation.Function; +import static org.postgresql.pljava.annotation.Function.Effects.IMMUTABLE; +import static org.postgresql.pljava.annotation.Function.OnNullInput.RETURNS_NULL; + +import java.util.*; + +public class Task1 { + + @Function( onNullInput = RETURNS_NULL, effects = IMMUTABLE ) + public static final String[] task1_pljava( String separator, String[] words ) { + List result = new LinkedList(); + + for ( String w : words ) { + if ( ! w.contains( separator ) ) + result.add( w ); + else + result.addAll( w.split( separator ) ); + } + + return result; + + } +} diff --git a/challenge-253/luca-ferrari/pljava/ch-2.java b/challenge-253/luca-ferrari/pljava/ch-2.java new file mode 100644 index 0000000000..4a664fb345 --- /dev/null +++ b/challenge-253/luca-ferrari/pljava/ch-2.java @@ -0,0 +1,28 @@ +package PWC253; + +/** + * PL/Java implementation for PWC 253 + * Task 2 + * See + * + * To install into PostgreSQL execute: + + select sqlj.install_jar( 'file:///tmp/PWC253.1.jar', 'PWC253', true ); + select sqlj.set_classpath( 'public', 'PWC253' ); + + select task$tn_pljava(); + +*/ + +import org.postgresql.pljava.*; +import org.postgresql.pljava.annotation.Function; +import static org.postgresql.pljava.annotation.Function.Effects.IMMUTABLE; +import static org.postgresql.pljava.annotation.Function.OnNullInput.RETURNS_NULL; + +public class Task2 { + + @Function( onNullInput = RETURNS_NULL, effects = IMMUTABLE ) + public static final void task2_pljava() throws Exception { + throws Exception( "Not Implemented" ); + } +} diff --git a/challenge-254/luca-ferrari/blog-1.txt b/challenge-254/luca-ferrari/blog-1.txt new file mode 100644 index 0000000000..3014ec9e95 --- /dev/null +++ b/challenge-254/luca-ferrari/blog-1.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2024/01/29/PerlWeeklyChallenge254.html#task1 diff --git a/challenge-254/luca-ferrari/blog-10.txt b/challenge-254/luca-ferrari/blog-10.txt new file mode 100644 index 0000000000..7fcf1cea31 --- /dev/null +++ b/challenge-254/luca-ferrari/blog-10.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/[= date -%]/PerlWeeklyChallenge254.html#task2pljava diff --git a/challenge-254/luca-ferrari/blog-2.txt b/challenge-254/luca-ferrari/blog-2.txt new file mode 100644 index 0000000000..b678fbc47d --- /dev/null +++ b/challenge-254/luca-ferrari/blog-2.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2024/01/29/PerlWeeklyChallenge254.html#task2 diff --git a/challenge-254/luca-ferrari/blog-3.txt b/challenge-254/luca-ferrari/blog-3.txt new file mode 100644 index 0000000000..e21ffb6783 --- /dev/null +++ b/challenge-254/luca-ferrari/blog-3.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2024/01/29/PerlWeeklyChallenge254.html#task1plperl diff --git a/challenge-254/luca-ferrari/blog-4.txt b/challenge-254/luca-ferrari/blog-4.txt new file mode 100644 index 0000000000..423c6c15a3 --- /dev/null +++ b/challenge-254/luca-ferrari/blog-4.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2024/01/29/PerlWeeklyChallenge254.html#task2plperl diff --git a/challenge-254/luca-ferrari/blog-5.txt b/challenge-254/luca-ferrari/blog-5.txt new file mode 100644 index 0000000000..d16e156f35 --- /dev/null +++ b/challenge-254/luca-ferrari/blog-5.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2024/01/29/PerlWeeklyChallenge254.html#task1plpgsql diff --git a/challenge-254/luca-ferrari/blog-6.txt b/challenge-254/luca-ferrari/blog-6.txt new file mode 100644 index 0000000000..83e86f8b34 --- /dev/null +++ b/challenge-254/luca-ferrari/blog-6.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2024/01/29/PerlWeeklyChallenge254.html#task2plpgsql diff --git a/challenge-254/luca-ferrari/blog-7.txt b/challenge-254/luca-ferrari/blog-7.txt new file mode 100644 index 0000000000..84b7463fba --- /dev/null +++ b/challenge-254/luca-ferrari/blog-7.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2024/01/29/PerlWeeklyChallenge254.html#task1python diff --git a/challenge-254/luca-ferrari/blog-8.txt b/challenge-254/luca-ferrari/blog-8.txt new file mode 100644 index 0000000000..f7d14503d6 --- /dev/null +++ b/challenge-254/luca-ferrari/blog-8.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2024/01/29/PerlWeeklyChallenge254.html#task2python diff --git a/challenge-254/luca-ferrari/blog-9.txt b/challenge-254/luca-ferrari/blog-9.txt new file mode 100644 index 0000000000..aa57bfbb2b --- /dev/null +++ b/challenge-254/luca-ferrari/blog-9.txt @@ -0,0 +1 @@ +https://fluca1978.github.io/2024/01/29/PerlWeeklyChallenge254.html#task1pljava diff --git a/challenge-254/luca-ferrari/pljava/pom.xml b/challenge-254/luca-ferrari/pljava/pom.xml index d9047c527c..8777b204e3 100644 --- a/challenge-254/luca-ferrari/pljava/pom.xml +++ b/challenge-254/luca-ferrari/pljava/pom.xml @@ -5,11 +5,11 @@ 4.0.0 PWC - PWC253 + PWC254 1 - Perl Weekly Challenge 253 - Implementation of the tasks in PL/Java for PWC 253 + Perl Weekly Challenge 254 + Implementation of the tasks in PL/Java for PWC 254 US-ASCII diff --git a/challenge-254/luca-ferrari/pljava/src/main/java/Task1.java b/challenge-254/luca-ferrari/pljava/src/main/java/Task1.java new file mode 100644 index 0000000000..643a13cbab --- /dev/null +++ b/challenge-254/luca-ferrari/pljava/src/main/java/Task1.java @@ -0,0 +1,50 @@ +package PWC254; + +/** + * PL/Java implementation for PWC 254 + * Task 1 + * See + * + * + * To compile on the local machine: + + $ export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64/ # if not already set + $ mvn clean build + $ $ scp target/PWC253-1.jar luca@venkman:/tmp + + + * To install into PostgreSQL execute: + + select sqlj.install_jar( 'file:///tmp/PWC254-1.jar', 'PWC254', true ); + select sqlj.set_classpath( 'public', 'PWC254' ); + + select task1_pljava(); + + and then to redeploy: + + select sqlj.replace_jar( 'file:///tmp/PWC254-1.jar', 'PWC254', true ); + +*/ + +import org.postgresql.pljava.*; +import org.postgresql.pljava.annotation.Function; +import static org.postgresql.pljava.annotation.Function.Effects.IMMUTABLE; +import static org.postgresql.pljava.annotation.Function.OnNullInput.RETURNS_NULL; + +import java.util.*; +import java.sql.SQLException; +import java.util.logging.*; + +public class Task1 { + + private final static Logger logger = Logger.getAnonymousLogger(); + + @Function( onNullInput = RETURNS_NULL, effects = IMMUTABLE ) + public static final boolean task1_pljava( int num ) throws SQLException { + for ( int i = 2; i < Math.sqrt( num ); i++ ) + if ( Math.pow( i, 3 ) == num ) + return true; + + return false; + } +} diff --git a/challenge-254/luca-ferrari/pljava/src/main/java/Task2.java b/challenge-254/luca-ferrari/pljava/src/main/java/Task2.java new file mode 100644 index 0000000000..034943bebc --- /dev/null +++ b/challenge-254/luca-ferrari/pljava/src/main/java/Task2.java @@ -0,0 +1,69 @@ +package PWC254; + +/** + * PL/Java implementation for PWC 254 + * Task 1 + * See + * + * + * To compile on the local machine: + + $ export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64/ # if not already set + $ mvn clean build + $ $ scp target/PWC253-1.jar luca@venkman:/tmp + + + * To install into PostgreSQL execute: + + select sqlj.install_jar( 'file:///tmp/PWC254-1.jar', 'PWC254', true ); + select sqlj.set_classpath( 'public', 'PWC254' ); + + select task1_pljava(); + + and then to redeploy: + + select sqlj.replace_jar( 'file:///tmp/PWC254-1.jar', 'PWC254', true ); + +*/ + +import org.postgresql.pljava.*; +import org.postgresql.pljava.annotation.Function; +import static org.postgresql.pljava.annotation.Function.Effects.IMMUTABLE; +import static org.postgresql.pljava.annotation.Function.OnNullInput.RETURNS_NULL; + +import java.util.*; +import java.sql.SQLException; +import java.util.logging.*; + +public class Task2 { + private final static Logger logger = Logger.getAnonymousLogger(); + + @Function( onNullInput = RETURNS_NULL, effects = IMMUTABLE ) + public static final String task2_pljava( String word ) throws SQLException { + String result = ""; + Stack vowels = new Stack(); + + for ( String letter : word.split( "" ) ) { + if ( isVowel( letter ) ) + vowels.push( letter ); + } + + for ( String letter : word.split( "" ) ) { + if ( ! isVowel( letter ) || vowels.empty() ) + result += letter; + else + result += vowels.pop(); + } + + return result; + } + + + public static final boolean isVowel( String letter ) { + return letter.toLowerCase().equals( "a" ) + || letter.toLowerCase().equals( "e" ) + || letter.toLowerCase().equals( "i" ) + || letter.toLowerCase().equals( "o" ) + || letter.toLowerCase().equals( "u" ); + } +} diff --git a/challenge-254/luca-ferrari/plperl/ch-1.plperl b/challenge-254/luca-ferrari/plperl/ch-1.plperl new file mode 100644 index 0000000000..6b1db77580 --- /dev/null +++ b/challenge-254/luca-ferrari/plperl/ch-1.plperl @@ -0,0 +1,23 @@ +-- +-- Perl Weekly Challenge 254 +-- Task 1 +-- See +-- + +CREATE SCHEMA IF NOT EXISTS pwc254; + +CREATE OR REPLACE FUNCTION +pwc254.task1_plperl( int ) +RETURNS bool +AS $CODE$ + + my ( $num ) = @_; + + for ( 2 .. ( $num / 2 ) ) { + return 1 if ( $_ ** 3 == $num ); + } + + return 0; + +$CODE$ +LANGUAGE plperl; diff --git a/challenge-254/luca-ferrari/plperl/ch-2.plperl b/challenge-254/luca-ferrari/plperl/ch-2.plperl new file mode 100644 index 0000000000..9deb0bdab1 --- /dev/null +++ b/challenge-254/luca-ferrari/plperl/ch-2.plperl @@ -0,0 +1,27 @@ +-- +-- Perl Weekly Challenge 254 +-- Task 2 +-- See +-- + +CREATE SCHEMA IF NOT EXISTS pwc254; + +CREATE OR REPLACE FUNCTION +pwc254.task2_plperl( text ) +RETURNS text +AS $CODE$ + + my ( $word ) = @_; + + my @vowels = reverse grep { $_ =~ / [aeiou] /ix } split( //, $word ); + my $output = ''; + + for ( split //, $word ) { + $output .= $_ and next if ( $_ !~ / [aeiou] /ix || ! @vowels ); + $output .= shift( @vowels ) and next; + } + + return $output; + +$CODE$ +LANGUAGE plperl; diff --git a/challenge-254/luca-ferrari/plpgsql/ch-1.sql b/challenge-254/luca-ferrari/plpgsql/ch-1.sql new file mode 100644 index 0000000000..e52a58df16 --- /dev/null +++ b/challenge-254/luca-ferrari/plpgsql/ch-1.sql @@ -0,0 +1,24 @@ +-- +-- Perl Weekly Challenge 254 +-- Task 1 +-- See +-- + +CREATE SCHEMA IF NOT EXISTS pwc254; + +CREATE OR REPLACE FUNCTION +pwc254.task1_plpgsql( n int ) +RETURNS bool +AS $CODE$ +BEGIN + FOR i IN 2 .. sqrt( n )::int LOOP + IF pow( i, 3 ) = n THEN + RETURN TRUE; + END IF; + END LOOP; + + RETURN FALSE; + +END +$CODE$ +LANGUAGE plpgsql; diff --git a/challenge-254/luca-ferrari/plpgsql/ch-2.sql b/challenge-254/luca-ferrari/plpgsql/ch-2.sql new file mode 100644 index 0000000000..78cb4eb8eb --- /dev/null +++ b/challenge-254/luca-ferrari/plpgsql/ch-2.sql @@ -0,0 +1,50 @@ +-- +-- Perl Weekly Challenge 254 +-- Task 2 +-- See +-- + +CREATE SCHEMA IF NOT EXISTS pwc254; + +CREATE OR REPLACE FUNCTION +pwc254.task2_plpgsql( word text ) +RETURNS text +AS $CODE$ +DECLARE + output_string text := ''; + current_vowel char; + current_index int; + remaining_vowels int; + letter char; +BEGIN + CREATE TEMPORARY TABLE IF NOT EXISTS vowels( v char, i serial ); + TRUNCATE vowels; + + INSERT INTO vowels( v ) + SELECT v + FROM regexp_split_to_table( lower( word ), '' ) v + WHERE v IN ( 'a', 'e', 'i', 'o', 'u' ); + + FOR letter IN SELECT v FROM regexp_split_to_table( lower( word ), '' ) v LOOP + + SELECT count( * ) + FROM vowels + INTO remaining_vowels; + + IF letter NOT IN ('a', 'e', 'i', 'o', 'u' ) OR remaining_vowels = 0 THEN + output_string := output_string || letter; + ELSE + SELECT v, i + INTO current_vowel, current_index + FROM vowels + ORDER BY i DESC; + + output_string := output_string || current_vowel; + DELETE FROM vowels WHERE i = current_index; + END IF; + END LOOP; + + RETURN output_string; +END +$CODE$ +LANGUAGE plpgsql; diff --git a/challenge-254/luca-ferrari/python/ch-1.python b/challenge-254/luca-ferrari/python/ch-1.python new file mode 100644 index 0000000000..a0533551d8 --- /dev/null +++ b/challenge-254/luca-ferrari/python/ch-1.python @@ -0,0 +1,26 @@ +#!python + +# +# Perl Weekly Challenge 254 +# Task 1 +# +# See +# + +import sys +import math + +# task implementation +# the return value will be printed +def task_1( args ): + num = int( args[ 0 ] ) + for i in range( 2, int( math.sqrt( num ) ) ): + if ( i ** 3 ) == num: + return True + + return False + + +# invoke the main without the command itself +if __name__ == '__main__': + print( task_1( sys.argv[ 1: ] ) ) diff --git a/challenge-254/luca-ferrari/python/ch-2.python b/challenge-254/luca-ferrari/python/ch-2.python new file mode 100644 index 0000000000..dc37e2ad93 --- /dev/null +++ b/challenge-254/luca-ferrari/python/ch-2.python @@ -0,0 +1,29 @@ +#!python + +# +# Perl Weekly Challenge 254 +# Task 2 +# +# See +# + +import sys + +# task implementation +# the return value will be printed +def task_2( args ): + word = args[ 0 ].lower() + vowels = list( reversed( list( filter( lambda x: x in ('a','e','i','o','u'), word ) ) ) ) + output = '' + for letter in word: + if letter not in ( 'a', 'e', 'i', 'o', 'u' ) or len( vowels ) == 0 + output += letter + else: + output += vowels.pop( 0 ) + + return output + + +# invoke the main without the command itself +if __name__ == '__main__': + print( task_2( sys.argv[ 1: ] ) ) diff --git a/challenge-254/luca-ferrari/raku/ch-1.raku b/challenge-254/luca-ferrari/raku/ch-1.raku new file mode 100644 index 0000000000..48656b5e81 --- /dev/null +++ b/challenge-254/luca-ferrari/raku/ch-1.raku @@ -0,0 +1,17 @@ +#!raku + +# +# Perl Weekly Challenge 254 +# Task 1 +# +# See +# + +sub MAIN( Int $n ) { + # say ( $n ** ( 1 / 3 ) ).Int == ( $n ** ( 1 / 3 ) ); + for ( 2 ..^ $n.sqrt.Int ) { + 'true'.say and exit if ( $_ ** 3 == $n ); + } + + 'false'.say; +} diff --git a/challenge-254/luca-ferrari/raku/ch-2.raku b/challenge-254/luca-ferrari/raku/ch-2.raku new file mode 100644 index 0000000000..c72766df6f --- /dev/null +++ b/challenge-254/luca-ferrari/raku/ch-2.raku @@ -0,0 +1,21 @@ +#!raku + +# +# Perl Weekly Challenge 254 +# Task 2 +# +# See +# + +sub MAIN( Str $word ) { + my @reversed; + my @vowels.push: |$word.lc.comb.grep( * ~~ / <[aeiou]> / ).reverse; + + for $word.comb { + + @reversed.push( $_ ) and next if ( $_.lc !~~ / <[aeiou]> / || @vowels.elems == 0 ); + @reversed.push: @vowels.shift if ( @vowels.elems > 0 ); + } + + @reversed.join.say; +} -- cgit