0

Hello i am a new member of this and i was trying to include a matrix effect similar to the one at the beginning of the movie and it involves using the iostream header file, is there any replacement for this file cuz i tried using ios, and iostream and neither of them work the code is as below

view source
print?
001 #include <iostream>
002 using namespace std;
003
004
005 void randChar()
006 {
007
008 char symbol = rand()%126+33;
009 cout<<symbol<<"\b";
010 }
011
012 void randCharEnd()
013 {
014 char symbol = rand()%126+33;
015 cout<<symbol;
016 }
017
018 int spaceMaker(int a)
019 {
020 for(int i =0; i<=a; i++)
021 cout<<" ";
022 }
023
024 int timeWaster (int a)
025 {
026 a = a * 10;
027 for(int i=0; i<= a; i++)
028 cout<<" \b";
029
030 }
031
032
033
034 int main()
035 {
036 system("COLOR 0A");
037
038 srand((unsigned)time(NULL));
039 int lineFeedCtr =0;
040 int charCtr;
041 int clearCtr = 0;
042 char randChar2;
043 int ctr;
044 int spaceCtr = 0;
045
046
047
048 cout<<"E";
049 timeWaster(200);
050 cout<<"N";
051 timeWaster(200);
052 cout<<"T";
053 timeWaster(200);
054 cout<<"E";
055 timeWaster(200);
056 cout<<"R ";
057 timeWaster(200);
058
059
060 cout<<"T";
061 timeWaster(200);
062 cout<<"H";
063 timeWaster(200);
064 cout<<"E ";
065 timeWaster(200);
066
067
068 cout<<"M";
069 timeWaster(200);
070 cout<<"A";
071 timeWaster(200);
072 cout<<"T";
073 timeWaster(200);
074 cout<<"R";
075 timeWaster(200);
076 cout<<"I";
077 timeWaster(200);
078 cout<<"X ";
079 timeWaster(300);
080
081
082 cout<<"N";
083 timeWaster(200);
084 cout<<"O";
085 timeWaster(200);
086 cout<<"W";
087 timeWaster(200);
088 cout<<".";
089 timeWaster(300);
090 cout<<".";
091 timeWaster(300);
092 cout<<".";
093 timeWaster(300);
094 cout<<".\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b";
095 timeWaster(1000);
096
097 randChar();
098 randChar();
099 randChar();
100 randChar();
101 randCharEnd();
102 timeWaster(200);
103
104
105 randChar();
106 randChar();
107 randChar();
108 randChar();
109 randCharEnd();
110 timeWaster(175);
111
112
113 randChar();
114 randChar();
115 randChar();
116 randChar();
117 randCharEnd();
118 timeWaster(150);
119
120
121 randChar();
122 randChar();
123 randChar();
124 randChar();
125 randCharEnd();
126 timeWaster(125);
127
128
129 randChar();
130 randChar();
131 randChar();
132 randChar();
133 randCharEnd();
134 timeWaster(120);
135
136
137 randChar();
138 randChar();
139 randChar();
140 randChar();
141 randCharEnd();
142 timeWaster(110);
143
144
145 randChar();
146 randChar();
147 randChar();
148 randChar();
149 randCharEnd();
150 timeWaster(100);
151
152
153 randChar();
154 randChar();
155 randChar();
156 randChar();
157 randCharEnd();
158 timeWaster(90);
159
160
161 randChar();
162 randChar();
163 randChar();
164 randChar();
165 randCharEnd();
166 timeWaster(80);
167
168
169 randChar();
170 randChar();
171 randChar();
172 randChar();
173 randCharEnd();
174 timeWaster(70);
175
176
177 randChar();
178 randChar();
179 randChar();
180 randChar();
181 randCharEnd();
182 timeWaster(60);
183
184
185 randChar();
186 randChar();
187 randChar();
188 randChar();
189 randCharEnd();
190 timeWaster(50);
191
192
193 randChar();
194 randChar();
195 randChar();
196 randChar();
197 randCharEnd();
198 timeWaster(50);
199
200
201 randChar();
202 randChar();
203 randChar();
204 randChar();
205 randCharEnd();
206 timeWaster(50);
207
208
209 randChar();
210 randChar();
211 randChar();
212 randChar();
213 randCharEnd();
214 timeWaster(50);
215
216
217 randChar();
218 randChar();
219 randChar();
220 randChar();
221 randCharEnd();
222 timeWaster(50);
223
224
225 randChar();
226 randChar();
227 randChar();
228 randChar();
229 randCharEnd();
230 timeWaster(50);
231
232
233 randChar();
234 randChar();
235 randChar();
236 randChar();
237 randCharEnd();
238 timeWaster(50);
239
240
241 randChar();
242 randChar();
243 randChar();
244 randChar();
245 randCharEnd();
246 timeWaster(50);
247
248
249 randChar();
250 randChar();
251 randChar();
252 randChar();
253 randCharEnd();
254 timeWaster(50);
255
256
257 randChar();
258 randChar();
259 randChar();
260 randChar();
261 randCharEnd();
262 timeWaster(50);
263
264
265 randChar();
266 randChar();
267 randChar();
268 randChar();
269 randCharEnd();
270 timeWaster(50);
271
272
273 randChar();
274 randChar();
275 randChar();
276 randChar();
277 randCharEnd();
278 timeWaster(50);
279
280
281 while(1337>0)
282 {
283 ctr = 0;
284 charCtr = rand()%10+5;
285 spaceCtr = rand()%75;
286
287 if(clearCtr>=280)
288 {
289
290 clearCtr = 0;
291 }
292
293 while(ctr <= charCtr)
294 {
295 spaceMaker(spaceCtr);
296 ctr++;
297 randChar2 = static_cast<char>(rand()%126+33);
298 cout<<randChar2<<endl;
299 clearCtr++;
300 for(int b=0; b<=200;b++)
301 cout<<" \b";
302 }
303 }
304 system("PAUSE");
305 return 0;
306 }

Votes + Comments
yeah, i don't know what the hell you've got here, but it should be shot and buried. here's some green for bravely posting it anyhow.
OMG what horrible looking program!
2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by gerard4143
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.