This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# This is a short script to play rock paper scissors | |
use strict; | |
use warnings; | |
my @rps = qw(rock paper scissors); | |
my %weakness = (rock => "paper", paper => "scissors", scissors => "rock"); | |
my $score = 0; | |
my $npcscore = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# This script asks the user for a number and then provides the user with | |
# all even divisors for it | |
#----- functions ----- | |
evenDivision() { | |
local result=$(( $((100 * $1)) / $2)) | |
[[ "${result#*0}" == 0 ]] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#This script asks the user to provide a number and then compares that number to the numbers in an array | |
array=(1 2 3 4 5 6 7 8 9 10 11 12 13 14) | |
otherArray=() | |
echo please provide a number to compare | |
read number | |
for ((i=0; i<${#array[@]}; i++)); do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
#----- Functions ----- | |
divide() { | |
echo $(( $(($1 * 100)) / $2)) | |
} | |
multipleOfFour() { | |
result=$(divide $1 2) | |
[[ ${result#*0} == *0* ]] | |
} |
NewerOlder