发信人: SpiritRain (妖精雨·荒唐的2006), 信区: ANSI
标 题: [教程]第二节 代码讲解(入门组加修课)
发信站: 日月光华 (2007年01月12日14:23:28 星期五), 站内信件
○ . . .
╭╮ ●
╟╢ ╭╮╭╮ · ★ .
. ║║ ╰╮║ ╖ ╖ ○ . .
╯╰-╰╯╰╯ ╨ ╨
. . .
. ● .
. . . .
. ● 加 ○ ●
. .
. 修 . ○
. . . 课 .
水木清华BBS ASCIIart版面2004年11月新手培训教程 . 代码讲解篇
. . ●
○ . . ●
. . .
格式:lololing 参考教程"ASCIIArt跨站讲座第一期 - 基础知识" 整理:creambottle
┆ ┆
ANSI 控制码
ANSI控制码均以 Esc 作为控制码的开始标志,
水木BBS中ESC字符的输入方法是[ESC]+[ESC],在编辑器中用"*"代表。
* 是按两下 ESC 键 而来的,而不是数字8上方的*
为了避免其他方面造成的影响,现在请先把终端的默认高亮的设置关掉
cterm2000: 编辑>>系统设置>>高级,确认没选上总是高亮
fterm : 选项>>参数设置,确认没有选上默认高亮
sterm : 选项>>当前连接设置>>远程登录设置>>外观,确认没选上总是高亮
Page 1.
┆ ┆
颜色 控制码
我们最常见到的是显示颜色的ANSI控制码 BBS上我们可以设置的颜色共有16种
*[30m ---- *[37m 设置前景色
*[40m ---- *[47m 设置背景色 30 31 32 33 34 35 36 37
40 ss ss ss ss ss ss ss ss
41 ss ss ss ss ss ss ss ss
配色的常用规范将在第四节中讲 42 ss ss ss ss ss ss ss ss
43 ss ss ss ss ss ss ss ss
这里就不细说了 44 ss ss ss ss ss ss ss ss
45 ss ss ss ss ss ss ss ss
46 ss ss ss ss ss ss ss ss
47 ss ss ss ss ss ss ss ss
Page 2.
┆ ┆
其他常用控制码及注意事项
*[0m 关闭所有属性 *[1m 设置高亮度 *[4m 下划线
*[5m 闪烁 *[7m 反显
注意事项:
*[0m与*[m差不多 关闭闪烁下划线反显,并恢复到默认前背景色
在水木或者紫霞等站两者一样 sterm对两者的解释也一样
在其他BBS系统, *[0m一律恢复到低亮
cterm和fterm则不同 *[m则根据你的设置,恢复到默认的高低亮状态
Page 3.
┆ ┆
其他常用控制码及注意事项
*[4m是下划线 在cterm里面下划线一律是白色的,
而fterm或sterm里面下划线的颜色与相应位置文字的颜色相同
fterm,cterm中如果你的默认背景被设成了不同于黑色的另一种颜色
*[40m会切换到默认背景颜色而不是黑色,sterm则可能切换到黑色
*[5m是闪烁 要注意的是一般来说一屏上闪烁的部分不要太多太集中
*[7m是反显 建议不要使用,各种终端软件对其的解释差别较大
cterm中是交换前背景,高亮一律只作用在前景
fterm中忽略前背景色,用白底黑字
sterm中交换前背景,因此可能出现高亮背景低亮前景的情况
Page 4.
┆ ┆
其他不常用的控制码
*[x;yH x,y 为定位的坐标值
*[nA 光标上移n行
*[nB 光标下移n行
*[nC 光标右移n行
*[nD 光标左移n行
*[2J 清屏
*[K 清除从光标到行尾的内容
cterm 还提供了几种非标准的控制符(字体控制水木系统已不支持)
更多的请自行前往会议室精华区目录"学习园地" 研究和深层研究
Page 5.
┆ ┆
手工写控制码
即使有了方便直观的辅助工具作图之后,有时候还是难免会手工写控制码
手写代码的具体情况有很多
比如: 1) 各种情况下出现错行、小的颜色错误而进行的手工修改
2) 做定位qmd等等
只有熟知基本代码的情况下,手工修改才能快捷而有效率
作为一个中级ASCIIer,对代码的基本的了解和掌握更是必须具备的素质
下节预告:配色的基本规范(二节课,用时3天)
Page 6.
--
、 、 、 ` `
、 、 ` . ╋ ` . 、
ˉ _﹎ _﹎_﹎_﹎┃_﹎_﹎``︸﹊︸ ̄`﹊
ˉ︸﹊︸、︸﹊︸︸﹊︸︸﹊︸ 、
此妖已死,有事烧纸
※ 来源:·日月光华 bbs.fudan.edu.cn·[From: 妖精冢]
※ 修改:·SpiritRain 於 01月12日14:23:53 修改本文·[FROM: 211.86.148.148]
Sender: SpiritRain Fairy Rain Ridiculous 2006, message area: ANSI
Title: [Tutorial] Section 2: Code explanation, additional course for entry-level group
Sending site: Sun and Moon Guanghua Friday, January 12, 2007 14:23:28, site mail
. . .
.
. . .
. . .
. .
. . . .
. add
. .
. build .
. . . class .
Shuimu Tsinghua BBS ASCIIart layout November 2004 novice training tutorial. Code explanation
. .
. .
. . .
Format: lololing Reference Tutorial "ASCIIArt Cross-Site Lecture Issue 1 Basic Knowledge" Organized by: creambottle
ANSI control code
ANSI control codes all use Esc as the start mark of the control code
The input method of ESC character in Mizuki BBS is [ESC] [ESC] represented by "*" in the editor
* comes from pressing the ESC key twice, not the * above the number 8
In order to avoid other impacts, please turn off the default highlighting setting of the terminal first.
cterm2000: Edit>>System Settings>>Advanced Confirm that it is always highlighted if it is not selected
fterm: Options>>Parameter Settings Make sure default highlighting is not selected
sterm: Options>>Current connection settings>>Remote login settings>>Appearance Confirm that it is always highlighted if it is not selected
Page 1.
Color control code
The most common thing we see is the ANSI control code for displaying colors. There are 16 colors that we can set on BBS.
*[30m *[37m Set the foreground color
*[40m *[47m Set background color 30 31 32 33 34 35 36 37
40 ss ss ss ss ss ss ss ss
41 ss ss ss ss ss ss ss ss
Common specifications for color matching will be discussed in Section 4 42 ss ss ss ss ss ss ss ss
43 ss ss ss ss ss ss ss ss
I won’t go into details here 44 ss ss ss ss ss ss ss ss
45 ss ss ss ss ss ss ss ss
46 ss ss ss ss ss ss ss ss
47 ss ss ss ss ss ss ss ss
Page 2.
Other commonly used control codes and precautions
*[0m Turn off all attributes *[1m Set high brightness *[4m Underline
*[5m flashing *[7m reverse display
Precautions:
*[0m is similar to *[m. Turn off the flashing underline display and restore the default background color.
The two are the same at Shuimu or Zixia stations. Sterm also explains the two the same way.
In other BBS systems, *[0m will always return to low brightness.
cterm and fterm are different *[m will return to the default high and low brightness state according to your settings.
Page 3.
Other commonly used control codes and precautions
*[4m is an underline. Underlines in cterm are always white.
The color of the underline in fterm or sterm is the same as the color of the text in the corresponding position.
If your default background in fterm or cterm is set to a color other than black
*[40m will switch to the default background color instead of black. sterm may switch to black.
*[5m is flashing. It should be noted that generally speaking, the flashing parts on a screen should not be too concentrated or too concentrated.
*[7m is reverse display. It is recommended not to use it. The interpretation of various terminal software is quite different.
In cterm, the background is exchanged. Highlighting only affects the foreground.
Ignore the background color in fterm and use black text on a white background
The front background is exchanged in sterm, so there may be a situation where the background is highlighted and the foreground is low.
Page 4.
Other less commonly used control codes
*[x;yH x,y are the coordinate values of positioning
*[nA Move the cursor up n lines
*[nB Move the cursor down n lines
*[nC Move cursor n lines to the right
*[nD Move cursor left n lines
*[2J Clear screen
*[K clears the contents from the cursor to the end of the line
cterm also provides several non-standard control characters. Font control is no longer supported by water and wood systems.
For more information, please go to the "Learning Garden" directory of the conference room highlight area for research and in-depth research.
Page 5.
Manually write control code
Even after having convenient and intuitive auxiliary tools for drawing, sometimes it is inevitable to write control codes by hand.
There are many specific cases of handwritten code
For example: 1. Wrong lines and small color errors occur in various situations and are manually modified.
2 Do positioning qmd, etc.
Only when you are familiar with the basic code can manual modification be fast and efficient.
As an intermediate ASCIIer, a basic understanding and mastery of code is a must-have quality.
Preview of the next session: Basic specifications for color matching. Second session, lasting 3 days.
Page 6.
. .
This demon is dead. Burn paper if you have something to do.
Source: Sun and Moon Guanghua bbs.fudan.edu.cn [From: Fairy Tomb]
Modification: SpiritRain modified this article at 14:23:53 on January 12 [FROM: 211.86.148.148]