国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

代寫ENGR1010J、代做C/C++設(shè)計(jì)編程
代寫ENGR1010J、代做C/C++設(shè)計(jì)編程

時間:2024-12-11  來源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯



ENGR1010J FA2024 Lab6: Pac-Man
Due date: 23:59, December 9, 2024
Background
Pac-Man is a classic video game released in 1980. In this lab, we just need to create a basic gaming
interfac e so that we humans can play with it.
This is a screenshot from a Pac-Man game. A typical Pac-Man world contains a cute Pacman, walls,
small foods, big energy capsules, and lovely ghosts.
To make our lives easier, our version of "Pac-Man" does not feature such fancy graphics. Instead, it is
composed of all ASCII characters. Pacman is represented by a similar-looking  C , walls by  # , foods
by  . , capsules by  o , and ghosts by  @ . (The provided templates print boundaries, so you do not
need to consider them.) The picture below shows the game interface in the console.We have provided compiled executables for Windows, MacOS, and Linux. We recommend you run
the executable and play the game to get a basic idea of what you should do. Also, when you have
any doubt about whatever part you write, if your behavior matches our example program, it is
(almost) sure to say you are safe.
On MacOS or Linux, in order to run the provided executable, you may need to first run the command
 chmod +x Pacman_MacOS_arm64/x86  or  chmod +x Pacman_Linux  under the path of the text file in your
terminal. Contact TAs if you have any problems.
Unlike in the real-time video game Pac-Man, we control our Pacman frame by frame. The game will
pause every frame and wait for your input. You can type " w/a/s/d " into the game to move Pacman,
or " i " for it to stand still. Confirm your input by “Enter”, and the game will show you the next frame.
PartA: Make a Game From Scratch
Files
We have provided you with code templates, which contains  lab6.h ,  io.cpp ,  game.cpp ,  main.cpp .
The contents of each file are listed below:
File Content
lab6.h All the structs and variables as well as the function prototypes.
io.cpp Functions dealing with user inputs and output the game interface in the console.
game.cpp To realize all the functions given in lab6.h.
main.cpp The main function.
In this lab, what you need to do is to fill up the functions in game.cpp according to the comments and
instructions. Then you can run the main.cpp to test your codes with code runner. Use the command
line to compile  io.cpp ,  main.cpp ,  game.cpp  together:
 g++ -std=c++1z game.cpp main.cpp -o lab6 -I -lm . If you have any questions regarding compile
issues, feel free to ask!
However, if you think the functions in  game.cpp  are not enough, you are allowed to write your
own functions in  game.cpp , and do not forget to declare it in  lab6.h .
Variables and Functions
The game operates by a  struct game  structure. We have already specified some components of it:typedef struct game {
//Part A
 char** grid; // a 2-dimensional array of characters to display the game;
 int rows; // number of rows of the grid;
 int columns; // number of columns of the grid;
 int foodCount; // number of remaining food in the game;
 int score; // current score;
 GameState state; // the state of the game, one of losing, onGoing, or winning.
} Game;
Feel free to add more components to this structure if you would like to.
Apart from the structure, there are many functions you need to write for this game to operate. When
implementing provided function prototypes in the templates, you should follow the instructions below,
or see the comments. You MUST NOT modify the function names, or add/remove parameters. You
can also add more functions if you like. We will not check any function that are not provided.
A game of given rows and columns is created by calling the function
 Game* NewGame(int rows, int columns) . In this function, You should:
dynamically allocate space for a Game pointer
initialize all member variables of your Game structure. (For example,  foodCount  and  score 
should be initialized to 0.)
create the member grid by dynamically allocating a 2-dimensional array of given size.
Boundary is not included in either rows or columns, and the cell at top-left corner is at row 0 and
column 0.
When the game ends, the function  void EndGame(Game* game)  is automatically called. In this function,
you should:
free any memory you dynamically allocated, such as grid.
free the parameter game, as it is also dynamically created.
Walls, foods and Pacman are added to the game by functions  AddWall ,  AddFood , and  AddPacman . In
these functions you should:modify the grid in your  Game  structure to make sure whatever item you add displays correctly.
make sure all of these game components can only be added to an empty cell.
make sure Pacman cannot be added to the game if there is already a Pacman.
Finally, you can write the function  void MovePacman(Game* game, Direction direction)  to control your
Pacman.  Direction  is an enum of  {up, down, left, right, idle}  . The rule to move your Pacman
is as follows:
On  idle , Pacman will stay still.
If Pacman would move to an empty cell, Pacman will do so successfully;
If Pacman would move to a food cell, Pacman will move to it and eat the food. Your score will
increase by  FOOD_SCORE = 10 . If Pacman eats the last food, you win the game. You should mark
the state of this game as winning.
If Pacman would bump into a wall or a boundary, Pacman will stay still.
In any of the cases above, your score should decrease by 1, for one turn you have played.
You can have a better understanding of the whole process by reading the sample  main()  function in
 main.cpp  and function  void PlayGame(Game* game)  in  io.cpp .
Time to play!
You can initialize your custom game in your  main()  function by calling  NewGame . After that, you can
add walls and foods to any specific location by  AddWall  and  AddFood . Don’t forget to add a Pacman
by AddPacman to the game.
When your game is prepared, you can call the provided  PlayGame  function. When you win or lose,
 PlayGame  will terminate by calling  EndGame .
If your game runs... Congratulations! You now have a "complete" Pacman game. You can submit it to
JOJ for Part A, and the first three testcases are for Part A, so don't worry if you cannot pass the last
cases now. However, the game seems a little boring, let’s go to Part B...
Part B: Here come the ghosts!
Your game is missing a part of the greatest fun - the ghosts. In this part, you will add ghosts and
energy capsules to your game so that it will become more playable.
We do not force any restrictions on how you should store your data for ghosts and capsules. Do you
think you need to write a structure, especially for ghosts? If so, what do you need to store in it? Your
design can be in any way you like (but still try not to use global variables), as long as it meets the
requirements below:Requirements for ghosts:
There are at most  MAX GHOSTS = 30  ghosts.
Ghosts are added to the game by the function
 bool AddGhost(Game* game, int r, int c, Direction direction) .
This function is slightly different, as ghosts can be added on a cell with food or a capsule.
Ghosts cover foods and capsules in display, so their cells (originally  .  or  o ) will be
displayed in  @ . However, those food or capsules must still exist, and should be displayed
again when ghosts leave their cells.
 Direction  defines how a ghost moves. Ghosts move either in a horizontal line or a vertical
line. The parameter  direction  in this function is the ghost’s initial direction.
Ghosts are moved by the function  void MoveGhosts(Game* game) .
This function will move all ghosts in the game by one step to their own directions.
Ghosts should be moved in the order they were added.
If a ghost would move onto a cell with food or a capsule, it will cover the food or capsule in
display, so that cell (originally  .  or  o ) will be displayed in  @ . However, that food or capsule
must still exist, and should be displayed again when this ghost leaves that cell.
If a ghost would bump into a wall, another ghost, or a boundary, its direction will reverse,
and it will try to move in the new direction immediately this turn. If then it would bump into
another wall/ghost/boundary, it will stop and won’t move for this turn, with its direction
reversed.
Now it is possible to lose the game. By rules, Pacman always moves first. There are three situations
that need to be specified:
If Pacman directly bumps into a ghost, Pacman will move to that cell, and get killed. You should
mark the game state as losing.
If a food or a capsule is below that ghost, Pacman cannot eat it.
If Pacman moves to a cell that a ghost also attempts to move to, Pacman will perform a
successful move, and the ghost then moves onto Pacman’s cell. You will also lose the game.
Requirements for capsules:
Capsules are large foods that give Pacman superpower. Therefore, capsules are counted as the
number of foods in the game. Pacman must eat all food and capsules to win.
Capsules are added by the function  bool AddCapsule(Game* game, int r, int c) . Like food, a
capsule cannot be added to a cell with a wall, a Pacman, or a ghost. However, a capsule can be
added to a cell with a food, resulting in that food being upgraded to a capsule.
When Pacman eats a capsule, your score will increase by  CAPSULE SCORE = 50 , and Pacman will
gain superpower for its next  CAPSULE DURATION = 10  moves. Its superpower is that:
All ghosts will be scared, and their display change from  @  to  X . When Pacman’s
superpower expires, they change back to their cute evil faces  @ .Scared ghosts are slowed down by 50%, which is shown by that they cannot move every
other turn.(We cannot move ghosts by half a cell, after all) They will be able to move on the
same turn when Pacman eats a capsule, but cannot move the next turn. This goes on until
Pacman’s superpower expires.
When with superpower, Pacman can eat ghosts! When Pacman moves onto a grid with a
scared ghost, it eats the ghost, earning a score of  GHOST SCORE = 200 . If there is a food or a
capsule below that ghost, Pacman eats it as well. That ghost will not respawn and can be
removed from the game. The same goes for the case when a scared ghost bumps into
Pacman.
Pacman’s superpower activates immediately when it eats a capsule, and counts down right after
Pacman’s turn, starting from its next turn. For example, if Pacman and a scared ghost attempt to
move onto the same grid on Pacman’s 10th turn of superpower, Pacman will move first, but its
superpower will immediately expire, and that ghost, not scared anymore, can kill Pacman. In
other words, Pacman’s superpower ends after 10 turns at the same moment of eating a capsule.
If Pacman eats another capsule while it has superpower, the duration of superpower will be
refreshed to 10 turns, rather than stack. In this case, it is possible that a scared ghost has
already moved on the turn(the new 9th turn) right before the turn when Pacman’s superpower
expires(10th). That ghost can still move on its next turn(10th), because it will not be a scared
ghost then.
Finally, you can add ghosts and capsules to your game in your main function, and enjoy the finished
game of Pacman. The submission is the same as how you did for part A. Good luck and have fun!
Rubric
Tasks
Part A: 30 pts
Part B: ** pts
Oral Explanation: 30 pts
Total: 150 pts
Deduction
Late submission on Canvas: -20 pts per day. JOJ will be closed on the day of the lab, so no late
submission will be accepted on JOJ.
Global variables: Using global variables in such a big project could be dangerous and you will
lose 10 points for each global variable.Submission
You need to compress your  game.cpp  and  lab6.h  file into a single zip file and submit it to JOJ.

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp




 

掃一掃在手機(jī)打開當(dāng)前頁
  • 上一篇:代做CS-107、java程序語言代寫
  • 下一篇:CE235編程代寫、代做python程序設(shè)計(jì)
  • 無相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業(yè)CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務(wù) 管路
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真技術(shù)服務(wù)
    流體CFD仿真分析_代做咨詢服務(wù)_Fluent 仿真
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲勞振動
    結(jié)構(gòu)仿真分析服務(wù)_CAE代做咨詢外包_剛強(qiáng)度疲
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)40個行業(yè)
    流體cfd仿真分析服務(wù) 7類仿真分析代做服務(wù)4
    超全面的拼多多電商運(yùn)營技巧,多多開團(tuán)助手,多多出評軟件徽y1698861
    超全面的拼多多電商運(yùn)營技巧,多多開團(tuán)助手
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服務(wù)平臺
    CAE有限元仿真分析團(tuán)隊(duì),2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內(nèi)
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗(yàn)證碼 豆包網(wǎng)頁版入口 破天一劍 目錄網(wǎng) 排行網(wǎng)

    關(guān)于我們 | 打賞支持 | 廣告服務(wù) | 聯(lián)系我們 | 網(wǎng)站地圖 | 免責(zé)聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網(wǎng) 版權(quán)所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    久久久com| 影音先锋欧美在线| 亚洲欧美99| 午夜精品一区二区三区在线视| 青青青青在线视频| 国产一区在线免费| 久久人人爽人人爽人人片av高清 | 中文字幕一区二区三区乱码| 国产精品一区二区在线观看| 久久久亚洲网站| 日本欧美视频在线观看| 国产亚洲欧美另类一区二区三区| 久久免费一级片| 青青草视频国产| 欧美精品一本久久男人的天堂| 日韩成人在线资源| 国产精品久久久久久影视| 色婷婷精品国产一区二区三区| 国产人妻人伦精品| 久久天堂av综合合色| 无码人妻aⅴ一区二区三区日本| 国产国产精品人在线视| 精品91一区二区三区| 久久久久狠狠高潮亚洲精品| 欧美在线视频观看免费网站| 久久亚洲私人国产精品va| 欧美精品在线一区| 久久黄色免费看| 亚洲一区二区三区在线观看视频 | 国产亚洲精品自在久久| 亚洲AV无码成人精品一区| www日韩欧美| 日韩av在线第一页| 国产精品美女在线观看| 国产免费xxx| 无码av天堂一区二区三区| 日韩中文字幕在线视频播放 | 国产国产精品人在线视| 欧美日韩dvd| 91久久久久久久久久| 国产精品国色综合久久| 91精品久久久久久久| 亚洲综合中文字幕在线| 日韩亚洲精品电影| www日韩视频| 亚洲免费视频一区| 久久视频这里只有精品| 91|九色|视频| 国产一区二区不卡视频在线观看| 痴汉一区二区三区| 精品国产aⅴ麻豆| 国产又大又硬又粗| 日韩av播放器| 欧美精品激情在线观看| 久久精品国产sm调教网站演员| 国产综合免费视频| 日韩女在线观看| www.欧美三级电影.com| 91精品久久久久久久久久另类| 精品无码一区二区三区爱欲| 日本成人黄色免费看| 久久久久久久久久久久久久国产 | 国产精品国产精品国产专区蜜臀ah| 久久最新免费视频| 国产伦精品一区二区三区免费视频| 欧洲国产精品| 日本欧美一二三区| 亚洲高潮无码久久| 伊人久久大香线蕉午夜av| 久久天天躁狠狠躁夜夜躁2014 | 久久久精品电影| 久久精品久久精品国产大片| 国产日韩精品一区二区| 欧美在线视频一区二区| 日日摸天天爽天天爽视频| 亚洲字幕一区二区| 一区中文字幕在线观看| 精品中文字幕在线观看| 国产精品女主播视频| 国产素人在线观看| 欧美国产激情视频| 欧美精品成人一区二区在线观看| 日本免费不卡一区二区| 亚洲 中文字幕 日韩 无码| 中文字幕中文字幕一区三区| 欧美日韩xxx| 久久人人爽人人爽人人片av高清| 国产午夜精品在线| 免费久久99精品国产自| 亚洲欧洲日夜超级视频| 在线国产精品网| 亚洲一区二三| 无码人妻精品一区二区蜜桃网站| 亚洲欧洲国产日韩精品| 亚洲成人一区二区三区| 亚洲黄色网址在线观看| 亚洲www永久成人夜色| 动漫一区二区在线| 五月天综合婷婷| 日本欧洲国产一区二区| 青青青国产精品一区二区| 欧洲精品在线播放| 欧美中文字幕在线观看| 欧美一区二区在线视频观看| 欧美国产一区二区在线| 国产小视频免费| 成人av在线亚洲| 青青草精品毛片| 青青草国产精品视频| 黄色大片中文字幕| 国产一区二区黄色| 99久久激情视频| 国产二区视频在线播放| 日韩亚洲欧美中文在线| 国产精品久久九九| 一区二区三区一级片| 天天干天天操天天干天天操| 婷婷精品国产一区二区三区日韩| 日韩欧美在线观看强乱免费| 欧美精品v日韩精品v国产精品| 美日韩精品免费| 成人毛片一区二区| 久久国产亚洲精品无码| 国产精品免费观看在线| 中文字幕99| 日本精品一区二区三区视频| 欧美激情 国产精品| 国产日本欧美在线| 久章草在线视频| 国产精品流白浆视频| 欧美激情精品久久久久久| 亚洲一区二区免费在线| 日本手机在线视频| 精品一区二区三区毛片| av不卡在线免费观看| 久久久久在线观看| 欧美成人亚洲成人| 日韩中文字幕av在线| 激情深爱综合网| 91精品国产网站| 国产精品久久久久久久久久新婚| 亚洲欧美日韩精品综合在线观看 | 人禽交欧美网站免费| 国产欧美日韩在线播放| 国产不卡精品视男人的天堂| 国产精品美女免费| 午夜老司机精品| 国产在线999| 久久久久久一区二区三区| 操日韩av在线电影| 日本不卡在线观看| 国产裸体写真av一区二区| 久久久久久久久久久成人| 一区二区三区在线视频看| 欧美少妇在线观看| 国产欧美韩国高清| www.亚洲成人| 亚洲一区二区三区四区视频| 黄色一区三区| 久久久久久www| 欧美激情久久久久久| 人人妻人人澡人人爽欧美一区 | 一区二区在线观看网站| 欧美激情国产日韩| 久久全球大尺度高清视频| 久久中文字幕在线视频| 日本黄网站免费| 国产精品一区二区免费看 | 国产福利视频在线播放| 欧美日韩高清在线观看| 欧美做受高潮1| 久久影院理伦片| 欧美激情亚洲另类| 黄色网址在线免费看| 久久噜噜噜精品国产亚洲综合| 麻豆成人在线看| 欧美欧美一区二区| 久久久久99精品成人片| 亚洲一区二区精品在线| 免费日韩中文字幕| 日韩中文字幕视频| 三级网在线观看| 高清一区二区三区视频| 久久天天躁狠狠躁夜夜躁2014| 欧美亚洲视频在线看网址| 国产成人在线精品| 亚洲www永久成人夜色| 国产精品有限公司| 欧美成人在线影院| 黄色成人在线看| 久久九九亚洲综合| 青青久久av北条麻妃黑人| 国产第一区电影| 午夜精品一区二区三区在线播放| 成人免费福利在线| 欧美激情亚洲综合一区| 国产日韩欧美另类| 国产精品久久久久久久久免费| 欧美午夜精品久久久久久蜜| 久久国产精品-国产精品|