Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

PowerShell 65 Bytes

0..$args[0]|%{-join("_"*25+" "*5)[($r=Random 25)..($r-29)];,""*5}

Run a loop for n iterations. Get a random number and make a underscore string with 5 spaces at the end. Index into the the string as an array to pull starting from a random location. Negative indexing wraps from the end. Join that back up again and append 5 newlines.

Edit: I don't know why I thought I needed the parameter for -Maximum as it's positional. Thanks to TimmyD TimmyD I shaved some bytes and forgot to get input so that drove me back up to 65.

PowerShell 65 Bytes

0..$args[0]|%{-join("_"*25+" "*5)[($r=Random 25)..($r-29)];,""*5}

Run a loop for n iterations. Get a random number and make a underscore string with 5 spaces at the end. Index into the the string as an array to pull starting from a random location. Negative indexing wraps from the end. Join that back up again and append 5 newlines.

Edit: I don't know why I thought I needed the parameter for -Maximum as it's positional. Thanks to TimmyD I shaved some bytes and forgot to get input so that drove me back up to 65.

PowerShell 65 Bytes

0..$args[0]|%{-join("_"*25+" "*5)[($r=Random 25)..($r-29)];,""*5}

Run a loop for n iterations. Get a random number and make a underscore string with 5 spaces at the end. Index into the the string as an array to pull starting from a random location. Negative indexing wraps from the end. Join that back up again and append 5 newlines.

Edit: I don't know why I thought I needed the parameter for -Maximum as it's positional. Thanks to TimmyD I shaved some bytes and forgot to get input so that drove me back up to 65.

miscounted
Source Link
Matt
  • 1.1k
  • 12
  • 14

PowerShell 6665 Bytes

0..$args[0]|%{-join("_"*25+" "*5)[($r=Random 25)..($r-29)];,""*5}

Run a loop for n iterations. Get a random number and make a underscore string with 5 spaces at the end. Index into the the string as an array to pull starting from a random location. Negative indexing wraps from the end. Join that back up again and append 5 newlines.

Edit: I don't know why I thought I needed the parameter for -Maximum as it's positional. Thanks to TimmyD I shaved some bytes and forgot to get input so that drove myme back up to 65.

PowerShell 66 Bytes

0..$args[0]|%{-join("_"*25+" "*5)[($r=Random 25)..($r-29)];,""*5}

Run a loop for n iterations. Get a random number and make a underscore string with 5 spaces at the end. Index into the the string as an array to pull starting from a random location. Negative indexing wraps from the end. Join that back up again and append 5 newlines.

Edit: I don't know why I thought I needed the parameter for -Maximum as it's positional. Thanks to TimmyD I shaved some bytes and forgot to get input so that drove my back up to 65.

PowerShell 65 Bytes

0..$args[0]|%{-join("_"*25+" "*5)[($r=Random 25)..($r-29)];,""*5}

Run a loop for n iterations. Get a random number and make a underscore string with 5 spaces at the end. Index into the the string as an array to pull starting from a random location. Negative indexing wraps from the end. Join that back up again and append 5 newlines.

Edit: I don't know why I thought I needed the parameter for -Maximum as it's positional. Thanks to TimmyD I shaved some bytes and forgot to get input so that drove me back up to 65.

added 80 characters in body
Source Link
Matt
  • 1.1k
  • 12
  • 14

PowerShell (削除) 65 (削除ここまで)(削除) 60 (削除ここまで) 5966 Bytes

0..3|%$args[0]|%{-join("_"*25+" "*5)[($r=Random 25)..($r-29)]+"`n"*5];,""*5}

Run a loop for 4n iterations. Get a random number and make a underscore string with 5 spaces at the end. Index into the the string as an array to pull starting from a random location. Negative indexing wraps from the end. Join that back up again and append 5 newlines.

Edit: I don't know why I thought I needed the parameter for -Maximum as it's positional. Thanks to TimmyD I shaved some bytes and forgot to get input so that drove my back up to 65.

PowerShell (削除) 65 (削除ここまで)(削除) 60 (削除ここまで) 59 Bytes

0..3|%{-join("_"*25+" "*5)[($r=Random 25)..($r-29)]+"`n"*5}

Run a loop for 4 iterations. Get a random number and make a underscore string with 5 spaces at the end. Index into the the string as an array to pull starting from a random location. Negative indexing wraps from the end. Join that back up again and append 5 newlines.

Edit: I don't know why I thought I needed the parameter for -Maximum as it's positional.

PowerShell 66 Bytes

0..$args[0]|%{-join("_"*25+" "*5)[($r=Random 25)..($r-29)];,""*5}

Run a loop for n iterations. Get a random number and make a underscore string with 5 spaces at the end. Index into the the string as an array to pull starting from a random location. Negative indexing wraps from the end. Join that back up again and append 5 newlines.

Edit: I don't know why I thought I needed the parameter for -Maximum as it's positional. Thanks to TimmyD I shaved some bytes and forgot to get input so that drove my back up to 65.

added 9 characters in body
Source Link
Matt
  • 1.1k
  • 12
  • 14
Loading
added 101 characters in body
Source Link
Matt
  • 1.1k
  • 12
  • 14
Loading
Source Link
Matt
  • 1.1k
  • 12
  • 14
Loading

AltStyle によって変換されたページ (->オリジナル) /