diff --git a/exhaustive-search.md b/exhaustive-search.md index 983318e06dd4d4c0fb4bf8257baff2f97bfc6eb2..3cacc9f88466e43b4517f6a38b25ad7a7ce4737a 100644 --- a/exhaustive-search.md +++ b/exhaustive-search.md @@ -16,7 +16,7 @@ Postcondition: (If `p` is a post, then `p.tags` gives its tags as a set of strings.) -``` +```js function filter(posts, tag) { // … } @@ -51,7 +51,7 @@ green, and blue.) (If `g` is a graph, then `g.vertices` gives its vertices as a set.) -``` +```js function color(graph) { // … for (const coloring of mappings(graph.vertices, PALETTE)) { @@ -85,7 +85,7 @@ of vertex pairs.) (The parameter `coloring` is assumed to hold a dictionary that maps vertices to colors.) -``` +```js function isValidColoring(graph, coloring) { // … } @@ -112,7 +112,7 @@ Sad path: ### JavaScript -``` +```js function knapsack(items, getWeight, weightLimit, getValue) { // … for (const option of options(items, getWeight, weightLimit)) { @@ -139,7 +139,7 @@ Postcondition: #### JavaScript -``` +```js function options(items, getWeight, weightLimit) { // … }