发信人: linsivvi (潇潇^_^), 信区: ANSI_Discuss
标 题: [组二]第二次 by xiaoyubaobao
发信站: 日月光华 (2007年01月26日09:55:00 星期五), 站内信件
【 以下文字转载自 linsivvi 的信箱 】
【 原文由 xiaoyubaobao 所发表 】
──────────────────────────────────────
╱█ __ __ ______ ______
╱__█ █ █ █__ ̄  ̄█ ̄
__╱  ̄█ █╲█ ▁ █ __█__
 ̄  ̄  ̄  ̄  ̄ ̄ ̄  ̄ ̄ ̄
日月光华ANSI版短期培训班
2007年1月24日作业提交
xiaoyubaobao(05SS)
教师:Spirit 组长:linsivvi
───────────────────────────────────|(1)|─
──|1月24日作业|───────────────────|xiaoyubaobao|────
A类作业:
1. 已test。
2. 使用透明色效果制作一个ANSI。
★☆★☆════════════╗
☆ ║
★ 这是一首简单的小情歌 ◇
☆ 唱着人们心肠的曲折 ◆
║ ◇
╚════════════◇◆◇◆◇◆◇════════════╗
◇ ║
◆ 受不了看见你背影来到 ☆
◇ 写下我度秒如年的爱的离骚 ★
║ ☆
╚════════════☆★☆★
───────────────────────────────────|(2)|─
──|1月24日作业|───────────────────|xiaoyubaobao|────
B类作业:
1. 简化代码。
原代码:
┌─────────────────────────────┐
│*[1m*[4m*[5m*[33;45;31mA*[0m*[44;45;32mB*[0m*[42;32mC*[0m │
└─────────────────────────────┘
简化之后:
┌───────────────────────┐
│*[1;4;5;45;31mA*[0m*[45m32mB*[0m*[42m32mC*[0m │
└───────────────────────┘
或者:
┌─────────────────────┐
│*[1;4;5;45;31mA*[0m*[45;32mB*[42;32mC*[0m │
└─────────────────────┘
───────────────────────────────────|(3)|─
──|1月24日作业|───────────────────|xiaoyubaobao|────
B类作业:
1. 简化代码。
解释一下我要写出两种简化代码的原因:
┌─────────────────────────┐
│ 效果的简化按照合并以及重复出现取最后出现的控制│
│符的原则,两种简化代码没什么区别。 │
│ 但有一个地方不同,字母B和C的效果都使用了前景色│
│和背景色效果,而A的效果则比较复杂。所以A字母效果后│
│“*[0m”一定要加,这样才能关闭之前显示的所有属性,│
│不会影响后面;B和C的效果类型一样,效果内容不一样,│
│因此可删掉B字母后面的“*[0m”,保留C字母后的即可。│
└─────────────────────────┘
效果:
ABC
───────────────────────────────────|(4)|─
──|1月24日作业|───────────────────|xiaoyubaobao|────
B类作业:
2. 规范代码的意义:
┌───────────────────────────┐
│ 同写程序一样,ANSI控制符的代码也应当有相应的规范。│
│首先要保证在各种term以及浏览器里面都能显示正常,这应该│
│就是教程中所提到的代码的通用性。然后好的ANSI控制符代码│
│还要有可读性,方便他人阅读。这同写程序一样,不仅程序保│
│证可用,代码还要方便他人阅读。 │
│ 在我们专业课的很多project中,代码规范性都占有一定 │
│比例的分数。这或许也是一个程序员应该必备的能力吧。使用│
│好的代码规范能使得程序员与使用者之间更好的沟通。ANSI作│
│品也一样,ANSI控制符代码的规范也能使ANSI效果更加明白、│
│易懂、准确,也更加直观。 │
│ 因此,规范代码应该从刚开始学ANSI开始,就养成一个好│
│的习惯。*^^* │
└───────────────────────────┘
───────────────────────────────────|(5)|─
--
幸福在很远的地方,但终究还是幸福。
※ 来源:·日月光华 bbs.fudan.edu.cn·[FROM: 10.8.225.9]
--
※ 转载:·日月光华 bbs.fudan.edu.cn·[FROM: 211.160.88.24]
Sender: linsivvi Xiaoxiao^ ^, message area: ANSI Discuss
Title: [Group 2] The second time by xiaoyubaobao
Sending site: Sun and Moon Guanghua January 26, 2007 09:55:00 Friday, site mail
The following text is reproduced from linsivvi’s mailbox
Originally published by xiaoyubaobao
Sun and Moon Guanghua ANSI version short-term training course
Assignment submitted on January 24, 2007
xiaoyubaobao 05SS
Teacher Spirit Team Leader linsivvi
1
Homework for January 24th xiaoyubaobao
Class A work
1. tested
2. Use transparent color effect to create an ANSI
This is a simple little love song
Singing about the twists and turns of people's hearts
I can't bear to see your back coming
Write down the dissatisfaction of my love that lasts for a second like a year
2
Homework for January 24th xiaoyubaobao
Category B homework
1. Simplify the code
Original code
*[1m*[4m*[5m*[33;45;31mA*[0m*[44;45;32mB*[0m*[42;32mC*[0m
After simplification
*[1;4;5;45;31mA*[0m*[45m32mB*[0m*[42m32mC*[0m
or
*[1;4;5;45;31mA*[0m*[45;32mB*[42;32mC*[0m
3
Homework for January 24th xiaoyubaobao
Category B homework
1. Simplify the code
Explain why I want to write two simplified codes
Effects are simplified by merging and repeating the control that appears last.
According to the principle of syntax, there is no difference between the two simplified codes.
But there is one difference. The effects of letters B and C both use the foreground color.
And the background color effect, and the effect of A is more complicated, so after the effect of A letter
*[0m must be added so that all previously displayed attributes can be turned off.
It will not affect the following. The effect types of B and C are the same but the effect content is different.
Therefore, you can delete the *[0m after the letter B and keep the one after the letter C.
Effect
ABC
4
Homework for January 24th xiaoyubaobao
Category B homework
2. The meaning of standardized code
Just like writing a program, the code of ANSI control symbols should also have corresponding specifications.
First of all, make sure that it can be displayed normally in various terms and browsers. This should
It is the universality of the code mentioned in the tutorial and then good ANSI control code
It also needs to be readable and convenient for others to read. This is the same as writing a program. Not only does the program maintain
The code must be valid and easy for others to read.
In many projects in our professional courses, code standardization plays a certain role.
Proportional fractions. This may also be an essential ability for a programmer. Use
Good coding standards can enable better communication between programmers and users. ANSI operation
The same goes for products. The specification of ANSI control code can also make the ANSI effect more clear.
Easy to understand, accurate and more intuitive
Therefore, you should develop a good standard code from the beginning when you first learn ANSI.
Habit *^^*
5
Happiness is far away, but it is still happiness after all
Source: Sun and Moon Guanghua bbs.fudan.edu.cn [FROM: 10.8.225.9]
Reprint: Sun and Moon Guanghua bbs.fudan.edu.cn [FROM: 211.160.88.24]