Sunday, November 23, 2008

The Hardest Logic Puzzle on Earth

Well first of you may have noticed (if you use I.E.) that the layout has changed drastically and is almost completely free of bugs. I have also lost all respect for Microsoft and am considering to create a website just to combat them. I am just so sick of them...

On a happier note I was being bored again and surfing through the net I found this: http://philosophy.hku.hk/think/logic/hardest.php. It's a very interesting website and I advise you to read through it if you haven't finished a course on Psychology and Critical Thinking yet. The website states that George Boolos states that this is the most difficult logical puzzle on earth:

Three gods A , B , and C are called, in some order, True, False, and Random. True always speaks truly, False always speaks falsely, but whether Random speaks truly or falsely is a completely random matter. Your task is to determine the identities of A , B , and C by asking three yes-no questions; each question must be put to exactly one god. The gods understand English, but will answer in their own language, in which the words for yes and no are “da” and “ja”, in some order. You do not know which word means which.
I thought I might give it a try.

First of I Organised My Data:
  • 3 Gods: A,B,C
  • True Names of 3 Gods: True, False, Random
  • I can ask 3 true and false questions.
  • The response is either da/ja which means either yes/no.

After that I used one of my favorite computer algorithms; Brute Force =)
I calculated all of the possible answers to the puzzle:


So once I knew the 6 different answers I couldn't do anything more on that part of the puzzle but wonder if it was even something useful I had done.

I moved on to another part of the puzzle: The Questions.
I would have to ask 3 true and false questions to find out which of the 6 answers was the correct one. Not only would I have to consider the questions I would ask but also to which God I would ask them to.

Lets look closer at "True and False Questions". The question would have to be answered by yes or no (da/ja). The types of "True and False Questions" I could think of are listed below:
  1. Asks weather dogs are animals (true)
  2. Asks weather dogs are stones (false)
Upon further thinking I also thought of these more personal questions:
  1. Asks: Are you True/False/Random
  2. Asks opposite of 1-3
  3. Asks: Are you "Insert a Double Combination of Questions 1-3"
  4. Asks opposite of 5
I wasn't really sure if the first pair of questions or the latter bunch of questions would help me more so I just wrote both down. I would probably have to ask a correct combination of the above questions to find out what da/ja meant. Once I know what da/ja means I probably could find out with ease which god lied and which one didn't, I'm not sure about the Random god yet.

Lets apply the Brute Force Method Again:
  • The different Questions I could ask is: 2+3+3+3+3=14
  • The amount of Questions I could ask is: 3 (given)
  • The number of Responses I could get is: 2 (da/ja)
The Total Different Routes I Could Take or be Chosen to Take: 14*3*2=84
I'm pretty much stuck there. I will analyse the routes more carefully in the Next Post and I hope I'll get a result.

Monday, November 17, 2008

Fighting Boredom

I'm not getting anything done lately since I'm very bored. I'm not so sure yet why I feel like doing nothing all day lately but I'm sure it's a severe case of boredom. I don't think it's laziness since I don't feel like doing fun stuff either, things like programming or writing random stuff are normally things I like to do but lately I just don't feel like doing them. I think I got bored by these things because they don't provide a challenge any more. Of course programming takes a lot of time and is something hard to do but I have the blueprints of how I'm going to do everything I want to do in my mind and there are no obstacles standing in my way. Except time of course, but that's not really an obstacle since I have more than enough of it. I hope I'll get over this total lack of enthusiasm soon.

Since I'm not going to get anything done due to boredom I've decided to make a list which I have to follow. Excuses about boredom are not accepted.

List:
- Make website Internet Explorer Capable
- Finish of Website Layout
- Create Help Files for my Website
- Add my E-Mail address and the likes under "Contact"
- Add one Game under "Games"
- Finish of Current Content
- Think of more ways to use up time:
- Maybe get Traffic?
- Put on more games?
- Create an Article Section?

Monday, November 3, 2008

Finally Website!

I have finally gotten a website: http://www.zirconcode.com/
This Blog will be integrated into that site but will still be available under: http://devediary.blogspot.com/

I'm currently just trying to get this site to work. For best results view it in Firefox (3 or above?). I'll get this site to look good for funnier browsers like IE too but that has to wait until I got everything set up.

The Site currently has the following categories:
Home = A Welcome Message + News Blog (this one)
Applications & Games = Anything Java for Computer Illiterate (it's also longer)
Help! = ...
Contact = a non-private e-mail and maybe comments?

I may be adding a forum later once I get more than about 350 hits a year =).
Also I'm not quite sure if I should add an "Articles" section (with polished blogposts, ex. Triangle Interpolation) but it would probably boost my hit counter.

On a more Boring note (location,location,location...):
Let me explain in a monotonous voice how I stumbled on the name ZirconCode because I know that you are just burning to know =/.
Well first I thought something with "Source" or "Code" or similar would be nice. Then I thought that maybe I could add some colour prefix like "red" or "blue" but for various reasons it didn't sound so good... (really, trust me)
Then I thought instead of colours I could add a precious metal like "diamond" or "ruby" or "gold" or "titanium" or...
Well I somehow ended up at ZirconCode and as it was the first name I came up with which wasn't taken I took it =).

Tuesday, August 26, 2008

Introduction to HTML

I'm really sorry but blogger just sucks with code. It removes any HTML tag I write and puts a blank in it's place. I can't write a tutorial without giving examples. Sorry.
I'll try to fix this problem as soon as possible.

...

edit: there seems to be no solution yet for blogger (only for blogger-draft). Even more of a reason to create my own website and host my blog there.

I have saved this post in .txt file and as soon as I complete my website I will post it.

Have Faith =)

Saturday, August 23, 2008

Splitting your Website Layout

Unfortunately we can't just tell the browser to take our little image and make a fully fledged website out of it. We have to tell him how to. To do this we first have to split our layout into boxes as the website will then be orderly and easy to realify.

Here's how I did it:

the website will have to be split so that each box can be represented by a box with the following attributes:
  • height (percent of screen/pixels/font size)
  • width (see above)
  • background color (any color represented by hex)
  • background image (any size and anywhere)
  • text or other content (tables/lists/links in any form of presentation)
Remember, keep the boxes to a minimum but still use enough of them to be able to produce neat code. A box for the header may include two other boxes, one for the title and one for a company logo or an add or something similar. Then you will need a box for the content (only one). Last but not least you will need a box for the footer which will display copyright information and the like. If you wrap all your boxes into one main box it will be easier to center ALL of the content. You can of course use one or two more boxes if you like, for example for an advertisement or new bar. All in all you should have 3-7 boxes.

Next we will start coding...
Bye...

Designing a Website Layout

The next step in creating a website is to draw up a quick sketch of how it's supposed to look like when finished. Later you will have to worry about how to realify your image but now let your artist sense roam free. If you have more than one idea go ahead and sketch them all, it's always good to have a backup plan. For designing the website you can use any simple painting program, it doesn't have to look good, remember, this is just so you know how your layout will have to be written. You could even use our trusty friend old pencil and paper.

So I've gone ahead and done 2 quick sketches in bitmap:

remember this sketch is designed for me by me (which means it's encoded in maniacode) but I'm going to explain it to you anyway. The bblahblah part is the text the user is viewing, this can be a game too or pictures. The scribble to the right of it is supposed to be a scroll bar (don't laugh). The title (at the top) is the title of the document the user is viewing. The red scribble in the top left corner is my company logo (it signalizes uniqueness and creativity). The curvy blue/purple/light-blue lines are going to look shiny and clear like plasma/water tentacles. The menu is the black scribbles below my great company logo.

Here's my second sketch:

I'm not going to explain this one, it's readable by average maniacs so yeah...

When drawing your sketches put yourself in your viewers shoes. Would you find it accessible? Interesting on first sight? Neat? Ugly? Too Pretty? Too Colorized? Too Bland? Take special care that he finds what he's searching for quickly without any hassle.

The next post will be about splitting up your image into boxes as those are easier to represent in CSS/HTML,

Until Then... Bye

Wednesday, August 20, 2008

Website Outline

The first thing I do is always to think and create an outline. The outline doesn't have to be the final outcome, just a rough draft so you now what you want.

My outline looks like this:

-Website
--Name
---Unknown (will think of later)
--Content
---Home
----Welcome message with blog below that
---Java
----Games
----Applications
---Contact
----Contact formula not showing my e-mail address (due to security reasons)
---About? (maybe...)
--Style of Website
---Either
----Dark background with light text (cool)
-----black background with almost white text
----Very Light background with dark text (clean)
-----Blue tones and white and maybe mix in some purple

those colors just randomly came to my mind because i think they fit nicely together:
dark theme (cool): lllllllllllllllllllllllllllllllllllllllllllllllllllllll
light theme (clean): lllllllllllllllllllllllllllllllllllllllllllllllllllllll

Color picking can be a very big deal but for my purpose I don't need to know what every color represents and stuff like that's since it will be a rather small website at the beginning. When the hit-count picked up some speed I might post about picking correct colors for correct occasions but that's going to take some (long) while unfortunately.

Well, the outline is finished and now I have to think about how I will accomplish my goals...

Tuesday, August 19, 2008

Im Back

I'm back from the holidays. It took me quite a while (eight weeks) to meet all my friends again in Germany and Switzerland (I'm currently living in japan). I went to a sea in the middle of the woods in Germany, it's very beautiful out there. I saw my grand-parents (all four are still living). I ate tons of pudding and Swiss chocolate. I saw a gigantic digital billboard at a train station displaying a blue screen. I took the airplane twice and ate really bad food. Unfortunately I didn't have Internet access during that time so I couldn't post (that really sucked). Did I mention that the airplane food sucks?

Anyhow, I've decided to pause my development from my 3D engine and create myself a website. I really need one to post my Java apps/games and I'll add this blog to my website too (if I can). The website will also contain a contact formula (not showing my e-mail address). Later on, when there are more visitor I'm hoping to add a forum and an account-system which saves your game high scores and the like.

That's it for today...

Tuesday, June 24, 2008

Going on Holidays

Yeah, I'm going to switzerland for about 6-8 weeks or so I'm not gonna post anything during that time. I'm in a rush right now, have to pack this and that....

btw: I hate Flying

Wednesday, June 18, 2008

Fog and Field of Vision

I've implemented some simple fog and field of vision.

Here's a picture:
The red line represents the end of the map. Now the map could go on almost infinitely so it's important that we stop drawing at some distance. This distance is the field of vision and is represented in the following image as a blue line.

To implement field of vision simply do a check:

Blogger is messing up my code, Trying to fix it soon

if((a.z+b.z+c.z)/3 <>
where a, b and c are the 3 vertices of the triangle.
This doesn't look quite so good so we try to blend it out with fog:

The green line represents the FogDistance, this is so that the fog doesn't start right in front of our eyes. That could get annoying, but sometimes it is wanted so just set the distance to 1 when needed. We simply add a little bit more black each time the triangle gets farther away from FogDistance:


Blogger is messing up my code, Trying to fix it soon

int r,b,g; // Color values of triangle

if((a.z+b.z+c.z)/3 > FogDistance) // Check if greater than distance
{
// Make Darker by distance to fogdistance*fogintensity
r = r-(FogIntensity*a.z+b.z+c.z)/3-FogDistance);
b = b-(FogIntensity*a.z+b.z+c.z)/3-FogDistance);
g = g-(FogIntensity*a.z+b.z+c.z)/3-FogDistance);
}
// Very important check if color values are acceptable:
if(r > 255) r = 255;
if(r < r =" 0;"> 255) b = 255;
if(b < b =" 0;"> 255) g = 255;
if(g < g =" 0">


int r,b,g // Color values of triangle
if((a.z+b.z+c.z)/3 > FogDistance) // Check if greater than distance
{
// Make Darker by distance to fogdistance*fogintensity
r-(FogIntensity*a.z+b.z+c.z)/3-FogDistance);
b-(FogIntensity*a.z+b.z+c.z)/3-FogDistance);
g-(FogIntensity*a.z+b.z+c.z)/3-FogDistance);
}
// Very important check if color values are acceptable:
if(r > 255) r = 255;
if(r < r =" 0;"> if(b > 255) b = 255;
if(b < b =" 0;"> if(g > 255) g = 255;
if(g < g =" 0;">



FogIntensity should be very small, just try it out. Something like: 0.0001

That's it for today, I'll hopefully implement colors next.