RUSES
Would you like to react to this message? Create an account in a few clicks or log in to continue.
May 2024
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
2728293031  

Calendar Calendar


Weekend Programming Challenge #3 24/02

4 posters

Go down

Weekend Programming Challenge #3 24/02 Empty Weekend Programming Challenge #3 24/02

Post  Alex Fri Feb 24, 2012 11:18 am

Create a function that will animate a Flomb - all the arms change: \ -> / and / -> \ in each frame

i.e.
\(O_O)/ -> /(O_O)\

Let's say a rough parameter for the function is (C++)

void animateFlomb(const string& flomb, int numberOfFrames);

if animateFlomb("\(O__O\)",5) was called:
The output would be
\(O__O\)
/(O__O/)
\(O__O\)
/(O__O/)
\(O__O\)

Another function to create:

string flipHorizontalFlomb(const string& flomb)


This will flip a Flomb, but it's not a case of reversing the string because if:

\(O__O\) was reversed it would look like: )\O__O(\ which doesn't look right
Instead of flipping it like that, the function should flip it like:

\(O__O\) -> (/O__O)/

Then create a flipVerticalFlomb(const string& flomb)


\(O__O\) -> /(O__O/)
(flips the arms)

Using the basic ideas in the functions created

Make a function

void danceFlomb(const string& flomb, int numFrames)


That will flip the Flomb horizontally then vertically then horizontal... etc until the numFrames counter is reached
i.e.

danceFlomb("\(O__O\)",6) would output:
\(O__O\)
(/O__O)/
(\O__O)\
/(O__O/)
\(O__O\)
(/O__O)/
(repeats every 4 frames)

Also play around with clear screen commands (i.e. Windows only system("cls")) and wait commands to make an animation instead of a list of frames, and colouring the console (i.e. Windows: system("color AA") etc) so you could make a dance animation with lots of colours Smile
Alex
Alex

Posts : 67
Join date : 2012-02-23
Location : Come at me bro

Back to top Go down

Weekend Programming Challenge #3 24/02 Empty Re: Weekend Programming Challenge #3 24/02

Post  Charlie Mon Feb 27, 2012 4:01 am

Here's mine Smile Criticism welcome.

http://pastebin.com/WWKV4pwE

Spoiler:
Charlie
Charlie

Posts : 16
Join date : 2012-02-23

Back to top Go down

Weekend Programming Challenge #3 24/02 Empty Re: Weekend Programming Challenge #3 24/02

Post  John Mon Feb 27, 2012 4:17 am

looks amazing afro rave mode is best!!
cant wait to do some of these challenges
cheers
John
John
Admin

Posts : 36
Join date : 2012-02-23
Age : 32

https://ruses.forumotion.co.uk

Back to top Go down

Weekend Programming Challenge #3 24/02 Empty Re: Weekend Programming Challenge #3 24/02

Post  Alex Tue Mar 06, 2012 3:27 am

Might stop doing these cos no-one seems interested, answer code is on my netbook but Charlie's works fine Very Happy
Alex
Alex

Posts : 67
Join date : 2012-02-23
Location : Come at me bro

Back to top Go down

Weekend Programming Challenge #3 24/02 Empty Re: Weekend Programming Challenge #3 24/02

Post  John Tue Mar 06, 2012 5:06 am

they are a realy good idea but just dont think anyone has the time at the moment Sad
John
John
Admin

Posts : 36
Join date : 2012-02-23
Age : 32

https://ruses.forumotion.co.uk

Back to top Go down

Weekend Programming Challenge #3 24/02 Empty Re: Weekend Programming Challenge #3 24/02

Post  ElliottH Tue Mar 06, 2012 6:55 am

Yeahh so busy at the moment :/ could be a good idea over easter or something?
ElliottH
ElliottH
Admin

Posts : 16
Join date : 2012-02-23

Back to top Go down

Weekend Programming Challenge #3 24/02 Empty Re: Weekend Programming Challenge #3 24/02

Post  Charlie Tue Mar 06, 2012 7:18 am

Yeah that sounds like a good idea actually, although revision could get in the way Neutral
Charlie
Charlie

Posts : 16
Join date : 2012-02-23

Back to top Go down

Weekend Programming Challenge #3 24/02 Empty Re: Weekend Programming Challenge #3 24/02

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum