叫做Marius Heil的AS开发者使用AS3构造了一个25行代码的AS3游戏,并且获得了25行AS3代码编程大赛的第一名!

/** * 25-Line ActionScript Contest Entry * * Project: SmilieBounce 25 * Author: Marius Heil * Date: 26.11.2008 * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ // 3 free lines! Alter the parameters of the following lines or remove them. // Do not substitute other code for the three lines in this section [SWF(width=800, height=650, backgroundColor=0xffffff, frameRate=12)] stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; // 25 lines begins here! stage.addEventListener(KeyboardEvent.KEY_DOWN, function(e:KeyboardEvent){ root["key"+e.keyCode] = true;}); stage.addEventListener(KeyboardEvent.KEY_UP, function(e:KeyboardEvent){ root["key"+e.keyCode] = false; }); (this.field = addChild(new TextField())).text = this.backup = (this.field.type=(this.field.autoSize="left").substring(0, 0)+"input").substring(0, 0)+"‼==============================================================================================================================================‼/n‼ ‼/n‼ ‼/n‼ ♫♫ ‼/n‼♫♫♫♫♫♫ ▐▀▐ ¥ ▀ ☼ ▀ ∙ ‼/n▀▀▀▀▀▀▀▀ ∙ ▐ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ♫♫♫♫‼/n‼ ▐ ▀▀▀▀▀‼/n‼ ▀♫♫♫♫♫♫♫♫♫♫♫♫♫♫ ∙ ∙ ▐ ‼/n‼ ∙ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▐ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▐ ∙ ‼/n‼ ▐ ▀ ☼ ▐ ▐ ‼/n‼ ▐ ▀▀▀▀▀▀▀ ▐▀▀▀▀ ‼/n‼ ∙ ▐ ▐ ‼/n‼ ♫♫♫♫ ^///^ ▐ ☼ ▀ ▐ ‼/n‼ ∙ ▀▀▀▀▀▀▀▀▀ ▐▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▐ ‼/n‼ ♫♫♫♫♫ ♫♫♫♫♫ ▐ ▐ ‼/n‼ ▀▀▀▀▀ ▀▀▀▀▀ ▐♫▐ ///^/// ^/// ▐ ▀▀▀▀▀▀▀▀▀▀▀▐ ∙ ‼/n‼♫♫♫♫ ▐♫▐ / // //^^/ //^///▐ ▐ ‼/n▀▀▀▀▀▀▀▀▀▀ ▐♫▐ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▐ ∙ ♫♫ ‼/n‼ ▀ ▐♫▐ ▐ ▐ ▐ ♫♫ ‼/n‼ ▀ ¥ ▀ ☼ ▀ ▐♫▐ ▐ ▀▀▀▀▐ ▐ ▐ ▀▀ ‼/n‼ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▐♫▐ ▐ ♫♫♫♫♫♫♫▐ ▐▀ ▐ ‼/n‼ ☺ ▀▀▀▀▀▀ ♫ ▀▀▀▀▀▀▀▀▐ ▐ ▐ ‼/n‼ ΞΞ ▐ ▐ ▀▐ ‼/n‼ ♫ ///^ ▀▀▀ ▐ ▐ ‼/n‼ ♫♫♫ ΞΞΞΞ ▀///^/ ▀ ¥ ▐ ▐ ◘◘ ‼/n‼ ▀▀▀▀▀▀▐ ΞΞ === ▐ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▐ ▀▀▀▀▀▀ ‼/n‼ ‼‼~~~~~~~‼‼ ▐ ▐ ▀▐ ▀ ‼/n▀▀▀▀▀▀ ‼‼░░░░░░░‼‼▬▬▬▬▬ ▐ /// /// ^/// ///^ /// /// ///^ ///^▐ ▐ /// /// /// ♫♫ ‼/n‼♫♫ ‼‼░░░░░░░‼‼ΞΞΞΞΞ ▐/ // //^^/ //^/ //^ // //^^///^/ / //▐ ☼ ▀ ▐^ // //^/ //♫♫///^‼/n‼=========‼‼‼‼‼‼‼‼‼‼‼==========================================================================================================================‼/nSmilieBounce 25 with built in copy&replace editor ;-)/n/n[.:control:.] [.:enemies:.] [.:goal:.] [.:have fun:.]/n ↑up/n ← → ▀ ¥▀☼ ▀~~▀///▀ ◘◘ & ♫♫ & do not cheat ;-)/n left right ▀▀▀▀▀▀▀▀▀▀▀▀▀/n/n[.:score:.] "; addEventListener(Event.ENTER_FRAME, function(){ replace("☼", "☼", true, Math.round(Math.random())*2-1, 0, "¥", "¥", true, Math.round(Math.random())*2-1, 0, "☺", "☺", root["key"+39], 1, 0, "☺", "☺", root["key"+37], -1, 0, "☺", "☺", true, 0, 1) }); function replace(...args) { var pos=this.field.text.indexOf("☺"); if (this.jCount>0 && "♫♪☼~^/// ".indexOf(this.field.text.substring( (pos%145)+(Math.floor(pos/145)-1)*145 , (pos%145)+(Math.floor(pos/145)-1)*145 +1)) > -1) this.field.text = (((this.jCount = this.jCount -1)-this.jCount)+"").substring(0,0)+(this.field.text.substring(0,pos)+" "+this.field.text.substring(pos+1,this.field.text.length)).substring(0 , (pos%145)+(Math.floor(pos/145)-1)*145) + "☺" + (this.field.text.substring(0,pos)+" "+this.field.text.substring(pos+1,this.field.text.length)).substring((pos%145)+(Math.floor(pos/145)-1)*145 +1 , this.field.text.length  );// Neue x, y position berechnen else if ("♫♪☼~^/// ".indexOf(this.field.text.substring( (pos%145)+(Math.floor(pos/145)-1)*145 , (pos%145)+(Math.floor(pos/145)-1)*145 +1)) < 0) this.jCount=0; if ( ((this.field.x+(pos%145)*12) > 500 || (this.field.x+(pos%145)*12) < 300) && (this.field.x < 0 || ((this.field.x+(pos%145)*12)-400)*0.03 > 0) && (this.field.x > -930 || ((this.field.x+(pos%145)*12)-400)*0.03 < 0) ) this.field.x -= ((this.field.x+(pos%145)*12)-400)*0.03; if(root["key"+16]) this.field.text = tempField = this.backup; var tempField:String=this.field.text; for (var j:int=0; j<args.length; j+=(this.pos=0)+5) { while( (this.pos = this.field.text.indexOf(args[j+0], this.pos+1)) > -1){ var futChar = this.field.text.substring( (this.pos%145)+args[j+3]+(Math.floor(this.pos/145)+args[j+4])*145 , (this.pos%145)+args[j+3]+(Math.floor(this.pos/145)+args[j+4])*145 +1); if ( "♫♪☼~^ ///".indexOf(this.field.text.substring( (pos%145)+(Math.floor(pos/145)+1)*145 , (pos%145)+(Math.floor(pos/145)+1)*145 +1)) < 0 && root["key"+38] && this.field.text.substring(this.pos,this.pos+1) == "☺" ) this.jCount=5; if ( (args[j+2]) && "·☼¥☺~^ ♫♪///◘".indexOf(futChar) > -1 && (!this.jCount || args[j+4] != 1)) { tempField = (tempField.substring(0, this.pos) + " " + tempField.substring(this.pos+1, tempField.length)); tempField = tempField.substring(0 , (this.pos%145)+args[j+3]+(Math.floor(this.pos/145)+args[j+4])*145) + args[j+1] + tempField.substring((this.pos%145)+args[j+3]+(Math.floor(this.pos/145)+args[j+4])*145 +1 , tempField.length  ); if ((this.field.text.substring(this.pos,this.pos+1) == "☺" && "~¥☼^///".indexOf(futChar) > -1) || (futChar == "☺" && "☼¥~^^///".indexOf(this.field.text.substring(this.pos,this.pos+1)) > -1)) this.field.text=tempField="/n ______ __ __ ______ __ __ __/n / __ // | | | | / || | | | | |/n | | | | | | | | | ,----'| |__| | | |/n | | | | | | | | | | | __ | | |/n | `--' | | `--' | | `----.| | | | |__|/n //______/ //______/ //______||__| |__| (__)/n/n/n/n +++++ +++++/n +#### ++ +#### ++/n +# ‼ You killed a lovely +# ‼/n | ‼ Smilie :-( | ‼/n | RIP ‼ | RIP ‼/n | ‼ | ‼/n | #‼ Better Luck next Time | #‼/n | ##‼ | ##‼/n +++######-++ +++######-++/n //. **. // //. , . ///n // ° ****// // ° ° ///n // ** )(// /**. ** ///n // **** // Smile again: /******** ///n //° .)( ° // // )( .)( ///n /+________+/ Hit SHIFT for rebirth /+________+//n +----------+ +----------+"; if (this.field.text.substring(this.pos,this.pos+1)=="☺"&&"♫♪".indexOf(futChar)>-1) tempField+="I"; if (this.field.text.substring(this.pos,this.pos+1)=="☺" && futChar == "◘") this.field.text=tempField =" .-./n /. ///n (.. )/n // //n /// `-´ n /// () /°´°// () n (´) () /// /// / ´°°°// /// /// () (´)/n |// /// /°°// /´´// / ´ °°°// / ´// /°°// /// /|/n |´/// ´///°´°´// /´ ´´// / ´ °°°°°// / ´´// /°°+°/// ´///+|/n |´´//´´/°°´°°°//´ ´´´´/ ° ´°°°°°°//´ ´ ´´/°.°...//´´/##|/n |´ ´///°° ´ °°°//´´´´/ ´ °´´´°°°°°// ´´´/°°.+...#///+##|/n |´ °°° °°°°°°//´´/ °#######°°°°//´´/°°......#.°+#+|/n |´ ´´ ´ °° °°°°///°°## ##°°°///°°..°.++.#.###.|/n |´ ´´´ °°°°°°°°°°# #°°°...°°°°°....+++|/n | ´ ´´ °°°°°°°°# ©© ©© #°°.°.°°°.°°+#..++|/n | ´´´° °°°°+++# ©©©© ©©©© #+++°°°°...+..°.+|/n |´´ ´´´°°°°+ # ©© ©© # +°°.°°°+.#.+|/n | ´ ´´°°°°+ © ©# #© © +°°°°°.#°#+|/n | ´ ´´ °°+ # ** ** # +°°.+..°#+|/n |´´´´ °°°+ * # ** ** # * +°°°.+#+.#+|/n | ´´ °°°°°+ *** +# ****** #+ *** +°°°°#+°##.+|/n |´ °°° °°°°°°+++°°°°## ##°°°°+++°°°°°+°°+°°#+|/n | CONGRATULATIONS!°°°°######°°°YOU JUST FINISHED°#.|/n (+---------------------------------------------------+)/n /°´ °°°**_____*__**__*_____*_*°**°*_____*______** ´ ´´///n /°´´ *° */ ____| /// |_ _| |*°°*|_ _| ____|**´´*´°´)/n (*°° ° °*| (___*| // / |*| |*| |*°°***| |*| |__ *°° ´ ´°´° )/n //*´***_**//___ //| |///| |*| |*| |******| |*| __|*°*°°°**´´´///n (//__ | |*____) | |**| |_| |_| |____*_| |_| |____ ***°**°° *)/n /**´**| ||_____/|_|_*|_|_____|______|_____|______|_____* °*//n (*´´°*| '_ //*/ _ //| |*| | _ //*/ __/ _ //***/ _ //| ____| _//n |** *| |_) | (_) | |_| | |*| | (_| __/*°*|/*) /| |__** *°)/n (**´*|_.__/*//___/*//__,_|_|*|_|//___//___|*°°**/ /*|___ //* * |/n //** *´´*´*°***°*°°°**°°******°°°°°****°***/ /_**___) | **)/n ( ***Wanna play again? Just Hit SHIFT***/_____|____/* *//n //____________________________________________________//n/n Final score (if you didn't cheat:D): "+(this.field.text.length-4581); }} this.field.text=tempField;} this.field.setTextFormat(new TextFormat("Lucida Console", 20, null, null, null, null, null, null, null, null, null, null, -3)); } // 25 lines ends here!

文章来自: 闪无忧(www.5uflash.com) 详文参考:http://www.5uflash.com/flashjiaocheng/Flash-as3-jiaocheng/4677.html

25行AS3代码编程大赛的第一名!25行代码构造的AS3游戏相关推荐

  1. 腾讯广告算法大赛 | 初赛第一名心得分享

    腾讯广告算法大赛初赛第一名揭晓, 这只队伍可不得了, 单看队名以为是一个人, 其实它集结了三大高校的精英选手! 今天,他们将从三个方面全方位传授比赛经验. 小板凳儿排排坐!干货记起来~ 大家好,我们是 ...

  2. 语言代码编程大赛简讯_精品干货:C语言的高效编程与代码优化

    在本篇文章中,我收集了很多经验和方法.应用这些经验和方法,可以帮助我们从执行速度和内存使用等方面来优化C语言代码. 简介 在最近的一个项目中,我们需要开发一个运行在移动设备上但不保证图像高质量的轻量级 ...

  3. 命令行与shell编程系列之什么是命令行

    命令行与shell编程系列文章目录 第一章 什么是命令行 第二章 文件权限 第三章 文件的处理 第四章 磁盘和文件系统 第五章 理解shell解析器和shell进程 文章目录 命令行与shell编程系 ...

  4. 开源-BDCI2018供应链需求预测模型第一名解决方案和代码

    本人经过作者同意,公布了:BDCI2018供应链需求预测数据竞赛第一名的解决方案和代码.该方案利用赛题为运用平台积累最近1年多的商品数据预测45天后5周每周(week1~week5)的销量,为供应链提 ...

  5. java获取当前运行代码的类名、方法名、行号

    1.获取当前运行代码的类名,方法名,行号,主要是通过java.lang.StackTraceElement类 2. [1]获得调用者的方法名, 同new Throwable String _metho ...

  6. 【如何给iOS APP加固】之代码混淆及加密 第一章【附代码】

    为了给iOS app加固,我们可以采取以下几种方式: 1.代码混淆 代码混淆是通过修改源代码结构和变量名,使得代码难以被理解和反编译.这可以防止黑客获取应用程序的代码,因为即使他们能够获得源代码,也会 ...

  7. 2018美团CodeM编程大赛资格赛第一题

    一.问题描述 题目描述 美团在吃喝玩乐等很多方面都给大家提供了便利.最近又增加了一项新业务:小象生鲜.这是新零售超市,你既可以在线下超市门店选购生鲜食品,也可以在手机App上下单,最快30分钟就配送到 ...

  8. 深访杨超越杯编程大赛发起人 还原硬核粉丝追星全过程

    欢迎关注"创事记"的微信订阅号:sinachuangshiji 文/石灿 来源:刺猬公社(ID:ciweigongshe) "大家加油,我要退群了,被老婆看到不好.&qu ...

  9. 无代码编程时代下,程序员要失业了?

    作者 | Phodal 责编 | 伍杏玲 [CSDN 编者按]"中台之后,便是无代码编程."无代码编程是什么?开发流程是怎么样的?有何优缺点? 无代码编程时代来了,就不需要程序员编 ...

最新文章

  1. cocos2dx-2.2.0的开始
  2. 进程注入后门工具Cymothoa
  3. 在Linux(Ubuntu)下搭建ASP.NET Core环境并运行 继续跨平台
  4. 退役-兵巨臂锻炼计划
  5. mybatis没有clob类型_mybatis将Oracle的Clob类型转成String的方法
  6. leetcode 140. Word Break II | 140. 单词拆分 II(动态规划)
  7. 【AI视野·今日CV 计算机视觉论文速览 第152期】Fri, 9 Aug 2019
  8. 【小记录】关于dojo中的on事件
  9. 表单提交Post方法、Get方法
  10. LBS由ip查经纬度
  11. c++两个文档匹配数据_《搜索和推荐中的深度匹配》——1.2 搜索和推荐中匹配统一性...
  12. SQL-Server使用点滴(二-系统表)
  13. Mybatis sqlsession解析
  14. Cesium:通过字符串创建颜色
  15. 一个用户在同一时间只能登录一次
  16. c读取txt文件内容并建立一个链表_面试官给我挖坑:rm删除文件之后,空间就被释放了吗?...
  17. 我的希捷ST31000340NS,BIOS不认,磁头反复归位,BUSY模式的固件门硬盘修复成功
  18. 【算法•日更•第五十五期】知识扫盲:什么是卡常数?
  19. 微博微信QQ等开发者平台注册应用时提交签名信息的坑点。
  20. 内网主机通过公网域名解析访问内网服务器,存在什么问题,如何解决?

热门文章

  1. leetcode 94
  2. windows桌面待办事项_想在手机桌面上安装一个便利贴,下载什么便签软件好?
  3. 辛巴巴巴鲁比啦音乐计算机版,辛巴巴巴鲁给啦是什么歌 辛巴巴巴鲁比啦歌曲介绍...
  4. phantomjsjava_Java利用Phantomjs实现生成图片的功能
  5. 化工原理 (传热和设备)
  6. php贝叶斯,php – 将单个概率与朴素贝叶斯垃圾邮件过滤相结合
  7. NeurIPS 2021 | 微软研究院提出CLUES,用于NLU的少样本学习评估
  8. 直播 | KDD 2021论文解读:基于协同对比学习的自监督异质图神经网络
  9. 总奖金15万,双赛道同名消歧挑战赛报名进行中
  10. LongFormer:用稀疏自注意力拓展模型文本容纳量