If Statements | Ruby | Tutorial 17

preview_player
Показать описание

Throughout the course we'll be looking at various topics including variables, arrays, getting user input, loops, conditionals, object orientation, and much more.
Рекомендации по теме
Комментарии
Автор

btw, you can use '!' and 'not' interchangeably

randomdude
Автор

you can also do a tring like this

puts
sleep(0.1)
puts "| option A: hello|"
sleep(0.1)
puts
sleep(0.1)

name = gets

a = true

if a
puts " hello my good sir"

and then when you get this figured out you can build simple automation scripts with it like i do with python3 but with variables

you can also import color into text like

class String
def black; "\e[30m#{self}\e[0m" end
def red; "\e[31m#{self}\e[0m" end
def green; "\e[32m#{self}\e[0m" end
def brown; "\e[33m#{self}\e[0m" end
def blue; "\e[34m#{self}\e[0m" end
def magenta; "\e[35m#{self}\e[0m" end
def cyan; "\e[36m#{self}\e[0m" end
def gray; "\e[37m#{self}\e[0m" end

def bg_black; "\e[40m#{self}\e[0m" end
def bg_red; "\e[41m#{self}\e[0m" end
def bg_green; "\e[42m#{self}\e[0m" end
def bg_brown; "\e[43m#{self}\e[0m" end
def bg_blue; "\e[44m#{self}\e[0m" end
def bg_magenta; "\e[45m#{self}\e[0m" end
def bg_cyan; "\e[46m#{self}\e[0m" end
def bg_gray; "\e[47m#{self}\e[0m" end

def bold; "\e[1m#{self}\e[22m" end
def italic; "\e[3m#{self}\e[23m" end
def underline; "\e[4m#{self}\e[24m" end
def blink; "\e[5m#{self}\e[25m" end
def reverse_color; "\e[7m#{self}\e[27m" end
end

puts 'hello".red

repraod
Автор

Ever thought about Node js tutorials Mike? It's a shame, because you have a gift for teaching, just not the social interaction aspect that comes with it? You never reply to any comments left by your subscribers. And these are legitimate questions. Your content is great! Just wonder if you're going to create any more?

adante