加勒比久久综合,国产精品伦一区二区,66精品视频在线观看,一区二区电影

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

ECE2810J代做、代寫(xiě)C++語(yǔ)言編程
ECE2810J代做、代寫(xiě)C++語(yǔ)言編程

時(shí)間:2024-11-24  來(lái)源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



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

請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp




 

掃一掃在手機(jī)打開(kāi)當(dāng)前頁(yè)
  • 上一篇:代寫(xiě)I&C SCI 46 、c/c++,Java程序語(yǔ)言代做
  • 下一篇:CS1026A代做、Python設(shè)計(jì)程序代寫(xiě)
  • 無(wú)相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評(píng)軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務(wù)-企業(yè)/產(chǎn)品研發(fā)/客戶要求/設(shè)計(jì)優(yōu)化
    有限元分析 CAE仿真分析服務(wù)-企業(yè)/產(chǎn)品研發(fā)
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計(jì)優(yōu)化
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計(jì)優(yōu)化
    出評(píng) 開(kāi)團(tuán)工具
    出評(píng) 開(kāi)團(tuán)工具
    挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
    挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
    海信羅馬假日洗衣機(jī)亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
    海信羅馬假日洗衣機(jī)亮相AWE 復(fù)古美學(xué)與現(xiàn)代
    合肥機(jī)場(chǎng)巴士4號(hào)線
    合肥機(jī)場(chǎng)巴士4號(hào)線
    合肥機(jī)場(chǎng)巴士3號(hào)線
    合肥機(jī)場(chǎng)巴士3號(hào)線
  • 短信驗(yàn)證碼 目錄網(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號(hào)-3 公安備 42010502001045

    校园春色亚洲| 久久免费国产| 精品一区二区三区中文字幕视频| 亚洲精品国产嫩草在线观看| 欧美a视频在线| 天堂99x99es久久精品免费| 国产调教精品| 精品高清在线| 免费的国产精品| 亚洲福利合集| 香蕉久久夜色精品国产| 欧美久久精品一级c片| 亚洲欧洲日韩精品在线| 午夜在线视频观看日韩17c| 好吊妞视频这里有精品| 97视频一区| a∨色狠狠一区二区三区| 国产精品婷婷| 久久精品男女| 偷拍一区二区| 黑人久久a级毛片免费观看| 青青久久av| 成人国产精品入口免费视频| 九九99久久精品在免费线bt| 国产精品22p| 美女久久久久| 日本不卡网站| 亚洲天堂免费| 在线成人动漫av| 亚洲成人va| 嫩草国产精品入口| 97精品在线| 欧美偷拍综合| 国产偷自视频区视频一区二区| 天堂综合在线播放| 国产一区美女| 一区二区三区中文| 日本中文字幕一区二区有限公司| 三级一区在线视频先锋 | 成人精品毛片| 免费人成在线不卡| 国产精品色婷婷在线观看| 久久高清免费| 中文成人在线| 国产在线精彩视频| 国产欧美日韩一区二区三区四区| 999国产精品永久免费视频app| 蜜芽一区二区三区| 久久久久久久久丰满| 欧美一区=区三区| 亚洲成av在线| 欧美激情精品久久久六区热门| 欧美调教网站| 日韩高清不卡一区二区| 国产日本亚洲| 欧美视频免费看| 一本不卡影院| 欧美日韩中文一区二区| 欧美日韩亚洲国产精品| 蜜桃久久av| 久久视频一区| 欧美经典影片视频网站| 欧美三级视频| 国产精品亚洲片在线播放| 日韩三区四区| 精品国产第一福利网站| 999在线精品| 成人亚洲一区二区| 日韩一二三区| 亚洲图区在线| 在线高清欧美| а√天堂8资源中文在线| 日韩中文字幕一区二区三区| 影音先锋久久资源网| 欧美一区不卡| 亚洲精品播放| 成人羞羞视频播放网站| 北条麻妃在线一区二区免费播放| www.久久爱.com| 韩国精品福利一区二区三区| 国产精品视频一区二区三区| 五月天av在线| 美女福利一区二区| 91亚洲国产高清| 成人综合网站| 久久国产视频网| 男女啪啪999亚洲精品| 成人一区不卡| 欧美一区二区麻豆红桃视频| 樱桃成人精品视频在线播放| 亚洲欧美不卡| 韩日一区二区| 亚洲国产日韩欧美一区二区三区| 亚洲色图插插| 欧美三区在线| 日韩黄色网络| 欧美一区2区| 阿v视频在线观看| 麻豆精品在线观看| 免费成人av在线播放| 成人精品国产亚洲| 日本人妖一区二区| 婷婷成人在线| 经典三级一区二区| 精品精品视频| 老妇喷水一区二区三区| 欧美人成网站| 欧美1区3d| 伊人久久视频| 中文字幕一区日韩精品| 欧美wwwww| 99亚洲伊人久久精品影院| 在线综合色站| 久久男人av资源站| 日韩电影在线看| 麻豆亚洲精品| 日韩电影在线一区二区| 92国产精品| 欧美三区美女| 国产精品大片| 久久99久久99精品免观看软件| 亚洲91视频| 亚洲精品无播放器在线播放| 免费的成人av| 久久中文字幕av| 日精品一区二区| 女人天堂亚洲aⅴ在线观看| 欧美精品不卡| 在线视频免费在线观看一区二区| 日韩综合网站| 欧美私人啪啪vps| 国产人成精品一区二区三| 久久一区二区三区喷水| 久久精品国产99国产| 国产女人18毛片水真多18精品| 亚洲啊v在线免费视频| 亚洲黄网站黄| 久久精品青草| 国产经典一区| 亚洲欧美日韩精品一区二区| 欧美黄色一级视频| 三级一区在线视频先锋| 久久免费av| 黑色丝袜福利片av久久| 亚洲成在人线免费观看| 你懂的亚洲视频| 日韩一区二区三区免费播放| 99久久久久国产精品| 日韩视频在线观看| 日产精品一区| 久久伊人影院| 免费高清在线一区| 日韩高清在线不卡| 999国产精品| 久久69成人| 欧美gv在线| 日本色综合中文字幕| 欧美日韩综合| 日韩高清中文字幕一区| 久久在线电影| 欧美国产中文高清| 欧美精品99| 野花国产精品入口| 只有精品亚洲| 日韩一级大片| 亚洲人体在线| 久久久久久一区二区| 亚洲综合中文| 视频福利一区| 久久麻豆视频| sdde在线播放一区二区| 麻豆一区二区在线| 亚洲精品网址| 亚洲理伦在线| 伊人影院久久| 国产一精品一av一免费爽爽| 久久久777| 日韩美女一区二区三区在线观看| 日韩电影一区二区三区四区| 欧美黄色大片在线观看| 麻豆视频久久| 777午夜精品电影免费看| 国产国产精品| а天堂中文最新一区二区三区| 99热在线成人| 久久久久97| 鲁大师影院一区二区三区| 91精品啪在线观看国产手机| ww久久综合久中文字幕| 一级毛片免费高清中文字幕久久网 | 日本不良网站在线观看| 精品伊人久久久| 国内精品视频| www.com.cn成人| 成人羞羞视频播放网站| 麻豆国产一区二区| 免费毛片在线不卡| 婷婷精品在线观看| 波多野一区二区| 99国产一区|