貪吃蛇*要點分析: *1)數據結構:matrix[][]用來存儲地圖上面的信息,如果什么也沒有設置為false, * 如果有食物或蛇,設置為true;nodeArray,一個LinkedList,用來保存蛇的每 * 一節;food用來保存食物的位置;而Node類是保存每個位置的信息。 *2)重要函數: * changeDirection(int newDirection) ,用來改變蛇前進的方向,而且只是 * 保存頭部的前進方向,因為其他的前進方向已經用位置來指明了。 其中newDirection * 必須和原來的direction不是相反方向,所以相反方向的值用了同樣的奇偶性。在測試 * 的時候使用了direction%2!=newDirection%2 進行判斷。 * moveOn(),用來更新蛇的位置,對于當前方向,把頭部位置進行相應改變。如果越界, * 結束;否則,檢測是否遇到食物(加頭部)或身體(結束);如果什么都沒有,加上頭部, * 去掉尾部。由于用了LinkedList數據結構,省去了相當多的麻煩。
上傳時間: 2014-06-14
上傳用戶:cjf0304
AutomaticPropertiesDefaultValues Article_src.zip PropertyInfo[] props = o.GetType().GetProperties(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.Static) for (int i = 0 i < props.Length i++) { PropertyInfo prop = props[i] if (prop.GetCustomAttributes(true).Length > 0) { object[] defaultValueAttribute = prop.GetCustomAttributes(typeof(DefaultValueAttribute), true) if (defaultValueAttribute != null) { DefaultValueAttribute dva = defaultValueAttribute[0] as DefaultValueAttribute if(dva != null) prop.SetValue(o, dva.Value, null) }
標簽: AutomaticPropertiesDefaultValues PropertyInfo Article_src GetPropert
上傳時間: 2014-11-22
上傳用戶:xaijhqx
(***FlatStyle v4.42.8.0 for DELPHI7 by comerose update***)2007.04.30 更新說明1.修正 TFlatListView 標題的平面顯示(更加完美).2.增加 TFlatListView 的屬性. ①ColorTitleFace以實現對標題平面顏色控制. ②ColorTitleCheck選擇時的CheckBox的顏色控制. ③AllCheck對列表進行全選(只在CheckBoxs為True時有效). AllCheck=True時全選列表,AllCheck=False取消全選. ④GroundPic背景圖像來源. ⑤GroundHas是否使用畫背景圖像(在OnDrawBackground事件中無效). ⑥GroundStretch是否放縮背景圖像(在OnDrawBackground事件中無效). ⑦OnDrawBackground自定義重畫事件(在GroundHas=false時,事件中有效). ⑧在標題中增加一個列表全選按鈕(CheckBoxs=true和ViewStyle=vsReport時有效). 如果你之前的程序在OnCustomDraw中有代碼的, 請把這些代碼復制到OnDrawBackground事件中.3.修正 TFlatListBoxExt 和 TFlatCheckListExt 鼠標進入時的變色. (原來版本當列表數目顯示區域少于控件區域時,會有部分地方不變色的BUG).4.優化一些代碼。5.編譯說明 ①首先打開 FlatVcls.dpk 包, 編譯. ②再次打開 FlatStyle.dpk 包, 編譯. ③成功!6.更詳細的說明,請閱讀內部的README.TXT文件.
標簽: TFlatListView FlatStyle comerose DELPHI7
上傳時間: 2013-12-31
上傳用戶:hongmo
最新發送短信的jar包 COutgoingMessage msg = new COutgoingMessage(mobile , message) msg.setMessageEncoding(CMessage.MessageEncoding.EncUcs2) msg.setStatusReport(true) srv.sendMessage(msg)
標簽: COutgoingMessage setMessageEncoding msg message
上傳時間: 2016-07-29
上傳用戶:大三三
wince EVC 簡單的圖片瀏覽功能,自已隨意擴展 支持 *.bmp *.jpg *.gif *.png 等等 // TODO: Add your control notification handler code here CString defFilter("選中其中一個文件|*.bmp *.jpg *.gif *.png") CFileDialog dlg(TRUE,NULL,NULL,OFN_ALLOWMULTISELECT,defFilter) if(dlg.DoModal()==IDOK){ PathName=dlg.GetPathName() }
標簽: notification control wince TODO
上傳時間: 2016-09-22
上傳用戶:gut1234567
LCD Driver datasheet The SPF54126A, a 262144-color System-on-Chip (SoC) driver LSI designed for small and medium sizes of TFT LCD display, is capable of supporting up to 176xRGBx220 in resolution which can be achieved by the designated RAM for graphic data. The 528-channel source driver has true 6-bit resolution, which generates 64 Gamma-corrected values by an internal D/A converter. The source driver of SPFD54126A adopts OP-AMP structure to enhance display quality and it cooperates with advanced circuitry techniques to reduce power consumption.
標簽: System-on-Chip datasheet designed Driver
上傳時間: 2016-09-22
上傳用戶:xauthu
The Inter IC bus or I2C bus is a simple bidirectional two wire bus designed primarily for general control and data transfer communication between ICs. Some of the features of the I2C bus are: • Two signal lines, a serial data line (SDA) and a serial clock line (SCL), and ground are required. A 12V supply line (500mA max.) for powering the peripherals often may be present. • Each device connected to the bus is software addressable by a unique address and simple master/ slave relationships exist at all times masters can operate as master-transmitters or as master-receivers. • The I2C bus is a true multi-master bus including collision detection and arbitration to prevent data corruption if two or more masters simultaneously initiate data transfer systems. • Serial, 8-bit oriented, bidirectional data transfers can be made at up to 100 KBit/s in the standard mode or up to 400 KBit/s in the fast mode.
標簽: bus bidirectional primarily designed
上傳時間: 2013-12-11
上傳用戶:jeffery
在作業1的Employee和EmployeeDemo兩個類基礎上修改 1,重寫Employee類的toString方法,返回Employee類的相關信息的字符串形式 重寫Employee類的equals方法,如果兩個Employee實例的名字和所屬部門相同,返回true; 并在EmployeeDemo類里面驗證上述兩個方法 2,定義Clerk、Salesman、Engineer三個類,分別繼承自Employee 為Salesman增加一個年銷售額屬性 為Engineer增加一個年消化人月數屬性 3,將下面的描述反映到程序里 普通員工年終獎金分配方案為月薪×2 Salesman:銷售額×2%+月薪×1.8 Engineer:年消化人月數×300+月薪×2.5 Clerk:月薪×2.5
標簽: EmployeeDemo Employee 修改
上傳時間: 2016-10-21
上傳用戶:jeffery
下面的函數LoadBmpFile,其功能是從一個.bmp文件中讀取數據(包括BITMAPINFOHEADER,調色板和實際圖象數據),將其存儲在一個全局內存句柄hImgData中,這個hImgData將在以后的圖象處理程序中用到。同時填寫一個類型為HBITMAP的全局變量hBitmap和一個類型為HPALETTE的全局變量hPalette。這兩個變量將在處理WM_PAINT消息時用到,用來顯示位圖。該函數的兩個參數分別是用來顯示位圖的窗口句柄,和.bmp文件名(全路徑)。當函數成功時,返回TRUE,否則返回FALSE。
標簽: LoadBmpFile 函數
上傳時間: 2016-10-26
上傳用戶:z754970244
All people curious about how Linux works and why it is so efficient will find answers here. After reading the book, you will find your way through the many thousands of lines of code, distinguishing between crucial data structures and secondary ones—in short, becoming a true Linux hacker.
標簽: efficient curious answers people
上傳時間: 2013-12-29
上傳用戶:lifangyuan12