Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
3 votes
3 answers
168 views

Basic python rock papers scissors game (first code)

I'd just appreciate if anyone can suggest some incremental improvements that would help me to think better like a coder. Here is the very basic RPS (rock, paper, scissors). One thing I may next add is ...
Mah Neh's user avatar
  • 51
2 votes
1 answer
123 views

Dial up some obscure stats for the Chutes and Ladders game

Years ago, I wrote some code in Perl for the Chutes and Ladders game. I re-wrote the code here in Python. The code simulates one player in a game to see how many spins of the dial are needed to win ...
toolic's user avatar
  • 3,395
12 votes
2 answers
1k views

Space shooter game using pygame

I have made a space shooter game in pygame with over 800 lines of code (including blank lines). The aim of the game is to kill all of the ships in the game. You start with a small spaceship and one ...
coder's user avatar
  • 121
1 vote
0 answers
56 views

Django Google Authentication App Using OAuthlib and DRF

Context I've been working on a Django-based Google Authentication application, designed to manage OAuth authentication without relying on libraries such as ...
Grajdeanu Alex's user avatar
3 votes
1 answer
81 views

Multiline string concatenation

Problem Description Printing the result of adding two numpy arrays together is very ugly. Here we will use these numpy arrays as an example: ...
mikeLundquist's user avatar
4 votes
1 answer
75 views

Centre of mass based TSP solution (2)

I updated the code to a working state. My previous question. Even if this code working I wonder if I can write this code in a more efficient way. Maybe less for loops Etc. ...
tumr's user avatar
  • 53
2 votes
2 answers
85 views

Checking file header for magic number in Python

I wrote this to check files for successful compression with LZ4. Any advice is welcome. Particularly regarding raising exceptions and error handling. ...
voices's user avatar
  • 767
3 votes
3 answers
171 views

Converting a dict to a list + ID

I wrote this code: PROJECTS_LIST = [ project if not project.update({"project_id": project_id}) else None for project_id, project in PROJECTS.items() ] ...
UCYT5040's user avatar
  • 151
0 votes
1 answer
105 views

Centre of mass based TSP solution

This is the code that I tried to approach to the traveling salesman problem in a new way. As you can see, it does not give such great results. Can I get this idea further, or should I quit to ...
tumr's user avatar
  • 53
2 votes
1 answer
45 views

A selenium web scraper to package NBA data

I'm building a selenium web scraper for basketball-reference.com that takes a player name and returns data in either a JSON format or Pandas DataFrame object. The class in question is one of many that ...
BluffShove's user avatar
2 votes
4 answers
661 views

Adding Node to Linked List

I've been programming for 3 months now, and I've just come across Linked List, and I'm not gonna lie, I've been struggling a little. I wrote this code to practice on Linked Lists. The purpose is to ...
fraber's user avatar
  • 179
4 votes
4 answers
1k views

Creating an O(n) algorithm for an array of integers

To avoid plagiarism in my university, I am going to modify the problem. Henry likes to jump from building to building. The heights of each building are given as a list of H numbers. We also number ...
Duckycodes's user avatar
4 votes
2 answers
288 views

Simple version of NEAT

I have wrote my own simple version of NEAT and want to improve the code for mainly performance (training and runtime of a generation). This simple version of NEAT aims to perform somewhere near as ...
coder's user avatar
  • 121
3 votes
1 answer
122 views

Miller-Rabin implementation is very slow

I implemented the Miller-Rabin-Primetest in python3. But I have the feeling it is very slow. I know that there are faster version in gmpy2 package, but I want to compare it with another code I have in ...
Lereu's user avatar
  • 141
3 votes
1 answer
86 views

Sorting songs with the ability to save and resume partial sorts

I listen to a lot of music (~4k h/y) and managing thousands of songs is a bit of a challenging. To improve my listening experience I want to better organize my collection. One thing I want to do is ...
Peilonrayz's user avatar
  • 43.3k

15 30 50 per page
1
2 3 4 5
345