Batch code that converts a string to uppercase in lower case and outputs a delayed response

Source: Internet
Author: User
Tags benchmark

Question objective
1. Master the big and lowercase interchange skills
2. Master latency output skills
3. Master character truncation techniques
Problem-solving requirements
1. Ensure Code Efficient and universal
2. Try to make code as concise as possible
3. Do not generate temporary files
Extra score rules
1 unique Train of Thought benchmark score 5 points
2 code efficiency, general benchmark score: 4 points
3. Superb Skills, benchmark score: 3 points
4. Simple code benchmark: 2 points
5. Perfect code + 15 points
The questions are as follows:
There is a string I like the bathome, because here is the batch of the world.
Batch Processing is required to convert all the letters of the string into uppercase and output the strings in a delayed manner based on the typing effect on the screen.
Limits
Not Limited

BATMAN:Copy codeThe Code is as follows: @ echo off
Set "str = I like the bathome, because here is the batch of the world ."
Set "code = a B c d e f g h I j k l n m o p q r s t u v w x y z"
For % I in (% code %) Do call, set "str = % STR: % I = % I %"
: Lp
Set/P = % STR :~, 1% <NUL & set "str = % STR :~ 1%"
For/L % I in (1,1, 200) Do echo> NUL
If defined STR goto lp
Pause> NUL

Terse:Copy codeThe Code is as follows: @ echo off & setlocal enabledelayedexpansion
Set "str = I like the bathome, because here is the batch of the world ."
For % I in (a B c d e f g h I j k l m n o p q r s t u v w x y z) do set STR =! STR: % I = % I!
: Lp
Set/P =! STR :~ % N %, 1! <NUL
Set/a n + = 1
For/L % J in (1, 1, 500) Do ver> NUL
If not "! STR :~ % N %, 1! "=" "Goto lp
Pause> NUL

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.