This commit is contained in:
Miloslav Ciz 2025-04-19 23:59:35 +02:00
parent d666a3d2b5
commit 165d7890e6
23 changed files with 2150 additions and 1985 deletions

View file

@ -380,8 +380,138 @@ XX XX XX XX XX XX X
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX
```
How about some text generation for a change? Let's program a corporate bullshit generator (see also [Markov chain](markov_chain.md)):
```
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
srand(123);
for (int i = 0; i < 10; ++i)
{
switch (rand() % 3)
{
case 0:
printf("To");
switch (rand() % 3)
{
case 0: printf(" us"); break;
case 1: printf(" our highly qualified team"); break;
default: printf(" our company"); break;
}
printf(" it is");
switch (rand() % 5)
{
case 0: printf(" essential"); break;
case 1: printf(" of utmost importance"); break;
case 2: printf(" given"); break;
case 3: printf(" evident"); break;
default: printf(" more than natural"); break;
}
break;
case 1:
printf("We");
switch (rand() % 4)
{
case 0: printf(" believe"); break;
case 1: printf(" know"); break;
case 2: printf(" firmly trust"); break;
default: printf(" hold"); break;
}
break;
default:
printf("Our %s%s %s",
(rand() % 2) ? "founder's " : "",
(rand() % 2) ? "motto" : "highest priority",
(rand() % 2) ? "is" : "has always been");
break;
}
printf(" that");
switch (rand() % 5)
{
case 0: printf(" your business"); break;
case 1: printf(" a brand such as yours"); break;
case 2: printf(" the company you're building"); break;
case 3: printf(" the hard work you put in"); break;
case 4: printf(" image, the driving force of strong marketing,"); break;
default: printf(" exceptional project leadership"); break;
}
switch (rand() % 5)
{
case 0: printf(" deserves"); break;
case 1: printf(" demands"); break;
case 2: printf(" always requires"); break;
case 3: printf(" must be supported by"); break;
default: printf(" should be backed by"); break;
}
switch (rand() % 7)
{
case 0: printf(" dedicated hard work"); break;
case 1: printf(" modern technology"); break;
case 2: printf(" state-of-the-art solutions"); break;
case 3: printf(" valuable feedback"); break;
case 4: printf(" paradigm shifting code reviews"); break;
case 5: printf(" blazing fast integration"); break;
default: printf(" satisfied customers"); break;
}
if (rand() % 2)
{
printf(" and");
switch (rand() % 6)
{
case 0: printf(" unprecedented data evaluation"); break;
case 1: printf(" fair treatment"); break;
case 2: printf(" effective collaboration"); break;
case 3: printf(" proffessional security"); break;
case 4: printf(" justified profit optimization"); break;
default:
printf(" our %s %s %s",
rand() % 2 ? "team" : "company",
rand() % 2 ? "is proud to" : "will reliably",
rand() % 2 ? "deliver it" : "make it a reality");
break;
}
}
if (rand() % 6 == 0)
printf(rand() % 2 ? " for uncontested prices" : " under fair conditions");
printf(". ");
}
putchar('\n');
return 0;
}
```
This very simple code still produces a stream of shit almost indistinguishable from anything found on a typical Wordpress business website:
*We know that the hard work you put in deserves modern technology and fair treatment under fair conditions. To our company it is evident that a brand such as yours demands modern technology and our team will reliably deliver it. We hold that a brand such as yours demands modern technology. Our motto has always been that your business must be supported by dedicated hard work and our company is proud to make it a reality. To us it is of utmost importance that the company you're building always requires state-of-the-art solutions. Our motto is that the hard work you put in demands paradigm shifting code reviews and our team is proud to make it a reality. To our highly qualified team it is more than natural that the company you're building should be backed by valuable feedback and fair treatment. We hold that the hard work you put in always requires modern technology and justified profit optimization. Our motto has always been that the hard work you put in should be backed by valuable feedback. We firmly trust that a brand such as yours must be supported by satisfied customers.*
TODO: some example with noise
## See Also
- [algorithmic art](algorithmic_art.md)
- [randomness](randomness.md)
- [nanogenmo](nanogenmo.md)
- [demoscene](demoscene.md)
- [markov chain](markov_chain.md)
- [fractals](fractal.md)