This file contains hidden or 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.util.Scanner; | |
public class TicTacToe { | |
public static void main(String[] args) { | |
Scanner s = new Scanner(System.in); | |
char player = '0'; | |
char[][] board = emptyBoard(); |
This file contains hidden or 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
diff --git a/config.h b/config.h | |
index 00458f2..1585fa1 100644 | |
--- a/config.h | |
+++ b/config.h | |
@@ -4,6 +4,8 @@ | |
static const char *user_text = "Username"; | |
/* Password prompt text */ | |
static const char *pass_text = "Password"; | |
+/* Default User */ | |
+static const char *default_user = ""; |
This file contains hidden or 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
// sa zicem ca o avem o functie "cube" care facem un cub de latura L la pozitia (x,y,z) | |
function cube(x,y,z,L){ | |
console.log("cub de latura", L, "la",x,y,z); | |
} | |
// si o functie generica care face fibonacci pana la 'count' | |
// adica primele 100 de numere din sir, sa zicem |
This file contains hidden or 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 com.itschool.agendaSaracului; | |
import java.awt.Dimension; | |
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import java.awt.event.WindowEvent; | |
import java.awt.event.WindowListener; | |
import java.io.BufferedWriter; | |
import java.io.File; | |
import java.io.FileWriter; |
This file contains hidden or 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 com.boogie666.tictactoe; | |
import java.util.Scanner; | |
public class Main { | |
private static char X = 'X'; | |
private static char ZERO = 'O'; | |
private static char NIMIC = '-'; | |
private static char[][] tabla = { |
This file contains hidden or 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
//define the finite state machine data structure... | |
let fsm = { | |
"checkLogin" : {"valid" : "login", | |
"invalid" : "showError"} | |
}; | |
//create the handler functions... | |
function checkLogin(state){ | |
if(state.data.username == "admin"){ | |
return { |
This file contains hidden or 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
function checkLogin(state){ | |
if(state.data.username == "admin"){ | |
return { | |
...state, | |
transitionTo: "valid" | |
}; | |
}else { | |
return { | |
...state, | |
transitionTo: "invalid" |
This file contains hidden or 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
function run(fsm, stateRunner, state){ | |
let runner = stateRunner[state.currentState]; | |
return Promise.resolve(runner(state)).then(function(transition){ | |
if(transition.transitionTo === "done"){ | |
return transition.data; | |
} | |
return run(fsm, stateRunner, { | |
...transition, | |
currentState: fsm[state.currentState][transition.transitionVia] | |
}); |
This file contains hidden or 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
(defn- -create-react-component | |
"create a 'inline' component and set the display name to the same name as the function" | |
[f] | |
(let [component (fn [js-props] | |
(let [args (.-uixprops js-props)] | |
(hiccup->react (apply f args))))] | |
(set! (.-displayName component) (.-name f)) | |
component)) | |
;; obvious optimization if obvious |
This file contains hidden or 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
require("./array.js"); | |
const { reduce, reduced } = require("./reduce.js"); | |
const { map, dropWhile, dedupe, window, comp } = require("./transducers.js"); | |
const { into } = require("./into.js"); | |
function pair_items(items){ | |
items = into([], dropWhile(x => x.hasOwnProperty("pair_id")), items); | |
var first = items[0]; | |
items.shift(); |
NewerOlder