for i in from..til case $1 when "i" @recipes.push($data_items[i]) when "w" @recipes.push($data_weapons[i]) when "a" @recipes.push($data_armors[i]) end end @recipes = @recipes.sort_by {|x| [x.class.to_s, x.id]} end

for i in from..til case $1 when "i" return if @recipes.include?($data_items[i]) @recipes.push($data_items[i]) when "w" return if @recipes.include?($data_weapons[i]) @recipes.push($data_weapons[i]) when "a" return if @recipes.include?($data_armors[i]) @recipes.push($data_armors[i]) end end

for i in from..til case $1 when "i" return if not @recipes.include?($data_items[i]) @recipes.delete($data_items[i]) when "w" return if not @recipes.include?($data_weapons[i]) @recipes.delete($data_weapons[i]) when "a" return if not @recipes.include?($data_armors[i]) @recipes.delete($data_armors[i]) end end