This file contains 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
#this question is from the first section and is the seco | |
puts "Let’s start with an easy one. Write the expression 1+1 in two different, but equivalent ways." | |
puts "Answer :" | |
puts "1.+(1)" #this answer is in standard ruby syntax | |
# Ruby Data Types: BigNum | |
puts "When a Fixnum grows too large, it becomes a Bignum. What's the largest Fixnum?" |
This file contains 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
puts "welcom to Arkham asylum Santa!!" | |
puts "what would you like to do" | |
puts "Options: explore, fight , leave , surprise" | |
choice = gets.chomp | |
case choice | |
when "explore" | |
puts " you found a new evadence of a plan to brake out " | |
puts " do you want to investigate the plan more " | |
puts "options: yes , no " | |
plan = gets.chomp |
This file contains 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
puts "welcome to Arkham asylum Santa!!" | |
puts "what would you like to do" | |
puts "Options: explore, fight , leave , surprise" | |
choice = gets.chomp | |
case choice | |
when "explore" | |
puts " you found a new evidence of a plan to brake out " | |
puts " do you want to investegate the plan more " | |
puts "options: yes , no " | |
plan = gets.chomp |
This file contains 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
puts <<END | |
_________(█) | |
_______██████ | |
_____ ████████ | |
____███████████_ | |
__ (░░░░░░░)░░░) | |
__(░(░█░░█░)░░░) | |
__(░░(░░●░░░)░░░) | |
__ (░░░░◡░░)░░░░) # # ##### # # # # ## # # | |
_██(░░░░░░░░░░)██ # # # # # # # # # # ## ## |
This file contains 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
def max(a,b) | |
a < b ? b : a | |
end | |
puts max(44,23) |
This file contains 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
class Array | |
def togeather | |
self.inject{|sum,x| sum + x } | |
end | |
end | |
[[1, 2], [3, 4]].togeather |
This file contains 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
class Quadrilateral | |
attr_accessor :top, :bottom, :left, :right | |
def initialize(left, top, right, bottom) | |
@left = left | |
@right = right | |
@bottom = bottom | |
@top = top |
This file contains 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
class Game | |
def initialize | |
main_menu | |
end | |
end | |
class Human | |
attr_accessor :name | |
def initialize(name) |
This file contains 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
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script> | |
<title>title</title> | |
</head> | |
<body> | |
<form> | |
<span> |
This file contains 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
$( "form" ).submit(function( event ) { | |
if ( $( "input:first" ).val() === "Wyncode" ) { | |
$( "span" ).text().show(); | |
event.preventDefault(); | |
} | |
$("input").css({'background-color' : 'red'}); | |
event.preventDefault(); | |
}); |
OlderNewer