Advertisement
C_Volume2 Games #81432

connect4.cpp

The classic game of connect 4. Only 2 player play. Uses BGI graphics. Has good visuals.

AI

Tóm tắt bởi AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Mã nguồn
original-source
Upload
<font face="courier new" size="-1">
<b>unit</b> Unit1;<br /><br />
<b>interface</b><br /><br />
<b>uses</b><br />
&nbsp;&nbsp;Windows,<br />
&nbsp;&nbsp;Messages,<br />
&nbsp;&nbsp;Forms;<br /><br />
<b>type</b><br />
&nbsp;&nbsp;TForm1 = <b>class</b>(TForm)<br />
&nbsp;&nbsp;<b>protected</b><br />
&nbsp;&nbsp;&nbsp;&nbsp;<b>procedure</b> WMNCHitTest(<b>var</b> Msg: TWMNCHitTest); <b>message</b> WM_NCHITTEST;<br />
&nbsp;&nbsp;<b>end</b>;<br /><br />
<b>var</b><br />
&nbsp;&nbsp;Form1: TForm1;<br /><br />
<b>implementation</b><br /><br />
<font color="#000080">{$R *.DFM}</font><br /><br />
<b>procedure</b> TForm1.WMNCHitTest(<b>var</b> Msg: TWMNCHitTest);<br />
<b>begin</b><br />
&nbsp;&nbsp;<font color="#000080">// Call default procedure</font><br />
&nbsp;&nbsp;<b>inherited</b>;<br /><br />
&nbsp;&nbsp;<font color="#000080">// Modify result to make windows think we're<br />
&nbsp;&nbsp;// clicking on the titlebar when we're actually<br />
&nbsp;&nbsp;// clicking on the client area...</font><br />
&nbsp;&nbsp;<b>if</b> Msg.Result = HTCLIENT <b>then</b><br />
&nbsp;&nbsp;&nbsp;&nbsp;Msg.Result := HTCAPTION;<br />
<b>end</b>;<br /><br />
<b>end</b>.<br />
</font>
Bình luận gốc (3)
Được khôi phục từ Wayback Machine