Git Product home page Git Product logo

analogchess's People

Contributors

byarmis avatar ehulinsky avatar mwufi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

analogchess's Issues

En Passant

Sadly en passant (the funny move) is not implemented yet because I have no idea how it would work.

Maybe if a pawn passes through another pawn's line of attack, the pawn can choose to capture it?

Partially leaving this issue as a reminder to myself to look at code and see if I can even implement this

AI knows everything!!!

This is a story of how Github Copilot can write some code.

Background: We're porting this to Javascript, and getting the initial piece function. You know, the one that goes

pieces = [Rook(0.5,0.5,white),
          Rook(7.5,0.5,white),
          Knight(1.5,0.5,white),
          Knight(6.5,0.5,white),
          Bishop(5.5,0.5,white),
          Bishop(2.5,0.5,white),
          King(4.5,0.5,white),
          Queen(3.5,0.5,white),
... etc

I write

const initialGameState = [
  {type: "pawn", color: "white", x:

COPILOT:

const gameState = [
  { type: "pawn", color: "white", x: 0, y: 1 },
 ...

No, that's not quite right. So I edit it and say x: 0.5. And then it generates the next line

  {type: "pawn", color: "white", x: 0.5, y: 1.5},

Great, let's keep going.

COPILOT:

  {type: "pawn", color: "white", x: 0.5, y: 1.5},
  {type: "pawn", color: "white", x: 1.5, y: 1.5},

Uh... this is looking uncanny. Let's see if it can do the rest.

COPILOT:

  {type: "pawn", color: "white", x: 2.5, y: 1.5},
  {type: "pawn", color: "white", x: 3.5, y: 1.5},
  {type: "pawn", color: "white", x: 4.5, y: 1.5},
  {type: "pawn", color: "white", x: 5.5, y: 1.5},
  {type: "pawn", color: "white", x: 6.5, y: 1.5},
  {type: "pawn", color: "white", x: 7.5, y: 1.5},

The back pieces are the hard part, right? And here's where it just completely goes wild and does everything like you'd expect.

COPILOT:

  {type: "rook", color: "white", x: 0.5, y: 0.5},
  {type: "knight", color: "white", x: 1.5, y: 0.5},
  {type: "bishop", color: "white", x: 2.5, y: 0.5},
  {type: "queen", color: "white", x: 3.5, y: 0.5},
  {type: "king", color: "white", x: 4.5, y: 0.5},
  {type: "bishop", color: "white", x: 5.5, y: 0.5},
  {type: "knight", color: "white", x: 6.5, y: 0.5},
  {type: "rook", color: "white", x: 7.5, y: 0.5},
  {type: "pawn", color: "black", x: 0.5, y: 6.5},
  {type: "pawn", color: "black", x: 1.5, y: 6.5},
  {type: "pawn", color: "black", x: 2.5, y: 6.5},
  {type: "pawn", color: "black", x: 3.5, y: 6.5},
  {type: "pawn", color: "black", x: 4.5, y: 6.5},
  {type: "pawn", color: "black", x: 5.5, y: 6.5},
  {type: "pawn", color: "black", x: 6.5, y: 6.5},
  {type: "pawn", color: "black", x: 7.5, y: 6.5},
  {type: "rook", color: "black", x: 0.5, y: 7.5},
  {type: "knight", color: "black", x: 1.5, y: 7.5},
  {type: "bishop", color: "black", x: 2.5, y: 7.5},
  {type: "queen", color: "black", x: 3.5, y: 7.5},
  {type: "king", color: "black", x: 4.5, y: 7.5},
  {type: "bishop", color: "black", x: 5.5, y: 7.5},
  {type: "knight", color: "black", x: 6.5, y: 7.5},
  {type: "rook", color: "black", x: 7.5, y: 7.5}
];

Copilot knows about analog chess!! ๐Ÿ˜ฎ Literally all I did was type one line and then press tab to keep accepting the rest

No float coordinates issues in pygame 1.9.6

Getting a bunch of errors like these in python 3.8.10+pygame 1.9.6:

pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
analogchessV4.py:47: DeprecationWarning: an integer is required (got type float).  Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
  pygame.draw.polygon(surf, c, pts)
Traceback (most recent call last):
  File "analogchessV4.py", line 1214, in <module>
    piece.draw_paths(pieces)
  File "analogchessV4.py", line 535, in draw_paths
    draw_line_round_corners_polygon(see_through, to_screen_coords((self.start_x,self.start_y)), to_screen_coords(end_pos), RED_HIGHLIGHT, self.radius*2*640/8)
  File "analogchessV4.py", line 48, in draw_line_round_corners_polygon
    pygame.draw.circle(surf, c, p1, round(w / 2))
TypeError: integer argument expected, got float

It's easy to fix by converting all float lengths and coords to int

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.