📄 unsort.pl
字号:
#! /usr/bin/env perl# unsort.pl - print words of a short file in random order# processes from stdin to stdout# Copyright (C) 2004 by Matthias Andree# This file is under the GNU General Public License, v2my @a = <>;chomp @a;@a = split ' ', join(' ', @a);srand(time ^ ($$ + ($$ << 15)));while(scalar @a) { my $pos = int rand scalar @a; print $a[$pos], "\n"; @a = (@a[0..($pos-1)],@a[($pos+1)..$#a]);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -