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
// 156 Caracteres | |
// No FF o mesmo código sem "new " também funciona, mas não foi aceite e assim os 152 ficaram por uma miragem... | |
// | |
// Com <enter>s para aumentar a legibilidade. | |
new EventSource("events").onmessage=function(a){ | |
for(a in o=a.data.match(/\d\S+/g))with(A.getContext("2d"))fillStyle='rgb('+o[a],fillRect(a,y,1,1); | |
y=o?y+1:0 | |
} |
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
/** | |
* Contém 4 Classes com a Demo da aula. | |
* A classe importante é a classe AStar que recebe um mapa de Casas e utilizando PriorityQueues | |
* devolve um LinkedList com a Path a seguir (invertida). | |
* | |
* Devem adapatar o código às vossas necessidades nomeadamente tendo em atenção que neste demo há alguns valores | |
* que estão escritos directamente no código e que servem apenas para este exemplo (por exemplo as dimensões do mapa). | |
*/ | |
import java.awt.BorderLayout; | |
import java.awt.Container; |
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
package imageBG; | |
import java.awt.Graphics; | |
import java.awt.Image; | |
import javax.swing.JComponent; | |
public class ImagePanel extends JComponent { | |
private Image image; |
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
/* | |
Webgl 3D Picking in P5js with Colour Buffer | |
18 May 2017 | |
David R. <david at the domain of sixhat dot net> | |
*/ | |
var pg; | |
var img; | |
function preload() { | |
img = loadImage('cat.jpg'); |
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 java.rmi.Remote; | |
import java.rmi.RemoteException; | |
public interface Board extends Remote { | |
public int[] play(int pos, String nome) throws RemoteException; | |
public int[] getBoard(String nome) throws RemoteException; | |
} |
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 java.rmi.NotBoundException; | |
import java.rmi.RemoteException; | |
import java.rmi.registry.LocateRegistry; | |
import java.rmi.registry.Registry; | |
import java.util.InputMismatchException; | |
import java.util.Scanner; | |
public class Player { | |
private Scanner input; | |
private Registry reg; |
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 java.rmi.RemoteException; | |
import java.rmi.registry.LocateRegistry; | |
import java.rmi.registry.Registry; | |
import java.rmi.server.UnicastRemoteObject; | |
import java.util.ArrayList; | |
public class BoardServer implements Board { | |
private ArrayList<String> jogadores; | |
private String turno; |
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 java.rmi.Remote; | |
import java.rmi.RemoteException; | |
public interface Tabuleiro extends Remote { | |
int[] play(int pos, String nome) throws RemoteException; | |
int[] getBoard(String nome) throws RemoteException; | |
boolean jogoEstaValido() throws RemoteException; | |
} |
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 java.rmi.NotBoundException; | |
import java.rmi.RemoteException; | |
import java.rmi.registry.LocateRegistry; | |
import java.rmi.registry.Registry; | |
import java.util.InputMismatchException; | |
import java.util.Scanner; | |
public class Player { | |
private final static String FMT_PRINT = "%d %d %d"; | |
private Scanner input; |
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 java.rmi.RemoteException; | |
import java.rmi.registry.LocateRegistry; | |
import java.rmi.registry.Registry; | |
import java.rmi.server.UnicastRemoteObject; | |
import java.util.ArrayList; | |
public class JogoDoGalo implements Tabuleiro { | |
private ArrayList<String> jogadores; | |
private int[] board; | |
private String turno; |
OlderNewer