You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{quote {author: "Edsger Dijkstra", title: "The Threats to Computing Science", chapter: true}
6
6
@@ -18,7 +18,7 @@ In "project" chapters, I'll stop pummeling you with new theory for a brief momen
18
18
19
19
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.
20
20
21
-
## Meadowfield
21
+
## Çayır alanı
22
22
23
23
{{index "roads array"}}
24
24
@@ -70,7 +70,7 @@ Given an array of edges, `buildGraph` creates a map object that, for each node,
70
70
71
71
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.
72
72
73
-
## The task
73
+
## Görev
74
74
75
75
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.
76
76
@@ -140,7 +140,7 @@ console.log(first.place);
140
140
141
141
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.
142
142
143
-
## Persistent data
143
+
## Kalıcı veriler
144
144
145
145
{{index "persistent data structure", mutability, ["data structure", immutable]}}
146
146
@@ -163,7 +163,7 @@ For a small system like the one we are building in this chapter, we could handle
163
163
164
164
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.
165
165
166
-
## Simulation
166
+
## Simülasyon
167
167
168
168
{{index simulation, "virtual world"}}
169
169
@@ -258,7 +258,7 @@ The way `runRobotAnimation` is implemented will remain a mystery for now, but af
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.
302
302
@@ -306,7 +306,7 @@ To do that, it has to be able to deliberately move toward a given parcel or towa
306
306
307
307
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.
308
308
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.
310
310
311
311
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).
312
312
@@ -374,9 +374,9 @@ if}}
374
374
375
375
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.
376
376
377
-
## Exercises
377
+
## Egzersizler
378
378
379
-
### Measuring a robot
379
+
### Bir robotun ölçülmesi
380
380
381
381
{{index "measuring a robot (exercise)", testing, automation, "compareRobots function"}}
382
382
@@ -395,6 +395,7 @@ function compareRobots(robot1, memory1, robot2, memory2) {
0 commit comments