[WIP] #/Letter Pairs, a brain game


(Pharap) #4

You mean my resource collection?
If so, glad to hear they’re being useful.

I have a sort of demo/example that might help with that,
but it uses a few intermediate techniques that you might not have come across.
The example is here.
It’s actually supposed to be for a menu for giving players items, but it can be tweaked to act as an options menu.

Either way, it would be good to make it optional.
So people can practise with it off first.

I’m not sure what you mean by that.

Fair enough, though I think the [WIP] part of your title is good enough to indicate that it’s unfinished and will have bugs or issues. People around here are generally quite understanding of that.

Yes, you can just use the github UI in the browser and not bother with any command line or GUI. There are one or two things you can’t do without the command line or a GUI system (like delete an accidental commit on the master branch and moving a file in a single commit instead of two), but otherwise you can do most of the common tasks using just the UI.

Licencing isn’t about being commercial,
and it’s not just saving yourself from being sued (it’s good for stopping that, but that’s not its only purpose),
it’s also about making users aware of what they can and can’t do with the program.

If someone sees “MIT licence” they know that all they have to do is retain the copyright notice and they can do pretty much what they want.
If someone sees “BSD 3-clause licence” they know they have to be clear that the copyright holder/contributors don’t endorse their derivative (unless they have written permission).
If someone sees “Apache 2.0 licence” then they know they have to keep a record of the changes that they make.

If you really want to put it in the public domain, use ‘The Unlicence’.
It voids all warranty and liability (as is standard for a licence), permits people to use the code privately or commercially and allows the code to be modified and distributed without constraint.

Alternatively you could use the MIT licence which is almost the same but has the condition that the licence header must be retained, so you still get credit when people make derivatives.


(Scott) #5

There are Windows GUI interfaces available for Git.

https://git-scm.com/download/gui/windows


(Darrell) #6

Excellent! :+1: I’ll watch your GitHub as it progresses. :1st_place_medal:


(Felipe Manga) #7

It didn’t work for you because you didn’t like it (in which case, maybe simavr-arduboy can help you?) or because something went wrong? If the latter, could you say a bit more (what happened and were you using the online or one of the offline versions)?
If you found something broken, I’d like to fix it.


#8

I found this to have been more useful. at least for the main menu. Perhaps the complexity of the one you recommended will be better for the setup page.

yeah. not going to happen. the difficulty default should be “developer’s recommended.” I have plans on making it even more difficult where after a period of answering the answer key map disappears and the boxes move instead. THAT, imo should be off initially.

oh the type of thing where its like function (variable1, function2(variable3), &variable3).
having difficulty figuring out when to “passthrough” also the different information types and signed/unsigned. i don’t expect you to explain it here. maybe i should mention that last month i didn’t know a single line of c. personally. rather than go through all the tutorials i only searched for what i needed to make this asap. i can’t explain it but I feel like noah: something big might happen to dumb society down even more than what smartphones are doing and i felt the need to release this as soon as i could so that we might may stay afloat.

_

first of all, you’re inspiring. like its on your agenda to release a perfect product. that is like… one of the reasons why ive started to learn programming. thank you.

as for the issue; I must apologize. it started working. Turns out the power switch isnt supposed to manipulate the build+play. i always thought that was kinda anti-intuitive. i kinda wish there was an option to load up the .ino and libraries from a file select prompt… also… whats with the cheeseburger?


(Pharap) #9

Most likely.
It’s more flexible than the other system.

I’m still not sure what you mean by ‘pass through’.
It is said that values are ‘passed’ to functions, but that’s generally described as ‘passing’ rather than ‘passthrough’.

Explaining isn’t a problem, half of the point of the Arduboy is for the sake of learning.
(But I can’t explain anything if I don’t know what needs explaining.)


I still think not having a licence is a bad idea.
The unlicence would suit your needs perfectly:

To opt out of the copyright industry’s game altogether and set your code free, put your next software project into the public domain using the following (un)licensing statement:

From http://unlicense.org/


(Simon) #10

I think he means passing multiple parameters by ref so he can then update them.


(Pharap) #11

I’m not a fan of modifying the value of function inputs,
but I’ll demonstrate anyway:

#include <Arduboy2.h>

Arduboy2 arduboy;

void main(void)
{
  arduboy.begin();
}

// The & makes this a reference
void add5(int & a)
{
  a += 5;
}

void loop(void)
{
  if(!arduboy.nextFrame())
    return;

  arduboy.clear();

  int variable = 0;
  arduboy.print(variable);
  add5(variable);
  arduboy.print(variable);
  add5(variable);
  arduboy.print(variable);

  arduboy.display();
}

(For more information on references this article is quite good.)


(Simon) #12

Yes … its sloppy programming but sometimes necessary. If you are going to update input parameters, make it clear that they will be modified - and maybe make all your other non-updated parameters const to further reinforce what is and isn’t being updated.

Actually, I am not sure sloppy is the correct word here but you get my point …

I would be more inclined to return a class or structure with all of the variables you need encapsulated.


#13

i’m actually a huge fan of it. I see it as a tool in a tool box. you only have 1 but you can use it for 4 different sized bolts. the size needs to be adjusted every time.


#14

I want to chip in on the software license discussion. @Pharap already explained it pretty well, but I have spent a lot of time looking at stuff about software licensing and I had something to add.

As far as I know, putting no license on a project essentially means that nobody technically has the right to use the code (the source is available, but perhaps not “open source” and definitely not free/libre). Without providing a specific license, nobody has been granted the right to use it for anything.

The unlicense that @Pharap suggested tries its best to put the code in the public domain, but some countries make it annoyingly difficult to legally relinquish your copyrights. That’s why it makes some statements about how the copyright holder(s) are aware that it would be “to the detriment of our heirs and successors,” because if not, a court might be able to claim that the people didn’t understand what rights they were giving up (or something like that. I’m not a legal expert). Copyright law is messed up.

TLDR: Adding a license in this case isn’t restrictive; it’s giving people the right to use your software for any purpose.


#15

I’m going to attempt to reply to you in a form that doesn’t unartistically sticks to quoting you.

I appreciate the insight on how the copyright causes problems to oneself. That is exactly why I refuse to attach one. You talk about this piece of software as if it will be the next big thing, for you say that “nobody technically has the right to use the code” when I have made it clear that this code is for anyone’s use. Like at what point do we literally ignore the developer’s words?
Okay so hypothetical is someone just happens to search for “CEOV” and gets upon the code to just download it and… what? use it to her/his own regards? (which I’m for) No, but you say that they would look up the author naturally and then find out from this tiny forum, this topic.
i don’t need a license because I told you you I don’t need a license. Every-time you fight me to put a license on it you further box in what possibilities, capabilities or gifts i provide.
Okay so lets stick to the basics of what #/Letter Pairs offers?

by filtering a challenge into the right genesis you get a point.
But the challenge is a pair of unrelated ideas which means the combination creates a specific multiplexed result.
quite literally. organizing the challenge into its genesis cuts down on jumping to negative conclusions. Because more than 1 factor needs to be considered this should cause an interrupt process in the brain which allows an add-on of more search queries.
This sort of brain developing software should never be licensed.
said again:
THIS SORT OF BRAIN DEVELOPING SOFTWARE SHOULD NEVER BE LICENSED

For if its given away for good. it should be used for good.

a license is small lock, but a lock nonetheless.


(Pharap) #16

I’m going to make one last comment about the licencing issue, purely because I think you’re missing some fundamental facts.

The ‘public domain’ is not the same thing in every country.
In some countries (e.g. Germany) it’s very hard to put something in the public domain.
In some countries, simply saying “I waive my rights” in an informal way isn’t good enough.
(I.e. @wuuff’s comment is completely valid.)

However with a public domain equivalent licence you explicitly state what rights you give to people who acquire the code, and by giving those rights explicitly you avoid the issue of trying to waive your copyright in countries that don’t allow copyright to be waived (and often waive it in countries that do allow it to be waived regardless).

For example, the unlicence explicitly states:

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

It’s the explicit granting of rights to the end user that allows the licence to achieve what merely attempting to waive copyright cannot - it expresses the intent in an unambiguous way, in formal legal wording such that it can be interpreted as intended in any country, regardless of copyright law.

So with the right licence, you aren’t putting locks on your code,
you’re unchaining it more than you could than simply stating “I waive my rights”.


Some relevant quotes/information:
(I have shrunk the quotes to keep this comment optionally short, click to reveal them.)

From Creative Commons:

Public domain is difficult/impossible > Dedicating works to the public domain is difficult if not impossible for those wanting to contribute their works for public use before applicable copyright or database protection terms expire. Few if any jurisdictions have a process for doing so easily and reliably. Laws vary from jurisdiction to jurisdiction as to what rights are automatically granted and how and when they expire or may be voluntarily relinquished. More challenging yet, many legal systems effectively prohibit any attempt by these owners to surrender rights automatically conferred by law, particularly moral rights, even when the author wishing to do so is well informed and resolute about doing so and contributing their work to the public domain.

From Wikipedia:

Public domain not legally sanctioned > Robert A. Baron argues in his essay "Making the Public Domain Public" that "because the public domain is not a legally sanctioned entity," a statement disclaiming a copyright or "granting" a work into the public domain has no legal effect whatsoever, and that the owner still retains all rights to the work not otherwise released. The owner would then have the legal right to prosecute people who use the work under the impression that it was in the public domain. It is certainly true that under some jurisdictions, it is impossible to release moral rights. For example the German Copyright Law (Urheberrechtsgesetz) prevents the transferability of copyrights in §29 UrhG so that an abdication isn't possible as well, though that is not the case in the United States. A more likely problem may be the lack of factual evidence that the owner has indeed put the work into the public domain.

More about that German law, from Wikipedia:

Principle of non-transferability > The „principle of non-transferability“ of full or divided authorship according to § 29 I UrhG is valid. Therefore, the creator of an original work can neither transfer their personal right as a creator,[15] nor the complete rights for the exploitation of their work to others.

If this has not deterred you then fair enough,
I won’t make another attempt to inform you (and I hope others won’t either).

But be aware that we are telling you this for the benefit of both you and your end users,
not because we want to try to force restrictions on your work - quite the opposite, we are trying to use our knowledge to ensure that your work is used intended and that it doesn’t have any unintentional restrictions (or as close to that as is legally possible).


#17

I’ve been able to work on the game some more and I’m at a junction point. Should I stick to system characters encoding or use bitmaps?

Right now I’m leaning towards bitmaps because it would allow me to easily change the language. I find that using this game with “even”/“odd” in the language I’m currently learning, helps anchor in the new word associations I’m creating. The problem is the language I’m learning has accents and I pathetic as it might seem, I rather use the built in character set which already has the characters. For example. the “setSystemEEPROM.ino” (for arduboy2 library) allows me to pick characters 152(x99) and 142(x8E), yet I can’t find a simple documentation on putting those characters in the “print.”
I read around and it seems that characters over 155 take more than 1 byte. I’m alright with that. I’m not using it for the challenge string but for the shuffling key map. Anyone know a quick way to put these in?

As for something else I’ve been working on, and I would like to share:

 int keylinger = 3;
 arduboy.pollButtons();
 if(arduboy.pressed(UP_BUTTON)) {upcounter = keylinger; uppress = true; consent = true;}
 if(arduboy.pressed(LEFT_BUTTON)) {leftcounter = -keylinger; leftpress = true; consent = true;} //
 if(arduboy.pressed(RIGHT_BUTTON)) {rightcounter = keylinger; rightpress = true; consent = true;} //
 if(arduboy.pressed(DOWN_BUTTON)) {downcounter = -keylinger; downpress = true; consent = true;}
 if(arduboy.justReleased(UP_BUTTON)) {uppress = false;}
 if(arduboy.justReleased(LEFT_BUTTON)) {leftpress = false;} //
 if(arduboy.justReleased(RIGHT_BUTTON)) {rightpress = false;} //
 if(arduboy.justReleased(DOWN_BUTTON)) {downpress = false;}
 if (upcounter != 0 && uppress == false){upcounter -=1;}
 if (leftcounter != 0 && leftpress == false){leftcounter +=1;} //
 if (rightcounter != 0 && rightpress == false){rightcounter -=1;} //
 if (downcounter != 0 && downpress == false){downcounter +=1;}
 if (uppress == false && leftpress == false && rightpress == false && downpress == false && consent == true){
 int horizontalcounter=leftcounter+rightcounter; int verticalcounter=upcounter+downcounter;
 upcounter = leftcounter = rightcounter = downcounter = 0; consent = false;
   switch (gametype){ //4 directions
     case 0:
       if (abs(horizontalcounter) > abs(verticalcounter)){ //axis choose
         if (horizontalcounter > 0){//code here}
         else {//code here}
       }
       else {
         if (verticalcounter > 0){//code here}
         else {//code here}
       }
     break;
     case 1: //8 directions
       if (horizontalcounter == 0 && verticalcounter > 0){//code here}//up
       if (horizontalcounter < 0 && verticalcounter == 0){//code here}//left
       if (horizontalcounter > 0 && verticalcounter == 0){//code here}//right
       if (horizontalcounter == 0 && verticalcounter < 0){//code here}//down
       if (horizontalcounter < 0 && verticalcounter > 0){//code here}//northwest
       if (horizontalcounter > 0 && verticalcounter > 0){//code here}//northeast
       if (horizontalcounter < 0 && verticalcounter < 0){//code here}//southwest
       if (horizontalcounter > 0 && verticalcounter < 0){//code here}//southeast
     break;
   }
 }

its a code to properly register diagonal keys. It works by focusing on the release of the keys and a diminishing counter of the keys which were pressed before any of all of them were released. the two gametypes are 0 which is normal x and y keys and 1 which is diagonal keys enabled. I haven’t tested the latter but I’m pretty sure it will work. I believe this might come to be very useful in games where holding a red button will bring up a inventory wheel menu where you can select a piece of gear from 8 different slots. this would be a much faster system of select than the typical up and down menus which take longer to navigate.


Logix - Game Jam 3
#18

You can write different characters of the font by using hex in your string (and prefacing the hex value with \x), for example to print the accented characters you mentioned:

const char theString[] = "Hello \x83 and \x8E";

arduboy.print(theString);

You can also use the drawChar() function of Arduboy2 as well, if you want to draw a single character at a given pixel position:

// Draw the 0x8E font character at X pixel 5, Y pixel 10, with a white font color
// and black background color, at 1x size (you can change this to 2 for 2x size, etc).
arduboy.drawChar(5, 10, 0x8E, WHITE, BLACK, 1);

drawChar() can be used for example to draw the \x8E character slightly higher than other text, so that its bottom part is in line with the text.

Here’s an example, showing both drawChar() and print():

#include <Arduboy2.h>

Arduboy2 arduboy;

// The string that includes extra font characters.
const char theString[] = "Hello \x83 and \x8E";

void setup() {
  arduboy.begin();
  arduboy.setFrameRate(15);
}

void loop() {
  if (!(arduboy.nextFrame()))
    return;
    
  arduboy.clear();

  arduboy.setCursor(20, 9);

  // Print the string that has extra font characters.
  arduboy.print(theString);

  // Draw the 0x8E character to the left of the "Hello" text, and slightly higher so it lines up.
  arduboy.drawChar(10, 8, 0x8E, WHITE, BLACK, 1);

  arduboy.display();
}

If you want to know what hex value corresponds to what character in the font, see the below image that shows each character in the font itself. To find the character, check the row first, and then the column (for example the hex value 8E is the character in row 8, column E).

arduboyfont

The font sheet image above is from ChrisS, and can be found in their post here:

Please note that the font sheet image looks to be based on an older version of the Arduboy’s font, and it seems like the Arduboy’s font has now changed so that the characters in the above image from B0 onwards are now shifted one to the right (for example to show the character at B0 in the image, you would use B1 instead as the hex value in your code).


(Pharap) #19

Arduboy2 uses Code page 437 for its font.

Code page 437

You have to be careful when you make the string though, using the \x char escape will try to consume as many hex characters as it can, so you may have to split your string up a bit, e.g.

const char string[] PROGMEM = "Cr" "\xA2" "dits";

(This works because adjacent string literals get concatenated at compile time as if they were all part of the same literal.)

Not quite, characters with a value over 255 take more than one byte.

Good idea.

I’m sure there’s an easier way to pull it off than the code you’ve got there, but I’m not sure what without thinking about it.

It would also depend on whether it would select when the user let go of the red button or the direction buttons.
Select when letting go of red would be easier.

Funny you should mention that


#20

So, I’ve continued work on this project and despite the char answers i received earlier, I’ve decided to go with a spritesheet anyways. The reason for this is because the characters get misaligned:
Capture_test

Rather than deal with this (also the font is too big for print accents) I decided to go the bitmap route, but I’m trying to keep it as one spritesheet so that changing languages is as easy as dealing with swapping one chunk of code, rather than multiples.

But then I came upon another problem: spritesheet sizes. I’m reading around that the height of a spritesheet needs to be a multiple of 8, however crait’s converter seems to deal with other sizes just fine. english_sprites
But now I have another problem: transparency doesn’t work in the corners.

I’ve tried drawPlusMask, but i can’t tell if im putting a proper mask so I decided to separate the mask (so now I have 2 progmem images, which I’m not a fan of). Had to use a non transparent pngs for this:english_sprites_no_mask and english_mask_single_w_white_corners(this is a mask).
This is the result:

 #include <Arduboy2.h>
 #include <Sprites.h>
Arduboy2 arduboy;
Sprites sprites;

int playerx = 5;
int playery = 10;

//spritesheet
const unsigned char choicetiles[] PROGMEM  = {
  25, 20,
0xf8, 0x4, 0x2, 0xf9, 0x29, 0x29, 0x9, 0x1, 0x79, 0x81, 0x1, 0xf9, 0x1, 0xf9, 0x29, 0x29, 0x9, 0x1, 0xf9, 0x11, 0x21, 0xf9, 0x2, 0x4, 0xf8, 0xff, 0x00, 0x00, 0x79, 0x81, 0x1, 0xf9, 0x00, 0xf0, 0x8, 0x9, 0xf0, 0x00, 0xf9, 0x81, 0x81, 0xf9, 0x00, 0xf9, 0x00, 0x00, 0x1, 0x00, 0x00, 0xff, 0x1, 0x2, 0x4, 0x8, 0x8, 0x9, 0x8, 0x8, 0x8, 0x9, 0x9, 0x8, 0x8, 0x9, 0x8, 0x8, 0x9, 0x8, 0x9, 0x9, 0x9, 0x9, 0x4, 0x2, 0x1, 0xf8, 0x4, 0x2, 0xf9, 0x29, 0x29, 0x9, 0x1, 0x79, 0x81, 0x1, 0xf9, 0x1, 0xf9, 0x29, 0x29, 0x9, 0x1, 0xf9, 0x11, 0x21, 0xf9, 0x2, 0x4, 0xf8, 0xff, 0x00, 0x00, 0xf1, 0x9, 0x9, 0x91, 0x00, 0x10, 0x28, 0x29, 0xc8, 0x00, 0xf9, 0x11, 0x21, 0xf9, 0x00, 0x9, 0xf8, 0x8, 0x9, 0x00, 0x00, 0xff, 0x1, 0x2, 0x4, 0x8, 0x9, 0x9, 0x8, 0x8, 0x9, 0x9, 0x9, 0x8, 0x8, 0x9, 0x8, 0x8, 0x9, 0x8, 0x8, 0x9, 0x8, 0x8, 0x4, 0x2, 0x1, 0xf8, 0x4, 0x2, 0xf1, 0x9, 0x9, 0xf1, 0x1, 0xf9, 0x9, 0x9, 0xf1, 0x1, 0xf9, 0x9, 0x9, 0xf1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 0x4, 0xf8, 0xff, 0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, 0x00, 0x00, 0xff, 0x1, 0x2, 0x4, 0x8, 0x9, 0x9, 0x8, 0x8, 0x9, 0x9, 0x9, 0x8, 0x8, 0x9, 0x9, 0x9, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x4, 0x2, 0x1, 0xf8, 0x4, 0x2, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x1, 0x2, 0x4, 0xf8, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x1, 0x2, 0x4, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x4, 0x2, 0x1, 
};
const unsigned char mask[] PROGMEM  = {
  25, 20,
0x7, 0xff, 0x3, 0xff, 0x1, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xe, 0xf, 0xc, 0xf, 0x8, 0xf, 0x00, 0xf, 0x00, 0xf, 0x00, 0xf, 0x00, 0xf, 0x00, 0xf, 0x00, 0xf, 0x00, 0xf, 0x00, 0xf, 0x00, 0xf, 0x00, 
};
void setup() {
  arduboy.boot();
  arduboy.flashlight();
  arduboy.setFrameRate(10);
  arduboy.display();
}

void loop() {
  //Prevent the Arduboy from running too fast
  if(!arduboy.nextFrame()) return;
      arduboy.clear();
      arduboy.drawRoundRect(43, 3, 21, 18, 8); //left box
      arduboy.drawRoundRect(65, 3, 21, 18, 1); //right box, i need more boxes..'
      //arduboy.drawCircle(9,6,11,1); //smaller circle test
      arduboy.drawCircle(9,6,12,1); //top circle test
      Sprites::drawExternalMask(playerx, playery, choicetiles, mask, 0, 0);

  arduboy.pollButtons();
    if(arduboy.pressed(LEFT_BUTTON)) {
        playerx = playerx - 1;
    }
    if(arduboy.pressed(RIGHT_BUTTON)) {
        playerx = playerx + 1;
    }
    if(arduboy.pressed(UP_BUTTON)) {
        playery = playery - 1;
    }
    if(arduboy.pressed(DOWN_BUTTON)) {
        playery = playery + 1;
    }
  arduboy.display();
}

But that’s not all! now there is a strange transparent vertical interlacing going on. Capture_test2
When I put the above code into projectabe, moving the 25x20 icon over the circle and square shows that what’s under it still shows up but interlaced. Anyone know why this is happening?

Preferably I rather use one char progmem for the image…

I spent 3 hours on this and I found myself going around in circles so I decided to post back in this topic for help. It would be greatly appreciated.


(Pharap) #21

They do.
Images where the height is not a power of 8 will be typically padded.

(The dimensions of the image are encoded so I think the value of the padding won’t make a difference because the renderer will skip the padded area, but I’m not completely sure about that.)

It’s likely that your mask is the wrong way round or the padding is being padded with ‘solid’ rather than ‘transparent’.

In most siuations, a bit mask uses 0 (black) for ‘solid’ and 1 (white) for ‘transparent’,
but for whatever reason it’s the reverse on the Arduboy,
1 (white) for ‘solid’ and 0 (black) for ‘transparent’.


Oh, and if you’re using an external mask,
the external mask doesn’t need its dimensions encoded at the top, it pulls them from the non-mask image.
Leaving the dimensions in the mask would cause the mask to be corrupted slightly, so they’ll need to be removed.


#22

SUCCESS! Thank you so much, @Pharap!
Capture_test3.
once you helped me figure out that a multiple of 8 doesn’t mean the pixels image has to be a multiple 8 and could use transparency padding. i was like oh right
once I figured that out, i built the spritesheet vertically with vertical transparent spacing, named the filename.png properly, and team args converter worked like a charm.

this is really good, I think its all downhill from here.


(Pharap) #23

If you aren’t sure how the image format works, here’s a diagram @emutyworks made ages ago that I like to keep around.

EmutyDiagram

Edit:

To be completely clear, dark squares correspond to 0 and bright squares correspond to 1.
Following that you should be able to see that the most significant bit (left hand side) ends up at the bottom of the column in the image.