Example #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);
Example #3
0
 Vector.GreaterThanOrEqual(value, s_A) & Vector.LessThanOrEqual(value, s_Z),
Example #4
0
 InitializeValue(ref value, Type.GetElementType());
 new return ExpressionValue(value);
Example #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);
 }
Example #9
0
 TokenOf <Emote> => await GetEmote(value, guild),
Example #10
0
 TokenOf <SocketTextChannel> => GetSocketGuildTextChannel(value, client, guild as SocketGuild),
Example #11
0
 TokenOf <SocketGuildChannel> => GetSocketGuildChannel(value, guild as SocketGuild),
Example #12
0
 TokenOf <SocketGuildUser> => GetSocketGuildUser(value, guild as SocketGuild),
Example #13
0
 TokenOf <IGuildUser> => await GetIGuildUser(value, client, guild),
Example #14
0
 public MovingBall(Core c, value v)
 {
     core = c;
     colour = v;
 }
Example #15
0
 AssertEquals(value, new Integer(1));
Example #16
0
 new DbgEngineValueNodeImpl(this, factory.Create(evalInfo, name, value, formatSpecifiers, options, expression, imageName, isReadOnly, causesSideEffects, expectedType));
Example #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;
        }
Example #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);
 }
Example #20
0
 TokenOf <IRole> => GetIRole(value, guild),
Example #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); }
Example #22
0
 TokenOf <SocketRole> => GetSocketRole(value, guild),
Example #23
0
 return string.Format(
     cacheKeyFormat,
     key,
     value == null
         ? string.Empty
Example #24
0
 set => Light[0].Emission = new Color(value, ColorFormat.Bgr);
Example #25
0
 validate(value, serializer);
 ValorBruto = ValorBrutoMoeda != null ? new Dinheiro(value, Moeda.Obtem(ValorBrutoMoeda)) : Dinheiro.EmReais(value);
Example #27
0
 set => Id = MakeId(value, TargetId);
Example #28
0
 set => AddNode(value, row, col);
Example #29
0
 get => Get(key); set => Put(value, key);
Example #30
0
 => parser.Bind(value => int.TryParse(value, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out var integer)
Example #31
0
 return(ArrayContains(value, ValidCodes));
Example #32
0
 set => ReplaceAt(value, index);
 set => createRender = d => new GameObjectActivateRender(value(d, render));
Example #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);
 }
Example #36
0
 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;
 }
Example #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;
 }
Example #42
0
 if (Equals(value, _carWrapper))
 {
     return;
Example #43
0
	void SET_16BIT_WORD(buffer, location, value)	{ buffer[location+0] = (byte)((value)&0xFF); \
													  buffer[location+1] = (byte)((value>>8)&0xFF); }
Example #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;
Example #47
0
 set => SetValue(value, x, y);
Example #48
0
 if (Equals(value, _track))
 {
     return;
Example #49
0
 /*
  * Constructo for FixedBall
  * */
 public FixedBall(Core c, value v)
     : base(c,v)
 {
 }
 context.write(null, new Text(value.toString()));