воскресенье, 11 августа 2019 г.

willie script, psh

$count_in_serial = 4 #
$overall_count = 20 #
$sleep_sec = 6 #

Add-Type -AssemblyName System.speech
$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer
$speak.SelectVoice('Microsoft Zira Desktop')

$rnd = [random]::new()

for($i=0; $i -lt $overall_count; $i++){
    $str = ""
    for($j=0; $j -lt $count_in_serial; $j++){
      $str += " " + $rnd.Next(1,10) 
    }
    write-host $str
    $speak.Speak($str)
    Start-Sleep -Seconds $sleep_sec
}

Комментариев нет:

Отправить комментарий