repl.it
@RohilPatel/

Baño Clicker Official

Nodejs

No description

fork
loading
Files
  • index.js
  • public
  • Packager files
  • package-lock.json
  • package.json
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const express = require("express");
const app = express();
const http = require("http").createServer(app);
const port = 3000;

const chars = "a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9".split(" ");

const codes = chars.map(char => {
  char = chars[Math.floor(Math.random()*chars.length)];
  chars.splice(chars.indexOf(char) + 1, chars.indexOf(char) + 2);
  return char;
});

console.log(codes);

// app.use(express.static("public"));

// const io = require("socket.io")(http);

// let sockets = [];

// io.on("connection", socket => {
//   console.log(`${socket.id} connected`);
//   sockets.push(socket);

//   socket.on("click", () => {
//     socket.clicks++;
//   });

//   socket.on("disconnect", () => console.log(`${socket.id} disconnected`));
// });

// http.listen(port, () => console.log(`server started on port ${port}`));
?