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

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

代寫CSCI 1100、代做Homework 8
代寫CSCI 1100、代做Homework 8

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



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.

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
















 

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

    合肥圖文信息
    流體仿真外包多少錢_專業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怎么修改定
  • 短信驗證碼 豆包網頁版入口 破天一劍 目錄網 排行網

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

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

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    国产精品免费入口| 操人视频欧美| 激情小说综合区| 国产成人亚洲精品| 伊人天天久久大香线蕉av色| 青青影院一区二区三区四区| 久久久无码中文字幕久...| 美女视频久久黄| 狠狠色综合欧美激情| 日韩视频精品在线| 日韩欧美精品在线不卡| 国产精品小说在线| 欧美精品久久久久| 国产精品一区av| 中日韩在线视频| 成人国产精品一区| 在线天堂一区av电影| 国产伦精品一区二区三区照片| 久久国产精彩视频| 国产一区亚洲二区三区| 久久天天躁夜夜躁狠狠躁2022| 国产主播在线一区| 欧美成在线观看| 国模视频一区二区三区| 国产精品高清在线| 国产亚洲综合视频| 欧美日韩高清在线观看| 黄色国产小视频| 久久亚洲欧美日韩精品专区| 国产主播在线看| 一区二区三区四区不卡| 91精品久久久久久久久久久| 欧美一区二区大胆人体摄影专业网站 | 久久青草福利网站| 亚洲丰满在线| 国产激情视频一区| 青青青青在线视频| 国产精品色视频| 国产一区二区在线网站| 欧美激情综合色| 国产精品99免视看9| 日韩激情视频一区二区| 国产精品日韩欧美一区二区三区| 免费一级特黄毛片| 欧美精品久久久久久久久久| 国产精品1234| 欧美亚洲视频在线看网址| 国产精品高潮呻吟视频| 成人h视频在线观看| 午夜免费福利小电影| 色噜噜久久综合伊人一本| 麻豆久久久9性大片| 亚洲在线播放电影| 日韩一中文字幕| 国产日韩一区二区在线观看| 亚洲a在线观看| 北条麻妃在线一区二区| 国产欧美精品一区二区三区介绍| 亚洲精品久久久久久一区二区| 久久福利电影| 国产一区二区不卡视频在线观看| 亚洲国产精品久久久久爰色欲| 久久久噜噜噜久久中文字免| 国产在线视频在线| 无码人妻精品一区二区三区99v| 精品中文字幕在线观看| 国产一区二区三区av在线| 久久久久久国产精品| 国产二区视频在线播放| 国模精品一区二区三区色天香| 亚洲精品一区二区三| 久久视频国产精品免费视频在线| 国产午夜大地久久| 日本久久久久久久久久久| 久久综合五月天| 国产av无码专区亚洲精品| 国产午夜精品一区| 精品一区二区三区自拍图片区| 久久亚洲精品国产亚洲老地址| 国产日韩在线一区二区三区| 丝袜美腿亚洲一区二区| 国产内射老熟女aaaa| 日本一区二区黄色| 欧美精品videofree1080p| 日韩中文字幕在线视频| www.日本在线视频| 欧美中在线观看| 亚洲精品高清国产一线久久| 国产精品免费一区| 久久另类ts人妖一区二区| 国产欧美日韩免费看aⅴ视频| 日韩网站在线免费观看| 综合国产精品久久久| 久久精品在线播放| 91国偷自产一区二区三区的观看方式| 精品一区二区三区视频日产 | 国产精品视频播放| 国产极品尤物在线| 国产欧美精品一区二区三区| 欧美精品123| 日本在线一区| 亚洲a一级视频| 伊人婷婷久久| 精品成在人线av无码免费看| 久久九九热免费视频| 久久久久久亚洲精品中文字幕| 99在线国产| 国产欧美日韩精品专区| 麻豆一区区三区四区产品精品蜜桃| 人妻无码视频一区二区三区| 日本视频一区二区在线观看| 天堂va久久久噜噜噜久久va| 亚洲一区二区三区乱码aⅴ | 麻豆av一区| 黄色网页免费在线观看| 日韩精品一区二区三区色偷偷| 色999日韩自偷自拍美女| 亚洲精品偷拍视频| 国产99久久久欧美黑人| 欧美理论片在线观看| 久久精品国亚洲| 日日狠狠久久偷偷四色综合免费| 国产国产精品人在线视| 国产精品1234| 国产激情一区二区三区在线观看| 久久一区二区三区欧美亚洲| 国产精彩视频一区二区| 91久久伊人青青碰碰婷婷| 91久热免费在线视频| 国产精国产精品| 国产av无码专区亚洲精品| 久久精品二区| 久久久久久国产精品免费免费 | 黄瓜视频免费观看在线观看www| 欧美精品国产精品久久久| 欧美亚洲成人精品| 免费在线观看日韩视频| 好吊色欧美一区二区三区四区| 黄色国产精品视频| 国产欧美在线观看| 国产精品一区二区久久久久| av 日韩 人妻 黑人 综合 无码| 97成人在线免费视频| 久久久亚洲国产天美传媒修理工| 国产国语刺激对白av不卡| 日韩一区二区欧美| 久久精品视频在线| 久久亚洲一区二区三区四区五区高 | 亚洲精品日韩av| 午夜精品www| 欧洲美女7788成人免费视频| 免费看国产一级片| 成人av网站观看| 国产激情片在线观看| 久久久成人av| 九九热精品视频| 性高潮久久久久久久久| 日韩久久久久久久| 男人天堂成人在线| 成人免费视频97| 久久www免费人成精品| 国产精品美女主播在线观看纯欲| 精品伦理一区二区三区| 亚洲国产精品久久久久久女王| 日本毛片在线免费观看| 国产资源第一页| 久久久亚洲网站| 国产精品伦子伦免费视频| 中文字幕精品—区二区日日骚| 日本精品一区二区三区视频| 国产中文字幕亚洲| 91精品成人久久| 国产精品美女999| 在线观看国产一区| 青青在线视频观看| 国产精品一区二区三| 日韩中文娱乐网| 中文字幕日韩精品无码内射| 日本国产高清不卡| 国产乱码精品一区二区三区不卡| 国产二区不卡| 久久久久国产视频| 欧美亚洲丝袜| 国产精品69页| 精品久久久久久久免费人妻| 日韩视频在线视频| 苍井空浴缸大战猛男120分钟| 国产精品偷伦一区二区| 中文字幕成人一区| 欧美日韩国产精品一卡| 国产精品99免视看9| 久久中文字幕在线| 日韩精品一区二区三区色偷偷| 成人国产精品一区| 国产精品久久久久久久久久久久久久| 春日野结衣av| 国产精品一区二区欧美| 国产精品成人免费视频| 日韩免费高清在线| 91久久国产婷婷一区二区|