<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
>
<channel>
	<title>Wiki</title>
	<link>https://wiki.wodemo.net/</link>
        <item>
        <title><![CDATA[实现井字棋]]></title>
		<link><![CDATA[https://wiki.wodemo.net/entry/529353]]></link>
		<dc:creator><![CDATA[Crazy白茫茫 (@wiki)]]></dc:creator>
		<pubDate><![CDATA[Wed, 26 Feb 2020 04:40:40 -0800]]></pubDate>
        <description><![CDATA[


	.a>button,.b>button,.c>button{display:inline-block;border:2px solid black;
	width:50px;height:50px;margin:0px;padding:0px;font-size:30px}
	*{box-sizing: border-box}



	






    
    





    
    






    
    
    

var xo={
 get(query){
if(document.getElementById(query).innerHTML=="o"||document.getElementById(query).innerHTML=="x"){
return document.getElementById(query).innerHTML}else{
	return Math.random()
    }
},
 do(self){
    if(self.innerHTML!="x" &&   self.innerHTML!="o"){
			if(xo.step%2==0){
				self.innerHTML="x"
				}else{
					self.innerHTML="o"
					}
					xo.step++;
				if(xo.verify())xo.win()
			   }
},
 verify(){
 	
	if(xo.get("x-1")===xo.get("x-2") &&  xo.get("x-2")===xo.get("x-3"))return true;
	
	if(xo.get("x-4")===xo.get("x-5") &&  xo.get("x-5")===xo.get("x-6"))return true;
	
	if(xo.get("x-7")===xo.get("x-8") &&  xo.get("x-8")===xo.get("x-9"))return true;
	
	if(xo.get("x-1")===xo.get("x-4") &&  xo.get("x-4")===xo.get("x-7"))return true;
	
	if(xo.get("x-2")===xo.get("x-5") &&  xo.get("x-5")===xo.get("x-8"))return true;
	
	if(xo.get("x-3")===xo.get("x-6") &&  xo.get("x-6")===xo.get("x-9"))return true;
	
	if(xo.get("x-1")===xo.get("x-5") &&  xo.get("x-5")===xo.get("x-9"))return true;
	
	if(xo.get("x-3")===xo.get("x-5") &&  xo.get("x-5")===xo.get("x-7"))return true;

	if(xo.step===9)return false;
},
win(){
	document.querySelector(".d").innerHTML=xo.step%2==0?"o赢了":"x赢了"
    	
},
step: 0
}



```html
&lt;html&gt;
&lt;head&gt;
&lt;style&gt;
	.a&gt;button,.b&gt;button,.c&gt;button{display:inline-block;border:2px solid black;
	width:50px;height:50px;margin:2px;padding:22px;font-size:30px}
	*{box-sizing: border-box}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;div class=&quot;a&quot;&gt;
&lt;button id=&quot;x-1&quot; onclick=&quot;xo.do(this)&quot;&gt;
&lt;/button&gt;
&lt;button id=&quot;x-2&quot; onclick=&quot;xo.do(this)&quot;&gt;
&lt;/button&gt;
&lt;button id=&quot;x-3&quot; onclick=&quot;xo.do(this)&quot;&gt;
&lt;/button&gt;
    &lt;/div&gt;
    &lt;div class=&quot;b&quot;&gt;
&lt;button id=&quot;x-4&quot; onclick=&quot;xo.do(this)&quot;&gt;
&lt;/button&gt;
&lt;button id=&quot;x-5&quot; onclick=&quot;xo.do(this)&quot;&gt;&lt;/button&gt;
&lt;button id=&quot;x-6&quot; onclick=&quot;xo.do(this)&quot;&gt;
&lt;/button&gt;
    &lt;/div&gt;
    &lt;div class=&quot;c&quot;&gt;
&lt;button id=&quot;x-7&quot; onclick=&quot;xo.do(this)&quot;&gt;
&lt;/button&gt;
&lt;button id=&quot;x-8&quot; onclick=&quot;xo.do(this)&quot;&gt;
&lt;/button&gt;
&lt;button id=&quot;x-9&quot; onclick=&quot;xo.do(this)&quot;&gt;
&lt;/button&gt;
    &lt;/div&gt;
    &lt;div class=&quot;d&quot;&gt;
    &lt;/div&gt;
&lt;script&gt;
var xo={
 get(query){
if(document.getElementById(query).innerHTML==&quot;o&quot;||document.getElementById(query).innerHTML==&quot;x&quot;){
return document.getElementById(query).innerHTML}else{
	return Math.random()
    }
},
 do(self){
    if(self.innerHTML!=&quot;x&quot; &amp;&amp;   self.innerHTML!=&quot;o&quot;){
			if(xo.step%2==0){
				self.innerHTML=&quot;x&quot;
				}else{
					self.innerHTML=&quot;o&quot;
					}
					xo.step++;
				if(xo.verify())xo.win()
			   }
},
 verify(){
 	
	if(xo.get(&quot;x-1&quot;)===xo.get(&quot;x-2&quot;) &amp;&amp;  xo.get(&quot;x-2&quot;)===xo.get(&quot;x-3&quot;))return true;
	
	if(xo.get(&quot;x-4&quot;)===xo.get(&quot;x-5&quot;) &amp;&amp;  xo.get(&quot;x-5&quot;)===xo.get(&quot;x-6&quot;))return true;
	
	if(xo.get(&quot;x-7&quot;)===xo.get(&quot;x-8&quot;) &amp;&amp;  xo.get(&quot;x-8&quot;)===xo.get(&quot;x-9&quot;))return true;
	
	if(xo.get(&quot;x-1&quot;)===xo.get(&quot;x-4&quot;) &amp;&amp;  xo.get(&quot;x-4&quot;)===xo.get(&quot;x-7&quot;))return true;
	
	if(xo.get(&quot;x-2&quot;)===xo.get(&quot;x-5&quot;) &amp;&amp;  xo.get(&quot;x-5&quot;)===xo.get(&quot;x-8&quot;))return true;
	
	if(xo.get(&quot;x-3&quot;)===xo.get(&quot;x-6&quot;) &amp;&amp;  xo.get(&quot;x-6&quot;)===xo.get(&quot;x-9&quot;))return true;
	
	if(xo.get(&quot;x-1&quot;)===xo.get(&quot;x-5&quot;) &amp;&amp;  xo.get(&quot;x-5&quot;)===xo.get(&quot;x-9&quot;))return true;
	
	if(xo.get(&quot;x-3&quot;)===xo.get(&quot;x-5&quot;) &amp;&amp;  xo.get(&quot;x-5&quot;)===xo.get(&quot;x-7&quot;))return true;

	if(xo.step===9)return false;
},
win(){
	document.querySelector(&quot;.d&quot;).innerHTML=xo.step%2==0?&quot;o赢了&quot;:&quot;x赢了&quot;
    	
},
step: 0
}

&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
```]]></description>
    </item>
        <item>
        <title><![CDATA[canvas画函数]]></title>
		<link><![CDATA[https://wiki.wodemo.net/entry/520762]]></link>
		<dc:creator><![CDATA[Crazy白茫茫 (@wiki)]]></dc:creator>
		<pubDate><![CDATA[Tue, 09 Jul 2019 01:30:35 -0700]]></pubDate>
        <description><![CDATA[

(function(){
    let canvas = document.getElementById('myCanvas');
    if(!canvas.getContext) return;
    let ctx = canvas.getContext("2d");
    ctx.fillStyle = "rgb(200,0,0)";
    ctx.strokeRect (0,0,300,300);
    let y;
      //绘制矩形
for(let x=0;x

html{
filter: grayscale(100%);
-moz-filter: grayscale(100%);
-o-filter: grayscale(100%);
-webkit-filter: grayscale(1);
}

]]></description>
    </item>
    </channel>
</rss>
