本文整理汇总了C#中Fields.SetField方法的典型用法代码示例。如果您正苦于以下问题:C# Fields.SetField方法的具体用法?C# Fields.SetField怎么用?C# Fields.SetField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Fields
的用法示例。
在下文中一共展示了Fields.SetField方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Mini
private int Mini(int depth, int alpha, int beta, Fields.Field field)
{
if (depth == 0)
{
return Valuation(field, AIPlayer);
}
int localBeta = int.MaxValue - 1;
for (int i = 0; i < field.Length; i++)
{
if (field.IsFieldEmpty(i))
{
field.SetField(i, AIPlayer);
int wert = Max(depth, alpha, beta, field);
field.SetField(i, ' ');
if (wert < localBeta)
{
if (wert < alpha)
{
bestZug = i;
return wert;
}
localBeta = wert;
if (wert < beta)
{
beta = wert;
}
}
}
}
return localBeta;
}
示例2: Max
private int Max(int depth, int alpha, int beta, Fields.Field field)
{
if (depth == 0)
{
return Valuation(field, HumanPlayer);
}
int localAlpha = int.MinValue + 1;
for (int i = 0; i < field.Length; i++)
{
if (field.IsFieldEmpty(i))
{
field.SetField(i, HumanPlayer);
int wert = Mini(depth - 1, alpha, beta, field);
field.SetField(i, ' ');
if (wert > localAlpha)
{
if (wert > beta)
{
bestZug = i;
return wert;
}
localAlpha = wert;
if (wert > alpha)
{
alpha = wert;
}
}
}
}
return localAlpha;
}
示例3: TestForLineComplettings
private int TestForLineComplettings(Fields.Field field, char player)
{
int ret = -1;
for (int playerpos = 0; (playerpos < field.Length) && (ret == -1); playerpos++)
{
if (field.IsFieldEmpty(playerpos))
{
field.SetField(playerpos, player);
if ((Logik.WinChecker.Pruefe(SitCodeHelper.ToPlayer(player), field)) && (ret == -1))
ret = playerpos;
field.SetField(playerpos, ' ');
}
}
return ret;
}
示例4: GetRandomField
public static Fields.Field GetRandomField(Fields.Field field)
{
char player = '2';
for (int i = 0; i < field.Length; i++)
{
field.SetField(GetRandomZug(field), player);
player = Player.Player.PlayerChange(player);
}
return field;
}