Re: [請問] 有沒有類似九宮格亂碼器or程式

看板EZsoft作者 (走啦!去喝酒)時間3月前 (2024/01/31 08:13), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串3/3 (看更多)
雖然原po已決定的方法,不過我剛好在試一個類chatgpt服務 以下是它給的做法: 這個方法在目前的windows下不用另外安裝軟體 1. 以管理員權限開啟 windows PowerShell https://www.google.com/search?q=windows+PowerShell+administrator 2. 執行以下指令: Set-ExecutionPolicy RemoteSigned 3. 開新文字檔貼上文末程式碼,將檔名改為 script.ps1 4. windows powershell 視窗切換到 script.ps1 所在目錄 .\script.ps1 -InputFile "in.txt" -OutputFile "out.txt" 會隨機重排 in.txt 中的文字,存入 out.txt 寬度會自動設為字數的平方根 若加上 -Width 7 ,out.txt 中每行寬度就會是 7 powershell 程式碼: param( [Parameter(Mandatory=$true)] [string]$InputFile, [Parameter(Mandatory=$true)] [string]$OutputFile, [int]$Width=0 ) $text = Get-Content -Path $InputFile -Raw $text = $text -replace '\s','' $chars = $text.ToCharArray() $random = New-Object System.Random $chars = $chars | Sort-Object { $random.Next() } $text = -join $chars if ($Width -eq 0) { $Width = [Math]::Sqrt($text.Length) Write-Host "hihi here" } $lines = $text -split '(.{' + $Width + '})' | Where-Object { $_ } $lines | Out-File -FilePath $OutputFile ※ 引述《aisidi (調配咖哩粉)》之銘言: : 我想把兩首詩詞打亂 : 鋪排成類似九宮格 : (九只是虛數,不一定是九,) : 有沒有程式or線上軟體 : 可以直接幫忙鋪排的 : 先謝大家的分享了^^ -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 141.164.52.134 (韓國) ※ 文章網址: https://www.ptt.cc/bbs/EZsoft/M.1706660010.A.A94.html
文章代碼(AID): #1bkP2ggK (EZsoft)
文章代碼(AID): #1bkP2ggK (EZsoft)