Skip to content

Commit 9ca5dc7

Browse files
committed
cleaned up directory for submission
1 parent ae51b65 commit 9ca5dc7

File tree

16 files changed

+198
-295
lines changed

16 files changed

+198
-295
lines changed

demo07.pl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/perl -w
2+
3+
#taken from the 2041 website
4+
#tests foreach loops and printing ARGV
5+
6+
foreach $i (0..$#ARGV) {
7+
print "$ARGV[$i]\n";
8+
}

demo08.pl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/perl -w
2+
3+
#tests split and join and concatenation
4+
5+
$info = "Caine:Michael:Actor:14, Leafy Drive";
6+
7+
@personal = split(/:/, $info);
8+
9+
print "@personal\n"

demo09.pl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/perl -w
2+
3+
#taken from the 2041 site
4+
5+
$n = 1;
6+
while ($n <= 10) {
7+
$total = 0;
8+
$j = 1;
9+
while ($j <= $n) {
10+
$i = 1;
11+
while ($i <= $j) {
12+
$total = $total + $i;
13+
$i = $i + 1;
14+
}
15+
$j = $j + 1;
16+
}
17+
print "$total\n";
18+
$n = $n + 1;
19+
}

diary.txt

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Date: Wed Oct 16 19:23 (started 17:20)
2+
3+
added demo00 though 09 and final few tests
4+
Cleaned up code in main program
5+
6+
7+
Date: Mon Oct 7 20:15 (started 18:02)
8+
9+
Added more tests and demoes
10+
Implemented split, join, chomp
11+
Fixed some bugs
12+
13+
14+
Date: Mon Sep 30 23:22 (started 20:52)
15+
16+
Implemented STDIN and $_ in certain cases
17+
18+
19+
Date: Mon Sep 30 22:43 (Started 19:01)
20+
21+
Implemented break and continue,
22+
Cleaned up arithmetic subroutine
23+
Implemented whitespace subroutine
24+
25+
26+
Date: Mon Sep 30 21:04 (Started 19:07)
27+
28+
Implemented print without newline, if statements, removal of closing curly braces, comparisons
29+
(subset 2 done)
30+
31+
32+
Date: Mon Sep 30 20:15 (Started 19:01)
33+
34+
Added print without newline
35+
Altered demoes to be more comprehensive
36+
Implemented arithmetic subroutine (subset 1 done)
37+
38+
39+
Date: Fri Sep 27 18:40 (started 16:40)
40+
41+
Demoes created, base file altered (subset 0 done)
42+
First commit

perlpythonLinesInProgress.pl

Lines changed: 0 additions & 272 deletions
This file was deleted.

test00.pl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/perl -w
2+
3+
#tests multiple variables in the same print statement
4+
5+
6+
$number = 9000;
7+
$word = ”cats”;
8+
print$number $word \n";

test01.pl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/perl -w
2+
3+
#tests printing multiple variables in a single print statement
4+
5+
$name = "Harry";
6+
$age = 22;
7+
8+
print "Hello, my name is $name and I am $age years old.\n";

test02.pl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/perl -w
2+
3+
#tests print with and without newlines (and a single variable)
4+
5+
6+
$number = 9000;
7+
$word = ”cats”;
8+
9+
10+
print “I have $number";
11+
12+
print “ $word.”;
13+
14+
print “I promise, Im not a crazy cat lady.”
15+
16+

0 commit comments

Comments
 (0)