Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

How do I make this faster?

Name: Anonymous 2019-09-10 17:01

#include <time.h>
#include <stdio.h>
#include <stdlib.h>

int myrand(int min, int max) {
int new_value;
static int previous_value;

if(min > max) return 1;

do {
srand(time(NULL));
new_value = rand() % (max - min);
} while(new_value == previous_value);

previous_value = new_value;
return new_value;
}

int main() {
for(register char c = 0; c < 5; c++) {
printf("%c\t", myrand(33, 126));
}

putchar('\n');
return 0;
}

Name: Anonymous 2019-09-11 22:56

>>14
More boilerplate, noise and unproductive crap. As bad as C but uglier.

The best programming language is English. The day we can make computers execute busines logic, like "Print five random ints from 33 to 127, tab-separated", you all can keep portable assembly, Sepples, Javur, C-octothorpe and the like to yourselves, I have business to do and my time is far more expensive than execution time jerk-offs.

In the mean time I'm content with the FIOC and similar dynamic, high-level, multi-paradigm languages where at least I can get close enough to English and keep the ratio of business logic lines to boilerplate shit quite high. And also stay out of OOP, which requires a lot of that shit too with its classes, interfaces, ``design patterns'' and similar workarounds to using fucking λ-expressions.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List