e;e++)m<<=1,v==r-1?(v=0,d.push(n(m)),m=0):v++;for(t=a.charCodeAt(0),e=0;8>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;h>e;e++)m=m<<1|t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=a.charCodeAt(0),e=0;16>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}l--,0==l&&(l=Math.pow(2,h),h++),delete p[a]}else for(t=s[a],e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;l--,0==l&&(l=Math.pow(2,h),h++),s[c]=f++,a=String(u)}if(""!==a){if(Object.prototype.hasOwnProperty.call(p,a)){if(a.charCodeAt(0)<256){for(e=0;h>e;e++)m<<=1,v==r-1?(v=0,d.push(n(m)),m=0):v++;for(t=a.charCodeAt(0),e=0;8>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}else{for(t=1,e=0;h>e;e++)m=m<<1|t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t=0;for(t=a.charCodeAt(0),e=0;16>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1}l--,0==l&&(l=Math.pow(2,h),h++),delete p[a]}else for(t=s[a],e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;l--,0==l&&(l=Math.pow(2,h),h++)}for(t=2,e=0;h>e;e++)m=m<<1|1&t,v==r-1?(v=0,d.push(n(m)),m=0):v++,t>>=1;for(;;){if(m<<=1,v==r-1){d.push(n(m));break}v++}return d.join("")},decompress:function(o){return null==o?"":""==o?null:i._decompress(o.length,32768,function(r){return o.charCodeAt(r)})},_decompress:function(o,n,e){var t,i,s,p,u,c,a,l,f=[],h=4,d=4,m=3,v="",w=[],A={val:e(0),position:n,index:1};for(i=0;3>i;i+=1)f[i]=i;for(p=0,c=Math.pow(2,2),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;switch(t=p){case 0:for(p=0,c=Math.pow(2,8),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;l=r(p);break;case 1:for(p=0,c=Math.pow(2,16),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;l=r(p);break;case 2:return""}for(f[3]=l,s=l,w.push(l);;){if(A.index>o)return"";for(p=0,c=Math.pow(2,m),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;switch(l=p){case 0:for(p=0,c=Math.pow(2,8),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;f[d++]=r(p),l=d-1,h--;break;case 1:for(p=0,c=Math.pow(2,16),a=1;a!=c;)u=A.val&A.position,A.position>>=1,0==A.position&&(A.position=n,A.val=e(A.index++)),p|=(u>0?1:0)*a,a<<=1;f[d++]=r(p),l=d-1,h--;break;case 2:return w.join("")}if(0==h&&(h=Math.pow(2,m),m++),f[l])v=f[l];else{if(l!==d)return null;v=s+s.charAt(0)}w.push(v),f[d++]=s+v.charAt(0),h--,s=v,0==h&&(h=Math.pow(2,m),m++)}}};return i}();"function"==typeof define&&define.amd?define(function(){return LZString}):"undefined"!=typeof module&&null!=module&&(module.exports=LZString);
2 |
--------------------------------------------------------------------------------
/docs/assets/mp3/beep.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mogproject/mog-playground/5e5d74cb6ca7f43b345a624611eeaeeecc71d65f/docs/assets/mp3/beep.mp3
--------------------------------------------------------------------------------
/docs/assets/mp3/cancel.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mogproject/mog-playground/5e5d74cb6ca7f43b345a624611eeaeeecc71d65f/docs/assets/mp3/cancel.mp3
--------------------------------------------------------------------------------
/docs/assets/mp3/click.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mogproject/mog-playground/5e5d74cb6ca7f43b345a624611eeaeeecc71d65f/docs/assets/mp3/click.mp3
--------------------------------------------------------------------------------
/docs/assets/mp3/select.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mogproject/mog-playground/5e5d74cb6ca7f43b345a624611eeaeeecc71d65f/docs/assets/mp3/select.mp3
--------------------------------------------------------------------------------
/docs/assets/mp3/success.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mogproject/mog-playground/5e5d74cb6ca7f43b345a624611eeaeeecc71d65f/docs/assets/mp3/success.mp3
--------------------------------------------------------------------------------
/docs/assets/mp3/switch.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mogproject/mog-playground/5e5d74cb6ca7f43b345a624611eeaeeecc71d65f/docs/assets/mp3/switch.mp3
--------------------------------------------------------------------------------
/docs/browserconfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | #8bc53f
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/docs/index-debug.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 | Shogi Playground
29 |
30 |
31 |
32 |
33 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
54 |
55 |
56 |
57 |
Shogi Playground
58 |
Now Loading...
59 |
60 |
61 |
62 |
66 |
67 |
68 |
69 |
70 |
71 |
JavaScript Required
72 |
Thank you for visiting Shogi Playground. Please enable JavaScript and reload this page.
73 |
74 |
75 |
76 |
77 |
78 |
79 |
--------------------------------------------------------------------------------
/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | Shogi Playground
34 |
35 |
36 |
37 |
38 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
59 |
60 |
61 |
62 |
Shogi Playground
63 |
Now Loading...
64 |
65 |
66 |
67 |
68 |
JavaScript Required
69 |
Thank you for visiting Shogi Playground. Please enable JavaScript and reload this page.
70 |
71 |
72 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/docs/privacy/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Shogi Playground Privacy Policy
7 |
8 |
9 |
10 |
11 |
12 |
Privacy Policy
13 |
14 |
Shogi Playground is developed by Yosuke Mizutani. This website collects some Personal Data from its User.
15 |
16 |
Personal Data collected
17 |
18 | The following services may collect your Personal Data.
19 |
20 |
21 |
22 | Google Analytics
23 | Purpose: Analytics
24 | Personal Data: Cookies; Usage Data
25 |
26 |
27 | GitHub Pages
28 | Purpose: Hosting and backend infrastructure
29 | Personal Data: various types of Data as specified in the privacy policy of the service
30 |
31 |
32 | Cloudflare
33 | Purpose: Traffic optimization and distribution
34 | Personal Data: Cookies; various types of Data as specified in the privacy policy of the service
35 |
36 |
37 |
38 |
Cookie policy
39 |
We do not use cookies in the Shogi Playground application. Settings and caches are stored in the localStorage of your browser.
40 |
41 |
Disclosure of your personal information
42 |
We do not sell your personal information. We do not share your information with third parties, unless it is required by law.
43 |
44 |
Last update: May 9, 2019
45 |
46 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/docs/shogibot/help.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 | Shogi Bot Help
27 |
28 |
36 |
37 |
38 |
39 | Shogi Bot - How to text a move
40 | Shogi Bot recognizes vague descriptions. Each section is optional and case-insensitive. The notation order does not matter except Origin (must be before Destination ) and Promotion (must be at the end).
41 |
42 | 1. Destination
43 | The simplest way to text your move is just to put a destination. Western, Japanese, and CSA notations are acceptable.
44 |
45 | Western notation: '1a', '7f', '9i', etc.
46 | Japanese notation: '1一', '7六', '9九', '11', '76', '99', etc.
47 | CSA notation: '11', '76', '99', etc.
48 |
49 | If your notation is ambiguous, additional choice buttons will show up.
50 | You can omit this notation if your destination is the same as the preceding piece .
51 |
52 | 2. Origin
53 | To resolve ambiguity, you can also include the coordinate of the origin. The notation is same as Destination . This part must be before Destination .
54 |
55 | 3. Piece
56 | Shogi Bot accepts both Western, CSA, and other common notations.
57 |
58 | Pawn: 'P', 'F', 'FU'
59 | Promoted Pawn: '+P', 'PP', 'T', 'TO'
60 |
61 | Lance: 'L', 'KY'
62 | Promoted Lance: '+L', 'PL', 'NY'
63 |
64 | Knight: 'N', 'KE'
65 | Promoted Knight: '+N', 'PN', 'NK'
66 |
67 | Silver: 'S', 'GI'
68 | Promoted Silver: '+S', 'PS', 'NG'
69 |
70 | Gold: 'G', 'KI'
71 |
72 | Bishop: 'B', 'KA'
73 | Promoted Bishop: '+B', 'PB', 'U', 'UM', 'H'
74 |
75 | Rook: 'R', 'HI'
76 | Promoted Rook: '+R', 'PR', 'RY', 'D'
77 |
78 | King: 'K', 'OU', 'GY'
79 |
80 |
81 | 4. Drop or Simple Move
82 |
83 | Drop: '*', '00'
84 | Simple Move: '-', 'x'
85 |
86 |
87 | 5. Promotion
88 | You can specify a promotion flag at the end of your text .
89 |
90 | Promote: '+', 'naru', 'nari'
91 | Unpromote: '=', 'narazu'
92 |
93 |
94 |
95 |
96 |
--------------------------------------------------------------------------------
/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mogproject/mog-playground/5e5d74cb6ca7f43b345a624611eeaeeecc71d65f/favicon.ico
--------------------------------------------------------------------------------
/index-dev-debug.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 | Shogi Playground [Dev]
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
28 |
29 |
30 |
31 |
Shogi Playground
32 |
Now Loading...
33 |
34 |
35 |
36 |
40 |
41 |
42 |
43 |
44 |
45 |
JavaScript Required
46 |
Thank you for visiting Shogi Playground. Please enable JavaScript and reload this page.
47 |
48 |
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/index-dev.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 | Shogi Playground [Dev]
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
28 |
29 |
30 |
31 |
Shogi Playground
32 |
Now Loading...
33 |
34 |
35 |
36 |
37 |
JavaScript Required
38 |
Thank you for visiting Shogi Playground. Please enable JavaScript and reload this page.
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/project/build.properties:
--------------------------------------------------------------------------------
1 | sbt.version=1.2.8
2 |
--------------------------------------------------------------------------------
/project/plugins.sbt:
--------------------------------------------------------------------------------
1 | addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.0")
2 | addSbtPlugin("org.scala-js" % "sbt-jsdependencies" % "1.0.0")
3 |
4 | libraryDependencies += "org.scala-js" %% "scalajs-env-jsdom-nodejs" % "1.1.0"
5 |
--------------------------------------------------------------------------------
/src/main/scala/com/mogproject/mogami/playground/App.scala:
--------------------------------------------------------------------------------
1 | package com.mogproject.mogami.playground
2 |
3 | import com.mogproject.mogami.frontend._
4 | import com.mogproject.mogami.playground.view.PlaygroundView
5 | import org.scalajs.dom.Element
6 |
7 | import scala.scalajs.js.annotation.JSExportTopLevel
8 |
9 | /**
10 | * entry point
11 | */
12 | @JSExportTopLevel("App")
13 | object App extends PlaygroundAppLike {
14 | PlaygroundSettings
15 |
16 | override def createView(config: PlaygroundConfiguration, rootElem: Element): PlaygroundView = {
17 | PlaygroundView(config.deviceType.isMobile, config.freeMode, config.embeddedMode, config.isDev, config.isDebug, rootElem)
18 | }
19 |
20 | }
21 |
--------------------------------------------------------------------------------
/src/main/scala/com/mogproject/mogami/playground/PlaygroundSettings.scala:
--------------------------------------------------------------------------------
1 | package com.mogproject.mogami.playground
2 |
3 | import com.mogproject.mogami.frontend.FrontendSettings
4 |
5 | /**
6 | * Project-level global settings
7 | */
8 | object PlaygroundSettings {
9 | }
10 |
--------------------------------------------------------------------------------
/src/main/scala/com/mogproject/mogami/playground/view/Footer.scala:
--------------------------------------------------------------------------------
1 | package com.mogproject.mogami.playground.view
2 |
3 | import com.mogproject.mogami.frontend.view.footer.FooterLike
4 |
5 | /**
6 | *
7 | */
8 | case class Footer(isDev: Boolean, isDebug: Boolean) extends FooterLike
--------------------------------------------------------------------------------
/src/main/scala/com/mogproject/mogami/playground/view/MainPane.scala:
--------------------------------------------------------------------------------
1 | package com.mogproject.mogami.playground.view
2 |
3 |
4 | import com.mogproject.mogami.frontend.view.{MainPaneLike, PlaygroundSiteLike}
5 |
6 | case class MainPane(isMobile: Boolean, embeddedMode: Boolean, override val getSite: () => PlaygroundSiteLike) extends MainPaneLike
7 |
--------------------------------------------------------------------------------
/src/main/scala/com/mogproject/mogami/playground/view/NavBar.scala:
--------------------------------------------------------------------------------
1 | package com.mogproject.mogami.playground.view
2 |
3 | import com.mogproject.mogami.util.Implicits._
4 | import com.mogproject.mogami.frontend._
5 | import com.mogproject.mogami.frontend.action.ChangeModeAction
6 | import com.mogproject.mogami.frontend.state.ObserveFlag
7 | import com.mogproject.mogami.frontend.view.button.RadioButton
8 | import com.mogproject.mogami.frontend.view.nav.NavBarLike
9 |
10 | /**
11 | *
12 | */
13 | case class NavBar(isMobile: Boolean, embeddedMode: Boolean) extends NavBarLike with PlaygroundSAMObserver {
14 |
15 | private[this] def availableModes: Seq[ModeType] = Seq(PlayModeType, ViewModeType) ++ (!embeddedMode).option(EditModeType)
16 |
17 | lazy val modeButton: RadioButton[ModeType] = RadioButton(
18 | availableModes,
19 | (_: Messages) => Map[ModeType, String](PlayModeType -> "Play", ViewModeType -> "View", EditModeType -> "Edit").view.filterKeys(availableModes.contains).toMap,
20 | (mt: ModeType) => doAction(ChangeModeAction(mt, confirmed = false)),
21 | Seq(classButtonThin, "mode-select"),
22 | Seq.empty
23 | )
24 |
25 | override lazy val buttons: Seq[WebComponent] = modeButton +: super.buttons
26 |
27 | //
28 | // Observer
29 | //
30 | override val samObserveMask: Long = ObserveFlag.MODE_TYPE
31 |
32 | override def refresh(model: PlaygroundModel, flag: Long): Unit = {
33 | val modeType = model.mode.modeType
34 | modeButton.select(modeType)
35 | replaceClass(navElem, "nav-bg-", s"nav-bg-${modeType.toString.take(4).toLowerCase()}")
36 | }
37 | }
--------------------------------------------------------------------------------
/src/main/scala/com/mogproject/mogami/playground/view/PlaygroundSite.scala:
--------------------------------------------------------------------------------
1 | package com.mogproject.mogami.playground.view
2 |
3 | import com.mogproject.mogami.frontend.view.{MainPaneLike, PlaygroundSiteLike}
4 | import com.mogproject.mogami.frontend.view.footer.FooterLike
5 |
6 | case class PlaygroundSite(isMobile: Boolean, freeMode: Boolean, embeddedMode: Boolean, isDev: Boolean, isDebug: Boolean) extends PlaygroundSiteLike {
7 | override lazy val mainPane: MainPaneLike = MainPane(isMobile, embeddedMode, () => this)
8 |
9 | override lazy val navBar: NavBar = NavBar(isMobile, embeddedMode)
10 |
11 | override lazy val footer: FooterLike = Footer(isDev, isDebug)
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/src/main/scala/com/mogproject/mogami/playground/view/PlaygroundView.scala:
--------------------------------------------------------------------------------
1 | package com.mogproject.mogami.playground.view
2 |
3 | import com.mogproject.mogami.frontend.view.{BasePlaygroundView, PlaygroundSiteLike}
4 | import org.scalajs.dom.Element
5 |
6 |
7 | case class PlaygroundView(isMobile: Boolean, freeMode: Boolean, embeddedMode: Boolean, isDev: Boolean, isDebug: Boolean, rootElem: Element) extends BasePlaygroundView {
8 | override lazy val website: PlaygroundSiteLike = PlaygroundSite(isMobile, freeMode, embeddedMode, isDev, isDebug)
9 | }
10 |
--------------------------------------------------------------------------------