quine计划有什么意义? [英] What is the point of a quine program?

查看:105
本文介绍了quine计划有什么意义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在CS课程中了解了今天的Quine程序。我知道它们是用于输出自己的源代码或自我复制的程序。但是我不知道的是,除了对编码能力和逻辑的一个很好的测试之外,重点是什么?这些类型的程序可以在现实生活中使用,还是只是为了好玩?



它们是否适用于真正的单词?



我尝试了什么:



询问Stack Overflow ...并且每个人都是一个混蛋。我真的很感兴趣。

I just recently learned about Quine programs today in my CS class. I understand that they are programs meant to output there own source code, or "self-reproduce". But what I don't get is, besides being a good test of coding ability and logic, whats the point? Can these types of programs be used in real life situations or are they simply for fun?

Are they applicable to the real word?

What I have tried:

Asking on Stack Overflow...and everyone was a jerk about it. I'm genuinely interested.

推荐答案

据我所知,它们很少在现实生活中很有用。我可以设想一个场景,你有一个代码生成应用程序,可以动态编译。通过调用模块并让它编写输出然后编译成独立的可执行模块来包含模块会很有用。



不可否认,这是一个非常人为的理论例子,因为这是我能想到的唯一可能的用途,除了有趣和游戏之外。
As far as I know they are useful in real life applications only rarely. I can envision a scenario where you have a code generating app that compiles on the fly. It would be useful to include a module by invoking it and having it write its output that can then be compiled into a stand-alone executable module.

Admittedly, this is a very contrived, theoretical example because that's the only possible use I can think of for them beyond fun and games.


Google是解决此类问题的最佳场所:附带计划 - Google搜索 [ ^ ]。
Google is the best place for such questions: Quine programs - Google Search[^].


这篇关于quine计划有什么意义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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