Learn All About Record Types in C#

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 พ.ย. 2024

ความคิดเห็น • 3

  • @ralfiasz
    @ralfiasz 2 ปีที่แล้ว

    Hey! I've been watching you videos for a few days. Very engaging content and style! I was wondering if you could help me bite a school project. It's a game of checkers with the state of the game stored in 4 Longs. Project is to be written in Java. I am clueless, help me Sir if you can. I can't use arrays - those are rewarded with 0 points total.

    • @McCulloughAssociates
      @McCulloughAssociates  2 ปีที่แล้ว

      Hi! So the checkerboard is 8x8, so 64 squares. A long integer is 64 bits. Maybe a 1 means there is a checker in the square and 0 is empty. You have 4 longs, so 1 for reds and 1 for blacks and 1 each for the kinged checkers. You will have to use the bitwise operators &, |, to pack and unpack the bits into the longs. Draw yourself a picture and number the squares from 0 to 63. For instance a value of 3 is 0x0011 which could mean a checker in the 2 lower left squares (dependening on how you number them).

    • @ralfiasz
      @ralfiasz 2 ปีที่แล้ว +1

      @@McCulloughAssociates I did that already Sir. I’m currently working on move validation. Thank you for answering! I love your videos!