HOW TO USE IN BROWSER CODER
$('#editor').text(function echo(m) {\n\treturn m;\n}\nconsole.log(echo("Hello World"));
);
\n = new line \t = tab
Order of execution
- User opens webpage javascript_ide.js => Runs to setup blank canvases page_setup.js = runs overrideDefault() (in javascript_ide.js) to allow termianl functions
- User logs in with username
- If user exist, continues
- else creates new user, shows new user screen
-
Once logged in, allows user to create or find a room
-
once inside of a room
- runs keySetup() to allow button functions
- sends codeContent()
- retrives code through showOpponentCode()
- runs gameSetup() (in battle.js) & displays 'ready'
- Once both players click ready . . .
- removes ready button
- runs fillGameField() for BOTH canvases
- fill up questionfield with question
- fill up canvases with preexisting code
- runs timeStart() for timer to start
- runs submitBtnSetup() to allow player to submit their code
- runs checkAnswer() when submitBtn is clicked
- Once player submits correct answer
- runs playerWin()
SCHEMA Question -question prompt (prompt) -editorText (maybe combine these?) -test (testCase) -finalTest (answer)
battleData
- winnerSolution
- loserSolution
- battle_id
battles
- user id
- opponent id
- win (boolean)
- question id
user
- username
- mmr
ROOM STATES 1 = room has 1 player 2 = room has 2 player 3 = waiting for difficulty selection