Friday, March 24, 2006

possible solution steps

1. one vertical text area/ div to reflect the history
2. one text box fro the object, pulldown for the commands and another text box for args
3. one div for the puzzle


the puzzle is as follows
generate an NXN array of divs each with a unique i,j id.

genearte 2n divs for the row and col identifier tabs..
and n more divs for the block identifier tabs

clicking on any div will add its id to the object text box
except when super seded. ie if you select a cell and a row containing that cell, the cell handle is removed and the row handle is added.

more later..

Wednesday, March 22, 2006

requirements for my NXN puzzle

1. this is a simple sudoku to start with.. here are the requirements..

1. allows user to pick N
2. display cells in a partitioned grid.
3. allow choice of difficulty of puzzle
4. allow pencil marks,
when a probable is crossed out, it should disappear from that cell.
5. the cells themselves are only for display, the actual method to affect the contents of a cell is to type a command in a text box,

to give an idea here is the layout i have in mind.
top left, the sudoku puzzle grid
in a wide text box right under it, [ infact three , one for the objects , one for the command, one for the arguments ]. the user enters text,
objects can be selected with teh mouse[ example, specific cells]
commands set or unset cells with values, add or remove pencil marks etc..

this would give a very interesting set of programs to solve a given puzzle.
the competetion is to turn in the best program for a given puzzle. different metrics for the program could be used , least number of instructions for example.

example : foreach(s[1,1], s[1,3], s[1,5]) r1.remove_pencil_marks_complement( 1,3,6)
would remove the pencil marks from all the cells in r1 except those specified in the objects section.

im sure over time the language and the interface can improve.

so now on to designing soem cool apps that do this:) ; oh and by the way if you want to implement this , go right ahead.. you can discuss with me at sriram dote durbha ate gmail
cheers
ram

Friday, January 06, 2006

RoR 101

for a very simple app without a database here is how to start..
  1. name your controller say word
  2. in config/routes.rb map.index '', :controller => "word"
  3. in app/controllers create a new file called word_controller.rb and put a ruby class called WordController.
  4. in app/views createa folder called word.
  5. in app/views/word create a file called index.rhtml
  6. in rename public/index.rhtml to old-index.rhtml
thats enough to get started . and have a lot of fun

now run script/server
even if it complains that it cannot connect to a database just proceed and start it [ this happens if you are using radrails, and i suggest you use radrails ]

now if you point your browser to http://127.0.0.1:3000/ and press enter
you will see that what ever you put in the file app/views/word/index.rhtml is rendered :)

Tuesday, January 03, 2006

A Rosy Picture

have you ever played the game "petals of the rose" ?
my first run in with rails was like a bigger version of that game,
it took me a wile to figure out what was actually happening.
but once i did get my head around it, i started liking rails little by little.

yesterday i spent about 50 odd minutes to create a site, and that includes discussion with the client/partner !!

however, i still think i need another month or so, to trudge thru the API before i feel comfortable enough. yesterday i was telling some one that if i could do this site in perl or java servlets/jsp.. i could have finished it pretty fast.. today i realise that that thought was what was holding me back.

i was constatnly trying to think in terms of the reqest and response .. when i last dabled in website development, i used to parse each request and construct a response. well now you just put your resoonse in a place, and it gets picked up. so all you have to know is what to name stuff..

in my next post i will write a short summary that should help any one get uptospeed with rails.
cheers
ram

Sunday, January 01, 2006

ground zero

hi all,
in this blog i will write mynotes about rails as i go ahead, i hope to engage in some discussion thru hte comments or on irc://irc.freenode.net/#rubyonrails .

please note that i dont have any particular affinity or adversity towards any tool kit/framework . so kindly no flames please. im just trying to learn to make web apps, to bring my ideas and those of others who ask me ot make a webapp for them to implementation . i really dotn care what tool or language is underneath. right now im toying with rubyonrails.i played around for a day with django
so my irc handle is new2django , i dont want to change it, for whatever reason. so when i say something comparing the both, kindly dont asusme that im one side or the other. im on neither!!

to start with, ill give a small note on my first observations in the next post.
if you want me to do post on any topic of interest or use to you, by all means plese do ask me either on irc or in teh commetns section of this blog.
thanks cheers
ram