- 应该是 面向过程 + 测试优先
- 可供选择的数据结构是
- (这个要好好挑一挑)
- 过程的一些规约
- 文件的输入 ,转化成我们需要的数据结构
- 在这个数据结构上,进行相关的操作
- 也借此机会建构一下相关的知识
- 数组的数组实现
http://c.biancheng.net/view/916.html
先空过去
Req 2- 实际上把 1~ nn 这么nn个数 填到n*n的表中,具体怎么填呢?
- row从0开始 填够一行 每次加1
- 英语太多了 ,只能这样慢慢看来,tnnd.
- 首先克服语言障碍。果然,我校的英语教育通过专业课完成。 希望今年6月6级能有580.
- forward(units)前进(单位)
Moves the turtle in the current direction by units pixels, where units is an integer. Following the original Logo convention, the turtle starts out facing up.
移动小海龟通过单位像素(pixels),这里单位为整数。遵从一个古老的惯例,小海龟开始的时候面是朝上的。
turn(degrees)旋转(角度)
Rotates the turtle by angle degrees to the right (clockwise), where degrees is a double precision floating point number.
向右旋转一定的角度(by angle degree)小海龟(clockwise顺时针),这里角度为double双精度类型。
You can see the definitions of these commands in Turtle.java.
Now look at the source code in TurtleSoup.java, in the src folder in package turtle.
-
Your first task is to implement drawSquare(Turtle turtle, int sideLength), using the two methods introduced above: forward and turn.
-
我们的第一个task是(终于到了 废话真多)实现drawSquare(Turtle tirtle,int sideLengh),使用上面(above)介绍的两个方法: forward 和turn.
-
Once you’ve implemented the method, run the main method in TurtleSoup.java. To run main, right-click on the file TurtleSoup.java in the Package Explorer on the left side of Eclipse, go to Run As, and select Java Application.
-
一旦(once)我实现了这个method,在
TurtleSoup.java里运行main()方法,…(对如何运行的步骤的介绍blablabla) -
This main method creates a new turtle, calls your drawSquare method, and instructs the turtle to draw on screen. A window will pop up, and, once you click the “Run!” button, you should see a square drawn on the canvas.
-
main()干了啥 main*() new了一个turtle对象,call了drawAquare方法,instructs这个tutle画在屏幕上。这个时候,一个windows就会pop up(突然出现),一旦我点了"Run!"按钮,我就会在画布上看见一个方块画在canvas(板子上一个绘画软件也叫这个名)
-
好的现在题看明白了 研究研究吧
- 这个turtle是不是小海龟的意思,感觉更像是pointer呀
- n. 海龟;海龟肉;<美>龟;淡水龟;(计算机)龟标 好吧百度一下龟标是啥
https://zhuanlan.zhihu.com/p/67397220 好吧确实是个pointer 不过是个turtle样子的
- 首先要在eclipse中打开我们的文件。
- file->import ->general->exciting …->YES
- 这就是test first的编程思想呗。
- 我# 这么高级吗 ,这也太有意思了点吧。
Implement and test a FriendshipGraph class that represents friendships in a
social network and can compute the distance between two people in the graph. An auxiliary class Person is also required to be implemented.
- 实现FriendshipGraph 类,这玩意代表社交网络中的友谊,还能计算图里头两人的距离。
- 辅助(auxiliary)的类Person也得实现
- Ctrl + Shift + F to auto-format your code!
- 这么好的吗 自动格式化代码
- 这个就需要一些基础的OOP概念了。
-
要选择一下用什么数据结构,还有应该给Person给个ID
-
然后 拿三元组存储边吧
-
不需要 拿着ID 找person
-
所以不需要数据库
-
就三元组就行 实现的话 用ArrayList+自定义数据类型(对象实现)好的
-
以邻接链表存也行 宽搜 需要列表 会更方便
-
x现在基本完成了 下面需要做一些测试。
数组赋初值 不要用 增强循环 会不成功的。
应该Test的部分还是没有完成的

![[软件构造]lab 1 一个报告 [软件构造]lab 1 一个报告](http://www.mshxw.com/aiimages/31/831868.png)
