Sunday, April 27, 2014

Introduction

Thank you, everyone, for reading my blog. I look forward to perusing yours, and I hope you find an equal interest in mine.

There are two riddles on this blog. Why are there only two on a blog entitled "Three HTML Riddles by Adam Cleri? I did create three, and intended to display all of them. The first two riddles I composed are classic riddles, clearly stated, requiring challenging but reasonable coding skills. The third looked like a PC got into a fist fight with a Mac.

Nevertheless, I deliver two quality riddles, a set of hints for both and their answers. All riddles, hints and answers are written in HTML code. You can run any of the code found in this blog, as well as your answers, by copying and pasting them on the following link. I will place this link on every post in this blog.

W3Schools CodeConverter

This website can also answer questions on various skills. I will post links to specific skills where relevant, but you can view any of them at HTMLTutorial.

For the greatest HTML-building exercise, also attempt the Challenge located at the end of each riddle's code.


Happy sleuthing!

P.S. Please ignore the stated dates and times of publication. I needed to change this information to order these posts appropriately. For reference purposes, the entire blog was posted between 25 April and 27 April.

Riddle 1: A Visit to Saint Ives

Here it is, everyone, this is your first HTML puzzle, which tests your knowledge of paragraphs and line breaks.

For more on paragraphs and line breaks, please visit here

To convert this code, copy and paste it into the reader at W3Schools CodeConverter. You can also test and debug your answer code at this link.

For some helpful hints, see Riddle 1, Hint.

<!DOCTYPE html>
<html>

<head>
<title> A Visit to Saint Ives </title>
<meta name="description" content="This puzzle utilizes paragraph and line breaks">
</head>

<body>

<h1> A Visit to Saint Ives </h1>
<h2> This puzzle utilizes paragraphs and line breaks </h2>

<p>As I was going to Saint Ives,
<br>I met a man with seven wives. </p>
<p>These seven wives had seven sacks,
<br>those seven sacks had seven cats,
<br>those seven cats had seven kittens. </p>

<p>Kittens, cats, sacks and wives--
<br>how many were going to Saint Ives?</p>

<p><b>Challenge:</b>
<br>Define your answer as a paragraph.
<br>Then, have at least one line break.
<br>Use this code as a model, or visit here for more examples</p>
</body>
</html>

Riddle 1, Hint

For the riddle itself, I advise that you do not try counting all of those kittens! Otherwise, see below for help on spacing.

You can check your answer with mine, after you give it a test run on W3Schools CodeConverter.


<!DOCTYPE>
<html>

<head>
<title> A Visit to Saint Ives Hint </title>
</head>

<body>
<h1>A Visit to Saint Ives, Hint</h1>
<h2>How to make paragraphs and line breaks</h2>

<p>Begin a paragraph and end a paragraph with the p and /p tags. </p>
<p>To begin a new line in the same paragraph,
<br>use the "br" tag.
<br>Note that the br tag does not have a closing tag,
<br>even though the paragraph ends with a /p. </p>

<p>Also, remember that only what is inside the "body" tags will appear on the website.
<br>As in this code, what appears inbetween the "head" tags is not published on the website.
<br>The elements in the "head" section of an HTML code will be the subject of Puzzle 2. </p>
</body>

</html>

Riddle 1, Answer

This riddle poses many questions: Isn't polygamy illegal? Does anyone ever tell these so-called "Wives" to not "let the cat out the bag?" And how they feel about that?
Though some questions may never be answered, I hope that line spacing in HTML is no longer a mystery to you. If you are still working out the kinks in your code, please visit W3Schools CodeConverter.

<!DOCTYPE>
<head>
<title>How many were going to Saint Ives, the answer</title>
</head>

<body>
<h1>A Visit to Saint Ives, Answer</h1>
<p>The mischievious narrator of this puzzle starts this riddle saying, "As I was going to St. Ives." Therefore, he and only he was bound for St. Ives. Everyone else in this riddle was heading in the other direction.
<br>With no felines or sack-carrying women approaching St. Ives, the correct answer is zero.
<br>However, one is also an acceptable answer, if you want to stress that there is, indeed, a single person going to St. Ives.
</p>

<p>Note: If anyone out there did actually sum the kittens, cats, sacks and wives, you should have computed 2800.
<br>If you found this answer, congratulations: you are as good at math as riddle solving.</p>

Riddle 2: The Doctor Riddle

We are now on to Puzzle number 2. You will need to use your head on this one to complete the Challenge.
You might also want to visit the Hints page for this puzzle, where you will find comments describing the metadata in the head.

To code your answer, you may need to check your work at W3Schools CodeConverter or learn a little bit more about the head section.

Good luck!

<!DOCTYPE>

<html>


<head>

<title>The Wrong Doctor, relatively speaking</title>

<meta name="keywords" content="riddle, doctor, gender roles">


<meta name= "description" content="What parent is not this child's father?">

<meta name ="author" content="Adam Cleri"
</head>

<body>
<h1>The Doctor Riddle</h1>
<h2>This riddle elaborates on the "head" section of an HTML code.</h2>
<p>A father and his son end up in a horrific car accident, and are immediately rushed to two separate hospitals.
<br>When the boy arrives to the emergency room, the doctor says, "I cannot treat this boy, he is my son."
<br><br>How is this possible? </p>
<p><b>Challenge:</b>
<br>Include the following in your the head of your HTML code:
<br>keywords
<br>a description
<br>your name as the author.</p>



</body>

</html>

Riddle 2, Hint

This riddle is all about metadata, a cornerstone concept in this course. In the head of this code, a handful of metadata are defined in comments, for example <!--This is a comment--> Note that comments do not effect the code, and never appear in the output, even when they are in the body, as below.

Test your code at W3Schools CodeConverter, and then compare it to the answer.

For more on comments, click here.

Warning! Do not confuse the head section of a code with the "headings." The heading contents are listed between <h1> and </h1>, <h2> and </h2>, and so on. For example, <h1>The Doctor Riddle</h1> is a heading. Search engines take headings into account when selecting websites. For more information, see headings.


<!DOCTYPE>


<html>




<head>



<title>The Wrong Doctor, relatively speaking</title>



<meta name="keywords" content="riddle, doctor, gender roles">


<!--The content of "keywords" are the words that will connect your webpage to a search engine.-->



<meta name= "description" content="What parent is not this child's father?">
<!--Describes the webpage-->

<!--Other metadata-->
<meta name ="author" content="Adam Cleri"

</head>



<body>
<!--Except for this comment, the body portion of HTML code, unlike the head, is produced in the final composition.

<h1>The Doctor Riddle</h1>
<h2>This riddle elaborates on the "head" section of an HTML code.</h2>

<p>A father and his son end up in a horrific car accident, and are immediately rushed to two separate hospitals.
<br>When the boy arrives to the emergency room, the doctor says, "I cannot treat this boy, he is my son."
<br><br>How is this possible? </p>

<p><b>Challenge:</b>
<br>Include the following in your the head of your HTML code:
<br>keywords
<br>a description
<br>your name as the author.</p>







</body>


</html>

Saturday, April 26, 2014

Riddle 2, Answer

If you have a reply, compare it to my answer. If you cannot fathom a guess, take solace in my comment at the end of the code. Remember, comments take the form of <!--I do not appear in the final product--> and they do not effect the code or get presented in the composition.

You can test my response, and yours as well, at W3Schools CodeConverter.


<!DOCTYPE>

<html>

<head>

<meta name="keywords" content="answer, riddle 2, mother."

<meta name="description" content="A riddle about gender roles, hinging on subtle societal chauvanism."

<meta name="author" content="Adam Cleri."


</head>

<body>

<h1>The Doctor Riddle Answer</h1>

<p>The doctor is the child's mother.</p>

<!--If this riddle stumped you, do not worry, you are in good company. After admitting I could not answer it, the person who presented the riddle told me that, in one class, 90% of kindergardeners answered the problem correctly. For my ego's sake, I hope this is just a rumor.-->

</html>