Batch processing random value Practice code _dos/bat

Source: Internet
Author: User
Tags benchmark
The purpose of the quiz:
Mastering the technique of random value using random
Problem-Solving requirements:
Code generic, efficient
Try to be concise.
Try not to generate temporary files
Additional rules:
1 Ideas unique benchmark points 5 points
2 code efficiency, common benchmark points 4 points
3 Skill Superb Benchmark score 3 points
4 Code concise benchmark points 2 points
5 Perfect code plus points 15 points
The topics are as follows:
1-26 is known to correspond to A-Z one by one, such as 1 corresponding to a 10 corresponding to J 26 corresponding to Z, requiring batch processing
Randomly extract 10 distinct values from the 52 values of 1-26-A-Z (all considered values) and display them,
Note that values such as 1 and a 24 and x 26 and Z are considered identical.
Problem-Solving Limitations:
Temporarily unrestricted.
Answer:
Batman
Copy Code code as follows:

@echo off&setlocal enabledelayedexpansion
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/a n+=1,a=!random!%%2
If!a! Equ 0 (
Set "_!random!! random!! Random!=%%i "
) Else (
Set "_!random!! random!! random!=!n! "
)
)
for/f "tokens=2 delims=="%%i in (' Set _ ') does (
set/a n-=1
If!n! Equ pause>nul&goto:eof
Set/p=%%i <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.