MINI DOOM  Python    1   
 


   MINI DOOM.  Python  .        Python 3.15:  Python  uv,         .     ,   ,   , ,   ,  ,   ,      Python           .

        ,   .      ruff  mypy --strict,    .

8 , 113    ,   ,   Python    .    GitHub

 ,        Python   .  ,  . 18+.





MINI DOOM  Python    1   








.     , ,      Python,   - . ,       .              Doom:  , , ,   ,   ,   -  .   ,         ,   .










 0.1    MINI DOOM   :  ,   ,   ,  .         



   0.1.       ,   .  ,  ,              .   ,       ,    .




   


 ,       ,       .          ,  ,  ,  , , ,      ,   ,    .

     Python,   .      ,     ,     :  ,   numpy, -3D,   ,  ,   .  Python    ,  ,        ,       .

  18+.  ,      (    ),          :   ,       . ,    .




 Doom   Python


  Doom    .   ,        ,   ,      :   ,   ,  numpy  ,  ,   ,   .   ,     ,       ,    .

 Python             . ,  Python       .  :      Python     ,  .          numpy,     ,     .    ,     ,        :   ,  , .











  


    .     ,     .










 0.1    



      :     ,   ,         ,   ,    ,      .       .

  :     .     ,   :    .         ,   .




  


      .      ,    ,      .    :  ,   ,    .     0.1.










 0.1    : ,     



     , $ python3 main.py,   .  Windows     python main.py,     uv run main.py:     1. ,   ,   ,    .

    .      Python 3.15     :  ruff        mypy   .        ,   .    .    :    ,    ,      .

 Python   ,    .     :      ,   .        ,        ,        .   ,     9.




 


      .   .






































 


   Windows, macOS  Linux.   ,   Python.

 Python 3.15   uv    ,    1.

  Visual Studio Code   Python  Ruff.    ,      .

  : numpy  pygame-ce.  uv      9.

  . ,    .

  :  Doom    ,      .      26  .




 


      GitHub: https://github.com/RushSex/MiniDoom-Python.         Code,  Download ZIP    git clone;         .   examples         ch01  ch29,         ,        .       minidoom: uv sync, uv run main.py   .

     . ,   ,     ,  ,     ,   .    ,   .







 .  Python,        Hello, Doom!.  .




 


 MINI DOOM.  Python            .    ,     ,   .

  1.      18:  Python  ,       .

  2.      913:  pygame-ce,   numpy,  ,   ,  .

  3.     1419: , , ,   , , .

  4.  -    2025: , , ,  ,  , .

  5. ,       2629: , ,   , uv, ruff, mypy  pytest.

     GitHub: https://github.com/RushSex/MiniDoom-Python.  examples/chNN   ,     minidoom.   README: uv sync, uv run main.py   .




 I.   


    ,    .       Python        .  ,  ,  ,   .         :    ,   ,    ,    .




 1. Hello, Doom


     ,      ,   Hello, World!.    ,     ,   Doom.      Python  ,   ,    ,      ,    ,   ,  Python  .




      


    ,    .     :       ,   ,  .    ,      ,          .

   .   ,  ,       .    C++            .exe.  Python   :          ,   ,    .    ,     python.

   ,         -       Python        .      1.1.










 1.1       :     ,   



      ,    . :     ,   . :    ,     .         ,     .  C++       .   Python           .        .











 Python


   Python   3.15,     2026 .     .     uv     Python  ,    Ruff.    Python  ,     ,    .       python.org     Add python.exe to PATH   ,   uv  .

  PowerShell ( Windows)   ( Linux  macOS).

  uv.  Windows: powershell -c irm https://astral.sh/uv/install.ps1 | iex.  Linux  macOS: curl -LsSf https://astral.sh/uv/install.sh | sh.       docs.astral.sh/uv.

     ,    uv.   Python: uv python install 3.15.

   : uv tool install ruff  uv tool install mypy.     .

,    ,   python --version, ruff --version  mypy --version.     ,     .




















   


     ,    Visual Studio Code     Microsoft,   Python.     code.visualstudio.com, ,        : Python  Microsoft  Ruff  Astral.     Python,        .

 .  -  mini_doom,  VS Code   ?     .   main.py   Python       .       (  ?  )  python main.py.      1.1.










 1.1    VS Code,   











Hello, Doom


  main.py    1.1.   ,  :    .










 1.1   



.     ,      :  Hello, Doom!. ,  . , .      :  ,   main,    .   Python  .

    . print   ,  ,     ,   .       .    ,   , .    Hello, Doom!:   .   Python,    ,   ,     .   print      .

 print             .       : sep ,   ,  end    .     1.2.










 1.2   print:  , sep  end



 1.          .    ,  Python ,   . print    .

 2. sep=   ,  HEALTH:  100 .

 35. end=     .   print    Loading OK     .

 6. print     .

 7. 2 + 2 =     ,    .  2 + 2    : Python     4.  print    ,    1.2.










 1.2   print:      ,    











  


 Hello, Doom!   ,        .   ,    ,    ASCII-.    1.3.










 1.3    MINI DOOM  



 1  2   .  :   #    Python .            ,  ,   .   .

 3. TITLE =     : ,    .       ,   ,         TITLE    11   ,  .        Python   , ,   .

        .           ,          .      :  .   :      ,           .

    r  .      \   : \n   , \t  .      .  r    (raw):       .  ,   ,    1.4:    r,      Ruff.










 1.4   r: Ruff   



Ruff :   3,   4   escape- \/      Python .     ,      14,   .  Ruff   :  r  .  Python      SyntaxWarning,   .        \n,        ,       .











 Python 


         ,       .  .            .    ,   ,     .

    .   ,      Python.     ,     -,      .       1.5.










 1.5       2



  ,    .       1.3.










 1.3     : , ,   



Python :   main.py,   2,      ,   ^ ,  .  :  1   , MINI DOOM  .       .










      .    ,   .   ,      .   1.6  print  pirnt.










 1.6     



?       ,     .   (traceback)    ,     .    :    . NameError:  pirnt  . Python  ,      print.      ,        .  , Ready.,    .

    . ,      ,   ,  ,         .      ,    .      ,     .     .       ,   ,   ,   .   Ruff.        1.7.










 1.7      Ruff:    



Ruff  ,   : F821    pirnt,  3,  1.        ,        Ruff.

    . Python  ,     .     ,    ,      : ,  .   1.8       .










 1.8      



 ,    2  . TypeError:      ,    int,    .     ,    ,      .

      mypy,   .      ,     ,   ,   .     1.9.










 1.9     mypy



mypy :  3,    +  str  int,      .       ,    .      : print(AMMO:, ammo)   ,  print     .

    1.2.










 1.2   ,   ,    



    :

    :     ,   .

        .

   ,     Error. Python   ,    ,   : Did you mean?

             .         .




 


Ruff  mypy   :       .      .    Python    pyproject.toml   .     main.py  ,    1.10.










 1.10   :  Ruff   mypy



 [project]   : ,     Python.  [tool.ruff.lint]    Ruff:      ,   (E, W)    (F)    (B),   (UP)    (SIM, PL).     : Ruff      ,      .  ignore   ,       ,  ,      .  [tool.ruff.lint.pylint]    : Ruff          ,         ,    .  strict = true   [tool.mypy]   mypy   .

          ,     .     ,    1.11:        .










 1.11    : Ruff, mypy    











 


  Python     ,    -   .

 Python   uv,    VS Code   Python  Ruff.

   Python     : print(Hello, Doom!).

 print     ; sep  , end   .

     ,  r       ASCII-.

    ( )     (,    ).   :   Ruff,   mypy.

    .

 :    ,     MINI DOOM    Ruff  mypy.         ,   ,    ,   ,   .







 1.1. ?      1.12,   ,   .   .










 1.12   1.1



 1.2. .    1.13  . ?    ,   .










 1.13   1.2



 1.3. .   PRESS ENTER     +,   |.    :    ,   .

 1.4..    1.6    ,   .    1.5   .  ?         ?







 1.1.  .  ,           Loading textures ...... OK,   OK        .   .

 1.2.  .        .          .      ?

 1.3.  .     1.1   :  ,   ,  Print   ,        .            .       Ruff:        ?




 2.   


   . , , , ,   ,   .         ,   .           ,   ,        ,    .    ,     ,   .




    


 ,  .     :  100,  imp,  3.4.   ,        .        Python: ,   .  health = 100  :       100      health.  =     ,  .










 2.1   : , , 



 13   .    ,   : health, ammo, player_speed.   Python ,  Ruff ,     PlayerSpeed ,   .               if  for.

 9. ammo = ammo  1      ,     :  ,     ammo,  ,     .  10     : health -= 15  health = health  15.    +=, *=, /=  .

     , Python   .   2.2.










 2.2           



 2. armor = health   :      100   .  health is armor   3   : True,      .  type(health) ,     int   .

 5. health -= 15         Python ,    .        85,   health   . armor      100.   ,    2.1.










 2.1      .       ,    











  


            .   ,     :  ,  ,     ,      1, .     type,            .     2.3.










 2.3       



 6  7   ,   .  8  : int(42)    ,     ; float(2.5)  ; str(7)  ,      .   9  ,     3:      ,    .     2.1.










 2.1    Python



    : 1_000_000   ,  1000000,     .




,   


       . ,  C++  int   2 147 483 647,      ,         . -          .  Python  int  ,   2.4.










 2.4    Python   



 2**100   2   ,      .  2     3011 ,  Python   .       :   ,     .     ,    .











:   


 ,       : +,   *.     Python ,        .  2.5.










 2.5   ,    



 /   .   float,    : 6 / 2  3.0,   3.

 //     : 7 // 2  3.      .

 %    : 7 % 2  1.    .

 divmod(a, b)      : 200    3   20 .











  


       ,    Doom.     2.6.










 2.6  ,    



 4. kills / total   ,  ,   100  .  C++    :     ,    0.  Python  /  .




  .


   .

   ,     (https://www.litres.ru/book/aleksey-primak/mini-doom-sovremennyi-python-cherez-igru-tom-1-uchimsia-der-74683472/)  .

      Visa, MasterCard, Maestro,    ,   ,     ,  PayPal, WebMoney, ., QIWI ,       .


