Skip to content

Instantly share code, notes, and snippets.

@arllanos
Created June 11, 2020 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arllanos/6a57c6b293c0c7280562aef3d97eb248 to your computer and use it in GitHub Desktop.
Save arllanos/6a57c6b293c0c7280562aef3d97eb248 to your computer and use it in GitHub Desktop.
Render Minesweeper board
const template = `
<style>
th, td {
padding: .75rem 1.25rem;
font-size: 11px
}
.alert-info{color:#0c5460;background-color:#d1ecf1;border-color:#bee5eb;font-size:1.5rem;font-family:monospace}
.alert{position:relative;padding:.75rem 1.25rem;margin-bottom:1rem;border:1px solid transparent;border-radius:.25rem}
</style>
<div class="alert alert-info">
<strong>References:</strong> <br>
<strong>* M </strong> -----> Veiled mine <br>
<strong>* X</strong> -----> Exploded mine <br>
<strong>* E</strong> -----> Veiled Empty <br>
<strong>* B</strong> -----> Revealed Blank <br>
<strong>* Digit</strong> -> Revealed with adjacent mine count <br>
-<strong>Note: </strong> Lowercase values inidcate flagged cell-
</div>
<table font-size: 8px>
{{#each this}}
{{#each this}}
<tr>
{{#each this }}
<td>{{ this }}</td>
{{/each}}
</tr>
{{/each}}
{{/each}}
<table>
`
pm.visualizer.set(template, {
response: JSON.parse(responseBody)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment