Skip to content

Instantly share code, notes, and snippets.

View keshavsaharia's full-sized avatar

Keshav Saharia keshavsaharia

View GitHub Profile
@keshavsaharia
keshavsaharia / NeuralNetwork.wl
Last active April 21, 2017 13:14
A neural network implemented in Mathematica.
(* A neuron is a list, where the first element is the value, and the remaining elements are weights of
incoming connections to the neuron. Neurons are constructed by specifying the number of incoming synapses *)
Neuron[i_] := {0} ~Join~ ((2*RandomReal[] - 1) & /@ Range[i]);
(* Create a neuron with the specific weight and set of edges *)
Neuron[v_, w_] := Join[{v}, w];
(* A layer of the network is just a list of neurons *)
Layer[n_, i_] := Array[Neuron[i] &, n];

This is da readmeasdf

@keshavsaharia
keshavsaharia / README.md
Last active February 17, 2017 05:48
problem: Fizz Buzz

Fizz Buzz

Write a program that prints the numbers from 1 to 100. However, for multiples of three, print "fizz" instead of the number. For the multiples of five, print "buzz", instead of the number. For numbers which are multiples of both three and five, print "fizzbuzz".

<!DOCTYPE html>
<html>
<head>
<style>
/* Style the things in the page */
body {
}
button {
import zen.core.Zen;
public class Play2048 {
static int[][] board;
private static final int UP = 0;
private static final int DOWN = 1;
private static final int LEFT = 2;
private static final int RIGHT = 3;