6 nov 2018

Programa - Colorear texto-1 con gema win32console

Colorear texto-1 con gema win32console

 require 'win32console'
[0, 1, 4, 5, 7].each do |attr|
  puts '----------------------------------------------------------------'
  puts "ESC[#{attr};Foreground;Background"
  30.upto(37) do |fg|
    40.upto(47) do |bg|
      print "\033[#{attr};#{fg};#{bg}m #{fg};#{bg}  "
    end
  puts "\033[0m"
  end
end

Documentación e instalación de win32console aqui

ejercicio TK -1

 #!/usr/bin/ruby #https://sandbox.mc.edu/~bennet/ruby/code/tk2_rb.html # Import the library. require 'tk' # Root window. root = TkRo...