python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
I have an if-else statement with over 100 "elses". Any ideas on how to condense this?
I've coded a game in oTree for research purposes and the code below does exactly what I intend. The problem is that some games have over 100 rounds so you can see how the code could get ridiculously l...
Cameron Kormylo
Votes: 0
Answers: 3
Implementation of a function to check who wins on a TicTacToe game
This is my first approach to programming and I'm trying to create a TicTacToe game.At the moment, I'm doing a function that checks if a winning play is happening, but I'm sure that there are better wa...
Daiana Terranova
Votes: 0
Answers: 1
Is there a way to compress a check that returns a nullable boolean this into 1-2 lines?
I'm making a simple C# console app and the user has to input either a 1 or a 2 to select their option, and obviously since the user can enter absolutely anything, I need to make a check that returns t...
Nick
Votes: 0
Answers: 3
Optimise a function with numerous conditions that depends on the previous row in a Python dataframe
I have the following dataframe:
country_ID
ID
direction
date
ESP_1
0
IN
2021-02-28
ENG
0
IN
2021-03-03
ENG
0
OUT
2021-03-04
ESP_2
0
IN
2021-03-05
FRA
1
OUT
2021-03-07
ENG
1
OUT
2021-...
Carola
Votes: 0
Answers: 1