Skip to content

Instantly share code, notes, and snippets.

View lx93's full-sized avatar
👹
Not all those who wander are lost

Xiang Li lx93

👹
Not all those who wander are lost
  • MS CS @ University of San Francisco
  • San Francisco, CA
View GitHub Profile
@lx93
lx93 / trim_arr.rb
Created September 8, 2017 19:55 — forked from imann24/trim_arr.rb
Trim a 2D array on a particular interval. Helper method for game of Mash
values = Array[["Charlie", "Dee", "Mac", "Dennis", "Frank"], ["Bar", "Bridge", "Van", "Submarine"], ["House", "Mansion"]]
interval = 11
def trim(array, interval)
running = true
interval_counter = 0
inner_pointer = 0
outer_pointer = 0
flags = Array.new(array.length, false)
while(running)