Skip to content

Instantly share code, notes, and snippets.

View Raagh's full-sized avatar
🎯
Focusing on quality

Patricio Ferraggi Raagh

🎯
Focusing on quality
View GitHub Profile
@Raagh
Raagh / ui.js
Created April 14, 2020 18:23
Functional Snake Game part 2 - UI module
const r = require("ramda")
const { intercalate, update } = require("./helper")
const createWorld = (rows, columns, state) => {
const repeatDot = r.repeat(".")
const map = r.map(r.thunkify(repeatDot)(rows), repeatDot(columns))
return r.pipe(addSnake(state), addApple(state))(map)
}
@Raagh
Raagh / snake.js
Last active April 13, 2020 19:57
Snake Game Functional JavaScript Part 0 - Point
const point = (x, y) => {
return {
x: x,
y: y,
}
}