Guest User

T6 Case Problem 2: The Japanese Puzzle Factory

a guest
Apr 4th, 2019
9,426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.42 KB | None | 0 0
  1. Summary
  2. The Japanese Puzzle Factory: Rebecca Peretz has a passion for riddles and puzzles. Her favorites are the Japanese logic puzzles that have become very popular in recent years. Rebecca and a few of her friends have begun work on a new website called The Japanese Puzzle Factory where they plan to create and distribute Japanese-style puzzles. Eventually, the JPF website will include interactive programs to enable users to solve the puzzles online, but for now Rebecca is interested only in the design and layout of the pages. You have been asked to help by creating a draft version of the web page describing the Sudoku puzzle
  3. A preview of the home page is shown above.
  4. The style sheets and graphic files have already been created for you. Your job is to write the HTML markup.
  5. Instructions
  6. This Review Assignment contains interactive instructions that you can complete to ensure you've completed the instruction correctly.
  7. After reading each instruction thoroughly, perform the requested change in the code editor to the right. You can use the Build Website button to refresh your website preview at any point and view a full-page version of your website by clicking the arrow in the top right corner of your website preview.
  8.  
  9. Linking CSS File
  10. Enter your name and the date in the comment section of jpf_sudoku.html and jpf_sudoku.css.
  11. Open the jpf_sudoku.html file and add a link to the jpf_sudoku.css style sheet file to the document head.
  12. You will not be tested on this instruction, but you should still complete it.
  13. Create the Table
  14. Within the section element, insert a table element that will be used to display the Sudoku puzzle. Give the table element the class name spuzzle .
  15. Add a caption to the spuzzle table containing the text Sudoku.
  16. Table Header
  17. Create a table header row group containing a single row. The row should display 10 heading cells. The first heading cell should be blank and the remaining nine cells should display the digits from 1 to 9.
  18. Table Body
  19. Create the table body row group containing nine table rows with the first cell in each row containing a heading cell displaying the letters A through I.
  20. After the initial table heading cell in the first, fourth, and seventh rows of the table body row group, insert three table data cells spanning three rows and three columns each. Altogether, these nine data cells will store the nine 3×3 boxes that are part of the Sudoku puzzle.
  21. In the first row of the table body row, put the three table data cells you entered in the last step in the greenBox, goldBox, and greenBox classes, respectively. In the fourth row, the three data cells belong to the goldBox, greenBox, and goldBox classes. In the seventh row, the three data cells belong to the greenBox, goldBox, and greenBox classes.
  22. Table Data Cells
  23. Go to each of the nine table data cells you created in the last two steps. Within each data cell, insert a nested table belonging to the subTable class. Within each of these nested tables, insert three rows and three columns of data cells. Enter the digits from the example in the Introduction section in the appropriate table cells. Where there is no digit, leave the data cell empty.
  24.  
  25.  
  26. Outer Table Layout
  27. Open the jpf_sudoku.css file. Start by creating styles for the outer table. Go to the Table Styles section and create a style rule for the table element of the spuzzle class that:
  28. sets the table borders to collapse,
  29. sets the top/bottom margins to 0 pixels and the left/right margins to auto , and
  30. sets the width to 90%.
  31. Outer Table Elements
  32. For every td element, create a style rule that:
  33. adds a 5-pixel outset gray border and
  34. sets the width to 33.3%
  35. For every th element, create a style rule that:
  36. sets the font color to gray and
  37. sets the right and bottom padding space to 10 pixels.
  38. Inner Table Layout
  39. Next, you create styles for the inner table that is placed within each cell of the outer table. Go to the Inner Table Styles section and create a style rule for the table element of the subTable class that:
  40. sets the table borders to collapse and
  41. sets the width to 100%
  42. Inner Table Elements
  43. For every td element within the subTable table, create a style rule that:
  44. adds an inset box shadow with offset values of 0 pixels in the horizontal and vertical directions with a blur of 15 pixels,
  45. adds a 1-pixel solid black border,
  46. displays the text in a blue font,
  47. sets the cell height to 40 pixels, and
  48. centers the cell text in the horizontal and vertical directions.
  49. For every td element that is nested within a td element of the goldBox class, create a style rule that sets the background color to rgb(228, 199, 42).
  50. For every td element that is nested within a td element of the greenBox class, create a style rule that sets the background color to rgb(203, 229, 130).
  51.  
  52.  
  53. Verify
  54. Open the jpf_sudoku.html file and click the Build Website button to verify that the table layout and design match the example shown in the Introduction section.
  55. Review the webpage you have created on the right side of the screen.
  56. Validate
  57. You can use the W3C HTML Validator to ensure that your HTML files adhere to World Wide Web (W3) standards. This also helps improve the readability of your HTML files, making them easier to work with.
  58.  
  59. jpf_sudoku.html
  60. <!DOCTYPE html>
  61. <html>
  62. <head>
  63. <!--
  64. New Perspectives on HTML5 and CSS3, 7th Edition
  65. Tutorial 6
  66. Case Problem 2
  67.  
  68. Sudoku Puzzle
  69. Author:
  70. Date: 10/10/2018
  71. Filename: jpf_sudoku.html
  72.  
  73. -->
  74.  
  75. <meta charset="utf-8" />
  76. <meta name="viewport" content="width=device-width, initial-scale=1" />
  77. <title>The Sudoku Puzzle</title>
  78. <link href="jpf_reset.css" rel="stylesheet" />
  79. <link href="jpf_styles.css" rel="stylesheet" />
  80. <link href="jpf_sudoku.css" rel="stylesheet" />
  81. </head>
  82.  
  83. <body>
  84. <header>
  85. <img src="jpf_logo.png" alt="Japanese Puzzle Factory" id="logoimg" />
  86. <nav> <a id="navicon" href="#"><img src="jpf_navicon.png" alt="" /></a>
  87. <ul>
  88. <li><a href="#">Home</a></li>
  89. <li><a href="#">Store</a></li>
  90. <li><a href="#">Hints</a></li>
  91. <li><a href="#">Forum</a></li>
  92. <li><a href="#">Competitions</a></li>
  93. <li><a href="#">Site Map</a></li>
  94. </ul>
  95. </nav>
  96. </header>
  97.  
  98. <section>
  99. <table class="spuzzle">
  100. <caption>Sudoku</caption>
  101. <thead>
  102. <tr>
  103. <th></th>
  104. <th>1</th>
  105. <th>2</th>
  106. <th>3</th>
  107. <th>4</th>
  108. <th>5</th>
  109. <th>6</th>
  110. <th>7</th>
  111. <th>8</th>
  112. <th>9</th>
  113. </tr>
  114. </thead>
  115. <tbody>
  116. <tr>
  117. <th>A</th>
  118. <td rowspan="3" colspan="3" class="greenBox">
  119. <table class="subTable">
  120. <tr>
  121. <td></td>
  122. <td></td>
  123. <td>4</td>
  124. </tr>
  125. <tr>
  126. <td></td>
  127. <td></td>
  128. <td></td>
  129. </tr>
  130. <tr>
  131. <td>3</td>
  132. <td>5</td>
  133. <td></td>
  134. </tr>
  135. </table>
  136. </td>
  137. <td rowspan="3" colspan="3" class="goldBox">
  138. <table class="subTable">
  139. <tr>
  140. <td>5</td>
  141. <td></td>
  142. <td>3</td>
  143. </tr>
  144. <tr>
  145. <td></td>
  146. <td></td>
  147. <td></td>
  148. </tr>
  149. <tr>
  150. <td></td>
  151. <td></td>
  152. <td></td>
  153. </tr>
  154. </table>
  155. </td>
  156. <td rowspan="3" colspan="3" class="greenBox">
  157. <table class="subTable">
  158. <tr>
  159. <td></td>
  160. <td>7</td>
  161. <td></td>
  162. </tr>
  163. <tr>
  164. <td>3</td>
  165. <td>1</td>
  166. <td></td>
  167. </tr>
  168. <tr>
  169. <td>2</td>
  170. <td></td>
  171. <td></td>
  172. </tr>
  173. </table>
  174. </td>
  175. </tr>
  176. <tr>
  177. <th>B</th>
  178. </tr>
  179. <tr>
  180. <th>C</th>
  181. </tr>
  182. <tr>
  183. <th>D</th>
  184. <td rowspan="3" colspan="3" class="goldBox">
  185. <table class="subTable">
  186. <tr>
  187. <td></td>
  188. <td></td>
  189. <td></td>
  190. </tr>
  191. <tr>
  192. <td>6</td>
  193. <td></td>
  194. <td>9</td>
  195. </tr>
  196. <tr>
  197. <td>4</td>
  198. <td>7</td>
  199. <td>2</td>
  200. </tr>
  201. </table>
  202. </td>
  203. <td rowspan="3" colspan="3" class="greenBox">
  204. <table class="subTable">
  205. <tr>
  206. <td></td>
  207. <td>2</td>
  208. <td></td>
  209. </tr>
  210. <tr>
  211. <td></td>
  212. <td></td>
  213. <td></td>
  214. </tr>
  215. <tr>
  216. <td></td>
  217. <td>9</td>
  218. <td></td>
  219. </tr>
  220. </table>
  221. </td>
  222. <td rowspan="3" colspan="3" class="goldBox">
  223. <table class="subTable">
  224. <tr>
  225. <td>9</td>
  226. <td>3</td>
  227. <td>7</td>
  228. </tr>
  229. <tr>
  230. <td>4</td>
  231. <td></td>
  232. <td>8</td>
  233. </tr>
  234. <tr>
  235. <td></td>
  236. <td></td>
  237. <td></td>
  238. </tr>
  239. </table>
  240. </td>
  241. </tr>
  242. <tr>
  243. <th>E</th>
  244. </tr>
  245. <tr>
  246. <th>F</th>
  247. </tr>
  248. <tr>
  249. <th>G</th>
  250. <td rowspan="3" colspan="3" class="greenBox">
  251. <table class="subTable">
  252. <tr>
  253. <td></td>
  254. <td></td>
  255. <td>1</td>
  256. </tr>
  257. <tr>
  258. <td></td>
  259. <td>4</td>
  260. <td>5</td>
  261. </tr>
  262. <tr>
  263. <td></td>
  264. <td>6</td>
  265. <td></td>
  266. </tr>
  267. </table>
  268. </td>
  269. <td rowspan="3" colspan="3" class="goldBox">
  270. <table class="subTable">
  271. <tr>
  272. <td></td>
  273. <td></td>
  274. <td></td>
  275. </tr>
  276. <tr>
  277. <td></td>
  278. <td></td>
  279. <td></td>
  280. </tr>
  281. <tr>
  282. <td>8</td>
  283. <td></td>
  284. <td>1</td>
  285. </tr>
  286. </table>
  287. </td>
  288. <td rowspan="3" colspan="3" class="greenBox">
  289. <table class="subTable">
  290. <tr>
  291. <td></td>
  292. <td>5</td>
  293. <td>2</td>
  294. </tr>
  295. <tr>
  296. <td></td>
  297. <td></td>
  298. <td></td>
  299. </tr>
  300. <tr>
  301. <td>7</td>
  302. <td></td>
  303. <td></td>
  304. </tr>
  305. </table>
  306. </td>
  307. </tr>
  308. <tr>
  309. <th>H</th>
  310. </tr>
  311. <tr>
  312. <th>I</th>
  313. </tr>
  314.  
  315. </tbody>
  316. </table>
  317. </section>
  318.  
  319. <article>
  320. <h1>To Play</h1>
  321. <p>Sudoku is played on a 9x9 grid with nine 3x3 boxes
  322. placed within the grid. Enter a digit from 1 to 9 in
  323. each table cell. A few starting numbers have been
  324. supplied for you. The digits from 1 to 9 can appear
  325. only once each in every row, column, and box in the
  326. table (diagonals don't count). Every Sudoku puzzle
  327. has a unique solution.
  328. </p>
  329. <p>Good luck!</p>
  330. </article>
  331.  
  332. <footer>
  333. <nav>
  334. <ul>
  335. <li><a href="#">Akari</a></li>
  336. <li><a href="#">Divide by Box</a></li>
  337. <li><a href="#">Fillomino</a></li>
  338. <li><a href="#">Hashiwokakero</a></li>
  339. <li><a href="#">Heyawake</a></li>
  340.  
  341. </ul>
  342. <ul>
  343. <li><a href="#">Hitori</a></li>
  344. <li><a href="#">Kakuro</a></li>
  345. <li><a href="#">Katagaku</a></li>
  346. <li><a href="#">Masugo</a></li>
  347. <li><a href="#">Masyu</a></li>
  348. </ul>
  349. <ul>
  350. <li><a href="#">Nonogram</a></li>
  351. <li><a href="#">Oekaki Logic</a></li>
  352. <li><a href="#">Shikaku</a></li>
  353. <li><a href="#">Sudoku</a></li>
  354. <li><a href="#">Suhai</a></li>
  355. </ul>
  356. <ul>
  357. <li><a href="#">Super Sudoku</a></li>
  358. <li><a href="#">Tenketsu</a></li>
  359. <li><a href="#">Tentai Show</a></li>
  360. <li><a href="#">Wordoku</a></li>
  361. <li><a href="#">Yajilin</a></li>
  362. </ul>
  363. </nav>
  364. </footer>
  365.  
  366. </body>
  367. </html>
  368.  
  369. jpf_sudoku.css
  370. @charset "utf-8";
  371. /*
  372. New Perspectives on HTML5 and CSS3, 7th Edition
  373. Tutorial 6
  374. Case Problem 2
  375.  
  376. Sudoku Style Sheet
  377. Author:
  378. Date: 10/10/2018
  379. Filename:jpf_sudoku.css
  380.  
  381. */
  382. /* Table Styles */
  383.  
  384. table.spuzzle {
  385. border-collapse: collapse;
  386. margin-bottom: 0px;
  387. margin-top: 0px;
  388. margin-left: auto;
  389. margin-right: auto;
  390. width: 90%;
  391. }
  392.  
  393. td {
  394. border: 5px outset gray;
  395. width: 33.3%;
  396. }
  397.  
  398. th {
  399. color: gray;
  400. padding-bottom: 10px;
  401. padding-right: 10px;
  402. }
  403. /* Inner Table Styles */
  404.  
  405. table.subTable {
  406. border-collapse: collapse;
  407. width: 100%;
  408. }
  409.  
  410. table.subTable td {
  411. box-shadow: inset 0px 0px 15px;
  412. border: 1px solid black;
  413. color: blue;
  414. height: 40px;
  415. text-align: center;
  416. }
  417.  
  418. td.goldBox td {
  419. background-color: rgb(288,199,42);
  420. }
  421.  
  422. td.greenBox td {
  423. background-color: rgb(203, 229, 130);
  424. }
Advertisement
Add Comment
Please, Sign In to add comment