# Michael Porter

## Muddy Boots Code

Born and raised in the oilfields of West Texas, I’ve been interested in learning to code for a very long time. After a stint in the Marines and a lot of practical experience behind me, I’ve decided to make the leap with and start my journey toward becoming a professional software developer. I love being out in the world getting my hands dirty and my boots muddy. I believe that the ability to creatively solve problems with software should go hand in hand with the hard-practical work happening on the ground. To that end, I hope to build applications and tools to help working men and women be their most productive.

### Code Snippets

#### Temperature Conversion

This ruby program will prompt the user for a temperature in degrees Celsius and let the user know what the corresponding temperature is in Fahrenheit.

``````

def celcius_to_fahrenheit_conversion(user_temp)

user_temp * 9/5 + 32

end

puts "Please enter a temperature in degrees Celcius: "

user_temp = gets.chomp.to_f

response =  "Your temperature converted to Fahrenheit is: #{celcius_to_fahrenheit_conversion(user_temp)}"

puts response

``````

``````

import random

# Creates the computers choice
def roshambo(randomChoice):
if randomChoice == 1:
return 'scissors'
elif randomChoice == 2:
return 'rock'
else:
return 'paper'

# Matches computers choice with the players choice to find a winner
def rock_paper_scissors(player_choice):
if player_choice.lower() == 'rock' and auto_play not in ('paper', 'rock'):
return 'Winner!'
elif player_choice.lower() == 'scissors' and auto_play not in ('scissors', 'rock'):
return 'Winner!'
elif player_choice.lower() == 'paper' and auto_play not in ('paper', 'scissors'):
return 'Winner!'
elif player_choice.lower() == auto_play:
return 'Draw!'
else:
return 'You lose!'

# Keeps playing RPS as long as the player says yes
keep_playing = True

while keep_playing == True:

play = input(str("Would you like to play rock, paper, scissors? yes or no?\n"))

if play.lower() == 'yes':
player_choice = input(str("Ok! what's your choice?\n"))
r = random.randint(1, 3)
auto_play = roshambo(r)
result = rock_paper_scissors(player_choice)
print('{}, You chose {} and I chose {}'.format(result, player_choice, auto_play))
elif play.lower() == 'no':
keep_playing = False
else:
print("I'm sorry I don't understand.")

print('Ok take care!')

``````

#### Rock, Paper, Scissors

This python program will play Rock, Paper, Scissors. It contains a few small methods to determine both computer and player choices as well as very basic error handling.

#### Foobar

This ruby program is an adaptation of a classic technical interview problem which displays sequences of the Foobar pattern.

``````
def foobar (user_input)
user_input.times do | counter |

count += 1

if counter % 3 == 0 && counter % 5 == 0
puts "foobar"
elsif counter % 5 == 0
puts "bar"
elsif counter % 3 == 0
puts "foo"
else
puts counter
end
end
end

puts "How many items would you like to see?"

user_input = gets.chomp.to_i

foobar(user_input)

``````

# Contact

Email: Michael@MuddyBootsCode.io