hey

  • 12 Replies
  • 513 Views
*

Zero

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1016
  • Ready?
    • dissolvedgirl
hey
« on: December 11, 2019, 05:19:47 pm »
hi guys
I'm back

*

Freddy

  • Administrator
  • **********************
  • Colossus
  • *
  • 6829
  • Mostly Harmless
Re: hey
« Reply #1 on: December 11, 2019, 05:22:17 pm »
Welcome back Zero  :)

*

Zero

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1016
  • Ready?
    • dissolvedgirl
Re: hey
« Reply #2 on: December 11, 2019, 05:50:25 pm »
How are you Freddy? :)

*

ivan.moony

  • Trusty Member
  • ***********
  • Eve
  • *
  • 1458
    • contrast-zone
Re: hey
« Reply #3 on: December 11, 2019, 06:09:42 pm »
Hi  :)

Long time no see...

Are there any cool projects?
There exist some rules interwoven within this world. As much as it is a blessing, so much it is a curse.

*

Freddy

  • Administrator
  • **********************
  • Colossus
  • *
  • 6829
  • Mostly Harmless
Re: hey
« Reply #4 on: December 11, 2019, 06:20:09 pm »
How are you Freddy? :)

I'm good thanks, not doing much programming at the moment, but have a new game to work on when I get some free time. It's in the coming up with ideas stage.

Got anything you are working on now?

*

Zero

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1016
  • Ready?
    • dissolvedgirl
Re: hey
« Reply #5 on: December 11, 2019, 06:54:17 pm »
Not really... Hi Ivan :)

Right now I'm screwing around, downgrading Javascript so it looks like 80's unstructured BASIC.

Sticking this into an .html file:

Code
<!DOCTYPE html>
<html>
<head>
    <title>BASIC</title>
    <meta charset="utf-8">
    <style>
        html, body, body * {
            background: #005;
            color: #db9;
            font-family: Consolas, 'Lucida console', monospace, monospace;
            margin: 0;
            padding: 0;
            font-size: 16px;
            overflow-x: hidden;
            scrollbar-color: #444 transparent !important;
        }
        #term-output {
            white-space: pre-wrap;
        }
        #term-input {
            border: none;
            width: 100vw;
        }
    </style>
    <style id="paper-style">
        html, body, body * {}
    </style>
</head>
<body>
    <pre id="term-output"></pre><input type="text" id="term-input">

    <script>

    String.prototype.regexIndexOf = function(regex, startpos) {
        var indexOf = this.substring(startpos || 0).search(regex);
        return (indexOf >= 0) ? (indexOf + (startpos || 0)) : indexOf;
    }       

    var BASIC = {};
    var that;

    BASIC.color = "#db9";

    BASIC.program = {},
    BASIC.progPointer = "stop",
    BASIC.nextProgPointer = "stop";

    BASIC.subStack = [];

    const rem = function() {}

    const print = function(rawtxt) {

        var txt = (typeof rawtxt == "string" || typeof rawtxt == "number") ? rawtxt : JSON.stringify(rawtxt);
        BASIC.termOutput.innerHTML += `\n<span style="color:${BASIC.color};">${txt}</span>`;
        window.scrollTo(0,document.body.scrollHeight);
    }

    const pen = function(c) {

        BASIC.color = c;
    }

    const paper = function(b) {

        BASIC.paperStyle.innerHTML = `html, body, body * { background: ${b};}`;
    }

    const edit = function(lineNumber, instruction) {

        if (typeof instruction == "undefined") {

            BASIC.termInput.value = lineNumber+' '+BASIC.program[lineNumber];

        } else {

            BASIC.program[lineNumber] = instruction.trim();
        }
    }

    const run = function(start) {

        BASIC.progPointer = BASIC.orderedLines().filter(l => l >= (start || 0))[0];
       
        while (BASIC.progPointer) {
            BASIC.nextProgPointer = BASIC.orderedLines().filter(l => l > BASIC.progPointer)[0];
            that = BASIC.execute(BASIC.program[BASIC.progPointer]);
            BASIC.progPointer = BASIC.nextProgPointer;
        }

        BASIC.progPointer = "stop";
    }

    const goto = function(n) {

        BASIC.nextProgPointer = BASIC.orderedLines().filter(l => l >= n)[0];
    }

    const gosub = function(n) {

        BASIC.subStack.push(BASIC.progPointer);
        BASIC.nextProgPointer = BASIC.orderedLines().filter(l => l >= n)[0];
    }

    const end = function(n) {

        var previous = BASIC.subStack.pop();
        BASIC.nextProgPointer = BASIC.orderedLines().filter(l => l > previous)[0];
    }

    const list = function(rawStart, rawEnd) {

        var lineList = BASIC.orderedLines();
       
        var start = rawStart || lineList[0];
        var end = rawEnd || lineList[lineList.length-1];

        lineList.filter(l => l >= start && l <= end).forEach(l => { print(l+' '+BASIC.program[l]); });
    }

    const cls = function() {
        BASIC.termOutput.innerHTML = '';
    }

    BASIC.execute = function(rawloc) {

        var result;
        var loc = rawloc+' ';

        try {
            var verb = loc.substr(0, loc.regexIndexOf(/[ =]/));
            var args = eval('['+loc.substr(verb.length)+']');
            result = eval(verb).apply(null, args);
            var success = true;
        } catch(e) {}
        if (!success) {
            try{
                result = eval(loc);
            } catch(e) {
                print((BASIC.progPointer == "stop" ? '' : `line ${BASIC.progPointer}, `) + e.message);
            }
        }
        return result;
    }

    BASIC.evalInput = function(cmd) {

        print(cmd);
        BASIC.termInput.value = '';

        var first = cmd.substr(0, cmd.indexOf(' '));
        var lineNumber = parseInt(first);
        if (first.length > 0 && !isNaN(lineNumber)) {

            edit(lineNumber, cmd.substr(first.length));

        } else {

            that = BASIC.execute(cmd);
            print("Ready");
            BASIC.termInput.focus();
        }
    }

    BASIC.orderedLines = function() {
        return Object.keys(BASIC.program).map(t => parseInt(t)).sort((a,b)=>{a<b});
    }

    BASIC.termInput = document.getElementById("term-input");
    BASIC.termOutput = document.getElementById("term-output");
    BASIC.paperStyle = document.getElementById("paper-style");
   
    BASIC.termInput.addEventListener("keyup", function(event) {

        if (event.key === "Enter") BASIC.evalInput(BASIC.termInput.value);
    });

    window.onclick = function() {
       
        BASIC.termInput.focus();
    }

    print("Ready");
    BASIC.termInput.focus();

    </script>
</body>
</html>

... you'd get an interpreter able to take a program like:


10 x = 1
20 gosub 100
30 x = x+1
40 if (x < 20) goto(20)
50 goto 200
100 print x
110 end
200 print "that's all folks"


...as I said, just screwin around.

*

Zero

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1016
  • Ready?
    • dissolvedgirl
Re: hey
« Reply #6 on: December 11, 2019, 06:56:12 pm »
what the game about?

*

Hopefully Something

  • Trusty Member
  • *********
  • Terminator
  • *
  • 960
  • no seriously where are these cookies
Re: hey
« Reply #7 on: December 11, 2019, 07:05:43 pm »
Hey, Zero. 

*

Zero

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1016
  • Ready?
    • dissolvedgirl
Re: hey
« Reply #8 on: December 11, 2019, 07:12:16 pm »
Hi Hope ;)

Hey guys, where's Ranch?

*

Freddy

  • Administrator
  • **********************
  • Colossus
  • *
  • 6829
  • Mostly Harmless

*

Korrelan

  • Trusty Member
  • ***********
  • Eve
  • *
  • 1418
  • Look into my eyes! WOAH!
    • YouTube
Re: hey
« Reply #10 on: December 11, 2019, 09:12:25 pm »
Yo... Z

 :)
It thunk... therefore it is!...    /    Project Page    /    KorrTecx Website

*

Art

  • At the end of the game, the King and Pawn go into the same box.
  • Moderator
  • **********************
  • Colossus
  • *
  • 5864
Re: hey
« Reply #11 on: December 12, 2019, 03:39:16 am »
Hey Zero! Nice to see you!
In the world of AI, it's the thought that counts!

*

Zero

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1016
  • Ready?
    • dissolvedgirl
Re: hey
« Reply #12 on: December 12, 2019, 09:30:06 am »
Hello friends, it's nice to be back.

 


Project Acuitas
by Don Patrick (General Project Discussion)
September 28, 2020, 08:00:10 pm
A.I script writer
by yotamarker (General AI Discussion)
September 26, 2020, 10:26:35 am
The New Species (Project Progress)
by MikeB (General Project Discussion)
September 25, 2020, 09:51:44 am
Pattern based NLP
by MikeB (General Project Discussion)
September 25, 2020, 09:29:25 am
humor
by yotamarker (General AI Discussion)
September 25, 2020, 07:06:40 am
Autonomous Rover
by infurl (Home Made Robots)
September 25, 2020, 03:52:16 am
What's everyone up to ?
by LOCKSUIT (General Chat)
September 25, 2020, 01:13:09 am
List of MMO Games for 2020
by Dat D (General Chat)
September 24, 2020, 04:29:28 am
Robotic vacuum cleaner news.
by Dat D (Robotics News)
Today at 10:15:58 am
New model beats GPT3
by LOCKSUIT (AI News )
September 25, 2020, 01:19:53 am
GPT-f SOTA AMTP
by infurl (AI News )
September 13, 2020, 12:56:47 am
Battle dogs!
by LOCKSUIT (Robotics News)
September 12, 2020, 04:27:46 pm
Artificial Intelligence Easily Beats Human Fighter Pilot in DARPA Trial
by LOCKSUIT (AI News )
September 12, 2020, 04:25:46 pm
Important memristor breakthrough.
by infurl (AI News )
September 07, 2020, 12:57:06 am
AllenAct for research in embodied AI
by infurl (AI News )
September 01, 2020, 01:27:35 am

Users Online

148 Guests, 0 Users

Most Online Today: 193. Most Online Ever: 528 (August 03, 2020, 06:16:11 am)

Articles