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

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

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

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

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

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

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

          9000px;">

                午夜不卡av免费| 日韩美女视频一区| 亚洲制服丝袜av| 波多野结衣中文字幕一区| 日韩欧美国产午夜精品| 视频一区免费在线观看| 这里只有精品免费| 日韩精品午夜视频| 精品三级av在线| 国产尤物一区二区| 国产日韩欧美综合一区| 成人国产精品免费网站| 亚洲三级理论片| 欧美性极品少妇| 天天色 色综合| 日韩欧美在线网站| 国产成人午夜视频| 亚洲特黄一级片| 欧美亚洲高清一区| 日本视频在线一区| 欧美xxx久久| 成人深夜福利app| 亚洲欧美日韩在线不卡| 欧美主播一区二区三区美女| 日本欧美在线观看| 久久先锋资源网| 99精品视频中文字幕| 亚洲成人一区二区| 欧美r级在线观看| 不卡在线视频中文字幕| 亚洲激情在线激情| 91精品国产色综合久久ai换脸| 国产精品综合av一区二区国产馆| 中文字幕中文字幕在线一区| 欧美日韩免费一区二区三区| 国产精品一卡二| 亚洲一区二区三区四区在线免费观看 | 日韩av在线发布| 国产日韩精品视频一区| 欧美主播一区二区三区| 国产乱子伦一区二区三区国色天香| 中文字幕欧美激情一区| 欧美伊人精品成人久久综合97| 久久不见久久见免费视频7 | 激情欧美一区二区| 亚洲同性同志一二三专区| 欧美一区二区精品在线| 91蝌蚪porny九色| 国产一区二区免费看| 亚洲一区二区欧美日韩 | 精品国产亚洲一区二区三区在线观看| 成人精品电影在线观看| 日韩黄色免费电影| 亚洲欧美偷拍另类a∨色屁股| 精品少妇一区二区三区免费观看| 日本精品裸体写真集在线观看| 韩国女主播成人在线| 日韩国产欧美在线播放| 中文一区二区完整视频在线观看| 91精品国产美女浴室洗澡无遮挡| 色综合天天综合在线视频| 国内精品国产成人| 蜜桃精品视频在线| 午夜欧美大尺度福利影院在线看| 国产清纯白嫩初高生在线观看91| 日韩午夜在线播放| 欧美日韩激情在线| 在线视频你懂得一区二区三区| 国产精品一级片在线观看| 日韩精品91亚洲二区在线观看| 亚洲夂夂婷婷色拍ww47| 亚洲男女毛片无遮挡| 中文文精品字幕一区二区| 精品女同一区二区| 日韩三级视频在线观看| 欧美精品一二三| 欧美唯美清纯偷拍| 欧洲精品视频在线观看| 色欧美88888久久久久久影院| 粉嫩av一区二区三区| 国产二区国产一区在线观看 | 中文字幕欧美三区| 欧美精品一区视频| 日韩欧美国产高清| 9191成人精品久久| 日韩一区二区高清| 欧美一级午夜免费电影| 欧美高清hd18日本| 欧美一级生活片| 日韩欧美一级二级三级久久久| 欧美另类高清zo欧美| 欧美日韩亚洲高清一区二区| 欧美午夜宅男影院| 色婷婷狠狠综合| 色悠久久久久综合欧美99| 色婷婷av一区二区三区大白胸| 在线观看三级视频欧美| 色哟哟亚洲精品| 在线视频观看一区| 欧美色图免费看| 91精品国产欧美一区二区18| 91精品国产aⅴ一区二区| 3atv一区二区三区| 精品国产乱码久久久久久蜜臀 | 久久久久久99久久久精品网站| 国产在线精品免费av| 欧美激情自拍偷拍| 成人福利视频在线看| 国产一区二区中文字幕| 8v天堂国产在线一区二区| 亚洲国产成人av网| 亚洲色图另类专区| 一区二区高清视频在线观看| 欧美成人r级一区二区三区| 久久夜色精品国产欧美乱极品| 久久久久久综合| 国产精品三级久久久久三级| 亚洲黄色尤物视频| 日本美女一区二区| 国产1区2区3区精品美女| 97久久久精品综合88久久| 欧美亚一区二区| 久久综合狠狠综合久久激情| 国产精品不卡在线| 亚洲aⅴ怡春院| 国产黄色精品视频| 在线观看视频一区二区| 欧美精品一区二区三| 亚洲欧美在线视频| 日本美女视频一区二区| av网站一区二区三区| 欧美日韩成人综合| 日本一区二区不卡视频| 国产真实乱子伦精品视频| 国产精品小仙女| 在线免费视频一区二区| 精品少妇一区二区三区日产乱码| 国产精品久久精品日日| 香蕉av福利精品导航| 成人激情黄色小说| 日韩一级片网站| 一区二区三区不卡视频在线观看| 国产揄拍国内精品对白| 欧美日韩亚洲丝袜制服| 国产精品萝li| 精品一区二区三区不卡 | 国产一区二区精品在线观看| 97se亚洲国产综合在线| 精品成人一区二区| 亚洲午夜免费电影| 成人黄色av电影| 精品粉嫩aⅴ一区二区三区四区| 亚洲激情成人在线| 成人av第一页| 久久中文娱乐网| 视频一区视频二区中文| 色94色欧美sute亚洲13| 国产精品水嫩水嫩| 国产精品一色哟哟哟| 日韩三级视频中文字幕| 亚洲丶国产丶欧美一区二区三区| 成人av网站大全| 久久亚洲一区二区三区四区| 日韩高清一级片| 欧美日韩成人在线| 一区二区三区精品| 99久久精品国产观看| 中文在线免费一区三区高中清不卡| 久草这里只有精品视频| 91精品国产色综合久久| 亚瑟在线精品视频| 欧美三级日韩三级| 一区二区三区不卡在线观看| 91在线播放网址| 1024精品合集| 色综合天天综合狠狠| 亚洲图片你懂的| 91天堂素人约啪| 亚洲黄色在线视频| 欧美亚洲国产怡红院影院| 亚洲综合免费观看高清在线观看| 91蜜桃网址入口| 夜夜夜精品看看| 欧美亚洲日本国产| 偷窥少妇高潮呻吟av久久免费| 欧美精品一级二级| 美国欧美日韩国产在线播放| 日韩欧美一级二级三级| 狠狠色2019综合网| 国产午夜精品在线观看| 东方欧美亚洲色图在线| 欧美国产激情一区二区三区蜜月 | 成人免费的视频| 国产精品久久久久久久久动漫| 成人免费视频一区| 亚洲欧美一区二区三区孕妇| 欧洲av在线精品| 石原莉奈一区二区三区在线观看| 欧美精品在线观看播放| 久久精品国产99国产精品|