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
[lila] $ inspect tree compile | |
[info] lila/compile:compile = Task[sbt.inc.Analysis] | |
[info] +-lila/compile:incCompileSetup = Task[sbt.Compiler$IncSetup] | |
[info] | +-*/*:skip = Task[Boolean] | |
[info] | +-lila/compile:compileAnalysisFilename = Task[java.lang.String] | |
[info] | | +-*/*:crossPaths = true | |
[info] | | +-lila/*:scalaBinaryVersion = 2.11 | |
[info] | | | |
[info] | +-*/*:compilerCache = Task[xsbti.compile.GlobalsCache] | |
[info] | +-*/*:definesClass = Task[scala.Function1[java.io.File, scala.Function1[java.lang.String, Boolean]]] |
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
vagrant@vagrant:~$ cd /vagrant/ | |
vagrant@vagrant:/vagrant$ sbt run -Dhttp.port=9663 | |
[info] Loading project definition from /vagrant/project | |
[info] Set current project to lila (in build file:/vagrant/) | |
MessageCompiler took 305ms | |
--- (Running the application, auto-reloading is enabled) --- | |
[info] p.c.s.NettyServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9663 |
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
Might want to add similar for linking to user profiles (via @).: | |
1. https://github.com/ornicar/lila/blob/4c86f1051b18429c275bf45e23800378a27f1ba0/app/templating/StringHelper.scala#L30 |
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 Move (makeMove, Move (PlaceTiles, Exchange, Pass), GameTransition(MoveTransition, ExchangeTransition, PassTransition)) where | |
import ScrabbleError | |
import FormedWord | |
import Control.Monad | |
import Control.Applicative | |
import Data.Maybe | |
import Game | |
import Player | |
import Data.Map as Map |
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
object Primes extends App { | |
val candidates = (Stream from (5, 2)) | |
def isPrime(number: Int, discovered: Stream[Int]): Boolean = | |
discovered takeWhile (_ < Math.sqrt(number).toInt) forall (x => number % x != 0) | |
val primes: Stream[Int] = 2 #:: 3 #:: (candidates filter { x => isPrime(x, primes) }) |
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
Bag="JEARVINENVO_NILLEWBKONUIEUWEAZBDESIAPAEOOURGOCDSNIADOAACAR_RMYELTUTYTEREOSITNIRFGPHAQLHESOIITXFDMETG" | |
start | |
a: JEARVIN | |
b: ENVO_NI | |
c: LLEWBKO | |
d: NUIEUWE | |
bag: LLEWBKONUIEUWEAZBDESIAPAEOOURGOCDSNIADOAACAR_RMYELTUTYTEREOSITNIRFGPHAQLHESOIITXFDMETG |
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
Bag="JEARVINENVO_NILLEWBKONUIEUWEAZBDESIAPAEOOURGOCDSNIADOAACAR_RMYELTUTYTEREOSITNIRFGPHAQLHESOIITXFDMETG" | |
start | |
a: JEARVIN | |
b: ENVO_NI | |
c: LLEWBKO | |
d: NUIEUWE | |
bag: LLEWBKONUIEUWEAZBDESIAPAEOOURGOCDSNIADOAACAR_RMYELTUTYTEREOSITNIRFGPHAQLHESOIITXFDMETG |
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
Don't expose the Letter / BlankLetter constructors to anything that's not the letterbag... |
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
Don't pattern match an Option. Use fold (available in Scala 2.10) | |
Don't use Either: Have a look at scalaz's Valid / Try monad. Not sure about this one, feels ugly using exeptions when the behaviour is fully expected. People make invalid moves in scrabble all the time. Threading around 'Either's isn't particularly satisfying either. Hmmm... | |
- Look into the role of 'flatMap' in Try monads. | |
Try to avoid the InstanceOf usage. | |
Include an .sbt file (for building.) |
NewerOlder