You are not logged in or registered. Please login or register to use the full functionality of this board...
SIGN IN Join Our Community For FREE


programming language comparisons
05-22-2017, 08:14 PM (This post was last modified: 05-23-2017 01:21 PM by figosdev.)
Post: #1
 (Print Post)
programming language comparisons
# for comments
* works in bash, python, fig
* and sb if starting a line


// for comments
* works in javascript


' for comments
* works in qb, fb, qb64, sb


abs(x)
* works in qb, fb, qb64, sb, python, truebasic


end
* works in qb, fb, qb64, sb, truebasic
* quit() in python


int(x)
* works in qb, fb, qb64, sb, python, truebasic


print "hello"
* works in qb, fb, qb64, sb, python, truebasic


return var (to exit a user defined function):
* works in freebasic, python, js


substring brackets: x[s:f]
* may require $ for x$
* works in truebasic, python





#### license: creative commons cc0 1.0 (public domain)
#### http://creativecommons.org/publicdomain/zero/1.0/


Code Snippet: [Select]
#!/usr/bin/env python
# coding: utf-8
#### license: creative commons cc0 1.0 (public domain)
#### http://creativecommons.org/publicdomain/zero/1.0/
proginf = "cmddb 0.2, may 2017 mn"

db = """


[[output text with newline]]

[fig]mainvar print
    category: output (shares line)
        use: output main variable to the screen (aka stdout.) command name dates back to teletypes
[/]

[basic(1964)]10 print p$
    category: output
        use: output p$ to the screen
[/]

[qbasic]print p$
    category: output
        use: output p$ to the screen
[/]

[python]print p
    category: output
        use: output p to the screen
[/]

[bash]echo "$p"
    category: output
        use: output $p to the screen
[/]

[awk]print p
    category: output
        use: output p to the screen
[/]

[js]document.write(p + "<br>");
    category: output
        use: write contents of p to the document
[/]

[[/]]





[[output text without newline]]

[fig]mv prints
    category: output (shares line)
        use: output main variable to the screen
[/]

[basic(1964)]10 print p$;
    category: output
        use: output p$ to the screen
[/]

[qbasic]print p$;
    category: output
        use: output p$ to the screen
[/]

[python]print p,
    category: output
        use: output p to the screen
[/]

[bash]echo -n "$p"
    category: output
        use: output $p to the screen
[/]

[awk]
[/]

[js]document.write(p);
    category: output
        use: write contents of p to the document
[/]

[[/]]








[[add or concatenate a value]]

[fig]plus numstrarr
    category: math (shares line)
        use: change main variable to itself plus a num or string or array
[/]

[basic(1964)]+ num
    category: math (shares line)
        use: change an expression to itself plus a num

[/]

[qbasic]+ numstr
    category: math (shares line)
        use: change an expression to itself plus a num or string

[/]

[python]+ numstrarr
    category: math (shares line)
        use: change an expression to itself plus a num or string or array
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]





[[subtract a value]]

[fig]minus num
    category: math (shares line)
        use: change main variable to itself minus a num
[/]

[basic(1964)]- num
    category: math (shares line)
        use: change an expression to itself minus a num

[/]

[qbasic]- num
    category: math (shares line)
        use: change an expression to itself minus a num
[/]

[python]- num
    category: math (shares line)
        use: change an expression to itself minus a num
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]





[[multiply times a value]]

[fig]times num
    category: math (shares line)
        use: change main variable (including strings and arrays) to itself times a num
[/]

[basic(1964)]* num
    category: math (shares line)
        use: change an expression to itself times a num

[/]

[qbasic]* num
    category: math (shares line)
        use: change an expression to itself times a num

[/]

[python]* num
    category: math (shares line)
        use: change an expression (including strings and arrays) to itself times a num
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]






[[divide by a value]]

[fig]divby num
    category: math (shares line)
        use: change main variable to itself divided by a num
[/]

[basic(1964)]/ num
    category: math
        use: change an expression to itself divided by a num

[/]

[qbasic]/ num
    category: math
        use: change an expression to itself divided by a num

[/]

[python]/ float(num)
    category: math
        use: change an expression to itself divided by a num
            note: python 2 does int division unless float() is used
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]




[[comment a line]]

[fig]#
    category: comment (can share)
        use: place at beginning (or end) of line, prior to a comment
[/]

[basic(1964)]10 rem
    category: comment
        use: place at beginning of line, prior to a comment
[/]

[qbasic]rem or '
    category: comment
        use: place at beginning (or ' at end) of line, prior to comment
[/]

[python]#
    category: comment
        use: place at beginning (or end) of line, prior to a comment
[/]

[bash]#
    category: comment
        use: place at beginning (or end) of line, prior to a comment
[/]

[awk]#
    category: comment
        use: place at beginning (or end) of line, prior to a comment
            note: avoiding ' in awk comments is recommended
[/]

[js]//
    category: comment
        use: place at beginning (or end) of line, prior to a comment
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]







[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]

"""

def left(p, x): return p[:x]

def right(p, x): return p[-x:]

def dbparse(p, l, cb):
    pre = "\x1b[0;"+str(30+l)+"m "
    pos = "\x1b[0;37m"
    if l == 2: pre = "\n " + "\x1b[0;"+str(30+l)+"m" ; pos = "\x1b[0;37m" + "\n\n"
    tabs = " " * 2 # chr(9)
    if l == 1: pre = "\x1b[47;"+str(30+l)+"m"+ tabs ; pos = "\x1b[40;37m"
    pflg = 0
    cflg = 0
    buf = ""
    if l == 0: print ; print cb.rstrip() + "\x1b[44;37m" ; print " " * 4 + p + "\x1b[40;37m"
    for t in p:  
        buf += t
        
        if pflg == 0:
            if right(buf, l) == "[" * l:
                buf = ""
                pflg = 1
        else:
            if right(buf, l * 2 + 1) == "[" * l + "/" + "]" * l:
                contents = left(buf, len(buf) - l * 2 - 1) ; buf = "" ; pflg = 0
                if len(contents.strip()) and l > 0: dbparse(contents, l - 1, cb + cbuf) ; cb = ""
            elif right(buf, l) == "]" * l:
                if l == 1: cbuf = left(pre + left(buf, len(buf) -l) + " " * (80+len(pre)-2), (80+len(pre)-2)) + pos ; buf = ""
                else: cbuf = pre + left(buf, len(buf) -l) + pos ; buf = ""
          


dblevel = 0
while 1:
    if "[" * (dblevel + 1) in db: dblevel += 1
    else: break

dbparse(db, dblevel, "")

print
#!/usr/bin/env python
# coding: utf-8
#### license: creative commons cc0 1.0 (public domain)
#### http://creativecommons.org/publicdomain/zero/1.0/
proginf = "cmddb 0.2, may 2017 mn"

db = """


[[output text with newline]]

[fig]mainvar print
    category: output (shares line)
        use: output main variable to the screen (aka stdout.) command name dates back to teletypes
[/]

[basic(1964)]10 print p$
    category: output
        use: output p$ to the screen
[/]

[qbasic]print p$
    category: output
        use: output p$ to the screen
[/]

[python]print p
    category: output
        use: output p to the screen
[/]

[bash]echo "$p"
    category: output
        use: output $p to the screen
[/]

[awk]print p
    category: output
        use: output p to the screen
[/]

[js]document.write(p + "<br>");
    category: output
        use: write contents of p to the document
[/]

[[/]]





[[output text without newline]]

[fig]mv prints
    category: output (shares line)
        use: output main variable to the screen
[/]

[basic(1964)]10 print p$;
    category: output
        use: output p$ to the screen
[/]

[qbasic]print p$;
    category: output
        use: output p$ to the screen
[/]

[python]print p,
    category: output
        use: output p to the screen
[/]

[bash]echo -n "$p"
    category: output
        use: output $p to the screen
[/]

[awk]
[/]

[js]document.write(p);
    category: output
        use: write contents of p to the document
[/]

[[/]]








[[add or concatenate a value]]

[fig]plus numstrarr
    category: math (shares line)
        use: change main variable to itself plus a num or string or array
[/]

[basic(1964)]+ num
    category: math (shares line)
        use: change an expression to itself plus a num

[/]

[qbasic]+ numstr
    category: math (shares line)
        use: change an expression to itself plus a num or string

[/]

[python]+ numstrarr
    category: math (shares line)
        use: change an expression to itself plus a num or string or array
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]





[[subtract a value]]

[fig]minus num
    category: math (shares line)
        use: change main variable to itself minus a num
[/]

[basic(1964)]- num
    category: math (shares line)
        use: change an expression to itself minus a num

[/]

[qbasic]- num
    category: math (shares line)
        use: change an expression to itself minus a num
[/]

[python]- num
    category: math (shares line)
        use: change an expression to itself minus a num
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]





[[multiply times a value]]

[fig]times num
    category: math (shares line)
        use: change main variable (including strings and arrays) to itself times a num
[/]

[basic(1964)]* num
    category: math (shares line)
        use: change an expression to itself times a num

[/]

[qbasic]* num
    category: math (shares line)
        use: change an expression to itself times a num

[/]

[python]* num
    category: math (shares line)
        use: change an expression (including strings and arrays) to itself times a num
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]






[[divide by a value]]

[fig]divby num
    category: math (shares line)
        use: change main variable to itself divided by a num
[/]

[basic(1964)]/ num
    category: math
        use: change an expression to itself divided by a num

[/]

[qbasic]/ num
    category: math
        use: change an expression to itself divided by a num

[/]

[python]/ float(num)
    category: math
        use: change an expression to itself divided by a num
            note: python 2 does int division unless float() is used
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]




[[comment a line]]

[fig]#
    category: comment (can share)
        use: place at beginning (or end) of line, prior to a comment
[/]

[basic(1964)]10 rem
    category: comment
        use: place at beginning of line, prior to a comment
[/]

[qbasic]rem or '
    category: comment
        use: place at beginning (or ' at end) of line, prior to comment
[/]

[python]#
    category: comment
        use: place at beginning (or end) of line, prior to a comment
[/]

[bash]#
    category: comment
        use: place at beginning (or end) of line, prior to a comment
[/]

[awk]#
    category: comment
        use: place at beginning (or end) of line, prior to a comment
            note: avoiding ' in awk comments is recommended
[/]

[js]//
    category: comment
        use: place at beginning (or end) of line, prior to a comment
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]







[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]








[[output text without newline]]

[fig]
[/]

[basic(1964)]
[/]

[qbasic]
[/]

[python]
[/]

[bash]
[/]

[awk]
[/]

[js]
[/]

[[/]]

"""

def left(p, x): return p[:x]

def right(p, x): return p[-x:]

def dbparse(p, l, cb):
    pre = "\x1b[0;"+str(30+l)+"m "
    pos = "\x1b[0;37m"
    if l == 2: pre = "\n " + "\x1b[0;"+str(30+l)+"m" ; pos = "\x1b[0;37m" + "\n\n"
    tabs = " " * 2 # chr(9)
    if l == 1: pre = "\x1b[47;"+str(30+l)+"m"+ tabs ; pos = "\x1b[40;37m"
    pflg = 0
    cflg = 0
    buf = ""
    if l == 0: print ; print cb.rstrip() + "\x1b[44;37m" ; print " " * 4 + p + "\x1b[40;37m"
    for t in p:  
        buf += t
        
        if pflg == 0:
            if right(buf, l) == "[" * l:
                buf = ""
                pflg = 1
        else:
            if right(buf, l * 2 + 1) == "[" * l + "/" + "]" * l:
                contents = left(buf, len(buf) - l * 2 - 1) ; buf = "" ; pflg = 0
                if len(contents.strip()) and l > 0: dbparse(contents, l - 1, cb + cbuf) ; cb = ""
            elif right(buf, l) == "]" * l:
                if l == 1: cbuf = left(pre + left(buf, len(buf) -l) + " " * (80+len(pre)-2), (80+len(pre)-2)) + pos ; buf = ""
                else: cbuf = pre + left(buf, len(buf) -l) + pos ; buf = ""
          


dblevel = 0
while 1:
    if "[" * (dblevel + 1) in db: dblevel += 1
    else: break

dbparse(db, dblevel, "")

print
Find all posts by this user
Like Post



Forum Jump:


User(s) browsing this thread: 1 Guest(s)




QB64 Member Project - Foursight
QB64 Member Project - Rubix's Magic
QB64 Member Project - Quarto
QB64 Member Project - STxAxTIC 3D World
QB64 Member Project - Color Rotating Text
QB64 Member Project - Kings Vallery version two
QB64 Member Project - Kings Court
QB64 Member Project - Basic Dithering
QB64 Member Project - Blokus
QB64 Member Project - Score 4
QB64 Member Project - Point Blank
QB64 Member Project - Pivet version one
QB64 Member Project - Red Scrolling LED Sign
QB64 Member Project - Splatter
QB64 Member Project - Martin Fractals version four
QB64 Member Project - Domain
QB64 Member Project - Overboard
QB64 Member Project - Algeria Weather
QB64 Member Project - Line Thickness
QB64 Member Project - OpenGL Triangles
QB64 Member Project - MAPTRIANGLE
QB64 Member Project - Isolation
QB64 Member Project - Exit
QB64 Member Project - Amazon
QB64 Member Project - Qubic
QB64 Member Project - Swirl
QB64 Member Project - Pivot version two
QB64 Member Project - 9 Board
QB64 Member Project - Color Triangles
QB64 Member Project - Rotating Background
QB64 Member Project - Sabotage
QB64 Member Project - Inside Moves
QB64 Member Project - Dakapo
QB64 Member Project - Connect Four
QB64 Member Project - Bowditch curve
QB64 Member Project - Dreamy Clock
QB64 Member Project - Martin Fractals version one
QB64 Member Project - Spinning Color Wheel
QB64 Member Project - Touche
QB64 Member Project - Othello
QB64 Member Project - Kings Valley verion one
QB64 Member Project - Martin Fractals version three
QB64 Member Project - Full Color LED Sign
QB64 Member Project - Input
QB64 Member Project - RGB Color Wheel
QB64 Member Project - Kobolts Monopoly
QB64 Member Project - Martin Fractals version two
QB64 Member Project - ARB Checkers
QB64 Member Project - Spiro Roses