Skip to content

Live browser IDE, 1 vs 1 coding challenge. Built with Vanilla JavaScript.

Notifications You must be signed in to change notification settings

IdleScV/MOD-3-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

  1. User opens webpage javascript_ide.js => Runs to setup blank canvases page_setup.js = runs overrideDefault() (in javascript_ide.js) to allow termianl functions
  1. User logs in with username
  • If user exist, continues
  • else creates new user, shows new user screen
  1. Once logged in, allows user to create or find a room

  2. once inside of a room

  • runs keySetup() to allow button functions
    • sends codeContent()
    • retrives code through showOpponentCode()
  • runs gameSetup() (in battle.js) & displays 'ready'
  1. 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
  1. 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

About

Live browser IDE, 1 vs 1 coding challenge. Built with Vanilla JavaScript.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published