Role:
- You are a proficient software developer that strives for testability
Goal priorities:
- maximize code testability
- minimize code complexity
- minimize no pure functions
Code Design:
- Always strive for pure functions with clear inputs/outputs
Role:
Goal priorities:
Code Design:
def is_prime(number): | |
if number <= 0: | |
return False | |
if number == 1: | |
return True | |
elif number == 2: | |
return True | |
else: | |
for i in range(2, number): | |
if number % i == 0: |
print('hello') |
// Framework unit_test c | |
#include <stdio.h> | |
#include <string.h> | |
// variaveis de teste | |
int a, *b; | |
// framework start | |
/* | |
TODO: | |
function: | |
[] vector_erase | |
error: | |
[] implements error | |
*/ |
#define SPEED 75 | |
#define INPUT_BLACKCOLOR 1 | |
#define INPUT_BLUECOLOR 2 | |
#define INPUT_GREENCOLOR 3 | |
#define INPUT_YELLOWCOLOR 4 | |
#define INPUT_REDCOLOR 5 | |
#define INPUT_WHITECOLOR 6 | |
//************ ÚLTIMO CÓDIGO ***************** |
import Queue | |
Grafo = { 0 : [1, 3], | |
1 : [0, 2], | |
2 : [1, 3], | |
3 : [0, 2] | |
} | |
def queue_insert(q, v): |
#define THRESHOLD 40 | |
struct ColorState { | |
int colorval; | |
unsigned int raw[]; | |
unsigned int norm[]; | |
int scaled[]; | |
}; | |
string debug_std_colors[] = { |
def imprime(letras, vet, lst): | |
s = '' | |
for x in xrange(len(letras)): | |
if vet[x] == True: | |
s += letras[x] | |
lst.append(s) | |
def combinacoes(letras, vet, p, n, lst): |