aboutsummaryrefslogtreecommitdiff
path: root/challenge-240
diff options
context:
space:
mode:
authorMohammad S Anwar <mohammad.anwar@yahoo.com>2023-10-24 16:38:23 +0100
committerMohammad S Anwar <mohammad.anwar@yahoo.com>2023-10-24 16:38:23 +0100
commitfe91a51fecb2b2a40727af7878d684a0a6f44bb2 (patch)
tree4b801d814d89d5584933913de05839086f0af205 /challenge-240
parentda46530dd08b688373320ae670d0395027ec0d9e (diff)
downloadperlweeklychallenge-club-fe91a51fecb2b2a40727af7878d684a0a6f44bb2.tar.gz
perlweeklychallenge-club-fe91a51fecb2b2a40727af7878d684a0a6f44bb2.tar.bz2
perlweeklychallenge-club-fe91a51fecb2b2a40727af7878d684a0a6f44bb2.zip
- Added solutions by Robert DiCicco.
Diffstat (limited to 'challenge-240')
-rw-r--r--challenge-240/robert-dicicco/tcl/ch-2.tcl37
1 files changed, 37 insertions, 0 deletions
diff --git a/challenge-240/robert-dicicco/tcl/ch-2.tcl b/challenge-240/robert-dicicco/tcl/ch-2.tcl
new file mode 100644
index 0000000000..cc7a3a3af7
--- /dev/null
+++ b/challenge-240/robert-dicicco/tcl/ch-2.tcl
@@ -0,0 +1,37 @@
+#!/usr/bin/env tclsh
+set comment {
+-----------------------------------
+AUTHOR: Robert DiCicco
+DATE : 23-OCT-2023
+Challenge 240 Task 02 Build Array ( Tcl )
+-----------------------------------
+}
+
+set myints {{0 2 1 5 3 4} {5 0 1 2 3 4}}
+
+foreach mints $myints {
+ set out {}
+ puts "Input: @ints = ($mints)"
+ set cnt 0
+ while { $cnt < [llength $mints]} {
+ set i [lindex $mints $cnt]
+ lappend out [lindex $mints $i]
+ incr cnt
+ }
+ puts "Output: ($out)\n"
+}
+
+set comment {
+-----------------------------------
+SAMPLE OUTPUT
+tclsh .\BuildArray.tcl
+
+Input: @ints = (0 2 1 5 3 4)
+Output: (0 1 2 4 5 3)
+
+Input: @ints = (5 0 1 2 3 4)
+Output: (4 5 0 1 2 3)
+-----------------------------------
+}
+
+