All Questions
623 questions
8
votes
2
answers
956
views
2D block game like Minecraft
I have been working on a 2D block game. I like the progress I am making, but I would like to improve the performance and the overall quality of the code. The code and textures are stored in my GitHub ...
6
votes
2
answers
255
views
(HackerRank) Project Euler+ #250: 250250
Link to problem: linkNumber of solvers: 27 out of 844Solve rate (per person): 3.199%Success rate (over all submissions): 1.78%
Project Euler+ on HackerRank is basically supposed to be a generalization ...
3
votes
1
answer
99
views
Optimizing sieving code for the Multiple Polynomial Quadratic Sieve
I wrote code for the multiple polynomial quadratic sieve (MPQS) here:
...
2
votes
2
answers
260
views
Infinite 2d block world (2d minecraft) with chunk system, physics and slower loading
Follow up from this question. I have added a slower loading system that allows the main game to run faster but I still get under 30 fps with caves even if I allow the player to outrun the loading. I ...
4
votes
1
answer
125
views
Calculate optimal game upgrades, v2
This is the second iteration of the code I originally posted here: Calculate optimal game upgrades. Based on the feedback there, I chose to change the code to use a dynamic programming approach with ...
5
votes
4
answers
2k
views
Calculate optimal game upgrades
I'm looking for ways to improve the performance of this code. Using numba helps performance, but I'm not sure how to further improve it. Any (relatively) simple ...
7
votes
3
answers
855
views
Generate all the free polyominoes who's width and height is no larger than 8
I'm working on a puzzle game and I need all the free polyominoes that can fit into an 8 by 8 grid. My code uses Redelmeier's Alogorithm for enumerating them, checks them for rotations and reflections, ...
1
vote
2
answers
151
views
Printing a pattern of input string in X shape
Context:
Write a program to print the output for the given input(Example is given in comments of my code). String is of odd length.
I would be grateful if anyone could give feedback on my following ...
8
votes
5
answers
828
views
adding data to a CSV file for it to be read
I'm making a program that lets you enter a name and house that adds it to the CSV file for it to be read and print out "Tre is in house Dragon", etc. The code works; I'm just wondering if ...
1
vote
1
answer
287
views
Rules-engine to be improved/simplified for Efficiency (performance), Extensibility and Maintenance?
This is a simple implementation of a rules engine. I am really hating the very long MATCH/CASE function. I am wondering what kind of Design Patterns could be used there to make this code more ...
3
votes
5
answers
2k
views
How do I speed up this simulation program
This is a program to solve a differential equation numerically using Euler method. As of now, it is very slow, and I need to run 10000 Monte Carlo simulations.
The differential equation is called ...
1
vote
2
answers
77
views
Using odd prime powers, my heuristic tries to solve instances of Exact 3 Cover in polytime, what can be done to optimize it?
By the way, a heuristic is not the same thing as a proven working algorithm that solves all input instances. It could either be experimental or be used to study intricacies in a problem.
The purpose ...
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 ...
5
votes
2
answers
336
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 ...
1
vote
2
answers
132
views
Miller-Rabin prime test
I have an implementation of the Miller-Rabin prime test, coded in Python 3.
I want to use that as a comparison to a prime test which I coded myself.
Unfortunately I have no idea how "fast" ...