eupolicy.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
This Mastodon server is a friendly and respectful discussion space for people working in areas related to EU policy. When you request to create an account, please tell us something about you.

Server stats:

192
active users

#Code

14 posts13 participants0 posts today

I can hardly believe it.
Deepseek, which runs locally on my regular laptop WITHOUT internet access, responded to my question of whether it could write me a game in Python similar to “PONG” with the following:

------

Can you write a python scrip to run a game like the classic Pong game?

Thinking...
Okay, so I want to create a Python script for a classic Pong game. Let me
think about how to approach this.

First, I remember that Pong is a two-player game where each player controls
a paddle, and they hit a ball back and forth. The goal is to make the ball
go past the opponent's paddle. So, I need to set up the game window, create
paddles for both players, a ball, and handle their movements.

I think using Pygame would be a good idea since it's a library designed for
creating games in Python. I'll need to initialize Pygame and set up the
display. The screen size can be something like 800x600 pixels. Setting the
title of the window to "Pong" makes sense.

Next, defining colors is important for visibility. White for the paddles and
ball, and black for the background. That should make everything stand out
clearly.

Now, I need to define the game objects: the left paddle, right paddle, and
the ball. Each will have their own positions and dimensions. For example,
the left paddle could be on the left side of the screen, centered
vertically. The same goes for the right paddle but on the opposite side. The
ball should start in the center.

Handling user input is crucial. I'll need to listen for key presses—like the
Up and Down arrows for moving the paddles. For each frame, if a key is
pressed, adjust the paddle's position accordingly. But I also need to make
sure the paddles don't move off the screen, so I should check their
positions against the window boundaries.

The ball movement involves updating its position based on its velocity.
Collision detection with the walls (top and bottom of the screen) will
reverse the y-component of the velocity. When the ball hits a paddle, it
should bounce back, changing the x-component of the velocity. This means I
need to check for collisions between the ball and each paddle.

Scoring is another important aspect. If the ball goes past the left or right
side, the corresponding player gets a point. Updating the score display will
require rendering text on the screen.

Putting it all together, the main loop will handle drawing the objects,
updating positions based on input and physics, checking for collisions, and
managing scoring. I'll also need to set a frame rate using Pygame's clock to
control how fast everything updates.

I should test each part as I go—maybe first make sure the paddles move
correctly without the ball, then add the ball movement, collision with
walls, paddle collisions, and finally scoring. Debugging will be necessary
if something doesn't work right, like the ball not bouncing or the paddles
moving too fast.

In summary, the steps are: set up Pygame, create game objects, handle user
input, move objects, detect collisions, update scores, and display
everything on screen. I'll write the code step by step, making sure each
part works before moving on to the next.
...done thinking.

Certainly! Below is a Python script that creates a classic Pong game using
the Pygame library:

This script creates a simple Pong game with the following features:

1. Two players can play using their respective controls:
- Player on the left uses 'W' and 'S' keys to move up and down.
- Player on the right uses UP and DOWN arrow keys.

2. The ball bounces off the paddles and walls.

3. Points are scored when the ball goes past an opponent's paddle.

4. The score is displayed in the top center of the screen.

To run this game:

1. Make sure you have Pygame installed. If not, install it using pip:
```
pip install pygame
```
import pygame
import random

# Initialize Pygame
pygame.init()

# Set up the display
width = 800
height = 600
window = pygame.display.set_mode((width, height))
pygame.display.set_caption(„Pong Game“)

# Colors
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)

# Paddle dimensions
paddle_width = 10
paddle_height = 100

# Ball dimensions
ball_size = 15

# Paddles positions
left_paddle_y = height / 2 – paddle_height / 2
right_paddle_y = height / 2 – paddle_height / 2

# Ball position and speed
ball_x = width / 2
ball_y = height / 2
ball_speed_x = random.choice([-5, 5])
ball_speed_y = random.choice([-5, 5])

# Score
score_left = 0
score_right = 0
font = pygame.font.Font(None, 36)

# Game loop variables
clock = pygame.time.Clock()
running = True

while running:
# Handle events
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False

# Get keys pressed
keys = pygame.key.get_pressed()

# Move left paddle
if keys[pygame.K_w]:
left_paddle_y -= 5
if keys[pygame.K_s]:
left_paddle_y += 5

more --->

word.undead-network.de/2025/08
#ai #code #deepseek #pygame #python

Replied in thread

@emilymbender Thank you - "#ChatGPT, #Grok, #Claude, #Gemini and Co, however, are not oracles. They are mathematically sophisticated games played with giant statistical databases. Recall in this regard that very few people assume any kind of intelligence, reasoning or sensory experience when using #Midjourney and other early image generators that are built using the same contemporary machine learning paradigm as #LLMs. We know they are just clever #code

"Coders confuse technical power with social change. They think: “If I can write the tool, I can fix the politics.” But tools reflect cultures. Without collective governance, tools just reproduce existing hierarchies."

Good post of @hamishcampbell which reminded me of Aaron Swartz's "all code is political" statement. Sadly, in the "teach all to code" we quietly left out socio-political part - because it makes tons of people uncomfortable.

hamishcampbell.com/why-teach-e

hamishcampbell.comWhy “teach everyone to code” has become a dead-end slogan – Hamish Campbell
More from Hamish Campbell

Ich werde jetzt Embedded-Linux-Entwickler!, Beitrag von Andreas Mützel auf der @FrOSCon

media.ccc.de/v/froscon2025-335

“Das kann doch nicht so schwer sein - ist doch auch nur Linux.” Stimmt das? Was sind typische Unterschiede und Gemeinsamkeiten zu “normalen” Linux-Systemen?

Eingebettete Systeme sind allgegenwärtig, und #Linux findet immer größere Verbreitung als #Betriebssystem dieser Systeme. Was macht ein “Embedded” Linux aus?

Nice little piece on prompt engineering. My additional remark would be that you are hooked to some (paying) service, which is a liability, financially and creatively.

Ultimately GPT5 LLMs might run locally on your own device, but those days aren't there yet. And even still, and then again, you will only be as good a prompt engineer as you can afford to be by the tools (model/device) you own.

LLMs are consumerist development.

dev.to/holasoymalva/programmin

DEV CommunityProgramming Is Becoming PromptingAre we losing coding creativity as AI blurs the lines between programming and prompting? Welcome to the new reality.

Question for accessibility folks and people who rely on screen readers.

I code nav so there’s no link when you’re on a respective page. Like this:

<dd>One</dd>
<dd><a href="/two">Two</a></dd>

But the aria-current attribute can be used with persistent links:

<dd><a href="/one" aria-current="page">One</a></dd>
<dd><a href="/two">Two</a></dd>

Which of these, or using aria-current on a non-linked item, feels the most accessible?