Skip to content

Instantly share code, notes, and snippets.

View ccalmendra's full-sized avatar

Camilo Almendra ccalmendra

  • UFC
  • Quixadá, Brazil
View GitHub Profile
public String parOuImpar(int i) {
if (i % 2 == 0) {
return "par";
}
else {
return "impar";
}
}
@ccalmendra
ccalmendra / example-low-quality-routine.cpp
Created September 30, 2014 18:14
Jogo dos Muitos Erros - identique os erros na construção da rotina
void HandleStuff( COPY_DATA & inputRec, int crntQtr, EMP_DATA empRec,
double & estimRevenue, double ytdRevenue, int screenX, int screenY,
COLOR_TYPE & newColor, COLOR_TYPE & prevColor, StatusType & status,
int expenseType)
{
int i;
for ( i = 0; i< 100; i++ ) {
inputRec.revenue[i] = 0;
inputRec.expense[i] = corpExpense[ crntQtr][ i ];
}
@ccalmendra
ccalmendra / JogoDaVelha.java
Created June 1, 2012 18:30
Dojo Quixadá - 24/08/2011
public class JogoDaVelha {
char Tabuleiro[][] = { {'.','.','.'},{'.','.','.'},{'.','.','.'} };
char[] jogadores = {'X','O'};
public String getTabuleiro() {
String tab = new String();
tab = tab.concat(new String(this.Tabuleiro[0])).concat("\n"
).concat(new String(this.Tabuleiro[1])).concat("\n"
@ccalmendra
ccalmendra / JogoDaVelhaTest.java
Created June 1, 2012 18:26
Dojo Quixadá - 27/07/2011
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
public class JogoDaVelhaTest {
@Test
public void aoCriarJogoQuadroEstaVazio() {