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

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

代寫(xiě)CSCI 1100、代做Homework 8
代寫(xiě)CSCI 1100、代做Homework 8

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



CSCI 1100 — Computer Science 1 Homework 8
Bears, Berries and Tourists Redux: Classes
Overview
This homework is worth 100 points toward your overall homework grade, and is due Thursday,
April 18, 2024 at 11:59:59 pm. It has three parts. The first two are not worth many points,
and may end up being worth 0. They are mainly there to give you information to help you debug
your solution. Please download hw8_files.zip. and unzip it into the directory for your HW8.
You will find data files and sample outputs for each of the parts.
The goal of this assignment is to work with classes. You will be asked to write a simulation engine
and use classes to encapsulate data and functionality. You will have a lot of design choices to make.
While we have done simulations before, this one will be more complex. It is especially important
that you start slowly, build a program that works for simple cases, test it and then add more
complexity. We will provide test cases of increasing difficulty. Make sure you develop slowly and
test throughly.
Submission Instructions
In this homework, for the first time, you will be submitting multiple files to Submitty that together
comprise a single program.
Please follow these instructions carefully.
Each of Part 1, Part 2 and Part 3 will require you to to write a main program: hw8_part1.py,
hw8_part2.py and hw8_part3.py, respectively. You must also submit three modules per part in
addition to this main file, each of which encapsulates a class. The first is a file called BerryField.py
that contains your berry class, a file called Bear.py that contains your Bear class and a file called
Tourist.py that contains your Tourist class.
As always, make sure you follow the program structure guidelines. You will be graded on good
program structure as well as program correctness.
Remember as well that we will be continuing to test homeworks for similarity. So,
follow our guidelines for the acceptable levels of collaboration. You can download the
guidelines from the resources section in the Course Materials if you need a refresher.
We take this very seriously and will not hesitate to impose penalties when warranted.
Getting Started
You will need to write at least three classes for this assignment corresponding to a BerryField, a
bear and a Tourist. We are going to give you a lot of freedom in how you organize these three
classes, but each class must have at least an initializer and a string method. Additional methods
are up to you. Each of the classes is described below.
BerryField
The berry field must maintain and manage the location of berries as a square Row X Column grid
with (0,0) being the upper left corner and (N-1, N-1) being the lower right corner. Each space
holds 0-10 berry units.
• The initializer class must, minimally, be able to take in a grid of values (think of our Sodoku
lab) and use it to create a berry field with the values contained in the grid.
• The string function must, minimally, be able to generate a string of the current state of the
berry patch. Each block in the grid must be formatted with the "{:>4}" format specifier. If
there is a bear at the location the grid should have a "B", if there is a tourist the grid should
have a "T", and if there is both a bear and a tourist the grid should have an "X". If there is
neither a bear nor a tourist, it should have the number of berries at the location.
• Berries grow. The berry class must provide a way to grow the berry field. When the berries
grow, any location with a value 1 <= number of berries < 10 will gain an extra berry.
• Berries also spread. Any location with no berries that is adjacent to a location with 10 berries
will get 1 berry during the grow operation.
Bear
Each bear has a location and a direction in which they are walking. Bears are also very hungry. In
your program, You must manage 2 lists of bears. The first list are those bears that are currently
walking in the field. The second is a queue of bears waiting to enter the field.
• The initializer class must, minimally, be able to take in a row and column location and a
direction of travel.
• The string function must, minimally, be able to print out the location and direction of travel
for the bear and if the bear is asleep.
• Bears can walk North (N), South (S), East (E), West (W), NorthEast (NE), NorthWest (NW),
SouthEast (SE), or SouthWest (SW). Once a bear starts walking in a direction it never turns.
• Bears are always hungry. Every turn, unless there is tourist on the same spot, the bear eats
all the berries available on the space and then moves in its current direction to the next space.
This continues during the current turn until the bear eats 30 berries or runs into a tourist.
• For the special case of a bear and a tourist being in the same place during a turn, the bear
does not eat any berries, but the tourist mysteriously disappears and the bear falls asleep for
three turns.
• Once a bear reaches the boundary of the field (its row or column becomes -1 or N), it is no
longer walking in the field and need not be considered any longer.
Tourist
Each tourist has a location. Just like with bears, you must someplace maintain a list of tourists
currently in the field and a queue of tourists waiting to enter the field.
• The initializer class must, minimally, be able to take in a row and column location.
• Tourists see a bear if the bear is within 4 of their current position.
• The string function must, minimally, be able to print out the location of the tourist and how
many turns have passed since they have seen a bear.
• Tourists stand and watch. They do not move, but they will leave the field if:
1. Three turns pass without them seeing a bear; they get bored and go home.
2. They can see three bears at the same time; they get scared and go home
3. A bear runs into them; they mysteriously disappear and can no longer be found in the
field.
Execution
Remember to get hw8_files_F19.zip from the Course Materials section of Submitty. It has two
sample input files and the expected output for your program.
For this homework all of the data required to initialize your classes and program can be found in
json files. Each of your 3 parts should start by asking for the name of the json file, reading the
file, and then creating the objects you need based on the data read. The code below will help you
with this.
f = open("bears_and_berries_1.json")
data = json.loads(f.read())
print(data["berry_field"])
print(data["active_bears"])
print(data["reserve_bears"])
print(data["active_tourists"])
print(data["reserve_tourists"])
You will see that field in a list of lists where each [row][column] value is the number of berries
at that location; the "active_bears" and "reserve_bears" entries are lists of three-tuples (row,
column, direction) defining the bears; and the "active_tourists" and "reserve_tourists"
entries are lists of two-tuples (row, column) defining the tourists.
Part 1
In part one, read the json file, create your objects and then simply report on the initial state of the
simulation by printing out the berry field, active bears, and active tourists. Name your program
hw8_part1.py and submit it along with the three classes you developed.
Part 2
In part two, start off the same by reading the json file and create your objects and again print out
the initial state of the simulation. Then run five turns of the simulation by:
• Growing the berries
• Moving the bears
• Checking on the tourists
• Print out the state of the simulation
Do not worry about the reserve bears or reserve tourists entering the field, but report on any
tourists or bears that leave. Name your program hw8_part2.py and submit it along with the three
classes you developed.
Part 3
In part three, do everthing you did in part 2, but make the following changes.
• After checking on the tourists, if there are still bears in the reserve queue and at least 500
berries, add the next reserve bear to the active bears.
• Then, if there is are still tourists in the reserve queue and at least 1 active bear, add the next
reserve tourist to the field.
• Instead of stopping after 5 turns, run until there are no more bears on the field and no more
bears in the reserve list; or if there are no more bears on the field and no more berries.
• Finally, instead of reporting status every turn, report it every 5 turns and then again when
the simulation ends.
As you go, report on any tourists or bears that leave or enter the field. Name your program
hw8_part3.py and submit it along with the three classes you developed.

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
















 

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

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

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    日本毛片在线免费观看| 波霸ol色综合久久| 日本精品久久久久久久久久| 自拍另类欧美| 久久99精品久久久久久琪琪| 欧洲国产精品| 蜜桃网站成人| 国产精品中文久久久久久久| 国产亚洲二区| 一本久道高清无码视频| 欧美激情中文字幕乱码免费| 欧美激情久久久久久| 一本色道久久88亚洲精品综合| 九九热精品视频国产| 国产精品久久久久免费| 国产精品大片wwwwww| 精品国产91亚洲一区二区三区www| 欧美成年人在线观看| 国产乱子伦精品视频| 久久天堂av综合合色| 久久国产精品网| 国产成人精品网站| 国产精品第三页| 欧美激情精品久久久久久久变态| 欧美激情一区二区三区在线视频观看| 欧美激情亚洲综合一区| 亚洲 高清 成人 动漫| 青草青草久热精品视频在线网站| 欧美精品国产精品久久久| 热re99久久精品国99热蜜月| 欧美中文字幕精品| 国产日韩欧美黄色| 久久男人av资源网站| 国产精品免费电影| 亚洲综合中文字幕在线观看| 日本一本a高清免费不卡| 欧美精品国产精品久久久| 国产视频一区二区三区四区 | 国产精品伦子伦免费视频| 美女啪啪无遮挡免费久久网站| 精品国产一区二区三 | 亚州av一区二区| 欧美亚洲日本黄色| 分分操这里只有精品| 久久狠狠久久综合桃花| 久久亚洲精品视频| 日韩av电影免费播放| 好吊色欧美一区二区三区| av动漫免费看| 国产精品美女在线| 色综合影院在线观看| 国产一区视频观看| 久久精品ww人人做人人爽| 精品国产免费av| 日韩 欧美 高清| 国产精品中文在线| 久久九九有精品国产23| 亚洲一区制服诱惑| 免费观看美女裸体网站| 久久资源av| 真实国产乱子伦对白视频| 欧美精品国产精品久久久| 国产极品尤物在线| 欧美极品美女电影一区| 激情综合网婷婷| 久久久久久久久爱| 懂色中文一区二区三区在线视频| 国产一区二区在线免费| 日韩中文在线不卡| 午夜精品美女自拍福到在线| 国产欧美精品一区二区| 国产精品二区在线| 欧美成人综合一区| 九色视频成人porny| 亚洲精品人成| 分分操这里只有精品| 精品自拍视频在线观看| 精品欧美日韩在线| 久久精品国产一区二区三区| 色狠狠久久av五月综合| 97欧美精品一区二区三区| 精品久久久久亚洲| 激情成人开心网| 国产成人女人毛片视频在线| 亚洲精品在线视频观看| 成人一区二区av| 免费久久久久久| 日韩av免费一区| 国产精品一二三在线观看| 国产精品日韩一区二区| 欧美一区二区影视| 久艹在线免费观看| 日本欧美精品久久久| 久久国产欧美精品| 青青草久久网络| zzjj国产精品一区二区| 欧美日韩高清在线一区| 久久精品亚洲精品| 精品日产一区2区三区黄免费| 国产成人精品免费看在线播放| 日韩一级在线免费观看| 国产极品粉嫩福利姬萌白酱| 日韩中文字幕组| 久久久久亚洲精品| 欧美在线视频二区| 国产精品涩涩涩视频网站| 欧美日本韩国在线| 国产精品久久中文字幕| 国产日韩二区| 亚洲视频在线观看日本a| 91精品国产91久久久久| 日本欧美精品在线| www.99久久热国产日韩欧美.com| 欧美在线不卡区| 国产精品老女人精品视频| 国产一二三四区在线观看| 一区视频二区视频| 久久久亚洲国产| 欧洲黄色一级视频| 久久夜色精品国产| 91精品视频观看| 欧美一级爱爱| 欧美激情xxxxx| 久久国产精品免费观看| 国内精品**久久毛片app| 国产99视频精品免费视频36| 国产精品69久久| 欧美日韩国产综合视频在线| 精品国产乱码久久久久软件| 99国产在线观看| 茄子视频成人免费观看| 美女精品视频一区| 国产高清视频一区三区| 欧美不卡在线一区二区三区| 欧美激情久久久久| 国产a级片免费观看| 精品无码一区二区三区爱欲 | 精品免费日产一区一区三区免费 | 午夜精品一区二区三区在线播放 | 日韩av色综合| 国产精品久久久久免费| 99九九视频| 欧美亚洲免费高清在线观看| 欧美黄网免费在线观看| 久久精品成人一区二区三区蜜臀| 蜜桃av噜噜一区二区三| 少妇久久久久久被弄到高潮| 久久这里有精品| 国产成人在线免费看| 国产欧美日韩综合精品二区| 热久久99这里有精品| 亚洲影院在线看| 国产精品视频一| 97免费高清电视剧观看| 精品日本一区二区三区| 亚洲高潮无码久久| 久久综合亚洲社区| 久久久久久久久久久一区| 国产精品一码二码三码在线| 欧美视频在线观看视频| 日日摸天天爽天天爽视频| 久久成人在线视频| 久久久精品久久| 国产高潮呻吟久久久| 隔壁老王国产在线精品| 免费在线a视频| 日韩精品一区二区三区外面| 亚洲精品免费在线看| 国产精品国色综合久久| 久久久久久久久久伊人| 久久视频这里有精品| 99视频精品免费| 国产美女精品视频免费观看| 欧美日本亚洲| 日韩精品无码一区二区三区免费| 亚州成人av在线| 亚洲一区精彩视频| 久久久久久国产精品三级玉女聊斋| 国产精品久久九九| 国产精品欧美日韩一区二区| 国产l精品国产亚洲区久久| 国产精彩视频一区二区| 91九色在线免费视频| www黄色av| 国产精品亚洲аv天堂网| 国产美女精彩久久| 国产精品一区二区三区免费| 国产亚洲情侣一区二区无| 国产亚洲精品网站| 国产亚洲欧美另类一区二区三区| 狠狠干 狠狠操| 麻豆精品传媒视频| 国产又爽又黄的激情精品视频| 麻豆一区区三区四区产品精品蜜桃| 海角国产乱辈乱精品视频| 国产专区在线视频| 国产伦理一区二区三区| 国产精品一区二区三区免费视频| 国产日本一区二区三区| 欧美日韩亚洲一区二区三区四区|