A tool class that generates some scrap code that is used to confuse

Source: Internet
Author: User

Publish a number of small games, because the game frame is the same, is the same as the judgment code is not reviewed.

Then added a bit of scrap code. I don't know if I can. If it is a manual audit, it is basically not ...

Tool class
/** * Generates some scrap code to confuse * @author Chenkai 2018/10/7 */class Confusetool {public constructor () {}public static createclass (num:n umber) {Let str = "", for (let i=0;i<num;i++) {//class str + = "Class" + this.getletter () + "{" + "\ n";//property for (Let I=0;i<20;i + +) {str + = "public    " + this.getletter () + ";" + "\ n";} function for (let i=0;i<20;i++) {str + = "public    " + this.getletter () + "() {" + "\ n"; for (let i=0;i<10;i++) {str + = "        Let "+ this.getletter () +" = ' "+ this.getletter () +" '; " + "\ n";} str + = "    }" + "\ n";} Class End str + = "}" + "\ n";} return str;} /** confusing letters and numbers */public static confusestr = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";/** gets the confusing string */public static Getletter () {Let str = " StrLen = This.confusestr.length;let len = 20;for (let i=0;i<len;i++) {str + = This.confuseStr.charAt (Math.Round ( Math.random () * (strLen-1));} return str;}}

  

Use
Console.log (Confusetool.createclass (1));

  

Browser printing

A tool class that generates some scrap code that is used to confuse

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.