About

Tribit is a unit of information,  which is equal to 3 bits. This fantasy console was called after this unit as it's based on tribits. Fantasy console comes with a programming language and a web IDE, to make the programming process more fun.

Also it's pretty documented. You can find the documentation, after pressing "Help" button in the IDE. In the documentation you can find ThreeB (the programming language) documentation and few sample programs.

When you create a game for this console, you have to somehow design it to fit in a 8x8 screen and low memory, and that's why I created this console. It's very challenging to create something within hard restrictions.

Capabilities

  • ROM: 4 096T (=1 536 B)
  • RAM: 32T (=12B)
  • Screen: 8x8, 1-bit, with different pixel types and optional ghosting effect
  • Registers: 8, each 3 bits
  • Input: 4 keys

Features

  • The console itself
  • Simple but pretty convenient IDE
  • Assembly Language with
  • ThreeB, the B-like (C-like) high-level programming language 

Comments

Log in with itch.io to leave a comment.

(2 edits)

How does declaring variables inside functions work? Does this have scope? 

I read the docs but I am a bit confused about storage classes? 

Take the following example:

```

let global;

let #weakGlobal := 0;

inc() {

  let i;

  i++

}

main() {

  let a, b;

 global++;

  inc();

  int();

}

```

1. What value is `global` initialized with? 

2. Does `weakGlobal` ever go out of scope, since it is declared at the file level?

3. Does `i`'s value persist across function calls? What if it was weak? What if I did `let i = 1;` in there instead, would it keep resetting on calls of `inc`?
 4. Does `main` see the vars declared inside of `inc`? Or are they scoped to `onc`? Does `inc` see the vars inside `main`?

5. The documentation mention vectors but forgets to explain their syntax. Can you elaborate on that? 


Thank you!

I'd love to test all these questions out myself but the results seem "inconsistent" to me. You mention 3B being buggy in the docs. I'm not sure if it actually is being inconsistent/buggy or if I'm just not getting it. Hence, why I'm asking. 

PS: Your Discord link is broken. 


Great work! I'm really enjoying playing around with this. It's awesome stuff! 

Hello! I’m glad you enjoyed my FC!

To be honest, I barely remember all the things, so will try to answer as I remember.

  1. Zero. At least this is the most logical answer I can give, because all values are 3-bit unsigned integers
  2. As I rememver, weak variables were made for local use in function. It means that you have two types of variables: strong and weak. Strong have always defined in 32 cell memory, so one cell is always “booked” for it. Weak variables are defined from the other side of memory, and can be redefined in function calls inside function. Example: fn1() { let #weak1 = 0; } // weak1 address is 31 fn2() { let #weak2 := 4; fn1() } // weak2 address is 31, so in the end it can become 0, not 4 This is how I remember it should work
  3. As I remember it shouldn’t persist. Actually, if you open developer’s console on this site, every time you run program, you’ll see all assembly code generated, and how compiler parsed it all. I think it could help you.
  4. No, they both don’t see variables of each other
  5. “Vector” is an alias for array, so you define them: let vec[5], then use: vec[0] - first element, can be assigned

And yes, discord server is dead :(