Skip to content

Commit 9912538

Browse files
author
梶塚太智
committed
Update main.rs
append feature of shuffle list
1 parent 33a3c47 commit 9912538

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,13 @@ impl Executor {
428428
self.stack.push(result);
429429
}
430430

431+
// シーケンス値をシャッフル
432+
"shuffle" => {
433+
let mut list = self.pop_stack().get_list();
434+
list.shuffle(&mut rand::thread_rng());
435+
self.stack.push(Type::List(list));
436+
}
437+
431438
// 文字列操作コマンド
432439

433440
// 文字列を回数分リピート

0 commit comments

Comments
 (0)