Permalink
Browse files

add

  • Loading branch information...
1 parent 720766c commit cc1be0b7e4ddede6f8faf7fcd79c27704800aec2 @zdwalter committed Mar 10, 2012
Showing with 26 additions and 1 deletion.
  1. +2 −0 public/javascripts/hard/ex26.js
  2. +2 −0 public/javascripts/hard/ex27.js
  3. +21 −0 public/javascripts/hard/ex28.js
  4. +1 −1 src/app.coffee
View
2 public/javascripts/hard/ex26.js
@@ -0,0 +1,2 @@
+//Exercise 26: Congratulations, Take A Test!
+//fix below codes
View
2 public/javascripts/hard/ex27.js
@@ -0,0 +1,2 @@
+//Exercise 27: Memorizing Logic
+//ref https://developer.mozilla.org/en/JavaScript/Reference/Operators/Operator_Precedence
View
21 public/javascripts/hard/ex28.js
@@ -0,0 +1,21 @@
+//Exercise 28: Boolean Practice
+print('true && true = ' , true && true)
+print('false && true = ' , false && true)
+print('1 == 1 && 2 == 1 = ' , 1 == 1 && 2 == 1)
+print('"test" == "test" = ' , "test" == "test")
+print('1 == 1 || 2 != 1 = ' , 1 == 1 || 2 != 1)
+print('true && 1 == 1 = ' , true && 1 == 1)
+print('false && 0 != 0 = ' , false && 0 != 0)
+print('true || 1 == 1 = ' , true || 1 == 1)
+print('"test" == "testing" = ' , "test" == "testing")
+print('1 != 0 && 2 == 1 = ' , 1 != 0 && 2 == 1)
+print('"test" != "testing" = ' , "test" != "testing")
+print('"test" == 1 = ' , "test" == 1)
+print('! (true && false) = ' , ! (true && false))
+print('! (1 == 1 && 0 != 1) = ' , ! (1 == 1 && 0 != 1))
+print('! (10 == 1 || 1000 == 1000) = ' , ! (10 == 1 || 1000 == 1000))
+print('! (1 != 10 || 3 == 4) = ' , ! (1 != 10 || 3 == 4))
+print('! ("testing" == "testing" && "Zed" == "Cool Guy") = ' , ! ("testing" == "testing" && "Zed" == "Cool Guy"))
+print('1 == 1 && ! ("testing" == 1 || 1 == 0) = ' , 1 == 1 && ! ("testing" == 1 || 1 == 0))
+print('"chunky" == "bacon" && ! (3 == 4 || 3 == 3) = ' , "chunky" == "bacon" && ! (3 == 4 || 3 == 3))
+print('3 == 3 && ! ("testing" == "testing" || "Python" == "Fun") = ' , 3 == 3 && ! ("testing" == "testing" || "Python" == "Fun"))
View
2 src/app.coffee
@@ -152,7 +152,7 @@ routes.debugger = (req, res) ->
if user_script
app.logger.debug(user_script)
user_script = user_script.replace(/\s*$/g, "")
- #user_script += '\n' if user_script.slice(-1) isnt '\n'
+ user_script += '\n' if user_script.slice(-1) isnt '\n'
md5sum = crypto.createHash('md5')
md5sum.update(user_script)
md5 = md5sum.digest('hex')

0 comments on commit cc1be0b

Please sign in to comment.