Showing preview only (3,159K chars total). Download the full file or copy to clipboard to get everything.
Repository: HaliteChallenge/Halite
Branch: master
Commit: 822cfb693843
Files: 701
Total size: 2.9 MB
Directory structure:
gitextract_7mjz_vb8/
├── .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
│ ├── rankReset.py
│ └── updateOrgs.py
├── airesources/
│ ├── C/
│ │ ├── MyBot.c
│ │ ├── RandomBot.c
│ │ ├── hlt.h
│ │ ├── runGame.bat
│ │ └── runGame.sh
│ ├── C++/
│ │ ├── MyBot.cpp
│ │ ├── RandomBot.cpp
│ │ ├── hlt.hpp
│ │ ├── networking.hpp
│ │ ├── 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/
│ │ └── main.py
│ ├── setupMysql.py
│ ├── travisTests.ini
│ ├── website/
│ │ ├── APITest.php
│ │ ├── GameTest.php
│ │ ├── HistoryTest.php
│ │ ├── UserTest.php
│ │ └── testFile.txt
│ └── worker/
│ ├── languageBot/
│ │ ├── LANGUAGE
│ │ └── run.sh
│ ├── loseBot/
│ │ ├── MyBot.py
│ │ └── run.sh
│ ├── testWorker.py
│ └── winBot/
│ ├── MyBot.py
│ └── run.sh
├── visualizer/
│ ├── .editorconfig
│ ├── .gitattributes
│ ├── index.html
│ ├── index.js
│ ├── main.js
│ └── package.json
├── 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/
│ │ └── favicons/
│ │ ├── browserconfig.xml
│ │ └── manifest.json
│ ├── 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
│ ├── 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/
│ │ │ ├── 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/
│ │ │ │ │ ├── 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
│ │ │ │ ├── mixins.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
│ │ ├── swiftmailer/
│ │ │ ├── .gitattributes
│ │ │ ├── .gitignore
│ │ │ ├── .travis.yml
│ │ │ ├── CHANGES
│ │ │ ├── LICENSE
│ │ │ ├── README
│ │ │ ├── VERSION
│ │ │ ├── composer.json
│ │ │ ├── lib/
│ │ │ │ ├── classes/
│ │ │ │ │ ├── Swift/
│ │ │ │ │ │ ├── Attachment.php
│ │ │ │ │ │ ├── ByteStream/
│ │ │ │ │ │ │ ├── AbstractFilterableInputStream.php
│ │ │ │ │ │ │ ├── ArrayByteStream.php
│ │ │ │ │ │ │ ├── FileByteStream.php
│ │ │ │ │ │ │ └── TemporaryFileByteStream.php
│ │ │ │ │ │ ├── CharacterReader/
│ │ │ │ │ │ │ ├── GenericFixedWidthReader.php
│ │ │ │ │ │ │ ├── UsAsciiReader.php
│ │ │ │ │ │ │ └── Utf8Reader.php
│ │ │ │ │ │ ├── CharacterReader.php
│ │ │ │ │ │ ├── CharacterReaderFactory/
│ │ │ │ │ │ │ └── SimpleCharacterReaderFactory.php
│ │ │ │ │ │ ├── CharacterReaderFactory.php
│ │ │ │ │ │ ├── CharacterStream/
│ │ │ │ │ │ │ ├── ArrayCharacterStream.php
│ │ │ │ │ │ │ └── NgCharacterStream.php
│ │ │ │ │ │ ├── CharacterStream.php
│ │ │ │ │ │ ├── ConfigurableSpool.php
│ │ │ │ │ │ ├── DependencyContainer.php
│ │ │ │ │ │ ├── DependencyException.php
│ │ │ │ │ │ ├── EmbeddedFile.php
│ │ │ │ │ │ ├── Encoder/
│ │ │ │ │ │ │ ├── Base64Encoder.php
│ │ │ │ │ │ │ ├── QpEncoder.php
│ │ │ │ │ │ │ └── Rfc2231Encoder.php
│ │ │ │ │ │ ├── Encoder.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/
│ │ │ │ │ │ │ ├── ArrayKeyCache.php
│ │ │ │ │ │ │ ├── DiskKeyCache.php
│ │ │ │ │ │ │ ├── KeyCacheInputStream.php
│ │ │ │ │ │ │ ├── NullKeyCache.php
│ │ │ │ │ │ │ └── SimpleKeyCacheInputStream.php
│ │ │ │ │ │ ├── KeyCache.php
│ │ │ │ │ │ ├── LoadBalancedTransport.php
│ │ │ │ │ │ ├── MailTransport.php
│ │ │ │ │ │ ├── Mailer/
│ │ │ │ │ │ │ ├── ArrayRecipientIterator.php
│ │ │ │ │ │ │ └── RecipientIterator.php
│ │ │ │ │ │ ├── Mailer.php
│ │ │ │ │ │ ├── MemorySpool.php
│ │ │ │ │ │ ├── Message.php
│ │ │ │ │ │ ├── Mime/
│ │ │ │ │ │ │ ├── Attachment.php
│ │ │ │ │ │ │ ├── CharsetObserver.php
│ │ │ │ │ │ │ ├── ContentEncoder/
│ │ │ │ │ │ │ │ ├── Base64ContentEncoder.php
│ │ │ │ │ │ │ │ ├── NativeQpContentEncoder.php
│ │ │ │ │ │ │ │ ├── PlainContentEncoder.php
│ │ │ │ │ │ │ │ ├── QpContentEncoder.php
│ │ │ │ │ │ │ │ ├── QpContentEncoderProxy.php
│ │ │ │ │ │ │ │ └── RawContentEncoder.php
│ │ │ │ │ │ │ ├── ContentEncoder.php
│ │ │ │ │ │ │ ├── EmbeddedFile.php
│ │ │ │ │ │ │ ├── EncodingObserver.php
│ │ │ │ │ │ │ ├── Grammar.php
│ │ │ │ │ │ │ ├── Header.php
│ │ │ │ │ │ │ ├── HeaderEncoder/
│ │ │ │ │ │ │ │ ├── Base64HeaderEncoder.php
│ │ │ │ │ │ │ │ └── QpHeaderEncoder.php
│ │ │ │ │ │ │ ├── HeaderEncoder.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/
│ │ │ │ │ │ │ ├── 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
│ │ │ │ │ │ ├── Transport.php
│ │ │ │ │ │ ├── TransportException.php
│ │ │ │ │ │ └── Validate.php
│ │ │ │ │ └── Swift.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
│ │ │ │ └── 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/
│ │ │ │ └── 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
│ │ │ ├── acceptance.conf.php.default
│ │ │ ├── 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/
│ │ │ │ └── Swift/
│ │ │ │ └── Smoke/
│ │ │ │ ├── AttachmentSmokeTest.php
│ │ │ │ ├── BasicSmokeTest.php
│ │ │ │ ├── HtmlWithAttachmentSmokeTest.php
│ │ │ │ └── InternationalSmokeTest.php
│ │ │ ├── smoke.conf.php.default
│ │ │ └── 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
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
# Linguist ignore
website/lib/* linguist-vendored=false
environment/core/json.hpp linguist-vendored=false
environment/tclap/* linguist-vendored=false
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
================================================
FILE: .gitignore
================================================
###################
## Visual Studio ##
###################
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/
# Visual Studo 2015 cache/options directory
.vs/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding addin-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
_NCrunch_*
.*crunch*.local.xml
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# Windows Azure Build Output
csx/
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
*.[Cc]ache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
#Java
*.class
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
#Doc Ordner
*.class
*.pkh
*.ctxt
*.bluej
.DS_Store
#Friggin VS
*.sln
*.vcxproj
*.vcxproj.filters
*.vcxproj.user
*.vcxproj
Halite/Visualizer/Visualizer.vcxproj
Halite/Visualizer/Visualizer.exe
############
## Python ##
############
__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so
# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
eggs/
.eggs/
*.o
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg
# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
# Translations
*.mo
*.pot
# Django stuff:
*.log
# Sphinx documentation
docs/_build/
# PyBuilder
target/
#############
## Clojure ##
#############
pom.xml
*jar
airesources/Clojure/lib
native
.lein-failures
checkouts
.lein-deps-sum
#############
## Node.js ##
#############
# Logs
logs
npm-debug.log*
# Runtime data
pids
*.pid
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
# nyc test coverage
.nyc_output
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# node-waf configuration
.lock-wscript
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules
jspm_packages
# Optional npm cache directory
.npm
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
##############
## Composer ##
##############
composer.phar
vendor/
composer.lock
##########
## Atom ##
##########
.atom-build.yml
##########
## Rust ##
##########
target/
Cargo.lock
**/*.rs.bk
###########
## OCaml ##
###########
*.annot
*.cmo
*.cma
*.cmi
*.a
*.o
*.cmx
*.cmxs
*.cmxa
# ocamlbuild working directory
_build/
# ocamlbuild targets
*.byte
*.native
# oasis generated files
setup.data
setup.log
############
## Halite ##
############
Values.sql
storage/
config.php
workingPath/
*.ini
!travisTests.ini
*.swp
*.gch
*.exe
environment/halite
worker/halite
git_pull.php
*.zip
*.7z
*.gz
!BasicJavaBot.zip
# VS Code
.vscode
airesources/C++/MyBot
airesources/C++/BasicBot
airesources/*/halite
leaderboard.png
worker/[0-9]*
environment/visualizer
environment/shaders
environment/fonts
HaliteEnvironment-Mac
HaliteEnvironment-Debian
downloads/
keys/
starterpackages/
*.pem
*.ppk
*.hlt
!interestingGame.hlt
google*.html
screenlog.*
*.dll
node_modules
/dist
================================================
FILE: .travis.yml
================================================
sudo: required
dist: trusty
language: cpp
services:
- mysql
addons:
apt:
packages:
- mysql-server-5.6
- mysql-client-core-5.6
- mysql-client-5.6
install:
- cd ~/build/HaliteChallenge/Halite/tests
- cp travisTests.ini tests.ini
- cp travisTests.ini ../halite.ini
- cd ~/build/HaliteChallenge/Halite/website
- sudo ./install.sh
- cd ~/build/HaliteChallenge/Halite/worker
- sudo ./install.sh 123
- cd ~/build/HaliteChallenge/Halite/tests
- sudo ./install.sh
- export CXX="g++-4.9"
script:
- cd ~/build/HaliteChallenge/Halite/tests/
- sudo ./runTests.sh
notifications:
slack: halite:HnrNM3effc9q8ZVvT7PqsSYC
================================================
FILE: CONTRIBUTING.md
================================================
# Halite Contributing Guide
If you find a bug or have a feature request, please [open an issue](https://github.com/HaliteChallenge/Halite/issues/new).
Want to help out? Have you implemented a patch or a new feature? Send us a pull request! If you are looking for things to do, check out [our open issues](https://github.com/HaliteChallenge/Halite/issues).
## Common Contributions
### Writing a Starter Package
If you'd like to write a starter package for a new language, see this [guide](https://halite.io/advanced_writing_sp.php).
### Adding Your Company or University
Edit [this whitelist](https://github.com/HaliteChallenge/Halite/edit/master/website/organizationWhitelist.txt) and send us a pull request. If you need to change your email, head [here](https://halite.io/email.php). We'll make sure to tag all members of your organization who have already signed up.
## Folder Contents
- `admin/` - A collection of administrative resources (ex. a technical specification)
- `airesources/` - The language-specific starter kits for writing bots
- `environment/` - The halite game engine
- `tests/` - All of the project's unit and integration tests
- `website/` - The website that hosts the competition. Includes the API that manages the game servers.
- `worker/` - The source for the worker servers that compile bots and run games safely
## Installing the website on Ubuntu
Clone the repo:
git clone https://github.com/HaliteChallenge/Halite.git
Run the website install script with root user permissions. This will install php, apache, python (and some python modules), and composer (and some composer packages):
cd website; sudo ./install.sh
Run the database install script with root user permissions. This will install mysql and insert our schema into a database titled Halite.
cd sql; sudo ./install.sh
Create a `halite.ini` file using your favorite text editor in the root project directory. Place information about your local database setup in there. Your `halite.ini` file should look like this;
[database]
hostname = 127.0.0.1
username = YOUR_LOCAL_MYSQL_USERNAME
password = YOUR_LOCAL_MYSQL_PASSWORD
name = Halite
================================================
FILE: LICENSE
================================================
The MIT License
Copyright (c) 2016 Michael Truell and Benjamin Spector
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
================================================
FILE: README.md
================================================
# Halite
[](https://travis-ci.org/HaliteChallenge/Halite)
[](https://raw.githubusercontent.com/HaliteChallenge/Halite/master/LICENSE)
Halite is a programming competition. Contestants write bots to play an original multi-player turn-based strategy game played on a rectangular grid. For more information about the game, visit [our website](http://halite.io).
## Contributing
See [the Contributing Guide](CONTRIBUTING.md).
## Questions
See [the Forums](http://2016.forums.halite.io) and [our Discord chat](https://discordapp.com/invite/rbVDB4n).
## Authors
Halite was primarily created by [Ben Spector](https://github.com/Sydriax) and [Michael Truell](https://github.com/truell20) for Two Sigma during their summer 2016 internship.
Many others contributed to Halite's developement, including [Matt Adereth](https://github.com/adereth), [Trammell Hudson](https://github.com/osresearch), and Jaques Clapauch from Two Sigma and [Arnaud Sahuguet](https://github.com/sahuguet) and [Scot Spinner](https://github.com/awesomescot) from Cornell Tech. Halite's participants, including [Nick Malaguti](https://github.com/nmalaguti), [Travis Erdman](https://github.com/erdman), and [Janzert](https://github.com/janzert), have also been instrumental to the project.
================================================
FILE: admin/checkTaskCompletion.py
================================================
#!/usr/bin/env python3
import configparser
import time
from datetime import datetime
import pymysql
parser = configparser.ConfigParser()
parser.read("../halite.ini")
DB_CONFIG = parser["database"]
def check_compiles(db):
db.begin()
with db.cursor() as cursor:
cursor.execute("SELECT COUNT(*) FROM User WHERE compileStatus != 0")
return cursor.fetchone()['COUNT(*)']
def check_workers(db, start_time):
db.begin()
with db.cursor() as cursor:
cursor.execute("SELECT workerID, lastRequestTime FROM Worker ORDER BY workerID")
workers = cursor.fetchall()
waiting = list()
for w in workers:
if w["lastRequestTime"] < start_time:
waiting.append(w)
return waiting
def main():
if ("compState" not in parser or "noGameTasks" not in parser["compState"] or
not parser["compState"]["noGameTasks"]):
print(parser["compState"]["noGameTasks"])
print("Game tasks still activated. Disable in halite.ini [compState] noGameTasks")
return
start_time = datetime.now()
db = pymysql.connect(host=DB_CONFIG['hostname'], user=DB_CONFIG['username'], passwd=DB_CONFIG['password'], db=DB_CONFIG['name'], cursorclass=pymysql.cursors.DictCursor)
compiles = 1
workers = [1]
while compiles or workers:
compiles = check_compiles(db)
workers = check_workers(db, start_time)
if compiles:
print("Waiting for %d more compiles to complete." % (compiles,))
if workers:
print("Waiting for workers: ", end="")
print(", ".join(str(w["workerID"]) for w in workers[:5]), end="")
if len(workers) > 5:
print(" and %d more" % (len(workers) - 5,))
else:
print()
time.sleep(5)
db.begin()
with db.cursor() as cursor:
cursor.execute("SELECT MAX(gameID) FROM Game")
max_game = cursor.fetchone()["MAX(gameID)"]
print("All tasks completed, last gameID %d." % (max_game,))
if __name__ == "__main__":
main()
================================================
FILE: admin/commandRunner.py
================================================
import pymysql
import threading
import configparser
import sys
import os
import os.path
def runOnWorker(worker, keyPath, command):
print("########"+worker['ipAddress']+"########")
os.system("ssh -oStrictHostKeyChecking=no -i \""+keyPath+"\" ubuntu@"+worker['ipAddress']+" '"+command+"'")
print("########"+worker['ipAddress']+"########")
parser = configparser.ConfigParser()
parser.read("../halite.ini")
DB_CONFIG = parser["database"]
keyPath = os.path.join("../", parser["aws"]["keyfilepath"])
db = pymysql.connect(host=DB_CONFIG["hostname"], user=DB_CONFIG['username'], passwd=DB_CONFIG['password'], db=DB_CONFIG['name'], cursorclass=pymysql.cursors.DictCursor)
cursor = db.cursor()
cursor.execute("select * from Worker")
workers = cursor.fetchall()
command = sys.argv[1]
isAsync = False if len(sys.argv) < 3 else int(sys.argv[2]) == 1
if isAsync:
threads = []
for worker in workers:
t = threading.Thread(target=runOnWorker, args = (worker, keyPath, command))
t.daemon = True
t.start()
threads.append(t)
for t in threads:
t.join()
else:
for worker in workers:
runOnWorker(worker, keyPath, command)
================================================
FILE: admin/cost.py
================================================
dimensions = [(1, 20), (2, 25), (3, 30), (4, 35), (3, 40), (2, 45), (1, 50)]
averagePlayersPerGame = 4
playersPerServers = 15.6
perServerCost = 3*4.68
averagePlayers = 4000
totalTime = 0
totalMatches = 0
for dimension in dimensions:
totalMatches += dimension[0]
totalTime += dimension[0] * (15000 + pow(dimension[1], 3)*10/3)
timePerPlayerPerMatch = totalTime*averagePlayers/(averagePlayersPerGame*(averagePlayers/playersPerServers)*totalMatches)
print("Time per match per player in minutes: " + str(timePerPlayerPerMatch/(60*1000)))
costPerPlayer = perServerCost/playersPerServers
print("Cost per player: " + str(costPerPlayer))
totalCost = perServerCost*(averagePlayers/playersPerServers)
print("Total cost: " + str(totalCost))
================================================
FILE: admin/cron/haliteEmailer.py
================================================
import smtplib
from email.mime.text import MIMEText
def sendEmail(senderEmail, senderPassword, subject, body, recipient):
print("Sending email")
msg = MIMEText(body, "html")
msg['Subject'] = subject
msg['From'] = senderEmail
msg['To'] = recipient
s = smtplib.SMTP('smtp.gmail.com:587')
s.ehlo()
s.starttls();
s.login(senderEmail, senderPassword)
s.sendmail(senderEmail, [recipient], msg.as_string())
s.quit()
================================================
FILE: admin/cron/install.sh
================================================
apt-get update
apt-get install -y python3 python3-pip linkchecker
pip3 install configparser pymysql
================================================
FILE: admin/cron/linkChecker.py
================================================
#!/usr/bin/env python3
import configparser
import subprocess
import haliteEmailer
parser = configparser.ConfigParser()
parser.read("../../halite.ini")
HALITE_EMAIL = parser["email"]["email"]
HALITE_EMAIL_PASSWORD = parser["email"]["password"]
command = 'linkchecker --ignore-url=^mailto: --timeout=20 https://halite.io/'
proc = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = proc.communicate()
stdout = stdout.decode('utf-8')
stderr = stderr.decode('utf-8')
if stdout.split("\n")[-3].find("0 errors") == -1:
haliteEmailer.sendEmail(HALITE_EMAIL, HALITE_EMAIL_PASSWORD, "LINK ALERT", "There seem to be some broken links on http://halite.io/.<br>Here is what was given as the output of <b>\""+command+"\"</b> (<b>You will probably want more verbose output and so will have to run the command yourself</b>).<br><br>STDOUT:<br>"+stderr+"<br><br>STDERR:<br>"+stderr+"", HALITE_EMAIL)
================================================
FILE: admin/cron/workerChecker.py
================================================
#!/usr/bin/env python3
import configparser
import pymysql
import haliteEmailer
parser = configparser.ConfigParser()
parser.read("../../halite.ini")
DB_CONFIG = parser["database"]
HALITE_EMAIL = parser["email"]["email"]
HALITE_EMAIL_PASSWORD = parser["email"]["password"]
db = pymysql.connect(host=DB_CONFIG["hostname"], user=DB_CONFIG['username'], passwd=DB_CONFIG['password'], db=DB_CONFIG['name'])
cursor = db.cursor()
cursor.execute("select * from Worker WHERE TIMESTAMPDIFF(MINUTE, lastRequestTime, NOW()) > 30")
results = cursor.fetchall()
if len(results) == 0:
print("All good!")
else:
message = "Some workers haven't communicated with the manager in a while!<br><br>"
haliteEmailer.sendEmail(HALITE_EMAIL, HALITE_EMAIL_PASSWORD, str(len(results))+" workers down", message, HALITE_EMAIL)
================================================
FILE: admin/md/DISASTER.md
================================================
# Disaster Scenarios
### Restarting each component
#### Mysql DB
SSH into the AWS instance hosting the database.
$ sudo service mysql restart
#### Website backend and Manger
SSH into the AWS instance hosting the website and manager.
$ sudo service apache2 restart
#### Workers
On your local machine, assuming that your halite.ini is configured correctly and the database is up:
$ cd admin
$ python3 commandRunner.py 'cd Halite/worker; sudo ./stopWorkerScreen.sh; ./startWorkerScreen.sh'
Let's go over that last line. The `commandRunner.py` script uses ssh to run arbitrary bash commands on all of our workers. You pass it your desired bash command as a command line arguement (in this case `cd Halite/worker; ...`). The `sudo ./stopWorkerScreen.sh` command will kill all of the screens on a worker (and therefore the process that is running `worker.py`) and will stop and remove all docker containers on a worker. `./startWorkerScreen.sh` starts a detached screen and runs `python3 worker.py` in it.
***Note:*** This will have to be updated soon. AWS doesn't let you login as root over ssh.
### Bad bot submitted
### Account DDOS
### Renew/Reinstall SSL
Run:
$ certbot-auto --apache -d halite.io -d www.halite.io
You will be presented with a couple of cursese menus. Renewing the certificate should be tried first. "Easy" (both http and https) should be picked instead of "Secure."
### Restarting from MySQL database backup
***These steps will delete all data in the production db***
Login to the backup server over SFTP using your favorite SFTP client ([Filezilla](https://filezilla-project.org/) is quite good). Navigate into the `/backup/db` folder. Grab the newest file (also the file that starts with the biggest number as these files are named by the timestamp when they were created).
Transfer this file to the home directory of the DB server directly or by downloading it to your local computer, logging into the DB server over SFTP, and then uploading it to the DB server.
SSH into the db server, and:
$ echo "drop database Halite; create database Halite;" | mysql -u root -p
$ mysql -u root -p Halite < NAME_OF_THE_SQL_FILE.sql
================================================
FILE: admin/md/INSTALL.md
================================================
# Installation
If you have not already:
git clone https://github.com/HaliteChallenge/Halite.git
### Website/Manager Server Setup
$ cd website && ./install.sh
Check that you are on php >= 5.6 and mysql >= 5.6.5:
$ `php -v; mysql -V
Symlink the repo to /var/www:
ln -s ~/Halite /var/www
Create and write a halite.ini file in the root directory of the project
Finish Apache setup:
* [Allow the following of symlinks by apache](http://superuser.com/questions/244245/how-do-i-get-apache-to-follow-symlinks)
* [Allow .htaccess override](http://stackoverflow.com/a/22526144)
* [Redirect root directory to website directory](http://serverfault.com/questions/9992/how-to-get-apache2-to-redirect-to-a-subdirectory)
* [Increase your max file upload size (worker's posting large replays, users posting big bot archives)](http://stackoverflow.com/questions/2184513/php-change-the-maximum-upload-file-size)
To setup automatic backups on the website server, copy the `backupWebsite` file in the `Halite/website/cron` folder into the server's `/etc/cron.hourly` folder, change the IP address in the file to that of the backup server, and make sure that the ssh key of the website server is in the `~/.ssh/authorized_keys` file on the backup server. Once copied, mark the `backupWebsite` file as executable and give cron permission to execute it like so:
cd /etc/cron.hourly
chmod +x backupWebsite
chmod 755 backupWebsite
### Database server setup
$ cd website/sql && ./install.sh
Add a superuser by wildcarding its host and allowing remote login. In the MySQL shell:
CREATE USER 'superuser'@'%' IDENTIFIED BY 'SOME_RANDOM_PASSWORD';
GRANT ALL PRIVILEGES ON *.* TO 'superuser'@'%' IDENTIFIED BY 'SOME_RANDOM_PASSWORD' WITH GRANT OPTION;
FLUSH PRIVILEGES;
To finish superuser setup, comment out `bind-address = 127.0.0.1` in `/etc/mysql/my.cnf`, and:
$ sudo service mysql restart
For ease of use of the mysql on the command line and for install scripts to be guranteed to run smoothly, please edit your `~/.my.cnf` to include these lines:
[mysqldump]
user=MYSQL_USERNAME
password=MYSQL_PASSWORD
[client]
user=MYSQL_USERNAME
password=MYSQL_PASSWORD
To setup automatic backups on the db server, copy the `backupDatabase` file in the `Halite/website/cron` folder into the server's `/etc/cron.hourly` folder, change the IP address in the file to the one of the backup server, and make sure that the ssh key of the db server is in the `~/.ssh/authorized_keys` file on the backup server. Once copied, mark the `backupDatabase` file as executable and give anyone permission to execute it like so:
cd /etc/cron.hourly
chmod +x backupDatabase
chmod 755 backupDatabase
### Worker server setup
***Note:*** Make sure that your `halite.ini` file points to the proper AWS key pair.
On your local machine:
$ cd website/php && python3 openNewWorker.py
================================================
FILE: admin/md/SPEC.md
================================================
# Halite Specification
Halite is an online programming challenge. Users write bots to play a simple, original game with the following rule set:
* Bots may move their pieces either north, south, east, or west every turn or choose to remain still.
* If a piece stays still, it gains strength equal to the production value of the current tile that it is on.
* If a piece moves onto a piece with the same owner, their strengths combine. Strength values are cut off at 255.
* A piece inflicts damage equal to its strength onto all adjacent pieces that are not maps squares but have a different owner and onto to all coinciding pieces that have a different owner (this includes map squares).
* When a piece has a strength < 0, it dies.
Users develop their bots locally using our game engine, zip and submit their source to our website when they are ready to test out their bot, and watch as their bot plays against others and is ranked on our leaderboard.
**Note:** This spec details how the project currently fuctions. Changes will be made before the public launch.
### Environment
The environment is written in C++ with no dependencies. The environment starts bot processes using the start commands given to it through the command line. It then communicates with bots over stdin and stdout, sending them the map and recieving their moves. A switch to using sockets for bot communication is planned. The environment outputs a replay file, with the `hlt` extension, which may be visualized [here](http://halite.io/game.php).
### Website
The frontend of halite.io is written in HTML, CSS, and Javascript. The Bootstrap 3 CSS library is used for styling. The Pixi javascript library is used for our game visualizer. The JQuery library is used for DOM manipulation and for AJAX calls. HTML files are classified as PHP files to allow the easy including of repeating HTML elements (i.e. the navigation bar). No templating is used at all on the frontend. All interactions with our backend are done through REST calls made through the JQuery AJAX library.
The backend is written in PHP. Apache is used as its webserver.
The server on which the website is hosted also hosts the manager.
To update the version of the site on the server, just:
cd ~/Halite && git pull
### HCE
The "HCE"(Halite Competition Environment) is what we call the system of servers that compiles the source code of each contestant, runs games between bots, and ranks each submission. The system consists of many worker servers and one manager server.
Worker servers query the manager server for tasks, either a compile task or a game task. If there is any bot that needs to be compiled, the manager will respond with a compile task. If there are no compile tasks, the manager will respond with a game task, which is chosen like so:
* A seed plager is chosen by picking the bot with the highest `rand()*(sigma^2)`. "Sigma" is the level of uncertainty in the Trueskill score of a bot
* An allowed rank difference `d` is computed as: `5 / rand()^0.65`
* The number of players `n` is picked at random from a range of 2-6
* The other `n-1` players are chosen at random from the players within `d`
* The width and height of the map is chosen from a range of 20-50
Once given the ID of the bot(s) that they are compiling/running, workers query the manager for the executables and source of each bot. After compilation, the resulting binary+source mix is posted to the manager. These are removed from the disk on the worker server on completion of a task.
During both compilation and runtime, bots are run within their own Docker container. Networking, RAM, CPU, and disk access is limited.
### Database
A MySQL server (5.7.1) is used as the database for the project. Our MySQL server runs on RDS.
### File Storage
Error logs, replay files, and bot source are hosted on AWS S3 standard storage.
### Forums
[The discourse forum software](https://www.discourse.org/) is used. User authentication is handled on our end through [discourse's sso](https://meta.discourse.org/t/official-single-sign-on-for-discourse/13045). The forums are run on their own server (2 GB of RAM, Ubuntu 14.04 64 bit). Automated emails are sent through halite@halite.io, using gmail as a service provider. We will migrate away from gmail for the public launch since they have quite a low cap on the number of messages per day.
### Backups
RDS backups are turned on.
### Admin Tools
A simple python script (`manager/commandRunner.py`) is used to run arbitrary commands on all of the workers listed in the `halite.ini` file.
A status page located at `halite.io/status.php` includes the time since every worker has queried the manager, the throughput of the HCE, and general stats about our user base. Google analytics is included on the site.
### Monitoring Tools
We use a series of cron jobs to alert us if one of the workers hasn't responded for a number of minutes and to alert us if there are any broken links on the site.
We plan on setting up pingdom/pagerduty to alert us of downtime.
### Configuration Files
An INI file, titled `halite.ini` and located in the root directory of the project, is used for all of our project configurations. Here is a sample halite.ini file:
```
[hce]
managerURl = http://localhost/manager/
apiKey = 1234
secretFolder = FAKE_FOLDER_NAME
[workerIPs]
FAKE_WORKER_NAME = 123.456.789.000
[email]
email = FAKE_EMAIL
password = FAKE_PASSWORD
[database]
hostname = localhost
username = root
password = pass123
name = MAIN_DB_NAME
[sso]
secret = SECRET_KEY_FORUMS
url = SINGLE_SIGN_ON_FORUMS
[forums]
apiUsername = FAKE_USERNAME
apiKey = 1234567890
[encrypt]
salt = abc123456789
[aws]
accesskey = 1234556
secretaccesskey = 1234561238378
amiid = ami-2d39803a
keyname = RandomKeyName
instancetype = t2.nano
securitygroupname = security-group-name
keyfilepath = NameOfKeyFile.pem
```
### Server Setup
Each of our servers run Ubuntu 14.04. A brief textual description of our server setup:
* One server runs the website and manager.
* Another server runs the database.
* Another server runs the forums.
* Another server runs a series of cron jobs that check for broken links or downed workers.
* Each worker runs is on its own server.
Below is a basic diagram of our server setup.

================================================
FILE: admin/md/STARTER_PACKAGE_CHECKLIST.md
================================================
Starter Package Checklist
* Make sure all proper files are present (MyBot, RandomBot, runGame.sh, runGame.bat)
* Add dependencies to docker file
* Test on game servers
* Add to archive script
* Add to downloads
* Update game server reference
================================================
FILE: admin/rankReset.py
================================================
#!/usr/bin/env python3
import configparser
import pymysql
parser = configparser.ConfigParser()
parser.read("../halite.ini")
DB_CONFIG = parser["database"]
def main():
confirm = input("This will clear all current ranks, are you sure? [y/N] ")
if confirm != "y":
return
db = pymysql.connect(host=DB_CONFIG["hostname"], user=DB_CONFIG['username'], passwd=DB_CONFIG['password'], db=DB_CONFIG['name'], cursorclass=pymysql.cursors.DictCursor)
cursor = db.cursor()
cursor.execute("SELECT COUNT(*) FROM User WHERE isRunning=1")
num_active = cursor.fetchone()['COUNT(*)']
cursor.execute("INSERT INTO UserHistory (userID, versionNumber, lastRank, lastNumPlayers, lastNumGames) SELECT userID, numSubmissions, rank, %d, numGames FROM User WHERE isRunning=1" % (num_active,))
cursor.execute("UPDATE User SET numSubmissions=numSubmissions+1, numGames=0, mu=25.0, sigma=8.333 WHERE isRunning=1")
db.commit()
db.close()
print("All ranks successfully reset.")
if __name__ == "__main__":
main()
================================================
FILE: admin/updateOrgs.py
================================================
import configparser
import pymysql
import urllib.request
parser = configparser.ConfigParser()
parser.read("../halite.ini")
DB_CONFIG = parser["database"]
db = pymysql.connect(host=DB_CONFIG["hostname"], user=DB_CONFIG['username'], passwd=DB_CONFIG['password'], db=DB_CONFIG['name'], cursorclass=pymysql.cursors.DictCursor)
cursor = db.cursor()
cursor.execute("select email, userID, organization from User")
users = cursor.fetchall()
orgs = [line.strip().split(" - ") for line in open("../website/organizationWhitelist.txt").readlines()]
for user in users:
if user["email"] == None:
continue
realUserOrg = "Other"
try:
emailDomain = user["email"].split("@")[1]
except:
pass
for org in orgs:
if emailDomain == org[1]:
realUserOrg = org[0]
break
if (realUserOrg != "Other" or user["organization"] == "") and realUserOrg != user["organization"]:
print("%s, %s, %s" % (realUserOrg, user["organization"], user["email"]))
cursor.execute("update User set organization = '"+realUserOrg+"' where userID="+str(user["userID"]))
db.commit()
================================================
FILE: airesources/C/MyBot.c
================================================
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "hlt.h"
#define BOT_NAME "MyCBot"
int main(void) {
GAME game;
int x, y, direction;
srand(time(NULL));
game = GetInit();
SendInit(BOT_NAME);
while (1) {
GetFrame(game);
for (x = 0 ; x < game.width ; x++) {
for (y = 0 ; y < game.height ; y++) {
if (game.owner[x][y] == game.playertag) {
direction = rand() % 5;
SetMove(game, x, y, direction);
}
}
}
SendFrame(game);
}
return 0;
}
================================================
FILE: airesources/C/RandomBot.c
================================================
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "hlt.h"
#define BOT_NAME "RandomCBot"
int main(void) {
GAME game;
int x, y, direction;
srand(time(NULL));
game = GetInit();
SendInit(BOT_NAME);
while (1) {
GetFrame(game);
for (x = 0 ; x < game.width ; x++) {
for (y = 0 ; y < game.height ; y++) {
if (game.owner[x][y] == game.playertag) {
direction = rand() % 5;
SetMove(game, x, y, direction);
}
}
}
SendFrame(game);
}
return 0;
}
================================================
FILE: airesources/C/hlt.h
================================================
/*
In general, none of the public functions return pointers,
nor do they take pointer arguments.
Useful functions:
GAME GetInit()
void SendInit(char *botname)
void GetFrame(GAME game)
void SetMove(GAME game, int x, int y, int direction)
void SendFrame(GAME game)
Convenience functions:
SITE GetSiteFromXY(GAME game, int x, int y)
SITE GetSiteFromMovement(GAME game, int src_x, int src_y, int direction)
Pssst! More documentation and some better bots are at:
https://github.com/fohristiwhirl/chalite
*/
#include <stdio.h>
#include <stdlib.h>
#define STILL 0
#define NORTH 1
#define EAST 2
#define SOUTH 3
#define WEST 4
typedef struct Site_struct {
int x;
int y;
int owner;
int strength;
int production;
} SITE;
typedef struct Game_struct {
int width;
int height;
int playertag;
int ** moves;
int ** owner;
int ** production;
int ** strength;
} GAME;
int ** __new_2d_int_array(int width, int height) {
int x;
int **result;
result = malloc(sizeof(int*) * width);
if (result == NULL) {
printf("Malloc 1 failed in __new_2d_int_array()\n");
exit(1);
}
for (x = 0 ; x < width ; x++) {
result[x] = malloc(sizeof(int) * height);
if (result[x] == NULL) {
printf("Malloc 2 failed in __new_2d_int_array()\n");
exit(1);
}
}
return result;
}
int __getnextint() {
int ch;
int result = 0;
int seen_any_digits = 0;
while (1) {
ch = getchar();
if (ch == EOF) {
printf("EOF received. Halite engine quit?\n");
exit(1);
}
if (ch >= 48 && ch <= 57) {
seen_any_digits = 1;
result *= 10;
result += ch - 48;
} else {
if (seen_any_digits) {
return result;
}
}
}
return 54321; // Never get here.
}
void __parseproduction(GAME game) {
int x, y;
for (y = 0 ; y < game.height ; y++) {
for (x = 0 ; x < game.width ; x++) {
game.production[x][y] = __getnextint();
}
}
return;
}
void __parsemap(GAME game) {
int x, y;
int run;
int owner;
int total_set;
int set_this_run;
x = 0;
y = 0;
total_set = 0;
set_this_run = 0;
while (total_set < game.width * game.height) {
run = __getnextint();
owner = __getnextint();
for (set_this_run = 0 ; set_this_run < run ; set_this_run++) {
game.owner[x][y] = owner;
total_set++;
x++;
if (x == game.width) {
x = 0;
y += 1;
}
}
}
for (y = 0 ; y < game.height ; y++) {
for (x = 0 ; x < game.width ; x++) {
game.strength[x][y] = __getnextint();
}
}
return;
}
GAME GetInit() {
GAME game;
game.playertag = __getnextint();
game.width = __getnextint();
game.height = __getnextint();
game.moves = __new_2d_int_array(game.width, game.height);
game.owner = __new_2d_int_array(game.width, game.height);
game.production = __new_2d_int_array(game.width, game.height);
game.strength = __new_2d_int_array(game.width, game.height);
__parseproduction(game);
__parsemap(game);
return game;
}
void SendInit(char *botname) {
printf("%s\n", botname);
fflush(stdout);
}
void GetFrame(GAME game) {
int x, y;
__parsemap(game);
// Reset the moves array while we're at it.
for (x = 0 ; x < game.width ; x++) {
for (y = 0 ; y < game.height ; y++) {
game.moves[x][y] = STILL;
}
}
return;
}
int __sanitise_x(GAME game, int x) {
if (x < 0) {
x += -(x / game.width) * game.width + game.width; // Can make x == width, so must still use % next
}
x %= game.width;
return x;
}
int __sanitise_y(GAME game, int y) {
if (y < 0) {
y += -(y / game.height) * game.height + game.height; // Can make y == height, so must still use % next
}
y %= game.height;
return y;
}
SITE GetSiteFromXY(GAME game, int x, int y) {
SITE result;
x = __sanitise_x(game, x);
y = __sanitise_y(game, y);
result.x = x;
result.y = y;
result.owner = game.owner[result.x][result.y];
result.production = game.production[result.x][result.y];
result.strength = game.strength[result.x][result.y];
return result;
}
SITE GetSiteFromMovement(GAME game, int src_x, int src_y, int direction) {
SITE result;
int x, y;
x = src_x;
y = src_y;
switch (direction) {
case NORTH:
y--;
break;
case EAST:
x++;
break;
case SOUTH:
y++;
break;
case WEST:
x--;
break;
}
x = __sanitise_x(game, x);
y = __sanitise_y(game, y);
result = GetSiteFromXY(game, x, y);
return result;
}
void SetMove(GAME game, int x, int y, int direction) {
x = __sanitise_x(game, x);
y = __sanitise_y(game, y);
game.moves[x][y] = direction;
return;
}
void SendFrame(GAME game) {
int x, y;
for (x = 0 ; x < game.width ; x++) {
for (y = 0 ; y < game.height ; y++) {
if (game.moves[x][y] != STILL && game.owner[x][y] == game.playertag) {
printf("%d %d %d ", x, y, game.moves[x][y]);
}
}
}
printf("\n");
fflush(stdout);
return;
}
================================================
FILE: airesources/C/runGame.bat
================================================
gcc MyBot.c -o MyBot.exe
gcc RandomBot.c -o RandomBot.exe
.\halite.exe -d "30 30" "MyBot.exe" "RandomBot.exe"
================================================
FILE: airesources/C/runGame.sh
================================================
#!/bin/bash
gcc MyBot.c -o MyBot.o
gcc RandomBot.c -o RandomBot.o
./halite -d "30 30" "./MyBot.o" "./RandomBot.o"
================================================
FILE: airesources/C++/MyBot.cpp
================================================
#include <stdlib.h>
#include <time.h>
#include <cstdlib>
#include <ctime>
#include <time.h>
#include <set>
#include <fstream>
#include "hlt.hpp"
#include "networking.hpp"
int main() {
srand(time(NULL));
std::cout.sync_with_stdio(0);
unsigned char myID;
hlt::GameMap presentMap;
getInit(myID, presentMap);
sendInit("MyC++Bot");
std::set<hlt::Move> moves;
while(true) {
moves.clear();
getFrame(presentMap);
for(unsigned short a = 0; a < presentMap.height; a++) {
for(unsigned short b = 0; b < presentMap.width; b++) {
if (presentMap.getSite({ b, a }).owner == myID) {
moves.insert({ { b, a }, (unsigned char)(rand() % 5) });
}
}
}
sendFrame(moves);
}
return 0;
}
================================================
FILE: airesources/C++/RandomBot.cpp
================================================
#include <stdlib.h>
#include <time.h>
#include <cstdlib>
#include <ctime>
#include <time.h>
#include <set>
#include <fstream>
#include "hlt.hpp"
#include "networking.hpp"
int main() {
srand(time(NULL));
std::cout.sync_with_stdio(0);
unsigned char myID;
hlt::GameMap presentMap;
getInit(myID, presentMap);
sendInit("RandomC++Bot");
std::set<hlt::Move> moves;
while(true) {
moves.clear();
getFrame(presentMap);
for(unsigned short a = 0; a < presentMap.height; a++) {
for(unsigned short b = 0; b < presentMap.width; b++) {
if (presentMap.getSite({ b, a }).owner == myID) {
moves.insert({ { b, a }, (unsigned char)(rand() % 5) });
}
}
}
sendFrame(moves);
}
return 0;
}
================================================
FILE: airesources/C++/hlt.hpp
================================================
#ifndef HLT_H
#define HLT_H
#include <list>
#include <vector>
#include <random>
#define STILL 0
#define NORTH 1
#define EAST 2
#define SOUTH 3
#define WEST 4
const int DIRECTIONS[] = {STILL, NORTH, EAST, SOUTH, WEST};
const int CARDINALS[] = {NORTH, EAST, SOUTH, WEST};
namespace hlt{
struct Location{
unsigned short x, y;
};
static bool operator<(const Location& l1, const Location& l2) {
return ((l1.x + l1.y)*((unsigned int)l1.x + l1.y + 1) / 2) + l1.y < ((l2.x + l2.y)*((unsigned int)l2.x + l2.y + 1) / 2) + l2.y;
}
struct Site{
unsigned char owner;
unsigned char strength;
unsigned char production;
};
class GameMap{
public:
std::vector< std::vector<Site> > contents;
unsigned short width, height; //Number of rows & columns, NOT maximum index.
GameMap() {
width = 0;
height = 0;
contents = std::vector< std::vector<Site> >(height, std::vector<Site>(width, { 0, 0, 0 }));
}
GameMap(const GameMap &otherMap) {
width = otherMap.width;
height = otherMap.height;
contents = otherMap.contents;
}
GameMap(int w, int h) {
width = w;
height = h;
contents = std::vector< std::vector<Site> >(height, std::vector<Site>(width, { 0, 0, 0 }));
}
bool inBounds(Location l) {
return l.x < width && l.y < height;
}
float getDistance(Location l1, Location l2) {
short dx = abs(l1.x - l2.x), dy = abs(l1.y - l2.y);
if(dx > width / 2) dx = width - dx;
if(dy > height / 2) dy = height - dy;
return dx + dy;
}
float getAngle(Location l1, Location l2) {
short dx = l2.x - l1.x, dy = l2.y - l1.y;
if(dx > width - dx) dx -= width;
else if(-dx > width + dx) dx += width;
if(dy > height - dy) dy -= height;
else if(-dy > height + dy) dy += height;
return atan2(dy, dx);
}
Location getLocation(Location l, unsigned char direction) {
if(direction != STILL) {
if(direction == NORTH) {
if(l.y == 0) l.y = height - 1;
else l.y--;
}
else if(direction == EAST) {
if(l.x == width - 1) l.x = 0;
else l.x++;
}
else if(direction == SOUTH) {
if(l.y == height - 1) l.y = 0;
else l.y++;
}
else if(direction == WEST) {
if(l.x == 0) l.x = width - 1;
else l.x--;
}
}
return l;
}
Site& getSite(Location l, unsigned char direction = STILL) {
l = getLocation(l, direction);
return contents[l.y][l.x];
}
};
struct Move{
Location loc; unsigned char dir;
};
static bool operator<(const Move& m1, const Move& m2) {
unsigned int l1Prod = ((m1.loc.x + m1.loc.y)*((unsigned int)m1.loc.x + m1.loc.y + 1) / 2) + m1.loc.y, l2Prod = ((m2.loc.x + m2.loc.y)*((unsigned int)m2.loc.x + m2.loc.y + 1) / 2) + m2.loc.y;
return ((l1Prod + m1.dir)*(l1Prod + m1.dir + 1) / 2) + m1.dir < ((l2Prod + m2.dir)*(l2Prod + m2.dir + 1) / 2) + m2.dir;
}
}
#endif
================================================
FILE: airesources/C++/networking.hpp
================================================
#ifndef AI_NETWORKING_H
#define AI_NETWORKING_H
#include <iostream>
#include <time.h>
#include <set>
#include <cfloat>
#include <fstream>
#include <string>
#include <sstream>
#include <algorithm>
#include <bitset>
#ifdef _WIN32
#include <sys/types.h>
#include <Winsock2.h>
#include <Ws2tcpip.h>
#define WINSOCKVERSION MAKEWORD(2,2)
#else
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <time.h>
#endif
#include "hlt.hpp"
namespace detail{
static std::vector< std::vector<unsigned char> > productions;
static int width, height;
static std::string serializeMoveSet(const std::set<hlt::Move> &moves) {
std::ostringstream oss;
for(auto a = moves.begin(); a != moves.end(); ++a) oss << a->loc.x << " " << a->loc.y << " " << (int)a->dir << " ";
return oss.str();
}
static void deserializeMapSize(const std::string & inputString) {
std::stringstream iss(inputString);
iss >> width >> height;
}
static void deserializeProductions(const std::string & inputString) {
std::stringstream iss(inputString);
productions.resize(height);
short temp;
for(auto a = productions.begin(); a != productions.end(); a++) {
a->resize(width);
for(auto b = a->begin(); b != a->end(); b++) {
iss >> temp;
*b = temp;
}
}
}
static hlt::GameMap deserializeMap(const std::string & inputString) {
std::stringstream iss(inputString);
hlt::GameMap map(width, height);
//Set productions
for(int a = 0; a < map.height; a++) {
for(int b = 0; b < map.width; b++) {
map.contents[a][b].production = productions[a][b];
}
}
//Run-length encode of owners
unsigned short y = 0, x = 0;
unsigned short counter = 0, owner = 0;
while(y != map.height) {
for(iss >> counter >> owner; counter; counter--) {
map.contents[y][x].owner = owner;
x++;
if(x == map.width) {
x = 0;
y++;
}
}
}
for (int a = 0; a < map.contents.size(); a++) {
for (int b = 0; b < map.contents[a].size(); b++) {
short strengthShort;
iss >> strengthShort;
map.contents[a][b].strength = strengthShort;
}
}
return map;
}
static void sendString(const std::string & sendString) {
if(sendString.length() < 1) std::cout << ' ' << std::endl; //Automatically flushes.
else std::cout << sendString << std::endl; //Automatically flushes.
}
static std::string getString() {
std::string newString;
std::getline(std::cin, newString);
return newString;
}
}
static void getInit(unsigned char& playerTag, hlt::GameMap& m) {
playerTag = (unsigned char)std::stoi(detail::getString());
detail::deserializeMapSize(detail::getString());
detail::deserializeProductions(detail::getString());
m = detail::deserializeMap(detail::getString());
}
static void sendInit(std::string name) {
detail::sendString(name);
}
static void getFrame(hlt::GameMap& m) {
m = detail::deserializeMap(detail::getString());
}
static void sendFrame(const std::set<hlt::Move> &moves) {
detail::sendString(detail::serializeMoveSet(moves));
}
#endif
================================================
FILE: airesources/C++/runGame.bat
================================================
g++ -std=c++11 MyBot.cpp -o MyBot.exe
g++ -std=c++11 RandomBot.cpp -o RandomBot.exe
.\halite.exe -d "30 30" "MyBot.exe" "RandomBot.exe"
================================================
FILE: airesources/C++/runGame.sh
================================================
#!/bin/bash
g++ -std=c++11 MyBot.cpp -o MyBot.o
g++ -std=c++11 RandomBot.cpp -o RandomBot.o
./halite -d "30 30" "./MyBot.o" "./RandomBot.o"
================================================
FILE: airesources/CSharp/Halite.csproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{1460A17A-7E8B-4643-B0A9-06A1B86F07E9}</ProjectGuid>
<OutputType>Exe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Halite</RootNamespace>
<AssemblyName>Halite</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject>Halite.MyBot</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="HaliteHelper.cs" />
<Compile Include="MyBot.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
================================================
FILE: airesources/CSharp/HaliteHelper.cs
================================================
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
/// <summary>
/// Helpful for debugging.
/// </summary>
public static class Log
{
private static string _logPath;
/// <summary>
/// File must exist
/// </summary>
public static void Setup(string logPath) {
_logPath = logPath;
}
public static void Information(string message) {
if (!string.IsNullOrEmpty(_logPath))
File.AppendAllLines(_logPath, new[] {string.Format("{0}: {1}", DateTime.Now.ToShortTimeString(), message)});
}
public static void Error(Exception exception) {
Log.Information(string.Format("ERROR: {0} {1}", exception.Message, exception.StackTrace));
}
}
public static class Networking
{
private static string ReadNextLine() {
var str = Console.ReadLine();
if (str == null) throw new ApplicationException("Could not read next line from stdin");
return str;
}
private static void SendString(string str) {
Console.WriteLine(str);
}
/// <summary>
/// Call once at the start of a game to load the map and player tag from the first four stdin lines.
/// </summary>
public static Map getInit(out ushort playerTag) {
// Line 1: Player tag
if (!ushort.TryParse(ReadNextLine(), out playerTag))
throw new ApplicationException("Could not get player tag from stdin during init");
// Lines 2-4: Map
var map = Map.ParseMap(ReadNextLine(), ReadNextLine(), ReadNextLine());
return map;
}
/// <summary>
/// Call every frame to update the map to the next one provided by the environment.
/// </summary>
public static void getFrame(ref Map map) {
map.Update(ReadNextLine());
}
/// <summary>
/// Call to acknowledge the initail game map and start the game.
/// </summary>
public static void SendInit(string botName) {
SendString(botName);
}
/// <summary>
/// Call to send your move orders and complete your turn.
/// </summary>
public static void SendMoves(IEnumerable<Move> moves) {
SendString(Move.MovesToString(moves));
}
}
public enum Direction
{
Still = 0,
North = 1,
East = 2,
South = 3,
West = 4
}
public struct Site
{
public ushort Owner { get; internal set; }
public ushort Strength { get; internal set; }
public ushort Production { get; internal set; }
}
public struct Location
{
public ushort X;
public ushort Y;
}
public struct Move
{
public Location Location;
public Direction Direction;
internal static string MovesToString(IEnumerable<Move> moves) {
return string.Join(" ", moves.Select(m => string.Format("{0} {1} {2}", m.Location.X, m.Location.Y, (int)m.Direction)));
}
}
/// <summary>
/// State of the game at every turn. Use <see cref="GetInitialMap"/> to get the map for a new game from
/// stdin, and use <see cref="NextTurn"/> to update the map after orders for a turn have been executed.
/// </summary>
public class Map
{
public void Update(string gameMapStr) {
var gameMapValues = new Queue<string>(gameMapStr.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries));
ushort x = 0, y = 0;
while (y < Height) {
ushort counter, owner;
if (!ushort.TryParse(gameMapValues.Dequeue(), out counter))
throw new ApplicationException("Could not get some counter from stdin");
if (!ushort.TryParse(gameMapValues.Dequeue(), out owner))
throw new ApplicationException("Could not get some owner from stdin");
while (counter > 0) {
_sites[x, y].Owner = owner;
x++;
if (x == Width) {
x = 0;
y++;
}
counter--;
}
}
var strengthValues = gameMapValues; // Referencing same queue, but using a name that is more clear
for (y = 0; y < Height; y++) {
for (x = 0; x < Width; x++) {
ushort strength;
if (!ushort.TryParse(strengthValues.Dequeue(), out strength))
throw new ApplicationException("Could not get some strength value from stdin");
_sites[x, y].Strength = strength;
}
}
}
/// <summary>
/// Get a read-only structure representing the current state of the site at the supplied coordinates.
/// </summary>
public Site this[ushort x, ushort y] {
get {
if (x >= Width)
throw new IndexOutOfRangeException(string.Format("Cannot get site at ({0},{1}) beacuse width is only {2}", x, y, Width));
if (y >= Height)
throw new IndexOutOfRangeException(string.Format("Cannot get site at ({0},{1}) beacuse height is only {2}", x, y, Height));
return _sites[x, y];
}
}
/// <summary>
/// Get a read-only structure representing the current state of the site at the supplied location.
/// </summary>
public Site this[Location location] => this[location.X, location.Y];
/// <summary>
/// Returns the width of the map.
/// </summary>
public ushort Width => (ushort)_sites.GetLength(0);
/// <summary>
/// Returns the height of the map.
/// </summary>
public ushort Height => (ushort)_sites.GetLength(1);
#region Implementation
private readonly Site[,] _sites;
private Map(ushort width, ushort height) {
_sites = new Site[width, height];
for (ushort x = 0; x < width; x++) {
for (ushort y = 0; y < height; y++) {
_sites[x, y] = new Site();
}
}
}
private static Tuple<ushort, ushort> ParseMapSize(string mapSizeStr) {
ushort width, height;
var parts = mapSizeStr.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries);
if (parts.Length != 2 || !ushort.TryParse(parts[0], out width) || !ushort.TryParse(parts[1], out height))
throw new ApplicationException("Could not get map size from stdin during init");
return Tuple.Create(width, height);
}
public static Map ParseMap(string mapSizeStr, string productionMapStr, string gameMapStr) {
var mapSize = ParseMapSize(mapSizeStr);
var map = new Map(mapSize.Item1, mapSize.Item2);
var productionValues = new Queue<string>(productionMapStr.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries));
ushort x, y;
for (y = 0; y < map.Height; y++) {
for (x = 0; x < map.Width; x++) {
ushort production;
if (!ushort.TryParse(productionValues.Dequeue(), out production))
throw new ApplicationException("Could not get some production value from stdin");
map._sites[x, y].Production = production;
}
}
map.Update(gameMapStr);
return map;
}
#endregion
}
================================================
FILE: airesources/CSharp/MyBot.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
public class MyBot
{
public const string MyBotName = "MyC#Bot";
public static void Main(string[] args) {
Console.SetIn(Console.In);
Console.SetOut(Console.Out);
ushort myID;
var map = Networking.getInit(out myID);
/* ------
Do more prep work, see rules for time limit
------ */
Networking.SendInit(MyBotName); // Acknoweldge the init and begin the game
var random = new Random();
while (true) {
Networking.getFrame(ref map); // Update the map to reflect the moves before this turn
var moves = new List<Move>();
for (ushort x = 0; x < map.Width; x++) {
for (ushort y = 0; y < map.Height; y++) {
if (map[x, y].Owner == myID) {
moves.Add(new Move {
Location = new Location {X = x, Y = y},
Direction = (Direction)random.Next(5)
});
}
}
}
Networking.SendMoves(moves); // Send moves
}
}
}
================================================
FILE: airesources/CSharp/Properties/AssemblyInfo.cs
================================================
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Halite")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Halite")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1460a17a-7e8b-4643-b0a9-06a1b86f07e9")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
================================================
FILE: airesources/CSharp/RandomBot.cs
================================================
using System;
using System.Collections.Generic;
using System.Linq;
public class MyBot
{
public const string RandomBotName = "RandomC#Bot";
public static void Main(string[] args) {
Console.SetIn(Console.In);
Console.SetOut(Console.Out);
ushort myID;
var map = Networking.getInit(out myID);
Networking.SendInit(RandomBotName);
var random = new Random();
while (true) {
Networking.getFrame(ref map);
var moves = new List<Move>();
for (ushort x = 0; x < map.Width; x++) {
for (ushort y = 0; y < map.Height; y++) {
if (map[x, y].Owner == myID) {
moves.Add(new Move {
Location = new Location {X = x, Y = y},
Direction = (Direction)random.Next(5)
});
}
}
}
Networking.SendMoves(moves); // Send moves
}
}
}
================================================
FILE: airesources/CSharp/runGame.bat
================================================
csc /t:library /out:HaliteHelper.dll HaliteHelper.cs
csc /reference:HaliteHelper.dll -out:MyBot.exe MyBot.cs
csc /reference:HaliteHelper.dll -out:RandomBot.exe RandomBot.cs
halite -d "30 30" "MyBot.exe" "RandomBot.exe"
================================================
FILE: airesources/CSharp/runGame.sh
================================================
#!/bin/bash
mcs -t:library -out:HaliteHelper.dll HaliteHelper.cs
mcs -reference:HaliteHelper.dll -out:MyBot.o MyBot.cs
mcs -reference:HaliteHelper.dll -out:RandomBot.o RandomBot.cs
./halite -d "30 30" "./MyBot.o" "./RandomBot.o"
================================================
FILE: airesources/Clojure/.gitignore
================================================
/target
/classes
/checkouts
pom.xml
pom.xml.asc
*.jar
*.class
/.lein-*
/.nrepl-port
.hgignore
.hg/
================================================
FILE: airesources/Clojure/README.md
================================================
# halite-clj
A Clojure implementation of a random Halite bot.
## Usage
First, copy the "halite" executable to the root of your project. Build using "lein uberjar" and run:
./halite -d "30 30" "java -cp target/MyBot.jar MyBot" "java -cp target/MyBot.jar RandomBot"
================================================
FILE: airesources/Clojure/project.clj
================================================
(defproject halite-clj "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]]
:uberjar-name "MyBot.jar"
:main MyBot
:profiles {:uberjar {:aot :all}}
)
================================================
FILE: airesources/Clojure/runGame.bat
================================================
call lein uberjar
halite.exe -d "30 30" "java -cp target/MyBot.jar MyBot" "java -cp target/MyBot.jar RandomBot"
================================================
FILE: airesources/Clojure/runGame.sh
================================================
#!/bin/bash
lein uberjar
./halite -d "30 30" "java -cp target/MyBot.jar MyBot" "java -cp target/MyBot.jar RandomBot"
================================================
FILE: airesources/Clojure/src/MyBot.clj
================================================
(ns MyBot
(:require [game]
[io])
(:gen-class))
(def bot-name "MyFirstClojureBot")
(defn random-moves
"Takes a 2D vector of sites and returns a list of [site, direction] pairs"
[my-id game-map]
(let [my-sites (->> game-map
flatten
(filter #(= (:owner %) my-id)))]
(map vector my-sites (repeatedly #(rand-nth game/directions)))))
(defn -main []
(let [{:keys [my-id productions width height game-map]} (io/get-init!)]
;; Do any initialization you want with the starting game-map before submitting the bot-name
(println bot-name)
(doseq [turn (range)]
(let [game-map (io/create-game-map width height productions (io/read-ints!))]
(io/send-moves! (random-moves my-id game-map))))))
================================================
FILE: airesources/Clojure/src/RandomBot.clj
================================================
(ns RandomBot
(:require [game]
[io])
(:gen-class))
(def bot-name "RandomClojureBot")
(defn random-moves
"Takes a 2D vector of sites and returns a list of [site, direction] pairs"
[my-id game-map]
(let [my-sites (->> game-map
flatten
(filter #(= (:owner %) my-id)))]
(map vector my-sites (repeatedly #(rand-nth game/directions)))))
(defn -main []
(let [{:keys [my-id productions width height game-map]} (io/get-init!)]
;; Do any initialization you want with the starting game-map before submitting the bot-name
(println bot-name)
(doseq [turn (range)]
(let [game-map (io/create-game-map width height productions (io/read-ints!))]
(io/send-moves! (random-moves my-id game-map))))))
================================================
FILE: airesources/Clojure/src/game.clj
================================================
(ns game
(:gen-class))
;; The map is represented by a 2D vector of Sites
(defrecord Site [^int x ^int y ^int production ^int strength ^int owner])
(def directions [:still :north :east :south :west])
(def cardinal-directions (rest directions))
(defn adjacent-site [game-map site direction]
(let [width (count (first game-map))
height (count game-map)
new-x (condp = direction
:west (mod (dec (:x site)) width)
:east (mod (inc (:x site)) width)
(:x site))
new-y (condp = direction
:north (mod (dec (:y site)) height)
:south (mod (inc (:y site)) height)
(:y site))]
(get-in game-map [new-y new-x])))
(defn single-dimension-distance
"Computes the distance between two integers mod m"
[p1 p2 m]
(let [unwrapped-distance (Math/abs (- p1 p2))]
(min unwrapped-distance (- m unwrapped-distance))))
(defn distance [game-map site1 site2]
(+ (single-dimension-distance (:x site1) (:x site2) (count (first game-map)))
(single-dimension-distance (:y site1) (:y site2) (count game-map))))
================================================
FILE: airesources/Clojure/src/io.clj
================================================
(ns io
(:require clojure.string
game)
(:gen-class))
(defn create-game-map
"Parses the run-length encoded format of the map into a 2D vector of Sites"
[width height productions compressed-map]
(let [total-size (* width height)
potential-owner-run-pairs (partition 2 compressed-map)
owner-pair-count (->> potential-owner-run-pairs
(map first)
(reductions + 0)
(take-while #(not= total-size %))
(count))
owners (->> potential-owner-run-pairs
(take owner-pair-count)
(mapcat #(repeat (first %) (second %))))
strengths (->> compressed-map
(drop (* 2 owner-pair-count)))
flat-sites (map game/->Site
(cycle (range width))
(mapcat #(repeat width %) (range))
productions
strengths
owners)]
(mapv vec (partition width flat-sites))))
(defn read-ints!
"Reads a sequence of space-delimited integers from *in*"
[]
(map #(Integer/parseInt %)
(clojure.string/split (read-line) #" ")))
(defn get-init!
"Reads all the initialization data provided by the Halite environment process"
[]
(let [my-id (Integer/parseInt (read-line))
[width height] (read-ints!)
productions (read-ints!)
game-map (create-game-map width height productions (read-ints!))]
{:my-id my-id :width width :height height :productions productions :game-map game-map}))
(def direction->int (zipmap game/directions (range)))
(defn- format-moves-for-output [moves]
(clojure.string/join " "
(for [[site direction] moves]
(clojure.string/join " " [(:x site) (:y site) (direction->int direction)]))))
(defn send-moves!
"Submits a list of [site, direction] pairs to the Halite enviroment process"
[moves]
(println (format-moves-for-output moves)))
================================================
FILE: airesources/Go/MyBot.go
================================================
package main
import (
"hlt"
"math/rand"
)
func main() {
conn, gameMap := hlt.NewConnection()
conn.SendName("MyBot")
for {
var moves hlt.MoveSet
gameMap = conn.GetFrame()
for y := 0; y < gameMap.Height; y++ {
for x := 0; x < gameMap.Width; x++ {
loc := hlt.NewLocation(x, y)
if gameMap.GetSite(loc, hlt.STILL).Owner == conn.PlayerTag {
moves = append(moves, hlt.Move{
Location: loc,
Direction: hlt.Direction(rand.Int() % 5),
})
}
}
}
conn.SendFrame(moves)
}
}
================================================
FILE: airesources/Go/RandomBot.go
================================================
package main
import (
"hlt"
"math/rand"
)
func main() {
conn, gameMap := hlt.NewConnection()
conn.SendName("RandomBot")
for {
var moves hlt.MoveSet
gameMap = conn.GetFrame()
for y := 0; y < gameMap.Height; y++ {
for x := 0; x < gameMap.Width; x++ {
loc := hlt.NewLocation(x, y)
if gameMap.GetSite(loc, hlt.STILL).Owner == conn.PlayerTag {
moves = append(moves, hlt.Move{
Location: loc,
Direction: hlt.Direction(rand.Int() % 5),
})
}
}
}
conn.SendFrame(moves)
}
}
================================================
FILE: airesources/Go/runGame.bat
================================================
.\halite.exe -d "30 30" "go run MyBot.go" "go run RandomBot.go"
================================================
FILE: airesources/Go/runGame.sh
================================================
#!/bin/bash
export GOPATH="$(pwd)"
./halite -d "30 30" "go run MyBot.go" "go run RandomBot.go"
================================================
FILE: airesources/Go/src/hlt/gamemap.go
================================================
package hlt
import (
"log"
"math"
"strconv"
)
type GameMap struct {
Width, Height int
Contents [][]Site
}
func NewGameMap(width, height int) GameMap {
gameMap := GameMap{
Width: width,
Height: height,
}
gameMap.Contents = make([][]Site, height)
for y := 0; y < height; y++ {
gameMap.Contents[y] = make([]Site, width)
for x := 0; x < width; x++ {
gameMap.Contents[y][x] = Site{}
}
}
return gameMap
}
func int_str_array_pop(input []string) (int, []string) {
ret, err := strconv.Atoi(input[0])
input = input[1:]
if err != nil {
log.Printf("Whoopse", err)
}
return ret, input
}
func (m *GameMap) InBounds(loc Location) bool {
return loc.X >= 0 && loc.X < m.Width && loc.Y >= 0 && loc.Y < m.Height
}
func (m *GameMap) GetDistance(loc1, loc2 Location) int {
dx := int(math.Abs(float64(loc1.X) - float64(loc2.X)))
dy := int(math.Abs(float64(loc1.Y) - float64(loc2.Y)))
if dx > m.Width/2 {
dx = m.Width - dx
}
if dy > m.Width/2 {
dy = m.Height - dy
}
return dx + dy
}
func (m *GameMap) GetAngle(loc1, loc2 Location) float64 {
dx := loc2.X - loc1.X
dy := loc2.Y - loc1.Y
if dx > m.Width-dx {
dx -= m.Width
} else if -dx > m.Width+dx {
dx += m.Width
}
if dy > m.Height-dy {
dx -= m.Height
} else if -dy > m.Height+dy {
dy += m.Height
}
return math.Atan2(float64(dy), float64(dx))
}
func (m *GameMap) GetLocation(loc Location, direction Direction) Location {
switch direction {
case NORTH:
if loc.Y == 0 {
loc.Y = m.Height - 1
} else {
loc.Y -= 1
}
case EAST:
if loc.X == m.Width-1 {
loc.X = 0
} else {
loc.X += 1
}
case SOUTH:
if loc.Y == m.Height-1 {
loc.Y = 0
} else {
loc.Y += 1
}
case WEST:
if loc.X == 0 {
loc.X = m.Width - 1
} else {
loc.X -= 1
}
}
return loc
}
func (m *GameMap) GetSite(loc Location, direction Direction) Site {
loc = m.GetLocation(loc, direction)
return m.Contents[loc.Y][loc.X]
}
================================================
FILE: airesources/Go/src/hlt/networking.go
================================================
package hlt
import (
"bufio"
"fmt"
"io"
"log"
"os"
"strconv"
"strings"
)
type Direction int
const (
STILL Direction = iota
NORTH
EAST
SOUTH
WEST
)
var Directions = []Direction{STILL, NORTH, EAST, SOUTH, WEST}
var CARDINALS = []Direction{NORTH, EAST, SOUTH, WEST}
type Site struct {
Owner int
Strength int
Production int
}
type Location struct {
Y, X int
}
func NewLocation(x, y int) Location {
return Location{
X: x,
Y: y,
}
}
type Move struct {
Location Location
Direction Direction
}
type MoveSet []Move
func (ms MoveSet) serialize() string {
var retstr string
for _, move := range ms {
retstr = fmt.Sprintf("%s %d %d %d", retstr, move.Location.X, move.Location.Y, move.Direction)
}
return retstr
}
type Connection struct {
width, height int
PlayerTag int
productions [][]int
reader *bufio.Reader
writer io.Writer
}
func (c *Connection) deserializeMap() GameMap {
splitString := strings.Split(c.getString(), " ")
m := NewGameMap(c.width, c.height)
var x, y, owner, counter int
for y != m.Height {
counter, splitString = int_str_array_pop(splitString)
owner, splitString = int_str_array_pop(splitString)
for a := 0; a < counter; a++ {
m.Contents[y][x].Owner = owner
x += 1
if x == m.Width {
x = 0
y += 1
}
}
}
for y := 0; y < m.Height; y++ {
for x := 0; x < m.Width; x++ {
m.Contents[y][x].Strength, splitString = int_str_array_pop(splitString)
m.Contents[y][x].Production = c.productions[y][x]
}
}
return m
}
func (c *Connection) sendString(input string) {
fmt.Println(input)
}
func (c *Connection) getString() string {
retstr, _ := c.reader.ReadString('\n')
retstr = strings.TrimSpace(retstr)
return retstr
}
func (c *Connection) getInt() int {
i, err := strconv.Atoi(c.getString())
if err != nil {
log.Printf("Whoopse", err)
}
return i
}
func (c *Connection) deserializeMapSize() {
splitString := strings.Split(c.getString(), " ")
c.width, splitString = int_str_array_pop(splitString)
c.height, splitString = int_str_array_pop(splitString)
}
func (c *Connection) deserializeProductions() {
splitString := strings.Split(c.getString(), " ")
c.productions = make([][]int, c.height)
for y := 0; y < c.height; y++ {
c.productions[y] = make([]int, c.width)
for x := 0; x < c.width; x++ {
c.productions[y][x], splitString = int_str_array_pop(splitString)
}
}
}
func NewConnection() (Connection, GameMap) {
conn := Connection{
reader: bufio.NewReader(os.Stdin),
writer: os.Stdout,
}
conn.PlayerTag = conn.getInt()
conn.deserializeMapSize()
conn.deserializeProductions()
return conn, conn.deserializeMap()
}
func (c *Connection) SendName(name string) {
c.sendString(name)
}
func (c *Connection) GetFrame() GameMap {
return c.deserializeMap()
}
func (c *Connection) SendFrame(moves MoveSet) {
c.sendString(moves.serialize())
}
================================================
FILE: airesources/Java/Direction.java
================================================
import java.util.Random;
public enum Direction {
STILL, NORTH, EAST, SOUTH, WEST;
public static final Direction[] DIRECTIONS = new Direction[]{STILL, NORTH, EAST, SOUTH, WEST};
public static final Direction[] CARDINALS = new Direction[]{NORTH, EAST, SOUTH, WEST};
public static Direction randomDirection() {
Direction[] values = values();
return values[new Random().nextInt(values.length)];
}
}
================================================
FILE: airesources/Java/GameMap.java
================================================
import java.util.ArrayList;
public class GameMap{
private final Site[][] contents;
private final Location[][] locations;
public final int width, height;
public GameMap(int width, int height, int[][] productions) {
this.width = width;
this.height = height;
this.contents = new Site[width][height];
this.locations = new Location[width][height];
for (int y = 0; y < height; y++) {
for(int x = 0; x < width; x++) {
final Site site = new Site(productions[x][y]);
contents[x][y] = site;
locations[x][y] = new Location(x, y, site);
}
}
}
public boolean inBounds(Location loc) {
return loc.x < width && loc.x >= 0 && loc.y < height && loc.y >= 0;
}
public double getDistance(Location loc1, Location loc2) {
int dx = Math.abs(loc1.x - loc2.x);
int dy = Math.abs(loc1.y - loc2.y);
if(dx > width / 2.0) dx = width - dx;
if(dy > height / 2.0) dy = height - dy;
return dx + dy;
}
public double getAngle(Location loc1, Location loc2) {
int dx = loc1.x - loc2.x;
// Flip order because 0,0 is top left
// and want atan2 to look as it would on the unit circle
int dy = loc2.y - loc1.y;
if(dx > width - dx) dx -= width;
if(-dx > width + dx) dx += width;
if(dy > height - dy) dy -= height;
if(-dy > height + dy) dy += height;
return Math.atan2(dy, dx);
}
public Location getLocation(Location location, Direction direction) {
switch (direction) {
case STILL:
return location;
case NORTH:
return locations[location.getX()][(location.getY() == 0 ? height : location.getY()) -1];
case EAST:
return locations[location.getX() == width - 1 ? 0 : location.getX() + 1][location.getY()];
case SOUTH:
return locations[location.getX()][location.getY() == height - 1 ? 0 : location.getY() + 1];
case WEST:
return locations[(location.getX() == 0 ? width : location.getX()) - 1][location.getY()];
default:
throw new IllegalArgumentException(String.format("Unknown direction %s encountered", direction));
}
}
public Site getSite(Location loc, Direction dir) {
return getLocation(loc, dir).getSite();
}
public Site getSite(Location loc) {
return loc.getSite();
}
public Location getLocation(int x, int y) {
return locations[x][y];
}
void reset() {
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
final Site site = contents[x][y];
site.owner = 0;
site.strength = 0;
}
}
}
}
================================================
FILE: airesources/Java/InitPackage.java
================================================
public class InitPackage {
public int myID;
public GameMap map;
}
================================================
FILE: airesources/Java/Location.java
================================================
public class Location {
// Public for backward compability
public final int x, y;
private final Site site;
public Location(int x, int y, Site site) {
this.x = x;
this.y = y;
this.site = site;
}
public int getX() {
return x;
}
public int getY() {
return y;
}
public Site getSite() {
return site;
}
}
================================================
FILE: airesources/Java/Move.java
================================================
public class Move {
public Location loc;
public Direction dir;
public Move(Location loc_, Direction dir_) {
loc = loc_;
dir = dir_;
}
}
================================================
FILE: airesources/Java/MyBot.java
================================================
import java.util.ArrayList;
import java.util.List;
public class MyBot {
public static void main(String[] args) throws java.io.IOException {
final InitPackage iPackage = Networking.getInit();
final int myID = iPackage.myID;
final GameMap gameMap = iPackage.map;
Networking.sendInit("MyJavaBot");
while(true) {
List<Move> moves = new ArrayList<Move>();
Networking.updateFrame(gameMap);
for (int y = 0; y < gameMap.height; y++) {
for (int x = 0; x < gameMap.width; x++) {
final Location location = gameMap.getLocation(x, y);
final Site site = location.getSite();
if(site.owner == myID) {
moves.add(new Move(location, Direction.randomDirection()));
}
}
}
Networking.sendFrame(moves);
}
}
}
================================================
FILE: airesources/Java/Networking.java
================================================
import java.net.*;
import java.io.*;
import java.util.ArrayList;
import java.util.Scanner;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.List;
public class Networking {
static int[][] deserializeProductions(String inputString, int width, int height) {
String[] inputStringComponents = inputString.split(" ");
int index = 0;
int[][] productions = new int[width][height];
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
productions[x][y] = Integer.parseInt(inputStringComponents[index]);
index++;
}
}
return productions;
}
static String serializeMoveList(List<Move> moves) {
StringBuilder builder = new StringBuilder();
for (Move move : moves) {
builder.append(move.loc.x)
.append(" ")
.append(move.loc.y)
.append(" ")
.append(move.dir.ordinal())
.append(" ");
}
return builder.toString();
}
static GameMap deserializeGameMap(String inputString, GameMap map) {
String[] inputStringComponents = inputString.split(" ");
// Run-length encode of owners
int y = 0, x = 0;
int counter = 0, owner = 0;
int currentIndex = 0;
while (y != map.height) {
counter = Integer.parseInt(inputStringComponents[currentIndex]);
owner = Integer.parseInt(inputStringComponents[currentIndex + 1]);
currentIndex += 2;
for (int a = 0; a < counter; a++) {
map.getLocation(x,y).getSite().owner = owner;
++x;
if(x == map.width) {
x = 0;
++y;
}
}
}
for (int b = 0; b < map.height; b++) {
for (int a = 0; a < map.width; a++) {
int strengthInt = Integer.parseInt(inputStringComponents[currentIndex]);
currentIndex++;
map.getLocation(a,b).getSite().strength = strengthInt;
}
}
return map;
}
static void sendString(String sendString) {
System.out.print(sendString+'\n');
System.out.flush();
}
static String getString() {
try {
StringBuilder builder = new StringBuilder();
int buffer;
while ((buffer = System.in.read()) >= 0) {
if (buffer == '\n') {
break;
} else {
builder = builder.append((char)buffer);
}
}
if(builder.charAt(builder.length()-1) == '\r') builder.setLength(builder.length()-1); //Removes a carriage return if on windows for manual testing.
return builder.toString();
} catch(Exception e) {
System.exit(1);
return null; // the java compiler is stupid
}
}
static InitPackage getInit() {
InitPackage initPackage = new InitPackage();
initPackage.myID = (int)Integer.parseInt(getString());
// Deserialize width and height:
final String[] inputStringComponents = getString().split(" ");
int width = Integer.parseInt(inputStringComponents[0]);
int height = Integer.parseInt(inputStringComponents[1]);
int[][] productions = deserializeProductions(getString(), width, height);
GameMap map = new GameMap(width, height, productions);
deserializeGameMap(getString(), map);
initPackage.map = map;
return initPackage;
}
static void sendInit(String name) {
sendString(name);
}
static void updateFrame(GameMap map) {
map.reset();
deserializeGameMap(getString(), map);
}
static void sendFrame(List<Move> moves) {
sendString(serializeMoveList(moves));
}
}
================================================
FILE: airesources/Java/RandomBot.java
================================================
import java.util.ArrayList;
import java.util.List;
public class RandomBot {
public static void main(String[] args) throws java.io.IOException {
final InitPackage iPackage = Networking.getInit();
final int myID = iPackage.myID;
final GameMap gameMap = iPackage.map;
Networking.sendInit("RandomJavaBot");
while(true) {
List<Move> moves = new ArrayList<Move>();
Networking.updateFrame(gameMap);
for (int y = 0; y < gameMap.height; y++) {
for (int x = 0; x < gameMap.width; x++) {
final Location location = gameMap.getLocation(x, y);
final Site site = location.getSite();
if(site.owner == myID) {
moves.add(new Move(location, Direction.randomDirection()));
}
}
}
Networking.sendFrame(moves);
}
}
}
================================================
FILE: airesources/Java/Site.java
================================================
public class Site {
public final int production;
public int owner, strength;
public Site(int production) {
this.production = production;
}
}
================================================
FILE: airesources/Java/runGame.bat
================================================
javac MyBot.java
javac RandomBot.java
.\halite.exe -d "30 30" "java MyBot" "java RandomBot"
================================================
FILE: airesources/Java/runGame.sh
================================================
#!/bin/bash
javac MyBot.java
javac RandomBot.java
./halite -d "30 30" "java MyBot" "java RandomBot"
================================================
FILE: airesources/JavaScript/MyBot.js
================================================
const {
Move,
} = require('./hlt');
const Networking = require('./networking');
const network = new Networking('MyJavaScriptBot');
network.on('map', (gameMap, id) => {
const moves = [];
for (let y = 0; y < gameMap.height; y++) {
for (let x = 0; x < gameMap.width; x++) {
const loc = { x, y };
const { owner } = gameMap.getSite(loc);
if (owner === id) {
moves.push(new Move(loc, Math.floor(Math.random() * 5)));
}
}
}
network.sendMoves(moves);
});
================================================
FILE: airesources/JavaScript/RandomBot.js
================================================
const {
Move,
} = require('./hlt');
const Networking = require('./networking');
const network = new Networking('RandomJavaScriptBot');
network.on('map', (gameMap, id) => {
const moves = [];
for (let y = 0; y < gameMap.height; y++) {
for (let x = 0; x < gameMap.width; x++) {
const loc = { x, y };
const { owner } = gameMap.getSite(loc);
if (owner === id) {
moves.push(new Move(loc, Math.floor(Math.random() * 5)));
}
}
}
network.sendMoves(moves);
});
================================================
FILE: airesources/JavaScript/hlt.js
================================================
const STILL = 0;
const NORTH = 1;
const EAST = 2;
const SOUTH = 3;
const WEST = 4;
const DIRECTIONS = [STILL, NORTH, EAST, SOUTH, WEST];
const CARDINALS = [NORTH, EAST, SOUTH, WEST];
const ATTACK = 0;
const STOP_ATTACK = 1;
class Location {
constructor(x = 0, y = 0) {
this.x = x;
this.y = y;
}
}
class Site {
constructor(owner = 0, strength = 0, production = 0) {
this.owner = owner;
this.strength = strength;
this.production = production;
}
}
class Move {
constructor(loc = new Location(), direction = STILL) {
this.loc = loc;
this.direction = direction;
}
}
class GameMap {
constructor(width = 0, height = 0, numberOfPlayers = 0) {
this.width = width;
this.height = height;
this.numberOfPlayers = numberOfPlayers;
this.contents = [];
for (let y = 0; y < this.height; y++) {
const row = [];
for (let x = 0; x < this.width; x++) {
row.push(new Site(0, 0, 0));
}
this.contents.push(row);
}
}
inBounds(l) {
return l.x >= 0 && l.x < this.width && l.y >= 0 && l.y < this.height;
}
getDistance(l1, l2) {
let dx = Math.abs(l1.x - l2.x);
let dy = Math.abs(l1.y - l2.y);
if (dx > (this.width / 2)) {
dx = this.width - dx;
}
if (dy > (this.height / 2)) {
dy = this.height - dy;
}
return dx + dy;
}
getAngle(l1, l2) {
let dx = l2.x - l1.x;
let dy = l2.y - l1.y;
if (dx > (this.width - dx)) {
dx -= this.width;
} else if (-dx > (this.width + dx)) {
dx += this.width;
}
if (dy > (this.height - dy)) {
dy -= this.height;
} else if (-dy > (this.height + dy)) {
dy += this.height;
}
return Math.atan2(dy, dx);
}
getLocation(loc, direction) {
let { x, y } = loc;
if (direction === STILL) {
// nothing
} else if (direction === NORTH) {
y -= 1;
} else if (direction === EAST) {
x += 1;
} else if (direction === SOUTH) {
y += 1;
} else if (direction === WEST) {
x -= 1;
}
if (x < 0) {
x = this.width - 1;
} else {
x %= this.width;
}
if (y < 0) {
y = this.height - 1;
} else {
y %= this.height;
}
return { x, y };
}
getSite(l, direction = STILL) {
const { x, y } = this.getLocation(l, direction);
return this.contents[y][x];
}
}
module.exports = {
STILL,
NORTH,
EAST,
SOUTH,
WEST,
DIRECTIONS,
CARDINALS,
ATTACK,
STOP_ATTACK,
Location,
Site,
Move,
GameMap
};
================================================
FILE: airesources/JavaScript/networking.js
================================================
const EventEmitter = require('events');
const readline = require('readline');
const { GameMap } = require('./hlt.js');
class Networking extends EventEmitter {
constructor(botName) {
super();
this.messageCount = 0;
this.width = 0;
this.height = 0;
this.productions = [];
this.rl = readline.createInterface({
input: process.stdin
});
this.rl.on('line', (line) => {
switch (this.messageCount++) {
case 0:
// first line is the player ID
this.id = parseInt(line, 10);
break;
case 1:
// second line is the map dimensions
this.deserializeMapSize(line);
break;
case 2:
// third line is the productions
this.deserializeProductions(line);
break;
case 3:
// fourth line is the initial map
break;
default:
// everything after is map updates
return this.emit('map', this.deserializeMap(line), this.id);
}
});
Networking.sendString(botName);
}
sendMoves(moves) {
Networking.sendString(Networking.serializeMoveSet(moves));
}
deserializeMapSize(inputString) {
[this.width, this.height] = splitToInts(inputString);
}
deserializeProductions(inputString) {
const flatProductions = splitToInts(inputString);
for (let i = 0; i < this.height; i++) {
const start = i * this.width;
const end = (i + 1) * this.width;
this.productions.push(flatProductions.slice(start, end));
}
}
deserializeMap(inputString) {
const flatMap = splitToInts(inputString);
const m = new GameMap(this.width, this.height);
let x = 0;
let y = 0;
let counter = 0;
let owner = 0;
let rest = flatMap;
while (y !== m.height) {
[counter, owner, ...rest] = rest;
for (let i = 0; i < counter; i++) {
m.contents[y][x].owner = owner;
x += 1;
if (x === m.width) {
x = 0;
y += 1;
}
}
}
for (y = 0; y < m.height; y++) {
for (x = 0; x < m.width; x++) {
m.contents[y][x].strength = rest.shift();
m.contents[y][x].production = this.productions[y][x];
}
}
return m;
}
}
Networking.sendString = function sendString(toBeSent) {
process.stdout.write(`${toBeSent}\n`);
};
Networking.serializeMoveSet = function serializeMoveSet(moves) {
return moves
.map((move) => `${move.loc.x} ${move.loc.y} ${move.direction}`)
.join(' ');
};
function splitToInts(inputString) {
return inputString.split(' ').map((value) => parseInt(value, 10));
}
module.exports = Networking;
================================================
FILE: airesources/JavaScript/runGame.bat
================================================
.\halite.exe -d "30 30" "node MyBot.js" "node RandomBot.js"
================================================
FILE: airesources/JavaScript/runGame.sh
================================================
#!/bin/bash
./halite -d "30 30" "node MyBot.js" "node RandomBot.js"
================================================
FILE: airesources/Julia/MyBot.jl
================================================
include("hlt.jl")
include("networking.jl")
myID, gameMap = getInit()
sendInit("MyJuliaBot")
while true
moves = Vector{Move}()
gameMap = getFrame()
for y in 0:gameMap.height-1
for x in 0:gameMap.width-1
if getSite(gameMap, Location(x, y)).owner == myID
push!(moves, Move(Location(x, y), rand(0:4)))
end
end
end
sendFrame(moves)
end
================================================
FILE: airesources/Julia/RandomBot.jl
================================================
include("hlt.jl")
include("networking.jl")
myID, gameMap = getInit()
sendInit("RandomJuliaBot")
while true
moves = Vector{Move}()
gameMap = getFrame()
for y in 0:gameMap.height-1
for x in 0:gameMap.width-1
if getSite(gameMap, Location(x, y)).owner == myID
push!(moves, Move(Location(x, y), rand(0:4)))
end
end
end
sendFrame(moves)
end
================================================
FILE: airesources/Julia/hlt.jl
================================================
const STILL = 0
const NORTH = 1
const EAST = 2
const SOUTH = 3
const WEST = 4
const DIRECTIONS = [a for a in 0:4]
const CARDINALS = [a for a in 1:4]
const ATTACK = 0
const STOP_ATTACK = 1
type Location
x :: Int64
y :: Int64
Location(x::Int64, y::Int64) = new(x, y)
Location() = Location(0, 0)
end
type Site
owner :: Int64
strength :: Int64
production :: Int64
Site(owner::Int64, strength::Int64, production::Int64) = new(owner, strength, production)
Site() = Site(0, 0, 0)
end
type Move
loc :: Location
direction :: Int64
Move(loc::Location, direction::Int64) = new(loc, direction)
Move() = Move(Location(), 0)
end
type GameMap
width :: Int64
height :: Int64
contents :: Vector{Vector{Site}}
function GameMap(width::Int64, height::Int64)
contents = Vector{Vector{Site}}()
for y in 0:height-1
row = Vector{Site}()
for x in 0:width-1
push!(row, Site(0, 0, 0))
end
push!(contents, row)
end
new(width, height, contents)
end
GameMap() = GameMap(0, 0)
end
isBounds(gm::GameMap, l::Location) = l.x >= 0 && l.x < gm.width && l.y >= 0 && l.y < gm.height
function getDistance(gm::GameMap, l1::Location, l2::Location)
dx = abs(l1.x - l2.x)
dy = abs(l1.y - l2.y)
if dx > gm.width / 2
dx = gm.width - dx
end
if dy > gm.height / 2
dy = gm.height - dy
end
dx + dy
end
function getAngle(gm::GameMap, l1::Location, l2::Location)
dx = l2.x - l1.x
dy = l2.y - l1.y
if dx > gm.width - dx
dx -= gm.width
elseif -dx > gm.width + dx
dx += gm.width
end
if dy > gm.height - dy
dy -= gm.height
elseif -dy > gm.height + dy
dy += gm.height
end
atan2(dy, dx)
end
function getLocation(gm::GameMap, loc::Location, direction::Int64)
l = deepcopy(loc)
if direction != STILL
if direction == NORTH
if l.y == 0
l.y = gm.height - 1
else
l.y = l.y - 1
end
elseif direction == EAST
if l.x == gm.width - 1
l.x = 0
else
l.x = l.x + 1
end
elseif direction == SOUTH
if l.y == gm.height - 1
l.y = 0
else
l.y = l.y + 1
end
elseif direction == WEST
if l.x == 0
l.x = gm.width - 1
else
l.x = l.x - 1
end
end
end
l
end
function getSite(gm::GameMap, l::Location, direction::Int64=STILL)
l = getLocation(gm, l, direction)
gm.contents[l.y + 1][l.x + 1]
end
================================================
FILE: airesources/Julia/networking.jl
================================================
_productions = Vector{Vector{Int64}}()
_width = nothing
_height = nothing
function serializeMoveSet(moves::Vector{Move})
returnString = ""
for move in moves
returnString *= string(move.loc.x) * " " * string(move.loc.y) * " " * string(move.direction) * " "
end
returnString
end
function deserializeMapSize(inputString::String)
splitString = reverse(split(inputString, " "))
global _width, _height
_width = parse(pop!(splitString))
_height = parse(pop!(splitString))
end
function deserializeProductions(inputString::String)
splitString = reverse(split(inputString, " "))
for a in 1:_height
row = Vector{Int64}()
for b in 1:_width
push!(row, parse(pop!(splitString)))
end
push!(_productions, row)
end
end
function deserializeMap(inputString::String)
splitString = reverse(split(inputString, " "))
m = GameMap(_width, _height)
y = 1
x = 1
counter = 0
owner = 0
while ~(y > m.height)
counter = parse(pop!(splitString))
owner = parse(pop!(splitString))
for a in 0:counter-1
m.contents[y][x].owner = owner
x += 1
if x > m.width
x = 1
y += 1
end
end
end
for a in 1:_height
for b in 1:_width
m.contents[a][b].strength = parse(pop!(splitString))
m.contents[a][b].production = _productions[a][b]
end
end
m
end
function sendString(toBeSent::String)
toBeSent *= "\n"
write(STDOUT, toBeSent)
flush(STDOUT)
end
function getString()
rstrip(readline(), '\n')
end
function getInit()
playerTag = parse(getString())
deserializeMapSize(getString())
deserializeProductions(getString())
m = deserializeMap(getString())
(playerTag, m)
end
function sendInit(name::String)
sendString(name)
end
function getFrame()
return deserializeMap(getString())
end
function sendFrame(moves::Vector{Move})
sendString(serializeMoveSet(moves))
end
================================================
FILE: airesources/Julia/runGame.bat
================================================
.\halite.exe -d "30 30" "julia MyBot.jl" "julia RandomBot.jl"
================================================
FILE: airesources/Julia/runGame.sh
================================================
#!/bin/bash
./halite -d "30 30" "julia MyBot.jl" "julia RandomBot.jl"
================================================
FILE: airesources/OCaml/MyBot.ml
================================================
(* OCaml Starter for Halite on Halite.io
This code is public domain. There is no warranty.
*)
open Td;;
let random_move state row col =
let dir = Halite.direction_of_int (Random.int 5) in
let loc = {
row = row;
col = col;
} in
{
loc = loc;
direction = dir;
}
;;
let random_moves state =
let moves = ref [] in
Array.iteri (fun ir row -> Array.iteri (fun ic site ->
if site.owner = state.my_id then
moves := (random_move state ir ic) :: !moves
) row) state.game_map.contents;
!moves
;;
let mybot_function state =
begin try
(
Halite.get_init state;
Halite.send_init "MyOCamlBot";
while true do
Halite.get_frame state;
let moves = random_moves state in
Halite.send_frame moves
done
)
with exc ->
(
Debug.debug (Printf.sprintf
"Exception in turn %d :\n" state.round);
Debug.debug (Printexc.to_string exc);
raise exc
)
end;
;;
let run_bot bot =
let game_state = Halite.init () in
bot game_state
;;
run_bot mybot_function
================================================
FILE: airesources/OCaml/README.md
================================================
Halite OCaml Starter Package
----------------------------
This is an OCaml starter package for Halite on halite.io
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.
================================================
FILE: airesources/OCaml/RandomBot.ml
================================================
(* OCaml Starter for Halite on Halite.io
This code is public domain. There is no warranty.
*)
open Td;;
let random_move state row col =
let dir = Halite.direction_of_int (Random.int 5) in
let loc = {
row = row;
col = col;
} in
{
loc = loc;
direction = dir;
}
;;
let random_moves state =
let moves = ref [] in
Array.iteri (fun ir row -> Array.iteri (fun ic site ->
if site.owner = state.my_id then
moves := (random_move state ir ic) :: !moves
) row) state.game_map.contents;
!moves
;;
let mybot_function state =
begin try
(
Halite.get_init state;
Halite.send_init "RandomOCamlBot";
while true do
Halite.get_frame state;
let moves = random_moves state in
Halite.send_frame moves
done
)
with exc ->
(
Debug.debug (Printf.sprintf
"Exception in turn %d :\n" state.round);
Debug.debug (Printexc.to_string exc);
raise exc
)
end;
;;
let run_bot bot =
let game_state = Halite.init () in
bot game_state
;;
run_bot mybot_function
================================================
FILE: airesources/OCaml/debug.ml
================================================
(* OCaml Starter for Halite on Halite.io
This code is public domain. There is no warranty.
*)
let out_chan = open_out "mybot_err.log" ;;
let debug s =
output_string out_chan s;
flush out_chan
;;
let error s =
output_string out_chan ("ERROR: " ^ s ^ "\n");
flush out_chan
;;
(* Replace the functions above with these to silence all logging
let out_chan = stdout;;
let debug s = () ;;
let error s = () ;;
*)
================================================
FILE: airesources/OCaml/halite.ml
================================================
(* OCaml Starter for Halite on Halite.io
This code is public domain. There is no warranty.
*)
open Td;;
open Debug;;
(* Some useful things *)
let time_first_turn = 15000.0;;
let time_per_turn = 1000.0;;
let list_directions = [`Still; `North; `East; `South; `West];;
let list_cardinals = [`North; `East; `South; `West];;
let (array_directions:t_direction array) =
[| `Still; `North; `East; `South; `West |]
;;
let (array_cardinals:t_direction array) = [| `North; `East; `South; `West |];;
(* Some boolean reference cells to track init status *)
let first_turn = ref false;;
let init_my_id_done = ref false;;
let init_size_done = ref false;;
let init_production_done = ref false;;
let init_map_done = ref false;;
let all_init_done = ref false;;
let sent_init = ref false;;
let get_time () = Unix.gettimeofday ();;
(* input processing *)
let new_site () =
{
owner = -1;
strength = -1;
production = -1;
}
;;
let new_blank_game_map width height =
let v = Array.make_matrix height width 0 in
Array.map (Array.map (fun _ -> new_site())) v
;;
let clear_state state =
state.game_map.contents <-
new_blank_game_map state.game_map.width state.game_map.height;
state.round <- 0;
;;
(* tokenizer from rosetta code *)
let split_char sep str =
let string_index_from i =
try Some (String.index_from str i sep)
with Not_found -> None
in
let rec aux i acc = match string_index_from i with
| Some i' ->
let w = String.sub str i (i' - i) in
aux (succ i') (w::acc)
| None ->
let w = String.sub str i (String.length str - i) in
List.rev (w::acc)
in
aux 0 []
;;
let get_2d_coords state coord =
let row = coord / state.game_map.width in
let col = coord mod state.game_map.width in
row, col
;;
let set_owner state coord owner =
let row, col = get_2d_coords state coord in
state.game_map.contents.(row).(col).owner <- owner
;;
let set_strength state coord v =
let row, col = get_2d_coords state coord in
state.game_map.contents.(row).(col).strength <- v
;;
let set_production state coord v =
let row, col = get_2d_coords state coord in
state.game_map.contents.(row).(col).production <- v
;;
let set_owners state start repeat owner =
for coord = start to (start + repeat - 1) do
set_owner state coord owner
done
;;
let total_size state = state.game_map.width * state.game_map.height;;
let deserialize_map state tokens =
let count = ref 0 in
let repeat = ref 0 in
let ready = ref false in
let num_sites = total_size state in
List.iter (fun token ->
if !count < num_sites then (
if !ready then (
set_owners state !count !repeat (int_of_string token);
count := !count + !repeat;
ready := false;
) else (
repeat := int_of_string token;
ready := true;
)
)
else (
set_strength state (!count mod num_sites) (int_of_string token);
count := !count + 1;
)
) tokens
;;
let init_production state tokens =
List.iteri (fun i s ->
set_production state i (int_of_string s)
) tokens
;;
let init_size state tokens =
match tokens with
| w :: h :: [] ->
let width = int_of_string w in
let height = int_of_string h in
state.game_map.width <- width;
state.game_map.height <- height;
state.max_rounds <- (int_of_float (sqrt (float_of_int(width * height)))) * 10;
clear_state state;
| _ ->
let s =
List.fold_left (fun acc t -> acc ^ " " ^ t) " " tokens
in
Debug.error ("incorrect input for init_size " ^ s ^ "\n")
;;
let init_my_id state tokens =
match tokens with
| id :: [] ->
state.my_id <- int_of_string id
| _ -> Debug.error ("incorrect input for init_my_id\n")
;;
let process_line state line =
let tokens = split_char ' ' (String.trim line) in
if !all_init_done then (
deserialize_map state tokens;
) else if not !init_my_id_done then (
init_my_id state tokens;
init_my_id_done := true;
) else if not !init_size_done then (
init_size state tokens;
init_size_done := true;
) else if not !init_production_done then (
init_production state tokens;
init_production_done := true;
) else if not !init_map_done then (
deserialize_map state tokens;
init_map_done := true;
all_init_done := true;
)
else Debug.error "Impossible condition: all_init_done not set when all init done"
;;
let get_frame state =
state.round <- state.round + 1;
state.last_update <- get_time();
let line = read_line () in
process_line state line
;;
let read_lines bot state =
while true do
let line = read_line () in
process_line state line;
done
;;
let get_init state =
let finished = ref false in
while not !finished do
let line = read_line () in
process_line state line;
if !all_init_done then
finished := true
done
;;
(* End input section *)
(* output section *)
let char_of_dir = function
| `Still -> '0'
| `North -> '1'
| `East -> '2'
| `South -> '3'
| `West -> '4'
;;
let serialize_move move =
Printf.sprintf "%i %i %c" move.loc.col move.loc.row (char_of_dir move.direction)
;;
let send_frame moves =
List.iter (fun move ->
Printf.printf "%s " (serialize_move move)
) moves;
Printf.printf "\n";
flush stdout;
;;
let send_init name =
print_string (name ^ "\n");
flush stdout;
sent_init := true;
;;
(* End output section *)
(* Utility functions *)
let random_from_list lst =
let len = List.length lst in
List.nth lst (Random.int len)
;;
let in_bounds state row col =
(row >= 0) && (col >= 0)
&&
(row < state.game_map.height) && (col < state.game_map.width)
;;
let get_distance state l1 l2 =
let pd_col = abs (l1.col - l2.col) in
let pd_row = abs (l1.row - l2.row) in
let d_col =
if pd_col > state.game_map.width / 2 then state.game_map.width - pd_col else pd_col
in
let d_row =
if pd_row > state.game_map.height / 2 then state.game_map.height - pd_row else pd_row
in
d_row + d_col
;;
let get_angle state l1 l2 =
let pd_col = l2.col - l1.col in
let pd_row = l2.row - l1.row in
let d_col =
if pd_col > state.game_map.width - pd_col then pd_col - state.game_map.width
else if (-pd_col) > state.game_map.width + pd_col then
pd_col + state.game_map.width
else pd_col
in
let d_row =
if pd_row > state.game_map.height - pd_row then
pd_row - state.game_map.height
else if (-pd_row) > state.game_map.height + pd_row then
pd_row + state.game_map.height
else pd_row
in
atan2 (float_of_int d_row) (float_of_int d_col)
;;
let wrap_loc state loc =
let wrap v bound =
if v < 0 then bound + v
else if v >= bound then v - bound
else v
in
let w_row = wrap loc.row state.game_map.height in
let w_col = wrap loc.col state.game_map.width in
{row = w_row; col = w_col}
;;
let get_location state loc direction =
let (o_row, o_col) =
match direction with
| `Still -> (0, 0)
| `North -> (-1, 0)
| `East -> (0, 1)
| `South -> (1, 0)
| `West -> (0, -1)
in
let row = loc.row + o_row in
let col = loc.col + o_col in
wrap_loc state {row = row; col = col}
;;
let get_site state loc direction =
let l = get_location state loc direction in
state.game_map.contents.(l.row).(l.col)
;;
let time_elapsed_this_turn state =
(get_time() -. state.last_update) *. 1000.
;;
let time_remaining state =
let turntime = if !first_turn then time_first_turn else time_per_turn in
(turntime -. time_elapsed_this_turn state)
;;
let direction_of_int = function
| 0 -> `Still
| 1 -> `North
| 2 -> `East
| 3 -> `South
| 4 -> `West
| n -> failwith ("Invalid direction_of_int: " ^ (string_of_int n) ^ "\n")
;;
let debug_block state f =
Array.iter (fun row ->
Debug.debug "\n";
Array.iter (fun site ->
Debug.debug (f site)
) row
) state.game_map.contents;
Debug.debug "\n"
;;
let debug_productions state =
debug_block state (fun site ->
Printf.sprintf "%2d" site.production
)
;;
let debug_owners state =
debug_block state (fun site ->
(string_of_int site.owner) ^ " "
)
;;
let debug_strength state =
debug_block state (fun site ->
Printf.sprintf "%3d " site.strength
)
;;
let debug_game_map state =
debug_owners state;
debug_strength state;
debug_productions state;
;;
(* End utility *)
let init () =
Random.self_init ();
let gmap =
{
width = (-1);
height = (-1);
contents = [|[| |]|];
}
in
let state =
{
my_id = (-1);
round = 0;
max_rounds = 0;
last_update = (-1.0);
game_map = gmap;
}
in
state
;;
================================================
FILE: airesources/OCaml/runGame.bat
================================================
ocamlbuild -lib unix MyBot.native
ocamlbuild -lib unix RandomBot.native
.\halite.exe -d "30 30" ".\MyBot.exe" ".\RandomBot.exe"
================================================
FILE: airesources/OCaml/runGame.sh
================================================
#!/bin/bash
ocamlbuild -lib unix MyBot.native
ocamlbuild -lib unix RandomBot.native
./halite -d "30 30" "./MyBot.native" "./RandomBot.native"
================================================
FILE: airesources/OCaml/td.ml
================================================
(* OCaml Starter for Halite on Halite.io
This code is public domain. There is no warranty.
*)
type t_direction = [ `Still | `North | `East | `South | `West ] ;;
type location =
{
mutable row : int;
mutable col : int;
}
;;
type site =
{
mutable owner : int;
mutable strength : int;
mutable production : int;
}
;;
type move =
{
mutable loc : location;
mutable direction : t_direction;
}
;;
type game_map =
{
mutable width : int;
mutable height : int;
mutable contents : site array array;
}
;;
type game_state =
{
mutable my_id : int;
mutable round : int;
mutable max_rounds : int;
mutable last_update : float;
mutable game_map : game_map;
}
;;
================================================
FILE: airesources/PHP/MyBot.php
================================================
<?php
require_once 'hlt.php';
require_once 'networking.php';
list($myID, $gameMap) = getInit();
sendInit('myPHPBot');
while (true) {
$moves = [];
$gameMap = getFrame();
for ($y = 0; $y < $gameMap->height; ++$y) {
for ($x = 0; $x < $gameMap->width; ++$x) {
if ($gameMap->getSite(new Location($x, $y))->owner === $myID) {
$moves[] = new Move(new Location($x, $y), rand(0, 4));
}
}
}
sendFrame($moves);
}
================================================
FILE: airesources/PHP/RandomBot.php
================================================
<?php
require_once 'hlt.php';
require_once 'networking.php';
list($myID, $gameMap) = getInit();
sendInit('RandomPHPBot');
while (true) {
$moves = [];
$gameMap = getFrame();
for ($y = 0; $y < $gameMap->height; ++$y) {
for ($x = 0; $x < $gameMap->width; ++$x) {
if ($gameMap->getSite(new Location($x, $y))->owner === $myID) {
$moves[] = new Move(new Location($x, $y), rand(0, 4));
}
}
}
sendFrame($moves);
}
================================================
FILE: airesources/PHP/hlt.php
================================================
<?php
define('STILL', 0);
define('NORTH', 1);
define('EAST', 2);
define('SOUTH', 3);
define('WEST', 4);
const DIRECTIONS = array(0, 1, 2, 3, 4);
const CARDINALS = array(1, 2, 3, 4);
define('ATTACK', 0);
define('STOP_ATTACK', 1);
class Location
{
public $x;
public $y;
public function __construct($x = 0, $y = 0)
{
$this->x = $x;
$this->y = $y;
}
}
class Site
{
public $owner;
public $strength;
public $production;
public function __construct($owner = 0, $strength = 0, $production = 0)
{
$this->owner = $owner;
$this->strength = $strength;
$this->production = $production;
}
}
class Move
{
public $loc;
public $direction;
public function __construct(Location $loc, $direction = STILL)
{
$this->loc = $loc;
$this->direction = $direction;
}
}
class GameMap
{
public $width;
public $height;
public $contents;
public function __construct($width = 0, $height = 0, $numberOfPlayers = 0)
{
$this->width = $width;
$this->height = $height;
$this->contents = [];
for ($y = 0; $y < $this->height; ++$y) {
$row = [];
for ($x = 0; $x < $this->width; ++$x) {
$row[] = new Site(0, 0, 0);
}
$this->contents[] = $row;
}
}
public function inBounds(Location $l)
{
return $l->x >= 0 && $l->x < $this->width && $l->y >= 0 && $l->y < $this->height;
}
public function getDistance(Location $l1, Location $l2)
{
$dx = abs($l1->x - $l2->x);
$dy = abs($l1->y - $l2->y);
if ($dx > $this->width / 2) {
$dx = $this->width - $dx;
}
if ($dy > $this->height / 2) {
$dy = $this->height - $dy;
}
return $dx + $dy;
}
public function getAngle(Location $l1, Location $l2)
{
$dx = $l2->x - $l1->x;
$dy = $l2->y - $l1->y;
if ($dx > $this->width - $dx) {
$dx -= $this->width;
} elseif (-$dx > $this->width + $dx) {
$dx += $this->width;
}
if ($dy > $this->height - $dy) {
$dy -= $this->height;
} elseif (-$dy > $this->height + $dy) {
$dy += $this->height;
}
return atan2($dy, $dx);
}
public function getLocation(Location $loc, $direction)
{
$l = clone $loc;
if ($direction !== STILL) {
if ($direction === NORTH) {
if ($l->y === 0) {
$l->y = $this->height - 1;
} else {
$l->y -= 1;
}
} elseif ($direction === EAST) {
if ($l->x === $this->width - 1) {
$l->x = 0;
} else {
$l->x += 1;
}
} elseif ($direction === SOUTH) {
if ($l->y === $this->height - 1) {
$l->y = 0;
} else {
$l->y += 1;
}
} elseif ($direction === WEST) {
if ($l->x === 0) {
$l->x = $this->width - 1;
} else {
$l->x -= 1;
}
}
}
return $l;
}
public function getSite(Location $l, $direction = STILL)
{
$l = $this->getLocation($l, $direction);
return $this->contents[$l->y][$l->x];
}
}
================================================
FILE: airesources/PHP/networking.php
================================================
<?php
$_productions = [];
$_width = -1;
$_height = -1;
function serializeMoveSet(array $moves)
{
$returnString = '';
foreach ($moves as $move) {
$returnString .= $move->loc->x . ' ' . $move->loc->y . ' ' . $move->direction . ' ';
}
return $returnString;
}
function deserializeMapSize($inputString)
{
global $_width, $_height;
$splitString = explode(' ', $inputString);
$_width = (int)array_shift($splitString);
$_height = (int)array_shift($splitString);
}
function deserializeProductions($inputString)
{
global $_width, $_height, $_productions;
$splitString = explode(' ', $inputString);
for ($a = 0; $a < $_height; ++$a) {
$row = [];
for ($b = 0; $b < $_width; ++$b) {
$row[] = (int)array_shift($splitString);
}
$_productions[] = $row;
}
}
function deserializeMap($inputString)
{
global $_width, $_height, $_productions;
$splitString = explode(' ', $inputString);
$m = new GameMap($_width, $_height);
$y = 0;
$x = 0;
while ($y !== $m->height) {
$counter = (int)array_shift($splitString);
$owner = (int)array_shift($splitString);
for ($a = 0; $a < $counter; ++$a) {
$m->contents[$y][$x]->owner = $owner;
$x += 1;
if ($x === $m->width) {
$x = 0;
$y += 1;
}
}
}
for ($a = 0; $a < $_height; ++$a) {
for ($b = 0; $b < $_width; ++$b) {
$m->contents[$a][$b]->strength = (int)array_shift($splitString);
$m->contents[$a][$b]->production = $_productions[$a][$b];
}
}
return $m;
}
function sendString($toBeSent)
{
$toBeSent .= "\n";
fwrite(STDOUT, $toBeSent);
}
function getString()
{
$input = fgets(STDIN);
if ($input === false) {
exit;
}
return rtrim($input, "\n");
}
function getInit()
{
$playerTag = (int)getString();
deserializeMapSize(getString());
deserializeProductions(getString());
$m = deserializeMap(getString());
return [$playerTag, $m];
}
function sendInit($name)
{
sendString($name);
}
function getFrame()
{
return deserializeMap(getString());
}
function sendFrame(array $moves)
{
sendString(serializeMoveSet($moves));
}
================================================
FILE: airesources/PHP/runGame.bat
================================================
.\halite.exe -d "30 30" "php MyBot.php" "php RandomBot.php"
================================================
FILE: airesources/PHP/runGame.sh
================================================
#!/bin/bash
./halite -d "30 30" "php MyBot.php" "php RandomBot.php"
================================================
FILE: airesources/Python/MyBot.py
================================================
import hlt
from hlt import NORTH, EAST, SOUTH, WEST, STILL, Move, Square
import random
myID, game_map = hlt.get_init()
hlt.send_init("MyPythonBot")
while True:
game_map.get_frame()
moves = [Move(square, random.choice((NORTH, EAST, SOUTH, WEST, STILL))) for square in game_map if square.owner == myID]
hlt.send_frame(moves)
================================================
FILE: airesources/Python/RandomBot.py
================================================
import hlt
from hlt import NORTH, EAST, SOUTH, WEST, STILL, Move, Square
import random
myID, game_map = hlt.get_init()
hlt.send_init("RandomPythonBot")
while True:
game_map.get_frame()
moves = [Move(square, random.choice((NORTH, EAST, SOUTH, WEST, STILL))) for square in game_map if square.owner == myID]
hlt.send_frame(moves)
================================================
FILE: airesources/Python/hlt.py
================================================
import sys
from collections import namedtuple
from itertools import chain, zip_longest
def grouper(iterable, n, fillvalue=None):
"Collect data into fixed-length chunks or blocks"
# grouper('ABCDEFG', 3, 'x') --> ABC DEF Gxx"
args = [iter(iterable)] * n
return zip_longest(*args, fillvalue=fillvalue)
NORTH, EAST, SOUTH, WEST, STILL = range(5)
def opposite_cardinal(direction):
"Returns the opposing cardinal direction."
return (direction + 2) % 4 if direction != STILL else STILL
Square = namedtuple('Square', 'x y owner strength production')
Move = namedtuple('Move', 'square direction')
class GameMap:
def __init__(self, size_string, production_string, map_string=None):
self.width, self.height = tuple(map(int, size_string.split()))
self.production = tuple(tuple(map(int, substring)) for substring in grouper(production_string.split(), self.width))
self.contents = None
self.get_frame(map_string)
self.starting_player_count = len(set(square.owner for square in self)) - 1
def get_frame(self, map_string=None):
"Updates the map information from the latest frame provided by the Halite game environment."
if map_string is None:
map_string = get_string()
split_string = map_string.split()
owners = list()
while len(owners) < self.width * self.height:
counter = int(split_string.pop(0))
owner = int(split_string.pop(0))
owners.extend([owner] * counter)
assert len(owners) == self.width * self.height
assert len(split_string) == self.width * self.height
self.contents = [[Square(x, y, owner, strength, production)
for x, (owner, strength, production)
in enumerate(zip(owner_row, strength_row, production_row))]
for y, (owner_row, strength_row, production_row)
in enumerate(zip(grouper(owners, self.width),
grouper(map(int, split_string), self.width),
self.production))]
def __iter__(self):
"Allows direct iteration over all squares in the GameMap instance."
return chain.from_iterable(self.contents)
def neighbors(self, square, n=1, include_self=False):
"Iterable over the n-distance neighbors of a given square. For single-step neighbors, the enumeration index provides the direction associated with the neighbor."
assert isinstance(include_self, bool)
assert isinstance(n, int) and n > 0
if n == 1:
combos = ((0, -1), (1, 0), (0, 1), (-1, 0), (0, 0)) # NORTH, EAST, SOUTH, WEST, STILL ... matches indices provided by enumerate(game_map.neighbors(square))
else:
combos = ((dx, dy) for dy in range(-n, n+1) for dx in range(-n, n+1) if abs(dx) + abs(dy) <= n)
return (self.contents[(square.y + dy) % self.height][(square.x + dx) % self.width] for dx, dy in combos if include_self or dx or dy)
def get_target(self, square, direction):
"Returns a single, one-step neighbor in a given direction."
dx, dy = ((0, -1), (1, 0), (0, 1), (-1, 0), (0, 0))[direction]
return self.contents[(square.y + dy) % self.height][(square.x + dx) % self.width]
def get_distance(self, sq1, sq2):
"Returns Manhattan distance between two squares."
dx = min(abs(sq1.x - sq2.x), sq1.x + self.width - sq2.x, sq2.x + self.width - sq1.x)
dy = min(abs(sq1.y - sq2.y), sq1.y + self.height - sq2.y, sq2.y + self.height - sq1.y)
return dx + dy
#################################################################
# Functions for communicating with the Halite game environment #
#################################################################
def send_string(s):
sys.stdout.write(s)
sys.stdout.write('\n')
sys.stdout.flush()
def get_string():
return sys.stdin.readline().rstrip('\n')
def get_init():
playerID = int(get_string())
m = GameMap(get_string(), get_string())
return playerID, m
def send_init(name):
send_string(name)
def translate_cardinal(direction):
"Translate direction constants used by this Python-based bot framework to that used by the official Halite game environment."
return (direction + 1) % 5
def send_frame(moves):
send_string(' '.join(str(move.square.x) + ' ' + str(move.square.y) + ' ' + str(translate_cardinal(move.direction)) for move in moves))
================================================
FILE: airesources/Python/runGame.bat
================================================
.\halite.exe -d "30 30" "python MyBot.py" "python RandomBot.py"
================================================
FILE: airesources/Python/runGame.sh
================================================
#!/bin/bash
if hash python3 2>/dev/null; then
./halite -d "30 30" "python3 MyBot.py" "python3 RandomBot.py"
else
./halite -d "30 30" "python MyBot.py" "python RandomBot.py"
fi
================================================
FILE: airesources/Ruby/MyBot.rb
================================================
$:.unshift(File.dirname(__FILE__))
require 'networking'
network = Networking.new("RubyBot")
tag, map = network.configure
while true
moves = []
map = network.frame
(0...map.height).each do |y|
(0...map.width).each do |x|
loc = Location.new(x, y)
site = map.site(loc)
if site.owner == tag
moves << Move.new(loc, GameMap::DIRECTIONS.shuffle.first)
end
end
end
network.send_moves(moves)
end
================================================
FILE: airesources/Ruby/RandomBot.rb
================================================
$:.unshift(File.dirname(__FILE__))
require 'networking'
network = Networking.new("RandomRubyBot")
tag, map = network.configure
while true
moves = []
map = network.frame
(0...map.height).each do |y|
(0...map.width).each do |x|
loc = Location.new(x, y)
site = map.site(loc)
if site.owner == tag
moves << Move.new(loc, GameMap::DIRECTIONS.shuffle.first)
end
end
end
network.send_moves(moves)
end
================================================
FILE: airesources/Ruby/game_map.rb
================================================
class GameMap
CARDINALS = [:north, :east, :south, :west]
DIRECTIONS = [:still] + CARDINALS
attr_reader :width, :height
attr_reader :content
def initialize(options = {})
@width = options[:width]
@height = options[:height]
@content = []
options[:owners].each_with_index do |owner, idx|
site = Site.new(owner, options[:strengths][idx], options[:production][idx])
y, x = idx.divmod(@width)
@content[y] ||= []
@content[y][x] = site
end
end
def site(location, direction = :still)
new_location = find_location(location, direction)
content[new_location.y][new_location.x]
end
def find_location(location, direction)
x, y = location.x, location.y
case direction
when :north
y = y == 0 ? height - 1 : y - 1
when :east
x = x == width - 1 ? 0 : x + 1
when :south
y = y == height - 1 ? 0 : y + 1
when :west
x = x == 0 ? width - 1 : x - 1
end
Location.new(x, y)
end
def distance_between(from, to)
dx = (from.x - to.x).abs
dy = (from.y - to.y).abs
dx = width - dx if dx > width / 2
dy = height - dy if dy > height / 2
dx + dy
end
def angle_between(from, to)
dx = to.x - from.x
dy = to.y - from.y
if dx > width - dx
dx -= width
elsif -dx > width + dx
dx += width
end
if dy > height - dy
dy -= height
elsif -dy > height + dy
dy += height
end
Math.atan2(dy, dx)
end
def in_bounds(loc)
loc.x.between?(0, width - 1) && loc.y.between?(0, height - 1)
end
end
================================================
FILE: airesources/Ruby/location.rb
================================================
class Location
attr_reader :x, :y
def initialize(x, y)
@x, @y = x, y
end
end
================================================
FILE: airesources/Ruby/move.rb
================================================
class Move
attr_reader :location, :direction
def initialize(location, direction)
@location = location
@direction = GameMap::DIRECTIONS.index(direction)
end
def to_s
[location.x, location.y, direction].join(' ')
end
end
================================================
FILE: airesources/Ruby/networking.rb
================================================
require 'logger'
require 'location'
require 'move'
require 'site'
require 'game_map'
class Networking
attr_reader :player_tag
attr_reader :width, :height, :size
attr_reader :production
attr_reader :name
def initialize(name)
# implicit IO flush
$stdout.sync = true
@name = name
init_player_tag
init_map_size
init_map_production
init_map
end
# getInit/sendInit
def configure
write_to_output(name)
[player_tag, @map]
end
# getFrame
def frame
init_map
end
# sendMoves
def send_moves(moves = [])
write_to_output(moves.join(' '))
end
def logger
@logger ||= Logger.new("bot-#{name}.log").tap do |l|
l.formatter = proc do |severity, datetime, progname, msg|
"#{datetime.strftime("%Y-%m-%d %H:%M:%S.%6N")} - #{severity} - #{msg}\n"
end
end
end
def log(msg, severity = :info)
logger.send(severity, msg)
end
private
def init_player_tag
@player_tag = Integer(read_from_input)
log("player tag: #{@player_tag}")
end
def init_map_size
@width, @height = read_ints_from_input
@size = @width * @height
log("width: #{@width} - height: #{@height} - size: #{@size}")
end
def init_map_production
@production = read_ints_from_input
end
def init_map
data = read_ints_from_input
owners_map = []
until owners_map.size == size
counter = data.shift
owner = data.shift
owners_map += [owner] * counter
end
@map = GameMap.new( width: width,
height: height,
owners: owners_map,
strengths: data,
production: production)
end
def read_from_input
$stdin.gets.strip
end
def read_ints_from_input
read_from_input.split(' ').map { |v| Integer(v) }
end
def write_to_output(data)
data = "#{data.strip}\n"
log("Sending: #{data.inspect}")
$stdout.puts(data)
end
end
================================================
FILE: airesources/Ruby/runGame.bat
================================================
.\halite.exe -d "30 30" "ruby MyBot.rb" "ruby RandomBot.rb"
================================================
FILE: airesources/Ruby/runGame.sh
================================================
#!/bin/bash
./halite -d "30 30" "ruby MyBot.rb" "ruby RandomBot.rb"
================================================
FILE: airesources/Ruby/site.rb
================================================
class Site
attr_reader :owner, :strength, :production
def initialize(owner = 0, strength = 0, production = 0)
@owner, @strength, @production = owner, strength, production
end
end
================================================
FILE: airesources/Rust/Cargo.toml
================================================
[package]
name = "Rust"
version = "0.1.0"
authors = ["Benjamin Spector <benjaminfspector@gmail.com>"]
publish = false
vcs = "None"
[dependencies]
rand = "*"
text_io = "*"
[[bin]]
path = "src/MyBot.rs"
name = "MyBot"
[[bin]]
path = "src/RandomBot.rs"
name = "RandomBot"
================================================
FILE: airesources/Rust/runGame.bat
================================================
cargo build
.\halite.exe -d "30 30" "target/debug/MyBot" "target/debug/RandomBot"
================================================
FILE: airesources/Rust/runGame.sh
================================================
#!/bin/bash
cargo build
./halite -d "30 30" "target/debug/MyBot" "target/debug/RandomBot"
================================================
FILE: airesources/Rust/src/MyBot.rs
================================================
#![allow(non_snake_case)]
#![allow(warnings)]
extern crate rand;
#[macro_use] extern crate text_io;
//Notice: due to Rust's extreme dislike of (even private!) global mutables, we do not reset the production values of each tile during get_frame.
//If you change them, you may not be able to recover the actual production values of the map, so we recommend not editing them.
//However, if your code calls for it, you're welcome to edit the production values of the sites of the map - just do so at your own risk.
mod hlt;
use hlt::{ networking, types };
use std::collections::HashMap;
use rand::Rng;
fn main() {
let (my_id, mut game_map) = networking::get_init();
let mut rng = rand::thread_rng();
networking::send_init(format!("{}{}", "RustBot".to_string(), my_id.to_string()));
loop {
networking::get_frame(&mut game_map);
let mut moves = HashMap::new();
for a in 0..game_map.height {
for b in 0..game_map.width {
let l = hlt::types::Location { x: b, y: a };
if game_map.get_site(l, types::STILL).owner == my_id {
moves.insert(l, (rng.gen::<u32>() % 5) as u8);
}
}
}
networking::send_frame(moves);
}
}
================================================
FILE: airesources/Rust/src/RandomBot.rs
================================================
#![allow(non_snake_case)]
#![allow(warnings)]
extern crate rand;
#[macro_use] extern crate text_io;
//Notice: due to Rust's extreme dislike of (even private!) global mutables, we do not reset the production values of each tile during get_frame.
//If you change them, you may not be able to recover the actual production values of the map, so we recommend not editing them.
//However, if your code calls for it, you're welcome to edit the production values of the sites of the map - just do so at your own risk.
mod hlt;
use hlt::{ networking, types };
use std::collections::HashMap;
use rand::Rng;
fn main() {
let (my_id, mut game_map) = networking::get_init();
let mut rng = rand::thread_rng();
networking::send_init(format!("{}{}", "RustBot".to_string(), my_id.to_string()));
loop {
networking::get_frame(&mut game_map);
let mut moves = HashMap::new();
for a in 0..game_map.height {
for b in 0..game_map.width {
let l = hlt::types::Location { x: b, y: a };
if game_map.get_site(l, types::STILL).owner == my_id {
moves.insert(l, (rng.gen::<u32>() % 5) as u8);
}
}
}
networking::send_frame(moves);
}
}
================================================
FILE: airesources/Rust/src/hlt/mod.rs
================================================
#![allow(warnings)]
pub mod networking;
pub mod types;
================================================
FILE: airesources/Rust/src/hlt/networking.rs
================================================
#![allow(warnings)]
use hlt::types;
use std::io;
use std::collections::HashMap;
use std::io::Write;
use std::str::FromStr;
//Persistant between moves, that way if the user screws up the map it won't persist.
static mut _width: u16 = 0;
static mut _height: u16 = 0;
fn serialize_move_set(moves: HashMap<types::Location, u8>) -> String {
let mut s: String = String::new();
for (l, d) in moves {
s = format!("{}{} {} {} ", s, l.x, l.y, d);
}
s
}
fn deserialize_map_size(s: String) -> () {
let splt: Vec<&str> = s.split(" ").collect();
unsafe {
_width = u16::from_str(splt[0]).unwrap();
_height = u16::from_str(splt[1]).unwrap();
}
}
fn deserialize_productions(s: String) -> types::GameMap {
let splt: Vec<&str> = s.split(" ").collect();
let mut gmp = types::GameMap { width: 0, height: 0, contents: Vec::new() };
unsafe {
gmp.width = _width;
gmp.height= _height;
}
gmp.contents.resize(gmp.height as usize, Vec::new());
let mut loc = 0;
for v in &mut gmp.contents {
for x in 0..gmp.width {
v.push(types::Site { owner: 0, strength: 0, production: u8::from_str(splt[loc]).unwrap() });
loc += 1;
}
}
gmp
}
fn deserialize_map(s: String, gmp: &mut types::GameMap) -> () {
let splt: Vec<&str> = s.split(" ").collect();
unsafe {
let mut counter = 0;
let mut owner = 0;
let mut loc: usize = 0;
for a in 0.._height {
for b in 0.._width {
if counter == 0 {
counter = u16::from_str(splt[loc]).unwrap();
loc += 1;
owner = u8::from_str(splt[loc]).unwrap();
loc += 1;
}
gmp.get_site(types::Location { x: b, y: a }, types::STILL).owner = owner;
counter -= 1;
}
}
for a in 0.._height {
for b in 0.._width {
gmp.get_site(types::Location { x: b, y: a }, types::STILL).strength = u8::from_str(splt[loc]).unwrap();
loc += 1;
}
}
}
}
fn send_string(s: String) -> () {
println!("{}", s);
io::stdout().flush();
}
fn get_string() -> String {
read!("{}\n")
}
pub fn get_init() -> (u8, types::GameMap) {
let playerTag: u8 = u8::from_str(&get_string()).unwrap();
deserialize_map_size(get_string());
let mut gmp = deserialize_productions(get_string());
deserialize_map(get_string(), &mut gmp);
(playerTag, gmp)
}
pub fn send_init(name: String) -> () {
send_string(name);
}
pub fn get_frame(gmp: &mut types::GameMap) -> () {
deserialize_map(get_string(), gmp);
}
pub fn send_frame(moves: HashMap<types::Location, u8>) -> () {
send_string(serialize_move_set(moves));
}
================================================
FILE: airesources/Rust/src/hlt/types.rs
================================================
#![allow(warnings)]
pub const STILL: u8 = 0;
pub const NORTH: u8 = 1;
pub const EAST: u8 = 2;
pub const SOUTH: u8 = 3;
pub const WEST: u8 = 4;
pub const DIRECTIONS: [u8; 5] = [STILL, NORTH, EAST, SOUTH, WEST];
pub const CARDINALS: [u8; 4] = [NORTH, EAST, SOUTH, WEST];
#[derive(Copy, Clone, Hash, Eq, PartialEq, PartialOrd, Ord, Debug)]
pub struct Location {
pub x: u16,
pub y: u16,
}
#[derive(Copy, Clone, Eq, Debug, PartialEq)]
pub struct Site {
pub owner: u8,
pub strength: u8,
pub production: u8,
}
#[derive(Clone, Debug)]
pub struct GameMap {
pub width: u16, //Number of columns.
pub height: u16, //Number of rows.
pub contents: Vec< Vec<Site> >,
}
impl GameMap {
pub fn in_bounds(&self, l: Location) -> bool {
l.x < self.width && l.y < self.height
}
pub fn get_distance(&self, l1: Location, l2: Location) -> u16 {
let mut dx = (l1.x as i16 - l2.x as i16).abs();
let mut dy = (l1.y as i16 - l2.y as i16).abs();
if dx > self.width as i16 / 2 { dx = self.width as i16 - dx; }
if dy > self.height as i16 / 2 { dy = self.height as i16 - dy; }
(dx + dy) as u16
}
pub fn get_angle(&self, l1: Location, l2: Location) -> f64 {
let mut dx = l2.x as i16- l1.x as i16;
let mut dy = l2.y as i16 - l1.y as i16;
if dx > self.width as i16 - dx { dx -= self.width as i16; }
else if-dx > self.width as i16 + dx { dx += self.width as i16; }
if dy > self.height as i16 - dy { dy -= self.height as i16; }
else if -dy > self.height as i16 + dy { dy += self.height as i16; }
(dy as f64).atan2(dx as f64)
}
pub fn get_location(&self, l: Location, d: u8) -> Location {
let mut loc = Location { x: l.x, y: l.y };
if d == NORTH {
if loc.y == 0 { loc.y = self.height - 1; }
else { loc.y -= 1; }
} else if d == EAST {
if loc.x == self.width - 1 { loc.x = 0; }
else { loc.x += 1; }
} else if d == SOUTH {
if loc.y == self.height - 1 { loc.y = 0; }
else { loc.y += 1; }
} else if d == WEST {
if loc.x == 0 { loc.x = self.width - 1; }
else { loc.x -= 1; }
}
loc
}
pub fn get_site(&mut self, l: Location, d: u8) -> &mut Site {
let loc = self.get_location(l, d);
&mut self.contents[loc.y as usize][loc.x as usize]
}
pub fn get_site_ref(&self, l: Location, d: u8) -> &Site {
let loc = self.get_location(l, d);
&self.contents[loc.y as usize][loc.x as usize]
}
}
================================================
FILE: airesources/Scala/Bot.scala
================================================
trait Bot {
def getMoves(grid: Grid): Iterable[Move]
}
trait BotFactory {
def make(id: Int): Bot
}
================================================
FILE: airesources/Scala/Direction.scala
================================================
import scala.util.Random
object Direction {
private val random = new Random()
val CARDINALS = Seq(North, East, South, West)
val ALL = Seq(Still, North, East, South, West)
def getRandomDir: Direction = ALL(random.nextInt(5))
def getRandomCard: Direction = CARDINALS(random.nextInt(4))
}
class Direction(value: Int) {
def getValue = value
}
case object Still extends Direction(0)
case object North extends Direction(1)
case object East extends Direction(2)
case object South extends Direction(3)
case object West extends Direction(4)
================================================
FILE: airesources/Scala/Env.scala
================================================
object Env {
def readId(): Int = {
read().toInt
}
def readInit(): Grid = {
val dims = read().split(" ")
val width = dims(0).toInt
val height = dims(1).toInt
val locations = Array.ofDim[Location](height, width)
val productions = read().split(" ")
for (y <- 0 until height) {
for (x <- 0 until width) {
locations(y)(x) = Location(x, y, productions(y * width + x).toInt)
}
}
val occupants = readFrame(width, height)
new Grid(width, height, locations, occupants)
}
def readFrame(width: Int, height: Int): Array[Array[Occupant]] = {
val ownersStrengths = read().split(" ")
val strengthsIndex = ownersStrengths.length - width * height
var y, x, count = 0
var owner, cur, i = 0
val occupants = Array.ofDim[Occupant](height, width)
while (y < height) {
if (cur < count) {
occupants(y)(x) = Occupant(owner, ownersStrengths(strengthsIndex + y * width + x).toInt)
if (x == width - 1) {
x = 0
y += 1
} else {
x += 1
}
cur += 1
} else {
count = ownersStrengths(i).toInt
owner = ownersStrengths(i + 1).toInt
cur = 0
i += 2
}
}
occupants
}
def writeFrame(moves: Iterable[Move]): Unit = {
val builder = new StringBuilder()
moves foreach { m =>
builder.append(m.location.x)
builder.append(" ")
builder.append(m.location.y)
builder.append(" ")
builder.append(m.direction.getValue)
builder.append(" ")
}
writeString(builder.toString())
}
def writeInit(name: String): Unit = {
writeString(name)
}
private def writeString(s: String): Unit = {
System.out.print(s + '\n')
System.out.flush()
}
private def read(): String = {
val buffer = new StringBuilder()
var next = System.in.read()
while (next != '\n' && next != 0) {
buffer.append(next.asInstanceOf[Char])
next = System.in.read()
}
buffer.toString
}
}
================================================
FILE: airesources/Scala/Grid.scala
================================================
object Grid {
val NEUTRAL = 0
}
class Grid(width: Int, height: Int, locations: Array[Array[Location]], var occupants: Array[Array[Occupant]]) {
def update(occupants: Array[Array[Occupant]]) = this.occupants = occupants
def getWidth = width
def getHeight = height
def getOccupant(x: Int, y: Int): Occupant = occupants(y)(x)
def getLocation(x: Int, y: Int): Location = locations(y)(x)
def getSite(x: Int, y: Int): Site = Site(getLocation(x, y), getOccupant(x, y))
def getSites: Seq[Site] = {
for {
x <- 0 until width
y <- 0 until height
} yield getSite(x, y)
}
def getMine(id: Int): Seq[Site] = {
for {
x <- 0 until width
y <- 0 until height
if getOccupant(x, y).id == id
} yield getSite(x, y)
}
def getDistance(first: Location, second: Location): Int = {
var dx = Math.abs(first.x - second.x)
var dy = Math.abs(first.y - second.y)
if (dx > width / 2.0) {
dx = width - dx
}
if (dy > height / 2.0) {
dy = height - dy
}
dx + dy
}
def getAngle(first: Location, second: Location): Double = {
var dx = first.x - second.x
// Flip order because 0,0 is top left
// and want atan2 to look as it would on the unit circle
var dy = second.y - first.y
if (dx > width - dx) {
dx -= width
}
if (-dx > width + dx) {
dx += width
}
if (dy > height - dy) {
dy -= height
}
if (-dy > height + dy) {
dy += height
}
Math.atan2(dy, dx)
}
def getNeighbor(location: Location, direction: Direction): Neighbor = {
val x = location.x
val y = location.y
direction match {
case North => Neighbor(getSite(x, if (y == 0) height - 1 else y - 1), North)
case East => Neighbor(getSite(if (x == width - 1) 0 else x + 1, y), East)
case South => Neighbor(getSite(x, if (y == height - 1) 0 else y + 1), South)
case West => Neighbor(getSite(if (x == 0) width - 1 else x - 1, y), West)
case Still => Neighbor(getSite(x, y), Still)
}
}
def getNeighbors(location: Location): Seq[Neighbor] = {
Direction.CARDINALS map (d => getNeighbor(location, d))
}
def getMyNeighbors(id: Int, location: Location): Seq[Neighbor] = {
getNeighbors(location).filter(_.site.occupant.id == id)
}
}
case class Location(x: Int, y: Int, production: Int)
case class Occupant(id: Int, strength: Int)
case class Site(location: Location, occupant: Occupant)
case class Neighbor(site: Site, direction: Direction)
================================================
FILE: airesources/Scala/Move.scala
================================================
case class Move(location: Location, direction: Direction)
================================================
FILE: airesources/Scala/MyBot.scala
================================================
object MyBot extends BotFactory {
def main(args: Array[String]): Unit = {
Runner.run("scalaMyBot", this)
}
override def make(id: Int): Bot = new MyBot(id)
}
class MyBot(myId: Int) extends Bot {
override def getMoves(grid: Grid): Iterable[Move] = {
for {
site <- grid.getMine(myId)
} yield Move(site.location, Direction.getRandomDir)
}
}
================================================
FILE: airesources/Scala/RandomBot.scala
================================================
object RandomBot extends BotFactory {
def main(args: Array[String]): Unit = {
Runner.run("scalaRandom", this)
}
override def make(id: Int): Bot = new RandomBot(id)
}
class RandomBot(myId: Int) extends Bot {
override def getMoves(grid: Grid): Iterable[Move] = {
for {
site <- grid.getMine(myId)
} yield Move(site.location, Direction.getRandomDir)
}
}
================================================
FILE: airesources/Scala/Runner.scala
================================================
object Runner {
def run(name: String, botFactory: BotFactory): Unit = {
val id = Env.readId()
val grid = Env.readInit()
val bot = botFactory.make(id)
Env.writeInit(name)
while (true) {
val occupants = Env.readFrame(grid.getWidth, grid.getHeight)
grid.update(occupants)
val moves = bot.getMoves(grid)
Env.writeFrame(moves)
}
}
}
================================================
FILE: airesources/Scala/runGame.bat
================================================
javac *.java
scalac HaliteBot.scala
scalac MyBot.scala
scalac RandomBot.scala
\halite.exe -d "30 30" "scala MyBot" "scala RandomBot"
================================================
FILE: airesources/Scala/runGame.sh
================================================
#!/bin/bash
scalac *.scala
./halite -d "30 30" "scala MyBot" "scala RandomBot"
================================================
FILE: airesources/Sockets/HaliteSocketHelper.cs
================================================
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
/*
* Note: For reasons presently unclear this networking package
* does not appear to be working with the pipe_socket_translator.py
* also provided. Please see the forums for a temporary workaround
* while we fix this issue. Thank you.
*/
/// <summary>
/// Helpful for debugging.
/// </summary>
public static class Log
{
private static string _logPath;
/// <summary>
/// File must exist
/// </summary>
public static void Setup(string logPath) {
_logPath = logPath;
}
public static void Information(string message) {
if (!string.IsNullOrEmpty(_logPath))
File.AppendAllLines(_logPath, new[] {string.Format("{0}: {1}", DateTime.Now.ToShortTimeString(), message)});
}
public static void Error(Exception exception) {
Log.Information(string.Format("ERROR: {0} {1}", exception.Message, exception.StackTrace));
}
}
public static class Networking
{
/// Socket input stream.
private static StreamReader _streamReader;
private static StreamWriter _streamWriter;
private static string ReadNextLine() {
var str = _streamReader.ReadLine();
if (str == null) throw new ApplicationException("Could not read next line from socket");
return str;
}
private static void SendString(string str) {
_streamWriter.WriteLine(str);
}
/// <summary>
/// Call once at the start of a game to load the map and player tag from the first four stdin lines.
/// </summary>
public static Map getInit(out ushort playerTag) {
Console.WriteLine("Enter the port on which to connect: ");
var client = new TcpClient("127.0.0.1", int.Parse(Console.ReadLine()));
var networkStream = client.GetStream();
_streamReader = new StreamReader(new BufferedStream(networkStream));
_streamWriter = new StreamWriter(networkStream) {AutoFlush = true};
// Line 1: Player tag
if (!ushort.TryParse(ReadNextLine(), out playerTag))
throw new ApplicationException("Could not get player tag from socket during init");
// Lines 2-4: Map
var map = Map.ParseMap(ReadNextLine(), ReadNextLine(), ReadNextLine());
return map;
}
/// <summary>
/// Call every frame to update the map to the next one provided by the environment.
/// </summary>
public static void getFrame(ref Map map) {
map.Update(ReadNextLine());
}
/// <summary>
/// Call to acknowledge the initail game map and start the game.
/// </summary>
public static void SendInit(string botName) {
SendString(botName);
}
/// <summary>
/// Call to send your move orders and complete your turn.
/// </summary>
public static void SendMoves(IEnumerable<Move> moves) {
SendString(Move.MovesToString(moves));
}
}
public enum Direction
{
Still = 0,
North = 1,
East = 2,
South = 3,
West = 4
}
public struct Site
{
public ushort Owner { get; internal set; }
public ushort Strength { get; internal set; }
public ushort Production { get; internal set; }
}
public struct Location
{
public ushort X;
public ushort Y;
}
public struct Move
{
public Location Location;
public Direction Direction;
internal static string MovesToString(IEnumerable<Move> moves) {
return string.Join(" ", moves.Select(m => string.Format("{0} {1} {2}", m.Location.X, m.Location.Y, (int)m.Direction)));
}
}
/// <summary>
/// State of the game at every turn. Use <see cref="GetInitialMap"/> to get the map for a new game from
/// stdin, and use <see cref="NextTurn"/> to update the map after orders for a turn have been executed.
/// </summary>
public class Map
{
public void Update(string gameMapStr) {
var gameMapValues = new Queue<string>(gameMapStr.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries));
ushort x = 0, y = 0;
while (y < Height) {
ushort counter, owner;
if (!ushort.TryParse(gameMapValues.Dequeue(), out counter))
throw new ApplicationException("Could not get some counter from stdin");
if (!ushort.TryParse(gameMapValues.Dequeue(), out owner))
throw new ApplicationException("Could not get some owner from stdin");
while (counter > 0) {
_sites[x, y] = new Site {Owner = owner};
x++;
if (x == Width) {
x = 0;
y++;
}
counter--;
}
}
var strengthValues = gameMapValues; // Referencing same queue, but using a name that is more clear
for (x = 0; x < Width; x++) {
for (y = 0; y < Height; y++) {
ushort strength;
if (!ushort.TryParse(strengthValues.Dequeue(), out strength))
throw new ApplicationException("Could not get some strength value from stdin");
_sites[x, y].Strength = strength;
}
}
}
/// <summary>
/// Get a read-only structure representing the current state of the site at the supplied coordinates.
/// </summary>
public Site this[ushort x, ushort y] {
get {
if (x >= Width)
throw new IndexOutOfRangeException(string.Format("Cannot get site at ({0},{1}) beacuse width is only {2}", x, y, Width));
if (y >= Height)
throw new IndexOutOfRangeException(string.Format("Cannot get site at ({0},{1}) beacuse height is only {2}", x, y, Height));
return _sites[x, y];
}
}
/// <summary>
/// Get a read-only structure representing the current state of the site at the supplied location.
/// </summary>
public Site this[Location location] => this[location.X, location.Y];
/// <summary>
/// Returns the width of the map.
/// </summary>
public ushort Width => (ushort)_sites.GetLength(0);
/// <summary>
/// Returns the height of the map.
/// </summary>
public ushort Height => (ushort)_sites.GetLength(1);
#region Implementation
private readonly Site[,] _sites;
private Map(ushort width, ushort height) {
_sites = new Site[width, height];
for (ushort x = 0; x < width; x++) {
for (ushort y = 0; y < height; y++) {
_sites[x, y] = new Site();
}
}
}
private static Tuple<ushort, ushort> ParseMapSize(string mapSizeStr) {
ushort width, height;
var parts = mapSizeStr.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries);
if (parts.Length != 2 || !ushort.TryParse(parts[0], out width) || !ushort.TryParse(parts[1], out height))
throw new ApplicationException("Could not get map size from stdin during init");
return Tuple.Create(width, height);
}
public static Map ParseMap(string mapSizeStr, string productionMapStr, string gameMapStr) {
var mapSize = ParseMapSize(mapSizeStr);
var map = new Map(mapSize.Item1, mapSize.Item2);
var productionValues = new Queue<string>(productionMapStr.Split(new[] {' '}, StringSplitOptions.RemoveEmptyEntries));
ushort x, y;
for (x = 0; x < map.Width; x++) {
for (y = 0; y < map.Height; y++) {
ushort production;
if (!ushort.TryParse(productionValues.Dequeue(), out production))
throw new ApplicationException("Could not get some production value from stdin");
map._sites[x, y].Production = production;
}
}
map.Update(gameMapStr);
return map;
}
#endregion
}
================================================
FILE: airesources/Sockets/SocketNetworking.java
================================================
import java.net.*;
import java.io.*;
import java.util.ArrayList;
import java.util.Scanner;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
public class SocketNetworking {
public static final int SIZE_OF_INTEGER_PREFIX = 4;
public static final int CHAR_SIZE = 1;
private static BufferedReader _in;
private static PrintWriter _out;
private static int _width, _height;
private static ArrayList< ArrayList<Integer> > _productions;
private static void deserializeGameMapSize(String inputString) {
String[] inputStringComponents = inputString.split(" ");
_width = Integer.parseInt(inputStringComponents[0]);
_height = Integer.parseInt(inputStringComponents[1]);
}
private static void deserializeProductions(String inputString) {
String[] inputStringComponents = inputString.split(" ");
int index = 0;
_productions = new ArrayList< ArrayList<Integer> >();
for(int a = 0; a < _height; a++) {
ArrayList<Integer> row = new ArrayList<Integer>();
for(int b = 0; b < _width; b++) {
row.add(Integer.parseInt(inputStringComponents[index]));
index++;
}
_productions.add(row);
}
}
private static String serializeMoveList(ArrayList<Move> moves) {
StringBuilder builder = new StringBuilder();
for(Move move : moves) builder.append(move.loc.x + " " + move.loc.y + " " + move.dir.ordinal() + " ");
return builder.toString();
}
private static GameMap deserializeGameMap(String inputString) {
String[] inputStringComponents = inputString.split(" ");
GameMap map = new GameMap(_width, _height);
// Run-length encode of owners
int y = 0, x = 0;
int counter = 0, owner = 0;
int currentIndex = 0;
while(y != map.height) {
counter = Integer.parseInt(inputStringComponents[currentIndex]);
owner = Integer.parseInt(inputStringComponents[currentIndex + 1]);
currentIndex += 2;
for(int a = 0; a < counter; ++a) {
map.contents.get(y).get(x).owner = owner;
++x;
if(x == map.width) {
x = 0;
++y;
}
}
}
for (int a = 0; a < map.contents.size(); ++a) {
for (int b = 0; b < map.contents.get(a).size(); ++b) {
int strengthInt = Integer.parseInt(inputStringComponents[currentIndex]);
currentIndex++;
map.contents.get(a).get(b).strength = strengthInt;
map.contents.get(a).get(b).production = _productions.get(a).get(b);
}
}
return map;
}
private static void sendString(String sendString) throws java.io.IOException {
_out.println(sendString);
_out.flush();
}
private static String getString() throws java.io.IOException {
return _in.readLine();
}
public static InitPackage getInit() throws java.io.IOException {
//Set up connection
System.out.print("Enter the port on which to connect: ");
Scanner in = new Scanner(System.in);
int port = in.nextInt();
Socket connection = new Socket("127.0.0.1", port);
System.out.println("Connected to intermediary on port #" + port);
_in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
_out = new PrintWriter(connection.getOutputStream(), false);
InitPackage initPackage = new InitPackage();
initPackage.myID = (int)Long.parseLong(getString());
deserializeGameMapSize(getString());
deserializeProductions(getString());
initPackage.map = deserializeGameMap(getString());
return initPackage;
}
public static void sendInit(String name) throws java.io.IOException {
sendString(name);
}
public static GameMap getFrame() throws java.io.IOException {
return deserializeGameMap(getString());
}
public static void sendFrame(ArrayList<Move> moves) throws java.io.IOException {
sendString(serializeMoveList(moves));
}
}
================================================
FILE: airesources/Sockets/pipe_socket_translator.py
================================================
import socket
import sys
# Connect
socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket.bind(('localhost', int(sys.argv[1])))
socket.listen(1)
connection, _ = socket.accept()
# IO Functions
def sendStringPipe(toBeSent):
sys.stdout.write(toBeSent+'\n')
sys.stdout.flush()
def getStringPipe():
str = sys.stdin.readline().rstrip('\n')
return(str)
def sendStringSocket(toBeSent):
global connection
toBeSent += '\n'
connection.sendall(bytes(toBeSent, 'ascii'))
def getStringSocket():
global connection
newString = ""
buffer = '\0'
while True:
buffer = connection.recv(1).decode('ascii')
if buffer != '\n':
newString += str(buffer)
else:
return newString
# Handle Init IO
sendStringSocket(getStringPipe()) # Player ID
sendStringSocket(getStringPipe()) # Map Dimensions
sendStringSocket(getStringPipe()) # Productions
sendStringSocket(getStringPipe()) # Starting Map
sendStringPipe(getStringSocket()) # Player Name / Ready Response
# Run Frame Loop
while True:
sendStringSocket(getStringPipe()) # Frame Map
sendStringPipe(getStringSocket()) # Move List
================================================
FILE: airesources/Sockets/socket_networking.hpp
================================================
#ifndef AI_NETWORKING_H
#define AI_NETWORKING_H
#include <iostream>
#include <time.h>
#include <set>
#include <cfloat>
#include <fstream>
#include <string>
#include <sstream>
#include <algorithm>
#include <bitset>
#include <assert.h>
#ifdef _WIN32
#include <sys/types.h>
#include <Winsock2.h>
#include <Ws2tcpip.h>
#else
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <netdb.h>
#include <netinet/in.h>
#include <string.h>
#include <sys/types.h>
#endif
#include "hlt.hpp"
namespace detail {
static std::vector< std::vector<unsigned char> > productions;
static int width, height;
#ifdef _WIN32
static SOCKET connection = INVALID_SOCKET;
#else
static int connection;
#endif
static std::string serializeMoveSet(const std::set<hlt::Move> &moves) {
std::ostringstream oss;
for(auto a = moves.begin(); a != moves.end(); ++a) oss << a->loc.x << " " << a->loc.y << " " << (int)a->dir << " ";
return oss.str();
}
static void deserializeMapSize(const std::string & inputString) {
std::stringstream iss(inputString);
iss >> width >> height;
}
static void deserializeProductions(const std::string & inputString) {
std::stringstream iss(inputString);
productions.resize(height);
short temp;
for(auto a = productions.begin(); a != productions.end(); a++) {
a->resize(width);
for(auto b = a->begin(); b != a->end(); b++) {
iss >> temp;
*b = temp;
}
}
}
static hlt::GameMap deserializeMap(const std::string & inputString) {
std::stringstream iss(inputString);
hlt::GameMap map(width, height);
//Set productions
for(int a = 0; a < map.height; a++) {
for(int b = 0; b < map.width; b++) {
map.contents[a][b].production = productions[a][b];
}
}
//Run-length encode of owners
unsigned short y = 0, x = 0;
unsigned short counter = 0, owner = 0;
while(y != map.height) {
for(iss >> counter >> owner; counter; counter--) {
map.contents[y][x].owner = owner;
x++;
if(x == map.width) {
x = 0;
y++;
}
}
}
for (int a = 0; a < map.contents.size(); a++) {
for (int b = 0; b < map.contents[a].size(); b++) {
short strengthShort;
iss >> strengthShort;
map.contents[a][b].strength = strengthShort;
}
}
return map;
}
static void sendString(std::string & sendString) {
sendString.push_back('\n');
#ifdef _WIN32
int result = send(connection, sendString.c_str(), sendString.size(), 0);
assert(result != SOCKET_ERROR);
#else
int result = write(connection, sendString.c_str(), sendString.size());
assert(result >= 1); //Should be at least 1, as at least a newline should get written.
#endif
sendString.pop_back(); //Remove newline.
}
static std::string getString() {
std::string newString;
char buffer = 0;
while(buffer != '\n') {
#ifdef _WIN32
int result = recv(connection, &buffer, 1, 0);
assert(result != SOCKET_ERROR);
#else
int result = read(connection, &buffer, 1);
assert(result >= 0);
#endif
newString.push_back(buffer);
}
return newString;
}
}
static void getInit(unsigned char& playerTag, hlt::GameMap& m) {
int port;
std::cout << "Enter the port on which to connect: ";
std::cin >> port;
#ifdef _WIN32
WSADATA wsaData;
int iResult = WSAStartup(MAKEWORD(2,2), &wsaData);
assert(iResult == 0); //Confirms that Winsock started up correctly.
struct addrinfo hints, * result;
ZeroMemory(&hints, sizeof(hints));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
iResult = getaddrinfo("127.0.0.1", std::to_string(port).c_str(), &hints, &result);
assert(iResult == 0); //Confirms that getaddrinfo did not fail.
detail::connection = socket(result->ai_family, result->ai_socktype, result->ai_protocol); //Creates socket.
assert(detail::connection != INVALID_SOCKET); //Confirms connection is a valid socket.
iResult = connect(detail::connection, result->ai_addr, int(result->ai_addrlen));
assert(iResult != SOCKET_ERROR); //Confirms that there was a successful connection.
freeaddrinfo(result);
#else
//Connect to port
connection = socket(AF_INET, SOCK_STREAM, 0);
assert(detail::connection >= 0);
struct hostent *server;
server = gethostbyname("127.0.0.1");
assert(server != NULL);
struct sockaddr_in serverAddr;
bzero((char *) &serverAddr, sizeof(serverAddr));
serverAddr.sin_family = AF_INET;
bcopy((char *)server->h_addr, (char *)&serverAddr.sin_addr.s_addr, server->h_length);
serverAddr.sin_port = htons(port);
assert(connect(detail::connection, (struct sockaddr *)&serverAddr, sizeof(serverAddr)) >= 0);
#endif
std::cout << "Connected to intermediary on port #" << port << std::endl;
playerTag = (unsigned char)std::stoi(detail::getString());
detail::deserializeMapSize(detail::getString());
detail::deserializeProductions(detail::getString());
m = detail::deserializeMap(detail::getString());
}
static void sendInit(std::string name) {
detail::sendString(name);
}
static void getFrame(hlt::GameMap& m) {
m = detail::deserializeMap(detail::getString());
}
static void sendFrame(const std::set<hlt::Move> &moves) {
std::string serializedMoves = detail::serializeMoveSet(moves);
detail::sendString(serializedMoves);
}
#endif
================================================
FILE: airesources/Sockets/socket_networking.py
================================================
from hlt import *
import socket
import traceback
import struct
from ctypes import *
import sys
_productions = []
_width = -1
_height = -1
_connection = None
def serializeMoveSet(moves):
returnString = ""
for move in moves:
returnString += str(move.loc.x) + " " + str(move.loc.y) + " " + str(move.direction) + " "
return returnString
def deserializeMapSize(inputString):
splitString = inputString.split(" ")
global _width, _height
_width = int(splitString.pop(0))
_height = int(splitString.pop(0))
def deserializeProductions(inputString):
splitString = inputString.split(" ")
for a in range(0, _height):
row = []
for b in range(0, _width):
row.append(int(splitString.pop(0)))
_productions.append(row)
def deserializeMap(inputString):
splitString = inputString.split(" ")
m = GameMap(_width, _height)
y = 0
x = 0
counter = 0
owner = 0
while y != m.height:
counter = int(splitString.pop(0))
owner = int(splitString.pop(0))
for a in range(0, counter):
m.contents[y][x].owner = owner
x += 1
if x == m.width:
x = 0
y += 1
for a in range(0, _height):
for b in range(0, _width):
m.contents[a][b].strength = int(splitString.pop(0))
m.contents[a][b].production = _productions[a][b]
return m
def sendString(toBeSent):
global _connection
toBeSent += '\n'
_connection.sendall(bytes(toBeSent, 'ascii'))
def getString():
global _connection
newString = ""
buffer = '\0'
while True:
buffer = _connection.recv(1).decode('ascii')
if buffer != '\n':
newString += str(buffer)
else:
return newString
def getInit():
# Connect to environment.
global _connection
_connection = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
port = int(input('Enter the port on which to connect: '))
_connection.connect(('localhost', port))
print('Connected to intermediary on port #' + str(port))
playerTag = int(getString())
deserializeMapSize(getString())
deserializeProductions(getString())
m = deserializeMap(getString())
return (playerTag, m)
def sendInit(name):
sendString(name)
def getFrame():
return deserializeMap(getString())
def sendFrame(moves):
sendString(serializeMoveSet(moves))
================================================
FILE: appveyor.yml
================================================
# Specify version format
version: "{build}"
only_commits:
message: /build/
# Build worker image (VM template)
image: Windows Server 2012 R2
# clone directory
clone_folder: C:\Halite
# branches to build
branches:
only:
- master
#before_build:
# - dir \s
# scripts that run after cloning repository
build_script:
- cd C:\Halite\environment
- .\make.bat
artifacts:
- path: environment\halite.exe
name: halite.exe
================================================
FILE: environment/Makefile
================================================
CXXFLAGS += -std=c++11 -pthread -I ./
INSTALL_PATH?=/usr/local
SOURCES=$(shell find . -name "*.cpp")
OBJECTS=$(SOURCES:%.cpp=%.o)
TARGET=halite
.PHONY: all
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@
.PHONY: clean
clean:
rm -f $(TARGET) $(OBJECTS)
.PHONY: install
install:
install -m 0755 halite $(INSTALL_PATH)/bin
================================================
FILE: environment/core/Halite.cpp
================================================
#include "Halite.hpp"
#include "limits.h"
#define F_NEWLINE '\n'
//Private Functions ------------------
std::vector<bool> Halite::processNextFrame(std::vector<bool> alive) {
//Update alive frame counts
for(unsigned char a = 0; a < number_of_players; a++) if(alive[a]) alive_frame_count[a]++;
//Create threads to send/receive data to/from players. The threads should return a float of how much time passed between the end of their message being sent and the end of the AI's message being received.
std::vector< std::future<int> > frameThreads(std::count(alive.begin(), alive.end(), true));
unsigned char threadLocation = 0; //Represents place in frameThreads.
//Get the messages sent by bots this frame
for(unsigned char a = 0; a < number_of_players; a++) {
if(alive[a]) {
frameThreads[threadLocation] = std::async(&Networking::handleFrameNetworking, &networking, a + 1, turn_number, game_map, ignore_timeout, &player_moves[a]);
threadLocation++;
}
}
full_player_moves.push_back(std::vector< std::vector<int> >(game_map.map_height, std::vector<int>(game_map.map_width, 0)));
//Join threads. Figure out if the player responded in an allowable amount of time or if the player has timed out.
threadLocation = 0; //Represents place in frameThreads.
for(unsigned char a = 0; a < number_of_players; a++) {
if(alive[a]) {
int time = frameThreads[threadLocation].get();
if(time == -1) {
networking.killPlayer(a + 1);
timeout_tags.insert(a + 1);
//Give their pieces to the neutral player.
for(unsigned short b = 0; b < game_map.map_height; b++) for(unsigned short c = 0; c < game_map.map_width; c++) if(game_map.contents[b][c].owner == a + 1) game_map.contents[b][c].owner = 0;
}
else total_frame_response_times[a] += time;
threadLocation++;
}
}
std::vector< std::map<hlt::Location, unsigned char> > pieces(number_of_players);
//For each player, use their moves to create the pieces map.
for(unsigned char a = 0; a < number_of_players; a++) if(alive[a]) {
//Add in pieces according to their moves. Also add in a second piece corresponding to the piece left behind.
for(auto b = player_moves[a].begin(); b != player_moves[a].end(); b++) if(game_map.inBounds(b->first) && game_map.getSite(b->first).owner == a + 1) {
if(b->second == STILL) {
if(game_map.getSite(b->first).strength + game_map.getSite(b->first).production <= 255) game_map.getSite(b->first).strength += game_map.getSite(b->first).production;
else game_map.getSite(b->first).strength = 255;
//Update full still count
full_still_count[a]++;
//Add to full production
full_production_count[a] += game_map.getSite(b->first).production;
}
//Update full caridnal count.
else full_cardinal_count[a]++;
//Update moves
full_player_moves.back()[b->first.y][b->first.x] = b->second;
hlt::Location newLoc = game_map.getLocation(b->first, b->second);
if(pieces[a].count(newLoc)) {
if(short(pieces[a][newLoc]) + game_map.getSite(b->first).strength <= 255) pieces[a][newLoc] += game_map.getSite(b->first).strength;
else pieces[a][newLoc] = 255;
}
else {
pieces[a].insert(std::pair<hlt::Location, unsigned char>(newLoc, game_map.getSite(b->first).strength));
}
//Add in a new piece with a strength of 0 if necessary.
if(!pieces[a].count(b->first)) {
pieces[a].insert(std::pair<hlt::Location, unsigned char>(b->first, 0));
}
//Erase from the game map so that the player can't make another move with the same piece.
game_map.getSite(b->first).owner = 0;
game_map.getSite(b->first).strength = 0;
}
}
//Add in all of the remaining pieces whose moves weren't specified.
for(unsigned short a = 0; a < game_map.map_height; a++) for(unsigned short b = 0; b < game_map.map_width; b++) {
hlt::Site & s = game_map.contents[a][b];
if(s.owner != 0) {
hlt::Location l = { b, a };
if(short(s.strength) + s.production <= 255) {
s.strength += s.production;
}
else s.strength = 255;
if(pieces[s.owner - 1].count(l)) {
if(short(pieces[s.owner - 1][l]) + s.strength <= 255) pieces[s.owner - 1][l] += s.strength;
else pieces[s.owner - 1][l] = 255;
}
else {
pieces[s.owner - 1].insert(std::pair<hlt::Location, unsigned char>(l, s.strength));
}
//Add to full production
full_production_count[s.owner - 1] += s.production;
//Update full still count
full_still_count[s.owner - 1]++;
//Erase from game map.
s.owner = 0;
s.strength = 0;
}
}
std::vector< std::map<hlt::Location, unsigned short> > toInjure(number_of_players);
std::vector< std::vector<unsigned short> > injureMap(game_map.map_height, std::vector<unsigned short>(game_map.map_width, 0));
//Sweep through locations and find the correct damage for each piece. Start by applying damage within only the active strengths.
for(unsigned char a = 0; a != game_map.map_height; a++) for(unsigned short b = 0; b < game_map.map_width; b++) {
hlt::Location l = { b, a };
for(unsigned short c = 0; c < number_of_players; c++) if(alive[c] && pieces[c].count(l)) {
for(unsigned short d = 0; d < number_of_players; d++) if(d != c && alive[d]) {
hlt::Location tempLoc = l;
//Check 'STILL' square. We also need to deal with the threshold here:
if(pieces[d].count(tempLoc)) {
//Apply damage, but not more than they have strength:
if(toInjure[d].count(tempLoc)) toInjure[d][tempLoc] += pieces[c][l];
else toInjure[d].insert(std::pair<hlt::Location, unsigned short>(tempLoc, pieces[c][l]));
}
//Check 'NORTH' square:
tempLoc = game_map.getLocation(l, NORTH);
if(pieces[d].count(tempLoc)) {
//Apply damage, but not more than they have strength:
if(toInjure[d].count(tempLoc)) toInjure[d][tempLoc] += pieces[c][l];
else toInjure[d].insert(std::pair<hlt::Location, unsigned short>(tempLoc, pieces[c][l]));
}
//Check 'EAST' square:
tempLoc = game_map.getLocation(l, EAST);
if(pieces[d].count(tempLoc)) {
//Apply damage, but not more than they have strength:
if(toInjure[d].count(tempLoc)) toInjure[d][tempLoc] += pieces[c][l];
else toInjure[d].insert(std::pair<hlt::Location, unsigned short>(tempLoc, pieces[c][l]));
}
//Check 'SOUTH' square:
tempLoc = game_map.getLocation(l, SOUTH);
if(pieces[d].count(tempLoc)) {
//Apply damage, but not more than they have strength:
if(toInjure[d].count(tempLoc)) toInjure[d][tempLoc] += pieces[c][l];
else toInjure[d].insert(std::pair<hlt::Location, unsigned short>(tempLoc, pieces[c][l]));
}
//Check 'WEST' square:
tempLoc = game_map.getLocation(l, WEST);
if(pieces[d].count(tempLoc)) {
//Apply damage, but not more than they have strength:
if(toInjure[d].count(tempLoc)) toInjure[d][tempLoc] += pieces[c][l];
else toInjure[d].insert(std::pair<hlt::Location, unsigned short>(tempLoc, pieces[c][l]));
}
}
if(game_map.getSite(l).strength > 0) {
if(toInjure[c].count(l)) toInjure[c][l] += game_map.getSite(l).strength;
else toInjure[c].insert(std::pair<hlt::Location, unsigned short>(l, game_map.getSite(l).strength));
injureMap[l.y][l.x] += pieces[c][l];
}
}
}
//Injure and/or delete pieces. Note >= rather than > indicates that pieces with a strength of 0 are killed.
for(unsigned char a = 0; a < number_of_players; a++) if(alive[a]) {
for(auto b = toInjure[a].begin(); b != toInjure[a].end(); b++) {
//Apply damage.
if(b->second >= pieces[a][b->first]) pieces[a].erase(b->first);
else pieces[a][b->first] -= b->second;
}
}
//Apply damage to map pieces.
for(int a = 0; a < game_map.map_height; a++) for(int b = 0; b < game_map.map_width; b++) {
if(game_map.contents[a][b].strength < injureMap[a][b]) game_map.contents[a][b].strength = 0;
else game_map.contents[a][b].strength -= injureMap[a][b];
game_map.contents[a][b].owner = 0;
}
//Add pieces back into the map.
for(unsigned char a = 0; a < number_of_players; a++) {
for(auto b = pieces[a].begin(); b != pieces[a].end(); b++) {
game_map.getSite(b->first).owner = a + 1;
game_map.getSite(b->first).strength = b->second;
}
}
//Add to full game:
full_frames.push_back(hlt::Map(game_map));
//Check if the game is over:
std::vector<bool> stillAlive(number_of_players, false);
for(auto a = last_territory_count.begin(); a != last_territory_count.end(); a++) *a = 0;
for(unsigned short a = 0; a < game_map.map_height; a++) for(unsigned short b = 0; b < game_map.map_width; b++) if(game_map.contents[a][b].owner != 0) {
last_territory_count[game_map.contents[a][b].owner - 1]++;
full_territory_count[game_map.contents[a][b].owner - 1]++;
full_strength_count[game_map.contents[a][b].owner - 1] += game_map.contents[a][b].strength;
full_production_count[game_map.contents[a][b].owner - 1] += game_map.contents[a][b].strength;
stillAlive[game_map.contents[a][b].owner - 1] = true;
}
return stillAlive;
}
//Public Functions -------------------
Halite::Halite(unsigned short width_, unsigned short height_, unsigned int seed_, unsigned short n_players_for_map_creation, Networking networking_, bool shouldIgnoreTimeout) {
networking = networking_;
// number_of_players is the number of active bots to start the match; it is constant throughout game
number_of_players = networking.numberOfPlayers();
//Initialize map
game_map = hlt::Map(width_, height_, n_players_for_map_creation, seed_);
//If this is single-player mode, remove all the extra players (they were automatically inserted in map, just 0 them out)
if (number_of_players == 1){
for(unsigned short b = 0; b < game_map.map_height; b++) for(unsigned short c = 0; c < game_map.map_width; c++) if(game_map.contents[b][c].owner > 1) game_map.contents[b][c].owner = 0;
}
//Default initialize
player_moves = std::vector< std::map<hlt::Location, unsigned char> >();
turn_number = 0;
player_names = std::vector< std::string >(number_of_players);
//Add to full game:
full_frames.push_back(hlt::Map(game_map));
//Initialize player moves vector
player_moves.resize(number_of_players);
//Check if timeout should be ignored.
ignore_timeout = shouldIgnoreTimeout;
//Init statistics
productive_squares_remaining = 1; // just more than zero to get through the game_loop the first time
alive_frame_count = std::vector<unsigned short>(number_of_players, 1);
last_territory_count = std::vector<unsigned int>(number_of_players, 1);
full_territory_count = std::vector<unsigned int>(number_of_players, 1);
full_strength_count = std::vector<unsigned int>(number_of_players, 255);
full_production_count = std::vector<unsigned int>(number_of_players);
full_still_count = std::vector<unsigned int>(number_of_players);
full_cardinal_count = std::vector<unsigned int>(number_of_players);
init_response_times = std::vector<unsigned int>(number_of_players);
total_frame_response_times = std::vector<unsigned int>(number_of_players);
timeout_tags = std::set<unsigned short>();
}
void Halite::output(std::string filename) {
std::ofstream gameFile;
gameFile.open(filename, std::ios_base::binary);
if(!gameFile.is_open()) throw std::runtime_error("Could not open file for replay");
nlohmann::json j;
//This is version 11.
j["version"] = 11;
//Encode some details about the game that will make it convenient to parse.
j["width"] = game_map.map_width;
j["height"] = game_map.map_height;
j["num_players"] = player_names.size();
j["num_frames"] = full_frames.size();
//Encode player names.
j["player_names"] = nlohmann::json(player_names);
//Encode the production map.
std::vector< std::vector<int> > productions(game_map.map_height, std::vector<int>(game_map.map_width));
for(int a = 0; a < game_map.map_height; a++) {
for(int b = 0; b < game_map.map_width; b++) {
productions[a][b] = (game_map.contents[a][b].production);
}
}
j["productions"] = nlohmann::json(productions);
//Encode the frames. Note that there is no moves field for the last frame.
std::vector< std::vector< std::vector< std::vector<int> > > > frames;
std::vector< std::vector< std::vector<int> > > moves;
frames.reserve(full_frames.size());
moves.reserve(full_frames.size() - 1);
for(int a = 0; a < full_frames.size(); a++) {
std::vector< std::vector< std::vector<int> > > frame(game_map.map_height, std::vector< std::vector<int> >(game_map.map_width));
for(int b = 0; b < game_map.map_height; b++) {
for(int c = 0; c < game_map.map_width; c++) {
frame[b][c].push_back(full_frames[a].contents[b][c].owner);
frame[b][c].push_back(full_frames[a].contents[b][c].strength);
}
}
frames.push_back(frame);
}
for(int a = 0; a < full_frames.size() - 1; a++) {
std::vector< std::vector<int> > move_frame(game_map.map_height, std::vector<int>(game_map.map_width));
for(int b = 0; b < game_map.map_height; b++) {
for(int c = 0; c < game_map.map_width; c++) {
move_frame[b][c] = full_player_moves[a][b][c];
}
}
moves.push_back(move_frame);
}
j["frames"] = nlohmann::json(frames);
j["moves"] = nlohmann::json(moves);
gameFile << j;
gameFile.flush();
gameFile.close();
}
GameStatistics Halite::runGame(std::vector<std::string> * names_, unsigned int seed, unsigned int id, bool enabledReplay, std::string replayDirectory) {
//For rankings
std::vector<bool> result(number_of_players, true);
std::vector<unsigned char> rankings;
//Send initial package
std::vector< std::future<int> > initThreads(number_of_players);
for(unsigned char a = 0; a < number_of_players; a++) {
initThreads[a] = std::async(&Networking::handleInitNetworking, &networking, static_cast<unsigned char>(a + 1), game_map, ignore_timeout, &player_names[a]);
}
for(unsigned char a = 0; a < number_of_players; a++) {
int time = initThreads[a].get();
if(time == -1) {
networking.killPlayer(a + 1);
timeout_tags.insert(a + 1);
result[a] = false;
rankings.push_back(a);
for(unsigned short b = 0; b < game_map.map_height; b++) for(unsigned short c = 0; c < game_map.map_width; c++) if(game_map.contents[b][c].owner == a + 1) game_map.contents[b][c].owner = 0;
}
else init_response_times[a] = time;
}
//Override player names with the provided ones if appropriate.
if(names_ != NULL) {
player_names.clear();
for(auto a = names_->begin(); a != names_->end(); a++) player_names.push_back(a->substr(0, 30));
}
const int maxTurnNumber = sqrt(game_map.map_width * game_map.map_height) * 10;
while(turn_number < maxTurnNumber && (std::count(result.begin(), result.end(), true) > 1 || (number_of_players == 1 && productive_squares_remaining > 0))) {
//Increment turn number:
turn_number++;
if(!quiet_output) std::cout << "Turn " << turn_number << "\n";
//Frame logic.
std::vector<bool> newResult = processNextFrame(result);
//Add to vector of players that should be dead.
std::vector<unsigned int> newRankings;
for(unsigned char a = 0; a < number_of_players; a++) if(result[a] && !newResult[a]) {
newRankings.push_back(a);
}
//Sort newRankings by last territory count. If it's the same, use the territory integral instead to break that tie.
std::stable_sort(newRankings.begin(), newRankings.end(), [&](const unsigned int & u1, const unsigned int & u2) -> bool {
if(last_territory_count[u1] == last_territory_count[u2]) return full_territory_count[u1] < full_territory_count[u2];
return last_territory_count[u1] < last_territory_count[u2];
});
for(auto a = newRankings.begin(); a != newRankings.end(); a++) rankings.push_back(*a);
//Count productive squares remaining for Halite single-player game
productive_squares_remaining = 0;
for(unsigned short b = 0; b < game_map.map_height; b++) for(unsigned short c = 0; c < game_map.map_width; c++) if(game_map.contents[b][c].owner == 0 && game_map.contents[b][c].production > 0) productive_squares_remaining++;
result = newResult;
}
std::vector<unsigned int> newRankings;
for(int a = 0; a < number_of_players; a++) if(result[a]) newRankings.push_back(a);
//Sort newRankings by last territory count. If it's the same, use the territory integral instead to break that tie.
std::stable_sort(newRankings.begin(), newRankings.end(), [&](const unsigned int & u1, const unsigned int & u2) -> bool {
if(last_territory_count[u1] == last_territory_count[u2]) return full_territory_count[u1] < full_territory_count[u2];
return last_territory_count[u1] < last_territory_count[u2];
});
for(auto a = newRankings.begin(); a != newRankings.end(); a++) rankings.push_back(*a);
std::reverse(rankings.begin(), rankings.end()); //Best player first rather than last.
GameStatistics stats;
int chunkSize = game_map.map_width * game_map.map_height / number_of_players;
for(unsigned char a = 0; a < number_of_players; a++) {
PlayerStatistics p;
p.tag = a + 1;
p.rank = std::distance(rankings.begin(), std::find(rankings.begin(), rankings.end(), a)) + 1;
// alive_frame_count counts frames, but the frames are 0-base indexed (at least in the visualizer), so everyone needs -1 to find the frame # where last_alive
// however, the first place player and 2nd place player always have the same reported alive_frame_count (not sure why)
// it turns out to make "last_frame_alive" match what is seen in replayer, we have to -2 from all but finishers who are alive in last frame of game who only need -1
p.last_frame_alive = alive_frame_count[a] - 2 + result[a];
p.average_territory_count = full_territory_count[a] / double(chunkSize * alive_frame_count[a]);
p.average_strength_count = full_strength_count[a] / double(chunkSize * alive_frame_count[a]);
p.average_production_count = alive_frame_count[a] > 1 ? full_production_count[a] / double(chunkSize * (alive_frame_count[a] - 1)) : 0; //For this, we want turns rather than frames.
p.still_percentage = full_cardinal_count[a] + full_still_count[a] > 0 ? full_still_count[a] / double(full_cardinal_count[a] + full_still_count[a]) : 0;
p.init_response_time = init_response_times[a];
p.average_frame_response_time = total_frame_response_times[a] / double(alive_frame_count[a]); //In milliseconds.
stats.player_statistics.push_back(p);
}
stats.timeout_tags = timeout_tags;
stats.timeout_log_filenames = std::vector<std::string>(timeout_tags.size());
//Output gamefile. First try the replays folder; if that fails, just use the straight filename.
if (enabledReplay) {
stats.output_filename = replayDirectory + "Replays/" + std::to_string(id) + '-' + std::to_string(seed) + ".hlt";
try {
output(stats.
gitextract_7mjz_vb8/
├── .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
│ ├── rankReset.py
│ └── updateOrgs.py
├── airesources/
│ ├── C/
│ │ ├── MyBot.c
│ │ ├── RandomBot.c
│ │ ├── hlt.h
│ │ ├── runGame.bat
│ │ └── runGame.sh
│ ├── C++/
│ │ ├── MyBot.cpp
│ │ ├── RandomBot.cpp
│ │ ├── hlt.hpp
│ │ ├── networking.hpp
│ │ ├── 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/
│ │ └── main.py
│ ├── setupMysql.py
│ ├── travisTests.ini
│ ├── website/
│ │ ├── APITest.php
│ │ ├── GameTest.php
│ │ ├── HistoryTest.php
│ │ ├── UserTest.php
│ │ └── testFile.txt
│ └── worker/
│ ├── languageBot/
│ │ ├── LANGUAGE
│ │ └── run.sh
│ ├── loseBot/
│ │ ├── MyBot.py
│ │ └── run.sh
│ ├── testWorker.py
│ └── winBot/
│ ├── MyBot.py
│ └── run.sh
├── visualizer/
│ ├── .editorconfig
│ ├── .gitattributes
│ ├── index.html
│ ├── index.js
│ ├── main.js
│ └── package.json
├── 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/
│ │ └── favicons/
│ │ ├── browserconfig.xml
│ │ └── manifest.json
│ ├── 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
│ ├── 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/
│ │ │ ├── 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/
│ │ │ │ │ ├── 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
│ │ │ │ ├── mixins.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
│ │ ├── swiftmailer/
│ │ │ ├── .gitattributes
│ │ │ ├── .gitignore
│ │ │ ├── .travis.yml
│ │ │ ├── CHANGES
│ │ │ ├── LICENSE
│ │ │ ├── README
│ │ │ ├── VERSION
│ │ │ ├── composer.json
│ │ │ ├── lib/
│ │ │ │ ├── classes/
│ │ │ │ │ ├── Swift/
│ │ │ │ │ │ ├── Attachment.php
│ │ │ │ │ │ ├── ByteStream/
│ │ │ │ │ │ │ ├── AbstractFilterableInputStream.php
│ │ │ │ │ │ │ ├── ArrayByteStream.php
│ │ │ │ │ │ │ ├── FileByteStream.php
│ │ │ │ │ │ │ └── TemporaryFileByteStream.php
│ │ │ │ │ │ ├── CharacterReader/
│ │ │ │ │ │ │ ├── GenericFixedWidthReader.php
│ │ │ │ │ │ │ ├── UsAsciiReader.php
│ │ │ │ │ │ │ └── Utf8Reader.php
│ │ │ │ │ │ ├── CharacterReader.php
│ │ │ │ │ │ ├── CharacterReaderFactory/
│ │ │ │ │ │ │ └── SimpleCharacterReaderFactory.php
│ │ │ │ │ │ ├── CharacterReaderFactory.php
│ │ │ │ │ │ ├── CharacterStream/
│ │ │ │ │ │ │ ├── ArrayCharacterStream.php
│ │ │ │ │ │ │ └── NgCharacterStream.php
│ │ │ │ │ │ ├── CharacterStream.php
│ │ │ │ │ │ ├── ConfigurableSpool.php
│ │ │ │ │ │ ├── DependencyContainer.php
│ │ │ │ │ │ ├── DependencyException.php
│ │ │ │ │ │ ├── EmbeddedFile.php
│ │ │ │ │ │ ├── Encoder/
│ │ │ │ │ │ │ ├── Base64Encoder.php
│ │ │ │ │ │ │ ├── QpEncoder.php
│ │ │ │ │ │ │ └── Rfc2231Encoder.php
│ │ │ │ │ │ ├── Encoder.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/
│ │ │ │ │ │ │ ├── ArrayKeyCache.php
│ │ │ │ │ │ │ ├── DiskKeyCache.php
│ │ │ │ │ │ │ ├── KeyCacheInputStream.php
│ │ │ │ │ │ │ ├── NullKeyCache.php
│ │ │ │ │ │ │ └── SimpleKeyCacheInputStream.php
│ │ │ │ │ │ ├── KeyCache.php
│ │ │ │ │ │ ├── LoadBalancedTransport.php
│ │ │ │ │ │ ├── MailTransport.php
│ │ │ │ │ │ ├── Mailer/
│ │ │ │ │ │ │ ├── ArrayRecipientIterator.php
│ │ │ │ │ │ │ └── RecipientIterator.php
│ │ │ │ │ │ ├── Mailer.php
│ │ │ │ │ │ ├── MemorySpool.php
│ │ │ │ │ │ ├── Message.php
│ │ │ │ │ │ ├── Mime/
│ │ │ │ │ │ │ ├── Attachment.php
│ │ │ │ │ │ │ ├── CharsetObserver.php
│ │ │ │ │ │ │ ├── ContentEncoder/
│ │ │ │ │ │ │ │ ├── Base64ContentEncoder.php
│ │ │ │ │ │ │ │ ├── NativeQpContentEncoder.php
│ │ │ │ │ │ │ │ ├── PlainContentEncoder.php
│ │ │ │ │ │ │ │ ├── QpContentEncoder.php
│ │ │ │ │ │ │ │ ├── QpContentEncoderProxy.php
│ │ │ │ │ │ │ │ └── RawContentEncoder.php
│ │ │ │ │ │ │ ├── ContentEncoder.php
│ │ │ │ │ │ │ ├── EmbeddedFile.php
│ │ │ │ │ │ │ ├── EncodingObserver.php
│ │ │ │ │ │ │ ├── Grammar.php
│ │ │ │ │ │ │ ├── Header.php
│ │ │ │ │ │ │ ├── HeaderEncoder/
│ │ │ │ │ │ │ │ ├── Base64HeaderEncoder.php
│ │ │ │ │ │ │ │ └── QpHeaderEncoder.php
│ │ │ │ │ │ │ ├── HeaderEncoder.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/
│ │ │ │ │ │ │ ├── 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
│ │ │ │ │ │ ├── Transport.php
│ │ │ │ │ │ ├── TransportException.php
│ │ │ │ │ │ └── Validate.php
│ │ │ │ │ └── Swift.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
│ │ │ │ └── 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/
│ │ │ │ └── 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
│ │ │ ├── acceptance.conf.php.default
│ │ │ ├── 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/
│ │ │ │ └── Swift/
│ │ │ │ └── Smoke/
│ │ │ │ ├── AttachmentSmokeTest.php
│ │ │ │ ├── BasicSmokeTest.php
│ │ │ │ ├── HtmlWithAttachmentSmokeTest.php
│ │ │ │ └── InternationalSmokeTest.php
│ │ │ ├── smoke.conf.php.default
│ │ │ └── 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
Showing preview only (365K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (3464 symbols across 401 files)
FILE: admin/checkTaskCompletion.py
function check_compiles (line 14) | def check_compiles(db):
function check_workers (line 20) | def check_workers(db, start_time):
function main (line 31) | def main():
FILE: admin/commandRunner.py
function runOnWorker (line 8) | def runOnWorker(worker, keyPath, command):
FILE: admin/cron/haliteEmailer.py
function sendEmail (line 4) | def sendEmail(senderEmail, senderPassword, subject, body, recipient):
FILE: admin/rankReset.py
function main (line 11) | def main():
FILE: airesources/C++/MyBot.cpp
function main (line 12) | int main() {
FILE: airesources/C++/RandomBot.cpp
function main (line 12) | int main() {
FILE: airesources/C++/hlt.hpp
type hlt (line 17) | namespace hlt{
type Location (line 18) | struct Location{
type Site (line 25) | struct Site{
class GameMap (line 31) | class GameMap{
method GameMap (line 36) | GameMap() {
method GameMap (line 41) | GameMap(const GameMap &otherMap) {
method GameMap (line 46) | GameMap(int w, int h) {
method inBounds (line 52) | bool inBounds(Location l) {
method getDistance (line 55) | float getDistance(Location l1, Location l2) {
method getAngle (line 61) | float getAngle(Location l1, Location l2) {
method Location (line 70) | Location getLocation(Location l, unsigned char direction) {
method Site (line 91) | Site& getSite(Location l, unsigned char direction = STILL) {
type Move (line 97) | struct Move{
FILE: airesources/C++/networking.hpp
type detail (line 29) | namespace detail{
function serializeMoveSet (line 33) | static std::string serializeMoveSet(const std::set<hlt::Move> &moves) {
function deserializeMapSize (line 39) | static void deserializeMapSize(const std::string & inputString) {
function deserializeProductions (line 44) | static void deserializeProductions(const std::string & inputString) {
function deserializeMap (line 57) | static hlt::GameMap deserializeMap(const std::string & inputString) {
function sendString (line 93) | static void sendString(const std::string & sendString) {
function getString (line 98) | static std::string getString() {
function getInit (line 105) | static void getInit(unsigned char& playerTag, hlt::GameMap& m) {
function sendInit (line 113) | static void sendInit(std::string name) {
function getFrame (line 117) | static void getFrame(hlt::GameMap& m) {
function sendFrame (line 120) | static void sendFrame(const std::set<hlt::Move> &moves) {
FILE: airesources/C/MyBot.c
function main (line 9) | int main(void) {
FILE: airesources/C/RandomBot.c
function main (line 9) | int main(void) {
FILE: airesources/C/hlt.h
type SITE (line 31) | typedef struct Site_struct {
type GAME (line 39) | typedef struct Game_struct {
function __getnextint (line 71) | int __getnextint() {
function __parseproduction (line 98) | void __parseproduction(GAME game) {
function __parsemap (line 110) | void __parsemap(GAME game) {
function GAME (line 149) | GAME GetInit() {
function SendInit (line 168) | void SendInit(char *botname) {
function GetFrame (line 173) | void GetFrame(GAME game) {
function __sanitise_x (line 190) | int __sanitise_x(GAME game, int x) {
function __sanitise_y (line 198) | int __sanitise_y(GAME game, int y) {
function SITE (line 206) | SITE GetSiteFromXY(GAME game, int x, int y) {
function SITE (line 223) | SITE GetSiteFromMovement(GAME game, int src_x, int src_y, int direction) {
function SetMove (line 254) | void SetMove(GAME game, int x, int y, int direction) {
function SendFrame (line 261) | void SendFrame(GAME game) {
FILE: airesources/CSharp/HaliteHelper.cs
class Log (line 11) | public static class Log
method Setup (line 18) | public static void Setup(string logPath) {
method Information (line 22) | public static void Information(string message) {
method Error (line 27) | public static void Error(Exception exception) {
class Networking (line 32) | public static class Networking
method ReadNextLine (line 34) | private static string ReadNextLine() {
method SendString (line 40) | private static void SendString(string str) {
method getInit (line 47) | public static Map getInit(out ushort playerTag) {
method getFrame (line 61) | public static void getFrame(ref Map map) {
method SendInit (line 69) | public static void SendInit(string botName) {
method SendMoves (line 76) | public static void SendMoves(IEnumerable<Move> moves) {
type Direction (line 81) | public enum Direction
type Site (line 90) | public struct Site
type Location (line 97) | public struct Location
type Move (line 103) | public struct Move
method MovesToString (line 108) | internal static string MovesToString(IEnumerable<Move> moves) {
class Map (line 117) | public class Map
method Update (line 119) | public void Update(string gameMapStr) {
method Map (line 183) | private Map(ushort width, ushort height) {
method ParseMapSize (line 192) | private static Tuple<ushort, ushort> ParseMapSize(string mapSizeStr) {
method ParseMap (line 200) | public static Map ParseMap(string mapSizeStr, string productionMapStr,...
FILE: airesources/CSharp/MyBot.cs
class MyBot (line 5) | public class MyBot
method Main (line 9) | public static void Main(string[] args) {
FILE: airesources/CSharp/RandomBot.cs
class MyBot (line 5) | public class MyBot
method Main (line 9) | public static void Main(string[] args) {
FILE: airesources/Go/MyBot.go
function main (line 9) | func main() {
FILE: airesources/Go/RandomBot.go
function main (line 9) | func main() {
FILE: airesources/Go/src/hlt/gamemap.go
type GameMap (line 9) | type GameMap struct
method InBounds (line 39) | func (m *GameMap) InBounds(loc Location) bool {
method GetDistance (line 43) | func (m *GameMap) GetDistance(loc1, loc2 Location) int {
method GetAngle (line 55) | func (m *GameMap) GetAngle(loc1, loc2 Location) float64 {
method GetLocation (line 74) | func (m *GameMap) GetLocation(loc Location, direction Direction) Locat...
method GetSite (line 104) | func (m *GameMap) GetSite(loc Location, direction Direction) Site {
function NewGameMap (line 14) | func NewGameMap(width, height int) GameMap {
function int_str_array_pop (line 30) | func int_str_array_pop(input []string) (int, []string) {
FILE: airesources/Go/src/hlt/networking.go
type Direction (line 13) | type Direction
constant STILL (line 16) | STILL Direction = iota
constant NORTH (line 17) | NORTH
constant EAST (line 18) | EAST
constant SOUTH (line 19) | SOUTH
constant WEST (line 20) | WEST
type Site (line 26) | type Site struct
type Location (line 32) | type Location struct
function NewLocation (line 36) | func NewLocation(x, y int) Location {
type Move (line 43) | type Move struct
type MoveSet (line 48) | type MoveSet
method serialize (line 50) | func (ms MoveSet) serialize() string {
type Connection (line 58) | type Connection struct
method deserializeMap (line 66) | func (c *Connection) deserializeMap() GameMap {
method sendString (line 96) | func (c *Connection) sendString(input string) {
method getString (line 100) | func (c *Connection) getString() string {
method getInt (line 106) | func (c *Connection) getInt() int {
method deserializeMapSize (line 114) | func (c *Connection) deserializeMapSize() {
method deserializeProductions (line 120) | func (c *Connection) deserializeProductions() {
method SendName (line 143) | func (c *Connection) SendName(name string) {
method GetFrame (line 147) | func (c *Connection) GetFrame() GameMap {
method SendFrame (line 151) | func (c *Connection) SendFrame(moves MoveSet) {
function NewConnection (line 132) | func NewConnection() (Connection, GameMap) {
FILE: airesources/Java/Direction.java
type Direction (line 3) | public enum Direction {
method randomDirection (line 9) | public static Direction randomDirection() {
FILE: airesources/Java/GameMap.java
class GameMap (line 2) | public class GameMap{
method GameMap (line 8) | public GameMap(int width, int height, int[][] productions) {
method inBounds (line 24) | public boolean inBounds(Location loc) {
method getDistance (line 28) | public double getDistance(Location loc1, Location loc2) {
method getAngle (line 38) | public double getAngle(Location loc1, Location loc2) {
method getLocation (line 54) | public Location getLocation(Location location, Direction direction) {
method getSite (line 71) | public Site getSite(Location loc, Direction dir) {
method getSite (line 75) | public Site getSite(Location loc) {
method getLocation (line 79) | public Location getLocation(int x, int y) {
method reset (line 83) | void reset() {
FILE: airesources/Java/InitPackage.java
class InitPackage (line 2) | public class InitPackage {
FILE: airesources/Java/Location.java
class Location (line 1) | public class Location {
method Location (line 7) | public Location(int x, int y, Site site) {
method getX (line 13) | public int getX() {
method getY (line 17) | public int getY() {
method getSite (line 21) | public Site getSite() {
FILE: airesources/Java/Move.java
class Move (line 1) | public class Move {
method Move (line 5) | public Move(Location loc_, Direction dir_) {
FILE: airesources/Java/MyBot.java
class MyBot (line 4) | public class MyBot {
method main (line 5) | public static void main(String[] args) throws java.io.IOException {
FILE: airesources/Java/Networking.java
class Networking (line 9) | public class Networking {
method deserializeProductions (line 11) | static int[][] deserializeProductions(String inputString, int width, i...
method serializeMoveList (line 27) | static String serializeMoveList(List<Move> moves) {
method deserializeGameMap (line 40) | static GameMap deserializeGameMap(String inputString, GameMap map) {
method sendString (line 77) | static void sendString(String sendString) {
method getString (line 82) | static String getString() {
method getInit (line 101) | static InitPackage getInit() {
method sendInit (line 122) | static void sendInit(String name) {
method updateFrame (line 126) | static void updateFrame(GameMap map) {
method sendFrame (line 131) | static void sendFrame(List<Move> moves) {
FILE: airesources/Java/RandomBot.java
class RandomBot (line 4) | public class RandomBot {
method main (line 5) | public static void main(String[] args) throws java.io.IOException {
FILE: airesources/Java/Site.java
class Site (line 1) | public class Site {
method Site (line 6) | public Site(int production) {
FILE: airesources/JavaScript/hlt.js
constant STILL (line 1) | const STILL = 0;
constant NORTH (line 2) | const NORTH = 1;
constant EAST (line 3) | const EAST = 2;
constant SOUTH (line 4) | const SOUTH = 3;
constant WEST (line 5) | const WEST = 4;
constant DIRECTIONS (line 7) | const DIRECTIONS = [STILL, NORTH, EAST, SOUTH, WEST];
constant CARDINALS (line 8) | const CARDINALS = [NORTH, EAST, SOUTH, WEST];
constant ATTACK (line 10) | const ATTACK = 0;
constant STOP_ATTACK (line 11) | const STOP_ATTACK = 1;
class Location (line 13) | class Location {
method constructor (line 14) | constructor(x = 0, y = 0) {
class Site (line 20) | class Site {
method constructor (line 21) | constructor(owner = 0, strength = 0, production = 0) {
class Move (line 28) | class Move {
method constructor (line 29) | constructor(loc = new Location(), direction = STILL) {
class GameMap (line 35) | class GameMap {
method constructor (line 36) | constructor(width = 0, height = 0, numberOfPlayers = 0) {
method inBounds (line 51) | inBounds(l) {
method getDistance (line 55) | getDistance(l1, l2) {
method getAngle (line 70) | getAngle(l1, l2) {
method getLocation (line 89) | getLocation(loc, direction) {
method getSite (line 118) | getSite(l, direction = STILL) {
FILE: airesources/JavaScript/networking.js
class Networking (line 5) | class Networking extends EventEmitter {
method constructor (line 6) | constructor(botName) {
method sendMoves (line 44) | sendMoves(moves) {
method deserializeMapSize (line 48) | deserializeMapSize(inputString) {
method deserializeProductions (line 52) | deserializeProductions(inputString) {
method deserializeMap (line 61) | deserializeMap(inputString) {
function splitToInts (line 104) | function splitToInts(inputString) {
FILE: airesources/PHP/hlt.php
class Location (line 15) | class Location
method __construct (line 20) | public function __construct($x = 0, $y = 0)
class Site (line 27) | class Site
method __construct (line 33) | public function __construct($owner = 0, $strength = 0, $production = 0)
class Move (line 41) | class Move
method __construct (line 46) | public function __construct(Location $loc, $direction = STILL)
class GameMap (line 53) | class GameMap
method __construct (line 59) | public function __construct($width = 0, $height = 0, $numberOfPlayers ...
method inBounds (line 74) | public function inBounds(Location $l)
method getDistance (line 79) | public function getDistance(Location $l1, Location $l2)
method getAngle (line 92) | public function getAngle(Location $l1, Location $l2)
method getLocation (line 111) | public function getLocation(Location $loc, $direction)
method getSite (line 144) | public function getSite(Location $l, $direction = STILL)
FILE: airesources/PHP/networking.php
function serializeMoveSet (line 7) | function serializeMoveSet(array $moves)
function deserializeMapSize (line 16) | function deserializeMapSize($inputString)
function deserializeProductions (line 26) | function deserializeProductions($inputString)
function deserializeMap (line 41) | function deserializeMap($inputString)
function sendString (line 74) | function sendString($toBeSent)
function getString (line 81) | function getString()
function getInit (line 93) | function getInit()
function sendInit (line 103) | function sendInit($name)
function getFrame (line 108) | function getFrame()
function sendFrame (line 113) | function sendFrame(array $moves)
FILE: airesources/Python/hlt.py
function grouper (line 6) | def grouper(iterable, n, fillvalue=None):
function opposite_cardinal (line 16) | def opposite_cardinal(direction):
class GameMap (line 27) | class GameMap:
method __init__ (line 28) | def __init__(self, size_string, production_string, map_string=None):
method get_frame (line 35) | def get_frame(self, map_string=None):
method __iter__ (line 55) | def __iter__(self):
method neighbors (line 59) | def neighbors(self, square, n=1, include_self=False):
method get_target (line 69) | def get_target(self, square, direction):
method get_distance (line 74) | def get_distance(self, sq1, sq2):
function send_string (line 85) | def send_string(s):
function get_string (line 91) | def get_string():
function get_init (line 95) | def get_init():
function send_init (line 101) | def send_init(name):
function translate_cardinal (line 105) | def translate_cardinal(direction):
function send_frame (line 110) | def send_frame(moves):
FILE: airesources/Ruby/game_map.rb
class GameMap (line 1) | class GameMap
method initialize (line 9) | def initialize(options = {})
method site (line 23) | def site(location, direction = :still)
method find_location (line 28) | def find_location(location, direction)
method distance_between (line 45) | def distance_between(from, to)
method angle_between (line 55) | def angle_between(from, to)
method in_bounds (line 74) | def in_bounds(loc)
FILE: airesources/Ruby/location.rb
class Location (line 1) | class Location
method initialize (line 5) | def initialize(x, y)
FILE: airesources/Ruby/move.rb
class Move (line 1) | class Move
method initialize (line 5) | def initialize(location, direction)
method to_s (line 10) | def to_s
FILE: airesources/Ruby/networking.rb
class Networking (line 8) | class Networking
method initialize (line 15) | def initialize(name)
method configure (line 28) | def configure
method frame (line 34) | def frame
method send_moves (line 39) | def send_moves(moves = [])
method logger (line 43) | def logger
method log (line 51) | def log(msg, severity = :info)
method init_player_tag (line 57) | def init_player_tag
method init_map_size (line 62) | def init_map_size
method init_map_production (line 68) | def init_map_production
method init_map (line 72) | def init_map
method read_from_input (line 89) | def read_from_input
method read_ints_from_input (line 93) | def read_ints_from_input
method write_to_output (line 97) | def write_to_output(data)
FILE: airesources/Ruby/site.rb
class Site (line 1) | class Site
method initialize (line 5) | def initialize(owner = 0, strength = 0, production = 0)
FILE: airesources/Rust/src/MyBot.rs
function main (line 16) | fn main() {
FILE: airesources/Rust/src/RandomBot.rs
function main (line 16) | fn main() {
FILE: airesources/Rust/src/hlt/networking.rs
function serialize_move_set (line 13) | fn serialize_move_set(moves: HashMap<types::Location, u8>) -> String {
function deserialize_map_size (line 21) | fn deserialize_map_size(s: String) -> () {
function deserialize_productions (line 29) | fn deserialize_productions(s: String) -> types::GameMap {
function deserialize_map (line 47) | fn deserialize_map(s: String, gmp: &mut types::GameMap) -> () {
function send_string (line 75) | fn send_string(s: String) -> () {
function get_string (line 80) | fn get_string() -> String {
function get_init (line 84) | pub fn get_init() -> (u8, types::GameMap) {
function send_init (line 92) | pub fn send_init(name: String) -> () {
function get_frame (line 96) | pub fn get_frame(gmp: &mut types::GameMap) -> () {
function send_frame (line 100) | pub fn send_frame(moves: HashMap<types::Location, u8>) -> () {
FILE: airesources/Rust/src/hlt/types.rs
constant STILL (line 3) | pub const STILL: u8 = 0;
constant NORTH (line 4) | pub const NORTH: u8 = 1;
constant EAST (line 5) | pub const EAST: u8 = 2;
constant SOUTH (line 6) | pub const SOUTH: u8 = 3;
constant WEST (line 7) | pub const WEST: u8 = 4;
constant DIRECTIONS (line 9) | pub const DIRECTIONS: [u8; 5] = [STILL, NORTH, EAST, SOUTH, WEST];
constant CARDINALS (line 10) | pub const CARDINALS: [u8; 4] = [NORTH, EAST, SOUTH, WEST];
type Location (line 13) | pub struct Location {
type Site (line 19) | pub struct Site {
type GameMap (line 26) | pub struct GameMap {
method in_bounds (line 33) | pub fn in_bounds(&self, l: Location) -> bool {
method get_distance (line 36) | pub fn get_distance(&self, l1: Location, l2: Location) -> u16 {
method get_angle (line 43) | pub fn get_angle(&self, l1: Location, l2: Location) -> f64 {
method get_location (line 52) | pub fn get_location(&self, l: Location, d: u8) -> Location {
method get_site (line 69) | pub fn get_site(&mut self, l: Location, d: u8) -> &mut Site {
method get_site_ref (line 73) | pub fn get_site_ref(&self, l: Location, d: u8) -> &Site {
FILE: airesources/Sockets/HaliteSocketHelper.cs
class Log (line 18) | public static class Log
method Setup (line 25) | public static void Setup(string logPath) {
method Information (line 29) | public static void Information(string message) {
method Error (line 34) | public static void Error(Exception exception) {
class Networking (line 39) | public static class Networking
method ReadNextLine (line 45) | private static string ReadNextLine() {
method SendString (line 51) | private static void SendString(string str) {
method getInit (line 58) | public static Map getInit(out ushort playerTag) {
method getFrame (line 77) | public static void getFrame(ref Map map) {
method SendInit (line 84) | public static void SendInit(string botName) {
method SendMoves (line 91) | public static void SendMoves(IEnumerable<Move> moves) {
type Direction (line 96) | public enum Direction
type Site (line 105) | public struct Site
type Location (line 112) | public struct Location
type Move (line 118) | public struct Move
method MovesToString (line 123) | internal static string MovesToString(IEnumerable<Move> moves) {
class Map (line 132) | public class Map
method Update (line 134) | public void Update(string gameMapStr) {
method Map (line 198) | private Map(ushort width, ushort height) {
method ParseMapSize (line 207) | private static Tuple<ushort, ushort> ParseMapSize(string mapSizeStr) {
method ParseMap (line 215) | public static Map ParseMap(string mapSizeStr, string productionMapStr,...
FILE: airesources/Sockets/SocketNetworking.java
class SocketNetworking (line 8) | public class SocketNetworking {
method deserializeGameMapSize (line 16) | private static void deserializeGameMapSize(String inputString) {
method deserializeProductions (line 24) | private static void deserializeProductions(String inputString) {
method serializeMoveList (line 39) | private static String serializeMoveList(ArrayList<Move> moves) {
method deserializeGameMap (line 45) | private static GameMap deserializeGameMap(String inputString) {
method sendString (line 80) | private static void sendString(String sendString) throws java.io.IOExc...
method getString (line 85) | private static String getString() throws java.io.IOException {
method getInit (line 89) | public static InitPackage getInit() throws java.io.IOException {
method sendInit (line 108) | public static void sendInit(String name) throws java.io.IOException {
method getFrame (line 112) | public static GameMap getFrame() throws java.io.IOException {
method sendFrame (line 116) | public static void sendFrame(ArrayList<Move> moves) throws java.io.IOE...
FILE: airesources/Sockets/pipe_socket_translator.py
function sendStringPipe (line 11) | def sendStringPipe(toBeSent):
function getStringPipe (line 14) | def getStringPipe():
function sendStringSocket (line 17) | def sendStringSocket(toBeSent):
function getStringSocket (line 21) | def getStringSocket():
FILE: airesources/Sockets/socket_networking.hpp
type detail (line 35) | namespace detail {
function serializeMoveSet (line 44) | static std::string serializeMoveSet(const std::set<hlt::Move> &moves) {
function deserializeMapSize (line 50) | static void deserializeMapSize(const std::string & inputString) {
function deserializeProductions (line 55) | static void deserializeProductions(const std::string & inputString) {
function deserializeMap (line 68) | static hlt::GameMap deserializeMap(const std::string & inputString) {
function sendString (line 104) | static void sendString(std::string & sendString) {
function getString (line 116) | static std::string getString() {
function getInit (line 133) | static void getInit(unsigned char& playerTag, hlt::GameMap& m) {
function sendInit (line 174) | static void sendInit(std::string name) {
function getFrame (line 178) | static void getFrame(hlt::GameMap& m) {
function sendFrame (line 181) | static void sendFrame(const std::set<hlt::Move> &moves) {
FILE: airesources/Sockets/socket_networking.py
function serializeMoveSet (line 13) | def serializeMoveSet(moves):
function deserializeMapSize (line 19) | def deserializeMapSize(inputString):
function deserializeProductions (line 26) | def deserializeProductions(inputString):
function deserializeMap (line 35) | def deserializeMap(inputString):
function sendString (line 61) | def sendString(toBeSent):
function getString (line 66) | def getString():
function getInit (line 77) | def getInit():
function sendInit (line 92) | def sendInit(name):
function getFrame (line 95) | def getFrame():
function sendFrame (line 98) | def sendFrame(moves):
FILE: environment/core/Halite.cpp
function GameStatistics (line 309) | GameStatistics Halite::runGame(std::vector<std::string> * names_, unsign...
FILE: environment/core/Halite.hpp
type PlayerStatistics (line 19) | struct PlayerStatistics {
type GameStatistics (line 35) | struct GameStatistics {
class Halite (line 51) | class Halite {
FILE: environment/core/hlt.hpp
type Color (line 19) | struct Color {
type hlt (line 23) | namespace hlt{
type Location (line 24) | struct Location{
type Site (line 34) | struct Site {
class Map (line 40) | class Map{
method Map (line 45) | Map() {
method Map (line 50) | Map(const Map &otherMap) {
method Map (line 55) | Map(short width, short height, unsigned char numberOfPlayers, unsign...
method inBounds (line 287) | bool inBounds(Location l) const {
method getDistance (line 290) | float getDistance(Location l1, Location l2) const {
method getAngle (line 296) | float getAngle(Location l1, Location l2) const {
method Location (line 305) | Location getLocation(Location l, unsigned char direction) const {
method Site (line 326) | Site& getSite(Location l, unsigned char direction = STILL) {
function Map (line 332) | static Map ppmToMap(std::string filename, int numplayers) {
method Map (line 45) | Map() {
method Map (line 50) | Map(const Map &otherMap) {
method Map (line 55) | Map(short width, short height, unsigned char numberOfPlayers, unsign...
method inBounds (line 287) | bool inBounds(Location l) const {
method getDistance (line 290) | float getDistance(Location l1, Location l2) const {
method getAngle (line 296) | float getAngle(Location l1, Location l2) const {
method Location (line 305) | Location getLocation(Location l, unsigned char direction) const {
method Site (line 326) | Site& getSite(Location l, unsigned char direction = STILL) {
FILE: environment/core/json.hpp
type nlohmann (line 81) | namespace nlohmann
type has_mapped_type (line 102) | struct has_mapped_type
type DecimalSeparator (line 123) | struct DecimalSeparator : std::numpunct<char>
method do_decimal_point (line 125) | char do_decimal_point() const
class basic_json (line 221) | class basic_json
class json_reverse_iterator (line 231) | class json_reverse_iterator
method json_reverse_iterator (line 7375) | json_reverse_iterator(const typename base_iterator::iterator_type&...
method json_reverse_iterator (line 7380) | json_reverse_iterator(const base_iterator& it) noexcept
method json_reverse_iterator (line 7385) | json_reverse_iterator operator++(int)
method json_reverse_iterator (line 7391) | json_reverse_iterator& operator++()
method json_reverse_iterator (line 7398) | json_reverse_iterator operator--(int)
method json_reverse_iterator (line 7404) | json_reverse_iterator& operator--()
method json_reverse_iterator (line 7411) | json_reverse_iterator& operator+=(difference_type i)
method json_reverse_iterator (line 7418) | json_reverse_iterator operator+(difference_type i) const
method json_reverse_iterator (line 7426) | json_reverse_iterator operator-(difference_type i) const
method difference_type (line 7434) | difference_type operator-(const json_reverse_iterator& other) const
method reference (line 7440) | reference operator[](difference_type n) const
method key (line 7446) | typename object_t::key_type key() const
method reference (line 7453) | reference value() const
class json_pointer (line 232) | class json_pointer
method json_pointer (line 9152) | explicit json_pointer(const std::string& s = "")
method to_string (line 9171) | std::string to_string() const noexcept
method pop_back (line 9189) | std::string pop_back()
method is_root (line 9202) | bool is_root() const
method json_pointer (line 9207) | json_pointer top() const
method reference (line 9224) | reference get_and_create(reference j) const
method reference (line 9293) | reference get_unchecked(pointer ptr) const
method reference (line 9337) | reference get_checked(pointer ptr) const
method const_reference (line 9389) | const_reference get_unchecked(const_pointer ptr) const
method const_reference (line 9433) | const_reference get_checked(const_pointer ptr) const
method split (line 9478) | static std::vector<std::string> split(std::string reference_string)
method replace_substring (line 9553) | static void replace_substring(std::string& s,
method escape (line 9568) | static std::string escape(std::string s)
method unescape (line 9577) | static void unescape(std::string& s)
method flatten (line 9592) | static void flatten(const std::string& reference_string,
method basic_json (line 9650) | static basic_json unflatten(const basic_json& value)
class iterator (line 265) | class iterator
method iterator (line 7233) | iterator() = default;
method iterator (line 7236) | explicit iterator(pointer object) noexcept
method iterator (line 7241) | iterator(const iterator& other) noexcept
method iterator (line 7246) | iterator& operator=(iterator other) noexcept(
method reference (line 7258) | reference operator*() const
method pointer (line 7264) | pointer operator->() const
method iterator (line 7270) | iterator operator++(int)
method iterator (line 7278) | iterator& operator++()
method iterator (line 7285) | iterator operator--(int)
method iterator (line 7293) | iterator& operator--()
method iterator (line 7300) | iterator& operator+=(difference_type i)
method iterator (line 7307) | iterator& operator-=(difference_type i)
method iterator (line 7314) | iterator operator+(difference_type i)
method iterator (line 7322) | iterator operator-(difference_type i)
method difference_type (line 7330) | difference_type operator-(const iterator& other) const
method reference (line 7336) | reference operator[](difference_type n) const
method reference (line 7342) | reference value() const
class const_iterator (line 267) | class const_iterator
method const_iterator (line 6623) | const_iterator() = default;
method const_iterator (line 6631) | explicit const_iterator(pointer object) noexcept
method const_iterator (line 6663) | explicit const_iterator(const iterator& other) noexcept
method const_iterator (line 6696) | const_iterator(const const_iterator& other) noexcept
method const_iterator (line 6705) | const_iterator& operator=(const_iterator other) noexcept(
method set_begin (line 6722) | void set_begin() noexcept
method set_end (line 6759) | void set_end() noexcept
method reference (line 6790) | reference operator*() const
method pointer (line 6831) | pointer operator->() const
method const_iterator (line 6867) | const_iterator operator++(int)
method const_iterator (line 6878) | const_iterator& operator++()
method const_iterator (line 6910) | const_iterator operator--(int)
method const_iterator (line 6921) | const_iterator& operator--()
method const_iterator (line 7055) | const_iterator& operator+=(difference_type i)
method const_iterator (line 7086) | const_iterator& operator-=(difference_type i)
method const_iterator (line 7095) | const_iterator operator+(difference_type i)
method const_iterator (line 7106) | const_iterator operator-(difference_type i)
method difference_type (line 7117) | difference_type operator-(const const_iterator& other) const
method reference (line 7144) | reference operator[](difference_type n) const
method key (line 7183) | typename object_t::key_type key() const
method reference (line 7201) | reference value() const
method allocator_type (line 279) | static allocator_type get_allocator()
type value_t (line 742) | enum class value_t : uint8_t
method T (line 760) | static T* create(Args&& ... args)
method json_value (line 819) | json_value() = default;
method json_value (line 821) | json_value(boolean_t v) noexcept : boolean(v) {}
method json_value (line 823) | json_value(number_integer_t v) noexcept : number_integer(v) {}
method json_value (line 825) | json_value(number_unsigned_t v) noexcept : number_unsigned(v) {}
method json_value (line 827) | json_value(number_float_t v) noexcept : number_float(v) {}
method json_value (line 829) | json_value(value_t t)
method json_value (line 883) | json_value(const string_t& value)
method json_value (line 889) | json_value(const object_t& value)
method json_value (line 895) | json_value(const array_t& value)
method assert_invariant (line 910) | void assert_invariant() const
type parse_event_t (line 932) | enum class parse_event_t : uint8_t
method basic_json (line 1053) | basic_json(const value_t value_type)
method basic_json (line 1086) | basic_json() = default;
method basic_json (line 1110) | basic_json(std::nullptr_t) noexcept
method basic_json (line 1135) | basic_json(const object_t& val)
method basic_json (line 1172) | basic_json(const CompatibleObjectType& val)
method basic_json (line 1200) | basic_json(const array_t& val)
method basic_json (line 1242) | basic_json(const CompatibleArrayType& val)
method basic_json (line 1272) | basic_json(const string_t& val)
method basic_json (line 1298) | basic_json(const typename string_t::value_type* val)
method basic_json (line 1331) | basic_json(const CompatibleStringType& val)
method basic_json (line 1351) | basic_json(boolean_t val) noexcept
method basic_json (line 1386) | basic_json(const number_integer_t val) noexcept
method basic_json (line 1417) | basic_json(const int val) noexcept
method basic_json (line 1456) | basic_json(const CompatibleNumberIntegerType val) noexcept
method basic_json (line 1486) | basic_json(const number_unsigned_t val) noexcept
method basic_json (line 1519) | basic_json(const CompatibleNumberUnsignedType val) noexcept
method basic_json (line 1550) | basic_json(const number_float_t val) noexcept
method basic_json (line 1599) | basic_json(const CompatibleNumberFloatType val) noexcept
method basic_json (line 1674) | basic_json(std::initializer_list<basic_json> init,
method basic_json (line 1757) | static basic_json array(std::initializer_list<basic_json> init =
method basic_json (line 1797) | static basic_json object(std::initializer_list<basic_json> init =
method basic_json (line 1821) | basic_json(size_type cnt, const basic_json& val)
method basic_json (line 1870) | basic_json(InputIT first, InputIT last)
method basic_json (line 1979) | explicit basic_json(std::istream& i, const parser_callback_t cb = nu...
method basic_json (line 2011) | basic_json(const basic_json& other)
method basic_json (line 2088) | basic_json(basic_json&& other) noexcept
method reference (line 2125) | reference& operator=(basic_json other) noexcept (
method string_t (line 2230) | string_t dump(const int indent = -1) const
method value_t (line 2272) | constexpr value_t type() const noexcept
method is_primitive (line 2302) | constexpr bool is_primitive() const noexcept
method is_structured (line 2329) | constexpr bool is_structured() const noexcept
method is_null (line 2351) | constexpr bool is_null() const noexcept
method is_boolean (line 2373) | constexpr bool is_boolean() const noexcept
method is_number (line 2403) | constexpr bool is_number() const noexcept
method is_number_integer (line 2432) | constexpr bool is_number_integer() const noexcept
method is_number_unsigned (line 2460) | constexpr bool is_number_unsigned() const noexcept
method is_number_float (line 2488) | constexpr bool is_number_float() const noexcept
method is_object (line 2510) | constexpr bool is_object() const noexcept
method is_array (line 2532) | constexpr bool is_array() const noexcept
method is_string (line 2554) | constexpr bool is_string() const noexcept
method is_discarded (line 2581) | constexpr bool is_discarded() const noexcept
method T (line 2622) | T get_impl(T*) const
method object_t (line 2635) | object_t get_impl(object_t*) const
method T (line 2656) | T get_impl(T*) const
method get_impl (line 2680) | std::vector<T> get_impl(std::vector<T>*) const
method T (line 2705) | T get_impl(T*) const
method array_t (line 2718) | array_t get_impl(array_t*) const
method T (line 2735) | T get_impl(T*) const
method T (line 2752) | T get_impl(T*) const
method boolean_t (line 2779) | constexpr boolean_t get_impl(boolean_t*) const
method object_t (line 2787) | object_t* get_impl_ptr(object_t*) noexcept
method object_t (line 2793) | constexpr const object_t* get_impl_ptr(const object_t*) const noexcept
method array_t (line 2799) | array_t* get_impl_ptr(array_t*) noexcept
method array_t (line 2805) | constexpr const array_t* get_impl_ptr(const array_t*) const noexcept
method string_t (line 2811) | string_t* get_impl_ptr(string_t*) noexcept
method string_t (line 2817) | constexpr const string_t* get_impl_ptr(const string_t*) const noexcept
method boolean_t (line 2823) | boolean_t* get_impl_ptr(boolean_t*) noexcept
method boolean_t (line 2829) | constexpr const boolean_t* get_impl_ptr(const boolean_t*) const noex...
method number_integer_t (line 2835) | number_integer_t* get_impl_ptr(number_integer_t*) noexcept
method number_integer_t (line 2841) | constexpr const number_integer_t* get_impl_ptr(const number_integer_...
method number_unsigned_t (line 2847) | number_unsigned_t* get_impl_ptr(number_unsigned_t*) noexcept
method number_unsigned_t (line 2853) | constexpr const number_unsigned_t* get_impl_ptr(const number_unsigne...
method number_float_t (line 2859) | number_float_t* get_impl_ptr(number_float_t*) noexcept
method number_float_t (line 2865) | constexpr const number_float_t* get_impl_ptr(const number_float_t*) ...
method ReferenceType (line 2882) | static ReferenceType get_ref_impl(ThisType& obj)
method ValueType (line 2944) | ValueType get() const
method PointerType (line 2980) | PointerType get() noexcept
method PointerType (line 2994) | constexpr const PointerType get() const noexcept
method PointerType (line 3030) | PointerType get_ptr() noexcept
method PointerType (line 3060) | constexpr const PointerType get_ptr() const noexcept
method ReferenceType (line 3111) | ReferenceType get_ref()
method ReferenceType (line 3126) | ReferenceType get_ref() const
method reference (line 3207) | reference at(size_type idx)
method const_reference (line 3250) | const_reference at(size_type idx) const
method reference (line 3297) | reference at(const typename object_t::key_type& key)
method const_reference (line 3344) | const_reference at(const typename object_t::key_type& key) const
method reference (line 3390) | reference operator[](size_type idx)
method const_reference (line 3438) | const_reference operator[](size_type idx) const
method reference (line 3478) | reference operator[](const typename object_t::key_type& key)
method const_reference (line 3526) | const_reference operator[](const typename object_t::key_type& key) c...
method reference (line 3568) | reference operator[](T * (&key)[n])
method const_reference (line 3603) | const_reference operator[](T * (&key)[n]) const
method reference (line 3636) | reference operator[](T* key)
method const_reference (line 3685) | const_reference operator[](T* key) const
method ValueType (line 3751) | ValueType value(const typename object_t::key_type& key, ValueType de...
method string_t (line 3777) | string_t value(const typename object_t::key_type& key, const char* d...
method ValueType (line 3827) | ValueType value(const json_pointer& ptr, ValueType default_value) const
method string_t (line 3852) | string_t value(const json_pointer& ptr, const char* default_value) c...
method reference (line 3881) | reference front()
method const_reference (line 3889) | const_reference front() const
method reference (line 3923) | reference back()
method const_reference (line 3933) | const_reference back() const
method InteratorType (line 3991) | InteratorType erase(InteratorType pos)
method InteratorType (line 4100) | InteratorType erase(InteratorType first, InteratorType last)
method size_type (line 4188) | size_type erase(const typename object_t::key_type& key)
method erase (line 4225) | void erase(const size_type idx)
method iterator (line 4271) | iterator find(typename object_t::key_type key)
method iterator (line 7233) | iterator() = default;
method iterator (line 7236) | explicit iterator(pointer object) noexcept
method iterator (line 7241) | iterator(const iterator& other) noexcept
method iterator (line 7246) | iterator& operator=(iterator other) noexcept(
method reference (line 7258) | reference operator*() const
method pointer (line 7264) | pointer operator->() const
method iterator (line 7270) | iterator operator++(int)
method iterator (line 7278) | iterator& operator++()
method iterator (line 7285) | iterator operator--(int)
method iterator (line 7293) | iterator& operator--()
method iterator (line 7300) | iterator& operator+=(difference_type i)
method iterator (line 7307) | iterator& operator-=(difference_type i)
method iterator (line 7314) | iterator operator+(difference_type i)
method iterator (line 7322) | iterator operator-(difference_type i)
method difference_type (line 7330) | difference_type operator-(const iterator& other) const
method reference (line 7336) | reference operator[](difference_type n) const
method reference (line 7342) | reference value() const
method const_iterator (line 4287) | const_iterator find(typename object_t::key_type key) const
method const_iterator (line 6623) | const_iterator() = default;
method const_iterator (line 6631) | explicit const_iterator(pointer object) noexcept
method const_iterator (line 6663) | explicit const_iterator(const iterator& other) noexcept
method const_iterator (line 6696) | const_iterator(const const_iterator& other) noexcept
method const_iterator (line 6705) | const_iterator& operator=(const_iterator other) noexcept(
method set_begin (line 6722) | void set_begin() noexcept
method set_end (line 6759) | void set_end() noexcept
method reference (line 6790) | reference operator*() const
method pointer (line 6831) | pointer operator->() const
method const_iterator (line 6867) | const_iterator operator++(int)
method const_iterator (line 6878) | const_iterator& operator++()
method const_iterator (line 6910) | const_iterator operator--(int)
method const_iterator (line 6921) | const_iterator& operator--()
method const_iterator (line 7055) | const_iterator& operator+=(difference_type i)
method const_iterator (line 7086) | const_iterator& operator-=(difference_type i)
method const_iterator (line 7095) | const_iterator operator+(difference_type i)
method const_iterator (line 7106) | const_iterator operator-(difference_type i)
method difference_type (line 7117) | difference_type operator-(const const_iterator& other) const
method reference (line 7144) | reference operator[](difference_type n) const
method key (line 7183) | typename object_t::key_type key() const
method reference (line 7201) | reference value() const
method size_type (line 4317) | size_type count(typename object_t::key_type key) const
method iterator (line 4357) | iterator begin() noexcept
method iterator (line 7233) | iterator() = default;
method iterator (line 7236) | explicit iterator(pointer object) noexcept
method iterator (line 7241) | iterator(const iterator& other) noexcept
method iterator (line 7246) | iterator& operator=(iterator other) noexcept(
method reference (line 7258) | reference operator*() const
method pointer (line 7264) | pointer operator->() const
method iterator (line 7270) | iterator operator++(int)
method iterator (line 7278) | iterator& operator++()
method iterator (line 7285) | iterator operator--(int)
method iterator (line 7293) | iterator& operator--()
method iterator (line 7300) | iterator& operator+=(difference_type i)
method iterator (line 7307) | iterator& operator-=(difference_type i)
method iterator (line 7314) | iterator operator+(difference_type i)
method iterator (line 7322) | iterator operator-(difference_type i)
method difference_type (line 7330) | difference_type operator-(const iterator& other) const
method reference (line 7336) | reference operator[](difference_type n) const
method reference (line 7342) | reference value() const
method const_iterator (line 4367) | const_iterator begin() const noexcept
method const_iterator (line 6623) | const_iterator() = default;
method const_iterator (line 6631) | explicit const_iterator(pointer object) noexcept
method const_iterator (line 6663) | explicit const_iterator(const iterator& other) noexcept
method const_iterator (line 6696) | const_iterator(const const_iterator& other) noexcept
method const_iterator (line 6705) | const_iterator& operator=(const_iterator other) noexcept(
method set_begin (line 6722) | void set_begin() noexcept
method set_end (line 6759) | void set_end() noexcept
method reference (line 6790) | reference operator*() const
method pointer (line 6831) | pointer operator->() const
method const_iterator (line 6867) | const_iterator operator++(int)
method const_iterator (line 6878) | const_iterator& operator++()
method const_iterator (line 6910) | const_iterator operator--(int)
method const_iterator (line 6921) | const_iterator& operator--()
method const_iterator (line 7055) | const_iterator& operator+=(difference_type i)
method const_iterator (line 7086) | const_iterator& operator-=(difference_type i)
method const_iterator (line 7095) | const_iterator operator+(difference_type i)
method const_iterator (line 7106) | const_iterator operator-(difference_type i)
method difference_type (line 7117) | difference_type operator-(const const_iterator& other) const
method reference (line 7144) | reference operator[](difference_type n) const
method key (line 7183) | typename object_t::key_type key() const
method reference (line 7201) | reference value() const
method const_iterator (line 4397) | const_iterator cbegin() const noexcept
method const_iterator (line 6623) | const_iterator() = default;
method const_iterator (line 6631) | explicit const_iterator(pointer object) noexcept
method const_iterator (line 6663) | explicit const_iterator(const iterator& other) noexcept
method const_iterator (line 6696) | const_iterator(const const_iterator& other) noexcept
method const_iterator (line 6705) | const_iterator& operator=(const_iterator other) noexcept(
method set_begin (line 6722) | void set_begin() noexcept
method set_end (line 6759) | void set_end() noexcept
method reference (line 6790) | reference operator*() const
method pointer (line 6831) | pointer operator->() const
method const_iterator (line 6867) | const_iterator operator++(int)
method const_iterator (line 6878) | const_iterator& operator++()
method const_iterator (line 6910) | const_iterator operator--(int)
method const_iterator (line 6921) | const_iterator& operator--()
method const_iterator (line 7055) | const_iterator& operator+=(difference_type i)
method const_iterator (line 7086) | const_iterator& operator-=(difference_type i)
method const_iterator (line 7095) | const_iterator operator+(difference_type i)
method const_iterator (line 7106) | const_iterator operator-(difference_type i)
method difference_type (line 7117) | difference_type operator-(const const_iterator& other) const
method reference (line 7144) | reference operator[](difference_type n) const
method key (line 7183) | typename object_t::key_type key() const
method reference (line 7201) | reference value() const
method iterator (line 4428) | iterator end() noexcept
method iterator (line 7233) | iterator() = default;
method iterator (line 7236) | explicit iterator(pointer object) noexcept
method iterator (line 7241) | iterator(const iterator& other) noexcept
method iterator (line 7246) | iterator& operator=(iterator other) noexcept(
method reference (line 7258) | reference operator*() const
method pointer (line 7264) | pointer operator->() const
method iterator (line 7270) | iterator operator++(int)
method iterator (line 7278) | iterator& operator++()
method iterator (line 7285) | iterator operator--(int)
method iterator (line 7293) | iterator& operator--()
method iterator (line 7300) | iterator& operator+=(difference_type i)
method iterator (line 7307) | iterator& operator-=(difference_type i)
method iterator (line 7314) | iterator operator+(difference_type i)
method iterator (line 7322) | iterator operator-(difference_type i)
method difference_type (line 7330) | difference_type operator-(const iterator& other) const
method reference (line 7336) | reference operator[](difference_type n) const
method reference (line 7342) | reference value() const
method const_iterator (line 4438) | const_iterator end() const noexcept
method const_iterator (line 6623) | const_iterator() = default;
method const_iterator (line 6631) | explicit const_iterator(pointer object) noexcept
method const_iterator (line 6663) | explicit const_iterator(const iterator& other) noexcept
method const_iterator (line 6696) | const_iterator(const const_iterator& other) noexcept
method const_iterator (line 6705) | const_iterator& operator=(const_iterator other) noexcept(
method set_begin (line 6722) | void set_begin() noexcept
method set_end (line 6759) | void set_end() noexcept
method reference (line 6790) | reference operator*() const
method pointer (line 6831) | pointer operator->() const
method const_iterator (line 6867) | const_iterator operator++(int)
method const_iterator (line 6878) | const_iterator& operator++()
method const_iterator (line 6910) | const_iterator operator--(int)
method const_iterator (line 6921) | const_iterator& operator--()
method const_iterator (line 7055) | const_iterator& operator+=(difference_type i)
method const_iterator (line 7086) | const_iterator& operator-=(difference_type i)
method const_iterator (line 7095) | const_iterator operator+(difference_type i)
method const_iterator (line 7106) | const_iterator operator-(difference_type i)
method difference_type (line 7117) | difference_type operator-(const const_iterator& other) const
method reference (line 7144) | reference operator[](difference_type n) const
method key (line 7183) | typename object_t::key_type key() const
method reference (line 7201) | reference value() const
method const_iterator (line 4468) | const_iterator cend() const noexcept
method const_iterator (line 6623) | const_iterator() = default;
method const_iterator (line 6631) | explicit const_iterator(pointer object) noexcept
method const_iterator (line 6663) | explicit const_iterator(const iterator& other) noexcept
method const_iterator (line 6696) | const_iterator(const const_iterator& other) noexcept
method const_iterator (line 6705) | const_iterator& operator=(const_iterator other) noexcept(
method set_begin (line 6722) | void set_begin() noexcept
method set_end (line 6759) | void set_end() noexcept
method reference (line 6790) | reference operator*() const
method pointer (line 6831) | pointer operator->() const
method const_iterator (line 6867) | const_iterator operator++(int)
method const_iterator (line 6878) | const_iterator& operator++()
method const_iterator (line 6910) | const_iterator operator--(int)
method const_iterator (line 6921) | const_iterator& operator--()
method const_iterator (line 7055) | const_iterator& operator+=(difference_type i)
method const_iterator (line 7086) | const_iterator& operator-=(difference_type i)
method const_iterator (line 7095) | const_iterator operator+(difference_type i)
method const_iterator (line 7106) | const_iterator operator-(difference_type i)
method difference_type (line 7117) | difference_type operator-(const const_iterator& other) const
method reference (line 7144) | reference operator[](difference_type n) const
method key (line 7183) | typename object_t::key_type key() const
method reference (line 7201) | reference value() const
method reverse_iterator (line 4498) | reverse_iterator rbegin() noexcept
method const_reverse_iterator (line 4506) | const_reverse_iterator rbegin() const noexcept
method reverse_iterator (line 4535) | reverse_iterator rend() noexcept
method const_reverse_iterator (line 4543) | const_reverse_iterator rend() const noexcept
method const_reverse_iterator (line 4572) | const_reverse_iterator crbegin() const noexcept
method const_reverse_iterator (line 4601) | const_reverse_iterator crend() const noexcept
class iteration_proxy (line 4608) | class iteration_proxy
class iteration_proxy_internal (line 6495) | class iteration_proxy_internal
method iteration_proxy_internal (line 6504) | explicit iteration_proxy_internal(IteratorType it) noexcept
method iteration_proxy_internal (line 6509) | iteration_proxy_internal& operator*()
method iteration_proxy_internal (line 6515) | iteration_proxy_internal& operator++()
method key (line 6530) | typename basic_json::string_t key() const
method value (line 6557) | typename IteratorType::reference value() const
method iteration_proxy (line 6568) | explicit iteration_proxy(typename IteratorType::reference cont)
method iteration_proxy_internal (line 6573) | iteration_proxy_internal begin() noexcept
method iteration_proxy_internal (line 6504) | explicit iteration_proxy_internal(IteratorType it) noexcept
method iteration_proxy_internal (line 6509) | iteration_proxy_internal& operator*()
method iteration_proxy_internal (line 6515) | iteration_proxy_internal& operator++()
method key (line 6530) | typename basic_json::string_t key() const
method value (line 6557) | typename IteratorType::reference value() const
method iteration_proxy_internal (line 6579) | iteration_proxy_internal end() noexcept
method iteration_proxy_internal (line 6504) | explicit iteration_proxy_internal(IteratorType it) noexcept
method iteration_proxy_internal (line 6509) | iteration_proxy_internal& operator*()
method iteration_proxy_internal (line 6515) | iteration_proxy_internal& operator++()
method key (line 6530) | typename basic_json::string_t key() const
method value (line 6557) | typename IteratorType::reference value() const
method iterator_wrapper (line 4622) | static iteration_proxy<iterator> iterator_wrapper(reference cont)
method iterator_wrapper (line 4630) | static iteration_proxy<const_iterator> iterator_wrapper(const_refere...
method empty (line 4682) | bool empty() const noexcept
method size_type (line 4750) | size_type size() const noexcept
method size_type (line 4816) | size_type max_size() const noexcept
method clear (line 4875) | void clear() noexcept
method push_back (line 4948) | void push_back(basic_json&& val)
method reference (line 4974) | reference operator+=(basic_json&& val)
method push_back (line 4984) | void push_back(const basic_json& val)
method reference (line 5008) | reference operator+=(const basic_json& val)
method push_back (line 5034) | void push_back(const typename object_t::value_type& val)
method reference (line 5058) | reference operator+=(const typename object_t::value_type& val)
method push_back (line 5089) | void push_back(std::initializer_list<basic_json> init)
method reference (line 5106) | reference operator+=(std::initializer_list<basic_json> init)
method iterator (line 5134) | iterator insert(const_iterator pos, const basic_json& val)
method iterator (line 7233) | iterator() = default;
method iterator (line 7236) | explicit iterator(pointer object) noexcept
method iterator (line 7241) | iterator(const iterator& other) noexcept
method iterator (line 7246) | iterator& operator=(iterator other) noexcept(
method reference (line 7258) | reference operator*() const
method pointer (line 7264) | pointer operator->() const
method iterator (line 7270) | iterator operator++(int)
method iterator (line 7278) | iterator& operator++()
method iterator (line 7285) | iterator operator--(int)
method iterator (line 7293) | iterator& operator--()
method iterator (line 7300) | iterator& operator+=(difference_type i)
method iterator (line 7307) | iterator& operator-=(difference_type i)
method iterator (line 7314) | iterator operator+(difference_type i)
method iterator (line 7322) | iterator operator-(difference_type i)
method difference_type (line 7330) | difference_type operator-(const iterator& other) const
method reference (line 7336) | reference operator[](difference_type n) const
method reference (line 7342) | reference value() const
method iterator (line 5160) | iterator insert(const_iterator pos, basic_json&& val)
method iterator (line 7233) | iterator() = default;
method iterator (line 7236) | explicit iterator(pointer object) noexcept
method iterator (line 7241) | iterator(const iterator& other) noexcept
method iterator (line 7246) | iterator& operator=(iterator other) noexcept(
method reference (line 7258) | reference operator*() const
method pointer (line 7264) | pointer operator->() const
method iterator (line 7270) | iterator operator++(int)
method iterator (line 7278) | iterator& operator++()
method iterator (line 7285) | iterator operator--(int)
method iterator (line 7293) | iterator& operator--()
method iterator (line 7300) | iterator& operator+=(difference_type i)
method iterator (line 7307) | iterator& operator-=(difference_type i)
method iterator (line 7314) | iterator operator+(difference_type i)
method iterator (line 7322) | iterator operator-(difference_type i)
method difference_type (line 7330) | difference_type operator-(const iterator& other) const
method reference (line 7336) | reference operator[](difference_type n) const
method reference (line 7342) | reference value() const
method iterator (line 5189) | iterator insert(const_iterator pos, size_type cnt, const basic_json&...
method iterator (line 7233) | iterator() = default;
method iterator (line 7236) | explicit iterator(pointer object) noexcept
method iterator (line 7241) | iterator(const iterator& other) noexcept
method iterator (line 7246) | iterator& operator=(iterator other) noexcept(
method reference (line 7258) | reference operator*() const
method pointer (line 7264) | pointer operator->() const
method iterator (line 7270) | iterator operator++(int)
method iterator (line 7278) | iterator& operator++()
method iterator (line 7285) | iterator operator--(int)
method iterator (line 7293) | iterator& operator--()
method iterator (line 7300) | iterator& operator+=(difference_type i)
method iterator (line 7307) | iterator& operator-=(difference_type i)
method iterator (line 7314) | iterator operator+(difference_type i)
method iterator (line 7322) | iterator operator-(difference_type i)
method difference_type (line 7330) | difference_type operator-(const iterator& other) const
method reference (line 7336) | reference operator[](difference_type n) const
method reference (line 7342) | reference value() const
method iterator (line 5241) | iterator insert(const_iterator pos, const_iterator first, const_iter...
method iterator (line 7233) | iterator() = default;
method iterator (line 7236) | explicit iterator(pointer object) noexcept
method iterator (line 7241) | iterator(const iterator& other) noexcept
method iterator (line 7246) | iterator& operator=(iterator other) noexcept(
method reference (line 7258) | reference operator*() const
method pointer (line 7264) | pointer operator->() const
method iterator (line 7270) | iterator operator++(int)
method iterator (line 7278) | iterator& operator++()
method iterator (line 7285) | iterator operator--(int)
method iterator (line 7293) | iterator& operator--()
method iterator (line 7300) | iterator& operator+=(difference_type i)
method iterator (line 7307) | iterator& operator-=(difference_type i)
method iterator (line 7314) | iterator operator+(difference_type i)
method iterator (line 7322) | iterator operator-(difference_type i)
method difference_type (line 7330) | difference_type operator-(const iterator& other) const
method reference (line 7336) | reference operator[](difference_type n) const
method reference (line 7342) | reference value() const
method iterator (line 5299) | iterator insert(const_iterator pos, std::initializer_list<basic_json...
method iterator (line 7233) | iterator() = default;
method iterator (line 7236) | explicit iterator(pointer object) noexcept
method iterator (line 7241) | iterator(const iterator& other) noexcept
method iterator (line 7246) | iterator& operator=(iterator other) noexcept(
method reference (line 7258) | reference operator*() const
method pointer (line 7264) | pointer operator->() const
method iterator (line 7270) | iterator operator++(int)
method iterator (line 7278) | iterator& operator++()
method iterator (line 7285) | iterator operator--(int)
method iterator (line 7293) | iterator& operator--()
method iterator (line 7300) | iterator& operator+=(difference_type i)
method iterator (line 7307) | iterator& operator-=(difference_type i)
method iterator (line 7314) | iterator operator+(difference_type i)
method iterator (line 7322) | iterator operator-(difference_type i)
method difference_type (line 7330) | difference_type operator-(const iterator& other) const
method reference (line 7336) | reference operator[](difference_type n) const
method reference (line 7342) | reference value() const
method swap (line 5336) | void swap(reference other) noexcept (
method swap (line 5368) | void swap(array_t& other)
method swap (line 5401) | void swap(object_t& other)
method swap (line 5434) | void swap(string_t& other)
method basic_json (line 5949) | static basic_json parse(const string_t& s,
method basic_json (line 5979) | static basic_json parse(std::istream& i,
method basic_json (line 5988) | static basic_json parse(std::istream&& i,
method type_name (line 6053) | std::string type_name() const
method extra_space (line 6082) | static std::size_t extra_space(const string_t& s) noexcept
method string_t (line 6130) | static string_t escape_string(const string_t& s)
method dump (line 6254) | void dump(std::ostream& o,
class primitive_iterator_t (line 6420) | class primitive_iterator_t
method set_begin (line 6424) | void set_begin() noexcept
method set_end (line 6430) | void set_end() noexcept
method is_begin (line 6436) | constexpr bool is_begin() const noexcept
method is_end (line 6442) | constexpr bool is_end() const noexcept
type internal_iterator (line 6474) | struct internal_iterator
method internal_iterator (line 6484) | internal_iterator() noexcept
class iteration_proxy (line 6491) | class iteration_proxy
class iteration_proxy_internal (line 6495) | class iteration_proxy_internal
method iteration_proxy_internal (line 6504) | explicit iteration_proxy_internal(IteratorType it) noexcept
method iteration_proxy_internal (line 6509) | iteration_proxy_internal& operator*()
method iteration_proxy_internal (line 6515) | iteration_proxy_internal& operator++()
method key (line 6530) | typename basic_json::string_t key() const
method value (line 6557) | typename IteratorType::reference value() const
method iteration_proxy (line 6568) | explicit iteration_proxy(typename IteratorType::reference cont)
method iteration_proxy_internal (line 6573) | iteration_proxy_internal begin() noexcept
method iteration_proxy_internal (line 6504) | explicit iteration_proxy_internal(IteratorType it) noexcept
method iteration_proxy_internal (line 6509) | iteration_proxy_internal& operator*()
method iteration_proxy_internal (line 6515) | iteration_proxy_internal& operator++()
method key (line 6530) | typename basic_json::string_t key() const
method value (line 6557) | typename IteratorType::reference value() const
method iteration_proxy_internal (line 6579) | iteration_proxy_internal end() noexcept
method iteration_proxy_internal (line 6504) | explicit iteration_proxy_internal(IteratorType it) noexcept
method iteration_proxy_internal (line 6509) | iteration_proxy_internal& operator*()
method iteration_proxy_internal (line 6515) | iteration_proxy_internal& operator++()
method key (line 6530) | typename basic_json::string_t key() const
method value (line 6557) | typename IteratorType::reference value() const
class const_iterator (line 6605) | class const_iterator : public std::iterator<std::random_access_itera...
method const_iterator (line 6623) | const_iterator() = default;
method const_iterator (line 6631) | explicit const_iterator(pointer object) noexcept
method const_iterator (line 6663) | explicit const_iterator(const iterator& other) noexcept
method const_iterator (line 6696) | const_iterator(const const_iterator& other) noexcept
method const_iterator (line 6705) | const_iterator& operator=(const_iterator other) noexcept(
method set_begin (line 6722) | void set_begin() noexcept
method set_end (line 6759) | void set_end() noexcept
method reference (line 6790) | reference operator*() const
method pointer (line 6831) | pointer operator->() const
method const_iterator (line 6867) | const_iterator operator++(int)
method const_iterator (line 6878) | const_iterator& operator++()
method const_iterator (line 6910) | const_iterator operator--(int)
method const_iterator (line 6921) | const_iterator& operator--()
method const_iterator (line 7055) | const_iterator& operator+=(difference_type i)
method const_iterator (line 7086) | const_iterator& operator-=(difference_type i)
method const_iterator (line 7095) | const_iterator operator+(difference_type i)
method const_iterator (line 7106) | const_iterator operator-(difference_type i)
method difference_type (line 7117) | difference_type operator-(const const_iterator& other) const
method reference (line 7144) | reference operator[](difference_type n) const
method key (line 7183) | typename object_t::key_type key() const
method reference (line 7201) | reference value() const
class iterator (line 7225) | class iterator : public const_iterator
method iterator (line 7233) | iterator() = default;
method iterator (line 7236) | explicit iterator(pointer object) noexcept
method iterator (line 7241) | iterator(const iterator& other) noexcept
method iterator (line 7246) | iterator& operator=(iterator other) noexcept(
method reference (line 7258) | reference operator*() const
method pointer (line 7264) | pointer operator->() const
method iterator (line 7270) | iterator operator++(int)
method iterator (line 7278) | iterator& operator++()
method iterator (line 7285) | iterator operator--(int)
method iterator (line 7293) | iterator& operator--()
method iterator (line 7300) | iterator& operator+=(difference_type i)
method iterator (line 7307) | iterator& operator-=(difference_type i)
method iterator (line 7314) | iterator operator+(difference_type i)
method iterator (line 7322) | iterator operator-(difference_type i)
method difference_type (line 7330) | difference_type operator-(const iterator& other) const
method reference (line 7336) | reference operator[](difference_type n) const
method reference (line 7342) | reference value() const
class json_reverse_iterator (line 7366) | class json_reverse_iterator : public std::reverse_iterator<Base>
method json_reverse_iterator (line 7375) | json_reverse_iterator(const typename base_iterator::iterator_type&...
method json_reverse_iterator (line 7380) | json_reverse_iterator(const base_iterator& it) noexcept
method json_reverse_iterator (line 7385) | json_reverse_iterator operator++(int)
method json_reverse_iterator (line 7391) | json_reverse_iterator& operator++()
method json_reverse_iterator (line 7398) | json_reverse_iterator operator--(int)
method json_reverse_iterator (line 7404) | json_reverse_iterator& operator--()
method json_reverse_iterator (line 7411) | json_reverse_iterator& operator+=(difference_type i)
method json_reverse_iterator (line 7418) | json_reverse_iterator operator+(difference_type i) const
method json_reverse_iterator (line 7426) | json_reverse_iterator operator-(difference_type i) const
method difference_type (line 7434) | difference_type operator-(const json_reverse_iterator& other) const
method reference (line 7440) | reference operator[](difference_type n) const
method key (line 7446) | typename object_t::key_type key() const
method reference (line 7453) | reference value() const
class lexer (line 7473) | class lexer
type token_type (line 7477) | enum class token_type
method lexer (line 7499) | explicit lexer(const string_t& s) noexcept
method lexer (line 7509) | explicit lexer(std::istream* s) noexcept
method lexer (line 7521) | lexer() = default;
method lexer (line 7524) | lexer(const lexer&) = delete;
method lexer (line 7525) | lexer operator=(const lexer&) = delete;
method string_t (line 7550) | static string_t to_unicode(const std::size_t codepoint1,
method token_type_name (line 7615) | static std::string token_type_name(const token_type t)
method token_type (line 7676) | token_type scan() noexcept
method yyfill (line 8459) | void yyfill() noexcept
method string_t (line 8485) | string_t get_token_string() const
method string_t (line 8549) | string_t get_string() const
method str_to_float_t (line 8669) | long double str_to_float_t(long double* /* type */, char** endptr)...
method str_to_float_t (line 8689) | double str_to_float_t(double* /* type */, char** endptr) const
method str_to_float_t (line 8709) | float str_to_float_t(float* /* type */, char** endptr) const
method get_number (line 8735) | void get_number(basic_json& result) const
class parser (line 8844) | class parser
method parser (line 8848) | parser(const string_t& s, const parser_callback_t cb = nullptr) no...
method parser (line 8856) | parser(std::istream& _is, const parser_callback_t cb = nullptr) no...
method basic_json (line 8864) | basic_json parse()
method basic_json (line 8878) | basic_json parse_internal(bool keep)
method get_token (line 9070) | typename lexer::token_type get_token() noexcept
method expect (line 9076) | void expect(typename lexer::token_type t) const
method unexpect (line 9089) | void unexpect(typename lexer::token_type t) const
class json_pointer (line 9124) | class json_pointer
method json_pointer (line 9152) | explicit json_pointer(const std::string& s = "")
method to_string (line 9171) | std::string to_string() const noexcept
method pop_back (line 9189) | std::string pop_back()
method is_root (line 9202) | bool is_root() const
method json_pointer (line 9207) | json_pointer top() const
method reference (line 9224) | reference get_and_create(reference j) const
method reference (line 9293) | reference get_unchecked(pointer ptr) const
method reference (line 9337) | reference get_checked(pointer ptr) const
method const_reference (line 9389) | const_reference get_unchecked(const_pointer ptr) const
method const_reference (line 9433) | const_reference get_checked(const_pointer ptr) const
method split (line 9478) | static std::vector<std::string> split(std::string reference_string)
method replace_substring (line 9553) | static void replace_substring(std::string& s,
method escape (line 9568) | static std::string escape(std::string s)
method unescape (line 9577) | static void unescape(std::string& s)
method flatten (line 9592) | static void flatten(const std::string& reference_string,
method basic_json (line 9650) | static basic_json unflatten(const basic_json& value)
method reference (line 9723) | reference operator[](const json_pointer& ptr)
method const_reference (line 9750) | const_reference operator[](const json_pointer& ptr) const
method reference (line 9775) | reference at(const json_pointer& ptr)
method const_reference (line 9800) | const_reference at(const json_pointer& ptr) const
method basic_json (line 9827) | basic_json flatten() const
method basic_json (line 9861) | basic_json unflatten() const
method basic_json (line 9911) | basic_json patch(const basic_json& json_patch) const
method basic_json (line 10204) | static basic_json diff(const basic_json& source,
type std (line 10361) | namespace std
function swap (line 10369) | inline void swap(nlohmann::json& j1,
type hash<nlohmann::json> (line 10380) | struct hash<nlohmann::json>
FILE: environment/main.cpp
type TCLAP (line 19) | namespace TCLAP {
type ArgTraits< std::pair<signed int, signed int> > (line 20) | struct ArgTraits< std::pair<signed int, signed int> > {
function main (line 31) | int main(int argc, char ** argv) {
FILE: environment/networking/Networking.cpp
function serializeMapSize (line 13) | std::string serializeMapSize(const hlt::Map & map) {
function serializeProductions (line 21) | std::string serializeProductions(const hlt::Map & map) {
type timeval (line 168) | struct timeval
type timeval (line 465) | struct timeval
FILE: environment/networking/Networking.hpp
class Networking (line 29) | class Networking {
type WinConnection (line 42) | struct WinConnection {
type UniConnection (line 48) | struct UniConnection {
FILE: environment/tclap/Arg.h
type std (line 43) | typedef std::istringstream istringstream;
type std (line 46) | typedef std::istrstream istringstream;
function namespace (line 57) | namespace TCLAP {
function Arg (line 503) | inline Arg::~Arg() { }
function a (line 546) | inline bool Arg::operator==(const Arg& a) const
function setRequireLabel (line 585) | inline void Arg::setRequireLabel( const std::string& s)
function argMatches (line 590) | inline bool Arg::argMatches( const std::string& argFlag ) const
function trimFlag (line 620) | inline void Arg::trimFlag(std::string& flag, std::string& value) const
function _hasBlanks (line 641) | inline bool Arg::_hasBlanks( const std::string& s ) const
function forceRequired (line 650) | inline void Arg::forceRequired()
function xorSet (line 655) | inline void Arg::xorSet()
function addToList (line 664) | inline void Arg::addToList( std::list<Arg*>& argList ) const
function allowMore (line 669) | inline bool Arg::allowMore()
function acceptsMultipleValues (line 674) | inline bool Arg::acceptsMultipleValues()
function reset (line 679) | inline void Arg::reset()
FILE: environment/tclap/ArgException.h
function namespace (line 30) | namespace TCLAP {
FILE: environment/tclap/ArgTraits.h
type StringLikeTrait (line 57) | struct StringLikeTrait {
FILE: environment/tclap/CmdLine.h
function namespace (line 51) | namespace TCLAP {
function _emptyCombined (line 511) | inline bool CmdLine::_emptyCombined(const std::string& s)
function missingArgsException (line 523) | inline void CmdLine::missingArgsException()
function deleteOnExit (line 550) | inline void CmdLine::deleteOnExit(Arg* ptr)
function deleteOnExit (line 555) | inline void CmdLine::deleteOnExit(Visitor* ptr)
function CmdLineOutput (line 560) | inline CmdLineOutput* CmdLine::getOutput()
function setOutput (line 565) | inline void CmdLine::setOutput(CmdLineOutput* co)
function std (line 573) | inline std::string& CmdLine::getVersion()
function std (line 578) | inline std::string& CmdLine::getProgramName()
function std (line 583) | inline std::list<Arg*>& CmdLine::getArgList()
function XorHandler (line 588) | inline XorHandler& CmdLine::getXorHandler()
function getDelimiter (line 593) | inline char CmdLine::getDelimiter()
function std (line 598) | inline std::string& CmdLine::getMessage()
function hasHelpAndVersion (line 603) | inline bool CmdLine::hasHelpAndVersion()
function setExceptionHandling (line 608) | inline void CmdLine::setExceptionHandling(const bool state)
function reset (line 618) | inline void CmdLine::reset()
FILE: environment/tclap/CmdLineInterface.h
function namespace (line 33) | namespace TCLAP {
FILE: environment/tclap/CmdLineOutput.h
function namespace (line 33) | namespace TCLAP {
FILE: environment/tclap/Constraint.h
function namespace (line 32) | namespace TCLAP {
FILE: environment/tclap/DocBookOutput.h
function namespace (line 37) | namespace TCLAP {
FILE: environment/tclap/HelpVisitor.h
function namespace (line 29) | namespace TCLAP {
FILE: environment/tclap/IgnoreRestVisitor.h
function namespace (line 29) | namespace TCLAP {
FILE: environment/tclap/MultiArg.h
function namespace (line 32) | namespace TCLAP {
FILE: environment/tclap/MultiSwitchArg.h
function namespace (line 33) | namespace TCLAP {
function getValue (line 153) | inline int MultiSwitchArg::getValue() { return _value; }
function processArg (line 155) | inline bool MultiSwitchArg::processArg(int *i, std::vector<std::string>&...
function reset (line 204) | inline void
FILE: environment/tclap/OptionalUnlabeledTracker.h
function namespace (line 29) | namespace TCLAP {
function check (line 48) | inline void OptionalUnlabeledTracker::check( bool req, const std::string...
FILE: environment/tclap/StandardTraits.h
function namespace (line 42) | namespace TCLAP {
FILE: environment/tclap/StdOutput.h
function namespace (line 37) | namespace TCLAP {
FILE: environment/tclap/SwitchArg.h
function namespace (line 32) | namespace TCLAP {
function getValue (line 158) | inline bool SwitchArg::getValue() { return _value; }
function lastCombined (line 160) | inline bool SwitchArg::lastCombined(std::string& combinedSwitches )
function combinedSwitchesMatch (line 169) | inline bool SwitchArg::combinedSwitchesMatch(std::string& combinedSwitch...
function commonProcessing (line 204) | inline void SwitchArg::commonProcessing()
function processArg (line 223) | inline bool SwitchArg::processArg(int *i, std::vector<std::string>& args)
function reset (line 255) | inline void SwitchArg::reset()
FILE: environment/tclap/UnlabeledMultiArg.h
function namespace (line 32) | namespace TCLAP {
FILE: environment/tclap/UnlabeledValueArg.h
function namespace (line 34) | namespace TCLAP {
FILE: environment/tclap/ValueArg.h
function namespace (line 32) | namespace TCLAP {
FILE: environment/tclap/ValuesConstraint.h
function virtual (line 65) | virtual ~ValuesConstraint() {}
function virtual (line 70) | virtual std::string description() const;
FILE: environment/tclap/VersionVisitor.h
function namespace (line 31) | namespace TCLAP {
FILE: environment/tclap/Visitor.h
function namespace (line 26) | namespace TCLAP {
FILE: environment/tclap/XorHandler.h
function namespace (line 32) | namespace TCLAP {
FILE: environment/tclap/ZshCompletionOutput.h
function namespace (line 37) | namespace TCLAP {
FILE: tests/environment/hlt.py
class Location (line 17) | class Location:
method __init__ (line 18) | def __init__(self, x=0, y=0):
class Site (line 21) | class Site:
method __init__ (line 22) | def __init__(self, owner=0, strength=0, production=0):
class Move (line 26) | class Move:
method __init__ (line 27) | def __init__(self, loc=0, direction=0):
class GameMap (line 31) | class GameMap:
method __init__ (line 32) | def __init__(self, width = 0, height = 0, numberOfPlayers = 0):
method inBounds (line 43) | def inBounds(self, l):
method getDistance (line 46) | def getDistance(self, l1, l2):
method getAngle (line 55) | def getAngle(self, l1, l2):
method getLocation (line 70) | def getLocation(self, loc, direction):
method getSite (line 94) | def getSite(self, l, direction = STILL):
FILE: tests/environment/networking.py
function serializeMoveSet (line 12) | def serializeMoveSet(moves):
function deserializeMapSize (line 18) | def deserializeMapSize(inputString):
function deserializeProductions (line 25) | def deserializeProductions(inputString):
function deserializeMap (line 34) | def deserializeMap(inputString):
function sendString (line 60) | def sendString(toBeSent):
function getString (line 66) | def getString():
function getInit (line 69) | def getInit():
function sendInit (line 77) | def sendInit(name):
function getFrame (line 80) | def getFrame():
function sendFrame (line 83) | def sendFrame(moves):
FILE: tests/scalabilityTests/main.py
function createNewUser (line 10) | def createNewUser(db, cursor, accessKey, secretAccessKey, numUsers):
FILE: tests/website/APITest.php
class APITest (line 4) | class APITest extends PHPUnit_Framework_TestCase {
method setUp (line 8) | protected function setUp() {
method tearDown (line 21) | protected function tearDown() {
method insertObject (line 31) | protected function insertObject($table, $obj) {
FILE: tests/website/GameTest.php
class GameTest (line 12) | class GameTest extends APITest {
method testGET (line 13) | public function testGET() {
FILE: tests/website/HistoryTest.php
class HistoryTest (line 8) | class HistoryTest extends APITest {
method testGET (line 9) | public function testGET() {
FILE: tests/website/UserTest.php
class UserTest (line 9) | class UserTest extends APITest {
method testGetUser (line 10) | public function testGetUser() {
method testActive (line 28) | public function testActive() {
FILE: tests/worker/testWorker.py
class CompilerTests (line 19) | class CompilerTests(unittest.TestCase):
method testStarterPackages (line 20) | def testStarterPackages(self):
method testLanguageOverride (line 46) | def testLanguageOverride(self):
class GameTests (line 60) | class GameTests(unittest.TestCase):
method testNormalGame (line 61) | def testNormalGame(self):
method testParsing (line 80) | def testParsing(self):
FILE: tests/worker/winBot/MyBot.py
function assign_move (line 9) | def assign_move(square):
FILE: visualizer/index.js
function handleFiles (line 19) | function handleFiles(files) {
FILE: visualizer/main.js
function onClosed (line 13) | function onClosed() {
function createMainWindow (line 19) | function createMainWindow() {
FILE: website/api/API.class.php
class API (line 14) | abstract class API{
method numRows (line 44) | protected function numRows($sql) {
method select (line 48) | protected function select($sql) {
method selectMultiple (line 58) | protected function selectMultiple($sql) {
method insert (line 69) | protected function insert($sql) {
method loadConfig (line 73) | protected function loadConfig() {
method loadAwsSdk (line 77) | protected function loadAwsSdk() {
method sendNotification (line 89) | protected function sendNotification($recipientUser, $subject, $message...
method initDB (line 117) | protected function initDB() {
method __construct (line 136) | public function __construct($request) {
method processAPI (line 178) | public function processAPI() {
method _response (line 185) | private function _response($data, $status = 200) {
method _cleanInputs (line 190) | private function _cleanInputs($data) {
method _requestStatus (line 202) | private function _requestStatus($code) {
FILE: website/api/manager/ManagerAPI.php
class ManagerAPI (line 16) | class ManagerAPI extends API{
method __construct (line 20) | public function __construct($request) {
method getAPIKey (line 33) | private function getAPIKey() {
method isValidWorker (line 40) | private function isValidWorker() {
method getTrueskillMatchQuality (line 55) | private function getTrueskillMatchQuality($rankingValues) {
method checkConfig (line 68) | private function checkConfig($section, $key) {
method task (line 79) | protected function task() {
method compile (line 137) | protected function compile() {
method game (line 164) | protected function game() {
method botFile (line 284) | protected function botFile() {
method botHash (line 322) | protected function botHash() {
FILE: website/api/web/WebsiteAPI.php
class WebsiteAPI (line 24) | class WebsiteAPI extends API{
method __construct (line 25) | public function __construct($request) {
method sanitizeHTTPParameters (line 43) | private function sanitizeHTTPParameters() {
method getForumsID (line 50) | private function getForumsID($userID) {
method logOutForums (line 57) | private function logOutForums($forumsID) {
method isLoggedIn (line 66) | private function isLoggedIn() {
method getUsers (line 70) | private function getUsers($query, $privateInfo=false) {
method getLoggedInUser (line 94) | private function getLoggedInUser() {
method getHS (line 101) | private function getHS($name=null, $state=null) {
method getOrganizationForEmail (line 112) | private function getOrganizationForEmail($email) {
method user (line 133) | protected function user() {
method email (line 200) | protected function email() {
method emailList (line 254) | protected function emailList() {
method history (line 279) | protected function history() {
method highSchool (line 289) | protected function highSchool() {
method notification (line 298) | protected function notification() {
method game (line 310) | protected function game() {
method botFile (line 338) | protected function botFile() {
method forums (line 381) | protected function forums() {
method worker (line 431) | protected function worker() {
method stats (line 441) | protected function stats() {
method announcement (line 480) | protected function announcement() {
method errorLog (line 505) | protected function errorLog() {
method session (line 529) | protected function session() {
FILE: website/api/web/openNewWorker.py
function runCommandOnInstance (line 42) | def runCommandOnInstance(instance, command):
FILE: website/lib/swiftmailer/lib/classes/Swift.php
class Swift (line 17) | abstract class Swift{
method init (line 32) | public static function init($callable) {
method autoload (line 41) | public static function autoload($class) {
method registerAutoload (line 70) | public static function registerAutoload($callable = null) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Attachment.php
class Swift_Attachment (line 16) | class Swift_Attachment extends Swift_Mime_Attachment{
method __construct (line 26) | public function __construct($data = null, $filename = null, $contentTy...
method newInstance (line 49) | public static function newInstance($data = null, $filename = null, $co...
method fromPath (line 61) | public static function fromPath($path, $contentType = null) {
FILE: website/lib/swiftmailer/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php
class Swift_ByteStream_AbstractFilterableInputStream (line 16) | abstract class Swift_ByteStream_AbstractFilterableInputStream implements...
method _commit (line 46) | abstract protected function _commit($bytes);
method _flush (line 51) | abstract protected function _flush();
method addFilter (line 59) | public function addFilter(Swift_StreamFilter $filter, $key) {
method removeFilter (line 68) | public function removeFilter($key) {
method write (line 81) | public function write($bytes) {
method commit (line 99) | public function commit() {
method bind (line 111) | public function bind(Swift_InputByteStream $is) {
method unbind (line 124) | public function unbind(Swift_InputByteStream $is) {
method flushBuffers (line 141) | public function flushBuffers() {
method _filter (line 153) | private function _filter($bytes) {
method _doWrite (line 162) | private function _doWrite($bytes) {
FILE: website/lib/swiftmailer/lib/classes/Swift/ByteStream/ArrayByteStream.php
class Swift_ByteStream_ArrayByteStream (line 16) | class Swift_ByteStream_ArrayByteStream implements Swift_InputByteStream,...
method __construct (line 52) | public function __construct($stack = null) {
method read (line 75) | public function read($length) {
method write (line 96) | public function write($bytes) {
method commit (line 111) | public function commit() {
method bind (line 122) | public function bind(Swift_InputByteStream $is) {
method unbind (line 135) | public function unbind(Swift_InputByteStream $is) {
method setReadPointer (line 150) | public function setReadPointer($byteOffset) {
method flushBuffers (line 164) | public function flushBuffers() {
FILE: website/lib/swiftmailer/lib/classes/Swift/ByteStream/FileByteStream.php
class Swift_ByteStream_FileByteStream (line 16) | class Swift_ByteStream_FileByteStream extends Swift_ByteStream_AbstractF...
method __construct (line 44) | public function __construct($path, $writable = false) {
method getPath (line 61) | public function getPath() {
method read (line 79) | public function read($length) {
method setReadPointer (line 114) | public function setReadPointer($byteOffset) {
method _commit (line 122) | protected function _commit($bytes) {
method _flush (line 128) | protected function _flush() {
method _getReadHandle (line 132) | private function _getReadHandle() {
method _getWriteHandle (line 151) | private function _getWriteHandle() {
method _resetReadHandle (line 164) | private function _resetReadHandle() {
method _getReadStreamSeekableStatus (line 172) | private function _getReadStreamSeekableStatus() {
method _seekReadStreamToPosition (line 178) | private function _seekReadStreamToPosition($offset) {
method _copyReadStream (line 196) | private function _copyReadStream() {
FILE: website/lib/swiftmailer/lib/classes/Swift/ByteStream/TemporaryFileByteStream.php
class Swift_ByteStream_TemporaryFileByteStream (line 14) | class Swift_ByteStream_TemporaryFileByteStream extends Swift_ByteStream_...
method __construct (line 15) | public function __construct() {
method getContent (line 25) | public function getContent() {
method __destruct (line 33) | public function __destruct() {
FILE: website/lib/swiftmailer/lib/classes/Swift/CharacterReader.php
type Swift_CharacterReader (line 17) | interface Swift_CharacterReader{
method getCharPositions (line 32) | public function getCharPositions($string, $startOffset, &$currentMap, ...
method getMapType (line 39) | public function getMapType();
method validateByteSequence (line 55) | public function validateByteSequence($bytes, $size);
method getInitialByteSize (line 65) | public function getInitialByteSize();
FILE: website/lib/swiftmailer/lib/classes/Swift/CharacterReader/GenericFixedWidthReader.php
class Swift_CharacterReader_GenericFixedWidthReader (line 17) | class Swift_CharacterReader_GenericFixedWidthReader implements Swift_Cha...
method __construct (line 30) | public function __construct($width) {
method getCharPositions (line 44) | public function getCharPositions($string, $startOffset, &$currentMap, ...
method getMapType (line 59) | public function getMapType() {
method validateByteSequence (line 77) | public function validateByteSequence($bytes, $size) {
method getInitialByteSize (line 88) | public function getInitialByteSize() {
FILE: website/lib/swiftmailer/lib/classes/Swift/CharacterReader/UsAsciiReader.php
class Swift_CharacterReader_UsAsciiReader (line 16) | class Swift_CharacterReader_UsAsciiReader implements Swift_CharacterReader{
method getCharPositions (line 27) | public function getCharPositions($string, $startOffset, &$currentMap, ...
method getMapType (line 45) | public function getMapType() {
method validateByteSequence (line 62) | public function validateByteSequence($bytes, $size) {
method getInitialByteSize (line 76) | public function getInitialByteSize() {
FILE: website/lib/swiftmailer/lib/classes/Swift/CharacterReader/Utf8Reader.php
class Swift_CharacterReader_Utf8Reader (line 17) | class Swift_CharacterReader_Utf8Reader implements Swift_CharacterReader{
method getCharPositions (line 84) | public function getCharPositions($string, $startOffset, &$currentMap, ...
method getMapType (line 137) | public function getMapType() {
method validateByteSequence (line 154) | public function validateByteSequence($bytes, $size) {
method getInitialByteSize (line 168) | public function getInitialByteSize() {
FILE: website/lib/swiftmailer/lib/classes/Swift/CharacterReaderFactory.php
type Swift_CharacterReaderFactory (line 16) | interface Swift_CharacterReaderFactory{
method getReaderFor (line 24) | public function getReaderFor($charset);
FILE: website/lib/swiftmailer/lib/classes/Swift/CharacterReaderFactory/SimpleCharacterReaderFactory.php
class Swift_CharacterReaderFactory_SimpleCharacterReaderFactory (line 16) | class Swift_CharacterReaderFactory_SimpleCharacterReaderFactory implemen...
method __construct (line 34) | public function __construct() {
method __wakeup (line 38) | public function __wakeup() {
method init (line 42) | public function init() {
method getReaderFor (line 100) | public function getReaderFor($charset) {
FILE: website/lib/swiftmailer/lib/classes/Swift/CharacterStream.php
type Swift_CharacterStream (line 20) | interface Swift_CharacterStream{
method setCharacterSet (line 26) | public function setCharacterSet($charset);
method setCharacterReaderFactory (line 33) | public function setCharacterReaderFactory(Swift_CharacterReaderFactory...
method importByteStream (line 40) | public function importByteStream(Swift_OutputByteStream $os);
method importString (line 48) | public function importString($string);
method read (line 58) | public function read($length);
method readBytes (line 68) | public function readBytes($length);
method write (line 75) | public function write($chars);
method setPointer (line 82) | public function setPointer($charOffset);
method flushContents (line 87) | public function flushContents();
FILE: website/lib/swiftmailer/lib/classes/Swift/CharacterStream/ArrayCharacterStream.php
class Swift_CharacterStream_ArrayCharacterStream (line 16) | class Swift_CharacterStream_ArrayCharacterStream implements Swift_Charac...
method __construct (line 47) | public function __construct(Swift_CharacterReaderFactory $factory, $ch...
method setCharacterSet (line 58) | public function setCharacterSet($charset) {
method setCharacterReaderFactory (line 68) | public function setCharacterReaderFactory(Swift_CharacterReaderFactory...
method importByteStream (line 77) | public function importByteStream(Swift_OutputByteStream $os) {
method importString (line 109) | public function importString($string) {
method read (line 122) | public function read($length) {
method readBytes (line 153) | public function readBytes($length) {
method write (line 175) | public function write($chars) {
method setPointer (line 240) | public function setPointer($charOffset) {
method flushContents (line 252) | public function flushContents() {
method _reloadBuffer (line 258) | private function _reloadBuffer($fp, $len) {
method _initializeMaps (line 271) | private static function _initializeMaps() {
FILE: website/lib/swiftmailer/lib/classes/Swift/CharacterStream/NgCharacterStream.php
class Swift_CharacterStream_NgCharacterStream (line 16) | class Swift_CharacterStream_NgCharacterStream implements Swift_Character...
method __construct (line 86) | public function __construct(Swift_CharacterReaderFactory $factory, $ch...
method setCharacterSet (line 98) | public function setCharacterSet($charset) {
method setCharacterReaderFactory (line 109) | public function setCharacterReaderFactory(Swift_CharacterReaderFactory...
method flushContents (line 116) | public function flushContents() {
method importByteStream (line 129) | public function importByteStream(Swift_OutputByteStream $os) {
method importString (line 143) | public function importString($string) {
method read (line 155) | public function read($length) {
method readBytes (line 212) | public function readBytes($length) {
method setPointer (line 228) | public function setPointer($charOffset) {
method write (line 240) | public function write($chars) {
FILE: website/lib/swiftmailer/lib/classes/Swift/ConfigurableSpool.php
class Swift_ConfigurableSpool (line 16) | abstract class Swift_ConfigurableSpool implements Swift_Spool{
method setMessageLimit (line 28) | public function setMessageLimit($limit) {
method getMessageLimit (line 37) | public function getMessageLimit() {
method setTimeLimit (line 46) | public function setTimeLimit($limit) {
method getTimeLimit (line 55) | public function getTimeLimit() {
FILE: website/lib/swiftmailer/lib/classes/Swift/DependencyContainer.php
class Swift_DependencyContainer (line 16) | class Swift_DependencyContainer{
method __construct (line 43) | public function __construct() {
method getInstance (line 51) | public static function getInstance() {
method listItems (line 64) | public function listItems() {
method has (line 77) | public function has($itemName) {
method lookup (line 93) | public function lookup($itemName) {
method createDependenciesFor (line 119) | public function createDependenciesFor($itemName) {
method register (line 141) | public function register($itemName) {
method asValue (line 157) | public function asValue($value) {
method asAliasOf (line 172) | public function asAliasOf($lookup) {
method asNewInstanceOf (line 193) | public function asNewInstanceOf($className) {
method asSharedInstanceOf (line 210) | public function asSharedInstanceOf($className) {
method withDependencies (line 229) | public function withDependencies(array $lookups) {
method addConstructorValue (line 249) | public function addConstructorValue($value) {
method addConstructorLookup (line 269) | public function addConstructorLookup($lookup) {
method _getValue (line 280) | private function _getValue($itemName) {
method _createAlias (line 285) | private function _createAlias($itemName) {
method _createNewInstance (line 290) | private function _createNewInstance($itemName) {
method _createSharedInstance (line 302) | private function _createSharedInstance($itemName) {
method _getEndPoint (line 311) | private function &_getEndPoint() {
method _resolveArgs (line 322) | private function _resolveArgs(array $args) {
method _lookupRecursive (line 339) | private function _lookupRecursive($item) {
FILE: website/lib/swiftmailer/lib/classes/Swift/DependencyException.php
class Swift_DependencyException (line 16) | class Swift_DependencyException extends Swift_SwiftException{
method __construct (line 22) | public function __construct($message) {
FILE: website/lib/swiftmailer/lib/classes/Swift/EmbeddedFile.php
class Swift_EmbeddedFile (line 16) | class Swift_EmbeddedFile extends Swift_Mime_EmbeddedFile{
method __construct (line 26) | public function __construct($data = null, $filename = null, $contentTy...
method newInstance (line 49) | public static function newInstance($data = null, $filename = null, $co...
method fromPath (line 60) | public static function fromPath($path) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Encoder.php
type Swift_Encoder (line 16) | interface Swift_Encoder extends Swift_Mime_CharsetObserver{
method encodeString (line 26) | public function encodeString($string, $firstLineOffset = 0, $maxLineLe...
FILE: website/lib/swiftmailer/lib/classes/Swift/Encoder/Base64Encoder.php
class Swift_Encoder_Base64Encoder (line 16) | class Swift_Encoder_Base64Encoder implements Swift_Encoder{
method encodeString (line 30) | public function encodeString($string, $firstLineOffset = 0, $maxLineLe...
method charsetChanged (line 53) | public function charsetChanged($charset) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Encoder/QpEncoder.php
class Swift_Encoder_QpEncoder (line 18) | class Swift_Encoder_QpEncoder implements Swift_Encoder{
method __construct (line 108) | public function __construct(Swift_CharacterStream $charStream, Swift_S...
method __sleep (line 119) | public function __sleep() {
method __wakeup (line 123) | public function __wakeup() {
method getSafeMapShareId (line 132) | protected function getSafeMapShareId() {
method initSafeMap (line 136) | protected function initSafeMap() {
method encodeString (line 156) | public function encodeString($string, $firstLineOffset = 0, $maxLineLe...
method charsetChanged (line 223) | public function charsetChanged($charset) {
method _encodeByteSequence (line 235) | protected function _encodeByteSequence(array $bytes, &$size) {
method _nextSequence (line 258) | protected function _nextSequence($size = 4) {
method _standardize (line 269) | protected function _standardize($string) {
method __clone (line 285) | public function __clone() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Encoder/Rfc2231Encoder.php
class Swift_Encoder_Rfc2231Encoder (line 16) | class Swift_Encoder_Rfc2231Encoder implements Swift_Encoder{
method __construct (line 29) | public function __construct(Swift_CharacterStream $charStream) {
method encodeString (line 43) | public function encodeString($string, $firstLineOffset = 0, $maxLineLe...
method charsetChanged (line 77) | public function charsetChanged($charset) {
method __clone (line 84) | public function __clone() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Encoding.php
class Swift_Encoding (line 16) | class Swift_Encoding{
method get7BitEncoding (line 22) | public static function get7BitEncoding() {
method get8BitEncoding (line 31) | public static function get8BitEncoding() {
method getQpEncoding (line 40) | public static function getQpEncoding() {
method getBase64Encoding (line 49) | public static function getBase64Encoding() {
method _lookup (line 55) | private static function _lookup($key) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Events/CommandEvent.php
class Swift_Events_CommandEvent (line 16) | class Swift_Events_CommandEvent extends Swift_Events_EventObject{
method __construct (line 38) | public function __construct(Swift_Transport $source, $command, $succes...
method getCommand (line 49) | public function getCommand() {
method getSuccessCodes (line 58) | public function getSuccessCodes() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Events/CommandListener.php
type Swift_Events_CommandListener (line 16) | interface Swift_Events_CommandListener extends Swift_Events_EventListener{
method commandSent (line 22) | public function commandSent(Swift_Events_CommandEvent $evt);
FILE: website/lib/swiftmailer/lib/classes/Swift/Events/Event.php
type Swift_Events_Event (line 16) | interface Swift_Events_Event{
method getSource (line 22) | public function getSource();
method cancelBubble (line 29) | public function cancelBubble($cancel = true);
method bubbleCancelled (line 36) | public function bubbleCancelled();
FILE: website/lib/swiftmailer/lib/classes/Swift/Events/EventDispatcher.php
type Swift_Events_EventDispatcher (line 16) | interface Swift_Events_EventDispatcher{
method createSendEvent (line 25) | public function createSendEvent(Swift_Transport $source, Swift_Mime_Me...
method createCommandEvent (line 36) | public function createCommandEvent(Swift_Transport $source, $command, ...
method createResponseEvent (line 47) | public function createResponseEvent(Swift_Transport $source, $response...
method createTransportChangeEvent (line 56) | public function createTransportChangeEvent(Swift_Transport $source);
method createTransportExceptionEvent (line 66) | public function createTransportExceptionEvent(Swift_Transport $source,...
method bindEventListener (line 73) | public function bindEventListener(Swift_Events_EventListener $listener);
method dispatchEvent (line 81) | public function dispatchEvent(Swift_Events_EventObject $evt, $target);
FILE: website/lib/swiftmailer/lib/classes/Swift/Events/EventListener.php
type Swift_Events_EventListener (line 16) | interface Swift_Events_EventListener{
FILE: website/lib/swiftmailer/lib/classes/Swift/Events/EventObject.php
class Swift_Events_EventObject (line 16) | class Swift_Events_EventObject implements Swift_Events_Event{
method __construct (line 28) | public function __construct($source) {
method getSource (line 37) | public function getSource() {
method cancelBubble (line 46) | public function cancelBubble($cancel = true) {
method bubbleCancelled (line 55) | public function bubbleCancelled() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Events/ResponseEvent.php
class Swift_Events_ResponseEvent (line 16) | class Swift_Events_ResponseEvent extends Swift_Events_EventObject{
method __construct (line 38) | public function __construct(Swift_Transport $source, $response, $valid...
method getResponse (line 49) | public function getResponse() {
method isValid (line 58) | public function isValid() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Events/ResponseListener.php
type Swift_Events_ResponseListener (line 16) | interface Swift_Events_ResponseListener extends Swift_Events_EventListener{
method responseReceived (line 22) | public function responseReceived(Swift_Events_ResponseEvent $evt);
FILE: website/lib/swiftmailer/lib/classes/Swift/Events/SendEvent.php
class Swift_Events_SendEvent (line 16) | class Swift_Events_SendEvent extends Swift_Events_EventObject{
method __construct (line 59) | public function __construct(Swift_Transport $source, Swift_Mime_Messag...
method getTransport (line 70) | public function getTransport() {
method getMessage (line 79) | public function getMessage() {
method setFailedRecipients (line 88) | public function setFailedRecipients($recipients) {
method getFailedRecipients (line 97) | public function getFailedRecipients() {
method setResult (line 106) | public function setResult($result) {
method getResult (line 118) | public function getResult() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Events/SendListener.php
type Swift_Events_SendListener (line 16) | interface Swift_Events_SendListener extends Swift_Events_EventListener{
method beforeSendPerformed (line 22) | public function beforeSendPerformed(Swift_Events_SendEvent $evt);
method sendPerformed (line 29) | public function sendPerformed(Swift_Events_SendEvent $evt);
FILE: website/lib/swiftmailer/lib/classes/Swift/Events/SimpleEventDispatcher.php
class Swift_Events_SimpleEventDispatcher (line 16) | class Swift_Events_SimpleEventDispatcher implements Swift_Events_EventDi...
method __construct (line 29) | public function __construct() {
method createSendEvent (line 47) | public function createSendEvent(Swift_Transport $source, Swift_Mime_Me...
method createCommandEvent (line 60) | public function createCommandEvent(Swift_Transport $source, $command, ...
method createResponseEvent (line 73) | public function createResponseEvent(Swift_Transport $source, $response...
method createTransportChangeEvent (line 84) | public function createTransportChangeEvent(Swift_Transport $source) {
method createTransportExceptionEvent (line 96) | public function createTransportExceptionEvent(Swift_Transport $source,...
method bindEventListener (line 105) | public function bindEventListener(Swift_Events_EventListener $listener) {
method dispatchEvent (line 121) | public function dispatchEvent(Swift_Events_EventObject $evt, $target) {
method _prepareBubbleQueue (line 127) | private function _prepareBubbleQueue(Swift_Events_EventObject $evt) {
method _bubble (line 139) | private function _bubble(Swift_Events_EventObject $evt, $target) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Events/TransportChangeEvent.php
class Swift_Events_TransportChangeEvent (line 16) | class Swift_Events_TransportChangeEvent extends Swift_Events_EventObject{
method getTransport (line 22) | public function getTransport() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Events/TransportChangeListener.php
type Swift_Events_TransportChangeListener (line 16) | interface Swift_Events_TransportChangeListener extends Swift_Events_Even...
method beforeTransportStarted (line 22) | public function beforeTransportStarted(Swift_Events_TransportChangeEve...
method transportStarted (line 29) | public function transportStarted(Swift_Events_TransportChangeEvent $evt);
method beforeTransportStopped (line 36) | public function beforeTransportStopped(Swift_Events_TransportChangeEve...
method transportStopped (line 43) | public function transportStopped(Swift_Events_TransportChangeEvent $evt);
FILE: website/lib/swiftmailer/lib/classes/Swift/Events/TransportExceptionEvent.php
class Swift_Events_TransportExceptionEvent (line 16) | class Swift_Events_TransportExceptionEvent extends Swift_Events_EventObj...
method __construct (line 30) | public function __construct(Swift_Transport $transport, Swift_Transpor...
method getException (line 40) | public function getException() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Events/TransportExceptionListener.php
type Swift_Events_TransportExceptionListener (line 16) | interface Swift_Events_TransportExceptionListener extends Swift_Events_E...
method exceptionThrown (line 22) | public function exceptionThrown(Swift_Events_TransportExceptionEvent $...
FILE: website/lib/swiftmailer/lib/classes/Swift/FailoverTransport.php
class Swift_FailoverTransport (line 16) | class Swift_FailoverTransport extends Swift_Transport_FailoverTransport{
method __construct (line 22) | public function __construct($transports = array()) {
method newInstance (line 39) | public static function newInstance($transports = array()) {
FILE: website/lib/swiftmailer/lib/classes/Swift/FileSpool.php
class Swift_FileSpool (line 17) | class Swift_FileSpool extends Swift_ConfigurableSpool{
method __construct (line 35) | public function __construct($path) {
method isStarted (line 50) | public function isStarted() {
method start (line 57) | public function start() {
method stop (line 63) | public function stop() {
method setRetryLimit (line 73) | public function setRetryLimit($limit) {
method queueMessage (line 86) | public function queueMessage(Swift_Mime_Message $message) {
method recover (line 112) | public function recover($timeout = 900) {
method flushQueue (line 133) | public function flushQueue(Swift_Transport $transport, &$failedRecipie...
method getRandomString (line 187) | protected function getRandomString($count) {
FILE: website/lib/swiftmailer/lib/classes/Swift/FileStream.php
type Swift_FileStream (line 16) | interface Swift_FileStream extends Swift_OutputByteStream{
method getPath (line 22) | public function getPath();
FILE: website/lib/swiftmailer/lib/classes/Swift/Filterable.php
type Swift_Filterable (line 16) | interface Swift_Filterable{
method addFilter (line 23) | public function addFilter(Swift_StreamFilter $filter, $key);
method removeFilter (line 30) | public function removeFilter($key);
FILE: website/lib/swiftmailer/lib/classes/Swift/Image.php
class Swift_Image (line 16) | class Swift_Image extends Swift_EmbeddedFile{
method __construct (line 26) | public function __construct($data = null, $filename = null, $contentTy...
method newInstance (line 39) | public static function newInstance($data = null, $filename = null, $co...
method fromPath (line 50) | public static function fromPath($path) {
FILE: website/lib/swiftmailer/lib/classes/Swift/InputByteStream.php
type Swift_InputByteStream (line 19) | interface Swift_InputByteStream{
method write (line 36) | public function write($bytes);
method commit (line 44) | public function commit();
method bind (line 54) | public function bind(Swift_InputByteStream $is);
method unbind (line 65) | public function unbind(Swift_InputByteStream $is);
method flushBuffers (line 73) | public function flushBuffers();
FILE: website/lib/swiftmailer/lib/classes/Swift/IoException.php
class Swift_IoException (line 16) | class Swift_IoException extends Swift_SwiftException{
method __construct (line 24) | public function __construct($message, $code = 0, Exception $previous =...
FILE: website/lib/swiftmailer/lib/classes/Swift/KeyCache.php
type Swift_KeyCache (line 16) | interface Swift_KeyCache{
method setString (line 33) | public function setString($nsKey, $itemKey, $string, $mode);
method importFromByteStream (line 45) | public function importFromByteStream($nsKey, $itemKey, Swift_OutputByt...
method getInputByteStream (line 59) | public function getInputByteStream($nsKey, $itemKey, Swift_InputByteSt...
method getString (line 69) | public function getString($nsKey, $itemKey);
method exportToByteStream (line 78) | public function exportToByteStream($nsKey, $itemKey, Swift_InputByteSt...
method hasKey (line 88) | public function hasKey($nsKey, $itemKey);
method clearKey (line 96) | public function clearKey($nsKey, $itemKey);
method clearAll (line 103) | public function clearAll($nsKey);
FILE: website/lib/swiftmailer/lib/classes/Swift/KeyCache/ArrayKeyCache.php
class Swift_KeyCache_ArrayKeyCache (line 16) | class Swift_KeyCache_ArrayKeyCache implements Swift_KeyCache{
method __construct (line 37) | public function __construct(Swift_KeyCache_KeyCacheInputStream $stream) {
method setString (line 51) | public function setString($nsKey, $itemKey, $string, $mode) {
method importFromByteStream (line 81) | public function importFromByteStream($nsKey, $itemKey, Swift_OutputByt...
method getInputByteStream (line 113) | public function getInputByteStream($nsKey, $itemKey, Swift_InputByteSt...
method getString (line 133) | public function getString($nsKey, $itemKey) {
method exportToByteStream (line 147) | public function exportToByteStream($nsKey, $itemKey, Swift_InputByteSt...
method hasKey (line 160) | public function hasKey($nsKey, $itemKey) {
method clearKey (line 172) | public function clearKey($nsKey, $itemKey) {
method clearAll (line 181) | public function clearAll($nsKey) {
method _prepareCache (line 190) | private function _prepareCache($nsKey) {
FILE: website/lib/swiftmailer/lib/classes/Swift/KeyCache/DiskKeyCache.php
class Swift_KeyCache_DiskKeyCache (line 16) | class Swift_KeyCache_DiskKeyCache implements Swift_KeyCache{
method __construct (line 61) | public function __construct(Swift_KeyCache_KeyCacheInputStream $stream...
method setString (line 82) | public function setString($nsKey, $itemKey, $string, $mode) {
method importFromByteStream (line 114) | public function importFromByteStream($nsKey, $itemKey, Swift_OutputByt...
method getInputByteStream (line 147) | public function getInputByteStream($nsKey, $itemKey, Swift_InputByteSt...
method getString (line 169) | public function getString($nsKey, $itemKey) {
method exportToByteStream (line 196) | public function exportToByteStream($nsKey, $itemKey, Swift_InputByteSt...
method hasKey (line 220) | public function hasKey($nsKey, $itemKey) {
method clearKey (line 230) | public function clearKey($nsKey, $itemKey) {
method clearAll (line 242) | public function clearAll($nsKey) {
method _prepareCache (line 259) | private function _prepareCache($nsKey) {
method _getHandle (line 278) | private function _getHandle($nsKey, $itemKey, $position) {
method _freeHandle (line 293) | private function _freeHandle($nsKey, $itemKey) {
method __destruct (line 302) | public function __destruct() {
FILE: website/lib/swiftmailer/lib/classes/Swift/KeyCache/KeyCacheInputStream.php
type Swift_KeyCache_KeyCacheInputStream (line 16) | interface Swift_KeyCache_KeyCacheInputStream extends Swift_InputByteStream{
method setKeyCache (line 22) | public function setKeyCache(Swift_KeyCache $keyCache);
method setNsKey (line 29) | public function setNsKey($nsKey);
method setItemKey (line 36) | public function setItemKey($itemKey);
method setWriteThroughStream (line 43) | public function setWriteThroughStream(Swift_InputByteStream $is);
method __clone (line 49) | public function __clone();
FILE: website/lib/swiftmailer/lib/classes/Swift/KeyCache/NullKeyCache.php
class Swift_KeyCache_NullKeyCache (line 16) | class Swift_KeyCache_NullKeyCache implements Swift_KeyCache{
method setString (line 27) | public function setString($nsKey, $itemKey, $string, $mode) {
method importFromByteStream (line 40) | public function importFromByteStream($nsKey, $itemKey, Swift_OutputByt...
method getInputByteStream (line 54) | public function getInputByteStream($nsKey, $itemKey, Swift_InputByteSt...
method getString (line 65) | public function getString($nsKey, $itemKey) {
method exportToByteStream (line 75) | public function exportToByteStream($nsKey, $itemKey, Swift_InputByteSt...
method hasKey (line 86) | public function hasKey($nsKey, $itemKey) {
method clearKey (line 96) | public function clearKey($nsKey, $itemKey) {
method clearAll (line 104) | public function clearAll($nsKey) {
FILE: website/lib/swiftmailer/lib/classes/Swift/KeyCache/SimpleKeyCacheInputStream.php
class Swift_KeyCache_SimpleKeyCacheInputStream (line 16) | class Swift_KeyCache_SimpleKeyCacheInputStream implements Swift_KeyCache...
method setKeyCache (line 34) | public function setKeyCache(Swift_KeyCache $keyCache) {
method setWriteThroughStream (line 43) | public function setWriteThroughStream(Swift_InputByteStream $is) {
method write (line 53) | public function write($bytes, Swift_InputByteStream $is = null) {
method commit (line 68) | public function commit() {
method bind (line 74) | public function bind(Swift_InputByteStream $is) {
method unbind (line 80) | public function unbind(Swift_InputByteStream $is) {
method flushBuffers (line 87) | public function flushBuffers() {
method setNsKey (line 96) | public function setNsKey($nsKey) {
method setItemKey (line 105) | public function setItemKey($itemKey) {
method __clone (line 113) | public function __clone() {
FILE: website/lib/swiftmailer/lib/classes/Swift/LoadBalancedTransport.php
class Swift_LoadBalancedTransport (line 16) | class Swift_LoadBalancedTransport extends Swift_Transport_LoadBalancedTr...
method __construct (line 22) | public function __construct($transports = array()) {
method newInstance (line 39) | public static function newInstance($transports = array()) {
FILE: website/lib/swiftmailer/lib/classes/Swift/MailTransport.php
class Swift_MailTransport (line 16) | class Swift_MailTransport extends Swift_Transport_MailTransport{
method __construct (line 22) | public function __construct($extraParams = '-f%s') {
method newInstance (line 39) | public static function newInstance($extraParams = '-f%s') {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mailer.php
class Swift_Mailer (line 16) | class Swift_Mailer{
method __construct (line 25) | public function __construct(Swift_Transport $transport) {
method newInstance (line 36) | public static function newInstance(Swift_Transport $transport) {
method createMessage (line 49) | public function createMessage($service = 'message') {
method send (line 70) | public function send(Swift_Mime_Message $message, &$failedRecipients =...
method registerPlugin (line 95) | public function registerPlugin(Swift_Events_EventListener $plugin) {
method getTransport (line 104) | public function getTransport() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mailer/ArrayRecipientIterator.php
class Swift_Mailer_ArrayRecipientIterator (line 16) | class Swift_Mailer_ArrayRecipientIterator implements Swift_Mailer_Recipi...
method __construct (line 29) | public function __construct(array $recipients) {
method hasNext (line 38) | public function hasNext() {
method nextRecipient (line 48) | public function nextRecipient() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mailer/RecipientIterator.php
type Swift_Mailer_RecipientIterator (line 16) | interface Swift_Mailer_RecipientIterator{
method hasNext (line 22) | public function hasNext();
method nextRecipient (line 30) | public function nextRecipient();
FILE: website/lib/swiftmailer/lib/classes/Swift/MemorySpool.php
class Swift_MemorySpool (line 16) | class Swift_MemorySpool implements Swift_Spool{
method isStarted (line 25) | public function isStarted() {
method start (line 32) | public function start() {
method stop (line 38) | public function stop() {
method setFlushRetries (line 44) | public function setFlushRetries($retries) {
method queueMessage (line 55) | public function queueMessage(Swift_Mime_Message $message) {
method flushQueue (line 70) | public function flushQueue(Swift_Transport $transport, &$failedRecipie...
FILE: website/lib/swiftmailer/lib/classes/Swift/Message.php
class Swift_Message (line 16) | class Swift_Message extends Swift_Mime_SimpleMessage{
method __construct (line 42) | public function __construct($subject = null, $body = null, $contentTyp...
method newInstance (line 71) | public static function newInstance($subject = null, $body = null, $con...
method addPart (line 84) | public function addPart($body, $contentType = null, $charset = null) {
method attachSigner (line 97) | public function attachSigner(Swift_Signer $signer) {
method detachSigner (line 114) | public function detachSigner(Swift_Signer $signer) {
method toString (line 141) | public function toString() {
method toByteStream (line 162) | public function toByteStream(Swift_InputByteStream $is) {
method __wakeup (line 178) | public function __wakeup() {
method doSign (line 185) | protected function doSign() {
method saveMessage (line 210) | protected function saveMessage() {
method saveHeaders (line 225) | protected function saveHeaders(array $altered) {
method restoreHeaders (line 238) | protected function restoreHeaders() {
method restoreMessage (line 253) | protected function restoreMessage() {
method __clone (line 266) | public function __clone() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/Attachment.php
class Swift_Mime_Attachment (line 16) | class Swift_Mime_Attachment extends Swift_Mime_SimpleMimeEntity{
method __construct (line 29) | public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_...
method getNestingLevel (line 43) | public function getNestingLevel() {
method getDisposition (line 54) | public function getDisposition() {
method setDisposition (line 65) | public function setDisposition($disposition) {
method getFilename (line 78) | public function getFilename() {
method setFilename (line 89) | public function setFilename($filename) {
method getSize (line 101) | public function getSize() {
method setSize (line 112) | public function setSize($size) {
method setFile (line 126) | public function setFile(Swift_FileStream $file, $contentType = null) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/CharsetObserver.php
type Swift_Mime_CharsetObserver (line 16) | interface Swift_Mime_CharsetObserver{
method charsetChanged (line 22) | public function charsetChanged($charset);
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/ContentEncoder.php
type Swift_Mime_ContentEncoder (line 16) | interface Swift_Mime_ContentEncoder extends Swift_Encoder{
method encodeByteStream (line 25) | public function encodeByteStream(Swift_OutputByteStream $os, Swift_Inp...
method getName (line 32) | public function getName();
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php
class Swift_Mime_ContentEncoder_Base64ContentEncoder (line 16) | class Swift_Mime_ContentEncoder_Base64ContentEncoder extends Swift_Encod...
method encodeByteStream (line 25) | public function encodeByteStream(Swift_OutputByteStream $os, Swift_Inp...
method getName (line 98) | public function getName() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/NativeQpContentEncoder.php
class Swift_Mime_ContentEncoder_NativeQpContentEncoder (line 16) | class Swift_Mime_ContentEncoder_NativeQpContentEncoder implements Swift_...
method __construct (line 25) | public function __construct($charset = null) {
method charsetChanged (line 34) | public function charsetChanged($charset) {
method encodeByteStream (line 48) | public function encodeByteStream(Swift_OutputByteStream $os, Swift_Inp...
method getName (line 68) | public function getName() {
method encodeString (line 83) | public function encodeString($string, $firstLineOffset = 0, $maxLineLe...
method _standardize (line 99) | protected function _standardize($string) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php
class Swift_Mime_ContentEncoder_PlainContentEncoder (line 16) | class Swift_Mime_ContentEncoder_PlainContentEncoder implements Swift_Mim...
method __construct (line 37) | public function __construct($name, $canonical = false) {
method encodeString (line 51) | public function encodeString($string, $firstLineOffset = 0, $maxLineLe...
method encodeByteStream (line 67) | public function encodeByteStream(Swift_OutputByteStream $os, Swift_Inp...
method getName (line 91) | public function getName() {
method charsetChanged (line 98) | public function charsetChanged($charset) {
method _safeWordwrap (line 110) | private function _safeWordwrap($string, $length = 75, $le = "\r\n") {
method _canonicalize (line 147) | private function _canonicalize($string) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php
class Swift_Mime_ContentEncoder_QpContentEncoder (line 16) | class Swift_Mime_ContentEncoder_QpContentEncoder extends Swift_Encoder_Q...
method __construct (line 26) | public function __construct(Swift_CharacterStream $charStream, Swift_S...
method __sleep (line 31) | public function __sleep() {
method getSafeMapShareId (line 35) | protected function getSafeMapShareId() {
method initSafeMap (line 39) | protected function initSafeMap() {
method encodeByteStream (line 59) | public function encodeByteStream(Swift_OutputByteStream $os, Swift_Inp...
method getName (line 124) | public function getName() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoderProxy.php
class Swift_Mime_ContentEncoder_QpContentEncoderProxy (line 18) | class Swift_Mime_ContentEncoder_QpContentEncoderProxy implements Swift_M...
method __construct (line 41) | public function __construct(Swift_Mime_ContentEncoder_QpContentEncoder...
method __clone (line 50) | public function __clone() {
method charsetChanged (line 58) | public function charsetChanged($charset) {
method encodeByteStream (line 66) | public function encodeByteStream(Swift_OutputByteStream $os, Swift_Inp...
method getName (line 73) | public function getName() {
method encodeString (line 80) | public function encodeString($string, $firstLineOffset = 0, $maxLineLe...
method getEncoder (line 87) | private function getEncoder() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/ContentEncoder/RawContentEncoder.php
class Swift_Mime_ContentEncoder_RawContentEncoder (line 17) | class Swift_Mime_ContentEncoder_RawContentEncoder implements Swift_Mime_...
method encodeString (line 27) | public function encodeString($string, $firstLineOffset = 0, $maxLineLe...
method encodeByteStream (line 39) | public function encodeByteStream(Swift_OutputByteStream $os, Swift_Inp...
method getName (line 50) | public function getName() {
method charsetChanged (line 57) | public function charsetChanged($charset) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/EmbeddedFile.php
class Swift_Mime_EmbeddedFile (line 16) | class Swift_Mime_EmbeddedFile extends Swift_Mime_Attachment{
method __construct (line 26) | public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_...
method getNestingLevel (line 39) | public function getNestingLevel() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/EncodingObserver.php
type Swift_Mime_EncodingObserver (line 16) | interface Swift_Mime_EncodingObserver{
method encoderChanged (line 22) | public function encoderChanged(Swift_Mime_ContentEncoder $encoder);
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/Grammar.php
class Swift_Mime_Grammar (line 17) | class Swift_Mime_Grammar{
method __construct (line 35) | public function __construct() {
method __wakeup (line 39) | public function __wakeup() {
method init (line 43) | protected function init() {
method getDefinition (line 124) | public function getDefinition($name) {
method getGrammarDefinitions (line 139) | public function getGrammarDefinitions() {
method getSpecials (line 148) | public function getSpecials() {
method escapeSpecials (line 161) | public function escapeSpecials($token, $include = array(), $exclude = ...
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/Header.php
type Swift_Mime_Header (line 16) | interface Swift_Mime_Header{
method getFieldType (line 43) | public function getFieldType();
method setFieldBodyModel (line 52) | public function setFieldBodyModel($model);
method setCharset (line 59) | public function setCharset($charset);
method getFieldBodyModel (line 68) | public function getFieldBodyModel();
method getFieldName (line 77) | public function getFieldName();
method getFieldBody (line 84) | public function getFieldBody();
method toString (line 91) | public function toString();
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder.php
type Swift_Mime_HeaderEncoder (line 16) | interface Swift_Mime_HeaderEncoder extends Swift_Encoder{
method getName (line 22) | public function getName();
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/Base64HeaderEncoder.php
class Swift_Mime_HeaderEncoder_Base64HeaderEncoder (line 16) | class Swift_Mime_HeaderEncoder_Base64HeaderEncoder extends Swift_Encoder...
method getName (line 23) | public function getName() {
method encodeString (line 40) | public function encodeString($string, $firstLineOffset = 0, $maxLineLe...
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php
class Swift_Mime_HeaderEncoder_QpHeaderEncoder (line 16) | class Swift_Mime_HeaderEncoder_QpHeaderEncoder extends Swift_Encoder_QpE...
method __construct (line 22) | public function __construct(Swift_CharacterStream $charStream) {
method initSafeMap (line 26) | protected function initSafeMap() {
method getName (line 42) | public function getName() {
method encodeString (line 55) | public function encodeString($string, $firstLineOffset = 0, $maxLineLe...
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/HeaderFactory.php
type Swift_Mime_HeaderFactory (line 16) | interface Swift_Mime_HeaderFactory extends Swift_Mime_CharsetObserver{
method createMailboxHeader (line 25) | public function createMailboxHeader($name, $addresses = null);
method createDateHeader (line 35) | public function createDateHeader($name, $timestamp = null);
method createTextHeader (line 45) | public function createTextHeader($name, $value = null);
method createParameterizedHeader (line 56) | public function createParameterizedHeader($name, $value = null, $param...
method createIdHeader (line 66) | public function createIdHeader($name, $ids = null);
method createPathHeader (line 76) | public function createPathHeader($name, $path = null);
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/HeaderSet.php
type Swift_Mime_HeaderSet (line 16) | interface Swift_Mime_HeaderSet extends Swift_Mime_CharsetObserver{
method addMailboxHeader (line 23) | public function addMailboxHeader($name, $addresses = null);
method addDateHeader (line 31) | public function addDateHeader($name, $timestamp = null);
method addTextHeader (line 39) | public function addTextHeader($name, $value = null);
method addParameterizedHeader (line 48) | public function addParameterizedHeader($name, $value = null, $params =...
method addIdHeader (line 56) | public function addIdHeader($name, $ids = null);
method addPathHeader (line 64) | public function addPathHeader($name, $path = null);
method has (line 76) | public function has($name, $index = 0);
method set (line 90) | public function set(Swift_Mime_Header $header, $index = 0);
method get (line 102) | public function get($name, $index = 0);
method getAll (line 111) | public function getAll($name = null);
method listAll (line 118) | public function listAll();
method remove (line 128) | public function remove($name, $index = 0);
method removeAll (line 135) | public function removeAll($name);
method newInstance (line 142) | public function newInstance();
method defineOrdering (line 151) | public function defineOrdering(array $sequence);
method setAlwaysDisplayed (line 160) | public function setAlwaysDisplayed(array $names);
method toString (line 167) | public function toString();
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/Headers/AbstractHeader.php
class Swift_Mime_Headers_AbstractHeader (line 16) | abstract class Swift_Mime_Headers_AbstractHeader implements Swift_Mime_H...
method __construct (line 71) | public function __construct(Swift_Mime_Grammar $grammar) {
method setCharset (line 80) | public function setCharset($charset) {
method getCharset (line 93) | public function getCharset() {
method setLanguage (line 105) | public function setLanguage($lang) {
method getLanguage (line 115) | public function getLanguage() {
method setEncoder (line 124) | public function setEncoder(Swift_Mime_HeaderEncoder $encoder) {
method getEncoder (line 134) | public function getEncoder() {
method setGrammar (line 143) | public function setGrammar(Swift_Mime_Grammar $grammar) {
method getGrammar (line 153) | public function getGrammar() {
method getFieldName (line 162) | public function getFieldName() {
method setMaxLineLength (line 171) | public function setMaxLineLength($lineLength) {
method getMaxLineLength (line 181) | public function getMaxLineLength() {
method toString (line 192) | public function toString() {
method __toString (line 203) | public function __toString() {
method setFieldName (line 214) | protected function setFieldName($name) {
method createPhrase (line 229) | protected function createPhrase(Swift_Mime_Header $header, $string, $c...
method encodeWords (line 265) | protected function encodeWords(Swift_Mime_Header $header, $input, $use...
method tokenNeedsEncoding (line 303) | protected function tokenNeedsEncoding($token) {
method getEncodableWordTokens (line 314) | protected function getEncodableWordTokens($string) {
method getTokenAsEncodedWord (line 345) | protected function getTokenAsEncodedWord($token, $firstLineOffset = 0) {
method generateTokenLines (line 385) | protected function generateTokenLines($token) {
method setCachedValue (line 394) | protected function setCachedValue($value) {
method getCachedValue (line 403) | protected function getCachedValue() {
method clearCachedValueIf (line 412) | protected function clearCachedValueIf($condition) {
method toTokens (line 425) | protected function toTokens($string = null) {
method _tokensToString (line 451) | private function _tokensToString(array $tokens) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/Headers/DateHeader.php
class Swift_Mime_Headers_DateHeader (line 16) | class Swift_Mime_Headers_DateHeader extends Swift_Mime_Headers_AbstractH...
method __construct (line 37) | public function __construct($name, Swift_Mime_Grammar $grammar) {
method getFieldType (line 50) | public function getFieldType() {
method setFieldBodyModel (line 61) | public function setFieldBodyModel($model) {
method getFieldBodyModel (line 72) | public function getFieldBodyModel() {
method getTimestamp (line 81) | public function getTimestamp() {
method setTimestamp (line 90) | public function setTimestamp($timestamp) {
method getFieldBody (line 108) | public function getFieldBody() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/Headers/IdentificationHeader.php
class Swift_Mime_Headers_IdentificationHeader (line 16) | class Swift_Mime_Headers_IdentificationHeader extends Swift_Mime_Headers...
method __construct (line 32) | public function __construct($name, Swift_Mime_Grammar $grammar) {
method getFieldType (line 45) | public function getFieldType() {
method setFieldBodyModel (line 58) | public function setFieldBodyModel($model) {
method getFieldBodyModel (line 69) | public function getFieldBodyModel() {
method setId (line 80) | public function setId($id) {
method getId (line 91) | public function getId() {
method setIds (line 104) | public function setIds(array $ids) {
method getIds (line 121) | public function getIds() {
method getFieldBody (line 137) | public function getFieldBody() {
method _assertValidId (line 158) | private function _assertValidId($id) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php
class Swift_Mime_Headers_MailboxHeader (line 16) | class Swift_Mime_Headers_MailboxHeader extends Swift_Mime_Headers_Abstra...
method __construct (line 31) | public function __construct($name, Swift_Mime_HeaderEncoder $encoder, ...
method getFieldType (line 45) | public function getFieldType() {
method setFieldBodyModel (line 58) | public function setFieldBodyModel($model) {
method getFieldBodyModel (line 71) | public function getFieldBodyModel() {
method setNameAddresses (line 99) | public function setNameAddresses($mailboxes) {
method getNameAddressStrings (line 129) | public function getNameAddressStrings() {
method getNameAddresses (line 157) | public function getNameAddresses() {
method setAddresses (line 181) | public function setAddresses($addresses) {
method getAddresses (line 192) | public function getAddresses() {
method removeAddresses (line 201) | public function removeAddresses($addresses) {
method getFieldBody (line 220) | public function getFieldBody() {
method normalizeMailboxes (line 238) | protected function normalizeMailboxes(array $mailboxes) {
method createDisplayNameString (line 265) | protected function createDisplayNameString($displayName, $shorten = fa...
method createMailboxListString (line 280) | protected function createMailboxListString(array $mailboxes) {
method tokenNeedsEncoding (line 294) | protected function tokenNeedsEncoding($token) {
method _createNameAddressStrings (line 305) | private function _createNameAddressStrings(array $mailboxes) {
method _assertValidAddress (line 327) | private function _assertValidAddress($address) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/Headers/OpenDKIMHeader.php
class Swift_Mime_Headers_OpenDKIMHeader (line 16) | class Swift_Mime_Headers_OpenDKIMHeader implements Swift_Mime_Header{
method __construct (line 38) | public function __construct($name) {
method getFieldType (line 50) | public function getFieldType() {
method setFieldBodyModel (line 61) | public function setFieldBodyModel($model) {
method getFieldBodyModel (line 72) | public function getFieldBodyModel() {
method getValue (line 81) | public function getValue() {
method setValue (line 90) | public function setValue($value) {
method getFieldBody (line 99) | public function getFieldBody() {
method toString (line 108) | public function toString() {
method getFieldName (line 117) | public function getFieldName() {
method setCharset (line 124) | public function setCharset($charset) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php
class Swift_Mime_Headers_ParameterizedHeader (line 16) | class Swift_Mime_Headers_ParameterizedHeader extends Swift_Mime_Headers_...
method __construct (line 46) | public function __construct($name, Swift_Mime_HeaderEncoder $encoder, ...
method getFieldType (line 59) | public function getFieldType() {
method setCharset (line 68) | public function setCharset($charset) {
method setParameter (line 81) | public function setParameter($parameter, $value) {
method getParameter (line 92) | public function getParameter($parameter) {
method setParameters (line 103) | public function setParameters(array $parameters) {
method getParameters (line 113) | public function getParameters() {
method getFieldBody (line 122) | public function getFieldBody() { //TODO: Check caching here
method toTokens (line 144) | protected function toTokens($string = null) {
method _createParameter (line 169) | private function _createParameter($name, $value) {
method _getEndOfParameterValue (line 231) | private function _getEndOfParameterValue($value, $encoded = false, $fi...
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/Headers/PathHeader.php
class Swift_Mime_Headers_PathHeader (line 16) | class Swift_Mime_Headers_PathHeader extends Swift_Mime_Headers_AbstractH...
method __construct (line 30) | public function __construct($name, Swift_Mime_Grammar $grammar) {
method getFieldType (line 43) | public function getFieldType() {
method setFieldBodyModel (line 55) | public function setFieldBodyModel($model) {
method getFieldBodyModel (line 65) | public function getFieldBodyModel() {
method setAddress (line 76) | public function setAddress($address) {
method getAddress (line 95) | public function getAddress() {
method getFieldBody (line 109) | public function getFieldBody() {
method _assertValidAddress (line 126) | private function _assertValidAddress($address) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/Headers/UnstructuredHeader.php
class Swift_Mime_Headers_UnstructuredHeader (line 16) | class Swift_Mime_Headers_UnstructuredHeader extends Swift_Mime_Headers_A...
method __construct (line 31) | public function __construct($name, Swift_Mime_HeaderEncoder $encoder, ...
method getFieldType (line 45) | public function getFieldType() {
method setFieldBodyModel (line 56) | public function setFieldBodyModel($model) {
method getFieldBodyModel (line 67) | public function getFieldBodyModel() {
method getValue (line 76) | public function getValue() {
method setValue (line 85) | public function setValue($value) {
method getFieldBody (line 95) | public function getFieldBody() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/Message.php
type Swift_Mime_Message (line 16) | interface Swift_Mime_Message extends Swift_Mime_MimeEntity{
method generateId (line 22) | public function generateId();
method setSubject (line 29) | public function setSubject($subject);
method getSubject (line 36) | public function getSubject();
method setDate (line 43) | public function setDate($date);
method getDate (line 50) | public function getDate();
method setReturnPath (line 57) | public function setReturnPath($address);
method getReturnPath (line 64) | public function getReturnPath();
method setSender (line 83) | public function setSender($address, $name = null);
method getSender (line 92) | public function getSender();
method setFrom (line 111) | public function setFrom($addresses, $name = null);
method getFrom (line 121) | public function getFrom();
method setReplyTo (line 138) | public function setReplyTo($addresses, $name = null);
method getReplyTo (line 148) | public function getReplyTo();
method setTo (line 163) | public function setTo($addresses, $name = null);
method getTo (line 173) | public function getTo();
method setCc (line 185) | public function setCc($addresses, $name = null);
method getCc (line 195) | public function getCc();
method setBcc (line 211) | public function setBcc($addresses, $name = null);
method getBcc (line 221) | public function getBcc();
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/MimeEntity.php
type Swift_Mime_MimeEntity (line 16) | interface Swift_Mime_MimeEntity extends Swift_Mime_CharsetObserver, Swif...
method getNestingLevel (line 38) | public function getNestingLevel();
method getContentType (line 45) | public function getContentType();
method getId (line 59) | public function getId();
method getChildren (line 68) | public function getChildren();
method setChildren (line 77) | public function setChildren(array $children);
method getHeaders (line 84) | public function getHeaders();
method getBody (line 93) | public function getBody();
method setBody (line 101) | public function setBody($body, $contentType = null);
method toString (line 108) | public function toString();
method toByteStream (line 115) | public function toByteStream(Swift_InputByteStream $is);
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/MimePart.php
class Swift_Mime_MimePart (line 16) | class Swift_Mime_MimePart extends Swift_Mime_SimpleMimeEntity{
method __construct (line 38) | public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_...
method setBody (line 56) | public function setBody($body, $contentType = null, $charset = null) {
method getCharset (line 72) | public function getCharset() {
method setCharset (line 83) | public function setCharset($charset) {
method getFormat (line 99) | public function getFormat() {
method setFormat (line 110) | public function setFormat($format) {
method getDelSp (line 122) | public function getDelSp() {
method setDelSp (line 133) | public function setDelSp($delsp = true) {
method getNestingLevel (line 147) | public function getNestingLevel() {
method charsetChanged (line 157) | public function charsetChanged($charset) {
method _fixHeaders (line 162) | protected function _fixHeaders() {
method _setNestingLevel (line 176) | protected function _setNestingLevel($level) {
method _convertString (line 181) | protected function _convertString($string) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/ParameterizedHeader.php
type Swift_Mime_ParameterizedHeader (line 16) | interface Swift_Mime_ParameterizedHeader extends Swift_Mime_Header{
method setParameter (line 23) | public function setParameter($parameter, $value);
method getParameter (line 32) | public function getParameter($parameter);
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderFactory.php
class Swift_Mime_SimpleHeaderFactory (line 16) | class Swift_Mime_SimpleHeaderFactory implements Swift_Mime_HeaderFactory{
method __construct (line 37) | public function __construct(Swift_Mime_HeaderEncoder $encoder, Swift_E...
method createMailboxHeader (line 52) | public function createMailboxHeader($name, $addresses = null) {
method createDateHeader (line 70) | public function createDateHeader($name, $timestamp = null) {
method createTextHeader (line 88) | public function createTextHeader($name, $value = null) {
method createParameterizedHeader (line 107) | public function createParameterizedHeader($name, $value = null,
method createIdHeader (line 129) | public function createIdHeader($name, $ids = null) {
method createPathHeader (line 147) | public function createPathHeader($name, $path = null) {
method charsetChanged (line 162) | public function charsetChanged($charset) {
method __clone (line 171) | public function __clone() {
method _setHeaderCharset (line 177) | private function _setHeaderCharset(Swift_Mime_Header $header) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php
class Swift_Mime_SimpleHeaderSet (line 16) | class Swift_Mime_SimpleHeaderSet implements Swift_Mime_HeaderSet{
method __construct (line 38) | public function __construct(Swift_Mime_HeaderFactory $factory, $charse...
method setCharset (line 50) | public function setCharset($charset) {
method addMailboxHeader (line 62) | public function addMailboxHeader($name, $addresses = null) {
method addDateHeader (line 73) | public function addDateHeader($name, $timestamp = null) {
method addTextHeader (line 84) | public function addTextHeader($name, $value = null) {
method addParameterizedHeader (line 96) | public function addParameterizedHeader($name, $value = null, $params =...
method addIdHeader (line 106) | public function addIdHeader($name, $ids = null) {
method addPathHeader (line 116) | public function addPathHeader($name, $path = null) {
method has (line 130) | public function has($name, $index = 0) {
method set (line 148) | public function set(Swift_Mime_Header $header, $index = 0) {
method get (line 163) | public function get($name, $index = 0) {
method getAll (line 178) | public function getAll($name = null) {
method listAll (line 201) | public function listAll() {
method remove (line 218) | public function remove($name, $index = 0) {
method removeAll (line 228) | public function removeAll($name) {
method newInstance (line 238) | public function newInstance() {
method defineOrdering (line 249) | public function defineOrdering(array $sequence) {
method setAlwaysDisplayed (line 260) | public function setAlwaysDisplayed(array $names) {
method charsetChanged (line 269) | public function charsetChanged($charset) {
method toString (line 278) | public function toString() {
method __toString (line 302) | public function __toString() {
method _storeHeader (line 307) | private function _storeHeader($name, Swift_Mime_Header $header, $offse...
method _canSort (line 319) | private function _canSort() {
method _sortHeaders (line 324) | private function _sortHeaders($a, $b) {
method _isDisplayed (line 345) | private function _isDisplayed(Swift_Mime_Header $header) {
method _notifyHeadersOfCharset (line 350) | private function _notifyHeadersOfCharset($charset) {
method __clone (line 361) | public function __clone() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php
class Swift_Mime_SimpleMessage (line 16) | class Swift_Mime_SimpleMessage extends Swift_Mime_MimePart implements Sw...
method __construct (line 26) | public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_...
method getNestingLevel (line 58) | public function getNestingLevel() {
method setSubject (line 69) | public function setSubject($subject) {
method getSubject (line 82) | public function getSubject() {
method setDate (line 93) | public function setDate($date) {
method getDate (line 106) | public function getDate() {
method setReturnPath (line 117) | public function setReturnPath($address) {
method getReturnPath (line 130) | public function getReturnPath() {
method setSender (line 144) | public function setSender($address, $name = null) {
method getSender (line 161) | public function getSender() {
method addFrom (line 175) | public function addFrom($address, $name = null) {
method setFrom (line 195) | public function setFrom($addresses, $name = null) {
method getFrom (line 212) | public function getFrom() {
method addReplyTo (line 226) | public function addReplyTo($address, $name = null) {
method setReplyTo (line 246) | public function setReplyTo($addresses, $name = null) {
method getReplyTo (line 263) | public function getReplyTo() {
method addTo (line 277) | public function addTo($address, $name = null) {
method setTo (line 298) | public function setTo($addresses, $name = null) {
method getTo (line 315) | public function getTo() {
method addCc (line 329) | public function addCc($address, $name = null) {
method setCc (line 347) | public function setCc($addresses, $name = null) {
method getCc (line 364) | public function getCc() {
method addBcc (line 378) | public function addBcc($address, $name = null) {
method setBcc (line 396) | public function setBcc($addresses, $name = null) {
method getBcc (line 413) | public function getBcc() {
method setPriority (line 426) | public function setPriority($priority) {
method getPriority (line 457) | public function getPriority() {
method setReadReceiptTo (line 472) | public function setReadReceiptTo($addresses) {
method getReadReceiptTo (line 486) | public function getReadReceiptTo() {
method attach (line 497) | public function attach(Swift_Mime_MimeEntity $entity) {
method detach (line 510) | public function detach(Swift_Mime_MimeEntity $entity) {
method embed (line 530) | public function embed(Swift_Mime_MimeEntity $entity) {
method toString (line 541) | public function toString() {
method __toString (line 560) | public function __toString() {
method toByteStream (line 569) | public function toByteStream(Swift_InputByteStream $is) {
method _getIdField (line 580) | protected function _getIdField() {
method _becomeMimePart (line 585) | protected function _becomeMimePart() {
method _getTopNestingLevel (line 599) | private function _getTopNestingLevel() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Mime/SimpleMimeEntity.php
class Swift_Mime_SimpleMimeEntity (line 16) | class Swift_Mime_SimpleMimeEntity implements Swift_Mime_MimeEntity{
method __construct (line 80) | public function __construct(Swift_Mime_HeaderSet $headers, Swift_Mime_...
method generateId (line 118) | public function generateId() {
method getHeaders (line 129) | public function getHeaders() {
method getNestingLevel (line 140) | public function getNestingLevel() {
method getContentType (line 149) | public function getContentType() {
method setContentType (line 160) | public function setContentType($type) {
method getId (line 176) | public function getId() {
method setId (line 189) | public function setId($id) {
method getDescription (line 205) | public function getDescription() {
method setDescription (line 218) | public function setDescription($description) {
method getMaxLineLength (line 231) | public function getMaxLineLength() {
method setMaxLineLength (line 244) | public function setMaxLineLength($length) {
method getChildren (line 255) | public function getChildren() {
method setChildren (line 267) | public function setChildren(array $children, $compoundLevel = null) {
method getBody (line 331) | public function getBody() {
method setBody (line 344) | public function setBody($body, $contentType = null) {
method getEncoder (line 362) | public function getEncoder() {
method setEncoder (line 373) | public function setEncoder(Swift_Mime_ContentEncoder $encoder) {
method getBoundary (line 390) | public function getBoundary() {
method setBoundary (line 407) | public function setBoundary($boundary) {
method charsetChanged (line 420) | public function charsetChanged($charset) {
method encoderChanged (line 430) | public function encoderChanged(Swift_Mime_ContentEncoder $encoder) {
method toString (line 439) | public function toString() {
method _bodyToString (line 451) | protected function _bodyToString() {
method __toString (line 482) | public function __toString() {
method toByteStream (line 491) | public function toByteStream(Swift_InputByteStream $is) {
method _bodyToByteStream (line 503) | protected function _bodyToByteStream(Swift_InputByteStream $is) {
method _getIdField (line 543) | protected function _getIdField() {
method _getHeaderFieldModel (line 550) | protected function _getHeaderFieldModel($field) {
method _setHeaderFieldModel (line 559) | protected function _setHeaderFieldModel($field, $model) {
method _getHeaderParameter (line 572) | protected function _getHeaderParameter($field, $parameter) {
method _setHeaderParameter (line 581) | protected function _setHeaderParameter($field, $parameter, $value) {
method _fixHeaders (line 594) | protected function _fixHeaders() {
method _getCache (line 611) | protected function _getCache() {
method _getGrammar (line 620) | protected function _getGrammar() {
method _clearCache (line 627) | protected function _clearCache() {
method getRandomId (line 636) | protected function getRandomId() {
method _readStream (line 650) | private function _readStream(Swift_OutputByteStream $os) {
method _setEncoding (line 661) | private function _setEncoding($encoding) {
method _assertValidBoundary (line 667) | private function _assertValidBoundary($boundary) {
method _setContentTypeInHeaders (line 673) | private function _setContentTypeInHeaders($type) {
method _setNestingLevel (line 679) | private function _setNestingLevel($level) {
method _getCompoundLevel (line 683) | private function _getCompoundLevel($children) {
method _getNeededChildLevel (line 692) | private function _getNeededChildLevel($child, $compoundLevel) {
method _createChild (line 710) | private function _createChild() {
method _notifyEncoderChanged (line 714) | private function _notifyEncoderChanged(Swift_Mime_ContentEncoder $enco...
method _notifyCharsetChanged (line 720) | private function _notifyCharsetChanged($charset) {
method _sortChildren (line 728) | private function _sortChildren() {
method _childSortAlgorithm (line 744) | private function _childSortAlgorithm($a, $b) {
method __destruct (line 760) | public function __destruct() {
method _assertValidId (line 771) | private function _assertValidId($id) {
method __clone (line 780) | public function __clone() {
FILE: website/lib/swiftmailer/lib/classes/Swift/MimePart.php
class Swift_MimePart (line 16) | class Swift_MimePart extends Swift_Mime_MimePart{
method __construct (line 26) | public function __construct($body = null, $contentType = null, $charse...
method newInstance (line 53) | public static function newInstance($body = null, $contentType = null, ...
FILE: website/lib/swiftmailer/lib/classes/Swift/NullTransport.php
class Swift_NullTransport (line 16) | class Swift_NullTransport extends Swift_Transport_NullTransport{
method __construct (line 20) | public function __construct() {
method newInstance (line 33) | public static function newInstance() {
FILE: website/lib/swiftmailer/lib/classes/Swift/OutputByteStream.php
type Swift_OutputByteStream (line 19) | interface Swift_OutputByteStream{
method read (line 33) | public function read($length);
method setReadPointer (line 44) | public function setReadPointer($byteOffset);
FILE: website/lib/swiftmailer/lib/classes/Swift/Plugins/AntiFloodPlugin.php
class Swift_Plugins_AntiFloodPlugin (line 16) | class Swift_Plugins_AntiFloodPlugin implements Swift_Events_SendListener...
method __construct (line 52) | public function __construct($threshold = 99, $sleep = 0, Swift_Plugins...
method setThreshold (line 63) | public function setThreshold($threshold) {
method getThreshold (line 72) | public function getThreshold() {
method setSleepTime (line 81) | public function setSleepTime($sleep) {
method getSleepTime (line 90) | public function getSleepTime() {
method beforeSendPerformed (line 99) | public function beforeSendPerformed(Swift_Events_SendEvent $evt) {
method sendPerformed (line 107) | public function sendPerformed(Swift_Events_SendEvent $evt) {
method sleep (line 125) | public function sleep($seconds) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Plugins/BandwidthMonitorPlugin.php
class Swift_Plugins_BandwidthMonitorPlugin (line 16) | class Swift_Plugins_BandwidthMonitorPlugin implements Swift_Events_SendL...
method beforeSendPerformed (line 37) | public function beforeSendPerformed(Swift_Events_SendEvent $evt) {
method sendPerformed (line 45) | public function sendPerformed(Swift_Events_SendEvent $evt) {
method commandSent (line 55) | public function commandSent(Swift_Events_CommandEvent $evt) {
method responseReceived (line 65) | public function responseReceived(Swift_Events_ResponseEvent $evt) {
method write (line 75) | public function write($bytes) {
method commit (line 85) | public function commit() {
method bind (line 96) | public function bind(Swift_InputByteStream $is) {
method unbind (line 109) | public function unbind(Swift_InputByteStream $is) {
method flushBuffers (line 120) | public function flushBuffers() {
method getBytesOut (line 131) | public function getBytesOut() {
method getBytesIn (line 140) | public function getBytesIn() {
method reset (line 147) | public function reset() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Plugins/Decorator/Replacements.php
type Swift_Plugins_Decorator_Replacements (line 16) | interface Swift_Plugins_Decorator_Replacements{
method getReplacementsFor (line 29) | public function getReplacementsFor($address);
FILE: website/lib/swiftmailer/lib/classes/Swift/Plugins/DecoratorPlugin.php
class Swift_Plugins_DecoratorPlugin (line 17) | class Swift_Plugins_DecoratorPlugin implements Swift_Events_SendListener...
method __construct (line 53) | public function __construct($replacements) {
method setReplacements (line 64) | public function setReplacements($replacements) {
method beforeSendPerformed (line 77) | public function beforeSendPerformed(Swift_Events_SendEvent $evt) {
method getReplacementsFor (line 152) | public function getReplacementsFor($address) {
method sendPerformed (line 165) | public function sendPerformed(Swift_Events_SendEvent $evt) {
method _restoreMessage (line 170) | private function _restoreMessage(Swift_Mime_Message $message) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Plugins/ImpersonatePlugin.php
class Swift_Plugins_ImpersonatePlugin (line 16) | class Swift_Plugins_ImpersonatePlugin implements Swift_Events_SendListener{
method __construct (line 29) | public function __construct($sender) {
method beforeSendPerformed (line 38) | public function beforeSendPerformed(Swift_Events_SendEvent $evt) {
method sendPerformed (line 54) | public function sendPerformed(Swift_Events_SendEvent $evt) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Plugins/Logger.php
type Swift_Plugins_Logger (line 16) | interface Swift_Plugins_Logger{
method add (line 22) | public function add($entry);
method clear (line 27) | public function clear();
method dump (line 34) | public function dump();
FILE: website/lib/swiftmailer/lib/classes/Swift/Plugins/LoggerPlugin.php
class Swift_Plugins_LoggerPlugin (line 16) | class Swift_Plugins_LoggerPlugin implements Swift_Events_CommandListener...
method __construct (line 25) | public function __construct(Swift_Plugins_Logger $logger) {
method add (line 34) | public function add($entry) {
method clear (line 41) | public function clear() {
method dump (line 50) | public function dump() {
method commandSent (line 59) | public function commandSent(Swift_Events_CommandEvent $evt) {
method responseReceived (line 69) | public function responseReceived(Swift_Events_ResponseEvent $evt) {
method beforeTransportStarted (line 79) | public function beforeTransportStarted(Swift_Events_TransportChangeEve...
method transportStarted (line 89) | public function transportStarted(Swift_Events_TransportChangeEvent $ev...
method beforeTransportStopped (line 99) | public function beforeTransportStopped(Swift_Events_TransportChangeEve...
method transportStopped (line 109) | public function transportStopped(Swift_Events_TransportChangeEvent $ev...
method exceptionThrown (line 119) | public function exceptionThrown(Swift_Events_TransportExceptionEvent $...
FILE: website/lib/swiftmailer/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php
class Swift_Plugins_Loggers_ArrayLogger (line 16) | class Swift_Plugins_Loggers_ArrayLogger implements Swift_Plugins_Logger{
method __construct (line 36) | public function __construct($size = 50) {
method add (line 45) | public function add($entry) {
method clear (line 55) | public function clear() {
method dump (line 64) | public function dump() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Plugins/Loggers/EchoLogger.php
class Swift_Plugins_Loggers_EchoLogger (line 16) | class Swift_Plugins_Loggers_EchoLogger implements Swift_Plugins_Logger{
method __construct (line 25) | public function __construct($isHtml = true) {
method add (line 34) | public function add($entry) {
method clear (line 45) | public function clear() {
method dump (line 51) | public function dump() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Plugins/MessageLogger.php
class Swift_Plugins_MessageLogger (line 16) | class Swift_Plugins_MessageLogger implements Swift_Events_SendListener{
method __construct (line 22) | public function __construct() {
method getMessages (line 31) | public function getMessages() {
method countMessages (line 40) | public function countMessages() {
method clear (line 47) | public function clear() {
method beforeSendPerformed (line 56) | public function beforeSendPerformed(Swift_Events_SendEvent $evt) {
method sendPerformed (line 65) | public function sendPerformed(Swift_Events_SendEvent $evt) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Plugins/Pop/Pop3Connection.php
type Swift_Plugins_Pop_Pop3Connection (line 16) | interface Swift_Plugins_Pop_Pop3Connection{
method connect (line 22) | public function connect();
method disconnect (line 29) | public function disconnect();
FILE: website/lib/swiftmailer/lib/classes/Swift/Plugins/Pop/Pop3Exception.php
class Swift_Plugins_Pop_Pop3Exception (line 16) | class Swift_Plugins_Pop_Pop3Exception extends Swift_IoException{
method __construct (line 22) | public function __construct($message) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Plugins/PopBeforeSmtpPlugin.php
class Swift_Plugins_PopBeforeSmtpPlugin (line 16) | class Swift_Plugins_PopBeforeSmtpPlugin implements Swift_Events_Transpor...
method __construct (line 51) | public function __construct($host, $port = 110, $crypto = null) {
method newInstance (line 66) | public static function newInstance($host, $port = 110, $crypto = null) {
method setConnection (line 77) | public function setConnection(Swift_Plugins_Pop_Pop3Connection $connec...
method bindSmtp (line 88) | public function bindSmtp(Swift_Transport $smtp) {
method setTimeout (line 99) | public function setTimeout($timeout) {
method setUsername (line 112) | public function setUsername($username) {
method setPassword (line 125) | public function setPassword($password) {
method connect (line 136) | public function connect() {
method disconnect (line 168) | public function disconnect() {
method beforeTransportStarted (line 187) | public function beforeTransportStarted(Swift_Events_TransportChangeEve...
method transportStarted (line 201) | public function transportStarted(Swift_Events_TransportChangeEvent $ev...
method beforeTransportStopped (line 207) | public function beforeTransportStopped(Swift_Events_TransportChangeEve...
method transportStopped (line 213) | public function transportStopped(Swift_Events_TransportChangeEvent $ev...
method _command (line 216) | private function _command($command) {
method _assertOk (line 234) | private function _assertOk($response) {
method _getHostString (line 242) | private function _getHostString() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Plugins/RedirectingPlugin.php
class Swift_Plugins_RedirectingPlugin (line 16) | class Swift_Plugins_RedirectingPlugin implements Swift_Events_SendListener{
method __construct (line 37) | public function __construct($recipient, array $whitelist = array()) {
method setRecipient (line 47) | public function setRecipient($recipient) {
method getRecipient (line 56) | public function getRecipient() {
method setWhitelist (line 65) | public function setWhitelist(array $whitelist) {
method getWhitelist (line 74) | public function getWhitelist() {
method beforeSendPerformed (line 83) | public function beforeSendPerformed(Swift_Events_SendEvent $evt) {
method _filterHeaderSet (line 125) | private function _filterHeaderSet(Swift_Mime_HeaderSet $headerSet, $ty...
method _filterNameAddresses (line 138) | private function _filterNameAddresses(array $recipients) {
method _isWhitelisted (line 157) | protected function _isWhitelisted($recipient) {
method sendPerformed (line 176) | public function sendPerformed(Swift_Events_SendEvent $evt) {
method _restoreMessage (line 180) | private function _restoreMessage(Swift_Mime_Message $message) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Plugins/Reporter.php
type Swift_Plugins_Reporter (line 16) | interface Swift_Plugins_Reporter{
method notify (line 30) | public function notify(Swift_Mime_Message $message, $address, $result);
FILE: website/lib/swiftmailer/lib/classes/Swift/Plugins/ReporterPlugin.php
class Swift_Plugins_ReporterPlugin (line 16) | class Swift_Plugins_ReporterPlugin implements Swift_Events_SendListener{
method __construct (line 29) | public function __construct(Swift_Plugins_Reporter $reporter) {
method beforeSendPerformed (line 36) | public function beforeSendPerformed(Swift_Events_SendEvent $evt) {
method sendPerformed (line 44) | public function sendPerformed(Swift_Events_SendEvent $evt) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Plugins/Reporters/HitReporter.php
class Swift_Plugins_Reporters_HitReporter (line 16) | class Swift_Plugins_Reporters_HitReporter implements Swift_Plugins_Repor...
method notify (line 33) | public function notify(Swift_Mime_Message $message, $address, $result) {
method getFailedRecipients (line 45) | public function getFailedRecipients() {
method clear (line 52) | public function clear() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Plugins/Reporters/HtmlReporter.php
class Swift_Plugins_Reporters_HtmlReporter (line 16) | class Swift_Plugins_Reporters_HtmlReporter implements Swift_Plugins_Repo...
method notify (line 24) | public function notify(Swift_Mime_Message $message, $address, $result) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Plugins/Sleeper.php
type Swift_Plugins_Sleeper (line 16) | interface Swift_Plugins_Sleeper{
method sleep (line 22) | public function sleep($seconds);
FILE: website/lib/swiftmailer/lib/classes/Swift/Plugins/ThrottlerPlugin.php
class Swift_Plugins_ThrottlerPlugin (line 16) | class Swift_Plugins_ThrottlerPlugin extends Swift_Plugins_BandwidthMonit...
method __construct (line 78) | public function __construct($rate, $mode = self::BYTES_PER_MINUTE, Swi...
method beforeSendPerformed (line 90) | public function beforeSendPerformed(Swift_Events_SendEvent $evt) {
method sendPerformed (line 122) | public function sendPerformed(Swift_Events_SendEvent $evt) {
method sleep (line 132) | public function sleep($seconds) {
method getTimestamp (line 145) | public function getTimestamp() {
method _throttleBytesPerMinute (line 160) | private function _throttleBytesPerMinute($timePassed) {
method _throttleMessagesPerSecond (line 173) | private function _throttleMessagesPerSecond($timePassed) {
method _throttleMessagesPerMinute (line 186) | private function _throttleMessagesPerMinute($timePassed) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Plugins/Timer.php
type Swift_Plugins_Timer (line 16) | interface Swift_Plugins_Timer{
method getTimestamp (line 22) | public function getTimestamp();
FILE: website/lib/swiftmailer/lib/classes/Swift/Preferences.php
class Swift_Preferences (line 16) | class Swift_Preferences{
method __construct (line 21) | private function __construct() {
method getInstance (line 29) | public static function getInstance() {
method setCharset (line 44) | public function setCharset($charset) {
method setTempDir (line 58) | public function setTempDir($dir) {
method setCacheType (line 72) | public function setCacheType($type) {
method setQPDotEscape (line 86) | public function setQPDotEscape($dotEscape) {
FILE: website/lib/swiftmailer/lib/classes/Swift/ReplacementFilterFactory.php
type Swift_ReplacementFilterFactory (line 16) | interface Swift_ReplacementFilterFactory{
method createFilter (line 25) | public function createFilter($search, $replace);
FILE: website/lib/swiftmailer/lib/classes/Swift/RfcComplianceException.php
class Swift_RfcComplianceException (line 16) | class Swift_RfcComplianceException extends Swift_SwiftException{
method __construct (line 22) | public function __construct($message) {
FILE: website/lib/swiftmailer/lib/classes/Swift/SendmailTransport.php
class Swift_SendmailTransport (line 16) | class Swift_SendmailTransport extends Swift_Transport_SendmailTransport{
method __construct (line 22) | public function __construct($command = '/usr/sbin/sendmail -bs') {
method newInstance (line 39) | public static function newInstance($command = '/usr/sbin/sendmail -bs') {
FILE: website/lib/swiftmailer/lib/classes/Swift/SignedMessage.php
class Swift_SignedMessage (line 21) | class Swift_SignedMessage extends Swift_Message{
FILE: website/lib/swiftmailer/lib/classes/Swift/Signer.php
type Swift_Signer (line 17) | interface Swift_Signer{
method reset (line 18) | public function reset();
FILE: website/lib/swiftmailer/lib/classes/Swift/Signers/BodySigner.php
type Swift_Signers_BodySigner (line 16) | interface Swift_Signers_BodySigner extends Swift_Signer{
method signMessage (line 24) | public function signMessage(Swift_Message $message);
method getAlteredHeaders (line 31) | public function getAlteredHeaders();
FILE: website/lib/swiftmailer/lib/classes/Swift/Signers/DKIMSigner.php
class Swift_Signers_DKIMSigner (line 16) | class Swift_Signers_DKIMSigner implements Swift_Signers_HeaderSigner{
method __construct (line 170) | public function __construct($privateKey, $domainName, $selector) {
method newInstance (line 186) | public static function newInstance($privateKey, $domainName, $selector) {
method reset (line 195) | public function reset() {
method write (line 222) | public function write($bytes) {
method commit (line 235) | public function commit() {
method bind (line 247) | public function bind(Swift_InputByteStream $is) {
method unbind (line 262) | public function unbind(Swift_InputByteStream $is) {
method flushBuffers (line 281) | public function flushBuffers() {
method setHashAlgorithm (line 292) | public function setHashAlgorithm($hash) {
method setBodyCanon (line 310) | public function setBodyCanon($canon) {
method setHeaderCanon (line 327) | public function setHeaderCanon($canon) {
method setSignerIdentity (line 344) | public function setSignerIdentity($identity) {
method setBodySignedLen (line 357) | public function setBodySignedLen($len) {
method setSignatureTimestamp (line 379) | public function setSignatureTimestamp($time) {
method setSignatureExpiration (line 392) | public function setSignatureExpiration($time) {
method setDebugHeaders (line 405) | public function setDebugHeaders($debug) {
method startBody (line 414) | public function startBody() {
method endBody (line 430) | public function endBody() {
method getAlteredHeaders (line 439) | public function getAlteredHeaders() {
method ignoreHeader (line 454) | public function ignoreHeader($header_name) {
method setHeaders (line 467) | public function setHeaders(Swift_Mime_HeaderSet $headers) {
method addSignature (line 496) | public function addSignature(Swift_Mime_HeaderSet $headers) {
method _addHeader (line 544) | protected function _addHeader($header, $is_sig = false) {
method _endOfHeaders (line 564) | protected function _endOfHeaders() {
method _canonicalizeBody (line 567) | protected function _canonicalizeBody($string) {
method _endOfBody (line 619) | protected function _endOfBody() {
method _addToBodyHash (line 627) | private function _addToBodyHash($string) {
method _addToHeaderHash (line 637) | private function _addToHeaderHash($header) {
method _getEncryptedHash (line 649) | private function _getEncryptedHash() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Signers/DomainKeySigner.php
class Swift_Signers_DomainKeySigner (line 16) | class Swift_Signers_DomainKeySigner implements Swift_Signers_HeaderSigner{
method __construct (line 118) | public function __construct($privateKey, $domainName, $selector) {
method newInstance (line 134) | public static function newInstance($privateKey, $domainName, $selector) {
method reset (line 143) | public function reset() {
method write (line 171) | public function write($bytes) {
method commit (line 188) | public function commit() {
method bind (line 202) | public function bind(Swift_InputByteStream $is) {
method unbind (line 219) | public function unbind(Swift_InputByteStream $is) {
method flushBuffers (line 240) | public function flushBuffers() {
method setHashAlgorithm (line 253) | public function setHashAlgorithm($hash) {
method setCanon (line 266) | public function setCanon($canon) {
method setSignerIdentity (line 283) | public function setSignerIdentity($identity) {
method setDebugHeaders (line 296) | public function setDebugHeaders($debug) {
method startBody (line 305) | public function startBody() {
method endBody (line 311) | public function endBody() {
method getAlteredHeaders (line 320) | public function getAlteredHeaders() {
method ignoreHeader (line 335) | public function ignoreHeader($header_name) {
method setHeaders (line 348) | public function setHeaders(Swift_Mime_HeaderSet $headers) {
method addSignature (line 379) | public function addSignature(Swift_Mime_HeaderSet $headers) {
method _addHeader (line 394) | protected function _addHeader($header) {
method _endOfHeaders (line 409) | protected function _endOfHeaders() {
method _canonicalizeBody (line 413) | protected function _canonicalizeBody($string) {
method _endOfBody (line 461) | protected function _endOfBody() {
method _addToHash (line 468) | private function _addToHash($string) {
method _startHash (line 473) | private function _startHash() {
method _getEncryptedHash (line 488) | private function _getEncryptedHash() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Signers/HeaderSigner.php
type Swift_Signers_HeaderSigner (line 16) | interface Swift_Signers_HeaderSigner extends Swift_Signer, Swift_InputBy...
method ignoreHeader (line 24) | public function ignoreHeader($header_name);
method startBody (line 31) | public function startBody();
method endBody (line 38) | public function endBody();
method setHeaders (line 47) | public function setHeaders(Swift_Mime_HeaderSet $headers);
method addSignature (line 56) | public function addSignature(Swift_Mime_HeaderSet $headers);
method getAlteredHeaders (line 63) | public function getAlteredHeaders();
FILE: website/lib/swiftmailer/lib/classes/Swift/Signers/OpenDKIMSigner.php
class Swift_Signers_OpenDKIMSigner (line 17) | class Swift_Signers_OpenDKIMSigner extends Swift_Signers_DKIMSigner{
method __construct (line 29) | public function __construct($privateKey, $domainName, $selector) {
method newInstance (line 39) | public static function newInstance($privateKey, $domainName, $selector) {
method addSignature (line 43) | public function addSignature(Swift_Mime_HeaderSet $headers) {
method setHeaders (line 55) | public function setHeaders(Swift_Mime_HeaderSet $headers) {
method startBody (line 97) | public function startBody() {
method endBody (line 107) | public function endBody() {
method reset (line 116) | public function reset() {
method setSignatureTimestamp (line 130) | public function setSignatureTimestamp($time) {
method setSignatureExpiration (line 143) | public function setSignatureExpiration($time) {
method setDebugHeaders (line 156) | public function setDebugHeaders($debug) {
method _canonicalizeBody (line 164) | protected function _canonicalizeBody($string) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Signers/SMimeSigner.php
class Swift_Signers_SMimeSigner (line 18) | class Swift_Signers_SMimeSigner implements Swift_Signers_BodySigner{
method __construct (line 47) | public function __construct($signCertificate = null, $signPrivateKey =...
method newInstance (line 77) | public static function newInstance($certificate = null, $privateKey = ...
method setSignCertificate (line 93) | public function setSignCertificate($certificate, $privateKey = null, $...
method setEncryptCertificate (line 124) | public function setEncryptCertificate($recipientCerts, $cipher = null) {
method getSignCertificate (line 145) | public function getSignCertificate() {
method getSignPrivateKey (line 152) | public function getSignPrivateKey() {
method setSignThenEncrypt (line 167) | public function setSignThenEncrypt($signThenEncrypt = true) {
method isSignThenEncrypt (line 176) | public function isSignThenEncrypt() {
method reset (line 185) | public function reset() {
method signMessage (line 196) | public function signMessage(Swift_Message $message) {
method getAlteredHeaders (line 219) | public function getAlteredHeaders() {
method toSMimeByteStream (line 227) | protected function toSMimeByteStream(Swift_InputByteStream $inputStrea...
method createMessage (line 256) | protected function createMessage(Swift_Message $message) {
method messageStreamToSignedByteStream (line 277) | protected function messageStreamToSignedByteStream(Swift_FileStream $o...
method messageStreamToEncryptedByteStream (line 298) | protected function messageStreamToEncryptedByteStream(Swift_FileStream...
method copyFromOpenSSLOutput (line 312) | protected function copyFromOpenSSLOutput(Swift_OutputByteStream $fromS...
method streamToMime (line 337) | protected function streamToMime(Swift_OutputByteStream $fromStream, Sw...
FILE: website/lib/swiftmailer/lib/classes/Swift/SmtpTransport.php
class Swift_SmtpTransport (line 23) | class Swift_SmtpTransport extends Swift_Transport_EsmtpTransport{
method __construct (line 31) | public function __construct($host = 'localhost', $port = 25, $security...
method newInstance (line 52) | public static function newInstance($host = 'localhost', $port = 25, $s...
FILE: website/lib/swiftmailer/lib/classes/Swift/Spool.php
type Swift_Spool (line 16) | interface Swift_Spool{
method start (line 20) | public function start();
method stop (line 25) | public function stop();
method isStarted (line 32) | public function isStarted();
method queueMessage (line 41) | public function queueMessage(Swift_Mime_Message $message);
method flushQueue (line 51) | public function flushQueue(Swift_Transport $transport, &$failedRecipie...
FILE: website/lib/swiftmailer/lib/classes/Swift/SpoolTransport.php
class Swift_SpoolTransport (line 16) | class Swift_SpoolTransport extends Swift_Transport_SpoolTransport{
method __construct (line 22) | public function __construct(Swift_Spool $spool) {
method newInstance (line 41) | public static function newInstance(Swift_Spool $spool) {
FILE: website/lib/swiftmailer/lib/classes/Swift/StreamFilter.php
type Swift_StreamFilter (line 16) | interface Swift_StreamFilter{
method shouldBuffer (line 24) | public function shouldBuffer($buffer);
method filter (line 33) | public function filter($buffer);
FILE: website/lib/swiftmailer/lib/classes/Swift/StreamFilters/ByteArrayReplacementFilter.php
class Swift_StreamFilters_ByteArrayReplacementFilter (line 18) | class Swift_StreamFilters_ByteArrayReplacementFilter implements Swift_St...
method __construct (line 42) | public function __construct($search, $replace) {
method shouldBuffer (line 102) | public function shouldBuffer($buffer) {
method filter (line 116) | public function filter($buffer, $_minReplaces = -1) {
FILE: website/lib/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilter.php
class Swift_StreamFilters_StringReplacementFilter (line 16) | class Swift_StreamFilters_StringReplacementFilter implements Swift_Strea...
method __construct (line 29) | public function __construct($search, $replace) {
method shouldBuffer (line 41) | public function shouldBuffer($buffer) {
method filter (line 59) | public function filter($buffer) {
FILE: website/lib/swiftmailer/lib/classes/Swift/StreamFilters/StringReplacementFilterFactory.php
class Swift_StreamFilters_StringReplacementFilterFactory (line 16) | class Swift_StreamFilters_StringReplacementFilterFactory implements Swif...
method createFilter (line 28) | public function createFilter($search, $replace) {
FILE: website/lib/swiftmailer/lib/classes/Swift/SwiftException.php
class Swift_SwiftException (line 16) | class Swift_SwiftException extends Exception{
method __construct (line 24) | public function __construct($message, $code = 0, Exception $previous =...
FILE: website/lib/swiftmailer/lib/classes/Swift/Transport.php
type Swift_Transport (line 16) | interface Swift_Transport{
method isStarted (line 22) | public function isStarted();
method start (line 27) | public function start();
method stop (line 32) | public function stop();
method send (line 45) | public function send(Swift_Mime_Message $message, &$failedRecipients =...
method registerPlugin (line 52) | public function registerPlugin(Swift_Events_EventListener $plugin);
FILE: website/lib/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php
class Swift_Transport_AbstractSmtpTransport (line 16) | abstract class Swift_Transport_AbstractSmtpTransport implements Swift_Tr...
method _getBufferParams (line 33) | abstract protected function _getBufferParams();
method __construct (line 41) | public function __construct(Swift_Transport_IoBuffer $buf, Swift_Event...
method setLocalDomain (line 60) | public function setLocalDomain($domain) {
method getLocalDomain (line 71) | public function getLocalDomain() {
method setSourceIp (line 80) | public function setSourceIp($source) {
method getSourceIp (line 89) | public function getSourceIp() {
method start (line 96) | public function start() {
method isStarted (line 126) | public function isStarted() {
method send (line 141) | public function send(Swift_Mime_Message $message, &$failedRecipients =...
method stop (line 196) | public function stop() {
method registerPlugin (line 228) | public function registerPlugin(Swift_Events_EventListener $plugin) {
method reset (line 235) | public function reset() {
method getBuffer (line 244) | public function getBuffer() {
method executeCommand (line 260) | public function executeCommand($command, $codes = array(), &$failures ...
method _readGreeting (line 273) | protected function _readGreeting() {
method _doHeloCommand (line 278) | protected function _doHeloCommand() {
method _doMailFromCommand (line 285) | protected function _doMailFromCommand($address) {
method _doRcptToCommand (line 292) | protected function _doRcptToCommand($address) {
method _doDataCommand (line 299) | protected function _doDataCommand() {
method _streamMessage (line 304) | protected function _streamMessage(Swift_Mime_Message $message) {
method _getReversePath (line 317) | protected function _getReversePath(Swift_Mime_Message $message) {
method _throwException (line 337) | protected function _throwException(Swift_TransportException $e) {
method _assertResponseCode (line 349) | protected function _assertResponseCode($response, $wanted) {
method _getFullResponse (line 369) | protected function _getFullResponse($seq) {
method _doMailTransaction (line 389) | private function _doMailTransaction($message, $reversePath, array $rec...
method _sendTo (line 412) | private function _sendTo(Swift_Mime_Message $message, $reversePath, ar...
method _sendBcc (line 422) | private function _sendBcc(Swift_Mime_Message $message, $reversePath, a...
method _lookupHostname (line 435) | private function _lookupHostname() {
method _isFqdn (line 451) | private function _isFqdn($hostname) {
method __destruct (line 463) | public function __destruct() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php
class Swift_Transport_Esmtp_Auth_CramMd5Authenticator (line 16) | class Swift_Transport_Esmtp_Auth_CramMd5Authenticator implements Swift_T...
method getAuthKeyword (line 22) | public function getAuthKeyword() {
method authenticate (line 35) | public function authenticate(Swift_Transport_SmtpAgent $agent, $userna...
method _getResponse (line 60) | private function _getResponse($secret, $challenge) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/LoginAuthenticator.php
class Swift_Transport_Esmtp_Auth_LoginAuthenticator (line 16) | class Swift_Transport_Esmtp_Auth_LoginAuthenticator implements Swift_Tra...
method getAuthKeyword (line 22) | public function getAuthKeyword() {
method authenticate (line 35) | public function authenticate(Swift_Transport_SmtpAgent $agent, $userna...
FILE: website/lib/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/NTLMAuthenticator.php
class Swift_Transport_Esmtp_Auth_NTLMAuthenticator (line 18) | class Swift_Transport_Esmtp_Auth_NTLMAuthenticator implements Swift_Tran...
method getAuthKeyword (line 27) | public function getAuthKeyword() {
method authenticate (line 40) | public function authenticate(Swift_Transport_SmtpAgent $agent, $userna...
method si2bin (line 73) | protected function si2bin($si, $bits = 32) {
method sendMessage1 (line 105) | protected function sendMessage1(Swift_Transport_SmtpAgent $agent) {
method parseMessage2 (line 118) | protected function parseMessage2($response) {
method readSubBlock (line 151) | protected function readSubBlock($block) {
method sendMessage3 (line 188) | protected function sendMessage3($response, $username, $password, $time...
method createMessage1 (line 215) | protected function createMessage1() {
method createMessage3 (line 232) | protected function createMessage3($domain, $username, $workstation, $l...
method createBlob (line 267) | protected function createBlob($timestamp, $client, $targetInfo) {
method getDomainAndUsername (line 286) | protected function getDomainAndUsername($name) {
method createLMPassword (line 304) | protected function createLMPassword($password, $challenge) {
method createNTLMPassword (line 332) | protected function createNTLMPassword($password, $challenge) {
method getCorrectTimestamp (line 351) | protected function getCorrectTimestamp($time) {
method createLMv2Password (line 379) | protected function createLMv2Password($password, $username, $domain, $...
method createNTLMv2Hash (line 407) | protected function createNTLMv2Hash($password, $username, $domain, $ch...
method createDesKey (line 419) | protected function createDesKey($key) {
method createSecurityBuffer (line 457) | protected function createSecurityBuffer($value, $offset, $is16 = false) {
method readSecurityBuffer (line 472) | protected function readSecurityBuffer($value) {
method castToByte (line 486) | protected function castToByte($v) {
method uRShift (line 499) | protected function uRShift($a, $b) {
method createByte (line 516) | protected function createByte($input, $bytes = 4, $isHex = true) {
method getRandomBytes (line 533) | protected function getRandomBytes($length) {
method desEncrypt (line 552) | protected function desEncrypt($value, $key) {
method md5Encrypt (line 567) | protected function md5Encrypt($key, $msg) {
method md4Encrypt (line 589) | protected function md4Encrypt($input) {
method convertTo16bit (line 602) | protected function convertTo16bit($input) {
method hex2bin (line 613) | protected function hex2bin($hex) {
method debug (line 624) | protected function debug($message) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php
class Swift_Transport_Esmtp_Auth_PlainAuthenticator (line 16) | class Swift_Transport_Esmtp_Auth_PlainAuthenticator implements Swift_Tra...
method getAuthKeyword (line 22) | public function getAuthKeyword() {
method authenticate (line 35) | public function authenticate(Swift_Transport_SmtpAgent $agent, $userna...
FILE: website/lib/swiftmailer/lib/classes/Swift/Transport/Esmtp/Auth/XOAuth2Authenticator.php
class Swift_Transport_Esmtp_Auth_XOAuth2Authenticator (line 26) | class Swift_Transport_Esmtp_Auth_XOAuth2Authenticator implements Swift_T...
method getAuthKeyword (line 32) | public function getAuthKeyword() {
method authenticate (line 45) | public function authenticate(Swift_Transport_SmtpAgent $agent, $email,...
method constructXOAuth2Params (line 63) | protected function constructXOAuth2Params($email, $token) {
FILE: website/lib/swiftmailer/lib/classes/Swift/Transport/Esmtp/AuthHandler.php
class Swift_Transport_Esmtp_AuthHandler (line 16) | class Swift_Transport_Esmtp_AuthHandler implements Swift_Transport_Esmtp...
method __construct (line 57) | public function __construct(array $authenticators) {
method setAuthenticators (line 66) | public function setAuthenticators(array $authenticators) {
method getAuthenticators (line 75) | public function getAuthenticators() {
method setUsername (line 84) | public function setUsername($username) {
method getUsername (line 93) | public function getUsername() {
method setPassword (line 102) | public function setPassword($password) {
method getPassword (line 111) | public function getPassword() {
method setAuthMode (line 120) | public function setAuthMode($mode) {
method getAuthMode (line 129) | public function getAuthMode() {
method getHandledKeyword (line 138) | public function getHandledKeyword() {
method setKeywordParams (line 147) | public function setKeywordParams(array $parameters) {
method afterEhlo (line 156) | public function afterEhlo(Swift_Transport_SmtpAgent $agent) {
method getMailParams (line 178) | public function getMailParams() {
method getRcptParams (line 185) | public function getRcptParams() {
method onCommand (line 192) | public function onCommand(Swift_Transport_SmtpAgent $agent, $command, ...
method getPriorityOver (line 204) | public function getPriorityOver($esmtpKeyword) {
method exposeMixinMethods (line 213) | public function exposeMixinMethods() {
method resetState (line 220) | public function resetState() {
method _getAuthenticatorsForAgent (line 230) | protected function _getAuthenticatorsForAgent() {
FILE: website/lib/swiftmailer/lib/classes/Swift/Transport/Esmtp/Authenticator.php
type Swift_Transport_Esmtp_Authenticator (line 16) | interface Swift_Transport_Esmtp_Authenticator{
method getAuthKeyword (line 22) | public function getAuthKeyword();
method authenticate (line 33) | public function authenticate(Swift_Transport_SmtpAgent $agent, $userna...
FILE: website/lib/swiftmailer/lib/classes/Swift/Transport/EsmtpHandler.php
type Swift_Transport_EsmtpHandler (line 16) | interface Swift_Transport_EsmtpHandler{
method getHandledKeyword (line 22) | public function getHandledKeyword();
method setKeywordParams (line 29) | public function setKeywordParams(array $parameters);
method afterEhlo (line
Condensed preview — 701 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,182K chars).
[
{
"path": ".gitattributes",
"chars": 529,
"preview": "# Linguist ignore\nwebsite/lib/* linguist-vendored=false\nenvironment/core/json.hpp linguist-vendored=false\nenvironment/tc"
},
{
"path": ".gitignore",
"chars": 5795,
"preview": "###################\n## Visual Studio ##\n###################\n# User-specific files\n*.suo\n*.user\n*.userosscache\n*.sln.docs"
},
{
"path": ".travis.yml",
"chars": 665,
"preview": "sudo: required\n\ndist: trusty\n\nlanguage: cpp\n\nservices: \n - mysql\n\naddons:\n apt:\n packages:\n - mysql-server-5.6\n "
},
{
"path": "CONTRIBUTING.md",
"chars": 2179,
"preview": "# Halite Contributing Guide\n\nIf you find a bug or have a feature request, please [open an issue](https://github.com/Hali"
},
{
"path": "LICENSE",
"chars": 1097,
"preview": "The MIT License\n\nCopyright (c) 2016 Michael Truell and Benjamin Spector\n\nPermission is hereby granted, free of charge, t"
},
{
"path": "README.md",
"chars": 1401,
"preview": "# Halite\n\n[](https://travis-ci.org/Halite"
},
{
"path": "admin/checkTaskCompletion.py",
"chars": 2063,
"preview": "#!/usr/bin/env python3\n\nimport configparser\nimport time\nfrom datetime import datetime\n\nimport pymysql\n\nparser = configpa"
},
{
"path": "admin/commandRunner.py",
"chars": 1184,
"preview": "import pymysql\nimport threading\nimport configparser\nimport sys\nimport os\nimport os.path\n\ndef runOnWorker(worker, keyPath"
},
{
"path": "admin/cost.py",
"chars": 740,
"preview": "dimensions = [(1, 20), (2, 25), (3, 30), (4, 35), (3, 40), (2, 45), (1, 50)]\naveragePlayersPerGame = 4\nplayersPerServers"
},
{
"path": "admin/cron/haliteEmailer.py",
"chars": 456,
"preview": "import smtplib\nfrom email.mime.text import MIMEText\n\ndef sendEmail(senderEmail, senderPassword, subject, body, recipient"
},
{
"path": "admin/cron/install.sh",
"chars": 101,
"preview": "apt-get update\napt-get install -y python3 python3-pip linkchecker\npip3 install configparser pymysql \n"
},
{
"path": "admin/cron/linkChecker.py",
"chars": 948,
"preview": "#!/usr/bin/env python3\n\nimport configparser\nimport subprocess\nimport haliteEmailer\n\nparser = configparser.ConfigParser()"
},
{
"path": "admin/cron/workerChecker.py",
"chars": 812,
"preview": "#!/usr/bin/env python3\n\nimport configparser\nimport pymysql\n\nimport haliteEmailer\n\nparser = configparser.ConfigParser()\np"
},
{
"path": "admin/md/DISASTER.md",
"chars": 2195,
"preview": "# Disaster Scenarios\n\n### Restarting each component \n\n#### Mysql DB\n\nSSH into the AWS instance hosting the database.\n\n "
},
{
"path": "admin/md/INSTALL.md",
"chars": 2948,
"preview": "# Installation\n\nIf you have not already:\n\n git clone https://github.com/HaliteChallenge/Halite.git\n\n### Website/Manag"
},
{
"path": "admin/md/SPEC.md",
"chars": 6330,
"preview": "# Halite Specification\n\nHalite is an online programming challenge. Users write bots to play a simple, original game with"
},
{
"path": "admin/md/STARTER_PACKAGE_CHECKLIST.md",
"chars": 243,
"preview": "Starter Package Checklist\n\n* Make sure all proper files are present (MyBot, RandomBot, runGame.sh, runGame.bat)\n* Add de"
},
{
"path": "admin/rankReset.py",
"chars": 1038,
"preview": "#!/usr/bin/env python3\n\nimport configparser\nimport pymysql\n\nparser = configparser.ConfigParser()\nparser.read(\"../halite."
},
{
"path": "admin/updateOrgs.py",
"chars": 1139,
"preview": "import configparser\nimport pymysql\nimport urllib.request\n\n\nparser = configparser.ConfigParser()\nparser.read(\"../halite.i"
},
{
"path": "airesources/C/MyBot.c",
"chars": 615,
"preview": "#include <stdio.h>\n#include <stdlib.h>\n#include <time.h>\n\n#include \"hlt.h\"\n\n#define BOT_NAME \"MyCBot\"\n\nint main(void) {\n"
},
{
"path": "airesources/C/RandomBot.c",
"chars": 619,
"preview": "#include <stdio.h>\n#include <stdlib.h>\n#include <time.h>\n\n#include \"hlt.h\"\n\n#define BOT_NAME \"RandomCBot\"\n\nint main(void"
},
{
"path": "airesources/C/hlt.h",
"chars": 5541,
"preview": "/*\n In general, none of the public functions return pointers,\n nor do they take pointer arguments.\n\n Useful fun"
},
{
"path": "airesources/C/runGame.bat",
"chars": 110,
"preview": "gcc MyBot.c -o MyBot.exe\ngcc RandomBot.c -o RandomBot.exe\n.\\halite.exe -d \"30 30\" \"MyBot.exe\" \"RandomBot.exe\"\n"
},
{
"path": "airesources/C/runGame.sh",
"chars": 115,
"preview": "#!/bin/bash\n\ngcc MyBot.c -o MyBot.o\ngcc RandomBot.c -o RandomBot.o\n./halite -d \"30 30\" \"./MyBot.o\" \"./RandomBot.o\"\n"
},
{
"path": "airesources/C++/MyBot.cpp",
"chars": 826,
"preview": "#include <stdlib.h>\n#include <time.h>\n#include <cstdlib>\n#include <ctime>\n#include <time.h>\n#include <set>\n#include <fst"
},
{
"path": "airesources/C++/RandomBot.cpp",
"chars": 830,
"preview": "#include <stdlib.h>\n#include <time.h>\n#include <cstdlib>\n#include <ctime>\n#include <time.h>\n#include <set>\n#include <fst"
},
{
"path": "airesources/C++/hlt.hpp",
"chars": 3450,
"preview": "#ifndef HLT_H\n#define HLT_H\n\n#include <list>\n#include <vector>\n#include <random>\n\n#define STILL 0\n#define NORTH 1\n#defin"
},
{
"path": "airesources/C++/networking.hpp",
"chars": 3504,
"preview": "#ifndef AI_NETWORKING_H\n#define AI_NETWORKING_H\n\n#include <iostream>\n#include <time.h>\n#include <set>\n#include <cfloat>\n"
},
{
"path": "airesources/C++/runGame.bat",
"chars": 136,
"preview": "g++ -std=c++11 MyBot.cpp -o MyBot.exe\ng++ -std=c++11 RandomBot.cpp -o RandomBot.exe\n.\\halite.exe -d \"30 30\" \"MyBot.exe\" "
},
{
"path": "airesources/C++/runGame.sh",
"chars": 141,
"preview": "#!/bin/bash\n\ng++ -std=c++11 MyBot.cpp -o MyBot.o\ng++ -std=c++11 RandomBot.cpp -o RandomBot.o\n./halite -d \"30 30\" \"./MyBo"
},
{
"path": "airesources/CSharp/Halite.csproj",
"chars": 2516,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"14.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
},
{
"path": "airesources/CSharp/HaliteHelper.cs",
"chars": 7104,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Net;\nusing System.Net."
},
{
"path": "airesources/CSharp/MyBot.cs",
"chars": 1199,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\npublic class MyBot\n{\n public const string MyBotN"
},
{
"path": "airesources/CSharp/Properties/AssemblyInfo.cs",
"chars": 1385,
"preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Infor"
},
{
"path": "airesources/CSharp/RandomBot.cs",
"chars": 1026,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n\npublic class MyBot\n{\n public const string RandomB"
},
{
"path": "airesources/CSharp/runGame.bat",
"chars": 220,
"preview": "csc /t:library /out:HaliteHelper.dll HaliteHelper.cs\ncsc /reference:HaliteHelper.dll -out:MyBot.exe MyBot.cs\ncsc /refere"
},
{
"path": "airesources/CSharp/runGame.sh",
"chars": 231,
"preview": "#!/bin/bash\n\nmcs -t:library -out:HaliteHelper.dll HaliteHelper.cs\nmcs -reference:HaliteHelper.dll -out:MyBot.o MyBot.cs\n"
},
{
"path": "airesources/Clojure/.gitignore",
"chars": 99,
"preview": "/target\n/classes\n/checkouts\npom.xml\npom.xml.asc\n*.jar\n*.class\n/.lein-*\n/.nrepl-port\n.hgignore\n.hg/\n"
},
{
"path": "airesources/Clojure/README.md",
"chars": 269,
"preview": "# halite-clj\n\nA Clojure implementation of a random Halite bot.\n\n## Usage\n\nFirst, copy the \"halite\" executable to the roo"
},
{
"path": "airesources/Clojure/project.clj",
"chars": 350,
"preview": "(defproject halite-clj \"0.1.0-SNAPSHOT\"\n :description \"FIXME: write description\"\n :url \"http://example.com/FIXME\"\n :l"
},
{
"path": "airesources/Clojure/runGame.bat",
"chars": 113,
"preview": "call lein uberjar\n\nhalite.exe -d \"30 30\" \"java -cp target/MyBot.jar MyBot\" \"java -cp target/MyBot.jar RandomBot\"\n"
},
{
"path": "airesources/Clojure/runGame.sh",
"chars": 119,
"preview": "#!/bin/bash\n\nlein uberjar\n\n./halite -d \"30 30\" \"java -cp target/MyBot.jar MyBot\" \"java -cp target/MyBot.jar RandomBot\"\n"
},
{
"path": "airesources/Clojure/src/MyBot.clj",
"chars": 781,
"preview": "(ns MyBot\n (:require [game]\n [io])\n (:gen-class))\n\n(def bot-name \"MyFirstClojureBot\")\n\n(defn random-moves\n "
},
{
"path": "airesources/Clojure/src/RandomBot.clj",
"chars": 784,
"preview": "(ns RandomBot\n (:require [game]\n [io])\n (:gen-class))\n\n(def bot-name \"RandomClojureBot\")\n\n(defn random-move"
},
{
"path": "airesources/Clojure/src/game.clj",
"chars": 1124,
"preview": "(ns game\n (:gen-class))\n\n;; The map is represented by a 2D vector of Sites\n(defrecord Site [^int x ^int y ^int producti"
},
{
"path": "airesources/Clojure/src/io.clj",
"chars": 2069,
"preview": "(ns io\n (:require clojure.string\n game)\n (:gen-class))\n\n(defn create-game-map\n \"Parses the run-length enco"
},
{
"path": "airesources/Go/MyBot.go",
"chars": 520,
"preview": "package main\n\nimport (\n\t\"hlt\"\n\n\t\"math/rand\"\n)\n\nfunc main() {\n\tconn, gameMap := hlt.NewConnection()\n\tconn.SendName(\"MyBot"
},
{
"path": "airesources/Go/RandomBot.go",
"chars": 524,
"preview": "package main\n\nimport (\n\t\"hlt\"\n\n\t\"math/rand\"\n)\n\nfunc main() {\n\tconn, gameMap := hlt.NewConnection()\n\tconn.SendName(\"Rando"
},
{
"path": "airesources/Go/runGame.bat",
"chars": 64,
"preview": ".\\halite.exe -d \"30 30\" \"go run MyBot.go\" \"go run RandomBot.go\"\n"
},
{
"path": "airesources/Go/runGame.sh",
"chars": 97,
"preview": "#!/bin/bash\n\nexport GOPATH=\"$(pwd)\"\n\n./halite -d \"30 30\" \"go run MyBot.go\" \"go run RandomBot.go\"\n"
},
{
"path": "airesources/Go/src/hlt/gamemap.go",
"chars": 1928,
"preview": "package hlt\n\nimport (\n\t\"log\"\n\t\"math\"\n\t\"strconv\"\n)\n\ntype GameMap struct {\n\tWidth, Height int\n\tContents\t [][]Site\n}\n\nfunc"
},
{
"path": "airesources/Go/src/hlt/networking.go",
"chars": 2896,
"preview": "package hlt\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\t\"os\"\n\t\"strconv\"\n\t\"strings\"\n)\n\ntype Direction int\n\nconst (\n\tSTILL Dir"
},
{
"path": "airesources/Java/Direction.java",
"chars": 434,
"preview": "import java.util.Random;\n\npublic enum Direction {\n STILL, NORTH, EAST, SOUTH, WEST;\n\n public static final Directio"
},
{
"path": "airesources/Java/GameMap.java",
"chars": 2896,
"preview": "import java.util.ArrayList;\npublic class GameMap{\n\n private final Site[][] contents;\n private final Location[][] l"
},
{
"path": "airesources/Java/InitPackage.java",
"chars": 75,
"preview": "\npublic class InitPackage {\n public int myID;\n public GameMap map;\n}\n"
},
{
"path": "airesources/Java/Location.java",
"chars": 396,
"preview": "public class Location {\n\n // Public for backward compability\n public final int x, y;\n private final Site site;\n"
},
{
"path": "airesources/Java/Move.java",
"chars": 169,
"preview": "public class Move {\n public Location loc;\n public Direction dir;\n\n public Move(Location loc_, Direction dir_) {"
},
{
"path": "airesources/Java/MyBot.java",
"chars": 944,
"preview": "import java.util.ArrayList;\nimport java.util.List;\n\npublic class MyBot {\n public static void main(String[] args) thro"
},
{
"path": "airesources/Java/Networking.java",
"chars": 3949,
"preview": "import java.net.*;\nimport java.io.*;\nimport java.util.ArrayList;\nimport java.util.Scanner;\nimport java.nio.ByteBuffer;\ni"
},
{
"path": "airesources/Java/RandomBot.java",
"chars": 952,
"preview": "import java.util.ArrayList;\nimport java.util.List;\n\npublic class RandomBot {\n public static void main(String[] args) "
},
{
"path": "airesources/Java/Site.java",
"chars": 167,
"preview": "public class Site {\n\n public final int production;\n public int owner, strength;\n\n public Site(int production) {"
},
{
"path": "airesources/Java/runGame.bat",
"chars": 92,
"preview": "javac MyBot.java\njavac RandomBot.java\n.\\halite.exe -d \"30 30\" \"java MyBot\" \"java RandomBot\"\n"
},
{
"path": "airesources/Java/runGame.sh",
"chars": 101,
"preview": "#!/bin/bash\n\njavac MyBot.java\njavac RandomBot.java\n./halite -d \"30 30\" \"java MyBot\" \"java RandomBot\"\n"
},
{
"path": "airesources/JavaScript/MyBot.js",
"chars": 501,
"preview": "const {\n Move,\n} = require('./hlt');\nconst Networking = require('./networking');\n\nconst network = new Networking('MyJav"
},
{
"path": "airesources/JavaScript/RandomBot.js",
"chars": 505,
"preview": "const {\n Move,\n} = require('./hlt');\nconst Networking = require('./networking');\n\nconst network = new Networking('Rando"
},
{
"path": "airesources/JavaScript/hlt.js",
"chars": 2531,
"preview": "const STILL = 0;\nconst NORTH = 1;\nconst EAST = 2;\nconst SOUTH = 3;\nconst WEST = 4;\n\nconst DIRECTIONS = [STILL, NORTH, "
},
{
"path": "airesources/JavaScript/networking.js",
"chars": 2656,
"preview": "const EventEmitter = require('events');\nconst readline = require('readline');\nconst { GameMap } = require('./hlt.js');\n\n"
},
{
"path": "airesources/JavaScript/runGame.bat",
"chars": 60,
"preview": ".\\halite.exe -d \"30 30\" \"node MyBot.js\" \"node RandomBot.js\"\n"
},
{
"path": "airesources/JavaScript/runGame.sh",
"chars": 69,
"preview": "#!/bin/bash\n\n./halite -d \"30 30\" \"node MyBot.js\" \"node RandomBot.js\"\n"
},
{
"path": "airesources/Julia/MyBot.jl",
"chars": 371,
"preview": "include(\"hlt.jl\")\ninclude(\"networking.jl\")\n\nmyID, gameMap = getInit()\nsendInit(\"MyJuliaBot\")\n\nwhile true\n moves = Vecto"
},
{
"path": "airesources/Julia/RandomBot.jl",
"chars": 375,
"preview": "include(\"hlt.jl\")\ninclude(\"networking.jl\")\n\nmyID, gameMap = getInit()\nsendInit(\"RandomJuliaBot\")\n\nwhile true\n moves = V"
},
{
"path": "airesources/Julia/hlt.jl",
"chars": 2439,
"preview": "const STILL = 0\nconst NORTH = 1\nconst EAST = 2\nconst SOUTH = 3\nconst WEST = 4\n\nconst DIRECTIONS = [a for a in 0:4]\nconst"
},
{
"path": "airesources/Julia/networking.jl",
"chars": 1895,
"preview": "_productions = Vector{Vector{Int64}}()\n_width = nothing\n_height = nothing\n\nfunction serializeMoveSet(moves::Vector{Move}"
},
{
"path": "airesources/Julia/runGame.bat",
"chars": 62,
"preview": ".\\halite.exe -d \"30 30\" \"julia MyBot.jl\" \"julia RandomBot.jl\"\n"
},
{
"path": "airesources/Julia/runGame.sh",
"chars": 71,
"preview": "#!/bin/bash\n\n./halite -d \"30 30\" \"julia MyBot.jl\" \"julia RandomBot.jl\"\n"
},
{
"path": "airesources/OCaml/MyBot.ml",
"chars": 1067,
"preview": "(* OCaml Starter for Halite on Halite.io\n This code is public domain. There is no warranty.\n *)\n\nopen Td;;\n\nlet random"
},
{
"path": "airesources/OCaml/README.md",
"chars": 288,
"preview": "Halite OCaml Starter Package\n----------------------------\n\nThis is an OCaml starter package for Halite on halite.io\n\nIt "
},
{
"path": "airesources/OCaml/RandomBot.ml",
"chars": 1071,
"preview": "(* OCaml Starter for Halite on Halite.io\n This code is public domain. There is no warranty.\n *)\n\nopen Td;;\n\nlet random"
},
{
"path": "airesources/OCaml/debug.ml",
"chars": 431,
"preview": "(* OCaml Starter for Halite on Halite.io\n This code is public domain. There is no warranty.\n *)\n\nlet out_chan = open_o"
},
{
"path": "airesources/OCaml/halite.ml",
"chars": 8667,
"preview": "(* OCaml Starter for Halite on Halite.io\n This code is public domain. There is no warranty.\n *)\n\nopen Td;;\nopen Debug;"
},
{
"path": "airesources/OCaml/runGame.bat",
"chars": 131,
"preview": "ocamlbuild -lib unix MyBot.native\nocamlbuild -lib unix RandomBot.native\n.\\halite.exe -d \"30 30\" \".\\MyBot.exe\" \".\\RandomB"
},
{
"path": "airesources/OCaml/runGame.sh",
"chars": 143,
"preview": "#!/bin/bash\n\nocamlbuild -lib unix MyBot.native\nocamlbuild -lib unix RandomBot.native\n./halite -d \"30 30\" \"./MyBot.native"
},
{
"path": "airesources/OCaml/td.ml",
"chars": 696,
"preview": "(* OCaml Starter for Halite on Halite.io\n This code is public domain. There is no warranty.\n *)\n\ntype t_direction = [ "
},
{
"path": "airesources/PHP/MyBot.php",
"chars": 481,
"preview": "<?php\n\nrequire_once 'hlt.php';\nrequire_once 'networking.php';\n\nlist($myID, $gameMap) = getInit();\nsendInit('myPHPBot');\n"
},
{
"path": "airesources/PHP/RandomBot.php",
"chars": 485,
"preview": "<?php\n\nrequire_once 'hlt.php';\nrequire_once 'networking.php';\n\nlist($myID, $gameMap) = getInit();\nsendInit('RandomPHPBot"
},
{
"path": "airesources/PHP/hlt.php",
"chars": 3500,
"preview": "<?php\n\ndefine('STILL', 0);\ndefine('NORTH', 1);\ndefine('EAST', 2);\ndefine('SOUTH', 3);\ndefine('WEST', 4);\n\nconst DIRECTIO"
},
{
"path": "airesources/PHP/networking.php",
"chars": 2307,
"preview": "<?php\n\n$_productions = [];\n$_width = -1;\n$_height = -1;\n\nfunction serializeMoveSet(array $moves)\n{\n $returnString = '"
},
{
"path": "airesources/PHP/runGame.bat",
"chars": 60,
"preview": ".\\halite.exe -d \"30 30\" \"php MyBot.php\" \"php RandomBot.php\"\n"
},
{
"path": "airesources/PHP/runGame.sh",
"chars": 69,
"preview": "#!/bin/bash\n\n./halite -d \"30 30\" \"php MyBot.php\" \"php RandomBot.php\"\n"
},
{
"path": "airesources/Python/MyBot.py",
"chars": 338,
"preview": "import hlt\nfrom hlt import NORTH, EAST, SOUTH, WEST, STILL, Move, Square\nimport random\n\n\nmyID, game_map = hlt.get_init()"
},
{
"path": "airesources/Python/RandomBot.py",
"chars": 342,
"preview": "import hlt\nfrom hlt import NORTH, EAST, SOUTH, WEST, STILL, Move, Square\nimport random\n\n\nmyID, game_map = hlt.get_init()"
},
{
"path": "airesources/Python/hlt.py",
"chars": 4542,
"preview": "import sys\nfrom collections import namedtuple\nfrom itertools import chain, zip_longest\n\n\ndef grouper(iterable, n, fillva"
},
{
"path": "airesources/Python/runGame.bat",
"chars": 64,
"preview": ".\\halite.exe -d \"30 30\" \"python MyBot.py\" \"python RandomBot.py\"\n"
},
{
"path": "airesources/Python/runGame.sh",
"chars": 185,
"preview": "#!/bin/bash\n\nif hash python3 2>/dev/null; then\n ./halite -d \"30 30\" \"python3 MyBot.py\" \"python3 RandomBot.py\"\nelse\n "
},
{
"path": "airesources/Ruby/MyBot.rb",
"chars": 443,
"preview": "$:.unshift(File.dirname(__FILE__))\nrequire 'networking'\n\nnetwork = Networking.new(\"RubyBot\")\ntag, map = network.configur"
},
{
"path": "airesources/Ruby/RandomBot.rb",
"chars": 449,
"preview": "$:.unshift(File.dirname(__FILE__))\nrequire 'networking'\n\nnetwork = Networking.new(\"RandomRubyBot\")\ntag, map = network.co"
},
{
"path": "airesources/Ruby/game_map.rb",
"chars": 1578,
"preview": "class GameMap\n\n CARDINALS = [:north, :east, :south, :west]\n DIRECTIONS = [:still] + CARDINALS\n\n attr_reader :width, :"
},
{
"path": "airesources/Ruby/location.rb",
"chars": 90,
"preview": "class Location\n\n attr_reader :x, :y\n\n def initialize(x, y)\n @x, @y = x, y\n end\n\nend\n"
},
{
"path": "airesources/Ruby/move.rb",
"chars": 245,
"preview": "class Move\n\n attr_reader :location, :direction\n\n def initialize(location, direction)\n @location = location\n @dir"
},
{
"path": "airesources/Ruby/networking.rb",
"chars": 1966,
"preview": "require 'logger'\n\nrequire 'location'\nrequire 'move'\nrequire 'site'\nrequire 'game_map'\n\nclass Networking\n\n attr_reader :"
},
{
"path": "airesources/Ruby/runGame.bat",
"chars": 60,
"preview": ".\\halite.exe -d \"30 30\" \"ruby MyBot.rb\" \"ruby RandomBot.rb\"\n"
},
{
"path": "airesources/Ruby/runGame.sh",
"chars": 69,
"preview": "#!/bin/bash\n\n./halite -d \"30 30\" \"ruby MyBot.rb\" \"ruby RandomBot.rb\"\n"
},
{
"path": "airesources/Ruby/site.rb",
"chars": 192,
"preview": "class Site\n\n attr_reader :owner, :strength, :production\n\n def initialize(owner = 0, strength = 0, production = 0)\n "
},
{
"path": "airesources/Rust/Cargo.toml",
"chars": 273,
"preview": "[package]\nname = \"Rust\"\nversion = \"0.1.0\"\nauthors = [\"Benjamin Spector <benjaminfspector@gmail.com>\"]\n\npublish = false\nv"
},
{
"path": "airesources/Rust/runGame.bat",
"chars": 82,
"preview": "cargo build\n.\\halite.exe -d \"30 30\" \"target/debug/MyBot\" \"target/debug/RandomBot\"\n"
},
{
"path": "airesources/Rust/runGame.sh",
"chars": 91,
"preview": "#!/bin/bash\n\ncargo build\n./halite -d \"30 30\" \"target/debug/MyBot\" \"target/debug/RandomBot\"\n"
},
{
"path": "airesources/Rust/src/MyBot.rs",
"chars": 1258,
"preview": "#![allow(non_snake_case)]\n#![allow(warnings)]\n\nextern crate rand;\n#[macro_use] extern crate text_io;\n\n//Notice: due to R"
},
{
"path": "airesources/Rust/src/RandomBot.rs",
"chars": 1258,
"preview": "#![allow(non_snake_case)]\n#![allow(warnings)]\n\nextern crate rand;\n#[macro_use] extern crate text_io;\n\n//Notice: due to R"
},
{
"path": "airesources/Rust/src/hlt/mod.rs",
"chars": 56,
"preview": "#![allow(warnings)]\n\npub mod networking;\npub mod types;\n"
},
{
"path": "airesources/Rust/src/hlt/networking.rs",
"chars": 2828,
"preview": "#![allow(warnings)]\n\nuse hlt::types;\nuse std::io;\nuse std::collections::HashMap;\nuse std::io::Write;\nuse std::str::FromS"
},
{
"path": "airesources/Rust/src/hlt/types.rs",
"chars": 2606,
"preview": "#![allow(warnings)]\n\npub const STILL: u8 = 0;\npub const NORTH: u8 = 1;\npub const EAST: u8 = 2;\npub const SOUTH: u8 = 3;\n"
},
{
"path": "airesources/Scala/Bot.scala",
"chars": 105,
"preview": "trait Bot {\n def getMoves(grid: Grid): Iterable[Move]\n}\n\ntrait BotFactory {\n def make(id: Int): Bot\n}\n\n"
},
{
"path": "airesources/Scala/Direction.scala",
"chars": 548,
"preview": "import scala.util.Random\n\nobject Direction {\n private val random = new Random()\n val CARDINALS = Seq(North, East, Sout"
},
{
"path": "airesources/Scala/Env.scala",
"chars": 2031,
"preview": "object Env {\n def readId(): Int = {\n read().toInt\n }\n\n def readInit(): Grid = {\n val dims = read().split(\" \")\n "
},
{
"path": "airesources/Scala/Grid.scala",
"chars": 2515,
"preview": "object Grid {\n val NEUTRAL = 0\n}\n\nclass Grid(width: Int, height: Int, locations: Array[Array[Location]], var occupants:"
},
{
"path": "airesources/Scala/Move.scala",
"chars": 57,
"preview": "case class Move(location: Location, direction: Direction)"
},
{
"path": "airesources/Scala/MyBot.scala",
"chars": 366,
"preview": "object MyBot extends BotFactory {\n def main(args: Array[String]): Unit = {\n Runner.run(\"scalaMyBot\", this)\n }\n\n ov"
},
{
"path": "airesources/Scala/RandomBot.scala",
"chars": 379,
"preview": "object RandomBot extends BotFactory {\n def main(args: Array[String]): Unit = {\n Runner.run(\"scalaRandom\", this)\n }\n"
},
{
"path": "airesources/Scala/Runner.scala",
"chars": 382,
"preview": "object Runner {\n def run(name: String, botFactory: BotFactory): Unit = {\n val id = Env.readId()\n val grid = Env.r"
},
{
"path": "airesources/Scala/runGame.bat",
"chars": 134,
"preview": "javac *.java\nscalac HaliteBot.scala\nscalac MyBot.scala\nscalac RandomBot.scala\n\n\\halite.exe -d \"30 30\" \"scala MyBot\" \"sca"
},
{
"path": "airesources/Scala/runGame.sh",
"chars": 81,
"preview": "#!/bin/bash\n\nscalac *.scala\n\n./halite -d \"30 30\" \"scala MyBot\" \"scala RandomBot\"\n"
},
{
"path": "airesources/Sockets/HaliteSocketHelper.cs",
"chars": 7846,
"preview": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Net;\nusing System.Net.S"
},
{
"path": "airesources/Sockets/SocketNetworking.java",
"chars": 4228,
"preview": "import java.net.*;\nimport java.io.*;\nimport java.util.ArrayList;\nimport java.util.Scanner;\nimport java.nio.ByteBuffer;\ni"
},
{
"path": "airesources/Sockets/pipe_socket_translator.py",
"chars": 1164,
"preview": "import socket\nimport sys\n\n# Connect\nsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\nsocket.bind(('localhost',"
},
{
"path": "airesources/Sockets/socket_networking.hpp",
"chars": 5614,
"preview": "#ifndef AI_NETWORKING_H\n#define AI_NETWORKING_H\n\n#include <iostream>\n#include <time.h>\n#include <set>\n#include <cfloat>\n"
},
{
"path": "airesources/Sockets/socket_networking.py",
"chars": 2446,
"preview": "from hlt import *\nimport socket\nimport traceback\nimport struct\nfrom ctypes import *\nimport sys\n\n_productions = []\n_width"
},
{
"path": "appveyor.yml",
"chars": 436,
"preview": "# Specify version format\nversion: \"{build}\"\n\nonly_commits:\n message: /build/\n\n# Build worker image (VM template)\nimage:"
},
{
"path": "environment/Makefile",
"chars": 360,
"preview": "CXXFLAGS += -std=c++11 -pthread -I ./\nINSTALL_PATH?=/usr/local\nSOURCES=$(shell find . -name \"*.cpp\")\nOBJECTS=$(SOURCES:%"
},
{
"path": "environment/core/Halite.cpp",
"chars": 21817,
"preview": "#include \"Halite.hpp\"\n\n#include \"limits.h\"\n\n#define F_NEWLINE '\\n'\n\n//Private Functions ------------------\n\nstd::vector<"
},
{
"path": "environment/core/Halite.hpp",
"chars": 3475,
"preview": "#ifndef HALITE_H\n#define HALITE_H\n\n#include <fstream>\n#include <string>\n#include <map>\n#include <set>\n#include <algorith"
},
{
"path": "environment/core/hlt.hpp",
"chars": 17243,
"preview": "#pragma once\n\n#include <list>\n#include <vector>\n#include <random>\n#include <functional>\n#include <iostream>\n#include <fs"
},
{
"path": "environment/core/json.hpp",
"chars": 346602,
"preview": "/*\n __ _____ _____ _____\n __| | __| | | | JSON for Modern C++\n| | |__ | | | | | | version 2.0.2\n|___"
},
{
"path": "environment/install.sh",
"chars": 351,
"preview": "# Install Halite environment\ncurl \"https://halite.io/downloads/environment/HaliteEnvironment-Source.zip\" -o \"HaliteEnvir"
},
{
"path": "environment/main.cpp",
"chars": 7107,
"preview": "#include <iostream>\n#include <cctype>\n#include <chrono>\n#include <list>\n#include <string.h>\n\n#include \"core/Halite.hpp\"\n"
},
{
"path": "environment/make.bat",
"chars": 252,
"preview": "SET PATH=C:\\Program Files (x86)\\MSBuild\\14.0\\Bin;%PATH%\nCALL \"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcv"
},
{
"path": "environment/networking/Networking.cpp",
"chars": 18354,
"preview": "#include \"Networking.hpp\"\n\n#include <fstream>\n#include <sstream>\n#include <algorithm>\n#include <stdio.h>\n#include <chron"
},
{
"path": "environment/networking/Networking.hpp",
"chars": 1665,
"preview": "#ifndef NETWORKING_H\n#define NETWORKING_H\n\n#include <iostream>\n#include <map>\n\n#ifdef _WIN32\n #include <windows.h>\n "
},
{
"path": "environment/tclap/Arg.h",
"chars": 17447,
"preview": "// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-\n\n/***************************************************************"
},
{
"path": "environment/tclap/ArgException.h",
"chars": 5044,
"preview": "// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-\n\n/***************************************************************"
},
{
"path": "environment/tclap/ArgTraits.h",
"chars": 2627,
"preview": "// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-\n\n/***************************************************************"
},
{
"path": "environment/tclap/CmdLine.h",
"chars": 13986,
"preview": "// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-\n\n/***************************************************************"
},
{
"path": "environment/tclap/CmdLineInterface.h",
"chars": 3627,
"preview": "\n/****************************************************************************** \n * \n * file: CmdLineInterface.h\n * \n"
},
{
"path": "environment/tclap/CmdLineOutput.h",
"chars": 1925,
"preview": "\n\n/****************************************************************************** \n * \n * file: CmdLineOutput.h\n * \n *"
},
{
"path": "environment/tclap/Constraint.h",
"chars": 1800,
"preview": "\n/******************************************************************************\n *\n * file: Constraint.h\n *\n * Copyr"
},
{
"path": "environment/tclap/DocBookOutput.h",
"chars": 8358,
"preview": "// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-\n\n/***************************************************************"
},
{
"path": "environment/tclap/HelpVisitor.h",
"chars": 1944,
"preview": "\n/****************************************************************************** \n * \n * file: HelpVisitor.h\n * \n * C"
},
{
"path": "environment/tclap/IgnoreRestVisitor.h",
"chars": 1335,
"preview": "\n/****************************************************************************** \n * \n * file: IgnoreRestVisitor.h\n * "
},
{
"path": "environment/tclap/Makefile.am",
"chars": 577,
"preview": "\nlibtclapincludedir = $(includedir)/tclap\n\nlibtclapinclude_HEADERS = \\\n\t\t\t CmdLineInterface.h \\\n\t\t\t ArgException.h \\\n\t\t\t"
},
{
"path": "environment/tclap/Makefile.in",
"chars": 11987,
"preview": "# Makefile.in generated by automake 1.10 from Makefile.am.\n# @configure_input@\n\n# Copyright (C) 1994, 1995, 1996, 1997, "
},
{
"path": "environment/tclap/MultiArg.h",
"chars": 12013,
"preview": "/****************************************************************************** \n * \n * file: MultiArg.h\n * \n * Copyr"
},
{
"path": "environment/tclap/MultiSwitchArg.h",
"chars": 5627,
"preview": "\n/****************************************************************************** \n*\n* file: MultiSwitchArg.h\n*\n* Copy"
},
{
"path": "environment/tclap/OptionalUnlabeledTracker.h",
"chars": 1721,
"preview": "\n\n/****************************************************************************** \n * \n * file: OptionalUnlabeledTrack"
},
{
"path": "environment/tclap/StandardTraits.h",
"chars": 4525,
"preview": "// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-\n\n/***************************************************************"
},
{
"path": "environment/tclap/StdOutput.h",
"chars": 8454,
"preview": "// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-\n\n/***************************************************************"
},
{
"path": "environment/tclap/SwitchArg.h",
"chars": 7659,
"preview": "\n/****************************************************************************** \n * \n * file: SwitchArg.h\n * \n * Cop"
},
{
"path": "environment/tclap/UnlabeledMultiArg.h",
"chars": 9619,
"preview": "\n/****************************************************************************** \n * \n * file: UnlabeledMultiArg.h\n * "
},
{
"path": "environment/tclap/UnlabeledValueArg.h",
"chars": 11445,
"preview": "\n/****************************************************************************** \n * \n * file: UnlabeledValueArg.h\n * "
},
{
"path": "environment/tclap/ValueArg.h",
"chars": 14148,
"preview": "/****************************************************************************** \n * \n * file: ValueArg.h\n * \n * Copyr"
},
{
"path": "environment/tclap/ValuesConstraint.h",
"chars": 3201,
"preview": "\n\n/****************************************************************************** \n * \n * file: ValuesConstraint.h\n * "
},
{
"path": "environment/tclap/VersionVisitor.h",
"chars": 2027,
"preview": "// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-\n\n/***************************************************************"
},
{
"path": "environment/tclap/Visitor.h",
"chars": 1258,
"preview": "\n/****************************************************************************** \n * \n * file: Visitor.h\n * \n * Copyr"
},
{
"path": "environment/tclap/XorHandler.h",
"chars": 4358,
"preview": "\n/****************************************************************************** \n * \n * file: XorHandler.h\n * \n * Co"
},
{
"path": "environment/tclap/ZshCompletionOutput.h",
"chars": 8000,
"preview": "// -*- Mode: c++; c-basic-offset: 4; tab-width: 4; -*-\n\n/***************************************************************"
},
{
"path": "tests/environment/Fail10Bot.py",
"chars": 270,
"preview": "from hlt import *\nfrom networking import *\n\n# Fails on turn 10.\n\nmyID, gameMap = getInit()\nsendInit(\"Fail10Bot\")\n\nturn ="
},
{
"path": "tests/environment/FailInitBot.py",
"chars": 101,
"preview": "from hlt import *\nfrom networking import *\n\n# Exits during initialization.\n\nmyID, gameMap = getInit()"
},
{
"path": "tests/environment/ModBot.py",
"chars": 982,
"preview": "from hlt import *\nfrom networking import *\n\nmyID, gameMap = getInit()\nsendInit(\"ModBot\")\n\nturn = 1\nwhile True:\n moves"
},
{
"path": "tests/environment/Timeout10Bot.py",
"chars": 302,
"preview": "from hlt import *\nfrom networking import *\n\n# Times out on turn 10.\n\nmyID, gameMap = getInit()\nsendInit(\"Timeout10Bot\")\n"
},
{
"path": "tests/environment/TimeoutInitBot.py",
"chars": 127,
"preview": "from hlt import *\nfrom networking import *\n\n# Times out during initialization.\n\nmyID, gameMap = getInit()\n\nwhile True:\n "
},
{
"path": "tests/environment/hlt.py",
"chars": 2540,
"preview": "import random\nimport math\nimport copy\n\nSTILL = 0\nNORTH = 1\nEAST = 2\nSOUTH = 3\nWEST = 4\n\nDIRECTIONS = [a for a in range(0"
},
{
"path": "tests/environment/networking.py",
"chars": 1928,
"preview": "from hlt import *\nimport socket\nimport traceback\nimport struct\nfrom ctypes import *\nimport sys\n\n_productions = []\n_width"
},
{
"path": "tests/environment/testenv.py",
"chars": 5277,
"preview": "import os\nimport subprocess\nimport sys\n\nmakeenvout = subprocess.Popen('cd ../../environment; make clean; make all', stdo"
},
{
"path": "tests/install.sh",
"chars": 960,
"preview": "add-apt-repository -y ppa:ubuntu-toolchain-r/test\napt-get update\n\n# Python\napt-get install -y python3\n\n# Java\napt-get in"
},
{
"path": "tests/runTests.sh",
"chars": 508,
"preview": "#!/bin/bash\nset -e\n\nfunction finish {\n echo \"Cleaning up\"\n cd $WORKINGDIR\n if [ -e ../temp.ini ]\n then c"
},
{
"path": "tests/scalabilityTests/main.py",
"chars": 1569,
"preview": "import configparser\nimport pymysql\n\nimport string\nimport random\n\nfrom boto.s3.connection import S3Connection\nfrom boto.s"
},
{
"path": "tests/setupMysql.py",
"chars": 301,
"preview": "import configparser\nimport os\n\nparser = configparser.ConfigParser()\nparser.read(\"../halite.ini\")\n\npasswordField = \"\" if "
},
{
"path": "tests/travisTests.ini",
"chars": 399,
"preview": "[test]\nisTest = 1\n\n[hce]\nmanagerURl = http://localhost/manager/\napiKey = 1234 \nsecretFolder = wrongFolder\n\n[email]\nemail"
},
{
"path": "tests/website/APITest.php",
"chars": 1261,
"preview": "<?php\ninclude_once \"../website/api/web/WebsiteAPI.php\";\n\nclass APITest extends PHPUnit_Framework_TestCase {\n protecte"
},
{
"path": "tests/website/GameTest.php",
"chars": 1254,
"preview": "<?php\n\ninclude_once \"../website/api/web/WebsiteAPI.php\";\ninclude_once \"APITest.php\";\ninclude_once \"UserTest.php\";\n\ndefin"
},
{
"path": "tests/website/HistoryTest.php",
"chars": 708,
"preview": "<?php\ninclude_once \"../website/api/web/WebsiteAPI.php\";\ninclude_once \"APITest.php\";\ninclude_once \"UserTest.php\";\n\ndefine"
},
{
"path": "tests/website/UserTest.php",
"chars": 1679,
"preview": "<?php\n\ninclude_once \"../website/api/web/WebsiteAPI.php\";\ninclude_once \"APITest.php\";\n\ndefine(\"USER_TABLE\", \"User\");\ncons"
},
{
"path": "tests/website/testFile.txt",
"chars": 0,
"preview": ""
},
{
"path": "tests/worker/languageBot/LANGUAGE",
"chars": 13,
"preview": "TestLanguage\n"
},
{
"path": "tests/worker/languageBot/run.sh",
"chars": 25,
"preview": "#Python\npython3 MyBot.py\n"
},
{
"path": "tests/worker/loseBot/MyBot.py",
"chars": 338,
"preview": "import hlt\nfrom hlt import NORTH, EAST, SOUTH, WEST, STILL, Move, Square\nimport random\n\n\nmyID, game_map = hlt.get_init()"
},
{
"path": "tests/worker/loseBot/run.sh",
"chars": 17,
"preview": "python3 MyBot.py\n"
},
{
"path": "tests/worker/testWorker.py",
"chars": 4621,
"preview": "import unittest\nimport sys\nimport os\nimport glob\nimport zipfile\nimport shutil\n\nWORKER_PATH = os.path.join(os.getcwd(), '"
},
{
"path": "tests/worker/winBot/MyBot.py",
"chars": 660,
"preview": "import hlt\nfrom hlt import NORTH, EAST, SOUTH, WEST, STILL, Move, Square\nimport random\n\n\nmyID, game_map = hlt.get_init()"
},
{
"path": "tests/worker/winBot/run.sh",
"chars": 17,
"preview": "python3 MyBot.py\n"
},
{
"path": "visualizer/.editorconfig",
"chars": 182,
"preview": "root = true\n\n[*]\nindent_style = tab\nend_of_line = lf\ncharset = utf-8\ntrim_trailing_whitespace = true\ninsert_final_newlin"
},
{
"path": "visualizer/.gitattributes",
"chars": 12,
"preview": "* text=auto\n"
},
{
"path": "visualizer/index.html",
"chars": 1318,
"preview": "<!DOCTYPE HTML>\n<html>\n<head>\n <title>Visualizer</title>\n\n <link href=\"lib/bootstrap.min.css\" rel=\"stylesheet\">\n "
},
{
"path": "visualizer/index.js",
"chars": 1787,
"preview": "$(function () {\n const fs = require('fs');\n var args = require('electron').remote.process.argv;\n if (args.lengt"
},
{
"path": "visualizer/main.js",
"chars": 902,
"preview": "'use strict';\nconst electron = require('electron');\nconst fs = require('fs');\n\nconst app = electron.app;\n\n// adds debug "
},
{
"path": "visualizer/package.json",
"chars": 1010,
"preview": "{\n \"name\": \"hailte-visualizer\",\n \"main\": \"main.js\",\n \"productName\": \"Halite-Visualizer\",\n \"version\": \"1.0.0\",\n \"des"
},
{
"path": "website/.htaccess",
"chars": 616,
"preview": "AddOutputFilterByType DEFLATE text/plain\nAddOutputFilterByType DEFLATE text/html\nAddOutputFilterByType DEFLATE text/xml\n"
},
{
"path": "website/404.php",
"chars": 1067,
"preview": "<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n <?php include __DIR__.'/includes/header.php'; ?>\n\n <title>404</title>\n\n "
},
{
"path": "website/about.php",
"chars": 4259,
"preview": "<html lang=\"en\">\n<head>\n <?php include 'includes/header.php'; ?>\n\n <title>About</title>\n\n <link href=\"lib/boots"
},
{
"path": "website/advanced_command_line.php",
"chars": 3562,
"preview": "<html lang=\"en\">\n<head>\n <?php include 'includes/header.php'; ?>\n\n <title>Halite Environment CLI</title>\n\n <lin"
},
{
"path": "website/advanced_development.php",
"chars": 2364,
"preview": "<html lang=\"en\">\n<head>\n <?php include 'includes/header.php'; ?>\n\n <title>Best Practices</title>\n\n <link href=\""
},
{
"path": "website/advanced_game_server.php",
"chars": 5643,
"preview": "<html lang=\"en\">\n<head>\n <?php include 'includes/header.php'; ?>\n\n <title>Game Servers</title>\n\n <link href=\"li"
}
]
// ... and 501 more files (download for full content)
About this extraction
This page contains the full source code of the HaliteChallenge/Halite GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 701 files (2.9 MB), approximately 788.2k tokens, and a symbol index with 3464 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.