function nameResult(str) { var _local1 = checkPreList(str); if (_local1 == null) { _local1 = getResult(str); } var _local2 = ("姓名:" + str) + newline; _local2 = _local2 + (("人品得分:" + foramtResult(_local1)) + newline); _local2 = _local2 + ("评价:" + getValue(_local1)); return (_local2); } function foramtResult(n) { return ((((n >= 0) && (n <= 100)) ? (n) : "负溢出")); } function getValue(n) { var _local2 = ""; if (n == 0) { _local2 = "你一定不是人吧?怎么一点人品都没有?!"; } else if ((n > 0) && (n <= 5)) { _local2 = "算了,跟你没什么人品好谈的..."; } else if ((n > 5) && (n <= 10)) { _local2 = "是我不好...不应该跟你谈人品问题的..."; } else if ((n > 10) && (n <= 15)) { _local2 = "杀过人没有?放过火没有?你应该无恶不做吧?"; } else if ((n > 15) && (n <= 20)) { _local2 = "你貌似应该三岁就偷看隔壁大妈洗澡的吧..."; } else if ((n > 20) && (n <= 25)) { _local2 = "你的人品之低下实在让人惊讶啊..."; } else if ((n > 25) && (n <= 30)) { _local2 = "你的人品太差了。你应该有干坏事的嗜好吧?"; } else if ((n > 30) && (n <= 35)) { _local2 = "你的人品真差!肯定经常做偷鸡摸狗的事..."; } else if ((n > 35) && (n <= 40)) { _local2 = "你拥有如此差的人品请经常祈求佛祖保佑你吧..."; } else if ((n > 40) && (n <= 45)) { _local2 = "老实交待..那些论坛上面经常出现的偷拍照是不是你的杰作?"; } else if ((n > 45) && (n <= 50)) { _local2 = "你随地大小便之类的事没少干吧?"; } else if ((n > 50) && (n <= 55)) { _local2 = "你的人品太差了..稍不小心就会去干坏事了吧?"; } else if ((n > 55) && (n <= 60)) { _local2 = "你的人品很差了..要时刻克制住做坏事的冲动哦.."; } else if ((n > 60) && (n <= 65)) { _local2 = "你的人品比较差了..要好好的约束自己啊.."; } else if ((n > 65) && (n <= 70)) { _local2 = "你的人品勉勉强强..要自己好自为之.."; } else if ((n > 70) && (n <= 75)) { _local2 = "有你这样的人品算是不错了.."; } else if ((n > 75) && (n <= 80)) { _local2 = "你有较好的人品..继续保持.."; } else if ((n > 80) && (n <= 85)) { _local2 = "你的人品不错..应该一表人才吧?"; } else if ((n > 85) && (n <= 90)) { _local2 = "你的人品真好..做好事应该是你的爱好吧.."; } else if ((n > 90) && (n <= 95)) { _local2 = "你的人品太好了..你就是当代活雷锋啊..."; } else if ((n > 95) && (n <= 99)) { _local2 = "你是世人的榜样!"; } else if (n == 100) { _local2 = "天啦!你不是人!你是神!!!"; } else { _local2 = "你的人品竟然负溢出了...我对你无语.."; } return (_local2); } function getResult(str) { var _local3 = 0; var _local1 = 0; while (_local1 < str.length) { _local3 = _local3 + str.charCodeAt(_local1); _local1++; } return (_local3 % 100); } function checkPreList(str) { var _local1 = null; for (var _local3 in PrenameList) { if (PrenameList[_local3][0] == str) { _local1 = PrenameList[_local3][1]; break; } } return (_local1); } PrenameList = new Array (); PrenameList.push(["张晋", 100]); PrenameList.push(["鬼龟", 100]); PrenameList.push(["cordy", 100]); PrenameList.push(["jx2cordy", 100]); PrenameList.push(["2306205002", 100]); PrenameList.push(["日本人", -1]); PrenameList.push(["小日本", -1]); PrenameList.push(["日本", -1]); PrenameList.push(["日本鬼子", -1]);
fscommand ("showmenu", false); inputName.maxChars = 20; resultArea.text = "请输入要计算的名字 然后点击计算按钮\n本程序内容纯属构 仅供娱乐之用\n如有雷同 纯属巧合\n----------by cordy"; okBtAction = new Object (); okBtAction.click = function () { var _local1 = inputName.text; _local1 = _local1.split(" ").join(""); _local1 = _local1.split(" ").join(""); _local1 = _local1.split("\t").join(""); inputName.text = _local1; if (_local1 == "") { resultArea.text = "请先输入要计算的名字"; } else { resultArea.text = nameResult(_local1); } }; okBt.addEventListener("click", okBtAction);
|