+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: BulkOS > Oh gosh.

  1. #11
    goluch
    Guest goluch's Avatar

    Default Re: BulkOS > Oh gosh.

    now that sounds cool.

  2. #12
    Wire Noob Straterra's Avatar
    Join Date
    Jan 2010
    Posts
    8

    Default Re: BulkOS > Oh gosh.

    I think I understand now. There is one thing kind of missing (either from me not seeing it or it not actually being there.) How would I take user input in a home made program? Is there some kind of keyboard buffer or such a program can use? Should I wire a keyboard to one of the inputs instead? Also, if I were to run the command 'run program.txt', where is the OS looking for program.txt? Thanks for the previous reply!

  3. #13
    Mario, hard at work Filipe's Avatar
    Join Date
    Jun 2007
    Location
    Portugal - Lisbon
    Posts
    401
    Blog Entries
    1

    Default Re: BulkOS > Oh gosh.

    Quote Originally Posted by Straterra View Post
    I think I understand now. There is one thing kind of missing (either from me not seeing it or it not actually being there.) How would I take user input in a home made program? Is there some kind of keyboard buffer or such a program can use? Should I wire a keyboard to one of the inputs instead? Also, if I were to run the command 'run program.txt', where is the OS looking for program.txt? Thanks for the previous reply!
    It's not actually there, while I'd love to have included it from the start, I'm only going to be able to add those features in the next version (which I've already got well under way). As for 'program.txt', in BulkOS 2 it's being loaded from the filesystem/table, or from a file, if you use the runfile command. If you want to load a program from memory, you'll first need to store it in the filesystem using the putstrdb <stringname> <cell index> function, this was changed in BulkOS 3 that allows you to send any string to the action stack (i.e. run #1 or run #program or run programname).

    Other features already in v3:
    1. Defining a memory cell is now done with the # prefix, if the prefix is not present, the value is used instead (ie. add #1 #10 adds the contents of cell 10 to cell 1, while add #1 10 adds the number 10 to the contents of cell 1).
    2. Keyboard, display and sound modules seperated from the main chip.
    3. Ability to draw your own gui with display module commands (both manually, or with shortcuts such as 'draw line'.
    4. More control over how the user interacts with your programs, and how the system behaves.
    5. Universal parser, allows doing things such as 'prt Hi, my name is #name' or 'prt Cell 1 contains: #1'.
    6. Easier to use file functions, requesting a file automatically drops it's contents to a table slot.
    7. Array commands allow you to build and encode arrays from memory cells, store it in a file and load them again when needed into the positions you desire.
    8. Sound module, nothing fancy, allows you to call sound files to be played, and to control their properties.
    9. New functions, others were simplified.
    10. Improved 'startup' code.
    11. New function editor written in bulkcode.
    12. Faster, more responsive, still pretty damned bulky (600+ ops/s when running at max speed).
    13. A few string functions.
    14. Some other things I don't quite remember.
    I'll keep you guys posted ^_^
    beep boop

  4. #14
    Wirererer Dskodk's Avatar
    Join Date
    Sep 2009
    Location
    In a toilet somewhere
    Posts
    161

    Default Re: BulkOS > Oh gosh.

    how did you load the file, then put it into an array?
    im working on an mp3 player, and i want to know how to use file functions.
    i want to have a file called 'songs.txt' and be able to load it into an array.
    so far, i've tried:
    Code:
    fileLoad("songs.txt")
    for(I=1,fileRead("songs.txt"):explode("|"):count()/3){
    fileLocations:insertString(I,fileRead("songs.txt"):explode("|"):string((I-3)*3))
    the format goes like this:
    File_location|OnscreenName|Artist|
    File_location|OnscreenName|Artist|
    and so on.
    u got any ideas?
    Blink.
    Breathe.
    Think.
    Discuss.
    You are unique.

  5. #15
    Mario, hard at work Filipe's Avatar
    Join Date
    Jun 2007
    Location
    Portugal - Lisbon
    Posts
    401
    Blog Entries
    1

    Default Re: BulkOS > Oh gosh.

    -snip, accidental double post-
    Last edited by Filipe; 01-27-2010 at 05:31 AM.
    beep boop

  6. #16
    Mario, hard at work Filipe's Avatar
    Join Date
    Jun 2007
    Location
    Portugal - Lisbon
    Posts
    401
    Blog Entries
    1

    Default Re: BulkOS > Oh gosh.

    Quote Originally Posted by Dskodk View Post
    how did you load the file, then put it into an array?
    im working on an mp3 player, and i want to know how to use file functions.
    i want to have a file called 'songs.txt' and be able to load it into an array.
    so far, i've tried:
    Code:
    fileLoad("songs.txt")
    for(I=1,fileRead("songs.txt"):explode("|"):count()/3){
    fileLocations:insertString(I,fileRead("songs.txt"):explode("|"):string((I-3)*3))
    the format goes like this:
    File_location|OnscreenName|Artist|
    File_location|OnscreenName|Artist|
    and so on.
    u got any ideas?
    E2 has a couple of neat little functions that use GLON. What you'll want to do is lay down an E2 file that contains an array with all the musics and their data:

    Code:
    Music = array()
    # Music 1:
    Music[1,string] = "music/path.mp3"
    Music[2,string] = "Artist"
    Music[3,string]= "OnScreenName"
    
    # Music 2
    Music[4,string] = "music/path2.mp3"
    Music[5,string] = "Artist"
    Music[6,string]= "OnScreenName"
    Once you have that, you'll need to save it into a file, so you'd do something like this BELOW the music data:

    Code:
    String = glonEncode(Music)
    fileWrite("filename.txt",String)
    What GLON does is encode an array into a string using some character kung-fu. It's much cleaner and powerful than doing the separation yourself, for example, you can store arrays inside OTHER arrays, you could store a whole table inside an array slot, actually.

    Now, you have the file contain a string. In your music player, just load it like you normally would, and then do the following:

    Code:
    FileRead = fileRead("filename.txt")
    Music = glonDecode(FileRead)
    'Music' is now an array, containing the data you initially stored. You can also use TABLES, the only difference being when the time comes to decode it, you have to use the glonDecodeTable() function instead.

    When reading songs from the array, just remember to jump 3 values each time, and read the two values after that to get your song data

    One thing about using glon is that editing your file manually becomes riskier, as doing the wrong move might break it and prevent you from loading its data properly (or at all).



    BulkOS 3 -

    If anyone even cares, I've made alot of huge changes to BulkOS, mainly improvements and additions on the bulkcode language. I'm not going into details now, but here's a simple game I scripted with it:



    Remember, this is all done in my own language running in the E2 chip, and processed on run-time.
    Attached Thumbnails Attached Thumbnails BulkOS > Oh gosh.-mathgame.png  
    Last edited by Filipe; 01-27-2010 at 05:31 AM.
    beep boop

  7. #17
    Wirererer jesse1412's Avatar
    Join Date
    Sep 2009
    Location
    in your basement
    Posts
    315

    Default Re: BulkOS > Oh gosh.

    this is actually an amazing os you made a language inside a custom language

+ Reply to Thread
Page 2 of 2 FirstFirst 12

Similar Threads

  1. BulkOS 3 - now with 10% more bulk!
    By Filipe in forum Finished contraptions
    Replies: 8
    Last Post: 01-31-2010, 03:23 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots