Code Monkey home page Code Monkey logo

cs61b's Introduction

CS61B

UC Berkeley CS61B, Spring 2021.

课程主页:https://sp21.datastructur.es/

UC berkeley CS Course Map:https://hkn.eecs.berkeley.edu/courseguides

开始教程

注册 gradescope 来使用 autograder

  1. 课程入门代码:MB7ZPY

  2. 学校: UC berkeley

  3. 学生卡:不用填

拉取作业存储库

  1. 创建一个 Github 仓库

  2. 使用 Git 的 git clone 命令 把 repo 拉到本地(换成你自己的 repo 地址)

    git clone https://github.com/turing0/CS61B.git
  3. 进入到本地刚创建的 repo

    cd CS61B
  4. 运行此命令

    git remote add skeleton https://github.com/Berkeley-CS61B/skeleton-sp21.git
  5. 运行此命令 pull skeleton code

    git pull skeleton master

可能遇到的问题

Proj0

如果你的电脑系统语言是中文,那么在 proj0 的 2048 游戏界面中按键会没有反应,这是因为是系统是中文的原因,得修改一处代码。

TL;DR:

GUISource 这个文件 36 行位置开始:

String command = _source.readKey();
switch (command) {
    case "W" :
        command = "Up";
        break;
    case "D" :
        command = "Right";
        break;
    case "S" :
        command = "Down";
        break;
    case "A" :
        command = "Left";
        break;
    default :
        break;
}

将代码修改成上面那样,上下左右箭头改成了 WASD 键(注意,输入英文默认的是大写字母)。

你也可以修改为上下左右的箭头,像下面这样:

String command = _source.readKey();
switch (command) {
    case "向上箭头" :
        command = "Up";
        break;
    case "向右箭头" :
        command = "Right";
        break;
    case "向下箭头" :
        command = "Down";
        break;
    case "向左箭头" :
        command = "Left";
        break;
    default :
        break;
}

这样就解决了问题!

cs61b's People

Contributors

turing0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.