Food.cpp 367 B

12345678910111213141516
  1. #include <windows.h>
  2. #include "Const.h"
  3. // Ãåíåðèðóåòñÿ ñëó÷àéíîå çíà÷åíèå, êîòîðîå èñïîëüçóåòñÿ â êà÷åñòâå êîîðäèíàòû åäû â ïîëå èãðû.
  4. void generate_food(int& food_x, int& food_y, int& columns, int& rows )
  5. {
  6. food_x = rand() % (columns - 2) + 1;
  7. food_y = rand() % (rows - 2) + 1;
  8. }
  9. //Óñòàíàâëèâàþòñÿ íà÷àëüíûå çíà÷åíèÿ äëÿ ïàðàìåòðîâ åäû.
  10. void init_food()
  11. {
  12. }