Solved

MP3 while playibg tic-tac-toe

Posted on 2004-09-10
10
284 Views
Last Modified: 2010-04-15
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
Comment
Question by:HonAlan
  • 4
  • 3
  • 3
10 Comments
 
LVL 11

Assisted Solution

by:griessh
griessh earned 50 total points
ID: 12029881
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
 

Author Comment

by:HonAlan
ID: 12035545
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
 
LVL 3

Accepted Solution

by:
CmdrRickHunter earned 75 total points
ID: 12037233
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
 

Author Comment

by:HonAlan
ID: 12042276
do u have the griessh's
0
 
LVL 3

Expert Comment

by:CmdrRickHunter
ID: 12079223
griessh?
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 11

Expert Comment

by:griessh
ID: 12083542
?
0
 

Author Comment

by:HonAlan
ID: 12087526
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
 
LVL 11

Expert Comment

by:griessh
ID: 12091479
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
 
LVL 3

Expert Comment

by:CmdrRickHunter
ID: 12104836
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
 
LVL 11

Expert Comment

by:griessh
ID: 12106647
not public ... my company wants to charge for then :-)
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now