我需要帮助编写以下功能。我的逻辑有问题 [英] I need help writing the following functions. Im having trouble with the logic

查看:68
本文介绍了我需要帮助编写以下功能。我的逻辑有问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助编写一个初始化rect的函数,给定左上角和右下角的位置,这些位置都在矩形内。



void Rect_init (Rect * rect,Point left_top,Point right_bottom);



另外编写一个使用curses函数的函数move()和addch()来填充描述的屏幕区域by rect with the character c



void Rect_fill(const Rect * rect,char c);



我尝试了什么:



我试过弄清楚逻辑,但我很难解决这些问题。

I need help writing a function which initializes rect, given the left-top and right-bottom corner locations, which are both within the rectangle.

void Rect_init(Rect* rect, Point left_top, Point right_bottom);

Also writing a function which uses the curses functions move() and addch() to fill the screen area described by rect with the character c

void Rect_fill(const Rect* rect, char c);

What I have tried:

I have tried figuring out the logic but I am having difficulty figure these problems out.

推荐答案

的成员对应于 X 成员。

热门底部 Rect 的成员对应 Y 成员点
Left and Right members of Rect correspond to the X member of Point.
Top and Bottom members of Rect correspond to the Y member of Point.


我们需要更多细节l



1.)结构的定义Rect和Point看字段。

2.)写入实际屏幕我们需要知道你正在使用什么图形包



第一个我们可以猜测但是写在屏幕上我们不知道你在用什么。
We need more detail

1.) The definition of the structs Rect and Point to see the fields.
2.) To write to the actual screen we need to know what graphics package you are using

The first one we can sort of guess at but writing to the screen we have no idea what you are using.


引用:

我试过弄清楚逻辑,但我很难解决这些问题。

I have tried figuring out the logic but I am having difficulty figure these problems out.



这是HomeWork!

HomeWork必须由您完成。可以将其视为(对于您的老师)检测您的弱点并允许采取补救措施的手段。从长远来看,简单地为您提供有效的解决方案。

我强烈建议您向老师报告您的困难。



如果你被困了,你已编写的代码,请发布代码并解释你的具体问题。


This is HomeWork !
HomeWork must be done by you. Think of it as a mean (for your teacher) to detect your weaknesses and it allow to take remedial actions. Simply giving you a working solution is not help on the long run.
I strongly suggest to report your difficulties to your teacher.

If you are stuck o, code you have already written, please post the code and explain your specific problem.


这篇关于我需要帮助编写以下功能。我的逻辑有问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆