Batch processing Yang Hui's triangle Effect implementation code

Source: Internet
Author: User
Tags goto

  This article mainly introduces batch processing printing color Yang Hui's triangle effect code, like a friend can test under

Effect Diagram:   code is as follows: @echo Off&color 0e setlocal enabledelayedexpansion mode con:cols=130 lines=130:top cls:: set/p I n= Please enter the number of rows: Set In=23&set ab=1&set var=64 if "%in%" = "goto top if%in% geq goto top If%in% leq 0 goto Top Echo %IN%|FINDSTR/R "^[0-9][0-9]*$" >nul 2>nul| | Goto Top Set Str=1 for/l%%i in (1,1,%in%) does (   set num=    set num2=0    for%%a in (!s tr!) Do (   set/a num2+=1    if!num2!==1 Set "str1="    set/a num1=%%a+num    set " str1=!str1!!num1! "   set num=%%a    )    call:lis"!str1:~1! "   set" str=!str1 ! 0 ") Rem again output an inverted pyramid to play. FOR/L%%a in (22-1 1) do echo!nam%%a! FOR/L%%i in (1 1 3) does (  for%%a in (a B c D E F) do (  color 0%%a   ping/n 2 127.1>nul  )) E Xit:lis set max=%~1 for/l%%a in (0 1) does (if not "!max:~%%a,1!" = = "" set/a ci+=1) set/a ki=var-ci/2 for/l%%a in (1 1!ki!) do set kg=!kG! Echo!kg!! max! Set nam!ab!=!kg!! max! set/a ab+=1 set Ci=0&set kg= goto:eof
Related Article

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

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.