Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

¶ /prog/ Challenge Vol. A ¶ Code Golf ¶

Name: Anonymous 2010-09-13 15:54

***************************************************
* - Implement a
Fibonacci Butt Sort.              *
*   http://dis.4chan.org/read/prog/1250478524/128 *
* - Don't forget the surrounding
b and i tags!    *
* -
Spaces and newlines must be skipped.          *
* - Do this in
less bytes of code than the        *
*   previous poster.                              *
* - Any frequently-used language may be used.*    *
***************************************************


*No one-character submissions in a self-made language that solves the problem in one byte.

Name: Anonymous 2010-09-14 9:16

>>22
MASTER RUBY EXPERT HERE

First, kid, don't use booleans in initialization.


b=0
puts "[b][i]#{ARGV[0].gsub(/\w/){|m|t=b==1?"o":"u";b=1-b;"[#{t}]#{m}[/#{t}]"}}[/i][/b]"


Then don't use b==1. Use !!b.

b=0
puts "[b][i]#{ARGV[0].gsub(/\w/){|m|t=!!b ?"o":"u";b=!b;"[#{t}]#{m}[/#{t}]"}}[/i][/b]"


Then upgrade your ruby to 1.9 and return back to integers. Also space after puts is unnecessary.


b=0
puts"[b][i]#{ARGV[0].gsub(/\w/){|m|t="ou"[b];b=1-b;"[#{t}]#{m}[/#{t}]"}}[/i][/b]"


Then reread original problem. It doesn't require to   /w/ can be upgraded to .

b=0
puts"[b][i]#{ARGV[0].gsub(/./){|m|t="ou"[b];b=1-b;"[#{t}]#{m}[/#{t}]"}}[/i][/b]"

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List