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
Started GET "/Starter%20Template%20for%20Bootstrap_files/bootstrap.css" for 127.0.0.1 at 2017-06-22 19:11:30 +0500 | |
ActionController::RoutingError (No route matches [GET] "/Starter%20Template%20for%20Bootstrap_files/bootstrap.css"): | |
actionpack (5.1.1) lib/action_dispatch/middleware/debug_exceptions.rb:63:in `call' | |
web-console (3.5.1) lib/web_console/middleware.rb:135:in `call_app' | |
web-console (3.5.1) lib/web_console/middleware.rb:28:in `block in call' | |
web-console (3.5.1) lib/web_console/middleware.rb:18:in `catch' | |
web-console (3.5.1) lib/web_console/middleware.rb:18:in `call' |
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
1. Знание основ Ruby, фреймворка Ruby on Rails | |
- http://guides.rubyonrails.org/ | |
- http://rusrails.ru/ | |
Вопросы: | |
1. Чем отличается статическая и динамическая типизации в языках программирования? | |
2. Какие виды наследования поддерживаются в Ruby? | |
3. Что такое модуль? Какая разница между классом и модулем? | |
4. Какие есть уровни контроля доступа к методам для классов и модулей? | |
5. Какие есть способы вызова методов в Ruby? | |
6. Что означает ключевое слово self? |
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
var userChoice = prompt("Do you choose rock, paper or scissors?"); | |
var computerChoice = Math.random(); | |
if (computerChoice < 0.34) { | |
computerChoice = "rock"; | |
} else if(computerChoice <= 0.67) { | |
computerChoice = "paper"; | |
} else { | |
computerChoice = "scissors"; | |
} console.log("Computer: " + computerChoice); |
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
Counting objects: 14, done. | |
Delta compression using up to 2 threads. | |
Compressing objects: 100% (14/14), done. | |
Writing objects: 100% (14/14), 1.53 KiB | 0 bytes/s, done. | |
Total 14 (delta 9), reused 0 (delta 0) | |
remote: Compressing source files... done. | |
remote: Building source: | |
remote: | |
remote: -----> Ruby app detected | |
remote: -----> Compiling Ruby/Rails |
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
git push heroku master | |
Total 0 (delta 0), reused 0 (delta 0) | |
remote: Compressing source files... done. | |
remote: Building source: | |
remote: | |
remote: -----> Ruby app detected | |
remote: -----> Compiling Ruby/Rails | |
remote: -----> Using Ruby version: ruby-2.2.6 | |
remote: -----> Installing dependencies using bundler 1.13.7 | |
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment |
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
options = [:paper, :rock, :scissors] | |
player1 = "" | |
player2 = "" | |
loop do | |
p1 = rand(0..2) | |
p2 = rand(0..2) | |
puts "Player 1: #{options[p1]}, Player 2: #{options[p2]}" |
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
print "(R)ock, (S)cissors, (P)aper? " | |
s = gets.strip.capitalize | |
if s == "R" | |
user_choice = :rock | |
elsif s == "S" | |
user_choice = :scissors | |
elsif s == "P" | |
user_choice = :paper | |
else |
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
print "How old are you? " | |
age = gets.to_i | |
print "Continue? (Y/N) " | |
answer = gets.strip.capitalize | |
if answer == "Y" && age >= 18 | |
puts "Ok, let's play!" | |
money = 100 |
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
print "Сколько вам лет? " | |
age = gets.to_i | |
print "Хотите играть? (Y/N) " | |
answer = gets.strip.capitalize | |
if answer == "Y" && age >= 18 | |
puts "Хорошо, поиграем!" | |
money = 100 |
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
def start | |
@num = rand (1..100) | |
print "Enter attempts number: " | |
@attempts = gets.to_i | |
print "Guess the number, #{@attempts} attempts, " |