本區搜索:
Yahoo!字典
打印

[ICT] Pascal 問題

[隱藏]

Pascal 問題

點用array 去寫個TABLE
JUST like this
http://iteslj.org/cw/1/rs-sounds.html

[ 本帖最後由 tiffany331 於 2013-4-18 10:53 PM 編輯 ]
   

TOP

Apparently, you need to use JS to manipulate different elements of the HTML DOM. If you're only going to write one crossword, try writing the parts of the script to initialise the crossword GUI first. That would probably involve appendChild and HTML tags like tables etc. Then the rest will be easier. If you're stuck, there's always a view source button in the browser.
<p align='center'><b>2015 DSE!!!</b></p>

TOP

i want to write a program about the table like the one in the game. How should I do?

TOP

Um...

Actually... you could build the table in HTML and CSS first. Then you can use JS for checking only.

In the source code of the webpage you provided, they used tables, so just create a large table with <tr> and <td>. In the CSS, just set the table margin to zero, etc. In the cells with squares, add an <input> tag. If you only want one crossword puzzle with little reusability, simply type them in the HTML source code (very easy). Otherwise, add the input tags based on your XML file with the XML DOM and the HTML DOM (very difficult). Give your input tags a NAME attribute and start from zero since JS arrays start from zero.

Declare a constant array and load your letters inside it in the declaration. (JS provides a simple way to initialise an array: ["1", "A", "B"]) Then loop through your input fields and check if the input value matches the corresponding array element. Display the 'wrong' message if there's something wrong. (JS has a nifty break; statement which allows you to break out of an array, so you don't need to bother with the complicated code in Longman's Ch 23.) Otherwise display the 'right' message.

It shouldn't be too hard; it's always a good idea to check w3schools' reference if you're stuck. http://w3schools.com/jsref/default.asp

[ 本帖最後由 123qwerty 於 2013-4-17 09:41 PM 編輯 ]
<p align='center'><b>2015 DSE!!!</b></p>

TOP

but i only need to write the program in Pascal
I study Elective D.

[ 本帖最後由 tiffany331 於 2013-4-18 12:17 PM 編輯 ]

TOP

Facepalm.

Sorry, I can't help then. I don't know any Pascal beyond console programs.
<p align='center'><b>2015 DSE!!!</b></p>

TOP

never mind, thank you so much

TOP

two dimensional array??

TOP

重要聲明:小卒資訊論壇 是一個公開的學術交流及分享平台。 論壇內所有檔案及內容 都只可作學術交流之用,絕不能用商業用途。 所有會員均須對自己所發表的言論而引起的法律責任負責(包括上傳檔案或連結), 本壇並不擔保該等資料之準確性及可靠性,且概不會就因有關資料之任何不確或遺漏而引致之任何損失或 損害承擔任何責任(不論是否與侵權行為、訂立契約或其他方面有關 ) 。