uccser / cs-field-guide

A free online interactive resource/textbook for high school students learning about computer science.

Home Page:https://www.csfieldguide.org.nz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Group cards in logical sets for binary cards interactive

eAlasdair opened this issue · comments

Bits are grouped in sets of 4 or 8, from the LSB up. i.e. 11110 (proper form 00011110)
is more commonly viewed as 1,1110 (1E) than 1111,0 (F?).

The Binary Cards interactive uses a simple container and so groups cards like the latter. In this example the face-up cards form a standard 8-bit group but instead the 8 MSBs are grouped instead:
image

Similarly, even the opposite doesn't seem right; it appears like the 256 card belongs to the group of 8 cards, with 1 left over at the bottom. If you were to ignore the actual number of dots on the card and just read each line like binary, it is 10000000 i.e 0x80 on one line, and 0 on the other
image

When the screen is smaller this problem is expressed differently, with cards grouped in sets of however many fit next to each other on the screen.
image

Instead, I propose that the number of cards shown is forced into sets of 4 or 8 (depending on screen size). If the url parameter expresses a number of cards greater than a threshold (say 6) yet not a multiple of 4 or 8, face-down cards should be prepended to make even sets of 4/8