This file contains 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_relative "../Stack" | |
file = File.open("input.txt") | |
file_data = file.read | |
data = file_data.split("\n") | |
points = { | |
")" => 3, | |
"]" => 57, |
This file contains 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_relative "../Matrix" | |
require_relative "../Queue" | |
file = File.open("input.txt") | |
file_data = file.read | |
data = file_data.split("\n") | |
matrix1 = Matrix.new(data.length, data[0].length) |
This file contains 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
file = File.open("input.txt") | |
file_data = file.read | |
data = file_data.split(',').map(&:to_i) | |
@fish = {} | |
data.each do |el| | |
@fish[el] += 1 if @fish[el] | |
@fish[el] = 1 if !@fish[el] |
This file contains 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_relative "../Matrix" | |
file = File.open("input.txt") | |
file_data = file.read | |
list = file_data.split("\n") | |
matrix = Matrix.new(1000, 1000) | |
# PART 1 |
This file contains 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
type Anode = { | |
value: string, | |
right: Anode | null, | |
left: Anode | null | |
} | |
let tree:Anode = { | |
value: "A", | |
right: { | |
value: "C", |
This file contains 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
tree = { | |
value: "A", | |
right: { | |
value: "C", | |
right: { | |
value: "F", | |
right: nil, | |
left: nil | |
}, | |
left: { |
This file contains 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
var currentCode = "0001"; | |
var details = { | |
currentCode : "0001", | |
currentColor : "#9097C0" | |
} | |
const tileSelect = (e) => { | |
if (e.target.className !== "tile") return | |
details.currentCode = e.target.dataset.code |
This file contains 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
data = IO.read('test-floor.txt').lines.map(&:chomp) | |
def surround(data) | |
3.times do | |
data.map! do |item| | |
item = item.split("") if item.is_a? String | |
item.unshift("w") | |
item.push("w") | |
end | |
data.push(Array.new(data[0].length, "w")) |
This file contains 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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using System.IO; | |
public class grid_manager : MonoBehaviour | |
{ | |
[SerializeField] | |
private float tile_size = 1.02F; |
NewerOlder