|
1 | 1 | { |
2 | 2 | "metadata": { |
3 | 3 | "name": "", |
4 | | - "signature": "sha256:23bf015233aa6621c6b7e3018e695e5ef0d1cbe57c61e43edcc463d814de4346" |
| 4 | + "signature": "sha256:3f68ff96f90dbafb8a28fbe4cb9991fc53c5e2447b982c637b2d258b44aad07d" |
5 | 5 | }, |
6 | 6 | "nbformat": 3, |
7 | 7 | "nbformat_minor": 0, |
|
1364 | 1364 | "* chars are bytes and pointers are integers\n", |
1365 | 1365 | "* pointer arithmetic means that `array[index]` is the same as `*(array+index)` whihc is the same as `index[array]`!\n", |
1366 | 1366 | "* lax formatting rules especially with respect to whitespace (or lack of it)\n", |
1367 | | - "* Use of the comma operator to stuff multiple expressions togehter e.g. the followig program compiles \n", |
1368 | | - " ```c\n", |
1369 | | - " main() {int b, c; int a=(b=2, c=3, a<0) ? (b+=3, b-1) : (c+=b, c+2);}\n", |
1370 | | - " ```\n", |
| 1367 | + "* Use of the comma operator to combine multiple expressions together with the ?: operator\n", |
1371 | 1368 | "* Recursive function calls - e.g. main calling main repeatedly is legal C\n", |
1372 | 1369 | "\n", |
1373 | 1370 | "Here is one winning from the 2013 IOCCC [entry](http://www.ioccc.org/2013/dlowe/hint.html) that should warm the heart of statisticians - it displays sparklines (invented by Tufte).\n", |
|
1460 | 1457 | "<http://www.dreamincode.net/forums/topic/38102-obfuscated-code-a-simple-introduction/>" |
1461 | 1458 | ] |
1462 | 1459 | }, |
1463 | | - { |
1464 | | - "cell_type": "code", |
1465 | | - "collapsed": false, |
1466 | | - "input": [ |
1467 | | - "%%file obs.c\n" |
1468 | | - ], |
1469 | | - "language": "python", |
1470 | | - "metadata": {}, |
1471 | | - "outputs": [ |
1472 | | - { |
1473 | | - "output_type": "stream", |
1474 | | - "stream": "stdout", |
1475 | | - "text": [ |
1476 | | - "Overwriting obs.c\n" |
1477 | | - ] |
1478 | | - } |
1479 | | - ], |
1480 | | - "prompt_number": 198 |
1481 | | - }, |
1482 | | - { |
1483 | | - "cell_type": "code", |
1484 | | - "collapsed": false, |
1485 | | - "input": [ |
1486 | | - "!clang obs.c -o obs" |
1487 | | - ], |
1488 | | - "language": "python", |
1489 | | - "metadata": {}, |
1490 | | - "outputs": [ |
1491 | | - { |
1492 | | - "output_type": "stream", |
1493 | | - "stream": "stdout", |
1494 | | - "text": [ |
1495 | | - "\u001b[1mobs.c:1:1: \u001b[0m\u001b[0;1;35mwarning: \u001b[0m\u001b[1mtype specifier missing, defaults to 'int' [-Wimplicit-int]\u001b[0m\r\n", |
1496 | | - "main() {int b, c; int a=(b=2, c=3, a<0) ? (b+=3, b-1) : (c+=b, c+2);}\r\n", |
1497 | | - "\u001b[0;1;32m^~~~\r\n", |
1498 | | - "\u001b[0m1 warning generated.\r\n" |
1499 | | - ] |
1500 | | - } |
1501 | | - ], |
1502 | | - "prompt_number": 199 |
1503 | | - }, |
1504 | 1460 | { |
1505 | 1461 | "cell_type": "code", |
1506 | 1462 | "collapsed": false, |
|
0 commit comments