October 11, 2025 AI, Fun 2 comments
October 11, 2025 AI, Fun 2 comments
The other day my daughter showed me the typing game her teacher encouraged kids to play. My daughter was impressed with my typing speed. This blog post is to impress her even more.
The game she played was online typing practice – you type text and compete with other players for speed and accuracy. Players are represented as racing cars. If you win races you qualify to higher league of players. In this post I want to do few things:
Here is the result of about 30 minutes of work. You can play it yourself (if reading from e-mail you may need to open the blog).
This was achieved with 13 prompts, summarized like this:
1. Initial project creation prompt
2. CORS issue fix request
3. Container class addition request
4. HTML demo update request
5. Simple version (typing.html) request
6. Visual version creation request
7. Error display duration adjustment
8. Error display fix attempt
9. Revert request for error display
10. UI enhancement with "click to activate" label
11. Visual version adjustment request
12. Final revert request
13. History documentation requestNow instead of working with Claude, I started working with Gemini to create a design for the multiplayer game.
Here is the high level system design document: opens in another page.

Given that I explicitly prompted it to be fully stateless, relying only on client side local history, no login and no other complications this seems to be a fairly good start. My prompt was:
Now I want you to create a comprehensive system design to build the game described above. We need:
- simple website with JS logic
- backend that can create rooms of gamers based on their levels
- the game should protect user privacy so there is no user info stored on backend
- game history is only stored as long as user has local cookies
- backend should handle at least 10k users
- single game has max 6 players
- if user wins the game they are placed into higher leagueAs a next step I fed the generated system design document back to Claude in Visual Code. This time I had to fight a lot more with the AI as it was running into issues connecting players but finally arrived at the multiplayer game:

Prompting history:
- Initial setup of multiplayer backend server
- Setup Node.js with Socket.IO and databases
- Create basic server structure
- Implementation of matchmaking system
- Create skill-based queue system
- Handle player matching logic
- Game room and state management
- Implement room creation and management
- Handle player synchronization
- Create typing texts table
- Add sample data
- Visual keyboard integration
- Add keyboard visualization to multiplayer version
- Implement key highlighting
The backend is powered by:
- Node.js
- Socket.IO (for real-time WebSocket communication)
- Redis (for server-side data/caching)
- PostgreSQL (for the database)I have complete confidence that if I had 2 or 3 days to spend on this I could actually create a game that can be put out there on some servers and be actually playable by actual human beings! The new world of AI is nuts. I’m out of my time allocated to blogging, but I’m convinced over and over again, that the old times of programming are over – the only way to survive is to adopt.
P.S. Another thought: I have a friend who works on Linux kernel stuff. You would imagine that hardcore stuff like that would not be affected by the era of AI, but no, he says that AI helps to properly review pull requests to the kernel and catch real issues, moreover it does help to build more complex things. Caveat, of course, is that the proper knowledge is still required. Who knows, if I knew nothing about programming, maybe, I wouldn’t be able to build this typing game so quickly? Or, maybe, this is just a matter of time?
January 12, 2020 Data Structures, Design, Fun 2 comments
Recently I went to a gym with a friend of mine and we had a chat about QuadTrees and k-d trees (yeah… don’t invite software engineers to your party – they will spoil everything). He asked me to explain what QuadTree is, and I said that it’s like binary tree just with four children instead of two. He then said it must be a variety of k-d tree. “Well…” – thought I – “probably, but I don’t know”. He explained that k-d trees as used to break k-dimensional space, which seemed reasonable as QuadTree is used to break two-dimensional space. Below are definitions of the two from wikipedia as well as some of context and my drawings.
A quadtree is a tree data structure in which each internal node has exactly four children. Quadtrees […] are most often used to partition a two-dimensional space by recursively subdividing it into four quadrants or regions.
https://en.wikipedia.org/wiki/Quadtree
Something like QuadTree could be used to compress images or to break a map of uneven density into regions where each node would have similar density.
For breaking a map, you can think of a designing a system that handles storage of information about restaurants and other points of interest. You would like to look up the information using your location on a map. Obviously downtown of a big city would have high density of these places and you might not want to show all of them to your user. So you would break you map into more quadrants few levels down, but on the outskirts you might have only few nodes that cover larger areas.
I just drew this process of compressing an image below. What you see on the bottom-left corner (SW) is an image, which was broken on bottom-right (SE) into 4 quadrants, each of which was broken into some more, but the moment either black or white occupied entire square the process stopped. Top-right (NE) is visualization of a compressed image (not too nice), and top-left (NW) is the QuadTree with some of the leafs pointing to their position on compressed image, which needed only 67 nodes and depending on how we store the data it could be insanely small amount of data required.

[…] k-d tree (short for k-dimensional tree) is a space-partitioning data structure for organizing points in a k-dimensional space. k-d trees are a useful data structure for several applications, such as searches involving a multidimensional search key (e.g. range searches and nearest neighbor searches).
https://en.wikipedia.org/wiki/K-d_tree
I didn’t draw anything for the k-d tree, but on very high level the idea is similar of breaking the space and going few levels down (there exists a generalization called binary space partitioning). With k-d tree the space is broken into TWO half-spaces by one of the dimensions instead of FOUR. Say, if it was “z”, then all children to the left will have “z” of smaller value than parent, and all to the right will have greater than parent. What I find interesting about k-d tree implementation is assigning axis to levels (root “x”, its children “y”, their children “z”, next level would be “x” again and so on for 3-dimensional space).
Don’t be like me, read a bit about these fascinating data structures and their application and who knows, you might be able to strike a great conversation in your local gym! :)
July 18, 2010 Book Reviews, Certification, Fun 6 comments
Book talks on different Windows Forms related stuff. From the beginning it tries to teach me how to create simple forms app and add controls to it, but hey with my experience developing applications it is too boring. In advanced WinForms controls it talks on ListBox, TreeView, CheckBoxes and so on :) After so complex things it leads me to ADO.NET and how to work with connection Strings and how to even read data from DataReader. In advanced topics on Windows Forms Development it talks on how to create MDI application. OMG, i knew how to do them on my 3rd year in university. In asynchronous operations it talks on how I can use BackgroundWorker and even what is Thread and how to synchronize two of them. Maybe the most interested chapter was Deployment, at least because I never really used it either at work or in university.
But you know what is the most funny about all of this? – Possibility that I will not pass this exam. Why? – Because these entry ms exams are kind of exams for con. It require simple knowing of names of classes and functions. But on other hand I understand, that they couldn’t make it different.
You just need to read this kit to pass this exam, almost no way to do it different.
I understand that if you have no experience working with Windows Forms book could bring lot of value for you. For example, do you know how to create not rectangular button or how to print documents programmatically.
Fact that I read this book means only one – which I’m going to schedule exam for next Friday and spend my evenings trying tests from book, and maybe MeasureUp. Also researching over internet how to prepare myself fot it.
So, wish me good luck on passing this exam.
July 16, 2010 Fun 2 comments
Today Firefox asked me for update, of course I approved.
When it started downloading updates very quickly I got this picture:
Readers, do you see anything wrong with it? :)
I never thought that guys from Firefox could do such fun and stupid bug, but this proves that we all are human, still not ideal robots.
May 19, 2010 .NET, Concurrency, Fun No comments
Today I was playing with exception handling and threading in .NET. It was really fun.
Do you know guys that like to have everything in global try-catch block? I have two news for them.
Bad one
Exception will not be caught in try-catch block if it was thrown in another thread. Those guys also could think that Application.ThreadException could help them to catch those.
static
void
Application_ThreadException(object
sender, System.Threading.ThreadExceptionEventArgs
e)
{
MessageBox.Show(“This is
something that I would not recommend you to have in your application.”);
}
But indeed this event fires only if exception has been thrown as result of Windows message or any other code that runs in same thread were your WinForms application lives. I tried to use two timers to verify that.
System.Windows.Forms.Timer – which ensures that code you have in your tick method runs in the same thread as your application. In this case I got message box.
System.Threading.Timer – which runs in separate thread, so my app just crashed.
But if those guys are writing all code in Form1.cs file… then maybe it worth for them to have handling of Application.ThreadException event :)
“Good” one
There is event which will be fired when exception is thrown from any code/thread withing your application domain. It is AppDomain.UnhandledException and it occurs when exception is not caught.
Lets take a look on code snippet that shows this:
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
static
void
currentDomain_UnhandledException(object
sender, UnhandledExceptionEventArgs e)
{
MessageBox.Show(“This is
shown when ANY thread is thrown in ANY point of your Domain.”);
}
To test this I created Threading.Timer and fired it every 2 seconds and throwing exception on each tick, I put breakpoint into event. I got everything expected and application after that failed.
But one of our smart guys could guess to put Thread.Sleep(1000000); into handler code like below:
Everyone is happy. Exception is thrown each 2 seconds or less and UI continue to respond. I hope you already see what is wrong with all of this.
This screenshot talks for itself:
And as you know process could have up to 1024 threads. My process is not exclusion and it also crashed after reached that number.
Ok, looks like guys should change their mind.
Hope it was a bit fun.