{{ message }}

Instantly share code, notes, and snippets.

# Matt Venezia mvenezia

Last active Oct 28, 2020
View (C++) Airline Seat Reservation System
 #include "stdafx.h" #include #include using namespace std; void FillSeatArray(pair arr[][4], int sizeDim1); // Precondition: arr is a two dimensional array of type pair[4]. // sizeDim1 is the size of the first array dimesion. // Postcondition: Each four element array of type pair is assigned values // representing seats. The pair at index 0 is assigned 'A', 1 is assigned 'B',
Last active Jan 10, 2019
This is a solution I came up with while trying to find a unique, extensible way to find the greatest value in a collection of integers. The real cool stuff here exists in the function get_greatest. I could have used a sorting algorithm and then returned the greatest value, but finding a recursive solution was a lot of fun. Very roughly speaking,…
View Recursive Find Max Val of Any N Ints
 /* This is a solution I came up with while trying to find a unique, extensible way to find the greatest value in a collection of integers. The real cool stuff here exists in the function get_greatest. I could have used a sorting algorithm and then returned the greatest value, but finding a recursive solution was a lot of fun. Very roughly speaking, the time complexity estimate is between O(n) and O(n^2). Really the function runs as follows (each term is a new recursive scope): n + (n - 1) + (n - 2) + ... + (n - (n - 2)). For example if n is 5: 5 + 4 + 3 + 2 = 14. */ #include
Last active Nov 8, 2018
View Namespace Venezia (C++)
 namespace Venezia { class Utils { public: template static T* SelectionSort(T arr[], int size) { for (int i = 0; i < size - 1; i++) {
Last active Jul 28, 2018
This program demonstrates an algorithm for deleting duplicate values of type char in an array.
View (C++) Delete Duplicates
 //This program demonstrates an algorithm for deleting duplicate values of type char in an array. #include "stdafx.h" #include using std::cout; using std::endl; void DeleteRepeats(char a[], int& numberUsed); //Precondition: numberUsed is <= declared size of a. a[0] through a[numberUsed - 1] have values of type char. //Postcondition: All duplicate values in a have been deleted, and numberUsed has been adjusted to reflect
Last active Jul 28, 2018
View (C#) ShieldPowerUp.cs
 using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class ShieldPowerUp : MonoBehaviour { #region Member Variables public static ShieldPowerUp instance;
Last active Jul 28, 2018
View (C#) FogFXManager.cs
 using UnityEngine; public class FogFXManager : MonoBehaviour { #region Const Member Variables const int NUM_FOG_SYSTEMS = 4; #endregion #region Public Member Variables public ParticleSystem widePrefab;
Last active Jul 28, 2018
View (C++) Namespace VenzMisc
 namespace VenzMisc { // Precondition: prob is between 0.0 and 1.0 inclusive. // Returns: generates random probability between 0.0 and 1.0 and returns true if randomProb // is <= prob, else false. Each invocation of this function has a (prob*100.0) percent chance // of returning true. bool Probability(float prob) { float randomProb = (RAND_MAX - rand()) / static_cast(RAND_MAX); return (randomProb <= prob) ? true : false;
Last active Jul 28, 2018
View (C++) Duelist Simulator
 #include "stdafx.h" #include #include #include #include #include using namespace std; bool Probability(float prob); // Precondition: prob is between 0.0 and 1.0 inclusive.
Created Jul 28, 2018
View (Python) def LowestRootPwr()
 def LowestRootPwr(): ''' This function prompts the user to enter an int. Returns: Tuple of two ints, root and pwr, such that root**pwr == userInput, while adhering to the constraints: 0 < pwr < 6, root and pwr have the smallest possible absolute values. ''' while True: