99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

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

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設計程序代寫
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    急尋熱仿真分析?代做熱仿真服務+熱設計優化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發動機性能
    挖掘機濾芯提升發動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
    合肥機場巴士2號線
    合肥機場巴士2號線
    合肥機場巴士1號線
    合肥機場巴士1號線
  • 短信驗證碼 豆包 幣安下載 AI生圖 目錄網

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

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

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                91同城在线观看| 色先锋资源久久综合| 欧美日韩亚洲综合一区二区三区| 久久66热re国产| 成人aa视频在线观看| 国产精品一区二区三区网站| 激情成人午夜视频| 国产一区中文字幕| 精品国产一二三区| 亚洲综合久久av| 欧美中文字幕亚洲一区二区va在线| 精品伦理精品一区| 丝袜美腿亚洲综合| 亚洲综合av网| 性感美女极品91精品| 亚洲国产毛片aaaaa无费看| 亚洲欧美韩国综合色| 亚洲欧美综合网| 欧美激情在线观看视频免费| 久久久www成人免费毛片麻豆 | 在线看日韩精品电影| 亚洲美女一区二区三区| 成人动漫av在线| 精品一区二区av| 精品一区二区三区久久久| 蜜桃视频在线一区| 看电影不卡的网站| 久久国产日韩欧美精品| 韩国精品主播一区二区在线观看| 久久国产精品第一页| 韩国理伦片一区二区三区在线播放 | 国产91精品一区二区麻豆亚洲| 国产91丝袜在线18| 欧美精品亚洲二区| 91视频观看视频| 日韩国产精品久久久久久亚洲| 免费看日韩精品| 日本最新不卡在线| 国产精品伦理在线| 中文字幕一区av| 五月婷婷激情综合网| 日本va欧美va欧美va精品| 亚洲宅男天堂在线观看无病毒| 亚洲国产欧美另类丝袜| 天堂午夜影视日韩欧美一区二区| 午夜视频在线观看一区| 亚洲va欧美va国产va天堂影院| 91蝌蚪porny| 毛片av一区二区| 欧美大胆人体bbbb| 成人av网站在线观看免费| 日韩精品免费视频人成| 亚洲电影在线播放| www国产精品av| 欧美日韩三级一区二区| 成人av手机在线观看| 国产精品久久久99| 一区二区激情小说| 精品久久久久久久久久久久包黑料 | www.一区二区| 亚洲综合视频在线观看| 久久蜜桃香蕉精品一区二区三区| 一区二区三区电影在线播| 从欧美一区二区三区| 欧美日韩久久久久久| 91精品久久久久久蜜臀| 国产精品女人毛片| 天涯成人国产亚洲精品一区av| 久久色中文字幕| 国产嫩草影院久久久久| 日日摸夜夜添夜夜添国产精品| 琪琪一区二区三区| 精品成人免费观看| 日韩成人伦理电影在线观看| 99久久婷婷国产综合精品| 欧美日韩国产另类不卡| 精品久久人人做人人爰| 欧美自拍偷拍午夜视频| 成人av网站免费观看| 夫妻av一区二区| 粉嫩嫩av羞羞动漫久久久| 久久精品久久精品| 日本不卡一区二区三区高清视频| 亚洲男帅同性gay1069| 中文字幕国产一区二区| 国产精品久久久久久福利一牛影视| 欧美一区2区视频在线观看| av一区二区三区四区| 国产不卡视频在线播放| 蜜桃在线一区二区三区| 欧美一区午夜视频在线观看| 欧洲视频一区二区| 91国偷自产一区二区使用方法| 在线观看视频一区二区欧美日韩| 一区二区三区精密机械公司| 欧美狂野另类xxxxoooo| 婷婷开心久久网| 国产精品一区专区| 欧美一区中文字幕| 国产精品国产自产拍在线| 免费观看日韩av| 欧美视频第二页| 日韩在线一区二区三区| 欧美日韩精品免费观看视频 | 最新不卡av在线| 国产亚洲短视频| 最近日韩中文字幕| 一区二区三区四区乱视频| 国产精品拍天天在线| 精品国产一区二区三区不卡| 一本色道亚洲精品aⅴ| 亚洲男人天堂av| 日韩一区二区免费在线观看| 亚洲福利一区二区三区| 99久久综合99久久综合网站| 26uuu国产一区二区三区| 国内精品第一页| 玉足女爽爽91| 欧美午夜寂寞影院| 久久福利视频一区二区| 欧美精品久久天天躁| 97se亚洲国产综合自在线观| 日韩精品乱码免费| 成人一区二区在线观看| 欧美三级三级三级爽爽爽| 日本91福利区| 色综合夜色一区| 精品1区2区在线观看| 麻豆高清免费国产一区| 午夜久久久久久电影| 视频一区二区三区入口| av动漫一区二区| 国产欧美精品一区二区三区四区 | 日韩欧美国产三级| 91精品国产色综合久久不卡蜜臀| 中文字幕乱码日本亚洲一区二区 | 一级日本不卡的影视| 日韩高清在线电影| 欧美性三三影院| 一区二区三区四区激情| 色综合天天综合在线视频| 欧美性生活一区| 午夜免费久久看| 色综合一区二区| 亚洲精品乱码久久久久| 成人一道本在线| 欧美国产日韩在线观看| 成人三级在线视频| 日韩午夜激情免费电影| 久久99国产精品尤物| 日本一区二区三区视频视频| 国产成a人无v码亚洲福利| 国产精品美女视频| 欧美日韩国产免费一区二区| 久久99精品国产91久久来源| 久久日一线二线三线suv| 国产福利一区二区三区视频 | 蜜臀va亚洲va欧美va天堂| 日韩欧美不卡一区| 91麻豆精品在线观看| 日本不卡视频一二三区| 久久综合九色综合欧美98 | 成人午夜av电影| 奇米精品一区二区三区在线观看一| 在线看不卡av| 成人午夜电影久久影院| 美腿丝袜亚洲三区| 亚洲国产成人av| 欧美一级久久久久久久大片| 国产福利精品一区| 蜜桃视频一区二区三区| 午夜精品一区二区三区免费视频| 国产精品乱码久久久久久| 欧美一区二区三区小说| 亚洲精品国产精品乱码不99| 久久久亚洲欧洲日产国码αv| 日韩欧美一二区| 久久久无码精品亚洲日韩按摩| 欧美精品日日鲁夜夜添| 在线观看一区不卡| 国产精品网站一区| 欧美日韩精品一区二区三区蜜桃 | 欧美性大战久久久| 欧美天堂亚洲电影院在线播放| 91香蕉视频mp4| 成人污视频在线观看| 成人国产精品免费观看动漫 | 国产精品丝袜久久久久久app| 99久久久久久| 一本色道久久综合狠狠躁的推荐| 图片区小说区区亚洲影院| 午夜精品久久久久久久| 久久精品国产99国产| 麻豆国产精品一区二区三区| 激情综合色综合久久综合| 九色|91porny| 色综合久久中文字幕综合网| 国产精品一区二区久激情瑜伽 | 日韩一级高清毛片| 色综合久久九月婷婷色综合|