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
(* ========================================================================== * | |
* General implementation of A-star algorithm | |
* ========================================================================== *) | |
module Astar : | |
sig | |
type 'a t = | |
{ | |
cost : 'a -> 'a -> int; | |
goal : 'a; |
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
The MIT-except-Apple License (MIT-EA) | |
Copyright (c) <year> <copyright holders> | |
Permission is hereby granted, free of charge, to any person (except | |
anybody associated with Apple Inc.) obtaining a copy of this software | |
and associated documentation files (the "Software"), to deal in the | |
Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
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
open System | |
let (|Alive|Dead|) i = | |
match i with | |
| 0 -> Dead | |
| 1 -> Alive | |
| _ -> failwith "What?" | |
let rand = Random() |
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
[assembly: WebActivatorEx.PreApplicationStartMethod(typeof(Ascend.Core.Application.App_Start.NinjectWebCommon), "Start")] | |
[assembly: WebActivatorEx.ApplicationShutdownMethodAttribute(typeof(Ascend.Core.Application.App_Start.NinjectWebCommon), "Stop")] | |
namespace Ascend.Core.Application.App_Start | |
{ | |
using System; | |
using System.Linq; | |
using System.Web; | |
using Microsoft.Web.Infrastructure.DynamicModuleHelper; |
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
import os,tty;tty.setcbreak(0);M=['']*16 | |
def G(v): | |
p=['']*4;u=list(filter(str,v));i=3 | |
while u:z=u.pop();p[i]=u and z==u[-1]and 2*u.pop()or z;i-=1 | |
return p | |
def Y(M,k):i=1;M=zip(*[iter(M)]*4);exec'M=map([list,G][i*k==k*k],zip(*M))[::-1];i+=1;'*4;return sum(M,[]) | |
while 1: | |
r=id(M)%71+17 | |
while M[r%16]*r:r-=1 | |
if r:M[r%16]=r%7%2*2+2 |