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
require 'win32/sound' | |
include Win32 | |
Time.class.class.class_eval{ | |
def parse_seconds(s) | |
s = s.to_s.to_f | |
if s.to_f < 60.0 | |
[0,0,s.to_i] |
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
require 'win32/sound' | |
include Win32 | |
Time.class.class.class_eval{ | |
def parse_seconds(s) ## get an array for timer displays of number of seconds [days:hours:minutes:seconds] | |
s = s.to_s.to_f | |
if s.to_f < 60.0 | |
[0,0,s.to_i] |
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 surname | |
int=self.to_s | |
if int.to_s=="0";int="0" | |
elsif int[-2..-1]=="11" or int[-2..-1] =="12" or int[-2..-1] =="13" | |
int<<"th" | |
elsif int[-1]=="1";int<<"st" | |
elsif int[-1]=="2";int<<"nd" | |
elsif int[-1]=="3";int<<"rd" | |
else;int<<"th" | |
end |
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
require 'ruby2d' | |
#window config | |
set width: 300, height: 200 | |
set title: "" | |
set background: 'black' | |
#set fullscreen: true | |
@square = Square.new(x: 10, y: 20, size: 25, color: 'blue') |
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
#begin | |
puts "Welcome to the rubin system installer, your system is being checked..." | |
launch_directory=Dir.getwd | |
launch_time=Time.now | |
puts "Launching from the installer files directory location." | |
puts "" | |
puts "Dir: "+launch_directory.to_s |
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
#begin | |
puts "Welcome to the rubin system installer, your system is being checked..." | |
launch_directory=Dir.getwd | |
launch_time=Time.now | |
puts "Launching from the installer files directory location." | |
puts "" | |
puts "Dir: "+launch_directory.to_s |
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
c=0 ; s=nil ; 100.times{ c+=1 ; print c.to_s + " " | |
if c % 3 == 0 ; print "FIZZ"; s=true; end | |
if c % 5 == 0 ; print "BUZZ "; s=false; end | |
if s; print " "; s=false; end } |
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
#self.rb#5#;#6#;#9#;#9#;#4#;#5#;#6#;#7#;#9#;#6#;#4### self.rb | |
## CHARACTERS | |
CHARS = [] ; c = 0 ; 256.times{ CHARS << c.chr.to_s ; c += 1 } | |
## every 8 bit binary number in cardinal order | |
BINARY = [] ; c = 0 ; 256.times { b = c.to_s(2) ; until b.to_s.length == 8 ; b = "0" + b.to_s ; end ; BINARY << b ; c += 1 } | |
## every hexicdeimal number in order | |
HEX = [] ; c = 0 ; 256.times { h = c.to_s(16) ; if h.length == 1 ; h = "0" + h.to_s ; end ; HEX << h ; c += 1 } | |
## a list of all 8 bit byte codes for the ascii characters | |
#BYTES = [] ; HEX.each do |h| ; BYTES << "\\x" + h ; end | |
##system/region termonology |
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
a=1 ; b=2 ; 100.times{ puts (a+b).to_s ; a+=1; b+=1 } |
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 scan_splicer(s,b,e) # i.e.: "<tag>", "</tag>" | |
if s.to_s == "" or b.to_s == "" or e.to_s == ""; raise "Invalid arguements passed."; end | |
if s.length<=(b.to_s.length+e.to_s.length); raise "Input string is too small."; end | |
pos=0; stack = false; list=[] | |
if b.length > e.length ; buffer_length = b.length; else; buffer_length = e.length; end | |
buffer = []; buffer_length.times{ buffer << "" } | |
empty_buffer=[]; buffer_length.times{ empty_buffer << "" } | |
empty_buffer2=[]; buffer_length.times{ empty_buffer2 << "" } | |
tag1=empty_buffer; b.split('').each { |ch| empty_buffer << ch ; empty_buffer.delete_at(0) } |