langs a-z

This commit is contained in:
Ingy döt Net 2013-04-10 22:43:41 -07:00
parent db842d013d
commit d066446780
11389 changed files with 98361 additions and 1020 deletions

View file

@ -0,0 +1,15 @@
#!/bin/sh
# Using a while control construct to emulate a for loop
l="1" # Set the counters to one
while [ "$l" -le 5 ] # Loop while the counter is less than five
do
m="1"
while [ "$m" -le "$l" ] # Loop while the counter is less than five
do
printf "*"
m=`expr "$m" + 1` # Increment the inner counter
done
echo
l=`expr "$l" + 1` # Increment the outer counter
done

View file

@ -0,0 +1,6 @@
for i in `jot 5`; do
for j in `jot $i`; do
printf \*
done
echo
done

View file

@ -0,0 +1,6 @@
for (( x=1; $x<=5; x=$x+1 )); do
for (( y=1; y<=$x; y=$y+1 )); do
echo -n '*'
done
echo ""
done

View file

@ -0,0 +1,6 @@
foreach i (`jot 5`)
foreach j (`jot $i`)
echo -n \*
end
echo ""
end