scripts
This commit is contained in:
parent
1f5b67dd15
commit
8994002299
3 changed files with 14 additions and 2 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bin
|
||||||
|
build
|
|
@ -1,9 +1,9 @@
|
||||||
for i = 1, 100 do
|
for i = 1, 100 do
|
||||||
if i % 15 == 0 then
|
if i % 15 == 0 then
|
||||||
print("FizzBuzz")
|
print("FizzBuzz")
|
||||||
elseif i % 5 == 0 then
|
|
||||||
print("Fizz")
|
|
||||||
elseif i % 3 == 0 then
|
elseif i % 3 == 0 then
|
||||||
|
print("Fizz")
|
||||||
|
elseif i % 5 == 0 then
|
||||||
print("Buzz")
|
print("Buzz")
|
||||||
else
|
else
|
||||||
print(i)
|
print(i)
|
||||||
|
|
10
src/fb.sh
Normal file
10
src/fb.sh
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
for i in $(seq 1 100); do
|
||||||
|
if [[ $(( $i % 15 )) == 0 ]]; then
|
||||||
|
echo FizzBuzz
|
||||||
|
elif [[ $(( $i % 3 )) == 0 ]]; then
|
||||||
|
echo Fizz
|
||||||
|
elif [[ $(( $i % 5 )) == 0 ]]; then
|
||||||
|
echo Buzz
|
||||||
|
else echo $i
|
||||||
|
fi
|
||||||
|
done
|
Loading…
Add table
Reference in a new issue