Skip to content

Instantly share code, notes, and snippets.

View LaBlazer's full-sized avatar
😢
C++rying

LBLZR_ LaBlazer

😢
C++rying
View GitHub Profile
def sum_tree(w, h):
summ = 0
for i in range(0, h + 1):
print(f"{summ} + {w**i}")
summ += w**i
return summ
def formula_tree(w, h):
return (w**(h + 1) - 1) // (w - 1)
vstupy = {}
vstupy["User"] = ["id", "email", "password", "name", "surname", "aid", "phone"]
vstupy["Courier"] = ["id", "email", "password", "name", "surname", "aid", "phone", "nin", "iban"]
vstupy["Restaurant"] = ["id", "email", "password", "name", "description", "logo", "opening_hours", "aid", "phone", "iban"]
vstupy["Address"]= ["id", "street", "city", "country", "postal_code"]
vstupy["Position"]= ["id", "oid", "latitude", "longtitude", "time"]
vstupy["Menu"]= ["id", "rid", "mid", "name", "price", "picture"]
vstupy["Order"] = ["id", "uid", "cid", "rid", "state", "created", "price", "courier_rating", "restaurant_rating"]
vstupy["OrderItem"]= ["id", "oid", "mid", "amount"]
template<typename T>
void mergeArrays(T arr1[], T arr2[], int n1,
int n2, T arr3[])
{
int i = 0, j = 0, k = 0;
// Traverse both array
while (i<n1 && j <n2)
{
if (arr1[i] < arr2[j])
@LaBlazer
LaBlazer / date_classifier.py
Last active June 3, 2019 11:14
Classifies date formats and outputs them in standard format (day/month/year)
#Kopirajt LBLZR_ lmao
import os.path, codecs, sys
date_files = ["dates1.txt", "dates2.txt", "dates3.txt", "dates4.txt"]
output_file = "dates_out.txt"
def save_list(listt, filename):
with codecs.open(filename, "w", "utf-8") as fp:
#firstly we delete old entries
fp.truncate()
@LaBlazer
LaBlazer / easter.cpp
Last active September 2, 2019 15:42
Easter calculator with HTML export (ProgTest HW3)
#ifndef __PROGTEST__
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <vector>
@LaBlazer
LaBlazer / main.cpp
Last active December 5, 2018 13:33
Default progtest cpp file
#ifndef __PROGTEST__
#define pause() system("pause");
#else
#define pause();
#endif
#include <iostream>
int main() {
std::cout << "test" << std::endl;
@LaBlazer
LaBlazer / knights_tour.cpp
Last active June 24, 2019 21:02
Bruteforce algorithm for calculating Knight's Tour problem
//Copyright LBLZR_
#include <iostream>
#include <vector>
const std::pair<int, int> POSSIBLE_MOVES[] = { {2, -1}, {2, 1}, {1, 2}, {-1, 2}, {-2, 1}, {-2, -1}, {-1, -2}, {1, -2} };
const unsigned int POSSIBLE_MOVES_AMOUNT = sizeof(POSSIBLE_MOVES) / sizeof(POSSIBLE_MOVES[0]);
template <size_t rows, size_t cols>
void copyArray(bool(&in)[rows][cols], bool(&out)[rows][cols]) {
for (unsigned int x = 0; x < rows; x++)
@LaBlazer
LaBlazer / 44.cpp
Last active October 1, 2018 10:58
4x4 game solver
#include <iostream>
#include <thread>
#include <vector>
struct Node {
bool WalkedRight;
bool WalkedDown;
Node() {
WalkedRight = false;
@LaBlazer
LaBlazer / hangman.cpp
Last active September 2, 2019 15:46
Simple hangman game made in C++ using SFML library
#include <string>
#include <iostream>
#include <fstream>
#include <vector>
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
int main()
{
std::vector<std::string> wordlist;
@LaBlazer
LaBlazer / doggo_bot.py
Created February 23, 2018 17:40
Discord bot that posts a doggo picture
# Pls no stealerino licence
import discord, asyncio, os, random
IMG_FOLDER = "dogs"
BOT_TOKEN = "SECRET"
IMG_MESSAGE = ":dog: :dog: :dog:"
client = discord.Client()
if not os.path.isdir(IMG_FOLDER + "/"):