Skip to content

Instantly share code, notes, and snippets.

View Pharaoh00's full-sized avatar

Pharaoh Pharaoh00

  • Belo Horizonte - MG - Brasil
View GitHub Profile
import random
moves = ["rock", "paper", "scissors"]
class Player:
self.move = "something"
self.move2 = "something"
def learn(self, my_move, their_move):
import random
"""This program plays a game of Rock, Paper, Scissors between two Players,
and reports both Player's scores each round."""
moves = ['rock', 'paper', 'scissors']
"""The Player class is the parent class for all of the Players
in this game"""
class Player:
def __init__(self, x, y): # This is the initiation for the class Player
self.x = x
self.y = y
def returnX(self):
return self.x
def returnY(self):
return self.y
def beats(one, two):
result = False
# Only two outcome can occur
# If you Win = True
# If you Lose = False
# This is the boolean logic (George Boole created this on 1854)
# BEFORE all the computer stuff. Cool right?
if one is two:
#include "../header/player.h"
#include <math.h>
void Player::init(const char* path,
int srcX, int srcY,
int w, int h,
float initX, float initY) {
BaseSprite::init(path, srcX, srcY, w, h, initX, initY);
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Aula_23_02
{
class employee
{
using System;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
//int operação, resultado = 0, num1, num2, raio, altura; ISSO É COISA DE PREGUIÇOSO
//Na hora da prova tudo bem, por causa de espaço, mas para programar coloque um em baixo do outro.
int subRotinaEx30(int* vetor, int qtd, bool ordem){
// Ordem é a maneira que será imprimida.
// true = vetor[0], vetor[1], ..., vetor[n-1]
// false = vetor[n-1], ..., vetor[1], vetor[0]
int sum = 0;
if(qtd < 0){
return 0;
}
if(ordem == true){
subRotinaEx30(vetor, qtd - 1, ordem);
@Pharaoh00
Pharaoh00 / ex31.h
Last active September 15, 2019 19:03
float factRecursiva(int num){
if(num == 0){
return 1;
}
else {
return num * factRecursiva(num - 1);
}
}
int mdcEx23(int num1, int num2){
int* temp = malloc(sizeof(int));
while(num2 != 0){
temp = num1 % num2;
num1 = num2;
num2 = temp;
}
return num1;
free(temp);
}