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
//add rand and bmp as dependencies in toml file | |
extern crate rand; | |
extern crate bmp; | |
use bmp::Image; | |
use rand::Rng; | |
#[derive(Clone)] | |
enum Expr { | |
VariableX, | |
VariableY, |
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 ColorF(r : float, g : float, b : float) = | |
new(r : byte, g : byte, b : byte) = ColorF(float r / 255.0, float g / 255.0, float b / 255.0) | |
member __.R = r | |
member __.G = g | |
member __.B = b | |
member color.RGBA = | |
let r = int (r * 255.0) | |
let g = int (g * 255.0) | |
let b = int (b * 255.0) |
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
.class public auto ansi abstract sealed Program | |
extends [mscorlib]System.Object | |
{ | |
.custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( | |
01 00 07 00 00 00 00 00 | |
) | |
.class nested public auto auto sealed serializable beforefieldinit DU | |
extends [mscorlib]System.ValueType | |
implements class [mscorlib]System.IEquatable`1<valuetype Program/DU>, | |
[mscorlib]System.Collections.IStructuralEquatable, |
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; | |
namespace FizzBuzz | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
for(int i=1;i<=100;i++) { | |
switch (new { mod3 = i % 3, mod5 = i % 5 }) { |
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
module AST = | |
type Name = string | |
type TypeName = string | |
type Literal = Int of int | Bool of bool | String of string | Void | |
type Expr = | |
| Literal of Literal | |
| Rem of Expr * Expr |
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
#define NUM_SPHERE 6 | |
#define NUM_LIGHT 3 | |
struct Camera { | |
vec3 position; | |
vec3 forward; | |
vec3 up; | |
vec3 right; | |
}; |
OlderNewer