This file contains hidden or 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
for (int i = 0; i < 100; i++) | |
Console.WriteLine((0 == i % 3 && 0 == i % 5) ? "FizzBuzz" : 0 == i % 3 ? "Fizz" : 0 == i % 5 ? "Buzz" : i.ToString()); |
This file contains hidden or 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
public object CreateInstance(string Name, params object[] Args) | |
{ | |
Type ToCreate = Type.GetType(Name); | |
var InnerTypeList = new List<Type>(); | |
InnerTypeList.Add(typeof(CallSite)); | |
InnerTypeList.Add(typeof(Type)); | |
foreach (object Arg in Args) | |
{ | |
InnerTypeList.Add(Arg.GetType()); |
This file contains hidden or 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
public class ImplicitTest | |
{ | |
public double Val { get; set; } | |
public ImplicitTest(double Val) | |
{ | |
this.Val = Val; | |
} | |
public static implicit operator int(ImplicitTest d) |
This file contains hidden or 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
//Problem: | |
//You have N zombies, you wish to find the strongest and weakest zombie in population | |
//The only way to compare 2 zombies is by directly comparing their strength with either > or < | |
//Zombie strength in this implementation is specified with an integer | |
//The problem must be solved with a maximum of 3n/2 comparisons or "fights" between 2 zombies | |
open System | |
//Find the highest power of 2 which is less then or equal to n | |
let highestPower2 n = |
This file contains hidden or 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
# http://fsharp.org | |
# ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾ | |
# Detection | |
# ‾‾‾‾‾‾‾‾‾ | |
hook global BufCreate .*\.(fs|fsi|fsx|fsscript)$ %{ | |
set-option buffer filetype fsharp | |
} |
This file contains hidden or 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
//pema99 - Merge sort implementation - 23/09/2021 | |
let rec merge op l r = | |
match l, r with | |
| [], _ -> r | |
| _, [] -> l | |
| lh::lt, rh::rt -> | |
if op lh rh then lh :: merge op lt r | |
else rh :: merge op l rt |
This file contains hidden or 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
float a,b,c,d,f;int[] e;int q=20;int w=50; | |
void r(){e=new int[32];c=2;d=2;b=300;f=0;a=0;} | |
void setup(){size(400,400);r();} | |
void draw(){ | |
background(0); | |
rect(f,380,w,18); | |
for(int x=0;x<8;x++) | |
for(int y=0;y<4;y++) | |
if(e[y*8+x]==0){ | |
int s=x*w;int t=y*q; |
This file contains hidden or 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 LambdaCalc | |
open Combinator | |
open Common | |
open Util | |
// Lambda calc AST | |
type Expr = | |
| Id of string | |
| Abs of string * Expr |
This file contains hidden or 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
Shader "Unlit/ScreenVertPos" | |
{ | |
Properties | |
{ | |
[IntRange] _Width ("Texture Size (POT)", Range(0, 13)) = 7 | |
} | |
SubShader | |
{ | |
Pass | |
{ |
This file contains hidden or 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
Shader "Unlit/Double Layer Fresnel" | |
{ | |
Properties {} | |
SubShader { | |
Tags { | |
"RenderType"="Transparent" "Queue"="Transparent" "DisableBatching"="True" "IgnoreProjector" = "True" | |
} | |
GrabPass {} | |
Pass { | |
Name "FORWARD" |
OlderNewer