├── .gitattributes ├── .gitignore ├── .travis.yml ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── admin ├── checkTaskCompletion.py ├── commandRunner.py ├── cost.py ├── cron │ ├── haliteEmailer.py │ ├── install.sh │ ├── linkChecker.py │ └── workerChecker.py ├── md │ ├── DISASTER.md │ ├── INSTALL.md │ ├── SPEC.md │ ├── STARTER_PACKAGE_CHECKLIST.md │ └── components.png ├── rankReset.py └── updateOrgs.py ├── airesources ├── C++ │ ├── MyBot.cpp │ ├── RandomBot.cpp │ ├── hlt.hpp │ ├── networking.hpp │ ├── runGame.bat │ └── runGame.sh ├── C │ ├── MyBot.c │ ├── RandomBot.c │ ├── hlt.h │ ├── runGame.bat │ └── runGame.sh ├── CSharp │ ├── Halite.csproj │ ├── HaliteHelper.cs │ ├── MyBot.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── RandomBot.cs │ ├── runGame.bat │ └── runGame.sh ├── Clojure │ ├── .gitignore │ ├── README.md │ ├── project.clj │ ├── runGame.bat │ ├── runGame.sh │ └── src │ │ ├── MyBot.clj │ │ ├── RandomBot.clj │ │ ├── game.clj │ │ └── io.clj ├── Go │ ├── MyBot.go │ ├── RandomBot.go │ ├── runGame.bat │ ├── runGame.sh │ └── src │ │ └── hlt │ │ ├── gamemap.go │ │ └── networking.go ├── Java │ ├── Direction.java │ ├── GameMap.java │ ├── InitPackage.java │ ├── Location.java │ ├── Move.java │ ├── MyBot.java │ ├── Networking.java │ ├── RandomBot.java │ ├── Site.java │ ├── runGame.bat │ └── runGame.sh ├── JavaScript │ ├── MyBot.js │ ├── RandomBot.js │ ├── hlt.js │ ├── networking.js │ ├── runGame.bat │ └── runGame.sh ├── Julia │ ├── MyBot.jl │ ├── RandomBot.jl │ ├── hlt.jl │ ├── networking.jl │ ├── runGame.bat │ └── runGame.sh ├── OCaml │ ├── MyBot.ml │ ├── README.md │ ├── RandomBot.ml │ ├── debug.ml │ ├── halite.ml │ ├── runGame.bat │ ├── runGame.sh │ └── td.ml ├── PHP │ ├── MyBot.php │ ├── RandomBot.php │ ├── hlt.php │ ├── networking.php │ ├── runGame.bat │ └── runGame.sh ├── Python │ ├── MyBot.py │ ├── RandomBot.py │ ├── hlt.py │ ├── runGame.bat │ └── runGame.sh ├── Ruby │ ├── MyBot.rb │ ├── RandomBot.rb │ ├── game_map.rb │ ├── location.rb │ ├── move.rb │ ├── networking.rb │ ├── runGame.bat │ ├── runGame.sh │ └── site.rb ├── Rust │ ├── Cargo.toml │ ├── runGame.bat │ ├── runGame.sh │ └── src │ │ ├── MyBot.rs │ │ ├── RandomBot.rs │ │ └── hlt │ │ ├── mod.rs │ │ ├── networking.rs │ │ └── types.rs ├── Scala │ ├── Bot.scala │ ├── Direction.scala │ ├── Env.scala │ ├── Grid.scala │ ├── Move.scala │ ├── MyBot.scala │ ├── RandomBot.scala │ ├── Runner.scala │ ├── runGame.bat │ └── runGame.sh └── Sockets │ ├── HaliteSocketHelper.cs │ ├── SocketNetworking.java │ ├── pipe_socket_translator.py │ ├── socket_networking.hpp │ └── socket_networking.py ├── appveyor.yml ├── environment ├── Makefile ├── core │ ├── Halite.cpp │ ├── Halite.hpp │ ├── hlt.hpp │ └── json.hpp ├── install.sh ├── main.cpp ├── make.bat ├── networking │ ├── Networking.cpp │ └── Networking.hpp └── tclap │ ├── Arg.h │ ├── ArgException.h │ ├── ArgTraits.h │ ├── CmdLine.h │ ├── CmdLineInterface.h │ ├── CmdLineOutput.h │ ├── Constraint.h │ ├── DocBookOutput.h │ ├── HelpVisitor.h │ ├── IgnoreRestVisitor.h │ ├── Makefile.am │ ├── Makefile.in │ ├── MultiArg.h │ ├── MultiSwitchArg.h │ ├── OptionalUnlabeledTracker.h │ ├── StandardTraits.h │ ├── StdOutput.h │ ├── SwitchArg.h │ ├── UnlabeledMultiArg.h │ ├── UnlabeledValueArg.h │ ├── ValueArg.h │ ├── ValuesConstraint.h │ ├── VersionVisitor.h │ ├── Visitor.h │ ├── XorHandler.h │ └── ZshCompletionOutput.h ├── tests ├── environment │ ├── Fail10Bot.py │ ├── FailInitBot.py │ ├── ModBot.py │ ├── Timeout10Bot.py │ ├── TimeoutInitBot.py │ ├── hlt.py │ ├── networking.py │ └── testenv.py ├── install.sh ├── runTests.sh ├── scalabilityTests │ ├── BasicJavaBot.zip │ └── main.py ├── setupMysql.py ├── travisTests.ini ├── website │ ├── APITest.php │ ├── GameTest.php │ ├── HistoryTest.php │ ├── UserTest.php │ └── testFile.txt └── worker │ ├── languageBot │ ├── LANGUAGE │ ├── MyBot.py │ ├── hlt.py │ ├── networking.py │ └── run.sh │ ├── loseBot │ ├── MyBot.py │ ├── hlt.py │ └── run.sh │ ├── testWorker.py │ └── winBot │ ├── MyBot.py │ ├── hlt.py │ └── run.sh ├── visualizer ├── .editorconfig ├── .gitattributes ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── index.html ├── index.js ├── lib │ ├── bootstrap.min.css │ ├── bootstrap.min.js │ ├── jquery.min.js │ ├── lodash.min.js │ ├── pixi.min.js │ ├── seedrandom.min.js │ └── xss.js ├── main.js ├── package.json ├── script │ ├── parsereplay.js │ └── visualizer.js └── style │ └── general.css ├── website ├── .htaccess ├── 404.php ├── about.php ├── advanced_command_line.php ├── advanced_development.php ├── advanced_game_server.php ├── advanced_libraries.php ├── advanced_replay_file.php ├── advanced_strategy.php ├── advanced_third_party.php ├── advanced_writing_sp.php ├── api │ ├── API.class.php │ ├── manager │ │ ├── .htaccess │ │ ├── ManagerAPI.php │ │ ├── api.php │ │ ├── trueskillMatchQuality.py │ │ └── updateTrueskill.py │ └── web │ │ ├── .htaccess │ │ ├── WebsiteAPI.php │ │ ├── api.php │ │ └── openNewWorker.py ├── archiveEnvironment.sh ├── archiveStarterPackages.sh ├── assets │ ├── amino.png │ ├── combination.png │ ├── cornell_tech.png │ ├── example_vis.png │ ├── favicons │ │ ├── android-chrome-192x192.png │ │ ├── android-chrome-512x512.png │ │ ├── apple-touch-icon.png │ │ ├── browserconfig.xml │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon.ico │ │ ├── manifest.json │ │ ├── mstile-144x144.png │ │ ├── mstile-150x150.png │ │ ├── mstile-310x150.png │ │ ├── mstile-310x310.png │ │ └── mstile-70x70.png │ ├── full_logo.png │ ├── full_logo.svg │ ├── hero.png │ ├── overkill-1.png │ ├── overkill-2.png │ ├── two_sigma.png │ ├── vettery.png │ └── vis │ │ ├── dl_arrow.png │ │ ├── dr_arrow.png │ │ ├── l_arrow.png │ │ ├── pause.png │ │ ├── play.png │ │ ├── q_mark.png │ │ └── r_arrow.png ├── associate.php ├── basics_faqs.php ├── basics_improve_random.php ├── basics_intro_halite.php ├── basics_quickstart.php ├── composer.json ├── cron │ ├── backupDatabase │ └── backupWebsite ├── downloads.php ├── email.php ├── favicon.ico ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── game.php ├── includes │ ├── dropdowns.php │ ├── footer.php │ ├── header.php │ ├── leaderTable.php │ ├── learn_sidebar.php │ ├── login_form.php │ ├── navbar.php │ └── register_form.php ├── index.php ├── install.sh ├── leaderboard.php ├── lib │ ├── bootstrap.min.css │ ├── bootstrap.min.js │ ├── bootstrap │ │ ├── bootstrap │ │ │ ├── alerts.less │ │ │ ├── badges.less │ │ │ ├── bootstrap.less │ │ │ ├── breadcrumbs.less │ │ │ ├── button-groups.less │ │ │ ├── buttons.less │ │ │ ├── carousel.less │ │ │ ├── close.less │ │ │ ├── code.less │ │ │ ├── component-animations.less │ │ │ ├── dropdowns.less │ │ │ ├── forms.less │ │ │ ├── glyphicons.less │ │ │ ├── grid.less │ │ │ ├── input-groups.less │ │ │ ├── jumbotron.less │ │ │ ├── labels.less │ │ │ ├── list-group.less │ │ │ ├── media.less │ │ │ ├── mixins.less │ │ │ ├── mixins │ │ │ │ ├── alerts.less │ │ │ │ ├── background-variant.less │ │ │ │ ├── border-radius.less │ │ │ │ ├── buttons.less │ │ │ │ ├── center-block.less │ │ │ │ ├── clearfix.less │ │ │ │ ├── forms.less │ │ │ │ ├── gradients.less │ │ │ │ ├── grid-framework.less │ │ │ │ ├── grid.less │ │ │ │ ├── hide-text.less │ │ │ │ ├── image.less │ │ │ │ ├── labels.less │ │ │ │ ├── list-group.less │ │ │ │ ├── nav-divider.less │ │ │ │ ├── nav-vertical-align.less │ │ │ │ ├── opacity.less │ │ │ │ ├── pagination.less │ │ │ │ ├── panels.less │ │ │ │ ├── progress-bar.less │ │ │ │ ├── reset-filter.less │ │ │ │ ├── reset-text.less │ │ │ │ ├── resize.less │ │ │ │ ├── responsive-visibility.less │ │ │ │ ├── size.less │ │ │ │ ├── tab-focus.less │ │ │ │ ├── table-row.less │ │ │ │ ├── text-emphasis.less │ │ │ │ ├── text-overflow.less │ │ │ │ └── vendor-prefixes.less │ │ │ ├── modals.less │ │ │ ├── navbar.less │ │ │ ├── navs.less │ │ │ ├── normalize.less │ │ │ ├── pager.less │ │ │ ├── pagination.less │ │ │ ├── panels.less │ │ │ ├── popovers.less │ │ │ ├── print.less │ │ │ ├── progress-bars.less │ │ │ ├── responsive-embed.less │ │ │ ├── responsive-utilities.less │ │ │ ├── scaffolding.less │ │ │ ├── tables.less │ │ │ ├── theme.less │ │ │ ├── thumbnails.less │ │ │ ├── tooltip.less │ │ │ ├── type.less │ │ │ ├── utilities.less │ │ │ ├── variables.less │ │ │ └── wells.less │ │ ├── bootswatch.less │ │ ├── build.less │ │ ├── build.sh │ │ ├── output.css │ │ └── variables.less │ ├── jquery.min.js │ ├── lodash.min.js │ ├── pixi.min.js │ ├── seedrandom.min.js │ ├── swiftmailer │ │ ├── .gitattributes │ │ ├── .gitignore │ │ ├── .travis.yml │ │ ├── CHANGES │ │ ├── LICENSE │ │ ├── README │ │ ├── VERSION │ │ ├── composer.json │ │ ├── lib │ │ │ ├── classes │ │ │ │ ├── Swift.php │ │ │ │ └── Swift │ │ │ │ │ ├── Attachment.php │ │ │ │ │ ├── ByteStream │ │ │ │ │ ├── AbstractFilterableInputStream.php │ │ │ │ │ ├── ArrayByteStream.php │ │ │ │ │ ├── FileByteStream.php │ │ │ │ │ └── TemporaryFileByteStream.php │ │ │ │ │ ├── CharacterReader.php │ │ │ │ │ ├── CharacterReader │ │ │ │ │ ├── GenericFixedWidthReader.php │ │ │ │ │ ├── UsAsciiReader.php │ │ │ │ │ └── Utf8Reader.php │ │ │ │ │ ├── CharacterReaderFactory.php │ │ │ │ │ ├── CharacterReaderFactory │ │ │ │ │ └── SimpleCharacterReaderFactory.php │ │ │ │ │ ├── CharacterStream.php │ │ │ │ │ ├── CharacterStream │ │ │ │ │ ├── ArrayCharacterStream.php │ │ │ │ │ └── NgCharacterStream.php │ │ │ │ │ ├── ConfigurableSpool.php │ │ │ │ │ ├── DependencyContainer.php │ │ │ │ │ ├── DependencyException.php │ │ │ │ │ ├── EmbeddedFile.php │ │ │ │ │ ├── Encoder.php │ │ │ │ │ ├── Encoder │ │ │ │ │ ├── Base64Encoder.php │ │ │ │ │ ├── QpEncoder.php │ │ │ │ │ └── Rfc2231Encoder.php │ │ │ │ │ ├── Encoding.php │ │ │ │ │ ├── Events │ │ │ │ │ ├── CommandEvent.php │ │ │ │ │ ├── CommandListener.php │ │ │ │ │ ├── Event.php │ │ │ │ │ ├── EventDispatcher.php │ │ │ │ │ ├── EventListener.php │ │ │ │ │ ├── EventObject.php │ │ │ │ │ ├── ResponseEvent.php │ │ │ │ │ ├── ResponseListener.php │ │ │ │ │ ├── SendEvent.php │ │ │ │ │ ├── SendListener.php │ │ │ │ │ ├── SimpleEventDispatcher.php │ │ │ │ │ ├── TransportChangeEvent.php │ │ │ │ │ ├── TransportChangeListener.php │ │ │ │ │ ├── TransportExceptionEvent.php │ │ │ │ │ └── TransportExceptionListener.php │ │ │ │ │ ├── FailoverTransport.php │ │ │ │ │ ├── FileSpool.php │ │ │ │ │ ├── FileStream.php │ │ │ │ │ ├── Filterable.php │ │ │ │ │ ├── Image.php │ │ │ │ │ ├── InputByteStream.php │ │ │ │ │ ├── IoException.php │ │ │ │ │ ├── KeyCache.php │ │ │ │ │ ├── KeyCache │ │ │ │ │ ├── ArrayKeyCache.php │ │ │ │ │ ├── DiskKeyCache.php │ │ │ │ │ ├── KeyCacheInputStream.php │ │ │ │ │ ├── NullKeyCache.php │ │ │ │ │ └── SimpleKeyCacheInputStream.php │ │ │ │ │ ├── LoadBalancedTransport.php │ │ │ │ │ ├── MailTransport.php │ │ │ │ │ ├── Mailer.php │ │ │ │ │ ├── Mailer │ │ │ │ │ ├── ArrayRecipientIterator.php │ │ │ │ │ └── RecipientIterator.php │ │ │ │ │ ├── MemorySpool.php │ │ │ │ │ ├── Message.php │ │ │ │ │ ├── Mime │ │ │ │ │ ├── Attachment.php │ │ │ │ │ ├── CharsetObserver.php │ │ │ │ │ ├── ContentEncoder.php │ │ │ │ │ ├── ContentEncoder │ │ │ │ │ │ ├── Base64ContentEncoder.php │ │ │ │ │ │ ├── NativeQpContentEncoder.php │ │ │ │ │ │ ├── PlainContentEncoder.php │ │ │ │ │ │ ├── QpContentEncoder.php │ │ │ │ │ │ ├── QpContentEncoderProxy.php │ │ │ │ │ │ └── RawContentEncoder.php │ │ │ │ │ ├── EmbeddedFile.php │ │ │ │ │ ├── EncodingObserver.php │ │ │ │ │ ├── Grammar.php │ │ │ │ │ ├── Header.php │ │ │ │ │ ├── HeaderEncoder.php │ │ │ │ │ ├── HeaderEncoder │ │ │ │ │ │ ├── Base64HeaderEncoder.php │ │ │ │ │ │ └── QpHeaderEncoder.php │ │ │ │ │ ├── HeaderFactory.php │ │ │ │ │ ├── HeaderSet.php │ │ │ │ │ ├── Headers │ │ │ │ │ │ ├── AbstractHeader.php │ │ │ │ │ │ ├── DateHeader.php │ │ │ │ │ │ ├── IdentificationHeader.php │ │ │ │ │ │ ├── MailboxHeader.php │ │ │ │ │ │ ├── OpenDKIMHeader.php │ │ │ │ │ │ ├── ParameterizedHeader.php │ │ │ │ │ │ ├── PathHeader.php │ │ │ │ │ │ └── UnstructuredHeader.php │ │ │ │ │ ├── Message.php │ │ │ │ │ ├── MimeEntity.php │ │ │ │ │ ├── MimePart.php │ │ │ │ │ ├── ParameterizedHeader.php │ │ │ │ │ ├── SimpleHeaderFactory.php │ │ │ │ │ ├── SimpleHeaderSet.php │ │ │ │ │ ├── SimpleMessage.php │ │ │ │ │ └── SimpleMimeEntity.php │ │ │ │ │ ├── MimePart.php │ │ │ │ │ ├── NullTransport.php │ │ │ │ │ ├── OutputByteStream.php │ │ │ │ │ ├── Plugins │ │ │ │ │ ├── AntiFloodPlugin.php │ │ │ │ │ ├── BandwidthMonitorPlugin.php │ │ │ │ │ ├── Decorator │ │ │ │ │ │ └── Replacements.php │ │ │ │ │ ├── DecoratorPlugin.php │ │ │ │ │ ├── ImpersonatePlugin.php │ │ │ │ │ ├── Logger.php │ │ │ │ │ ├── LoggerPlugin.php │ │ │ │ │ ├── Loggers │ │ │ │ │ │ ├── ArrayLogger.php │ │ │ │ │ │ └── EchoLogger.php │ │ │ │ │ ├── MessageLogger.php │ │ │ │ │ ├── Pop │ │ │ │ │ │ ├── Pop3Connection.php │ │ │ │ │ │ └── Pop3Exception.php │ │ │ │ │ ├── PopBeforeSmtpPlugin.php │ │ │ │ │ ├── RedirectingPlugin.php │ │ │ │ │ ├── Reporter.php │ │ │ │ │ ├── ReporterPlugin.php │ │ │ │ │ ├── Reporters │ │ │ │ │ │ ├── HitReporter.php │ │ │ │ │ │ └── HtmlReporter.php │ │ │ │ │ ├── Sleeper.php │ │ │ │ │ ├── ThrottlerPlugin.php │ │ │ │ │ └── Timer.php │ │ │ │ │ ├── Preferences.php │ │ │ │ │ ├── ReplacementFilterFactory.php │ │ │ │ │ ├── RfcComplianceException.php │ │ │ │ │ ├── SendmailTransport.php │ │ │ │ │ ├── SignedMessage.php │ │ │ │ │ ├── Signer.php │ │ │ │ │ ├── Signers │ │ │ │ │ ├── BodySigner.php │ │ │ │ │ ├── DKIMSigner.php │ │ │ │ │ ├── DomainKeySigner.php │ │ │ │ │ ├── HeaderSigner.php │ │ │ │ │ ├── OpenDKIMSigner.php │ │ │ │ │ └── SMimeSigner.php │ │ │ │ │ ├── SmtpTransport.php │ │ │ │ │ ├── Spool.php │ │ │ │ │ ├── SpoolTransport.php │ │ │ │ │ ├── StreamFilter.php │ │ │ │ │ ├── StreamFilters │ │ │ │ │ ├── ByteArrayReplacementFilter.php │ │ │ │ │ ├── StringReplacementFilter.php │ │ │ │ │ └── StringReplacementFilterFactory.php │ │ │ │ │ ├── SwiftException.php │ │ │ │ │ ├── Transport.php │ │ │ │ │ ├── Transport │ │ │ │ │ ├── AbstractSmtpTransport.php │ │ │ │ │ ├── Esmtp │ │ │ │ │ │ ├── Auth │ │ │ │ │ │ │ ├── CramMd5Authenticator.php │ │ │ │ │ │ │ ├── LoginAuthenticator.php │ │ │ │ │ │ │ ├── NTLMAuthenticator.php │ │ │ │ │ │ │ ├── PlainAuthenticator.php │ │ │ │ │ │ │ └── XOAuth2Authenticator.php │ │ │ │ │ │ ├── AuthHandler.php │ │ │ │ │ │ └── Authenticator.php │ │ │ │ │ ├── EsmtpHandler.php │ │ │ │ │ ├── EsmtpTransport.php │ │ │ │ │ ├── FailoverTransport.php │ │ │ │ │ ├── IoBuffer.php │ │ │ │ │ ├── LoadBalancedTransport.php │ │ │ │ │ ├── MailInvoker.php │ │ │ │ │ ├── MailTransport.php │ │ │ │ │ ├── NullTransport.php │ │ │ │ │ ├── SendmailTransport.php │ │ │ │ │ ├── SimpleMailInvoker.php │ │ │ │ │ ├── SmtpAgent.php │ │ │ │ │ ├── SpoolTransport.php │ │ │ │ │ └── StreamBuffer.php │ │ │ │ │ ├── TransportException.php │ │ │ │ │ └── Validate.php │ │ │ ├── dependency_maps │ │ │ │ ├── cache_deps.php │ │ │ │ ├── message_deps.php │ │ │ │ ├── mime_deps.php │ │ │ │ └── transport_deps.php │ │ │ ├── mime_types.php │ │ │ ├── preferences.php │ │ │ ├── swift_init.php │ │ │ ├── swift_required.php │ │ │ ├── swift_required_pear.php │ │ │ └── swiftmailer_generate_mimes_config.php │ │ ├── phpunit.xml.dist │ │ └── tests │ │ │ ├── IdenticalBinaryConstraint.php │ │ │ ├── StreamCollector.php │ │ │ ├── SwiftMailerSmokeTestCase.php │ │ │ ├── SwiftMailerTestCase.php │ │ │ ├── _samples │ │ │ ├── charsets │ │ │ │ ├── iso-2022-jp │ │ │ │ │ └── one.txt │ │ │ │ ├── iso-8859-1 │ │ │ │ │ └── one.txt │ │ │ │ └── utf-8 │ │ │ │ │ ├── one.txt │ │ │ │ │ ├── three.txt │ │ │ │ │ └── two.txt │ │ │ ├── dkim │ │ │ │ ├── dkim.test.priv │ │ │ │ └── dkim.test.pub │ │ │ ├── files │ │ │ │ ├── data.txt │ │ │ │ └── swiftmailer.png │ │ │ └── smime │ │ │ │ ├── CA.srl │ │ │ │ ├── ca.crt │ │ │ │ ├── ca.key │ │ │ │ ├── create-cert.sh │ │ │ │ ├── encrypt.crt │ │ │ │ ├── encrypt.key │ │ │ │ ├── encrypt2.crt │ │ │ │ ├── encrypt2.key │ │ │ │ ├── intermediate.crt │ │ │ │ ├── intermediate.key │ │ │ │ ├── sign.crt │ │ │ │ ├── sign.key │ │ │ │ ├── sign2.crt │ │ │ │ └── sign2.key │ │ │ ├── acceptance.conf.php.default │ │ │ ├── acceptance │ │ │ └── Swift │ │ │ │ ├── AttachmentAcceptanceTest.php │ │ │ │ ├── ByteStream │ │ │ │ └── FileByteStreamAcceptanceTest.php │ │ │ │ ├── CharacterReaderFactory │ │ │ │ └── SimpleCharacterReaderFactoryAcceptanceTest.php │ │ │ │ ├── DependencyContainerAcceptanceTest.php │ │ │ │ ├── EmbeddedFileAcceptanceTest.php │ │ │ │ ├── Encoder │ │ │ │ ├── Base64EncoderAcceptanceTest.php │ │ │ │ ├── QpEncoderAcceptanceTest.php │ │ │ │ └── Rfc2231EncoderAcceptanceTest.php │ │ │ │ ├── EncodingAcceptanceTest.php │ │ │ │ ├── KeyCache │ │ │ │ ├── ArrayKeyCacheAcceptanceTest.php │ │ │ │ └── DiskKeyCacheAcceptanceTest.php │ │ │ │ ├── MessageAcceptanceTest.php │ │ │ │ ├── Mime │ │ │ │ ├── AttachmentAcceptanceTest.php │ │ │ │ ├── ContentEncoder │ │ │ │ │ ├── Base64ContentEncoderAcceptanceTest.php │ │ │ │ │ ├── NativeQpContentEncoderAcceptanceTest.php │ │ │ │ │ ├── PlainContentEncoderAcceptanceTest.php │ │ │ │ │ └── QpContentEncoderAcceptanceTest.php │ │ │ │ ├── EmbeddedFileAcceptanceTest.php │ │ │ │ ├── HeaderEncoder │ │ │ │ │ └── Base64HeaderEncoderAcceptanceTest.php │ │ │ │ ├── MimePartAcceptanceTest.php │ │ │ │ └── SimpleMessageAcceptanceTest.php │ │ │ │ ├── MimePartAcceptanceTest.php │ │ │ │ └── Transport │ │ │ │ └── StreamBuffer │ │ │ │ ├── AbstractStreamBufferAcceptanceTest.php │ │ │ │ ├── BasicSocketAcceptanceTest.php │ │ │ │ ├── ProcessAcceptanceTest.php │ │ │ │ ├── SocketTimeoutTest.php │ │ │ │ ├── SslSocketAcceptanceTest.php │ │ │ │ └── TlsSocketAcceptanceTest.php │ │ │ ├── bootstrap.php │ │ │ ├── bug │ │ │ └── Swift │ │ │ │ ├── Bug111Test.php │ │ │ │ ├── Bug118Test.php │ │ │ │ ├── Bug206Test.php │ │ │ │ ├── Bug274Test.php │ │ │ │ ├── Bug34Test.php │ │ │ │ ├── Bug35Test.php │ │ │ │ ├── Bug38Test.php │ │ │ │ ├── Bug518Test.php │ │ │ │ ├── Bug51Test.php │ │ │ │ ├── Bug534Test.php │ │ │ │ ├── Bug71Test.php │ │ │ │ ├── Bug76Test.php │ │ │ │ └── BugFileByteStreamConsecutiveReadCallsTest.php │ │ │ ├── fixtures │ │ │ └── MimeEntityFixture.php │ │ │ ├── smoke.conf.php.default │ │ │ ├── smoke │ │ │ └── Swift │ │ │ │ └── Smoke │ │ │ │ ├── AttachmentSmokeTest.php │ │ │ │ ├── BasicSmokeTest.php │ │ │ │ ├── HtmlWithAttachmentSmokeTest.php │ │ │ │ └── InternationalSmokeTest.php │ │ │ └── unit │ │ │ └── Swift │ │ │ ├── ByteStream │ │ │ └── ArrayByteStreamTest.php │ │ │ ├── CharacterReader │ │ │ ├── GenericFixedWidthReaderTest.php │ │ │ ├── UsAsciiReaderTest.php │ │ │ └── Utf8ReaderTest.php │ │ │ ├── CharacterStream │ │ │ └── ArrayCharacterStreamTest.php │ │ │ ├── DependencyContainerTest.php │ │ │ ├── Encoder │ │ │ ├── Base64EncoderTest.php │ │ │ ├── QpEncoderTest.php │ │ │ └── Rfc2231EncoderTest.php │ │ │ ├── Events │ │ │ ├── CommandEventTest.php │ │ │ ├── EventObjectTest.php │ │ │ ├── ResponseEventTest.php │ │ │ ├── SendEventTest.php │ │ │ ├── SimpleEventDispatcherTest.php │ │ │ ├── TransportChangeEventTest.php │ │ │ └── TransportExceptionEventTest.php │ │ │ ├── KeyCache │ │ │ ├── ArrayKeyCacheTest.php │ │ │ └── SimpleKeyCacheInputStreamTest.php │ │ │ ├── Mailer │ │ │ └── ArrayRecipientIteratorTest.php │ │ │ ├── MailerTest.php │ │ │ ├── MessageTest.php │ │ │ ├── Mime │ │ │ ├── AbstractMimeEntityTest.php │ │ │ ├── AttachmentTest.php │ │ │ ├── ContentEncoder │ │ │ │ ├── Base64ContentEncoderTest.php │ │ │ │ ├── PlainContentEncoderTest.php │ │ │ │ └── QpContentEncoderTest.php │ │ │ ├── EmbeddedFileTest.php │ │ │ ├── HeaderEncoder │ │ │ │ ├── Base64HeaderEncoderTest.php │ │ │ │ └── QpHeaderEncoderTest.php │ │ │ ├── Headers │ │ │ │ ├── DateHeaderTest.php │ │ │ │ ├── IdentificationHeaderTest.php │ │ │ │ ├── MailboxHeaderTest.php │ │ │ │ ├── ParameterizedHeaderTest.php │ │ │ │ ├── PathHeaderTest.php │ │ │ │ └── UnstructuredHeaderTest.php │ │ │ ├── MimePartTest.php │ │ │ ├── SimpleHeaderFactoryTest.php │ │ │ ├── SimpleHeaderSetTest.php │ │ │ ├── SimpleMessageTest.php │ │ │ └── SimpleMimeEntityTest.php │ │ │ ├── Plugins │ │ │ ├── AntiFloodPluginTest.php │ │ │ ├── BandwidthMonitorPluginTest.php │ │ │ ├── DecoratorPluginTest.php │ │ │ ├── LoggerPluginTest.php │ │ │ ├── Loggers │ │ │ │ ├── ArrayLoggerTest.php │ │ │ │ └── EchoLoggerTest.php │ │ │ ├── PopBeforeSmtpPluginTest.php │ │ │ ├── RedirectingPluginTest.php │ │ │ ├── ReporterPluginTest.php │ │ │ ├── Reporters │ │ │ │ ├── HitReporterTest.php │ │ │ │ └── HtmlReporterTest.php │ │ │ └── ThrottlerPluginTest.php │ │ │ ├── Signers │ │ │ ├── DKIMSignerTest.php │ │ │ ├── OpenDKIMSignerTest.php │ │ │ └── SMimeSignerTest.php │ │ │ ├── StreamFilters │ │ │ ├── ByteArrayReplacementFilterTest.php │ │ │ ├── StringReplacementFilterFactoryTest.php │ │ │ └── StringReplacementFilterTest.php │ │ │ └── Transport │ │ │ ├── AbstractSmtpEventSupportTest.php │ │ │ ├── AbstractSmtpTest.php │ │ │ ├── Esmtp │ │ │ ├── Auth │ │ │ │ ├── CramMd5AuthenticatorTest.php │ │ │ │ ├── LoginAuthenticatorTest.php │ │ │ │ ├── NTLMAuthenticatorTest.php │ │ │ │ └── PlainAuthenticatorTest.php │ │ │ └── AuthHandlerTest.php │ │ │ ├── EsmtpTransport │ │ │ └── ExtensionSupportTest.php │ │ │ ├── EsmtpTransportTest.php │ │ │ ├── FailoverTransportTest.php │ │ │ ├── LoadBalancedTransportTest.php │ │ │ ├── MailTransportTest.php │ │ │ ├── SendmailTransportTest.php │ │ │ └── StreamBufferTest.php │ └── xss.js ├── local_visualizer.php ├── organizationWhitelist.txt ├── privacy_policy.php ├── recent_games.php ├── robots.txt ├── rules_contest.php ├── rules_game.php ├── script │ ├── associate.js │ ├── backend.js │ ├── basics_intro_halite.js │ ├── email.js │ ├── game.js │ ├── general.js │ ├── index.js │ ├── leaderTable.js │ ├── leaderboard.js │ ├── localVisualizer.js │ ├── parsereplay.js │ ├── recent_games.js │ ├── status.js │ ├── user.js │ └── visualizer.js ├── sql │ ├── dummyData.sql │ ├── importDummyData.sh │ ├── install.sh │ └── schema.sql ├── status.php ├── style │ ├── general.css │ └── learn.css ├── terms_of_service.php ├── tutorials │ ├── basic │ │ ├── BasicBot.cpp │ │ ├── BasicBot.java │ │ ├── BasicBot.py │ │ └── BasicBot.rs │ ├── bfs │ │ └── BfsBot.java │ ├── machinelearning │ │ ├── MattBot.py │ │ ├── TrainMatt.py │ │ ├── hlt.py │ │ ├── my_model_architecture.json │ │ ├── my_model_weights.h5 │ │ └── networking.py │ └── random │ │ ├── ImprovedRandom.cpp │ │ ├── ImprovedRandom.java │ │ └── ImprovedRandom.py └── user.php └── worker ├── Dockerfile ├── archive.py ├── backend.py ├── buildDocker.sh ├── changeAPIKey.py ├── compiler.py ├── install.sh ├── runGame.sh ├── startWorkerScreen.sh ├── stopWorkerScreen.sh └── worker.py /.gitattributes: -------------------------------------------------------------------------------- 1 | # Linguist ignore 2 | website/lib/* linguist-vendored=false 3 | environment/core/json.hpp linguist-vendored=false 4 | environment/tclap/* linguist-vendored=false 5 | 6 | # Auto detect text files and perform LF normalization 7 | * text=auto 8 | 9 | # Custom for Visual Studio 10 | *.cs diff=csharp 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | 3 | dist: trusty 4 | 5 | language: cpp 6 | 7 | services: 8 | - mysql 9 | 10 | addons: 11 | apt: 12 | packages: 13 | - mysql-server-5.6 14 | - mysql-client-core-5.6 15 | - mysql-client-5.6 16 | 17 | install: 18 | - cd ~/build/HaliteChallenge/Halite/tests 19 | - cp travisTests.ini tests.ini 20 | - cp travisTests.ini ../halite.ini 21 | 22 | - cd ~/build/HaliteChallenge/Halite/website 23 | - sudo ./install.sh 24 | 25 | - cd ~/build/HaliteChallenge/Halite/worker 26 | - sudo ./install.sh 123 27 | 28 | - cd ~/build/HaliteChallenge/Halite/tests 29 | - sudo ./install.sh 30 | 31 | - export CXX="g++-4.9" 32 | 33 | script: 34 | - cd ~/build/HaliteChallenge/Halite/tests/ 35 | - sudo ./runTests.sh 36 | 37 | notifications: 38 | slack: halite:HnrNM3effc9q8ZVvT7PqsSYC 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2016 Michael Truell and Benjamin Spector 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /admin/commandRunner.py: -------------------------------------------------------------------------------- 1 | import pymysql 2 | import threading 3 | import configparser 4 | import sys 5 | import os 6 | import os.path 7 | 8 | def runOnWorker(worker, keyPath, command): 9 | print("########"+worker['ipAddress']+"########") 10 | os.system("ssh -oStrictHostKeyChecking=no -i \""+keyPath+"\" ubuntu@"+worker['ipAddress']+" '"+command+"'") 11 | print("########"+worker['ipAddress']+"########") 12 | 13 | parser = configparser.ConfigParser() 14 | parser.read("../halite.ini") 15 | DB_CONFIG = parser["database"] 16 | 17 | keyPath = os.path.join("../", parser["aws"]["keyfilepath"]) 18 | 19 | db = pymysql.connect(host=DB_CONFIG["hostname"], user=DB_CONFIG['username'], passwd=DB_CONFIG['password'], db=DB_CONFIG['name'], cursorclass=pymysql.cursors.DictCursor) 20 | cursor = db.cursor() 21 | 22 | cursor.execute("select * from Worker") 23 | workers = cursor.fetchall() 24 | 25 | command = sys.argv[1] 26 | 27 | isAsync = False if len(sys.argv) < 3 else int(sys.argv[2]) == 1 28 | 29 | if isAsync: 30 | threads = [] 31 | for worker in workers: 32 | t = threading.Thread(target=runOnWorker, args = (worker, keyPath, command)) 33 | t.daemon = True 34 | t.start() 35 | threads.append(t) 36 | 37 | for t in threads: 38 | t.join() 39 | else: 40 | for worker in workers: 41 | runOnWorker(worker, keyPath, command) 42 | -------------------------------------------------------------------------------- /admin/cost.py: -------------------------------------------------------------------------------- 1 | dimensions = [(1, 20), (2, 25), (3, 30), (4, 35), (3, 40), (2, 45), (1, 50)] 2 | averagePlayersPerGame = 4 3 | playersPerServers = 15.6 4 | perServerCost = 3*4.68 5 | averagePlayers = 4000 6 | totalTime = 0 7 | totalMatches = 0 8 | for dimension in dimensions: 9 | totalMatches += dimension[0] 10 | totalTime += dimension[0] * (15000 + pow(dimension[1], 3)*10/3) 11 | 12 | 13 | timePerPlayerPerMatch = totalTime*averagePlayers/(averagePlayersPerGame*(averagePlayers/playersPerServers)*totalMatches) 14 | print("Time per match per player in minutes: " + str(timePerPlayerPerMatch/(60*1000))) 15 | costPerPlayer = perServerCost/playersPerServers 16 | print("Cost per player: " + str(costPerPlayer)) 17 | totalCost = perServerCost*(averagePlayers/playersPerServers) 18 | print("Total cost: " + str(totalCost)) 19 | -------------------------------------------------------------------------------- /admin/cron/haliteEmailer.py: -------------------------------------------------------------------------------- 1 | import smtplib 2 | from email.mime.text import MIMEText 3 | 4 | def sendEmail(senderEmail, senderPassword, subject, body, recipient): 5 | print("Sending email") 6 | 7 | msg = MIMEText(body, "html") 8 | msg['Subject'] = subject 9 | msg['From'] = senderEmail 10 | msg['To'] = recipient 11 | 12 | s = smtplib.SMTP('smtp.gmail.com:587') 13 | s.ehlo() 14 | s.starttls(); 15 | s.login(senderEmail, senderPassword) 16 | s.sendmail(senderEmail, [recipient], msg.as_string()) 17 | s.quit() 18 | -------------------------------------------------------------------------------- /admin/cron/install.sh: -------------------------------------------------------------------------------- 1 | apt-get update 2 | apt-get install -y python3 python3-pip linkchecker 3 | pip3 install configparser pymysql 4 | -------------------------------------------------------------------------------- /admin/cron/linkChecker.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import configparser 4 | import subprocess 5 | import haliteEmailer 6 | 7 | parser = configparser.ConfigParser() 8 | parser.read("../../halite.ini") 9 | 10 | HALITE_EMAIL = parser["email"]["email"] 11 | HALITE_EMAIL_PASSWORD = parser["email"]["password"] 12 | 13 | command = 'linkchecker --ignore-url=^mailto: --timeout=20 https://halite.io/' 14 | proc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) 15 | stdout, stderr = proc.communicate() 16 | stdout = stdout.decode('utf-8') 17 | stderr = stderr.decode('utf-8') 18 | 19 | if stdout.split("\n")[-3].find("0 errors") == -1: 20 | haliteEmailer.sendEmail(HALITE_EMAIL, HALITE_EMAIL_PASSWORD, "LINK ALERT", "There seem to be some broken links on http://halite.io/.
Here is what was given as the output of \""+command+"\" (You will probably want more verbose output and so will have to run the command yourself).

STDOUT:
"+stderr+"

STDERR:
"+stderr+"", HALITE_EMAIL) 21 | -------------------------------------------------------------------------------- /admin/cron/workerChecker.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import configparser 4 | import pymysql 5 | 6 | import haliteEmailer 7 | 8 | parser = configparser.ConfigParser() 9 | parser.read("../../halite.ini") 10 | 11 | DB_CONFIG = parser["database"] 12 | HALITE_EMAIL = parser["email"]["email"] 13 | HALITE_EMAIL_PASSWORD = parser["email"]["password"] 14 | 15 | db = pymysql.connect(host=DB_CONFIG["hostname"], user=DB_CONFIG['username'], passwd=DB_CONFIG['password'], db=DB_CONFIG['name']) 16 | cursor = db.cursor() 17 | cursor.execute("select * from Worker WHERE TIMESTAMPDIFF(MINUTE, lastRequestTime, NOW()) > 30") 18 | results = cursor.fetchall() 19 | 20 | if len(results) == 0: 21 | print("All good!") 22 | else: 23 | message = "Some workers haven't communicated with the manager in a while!

" 24 | haliteEmailer.sendEmail(HALITE_EMAIL, HALITE_EMAIL_PASSWORD, str(len(results))+" workers down", message, HALITE_EMAIL) 25 | -------------------------------------------------------------------------------- /admin/md/STARTER_PACKAGE_CHECKLIST.md: -------------------------------------------------------------------------------- 1 | Starter Package Checklist 2 | 3 | * Make sure all proper files are present (MyBot, RandomBot, runGame.sh, runGame.bat) 4 | * Add dependencies to docker file 5 | * Test on game servers 6 | * Add to archive script 7 | * Add to downloads 8 | * Update game server reference 9 | -------------------------------------------------------------------------------- /admin/md/components.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/admin/md/components.png -------------------------------------------------------------------------------- /admin/rankReset.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import configparser 4 | import pymysql 5 | 6 | parser = configparser.ConfigParser() 7 | parser.read("../halite.ini") 8 | 9 | DB_CONFIG = parser["database"] 10 | 11 | def main(): 12 | confirm = input("This will clear all current ranks, are you sure? [y/N] ") 13 | if confirm != "y": 14 | return 15 | db = pymysql.connect(host=DB_CONFIG["hostname"], user=DB_CONFIG['username'], passwd=DB_CONFIG['password'], db=DB_CONFIG['name'], cursorclass=pymysql.cursors.DictCursor) 16 | cursor = db.cursor() 17 | cursor.execute("SELECT COUNT(*) FROM User WHERE isRunning=1") 18 | num_active = cursor.fetchone()['COUNT(*)'] 19 | cursor.execute("INSERT INTO UserHistory (userID, versionNumber, lastRank, lastNumPlayers, lastNumGames) SELECT userID, numSubmissions, rank, %d, numGames FROM User WHERE isRunning=1" % (num_active,)) 20 | cursor.execute("UPDATE User SET numSubmissions=numSubmissions+1, numGames=0, mu=25.0, sigma=8.333 WHERE isRunning=1") 21 | db.commit() 22 | db.close() 23 | print("All ranks successfully reset.") 24 | 25 | if __name__ == "__main__": 26 | main() 27 | -------------------------------------------------------------------------------- /admin/updateOrgs.py: -------------------------------------------------------------------------------- 1 | import configparser 2 | import pymysql 3 | import urllib.request 4 | 5 | 6 | parser = configparser.ConfigParser() 7 | parser.read("../halite.ini") 8 | 9 | DB_CONFIG = parser["database"] 10 | 11 | db = pymysql.connect(host=DB_CONFIG["hostname"], user=DB_CONFIG['username'], passwd=DB_CONFIG['password'], db=DB_CONFIG['name'], cursorclass=pymysql.cursors.DictCursor) 12 | cursor = db.cursor() 13 | cursor.execute("select email, userID, organization from User") 14 | users = cursor.fetchall() 15 | 16 | orgs = [line.strip().split(" - ") for line in open("../website/organizationWhitelist.txt").readlines()] 17 | 18 | for user in users: 19 | if user["email"] == None: 20 | continue 21 | 22 | realUserOrg = "Other" 23 | try: 24 | emailDomain = user["email"].split("@")[1] 25 | except: 26 | pass 27 | for org in orgs: 28 | if emailDomain == org[1]: 29 | realUserOrg = org[0] 30 | break 31 | if (realUserOrg != "Other" or user["organization"] == "") and realUserOrg != user["organization"]: 32 | print("%s, %s, %s" % (realUserOrg, user["organization"], user["email"])) 33 | cursor.execute("update User set organization = '"+realUserOrg+"' where userID="+str(user["userID"])) 34 | db.commit() 35 | -------------------------------------------------------------------------------- /airesources/C++/MyBot.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "hlt.hpp" 10 | #include "networking.hpp" 11 | 12 | int main() { 13 | srand(time(NULL)); 14 | 15 | std::cout.sync_with_stdio(0); 16 | 17 | unsigned char myID; 18 | hlt::GameMap presentMap; 19 | getInit(myID, presentMap); 20 | sendInit("MyC++Bot"); 21 | 22 | std::set moves; 23 | while(true) { 24 | moves.clear(); 25 | 26 | getFrame(presentMap); 27 | 28 | for(unsigned short a = 0; a < presentMap.height; a++) { 29 | for(unsigned short b = 0; b < presentMap.width; b++) { 30 | if (presentMap.getSite({ b, a }).owner == myID) { 31 | moves.insert({ { b, a }, (unsigned char)(rand() % 5) }); 32 | } 33 | } 34 | } 35 | 36 | sendFrame(moves); 37 | } 38 | 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /airesources/C++/RandomBot.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "hlt.hpp" 10 | #include "networking.hpp" 11 | 12 | int main() { 13 | srand(time(NULL)); 14 | 15 | std::cout.sync_with_stdio(0); 16 | 17 | unsigned char myID; 18 | hlt::GameMap presentMap; 19 | getInit(myID, presentMap); 20 | sendInit("RandomC++Bot"); 21 | 22 | std::set moves; 23 | while(true) { 24 | moves.clear(); 25 | 26 | getFrame(presentMap); 27 | 28 | for(unsigned short a = 0; a < presentMap.height; a++) { 29 | for(unsigned short b = 0; b < presentMap.width; b++) { 30 | if (presentMap.getSite({ b, a }).owner == myID) { 31 | moves.insert({ { b, a }, (unsigned char)(rand() % 5) }); 32 | } 33 | } 34 | } 35 | 36 | sendFrame(moves); 37 | } 38 | 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /airesources/C++/runGame.bat: -------------------------------------------------------------------------------- 1 | g++ -std=c++11 MyBot.cpp -o MyBot.exe 2 | g++ -std=c++11 RandomBot.cpp -o RandomBot.exe 3 | .\halite.exe -d "30 30" "MyBot.exe" "RandomBot.exe" 4 | -------------------------------------------------------------------------------- /airesources/C++/runGame.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | g++ -std=c++11 MyBot.cpp -o MyBot.o 4 | g++ -std=c++11 RandomBot.cpp -o RandomBot.o 5 | ./halite -d "30 30" "./MyBot.o" "./RandomBot.o" 6 | -------------------------------------------------------------------------------- /airesources/C/MyBot.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "hlt.h" 6 | 7 | #define BOT_NAME "MyCBot" 8 | 9 | int main(void) { 10 | 11 | GAME game; 12 | int x, y, direction; 13 | 14 | srand(time(NULL)); 15 | 16 | game = GetInit(); 17 | SendInit(BOT_NAME); 18 | 19 | while (1) { 20 | 21 | GetFrame(game); 22 | 23 | for (x = 0 ; x < game.width ; x++) { 24 | for (y = 0 ; y < game.height ; y++) { 25 | if (game.owner[x][y] == game.playertag) { 26 | direction = rand() % 5; 27 | SetMove(game, x, y, direction); 28 | } 29 | } 30 | } 31 | 32 | SendFrame(game); 33 | } 34 | 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /airesources/C/RandomBot.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "hlt.h" 6 | 7 | #define BOT_NAME "RandomCBot" 8 | 9 | int main(void) { 10 | 11 | GAME game; 12 | int x, y, direction; 13 | 14 | srand(time(NULL)); 15 | 16 | game = GetInit(); 17 | SendInit(BOT_NAME); 18 | 19 | while (1) { 20 | 21 | GetFrame(game); 22 | 23 | for (x = 0 ; x < game.width ; x++) { 24 | for (y = 0 ; y < game.height ; y++) { 25 | if (game.owner[x][y] == game.playertag) { 26 | direction = rand() % 5; 27 | SetMove(game, x, y, direction); 28 | } 29 | } 30 | } 31 | 32 | SendFrame(game); 33 | } 34 | 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /airesources/C/runGame.bat: -------------------------------------------------------------------------------- 1 | gcc MyBot.c -o MyBot.exe 2 | gcc RandomBot.c -o RandomBot.exe 3 | .\halite.exe -d "30 30" "MyBot.exe" "RandomBot.exe" 4 | -------------------------------------------------------------------------------- /airesources/C/runGame.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | gcc MyBot.c -o MyBot.o 4 | gcc RandomBot.c -o RandomBot.o 5 | ./halite -d "30 30" "./MyBot.o" "./RandomBot.o" 6 | -------------------------------------------------------------------------------- /airesources/CSharp/RandomBot.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | public class MyBot 6 | { 7 | public const string RandomBotName = "RandomC#Bot"; 8 | 9 | public static void Main(string[] args) { 10 | Console.SetIn(Console.In); 11 | Console.SetOut(Console.Out); 12 | 13 | ushort myID; 14 | var map = Networking.getInit(out myID); 15 | 16 | Networking.SendInit(RandomBotName); 17 | 18 | var random = new Random(); 19 | while (true) { 20 | Networking.getFrame(ref map); 21 | 22 | var moves = new List(); 23 | for (ushort x = 0; x < map.Width; x++) { 24 | for (ushort y = 0; y < map.Height; y++) { 25 | if (map[x, y].Owner == myID) { 26 | moves.Add(new Move { 27 | Location = new Location {X = x, Y = y}, 28 | Direction = (Direction)random.Next(5) 29 | }); 30 | } 31 | } 32 | } 33 | 34 | Networking.SendMoves(moves); // Send moves 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /airesources/CSharp/runGame.bat: -------------------------------------------------------------------------------- 1 | csc /t:library /out:HaliteHelper.dll HaliteHelper.cs 2 | csc /reference:HaliteHelper.dll -out:MyBot.exe MyBot.cs 3 | csc /reference:HaliteHelper.dll -out:RandomBot.exe RandomBot.cs 4 | halite -d "30 30" "MyBot.exe" "RandomBot.exe" 5 | -------------------------------------------------------------------------------- /airesources/CSharp/runGame.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | mcs -t:library -out:HaliteHelper.dll HaliteHelper.cs 4 | mcs -reference:HaliteHelper.dll -out:MyBot.o MyBot.cs 5 | mcs -reference:HaliteHelper.dll -out:RandomBot.o RandomBot.cs 6 | ./halite -d "30 30" "./MyBot.o" "./RandomBot.o" 7 | -------------------------------------------------------------------------------- /airesources/Clojure/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /classes 3 | /checkouts 4 | pom.xml 5 | pom.xml.asc 6 | *.jar 7 | *.class 8 | /.lein-* 9 | /.nrepl-port 10 | .hgignore 11 | .hg/ 12 | -------------------------------------------------------------------------------- /airesources/Clojure/README.md: -------------------------------------------------------------------------------- 1 | # halite-clj 2 | 3 | A Clojure implementation of a random Halite bot. 4 | 5 | ## Usage 6 | 7 | First, copy the "halite" executable to the root of your project. Build using "lein uberjar" and run: 8 | 9 | ./halite -d "30 30" "java -cp target/MyBot.jar MyBot" "java -cp target/MyBot.jar RandomBot" 10 | -------------------------------------------------------------------------------- /airesources/Clojure/project.clj: -------------------------------------------------------------------------------- 1 | (defproject halite-clj "0.1.0-SNAPSHOT" 2 | :description "FIXME: write description" 3 | :url "http://example.com/FIXME" 4 | :license {:name "Eclipse Public License" 5 | :url "http://www.eclipse.org/legal/epl-v10.html"} 6 | :dependencies [[org.clojure/clojure "1.8.0"]] 7 | :uberjar-name "MyBot.jar" 8 | :main MyBot 9 | :profiles {:uberjar {:aot :all}} 10 | ) 11 | -------------------------------------------------------------------------------- /airesources/Clojure/runGame.bat: -------------------------------------------------------------------------------- 1 | call lein uberjar 2 | 3 | halite.exe -d "30 30" "java -cp target/MyBot.jar MyBot" "java -cp target/MyBot.jar RandomBot" 4 | -------------------------------------------------------------------------------- /airesources/Clojure/runGame.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | lein uberjar 4 | 5 | ./halite -d "30 30" "java -cp target/MyBot.jar MyBot" "java -cp target/MyBot.jar RandomBot" 6 | -------------------------------------------------------------------------------- /airesources/Clojure/src/MyBot.clj: -------------------------------------------------------------------------------- 1 | (ns MyBot 2 | (:require [game] 3 | [io]) 4 | (:gen-class)) 5 | 6 | (def bot-name "MyFirstClojureBot") 7 | 8 | (defn random-moves 9 | "Takes a 2D vector of sites and returns a list of [site, direction] pairs" 10 | [my-id game-map] 11 | (let [my-sites (->> game-map 12 | flatten 13 | (filter #(= (:owner %) my-id)))] 14 | (map vector my-sites (repeatedly #(rand-nth game/directions))))) 15 | 16 | (defn -main [] 17 | (let [{:keys [my-id productions width height game-map]} (io/get-init!)] 18 | 19 | ;; Do any initialization you want with the starting game-map before submitting the bot-name 20 | 21 | (println bot-name) 22 | 23 | (doseq [turn (range)] 24 | (let [game-map (io/create-game-map width height productions (io/read-ints!))] 25 | (io/send-moves! (random-moves my-id game-map)))))) 26 | -------------------------------------------------------------------------------- /airesources/Clojure/src/RandomBot.clj: -------------------------------------------------------------------------------- 1 | (ns RandomBot 2 | (:require [game] 3 | [io]) 4 | (:gen-class)) 5 | 6 | (def bot-name "RandomClojureBot") 7 | 8 | (defn random-moves 9 | "Takes a 2D vector of sites and returns a list of [site, direction] pairs" 10 | [my-id game-map] 11 | (let [my-sites (->> game-map 12 | flatten 13 | (filter #(= (:owner %) my-id)))] 14 | (map vector my-sites (repeatedly #(rand-nth game/directions))))) 15 | 16 | (defn -main [] 17 | (let [{:keys [my-id productions width height game-map]} (io/get-init!)] 18 | 19 | ;; Do any initialization you want with the starting game-map before submitting the bot-name 20 | 21 | (println bot-name) 22 | 23 | (doseq [turn (range)] 24 | (let [game-map (io/create-game-map width height productions (io/read-ints!))] 25 | (io/send-moves! (random-moves my-id game-map)))))) 26 | -------------------------------------------------------------------------------- /airesources/Clojure/src/game.clj: -------------------------------------------------------------------------------- 1 | (ns game 2 | (:gen-class)) 3 | 4 | ;; The map is represented by a 2D vector of Sites 5 | (defrecord Site [^int x ^int y ^int production ^int strength ^int owner]) 6 | 7 | (def directions [:still :north :east :south :west]) 8 | (def cardinal-directions (rest directions)) 9 | 10 | (defn adjacent-site [game-map site direction] 11 | (let [width (count (first game-map)) 12 | height (count game-map) 13 | new-x (condp = direction 14 | :west (mod (dec (:x site)) width) 15 | :east (mod (inc (:x site)) width) 16 | (:x site)) 17 | new-y (condp = direction 18 | :north (mod (dec (:y site)) height) 19 | :south (mod (inc (:y site)) height) 20 | (:y site))] 21 | (get-in game-map [new-y new-x]))) 22 | 23 | (defn single-dimension-distance 24 | "Computes the distance between two integers mod m" 25 | [p1 p2 m] 26 | (let [unwrapped-distance (Math/abs (- p1 p2))] 27 | (min unwrapped-distance (- m unwrapped-distance)))) 28 | 29 | (defn distance [game-map site1 site2] 30 | (+ (single-dimension-distance (:x site1) (:x site2) (count (first game-map))) 31 | (single-dimension-distance (:y site1) (:y site2) (count game-map)))) 32 | -------------------------------------------------------------------------------- /airesources/Go/MyBot.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "hlt" 5 | 6 | "math/rand" 7 | ) 8 | 9 | func main() { 10 | conn, gameMap := hlt.NewConnection() 11 | conn.SendName("MyBot") 12 | for { 13 | var moves hlt.MoveSet 14 | gameMap = conn.GetFrame() 15 | for y := 0; y < gameMap.Height; y++ { 16 | for x := 0; x < gameMap.Width; x++ { 17 | loc := hlt.NewLocation(x, y) 18 | if gameMap.GetSite(loc, hlt.STILL).Owner == conn.PlayerTag { 19 | moves = append(moves, hlt.Move{ 20 | Location: loc, 21 | Direction: hlt.Direction(rand.Int() % 5), 22 | }) 23 | } 24 | } 25 | } 26 | conn.SendFrame(moves) 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /airesources/Go/RandomBot.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "hlt" 5 | 6 | "math/rand" 7 | ) 8 | 9 | func main() { 10 | conn, gameMap := hlt.NewConnection() 11 | conn.SendName("RandomBot") 12 | for { 13 | var moves hlt.MoveSet 14 | gameMap = conn.GetFrame() 15 | for y := 0; y < gameMap.Height; y++ { 16 | for x := 0; x < gameMap.Width; x++ { 17 | loc := hlt.NewLocation(x, y) 18 | if gameMap.GetSite(loc, hlt.STILL).Owner == conn.PlayerTag { 19 | moves = append(moves, hlt.Move{ 20 | Location: loc, 21 | Direction: hlt.Direction(rand.Int() % 5), 22 | }) 23 | } 24 | } 25 | } 26 | conn.SendFrame(moves) 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /airesources/Go/runGame.bat: -------------------------------------------------------------------------------- 1 | .\halite.exe -d "30 30" "go run MyBot.go" "go run RandomBot.go" 2 | -------------------------------------------------------------------------------- /airesources/Go/runGame.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export GOPATH="$(pwd)" 4 | 5 | ./halite -d "30 30" "go run MyBot.go" "go run RandomBot.go" 6 | -------------------------------------------------------------------------------- /airesources/Java/Direction.java: -------------------------------------------------------------------------------- 1 | import java.util.Random; 2 | 3 | public enum Direction { 4 | STILL, NORTH, EAST, SOUTH, WEST; 5 | 6 | public static final Direction[] DIRECTIONS = new Direction[]{STILL, NORTH, EAST, SOUTH, WEST}; 7 | public static final Direction[] CARDINALS = new Direction[]{NORTH, EAST, SOUTH, WEST}; 8 | 9 | public static Direction randomDirection() { 10 | Direction[] values = values(); 11 | return values[new Random().nextInt(values.length)]; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /airesources/Java/InitPackage.java: -------------------------------------------------------------------------------- 1 | 2 | public class InitPackage { 3 | public int myID; 4 | public GameMap map; 5 | } 6 | -------------------------------------------------------------------------------- /airesources/Java/Location.java: -------------------------------------------------------------------------------- 1 | public class Location { 2 | 3 | // Public for backward compability 4 | public final int x, y; 5 | private final Site site; 6 | 7 | public Location(int x, int y, Site site) { 8 | this.x = x; 9 | this.y = y; 10 | this.site = site; 11 | } 12 | 13 | public int getX() { 14 | return x; 15 | } 16 | 17 | public int getY() { 18 | return y; 19 | } 20 | 21 | public Site getSite() { 22 | return site; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /airesources/Java/Move.java: -------------------------------------------------------------------------------- 1 | public class Move { 2 | public Location loc; 3 | public Direction dir; 4 | 5 | public Move(Location loc_, Direction dir_) { 6 | loc = loc_; 7 | dir = dir_; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /airesources/Java/MyBot.java: -------------------------------------------------------------------------------- 1 | import java.util.ArrayList; 2 | import java.util.List; 3 | 4 | public class MyBot { 5 | public static void main(String[] args) throws java.io.IOException { 6 | 7 | final InitPackage iPackage = Networking.getInit(); 8 | final int myID = iPackage.myID; 9 | final GameMap gameMap = iPackage.map; 10 | 11 | Networking.sendInit("MyJavaBot"); 12 | 13 | while(true) { 14 | List moves = new ArrayList(); 15 | 16 | Networking.updateFrame(gameMap); 17 | 18 | for (int y = 0; y < gameMap.height; y++) { 19 | for (int x = 0; x < gameMap.width; x++) { 20 | final Location location = gameMap.getLocation(x, y); 21 | final Site site = location.getSite(); 22 | if(site.owner == myID) { 23 | moves.add(new Move(location, Direction.randomDirection())); 24 | } 25 | } 26 | } 27 | Networking.sendFrame(moves); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /airesources/Java/RandomBot.java: -------------------------------------------------------------------------------- 1 | import java.util.ArrayList; 2 | import java.util.List; 3 | 4 | public class RandomBot { 5 | public static void main(String[] args) throws java.io.IOException { 6 | 7 | final InitPackage iPackage = Networking.getInit(); 8 | final int myID = iPackage.myID; 9 | final GameMap gameMap = iPackage.map; 10 | 11 | Networking.sendInit("RandomJavaBot"); 12 | 13 | while(true) { 14 | List moves = new ArrayList(); 15 | 16 | Networking.updateFrame(gameMap); 17 | 18 | for (int y = 0; y < gameMap.height; y++) { 19 | for (int x = 0; x < gameMap.width; x++) { 20 | final Location location = gameMap.getLocation(x, y); 21 | final Site site = location.getSite(); 22 | if(site.owner == myID) { 23 | moves.add(new Move(location, Direction.randomDirection())); 24 | } 25 | } 26 | } 27 | Networking.sendFrame(moves); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /airesources/Java/Site.java: -------------------------------------------------------------------------------- 1 | public class Site { 2 | 3 | public final int production; 4 | public int owner, strength; 5 | 6 | public Site(int production) { 7 | this.production = production; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /airesources/Java/runGame.bat: -------------------------------------------------------------------------------- 1 | javac MyBot.java 2 | javac RandomBot.java 3 | .\halite.exe -d "30 30" "java MyBot" "java RandomBot" 4 | -------------------------------------------------------------------------------- /airesources/Java/runGame.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | javac MyBot.java 4 | javac RandomBot.java 5 | ./halite -d "30 30" "java MyBot" "java RandomBot" 6 | -------------------------------------------------------------------------------- /airesources/JavaScript/MyBot.js: -------------------------------------------------------------------------------- 1 | const { 2 | Move, 3 | } = require('./hlt'); 4 | const Networking = require('./networking'); 5 | 6 | const network = new Networking('MyJavaScriptBot'); 7 | 8 | network.on('map', (gameMap, id) => { 9 | const moves = []; 10 | 11 | for (let y = 0; y < gameMap.height; y++) { 12 | for (let x = 0; x < gameMap.width; x++) { 13 | const loc = { x, y }; 14 | const { owner } = gameMap.getSite(loc); 15 | if (owner === id) { 16 | moves.push(new Move(loc, Math.floor(Math.random() * 5))); 17 | } 18 | } 19 | } 20 | 21 | network.sendMoves(moves); 22 | }); 23 | -------------------------------------------------------------------------------- /airesources/JavaScript/RandomBot.js: -------------------------------------------------------------------------------- 1 | const { 2 | Move, 3 | } = require('./hlt'); 4 | const Networking = require('./networking'); 5 | 6 | const network = new Networking('RandomJavaScriptBot'); 7 | 8 | network.on('map', (gameMap, id) => { 9 | const moves = []; 10 | 11 | for (let y = 0; y < gameMap.height; y++) { 12 | for (let x = 0; x < gameMap.width; x++) { 13 | const loc = { x, y }; 14 | const { owner } = gameMap.getSite(loc); 15 | if (owner === id) { 16 | moves.push(new Move(loc, Math.floor(Math.random() * 5))); 17 | } 18 | } 19 | } 20 | 21 | network.sendMoves(moves); 22 | }); 23 | -------------------------------------------------------------------------------- /airesources/JavaScript/runGame.bat: -------------------------------------------------------------------------------- 1 | .\halite.exe -d "30 30" "node MyBot.js" "node RandomBot.js" 2 | -------------------------------------------------------------------------------- /airesources/JavaScript/runGame.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ./halite -d "30 30" "node MyBot.js" "node RandomBot.js" 4 | -------------------------------------------------------------------------------- /airesources/Julia/MyBot.jl: -------------------------------------------------------------------------------- 1 | include("hlt.jl") 2 | include("networking.jl") 3 | 4 | myID, gameMap = getInit() 5 | sendInit("MyJuliaBot") 6 | 7 | while true 8 | moves = Vector{Move}() 9 | gameMap = getFrame() 10 | for y in 0:gameMap.height-1 11 | for x in 0:gameMap.width-1 12 | if getSite(gameMap, Location(x, y)).owner == myID 13 | push!(moves, Move(Location(x, y), rand(0:4))) 14 | end 15 | end 16 | end 17 | sendFrame(moves) 18 | end 19 | -------------------------------------------------------------------------------- /airesources/Julia/RandomBot.jl: -------------------------------------------------------------------------------- 1 | include("hlt.jl") 2 | include("networking.jl") 3 | 4 | myID, gameMap = getInit() 5 | sendInit("RandomJuliaBot") 6 | 7 | while true 8 | moves = Vector{Move}() 9 | gameMap = getFrame() 10 | for y in 0:gameMap.height-1 11 | for x in 0:gameMap.width-1 12 | if getSite(gameMap, Location(x, y)).owner == myID 13 | push!(moves, Move(Location(x, y), rand(0:4))) 14 | end 15 | end 16 | end 17 | sendFrame(moves) 18 | end 19 | -------------------------------------------------------------------------------- /airesources/Julia/runGame.bat: -------------------------------------------------------------------------------- 1 | .\halite.exe -d "30 30" "julia MyBot.jl" "julia RandomBot.jl" 2 | -------------------------------------------------------------------------------- /airesources/Julia/runGame.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ./halite -d "30 30" "julia MyBot.jl" "julia RandomBot.jl" 4 | -------------------------------------------------------------------------------- /airesources/OCaml/MyBot.ml: -------------------------------------------------------------------------------- 1 | (* OCaml Starter for Halite on Halite.io 2 | This code is public domain. There is no warranty. 3 | *) 4 | 5 | open Td;; 6 | 7 | let random_move state row col = 8 | let dir = Halite.direction_of_int (Random.int 5) in 9 | let loc = { 10 | row = row; 11 | col = col; 12 | } in 13 | { 14 | loc = loc; 15 | direction = dir; 16 | } 17 | ;; 18 | 19 | let random_moves state = 20 | let moves = ref [] in 21 | Array.iteri (fun ir row -> Array.iteri (fun ic site -> 22 | if site.owner = state.my_id then 23 | moves := (random_move state ir ic) :: !moves 24 | ) row) state.game_map.contents; 25 | !moves 26 | ;; 27 | 28 | let mybot_function state = 29 | begin try 30 | ( 31 | Halite.get_init state; 32 | Halite.send_init "MyOCamlBot"; 33 | while true do 34 | Halite.get_frame state; 35 | let moves = random_moves state in 36 | Halite.send_frame moves 37 | done 38 | ) 39 | with exc -> 40 | ( 41 | Debug.debug (Printf.sprintf 42 | "Exception in turn %d :\n" state.round); 43 | Debug.debug (Printexc.to_string exc); 44 | raise exc 45 | ) 46 | end; 47 | ;; 48 | 49 | let run_bot bot = 50 | let game_state = Halite.init () in 51 | bot game_state 52 | ;; 53 | 54 | run_bot mybot_function 55 | 56 | -------------------------------------------------------------------------------- /airesources/OCaml/README.md: -------------------------------------------------------------------------------- 1 | Halite OCaml Starter Package 2 | ---------------------------- 3 | 4 | This is an OCaml starter package for Halite on halite.io 5 | 6 | It uses lowercase letters and underscores for variable and function names (following the OCaml convention), but otherwise matches the API seen in other starter packages. 7 | 8 | -------------------------------------------------------------------------------- /airesources/OCaml/RandomBot.ml: -------------------------------------------------------------------------------- 1 | (* OCaml Starter for Halite on Halite.io 2 | This code is public domain. There is no warranty. 3 | *) 4 | 5 | open Td;; 6 | 7 | let random_move state row col = 8 | let dir = Halite.direction_of_int (Random.int 5) in 9 | let loc = { 10 | row = row; 11 | col = col; 12 | } in 13 | { 14 | loc = loc; 15 | direction = dir; 16 | } 17 | ;; 18 | 19 | let random_moves state = 20 | let moves = ref [] in 21 | Array.iteri (fun ir row -> Array.iteri (fun ic site -> 22 | if site.owner = state.my_id then 23 | moves := (random_move state ir ic) :: !moves 24 | ) row) state.game_map.contents; 25 | !moves 26 | ;; 27 | 28 | let mybot_function state = 29 | begin try 30 | ( 31 | Halite.get_init state; 32 | Halite.send_init "RandomOCamlBot"; 33 | while true do 34 | Halite.get_frame state; 35 | let moves = random_moves state in 36 | Halite.send_frame moves 37 | done 38 | ) 39 | with exc -> 40 | ( 41 | Debug.debug (Printf.sprintf 42 | "Exception in turn %d :\n" state.round); 43 | Debug.debug (Printexc.to_string exc); 44 | raise exc 45 | ) 46 | end; 47 | ;; 48 | 49 | let run_bot bot = 50 | let game_state = Halite.init () in 51 | bot game_state 52 | ;; 53 | 54 | run_bot mybot_function 55 | 56 | -------------------------------------------------------------------------------- /airesources/OCaml/debug.ml: -------------------------------------------------------------------------------- 1 | (* OCaml Starter for Halite on Halite.io 2 | This code is public domain. There is no warranty. 3 | *) 4 | 5 | let out_chan = open_out "mybot_err.log" ;; 6 | 7 | let debug s = 8 | output_string out_chan s; 9 | flush out_chan 10 | ;; 11 | 12 | let error s = 13 | output_string out_chan ("ERROR: " ^ s ^ "\n"); 14 | flush out_chan 15 | ;; 16 | 17 | (* Replace the functions above with these to silence all logging 18 | 19 | let out_chan = stdout;; 20 | 21 | let debug s = () ;; 22 | 23 | let error s = () ;; 24 | 25 | *) 26 | 27 | -------------------------------------------------------------------------------- /airesources/OCaml/runGame.bat: -------------------------------------------------------------------------------- 1 | ocamlbuild -lib unix MyBot.native 2 | ocamlbuild -lib unix RandomBot.native 3 | .\halite.exe -d "30 30" ".\MyBot.exe" ".\RandomBot.exe" 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /airesources/OCaml/runGame.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ocamlbuild -lib unix MyBot.native 4 | ocamlbuild -lib unix RandomBot.native 5 | ./halite -d "30 30" "./MyBot.native" "./RandomBot.native" 6 | -------------------------------------------------------------------------------- /airesources/OCaml/td.ml: -------------------------------------------------------------------------------- 1 | (* OCaml Starter for Halite on Halite.io 2 | This code is public domain. There is no warranty. 3 | *) 4 | 5 | type t_direction = [ `Still | `North | `East | `South | `West ] ;; 6 | 7 | type location = 8 | { 9 | mutable row : int; 10 | mutable col : int; 11 | } 12 | ;; 13 | 14 | type site = 15 | { 16 | mutable owner : int; 17 | mutable strength : int; 18 | mutable production : int; 19 | } 20 | ;; 21 | 22 | type move = 23 | { 24 | mutable loc : location; 25 | mutable direction : t_direction; 26 | } 27 | ;; 28 | 29 | type game_map = 30 | { 31 | mutable width : int; 32 | mutable height : int; 33 | mutable contents : site array array; 34 | } 35 | ;; 36 | 37 | type game_state = 38 | { 39 | mutable my_id : int; 40 | mutable round : int; 41 | mutable max_rounds : int; 42 | mutable last_update : float; 43 | mutable game_map : game_map; 44 | } 45 | ;; 46 | 47 | 48 | -------------------------------------------------------------------------------- /airesources/PHP/MyBot.php: -------------------------------------------------------------------------------- 1 | height; ++$y) { 13 | for ($x = 0; $x < $gameMap->width; ++$x) { 14 | if ($gameMap->getSite(new Location($x, $y))->owner === $myID) { 15 | $moves[] = new Move(new Location($x, $y), rand(0, 4)); 16 | } 17 | } 18 | } 19 | sendFrame($moves); 20 | } 21 | -------------------------------------------------------------------------------- /airesources/PHP/RandomBot.php: -------------------------------------------------------------------------------- 1 | height; ++$y) { 13 | for ($x = 0; $x < $gameMap->width; ++$x) { 14 | if ($gameMap->getSite(new Location($x, $y))->owner === $myID) { 15 | $moves[] = new Move(new Location($x, $y), rand(0, 4)); 16 | } 17 | } 18 | } 19 | sendFrame($moves); 20 | } 21 | -------------------------------------------------------------------------------- /airesources/PHP/runGame.bat: -------------------------------------------------------------------------------- 1 | .\halite.exe -d "30 30" "php MyBot.php" "php RandomBot.php" 2 | -------------------------------------------------------------------------------- /airesources/PHP/runGame.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ./halite -d "30 30" "php MyBot.php" "php RandomBot.php" 4 | -------------------------------------------------------------------------------- /airesources/Python/MyBot.py: -------------------------------------------------------------------------------- 1 | import hlt 2 | from hlt import NORTH, EAST, SOUTH, WEST, STILL, Move, Square 3 | import random 4 | 5 | 6 | myID, game_map = hlt.get_init() 7 | hlt.send_init("MyPythonBot") 8 | 9 | while True: 10 | game_map.get_frame() 11 | moves = [Move(square, random.choice((NORTH, EAST, SOUTH, WEST, STILL))) for square in game_map if square.owner == myID] 12 | hlt.send_frame(moves) 13 | -------------------------------------------------------------------------------- /airesources/Python/RandomBot.py: -------------------------------------------------------------------------------- 1 | import hlt 2 | from hlt import NORTH, EAST, SOUTH, WEST, STILL, Move, Square 3 | import random 4 | 5 | 6 | myID, game_map = hlt.get_init() 7 | hlt.send_init("RandomPythonBot") 8 | 9 | while True: 10 | game_map.get_frame() 11 | moves = [Move(square, random.choice((NORTH, EAST, SOUTH, WEST, STILL))) for square in game_map if square.owner == myID] 12 | hlt.send_frame(moves) 13 | -------------------------------------------------------------------------------- /airesources/Python/runGame.bat: -------------------------------------------------------------------------------- 1 | .\halite.exe -d "30 30" "python MyBot.py" "python RandomBot.py" 2 | -------------------------------------------------------------------------------- /airesources/Python/runGame.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if hash python3 2>/dev/null; then 4 | ./halite -d "30 30" "python3 MyBot.py" "python3 RandomBot.py" 5 | else 6 | ./halite -d "30 30" "python MyBot.py" "python RandomBot.py" 7 | fi 8 | -------------------------------------------------------------------------------- /airesources/Ruby/MyBot.rb: -------------------------------------------------------------------------------- 1 | $:.unshift(File.dirname(__FILE__)) 2 | require 'networking' 3 | 4 | network = Networking.new("RubyBot") 5 | tag, map = network.configure 6 | 7 | while true 8 | moves = [] 9 | map = network.frame 10 | 11 | (0...map.height).each do |y| 12 | (0...map.width).each do |x| 13 | loc = Location.new(x, y) 14 | site = map.site(loc) 15 | 16 | if site.owner == tag 17 | moves << Move.new(loc, GameMap::DIRECTIONS.shuffle.first) 18 | end 19 | end 20 | end 21 | 22 | network.send_moves(moves) 23 | end 24 | 25 | -------------------------------------------------------------------------------- /airesources/Ruby/RandomBot.rb: -------------------------------------------------------------------------------- 1 | $:.unshift(File.dirname(__FILE__)) 2 | require 'networking' 3 | 4 | network = Networking.new("RandomRubyBot") 5 | tag, map = network.configure 6 | 7 | while true 8 | moves = [] 9 | map = network.frame 10 | 11 | (0...map.height).each do |y| 12 | (0...map.width).each do |x| 13 | loc = Location.new(x, y) 14 | site = map.site(loc) 15 | 16 | if site.owner == tag 17 | moves << Move.new(loc, GameMap::DIRECTIONS.shuffle.first) 18 | end 19 | end 20 | end 21 | 22 | network.send_moves(moves) 23 | end 24 | 25 | -------------------------------------------------------------------------------- /airesources/Ruby/location.rb: -------------------------------------------------------------------------------- 1 | class Location 2 | 3 | attr_reader :x, :y 4 | 5 | def initialize(x, y) 6 | @x, @y = x, y 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /airesources/Ruby/move.rb: -------------------------------------------------------------------------------- 1 | class Move 2 | 3 | attr_reader :location, :direction 4 | 5 | def initialize(location, direction) 6 | @location = location 7 | @direction = GameMap::DIRECTIONS.index(direction) 8 | end 9 | 10 | def to_s 11 | [location.x, location.y, direction].join(' ') 12 | end 13 | 14 | end 15 | -------------------------------------------------------------------------------- /airesources/Ruby/runGame.bat: -------------------------------------------------------------------------------- 1 | .\halite.exe -d "30 30" "ruby MyBot.rb" "ruby RandomBot.rb" 2 | -------------------------------------------------------------------------------- /airesources/Ruby/runGame.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ./halite -d "30 30" "ruby MyBot.rb" "ruby RandomBot.rb" 4 | -------------------------------------------------------------------------------- /airesources/Ruby/site.rb: -------------------------------------------------------------------------------- 1 | class Site 2 | 3 | attr_reader :owner, :strength, :production 4 | 5 | def initialize(owner = 0, strength = 0, production = 0) 6 | @owner, @strength, @production = owner, strength, production 7 | end 8 | 9 | end 10 | -------------------------------------------------------------------------------- /airesources/Rust/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "Rust" 3 | version = "0.1.0" 4 | authors = ["Benjamin Spector "] 5 | 6 | publish = false 7 | vcs = "None" 8 | 9 | [dependencies] 10 | rand = "*" 11 | text_io = "*" 12 | 13 | [[bin]] 14 | path = "src/MyBot.rs" 15 | name = "MyBot" 16 | 17 | [[bin]] 18 | path = "src/RandomBot.rs" 19 | name = "RandomBot" 20 | -------------------------------------------------------------------------------- /airesources/Rust/runGame.bat: -------------------------------------------------------------------------------- 1 | cargo build 2 | .\halite.exe -d "30 30" "target/debug/MyBot" "target/debug/RandomBot" 3 | -------------------------------------------------------------------------------- /airesources/Rust/runGame.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cargo build 4 | ./halite -d "30 30" "target/debug/MyBot" "target/debug/RandomBot" 5 | -------------------------------------------------------------------------------- /airesources/Rust/src/hlt/mod.rs: -------------------------------------------------------------------------------- 1 | #![allow(warnings)] 2 | 3 | pub mod networking; 4 | pub mod types; 5 | -------------------------------------------------------------------------------- /airesources/Scala/Bot.scala: -------------------------------------------------------------------------------- 1 | trait Bot { 2 | def getMoves(grid: Grid): Iterable[Move] 3 | } 4 | 5 | trait BotFactory { 6 | def make(id: Int): Bot 7 | } 8 | 9 | -------------------------------------------------------------------------------- /airesources/Scala/Direction.scala: -------------------------------------------------------------------------------- 1 | import scala.util.Random 2 | 3 | object Direction { 4 | private val random = new Random() 5 | val CARDINALS = Seq(North, East, South, West) 6 | val ALL = Seq(Still, North, East, South, West) 7 | 8 | def getRandomDir: Direction = ALL(random.nextInt(5)) 9 | def getRandomCard: Direction = CARDINALS(random.nextInt(4)) 10 | } 11 | 12 | class Direction(value: Int) { 13 | def getValue = value 14 | } 15 | 16 | case object Still extends Direction(0) 17 | case object North extends Direction(1) 18 | case object East extends Direction(2) 19 | case object South extends Direction(3) 20 | case object West extends Direction(4) 21 | -------------------------------------------------------------------------------- /airesources/Scala/Move.scala: -------------------------------------------------------------------------------- 1 | case class Move(location: Location, direction: Direction) -------------------------------------------------------------------------------- /airesources/Scala/MyBot.scala: -------------------------------------------------------------------------------- 1 | object MyBot extends BotFactory { 2 | def main(args: Array[String]): Unit = { 3 | Runner.run("scalaMyBot", this) 4 | } 5 | 6 | override def make(id: Int): Bot = new MyBot(id) 7 | } 8 | 9 | class MyBot(myId: Int) extends Bot { 10 | override def getMoves(grid: Grid): Iterable[Move] = { 11 | for { 12 | site <- grid.getMine(myId) 13 | } yield Move(site.location, Direction.getRandomDir) 14 | } 15 | } -------------------------------------------------------------------------------- /airesources/Scala/RandomBot.scala: -------------------------------------------------------------------------------- 1 | object RandomBot extends BotFactory { 2 | def main(args: Array[String]): Unit = { 3 | Runner.run("scalaRandom", this) 4 | } 5 | 6 | override def make(id: Int): Bot = new RandomBot(id) 7 | } 8 | 9 | class RandomBot(myId: Int) extends Bot { 10 | override def getMoves(grid: Grid): Iterable[Move] = { 11 | for { 12 | site <- grid.getMine(myId) 13 | } yield Move(site.location, Direction.getRandomDir) 14 | } 15 | } -------------------------------------------------------------------------------- /airesources/Scala/Runner.scala: -------------------------------------------------------------------------------- 1 | object Runner { 2 | def run(name: String, botFactory: BotFactory): Unit = { 3 | val id = Env.readId() 4 | val grid = Env.readInit() 5 | 6 | val bot = botFactory.make(id) 7 | Env.writeInit(name) 8 | 9 | while (true) { 10 | val occupants = Env.readFrame(grid.getWidth, grid.getHeight) 11 | grid.update(occupants) 12 | val moves = bot.getMoves(grid) 13 | Env.writeFrame(moves) 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /airesources/Scala/runGame.bat: -------------------------------------------------------------------------------- 1 | javac *.java 2 | scalac HaliteBot.scala 3 | scalac MyBot.scala 4 | scalac RandomBot.scala 5 | 6 | \halite.exe -d "30 30" "scala MyBot" "scala RandomBot" 7 | -------------------------------------------------------------------------------- /airesources/Scala/runGame.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | scalac *.scala 4 | 5 | ./halite -d "30 30" "scala MyBot" "scala RandomBot" 6 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | # Specify version format 2 | version: "{build}" 3 | 4 | only_commits: 5 | message: /build/ 6 | 7 | # Build worker image (VM template) 8 | image: Windows Server 2012 R2 9 | 10 | # clone directory 11 | clone_folder: C:\Halite 12 | 13 | # branches to build 14 | branches: 15 | only: 16 | - master 17 | 18 | #before_build: 19 | # - dir \s 20 | 21 | # scripts that run after cloning repository 22 | build_script: 23 | - cd C:\Halite\environment 24 | - .\make.bat 25 | 26 | artifacts: 27 | - path: environment\halite.exe 28 | name: halite.exe 29 | -------------------------------------------------------------------------------- /environment/Makefile: -------------------------------------------------------------------------------- 1 | CXXFLAGS += -std=c++11 -pthread -I ./ 2 | INSTALL_PATH?=/usr/local 3 | SOURCES=$(shell find . -name "*.cpp") 4 | OBJECTS=$(SOURCES:%.cpp=%.o) 5 | TARGET=halite 6 | 7 | .PHONY: all 8 | all: $(TARGET) 9 | 10 | $(TARGET): $(OBJECTS) 11 | $(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@ 12 | 13 | .PHONY: clean 14 | clean: 15 | rm -f $(TARGET) $(OBJECTS) 16 | 17 | .PHONY: install 18 | install: 19 | install -m 0755 halite $(INSTALL_PATH)/bin 20 | -------------------------------------------------------------------------------- /environment/install.sh: -------------------------------------------------------------------------------- 1 | # Install Halite environment 2 | curl "https://halite.io/downloads/environment/HaliteEnvironment-Source.zip" -o "HaliteEnvironment-Source.zip" 3 | mkdir HaliteEnvironment-Source 4 | unzip HaliteEnvironment-Source.zip -d HaliteEnvironment-Source 5 | rm HaliteEnvironment-Source.zip 6 | cd HaliteEnvironment-Source 7 | make 8 | mv halite ../ 9 | cd ../ 10 | rm -r HaliteEnvironment-Source 11 | -------------------------------------------------------------------------------- /environment/make.bat: -------------------------------------------------------------------------------- 1 | SET PATH=C:\Program Files (x86)\MSBuild\14.0\Bin;%PATH% 2 | CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 3 | cd environment 4 | cl.exe /O2 /MT /EHsc main.cpp core/Halite.cpp /I . networking/Networking.cpp /link /out:halite.exe 5 | -------------------------------------------------------------------------------- /environment/tclap/Makefile.am: -------------------------------------------------------------------------------- 1 | 2 | libtclapincludedir = $(includedir)/tclap 3 | 4 | libtclapinclude_HEADERS = \ 5 | CmdLineInterface.h \ 6 | ArgException.h \ 7 | CmdLine.h \ 8 | XorHandler.h \ 9 | MultiArg.h \ 10 | UnlabeledMultiArg.h \ 11 | ValueArg.h \ 12 | UnlabeledValueArg.h \ 13 | Visitor.h Arg.h \ 14 | HelpVisitor.h \ 15 | SwitchArg.h \ 16 | MultiSwitchArg.h \ 17 | VersionVisitor.h \ 18 | IgnoreRestVisitor.h \ 19 | CmdLineOutput.h \ 20 | StdOutput.h \ 21 | DocBookOutput.h \ 22 | ZshCompletionOutput.h \ 23 | OptionalUnlabeledTracker.h \ 24 | Constraint.h \ 25 | ValuesConstraint.h \ 26 | ArgTraits.h \ 27 | StandardTraits.h 28 | 29 | -------------------------------------------------------------------------------- /tests/environment/Fail10Bot.py: -------------------------------------------------------------------------------- 1 | from hlt import * 2 | from networking import * 3 | 4 | # Fails on turn 10. 5 | 6 | myID, gameMap = getInit() 7 | sendInit("Fail10Bot") 8 | 9 | turn = 1 10 | hasMultipleSquares = False; 11 | while True: 12 | moves = [] 13 | gameMap = getFrame() 14 | if turn == 10: 15 | break 16 | sendFrame(moves) 17 | turn += 1 -------------------------------------------------------------------------------- /tests/environment/FailInitBot.py: -------------------------------------------------------------------------------- 1 | from hlt import * 2 | from networking import * 3 | 4 | # Exits during initialization. 5 | 6 | myID, gameMap = getInit() -------------------------------------------------------------------------------- /tests/environment/ModBot.py: -------------------------------------------------------------------------------- 1 | from hlt import * 2 | from networking import * 3 | 4 | myID, gameMap = getInit() 5 | sendInit("ModBot") 6 | 7 | turn = 1 8 | while True: 9 | moves = [] 10 | gameMap = getFrame() 11 | 12 | for y in range(gameMap.height): 13 | for x in range(gameMap.width): 14 | site = gameMap.getSite(Location(x, y)) 15 | if site.owner == myID: 16 | direction = -1; 17 | if site.strength < 5* site.production: 18 | direction = STILL 19 | else: 20 | for d in CARDINALS: 21 | if gameMap.getSite(Location(x, y), d).owner != myID: 22 | direction = d 23 | break 24 | if direction == -1: 25 | if turn % 4 < 2: 26 | direction = NORTH if x % 2 == 1 else SOUTH 27 | else: 28 | direction = EAST if y % 2 == 1 else WEST 29 | moves.append(Move(Location(x, y), direction)) 30 | 31 | sendFrame(moves) 32 | turn += 1 -------------------------------------------------------------------------------- /tests/environment/Timeout10Bot.py: -------------------------------------------------------------------------------- 1 | from hlt import * 2 | from networking import * 3 | 4 | # Times out on turn 10. 5 | 6 | myID, gameMap = getInit() 7 | sendInit("Timeout10Bot") 8 | 9 | turn = 1 10 | hasMultipleSquares = False; 11 | while True: 12 | moves = [] 13 | gameMap = getFrame() 14 | if turn == 10: 15 | while(True): 16 | pass 17 | sendFrame(moves) 18 | turn += 1 19 | -------------------------------------------------------------------------------- /tests/environment/TimeoutInitBot.py: -------------------------------------------------------------------------------- 1 | from hlt import * 2 | from networking import * 3 | 4 | # Times out during initialization. 5 | 6 | myID, gameMap = getInit() 7 | 8 | while True: 9 | pass -------------------------------------------------------------------------------- /tests/install.sh: -------------------------------------------------------------------------------- 1 | add-apt-repository -y ppa:ubuntu-toolchain-r/test 2 | apt-get update 3 | 4 | # Python 5 | apt-get install -y python3 6 | 7 | # Java 8 | apt-get install -y openjdk-8-jdk libjansi-java 9 | 10 | # Rust 11 | curl -sSf https://static.rust-lang.org/rustup.sh | sh 12 | 13 | # C++ 14 | apt-get install -y g++-4.9 15 | 16 | # Scala 17 | wget www.scala-lang.org/files/archive/scala-2.10.4.deb 18 | dpkg -i scala-2.10.4.deb 19 | apt-get update -y 20 | apt-get install -y scala 21 | wget https://bintray.com/artifact/download/sbt/debian/sbt-0.13.6.deb 22 | dpkg -i sbt-0.13.6.deb 23 | apt-get update -y 24 | apt-get install -y sbt 25 | 26 | # Php unit 27 | wget https://phar.phpunit.de/phpunit-5.7.phar 28 | chmod +x phpunit-5.7.phar 29 | mv phpunit-5.7.phar /usr/local/bin/phpunit 30 | 31 | 32 | php -v 33 | mysql -V 34 | phpunit --version 35 | 36 | update-alternatives --set java $(update-alternatives --list java | grep java-8-openjdk) 37 | update-alternatives --set javac $(update-alternatives --list javac | grep java-8-openjdk) 38 | update-alternatives --display java 39 | update-alternatives --display javac 40 | java -version 41 | javac -version 42 | -------------------------------------------------------------------------------- /tests/runTests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | function finish { 5 | echo "Cleaning up" 6 | cd $WORKINGDIR 7 | if [ -e ../temp.ini ] 8 | then cp temp.ini ../halite.ini; 9 | fi 10 | } 11 | trap finish EXIT 12 | 13 | echo "Setting up" 14 | WORKINGDIR=$PWD 15 | if [ -e ../halite.ini ] 16 | then cp ../halite.ini temp.ini; 17 | fi 18 | cp tests.ini ../halite.ini 19 | python3 setupMysql.py || python setupMysql.py 20 | 21 | echo "Website tests" 22 | phpunit --stderr website/ 23 | 24 | echo "Worker tests" 25 | cd worker 26 | python3 testWorker.py 27 | 28 | echo "Environment tests" 29 | cd ../environment 30 | python3 testenv.py 31 | -------------------------------------------------------------------------------- /tests/scalabilityTests/BasicJavaBot.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/tests/scalabilityTests/BasicJavaBot.zip -------------------------------------------------------------------------------- /tests/setupMysql.py: -------------------------------------------------------------------------------- 1 | import configparser 2 | import os 3 | 4 | parser = configparser.ConfigParser() 5 | parser.read("../halite.ini") 6 | 7 | passwordField = "" if parser["database"]["password"] == "" else "-p"+parser["database"]["password"] 8 | os.system("mysql -u "+parser["database"]["username"]+" "+passwordField+" < ../website/sql/schema.sql") 9 | -------------------------------------------------------------------------------- /tests/travisTests.ini: -------------------------------------------------------------------------------- 1 | [test] 2 | isTest = 1 3 | 4 | [hce] 5 | managerURl = http://localhost/manager/ 6 | apiKey = 1234 7 | secretFolder = wrongFolder 8 | 9 | [email] 10 | email = halite@halite.io 11 | password = wrongPassword 12 | 13 | [database] 14 | hostname = 127.0.0.1 15 | username = root 16 | password = 17 | name = Halite 18 | 19 | [sso] 20 | secret = wrongSecret 21 | url = http://forums.halite.io/session/sso_login 22 | 23 | [forums] 24 | apiUsername = wrongUser 25 | apiKey = 123456789 26 | 27 | [encrypt] 28 | salt = wrongSalt 29 | -------------------------------------------------------------------------------- /tests/website/HistoryTest.php: -------------------------------------------------------------------------------- 1 | "123", "lastNumGames" => "100", "lastNumPlayers" => "20", "versionNumber" => "1", "lastRank" => "2"); 8 | class HistoryTest extends APITest { 9 | public function testGET() { 10 | $this->insertObject(HISTORY_TABLE, TEST_USER_HISTORY); 11 | 12 | $_GET['userID'] = TEST_USER_HISTORY['userID']; 13 | $_SERVER['REQUEST_METHOD'] = "POST"; 14 | 15 | $returnedHistory = json_decode((new WebsiteAPI("history"))->processAPI(), true)[0]; 16 | 17 | $this->assertArraySubset(TEST_USER_HISTORY, $returnedHistory); 18 | } 19 | } 20 | ?> 21 | -------------------------------------------------------------------------------- /tests/website/testFile.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/tests/website/testFile.txt -------------------------------------------------------------------------------- /tests/worker/languageBot/LANGUAGE: -------------------------------------------------------------------------------- 1 | TestLanguage 2 | -------------------------------------------------------------------------------- /tests/worker/languageBot/MyBot.py: -------------------------------------------------------------------------------- 1 | ../../../airesources/Python/MyBot.py -------------------------------------------------------------------------------- /tests/worker/languageBot/hlt.py: -------------------------------------------------------------------------------- 1 | ../../../airesources/Python/hlt.py -------------------------------------------------------------------------------- /tests/worker/languageBot/networking.py: -------------------------------------------------------------------------------- 1 | ../../../airesources/Python/networking.py -------------------------------------------------------------------------------- /tests/worker/languageBot/run.sh: -------------------------------------------------------------------------------- 1 | #Python 2 | python3 MyBot.py 3 | -------------------------------------------------------------------------------- /tests/worker/loseBot/MyBot.py: -------------------------------------------------------------------------------- 1 | import hlt 2 | from hlt import NORTH, EAST, SOUTH, WEST, STILL, Move, Square 3 | import random 4 | 5 | 6 | myID, game_map = hlt.get_init() 7 | hlt.send_init("MyPythonBot") 8 | 9 | while True: 10 | game_map.get_frame() 11 | moves = [Move(square, random.choice((NORTH, EAST, SOUTH, WEST, STILL))) for square in game_map if square.owner == myID] 12 | hlt.send_frame(moves) 13 | -------------------------------------------------------------------------------- /tests/worker/loseBot/hlt.py: -------------------------------------------------------------------------------- 1 | ../../../airesources/Python/hlt.py -------------------------------------------------------------------------------- /tests/worker/loseBot/run.sh: -------------------------------------------------------------------------------- 1 | python3 MyBot.py 2 | -------------------------------------------------------------------------------- /tests/worker/winBot/MyBot.py: -------------------------------------------------------------------------------- 1 | import hlt 2 | from hlt import NORTH, EAST, SOUTH, WEST, STILL, Move, Square 3 | import random 4 | 5 | 6 | myID, game_map = hlt.get_init() 7 | hlt.send_init("PythonBot") 8 | 9 | def assign_move(square): 10 | for direction, neighbor in enumerate(game_map.neighbors(square)): 11 | if neighbor.owner != myID and neighbor.strength < square.strength: 12 | return Move(square, direction) 13 | 14 | if square.strength < 5 * square.production: 15 | return Move(square, STILL) 16 | else: 17 | return Move(square, random.choice((WEST, NORTH))) 18 | 19 | 20 | while True: 21 | game_map.get_frame() 22 | moves = [assign_move(square) for square in game_map if square.owner == myID] 23 | hlt.send_frame(moves) 24 | -------------------------------------------------------------------------------- /tests/worker/winBot/hlt.py: -------------------------------------------------------------------------------- 1 | ../../../airesources/Python/hlt.py -------------------------------------------------------------------------------- /tests/worker/winBot/run.sh: -------------------------------------------------------------------------------- 1 | python3 MyBot.py 2 | -------------------------------------------------------------------------------- /visualizer/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | end_of_line = lf 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = true 9 | 10 | [package.json] 11 | indent_style = space 12 | indent_size = 2 13 | -------------------------------------------------------------------------------- /visualizer/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /visualizer/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- 1 | ../../website/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /visualizer/fonts/glyphicons-halflings-regular.svg: -------------------------------------------------------------------------------- 1 | ../../website/fonts/glyphicons-halflings-regular.svg -------------------------------------------------------------------------------- /visualizer/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- 1 | ../../website/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /visualizer/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- 1 | ../../website/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /visualizer/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- 1 | ../../website/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /visualizer/lib/bootstrap.min.css: -------------------------------------------------------------------------------- 1 | ../../website/lib/bootstrap.min.css -------------------------------------------------------------------------------- /visualizer/lib/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | ../../website/lib/bootstrap.min.js -------------------------------------------------------------------------------- /visualizer/lib/jquery.min.js: -------------------------------------------------------------------------------- 1 | ../../website/lib/jquery.min.js -------------------------------------------------------------------------------- /visualizer/lib/lodash.min.js: -------------------------------------------------------------------------------- 1 | ../../website/lib/lodash.min.js -------------------------------------------------------------------------------- /visualizer/lib/pixi.min.js: -------------------------------------------------------------------------------- 1 | ../../website/lib/pixi.min.js -------------------------------------------------------------------------------- /visualizer/lib/seedrandom.min.js: -------------------------------------------------------------------------------- 1 | ../../website/lib/seedrandom.min.js -------------------------------------------------------------------------------- /visualizer/lib/xss.js: -------------------------------------------------------------------------------- 1 | ../../website/lib/xss.js -------------------------------------------------------------------------------- /visualizer/main.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | const electron = require('electron'); 3 | const fs = require('fs'); 4 | 5 | const app = electron.app; 6 | 7 | // adds debug features like hotkeys for triggering dev tools and reload 8 | // require('electron-debug')(); 9 | 10 | // prevent window being garbage collected 11 | let mainWindow; 12 | 13 | function onClosed() { 14 | // dereference the window 15 | // for multiple windows store them in an array 16 | mainWindow = null; 17 | } 18 | 19 | function createMainWindow() { 20 | const win = new electron.BrowserWindow({ 21 | width: 1200, 22 | height: 800 23 | }); 24 | 25 | win.loadURL(`file://${__dirname}/index.html`); 26 | win.on('closed', onClosed); 27 | 28 | return win; 29 | } 30 | 31 | app.on('window-all-closed', () => { 32 | if (process.platform !== 'darwin') { 33 | app.quit(); 34 | } 35 | }); 36 | 37 | app.on('activate', () => { 38 | if (!mainWindow) { 39 | mainWindow = createMainWindow(); 40 | } 41 | }); 42 | 43 | app.on('ready', () => { 44 | mainWindow = createMainWindow(); 45 | }); 46 | -------------------------------------------------------------------------------- /visualizer/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "hailte-visualizer", 3 | "main": "main.js", 4 | "productName": "Halite-Visualizer", 5 | "version": "1.0.0", 6 | "description": "", 7 | "license": "MIT", 8 | "repository": "https://github.com/HaliteChallenge/Halite", 9 | "author": { 10 | "name": "Henry Wildermuth", 11 | "email": "hmwildermuth@gmail.com", 12 | "url": "https://github.com/FlyingGraysons" 13 | }, 14 | "scripts": { 15 | "test": "xo", 16 | "start": "electron .", 17 | "build": "mkdir -p downloads/ && cd downloads/ && electron-packager ../ --all --overwrite && for i in */; do zip -r \"${i%/}.zip\" \"$i\"; done" 18 | }, 19 | "files": [ 20 | "main.js", 21 | "index.html", 22 | "./style/", 23 | "./script/", 24 | "./lib/" 25 | ], 26 | "keywords": [ 27 | "electron-app", 28 | "electron", 29 | "halite" 30 | ], 31 | "dependencies": { 32 | "electron-debug": "^1.0.0" 33 | }, 34 | "devDependencies": { 35 | "devtron": "^1.1.0", 36 | "electron": "^1.0.1", 37 | "electron-packager": "^8.2.0", 38 | "xo": "^0.16.0" 39 | }, 40 | "xo": { 41 | "esnext": true, 42 | "envs": [ 43 | "node", 44 | "browser" 45 | ] 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /visualizer/script/parsereplay.js: -------------------------------------------------------------------------------- 1 | ../../website/script/parsereplay.js -------------------------------------------------------------------------------- /visualizer/script/visualizer.js: -------------------------------------------------------------------------------- 1 | ../../website/script/visualizer.js -------------------------------------------------------------------------------- /visualizer/style/general.css: -------------------------------------------------------------------------------- 1 | ../../website/style/general.css -------------------------------------------------------------------------------- /website/.htaccess: -------------------------------------------------------------------------------- 1 | AddOutputFilterByType DEFLATE text/plain 2 | AddOutputFilterByType DEFLATE text/html 3 | AddOutputFilterByType DEFLATE text/xml 4 | AddOutputFilterByType DEFLATE text/css 5 | AddOutputFilterByType DEFLATE application/xml 6 | AddOutputFilterByType DEFLATE application/xhtml+xml 7 | AddOutputFilterByType DEFLATE application/rss+xml 8 | AddOutputFilterByType DEFLATE application/javascript 9 | AddOutputFilterByType DEFLATE application/x-javascript 10 | 11 | ErrorDocument 404 /404.php 12 | 13 | 14 | 15 | ExpiresActive on 16 | ExpiresDefault "access plus 2 days" 17 | 18 | 19 | -------------------------------------------------------------------------------- /website/404.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 404 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 |
16 |
17 |
18 |

404 Error

19 |

You might want to head back to the homepage.

20 |

The page you were looking for doesn't exist. If you think that there's a problem with our site, please email us at halite@halite.io or post on the forums.

21 |
22 |
23 |
24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /website/api/manager/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | RewriteEngine On 3 | RewriteCond %{REQUEST_FILENAME} !-f 4 | RewriteCond %{REQUEST_FILENAME} !-d 5 | RewriteRule (.*)$ api.php?request=$1 [QSA,NC,L] 6 | 7 | -------------------------------------------------------------------------------- /website/api/manager/api.php: -------------------------------------------------------------------------------- 1 | processAPI(); 13 | } catch (Exception $e) { 14 | echo json_encode(Array('error' => $e->getMessage())); 15 | } 16 | 17 | ?> 18 | -------------------------------------------------------------------------------- /website/api/manager/trueskillMatchQuality.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import trueskill 3 | 4 | sys.argv.pop(0) 5 | 6 | teams = [[trueskill.Rating(mu=float(sys.argv[a]), sigma=float(sys.argv[a+1]))] for a in range(0, len(sys.argv), 2)] 7 | print(trueskill.TrueSkill().quality(teams)) 8 | -------------------------------------------------------------------------------- /website/api/manager/updateTrueskill.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import trueskill 3 | 4 | sys.argv.pop(0) 5 | 6 | teams = [[trueskill.Rating(mu=float(sys.argv[a]), sigma=float(sys.argv[a+1]))] for a in range(0, len(sys.argv), 2)] 7 | 8 | newRatings = trueskill.rate(teams) 9 | for rating in newRatings: 10 | print(str(rating[0].mu) + " " + str(rating[0].sigma)) 11 | -------------------------------------------------------------------------------- /website/api/web/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | RewriteEngine On 3 | RewriteCond %{REQUEST_FILENAME} !-f 4 | RewriteCond %{REQUEST_FILENAME} !-d 5 | RewriteRule (.*)$ api.php?request=$1 [QSA,NC,L] 6 | 7 | -------------------------------------------------------------------------------- /website/api/web/api.php: -------------------------------------------------------------------------------- 1 | processAPI(); 13 | } catch (Exception $e) { 14 | echo json_encode(Array('error' => $e->getMessage())); 15 | } 16 | 17 | ?> 18 | -------------------------------------------------------------------------------- /website/archiveEnvironment.sh: -------------------------------------------------------------------------------- 1 | cd ../environment 2 | zip -r HaliteEnvironment-Source * 3 | mkdir ../website/downloads/environment 4 | mv HaliteEnvironment-Source.zip ../website/downloads/environment/ 5 | -------------------------------------------------------------------------------- /website/assets/amino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/amino.png -------------------------------------------------------------------------------- /website/assets/combination.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/combination.png -------------------------------------------------------------------------------- /website/assets/cornell_tech.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/cornell_tech.png -------------------------------------------------------------------------------- /website/assets/example_vis.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/example_vis.png -------------------------------------------------------------------------------- /website/assets/favicons/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/favicons/android-chrome-192x192.png -------------------------------------------------------------------------------- /website/assets/favicons/android-chrome-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/favicons/android-chrome-512x512.png -------------------------------------------------------------------------------- /website/assets/favicons/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/favicons/apple-touch-icon.png -------------------------------------------------------------------------------- /website/assets/favicons/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | #002226 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /website/assets/favicons/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/favicons/favicon-16x16.png -------------------------------------------------------------------------------- /website/assets/favicons/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/favicons/favicon-32x32.png -------------------------------------------------------------------------------- /website/assets/favicons/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/favicons/favicon.ico -------------------------------------------------------------------------------- /website/assets/favicons/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Halite", 3 | "icons": [ 4 | { 5 | "src": "\/android-chrome-192x192.png", 6 | "sizes": "192x192", 7 | "type": "image\/png" 8 | }, 9 | { 10 | "src": "\/android-chrome-512x512.png", 11 | "sizes": "512x512", 12 | "type": "image\/png" 13 | } 14 | ], 15 | "theme_color": "#002226", 16 | "display": "standalone" 17 | } 18 | -------------------------------------------------------------------------------- /website/assets/favicons/mstile-144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/favicons/mstile-144x144.png -------------------------------------------------------------------------------- /website/assets/favicons/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/favicons/mstile-150x150.png -------------------------------------------------------------------------------- /website/assets/favicons/mstile-310x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/favicons/mstile-310x150.png -------------------------------------------------------------------------------- /website/assets/favicons/mstile-310x310.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/favicons/mstile-310x310.png -------------------------------------------------------------------------------- /website/assets/favicons/mstile-70x70.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/favicons/mstile-70x70.png -------------------------------------------------------------------------------- /website/assets/full_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/full_logo.png -------------------------------------------------------------------------------- /website/assets/hero.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/hero.png -------------------------------------------------------------------------------- /website/assets/overkill-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/overkill-1.png -------------------------------------------------------------------------------- /website/assets/overkill-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/overkill-2.png -------------------------------------------------------------------------------- /website/assets/two_sigma.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/two_sigma.png -------------------------------------------------------------------------------- /website/assets/vettery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/vettery.png -------------------------------------------------------------------------------- /website/assets/vis/dl_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/vis/dl_arrow.png -------------------------------------------------------------------------------- /website/assets/vis/dr_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/vis/dr_arrow.png -------------------------------------------------------------------------------- /website/assets/vis/l_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/vis/l_arrow.png -------------------------------------------------------------------------------- /website/assets/vis/pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/vis/pause.png -------------------------------------------------------------------------------- /website/assets/vis/play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/vis/play.png -------------------------------------------------------------------------------- /website/assets/vis/q_mark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/vis/q_mark.png -------------------------------------------------------------------------------- /website/assets/vis/r_arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/assets/vis/r_arrow.png -------------------------------------------------------------------------------- /website/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "lusitanian/oauth": "~0.3", 4 | "swiftmailer/swiftmailer": "^5.4.3", 5 | "aws/aws-sdk-php": "^3.19" 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /website/cron/backupDatabase: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TIMESTAMP=$(date +%s) 4 | mysqldump -u root Halite > "/etc/cron.hourly/dump/"$TIMESTAMP"_dump.sql" 5 | rsync -azvP /etc/cron.hourly/dump/* root@192.241.158.114:/backup/db 6 | -------------------------------------------------------------------------------- /website/cron/backupWebsite: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | rsync -azvP /root/Halite/storage/bots/* root@192.241.158.114:/backup/web/storage/bots/ 4 | rsync -azvP /root/Halite/halite.ini root@192.241.158.114:/backup/web/ 5 | -------------------------------------------------------------------------------- /website/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/favicon.ico -------------------------------------------------------------------------------- /website/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /website/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /website/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /website/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /website/includes/dropdowns.php: -------------------------------------------------------------------------------- 1 |
  • 2 | Learn 3 |
  • 4 |
  • 5 | Download 6 |
  • 7 |
  • 8 | Rankings 9 |
  • 10 |
  • 11 | Visualize 12 |
  • 13 |
  • 14 | Forums 15 |
  • 16 |
  • 17 | About 18 |
  • -------------------------------------------------------------------------------- /website/includes/footer.php: -------------------------------------------------------------------------------- 1 | 2 | 3 |
    4 |
    5 | Terms of Service 6 | | 7 | Privacy Policy 8 |
    -------------------------------------------------------------------------------- /website/includes/header.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /website/includes/leaderTable.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
    UserTierLanguageLevelOrganizationPoints
    16 | -------------------------------------------------------------------------------- /website/includes/login_form.php: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | 4 | 5 |
    6 |
    7 | 8 | 9 |
    10 |
    11 | 12 |
    13 |
    14 | -------------------------------------------------------------------------------- /website/includes/register_form.php: -------------------------------------------------------------------------------- 1 |
    2 |
    3 | 4 | 5 |
    6 |
    7 | 8 | 9 |
    10 |
    11 | 12 | 13 |
    14 |
    15 | 16 | 17 |
    18 |
    19 | 20 |
    21 |
    22 | -------------------------------------------------------------------------------- /website/install.sh: -------------------------------------------------------------------------------- 1 | LC_ALL=C.UTF-8 add-apt-repository -y ppa:ondrej/php 2 | apt-get update 3 | 4 | apt-get install -y php5.6 php5.6-mysql apache2 5 | a2enmod rewrite expires 6 | 7 | apt-get install -y python3 python3-pip 8 | 9 | pip3 install trueskill boto paramiko pymysql 10 | 11 | apt-get install -y zip 12 | 13 | curl -sS https://getcomposer.org/installer | php 14 | mv composer.phar /usr/local/bin/composer 15 | composer install 16 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | 13 | > li { 14 | display: inline-block; 15 | 16 | + li:before { 17 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 18 | padding: 0 5px; 19 | color: @breadcrumb-color; 20 | } 21 | } 22 | 23 | > .active { 24 | color: @breadcrumb-active-color; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile 27 | button& { 28 | padding: 0; 29 | cursor: pointer; 30 | background: transparent; 31 | border: 0; 32 | -webkit-appearance: none; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | 21 | &.in { display: block; } 22 | tr&.in { display: table-row; } 23 | tbody&.in { display: table-row-group; } 24 | } 25 | 26 | .collapsing { 27 | position: relative; 28 | height: 0; 29 | overflow: hidden; 30 | .transition-property(~"height, visibility"); 31 | .transition-duration(.35s); 32 | .transition-timing-function(ease); 33 | } 34 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/media.less: -------------------------------------------------------------------------------- 1 | .media { 2 | // Proper spacing between instances of .media 3 | margin-top: 15px; 4 | 5 | &:first-child { 6 | margin-top: 0; 7 | } 8 | } 9 | 10 | .media, 11 | .media-body { 12 | zoom: 1; 13 | overflow: hidden; 14 | } 15 | 16 | .media-body { 17 | width: 10000px; 18 | } 19 | 20 | .media-object { 21 | display: block; 22 | 23 | // Fix collapse in webkit from max-width: 100% and display: table-cell. 24 | &.img-thumbnail { 25 | max-width: none; 26 | } 27 | } 28 | 29 | .media-right, 30 | .media > .pull-right { 31 | padding-left: 10px; 32 | } 33 | 34 | .media-left, 35 | .media > .pull-left { 36 | padding-right: 10px; 37 | } 38 | 39 | .media-left, 40 | .media-right, 41 | .media-body { 42 | display: table-cell; 43 | vertical-align: top; 44 | } 45 | 46 | .media-middle { 47 | vertical-align: middle; 48 | } 49 | 50 | .media-bottom { 51 | vertical-align: bottom; 52 | } 53 | 54 | // Reset margins on headings for tighter default spacing 55 | .media-heading { 56 | margin-top: 0; 57 | margin-bottom: 5px; 58 | } 59 | 60 | // Media list variation 61 | // 62 | // Undo default ul/ol styles 63 | .media-list { 64 | padding-left: 0; 65 | list-style: none; 66 | } 67 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------------------------------- 3 | 4 | // Utilities 5 | @import "mixins/hide-text.less"; 6 | @import "mixins/opacity.less"; 7 | @import "mixins/image.less"; 8 | @import "mixins/labels.less"; 9 | @import "mixins/reset-filter.less"; 10 | @import "mixins/resize.less"; 11 | @import "mixins/responsive-visibility.less"; 12 | @import "mixins/size.less"; 13 | @import "mixins/tab-focus.less"; 14 | @import "mixins/reset-text.less"; 15 | @import "mixins/text-emphasis.less"; 16 | @import "mixins/text-overflow.less"; 17 | @import "mixins/vendor-prefixes.less"; 18 | 19 | // Components 20 | @import "mixins/alerts.less"; 21 | @import "mixins/buttons.less"; 22 | @import "mixins/panels.less"; 23 | @import "mixins/pagination.less"; 24 | @import "mixins/list-group.less"; 25 | @import "mixins/nav-divider.less"; 26 | @import "mixins/forms.less"; 27 | @import "mixins/progress-bar.less"; 28 | @import "mixins/table-row.less"; 29 | 30 | // Skins 31 | @import "mixins/background-variant.less"; 32 | @import "mixins/border-radius.less"; 33 | @import "mixins/gradients.less"; 34 | 35 | // Layout 36 | @import "mixins/clearfix.less"; 37 | @import "mixins/center-block.less"; 38 | @import "mixins/nav-vertical-align.less"; 39 | @import "mixins/grid-framework.less"; 40 | @import "mixins/grid.less"; 41 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/alerts.less: -------------------------------------------------------------------------------- 1 | // Alerts 2 | 3 | .alert-variant(@background; @border; @text-color) { 4 | background-color: @background; 5 | border-color: @border; 6 | color: @text-color; 7 | 8 | hr { 9 | border-top-color: darken(@border, 5%); 10 | } 11 | .alert-link { 12 | color: darken(@text-color, 10%); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/background-variant.less: -------------------------------------------------------------------------------- 1 | // Contextual backgrounds 2 | 3 | .bg-variant(@color) { 4 | background-color: @color; 5 | a&:hover, 6 | a&:focus { 7 | background-color: darken(@color, 10%); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/border-radius.less: -------------------------------------------------------------------------------- 1 | // Single side border-radius 2 | 3 | .border-top-radius(@radius) { 4 | border-top-right-radius: @radius; 5 | border-top-left-radius: @radius; 6 | } 7 | .border-right-radius(@radius) { 8 | border-bottom-right-radius: @radius; 9 | border-top-right-radius: @radius; 10 | } 11 | .border-bottom-radius(@radius) { 12 | border-bottom-right-radius: @radius; 13 | border-bottom-left-radius: @radius; 14 | } 15 | .border-left-radius(@radius) { 16 | border-bottom-left-radius: @radius; 17 | border-top-left-radius: @radius; 18 | } 19 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/center-block.less: -------------------------------------------------------------------------------- 1 | // Center-align a block level element 2 | 3 | .center-block() { 4 | display: block; 5 | margin-left: auto; 6 | margin-right: auto; 7 | } 8 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/clearfix.less: -------------------------------------------------------------------------------- 1 | // Clearfix 2 | // 3 | // For modern browsers 4 | // 1. The space content is one way to avoid an Opera bug when the 5 | // contenteditable attribute is included anywhere else in the document. 6 | // Otherwise it causes space to appear at the top and bottom of elements 7 | // that are clearfixed. 8 | // 2. The use of `table` rather than `block` is only necessary if using 9 | // `:before` to contain the top-margins of child elements. 10 | // 11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/ 12 | 13 | .clearfix() { 14 | &:before, 15 | &:after { 16 | content: " "; // 1 17 | display: table; // 2 18 | } 19 | &:after { 20 | clear: both; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/hide-text.less: -------------------------------------------------------------------------------- 1 | // CSS image replacement 2 | // 3 | // Heads up! v3 launched with only `.hide-text()`, but per our pattern for 4 | // mixins being reused as classes with the same name, this doesn't hold up. As 5 | // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. 6 | // 7 | // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 8 | 9 | // Deprecated as of v3.0.1 (has been removed in v4) 10 | .hide-text() { 11 | font: ~"0/0" a; 12 | color: transparent; 13 | text-shadow: none; 14 | background-color: transparent; 15 | border: 0; 16 | } 17 | 18 | // New mixin to use as of v3.0.1 19 | .text-hide() { 20 | .hide-text(); 21 | } 22 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/image.less: -------------------------------------------------------------------------------- 1 | // Image Mixins 2 | // - Responsive image 3 | // - Retina image 4 | 5 | 6 | // Responsive image 7 | // 8 | // Keep images from scaling beyond the width of their parents. 9 | .img-responsive(@display: block) { 10 | display: @display; 11 | max-width: 100%; // Part 1: Set a maximum relative to the parent 12 | height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching 13 | } 14 | 15 | 16 | // Retina image 17 | // 18 | // Short retina mixin for setting background-image and -size. Note that the 19 | // spelling of `min--moz-device-pixel-ratio` is intentional. 20 | .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) { 21 | background-image: url("@{file-1x}"); 22 | 23 | @media 24 | only screen and (-webkit-min-device-pixel-ratio: 2), 25 | only screen and ( min--moz-device-pixel-ratio: 2), 26 | only screen and ( -o-min-device-pixel-ratio: 2/1), 27 | only screen and ( min-device-pixel-ratio: 2), 28 | only screen and ( min-resolution: 192dpi), 29 | only screen and ( min-resolution: 2dppx) { 30 | background-image: url("@{file-2x}"); 31 | background-size: @width-1x @height-1x; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/labels.less: -------------------------------------------------------------------------------- 1 | // Labels 2 | 3 | .label-variant(@color) { 4 | background-color: @color; 5 | 6 | &[href] { 7 | &:hover, 8 | &:focus { 9 | background-color: darken(@color, 10%); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/list-group.less: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | .list-group-item-variant(@state; @background; @color) { 4 | .list-group-item-@{state} { 5 | color: @color; 6 | background-color: @background; 7 | 8 | a&, 9 | button& { 10 | color: @color; 11 | 12 | .list-group-item-heading { 13 | color: inherit; 14 | } 15 | 16 | &:hover, 17 | &:focus { 18 | color: @color; 19 | background-color: darken(@background, 5%); 20 | } 21 | &.active, 22 | &.active:hover, 23 | &.active:focus { 24 | color: #fff; 25 | background-color: @color; 26 | border-color: @color; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/nav-divider.less: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | .nav-divider(@color: #e5e5e5) { 6 | height: 1px; 7 | margin: ((@line-height-computed / 2) - 1) 0; 8 | overflow: hidden; 9 | background-color: @color; 10 | } 11 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/nav-vertical-align.less: -------------------------------------------------------------------------------- 1 | // Navbar vertical align 2 | // 3 | // Vertically center elements in the navbar. 4 | // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. 5 | 6 | .navbar-vertical-align(@element-height) { 7 | margin-top: ((@navbar-height - @element-height) / 2); 8 | margin-bottom: ((@navbar-height - @element-height) / 2); 9 | } 10 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/opacity.less: -------------------------------------------------------------------------------- 1 | // Opacity 2 | 3 | .opacity(@opacity) { 4 | opacity: @opacity; 5 | // IE8 filter 6 | @opacity-ie: (@opacity * 100); 7 | filter: ~"alpha(opacity=@{opacity-ie})"; 8 | } 9 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/pagination.less: -------------------------------------------------------------------------------- 1 | // Pagination 2 | 3 | .pagination-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { 4 | > li { 5 | > a, 6 | > span { 7 | padding: @padding-vertical @padding-horizontal; 8 | font-size: @font-size; 9 | line-height: @line-height; 10 | } 11 | &:first-child { 12 | > a, 13 | > span { 14 | .border-left-radius(@border-radius); 15 | } 16 | } 17 | &:last-child { 18 | > a, 19 | > span { 20 | .border-right-radius(@border-radius); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/panels.less: -------------------------------------------------------------------------------- 1 | // Panels 2 | 3 | .panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border) { 4 | border-color: @border; 5 | 6 | & > .panel-heading { 7 | color: @heading-text-color; 8 | background-color: @heading-bg-color; 9 | border-color: @heading-border; 10 | 11 | + .panel-collapse > .panel-body { 12 | border-top-color: @border; 13 | } 14 | .badge { 15 | color: @heading-bg-color; 16 | background-color: @heading-text-color; 17 | } 18 | } 19 | & > .panel-footer { 20 | + .panel-collapse > .panel-body { 21 | border-bottom-color: @border; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/progress-bar.less: -------------------------------------------------------------------------------- 1 | // Progress bars 2 | 3 | .progress-bar-variant(@color) { 4 | background-color: @color; 5 | 6 | // Deprecated parent class requirement as of v3.2.0 7 | .progress-striped & { 8 | #gradient > .striped(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/reset-filter.less: -------------------------------------------------------------------------------- 1 | // Reset filters for IE 2 | // 3 | // When you need to remove a gradient background, do not forget to use this to reset 4 | // the IE filter for IE9 and below. 5 | 6 | .reset-filter() { 7 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)")); 8 | } 9 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/reset-text.less: -------------------------------------------------------------------------------- 1 | .reset-text() { 2 | font-family: @font-family-base; 3 | // We deliberately do NOT reset font-size. 4 | font-style: normal; 5 | font-weight: normal; 6 | letter-spacing: normal; 7 | line-break: auto; 8 | line-height: @line-height-base; 9 | text-align: left; // Fallback for where `start` is not supported 10 | text-align: start; 11 | text-decoration: none; 12 | text-shadow: none; 13 | text-transform: none; 14 | white-space: normal; 15 | word-break: normal; 16 | word-spacing: normal; 17 | word-wrap: normal; 18 | } 19 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/resize.less: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | .resizable(@direction) { 4 | resize: @direction; // Options: horizontal, vertical, both 5 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 6 | } 7 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/responsive-visibility.less: -------------------------------------------------------------------------------- 1 | // Responsive utilities 2 | 3 | // 4 | // More easily include all the states for responsive-utilities.less. 5 | .responsive-visibility() { 6 | display: block !important; 7 | table& { display: table !important; } 8 | tr& { display: table-row !important; } 9 | th&, 10 | td& { display: table-cell !important; } 11 | } 12 | 13 | .responsive-invisibility() { 14 | display: none !important; 15 | } 16 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/size.less: -------------------------------------------------------------------------------- 1 | // Sizing shortcuts 2 | 3 | .size(@width; @height) { 4 | width: @width; 5 | height: @height; 6 | } 7 | 8 | .square(@size) { 9 | .size(@size; @size); 10 | } 11 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/tab-focus.less: -------------------------------------------------------------------------------- 1 | // WebKit-style focus 2 | 3 | .tab-focus() { 4 | // WebKit-specific. Other browsers will keep their default outline style. 5 | // (Initially tried to also force default via `outline: initial`, 6 | // but that seems to erroneously remove the outline in Firefox altogether.) 7 | outline: 5px auto -webkit-focus-ring-color; 8 | outline-offset: -2px; 9 | } 10 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/table-row.less: -------------------------------------------------------------------------------- 1 | // Tables 2 | 3 | .table-row-variant(@state; @background) { 4 | // Exact selectors below required to override `.table-striped` and prevent 5 | // inheritance to nested tables. 6 | .table > thead > tr, 7 | .table > tbody > tr, 8 | .table > tfoot > tr { 9 | > td.@{state}, 10 | > th.@{state}, 11 | &.@{state} > td, 12 | &.@{state} > th { 13 | background-color: @background; 14 | } 15 | } 16 | 17 | // Hover states for `.table-hover` 18 | // Note: this is not available for cells or rows within `thead` or `tfoot`. 19 | .table-hover > tbody > tr { 20 | > td.@{state}:hover, 21 | > th.@{state}:hover, 22 | &.@{state}:hover > td, 23 | &:hover > .@{state}, 24 | &.@{state}:hover > th { 25 | background-color: darken(@background, 5%); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/text-emphasis.less: -------------------------------------------------------------------------------- 1 | // Typography 2 | 3 | .text-emphasis-variant(@color) { 4 | color: @color; 5 | a&:hover, 6 | a&:focus { 7 | color: darken(@color, 10%); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/mixins/text-overflow.less: -------------------------------------------------------------------------------- 1 | // Text overflow 2 | // Requires inline-block or block for proper styling 3 | 4 | .text-overflow() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/pager.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: @line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | &:extend(.clearfix all); 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: @pager-bg; 19 | border: 1px solid @pager-border; 20 | border-radius: @pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: @pager-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: @pager-disabled-color; 50 | background-color: @pager-bg; 51 | cursor: @cursor-disabled; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/responsive-embed.less: -------------------------------------------------------------------------------- 1 | // Embeds responsive 2 | // 3 | // Credit: Nicolas Gallagher and SUIT CSS. 4 | 5 | .embed-responsive { 6 | position: relative; 7 | display: block; 8 | height: 0; 9 | padding: 0; 10 | overflow: hidden; 11 | 12 | .embed-responsive-item, 13 | iframe, 14 | embed, 15 | object, 16 | video { 17 | position: absolute; 18 | top: 0; 19 | left: 0; 20 | bottom: 0; 21 | height: 100%; 22 | width: 100%; 23 | border: 0; 24 | } 25 | } 26 | 27 | // Modifier class for 16:9 aspect ratio 28 | .embed-responsive-16by9 { 29 | padding-bottom: 56.25%; 30 | } 31 | 32 | // Modifier class for 4:3 aspect ratio 33 | .embed-responsive-4by3 { 34 | padding-bottom: 75%; 35 | } 36 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/thumbnails.less: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | display: block; 9 | padding: @thumbnail-padding; 10 | margin-bottom: @line-height-computed; 11 | line-height: @line-height-base; 12 | background-color: @thumbnail-bg; 13 | border: 1px solid @thumbnail-border; 14 | border-radius: @thumbnail-border-radius; 15 | .transition(border .2s ease-in-out); 16 | 17 | > img, 18 | a > img { 19 | &:extend(.img-responsive); 20 | margin-left: auto; 21 | margin-right: auto; 22 | } 23 | 24 | // Add a hover state for linked versions only 25 | a&:hover, 26 | a&:focus, 27 | a&.active { 28 | border-color: @link-color; 29 | } 30 | 31 | // Image captions 32 | .caption { 33 | padding: @thumbnail-caption-padding; 34 | color: @thumbnail-caption-color; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/utilities.less: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | .clearfix(); 11 | } 12 | .center-block { 13 | .center-block(); 14 | } 15 | .pull-right { 16 | float: right !important; 17 | } 18 | .pull-left { 19 | float: left !important; 20 | } 21 | 22 | 23 | // Toggling content 24 | // ------------------------- 25 | 26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 27 | .hide { 28 | display: none !important; 29 | } 30 | .show { 31 | display: block !important; 32 | } 33 | .invisible { 34 | visibility: hidden; 35 | } 36 | .text-hide { 37 | .text-hide(); 38 | } 39 | 40 | 41 | // Hide from screenreaders and browsers 42 | // 43 | // Credit: HTML5 Boilerplate 44 | 45 | .hidden { 46 | display: none !important; 47 | } 48 | 49 | 50 | // For Affix plugin 51 | // ------------------------- 52 | 53 | .affix { 54 | position: fixed; 55 | } 56 | -------------------------------------------------------------------------------- /website/lib/bootstrap/bootstrap/wells.less: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: @well-bg; 12 | border: 1px solid @well-border; 13 | border-radius: @border-radius-base; 14 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: @border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: @border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /website/lib/bootstrap/build.less: -------------------------------------------------------------------------------- 1 | @import "bootstrap/bootstrap.less"; 2 | @import "variables.less"; 3 | @import "bootswatch.less"; 4 | -------------------------------------------------------------------------------- /website/lib/bootstrap/build.sh: -------------------------------------------------------------------------------- 1 | lessc -clean-css build.less > ../bootstrap.min.css 2 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/.gitattributes: -------------------------------------------------------------------------------- 1 | *.crt -crlf 2 | *.key -crlf 3 | *.srl -crlf 4 | *.pub -crlf 5 | *.priv -crlf 6 | *.txt -crlf 7 | 8 | # ignore /notes in the git-generated distributed .zip archive 9 | /notes export-ignore 10 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/.gitignore: -------------------------------------------------------------------------------- 1 | /tests/acceptance.conf.php 2 | /tests/smoke.conf.php 3 | /build/* 4 | /vendor/ 5 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/.travis.yml: -------------------------------------------------------------------------------- 1 | language: php 2 | 3 | sudo: false 4 | 5 | before_script: 6 | - cp tests/acceptance.conf.php.default tests/acceptance.conf.php 7 | - cp tests/smoke.conf.php.default tests/smoke.conf.php 8 | - composer self-update 9 | - composer update --no-interaction --prefer-source 10 | - gem install mime-types -v 2.99.1 11 | - gem install mailcatcher 12 | - mailcatcher --smtp-port 4456 13 | 14 | script: 15 | - phpunit --verbose 16 | 17 | matrix: 18 | include: 19 | - php: 5.3 20 | - php: 5.4 21 | - php: 5.5 22 | - php: 5.6 23 | - php: 7.0 24 | - php: hhvm 25 | allow_failures: 26 | - php: 7.0 27 | - php: hhvm 28 | fast_finish: true 29 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2016 Fabien Potencier 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/README: -------------------------------------------------------------------------------- 1 | Swift Mailer 2 | ------------ 3 | 4 | Swift Mailer is a component based mailing solution for PHP 5. 5 | It is released under the MIT license. 6 | 7 | Homepage: http://swiftmailer.org 8 | Documentation: http://swiftmailer.org/docs 9 | Bugs: https://github.com/swiftmailer/swiftmailer/issues 10 | Repository: https://github.com/swiftmailer/swiftmailer 11 | 12 | Swift Mailer is highly object-oriented by design and lends itself 13 | to use in complex web application with a great deal of flexibility. 14 | 15 | For full details on usage, see the documentation. 16 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/VERSION: -------------------------------------------------------------------------------- 1 | Swift-5.4.2 2 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "swiftmailer/swiftmailer", 3 | "type": "library", 4 | "description": "Swiftmailer, free feature-rich PHP mailer", 5 | "keywords": ["mail","mailer","email"], 6 | "homepage": "http://swiftmailer.org", 7 | "license": "MIT", 8 | "authors": [{ 9 | "name": "Chris Corbyn" 10 | },{ 11 | "name": "Fabien Potencier", 12 | "email": "fabien@symfony.com" 13 | } 14 | ], 15 | "require": { 16 | "php": ">=5.3.3" 17 | }, 18 | "require-dev": { 19 | "mockery/mockery": "~0.9.1,<0.9.4" 20 | }, 21 | "autoload": { 22 | "files": ["lib/swift_required.php"] 23 | }, 24 | "autoload-dev": { 25 | "psr-0": { 26 | "Swift_": "tests/unit" 27 | } 28 | }, 29 | "extra": { 30 | "branch-alias": { 31 | "dev-master": "5.4-dev" 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/lib/classes/Swift/ByteStream/TemporaryFileByteStream.php: -------------------------------------------------------------------------------- 1 | getPath())) === false) { 27 | throw new Swift_IoException('Failed to get temporary file content.'); 28 | } 29 | 30 | return $content; 31 | } 32 | 33 | public function __destruct() { 34 | if (file_exists($this->getPath())) { 35 | @unlink($this->getPath()); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/lib/classes/Swift/CharacterReaderFactory.php: -------------------------------------------------------------------------------- 1 | getSource(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/lib/classes/Swift/Events/TransportExceptionEvent.php: -------------------------------------------------------------------------------- 1 | _exception = $ex; 33 | } 34 | 35 | /** 36 | * Get the TransportException thrown. 37 | * 38 | * @return Swift_TransportException 39 | */ 40 | public function getException() { 41 | return $this->_exception; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/lib/classes/Swift/Events/TransportExceptionListener.php: -------------------------------------------------------------------------------- 1 | createDependenciesFor('transport.failover') 27 | ); 28 | 29 | $this->setTransports($transports); 30 | } 31 | 32 | /** 33 | * Create a new FailoverTransport instance. 34 | * 35 | * @param Swift_Transport[] $transports 36 | * 37 | * @return Swift_FailoverTransport 38 | */ 39 | public static function newInstance($transports = array()) { 40 | return new self($transports); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/lib/classes/Swift/FileStream.php: -------------------------------------------------------------------------------- 1 | createDependenciesFor('transport.mail') 27 | ); 28 | 29 | $this->setExtraParams($extraParams); 30 | } 31 | 32 | /** 33 | * Create a new MailTransport instance. 34 | * 35 | * @param string $extraParams To be passed to mail() 36 | * 37 | * @return Swift_MailTransport 38 | */ 39 | public static function newInstance($extraParams = '-f%s') { 40 | return new self($extraParams); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/lib/classes/Swift/Mailer/RecipientIterator.php: -------------------------------------------------------------------------------- 1 | 'Foo') or ('foo@bar' => NULL). 27 | * 28 | * @return array 29 | */ 30 | public function nextRecipient(); 31 | } 32 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/lib/classes/Swift/Mime/CharsetObserver.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | /** 12 | * Pretends messages have been sent, but just ignores them. 13 | * 14 | * @author Fabien Potencier 15 | */ 16 | class Swift_NullTransport extends Swift_Transport_NullTransport{ 17 | /** 18 | * Create a new NullTransport. 19 | */ 20 | public function __construct() { 21 | call_user_func_array( 22 | array($this, 'Swift_Transport_NullTransport::__construct'), 23 | Swift_DependencyContainer::getInstance() 24 | ->createDependenciesFor('transport.null') 25 | ); 26 | } 27 | 28 | /** 29 | * Create a new NullTransport instance. 30 | * 31 | * @return Swift_NullTransport 32 | */ 33 | public static function newInstance() { 34 | return new self(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/lib/classes/Swift/Plugins/Decorator/Replacements.php: -------------------------------------------------------------------------------- 1 | _isHtml = $isHtml; 27 | } 28 | 29 | /** 30 | * Add a log entry. 31 | * 32 | * @param string $entry 33 | */ 34 | public function add($entry) { 35 | if ($this->_isHtml) { 36 | printf('%s%s%s', htmlspecialchars($entry, ENT_QUOTES), '
    ', PHP_EOL); 37 | } else { 38 | printf('%s%s', $entry, PHP_EOL); 39 | } 40 | } 41 | 42 | /** 43 | * Not implemented. 44 | */ 45 | public function clear() { 46 | } 47 | 48 | /** 49 | * Not implemented. 50 | */ 51 | public function dump() { 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/lib/classes/Swift/Plugins/Pop/Pop3Connection.php: -------------------------------------------------------------------------------- 1 | 18 | * 19 | * @deprecated 20 | */ 21 | class Swift_SignedMessage extends Swift_Message{ 22 | } 23 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/lib/classes/Swift/Signer.php: -------------------------------------------------------------------------------- 1 | 16 | */ 17 | interface Swift_Signer{ 18 | public function reset(); 19 | } 20 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/lib/classes/Swift/Signers/BodySigner.php: -------------------------------------------------------------------------------- 1 | 15 | */ 16 | interface Swift_Signers_BodySigner extends Swift_Signer{ 17 | /** 18 | * Change the Swift_Signed_Message to apply the singing. 19 | * 20 | * @param Swift_Message $message 21 | * 22 | * @return Swift_Signers_BodySigner 23 | */ 24 | public function signMessage(Swift_Message $message); 25 | 26 | /** 27 | * Return the list of header a signer might tamper. 28 | * 29 | * @return array 30 | */ 31 | public function getAlteredHeaders(); 32 | } 33 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/lib/classes/Swift/SpoolTransport.php: -------------------------------------------------------------------------------- 1 | 6 | * 7 | * For the full copyright and license information, please view the LICENSE 8 | * file that was distributed with this source code. 9 | */ 10 | 11 | /** 12 | * Stores Messages in a queue. 13 | * 14 | * @author Fabien Potencier 15 | */ 16 | class Swift_SpoolTransport extends Swift_Transport_SpoolTransport{ 17 | /** 18 | * Create a new SpoolTransport. 19 | * 20 | * @param Swift_Spool $spool 21 | */ 22 | public function __construct(Swift_Spool $spool) { 23 | $arguments = Swift_DependencyContainer::getInstance() 24 | ->createDependenciesFor('transport.spool'); 25 | 26 | $arguments[] = $spool; 27 | 28 | call_user_func_array( 29 | array($this, 'Swift_Transport_SpoolTransport::__construct'), 30 | $arguments 31 | ); 32 | } 33 | 34 | /** 35 | * Create a new SpoolTransport instance. 36 | * 37 | * @param Swift_Spool $spool 38 | * 39 | * @return Swift_SpoolTransport 40 | */ 41 | public static function newInstance(Swift_Spool $spool) { 42 | return new self($spool); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/lib/classes/Swift/StreamFilter.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | class Swift_Validate{ 16 | /** 17 | * Grammar Object. 18 | * 19 | * @var Swift_Mime_Grammar 20 | */ 21 | private static $grammar = null; 22 | 23 | /** 24 | * Checks if an e-mail address matches the current grammars. 25 | * 26 | * @param string $email 27 | * 28 | * @return bool 29 | */ 30 | public static function email($email) { 31 | if (self::$grammar === null) { 32 | self::$grammar = Swift_DependencyContainer::getInstance() 33 | ->lookup('mime.grammar'); 34 | } 35 | 36 | return (bool) preg_match( 37 | '/^'.self::$grammar->getDefinition('addr-spec').'$/D', 38 | $email 39 | ); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/lib/dependency_maps/cache_deps.php: -------------------------------------------------------------------------------- 1 | register('cache') 5 | ->asAliasOf('cache.array') 6 | 7 | ->register('tempdir') 8 | ->asValue('/tmp') 9 | 10 | ->register('cache.null') 11 | ->asSharedInstanceOf('Swift_KeyCache_NullKeyCache') 12 | 13 | ->register('cache.array') 14 | ->asSharedInstanceOf('Swift_KeyCache_ArrayKeyCache') 15 | ->withDependencies(array('cache.inputstream')) 16 | 17 | ->register('cache.disk') 18 | ->asSharedInstanceOf('Swift_KeyCache_DiskKeyCache') 19 | ->withDependencies(array('cache.inputstream', 'tempdir')) 20 | 21 | ->register('cache.inputstream') 22 | ->asNewInstanceOf('Swift_KeyCache_SimpleKeyCacheInputStream') 23 | ; 24 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/lib/dependency_maps/message_deps.php: -------------------------------------------------------------------------------- 1 | register('message.message') 5 | ->asNewInstanceOf('Swift_Message') 6 | 7 | ->register('message.mimepart') 8 | ->asNewInstanceOf('Swift_MimePart') 9 | ; 10 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/lib/preferences.php: -------------------------------------------------------------------------------- 1 | setCharset('utf-8'); 13 | 14 | // Without these lines the default caching mechanism is "array" but this uses a lot of memory. 15 | // If possible, use a disk cache to enable attaching large attachments etc. 16 | // You can override the default temporary directory by setting the TMPDIR environment variable. 17 | if (@is_writable($tmpDir = sys_get_temp_dir())) { 18 | $preferences->setTempDir($tmpDir)->setCacheType('disk'); 19 | } 20 | 21 | // this should only be done when Swiftmailer won't use the native QP content encoder 22 | // see mime_deps.php 23 | if (version_compare(phpversion(), '5.4.7', '<')) { 24 | $preferences->setQPDotEscape(false); 25 | } 26 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/lib/swift_init.php: -------------------------------------------------------------------------------- 1 | content .= $arg; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/SwiftMailerTestCase.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/_samples/files/swiftmailer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/lib/swiftmailer/tests/_samples/files/swiftmailer.png -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/_samples/smime/CA.srl: -------------------------------------------------------------------------------- 1 | D42DA34CF90FA0DE 2 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/_samples/smime/ca.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDazCCAlOgAwIBAgIJAKJCGQYLxWT1MA0GCSqGSIb3DQEBBQUAMEwxFzAVBgNV 3 | BAMMDlN3aWZ0bWFpbGVyIENBMRQwEgYDVQQKDAtTd2lmdG1haWxlcjEOMAwGA1UE 4 | BwwFUGFyaXMxCzAJBgNVBAYTAkZSMB4XDTEzMTEyNzA4MzkxMFoXDTE3MTEyNjA4 5 | MzkxMFowTDEXMBUGA1UEAwwOU3dpZnRtYWlsZXIgQ0ExFDASBgNVBAoMC1N3aWZ0 6 | bWFpbGVyMQ4wDAYDVQQHDAVQYXJpczELMAkGA1UEBhMCRlIwggEiMA0GCSqGSIb3 7 | DQEBAQUAA4IBDwAwggEKAoIBAQC7RLdHE3OWo9aZwv1xA/cYyPui/gegxpTqClRp 8 | gGcVQ+jxIfnJQDQndyoAvFDiqOiZ+gAjZGJeUHDp9C/2IZp05MLh+omt9N8pBykm 9 | 3nj/3ZwPXOAO0uyDPAOHhISITAxEuZCqDnq7iYujywtwfQ7bpW1hCK9PfNZYMStM 10 | kw7LsGr5BqcKkPuOWTvxE3+NqK8HxydYolsoApEGhgonyImVh1Pg1Kjkt5ojvwAX 11 | zOdjfw5poY5NArwuLORUH+XocetRo8DC6S42HkU/MoqcYxa9EuRuwuQh7GtE6baR 12 | PgrDsEYaY4Asy43sK81V51F/8Q1bHZKN/goQdxQwzv+/nOLTAgMBAAGjUDBOMB0G 13 | A1UdDgQWBBRHgqkl543tKhsVAvcx1I0JFU7JuDAfBgNVHSMEGDAWgBRHgqkl543t 14 | KhsVAvcx1I0JFU7JuDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAz 15 | OJiEQcygKGkkXXDiXGBvP/cSznj3nG9FolON0yHUBgdvLfNnctRMStGzPke0siLt 16 | RJvjqiL0Uw+blmLJU8lgMyLJ9ctXkiLJ/WflabN7VzmwYRWe5HzafGQJAg5uFjae 17 | VtAAHQgvbmdXB6brWvcMQmB8di7wjVedeigZvkt1z2V0FtBy8ybJaT5H6bX9Bf5C 18 | dS9r4mLhk/0ThthpRhRxsmupSL6e49nJaIk9q0UTEQVnorJXPcs4SPTIY51bCp6u 19 | cOebhNgndSxCiy0zSD7vRjNiyB/YNGZ9Uv/3DNTLleMZ9kZgfoKVpwYKrRL0IFT/ 20 | cfS2OV1wxRxq668qaOfK 21 | -----END CERTIFICATE----- 22 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/_samples/smime/encrypt.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDFjCCAf4CCQDULaNM+Q+g3TANBgkqhkiG9w0BAQUFADBMMRcwFQYDVQQDDA5T 3 | d2lmdG1haWxlciBDQTEUMBIGA1UECgwLU3dpZnRtYWlsZXIxDjAMBgNVBAcMBVBh 4 | cmlzMQswCQYDVQQGEwJGUjAeFw0xMzExMjcwODM5MTFaFw0xNzExMjYwODM5MTFa 5 | ME4xGTAXBgNVBAMMEFN3aWZ0bWFpbGVyLVVzZXIxFDASBgNVBAoMC1N3aWZ0bWFp 6 | bGVyMQ4wDAYDVQQHDAVQYXJpczELMAkGA1UEBhMCRlIwggEiMA0GCSqGSIb3DQEB 7 | AQUAA4IBDwAwggEKAoIBAQCcNO+fVZBT2znmVwXXZ08n3G5WA1kyvqh9z4RBBZOD 8 | V46Gc1X9MMXr9+wzZBFkAckKaa6KsTkeUr4pC8XUBpQnakxH/kW9CaDPdOE+7wNo 9 | FkPfc6pjWWgpAVxdkrtk7pb4/aGQ++HUkqVu0cMpIcj/7ht7H+3QLZHybn+oMr2+ 10 | FDnn8vPmHxVioinSrxKTlUITuLWS9ZZUTrDa0dG8UAv55A/Tba4T4McCPDpJSA4m 11 | 9jrW321NGQUntQoItOJxagaueSvh6PveGV826gTXoU5X+YJ3I2OZUEQ2l6yByAzf 12 | nT+QlxPj5ikotFwL72HsenYtetynOO/k43FblAF/V/l7AgMBAAEwDQYJKoZIhvcN 13 | AQEFBQADggEBAJ048Sdb9Sw5OJM5L00OtGHgcT1B/phqdzSjkM/s64cg3Q20VN+F 14 | fZIIkOnxgyYWcpOWXcdNw2tm5OWhWPGsBcYgMac7uK/ukgoOJSjICg+TTS5kRo96 15 | iHtmImqkWc6WjNODh7uMnQ6DsZsscdl7Bkx5pKhgGnEdHr5GW8sztgXgyPQO5LUs 16 | YzCmR1RK1WoNMxwbPrGLgYdcpJw69ns5hJbZbMWwrdufiMjYWvTfBPABkk1JRCcY 17 | K6rRTAx4fApsw1kEIY8grGxyAzfRXLArpro7thJr0SIquZ8GpXkQT/mgRR8JD9Hp 18 | z9yhr98EnKzITE/yclGN4pUsuk9S3jiyzUU= 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/_samples/smime/encrypt2.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDFzCCAf8CCQDULaNM+Q+g3jANBgkqhkiG9w0BAQUFADBMMRcwFQYDVQQDDA5T 3 | d2lmdG1haWxlciBDQTEUMBIGA1UECgwLU3dpZnRtYWlsZXIxDjAMBgNVBAcMBVBh 4 | cmlzMQswCQYDVQQGEwJGUjAeFw0xMzExMjcwODM5MTJaFw0xNzExMjYwODM5MTJa 5 | ME8xGjAYBgNVBAMMEVN3aWZ0bWFpbGVyLVVzZXIyMRQwEgYDVQQKDAtTd2lmdG1h 6 | aWxlcjEOMAwGA1UEBwwFUGFyaXMxCzAJBgNVBAYTAkZSMIIBIjANBgkqhkiG9w0B 7 | AQEFAAOCAQ8AMIIBCgKCAQEAw4AoYVYss2sa1BWJAJpK6gVemjXrp1mVXVpb1/z6 8 | SH15AGsp3kiNXsMpgvsdofbqC/5HXrw2G8gWqo+uh6GuK67+Tvp7tO2aD4+8CZzU 9 | K1cffj7Pbx95DUPwXckv79PT5ZcuyeFaVo92aug11+gS/P8n0WXSlzZxNuZ1f3G2 10 | r/IgwfNKZlarEf1Ih781L2SwmyveW/dtsV2pdrd4IZwsV5SOF2zBFIXSuhPN0c+m 11 | mtwSJe+Ow1udLX4KJkAX8sGVFJ5P5q4s2nS9vLkkj7X6YRQscbyJO9L7e1TksRqL 12 | DLxZwiko6gUhp4/bIs1wDj5tzkQBi4qXviRq3i7A9b2d0QIDAQABMA0GCSqGSIb3 13 | DQEBBQUAA4IBAQAj8iARhPB2DA3YfT5mJJrgU156Sm0Z3mekAECsr+VqFZtU/9Dz 14 | pPFYEf0hg61cjvwhLtOmaTB+50hu1KNNlu8QlxAfPJqNxtH85W0CYiZHJwW9eSTr 15 | z1swaHpRHLDUgo3oAXdh5syMbdl0MWos0Z14WP5yYu4IwJXs+j2JRW70BICyrNjm 16 | d+AjCzoYjKMdJkSj4uxQEOuW2/5veAoDyU+kHDdfT7SmbyoKu+Pw4Xg/XDuKoWYg 17 | w5/sRiw5vxsmOr9+anspDHdP9rUe1JEfwAJqZB3fwdqEyxu54Xw/GedG4wZBEJf0 18 | ZcS1eh31emcjYUHQa1IA93jcFSmXzJ+ftJrY 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/_samples/smime/intermediate.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDFjCCAf4CAQEwDQYJKoZIhvcNAQEFBQAwTDEXMBUGA1UEAwwOU3dpZnRtYWls 3 | ZXIgQ0ExFDASBgNVBAoMC1N3aWZ0bWFpbGVyMQ4wDAYDVQQHDAVQYXJpczELMAkG 4 | A1UEBhMCRlIwHhcNMTQxMTIwMTMyNTQxWhcNMTgxMTE5MTMyNTQxWjBWMSEwHwYD 5 | VQQDDBhTd2lmdG1haWxlciBJbnRlcm1lZGlhdGUxFDASBgNVBAoMC1N3aWZ0bWFp 6 | bGVyMQ4wDAYDVQQHDAVQYXJpczELMAkGA1UEBhMCRlIwggEiMA0GCSqGSIb3DQEB 7 | AQUAA4IBDwAwggEKAoIBAQDSgEhftX6f1wV+uqWl4J+zwCn8fHaLZT6GZ0Gs9ThE 8 | 4e+4mkLG1rvSEIJon8U0ic8Zph1UGa1Grveh5bgbldHlFxYSsCCyDGgixRvRWNhI 9 | KuO+SxaIZChqqKwVn3aNQ4BZOSo/MjJ/jQyr9BMgMmdxlHR3e1wkkeAkW//sOsfu 10 | xQGF1h9yeQvuu/GbG6K7vHSGOGd5O3G7bftfQ7l78TMqeJ7jV32AdJeuO5MD4dRn 11 | W4CQLTaeribLN0MKn35UdSiFoZxKHqqWcgtl5xcJWPOmq6CsAJ2Eo90kW/BHOrLv 12 | 10h6Oan9R1PdXSvSCvVnXY3Kz30zofw305oA/KJk/hVzAgMBAAEwDQYJKoZIhvcN 13 | AQEFBQADggEBABijZ2NNd05Js5VFNr4uyaydam9Yqu/nnrxbPRbAXPlCduydu2Gd 14 | d1ekn3nblMJ87Bc7zVyHdAQD8/AfS1LOKuoWHpTzmlpIL+8T5sbCYG5J1jKdeLkh 15 | 7L/UD5v1ACgA33oKtN8GzcrIq8Zp73r0n+c3hFCfDYRSZRCxGyIf3qgU2LBOD0A3 16 | wTff/N8E/p3WaJX9VnuQ7xyRMOubDuqJnlo5YsFv7wjyGOIAz9afZzcEbH6czt/t 17 | g0Xc/kGr/fkAjUu+z3ZfE4247Gut5m3hEVwWkpEEzQo4osX/BEX20Q2nPz9WBq4a 18 | pK3qNNGwAqS4gdE3ihOExMWxAKgr9d2CcU4= 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/_samples/smime/sign.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDFjCCAf4CCQDULaNM+Q+g3DANBgkqhkiG9w0BAQUFADBMMRcwFQYDVQQDDA5T 3 | d2lmdG1haWxlciBDQTEUMBIGA1UECgwLU3dpZnRtYWlsZXIxDjAMBgNVBAcMBVBh 4 | cmlzMQswCQYDVQQGEwJGUjAeFw0xMzExMjcwODM5MTBaFw0xNzExMjYwODM5MTBa 5 | ME4xGTAXBgNVBAMMEFN3aWZ0bWFpbGVyLVVzZXIxFDASBgNVBAoMC1N3aWZ0bWFp 6 | bGVyMQ4wDAYDVQQHDAVQYXJpczELMAkGA1UEBhMCRlIwggEiMA0GCSqGSIb3DQEB 7 | AQUAA4IBDwAwggEKAoIBAQCTe8ZouyjVGgqlljhaswYqLj7icMoHq+Qg13CE+zJg 8 | tl2/UzyPhAd3WWOIvlQ0lu+E/n0bXrS6+q28DrQ3UgJ9BskzzLz15qUO12b92AvG 9 | vLJ+9kKuiM5KXDljOAsXc7/A9UUGwEFA1D0mkeMmkHuiQavAMkzBLha22hGpg/hz 10 | VbE6W9MGna0szd8yh38IY1M5uR+OZ0dG3KbVZb7H3N0OLOP8j8n+4YtAGAW+Onz/ 11 | 2CGPfZ1kaDMvY/WTZwyGeA4FwCPy1D8tfeswqKnWDB9Sfl8hns5VxnoJ3dqKQHeX 12 | iC4OMfQ0U4CcuM5sVYJZRNNwP7/TeUh3HegnOnuZ1hy9AgMBAAEwDQYJKoZIhvcN 13 | AQEFBQADggEBAAEPjGt98GIK6ecAEat52aG+8UP7TuZaxoH3cbZdhFTafrP8187F 14 | Rk5G3LCPTeA/QIzbHppA4fPAiS07OVSwVCknpTJbtKKn0gmtTZxThacFHF2NlzTH 15 | XxM5bIbkK3jzIF+WattyTSj34UHHfaNAmvmS7Jyq6MhjSDbcQ+/dZ9eo2tF/AmrC 16 | +MBhyH8aUYwKhTOQQh8yC11niziHhGO99FQ4tpuD9AKlun5snHq4uK9AOFe8VhoR 17 | q2CqX5g5v8OAtdlvzhp50IqD4BNOP+JrUxjGLHDG76BZZIK2Ai1eBz+GhRlIQru/ 18 | 8EhQzd94mdFEPblGbmuD2QXWLFFKLiYOwOc= 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/_samples/smime/sign2.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDGTCCAgECAQEwDQYJKoZIhvcNAQEFBQAwVjEhMB8GA1UEAwwYU3dpZnRtYWls 3 | ZXIgSW50ZXJtZWRpYXRlMRQwEgYDVQQKDAtTd2lmdG1haWxlcjEOMAwGA1UEBwwF 4 | UGFyaXMxCzAJBgNVBAYTAkZSMB4XDTE0MTEyMDEzMjYyNloXDTE4MTExOTEzMjYy 5 | NlowTzEaMBgGA1UEAwwRU3dpZnRtYWlsZXItVXNlcjIxFDASBgNVBAoMC1N3aWZ0 6 | bWFpbGVyMQ4wDAYDVQQHDAVQYXJpczELMAkGA1UEBhMCRlIwggEiMA0GCSqGSIb3 7 | DQEBAQUAA4IBDwAwggEKAoIBAQDbr1m4z/rzFS/DxUUQIhKNx19oAeGYLt3niaEP 8 | twfvBMNB80gMgM9d+XtqrPAMPeY/2C8t5NlChNPKMcR70JBKdmlSH4/aTjaIfWmD 9 | PoZJjvRRXINZgSHNKIt4ZGAN/EPFr19CBisV4iPxzu+lyIbbkaZJ/qtyatlP7m/q 10 | 8TnykFRlyxNEveCakpcXeRd3YTFGKWoED+/URhVc0cCPZVjoeSTtPHAYBnC29lG5 11 | VFbq6NBQiyF4tpjOHRarq6G8PtQFH9CpAZg5bPk3bqka9C8mEr5jWfrM4EHtUkTl 12 | CwVLOQRBsz/nMBT27pXZh18GU0hc3geNDN4kqaeqgNBo0mblAgMBAAEwDQYJKoZI 13 | hvcNAQEFBQADggEBAAHDMuv6oxWPsTQWWGWWFIk7QZu3iogMqFuxhhQxg8BE37CT 14 | Vt1mBVEjYGMkWhMSwWBMWuP6yuOZecWtpp6eOie/UKGg1XoW7Y7zq2aQaP7YPug0 15 | 8Lgq1jIo7iO2b6gZeMtLiTZrxyte0z1XzS3wy7ZC9mZjYd7QE7mZ+/rzQ0x5zjOp 16 | G8b3msS/yYYJCMN+HtHln++HOGmm6uhvbsHTfvvZvtl7F5vJ5WhGGlUfjhanSEtZ 17 | 1RKx+cbgIv1eFOGO1OTuZfEuKdLb0T38d/rjLeI99nVVKEIGtLmX4dj327GHe/D3 18 | aPr2blF2gOvlzkfN9Vz6ZUE2s3rVBeCg2AVseYQ= 19 | -----END CERTIFICATE----- 20 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/acceptance/Swift/AttachmentAcceptanceTest.php: -------------------------------------------------------------------------------- 1 | listItems() as $itemName) { 11 | try { 12 | $di->lookup($itemName); 13 | } catch (Swift_DependencyException $e) { 14 | $this->fail($e->getMessage()); 15 | } 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/acceptance/Swift/EmbeddedFileAcceptanceTest.php: -------------------------------------------------------------------------------- 1 | assertEquals('7bit', $encoder->getName()); 9 | } 10 | 11 | public function testGet8BitEncodingReturns8BitEncoder() { 12 | $encoder = Swift_Encoding::get8BitEncoding(); 13 | $this->assertEquals('8bit', $encoder->getName()); 14 | } 15 | 16 | public function testGetQpEncodingReturnsQpEncoder() { 17 | $encoder = Swift_Encoding::getQpEncoding(); 18 | $this->assertEquals('quoted-printable', $encoder->getName()); 19 | } 20 | 21 | public function testGetBase64EncodingReturnsBase64Encoder() { 22 | $encoder = Swift_Encoding::getBase64Encoding(); 23 | $this->assertEquals('base64', $encoder->getName()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/acceptance/Swift/Mime/HeaderEncoder/Base64HeaderEncoderAcceptanceTest.php: -------------------------------------------------------------------------------- 1 | _encoder = new Swift_Mime_HeaderEncoder_Base64HeaderEncoder(); 8 | } 9 | 10 | public function testEncodingJIS() { 11 | if (function_exists('mb_convert_encoding')) { 12 | // base64_encode and split cannot handle long JIS text to fold 13 | $subject = '長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い長い件名'; 14 | 15 | $encodedWrapperLength = strlen('=?iso-2022-jp?'.$this->_encoder->getName().'??='); 16 | 17 | $old = mb_internal_encoding(); 18 | mb_internal_encoding('utf-8'); 19 | $newstring = mb_encode_mimeheader($subject, 'iso-2022-jp', 'B', "\r\n"); 20 | mb_internal_encoding($old); 21 | 22 | $encoded = $this->_encoder->encodeString($subject, 0, 75 - $encodedWrapperLength, 'iso-2022-jp'); 23 | $this->assertEquals( 24 | $encoded, $newstring, 25 | 'Encoded string should decode back to original string for sample ' 26 | ); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/acceptance/Swift/MimePartAcceptanceTest.php: -------------------------------------------------------------------------------- 1 | register('properties.charset')->asValue(null); 10 | 11 | return Swift_MimePart::newInstance(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/BasicSocketAcceptanceTest.php: -------------------------------------------------------------------------------- 1 | markTestSkipped( 10 | 'Cannot run test without an SMTP host to connect to (define '. 11 | 'SWIFT_SMTP_HOST in tests/acceptance.conf.php if you wish to run this test)' 12 | ); 13 | } 14 | parent::setUp(); 15 | } 16 | 17 | protected function _initializeBuffer() { 18 | $parts = explode(':', SWIFT_SMTP_HOST); 19 | $host = $parts[0]; 20 | $port = isset($parts[1]) ? $parts[1] : 25; 21 | 22 | $this->_buffer->initialize(array( 23 | 'type' => Swift_Transport_IoBuffer::TYPE_SOCKET, 24 | 'host' => $host, 25 | 'port' => $port, 26 | 'protocol' => 'tcp', 27 | 'blocking' => 1, 28 | 'timeout' => 15, 29 | )); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/acceptance/Swift/Transport/StreamBuffer/ProcessAcceptanceTest.php: -------------------------------------------------------------------------------- 1 | markTestSkipped( 10 | 'Cannot run test without a path to sendmail (define '. 11 | 'SWIFT_SENDMAIL_PATH in tests/acceptance.conf.php if you wish to run this test)' 12 | ); 13 | } 14 | 15 | parent::setUp(); 16 | } 17 | 18 | protected function _initializeBuffer() { 19 | $this->_buffer->initialize(array( 20 | 'type' => Swift_Transport_IoBuffer::TYPE_PROCESS, 21 | 'command' => SWIFT_SENDMAIL_PATH.' -bs', 22 | )); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | allowMockingNonExistentMethods(false); 11 | 12 | if (is_file(__DIR__.'/acceptance.conf.php')) { 13 | require_once __DIR__.'/acceptance.conf.php'; 14 | } 15 | if (is_file(__DIR__.'/smoke.conf.php')) { 16 | require_once __DIR__.'/smoke.conf.php'; 17 | } 18 | require_once __DIR__.'/StreamCollector.php'; 19 | require_once __DIR__.'/IdenticalBinaryConstraint.php'; 20 | require_once __DIR__.'/SwiftMailerTestCase.php'; 21 | require_once __DIR__.'/SwiftMailerSmokeTestCase.php'; 22 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/bug/Swift/Bug118Test.php: -------------------------------------------------------------------------------- 1 | _message = new Swift_Message(); 8 | } 9 | 10 | public function testCallingGenerateIdChangesTheMessageId() { 11 | $currentId = $this->_message->getId(); 12 | $this->_message->generateId(); 13 | $newId = $this->_message->getId(); 14 | 15 | $this->assertNotEquals($currentId, $newId); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/bug/Swift/Bug274Test.php: -------------------------------------------------------------------------------- 1 | setExpectedException('Swift_IoException', 'The path cannot be empty'); 7 | $message->attach(Swift_Attachment::fromPath('')); 8 | } 9 | 10 | public function testNonEmptyFileNameAsAttachment() { 11 | $message = new Swift_Message(); 12 | try { 13 | $message->attach(Swift_Attachment::fromPath(__FILE__)); 14 | } catch (Exception $e) { 15 | $this->fail('Path should not be empty'); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/bug/Swift/Bug518Test.php: -------------------------------------------------------------------------------- 1 | setTo('foo@bar.com'); 10 | 11 | $that = $this; 12 | $messageValidation = function ($m) use ($that) { 13 | //the getTo should return the same value as we put in 14 | $that->assertEquals('foo@bar.com', key($m->getTo()), 'The message has changed after it was put to the memory queue'); 15 | 16 | return true; 17 | }; 18 | 19 | $transport = m::mock('Swift_Transport'); 20 | $transport->shouldReceive('isStarted')->andReturn(true); 21 | $transport->shouldReceive('send') 22 | ->with(m::on($messageValidation), $failedRecipients) 23 | ->andReturn(1); 24 | 25 | $memorySpool = new Swift_MemorySpool(); 26 | $memorySpool->queueMessage($message); 27 | 28 | /* 29 | * The message is queued in memory. 30 | * Lets change the message 31 | */ 32 | $message->setTo('other@value.com'); 33 | 34 | $memorySpool->flushQueue($transport, $failedRecipients); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/bug/Swift/Bug71Test.php: -------------------------------------------------------------------------------- 1 | _message = new Swift_Message('test'); 8 | } 9 | 10 | public function testCallingToStringAfterSettingNewBodyReflectsChanges() { 11 | $this->_message->setBody('BODY1'); 12 | $this->assertRegExp('/BODY1/', $this->_message->toString()); 13 | 14 | $this->_message->setBody('BODY2'); 15 | $this->assertRegExp('/BODY2/', $this->_message->toString()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/bug/Swift/BugFileByteStreamConsecutiveReadCallsTest.php: -------------------------------------------------------------------------------- 1 | read(100); 13 | } catch (\Swift_IoException $exc) { 14 | $fbs->read(100); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/fixtures/MimeEntityFixture.php: -------------------------------------------------------------------------------- 1 | level = $level; 10 | $this->string = $string; 11 | $this->contentType = $contentType; 12 | } 13 | 14 | public function getNestingLevel() { 15 | return $this->level; 16 | } 17 | 18 | public function toString() { 19 | return $this->string; 20 | } 21 | 22 | public function getContentType() { 23 | return $this->contentType; 24 | } 25 | 26 | // These methods are here to account for the implemented interfaces 27 | public function getId() { 28 | } 29 | public function getHeaders() { 30 | } 31 | public function getBody() { 32 | } 33 | public function setBody($body, $contentType = null) { 34 | } 35 | public function toByteStream(Swift_InputByteStream $is) { 36 | } 37 | public function charsetChanged($charset) { 38 | } 39 | public function encoderChanged(Swift_Mime_ContentEncoder $encoder) { 40 | } 41 | public function getChildren() { 42 | } 43 | public function setChildren(array $children) { 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/smoke/Swift/Smoke/AttachmentSmokeTest.php: -------------------------------------------------------------------------------- 1 | _attFile = __DIR__.'/../../../_samples/files/textfile.zip'; 11 | } 12 | 13 | public function testAttachmentSending() { 14 | $mailer = $this->_getMailer(); 15 | $message = Swift_Message::newInstance() 16 | ->setSubject('[Swift Mailer] AttachmentSmokeTest') 17 | ->setFrom(array(SWIFT_SMOKE_EMAIL_ADDRESS => 'Swift Mailer')) 18 | ->setTo(SWIFT_SMOKE_EMAIL_ADDRESS) 19 | ->setBody('This message should contain an attached ZIP file (named "textfile.zip").'.PHP_EOL. 20 | 'When unzipped, the archive should produce a text file which reads:'.PHP_EOL. 21 | '"This is part of a Swift Mailer v4 smoke test."' 22 | ) 23 | ->attach(Swift_Attachment::fromPath($this->_attFile)) 24 | ; 25 | $this->assertEquals(1, $mailer->send($message), 26 | '%s: The smoke test should send a single message' 27 | ); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/smoke/Swift/Smoke/BasicSmokeTest.php: -------------------------------------------------------------------------------- 1 | _getMailer(); 9 | $message = Swift_Message::newInstance() 10 | ->setSubject('[Swift Mailer] BasicSmokeTest') 11 | ->setFrom(array(SWIFT_SMOKE_EMAIL_ADDRESS => 'Swift Mailer')) 12 | ->setTo(SWIFT_SMOKE_EMAIL_ADDRESS) 13 | ->setBody('One, two, three, four, five...'.PHP_EOL. 14 | 'six, seven, eight...' 15 | ) 16 | ; 17 | $this->assertEquals(1, $mailer->send($message), 18 | '%s: The smoke test should send a single message' 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/smoke/Swift/Smoke/HtmlWithAttachmentSmokeTest.php: -------------------------------------------------------------------------------- 1 | _attFile = __DIR__.'/../../../_samples/files/textfile.zip'; 11 | } 12 | 13 | public function testAttachmentSending() { 14 | $mailer = $this->_getMailer(); 15 | $message = Swift_Message::newInstance('[Swift Mailer] HtmlWithAttachmentSmokeTest') 16 | ->setFrom(array(SWIFT_SMOKE_EMAIL_ADDRESS => 'Swift Mailer')) 17 | ->setTo(SWIFT_SMOKE_EMAIL_ADDRESS) 18 | ->attach(Swift_Attachment::fromPath($this->_attFile)) 19 | ->setBody('

    This HTML-formatted message should contain an attached ZIP file (named "textfile.zip").'.PHP_EOL. 20 | 'When unzipped, the archive should produce a text file which reads:

    '.PHP_EOL. 21 | '

    This is part of a Swift Mailer v4 smoke test.

    ', 'text/html' 22 | ) 23 | ; 24 | $this->assertEquals(1, $mailer->send($message), 25 | '%s: The smoke test should send a single message' 26 | ); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/unit/Swift/Events/CommandEventTest.php: -------------------------------------------------------------------------------- 1 | _createEvent($this->_createTransport(), "FOO\r\n"); 6 | $this->assertEquals("FOO\r\n", $evt->getCommand()); 7 | } 8 | 9 | public function testSuccessCodesCanBeFetchedViaGetter() { 10 | $evt = $this->_createEvent($this->_createTransport(), "FOO\r\n", array(250)); 11 | $this->assertEquals(array(250), $evt->getSuccessCodes()); 12 | } 13 | 14 | public function testSourceIsBuffer() { 15 | $transport = $this->_createTransport(); 16 | $evt = $this->_createEvent($transport, "FOO\r\n"); 17 | $ref = $evt->getSource(); 18 | $this->assertEquals($transport, $ref); 19 | } 20 | 21 | // -- Creation Methods 22 | 23 | private function _createEvent(Swift_Transport $source, $command, $successCodes = array()) { 24 | return new Swift_Events_CommandEvent($source, $command, $successCodes); 25 | } 26 | 27 | private function _createTransport() { 28 | return $this->getMock('Swift_Transport'); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/unit/Swift/Events/EventObjectTest.php: -------------------------------------------------------------------------------- 1 | _createEvent($source); 7 | $ref = $evt->getSource(); 8 | $this->assertEquals($source, $ref); 9 | } 10 | 11 | public function testEventDoesNotHaveCancelledBubbleWhenNew() { 12 | $source = new stdClass(); 13 | $evt = $this->_createEvent($source); 14 | $this->assertFalse($evt->bubbleCancelled()); 15 | } 16 | 17 | public function testBubbleCanBeCancelledInEvent() { 18 | $source = new stdClass(); 19 | $evt = $this->_createEvent($source); 20 | $evt->cancelBubble(); 21 | $this->assertTrue($evt->bubbleCancelled()); 22 | } 23 | 24 | // -- Creation Methods 25 | 26 | private function _createEvent($source) { 27 | return new Swift_Events_EventObject($source); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/unit/Swift/Events/TransportChangeEventTest.php: -------------------------------------------------------------------------------- 1 | _createTransport(); 6 | $evt = $this->_createEvent($transport); 7 | $ref = $evt->getTransport(); 8 | $this->assertEquals($transport, $ref); 9 | } 10 | 11 | public function testSourceIsTransport() { 12 | $transport = $this->_createTransport(); 13 | $evt = $this->_createEvent($transport); 14 | $ref = $evt->getSource(); 15 | $this->assertEquals($transport, $ref); 16 | } 17 | 18 | // -- Creation Methods 19 | 20 | private function _createEvent(Swift_Transport $source) { 21 | return new Swift_Events_TransportChangeEvent($source); 22 | } 23 | 24 | private function _createTransport() { 25 | return $this->getMock('Swift_Transport'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/unit/Swift/Mime/HeaderEncoder/Base64HeaderEncoderTest.php: -------------------------------------------------------------------------------- 1 | assertEquals('B', $encoder->getName()); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/unit/Swift/Mime/SimpleMimeEntityTest.php: -------------------------------------------------------------------------------- 1 | add('>> Foo'); 8 | $data = ob_get_clean(); 9 | 10 | $this->assertEquals('>> Foo'.PHP_EOL, $data); 11 | } 12 | 13 | public function testAddingEntryDumpsEscapedLineWithHtml() { 14 | $logger = new Swift_Plugins_Loggers_EchoLogger(true); 15 | ob_start(); 16 | $logger->add('>> Foo'); 17 | $data = ob_get_clean(); 18 | 19 | $this->assertEquals('>> Foo
    '.PHP_EOL, $data); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /website/lib/swiftmailer/tests/unit/Swift/Signers/OpenDKIMSignerTest.php: -------------------------------------------------------------------------------- 1 | markTestSkipped( 10 | 'Need OpenDKIM extension run these tests.' 11 | ); 12 | } 13 | } 14 | 15 | public function testBasicSigningHeaderManipulation() { 16 | } 17 | 18 | // Default Signing 19 | public function testSigningDefaults() { 20 | } 21 | 22 | // SHA256 Signing 23 | public function testSigning256() { 24 | } 25 | 26 | // Relaxed/Relaxed Hash Signing 27 | public function testSigningRelaxedRelaxed256() { 28 | } 29 | 30 | // Relaxed/Simple Hash Signing 31 | public function testSigningRelaxedSimple256() { 32 | } 33 | 34 | // Simple/Relaxed Hash Signing 35 | public function testSigningSimpleRelaxed256() { 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /website/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: /cron 3 | Disallow: /sql 4 | Disallow: /vendor 5 | Allow: / 6 | Sitemap: https://halite.io/sitemap.xml 7 | -------------------------------------------------------------------------------- /website/script/basics_intro_halite.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | textFromURL("ar1481484242-3993659735.hlt", $("#gameReplay"), function(data) { 3 | console.log(data) 4 | if(data != null) { 5 | showGame(data, $("#gameReplay"), null, 500, true, true); 6 | } 7 | }); 8 | }) 9 | -------------------------------------------------------------------------------- /website/script/game.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | var replayName = getGET("replay"); 3 | if(replayName != null && replayName != undefined) { 4 | $("#pageContent").html("

    Loading replay...

    "); 5 | var data = textFromURL(replayName, $("#pageContent"), function(data) { 6 | console.log(data) 7 | if(data != null) { 8 | showGame(data, $("#pageContent"), null, null, true, false); 9 | } 10 | }); 11 | } else { 12 | $("#pageContent").append($("

    An unexpected error occured. If this error persists, please post on the forums or email us at halite@halite.io.

    ")); 13 | } 14 | }) 15 | -------------------------------------------------------------------------------- /website/script/index.js: -------------------------------------------------------------------------------- 1 | $(function() { 2 | $("#numUsers").html(getNumActiveUsers()); 3 | var data = textFromURL("ar1482947270-2437412300.hlt", $("#gameReplay"), function(data) { 4 | console.log(data) 5 | if(data != null) { 6 | showGame(data, $("#gameReplay"), null, 500, true, true, true, 30); 7 | } 8 | }); 9 | }) 10 | -------------------------------------------------------------------------------- /website/script/localVisualizer.js: -------------------------------------------------------------------------------- 1 | $(function () { 2 | var $dropZone = $("html"); 3 | var $filePicker = $("#filePicker"); 4 | function handleFiles(files) { 5 | // only use the first file. 6 | file = files[0]; 7 | console.log(file) 8 | var reader = new FileReader(); 9 | 10 | reader.onload = (function(filename) { // finished reading file data. 11 | return function(e2) { 12 | $("#displayArea").empty(); 13 | $("label[for=filePicker]").text("Select another file"); 14 | var fsHeight = $("#fileSelect").outerHeight(); 15 | showGame(textToGame(e2.target.result, filename), $("#displayArea"), null, -fsHeight, true, false, true); 16 | }; 17 | })(file.name); 18 | reader.readAsText(file); // start reading the file data. 19 | } 20 | 21 | $dropZone.on('dragover', function(e) { 22 | e.stopPropagation(); 23 | e.preventDefault(); 24 | }); 25 | $dropZone.on('drop', function(e) { 26 | e.stopPropagation(); 27 | e.preventDefault(); 28 | var files = e.originalEvent.dataTransfer.files; // Array of all files 29 | handleFiles(files) 30 | }); 31 | $filePicker.on('change', function(e) { 32 | var files = e.target.files 33 | handleFiles(files) 34 | }); 35 | }) 36 | -------------------------------------------------------------------------------- /website/sql/dummyData.sql: -------------------------------------------------------------------------------- 1 | DELETE FROM User; 2 | 3 | INSERT INTO User (userID, username, email, compileStatus, isRunning, language, organization) VALUES (2609, 'erdman', 'abc@gmail.com', 0, 1, 'Python', 'Other'), (1017, 'djma', 'abc@gmail.com', 0, 1, 'Java', 'Other'), (3063, 'daniel-shields', 'abc@gmail.com', 0, 1, 'Python', 'Other'); 4 | INSERT INTO Worker (apiKey, ipAddress) VALUES (1, "127.0.0.1"); 5 | -------------------------------------------------------------------------------- /website/sql/importDummyData.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "drop database Halite; create database Halite;" | mysql -u root -p 4 | mysql -u root Halite < schema.sql -p 5 | mysql -u root Halite < dummyData.sql -p 6 | -------------------------------------------------------------------------------- /website/sql/install.sh: -------------------------------------------------------------------------------- 1 | sudo apt-get install -y mysql-server 2 | 3 | echo "Starting MySql setup" 4 | ./importDummyData.sh 5 | -------------------------------------------------------------------------------- /website/style/general.css: -------------------------------------------------------------------------------- 1 | #jHeader { 2 | font-size: 50px; 3 | } 4 | 5 | #myFile { 6 | display:none; 7 | } 8 | 9 | #gameFile { 10 | display:none; 11 | } 12 | 13 | #navCont { 14 | margin:0 auto; 15 | width:90%; 16 | } 17 | 18 | #loginNav { 19 | display:inline; 20 | } 21 | 22 | #logoutNav { 23 | display:none; 24 | } 25 | 26 | #archivedTag { 27 | display:none; 28 | } 29 | 30 | .gameRow { 31 | display:none; 32 | } 33 | 34 | #leaderTable { 35 | padding-bottom:0px; 36 | margin-bottom:0px; 37 | } 38 | 39 | .gameRow { 40 | background-color:#F8F8F8; 41 | } 42 | 43 | .arrow { 44 | height: 16px; 45 | width: 16px; 46 | cursor: pointer; 47 | } 48 | 49 | .file-icon { 50 | height: 16px; 51 | width: 16px; 52 | } 53 | 54 | 55 | .jumbotron-btn { 56 | margin-top: 2px; 57 | margin-bottom: 2px; 58 | } 59 | 60 | .videoWrapper { 61 | position: relative; 62 | padding-bottom: 56.25%; /* 16:9 */ 63 | padding-top: 25px; 64 | height: 0; 65 | } 66 | .videoWrapper iframe { 67 | position: absolute; 68 | top: 0; 69 | left: 0; 70 | width: 100%; 71 | height: 100%; 72 | } 73 | 74 | .has-hover-text { 75 | cursor: pointer; 76 | } 77 | -------------------------------------------------------------------------------- /website/style/learn.css: -------------------------------------------------------------------------------- 1 | ul:not(.nav), p { 2 | line-height: 1.5em; 3 | } 4 | 5 | h1 { 6 | padding-top: 20px; 7 | padding-bottom: 9px; 8 | margin-bottom: 20px; 9 | border-bottom: 1px solid #003736; 10 | margin-top: 0; 11 | } 12 | -------------------------------------------------------------------------------- /website/tutorials/basic/BasicBot.py: -------------------------------------------------------------------------------- 1 | from hlt import * 2 | from networking import * 3 | 4 | myID, gameMap = getInit() 5 | sendInit("BasicPythonBot") 6 | 7 | while True: 8 | moves = [] 9 | gameMap = getFrame() 10 | 11 | for y in range(gameMap.height): 12 | for x in range(gameMap.width): 13 | site = gameMap.getSite(Location(x, y)) 14 | if site.owner == myID: 15 | direction = random.randint(0, 5) 16 | if site.strength < 5*site.production: 17 | direction = STILL 18 | else: 19 | for d in CARDINALS: 20 | if gameMap.getSite(Location(x, y), d).owner != myID: 21 | direction = d 22 | break 23 | moves.append(Move(Location(x, y), direction)) 24 | 25 | sendFrame(moves) 26 | -------------------------------------------------------------------------------- /website/tutorials/machinelearning/my_model_weights.h5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HaliteChallenge/Halite/822cfb6938437ae8fd607dc5cc0d1b5a62394289/website/tutorials/machinelearning/my_model_weights.h5 -------------------------------------------------------------------------------- /website/tutorials/random/ImprovedRandom.py: -------------------------------------------------------------------------------- 1 | from hlt import * 2 | from networking import * 3 | 4 | myID, gameMap = getInit() 5 | sendInit("PythonBot") 6 | 7 | while True: 8 | moves = [] 9 | gameMap = getFrame() 10 | for y in range(gameMap.height): 11 | for x in range(gameMap.width): 12 | if gameMap.getSite(Location(x, y)).owner == myID: 13 | 14 | movedPiece = False 15 | 16 | for d in CARDINALS: 17 | if gameMap.getSite(Location(x, y), d).owner != myID and gameMap.getSite(Location(x, y), d).strength < presentMap.getSite(Location(x, y)).strength: 18 | moves.append(Move(Location(x, y), d)) 19 | movedPiece = True 20 | break 21 | 22 | if not movedPiece and gameMap.getSite(Location(x, y)).strength < gameMap.getSite(Location(x, y)).production * 5: 23 | moves.append(Move(Location(x, y), STILL)) 24 | movedPiece = True 25 | 26 | if not movedPiece: 27 | moves.append(Move(Location(x, y), NORTH if bool(int(random.random() * 2)) else WEST)) 28 | movedPiece = True 29 | 30 | sendFrame(moves) -------------------------------------------------------------------------------- /worker/buildDocker.sh: -------------------------------------------------------------------------------- 1 | docker build -t 'mntruell/halite_sandbox:latest' - < Dockerfile 2 | -------------------------------------------------------------------------------- /worker/changeAPIKey.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import configparser 3 | 4 | apiKey = sys.argv[1] 5 | iniFile = "../halite.ini" 6 | 7 | parser = configparser.ConfigParser() 8 | parser.read(iniFile) 9 | parser["hce"]["apiKey"] = str(apiKey) 10 | parser.write(open(iniFile, "w")) 11 | -------------------------------------------------------------------------------- /worker/startWorkerScreen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if ! screen -list | grep -q "worker"; then 4 | screen -S worker -Ldm bash -c "cd ~/Halite/worker; sudo python3 worker.py" 5 | fi 6 | -------------------------------------------------------------------------------- /worker/stopWorkerScreen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | pkill screen 4 | docker kill $(docker ps -aq) 5 | docker rm $(docker ps -aq) 6 | --------------------------------------------------------------------------------