KOL答疑:FAQ-Assignment 3 – Fruit Bot UNSW Comp1511

大家如果在ass3中遇到问题的,可以向我们寻求答疑,我们是一群互联网爱好者,你的问题,我的答案。

 

有问题,请直接到到问题页面提交,或者扫码微信二维码,私信提问即可。我们尽可能快的回答你的提问。

 

Introduction

Bots have been in the news for doing negative things such as spreading fake news.

Your task in this assignment is to write a bot that makes the world a better place.

Your bot will pilot a drone which ferries fruit to UNSW students so they stop eating junk food, have a healthy diet.

Your bot must successfully buy, transport and sell fruit in a simulated world.

You will write a C program to implement this bot.

Virtual World

The virtual world in which your bot will operate has locations spread around a ring.

It is possible to move in only two directions in the virtual world: eastand west. You can not move north or south.

The word is circular so if you keep moving east or west you eventually return to where you started.

The details of the virtual world are randomly generated for each simulation. An example follows.

Locations are listed going east. As the world is circular if you go eastfrom Kora Lab you go to CSE. Similarly if you go west from CSE you go to Kora Lab.

There is a diagram here that may help you to better understand how the world fits together. To obtain a copy you can edit on draw.io, copythe contents of this txt file into your browser’s address bar.

>>……….. More………………………….

Question & Answer/问答专区:

答疑一:

提问者:

老师您好,我自己做题的时候老显示错误,

可以帮我看看这个问题吗?

答主:

你好,可以的,请描述你的问题。

提问者:

可以给出我点大致思路吗?

答主:

简单来说,可以通过输入输出,调用函数来模拟现实bot的move,buy等操作。

答疑二:

提问者:

在1511的assignment3里,为什么

if(strcmp(b–>fruit,b–>location–>fruit)!= 0)

这句话是错的?我想看我有的水果种类和location的水果种类,一不一样怎么办?

答主:

你好,这个是指针访问错误。

struct B {

int a;

};




struct A {

   int a;

   struct B b;

};




struct A one;

 

one->a和one->b->a 这两个能一样?

提问者:

谢谢。

 

 

我也有疑问

 

发表评论

%d 博主赞过: