On Umbrellas.

Yesterday, I was walking back to my hostel when it suddenly began to rain. I pulled out my umbrella and carried on walking. After about five minutes, I noticed no one else around me had an umbrella. I was the only one that I could see. In the ten minutes it took to get to my room, I saw exactly one other person, an old man on a bicycle, with one.

I always have my umbrella with me. Why? Because an umbrella is an easy thing to always have with you.


On Santa Claus and the Tooth Fairy

I used to believe in the Tooth Fairy. Not Santa Claus though. I’m not quite sure why. I remember when I lost my first tooth, or maybe my second, I put it under my pillow before I fell asleep. Next morning, tooth still there, no money. So the tooth fairy was not real.

That literally was what happened. I concluded that she didn’t exist, and calmly shrugged it off. The first time I heard of Santa Claus was in a fairly sceptical environment, so I must have vaguely felt that he wasn’t real anyway. But the tooth fairy was different. I was as naive as they make them, and I simply assumed it was true, without even thinking about. And of course I threw away that assumption easily.

I don’t quite know why I’m writing this. I’m watching Modern Family and someone happened to mention the tooth fairy and all these random memories came rushing back to me.

Wouldn’t it be so nice if we could put on and throw away ideas and beliefs as easily as that?

This was #… ah forget it. No more counting. I’ll talk about this next.


On learning by tinkering, part 2.

There is always a profound sadness associated with the end of anything, be it a book, a tv show, a year, or an era. Projects are no different. And now that I’m done with my game (I can proudly christen it v1.0) I am incredibly sad. Bordering on depressed, even. I cleaned my room (I keep it dirty just to have things to clean when I’m like this). I rearranged everything. I brushed my teeth. I made an OS X build of my game, and then a Windows one. I don’t have Linux. I got a guy to mop my room down. I paid him with the surprisingly plentiful change hidden in books and crannies in my room. I sat down. I looked at the screen, with Sublime Text (my newfound favourite text editor) staring back at me blankly. I closed the laptop, and asked my mother how to clean a mug. I didn’t have detergent, is liquid hand wash okay? I cleaned my mug. I had five or six mugs of tea yesterday. I spent 14 or 15 hours at the computer yesterday. Coding, looking things up, making mistakes, fixing mistakes. Learning.

Having fun.

I just spent the last fifteen minutes looking at the pictures my code generates. My code. (Knot atlas’s knots, but still!). There’s something mesmerising about losing yourself in your work. Music helps too, and I have Broke for Free playing right now. They’re on Bandcamp. Have I mentioned Bandcamp is awesome? It is.

I am nowhere near done yet. Oh no. This is just v1.0. This shall be a very ongoing project. I have oodles of ideas for game modes. Arpit had a brilliant idea, too, but I need to math it out to see if I can implement it or not.

What now? A log. Of retroactively named versions of my game. Thank you for reading.

v0.0
Idea is nebulous. Kawauchi shows us his game and I think about it for the next few days. I don’t quite know when exactly I wanted to make it. But I began doodling in class once. I drew the tiles I would go on to use in the actual code. I figured out how to convert arc representations into matrices. I stopped doodling.

v0.1
I find cocos2d and make the bare bones display window appear. I muck about till I get a hardcoded arc representation to become a diagram.

v0.2
I’m home now, and I’m back to doodling. This time it’s to toggle the crossings. I spend a full day thinking about it. I code it in one go the next day. Now the hardcoded knot toggles. I have one level of my game. It’s boring.

v0.3
The episode with Knot Atlas. I yanked 250 representations from their website. I wrote some code to go back and forth between knots. I changed from the “over/under” images for the crossings to “on/off”. And these are assigned randomly, to improve replayability.

v0.4
Squashed a bug I didn’t realise was there that had to do with duplicate regions being spat out by my code. Now is neat. Also the outside is now a region.

v0.5
Now I’m in Roorkee. There’s no internet. I can’t update/jailbreak my phone to put my game in it. Impatient. I begin coding it from scratch in Python. Find Tkinter, which I subsequently fall in love with. Rapidly get it up to speed, to v0.4 in one day. Or maybe two.

v0.6
I learn more Tkinter stuff. I make more windows. And buttons. And victory screens. I send the code to people. They either can’t or don’t want to play it. No matter, I try making it better.

v0.7
Changed a function that was updating every 0.1 sec into a static thing that checked only when something happened. Huge speed increase. Cool. Put in a help screen. Helpful help screen. Polish code a little bit.

v0.8
Added a counter that told you how many moves you’ve made so far vs. what the minimum is. Took a while to code. This was what I was doing yesterday. Made the counter slightly fancy with colours and stuff. Gave you the option to retry the same random seed, or to try a different seed.

v0.9
Got bored and added a Cheat button that shows you exactly which regions you need to tap in order to win. This is for when you’re too frustrated with a level or when you simply don’t believe the minimum number. Also, this is a wonderful gauge of difficulty. A 1, 2, or 3 turn level is incredibly easy and a 7, 8, or 9 turn level is deliciously hard. I love playing them. Can lose myself for hours.

v1.0
Used py2app to make an OS X app. Used py2exe to make a very messy Windows executable with a bunch of junky windows dlls and what not.

Roadmap?
Shall use py2objc to make an iOS app. When I eventually jailbreak my phone I shall get it on there.
Should probably care about Linux. But eh, they can build from source.
Write some code that goes through ALL the combinations for all the knots and sorts them by minimum turn required. Each knot has an average of say 12 crossings, and there are 249 knots, so that’s at least 1,000,000 levels. Yes, a million.

Jesus, a million.

Game modes. Like a time limited one. Or to get to a particular configuration. Or loads more. More info when I get down to coding them.

If you’ve read this far, you’re hopefully interested in the game. So here: https://www.dropbox.com/s/buzllp03yxp6a03/Source.zip

That contains the image tiles used to generate knots, the plist containing the codes I took from Knot Atlas, and the Python script itself. You’ll need Python 2.7 installed on your computer for the script to run. Leave all the various files inside the same folder. And you’re good to go!

Do let me know what you think. If you read the source, don’t hesitate to tell me all the ways I code horribly. Must get better.


On people’s voices inside your head.

No, I don’t mean the schizophrenic kind.

I was just reading this article and halfway through it I realised I was reading it in a woman’s voice. As in, I assumed the author was female, and proceeded to have it “read out” by her. I had no basis for this assumption. She had not mentioned her gender so far. But I turned out to be right. It was a woman.

Then I got to thinking. What voice do I read other articles in? I was reading another woman’s blog earlier about her attempts at building a roguelike in Python. I knew it was a woman though, because her blog is named after her. I don’t, however, remember the voice I read it in. And I have subsequently been stymied in my attempts to “listen” to those voices on other articles because now I’m interfering with myself. Kinda like Heinsenberg uncertainty.

I would like to think I read things in my voice. And that the above is a random aberration. But. I just don’t know. The more I think about it, the murkier it gets. So.

What voices do you read with?

When you’re texting someone you’ve spoken to, do you read their texts in their voice? I know I do only when their voice is different. Like if they had a peculiar accent, or a verbal tic. A regular Indian basic accent I read in my voice.

Abrupt ending.

This was #19.


On my opinions.

Yesterday, on how everyone learns things vs how I think everyone should (mucho paraphrasing and editing):

People these days, if they want to learn something, they go buy a book. That book tells them to buy a toolbox and they do. The book then goes on in immaculate detail about the origins of each tool (screwdrivers are for screwing screws into things), where it was made (a factory in magicland), the materials used to make it (magic plastic), amusing anecdotes about their creators (“Philips was a dick!”), and so on and so forth. Twenty chapters and eight months later, you are expected to know everything about every tool you now possess.

Then what? Your door hinges broke. What do you use to fix it? A screwdriver? Which one? Or you want to build a little kennel. Where the fuck do you start? You don’t know anything about wood. Is there a book for that? Or your microwave is toast. Electrical stuff?

Knowing about those tools uses precious memory overhead that isn’t worth it in the first place. Not everyone needs the same tools. Not everyone needs more than one. It depends!

I know it sounds clich├ęd and lame to say “don’t think, just do!” or “don’t prepare, just go for it!”, but the reason it’s so often repeated is because it is in fact very good advice. There is something to be said about a bootstrap requiring a boot in the first place, though, but I digress for the boot here is the internet.

Chuck the books. They’re useless for the most part. After they introduce the bare essentials, you’re done. Anything else is just junk you need to wade through for what exactly it is that you need. And there are better ways to find what you need. Google it.

You don’t need to know shit. You don’t need to know “all the topics”. You just need to know everything about whatever it is you want to do.

Google the hell out of it. I needed a GUI module for Python to display the game on-screen (by the way, it’s going rather well). So I googled that. And I came to Tkinter. And a bunch of other things. Tkinter was inbuilt so I picked that. I didn’t know how to make an image appear onscreen. I googled that. I could make an image appear onscreen. I didn’t know how to track where the user clicks with the mouse. I googled that. I could track where the user clicks with the mouse. Repeat ad infinitum.

You should do this because you want to, because you like to, because the end result makes you happy. If you do it because you have to, because it’s an assignment that’s worth a grade, because you want to impress the people interviewing you, stop and take a long hard look at yourself. Is this really what you want to do? When you could be enjoying doing something else?

(Apologies for the suddenly sanctimonious turn that took.)

This was #18.


On clutter and clarity.

As I mentioned in my last post, I now have an extra laptop. And when it came time to put, well, stuff on it, I was pleasantly surprised by what I went with.

Xcode. Python. Inform. Pixen. LaTeX. Emacs. J. Keynote.

In other words, stuff for working on.

It is very liberating. No vlc. No flash. No torrents. No Word. No movies. No songs. (Not no iTunes though).

I don’t claim that I won’t procrastinate as a result of this. I merely bask in the utter simplicity of it all.

I should have done this a while ago.

This was #17.


On my adventures in the key of DIY

I am not a DIY person. (That’s Do-It-Yourself, if you didn’t already know). I have never actually done any work with any tools for anything ever. The only time I used screwdrivers and/or wrenches was putting one of those remote controlled Lego things together.

I can tell you precisely why I’m not a DIY person. Because I lack the confidence that I wouldn’t make a bigger mess than already present. Case in point: putting a screen protector on my phone. Horrible task. I put it on and everything was fine. Except for one teensy air bubble near the top. I tried ignoring it for four minutes. Then I went mad and let’s just say two hours later the screen protector was in no shape to be doing any screen protecting.

Which is why I surprised myself when I upgraded the RAM of an old laptop we had lying around. I ordered the memory (2 x 2 gb) from flipkart. When it arrived, I opened the bottom of the laptop (unscrewing three screws!), ejected the old RAM, vacuumed the dust out, pushed the new ones in, re-screwed everything back together, and did not brick the laptop in any way whatsoever.

I also have never installed a new operating system before. Because I always procrastinate too much about organising and then backing up all the shit I have. This was different. Old laptop. Nobody cares. I’ll do a fresh install. I downloaded the latest OS the thing could run (OS X Lion), made a bootable pen drive of it, and installed it in the newly erased old drive.

I have plans of eventually getting a tiny (60 gb) SSD to round up the speed boost. Why so little? Because of the reason why I went though all this. Xcode.

Xcode requires Lion. Lion requires 4 gb. (Well, 2, but 4 is better). That’s honestly the only reason I did any of this.

It’s a relatively banal moral. If I want something badly enough, I will do the shit it takes to get it. Now. I’m surprised that this is a surprise to me. I am also surprised that what I just described seems to be being referred to as some sort of Herculean task here. Lots of surprises.

Not Herculean in the sense of effort, of course. Herculean in the sense of it testing my confidence.

I don’t really have a point.

Good night.