Return Styles: Pseud0ch, Terminal, Valhalla, Blue Moon.

Pages: 1-

¶ /prog/ Challenge Vol. B ¶ Fibonacci Buttsort ¶

Name: Anonymous 2018-01-05 11:35

***************************************************
* - Implement a Fibonacci Butt Sort.† *
* - Don't forget the surrounding b and i tags! *
* - Spaces and newlines must be skipped. *
* - Any frequently-used language may be used. *
* - Output markup is either BBCode or SEXPcode. *
* - Lowest bytesize wins. *
***************************************************


A Fibonacci Buttsort is an operation that can be performed on a string which outputs the string with alternating underline and overline tags, starting with underline. The resulting string is also bold and italicised. Whitespace characters are skipped.

SICP -> SICP
HAX ANUS -> HAX ANUS

Name: Anonymous 2018-01-05 12:32

import itertools;a=itertools.cycle('{u }{o }');b="{b {i ";c="b+=";d="next(a);"
for x in input():
if x.isspace():b+=x
else:exec((c+d)*3+c+'x;'+c+d)
print(b)


this is kinda meh solution, definitely can be golfed harder. also, it relies on a bug in /prague/'s sexpcode parser. can you spot it?

Name: Anonymous 2018-01-05 16:06

Hm ok

Name: FrozenVoid !MhMRSATORI!!ToSuuKYUiEA 2018-01-05 16:08

a=prompt(""),b=0;
"{b.i "+a.split("").map((x)=>{return/\s/.test(x)&&x||(b++%2?"{o "+x:"{u "+x)+"}"}).join("")+"}"


:^) Edited on 05/01/2018 16:13.

Name: Anonymous 2018-01-05 17:37

>>4
Turn off post edits. You ruined /prog/

Name: FrozenVoid !MhMRSATORI!!ToSuuKYUiEA 2018-01-05 17:38

>>5
I was fixing my code

Name: Anonymous 2018-01-05 17:41

>>5-6
Get out of my thread, autists.

Name: Anonymous 2018-01-05 18:09

Placeholder for my awesome code.

Name: Anonymous 2018-01-05 22:41

CL-USER> (format
t
"{b.i ~{~{{~[~;u~;o~] ~a}~}~}}"
(loop for x across (read-line) and i from 0
for m = (or (position x '(#\Space #\Newline #\Tab))
(1+ (mod i 2)))
collect `(,m ,x)))

Name: Anonymous 2018-01-06 3:45

>>5
Disable post edits for everyone dickhead

Name: Anonymous 2018-01-06 4:44

>>10
Why?

Name: Anonymous 2018-01-10 1:57

: FBS
." [b][i]"
0 DO
DUP
I 1+ 2 MOD IF
." [o]"
I + 1 TYPE
." [/o]"
ELSE
." [u]"
I + 1 TYPE
." [/u]"
THEN
LOOP ;

Name: Anonymous 2018-01-10 2:14

>>12
what programming language is this?

Name: Anonymous 2018-01-10 3:10

>>13
Forth

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