Skip to content

Instantly share code, notes, and snippets.

View pascal-codecat's full-sized avatar

pascal-codecat

View GitHub Profile
@pascal-codecat
pascal-codecat / game.rb
Last active July 12, 2016 20:18
3.11 optional game
def computerchoice
return rand(1..3)
end
$count_com = 0
$count_you = 0
def playgame
puts "What do you choose? paper= 1 /scissors= 2 /rock= 3"
@pascal-codecat
pascal-codecat / index.html
Created July 5, 2016 12:47
ilikerocket file
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SpaceX</title>
<!-- links -->
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
@pascal-codecat
pascal-codecat / scripts.js
Created July 5, 2016 12:45
ilikerocket file
// START TWITTER FACEBOOK
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],
p=/^http:/.test(d.location)?'http':'https';
if(!d.getElementById(id)){js=d.createElement(s);
js.id=id;js.src=p+'://platform.twitter.com/widgets.js';
fjs.parentNode.insertBefore(js,fjs);}}
(document, 'script', 'twitter-wjs');
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
@pascal-codecat
pascal-codecat / styles.css
Created July 5, 2016 12:45
ilierocket file
/*START BODY*/
body {
position: relative;
background-image:url(../img/background3.jpg)
}
/*END BODY*/
@pascal-codecat
pascal-codecat / cat.rb
Last active July 5, 2016 14:49
Ruby programming
class Pet
attr_reader :color, :breed
attr_accessor :name
def initialize(color, breed)
@color = color
@breed = breed
@hungry = true
end
@pascal-codecat
pascal-codecat / fav_foods.rb
Created June 24, 2016 22:18
Ruby programming
def fav_foods
food_array = []
3.times do
puts "Name a favorite food."
food_array << gets.chomp
end
p food_array
puts "Your favorite foods are #{food_array.join(", ")}"
food_array.each do |food|
puts "I like #{food} too!"
@pascal-codecat
pascal-codecat / program4.rb
Created June 24, 2016 21:39
Ruby programming
# number = 0
# while (number <= 10) do
# p "the number is now #{number}"
# number += 1
# end
(0...10).each do |n|
p "the new number is #{n}"
end
@pascal-codecat
pascal-codecat / program3.rb
Created June 24, 2016 21:36
Ruby programming
def choose
puts "Do you like programming? Yes, no, or maybe please."
choice = gets.chomp
case choice.downcase
when "yes"
puts "Thats\'s great!"
when "no"
puts "That\'s too bad!"
when "maybe"
puts "Glad you are giving it a chance!"
@pascal-codecat
pascal-codecat / program2.rb
Created June 24, 2016 21:35
Ruby programming
if (5+5==10)
puts "this is true"
else
puts "this is false"
end
@pascal-codecat
pascal-codecat / program.rb
Created June 24, 2016 16:12
Ruby programming
my_name = "Pascal"
def greeting
puts "Please enter your name:"
name = gets.chomp
puts "hello" + " " + name
end
greeting