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

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

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

時間:2024-12-03  來源:合肥網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
• D 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
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 and part 3 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. The test cases in part 1 and part 3 are similar,
but part 3 has stricter time and memory limitations.
(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 70 percent of the test cases in part 1.
(3) Submit the source code for part 2 on Canvas along with a corresponding Makefile to compile the source code.
(i.e. The code you used to get answer for part 2 on JOJ. ) 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. You only need to submit the output ffle for one test case.
(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.
Basic Tips for Optimizing Your Program
Deadlocks
• What is a freeze deadlock?
• List common freeze deadlocks.
• Analyze the pros and cons of adding more deadlock detections.
Efffciency
• How much memory do you need to store a “state”?
• With 100 bits, how many states can you store?
• If visiting one state takes 1ns, how much time will it take to visit through all possible states represented by 100
bits?
• How much information do you need to backtrace a path?
C++ Features
• Is std::pair fast or slow?
• How many temporary objects have you created in each iteration? Are they really necessary?
45 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
5.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. Your score will be calculated as follows:
min
(
100,
score in part 1 + score in part 2 + score in part 3
14
)
Please notice that the total points on JOJ will be 2150 with 1000 points for part 1, 400 points for part 2, and 750
points for part 3. You only need to get 1400 points on JOJ to get full score in this section.
56.2 Code Quality
Bad code quality will lead to a deduction of up to 20 points, which will be applied directly to your final score.
6.3 Bonus
For the first bonus requirement, you can get up to 10 points. For the second bonus requirement, you can get up to
30 points. The total score for the whole project 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
• Testing your code with another one’s account
• Post your code to github
• Using any kind of AI tools to solve the problem
9 Acknowledgement
This programming assignment is designed based on ENGR1510J Lab 3 and ENGR1510J Project 3.


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

掃一掃在手機打開當前頁
  • 上一篇:代寫QHE5701、SQL編程語言代做
  • 下一篇:菲律賓黑名單能申請保關入境嗎(應該怎么做)
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 目錄網 排行網

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

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

    日韩午夜电影网| 国产精品一线| 成人精品国产亚洲| 亚洲激情久久| 日韩黄色片在线观看| 欧美一级做一级爱a做片性| 最新欧美人z0oozo0| 日韩免费电影在线观看| 四虎成人精品一区二区免费网站| 亚洲一区二区成人| 噜噜噜狠狠夜夜躁精品仙踪林| 亚洲另类黄色| 欧美一区二区三区婷婷| 国产精品视频| 国产精品99一区二区| 精品国产鲁一鲁****| 一区二区三区在线| 欧美一区成人| 日韩在线观看一区| 欧美wwwww| 亚洲欧美日韩专区| 欧美日韩在线网站| 欧美三级午夜理伦三级小说| 亚洲美女久久| 欧美国产激情| 乱一区二区av| 一区二区激情| 亚洲精品大全| 日韩黄色大片网站| 9999国产精品| 男人操女人的视频在线观看欧美| 免费久久精品| 久久国产电影| 久久久久久久久99精品大| 精品久久亚洲| 日韩二区在线观看| 亚洲春色h网| 欧美三级一区| 欧美日韩播放| 怕怕欧美视频免费大全| 96sao精品免费视频观看| 久久久久观看| 91成人短视频在线观看| 麻豆精品精品国产自在97香蕉| 精品国产黄a∨片高清在线| 欧美日韩女优| 亚洲国产伊人| 久久国产婷婷国产香蕉| 99精品国产99久久久久久福利| 久久免费影院| 99精品视频免费观看视频| 久久国产三级精品| 亚洲国产美女| 不卡的国产精品| 欧美极品在线观看| 久久精品九色| 91久久精品无嫩草影院| 精品久久久久久久久久久下田| 精品久久美女| 久久精品国产大片免费观看| 国产一区观看| 国产亚洲毛片| 欧美aaaaaaaaaaaa| 天天免费亚洲黑人免费| 99久久婷婷国产综合精品首页| 福利精品一区| 欧美激情1区2区| 日韩激情中文字幕| 久久狠狠久久| 午夜欧美精品久久久久久久| 国产精品日韩精品欧美精品| 蜜臀av一级做a爰片久久| 国产在线看片免费视频在线观看| 欧美成人a交片免费看| 成人在线视频观看| 欧美国产另类| 日韩在线精品强乱中文字幕| 北条麻妃一区二区三区在线观看| 99久久久久国产精品| 伊人久久大香线蕉av超碰演员| 免费成人你懂的| 韩国女主播一区二区| 麻豆精品一区二区三区| 久久av影视| 欧美日韩性在线观看| 欧美中文字幕| 欧美综合影院| 国产高清日韩| 久久久国产精品一区二区中文| 最新成人av网站| 日韩国产一区| 一区二区在线| 精品久久久亚洲| 国产视频一区欧美| 精品免费av一区二区三区| 欧美激情无毛| 精品视频在线你懂得| 午夜亚洲性色视频| 日韩一区中文| 日韩成人伦理电影在线观看| 欧美色图在线播放| 亚洲黄色网址| 成人自拍视频| 国内精品视频在线观看| 爱搞国产精品| 99精品女人在线观看免费视频 | 精品素人av| 香蕉久久夜色精品| 日韩国产91| 免费观看亚洲天堂| 久久大逼视频| 日本午夜精品一区二区三区电影| 9l亚洲国产成人精品一区二三| 日韩视频在线一区二区三区| 素人一区二区三区| 日韩经典一区二区| 亚洲在线国产日韩欧美| 美女尤物国产一区| 欧美激情15p| 欧美激情国产在线| 国产成人调教视频在线观看| 激情综合激情| 日本午夜精品久久久久| 91在线一区| 精品国产免费人成网站| 久久99青青| 亚洲在线日韩| 欧美精品18| 欧美午夜不卡| 亚洲区一区二| 免费不卡中文字幕在线| 国产精品伦一区二区| 国产精品调教| 超碰超碰人人人人精品| 日本超碰一区二区| 日本大胆欧美人术艺术动态| 9999精品视频| 免费国产自线拍一欧美视频| 欧美激情精品久久久六区热门| 亚洲天堂激情| 蓝色福利精品导航| 菠萝蜜一区二区| 日本午夜精品视频在线观看| 天堂资源在线亚洲| 久久精品99国产精品| 亚洲高清成人| 亚洲国产婷婷| 亚洲在线观看| 国产一区毛片| 亚洲精品mv| 国产精品网在线观看| 777午夜精品电影免费看| 青青视频一区二区| 久久激五月天综合精品| 激情欧美一区| 亚洲一区二区| 日产精品一区二区| 亚洲成人黄色| ww久久综合久中文字幕| 99tv成人| 亚洲字幕久久| 美国毛片一区二区三区| 精品国产三区在线| 天堂综合在线播放| 蜜臀av免费一区二区三区| 欧美激情五月| 国内激情视频在线观看| 97视频一区| 麻豆免费精品视频| 老妇喷水一区二区三区| 久久视频社区| 久久精品国产免费看久久精品| 亚洲女同中文字幕| 国产永久精品大片wwwapp| 天堂av在线| 女厕嘘嘘一区二区在线播放| 国产成人视屏| 欧美特黄aaaaaaaa大片| 免费久久久久久久久| 亚洲男人都懂第一日本| 日韩久久电影| 香蕉久久网站| 亚洲视频国产| 国产精品v亚洲精品v日韩精品| 视频在线观看国产精品| 久久a爱视频| 国产欧美日韩精品一区二区三区| 伊人久久综合一区二区| 欧美.日韩.国产.一区.二区| 国产精品三级| 久久精品国产999大香线蕉| 男男成人高潮片免费网站| 男人的天堂久久| 国产乱码精品一区二区三区四区| 日韩不卡在线| 午夜在线精品偷拍| 青青一区二区| 久久亚洲精精品中文字幕| 三级不卡在线观看| 都市激情亚洲综合|