Mir2 Actor.pas
if (IsFace) and (FaceIndex > -1) then
begin
d := aFrmMain.WFaceimg.Images[FaceIndex * 10 + (FaceFram) mod 8]
/// if HorseSurface<>nil then
// dSurface.Draw (dx+shiftx, dy + hpy + ShiftY-60, d.ClientRect, d, TRUE)
// else
if d <> nil then
begin
if HorseSurface <> nil then
dsurface.Draw(SayX - d.Width div 2, dy + hpy + ShiftY - 60,
d.ClientRect, d, TRUE)
else
dsurface.Draw(SayX - d.Width div 2, dy + hpy + ShiftY - 50,
d.ClientRect, d, TRUE)
end
end
end
編寫具有如下函數(shù)原型的遞歸與非遞歸兩種函數(shù)equ,負(fù)責(zé)判斷數(shù)組a與b的前n個(gè)元素值是否按下標(biāo)對(duì)應(yīng)完全相同,是則返回TRUE,否則返回false。并編制主函數(shù)對(duì)它們進(jìn)行調(diào)用,以驗(yàn)證其正確性。
bool equ(int a[], int b[], int n)
提示:遞歸函數(shù)中可按如下方式來(lái)分解并處理問(wèn)題,先判斷最后一個(gè)元素是否相同,不同則返false;相同則看n是否等于1,是則返回TRUE,否則進(jìn)行遞歸調(diào)用(傳去實(shí)參a、b與 n-1,去判斷前n-1個(gè)元素的相等性),并返回遞歸調(diào)用的結(jié)果(與前n-1個(gè)元素的是否相等性相同)。
This source code has been tested under OpenWindows 2.0, Sun s X11/NeWS
server. For Xlib programs that use KeyPress events you should either
(1) set the FocusLenience resource to `TRUE , or (2) specifically notify
the window manager that you want to receive KeyPress/KeyRelease events
(but only in programs that need these events).
simulates coin tossing. Let the program toss a coin each time the user chooses the “Toss Coin” menu option. Count the number of times each side of the coin appears. Display the results. The program should call a separate method flip that takes no arguments and returns false for tails and TRUE for heads. [ Note: If the program realistically simulates coin tossing, each side of the coin should appear approximately half the time.]
The Radio Interface Layer is the name for an interface that was developed especially for the Pocket PC Phone Edition. It is meant to abstract the interface with a phone/modem device. To achieve this it is closely modelled after the GSM AT command interface. Unfortunately the API was not published officially by Microsoft. Instead more high level API s were published that should be sufficient for developers. Again, unfortunately they are not sufficient. For example the API for receiving notification of incoming SMS messages is arranged for exclusively for one application per type of SMS. Apparently this will be improved upon in Pocket PC 2003. Another area is the availablity of a TRUE AT command modem interface to interact with the GSM modem directly, which is also absent.