Skip to content

Instantly share code, notes, and snippets.

View ornicar's full-sized avatar
💭
⏚⏚⏚⏚

Thibault Duplessis ornicar

💭
⏚⏚⏚⏚
View GitHub Profile
URL: http://lichess.org/s8m31hrg
1. e4
1... e6
2. d4
2... Nf6
3. Nc3
3... d5
4. e5
4... Nfd7
5. Bb5
(ns pcg)
(defn log [& args] (.log js/console (apply pr-str args)))
(log "minimal program")
(ns lichess.problem
(:require [dommy.core :as dommy]
[cljs.core.async :refer [put! chan <!]])
(:require-macros [cljs.core.async.macros :refer [go]])
(:use-macros [dommy.macros :only [node sel sel1]]))
(defn log! [& args] (.log js/console (apply pr-str args)))
(defn log-obj! [obj] (.log js/console obj))
(def static-domain (str "http://" (clojure.string/replace (.-domain js/document) #"^\w+" "static")))
{
"history": "...",
"solution": {
"c3e4": {
"eval": 24, // always positive if white wins
"then": {
"e8g8": {
"eval": 32,
"then": {
"f3h4": "end",
package utils
import scala.util.{ Try, Success, Failure }
import scala.concurrent.Future
import scala.concurrent.ExecutionContext.Implicits.global
import akka.actor._
// This actor will perform asynchronous side effects sequentially.
// It ensures two effects are not performed at the same time, without blocking.
package models.store.prismicDB
import scala.util.{ Try, Success, Failure }
import scala.concurrent.{ Future, ExecutionContext}
import scala.concurrent.ExecutionContext.Implicits.global
import akka.actor._
// This actor will perform asynchronous side effects sequentially.
// It ensures two effects are not performed at the same time, without blocking.
e5c6
d5f4
d2d3
f4e2
c6e7
b7b5
c1g5
e2c3
b2c3
b5a4 win
package gainsbar
import Dir._
import Tile._
class GainsBot {
import GainsBot._
def move(input: Input) = {
package lila.puzzle
import scala.util.Random
import reactivemongo.api.QueryOpts
import reactivemongo.bson.{ BSONDocument, BSONInteger }
import lila.db.Types.Coll
import lila.user.User
ns29899(mongod-2.4.8) lichess> db.puzzle_attempt.aggregate({$group:{_id:'$u', nb:{$sum:1}}},{$sort:{nb:-1}},{$limit:10})
{
"result": [
{
"_id": "rwax_77",
"nb": 279
},
{
"_id": "thiago",
"nb": 156