I haven’t worked on this in a very long time, haha
So I stopped working on my Rubik’s Cube solver a while ago because it was more or less complete. I never actually submitted it though!
I just spent a few hours cleaning up the repo, fixing some stuff, etc.. It is now presentable and shippable!
I’m not sure exactly how to do this but my demo is actually a hosted web page giving instructions on how to install and run it. It’s not one line but actually two (one for cloning and one for pip install-ing) but I hope that’s okay.
Thanks all!
I sat down and (for fun!) designed a more modern version of Wikipedia. Just thinking about what an updated UI might look like for them. I’m thinking about using this as an excuse to learn Svelte and actually turn this into a real website…
(Also the hours of designing didn’t count lol)
I’ve been working on my physics simulation and I had to convert between two coordinate systems (world space and screen space). My brain really struggled with this one for some reason.
After spending some time trying to work it out in code I gave up and had to create a drawing in Freeform and literally draw out and rescale the vectors, moving them to where they needed to be.
So that’s what this screenshot is! I’ll explain what everything means.
Basically, everything in my engine is a 2D vector. I have a point in world space (represented as a vector of course) and need to convert it to screen space, but they have different origins (center vs top left). The idea is to display it as if it was world space but on the screen. The arrows are me physically placing, moving, and scaling the vectors to find the pattern that converts them.
Anyways, that was hard haha. It broke my brain
I just finished setting up the project to use “ebiten,” a UI library for Go. Additionally, I created a type Vector2D struct with an X and Y as well as Add, Subtract, Scale, Dot, and Rotate methods.
Unfortunately, I don’t have any interesting images to put here, so here’s a screenshot of the vector code :)
Custom themes!
Sorry, this is a short devlog, but I just finished the tedious task of letting the JS update every color in the CSS via CSS variables.
Luckily, I had thought ahead and made everything in the CSS already use a variable but there’s a lot of hardcoded values I had to manually input.
Draggable files on the desktop :)
.
I really like how smooth and bouncy the animation is, and I’m really proud of how well I fit the files in with the rest of the theme. Double clicking gives a really satisfying fluid motion.
Also, they open the windows :)
.
Sidenote, I added keyboard shortcuts! Notably, esc to close windows and cmd z to undo the closing.
I really had to balance the command z because I didn’t want it to undo writing text, but I also didn’t want to completely disable command z on my page. text
Strategy Functions!
.
So I have a UI (CLI) for the player now. I think it’s pretty cool, each player (3 bots, 1 player) has a field for a strategy function which takes in a game state and returns a card. In the bots’ cases, that means doing logic.
.
But, for the player, I just have a player strategy function that gets the card the user wants and returns that. I really love when something fits in like that without having to make exceptions.
.
Right now, I’m trying to figure out why my code has decided to deal every player the same cards. Very fun.
I’ve started outlining my new project! I’m making the game Hearts as a CLI.
I’m writing this in Go, a new language for me. I’m excited to learn but it’s been difficult, what with all the unique structure.
About the project, I’ve decided to make structs for players that have a field for their strategy, a function that takes in a state and returns a card. This will let me try out different strategies easily just by writing it in code, but it also seamlessly translates to player input. The function just gets input from stdin instead of doing logic to return a card.
My knowledge of Go (or lack of it) has been challenging because I’m used to knowing the correct way of doing something in Python whereas in Go I’m just making things up :)
As mentioned before, being intrusive on the slack is a major issue for me. I spent a while working on this (some of the time working on this was counted in my last devlog which had 10h on it).
Now you can put the flags /bot [–disable-{here|me|channel} #channelname]
Which lets you disable the bot for the current channel, yourself, or a specified channel. The same options exist for [–enable-{here|me|channel}].
Additionally, I spent some time using blockit (a slack tool) to make this mini UI with a disable button.
The disable works by saving to a json file the channel/user ID and an enabled or disabled string (so there is room for other options as well!)
Interestingly, I didn’t have to differentiate between user IDs or channel IDs. The user just puts @user or #channel and the ID is passed directly as a string to the bot.
So believe it or not, the hardest part about this project was the social aspect.
I make this slack bot that checks if the first letters of each word in a message spell something, thinking this will maybe happen to one person a day, or even less. Very uncommon. I even made sure the words had to be at least four letters so it didn’t trigger as often.
So I leave this bot going for about 12 hours while I sleep. I wake up and it has replied to 42 different messages.
I’m so sorry if that was you! It has been stopped!
Learned another basic JavaScript principle again (unpacking multiple value) :)
Meanwhile, I could do this ten times faster in Python without having to look something up every minute or so.
Browser in a website = (Pi WebOS)²
Behind the scenes there’s a lot that I’ve done.
Mainly, the window content is actually styled (and a few new windows have been added!), but there a a ton of small things that had to get done first.
There is a working (kind of) web browser that displays the url in an iframe, which is really cool, and actually not too difficult. It can’t display all sites because many popular sites intentionally disable being shown in an iframe, but it can go to hackclub.com.
I’ve added more windows and some other miscellaneous features. There was a lot of debugging, and coincidentally also a lot of forgotten keywords, like “let”. I’m too used to Python. I haven’t styled the windows yet, though.
Starting the WebOS basic mission. I have windows displaying, moving, and closable.
Next is adding content to the windows, but also making the nav menu do stuff.
I had a weird bug with the rem unit changing based on the parent height. If you know advanced CSS, you’ll understand why that’s strange :)
My program found solutions that I’ve never seen before :)
*
I told it to find an algorithm that takes an F2L pair out (e.g., R U R’ U’). If you are not familiar with the Rubik’s cube, I told it to find a sequence of moves that would result in a certain state.
*
I knew about one, very common sequence (R U R’ U’) and it found 17 others that I had never seen before, in about a minute of search time.
*
Now all that’s left is to optimize it so it can find longer algorithms!
This was meant to be a quick side project. I have now spent more time on this than my main project. What happened??