有人会帮助我使用xlib编写代码吗? [英] Will someone help me in writing a code using xlib?

查看:123
本文介绍了有人会帮助我使用xlib编写代码吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编写一个使用x11/xlib接口执行以下功能的程序:您的程序收到一个文件名作为命令行参数,该文件由格式为
的行组成
(137,296)50,60;

也就是说,传感器的坐标为圆括号,其后为传感器的感应半径和通信距离,然后为分号.所有传感器的坐标均为0-9999范围内的整数.然后,程序将打印已读取到stdout的传感器数量,打开一个窗口并显示所有传感器和双向通信链接.传感器位置本身显示为黑点,通讯链接显示为黄色部分,传感器的覆盖区域显示为红色圆圈.最后,您可以测试正方形中的所有点是否都被传感器覆盖,您可以使用o(ncube)算法.

Write a program that uses x11/xlib interface to perform the following functions: Your program receive a file name as command line argument, this file consists of lines of the form

(137,296) 50,60;

That is the coordinates of the sensor in parantheses followed by its sensing radius and communication distance followed by a semicolon. The coordinates of all sensors are integers of the range 0-9999. Your program then prints the number of sensors it has read to stdout, opens a window and displays all the sensors and the bidirectional communication links. The sensor position itself is shown as a black dot, the communication link as a yellow segment and the covered region of the sensor as a red circle. Finally you test whether all points in the square are covered by sensors for this you can use an o(ncube) algorithm.

推荐答案

这显然是一个作业问题,您必须努力解决它.当您确切告诉我您不能做的事情时,我一定会为您提供帮助.您在读取文件时遇到问题吗?还是在窗口上显示传感器网络?

-Saurabh
This is clearly a homework question and you have to make an effort to solve it. I will certainly help you as soon as you tell me exactly what is it that you can''t do. Are you having trouble reading the file? Or in showing the sensor network on a window?

-Saurabh


这听起来像是一项家庭作业.我们不为懒惰的人做家庭作业.我们宁愿它们在我们必须携带它们之前失败,因为它们最终会在我们工作的地方工作.
This reads like a homework assignment. We don''t do homework for lazy people. We prefer them to fail BEFORE we have to carry them because they end up working where we work.


我认为您可以尝试使用Google搜索,并且一定可以找到相关的东西(如果不完全相同).否则,您可以自行尝试并发布您遇到的问题,我们非常乐意为您提供帮助.
I think you can try Googling for it and you will certainly be able to find something relevant (if not exactly the same). Otherwise you can try it at your own and post the problem that you face, we will be more than happy to help you.


这篇关于有人会帮助我使用xlib编写代码吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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