【正文】
break。inumPlayers+1。} for(i=0。i++) { m = (i+numPlayers) % numPlayers。 //倍數(shù),發(fā)了幾圈了 splayer[m+1].pcards[n1].value =card54[i].value 。 splayer[m+1].pcards[n1].num =card54[i].num 。 numCards。 } //m_player1=1 號 : \r。//1 號玩家的牌 //m_player2=2 號 : \r。//2 號玩家的牌 //m_player3=3 號 : \r。//3 號玩家的牌 m_front= 。 for(int land=1。land++) if(splayer[land].m_blandowner==true) { switch(land){ case 1: //1 號是地主 m_player1+=Card2CStrMsg(splayer[1].pcards+17,3)。 case 2: //2 號是地主 m_player2+=Card2CStrMsg(splayer[2].pcards+17,3)。 case 3: //3 號是地主 m_player3+=Card2CStrMsg(splayer[3].pcards+17,3)。 }//switch }//if } void playingCards:: outcards(player amp。 getlenpc(ThisPlayer)。 splayer[currently_ply].m_bmytime=true。 //Accord with Rules Acrd_w_Rules=out_legal(ThisPlayer)。 m_strouttemp=illegal outcards:\r。 } // : implementation file //只出示部分代碼 ,詳細請參閱磁盤 圖 A5 serverSocketDlg 成員清單 include 畢業(yè)設(shè)計 29 include include include include include void CServerSocketDlg::Broadcast2Everyone(Cs amp。 int current_seats=0。 =0。 POSITION pos。 pSocket=(CClientSocket*)()。 =++next。msg)。 =1。 } 畢業(yè)設(shè)計 30 void CServerSocketDlg::OnReceive(CClientSocket *pSocket) { CString temp=_T()。 CString p_strName。 static int AllIsReady=0。 static int HighestPoint=0。//前面最近那個沒有 pass 的人 static int pass_times=0。 Cs msg。msg)。 //= 。 switch() //0:登錄 1:退出 2:準備 3:叫牌 4:出牌 5:pass 6:計分 { //不同的 case 對應不同的操作 ,然后將結(jié)果通過廣播到每個客戶端 . 畢業(yè)設(shè)計 31 //詳細請參看磁盤 } }//OnReceive() 客店端對出牌的顯示控制 //出牌 if(==0)//如果出牌不合法,可以有機會再出 { //flashAction:提示某個玩家出牌有錯,可以再重新 出牌 if(==) { AfxMessageBox(出牌不合法 )。 } else { (,DoAgainDOP )。 }//if(==0)//如果出牌不合法,可以有機會再出 if(!=1)m_bFirstOut=false。 m_str2Card(m_strpcards,card20)。 strcat(flashBuffer, INITDIZHU )。 (, flashBuffer)。 } else{//玩家收到回音 (, ClearButtons )。 m_strselectcards=InputString()。 } else{ (, DaOrPass )。 } } if( != ) { testingVar2 = 。 // myself is 2 testingVar4 = m_bFirstOut。 m_str2Card(m_stroutcards,cardHit)。 if (m_bFirstOut == 1) strcat(flashBuffer, zhuFirstDa )。 strcat(flashBuffer,getViewNumStr(, ))。 itoa (numCardsToFBuffer,NumbCardsToHit,10)。 strcat(flashBuffer, )。 (, flashBuffer)。 for(int hitCount=0。hitCount++) cardHit[hitCount].value=1。 m_stroutcards=廣播: +Broadcast。 畢業(yè)設(shè)計 34 附錄 B 網(wǎng)絡斗地主的規(guī)則簡介 一幅牌常規(guī)知識: 游戲人數(shù): 3 人。 一局: 從開牌到打完所有的牌,稱為一局。 牌套: 可出的牌套包括: ◆ 火箭:即雙王(雙花牌),什么牌 型都可打,是最大的牌。除火箭和比自己大的炸彈外,什么牌型都可打。 ◆ 對牌:兩個牌點相同的牌。 ◆ 三帶一手:三張牌 + 一張單牌或一對牌。例如: 3+4+5+6+7+8。 ◆ 雙順:三個或更多連續(xù)的對牌。不包括2和大、小王。例如: 33344 444555666777。 ◆ 飛機帶翅膀:三順+同數(shù)量的一套牌。例如: 5555+ 3+ 8或 4444+ 55+ 77 牌點大?。? 大王 小王 2AKQJ109876543 牌套的大?。? ◆ 火箭 什么牌型都可打,是最大的牌。 ◆ 對其他牌套而言,只有當牌套和總張數(shù)相同的牌,才可比較大小。 有效炸彈或火箭: 如果發(fā)牌時直接發(fā)出炸彈或火箭,計分時不翻番。 一幅牌游戲過程: 開牌: 游戲開始時,由打牌服務器將一副牌隨機留三張底牌,其他牌隨機發(fā)給三家。 叫牌: 第一局首個叫牌人由系統(tǒng)隨機指定,以后每局按逆時針順序輪流開始叫牌。 如果有人“叫牌”直接 叫“ 3 分”,后面的玩家就沒有“叫牌”機會了。地主確定后,將三張底牌亮明,所有玩家都能看到,并且將三張底牌交給地主。 基礎(chǔ)分: 地主所叫的分值。以后每輪都由上一輪的最后出牌人發(fā)牌。輪到玩家跟牌時,可選擇不跟,或者用比所出的牌大的牌套管住,稱為上牌。 一輪結(jié)束: 一輪牌中當某玩家出牌后,其余兩位玩家不再跟牌時,此輪結(jié)束。 一局結(jié)束: 當一玩家手中的牌全部打光時,一局牌結(jié)束,開始定勝負。 一幅牌計分: 基礎(chǔ)分:叫牌的底分,有“ 1分”“ 2分”“ 3 分”; 地主勝:地主得 2 叫牌的底分,其余兩家各得: — 叫牌的底分; 地主敗:地主得 — 2 叫牌的底分,其余兩家各得: 叫牌的底分; 每出一個有效炸彈(或火箭),分數(shù) 2 ; 地主把牌出完,其余兩家一張牌都沒出,分數(shù) 2 ; 兩家中有一家 出完牌,而地主僅僅出過一手牌,分數(shù) 2 。s 72hour visafree policy has attracted wide attention from both Chinese and foreign experts and businessmen since it took effect on Sept 1 last year. The program permits citizens from 51 countries and regions including the United States, Australia, Canada and Japan who have valid visas and flight tickets to a third country to spend three days in the city. The capital of Sichuan pro vince is the first city in the western region of China to offer foreign tourists a threeday visa and the fourth nationwide to adopt the policy following Shanghai, Beijing and Guangzhou. Li Zhiyong, deputy dean of the tourism 畢業(yè)設(shè)計 37 institute at Sichuan University, said the move contributes to a large increase in the number of overseas tourists and raises the city39。s largest breeding and research center. Three days are long enough for foreign visitors to visit those iconic tourist spots, he noted. The city is home to the remains of the Jin sha civilizat ion that dates back more than 3,000 years as well as the Qing cheng Mountains and the Du jiang yan irrigation system. Qing cheng has long been recognized as the birthplace of Taoism, China39。s business development. Rudy Buttignol, president of the public broadcasting pany in British Columbia, Canada, said his work requires frequent travel to Chengdu and the policy makes the trips easier. Data from the city39。s cooperation with Central Asian countries, a senior official said. Shaanxi Governor Lou Qinjian said the province is fresh, rich and unique, as it was when it anchored one end of the ancient Silk Road. It is the best option for acmodating industrial transfers from East China or the world at large, he said on Wednesday in Xi39。an, the starting point of the ancient Silk Road, a trade channel established more than 2,000 years ago linking China, Central Asia and Europe.