Skip to content

Commit dbf3759

Browse files
committed
gfx readme
1 parent eef223e commit dbf3759

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

README.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,19 @@ It is so dull to compute Fibonacci numbers, so here are more eyecandy examples f
5959
make gfx
6060
```
6161
### Mandelbrot set
62-
![](https://raw.githubusercontent.com/ssloy/ssloy.github.io/main/docs/tinycompiler/gfx/mandelbrot.png)
62+
<img src="https://raw.githubusercontent.com/ssloy/ssloy.github.io/main/docs/tinycompiler/gfx/mandelbrot.png" width="336">
6363

6464
### Zero-player breakout game
6565
![](https://raw.githubusercontent.com/ssloy/ssloy.github.io/main/docs/tinycompiler/gfx/breakout.gif)
6666

6767
### Fire
6868
![](https://raw.githubusercontent.com/ssloy/ssloy.github.io/main/docs/tinycompiler/gfx/fire6.gif)
69+
70+
### Sunset race
71+
![](https://raw.githubusercontent.com/ssloy/ssloy.github.io/main/docs/tinycompiler/gfx/sunset-race.gif)
72+
73+
### Metaballs
74+
![](https://raw.githubusercontent.com/ssloy/ssloy.github.io/main/docs/tinycompiler/gfx/metaballs.gif)
75+
76+
77+

test-programs/simple/eight-queens.wend

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ main() {
1414
bool valid_position(int row, int col) { // Is it safe to plase a queen in this position?
1515
int r; int c; // The board is filled left-to-right (it contains col-1 queens),
1616
c = 0; // so we need to check to the left of row,col position.
17-
while c<col { // Moreover, no need to check col column.
18-
if board(c+row*8) {
17+
while c<col {
18+
if board(c+row*8) { // Check current row (no need to check col column).
1919
return false;
2020
}
2121
c = c + 1;
2222
}
2323
r = row; c = col;
2424
while c>=0 && r>=0 {
25-
if board(c+r*8) {
25+
if board(c+r*8) { // Check the diagonal.
2626
return false;
2727
}
2828
r = r - 1;
2929
c = c - 1;
3030
}
3131
r = row; c = col;
3232
while r<8 && c>=0 {
33-
if board(c+r*8) {
33+
if board(c+r*8) { // Check the anti-diagonal.
3434
return false;
3535
}
3636
r = r + 1;

0 commit comments

Comments
 (0)