Skip to content

Instantly share code, notes, and snippets.

@sethprog26
sethprog26 / template.cpp
Created May 10, 2021 07:58
Chapter 19 drill
#include <iostream>
#include <vector>
using namespace std;
template <typename T> struct S {
private:
T val;
public:
@sethprog26
sethprog26 / arrv.cpp
Created May 10, 2021 07:53
Class 8 Drill
#include <iostream>
#include <vector>
int ga[10] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512};
void f(int array[], int size) {
int la[10];
for (int i = 0; i < size; i++) {
la[i] = array[i];
@sethprog26
sethprog26 / vector.cpp
Created May 10, 2021 07:40
Class 12 Drill
#include "std_lib_facilities.h"
template<typename T, typename A = allocator<T>>
class our_vector {
A alloc;
size_t sz;
T* elem;
size_t space;
public:
@sethprog26
sethprog26 / proj.cpp
Created May 6, 2021 21:27
Project From Ademitan Akinlade-Fajemirokun
#include <iostream>
#include <string>
using namespace std;
void printRules() {
cout << "Rules:\n"
<< " * The player who has three horizontally adjacent pieces, loses\n"
<< " * The player who has three vertically adjacent pieces, loses\n"
<< " * The player who has three diagonally adjacent pieces, loses\n"