Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Shortest Script Challenge - Alphabet staircase
- #https://www.reddit.com/r/PowerShell/comments/7rwxmp/shortest_script_challenge_alphabet_staircase/
- #My attempts...
- $a="A".."Z";$i=0;Do{-join($a[0..$i]);$i++}while($i-ne26) #56 Initial attempt, typed it out exploded then just removed white space.
- $a="A".."Z";$a|%{-join("A"..$_)} #32 A bit more refined.
- ("A".."Z")|%{-join("A"..$_)} #28 Who needs $a?
- 65..90|%{-join("A"..[char]$_)} #30 Trying a different take, not as good.
- #/u/vrdse
- 0..25|%{'ABCDEFGHIJKLMNOPQRSTUVWXYZ'[0..$_]-join''} #51
- 0..25|%{('A'..'Z')[0..$_]-join''} #33
- #/u/nadroj_r
- 0..25|%{[char[]](65..90)[0..$_]-join''} #39
- #/u/bukem
- 65..90|%{-join(65..$_|%{[char]$_})} #35
- 0..25|%{-join('A'..'Z')[0..$_]} #31
- ('A'..'Z')|%{-join('A'..$_)} #28 Yay, same as my 28.
- #/u/bis
- ('A'..'Z')|%{$z+=$_;$z} #23
- $z='';('A'..'Z')|%{$z+=$_;$z} #29
- $z='';65..90|%{$z+=[char]$_;$z} #31
- #/u/Jarmom
- 65..90|%{$x+=[char]$_;$x} #25 Need to "remove-variable x" to rerun.
Add Comment
Please, Sign In to add comment