This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
moves = ["rock", "paper", "scissors"] | |
class Player: | |
self.move = "something" | |
self.move2 = "something" | |
def learn(self, my_move, their_move): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace Aula_23_02 | |
{ | |
class employee | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float factRecursiva(int num){ | |
if(num == 0){ | |
return 1; | |
} | |
else { | |
return num * factRecursiva(num - 1); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} |
OlderNewer