Chinese BASIC

Chinese BASIC (Chinese: 中文培基; pinyin: Zhōngwén Péijī) is the name given to several Chinese-localized versions of the BASIC programming language in the early 1980s.

Versions

At least two versions of Chinese BASIC were modified Applesoft BASIC that accepted Chinese commands and variables. They were built into some Taiwan-made Apple II clones. One of these was shipped with the best-selling Multitech Microprofessor II (known as Acer today). Another version was shipped with MiTAC's Little Intelligent Computer (小神通).[1]

In addition to Apple II clones, Multitech also developed a Zilog Z80-based port of the Chinese BASIC for its own line of high-end computers.

Example

In a typical Chinese BASIC environment, Chinese and English commands are interchangeable. It may also accept Chinese and Latin alphabet variables. For example, you may use PRINT A in line 50, 印 A in line 200 and ? A in line 250. They all do the same thing—to print out the value of A on screen.

Chinese (traditional) keyboard layout
Chinese BASIC
commands are printed in blue
  Applesoft BASIC
10 卜=0   10 Y=0
20 水, 火   20 INPUT E, F
30 日 = 水   30 FOR A = E TO F
40 卜 = 卜+對數(日)   40 Y = Y + LOG (A)
50 下一   50 NEXT A
60   60 PRINT Y

This program calculates the sum of log (E) + log (E+1) + log (E+2) + ... + log (F). The Chinese characters used as variables are the 24 radicals of the Cangjie method, one of the earliest QWERTY keyboard-compatible Chinese input methods. The author of the example program may have been Chu Bong-Foo, the inventor of the Cangjie method and one of the founding fathers of modern Chinese computing.

The significant length of an Applesoft BASIC variable name is restricted to two bytes. Therefore, the variables THISNUMBER and THATNUMBER are treated as the same. In Multitech's Chinese BASIC, a variable can be 3 bytes long (one Chinese character + one numeral).

gollark: It appears to be muted anyway.
gollark: Is LyricLy saying anything?
gollark: ++radio connect
gollark: See, without osmarks internet radio™, dead chat.
gollark: It *does* work!

See also

References

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.