Skip to content

Instantly share code, notes, and snippets.

View tinwritescode's full-sized avatar
🏝️
Working remotely

Tin Nguyen tinwritescode

🏝️
Working remotely
View GitHub Profile
CXX := g++
CXX_FLAGS := -std=c++17 -ggdb -Wall
BIN := bin
INCLUDE := include
LIBRARIES :=
EXECUTABLE := main
#include "function.h"
char* reverseString(char *str) {
const int N = strlen(str);
for(int i = 0; i < N / 2; i++) {
swap(str[i], str[N - i - 1]);
}
return str;
char* humanlizeString(const char *str) {
char *result = new char[strlen(str) * 10];
const char *name[] = {
"nghin", "trieu", "ti"
};
const char *number[] = {
"khong", "mot", "hai", "ba", "bon",
"nam", "sau", "bay", "tam", "chin"
};
#include <iostream>
#include "Dice.h"
#include "../Random/Random.cpp"
using namespace std;
int main()
{
Dice dice;
char option;
@tinwritescode
tinwritescode / Dice.cpp
Created July 13, 2020 01:16
from Project 2 OOP, HCMUS
#include "Dice.h"
Dice::Dice()
{
m_rollTime = 0;
m_totalRoll = 0;
m_rollValues[0] = -1;
memset(m_rollValues, 0, sizeof(m_rollValues));
"An","Anh","Ao","Ánh","Ân","Âu Dương","Ấu","Bá","Bạc","Bạch","Bàn","Bàng","Bành","Bảo",
"Bế","Bì","Biện","Bình","Bồ","Chriêng","Ca","Cái","Cai","Cam","Cảnh","Cao","Cáp","Cát",
"Cầm","Cấn","Chế","Chiêm","Chu/Châu","Chung","Chúng","Chương","Chử","Cồ","Cổ","Công",
"Cống","Cung","Cù","Cự","Dã","Danh","Diêm","Diệp","Doãn","Dư","Đái","Điều","Đan","Đàm",
"Đào","Đầu","Đậu","Đèo","Điền","Đinh","Điêu","Đoàn","Đôn","Đống","Đồ","Đồng","Đổng","Đới",
"Đương","Đường","Đức","Đăng","Giả","Giao","Giang","Giàng","Giáp","H'","H'ma","H'nia","Hầu",
"Hà","Hạ","Hàn","Hán","Hề","Hi","Hình","Hoa","Hồng","Hùng","Hứa","Hướng","Kông","Kiểu","Kha",
"Khà","Khương","Khâu","Khiếu","Khoa","Khổng","Khu","Khuất","Khúc","Kiều","Kim","Khai","Lyly",
"La","Lã","Lãnh","Lạc","Lại","Lăng","Lâm","Lèng","Lều","Liêu","Liễu","Lò","Lô","Lỗ","Lộ","Luyện",
"Lục","Lư","Lương","Lưu","Lý","Mùa","Ma","Mai","Mang","Mã","Mạc","Mạch","Mạnh","Mâu","Mầu/Màu",
std::sort(students.begin(), students.end(), [](std::shared_ptr<Student> a, std::shared_ptr<Student> b) {
return a->getAvgMark() > b->getAvgMark();
});
#include <windows.h>
#include <stdio.h>
#include <string>
#include <typeinfo>
#include <iostream>
using namespace std;
int ReadSector(LPCWSTR drive, int readPoint, BYTE sector[512])
{
from PIL import Image
import numpy as np
import re
IMG_PATH = "map.bmp"
INPUT_PATH = "input.txt"
OUTPUT_PATH = "output.txt"
def bitmapToArray(path):
image = Image.open("map.bmp")
// SPDX-License-Identifier: MIT
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
// File: contracts/IUniswapV2Router01.sol
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {