查看: 21916| 回复: 31
跳转到指定楼层
上一主题 下一主题
收起左侧

有想法组织Stanford CS106A课程

全局:

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x

大家都知道,Stanford CS106A是以Java为载体讲编程思想的公开课

网易公开课视频在这里http://v.163.com/special/sp/programming.html
官网为http://see.stanford.edu/see/courseinfo.aspx?coll=824a47e1-135f-4508-a5aa-866adcae1111,上面有课程时间安排,作业,讲义,软件之类的,东西特别全

一共28课,每课50分钟左右,每个section有小assignment,大Assignment有7个。小assignment有答案,大的就没有了,当然网上也可以找到部分程序

虽有这个组织的想法,然有以下考虑:
1. 不知如何组织,发到哪个版块,是否需要审核通过才可组织;
2. 学过此课的童鞋众多,不知还有多少人愿意学,能否组织得起来;
3. 本人不才,编程能力不佳,不知能否胜任这个组织者的工作。或者,大牛们帮下忙?

望大家指教

上一篇:Stanford Design and Analysis of Algorithm I 第二期 Week#5 自由讨论
下一篇:Stanford CS106A 1#Assignment1讨论
推荐
xieyt 2015-12-26 11:34:42 | 只看该作者
全局:
表示网易的画质。。跪了ORZ很多代码看不清啊
回复

使用道具 举报

全局:
lz是否有兴趣在编程版组织学这个课?每个课时学完有1学分奖励(=50大米)
回复

使用道具 举报

推荐
伊望纯粹 2014-10-22 00:20:30 | 只看该作者
全局:
assignment2# pyramid
import acm.graphics.*;
import acm.program.*;
import java.awt.*;
public class Pyramid  extends GraphicsProgram {
        /** Width of each brick in pixels */
        private static final int BRICK_WIDTH = 30;

        /** Height of each brick in pixels */
        private static final int BRICK_HEIGHT = 12;

        /** Number of bricks in the base of the pyramid */
        private static final int BRICKS_IN_BASE = 14;
       
        public void run() {
                int j=1;
                for(int i=BRICKS_IN_BASE; i>0; i--){
                        addOneRow(i,j);
                        j++;
                }
        }
        private void addOneRow(int i,int j){
                for (int k=0;k<i;k++){
                 GRect brick=new GRect(getWidth()/2.0-BRICK_WIDTH*i/2+k*BRICK_WIDTH,getHeight()-BRICK_HEIGHT*j,BRICK_WIDTH,BRICK_HEIGHT);
                 add(brick);
                }
        }
        }
回复

使用道具 举报

🔗
nprotect 2012-7-19 21:16:12 | 只看该作者
全局:
我在学,刚写完第一个HW的4道题。
回复

使用道具 举报

🔗
nprotect 2012-7-19 21:23:08 | 只看该作者

斯坦福CS106A自学交流贴

全局:
本人正在学这门课,个人感觉作为CS入门+进阶挺不错,对于我这种coding极少,转专业CS的人来说再合适不过了,网易上有全部28集公开课,课程为2008年的录像。今年秋天这门课照常开,所有信息,课程讲义在斯坦福官网上都有,www.stanford.edu/class/cs106a   需要两本书,一本为课程导论,叫卡雷尔机器人学java,百度即可下载,另一本教科书为JAVA语言的科学与艺术。课程难度不大,assignment难度不小。。。以下记录自己的学习过程和代码,如果有同学同在学这么课,欢迎交流代码和心得。
回复

使用道具 举报

🔗
nprotect 2012-7-19 21:28:47 | 只看该作者
全局:
今天7月19号,前4堂已经看完,结束课程导论和karel机器人,HW0,HW1,完成。心得:养成良好的编程习惯,重视程序的结构,注释,本人刚学,CS基础接近于0,大牛看如果有啥弱智问题,或者弱智想法请尽量提出,如果有对assignment不同的解法,欢迎贴上来交流,assignment 1,4题代码如下,均测试过并符合题目要求:
回复

使用道具 举报

🔗
nprotect 2012-7-19 21:33:07 | 只看该作者
全局:
assignment #1,Handout #8 No.1: CollectNewspaperKarel

/*
* File: CollectNewspaperKarel.java
* --------------------------------
* At present, the CollectNewspaperKarel subclass does nothing.
* Your job in the assignment is to add the necessary code to
* instruct Karel to walk to the door of its house, pick up the
* newspaper (represented by a beeper, of course), and then return
* to its initial position in the upper left corner of the house.
*/

import stanford.karel.*;

/*
* Name: songy6@uci.edu
* Section Leader:  ICS department
*/

public class CollectNewspaperKarel extends SuperKarel {
       
        /*
         * this is my first decomposition program of karel the robot
         * public class include karel's basic movement methods
         */
       
        public void run() {
                moveToNewspaper();
                pickBeeper();
                turnAround();
                returnToStartpoint();
           }
       
        //this is move to newspaper's decomposition
                private void moveToNewspaper() {
                        move();
                        move();
                        turnRight();
                        move();
                        turnLeft();
                        move();
           }
               
        //this is return to startpoint's decomposition       
                private void returnToStartpoint() {
                        move();
                        turnRight();
                        move();
                        turnLeft();
                        move();
                        move();
                        turnAround();
           }
}
回复

使用道具 举报

🔗
nprotect 2012-7-19 21:33:59 | 只看该作者
全局:
assignment #1,Handout #8 No.2: StoneMasonKarel


/*
* File: StoneMasonKarel.java
* --------------------------
* The StoneMasonKarel subclass as it appears here does nothing.
* When you finish writing it, it should solve the "repair the quad"
* problem from Assignment 1.  In addition to editing the program,
* you should be sure to edit this comment so that it no longer
* indicates that the program does nothing.
*/

import stanford.karel.*;

/*
* Name: songy6@uci.edu
* Section Leader: ICS department
*/

public class StoneMasonKarel extends SuperKarel {

        //this is the basic idea for karel's action, decomposition shows later on
        public void run() {
                oneLineAction();
                while(frontIsClear()) {
                move();
                move();
                move();
                move();
                oneLineAction();
                }
        }
       
        //this is the basic idea for one line action for karel, decomposition shows later on
                private void oneLineAction() {               
                   turnLeft();
                   goAction();
                   turnAround();
                   returnAction();
                   turnLeft();
        }
               
        //this is the basic idea for goAction       
                private void goAction() {
                   while(frontIsClear()) {
                   if(noBeepersPresent()) {
                   putBeeper();
                   }
                   move();
                   }
                   if(noBeepersPresent()) {
                           putBeeper();
                   }
                }
               
        //this is the basic idea for returenAction
                private void returnAction() {
                        while(frontIsClear()) {
                                move();
                        }
                }                  
}


回复

使用道具 举报

🔗
nprotect 2012-7-19 21:34:32 | 只看该作者
全局:
assignment #1,Handout #8  No.3: CheckerboardKarel

/*
* File: CheckerboardKarel.java
* ----------------------------
* When you finish writing it, the CheckerboardKarel class should draw
* a checkerboard using beepers, as described in Assignment 1.  You
* should make sure that your program works for all of the sample
* worlds supplied in the starter folder.
*/

import stanford.karel.*;

/*
* Name: songy6@uci.edu
* Section Leader: ICS department
*/

/*basic idea for karel to fill the world, decomposition shows later on*/
public class CheckerboardKarel extends SuperKarel {
        public void run() {
                oneLineAction();   //karel's first line action. pre-condition, post-condition both facing east
                while(frontIsClear()){         
         if(beepersPresent()){
              move();                    //2,4,6,8,10.... line action
              turnLeft();
              move();
              turnRight();
              oneLineAction();
      }
              else {                        
                    move();                  //3,5,7,9,11.... line action
                    oneLineAction();  
              }
      }
        }

        /*oneLineAction decomposition*/
        private void oneLineAction() {
                turnLeft();
                goAction();                   //karel's one line go action
                turnAround();
                returnAction();               //karel's one line return action
                turnLeft();
        }
       
        /*goAction decomposition, key idea for this question*/
        private void goAction() {
                while(frontIsClear()) {       //while row high is odd number,"while" ends the circulation, it also cause off by one bug
                    putBeeper();              //while circulation ends, try to go back one row and test to decide if put one beeper or not
                    move();               
                    if(frontIsClear()) {      //while row high is even,"if" ends the circulation
                            move();
                    }
                }
               
                turnAround();                 //go back one row and test
                if(frontIsClear()){
                move();
                if(noBeepersPresent()) {
                        turnAround();
                        move();
                        putBeeper();
                }
                else {                        //此else对应if(noBeepersPresent())这个循环
                            turnAround();
                                move();
                         }
                       
                }
                else {
                        oneLineAction();          //此else对应if(frontIsClear())这个循环
            }                             //加此句的目的是为了防止当只有一行的时候,退一格检测奇偶的方法会报错
}                                     //注意oneLineAction定义的初始方向与实际的goAction呈90度

        /*returnAction decomposition*/
        private void returnAction() {
                while(frontIsClear()){
                move();
        }
        }
}

回复

使用道具 举报

🔗
 楼主| yiyiyaya 2012-7-19 21:36:55 | 只看该作者
全局:
nprotect 发表于 2012-7-19 21:16
我在学,刚写完第一个HW的4道题。

我也是正在学
回复

使用道具 举报

🔗
nprotect 2012-7-19 21:43:46 | 只看该作者
全局:
assignment #1,Handout #8  No.4: MidpointFindingKarel


/*
* File: MidpointFindingKarel.java
* -------------------------------
* When you finish writing it, the MidpointFindingKarel class should
* leave a beeper on the corner closest to the center of 1st Street
* (or either of the two central corners if 1st Street has an even
* number of corners).  Karel can put down additional beepers as it
* looks for the midpoint, but must pick them up again before it
* stops.  The world may be of any size, but you are allowed to
* assume that it is at least as tall as it is wide.
*/

import stanford.karel.*;

/*
* Name:    songy6@uci.edu
* Section Leader:  ICS department
*/

public class MidpointFindingKarel extends SuperKarel  {

        public void run() {
                oneLineAction();             //karel在第一横行的行为,期望可以在本行最后一格,放上相等于本行列数的beepers
                secondAndThirdLineAction();  //karel在第二,三横行的行为,期望可以从第一横行中取beepers
                                             //并交替放在第二,三横行的最后一格上,先放第二横行的最后一格
                secondAction();              //把第二横行最后一格的所有beepers从第二横行第一格开始,每一格放一个
                thirdAction();               //把第三横行最后一格的所有beepers从第三横行第一格开始,每一格放一个
                testing();                   //检测第三行和第二行是否beeper数量一致,若第二行多一个,对应位置则为多出
                                         //那个beeper的正下方,若两行beepers数量一致,对应位置为最后一个beeper
                                             //的正下方,以及右边的一个
        }                          
      
        private void oneLineAction()  {
               while (frontIsClear()) {
               putBeeper();
               move();
                 }
           putBeeper();
           turnAround();
           move();
           while (frontIsClear()){
            if (beepersPresent()){
                    pickBeeper();
                    turnAround();
                    while (frontIsClear()){
                     move();
                    }
                    if (frontIsBlocked()){
                            putBeeper();
                            turnAround();
                            move();
                 }
            }
            else {                            //对应if(beepersPresent())
                 move();
            }
       }
           pickBeeper();                      //当搜集到了第一行第一个时,因为被边框档住了,前面的
           turnAround();                      //while (frontIsClear())不能继续下去,所以必须再单独写
           while (frontIsClear()) {           //一次循环
                   move();
           }
           if (frontIsBlocked()){
                   putBeeper();
           }
   }                                          //至此,oneLineAction结束。第一行最后一格被放上了相等于
                                              //本行列数的beepers

     private void secondAndThirdLineAction(){ //交替分给第二,第三行beepers
               turnLeft();
               while (beepersPresent()){          //第二行的最后一格
                 pickBeeper();
                 move();
                 putBeeper();
                 turnAround();
                 move();
                 turnAround();
                 if (beepersPresent()){           //第三行的最后一格,注意while和if的嵌套使用
                   pickBeeper();
                   move();
                   move();
                   putBeeper();
                   turnAround();
                   move();
                   move();
                   turnAround();
             }
               }                                  //至此,secondAndThirdLineAction结束。第二,三横行
       }                                      //的最后一格上,被分别交替放上第一行中的beepers

     private void secondAction(){             //排列第二行beepers
             move();                              //secondAndThirdLineAction结束,karel面朝北方
             turnLeft();
             while(frontIsClear()){               //把第一个beeper带至最左边
             if (beepersPresent()){               //如果从第一个beeper开始循环,找不到通用的使karel返回的条件
                     pickBeeper();
             }
             move();
             }
             if (frontIsBlocked()){               //行至最左边
                     putBeeper();                     //放下beeper
                     turnAround();
                     while(frontIsClear()){           //返回起始位置
                             move();
                     }
                     if (frontIsBlocked()){
                             turnAround();                //转身
                     }
             }
             while (beepersPresent()){            //第二个beeper开始,程序可以循环
                     pickBeeper();
                     move();
                     while (noBeepersPresent()){      //循环开始
                     move();
               }
                     if (beepersPresent()){           //从第二个beeper开始,返回的判断依据改为前方是否有beeper存在
                             turnAround();
                             move();
                             putBeeper();
                             while(frontIsClear()){
                                     move();
                             }
                             if (frontIsBlocked()){
                                     turnAround();            //至此,karel把第二行的所有beeper排列起来
                             }
                      }
         }
     }
     
     private void thirdAction(){              //排列第三行beepers,原理同第二行,不重复了
             turnRight();                         //使karel面朝北面
             move();
             turnLeft();
             while(frontIsClear()){               //把第一个beeper带至最左边
                 if (beepersPresent()){           //如果从第一个beeper开始循环,找不到通用的使karel返回的条件
                         pickBeeper();
                 }
                 move();
                 }
                 if (frontIsBlocked()){           //行至最左边
                         putBeeper();                 //放下beeper
                         turnAround();
                         while(frontIsClear()){       //返回起始位置
                                 move();
                         }
                         if (frontIsBlocked()){
                                 turnAround();            //转身
                         }
                 }
                 while (beepersPresent()){        //第二个beeper开始,程序可以循环
                         pickBeeper();
                         move();
                         while (noBeepersPresent()){    //循环开始
                         move();
                   }
                         if (beepersPresent()){         //从第二个beeper开始,返回的判断依据改为前方是否有beeper存在
                                 turnAround();
                                 move();
                                 putBeeper();
                                 while(frontIsClear()){
                                         move();
                                 }
                                 if (frontIsBlocked()){
                                         turnAround();          //至此,karel把第三行的所有beeper排列起来
                                 }
                          }
             }
     }
     
     private void testing(){        //检测第二行和第三行的差值,注意结果:1)两行相等 2)第二行比第三行多一个
             turnLeft();
             move();
             turnRight();
             while (noBeepersPresent()){
                     move();
             }
             
             if (beepersPresent()){         //接触到第二行最右边的beeper了     
                     turnRight();
                     move();                    //向上跑一格
             }
             
          if (noBeepersPresent()){      //第三行最右边如果没有beeper,此时宽度为奇数  
                     turnAround();
                     move();
                     pickBeeper();
                     move();
                     putBeeper();               //中点已经被确定,并放置了一个beeper
                     turnAround();
                     move();
                     turnLeft();                //karel在第二行最右边,面朝西
                     while (frontIsClear()){    //开始收集余下的无用beepers
                             if (beepersPresent()){
                                     pickBeeper();
                             }
                             move();
                         }
             if (frontIsBlocked()){
                     pickBeeper();            //第二行的左起第一个beeper,上面的循环无法捡起来,所以加一个
                 turnRight();
                 move();
                 turnRight();             //此时,karel在第三行的第一格,面朝东面
                 }                           
             while (frontIsClear()){
                if (beepersPresent()){
                    pickBeeper();
                }
                 move();
             }
             if (frontIsBlocked()){        //到达第三行的最右边
                     turnRight();
                     move();
                     move();
                     turnRight();              //此时karel在第一行最右边,面朝左边
             }
             while (noBeepersPresent()){
                     move();
             }
          }                   
               
          else if (beepersPresent()) {     //偶数的时候,对应   if (noBeepersPresent()){
                     turnAround();             //注意不能两个if并列连用,因为if, else if后面均可以接条件
                     pickBeeper();
                     move();
                     pickBeeper();
                     move();
                     putBeeper();
                     turnLeft();
                     move();
                     putBeeper();               //此时,两个中心点上均有一个beeper
                 turnAround();
                 move();
                 turnRight();
                 move();
                 turnLeft();                 //karel此时在第二行中间,面朝西
                         while (frontIsClear()){     //开始收集余下的无用beepers
                                 if (beepersPresent()){
                                         pickBeeper();
                                 }
                                 move();
                         }
                 if (frontIsBlocked()){
                         pickBeeper();            //第二行的左起第一个beeper,上面的循环无法捡起来,所以加一个
                     turnRight();
                     move();
                     turnRight();             //此时,karel在第三行的第一格,面朝西面
                 }                           
                 while (frontIsClear()){
                    if (beepersPresent()){
                        pickBeeper();
                    }
                     move();
                 }
                 if (frontIsBlocked()){
                         turnRight();
                         move();
                         move();
                         turnRight();
                 }
                 while (noBeepersPresent()){
                         move();
                 }
                     }                 
          }//检测差值总括号         
}//程序总括号

回复

使用道具 举报

🔗
efny 2012-7-19 21:44:36 | 只看该作者
全局:
同样在学,楼主可以组织个群,然后讨论
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表