Skip to content

Instantly share code, notes, and snippets.

View alexanderbazo's full-sized avatar
🧰
Crafting Solutions for Digital Transformation

Alexander Bazo alexanderbazo

🧰
Crafting Solutions for Digital Transformation
View GitHub Profile
@alexanderbazo
alexanderbazo / grid.java
Last active January 8, 2016 07:44
Grid-Erstellung in der Graphics-App
private void setupGrid() {
rows = (int) Math.sqrt(NUM_SQUARES);
columns = (int) Math.sqrt(NUM_SQUARES);
squareHeight = HEIGHT / rows;
squareWidth = WIDTH / columns;
}
private void drawGrid() {
for (int x = 0; x < rows; x++) {
for (int y = 0; y < columns; y++) {
Compound board = new Compound()
private void initBoard(int fieldWidth, int fieldHeight) {
board = new Compound(0, 0);
for (int x = 0; x < ROWS; x++) {
for (int y = 0; y < COLUMNS; y++) {
Chessfield newField = getNewFieldForBoard(x, y, fieldWidth,fieldHeight);
board.add(newField);
}
}
@alexanderbazo
alexanderbazo / canvas.js
Created December 6, 2016 08:45
Zeichnen auf dem HTML5-Canvas
var canvas = document.querySelector("#canvas"),
context = canvas.getContext("2d");
// Zeichne eine Linie von x1,y1 nach x2,y2
function drawLine(x1, y1, x2, y2, color, weight) {
context.beginPath();
context.moveTo(x1, y1);
context.lineTo(x2, y2);
context.strokeStyle = color;
context.lineWidth = weight;
@alexanderbazo
alexanderbazo / AntColony.java
Last active December 8, 2017 14:17
Ein Lösungsvorschlag für die AntColony
import de.ur.mi.graphicsapp.GraphicsApp;
import simulator.ColonySimulator;
import world.ColonyView;
public class AntColony extends GraphicsApp {
private static final int WIDTH = 300;
private static final int HEIGHT = 300;
private ColonySimulator simulator;
private ColonyView view;
@alexanderbazo
alexanderbazo / example.js
Last active March 1, 2019 13:23
Closures und so
We couldn’t find that file to show.
@alexanderbazo
alexanderbazo / ApplicationTest.js
Created May 25, 2019 18:33
Beispiel für Test-Skript zur Simon-Says-Aufgabe
/* eslint-env browser */
/* eslint-disable no-console */
import Config from "../utils/config.js";
import Pattern from "../game/Pattern.js";
import Level from "../game/Level.js";
import Game from "../game/Game.js";
import View from "../ui/View.js";
@alexanderbazo
alexanderbazo / build.yml
Created December 6, 2019 16:07
Github Actions: Build and Release Android-APK
name: Minimal Android CI Workflow
on:
push:
branches:
- master
tags:
- 'v*'
jobs:
@alexanderbazo
alexanderbazo / test.js
Created April 27, 2020 08:44
2020-04-27-AB-Test
test
public class BouncingBalls extends GraphicsApp {
private static final int CANVAS_WIDTH = 1280;
private static final int CANVAS_HEIGHT = 360;
private static final Color BACKGROUND_COLOR = Colors.WHITE;
private static final int DEFAULT_SPEED = 5;
private static final int MIN_SPEED = 1;
private static final int BALL_RADIUS = 25;
private static final Color BALL_COLOR = Colors.RED;
public class BouncingBalls extends GraphicsApp {
private static final int CANVAS_WIDTH = 1280;
private static final int CANVAS_HEIGHT = 360;
private static final Color BACKGROUND_COLOR = Colors.WHITE;
private Circle circle;
private boolean isMovingRight = true;
private int currentSpeed = 10;