| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 566 人关注过本帖
标题:向各位论坛的坛友求助
只看楼主 加入收藏
小菜小菜
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2006-6-9
收藏
 问题点数:0 回复次数:0 
向各位论坛的坛友求助


各位大哥小弟我Delphi初学编程,还请各位帮个忙,我实在画不出算法流程图了.
还希望各位大哥帮忙写一下
分别有两个按钮: 发牌 洗牌
代码如下:
发牌
procedure TForm1.Button1Click(Sender: TObject);
var i: integer;
nSleep: integer;
Steps: integer;
BZ: integer;
begin
nSleep := 10;
Steps := 3;
BZ := 0;
try
My_Bmp := TBitmap.Create;
for i := 0 to 53 do
begin
My_Bmp.LoadFromResourceName(HInstance, 'CARD_' + IntToStr(Total_Card_Info[i]));
Move_Card(PB, PB.Width div 2, PB.Height div 2, Hand_Card_Info[0, i].X, Hand_Card_Info[0, i].Y, Card_Width, Card_Height, Back_ID, -1, BZ, nSleep, Steps);
PB.Canvas.Draw(Hand_Card_Info[0, i].X, Hand_Card_Info[0, i].Y, My_Bmp);
Hand_Card_Info[0, i].ID := Total_Card_Info[i];
Hand_Card_Info[0, i].Display_YesOrNo := True;
//减少中间的牌
Paint_Send_Middle_Card(PB, MotherCardBack_Rect, PB.Width div 2, 200, 54 - 1 - i, Card_Width, Card_Height, Back_ID, 54);
end;

finally
My_Bmp.Free;//所有牌显示
end;
showmessage('发牌结束')
end;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
T : TRect;
begin
MotherCardBack_Rect := TBitmap.Create ;
MotherCardBack_Rect.Width := PB.Width ;
MotherCardBack_Rect.height := PB.height ;
T := Rect(1,1,PB.Width ,PB.Height );

MotherCardBack_Rect.Canvas.CopyRect(T, PB.Canvas , T);

Card_Space_Card := 14; //发牌后的间距;
Side_Width := 15;
fix_X := 5; //发牌后的X坐标 ;
fix_Y := 15; //发牌后的Y坐标 ;
//初始化发牌的位置:
for i := 0 to 54 - 1 do
begin
Hand_Card_Info[0, i].X := fix_X;
Hand_Card_Info[0, i].Y := fix_Y;
fix_X := fix_X + Card_Space_Card;
end;
end;

洗牌
procedure TForm1.Button5Click(Sender: TObject);
begin
PB.Refresh;
sleep(500);
//洗牌
Wash_Card(Total_Card_Info);
Paint_Send_Middle_Card(PB, MotherCardBack_Rect, PB.Width div 2, 200, 54, Card_Width, Card_Height, Back_ID, 54);
showmessage('洗牌完毕,等待您发牌')
end;



小弟在此感激不尽了!!!

搜索更多相关主题的帖子: procedure 初学编程 流程图 
2006-06-09 02:14
快速回复:向各位论坛的坛友求助
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.067466 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved