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

Fibonacci Butt Sort

Name: Anonymous 2009-08-16 23:08

Let us discuss the various implementations of theFIBONACCI BUTT SORT.

Name: Anonymous 2009-09-03 20:06

>>123
Dont feel too bad about it. Buttsorts requires advanced knowledge of parsing and string manipulation. They are a good exercise for an expert programmer, but for a beginner like yourself you shouldn't try and tackle them until you've learned enough about the aforementioned subjects.

Name: Anonymous 2009-09-03 20:15

Name: Anonymous 2009-09-03 20:15

>>124-chan here. Disregard that, I suck cocks! Buttsorting might be advanced material for Prague, but in the grand Scheme of things it's a fairly elementary exercise for anyone with a few weeks of experience. Also, ignore my next post, since I'll just be trolling you with it anyway. Have a nice anus !!

Name: /prog/snake 2009-09-03 20:19

>>125 My Twitter is 2nd ;_;

Name: Anonymous 2009-09-03 20:22

>>125
A Fibonacci Buttsort is an operation that can be performed on a string which outputs the string with alternating underline and overline tags.
THIS IS A FIBONACCI BUTTSORT

Name: Anonymous 2009-09-03 20:55

>>128
oh great master enlighten us in the ways of the
FIBONACCI BUTTSORT

Name: Anonymous 2009-09-03 20:58

YOU FORGOT YOUR BOLD AND ITALIC TAGS

Name: sage 2009-09-03 21:05

>>130
Why do you think that I asked for help?
You forgot to sage, FTFY

Name: Anonymous 2009-09-03 22:19

>>111
WTF IS super(THIS); SHIT?

Name: Anonymous 2009-09-04 4:53

>>123
Uh. It's really simple string manipulation. You may want to consider your skill in various other problem domains before reaching a decision.

Name: Anonymous 2009-09-04 6:19

HELLO CHRYZZY

Name: Anonymous 2009-09-06 13:46

LOL SORTING STEPHANIE'S BUTT!

Name: Anonymous 2009-09-06 14:08

stuff = map(int,raw_input('Enter your numbers:').split(' '))
stuff.sort()
for num in stuff:
    print num,

Name: Anonymous 2009-09-07 7:22

############_________###_____________________________________###_________############
#############_______###____######_____________________________###_______#############
___________###______###___##____##____________________________###______###___________
___________###_____###____##____##_______________########______###_____###___________
____________###___###______######_______________##______##______###___###____________
____________###___###__________________________##________##_____###___###____________
_____________###__###__________________________##________##_____###__###_____________
_____________###__###___________________________##______##______###__###_____________
______________###__###___________________________########______###__###______________
______________###___###_______________________________________###___###______________
_______________###__###_______#################_______________###__###_______________
_____________________###______#################______________###_____________________

Name: Anonymous 2009-09-07 12:29

just testing
expert programmer

Name: Anonymous 2009-09-07 12:38

-- buttsort.hs - an implementation of the Fibonacci Buttsort
import Data.Char (isSpace)
import Control.Monad.State

data Tag = Tag String
           deriving (Show, Eq)

class Text a where
    value :: a -> String

instance Text Char where
    value = (:[])

instance (Text a) => Text [a] where
    value = concatMap value

(<<) :: (Text a) => Tag -> a -> String
infixr <<
(Tag t) << x = "[" ++ t ++ "]" ++ value x ++ "[/" ++ t ++ "]"

[b, i, o, u, m] = map Tag ["b", "i", "o", "u", "m"]

buttsortW, buttsortC :: String -> String
buttsortW = (b <<) . (i <<) . unwords . zipWith (<<) (cycle [u, o]) . words
buttsortC = (b <<) . (i <<) . concat . flip evalState (cycle [u, o]) . mapM f
  where f c = if isSpace c then return [c]
                else do t <- get
                        modify tail
                        return $ head t << c


EXPERT HASKELL PROGRAMMING

Name: Anonymous 2009-09-07 17:24

>>139
That looks remarkably like the one I posted in the other thread — whereëver it went — in the control flow and use of cycle, anyway.

________
tag t str = "[" ++ t ++ "]" ++ str ++ "[/" ++ t ++ "]"
[b,i,o,u] = tag `map` words "b i o u"

dabs = b . i . unwords . zipWith id (cycle [o,u]) . words
fbs = b . i . concat . flip evalState (cycle [o,u]) . mapM f where
    f ' ' = return " "
    f c = (liftM . concatMap) ($ [c]) (State $ splitAt 1)

Name: Anonymous 2009-09-07 18:44

>>140
Great minds think alike, I guess.

Name: Anonymous 2009-09-07 19:47

TESTING MY TOUPPERCASE BUTTSORT (*83

Name: Anonymous 2009-09-07 19:48

>>142
FORGOT MY SAGE

Name: Anonymous 2009-09-07 19:50

>>142
>>143
Too little, too late.

Name: Anonymous 2009-09-09 8:56

Name: Anonymous 2009-09-09 15:29

>>145
What is the meening of this poast?

Name: Anonymous 2009-09-09 15:40

>>146
( ≖‿≖)

Name: Anonymous 2009-09-09 15:45

>>146
RedCream Detected

Forgot your poohippo@hotmail.com, bro

Name: Anonymous 2009-09-09 22:52

[tt]test[/tt]

Name: Anonymous 2009-09-11 0:05

>>149
fail

Name: Anonymous 2009-09-15 22:55

fibonaccci butt sort

Name: Anonymous 2009-09-17 4:42

FIBONACCI BUTT SORT

Name: Anonymous 2009-11-14 15:06

[u]fi[]/ubo[]/un[]/u[]/uacci[]/u []/u[]/ubu[]/u[]/uttsor[]/u[]/u

Name: Anonymous 2009-11-14 15:09

>>153
LOLLING

^^^^ HAY EVERYONE LOOK AT THIS INTENSE FAILURE ^^^^^^

Name: Anonymous 2009-11-14 15:12

>>153
ahahhahhahahahha!

Name: Anonymous 2009-11-14 15:47

SCUURMPSRHIOSTE

Name: Anonymous 2009-11-14 15:51

>>156
Now that's just mean.

Name: Anonymous 2009-11-14 20:11

PBAANMTPSUU

Name: ¬¬ 2009-11-14 20:23

>>156
I wasn't surprised at all

Name: Anonymous 2009-11-14 20:32

ithinkit'stimetokillyourself

Name: Anonymous 2009-11-14 23:31

That's good, I was kind of missing the buttsort.

Name: Anonymous 2009-11-14 23:33

i wouldn't mind /b/ share some foolproof an hero methods.

p.s. i don't have an ipod.

Name: Anonymous 2009-11-15 17:17

Hey /prog/.

Name: Anonymous 2009-11-23 23:56

>>153


^^^^ HAY EVERYONE LOOK AT THIS INTENSE FAILURE ^^^^^^[/b][/b][/b][/b][/b][/b]

Name: Anonymous 2009-11-24 5:21

BUTTSORT MY ANUS

Name: Anonymous 2009-11-24 5:25

>>165
That's kinda the point.

Name: Anonymous 2009-11-24 5:32

>>165
ANUSSORT MY BUTT

Name: Anonymous 2009-11-24 5:36

Anyone noticed this thread is not threadstopped? Because the same faggot that posted >>1 makes the spam!

Name: Anonymous 2009-11-24 5:36

>>168
wat. email: sage. where's that?

Name: Anonymous 2009-11-24 5:37

lol 4chan disabled email

Name: Anonymous 2009-11-24 5:41

test

Name: Anonymous 2009-11-24 5:41

>>168
Precisely.

Name: Anonymous 2009-11-24 5:42

Well, buttsorting an anus is a bit like sorting an AVL tree.

Name: Anonymous 2009-11-24 5:43

HAXUS THE EMAIL

Name: Anonymous 2009-11-24 5:44

FUCK the Haxus meme just got haxed.

Name: Anonymous 2009-11-24 6:33

h

Name: Anonymous 2009-11-24 6:59

>>173
Don't you hate the kind of trolls that troll a board simply by putting technical terms together? also every idiot that'll jump in and say "but I know how to sort AVL trees!" AVL trees do NOT get sorted. They are self balanced you you!

Name: Anonymous 2009-11-24 8:13

>>177
lol lol i trol u

Name: Anonymous 2009-11-24 8:20

>>177
How old are you 12? Its either that or you're clearly retarded either way. I'd rather be 5ft 6 than be as retarded as you.

Name: Anonymous 2009-11-24 10:13

>>177
Balancing involves sorting... they are just refering to being able to properly implement an AVL tree including the balancing (or sorting) aspects.

It's obvious to me, you must just have assburgers.

Name: Anonymous 2009-11-24 10:16

yea!

Name: Anonymous 2009-11-24 10:17

[newlineInjection]\n[/newlineInjection]

Name: Anonymous 2009-11-24 10:20

Name: Anonymous 2009-11-24 10:20

%0A%3C/span%3E%3Cspan%20class=

Name: Anonymous 2009-11-24 10:25

‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂
‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂
‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂
‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂
‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂

Name: Anonymous 2009-11-24 10:28

◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂
‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂
‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂
‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂
‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂‬◙◙◙◙◙◙◙◙◙◙◙‍╩╩╩╩⌐∂

Name: Anonymous 2009-11-24 10:29

Name: Anonymous 2009-11-24 10:35

TRUE TRUTH EXPERT

Name: Anonymous 2009-11-24 10:37

>>30
GHCi, version 6.10.4: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer ... linking ... done.
Loading package base ... linking ... done.
[1 of 1] Compiling Main             ( fibs.hs, interpreted )

fibs.hs:1:11: Not in scope: `b'

fibs.hs:1:15: Not in scope: `i'

fibs.hs:1:30: Not in scope: `u'

fibs.hs:1:33: Not in scope: `o'
Failed, modules loaded: none.
Prelude>


WHAT?

Name: Anonymous 2009-11-24 11:08

YET ANOTHER HASKELL FAILUER

Name: Anonymous 2009-11-25 1:01

>>177
AVL trees do NOT get sorted. They are self balanced you you!

   joke
  _____
 /     \
/  you  \

Anii do not need buttsorting, they are self buttsorted

Name: Anonymous 2009-11-25 1:06

>>191
win

Name: Anonymous 2009-11-25 12:29

There is always a cheek to the left, one anus, and a cheek to the right, so I guess butttrees are naturally quite well-balanced.

Name: Anonymous 2009-11-25 16:08

Left cheek anus right cheek, arranged in an infinite set of Penrose tiles.

Name: Anonymous 2009-11-26 5:32


(defun compose (&rest fns)
  (if fns
      (let ((fn1 (car (last fns)))
        (fns (butlast fns)))
    #'(lambda (&rest args)
        (reduce #'funcall fns
            :from-end t
            :initial-value (apply fn1 args))))
    #'identity))

(defun cycle-fns (&rest functions)
       (let* ((n (length functions))
          (p 0)
          (array (loop
                with a = (make-array (list n)
                         :element-type 'function
                         :initial-element #'identity)
                for function in functions
                for i from 0 to (1- n)
                do (setf (aref a i) function)
                finally (return a))))
         (lambda (&rest args)
           (prog1
           (apply (aref array p) args)
         (setf p (mod (1+ p) n))))))

(defun bbcode (tag)
  (lambda (i)
    (format nil "[~A]~A[/~A]" tag i tag)))

(defun fibonacci-buttsort (string)
   (funcall (compose (bbcode "b") (bbcode "i"))
        (with-output-to-string (s)
          (mapc (lambda (x) (princ x s))
            (map 'list (cycle-fns (bbcode "o") (bbcode "u"))
             string)))))


EXPERT ARTIST

Name: Anonymous 2009-11-26 5:40

>>195
Come to think of it, i could get rid of (map 'list ...) by composing (princ ... s) with (cycle-fns ...)

Name: Anonymous 2009-11-26 5:52

>>195
Your cycle-fns function seems unnecessarily complicated, why not just use a circular list + pop or something like:

(let ((ht (make-hash-table :test #'equal)))
  (defun cycle (&rest args)
    (symbol-macrolet ((h (gethash args ht)))
      (unless h (setf h args))
      (pop h))))

Name: Anonymous 2009-11-26 9:05

>>197
stop using symbol-macrolet like a C preprocessor.

Name: 197 2009-11-26 9:26

>>198
AFAIK, the way I'm using it is perfectly valid, and is one of the intended usages of the SYMBOL-MACROLET special operator. In that example, h represents the place of the arguments list in the hashtable, when used directly, you use the accessor to obtain the value, when used during SETF, you write to that place, so the symbol h represents a place within the hashtable. CL has things like WITH-SLOTS, which does the exact same thing - abstracts a place which points to a location within some object, and treats it like a symbol, which is perfectly fine usage. What is your argument against this?

Name: Anonymous 2009-11-26 13:57

buttsorted binary dicks tree

Name: Anonymous 2009-11-27 3:45

>>197
It's because I'm an EXPERT ARTIST, not an EXPERT PROGRAMMER

But, thanks for tips.

Name: Anonymous 2009-11-27 22:25

[b]te st ing[/b]

Name: Anonymous 2009-11-27 22:26

TURNKEY

Name: Anonymous 2009-11-28 7:17

bbcode test
for(;;) {
    int x;
}

Name: Anonymous 2010-01-21 8:43

BAMPU PANTSU

Name: sage 2010-01-23 13:48

no bampu 4 u

Name: Anonymous 2010-01-23 13:49

>>206
u sure?

Name: Anonymous 2010-03-11 19:31

VALID BF CODE

++++++++++[->++++++++++<]>[->+>+>+>+>+>+>+<<<<<<<]<+++++++++
+[->+++++<]>[->>>>>>-<<<<<<]>--------->-->+++++>+++++++++++>
+++++++++++++++++>--->------->>++++[-<++++++++>]<<<<<<<<.>>.
>>>>.<<<<<<.>.>>>>>.[<]<,[--------------------------------[>
]>[.>>>>.>>.<<<<<<<<++++++++++++++++++++++++++++++++.>>.>>>>
>.<.[->>>>>+<<<<<]<[->>>>>+<<<<<]>>>>>[-<<<<+>>>>]>[-<<<<<<+
>>>>>>]<<[<]<[-]]>>>>>>>>.[<]<,]>>.>>>>>.<<<<.>>>>>.<<<<<<.>
>>>>.<<<.>>>>.

Name: Anonymous 2010-03-11 19:54

>>208
Valid BF code

Name: Anonymous 2010-03-11 22:34

>>208
You know I very nearly implemented a butt sort in befunge. Keeping track of state in befunge kinda blows, unless you're doing something like this:

v>>31g> ::51gg:2v++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9p BXY|-+<v3*89<%+ *                                                      *   +
21 >98 *7^>+\-0|<+ *                                                     *    +
*5 ^:+ 1pg15\,:< + *                                                     ***  +
10^  <>$25*,51g1v+                                                            +
-^ p<| -*46p15:+<+                                                            +
31^> 151p>92*4v+                                                            +
 ^_ ".",   ^ vp1<+                                                            +
>v >41p      >0 v+                                                            +
:5! vg-1g15-1g14<+                                                            +
+1-+>+41g1-51gg+v+                                                            +
1p-1vg+1g15-1g14<+                                                            +
g61g>+41g51g1-g+v+                                                            +
14*1v4+g+1g15g14<+                           * *                              +
5>^4>1g1+51g1-g+v+                           * *                              +
^ _^v4+gg15+1g14<+                           ***                              +
>v! >1g1+51g1+g+v+                                                            +
g8-v14/*25-*4*88<+                                                            +
19+>g51gg" "- v  +                                                            +
4*5  v<   v-2:_3v+                                                            +
 >^   |!-3_$  v<-+                                                            +
^    < <      <|<+                                                         ***+
>g51gp ^ >51gp^>v+                                                            +
^14"+"<  ^g14"!"<++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

... which is kind of awesome.

Name: Anonymous 2010-03-12 0:13

>>210
I've occasionally thought about implementing a macro language for befunge, perhaps similar to brainfuck's Pebble. It could be useful since befunge offers very little in the way of abstraction.

I haven't really thought about this in any great detail, however, so I'm not sure how it would work. I'm not even sure what the exact goals would be. I'd be interested to see what thoughts other people have on this matter.

The main downside to this is, that I can foresee, is that it then becomes harder to write self-modifying code: you don't know where things are going to be or their precise layout.

Name: Anonymous 2010-03-12 9:03

>>211
I seem to recall some sort of support for modules or something similar in Funge-98. I could be mistaken, or it might have been considered and left unpsec'd or something. (I didn't see it in the spec just now, but I didn't look very hard either.)

Name: Anonymous 2010-03-12 13:17

>>212
There's the "fingerprint" extension mechanism, and some interpreters support mechanisms of writing fingerprints in befunge itself, but I'm not sure it really achieves what I want.

Name: Anonymous 2010-03-12 13:46

Oh is that what that was about? I did pay attention enough to notice the fingerprint registry is down.

Name: Anonymous 2010-04-04 0:41

What!?!

Name: Anonymous 2010-04-04 0:41

WHAT!?!

Name: Anonymous 2010-04-04 0:45

>>215,216
[O],[/U]!

Name: Anonymous 2010-04-04 1:05

[/O]

Name: Anonymous 2010-04-04 3:34

FBYBTSRE

Name: av !AEboxxyE2Q 2010-04-04 4:24

dv

Name: Anonymous 2010-04-04 17:43

Fibonacci Butt Sort

Name: Anonymous 2010-04-04 17:45

Woohoo I did it!

Name: Anonymous 2010-04-04 18:20

I_I_I_I_I_I_I Testing Buttosrt I_I_I_I_I_I_I

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