- Install dependencies
npm install
- Create a config.js file with Github token to link to Atlier API. If you do not have access, reference the server code to create the backened to supply the data.
| export default class TicTacToe{ | |
| constructor(el){ | |
| this.el = document.getElementById(el); | |
| this.setupNewGame(); | |
| this.setupEventHandlers(); | |
| } | |
| setupNewGame() { | |
| this.gameState = [null, null, null, null, null, null, null, null, null]; | |
| this.currentPlayer = "X"; | 
| import Controller from '@ember/controller'; | |
| export default class ApplicationController extends Controller { | |
| appName = 'Ember Twiddle'; | |
| } | 
| import Controller from '@ember/controller'; | |
| export default class ApplicationController extends Controller { | |
| appName = 'Ember Twiddle'; | |
| } | 
| import Controller from '@ember/controller'; | |
| export default class ApplicationController extends Controller { | |
| appName = 'Ember Fun'; | |
| } | 
| import Component from '@glimmer/component'; | |
| export default class extends Component { | |
| } | 
| DROP DATABASE IF EXISTS `concessionaria`; | |
| CREATE DATABASE `concessionaria` ; | |
| USE `concessionaria`; | |
| CREATE TABLE `carros`( | |
| `id_do_carro` int(11) NOT NULL AUTO_INCREMENT, | |
| `nome` varchar(50) NOT NULL, | |
| `cor` varchar(50) NOT NULL, | |
| `quantidade_em_estoque` int(11) NOT NULL, | |
| `preco` decimal(8,2) NOT NULL, | 
| const numbersArray = [1, 2, 3, 4]; | |
| const logTimesTwo = num => console.log(num * 2); | |
| const customForEach = (arr, cb) => { | |
| for (let i = 0; i < arr.length; i++) { | |
| cb(arr[i]); | |
| } | |
| } | 
| function reverseString(str) { | |
| // Step 1. Create an empty string that will host the new created string | |
| var newString = ""; | |
| // Step 2. Create the FOR loop | |
| /* The starting point of the loop will be (str.length - 1) which corresponds to the | |
| last character of the string, "o" | |
| As long as i is greater than or equals 0, the loop will go on | |
| We decrement i after each iteration */ | |
| for (var i = str.length - 1; i >= 0; i--) { | 
| const getNeighboors = (matrix, row,col) => { | |
| let isTopBorder = row === 0; | |
| let isRightBorder = col === matrix[row].length - 1; | |
| let isBottomBorder = row === matrix.length - 1; | |
| let isLeftBorder = col === 0; | |
| let top = isTopBorder ? row : row - 1; | |
| let left = isLeftBorder ? col : col - 1; | |
| let bottom = isBottomBorder ? row : row + 1; |