貪吃蛇*要點(diǎn)分析: *1)數(shù)據(jù)結(jié)構(gòu):matrix[][]用來(lái)存儲(chǔ)地圖上面的信息,如果什么也沒(méi)有設(shè)置為false, * 如果有食物或蛇,設(shè)置為true;nodeArray,一個(gè)LinkedList,用來(lái)保存蛇的每 * 一節(jié);food用來(lái)保存食物的位置;而Node類是保存每個(gè)位置的信息。 *2)重要函數(shù): * changeDirection(int newDirection) ,用來(lái)改變蛇前進(jìn)的方向,而且只是 * 保存頭部的前進(jìn)方向,因?yàn)槠渌那斑M(jìn)方向已經(jīng)用位置來(lái)指明了。 其中newDirection * 必須和原來(lái)的direction不是相反方向,所以相反方向的值用了同樣的奇偶性。在測(cè)試 * 的時(shí)候使用了direction%2!=newDirection%2 進(jìn)行判斷。 * moveOn(),用來(lái)更新蛇的位置,對(duì)于當(dāng)前方向,把頭部位置進(jìn)行相應(yīng)改變。如果越界, * 結(jié)束;否則,檢測(cè)是否遇到食物(加頭部)或身體(結(jié)束);如果什么都沒(méi)有,加上頭部, * 去掉尾部。由于用了LinkedList數(shù)據(jù)結(jié)構(gòu),省去了相當(dāng)多的麻煩。
標(biāo)簽: matrix 貪吃蛇 分 數(shù)據(jù)結(jié)構(gòu)
上傳時(shí)間: 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) }
標(biāo)簽: AutomaticPropertiesDefaultValues PropertyInfo Article_src GetPropert
上傳時(shí)間: 2014-11-22
上傳用戶:xaijhqx
(***FlatStyle v4.42.8.0 for DELPHI7 by comerose update***)2007.04.30 更新說(shuō)明1.修正 TFlatListView 標(biāo)題的平面顯示(更加完美).2.增加 TFlatListView 的屬性. ①ColorTitleFace以實(shí)現(xiàn)對(duì)標(biāo)題平面顏色控制. ②ColorTitleCheck選擇時(shí)的CheckBox的顏色控制. ③AllCheck對(duì)列表進(jìn)行全選(只在CheckBoxs為T(mén)rue時(shí)有效). AllCheck=True時(shí)全選列表,AllCheck=False取消全選. ④GroundPic背景圖像來(lái)源. ⑤GroundHas是否使用畫(huà)背景圖像(在OnDrawBackground事件中無(wú)效). ⑥GroundStretch是否放縮背景圖像(在OnDrawBackground事件中無(wú)效). ⑦OnDrawBackground自定義重畫(huà)事件(在GroundHas=false時(shí),事件中有效). ⑧在標(biāo)題中增加一個(gè)列表全選按鈕(CheckBoxs=true和ViewStyle=vsReport時(shí)有效). 如果你之前的程序在OnCustomDraw中有代碼的, 請(qǐng)把這些代碼復(fù)制到OnDrawBackground事件中.3.修正 TFlatListBoxExt 和 TFlatCheckListExt 鼠標(biāo)進(jìn)入時(shí)的變色. (原來(lái)版本當(dāng)列表數(shù)目顯示區(qū)域少于控件區(qū)域時(shí),會(huì)有部分地方不變色的BUG).4.優(yōu)化一些代碼。5.編譯說(shuō)明 ①首先打開(kāi) FlatVcls.dpk 包, 編譯. ②再次打開(kāi) FlatStyle.dpk 包, 編譯. ③成功!6.更詳細(xì)的說(shuō)明,請(qǐng)閱讀內(nèi)部的README.TXT文件.
標(biāo)簽: TFlatListView FlatStyle comerose DELPHI7
上傳時(shí)間: 2013-12-31
上傳用戶:hongmo
最新發(fā)送短信的jar包 COutgoingMessage msg = new COutgoingMessage(mobile , message) msg.setMessageEncoding(CMessage.MessageEncoding.EncUcs2) msg.setStatusReport(true) srv.sendMessage(msg)
標(biāo)簽: COutgoingMessage setMessageEncoding msg message
上傳時(shí)間: 2016-07-29
上傳用戶:大三三
wince EVC 簡(jiǎn)單的圖片瀏覽功能,自已隨意擴(kuò)展 支持 *.bmp *.jpg *.gif *.png 等等 // TODO: Add your control notification handler code here CString defFilter("選中其中一個(gè)文件|*.bmp *.jpg *.gif *.png") CFileDialog dlg(TRUE,NULL,NULL,OFN_ALLOWMULTISELECT,defFilter) if(dlg.DoModal()==IDOK){ PathName=dlg.GetPathName() }
標(biāo)簽: notification control wince TODO
上傳時(shí)間: 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.
標(biāo)簽: System-on-Chip datasheet designed Driver
上傳時(shí)間: 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.
標(biāo)簽: bus bidirectional primarily designed
上傳時(shí)間: 2013-12-11
上傳用戶:jeffery
在作業(yè)1的Employee和EmployeeDemo兩個(gè)類基礎(chǔ)上修改 1,重寫(xiě)Employee類的toString方法,返回Employee類的相關(guān)信息的字符串形式 重寫(xiě)Employee類的equals方法,如果兩個(gè)Employee實(shí)例的名字和所屬部門(mén)相同,返回true; 并在EmployeeDemo類里面驗(yàn)證上述兩個(gè)方法 2,定義Clerk、Salesman、Engineer三個(gè)類,分別繼承自Employee 為Salesman增加一個(gè)年銷(xiāo)售額屬性 為Engineer增加一個(gè)年消化人月數(shù)屬性 3,將下面的描述反映到程序里 普通員工年終獎(jiǎng)金分配方案為月薪×2 Salesman:銷(xiāo)售額×2%+月薪×1.8 Engineer:年消化人月數(shù)×300+月薪×2.5 Clerk:月薪×2.5
標(biāo)簽: EmployeeDemo Employee 修改
上傳時(shí)間: 2016-10-21
上傳用戶:jeffery
下面的函數(shù)LoadBmpFile,其功能是從一個(gè).bmp文件中讀取數(shù)據(jù)(包括BITMAPINFOHEADER,調(diào)色板和實(shí)際圖象數(shù)據(jù)),將其存儲(chǔ)在一個(gè)全局內(nèi)存句柄hImgData中,這個(gè)hImgData將在以后的圖象處理程序中用到。同時(shí)填寫(xiě)一個(gè)類型為HBITMAP的全局變量hBitmap和一個(gè)類型為HPALETTE的全局變量hPalette。這兩個(gè)變量將在處理WM_PAINT消息時(shí)用到,用來(lái)顯示位圖。該函數(shù)的兩個(gè)參數(shù)分別是用來(lái)顯示位圖的窗口句柄,和.bmp文件名(全路徑)。當(dāng)函數(shù)成功時(shí),返回TRUE,否則返回FALSE。
標(biāo)簽: LoadBmpFile 函數(shù)
上傳時(shí)間: 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.
標(biāo)簽: efficient curious answers people
上傳時(shí)間: 2013-12-29
上傳用戶:lifangyuan12
蟲(chóng)蟲(chóng)下載站版權(quán)所有 京ICP備2021023401號(hào)-1