I want to build a web site for the project. I am working on a web site written from scratch in C.
I want to write about the program as I code the program. Unfortunately, this process of writing and coding at the same time is taking a long time. The writing is forcing me to check every single detail of the code.
Should I Use a Blockchain or Legacy Database?
Since HIVE is built on a blockchain, I was thinking of creating an object database for the site that I could embed on a blockchain structure.
I just haven't had luck with this design yet.
However, since I started the project I thought I should knock out a quick mock-up in PHP and SQLite3.
Yes, I realize that Web 3.0 technology is superior than Web 1.0. I also know that I need to master Web 3.0 programming.
But, I find simple web design and database programming to be easier, more fulfilling and more robust than blockchain design.
My coding style is usually denounced as "legacy code."
To be truthful, I really don't care about the number of spaces in an indent, nor do I care about naming conventions of variables. I usually use whatever style is common for a project.
Apparently, I am one of the few people in the world who does not mind going through a program and renaming all of the variables when some anal-rentive dictates a new coding style or naming convention.
Anyway, my last boss used a weird style where he appended an abbreviation of the datatype on the end of all variables. "First Name" would be "first_nm." A "Short Description" would be "short_desc."
I decided to ask Google Bard about coding styles and will use the coding styles recommended by Google.
I really don't care about variable names; so long as they are consistent.
If there is a preferred coding style for sites connecting to HIVE, let me know.
Starting the Design
The Infinite Doodle is an unbound collection of tiles in a three dimensional grid. To make the design challenging the tiles are connected by a binary tree.
In a binary tree, each parent tile is connected to two children tiles.
It is possible to express each position in a binary tree with a binary number. The first node is 1. The second node in binary is 10. The third is 11 and so forth.
Utilizing advanced mathematical techniques it is possible to map all of the positions of a binary tree onto the positive integers.
Okay, okay, okay, okay. Any list of integers is a binary tree.
The primary key for the Tile database is tile_id which has type INTEGER PRIMARY KEY.
I want to release a tile a day. SQLite3 uses a day numbering scheme called JulianDay. I am only interested in the day portion so I will have a column called release_jd. This just emphasizes the data type.
Each tile has a parent tile and two children tiles. I can calculate these figures the tile_id. I can find the parent by dividing by two. The two children would be tile_id + 0 and tile_id +1.
I want to embed the binary tree into a 3D grid. I need to record the x, y, and z positions of this point.
Everything in the grid is connected. Unfortunately there is a dozen different ways that one can connect the tiles in my grid.
The line from the doodle will enter a tile. It will divide then leave in two different directions.
There is one way in and two ways out.
There is an interesting symmetry between the exit and entry points. Imagine a line exits the top of a 100. It will enter the bottom of tile 1001.
I want to give a unique id to all the ways I can connect tiles in the grid.
Lets start by imagining a square. A square has 4 sides. A line could enter through 1) the left side, 2) the top, 3) the right-side or 4) the bottom.
A square also has 4 corners: A line could exit through the top-left, top-right, bottom-right, or bottom-left.
There are eight ways to exit a square.
But I am working on a 3D grid. A line could exit upwards or downwards. Since I want a robust grid that can hold a binary tree. I want to enumerate all of the possible entry points. This means that I will create a table with the following rows:
1 Left
2 Top
3 Right
4 Bottom
5 Top-left
6 Top-right
7 Bottom-Right
8 Bottom-Left
9 Up a Level
10 Down a Level
I can imagine situations where I will change a level and exit out the side. I am not going to run out of numbers; So, I will define codes for all the ways that a drone could rise and exit from a grid.
I will have a table called Entry_Type that I create with the SQL:
CREATE TABLE Entry_Type (
type_id INTEGER PRIMARY KEY,
x INT,
y INT,
z INT,
mirror_id INT,
entry_name TEXT);
CREATE UNIQUE INDEX Entry_Type_UIX
ON Entry_Type(x,y,z);
I will publish the full schema plus data on my homepage:
The Main Tile Database
This is the start of the schema for the main database. Unfortunately, it is seven PM and I have to cook for some hungry. I will publish now and finish the table later:
CREATE TABLE Tile (
tile_id INTEGER PRIMARY KEY,
x INT,
y INT,
z INT,
entry_type INT,
x_pixel INT,
y_pixel INT,
publish_jd INT,
tile_prompt TEXT);
CREATE UNIQUE INDEX Tile_XYX_UIX
ON Tile(x,y,z);
The Image
I created the following image with DALL-E. Today's doodle prompt will be:
END NOTE: I spent multiple hours writing this page. I was checking facts on different web sites. I opened a site with malformed javascript. The site froze my computer and I ended up losing the work and had to start over.
There is so much bad Javascript in this world. This is why I avoid Node.JS.