robsite

DM's Esoteric Programming Languages - HQ9++

HQ9++ has four syntax elements:

  • H Prints "Hello, world!".
  • Q Prints the entire text of the source code file.
  • 9 Prints the complete canonical lyrics to "99 Bottles of Beer on the Wall".
  • + Increments the accumulator.
  • ++ When the sequence ++ is encountered, it (naturally) increments the accumulator twice, and also instantiates an object of a new subclass of the generic superclass. In line with the best data-hiding principles, there is no way to access this object.
· :D, esoteric programming ·

Java2K

Nichtdeterministisches Java.

Java2K is not a deterministic programming language, but a probabilistic one. Even for built-in functions, there is only a certain probability the function will do whatever you intend it to do. All Functions have two different implementations. At runtime, based on a pseudo-RNG, the actual implementation is choosen. This is in line with common physicalist assumptions about the nature of the universe - there is never absolute security, there is always only probability.

· esoteric programming, java ·

Lexikon-Plugins

Kostenlose Plugins fürs Mac OS X Dictionary.
Mauszeiger über ein Wort, Cmd + Ctrl + D -> kleines Dictionary-Fenster öffnet sich. Aber nur in Cocoa-Programmen, also z.B. nicht im Firefox.

· dictionary, mac, tool ·

The Brainfuck Programming Language

>+++++++++[>+++++++++<-]>+.+++++++++++++++++++++++++++++.-------------.+++++++++++++++++.----------.+++++++++++
.---------------.>++++[>+++++++++++<-]>.------------.>++++++++++[>++++++++++<-]>++.+++++++++++++++.------------
------.++++++++.>++++[>++++++++<-]>.>+++++++++++[>+++++++++++<-]>.--------------------.----.+++++++.>++++[>++++
++++<-]>+.-.++++++++++.>++++++++[>++++++++++++<-]>+.++++++++.+++++++++.>++++[>++++++++<-]>.>++++++++++[>+++++++
+++<-]>+++.++++++++++++++.------------.+++++++++++.-------------------.+++++++++++++++++.>++++++[>+++++++<-]>.```
        
· :D, brainfuck, esoteric programming ·

Ein kleiner Brainfuck Interpreter

Mit Brainfuck-Code für Fibonacci-Zahlen. Oh Jubel.

    # brainfuck Interpreter

class Array
    def rtrim empty = 0
        (self.length-1).downto(0) do |a|
            return self[0..a] if self[a] != empty
        end     
        []   
    end
end

class Brainfuck

    attr_accessor :code, :ascii, :debug

    def initialize(code = "", memsize = 30000)
        @code   = code.gsub(/[^.,+-<>[]]/, "")
        @mem    = Array.new(memsize, 0)
        @ascii = true   # In/Output als ASCII oder mit puren Zellwerten arbeiten?
        @debug = false
    end

    def run
        p = 0
        cp = 0
        brackets = []
        while cp < @code.length
            c = @code[cp].chr

            case c 
            when "+"
                @mem[p] += 1
            when "-"
                @mem[p] -= 1
            when ">"
                p += 1
            when "<"
                p -= 1
            when "["
                brackets.push(cp)
            when "]"
                if @mem[p] != 0
                    cp = brackets.pop - 1
                else
                    brackets.pop
                end
            when "."
                if @debug
                    print "p: #{p} cp: #{cp} "
                    p @mem.rtrim
                end
                if @ascii
                    print @mem[p].chr
                else
                   puts @mem[p] 
                end
            when ","
                input = gets
                if @ascii
                    @mem[p] = input[0]
                else
                    @mem[p] = input.to_i
                end
            end    

            cp += 1       
        
        end        
    end
end

# Die ersten 10 Fibonacci-Zahlen: +>++>>>++++++++++[<<<<.>[->+>+<<]>>[-<<+>>]<<<[->+>>+<<<]>>>[-<<<+>>>]<<<[-]>>[<<+>>-]>>-]
# Die ersten n Fibonacci-Zahlen: +>++>>>,[<<<<.>[->+>+<<]>>[-<<+>>]<<<[->+>>+<<<]>>>[-<<<+>>>]<<<[-]>>[<<+>>-]>>-]

code = <<END
+>++>>>,[<<<<.>[->+>+<<]>>[-<<+>>]<<<[->+>>+<<<]>>>[-<<<+>>>]<<<[-]>>[<<+>>-]>>-]
END

bf = Brainfuck.new(code)
bf.ascii = false
bf.debug = false
bf.run
· meins, brainfuck, esoteric programming, ruby ·

We are noodle folk. Broth runs through our veins.

· :D, quote ·
Mastodon