Skip to content

Instantly share code, notes, and snippets.

View tyqualters's full-sized avatar

Ty Qualters tyqualters

View GitHub Profile
Computer Information:
Manufacturer: Micro-Star International Co., Ltd.
Model: MPG B550 GAMING EDGE WIFI (MS-7C91)
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: AuthenticAMD
CPU Brand: AMD Ryzen 7 5800X 8-Core Processor
CPU Family: 0x19
Computer Information:
Manufacturer: Micro-Star International Co., Ltd.
Model: MPG B550 GAMING EDGE WIFI (MS-7C91)
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: AuthenticAMD
CPU Brand: AMD Ryzen 7 5800X 8-Core Processor
CPU Family: 0x19
CPU Model: 0x21
@tyqualters
tyqualters / example.cpp
Last active June 26, 2023 04:15
Rust-based runtime ownership and borrowing implemented into C++
/**
* This is a C++ example of implementing Rust Lifetimes for memory safety.
* Note: This is more relevant to Runtime assurance, not so similar to Rust's compile time assurance.
*/
#include <iostream>
#include "lifetime.hpp"
auto add(Lifetime<int> b) /* Lifetime<int>& would be the same instance */ {
b.set(b.get() + 5);
std::cout << "Value of 'b' is: " << b.get() << std::endl;
/**
* @file chain.cc
* @author Ty Qualters (contact@tyqualters.com)
* @brief C++ example demonstrating the use of method chaining in a class.
* @version 0.1
* @date 2022-09-30
*
* @copyright Copyright (c) 2022
*
*/
@tyqualters
tyqualters / game.cc
Created June 28, 2020 20:44
My very simple guessing game
#include <iostream>
#include <fstream>
#include <vector>
// check if input is a letter
bool isLetter(char character)
{
char alphabet[52] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
for(short i = 0; i < sizeof(alphabet); ++i)
if(tolower(character) == alphabet[i]) return true;