Skip to content

Instantly share code, notes, and snippets.

View Raures's full-sized avatar

Rareș Munteanu Raures

  • Romania, Europe
View GitHub Profile
@Raures
Raures / pluses_and_minuses.cpp
Last active May 9, 2022 17:07
A short and simple string concatenation in C++
/*
Write a function solution that returns a string of length N consisting
of alternating characters: "+" and "-", starting with a "+" character.
You can assume N is between 1 and 100. For ex, given N=5,
your function should return "+-+-+" and given N=4, it should return "+-+-".
*/
#include <iostream>
std::string compose(int n) {
@Raures
Raures / game_of_golf.cpp
Last active May 9, 2022 17:05
A short and simple golf problem in C++
/*
In the game of golf, each hole has a par, meaning,
the average number of strokes a golfer is expected
to make in order to sink the ball in the hole to
complete the play.
Depending on how far above or below par your strokes are,
there is a different nickname.
Your function will be passed par and strokes arguments.
Return the correct string according to this table which
@Raures
Raures / ui-to-py-converter.py
Last active May 8, 2022 06:09
Easy drag and drop *.ui to *.py converter with GUI.
from PyQt5 import QtCore, QtGui, QtWidgets
from pathlib import Path
import os
import sys
# Variable that holds the path where the .py file will be placed
savePath = ""
# Variable that holds the path/name of the settings file
settingsFilePath = Path("settings.txt")