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

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

ECE2810J代做、代寫C++語言編程
ECE2810J代做、代寫C++語言編程

時間:2024-11-24  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



ECE2810J — Data Structures
and Algorithms
Programming Assignment 3
— UM-SJTU-JI (Fall 2024)
Notes
• Submission: on JOJ
• Due at Dec 1st, 2024, by 23:59
1 Introduction
In this assignment, you are tasked with implementing a C++ solution to a simpliffed version of the “sokoban” game,
where the objective is to push speciffc boxes to designated target positions on a grid. The challenge lies in devising an
efffcient strategy to navigate the grid, avoid obstacles, and ensure that all required boxes reach their target locations.
Your program should be able to handle various conffgurations of boxes, walls, and goals, ensuring the correct boxes are
pushed to their intended destinations. This project is C++ only, no other language is allowed.
2 Programming Assignment
2.1 Read Map
The map is designed as a grid where each cell is either a walkable path, a wall, or a point of interest (like the starting
point or a box). The ffrst line of the ffle deffnes the dimensions of the map in terms of columns and rows. The rest of
the ffle speciffes the content of each cell in the grid, using a series of symbols to represent different elements:
• . - Path: This represents a walkable path where the player can move freely. Boxes can also be pushed across
this type of cell.
• # - Wall: This represents an impassable barrier. Neither the player nor the boxes can pass through these cells.
• S - Starting Point: This is where the player begins. Each map should contain exactly one S character.
• B - Box’s Original Position: The initial position of a box.
• T - Target Position for Boxes: The destination cell for a box.
• R - Box at Target Position: This indicates that a box has been successfully pushed to its target position.
To ensure a valid and challenging map, the following constraints must be met:
(1) The outermost boundary of the map must be composed entirely of walls (#) to prevent the player or boxes from
exiting the map area.
(2) Each map must contain exactly one starting point (S).
(3) For test cases of the ffrst part on JOJ, the number of boxes (B) will be less or equal to 8 and the result of rows
times columns should be less or equal to 800.
(4) For test cases released on Canvas, it can be very complicated.
The player can move in four cardinal directions:
• Up
1• Down
• Left
• Right
The player can push a box if it is adjacent in one of these directions, and if the cell behind the box in that direction is
a path (.). Boxes can only be pushed. In other words, they cannot be pulled. Only one box can be pushed at a time,
and the player must move to the former box’s position after pushing it.
Below is an example of a map conffguration ffle. In this example, the map size is speciffed on the ffrst line as 11 10,
indicating 10 rows and 11 columns. The outer boundary is composed of walls (#), while inner cells deffne paths, the
starting point, box positions, and target positions.
11 10
###########
#..#..#...#
#..B....#.#
#..##.#...#
##.#...B###
##.#.....##
#SBBTT#..##
#..#.TT.###
####..#####
###########
2.2 Search routes
Help the player to ffnd the shortest route to push all the boxes to the expected place. Please notice that it is possible
that there are multiple boxes and multiple target positions. The player should push all the boxes to the target positions.
2.3 Show the route
The task requires the program to display the player’s route on the map, detailing each movement step-by-step. Each
step should be represented by a character indicating the direction moved:
• U for up
• R for right
• L for left
• W for down
For instance, given the map conffguration shown, the route may look like:
DRURRUURUURRDDDLLLDDRRRURULLLDLDRULLLUUULUURDRRURDDDDDLLLUUULURRRURDDDDULD
This format will be used as the return value of the solve function provided in the template code.
Bonus Requirements
(1) Display the map, player, boxes, and other elements at each step using the same format as the input map. Store
all the map state in a ffle, ensuring it is clear and easy to read.
2(2) Use a graphical interface to visually represent each step, showing the map, player, boxes, and other elements in
their updated positions. The output should be displayed as an animation, with each step shown for a brief period
before transitioning to the next step.
2.4 Unsolvable Maps
In some cases, a map conffguration may be unsolvable due to the positioning of walls or boxes, creating an impasse
that prevents the player from reaching all targets. Such conffgurations are referred to as “invalid maps.” This occurs
when one or more boxes are placed in positions from which they cannot be moved to their designated target cells.
A map is considered invalid if:
• There is more than one starting point or no starting point.
• There are more boxes than target positions.
• A box is surrounded by walls or other boxes in a way that makes it immovable.
• Any box is placed in a corner or against a wall where it has no path to the target position.
The following example demonstrates a typical invalid map layout:
11 10
###########
#..#..#...#
#.#B....#.#
#..##.#...#
##.#....###
##.#.....##
#S..TT#..##
#..#.TT.###
####..#####
###########
In this map: The box (B) is located next to walls on two sides, which prevents it from being moved toward the target
position (P).
When the program encounters such a conffguration, it should recognize the situation as unsolvable and output a
message as “No solution!” The program should then terminate without attempting to ffnd a solution or display a route.
3 Input / Output
As mentioned above, the input map is stored in a ffle. To test your program, you can use the following command to
read the map from a ffle:
1 ./main < inputMap.txt
For submission on JOJ, the output (i.e. the return value of the function) should either be “No solution!” or the route
to push all the boxes to the target positions.
If you have implemented the ffrst bonus requirements, you should ffrst display the steps in the format mentioned above,
and then display the map at each step. We highly recommend you to store the map at all steps in a ffle. For example,
if the output is stored in a ffle named output.txt, you can use the following command:
31 ./main < inputMap.txt > output.txt
If you have implemented the second bonus requirements, you should display the map in a graphical interface.
4 Submission
(1) For part 1 on JOJ, submit your source code in one ffle named sokoban.hpp. Your source code should include a
function named solve and a function named read_map.
(2) For part 2 on JOJ, put the detailed route output in the answers part in sokoban.hpp. The test cases will be
released on canvas, which may take a long time for your program to run. Please notice that part 2 and bonus
will be graded if and only if you can pass 80 percent of the test cases in part 1.
(3) Submit the source code on Canvas along with a corresponding Makefile to compile the source code. A sample
Makefile is provided on Canvas, which you may modify as needed. Your code submitted on Canvas should be
able to compile successfully and output the detailed route with the corresponding input ffle.
(4) (Optional) If you have implemented the ffrst bonus requirement, you also need to submit the output ffles on
Canvas. The naming format should match the original ffle name. For example, if the input ffle is named big_1.in,
the output ffle should be named big_1_detail.out. Failure to follow the correct naming format will result in
an invalid submission.
(5) (Optional) If you have implemented the second bonus requirement. You may come to the TA’s offfce hours
to demonstrate your program. The due date will be the same. The TA will give you a score based on the
demonstration.
5 Implementation Requirements and Restrictions
5.1 Requirements
• You must make sure that your code compiles successfully on a Linux operating system with g++ and the options
-std=c++1z -Wall -Wextra -Werror -pedantic -Wno-unused-result -Wconversion -Wvla.
• You can use any header ffle deffned in the C++17 standard. You can use cppreference as a reference.
5.2 Memory Leak
You may not leak memory in any way. To help you see if you are leaking memory, you may wish to call valgrind, which
can tell whether you have any memory leaks. (You need to install valgrind ffrst if your system does not have this
program.) The command to check memory leak is:
valgrind --leak-check=full <COMMAND>
You should replace <COMMAND> with the actual command you use to issue the program under testing. For example, if
you want to check whether running program
./main < input.txt
causes memory leak, then <COMMAND> should be “./main < input.txt”. Thus, the command will be
valgrind --leak-check=full ./main < input.txt
45.3 Code Quality
We will use cpplint, cppcheck to check your code quality. If your code does not pass these checks, you will lose some
points.
For cpplint, you can use the following command to check your code quality:
1 cpplint --linelength=120
,→ --filter=-legal,-readability/casting,-whitespace,-runtime/printf,
2 -runtime/threadsafe_fn,-readability/todo,-build/include_subdir,-build/header_guard
,→ *.h *.cpp
For cppcheck, only things related to error will lead to deduction. You can use the following command to check your
code quality:
1 cppcheck --enable=all *.cpp
6 Grading
6.1 Correctness
We will use the test cases on JOJ and Canvas to verify the correctness of your code. This section will have a total
score of 100 points.
6.2 Code Quality
Bad code quality will lead to a deduction of up to 20 points.
6.3 Bonus
For the ffrst bonus requirement, you can get up to 10 points. For the second bonus requirement, you can get up to
30 points. Please notice that bonus will be graded if and only if all the small test cases are passed. What’s more, the
total score will not exceed 130 points.
7 Late Policy
Same as the course policy.
8 Honor Code
Please DO NOT violate honor code.
Some behaviors that are considered as cheating:
• Reading another student’s answer/code, including keeping a copy of another student’s answer/code
• Copying another student’s answer/code, in whole or in part
• Having someone else write part of your assignment
• Using test cases of another student
5• Testing your code with another one’s account (Testing chances are limited)
• Post your code to github
9 Acknowledgement
This programming assignment is designed based on ENGR1510J Lab 3.
6

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




 

掃一掃在手機打開當前頁
  • 上一篇:代寫I&C SCI 46 、c/c++,Java程序語言代做
  • 下一篇:CS1026A代做、Python設計程序代寫
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    流體仿真外包多少錢_專業CFD分析代做_友商科技CAE仿真
    流體仿真外包多少錢_專業CFD分析代做_友商科
    CAE仿真分析代做公司 CFD流體仿真服務 管路流場仿真外包
    CAE仿真分析代做公司 CFD流體仿真服務 管路
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真技術服務
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲勞振動
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務 7類仿真分析代做服務40個行業
    流體cfd仿真分析服務 7類仿真分析代做服務4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內
    釘釘簽到打卡位置修改神器,2026怎么修改定
  • 短信驗證碼 寵物飼養 十大衛浴品牌排行 suno 豆包網頁版入口 wps 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    欧美激情一二区| 青青视频免费在线| 国产成人一二三区| 97久久国产亚洲精品超碰热| 国产精品自拍首页| 国产男人精品视频| 不卡一区二区三区视频| 成人免费在线网址| 国产精品亚洲欧美导航| 国产欧美精品一区二区三区 | 欧美日韩福利电影| 国产精品福利无圣光在线一区| 国产精品日韩一区二区三区| 国产精品日日摸夜夜添夜夜av| 国产精品久久久久久久久免费 | 国产精品手机视频| 国产精品成人免费电影| 精品国产一区三区| 欧美激情视频网址| 亚洲欧洲日产国码无码久久99| 亚洲国产欧洲综合997久久| 欧美一级免费播放| 欧在线一二三四区| 国产一区二区三区在线免费| 99国精产品一二二线| 国产mv久久久| 久久综合伊人77777| 亚洲一区二区三区午夜| 日韩免费观看视频| 麻豆成人在线播放| 国产精品18久久久久久首页狼| 国产成人免费av| 亚洲自拍av在线| 日本不卡一二三区| 国语自产精品视频在免费| 国产精品一区二区在线| 久久久久久九九九九| 欧美成人全部免费| 日日橹狠狠爱欧美超碰| 国产一区二区色| 国产高清精品一区二区三区| 久久资源免费视频| 日韩福利在线| 国产精品一区二区在线观看| 爽爽爽爽爽爽爽成人免费观看| 欧美精品在线观看91| 日韩欧美黄色大片| 成人免费视频97| 色噜噜亚洲精品中文字幕| 久久精品在线播放| 亚洲精品9999| 国产日韩中文字幕在线| 久久久噜噜噜www成人网| 一区二区三区欧美在线| 青青成人在线| 8090成年在线看片午夜| 欧美大片va欧美在线播放| 日本999视频| 97人人干人人| 欧美成年人视频网站欧美| 日韩视频一二三| 91久热免费在线视频| 精品国产乱码久久久久久郑州公司| 欧洲熟妇精品视频| 131美女爱做视频| 亚洲午夜精品久久久中文影院av| 黄色一级片av| www.日韩系列| 日本不卡二区| 久久人91精品久久久久久不卡| 一区二区三区欧美在线| 免费看污污视频| 久久天天躁狠狠躁夜夜躁| 日韩在线国产| 国产精品91在线| 亚洲人成无码www久久久| 国产美女在线一区| 久久中国妇女中文字幕| 蜜桃av噜噜一区二区三区| 国产成人黄色片| 无码人妻精品一区二区三区66| 国产精品一区二区3区| 久久婷婷国产麻豆91天堂| 欧美 日韩 亚洲 一区| xxxx性欧美| 欧美日韩国产精品一卡| 久久精品视频va| 狠狠色噜噜狠狠狠狠色吗综合| 久久精彩免费视频| 欧美久久久久久久久久久久久| 国产极品粉嫩福利姬萌白酱| 午夜精品一区二区三区av| 国产精华一区二区三区| 色噜噜狠狠色综合网| 91九色在线免费视频| 亚洲欧美日韩精品综合在线观看 | 丁香六月激情网| 国产极品尤物在线| 日韩一二区视频| 日韩中文字幕精品视频| 欧洲日本亚洲国产区| 国产成人拍精品视频午夜网站| 欧美性在线观看| 久久夜色精品国产欧美乱| 国产一区二区在线视频播放| 欧美精品在线免费| 91九色蝌蚪成人| 青青草成人网| 精品久久久久久乱码天堂| 97人人爽人人喊人人模波多| 午夜精品久久久内射近拍高清| 久久精品综合一区| 欧美高清一区二区| 久久6精品影院| 91精品视频免费观看| 日本精品一区二区 | 久草视频这里只有精品| 欧美 国产 综合| 久久久久国产精品免费| 国产精品av电影| 精品欧美国产| 亚洲一区二区自拍| 日韩视频免费中文字幕| 国产区一区二区| 日本成人中文字幕在线| 久久视频这里只有精品| 国产精品一区二区免费看| 日韩不卡一二区| 国产精品欧美久久久| 99在线视频播放| 欧美影院久久久| 久久97精品久久久久久久不卡| 91av免费看| 精品视频一区二区在线| 午夜精品久久久久久久白皮肤| 国产精品视频在线播放| 91.com在线| 精品一区二区三区免费毛片| 亚洲精品一区国产精品| 国产精品免费看一区二区三区| av资源一区二区| 欧美日韩黄色一级片| 亚洲在线观看视频| 久久精品国产电影| 91精品黄色| 国产精品中文字幕在线观看| 欧美一级黑人aaaaaaa做受 | 欧美日韩国产va另类| www日韩欧美| 久久精品午夜福利| 超碰在线观看97| 精品一区二区不卡| 欧美一级二级三级九九九| 亚洲乱码一区二区三区三上悠亚 | 国产精品亚洲自拍| 黄色一级一级片| 日本久久中文字幕| 亚洲一区二区在| 蜜月aⅴ免费一区二区三区 | 一级黄色免费在线观看| 国产精品久久久久久久久久尿| 91国产美女视频| 成人黄色一区二区| 国产日韩精品电影| 激情综合在线观看| 日韩精品伦理第一区| 在线免费一区| 美女精品视频一区| 国产精品久久久久久久久久久久久 | 日韩av一区二区三区在线观看| 欧美激情国产日韩精品一区18| 久久久久久久久久久久久国产| 国产精品aaaa| 91精品国产91久久久久久不卡| 国产乱人伦真实精品视频| 国产专区一区二区三区| 欧洲精品国产| 欧美亚洲免费在线| 日韩精品欧美专区| 日本视频精品一区| 日韩一级免费在线观看| 日韩手机在线观看视频| 日韩亚洲欧美视频| 欧美一区三区二区在线观看| 欧美午夜性视频| 狠狠久久综合婷婷不卡| 麻豆中文字幕在线观看| 国产亚洲精品美女久久久m| 国产一区玩具在线观看| 国产欧美日韩专区发布| 成人久久18免费网站图片| 国产伦精品一区二区三区照片| 国产一区欧美二区三区| 国产日韩亚洲精品| 国产欧美一区二区视频| 北条麻妃在线视频观看| 97国产在线观看| 久久精品日韩| 国产精品嫩草视频| 蜜月aⅴ免费一区二区三区|