电台复活节
An Easter egg is a hidden message or feature, completely unrelated to normal functionality, that developers put inside software, website, or game. Unlike viruses, worms, and trojans, Easter eggs are completely harmless. They are often used as a sort of signature of a programmer or as a joke. Sometimes they are written by personal initiative of a programmer and not a company request, and in those cases the company might take legal action against the developer. On the other hand, there are plenty of cases where a company, especially ones that specialize in game development, explicitly request several Easter eggs.
复活节彩蛋是开发人员放入软件, 站或游戏中的与正常功能完全无关的隐藏消息或功能。 与病毒,蠕虫和特洛伊木马不同,复活节彩蛋是完全无害的。 它们通常被用作程序员的一种签名或一个玩笑。 有时,它们是由程序员亲自编写的,而不是公司的要求,在这种情况下,公司可能会对开发人员采取法律行动。 另一方面,在很多情况下,一家公司,尤其是专门从事游戏开发的公司,明确要求几个复活节彩蛋。
复活节彩蛋简史 (A Short History of the Easter Eggs)
The term comes from the Anglo-Saxon tradition where parents, hide some eggs in their garden for Easter and then let their children find them. This type of work is often used in games where, for example, through a combination of keys or performing certain actions in a given order, you can access new levels or new powers.
该术语来自盎格鲁-撒克逊人的传统,父母在父母的花园里藏一些鸡蛋做复活节,然后让孩子们找到它们。 这类工作通常用于游戏中,例如,通过组合键或以给定顺序执行某些操作,您可以使用新的关卡或新功能。
For several years people, myself included, thought that the game Adventure released by Atari in 1979 was the first video game to containing an Easter egg. It wasn’t as amazing as you might think; it just displayed Warren Robinett (the name of the programmer). Although this myth is still alive, it seems that previous Easter eggs existed.
多年来,包括我自己在内的人们一直认为Atari在1979年发行的游戏Adventure是第一个包含复活节彩蛋的视频游戏。 这并不像您想像的那样惊人。 它只是显示Warren Robinett(程序员的名字)。 尽管这个神话仍然存在,但似乎以前的复活节彩蛋已经存在 。
The number of Easter eggs contained in software and games, even the most famous ones, has increased over the last couple decades. The web offers a plethora of examples; companies like Mozilla, Oracle, and Google are just few who have put Easter eggs in their software.
在过去的几十年中,软件和游戏(甚至是最著名的)中包含的复活节彩蛋数量有所增加。 络上提供了大量示例。 像Mozilla,Oracle和Google这样的公司很少在软件中添加复活节彩蛋。
- Mozilla put an Easter egg in all versions of Firefox. To see it in action, type “about:mozilla” in the address bar and then press enter. Firefox displays a quote from the “Book of Mozilla” about the birth of Firefox.
Mozilla在所有版本的Firefox中都添加了一个复活节彩蛋。 要查看其运行情况,请在地址栏中键入“ about:mozilla”,然后按Enter。 Firefox显示“ Mozilla图书”中关于Firefox诞生的 价。
- Google created an Easter egg in Picasa. If you open the desktop software and then press Ctrl + Shift + Y, a toy bear image appears. Every time you press the key combination, another bear is displayed.
Google在Picasa中创建了一个复活节彩蛋。 如果打开桌面软件,然后按Ctrl + Shift + Y,则会出现玩具熊图像。 每次按组合键,都会显示另一只熊。
- Skype, the famous VoIP software, has a simple but funny example. If you open the chat and then type “(drunk)” a hidden emoticon appears.
著名的VoIP软件Skype有一个简单但有趣的示例。 如果打开聊天,然后键入“(醉酒)”,则会出现一个隐藏的图释。
- A Tetris game has been hidden in the uTorrent software. To see it, click the “Help” menu and then go to “About”. Press T key and the game will appear.
uTorrent软件中隐藏了俄罗斯方块游戏。 要查看它,请单击“帮助”菜单,然后转到“关于”。 按T键,将出现游戏。
-
The OpenOffice suite has a lot of hidden games and other stuff. So many that they have a specific section on their website! If you want to play Tic-Tac-Toe in Calc, write “=GAME(A2:C4;”TicTacToe”)” into the A1 cell and then press enter.
OpenOffice套件包含许多隐藏的游戏和其他内容。 如此之多,以至于他们在 站上都有特定的部分 ! 如果要在Calc中播放井字游戏,请在A1单元格中写入“ = GAME(A2:C4;“ TicTacToe”)”,然后按Enter。
创建您的第一个复活节彩蛋 (Creating Your First Easter Egg)
I’ll guide you in creating a simple Easter egg with PHP. We’ll create a search form, and if a user searches for my name (obviously you can change with your own) the page will show a nice message. This will be the Easter egg.
我将指导您使用PHP创建一个简单的复活节彩蛋。 我们将创建一个搜索表单,如果用户搜索我的名字(显然您可以用自己的名字更改),则该页面将显示一条漂亮的消息。 这将是复活节彩蛋。
Create a PHP file with the following HTML code:
使用以下HTML代码创建一个PHP文件:
The form doesn’t have many elements; it only needs an input box where the user can type what she wants to search for and the submit button.
表单没有很多元素; 它只需要一个输入框,用户就可以在其中输入要搜索的内容和提交按钮。
Try to use the form. As you’ll see, it does nothing but redirects the user to the same page, sending what was entered in the search field as a parameter. The business logic has not implemented yet, so don’t worry that nothing special happens.
尝试使用该表格。 正如您将看到的,它什么也不做,只是将用户重定向到同一页面,并将在搜索字段中输入的内容作为参数发送。 业务逻辑尚未实现,所以不用担心没有什么特别的事情发生。
The next step is to write the business logic. We need to analyze the request using the superglobal array to see its value. If the parameter isn’t empty, we’ll display what the user searched for, but in case she searched for my name, I’ll add the funny message “I know, I’m so cool!”.
下一步是编写业务逻辑。 我们需要使用超全局数组分析请求以查看其值。 如果参数不为空,我们将显示用户搜索的内容,但是如果她搜索了我的名字,我将添加有趣的消息“我知道,我很酷!”。
The resultant code should look as follow.
结果代码应如下所示。
Now, when the user searches for my name she’ll see the following screen:
现在,当用户搜索我的名字时,她将看到以下屏幕:
I’ve shown you in this article how you can create a simple Easter egg. Easter eggs are a fun way to sign your software and to prove your paternity, Be careful though not to add one in your company software because the consequences could be undesirable. Now, every time you run a new program you’ll probably want search the Internet to see if it contains an Easter egg.
Image via Fotolia
图片来自Fotolia
翻译自: https://www.sitepoint.com/easter-eggs-what-they-are-and-how-to-create-them/
电台复活节
文章知识点与官方知识档案匹配,可进一步学习相关知识Java技能树首页概览92123 人正在系统学习中 相关资源:世新砸蛋抽奖软件V2.3.10官方安装版-其它代码类资源-CSDN文库
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!