Monday, May 13, 2013

First steps towards maze designing

I decided to go with a graph data structure(adjacency list) to build a rectangular maze. The maze would be designed in a fashion that the vertices would be the nodes of the path and the edges between the vertices would be positions where walls can be inserted.

I maintain a list of vertices with each vertex data structure having an array list of edges. An edge data structure would consist of two vertices.

Once I fill in my data structure, I start building the maze. Oh, I also need a stack for backtracking if required and also an array to check if a vertex is visited. From the start vertex, I pick a random neighbour which is unvisited and move to it after labelling the initial vertex as visited. I keep moving until I hit a position where are there are 1) no unvisited neighbours available or 2) I reach the destination. If 1, then I use my stack and back track.

The challenge now remains with drawing the randomly built maze.

Monday, May 06, 2013

The long seasons

I waited. I waited till I was provided. And then, I waited. I would observe a struggle to come out of a cocoon, a peck on bugs to enjoy a happy meal.  I had my own patch of earth and I was proud of it. 

I would be lying if I said I never wanted to know more about life. I wanted to know how I could grow, how I could improve, I wondered what sort of knowledge my ancestors held and if the knowledge was transferred. I often basked in the sun, making my food and thinking about life. I wondered if I had a specific function in life. I wondered if there were emotions that I could unravel. At times, I would feel thirsty.

I could feel movement with light. Sometimes, movement without it too. A good day would go by when I would just keep thinking. Sometimes, I would be bitten into, leaving me injured. I would wonder if there are others like me. Others who could grow, others who could compete. And then, I would wonder if I could live up to them if there was competition.

Slowly, the light faded. It stopped coming as it used to. I hoped that things would be the same again, but reality stood steadily defiant against my hope. Slowly, I started getting thinner and thinner. I was waging a losing war. I tried hard, I tried to somehow make light, but I could not. I remember the day I thought would be the last. The day after which I do not remember for a while. And then, when I woke, there was light. I slowly felt the familiar heat, I loved.

I knew I could grow now. I tried to make the best of a positive verve. It was great till it lasted. I was delighted and made no attempt to hide my delight as I dressed in my best colours. Colours which would often be stolen away.
And then, the light and the heat started burning me. There was never enough water to quench my thirst as I was sapped. This time I knew it was the end. I waited, as slowly, all my vitals stopped. I waited and thought if there were more.

-----------------------------------------------------------------------------------------------------------------------------
The plants are dying.