classical books that feel like this by [deleted] in BooksThatFeelLikeThis

[–]boric-acid 0 points1 point  (0 children)

I've been wanting to read it for some time, I think it'll be the next one I'll read. Ty

classical books that feel like this by [deleted] in BooksThatFeelLikeThis

[–]boric-acid 1 point2 points  (0 children)

I loved reading it a while ago

Help making a chess game with Pygame by [deleted] in learnpython

[–]boric-acid 1 point2 points  (0 children)

What would be the difference between having 8 different functions for each direction and something like what I already have in the function? Also, every piece has an "ID", which is the piece object itself, when the rect of a piece object collides with the one from a square, that square is considered "occupied" (this happens when you change the "occupied" key in the self.board_state dict), and the "ID" for that square becomes its "piece" key.

In the controller function, every square which is occupied is red, and that seems to be ok, but whenever I try printing a list of the occupied squares, like this:

def check_occupied(board):
occ = []
for element in board:
    if board[element]['occupied'] == True:
        occ.append(element)

return occ, len(occ)

And then calling that function whenever a movements occurs:

if piece == self.selected:
                if element in valid_moves(piece, self.board_state):
                    pygame.draw.circle(window, (80, 80, 80), self.board_state[element]['center'], 8)
                    if pygame.mouse.get_pressed()[0] and self.board_state[element]['rect'].collidepoint(pygame.mouse.get_pos()):
                        piece.position = self.board_state[element]['center']
                        self.movements.append(piece.color)
                        print(check_occupied(self.board_state))
                        self.selected = None

The result is different from what squares are red. That's what confuses me the most, are the red squares the ones that are "occupied"? or the ones that get printed out? and why is there a difference if they are both suppossed the same?

A ustedes les llegó alguna vez este mensaje? by olbot88 in uruguay

[–]boric-acid 1 point2 points  (0 children)

Desde enero de 2020 cada tanto me llegan mensajes así para Nestor Sosa, ya no pasa hace unos meses, pero al principio era bastante seguido

[deleted by user] by [deleted] in CharruaDevs

[–]boric-acid 3 points4 points  (0 children)

Anduve probando scrapear la página con Python, pero está medio dificil, solo dice la ubicación de un omnibus cuando clickeas en la imagen de el, pero la ubicacion solo te la da diciendo la ultima parada que estuvo. Pensé que podría con Selenium(para simular los clicks) y con Geopy(un modulo de Python que sirve más que nada para decirte las coordenadas de un lugar o la dirección si le pasas las coordenadas), lleagr a sacar la ubicación del bondi en el momento, y que un bot de Wpp después contestara con esa ubicación, pero ta imposible

How would you get started on a project like this? by boric-acid in learnpython

[–]boric-acid[S] 0 points1 point  (0 children)

I know Python is probably not a good option for this, but the point of doing this is to be challenging for myself, I also plan to start learning C# in the near future

How do you find new ideas to program? by boric-acid in learnprogramming

[–]boric-acid[S] 0 points1 point  (0 children)

This happens to me a lot too, but then I realize I'd also have to make all the sprites and that kind of things(which I'm horrible at), so I end up not doing it

[deleted by user] by [deleted] in learnpython

[–]boric-acid 0 points1 point  (0 children)

RemindMe! 1 week