Skip to content

Commit 9725e8f

Browse files
committed
progress on 07
1 parent 908b80a commit 9725e8f

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

07_robot.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{{meta {load_files: ["code/chapter/07_robot.js", "code/animatevillage.js"], zip: html}}}
22

3-
# Project: A Robot
3+
# Proje: Robot
44

55
{{quote {author: "Edsger Dijkstra", title: "The Threats to Computing Science", chapter: true}
66

@@ -18,7 +18,7 @@ In "project" chapters, I'll stop pummeling you with new theory for a brief momen
1818

1919
Our project in this chapter is to build an ((automaton)), a little program that performs a task in a ((virtual world)). Our automaton will be a mail-delivery ((robot)) picking up and dropping off parcels.
2020

21-
## Meadowfield
21+
## Çayır alanı
2222

2323
{{index "roads array"}}
2424

@@ -70,7 +70,7 @@ Given an array of edges, `buildGraph` creates a map object that, for each node,
7070

7171
It uses the `split` method to go from the road strings, which have the form `"Start-End"`, to two-element arrays containing the start and end as separate strings.
7272

73-
## The task
73+
## Görev
7474

7575
Our ((robot)) will be moving around the village. There are parcels in various places, each addressed to some other place. The robot picks up parcels when it comes to them and delivers them when it arrives at their destinations.
7676

@@ -140,7 +140,7 @@ console.log(first.place);
140140

141141
The move causes the parcel to be delivered, and this is reflected in the next state. But the initial state still describes the situation where the robot is at the post office and the parcel is undelivered.
142142

143-
## Persistent data
143+
## Kalıcı veriler
144144

145145
{{index "persistent data structure", mutability, ["data structure", immutable]}}
146146

@@ -163,7 +163,7 @@ For a small system like the one we are building in this chapter, we could handle
163163

164164
Unfortunately, although understanding a system built on persistent data structures is easier, _designing_ one, especially when your programming language isn't helping, can be a little harder. We'll look for opportunities to use persistent data structures in this book, but we'll also be using changeable ones.
165165

166-
## Simulation
166+
## Simülasyon
167167

168168
{{index simulation, "virtual world"}}
169169

@@ -258,7 +258,7 @@ The way `runRobotAnimation` is implemented will remain a mystery for now, but af
258258

259259
if}}
260260

261-
## The mail truck's route
261+
## Posta kamyonunun rotası
262262

263263
{{index "mailRoute array"}}
264264

@@ -296,7 +296,7 @@ runRobotAnimation(VillageState.random(), routeRobot, []);
296296

297297
if}}
298298

299-
## Pathfinding
299+
## Yol bulma
300300

301301
Still, I wouldn't really call blindly following a fixed route intelligent behavior. The ((robot)) could work more efficiently if it adjusted its behavior to the actual work that needs to be done.
302302

@@ -306,7 +306,7 @@ To do that, it has to be able to deliberately move toward a given parcel or towa
306306

307307
The problem of finding a route through a ((graph)) is a typical _((search problem))_. We can tell whether a given solution (a route) is a valid solution, but we can't directly compute the solution the way we could for 2 + 2. Instead, we have to keep creating potential solutions until we find one that works.
308308

309-
The number of possible routes through a graph is infinite. But when searching for a route from _A_ to _B_, we are interested only in the ones that start at _A_. We also don't care about routes that visit the same place twice—those are definitely not the most efficient route anywhere. So that cuts down on the number of routes that the route finder has to consider.
309+
The number of possible routes through a graph is infinite. But when searching for a route from _A_ to _B_, we are interested only in the ones that start at _A_. We also don't care about routes that visit the same place twice—those are definitely not the most efficient route anywhere. So that cuts down on the number of routes that the route finder has to consider.
310310

311311
In fact, we are mostly interested in the _shortest_ route. So we want to make sure we look at short routes before we look at longer ones. A good approach would be to "grow" routes from the starting point, exploring every reachable place that hasn't been visited yet, until a route reaches the goal. That way, we'll only explore routes that are potentially interesting, and we know that the first route we find is the shortest route (or one of the shortest routes, if there are more than one).
312312

@@ -374,9 +374,9 @@ if}}
374374

375375
This robot usually finishes the task of delivering 5 parcels in about 16 turns. That's slightly better than `routeRobot` but still definitely not optimal.
376376

377-
## Exercises
377+
## Egzersizler
378378

379-
### Measuring a robot
379+
### Bir robotun ölçülmesi
380380

381381
{{index "measuring a robot (exercise)", testing, automation, "compareRobots function"}}
382382

@@ -395,6 +395,7 @@ function compareRobots(robot1, memory1, robot2, memory2) {
395395
396396
compareRobots(routeRobot, [], goalOrientedRobot, []);
397397
```
398+
398399
if}}
399400

400401
{{hint
@@ -407,7 +408,7 @@ Your measurement function can then, in a loop, generate new states and count the
407408

408409
hint}}
409410

410-
### Robot efficiency
411+
### Robot verimliliği
411412

412413
{{index "robot efficiency (exercise)"}}
413414

@@ -435,7 +436,7 @@ One possible solution would be to compute routes for all packages and then take
435436

436437
hint}}
437438

438-
### Persistent group
439+
### Kalıcı grup
439440

440441
{{index "persistent group (exercise)", "persistent data structure", "Set class", "set (data structure)", "Group class", "PGroup class"}}
441442

0 commit comments

Comments
 (0)