I’m chechin. I majored in Mould Injection in university, but I also had a good appetite for learning coding. My dream is creating some little games like the flash game in the past time I growed up.
This is The First Post I Wrote
I’m going to write something in English. I’m afraid I could not update this blog every day. English is not my native language, but I will try my best to express what I want to say.
My First Project - a Real Web Game
I’ve already completed a little project by myself. It’s a complicated tic-tac-toe game. This is my CS50 final project. Yes, I got the certificate, finally.
Here’s my github and there’s build the game on gh-pages and you can play the game immediately.
More info and the rules detail in the manual text in the following link.
I’m going to make a multiply connect system, and a beautiful tutorial.
This is just the modify the first post
I modified the first default post “hello word”, so this post is really basic, just have a chance to write something.Hope I will have time to record the problem I met in CS50, and others before.
These are the websites I read. Really easy to read. Markdown Guild
Input: s = “pwwkew” Output: 3 Explanation: The answer is “wke”, with the length of 3. Notice that the answer must be a substring, “pwke” is a subsequence and not a substring.
substring: need continuous char subsequence: can have others between the chars
Using map[key] will return undefined. It different from an object.
map.has(key) = boolean
| | | | | | | | |
1 2 3 4 5 6 7 8 9 10 11
function twoSum(nums: number[], target: number): number[] { let hash = new Map; for (let i = 0; i < nums.length; i++) { const secondNum: number = target - nums[i]; if (hash.has(secondNum)) { return [hash.get(secondNum), i]; } hash.set(nums[i], i); }
When I want to google some problem, I don’t know how to express my question. And google always can not type the sign. English is not my mother tongue so I made this table and will upgrade when I learn the new one.
This is my first time using hexo. I’m trying to record what I did. I will not talk about the details like how to make a template or something. Just talk about installing and deploying on gh-pages.
I’ve already install the Node.js and git I used yarn just like npm but faster (using npm is just do the same things)
Just like the official tutorial installing, I use npm instal hexo-cli -g (I still didn’t understand how to yarn global to command line, so just use npm here) (2021.05.30 I knew how to set global command line, will make a new post to talk about this) Then open the folder with VScode. It may be an empty folder now. And enter yarn install in your terminal. Now, there should be something in this folder. Could check the details of these in the official web if you want.
We still do not deploy the blog on gh-pages and this is just like creating an app to help you generate the static website.
Let’s deploy to the gh-pages
Use the One-Command Deployment I spent a lot of time trying to know the official deployment, but I couldn’t understand. So why not use this convenient tool?
yarn build or hexo generate Now, we build a static website.
And we can deploy the website to gh-pages now use yarn deploy or hexo deploy There’s no difference between these two commands, yarn deploy is just a method to execute the hexo deploy, check the ‘package.json’ file in your folder.
This is the script when you use yarn "scripts_name" what is going to happen. Don’t change the file if you don’t need it.(if use npm will be npm run 'scripts_name')
Finally, check your website on your github-pages. Sometimes it may take several sec. Just use the generate and deploy every time you update the new post or change the template, or more complicated things I still don’t know.
The first version site will no update, but I will not delete it as a experience.
2021.5.29 update Finally, I know what the official website text means. I Only have to push my all hexo files to one repo (the official’s branch is source but this is just a convention, mine is named main lol)
check your folder connect to the repo then
the step 4 on hexo gh-pages text
setting the CI workflow on the git. It means when you push to the branch then do these things automatically. (CI = continuous Integration)
Add .github/workflows/pages.yml file to your repo with the following content: Just copy these text to your new file which just made