Advertisement
logicmoo

Snake

Apr 19th, 2020
2,052
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Prolog 2.50 KB | None | 0 0
  1. (base) root@gitlab:/opt/logicmoo_workspace/packs_sys/logicmoo_nlu/prolog/non_ec_planner/PaulBrownMagic/Snake# firefox http://prologpluscg.sourceforge.net/manual/index.html#SECTION00342000000000000000 &
  2. (base) root@gitlab:/opt/logicmoo_workspace/packs_sys/logicmoo_nlu/prolog/non_ec_planner/PaulBrownMagic/Snake# git diff
  3. diff --git a/chromium_app.pl b/chromium_app.pl
  4. index 3b3bca2..abe91a9 100644
  5. --- a/chromium_app.pl
  6. +++ b/chromium_app.pl
  7. @@ -1,5 +1,6 @@
  8.  :- use_module(library(www_browser), [www_open_url/1]).
  9.  
  10. +open_chromium_app :-!.
  11.  open_chromium_app :-
  12.      try_alt("chromium",
  13.          try_alt("chromium-browser",
  14. diff --git a/loader.lgt b/loader.lgt
  15. index d87d781..98ef7a4 100644
  16. --- a/loader.lgt
  17. +++ b/loader.lgt
  18. @@ -7,6 +7,17 @@
  19.      :- initialization((
  20.          logtalk_load_context(directory, Directory),
  21.          assertz(logtalk_library_path(snake, Directory)),
  22. +       % redefine the "my_logtalk_libraries" library alias for the directory name and
  23. +       % location where you will be cloning/downloading BedSit, SitCalc, and STRIPState
  24. +       assertz(logtalk_library_path(my_logtalk_libraries, home('MyLogtalkLibs/'))),
  25. +
  26. +       % assuming that the clones/downloads use the library names,
  27. +       % no need to redefine the library aliases that follow
  28. +       assertz(logtalk_library_path(sitcalc, my_logtalk_libraries('SitCalc/'))),
  29. +       assertz(logtalk_library_path(stripstate, my_logtalk_libraries('STRIPState/'))),
  30. +       assertz(logtalk_library_path(bedsit, my_logtalk_libraries('BedSit/'))),
  31. +       assertz(logtalk_library_path(situations, my_logtalk_libraries('Situations/'))),
  32. +
  33.          logtalk_load(snake(web_hooks)),
  34.          logtalk_load(snake(chromium_app)),
  35.          logtalk_load([ types(loader)
  36. @@ -25,7 +36,7 @@
  37.          define_events(after, bedsit, do(_), _, game),
  38.          server::serve,
  39.          open_chromium_app,
  40. -        halt
  41. +        write(halt)
  42.                   )).
  43.  
  44.  :- else.
  45. diff --git a/static/snake.js b/static/snake.js
  46. index a1d4a77..718d11d 100644
  47. --- a/static/snake.js
  48. +++ b/static/snake.js
  49. @@ -1,6 +1,7 @@
  50.  //const store = { snake: [], apple: {x: 0, y: 0}, gameover: true, tile_count: 32 }
  51.  
  52. -const socket = new WebSocket('ws://localhost:8000/socket');
  53. +//const socket = new WebSocket('ws://localhost:8000/socket');
  54. +const socket = new WebSocket('ws://gitlab:8000/socket');
  55.  
  56.  socket.onopen = function (e) {
  57.      socket.send('refresh')
  58.  
  59. (base) root@gitlab:/opt/logicmoo_workspace/packs_sys/logicmoo_nlu/prolog/non_ec_planner/PaulBrownMagic/Snake#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement