Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <chrono>
- #include <stdlib.h>
- #include <thread>
- #include <vector>
- using namespace std;
- string srep(string str, int rep){
- int i2 = 0;
- string newStr = "";
- for (i2 = 0; i2 < rep; i2 = i2 + 1) {
- newStr = newStr + str;
- }
- return newStr;
- }
- void main() {
- /*
- string text = "*** *** *** ***";
- while ( true ) {
- int i = 0;
- for (i = 0; i < 20; i = i + 1) {
- cout << srep(" ", i) + text << endl;
- this_thread::sleep_for(std::chrono::milliseconds(50));
- }
- for (i = 20; i > 0; i = i - 1) {
- cout << srep(" ", i) + text << endl;
- this_thread::sleep_for(std::chrono::milliseconds(50));
- }
- }
- */
- vector<string> pattern(2);
- pattern[0] = " o o o o o o o o o o o o o o o o o o ";
- pattern[1] = " o o o o o o o o o o o o o o o o o o ";
- size_t limit = 21;
- while (true) {
- size_t i = 0;
- for (i = 0; i < pattern[1].size(); i = i + limit) { // + 20 instead of limit makes a cool lightning bolt thing
- cout << pattern[1].substr(i, limit) << endl;
- this_thread::sleep_for(std::chrono::milliseconds(25));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement