Tic Tac Toe程序。可以供一到兩個(gè)玩家使用。程序中使用了visual basic 計(jì)時(shí)器,所以每一個(gè)步驟都有時(shí)間限制。此外,計(jì)算機(jī)可是一個(gè)有簡(jiǎn)單智能的對(duì)手,他不但不會(huì)隨便出手,反而還要竭力贏了你才罷休。
Tic Tac Toe program. One or two players. It uses the visual basic timer, so each move has time limit. Simple artificial intelligence: computer does not play randomly, but "tries" to win and STOP you from winning.
This example program shows how to configure and use the A/D Converter of the following microcontroller:
STMicroelectronics ST10F166
After configuring the A/D, the program reads the A/D result and outputs the converted value using the serial port.
To run this program...
Build the project (Project Menu, Build Target)
Start the debugger (Debug Menu, Start/STOP Debug Session)
View the Serial Window (View Menu, Serial Window #1)
View the A/D converter peripheral (Peripheral Menu, A/D Converter)
Run the program (Debug Menu, Go)
A debug script (debug.ini) creates buttons that set different analog values in A/D channels. As the program runs, you will see the A/D input and output change.
Other buttons create signals that generate sine wave or sawtooth patterns as analog inputs. µ Vision3 users may enable the built-in Logic Analyzer to view, measure and compare these input signals graphically.
These routines transmit and receive serial data using two general
* I/O pins, in 8 bit, No parity, 1 STOP bit format. They are useful
* for performing serial I/O on 8051 derivatives not having an
* internal UART, or for implementing a second serial channel.
zemax源碼:
This DLL models a standard ZEMAX surface type, either plane, sphere, or conic
The surface also demonstrates a user-defined apodization filter
The filter is defined as part of the real ray trace, case 5
The filter can be used at the STOP to produce x-y Gaussian apodization similar to the Gaussian pupil apodization in ZEMAX but separate in x and y.
The amplitude apodization is of the form EXP[-(Gx(x/R)^2 + Gy(y/R)^2)]
The transmission is of the form EXP[-2(Gx(x/R)^2 + Gy(y/R)^2)]
where
x^2 + y^2 = r^2
R = semi-diameter
The tranmitted intensity is maximum in the center.
T is set to 0 if semi-diameter < 1e-10 to avoid division by zero.