# Integral

Integral is an esoteric programming language created by User:OriginalOldMan on March 1, 2015. Programs consist of a polynomial whose integral is taken to determine how the program will run.

## Instructions

When the program is run, the integral of the polynomial is taken. For example

`30x^4 + 28x^3 + 15x^2 + 12x + 8`

would be turned into

`6x^5 + 7x^4 + 5x^3 + 6x^2 + 8x`

Then the coefficient of each term is encoded into a BF instruction as follows:

Coefficient BF
1 >
2 <
3 `+`
4 -
5 .
6 ,
7 [
8 ]

If the coefficient is greater than 8, the coefficient modulo 8 is encoded. For example 12 would be encoded as 4 or `-`. Coefficients of 0 are ignored.

So:

`6x^5 + 7x^4 + 5x^3 + 6x^2 + 8x`

would be encoded as:

`,[.,]`

A cat program!

## Programs

Hello world:

```318x^105 + 315x^104 + 312x^103 + 309x^102 + 306x^101 + 303x^100 + 300x^99 + 297x^98 + 686x^97 + 97x^96 +
288x^95 + 285x^94 + 282x^93 + 279x^92 + 644x^91 + 91x^90 + 270x^89 + 267x^88 + 88x^87 + 261x^86 +
258x^85 + 255x^84 + 84x^83 + 249x^82 + 246x^81 + 243x^80 + 80x^79 + 237x^78 + 156x^77 + 154x^76 +
152x^75 + 150x^74 + 296x^73 + 584x^72 + 72x^71 + 213x^70 + 70x^69 + 207x^68 + 68x^67 + 268x^66 +
66x^65 + 65x^64 + 192x^63 + 441x^62 + 124x^61 + 488x^60 + 120x^59 + 236x^58 + 464x^57 + 57x^56 +
56x^55 + 275x^54 + 54x^53 + 212x^52 + 208x^51 + 204x^50 + 250x^49 + 147x^48 + 144x^47 + 141x^46 +
138x^45 + 135x^44 + 132x^43 + 129x^42 + 210x^41 + 205x^40 + 120x^39 + 117x^38 + 114x^37 + 185x^36 +
36x^35 + 35x^34 + 170x^33 + 66x^32 + 128x^31 + 155x^30 + 60x^29 + 145x^28 + 84x^27 + 81x^26 +
78x^25 + 125x^24 + 96x^23 + 92x^22 + 88x^21 + 84x^20 + 80x^19 + 76x^18 + 90x^17 + 68x^16 +
64x^15 + 60x^14 + 56x^13 + 52x^12 + 48x^11 + 44x^10 + 40x^9 + 45x^8 + 8x^7 + 7x^6 +
18x^5 + 25x^4 + 4x^3 + 9x^2 + 6x^1 + 5```

In BF:

`++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.`

Fibonacci Numbers:

```1533x^510 + 1530x^509 + 1527x^508 + 1524x^507 + 1521x^506 + 1518x^505 + 1515x^504 + 1512x^503 + 1509x^502 + 1506x^501 +
1503x^500 + 500x^499 + 1497x^498 + 498x^497 + 497x^496 + 496x^495 + 495x^494 + 1482x^493 + 1479x^492 + 1476x^491 +
1473x^490 + 1470x^489 + 1467x^488 + 1464x^487 + 1461x^486 + 1458x^485 + 1455x^484 + 1452x^483 + 1449x^482 + 1446x^481 +
1443x^480 + 1440x^479 + 1437x^478 + 1434x^477 + 1431x^476 + 1428x^475 + 1425x^474 + 1422x^473 + 1419x^472 + 1416x^471 +
1413x^470 + 1410x^469 + 1407x^468 + 1404x^467 + 1401x^466 + 1398x^465 + 1395x^464 + 1392x^463 + 1389x^462 + 1386x^461 +
1383x^460 + 1380x^459 + 1377x^458 + 1374x^457 + 1371x^456 + 1368x^455 + 1365x^454 + 1362x^453 + 1359x^452 + 1356x^451 +
1353x^450 + 450x^449 + 1347x^448 + 1344x^447 + 1341x^446 + 1338x^445 + 1335x^444 + 1332x^443 + 1329x^442 + 1326x^441 +
1323x^440 + 1320x^439 + 1317x^438 + 1314x^437 + 1311x^436 + 1308x^435 + 1305x^434 + 1302x^433 + 1299x^432 + 1296x^431 +
1293x^430 + 1290x^429 + 1287x^428 + 1284x^427 + 1281x^426 + 1278x^425 + 1275x^424 + 1272x^423 + 1269x^422 + 1266x^421 +
1263x^420 + 1260x^419 + 1257x^418 + 1254x^417 + 834x^416 + 832x^415 + 830x^414 + 828x^413 + 826x^412 + 824x^411 +
2877x^410 + 410x^409 + 2863x^408 + 408x^407 + 407x^406 + 406x^405 + 405x^404 + 404x^403 + 403x^402 + 1206x^401 +
401x^400 + 1200x^399 + 798x^398 + 796x^397 + 794x^396 + 792x^395 + 790x^394 + 788x^393 + 786x^392 + 1568x^391 +
3128x^390 + 390x^389 + 389x^388 + 388x^387 + 387x^386 + 386x^385 + 385x^384 + 384x^383 + 2681x^382 + 764x^381 +
762x^380 + 760x^379 + 758x^378 + 756x^377 + 754x^376 + 752x^375 + 1125x^374 + 374x^373 + 373x^372 + 372x^371 +
371x^370 + 370x^369 + 369x^368 + 368x^367 + 1468x^366 + 2928x^365 + 730x^364 + 2548x^363 + 363x^362 + 1086x^361 +
1083x^360 + 1080x^359 + 1077x^358 + 1074x^357 + 1071x^356 + 1068x^355 + 1065x^354 + 1062x^353 + 1059x^352 + 2464x^351 +
1404x^350 + 700x^349 + 1396x^348 + 2436x^347 + 347x^346 + 346x^345 + 1035x^344 + 344x^343 + 1029x^342 + 684x^341 +
682x^340 + 680x^339 + 1356x^338 + 2704x^337 + 337x^336 + 336x^335 + 335x^334 + 2338x^333 + 666x^332 + 664x^331 +
662x^330 + 990x^329 + 329x^328 + 328x^327 + 327x^326 + 1304x^325 + 2600x^324 + 972x^323 + 646x^322 + 2254x^321 +
321x^320 + 2240x^319 + 1276x^318 + 2544x^317 + 634x^316 + 2212x^315 + 1260x^314 + 2512x^313 + 2504x^312 + 312x^311 +
2177x^310 + 620x^309 + 618x^308 + 2156x^307 + 307x^306 + 306x^305 + 305x^304 + 912x^303 + 606x^302 + 604x^301 +
602x^300 + 1200x^299 + 2392x^298 + 298x^297 + 297x^296 + 2072x^295 + 1180x^294 + 2352x^293 + 2344x^292 + 584x^291 +
582x^290 + 2320x^289 + 289x^288 + 288x^287 + 287x^286 + 2002x^285 + 285x^284 + 284x^283 + 849x^282 + 282x^281 +
843x^280 + 560x^279 + 558x^278 + 556x^277 + 1108x^276 + 2208x^275 + 275x^274 + 274x^273 + 273x^272 + 1904x^271 +
542x^270 + 540x^269 + 538x^268 + 804x^267 + 267x^266 + 266x^265 + 265x^264 + 1056x^263 + 2104x^262 + 786x^261 +
522x^260 + 1820x^259 + 259x^258 + 1806x^257 + 1028x^256 + 2048x^255 + 510x^254 + 1778x^253 + 1012x^252 + 2016x^251 +
2008x^250 + 250x^249 + 1743x^248 + 496x^247 + 494x^246 + 738x^245 + 245x^244 + 244x^243 + 1701x^242 + 968x^241 +
1928x^240 + 1920x^239 + 478x^238 + 476x^237 + 474x^236 + 472x^235 + 470x^234 + 468x^233 + 466x^232 + 1856x^231 +
231x^230 + 230x^229 + 229x^228 + 228x^227 + 227x^226 + 1582x^225 + 675x^224 + 672x^223 + 669x^222 + 666x^221 +
663x^220 + 660x^219 + 657x^218 + 654x^217 + 651x^216 + 648x^215 + 645x^214 + 642x^213 + 639x^212 + 636x^211 +
633x^210 + 630x^209 + 627x^208 + 624x^207 + 621x^206 + 618x^205 + 615x^204 + 612x^203 + 609x^202 + 606x^201 +
603x^200 + 600x^199 + 597x^198 + 594x^197 + 591x^196 + 588x^195 + 585x^194 + 582x^193 + 579x^192 + 576x^191 +
573x^190 + 570x^189 + 567x^188 + 564x^187 + 561x^186 + 558x^185 + 555x^184 + 552x^183 + 549x^182 + 546x^181 +
543x^180 + 540x^179 + 537x^178 + 534x^177 + 885x^176 + 1232x^175 + 700x^174 + 1392x^173 + 1384x^172 + 516x^171 +
513x^170 + 510x^169 + 507x^168 + 504x^167 + 501x^166 + 498x^165 + 495x^164 + 492x^163 + 489x^162 + 324x^161 +
1127x^160 + 640x^159 + 159x^158 + 632x^157 + 314x^156 + 1248x^155 + 155x^154 + 462x^153 + 459x^152 + 456x^151 +
453x^150 + 450x^149 + 447x^148 + 444x^147 + 441x^146 + 438x^145 + 435x^144 + 432x^143 + 429x^142 + 426x^141 +
423x^140 + 420x^139 + 417x^138 + 414x^137 + 411x^136 + 408x^135 + 405x^134 + 402x^133 + 399x^132 + 396x^131 +
393x^130 + 390x^129 + 387x^128 + 384x^127 + 381x^126 + 378x^125 + 375x^124 + 372x^123 + 369x^122 + 366x^121 +
363x^120 + 360x^119 + 357x^118 + 354x^117 + 351x^116 + 348x^115 + 345x^114 + 342x^113 + 339x^112 + 336x^111 +
333x^110 + 330x^109 + 327x^108 + 324x^107 + 321x^106 + 530x^105 + 735x^104 + 416x^103 + 824x^102 + 204x^101 +
202x^100 + 200x^99 + 198x^98 + 196x^97 + 194x^96 + 192x^95 + 190x^94 + 188x^93 + 186x^92 + 184x^91 +
182x^90 + 630x^89 + 89x^88 + 88x^87 + 87x^86 + 258x^85 + 85x^84 + 252x^83 + 166x^82 + 164x^81 +
162x^80 + 160x^79 + 316x^78 + 624x^77 + 77x^76 + 76x^75 + 75x^74 + 74x^73 + 511x^72 + 144x^71 +
142x^70 + 140x^69 + 138x^68 + 204x^67 + 67x^66 + 66x^65 + 65x^64 + 64x^63 + 252x^62 + 496x^61 +
122x^60 + 240x^59 + 413x^58 + 58x^57 + 57x^56 + 280x^55 + 55x^54 + 270x^53 + 106x^52 + 104x^51 +
102x^50 + 350x^49 + 196x^48 + 384x^47 + 376x^46 + 92x^45 + 90x^44 + 308x^43 + 43x^42 + 42x^41 +
123x^40 + 40x^39 + 117x^38 + 76x^37 + 74x^36 + 72x^35 + 140x^34 + 272x^33 + 33x^32 + 32x^31 +
31x^30 + 210x^29 + 58x^28 + 56x^27 + 54x^26 + 78x^25 + 25x^24 + 24x^23 + 23x^22 + 88x^21 +
168x^20 + 40x^19 + 38x^18 + 126x^17 + 34x^16 + 48x^15 + 15x^14 + 56x^13 + 104x^12 + 12x^11 +
77x^10 + 20x^9 + 27x^8 + 8x^7 + 28x^6 + 48x^5 + 10x^4 + 8x^3 + 6x^2 + 8x +
8```

In BF:

`+++++++++++>+>>>>++++++++++++++++++++++++++++++++++++++++++++>++++++++++++++++++++++++++++++++<<<<<<[>[>>>>>>+>+<<<<<<<-]>>>>>>>[<<<<<<<+>>>>>>>-]<[>++++++++++[-<-[>>+>+<<<-]>>>[<<<+>>>-]+<[>[-]<[-]]>[<<[>>>+<<<-]>>[-]]<<]>>>[>>+>+<<<-]>>>[<<<+>>>-]+<[>[-]<[-]]>[<<+>>[-]]<<<<<<<]>>>>>[++++++++++++++++++++++++++++++++++++++++++++++++.[-]]++++++++++<[->-<]>++++++++++++++++++++++++++++++++++++++++++++++++.[-]<<<<<<<<<<<<[>>>+>+<<<<-]>>>>[<<<<+>>>>-]<-[>>.>.<<<[-]]<<[>>+>+<<<-]>>>[<<<+>>>-]<<[<+>-]>[<+>-]<<<-]`

## BF to Integral converter

A BF to Integral converter written in Ruby:

```program = File.open(gets.delete("\n"),"r").read
\$instructions = ['>','<','+','-','.',',','[',']']
def index(c)
for i in 0..\$instructions.length-1
if c == \$instructions[i]
return i
end
end
end
for i in 0..program.length-1
if i % 10 == 0
puts
end
print (index(program[i]) + 1) * (program.length - i)
print "x^"
print program.length - i - 1
if i < program.length - 1
print " + "
end
end
puts
```