- Wizard Of Portal - логическая игра между двумя противниками, где один из игроков играет «черными», второй — «белыми» жезлами.
- Игровое поле - это глобальной карте, стостоящей из 3х3 поля, где каждое локальное поле стостоит из 3х3 клетки.
- Игра начинается с выбора первым игроком одного из локальных полей, а затем установкой своего жезла в одну из клеток на этом поле.
- Следующий игрок делает свой ход локальном поле, координаты которого соответстуют предыдущиму ходу поротивника в локальном поле, занимая одну из свободных клеток. И так далее
- Первый, выстроивший в ряд 3 своих жезлов по вертикали, горизонтали или диагонали, локального поля, занимает все локальное поле своим знаком.
- Если ход предыдущего игрока вынуждает следующего ходить в уже полностью занятое локальное поле, то тот должен сам выбрать одно из незанятых локальных полей.
- Побеждает тот, кто первым займет в ряд 3 локальных поля по вертикали, горизонтали или диагонали.
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
object GameOfLife extends App with Shtml { | |
import korolev.EventResult._ | |
val universeSize = 20 | |
val cellRadius = 10 | |
val cellGap = 2 | |
val cellWidth = cellRadius * 2 | |
val viewSide = cellRadius + universeSize * (cellWidth + cellGap) |
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
sealed trait MyList[+T] | |
case object MyNil extends MyList[Nothing] | |
case class MyCons[+T](head: T, tail: MyList[T]) extends MyList[T] | |
object MyList { | |
object :: { | |
def unapply[T](list: MyList[T]): Option[(T, MyList[T])] = list match { | |
case MyCons(x, xs) => Some((x, xs)) | |
case MyNil => None |
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
REPOSITORY="-DrepositoryId=haxemojos-nexus-releases -Durl=http://repo.haxemojos.org/content/repositories/releases" | |
OPTS="-DgeneratePom=false" | |
NAME="-DgroupId=org.haxe.compiler -DartifactId=haxe-compiler -Dversion=$1" | |
mvn deploy:deploy-file $NAME -Dclassifier=win -Dpackaging=zip -Dfile=haxe-$1-win.zip $REPOSITORY $OPTS | |
mvn deploy:deploy-file $NAME -Dclassifier=osx -Dpackaging=tgz -Dfile=haxe-$1-osx.tar.gz $REPOSITORY $OPTS | |
mvn deploy:deploy-file $NAME -Dclassifier=linux32 -Dpackaging=tgz -Dfile=haxe-$1-linux32.tar.gz $REPOSITORY $OPTS | |
mvn deploy:deploy-file $NAME -Dclassifier=linux64 -Dpackaging=tgz -Dfile=haxe-$1-linux64.tar.gz $REPOSITORY $OPTS | |
mvn deploy:deploy-file $NAME -Dpackaging=pom -Dfile=pom.xml $REPOSITORY $OPTS |
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
implicit def IterableW[F[_], T](implicit w: W[T], ev: F[T] <:< Iterable[T]) = { | |
new W[F[T]] { | |
def write(xs: F[T]) = { | |
ev(xs).map(x => w.write(x)).mkString(", ") | |
} | |
} | |
} | |
def writeIterable[F[_], T](xs: F[T])(implicit w: W[T], ev: F[T] <:< Iterable[T]) = { | |
ev(xs).map(x => w.write(x)).mkString(", ") |
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
import akka.actor._ | |
object Main extends App { | |
val N = 2000000 | |
val system = ActorSystem("mySystem") | |
val input = system.actorOf(Props[Input]) | |
val output = system.actorOf(Props[Output]) |
Перед тем как делать коммит, надо удостовериться, что у вас на компьютере есть все актуальные измениния из центрального репозитория.
# git pull (получить из менения из) origin (псевдоним центрального реаозитория) master (название ветки)
git pull origin master
Если при выпонении этой команды возникли конфликты, то нужно сбросить свои изменения во временное хранилище stash
. И выполнить pull
еще раз.
git stash
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
apply plugin: 'application' | |
apply plugin: 'scala' | |
repositories { | |
mavenLocal() | |
mavenCentral() | |
} | |
mainClassName = 'PushkaTest.MainApp' |
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
function Fsm(states) { | |
var self = this; | |
function onTransition(state, data) { | |
self.state = state; | |
self.data = data; | |
states[state](data, onTransition); | |
} | |
onTransition(Object.getOwnPropertyNames(states)[0], null); | |
} |
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
<? | |
$ADDYBOT_TOKEN = 'Your token from AddyBot Cabinet'; | |
// The data to send to the API | |
$postData = array( | |
'language' => 'english', | |
'userIdentifier' => 'telegram_user_id' | |
); | |
// Setup cURL |