Beginnings of an a.i. program...

Discussion in 'Intelligence & Machines' started by Spectrum, Jan 2, 2008.

Thread Status:
Not open for further replies.
  1. Spectrum Registered Senior Member

    Messages:
    459
    True artificial intelligence must program itself: the program must choose lines of code to be executed. I have created a program that almost does this, but I am having a few problems. If a running program reads through itself and then writes to itself then we have the beginnings of an a.i. program. Example:
    I have had some interesting results from using this method: everything from a program that operates as it should to a file that has read data from all over the computer. The most intersting was in QBASIC (found on Windows cd-rom under tools\oldmsdos):

    As you will find the program does not update itself: the program must be ended first. Then opening the program with wordpad (notepad is too small) produces some interesting results. I have posted the update problem on this forum so any help would be appreciated.
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Cyperium I'm always me Valued Senior Member

    Messages:
    3,058
    The problem is what position should the program choose?

    If you just get one and put in the same one, then it wouldn't matter anyway.

    open thefile$ for random as #1 len=1
    for address=1 to lof(1) ;address within file is 1 to length-of-file (LOF)
    get #1, address ;read a letter from the open file
    put #1, address ;write the letter to the file
    next address ;next location within file
    close #1

    Let's see if I got this straight, it was a long time since I played with random access files...

    When it gets something the address pointer is automatically moved one byte right?

    Ok, the file must not be empty or it will be a error.

    Then it will read the first value in the file, and put it at the next position right? Since the address pointer is moving one step each time.

    So I guess that if the first byte is "123" then all the other bytes in the file will become "123".

    I'm unsure how to change the address pointer, but it is explained in the help file, it was a while since I used these methods.
     
  4. Google AdSense Guest Advertisement



    to hide all adverts.
  5. Spectrum Registered Senior Member

    Messages:
    459
    So how come when I type...
    ...Data is read from all over the computer? The rem marks (') are so 'close #1' isn't overwritten (otherwise when I come to open the file an error message copmes up saying the file is already open).

    Seek #1, seek(1)-1
     
  6. Google AdSense Guest Advertisement



    to hide all adverts.
Thread Status:
Not open for further replies.

Share This Page