HabraWars-パイ​​ソンロボット

ドラフトは、プログラマー向けゲームのプレビューです 。 (非常に汚い、意見やコメントを収集するために公開されていますが、マイナスではないでください)

habrahabr.ru/blogs/sport_programming/74536

そして

habrahabr.ru/blogs/sport_programming/74523

一般的なエンジンで準備完了。 ゲームはターンベースであり、プレーヤープログラムへのインターフェイスはSTDIN STDOUTです。 任意のプログラミング言語を使用できます(I / Oをサポートしている場合、brainfuckでさえも)

wxPython(Linux / Windows / OSX)にGUIテスターがあり、スクリプトまたはバイナリをダウンロードできるサイト、デプロイされたプレーヤー評価システム(コード実行時間を含む)があります。 チームバトルとSDKは、いくつかの言語で計画されています。

すべて(サイトを含む)はGPLの下で非営利になります。

ダガーとフラッシャーは大歓迎です



PS ハブに関する議論の影響下で、文字通り一晩、絶対的な初心者によって書かれた厳密に判断しないでください アドバイスとコミットによるより良いサポート

更新:プレーヤープログラムの入力/出力形式の実際の説明を書きました

UPD ここに未完成のSDKがあります。Pythonのボットコードは次のようになります。



Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  1. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  2. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  3. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  4. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  5. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  6. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  7. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  8. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  9. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  10. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  11. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  12. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  13. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  14. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  15. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  16. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  17. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  18. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  19. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  20. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  21. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()



  22. Copy Source | Copy HTML #!/usr/bin/python """Sample game bot for python-robots""" import pyr-sdk class DumbBoot (pyr-sdk.Pobot): def main (self): """Main cyclic function: :))""" for enemyrobot in self .robots: if self .GetDistToRobot(enemyrobot)< 4 : self .FireToRobot(enemyrobot) if self .energy< 50 : self .KillYMySelf() if not self .isWallAhead(): self .Go() else : self .Left() ###########common part self .reloading() def start (self): """some code which run once""" pass if __name__== "__main__" : darvin_small_metal_guy = DumbBoot ()






All Articles