Skip to content

Instantly share code, notes, and snippets.

@nuoxoxo
nuoxoxo / game_of_life.cpp
Created December 27, 2021 13:09
Conway's Game of Life - C++/Terminal
#include <iostream>
#include <sstream>
#include <vector>
#include <ctime>
using namespace std;
using vvi = vector<vector<int>>;
// DRIVE
@nuoxoxo
nuoxoxo / get_num.cpp
Created October 22, 2021 22:53
c++ : get numbers from a string
while (getline(std::cin, s))
{
stringstream ss(s);
while (!ss.eof())
{
ss >> temp;
if (stringstream(temp) >> n)
cout << n << " ";
}
cout << endl;
@nuoxoxo
nuoxoxo / scanf_regex.md
Last active October 10, 2021 12:28
scanf regex + rounding float to 1 decimal place
input as output
12
4.0
Hello, World!
#include <stdio.h>

int main(void)
let multiply = function(num1, num2) {
if(isNaN(num1) || isNaN(num2)) return ''
let len1 = num1.length,
len2 = num2.length
let ans = []
for (let i = len1 - 1; i >= 0; i--) {
for (let j = len2 - 1; j >= 0; j--) {
let index1 = i + j,
h = 0
while True:
try:
h = int(input("Height: "))
except ValueError:
continue
if int(h) < 1 or int(h) > 64:
continue
else:
break