Exemple #1
0
        public value GenerateMove( opponent op, ref int bestRow, ref int bestColumn, value alpha, value beta)
        {
            value state, results;
                slotState owner;
                opponent opposite;
                int notNeeded=0;

              //  ttt_count++;
                // See if we have a win
                if ((state = evaluate()) != value.unclear ) {
                  //  depth++;
                    return state;
                }

                // Get the opposite player for the recursive call
                if (op == opponent.X) {
                    owner = slotState.ownedByX ;  opposite = opponent.O; state = alpha;
                }
                else {
                    owner = slotState.ownedByO; opposite = opponent.X; state = beta;
                }

                int x, y;

                for (x=0; x < NumOfRows;x++) {
                    for (y=0; y < NumOfCols; y++) {
                        if (gameBoardSlots[x,y] == slotState.ownedByNull) {
                            SetBoardPositionToOwner(x, y, owner);
                            results = GenerateMove(opposite, ref notNeeded, ref notNeeded, alpha, beta);
                            SetBoardPositionToOwner(x, y, slotState.ownedByNull);

                            if ((op == opponent.X && results > state)||
                                (op == opponent.O && results < state)) {

                                if (op == opponent.X) {
                                    alpha = state = results;
                                }
                                else {
                                    beta = state = results;
                                }

                                bestRow = x; bestColumn = y;

                                if (alpha >= beta) {
                                    return state;
                                }
                            }
                        }
                    }
                }

                return state;
        }
 set => Seek(value, SeekOrigin.Begin);
Exemple #3
0
 Vector.GreaterThanOrEqual(value, s_A) & Vector.LessThanOrEqual(value, s_Z),
Exemple #4
0
 InitializeValue(ref value, Type.GetElementType());
 new return ExpressionValue(value);
Exemple #6
0
 public FixedBall(Core c, value v)
 {
     core = c;
     colour = v;
 }
 /// <summary>
 /// Converts the specified value of type float into a double-precision floating point decimal.
 /// </summary>
 /// <param name="value">The value of type float to convert into a double-precision floating point decimal</param>
 /// <returns>A double-precision floating point decimal created from the specified value</returns>
 public double ToDouble($T value)
 {
     return Convert.ToDouble(value);
 }
 /// <summary>
 /// Converts a specified value of type $T value into a 16-bit short integer
 /// </summary>
 /// <param name="value">A generic of type $T to convert into a short integer</param>
 /// <returns>A short integer representation created from the specified value</returns>
 public short ToInt16($T value)
 {
     return Convert.ToInt16(value);
 }
Exemple #9
0
 TokenOf <Emote> => await GetEmote(value, guild),
Exemple #10
0
 TokenOf <SocketTextChannel> => GetSocketGuildTextChannel(value, client, guild as SocketGuild),
Exemple #11
0
 TokenOf <SocketGuildChannel> => GetSocketGuildChannel(value, guild as SocketGuild),
Exemple #12
0
 TokenOf <SocketGuildUser> => GetSocketGuildUser(value, guild as SocketGuild),
Exemple #13
0
 TokenOf <IGuildUser> => await GetIGuildUser(value, client, guild),
Exemple #14
0
 public MovingBall(Core c, value v)
 {
     core = c;
     colour = v;
 }
 AssertEquals(value, new Integer(1));
Exemple #16
0
 new DbgEngineValueNodeImpl(this, factory.Create(evalInfo, name, value, formatSpecifiers, options, expression, imageName, isReadOnly, causesSideEffects, expectedType));
Exemple #17
0
        /*
         * Update variables for each frame
         */
        public value Update(GameTime gameTime, KeyboardState keyBoardState, GamePadState gamePadState)
        {
            colour = value.none;
            for (int i = ballsSize - 1; i >= 0; i--)
            {
                if (balls[i] != null)
                {
                    if (balls[i].coreDistance > 310)
                    {
                        gameOver = true;
                        return colour;
                    }
                    if (balls[i].IsDead())
                    {
                        colour = balls[i].colour;
                        balls.Remove(balls[i]);
                        ballsSize--;
                    }
                }
            }
            Move(keyBoardState, gamePadState);

            return colour;
        }
Exemple #18
0
 TokenOf <IEmote> => await GetIEmote(value, guild),
 /// <summary>
 /// Converts a specified value of type $T into a 64-bit long integer
 /// </summary>
 /// <param name="value">the value of type $T to convert int a 64-bit long integer</param>
 /// <returns>A 64-bit long integer created from the specified value</returns>
 public long ToInt64($T value)
 {
     return Convert.ToInt64(value);
 }
Exemple #20
0
 TokenOf <IRole> => GetIRole(value, guild),
Exemple #21
0
	void SET_32BIT_WORD(buffer, location, value)	{ buffer[location+0] = (byte)((value)&0xFF); \
													  buffer[location+1] = (byte)((value>>8)&0xFF); \
													  buffer[location+2] = (byte)((value>>16)&0xFF); \
													  buffer[location+3] = (byte)((value>>24)&0xFF); }
Exemple #22
0
 TokenOf <SocketRole> => GetSocketRole(value, guild),
Exemple #23
0
 return string.Format(
     cacheKeyFormat,
     key,
     value == null
         ? string.Empty
Exemple #24
0
 set => Light[0].Emission = new Color(value, ColorFormat.Bgr);
Exemple #25
0
 validate(value, serializer);
 ValorBruto = ValorBrutoMoeda != null ? new Dinheiro(value, Moeda.Obtem(ValorBrutoMoeda)) : Dinheiro.EmReais(value);
Exemple #27
0
 set => Id = MakeId(value, TargetId);
 set => AddNode(value, row, col);
 get => Get(key); set => Put(value, key);
Exemple #30
0
 => parser.Bind(value => int.TryParse(value, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out var integer)
Exemple #31
0
 return(ArrayContains(value, ValidCodes));
Exemple #32
0
 set => ReplaceAt(value, index);
 set => createRender = d => new GameObjectActivateRender(value(d, render));
Exemple #34
0
 set => WriteSettings(value, GuideLinePositionsInChars);
 /// <summary>
 /// Converts a specified value of type $T into a byte value.
 /// </summary>
 /// <param name="value">A value of type $T</param>
 /// <returns>A byte converted from the specified value of type $T</returns>
 public byte ToByte($T value)
 {
     return Convert.ToByte(value);
 }
 OnLayoutChangedInternal?.Invoke(value, showEnvironmentPanel);
 /// <summary>
 /// Converts the specified valud of type $T into a 32-bit integer
 /// </summary>
 /// <param name="value">a value of type $T to convert into a 32-bit integer</param>
 /// <returns>an 32-bit integer created from the specified value</returns>
 public int ToInt32($T value)
 {
     return value;
 }
Exemple #38
0
this.FadeColour(value ? Color4.White : defaultColour, 500, Easing.OutQuint);
 /// <summary>
 /// Converts the specified value of type $T value into a single-precision floating point decimal.
 /// </summary>
 /// <param name="value">A value of type $T to into a single precision floating point decimal</param>
 /// <returns>A single-precision floating point decimal created from the specified value.</returns>
 public float ToSingle($T value)
 {
     return Convert.ToSingle(value);
 }
 set => SetObject(value, i);
 /// <summary>
 /// Converts a specified value of type $T into an object
 /// </summary>
 /// <param name="value">The value of type $T to convert into an object</param>
 /// <returns>The specified value cast as an object.</returns>
 public object ToObject($T value)
 {
     return (object)value;
 }
Exemple #42
0
 if (Equals(value, _carWrapper))
 {
     return;
Exemple #43
0
	void SET_16BIT_WORD(buffer, location, value)	{ buffer[location+0] = (byte)((value)&0xFF); \
													  buffer[location+1] = (byte)((value>>8)&0xFF); }
Exemple #44
0
 add => NetworkChange.NetworkAvailabilityChanged    += _networkAvailabilityChanged.MapForAttachment(value, abstraction => ((sender, args) => abstraction(sender, args.ToInterface())));
 return Math.Max(Math.Min(value, high), low);
 if (Equals(value, _quickDrivePresets))
 {
     return;
Exemple #47
0
 set => SetValue(value, x, y);
Exemple #48
0
 if (Equals(value, _track))
 {
     return;
Exemple #49
0
 /*
  * Constructo for FixedBall
  * */
 public FixedBall(Core c, value v)
     : base(c,v)
 {
 }
 context.write(null, new Text(value.toString()));