Skip to content

Instantly share code, notes, and snippets.

View Pr3d4dor's full-sized avatar

Gianluca Bine Pr3d4dor

  • Brazil
View GitHub Profile

Keybase proof

I hereby claim:

  • I am pr3d4dor on github.
  • I am gbine (https://keybase.io/gbine) on keybase.
  • I have a public key ASB7obt57AI_7xUXnX2zTtN7VPWPPlHaTeWZtArFGvZRuwo

To claim this, I am signing this object:

@Pr3d4dor
Pr3d4dor / cloudSettings
Last active February 16, 2021 00:15
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-08-01T18:34:25.214Z","extensionVersion":"v3.4.3"}
public class Exe1MetodosGenericos {
public static void print(Gen inputArray){
Object i = inputArray.getob();
for (Integer element : inputArray)
System.out.printf("%s ", element);
System.out.println();
}
@Pr3d4dor
Pr3d4dor / batalhanaval.php
Created September 19, 2015 17:09
batalhanaval.php
<?php
define("LIN", 7);
define ("COL", 7);
function verificaCoordenadas($x, $y){
$controle1 = 0;
$controle2 = 0;
if (($x>=65)&&($x<71)){
$controle1=1;
}
#include <iostream>
#include <string>
#include <sstream>
#include <bitset>
#include <fstream>
#define MAX 32
using namespace std;
//Structs que definem os campos de cada tipo difente de instrucao
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
#include <stdbool.h>
#define LIN 7
#define COL 7
//Funcao para verificar se as coordenadas são validas
bool verificaCoordenadas(int x,int y){
int controle1=0,controle2=0;
#define MAX 10
#define ERRORSTACKEMPTY -2
#define ERRORSTACKFULL -1
typedef struct{
int item[MAX];
int top;
}Stack;
int push(Stack *p,int x);
#include <stdio.h>
#include <stdlib.h>
//Stack.h is a header file that contains a abstract data type stack created to represent a stack, as the own name says
//Stack.h is here among the others gists
#include "Stack.h"
int main(){
int i;
Stack p;
char ex[MAX],aux=0,control=0;
iniStack(&p);
@Pr3d4dor
Pr3d4dor / Pong.c
Last active August 29, 2015 14:24
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <unistd.h>
#define y 20
#define x 70
int main()
{
int i=0,j=0,ball_x=x/2,ball_y=y/2,p1_ini=7,p1_end=y-7,p2_ini=7,p2_end=y-7,control=0,move;
int movementballx=1,movementbally=1,pointsp1=0,pointsp2=0;
//Binary search function in c
int binarySearch(int *vet,int n,int x){
//The vector needs to be ordered for the binary search work properly, you can use any sorting method.
bubbleSort(vet,n);
while (ini<=end){
middle=(ini+end)/2;
if (vet[middle]==x)
return 1;
if (vet[middle]<x)
ini=middle+1;