Login Register






[Ruby] Database search system filter_list
Author
Message
[Ruby] Database search system #1
This is more of a concept than a fully-built program but here it is (If you're not in the list, don't be offended.)

Code:
#rDB by Nightc||ed, ©2015 db = Hash.new ######List definitions###### db["Admin "] = "Oni" db["Gold "] = "Eclipse" db["S-Mod "] = "Saikou" db["Dysfunctional();"] = "Nightc||ed" db["Registered "] = "Anime" db["Bronze "] = "Master" db["Err "] = "Error" ############################ x = 0 num = db.count - 1 ###########Full list############ puts "Group: Member:" num.times do |pair| puts "#{db.keys[x]} │ #{db.values[x]}" x += 1 end ############################### puts "------------------- Enter index number:" i = gets.to_i i -= 1 system "cls" puts "Group: Member:" puts "#{db.keys[i]} │ #{db.values[i]}" sleep
It's often the outcasts, the iconoclasts ... those who have the least to lose because they
don't have much in the first place, who feel the new currents and ride them the farthest.

Reply