Projects

Tic-Tac-Toe in HTML

https://github.com/apetezible/Tic-Tac-Toe

Abstract

I hope you know the popular game Tic-Tac-Toe. If not, it is recommended that you google it. This project is about making this game directly on the Canvas, there are some elements that I had to add from external media (sounds, images and animation). For the brain of the game, I developed a Decision Tree in JavaScript.

Introduction

A free choice of a Project for one of the several endings of my Basic Programming led me to this idea: Containing a Decision Tree, a Design concept, a lot of use of Functions and Logic Cycles used to draw on the Canvas. I consider this as a convenient project.

The Game

I think that the right choice of a first player is an important problem, playing first on the board is an important element that deserves copious attention. The solution I propose is to throw some dice, the winner is the first player. The first player will use the Cross and the second will use the Circle.

Methods

There are two main methods present in this code. You can study the others in the code if you want.

– Throwing the Dice

There are two dice and both must have a different random number. The determined concept closest to random a number that came to my mind was the Random function predefined in JavaScript.

– The Machine Decision Maker

The way I thought about the machine was to play defensively. If it has to start, it will choose a “random” position. If the game has reached a situation that requires a random decision, the machine will choose a “random” position. The machine will not block the player’s possible winning selection, so a player may win.

SFM Surivor Manual

https://github.com/apetezible/SFM-Surivor-Manual

This is a compilation of all the developer’s wiki at the time I am making this compilation, the purpose of this book is not lucrative. You can take it like a material backup I made for the times it is impossible to access the internet. By forehand thanks to all the wiki contributors, without them the existence of this book couldn’t be possible. For all the updated information visit: https://developer.valvesoftware.com/wiki/Category:Source_Filmmaker

Controlling your Electric Installation over the Internet

https://github.com/apetezible/XMassLightsControl

Abstract

I’ll be controlling an Electric Installation over the Internet by connecting a Relay Module to an Arduino Uno. Using the Standard Firmata it is possible to control an Arduino by applying electronic inputs in it, the Source of those will be my Laptop running a Node.js Server using the Johnny-Five Library. For connecting the environment to the Internet it is necessary to use a Library and open your router’s ports, on this experiment I’ll use the Express Library.

Introduction

When abled to make a Node.js server for controlling an Arduino through Standard Fimata, and also setting HTTP servers using Express. The idea of controlling an Arduino Uno over the internet came to my mind. But it wasn’t until I needed to control remotely four electric Installations in my home that I decided to make this project.

Methods

I needed to control four Electric Installations on my home over the internet with my cellphone. I call an Electric Installation a device which will turn on whenever there is electricity and off when there is no. Those Electric Installations are a Radio, a Laser device, a Lightbulb and the Christmas Lights. For controlling the electricity passing in a with a digital input there is a Module called a Relay, for this project I used a 250VAC / 4 Channel Relay Module (because I have to Control 4 Electric Installations AC). For this example, I set the configuration whereas a normal state there is no electricity.

I used the Arduino Genuino Uno board configurated with the Standard Firmata which can be found ready to upload to the Arduino Board via USB in the Arduino IDE. This script is set to use the digital ports 5, 4, 3, 2, so I connected each channel from the Relay Module and the 5V output from the Arduino to the Relay Module VCC. 

It is required to set a Server for receiving instructions from the user and control the Arduino Board. For this, I connected my laptop to the Internet via WiFi and to the Arduino board via USB. On the Laptop I’ve installed Node.js for setting the environment, on it I’ve installed the Johnny-Five, Express and Firmata libraries with all their dependencies.

I’ve prepared a set of HTML invented for interaction in the phone. When you tap in one of the Elements on the webpage, the GET method is used by the device to connect to the Server. When the GET method is used, a new configuration is sent to the Arduino Board. 

If you have a Router capable of port-forwarding I recommend you to set it to open the port 8080 for your laptop IP. You probably have to communicate to your Internet Service Provider to open that Port if you were able to open your port in your Router but there is no access to your PC from the Internet (run your Server with Node.js and use https://www.canyouseeme.org/ with the port 8080 to check if there is a successful access to your Server). Otherwise install hamachi, a VPN, on your Laptop and configure it on your remote device. Run your Node.js server with app.js ().  

On your device, use a browser to open a webpage, introduce your public IP (in the successful port-forwarding) or your Hamachi IP then “:8080”. You are now controlling your Electric Installations Remotely.

Design a site like this with WordPress.com
Get started