[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 300
  • Last Modified:

MP3 while playibg tic-tac-toe

how do i start to write the code. By using c source only. I wanr to play tic-tac-toe while i also listen to my mp3.
0
HonAlan
Asked:
HonAlan
  • 4
  • 3
  • 3
2 Solutions
 
griesshCommented:
Hi HonAlan,

If you are a beginner, I suggest you concentrate on the TTT algorithm and use WinAmp to listen to mp3 files.

======
Werner
0
 
HonAlanAuthor Commented:
i have done the TTT algorithm but not yet done the Vs com 1 as i donne how to make it think by its own. So to gain a higher grade for my project at sch.
0
 
CmdrRickHunterCommented:
best solution is griessh's: have someone else decode the mp3 =p
  time to impement: 5 seconds for an expert, 3 minutes for a begining (gotta find that mp3 player... now where is it hidden?)
next best solution: download someone else's mp3 playing library, learn multithreaded code (which is a PAIN), and implement TTT in one thread, and mp3 playing in the other.  Be aware that this will not be cross platform.
  time to implement: 1-2 days for an expert, 2-4 weeks for a beginner (depending on how good you are at picking up multithreading)
worst solution: find somewhere on the web that explains the exact mp3 format... be ready because there's 2 flavors with a few dozen different variants in each flavor.  Learn how to do audio output and buffering (openAL in linux, probably directsound in windows), learn to do multithreaded code (good multithreaded code, not the easy stuff for the "next best solution"), and decode the mp3, using the algorithm found online, on the fly... because you dont want to be decoding the entire mp3 into wav format all at once (huge memry waste), and play it... all while learning how to make the computer play TTT
   time to implement: 1-8 weeks for an expert, 2months-6years for a beginner (I shiver just looking at their algorithms).


As for good TTT thinkings...
1) can I win.  If I can win, then why bother with anything else... WIN
2) can my opponent win.  if he can win (and I can't - I got past step 1), then BLOCK IT
3) have "prefered" locations (it likes the middle better, so if its open, GRAB IT), or randomly pick an opening

you're welcome to try to make neural algorithms, or learning programs that look ahead a few moves, but its TTT for pete's sake.  Its been proven that unbeatable (albiet uncreative) algorithms can be build using 1 2 and 3
0
Identify and Prevent Potential Cyber-threats

Become the white hat who helps safeguard our interconnected world. Transform your career future by earning your MS in Cybersecurity. WGU’s MSCSIA degree program was designed in collaboration with national intelligence organizations and IT industry leaders.

 
HonAlanAuthor Commented:
do u have the griessh's
0
 
CmdrRickHunterCommented:
griessh?
0
 
griesshCommented:
?
0
 
HonAlanAuthor Commented:
i need to play a song while i am playing a game in .c source
CmdrRickHunter say i need some 1 to help me decode the file and he call that griessh's
0
 
griesshCommented:
I don't have code for you ... I suggested to ue WinAmp to listen to music. You can download WinApm from http://winamp.com/player

=====
Werner
0
 
CmdrRickHunterCommented:
sorry, to clarify, if it doesn't make sense now:
>> best solution is griessh's: have someone else decode the mp3 =p
use griessh's solution : have winamp or annother program decode the mp3 in the background, withotu doing any coding.
griessh is just the name of the person who supplied the answer, not some code library or anything (well, I dont think griessh has made a public code library... have you? =p )
0
 
griesshCommented:
not public ... my company wants to charge for then :-)
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

  • 4
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now