chaitu236 / TakWeb

Javascript based Tak client
https://www.playtak.com
GNU General Public License v2.0
39 stars 18 forks source link

Implement PTN-loading #68

Closed nelhage closed 8 years ago

nelhage commented 8 years ago

Live demo at https://nelhage.github.io/TakWeb/#

Replaces the "Load TPS" button with a "Load PTN" button that can upload playtak PTN files directly.

TreffnonX commented 8 years ago

Invalid PTN

File content: [Site "PlayTak.com"] [Date "2016.10.26"] [Player1 "Guest853"] [Player2 "BeginnerBot"] [Size "5"] [Result "R-0"]

  1. a1 e2
  2. c3 b3
  3. c5 d3
  4. c4 d2
  5. c2 Cc1
  6. d1 d2-
  7. d2 c1+
  8. e1 2d1>
  9. d1 a3
  10. e3 b3>
  11. d4 3e1+21
  12. 2e2+ d3+
  13. 3e3<21 R-0 --

I tracked it to line break problems. Windows saves files with a double line break (\r\n) There seem to be additional problems though. I can't pin it down any further, as I am currently at work.

nelhage commented 8 years ago

@TreffnonX just updated, works for me now. Fixed the newlines and bug in drops with neither explicit count nor drops, like "d1>"

TreffnonX commented 8 years ago

Yep, works for me as well. Was able to load several arbitrary PTNs now. Good work!!1eleven ;) This might even trigger me to make an intermediary merge and get it to run on my fork before I add all the other stuff I did on it.

chaitu236 commented 8 years ago

Thanks nelhage awesome work! Thanks Treff for pointing out the issue!