Skip to content

Instantly share code, notes, and snippets.

var fs = require('fs');
var filename = process.argv[2];
console.log('Fixing ' + filename);
var lines = fs.readFileSync(filename).toString().split('\n');
var output = [];
lines.forEach((s, idx) => {
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Graphics2D;
import javax.swing.JFrame;
import javax.swing.WindowConstants;
/**
* @author Roi Atalla
*/
import javafx.animation.AnimationTimer;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.control.Button;
import javafx.scene.layout.HBox;
import javafx.scene.paint.Color;
import javafx.stage.FileChooser;
import javafx.stage.Stage;
open Printf
type move = Start | Right | Left | Up_Right | Up_Left | Down_Right | Down_Left;;
type board_move = {
move: move;
idx: int;
};;
type board_state = {
@ra4king
ra4king / FindLongestConsecutiveIntegerLength.java
Last active July 26, 2016 09:11
Finds the length of the longest chain of consecutive integers in an unsorted list.
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
/**
* @author Roi Atalla
*/
public class FindLongestConsecutiveIntegerLength {
public static void main(String[] args) {
public void readShader(String filePath, int shaderType)
{
try(BufferedReader reader = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream(vShaderPath))))
{
StringBuilder str = new StringBuilder();
String line;
while ((line = reader.readLine()) != null)
{
str.append(line).append("\n");
import static org.lwjgl.opengl.GL11.*;
import java.util.ArrayList;
import java.util.Random;
import org.lwjgl.opengl.*;
import org.lwjgl.*;
import org.lwjgl.input.Keyboard;
public class Map {