Tue Aug  1 23:00:11 MET DST 2000
Ok, I start all this. I can't find the DoS version I did some years ago, so I
restart all from scratch. Anyway, it's not big stuff, not hard coding, but it's
a funny game. You should try it :) much easier than rubik's cube (I solved the
clock, but not the cube :().
Ok, let's kick some code, enough noise for now.
Wed Aug  2 00:43:28 MET DST 2000
Ok, finished the first stage of development, which is to determine the
structure of the code, of the data, and write simple .c and .h (and the
Makefile !). Of course, some more files may be needed while the coding
process goes on, but the essential is there. I now have to fill the function,
and probably add some more functions, more low-level oriented, but let me
finish to listen to Bach (suites for Cello) and then some tv, a nice (I hope)
movie tonight. I'll come back tomorrow, maybe. I am looking for a job, maybe
in computer security ? I really don't know what to chose, I like everything in
computer stuff, it's hard to choose ! Well, enough noise.

Thu Aug  3 10:22:42 MET DST 2000
Ok, let's kick some code.
Thu Aug  3 12:29:11 MET DST 2000
Ok, done some coding. colck init and drawing stuff (not finished, some bugs
because of the handling of window's size changes). Enough for today, let's go
for some food and then out to do nothing. Life is, well, boring sometimes,
especially when you look for a job, fucking society.

Sat Aug  5 00:03:41 MET DST 2000
Ok, let's kick some more code. Let's try to have clean viewing routines, so
when you change the size of the window (in a limited range), things don't
fuck up.
Sat Aug  5 01:57:25 MET DST 2000
Ok, all is drawn perfectly well. I resize with no problem. Now, well, now some
sleep after having listened to some metallica. The next time, I'll handle the
mouse movement. (As you see, it takes time to draw it all (2 hours of coding),
and there we have lotsa rounds, so lotsa cos/sin calculus to make, it's boring
but you're happy when you finish and when you see it works fine.)

Tue Aug  8 10:47:44 MET DST 2000
Ok, let's handle the mouse cursor shape, the changing of it depending of the
mouse's position.
Tue Aug  8 12:42:36 MET DST 2000
Ok, all drawned correctly, handling of buttons (there was a little bug, though
I could only use buttons[4] but had to use buttons[2][4], because it's much
easier to handle, much less code, so I win in everything, in speed (less test)
and in size becasue less code). Only thing to do is now turn_corner. I should
make a save option too, some people might not win the first time and want to
keep it as it first was. Maybe a random stuff too... Well, the funniest will
be turn_corner, but for now, well enough. Let's have some food.
Tue Aug  8 15:06:38 MET DST 2000
Ok, let's do turn_corner stuff, and it will be playable. Then maybe a release
or I attack with no break on a solver (a visual stuff, amazing I hope).
Tue Aug  8 16:12:45 MET DST 2000
O, works all fine (seems to). I had a typo bug, you know, copy/paste, button1
remains button1 instead of becoming button2... The code has became strange,
because turn_face gave incorrect result on the other side, so we had to add
some post stuff (see turn_corner in clock.c), thus making me feel strange about
it all. A function that is not correct... but I keep it in the code ! with just
some post-hack. Really bad practice I think, but I guess that's how things go.
Damned, even with programming we do incorrect things to get correct result,
really annoying. The world has been crushed down ! (le monde vient de
s'crouler !).
Here are the stats for the code :
maison:~/c/games/rubix_clock$ wc -l *.[ch] Makefile
    190 clock.c
     56 clock.h
     87 event.c
     57 event.h
     50 main.c
    326 screen.c
     66 screen.h
     14 version.h
     40 Makefile
    886 total
886 lines of code. Not too much, huh ? Well, now I will have to add a randomizer
for the starting of the game and a saver at the end, so a loader too. Will make
it handling human readable files, thus will have to handle errors perfectly
well, thus I'll need setjmp, longjmp, but for today enough code, let's go out
for some time, will you ?

Wed Aug  9 10:57:43 MET DST 2000
Ok, well, it was a bug ! turn_corner is wrong. Let me explain. When you turn
a clock, the other corner's clocks do turn if the corresponding button is in
the same state as the one of the clock turned. I though (because it's been a
long time since I did not play with Rubik's clock, maybe 8 years or so or
even more, don't remember) it was only if the button was pushed too. Well, I
guess now turn_corner will be nice. Damned.
Wed Aug  9 11:23:55 MET DST 2000
Ok, seems to work. Now, what to do ? a randomizer at starting time.
Wed Aug  9 11:43:36 MET DST 2000
Ok, randomized, I played a bit with it, I had forgotten 1 step in the
strategy, but came back very quick. Will do some key-cuts, it's annoying to
have to use the mouse at every place. To turn face, will be 't', buttons
will be '1'...'4'. For the clocks don't know yet. Maybe it's not a big
trouble not to have key-cuts for clocks, huh ?
Wed Aug  9 11:58:55 MET DST 2000
Ok, keys handled. How to turn the clocks with the keyboard ? Hum... hard stuff
to imagine...
Wed Aug  9 12:00:57 MET DST 2000
Ok, found something. We will have some memory. By pushing e, r, d or f (look
at your keyboard to see those keys look like a sqaure) you select a corner.
Then, left or right key to turn. Cool, eh ? Yep, ultra-cool. Now, will have to
put a visual stuff to let the user know where he is. Ok, let's do it.
Wed Aug  9 12:45:52 MET DST 2000
Ok, done some more key-cuts, displays the little red stuff to tell where we
are. Perfect. A bit tricky to use, I guess most of people will use mouse, but
well, I want speed, and mouse is hard to use for me... Well, what about 'F2'
to reset the clock and 'F3' to randomize it, huh ? 'F1' will be used in the
future to auto-solve the clock. It will be visual and amazing, woo woo.
Wed Aug  9 12:57:45 MET DST 2000
Ok, it's done. Well, now I should handle a save-stuff, nope ? Well, will have
some food now, will you ?

Wed Aug  9 22:35:50 MET DST 2000
Ok, let's continue. What has to be done ?
1 - add up/down key-cuts to move the little red stuff
2 - change the randomizer (we don't have to play 10000 times to have some
randomness, we can set the values to the clocks directly, then adjust the
corner clocks of both sides, I am sure of it, I know this game well)
3 - add a autoload/autosave stuff
4 - a solver (it won't be included in the release version, because I want
to know if people can solve the clock with this program, as I didn't
because I solved it long time ago, in the real world)
Let's go for point 1.
Wed Aug  9 22:45:44 MET DST 2000
point 1 done. point 2 now.
Wed Aug  9 22:52:37 MET DST 2000
ok, point 2 done. Have to add another point that's I'll do very quickly now
(2s or so). Add 'space' to turn the clock. 22:53:42, done (add to write the
previous sentence, thus 1m instead of 2s. Now, point 3, longer stuff.
Wed Aug  9 23:13:28 MET DST 2000
save done, easy stuff, except I don't check return values of fprintf, which is
bad practice but it's said to return the nb of chars written, which I don't
like (but I know the value, I could check, but lotsa strlen, well, no care,
hope the fclose will return errors fi therre are some, for example "no space
left on device"). Now load, hardest stuff, because have to check if all is
good while loading, check bad files...
Wed Aug  9 23:36:10 MET DST 2000
Ok, well loader was not so hard to code, seems correct, except I just found I
forgot to check if corner clocks are ok and if clock values are right in 0-11
range... ok, let's check it.
Wed Aug  9 23:53:34 MET DST 2000
ok, done. Add a little bug when I compared the corners (I do a x != 12 - y but
if x == y == 0, I will be ok, but the test will be wrong, so have to deal with
modulo, damned, will I make a free bug program one day ?) (I had another bug
corrected previously, in the loader I had bad brackets in my second double
for, it was for the i as it should have been for the j, damned. How many bugs
remain in there ? Wooo, terrible question, the question every coder has
nightmares with ! Well, everything seems alright. I can make a release now,
I guess, nope ? Will have to write a web page, some scans to do now. Ok, let's
do it. For the solver, I'll do it another day and anyway it won't be in the
release because I want to know if people can solve this with the program
without knowing an algorithm. Let's go. This NOISE file is not very noisy,
is it ? I don't talk about myself or anything, damned...

Sun Aug 13 16:24:26 MET DST 2000
Ok, starting the 2.0.0 release. Gotta change the version (extremely hard
stuff !) then make a solver (easy stuff, but maybe a bit long). First, I will
implement the solver, then a realtime viewer (it should be amazing). Let's go.
Sun Aug 13 17:53:48 MET DST 2000
Ok, the solver is done. The only thing that could be better is to turn in the
best direction (because if you have to make 1 move in one direction and 11 in
the other one, it's better to make onlu 1, but the solver turns in only one
direction, always the same, so its very possible for it to make 11 moves). Have
to handle the mouse now, to let it move through the clock in realtime, so the
user being amazed. Badly, the strategy used is always the same (it's an
algorithm in fact), so the user won't be amazed too much, but the first time
(and maybe the second, the third) she will be amazed. The solver is full of
comments, clean code (I think), so anyone should understand it clearly, I
think. But enough noise for today. Let's have a bath, some food, and lotsa tv
for my brain to be washed.

Mon Aug 14 15:56:08 MET DST 2000
Ok. The movie to the tv was a Rohmer's one, not bad, nice little movie,
"Pauline  la plage". Ok, let's finish it. Let's handle the mouse pointer !
Mon Aug 14 17:57:52 MET DST 2000
Ok, works fine, except the event handling stuff is totally doomed and I can't
stop the solver, which is bad. I can see there are some "bugs" too, some buttons
are pushed uselessly sometimes, should solve this. Now, will handle the
"shortest move" stuff, ie not turning in only one direction, but the closest
one.
Mon Aug 14 18:05:21 MET DST 2000
Ok, did a :
  if ((current_hour - wanted_hour+12)%12 > 6)
    ev.which++;
Hope it's alright. semms to be. It means that we differ from more than 6
hours in one direction, we should take the other one. But when you read it, do
you understand that ? Isn't it the magic of coding ? to write something
absolutly different from what it means. It's really really strange, no ?
Extremely hardcore coding... hehe. And go read the bezier stuff. If you never
heard about Bezier, you won't understand a shit ! Damned, I put some meaning
in one program, but this meaning is absolutly destroyed by the langage used,
unless you already know what it's all about (thus, you don't need to hear what
I say to you). So the conclusion is that C is not a good langage, in that it
does not transmit meaning in an understandable shape (understandable means here
that you get some new information you then can handle like the source of the
information, plus or minus some very little variations, because of course we
all are unique and we do stuff uniquely, but not too much, because we work all
the same, or almost). But in fact, C is not exactly useless, because when I
read some C code, I then can reuse, rewrite this code, so a meaning passed
anyway, even if it's not where we suppose it to be (I learn a way to use C that
someone else gives me, but if the person does not explain the meaning of the
code, it will be absolutly useless to me). Well, hope I'm clear. Anyway, all
this is good for a discussion about meanings of things, how you can transmit
meanings, the nature of meanings. Absolutly hardcore philosophy stuff, but
that's the point to talk about it in there, is it ? Well, maybe. It's a NOISE
file, after all, isn't it ? Well, enough noise. The program could be finished
now, but I don't like the way the solver works. I should handle events cleanly,
so I'll have to add a state to the game, the "solving" state, by opposition to
the "normal" state, which was implicitly the current one. So, I will have to
modify some code here and there, nope ? Well, not today, tomorrow, which is
a catholic day, because they take days to handle their religion's stuff. If I
want to take days to handle something, what the hack will go on ? All this is
a question of power, of strength. If you're strong enough to impose your will
to others, you do what want, otherwise fuck you. But do we have to behave like
this ? Will we bahve like this till the end of time, or the end of humanity ?
Well, well, well, I don't like this, so well, what to do ? Mmm, don't know...
But enough noise (real noise for once, hehe).

Wed Aug 16 23:43:47 MET DST 2000
Ok. Well, maybe the last time I code for this program if I am fast enough
(and there is no reason for me to be slow, or ?). So, what to do ? First, we
must change the event handler. Let's go.
Thu Aug 17 01:31:55 MET DST 2000
Ok, semms to work. Lotsa modification, lotsa states for both clock and event.
I need to make the difference between machine and user for the generator of an
event. I need to make the difference between 4 modes for the clock. The code is
far from perfect, it's hacked everywhere, I'm not happy of myself. Well, well,
well, will have to think a bit about it all and clean stuff, if I get the time
and if I get the will. But now, let's modify the solver for it to push buttons
only when absolutly necessary. Ah, oh, I forgot to say I now use a setjmp /
longjmp stuff, really cool.
Thu Aug 17 02:08:07 MET DST 2000
Ok, all is done. Seems to work fine. What to do now ? Well, I think about some
sound, because my design is so clean I could add it very easily, but, well, I
don't know... What sort of sound to put in there, huh ?
02:21 : ok, well, removed two static local vars, bad I liked it ! :) but it
gave bad visual results. Ok, well, did I tell how I realized the solver was
wrong ? Did I tell I debugged it because I _saw_ it being wrong ? So, well, all
this just to say I did not realize when I coded the stuff that things were wrong
(remember, too much button moves). So, well, I don't really remember what I
wanted to write about it, maybe it's because it's late or something... Well, all
this to say a debugger is not only something that traces code but can be
anything that gives quickly understandable informations. For example, I saw my
strategy to be wrong only at running time, by viewing the mouse pointer moving
around the clocks and buttons. I did not realize it by reading the code. So, the
code is not all. When you code, if you only read your code, you can think all is
alright, when in fact you have bugs in there. Damned, it fucks my head up to
think that ! How to make a clean program, huh ? Are there methods or something ?
When I see all those programs full of bugs, when I see that even people with
extremly hardcore testing procedures like people of Ariane and still making
bugs, and very dangerous ones, well, I think all this is horrible and terrific.
Free bug programs don't exist, do they ? Hum... damned... in rubiclox, there
surely is bug, hiding, waiting for something to handle bad to show itself up
to the ligth ! argh ! Well, let's have some sleep, I'm fuckingly tired. Did I
tell (no, I didn't) that I will make a thesis, maybe ? Something to do with
security over a virtual virtual machine, prove stuff and the like. Absolutly
crazy stuff, believe me ! Well, maybe. We'll see that tomorrow. I'm excited,
just thinking of it ! Ok, let's go to bed, will you ? Enough noise...

Sat Dec 23 02:22:58 MET 2000
Ok, in some hours, I'll release it, at last. Well, well, well, life sux, but
that's not the point. I won't bother you with my problems. I don't understand
women, I'll never do, anyway no much more time to live, well fuck this NOISE.
