发信人: soulfox (小o&灵狐~以华丽之名), 信区: ANSI
标 题: [教程相关][第三章]关于简化代码的几点 by hw
发信站: 日月光华 (2007年08月09日21:00:12 星期四), 站内信件
by hw
常规的:无效代码去除,无下划线空格的前景色、高低亮、闪烁与两边协调
上面这两步做的时候我总是保持一定规范的:末尾*[m,行首指定颜色;每一处的高亮/低
亮/默认高低亮 状态与原作保持一致(除了空格的)。一般不考虑的是默认前背景与黑底白
字的区分,这只在改了背景色的sterm中有区别,除非我发现原作特地为此进行了处理,
不然是不会去照顾这一点的
当这个常规方案简化后的代码仍旧超长时,那就要想点别的办法了。如果只差一点点,那
么可以考虑延用上一行代码,将默认高低亮视作低亮处理等等。
由于不喜欢*[7m,所以上次寒假里没去考虑用这个做,对于这个并排fterm,最终还是差那
么一点,可以看看我两次的半成品
这次考虑到*[7m虽然几个term解释不同,但是将37换成白底基本都是一样的,这个作品可
以用,所以试了一下,正好放得下。
常规代码做不到,那就只能加光标移动了,这时候就看短行和字符空间,而像这个作品,
本来的代码只有17行,以第一屏来说也有两个空行可以利用,超长的又只有一行,空间绰
绰有余,什么方法都可以用。考虑到最好的兼容性,作品中有大量黑背景空格,所以上次
采用了*[C跳空格省背景变换来做,其实只要做一行的
--
BBS客户端探测程序(仅支持cterm、fterm、sterm、qterm以及WinXP telnet)
您当前所使用的是:
ctermIII fterm sterm Win telnet qterm <SFC(100,222,255) T(0,-10,"CTERMIII")>
※ 来源:·日月光华 bbs.fudan.edu.cn·[FROM: 222.70.3.15]
--
※ 转载:·日月光华 bbs.fudan.edu.cn·[FROM: 10.85.48.11]
--
※ 转载:·日月光华 bbs.fudan.edu.cn·[FROM: 10.85.48.11]
※ 修改:·soulfox 於 08月09日21:02:50 修改本文·[FROM: 10.85.48.11]
Sender: Soulfox Xiaoo&Linghu In the name of gorgeousness, message area: ANSI
Title: [Tutorial related][Chapter 3] Several points about simplifying code by hw
Sending site: Sun and Moon Guanghua Thursday, August 9, 2007 21:00:12, site mail
by hw
Conventional invalid code removal, foreground color without underlined spaces, high and low brightness, flickering and coordination with both sides
When doing the above two steps, I always maintain a certain standard. The end *[m specifies the color at the beginning of the line. The highlight of each place is low.
Bright The default high and low brightness state is consistent with the original work. Except for spaces, the default front background and black background and white are generally not considered.
The distinction between words is only different in sterm with a changed background color, unless I find that the original work has been specially processed for this purpose.
Otherwise, we wouldn’t take care of this.
When the simplified code of this conventional solution is still too long, then you have to think of another way. If it is just a little bit short, then
Can you consider continuing to use the previous line of code to treat the default high and low brightness as low brightness processing, etc.
Because I don't like *[7m, I didn't consider using this during the last winter vacation. For this side-by-side fterm, it was still not that good in the end.
Well, you can take a look at my two semi-finished products
This time I considered *[7m Although the interpretation of several terms is different, if 37 is replaced with a white background, it is basically the same. This work can be
I used it, so I tried it and it just fit.
If you can't do it with regular code, you can only add cursor movement. At this time, you need to look at short lines and character spaces. And like this work
The original code only has 17 lines. On the first screen, there are two blank lines that can be used. If it is super long, there is only one line, so there is plenty of space.
More than enough, any method can be used. Considering the best compatibility, there are a lot of black background spaces in the work, so last time
I used *[C to skip spaces and save background transformation. In fact, I only need to do one line.
BBS client detection program only supports cterm fterm sterm qterm and WinXP telnet
You are currently using
ctermIII fterm sterm Win telnet qterm <SFC 100,222,255 T 0, 10,"CTERMIII" >
Source: Sun and Moon Guanghua bbs.fudan.edu.cn [FROM: 222.70.3.15]
Reprint: Sun and Moon Guanghua bbs.fudan.edu.cn [FROM: 10.85.48.11]
Reprint: Sun and Moon Guanghua bbs.fudan.edu.cn [FROM: 10.85.48.11]
Modification: soulfox modified this article at 21:02:50 on August 9th [FROM: 10.85.48.11]