Skip to content

Instantly share code, notes, and snippets.

View AMiller90's full-sized avatar

Andrew Miller AMiller90

View GitHub Profile
@AMiller90
AMiller90 / PlayerBackstab
Last active April 3, 2026 17:55
C# write a function that takes in a knife object and Player object. Write a free function that returns true if the knife is backstabbing the player.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//Feedback: Better variable names for parameters, overloading should only take one parameter(this), Use classes,
//11/28/16
//C# write a function that takes in a knife object and Player object. Write a free function that returns true if the knife is backstabbing the player.
@AMiller90
AMiller90 / FSM with Interface
Last active October 17, 2016 15:50
Begin designing a finite state machine in c#. All states must implenent interfaces.
using System;
using System.Collections.Generic;
//This interface needs to be cut and pasted into a different file before running program
interface IStates
{
Enum sName { get; set; }
Delegate dDel { get; set; }
bool Handler();
}
@AMiller90
AMiller90 / DrawHalfCircleAndSphereUnity
Created October 11, 2016 15:42
Refactor c++ generate halfcircle and generate sphere functions to c# then execute them in unity engine
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class DrawHalfCircle : MonoBehaviour {
// Use this for initialization
void Start ()
{
List<GameObject> halfverts = new List<GameObject>();
@AMiller90
AMiller90 / WeaponDPS
Last active September 27, 2016 15:29
We expect this question to take approximately 30 - 45 minutes. Write a function that calculates the damage per second of a given weapon. Requirements : Function must take a parameter of type that inherits from Weapon. Return value must be to the nearest second decimal place. Ex : 35.6
#include<iostream>
//Question: Weapon DPS
//We expect this question to take approximately 30 - 45 minutes.
//Write a function that calculates the damage per second of a given weapon.
//Requirements : Function must take a parameter of type that inherits from Weapon.
//Return value must be to the nearest second decimal place.Ex : 35.6
//Weapon class
class Weapon
@AMiller90
AMiller90 / DistFromARectangle
Last active September 26, 2016 15:36
Question 1: Distance from a Rectangle We expect this question to take approximately 20 - 40 minutes. Write a function that tests if a point falls within a specified distance(“dist”) of any part of a solid, 2D rectangle.The rectangle is specified by the bottom left corner, a width, and a height. A function prototype and data structures you can as…
//09/26/16
//Question 1: Distance from a Rectangle
//We expect this question to take approximately 20 - 40 minutes.
//Write a function that tests if a point falls within a specified distance(“dist”) of any part of a solid, 2D rectangle.The rectangle is specified by the bottom left corner, a width, and a height.
//A function prototype and data structures you can assume exist are supplied below.You may make additions to the structures if you deem it appropriate.If you answer in a different language, you should follow a similar format :
#include<iostream>
struct Point
{
float x;
float y;
@AMiller90
AMiller90 / Answer Ligthing and Shader Questions
Created September 21, 2016 14:15
Gist 13: answer the following questions and submit via gist by 930. 1. What is the difference between a directional and point light 2. Which lighting model have you implemented? 3. What are the equations for your model? 4. Explain in detail how a diffuse calculation is made. 5. Explain in detail how information goes from an application to the sh…
Gist 13: answer the following questions and submit via gist by 930.
1. What is the difference between a directional and point light
2. Which lighting model have you implemented?
3. What are the equations for your model?
4. Explain in detail how a diffuse calculation is made.
5. Explain in detail how information goes from an application to the shader pipeline.
//Answers
@AMiller90
AMiller90 / FunctionThatMultiplies2Numbers
Last active September 19, 2016 15:28
write a function that multiplies two numbers. You can only use addition or subtraction and you can only check whether a number is positive negative or 0. Can not use > >= < <= Return and parameters are unsigned integers
#include <iostream>
unsigned int multiply(unsigned int num1, unsigned int num2)
{
unsigned int answer = 0;
//As long as i is not equal to 0
for (int i = num2; i != 0; i--)
{//Add the passed in first parameter to the current answer variable
@AMiller90
AMiller90 / How to draw
Created September 14, 2016 13:58
09/14/16 Morning gist In your own words answer this very simple question "How do you draw?" You have 2 hrs and you can use your own code as reference And notes This is an assessable question after 4 weeks of graphics
09/14/16 Morning gist
In your own words answer this very simple question
"How do you draw?"
You have 2 hrs and you can use your own code as reference
And notes
This is an assessable question after 4 weeks of graphics
//Without looking at code//
1.Create the objects and indices of what to draw and how to draw
2.Download proper libraries and then link appropriately
@AMiller90
AMiller90 / Create Half Circle
Created September 13, 2016 15:28
09/13/16 Write a function that takes arguments to create a half circle. Parameters should be radius, number of points and the return value should be the half circle
#include<iostream>
#include<vector>
//09/13/16
//Write a function that takes arguments to create a half circle.
//Parameters should be radius, number of points and the return value should be the half circle
struct Vertex
{
float X;
@AMiller90
AMiller90 / OverloadFunctionPointer
Created September 12, 2016 15:06
09/12/16 Write a function that takes another Func as a parameter. The passed function need only to add two numbers. Can the passed function be overloaded ? Explain why / why not
//09/12/16
//Write a function that takes another Func as a parameter.
//The passed function need only to add two numbers.
//Can the passed function be overloaded ? Explain why / why not
//YES! The passed in function can be overloaded as long as the return type stays the same.
//The parameters are of no importance to the function pointer. What matters is the return type.
#include<iostream>