Skip to content

Commit 25c0b9b

Browse files
authoredJul 19, 2020
Merge pull request #11 from KacperMayday/100lines-generator
Added 100lines Generator
2 parents 77ee3a6 + b5de687 commit 25c0b9b

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
 

‎100lines Generator/100lines.cpp

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include <iostream>
2+
#include <cstdlib>
3+
#include <time.h>
4+
#include <iomanip>
5+
6+
int main() {
7+
std::srand(time(nullptr));
8+
int instructions;
9+
int bits;
10+
std::cout << "How many bits each instruction should have?" << std::endl;
11+
std::cin >> bits;
12+
std::cout << "How many instruction you want to generate per line?" << std::endl;
13+
std::cin >> instructions;
14+
for (int i = 0; i < 100; ++i) {
15+
for (int k = 0; k < instructions; ++k) {
16+
for (int j = 0; j < bits; ++j) {
17+
std::cout << rand() % 2;
18+
}
19+
std::cout << " ";
20+
}
21+
std::cout << std::endl;
22+
}
23+
std::cout << "I hope it doesn't have any bugs!";
24+
}

‎100lines Generator/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 100lines Generator
2+
3+
This program generates 100 lines of random program using binary code. Just copy paste generated machine code and enjoy your unique new life-changing computer program!

0 commit comments

Comments
 (0)
Please sign in to comment.