Poetic Coding Lesson 2
詩意編碼第二堂
ASCII poetry
詩意「文字圖」
Date: February 8, 2021
<pre> </pre>
- Shortened word for 'preformatted text.'
「preformatted text」的縮寫。
- Text in a <pre> tag is displayed in a fixed-width font
<pre>內的文字以固定闊度的字體顯示。
- The text preserves both spaces and line breaks.
<pre>保留空格及換行。
- The text will be displayed as exactly as written in the HTML source code. This feature is different from <p> tag which displays the text as a paragraph, and ignores spaces and line breaks.
文字將完全依照HTML網頁中的編碼作顯示。這個功能有別於<p>標籤,<p>標籤是以段落形式顯示文字,並忽略空格及換行。
- <pre> tag usually contains text with a unique format, code source with indentation format, special characters or ASCII Art. ASCII stands for American Standard Code for Information Interchange, which is a character encoding standard for the web.
<pre>一般包含獨特及編碼縮排格式的文本、特殊字符或「文字圖」。「文字圖」是美國資訊交換標準碼ASCII的短寫,是一種網頁字符編碼的標準。
- We are using <pre> tag in order to create a knit based on the student's code. The output of the ASCII design will be printed onto a knit, so the students may touch their work in the end. The knit sample will be sent to students by February 22nd, for the 3rd workshop.
我們使用<pre>,是為了可依據學生的編碼來製作一件針織品。「文字圖」所輸出的內容將被織成布料,所以最後學生能觸摸自己的作品,針織品樣本將會在2月22日之前郵寄給學生,供第三堂使用。
- Some screen readers cannot properly format pre elements, and may ignore the spacing and line breaks inside of <pre> tag. It is recommended that you provide title or explanatory text along with the <pre> tag.
有些屏幕閱讀器不能完全地格式化預先的字符,可能會忽略<pre>的空格及換行,建議你可在<pre>標籤中加入標題或說明文字。
Project examples 例子
<pre> tag can be used to create a graphic representation on a web page. This may not be accessible for the screen-reader users.
<pre>可用於網頁上創建一個圖形表述,但屏幕閱讀器用家可能無法預覽。
small house 小房子:
[]___
/ /\
/____/__\
|[][]||||
The <pre> tag can be used to write with space, indentation and line breaks.
<pre>標籤可在編寫(文本)時使用空格,縮排及換行。
Small house
Small house
Small house
Small house
小房子
小房子
小房子
小房子
Homework 家課
Create a story about items in your room with a <pre> tag within 10 characters/ 10 lines constraint. An example:
在10个字符/10行限制内,用<pre>標籤創建一個關於你房間裡物品的故事。以下是例子:
In my room
I have a
cat and a
few plants
rose,
tulip,
lily,
sunflower,
orchid,
daffodil.
在我的房間
我有一隻
貓和
一些植物
玫瑰
鬱金香
百合花
向日葵
蘭花
水仙花
Another example that uses indentation within 10 characters/ 10 lines constraint.
另一個例子同樣使用10個字符/10行限制内的縮排格式。
I have
a cat
a dog
a bird
a horse
a bear
a pony
a shark
a deer
in my room.
我有
一隻貓
一隻狗
一隻小鳥
一隻馬
一隻熊
一隻小馬
一條鯊魚
一隻鹿
在我的房間內
Please consider the indentation, space, line breaks as part of the story. You can use ASCII characters such as !@#$%^&*()_+ by inserting special characters.
We are hoping to knit your story on a piece of fabric so you can touch them.
請加入縮排、空格、換行成為故事的一部分。你可以插入「文字圖」的特殊字符如!@#$%^&*()_+。我們希望可以把你的故事編織在一塊布料上,這樣你就能觸摸它們。
Please work on the homework until our next class. We will further explain the concept and use of ASCII in the class and give you time to work on the homework.
請在下一堂之前開始做家課,我們會在課堂上進一步講解有關「文字圖」的概念和應用,並給予你時間去完成家課。
Back to index