MINI DOOM  ++    1   
 


    C++,      ?   .     MINI DOOM.  C++  ,   ,     ,     Doom.     C++20  :   ,   ,   , ,    ,    .     ,          .         ,      .   ,     ,     ,     .    ,  . 18+.





 

MINI DOOM  ++    1   









.     , ,      C++,   - . ,       .              Doom:  , , ,   ,   ,   -  .   ,         ,   .








 0.1    MINI DOOM   :  ,  , ,  .         



   0.1.       ,   .  ,  ,              .   ,       ,    .




   


 ,       ,       .          ,   ,    , , ,      ,   ,    .

     C++,   .      ,     ,     :  , , -3D,   ,    .

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




 Doom


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











  


    .     ,     .








 0.1    



      :     ,   ,         ,   ,    ,      .       .

  :     .     ,   : , ,  .         ,   .




  


      .      ,    ,      .    :  ,   ,    .     0.1.








 0.1    : ,     



     , $ ./a.out,    .    Visual Studio     :  Ctrl+F5,        . ,   ,   ,    .

    .              ,      .        ,   .    .

    ,    .     :       ,   .      GCC; Visual Studio      ,    1  ,     .




 


      .   .
































 


   Windows 10  11.    ,     Windows,   .

 Visual Studio 2026,   Community.   ,    1.

  . ,    .

  :  Doom    ,      .




 


      GitHub: https://github.com/RushSex/MiniDoom.         Code,  Download ZIP    git clone;         .   examples         ch01  ch29,         ,        .         .

     . ,   ,     ,  ,     ,    .    ,   .







 .  Visual Studio,        Hello, Doom!.  .




 


 MINI DOOM.  C++            .    ,     ,   .

  1.      18:  C++  ,       .

  2.      913:   Windows, ,  ,   , .

  3.     1419: , , ,   , .

  4.  -    2025: , , ,  , .

  5. ,       2629: , , , CMake  .

     GitHub: https://github.com/RushSex/MiniDoom.  examples/chNN   ,    examples/ch29/doom.   README      Visual Studio 2026.




 I.   



    ,    .       C++         .  ,   Windows,  ,   .         :    ,   ,    ,    .




 1. Hello, Doom



     ,      ,   Hello, World!.    ,     ,   Doom.      Visual Studio,   ,    ,        ,    ,   ,    .




      


    ,    .     :       ,   ,  .    ,      ,          .

   .   ,  ,           .  -,    ,  ,          .     ,   ,     ,    .exe.

    .              .   (   )            C++.   .      1.1.








 1.1       ,   



    ,    .      ,       ,   ,     .      .











 Visual Studio 2026


Visual Studio    :  , ,      .         Community,     .

   Visual Studio 2026 Community   Microsoft   .

  ,    .      C++.    MSVC,  Windows  ,     .

      .   ,      .


















 


 Visual Studio.      .         C++            C++  .  ,   ,  MiniDoom_ch01,   .

Visual Studio        .      Ctrl+F5:     Hello World. ,   .       1.1.








 1.1    Visual Studio,   




 


       :   , ,         .    ,    ,       ,    .      .

ٸ          .    :    :  ,      ,    .      1.2.








 1.2   ,      











Hello, Doom


   ,    Visual Studio,      1.1.   ,  :    .








 1.1   



 Ctrl+F5.  ,      ,      :  Hello, Doom!. ,  . , .  ,   ,   .

 1. #include <iostream>    ,        .    input/output stream   -.    ,      ,      .         iostream,       .

 3. int main()    main,    .    ,    .exe.  int   ,     ,          .     3  6      .

 4. . std::cout   ,     .  std:: ,  cout     std      .  <<     :  "Hello, Doom!\n"   .   \n      :     ,   Enter.       .

 5. return 0;   main    :   .      ,     - .  main  :  return , C++   0.     ,   .

  <<    ,    1.2.     :   ,    ,    .








 1.2   <<  :      std::cout    











  


 Hello, Doom!   ,        .   ,    ,    ASCII-.    1.2.








 1.2    MINI DOOM  



   :      ,     .     R"(...)"   713.        : \n   ,     ,   .     ,         .     :   R"(  )"      ,    .

 1, 5  6     .  :   //     .            ,  ,   .   .

     :  .   .       ,           .











  


         Ctrl+F5,      .  .             ,         . Ÿ   ,     .

      ,   .           1.3.








 1.3        4



  ,    .       1.3.








 1.3     : , , ,   



 :   main.cpp,   4,   34        return.    ,   .  ;    4    .








   .   1.4  cout  cot.








 1.4    : cot  cout



  ,   std   cot,    ,     . , , oct         ,      .   ,      :   ,    .

  .   1.5   ,    health,      .     ,    ,  .








 1.5   ,   



       ,    .       ,   .     :    .    ?    ,   - . ,      .

      GCC. Visual Studio          ,   .     1.3.








 1.3     GCC   Visual Studio



    :

   .         ,       .

        .

   ,     error.    ,    .

             .         .




 


      ,     .

 Visual Studio 2026       C++      .

    : C++20, /W4, /WX, /permissive-, /utf-8.

     main,    std::cout   <<.

   R"(...)"        ASCII-.

    :  ,      .

 :    ,     MINI DOOM.         ,   ,    ,   ,   .







 1.1. ?      1.6,   ,   .   .








 1.6   1.1



 1.2. .    1.7  . ?    ,   .








 1.7   1.2



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

 1.4..       1.5       /WX.      ?  ,       .







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

 1.2.  .        .        )"  ,  .      ? :       .

 1.3.  .     1.1   :  ,   ,  main,  #include   .            .       .




 2.   



   :       .    .   .  ,   ,  ,     , , .          ,    .  ,   ,       ,    .

    ,   ,   ,  7 / 2  C++  ,  0,1 + 0,2   0,3.     ,  ,     ,   .




    


  ,      .       .       ,  health,     100.    :    ,    .

         ,         .        ,          .    2.1.








 2.1   : , , 



 46   .  int health = 100;  :    int   health     100.  int   , double  .      ,    3,4     . :      ,   .

 810  .   std::cout   ,   ,  ,    .

 12  . ammo = ammo - 1;      :         .   C++  =   ,  : ,    ammo,        ammo.  50   49.

 13     : health -= 15;   health  15.      : +=, -=, *=, /=.  :     85   49 .








     ?  &      ,  sizeof    .  2.2   ,  ;  B    .








 2.2        



        .     ,        :        ,    .      : int  4 , double  8, char  bool   .     ,    2.1.








 2.1     2.2   : , ,   




  


  C++ ,        .  2.3     . std::numeric_limits     :     ,  ,            .








 2.3      



   int:     .        .   float      , double   .        double,  float         .     ,    2.1.








 2.1         MINI DOOM











   


,     C++  ,   .     .   2.4.








 2.4     



60 / 15 = 4    .  60 / 7  8,     8,57.   ,     , C++       .  ,   :  8,99    8.

     %: 60 % 7 = 4,   7 ? 8 = 56,   60   .    ,      :    ,  ,    ,  .

        60.0  60,     : 8.57143.      : 7 / 2 * 2   7,  6.  7 / 2  = 3,  3 ? 2 = 6.         .











:   


        . ,   9,75     .     ,       .     :   =    .      2.5.








 2.5     



 int ammo{average};      .  :        ,   ,   ,   .    narrowing conversion   ,        .

    =?   2.6   ,  -.








 2.6    =     



    :   ,   ammo  9.        ,   . Visual Studio    C4244,   /WX  .       ,      ,   .

     ,  ,       static_cast.   2.7       .








 2.7        



    0%,      .   ,    2.2:    ,  3 / 14    .      .     100,   ,  21%     .  static_cast<double>(kills)  kills      ,     21,4286%.








 2.2    :      ,     



     : static_cast<int>(time)   ,   83,9   83.  84   ,   .  ,    27,      .




  auto


   Doom  60 ,      .         60, , -, ,    ,  -,     ,             .        .     2.8.








 2.8   constexpr, const    auto



 35. constexpr int kImpHealth = 60;  ,      . Ÿ  ,        .  k          ,   .

 8. auto ammo = 50;       .   , , ammo  int. auto  ,     ,    :     ,   .

 9. const   ,         .       ammo,   const,   constexpr.

 11.   .   ;       ,     .     :   ,     .











  


      .  ,   int,        ,  ?    2.9.         ,       .








 2.9   int:     



   .    7     :   , 2147483647 + 1    int.      ,       .

     ?           2.10.








 2.10      



              ,   99999  00000.  :   C++       .   ,     ,        .    ,       -  .








        .  2.11 ,   0,1 + 0,2  .








 2.11     



  false,  .       ,   0,1   ,  1/3  .  ,       ,  0,1 + 0,2   0,3,   0,3  .  ,   ==  .     std::format     .


















 : std::format


    1,       ?  C++20    std::format   <format>.     :     ,     ,    .       2.2.








 2.2     std::format



     :      ,   ,   .    ,     std::format ,   .




 :  


  .   Doom   5  15   ,   60 .      ,      ?       ,      ?     2.12.








 2.12  :     



 58       .     .

 1213  ,   .      :          ,    .    ,       .  : (60 + 14) / 15 = 74 / 15 = 4 .  : (60 + 4) / 5 = 64 / 5 = 12.   :     61,   (61 + 14) / 15 = 5     .




  .


   .

   ,     (https://www.litres.ru/book/aleksey-primak/mini-doom-sovremennyi-s-cherez-igru-tom-1-uchimsia-derzhat-74670697/)  .

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


