• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 06:01
CEST 12:01
KST 19:01
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL20] Ro24 Preview Pt2: Take-Off7[ASL20] Ro24 Preview Pt1: Runway132v2 & SC: Evo Complete: Weekend Double Feature4Team Liquid Map Contest #21 - Presented by Monster Energy9uThermal's 2v2 Tour: $15,000 Main Event18
Community News
Weekly Cups (Aug 18-24): herO dethrones MaxPax6Maestros of The Game—$20k event w/ live finals in Paris34Weekly Cups (Aug 11-17): MaxPax triples again!13Weekly Cups (Aug 4-10): MaxPax wins a triple6SC2's Safe House 2 - October 18 & 195
StarCraft 2
General
Greatest Players of All Time: 2025 Update A Eulogy for the Six Pool BoxeR's Wings Episode 2 - Fan Translation #1: Maru - Greatest Players of All Time Geoff 'iNcontroL' Robinson has passed away
Tourneys
$5,000 WardiTV Summer Championship 2025 Maestros of The Game—$20k event w/ live finals in Paris $5,100+ SEL Season 2 Championship (SC: Evo) Esports World Cup 2025 Sparkling Tuna Cup - Weekly Open Tournament
Strategy
Custom Maps
External Content
Mutation # 488 What Goes Around Mutation # 487 Think Fast Mutation # 486 Watch the Skies Mutation # 485 Death from Below
Brood War
General
No Rain in ASL20? Post ASL20 Ro24 discussion. BGH Auto Balance -> http://bghmmr.eu/ How do I speak directly to Coinbase?1-(888)-419-97 Recent recommended BW games
Tourneys
[ASL20] Ro24 Group F [ASL20] Ro24 Group E [IPSL] CSLAN Review and CSLPRO Reimagined! [ASL20] Ro24 Group D
Strategy
Muta micro map competition Simple Questions, Simple Answers Fighting Spirit mining rates [G] Mineral Boosting
Other Games
General Games
Stormgate/Frost Giant Megathread General RTS Discussion Thread Mechabellum Nintendo Switch Thread Dawn of War IV
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine The year 2050 European Politico-economics QA Mega-thread
Fan Clubs
INnoVation Fan Club SKT1 Classic Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread High temperatures on bridge(s) Gtx660 graphics card replacement
TL Community
The Automated Ban List TeamLiquid Team Shirt On Sale
Blogs
How Culture and Conflict Imp…
TrAiDoS
RTS Design in Hypercoven
a11
Evil Gacha Games and the…
ffswowsucks
INDEPENDIENTE LA CTM
XenOsky
[Girl blog} My fema…
artosisisthebest
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1332 users

Senior Project: C++ Help

Blogs > SCC-Faust
Post a Reply
SCC-Faust
Profile Blog Joined November 2007
United States3736 Posts
November 12 2008 14:21 GMT
#1
I finally decided what I was doing for my senior project. Being a senior, I don't have a lot of time and the project I am working on will take a considerable amount of time probably.

It is a basic computer to human Korean conversation program. You can pick either romanized Korean (annyeonghaseyo) or hangul Korean (인녕하세요). Then the computer will start off by saying hello in Korean, and the user may respond using basic vocabulary.

What I have done thus far is quite simple though.
I start the program, and I make it seem like it is actually loading something by using the Sleep(2000); command, which so far really has been a nice addition to my program. Then I use the function along with <windows.h> to properly change the color of the text in the console window. I do this before the user picks which type of Korean they wish to speak so they can pick what color text they type as well as the computer. I thought it was a nice add-on so the user can see a distinct difference between his/her text and the computers. However this is all I have gotten done.

Some questions:

1. Is it possible to display/write hangul in command window?
2. How should I come about for the computer to find what the user is saying and generating a response? I was figuring using strings and trying to find key words within the user's sentence and generate the most logical reply. Of course, it won't be complex and the amount of vocabulary it will accept and respond with will be limited. But as far as I know a string's termination is the space key, so I don't know how I can get the user to type a sentence and store the whole thing in a string. How do I prevent an array char[] or string from having the space key as the termination? And what shit should I use to find keywords in the string/char[]?
3. How do I delete individual items in Google Chrome's browser history? The fucking thing puts a time on when you visit shit. My brother's gonna be PISSED when he gets home.

I want to fuck Soulkey with a Zelderan.
micronesia
Profile Blog Joined July 2006
United States24698 Posts
November 12 2008 14:24 GMT
#2
Where is sleep from? Did you write it yourself? If so, do you use the clock or have multiple dummy iterations? I'm just curious.

Maybe you need to output korean text to a file if you can't get it to display on the screen properly (sounds like a decent amount of work to get the screen to display it)
ModeratorThere are animal crackers for people and there are people crackers for animals.
SCC-Faust
Profile Blog Joined November 2007
United States3736 Posts
Last Edited: 2008-11-12 14:30:05
November 12 2008 14:28 GMT
#3
On November 12 2008 23:24 micronesia wrote:
Where is sleep from? Did you write it yourself? If so, do you use the clock or have multiple dummy iterations? I'm just curious.


Actually I originally learned the Sleep command from PHP, but then I found out it was used in C++ also. It actually pauses the program for (x) amount of milliseconds. I've just searched the internet and a lot of people are using weird header files for this command, but my program only uses <iostream> and <windows.h> so far. Of course with namespace std.

Edit: Yeah Sleep command is in <windows.h> but it has to have that capitalized "S".
A lot of people on the forums I've been searching are using some custom made sleep, not one from the windows.h API sshizzzzz.


Maybe you need to output korean text to a file if you can't get it to display on the screen properly (sounds like a decent amount of work to get the screen to display it)


I was thinking about this as the other option incase displaying Korean fails in command. But yeah, either way it'll require lots of work unfortunately but it'll be semi-cool once finished.


I want to fuck Soulkey with a Zelderan.
dyodyo
Profile Blog Joined December 2005
Philippines578 Posts
November 12 2008 14:41 GMT
#4
On November 12 2008 23:21 SCC-Faust wrote:
...
And what shit should I use to find keywords in the string/char[]?
...


I don't know cpp, but I usually use Regular Expressions for this kind of task in Java/C#/PHP. I think you can use the PCRE library in c++.
TeamLiquid CJ Entusman #26
Scorch
Profile Blog Joined March 2008
Austria3371 Posts
November 12 2008 14:58 GMT
#5
On the strings terminated by a space stuff:
http://bytes.com/forum/thread572664.html
Kennigit *
Profile Blog Joined October 2006
Canada19447 Posts
Last Edited: 2008-11-12 15:05:38
November 12 2008 15:05 GMT
#6
On November 12 2008 23:41 dyodyo wrote:
Show nested quote +
On November 12 2008 23:21 SCC-Faust wrote:
...
And what shit should I use to find keywords in the string/char[]?
...


I don't know cpp, but I usually use Regular Expressions for this kind of task in Java/C#/PHP. I think you can use the PCRE library in c++.

mystring.find("What you want to find") gives you location of it. Wow level up me.
SCC-Faust
Profile Blog Joined November 2007
United States3736 Posts
November 12 2008 15:09 GMT
#7
On November 13 2008 00:05 Kennigit wrote:
Show nested quote +
On November 12 2008 23:41 dyodyo wrote:
On November 12 2008 23:21 SCC-Faust wrote:
...
And what shit should I use to find keywords in the string/char[]?
...


I don't know cpp, but I usually use Regular Expressions for this kind of task in Java/C#/PHP. I think you can use the PCRE library in c++.

mystring.find("What you want to find") gives you location of it. Wow level up me.


I love you Kennigit.
I want to fuck Soulkey with a Zelderan.
MasterOfChaos
Profile Blog Joined April 2007
Germany2896 Posts
Last Edited: 2008-11-12 19:57:10
November 12 2008 19:53 GMT
#8
http://en.wikipedia.org/wiki/ELIZA
Korean characters are probably possible if you use unicode output. Else you'd need to set your applocale to korean and use multi byte charsets which are a real horror.

@micronesia
His "sleep" is probably the winapi function which yields execution of your thread for about the specified time in milliseconds. Precision is quite bad due to low timer resolution and low thread switch interval.
http://msdn.microsoft.com/en-us/library/ms686298(VS.85).aspx
LiquipediaOne eye to kill. Two eyes to live.
Jonoman92
Profile Blog Joined September 2006
United States9104 Posts
November 12 2008 20:21 GMT
#9
System.out.println("Good Luck Faust");
Archaic
Profile Blog Joined March 2008
United States4024 Posts
November 12 2008 20:30 GMT
#10
On November 13 2008 05:21 Jonoman92 wrote:
System.out.println("Good Luck Faust");


String reply = "That's Java you noob!";
return reply;
Jonoman92
Profile Blog Joined September 2006
United States9104 Posts
Last Edited: 2008-11-13 04:20:22
November 13 2008 04:19 GMT
#11
Java is the only language I know so lay off! And by know I mean barely know.

edit: I don't know English that well either apparently because I left out a word in my original post.
Mastermind
Profile Blog Joined April 2008
Canada7096 Posts
November 13 2008 08:23 GMT
#12
Java is much nicer.
haduken
Profile Blog Joined April 2003
Australia8267 Posts
November 13 2008 12:24 GMT
#13
On November 13 2008 04:53 MasterOfChaos wrote:
http://en.wikipedia.org/wiki/ELIZA
Korean characters are probably possible if you use unicode output. Else you'd need to set your applocale to korean and use multi byte charsets which are a real horror.

@micronesia
His "sleep" is probably the winapi function which yields execution of your thread for about the specified time in milliseconds. Precision is quite bad due to low timer resolution and low thread switch interval.
http://msdn.microsoft.com/en-us/library/ms686298(VS.85).aspx


I was going to suggest having a look at ELIZA too.

The idea behind computer / IA basic is some kind of interpreter. You would have regular exp + grammars that you build into the interpreter.

It's easier to achieve 1 to 1 matching of response vs input but when the input is complex, you need to parse it appropriately.

This is very very computer science stuff, so do some research. C++ is not the ideally language for this type of programs. But stuff like Bison/Yacc can help you.
Rillanon.au
haduken
Profile Blog Joined April 2003
Australia8267 Posts
November 13 2008 12:26 GMT
#14
using sleep to fake a loading bar is very bad design. Why would you do that other than cosmetic reason?
Rillanon.au
Please log in or register to reply.
Live Events Refresh
Next event in 59m
[ Submit Event ]
Live Streams
Refresh
StarCraft: Brood War
Calm 1855
Hyuk 399
Larva 338
BeSt 238
Mind 196
Light 171
Stork 158
ZerO 145
Zeus 127
ggaemo 125
[ Show more ]
TY 120
EffOrt 112
Leta 95
Mini 91
Mong 90
Hyun 86
PianO 86
actioN 66
ToSsGirL 47
Rush 46
NotJumperer 40
Sacsri 39
soO 36
Liquid`Ret 34
sorry 34
Sharp 26
zelot 19
JulyZerg 15
Nal_rA 12
yabsab 10
ajuk12(nOOB) 5
Hm[arnc] 3
Dota 2
XcaliburYe199
XaKoH 126
League of Legends
JimRising 281
Reynor91
Counter-Strike
zeus223
oskar179
flusha140
Super Smash Bros
Westballz40
Other Games
summit1g7371
singsing1445
Happy190
SortOf158
Hui .90
ZerO(Twitch)11
Dewaltoss4
Organizations
Counter-Strike
PGL1851
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• lizZardDota280
League of Legends
• Jankos676
• Stunt586
Upcoming Events
LiuLi Cup
59m
MaxPax vs TriGGeR
ByuN vs herO
Cure vs Rogue
Classic vs HeRoMaRinE
Cosmonarchy
5h 59m
OyAji vs Sziky
Sziky vs WolFix
WolFix vs OyAji
Big Brain Bouts
5h 59m
Iba vs GgMaChine
TriGGeR vs Bunny
Reynor vs Classic
Serral vs Clem
BSL Team Wars
8h 59m
Team Hawk vs Team Dewalt
BSL Team Wars
8h 59m
Team Hawk vs Team Bonyth
Code For Giants Cup
12h 29m
SC Evo League
1d 1h
TaeJa vs Cure
Rogue vs threepoint
ByuN vs Creator
MaNa vs Classic
Maestros of the Game
1d 5h
ShoWTimE vs Cham
GuMiho vs Ryung
Zoun vs Spirit
Rogue vs MaNa
[BSL 2025] Weekly
1d 7h
SC Evo League
2 days
[ Show More ]
Maestros of the Game
2 days
SHIN vs Creator
Astrea vs Lambo
Bunny vs SKillous
HeRoMaRinE vs TriGGeR
BSL Team Wars
2 days
Team Bonyth vs Team Sziky
BSL Team Wars
2 days
Team Dewalt vs Team Sziky
Monday Night Weeklies
3 days
Replay Cast
3 days
Sparkling Tuna Cup
3 days
PiGosaur Monday
4 days
LiuLi Cup
5 days
Replay Cast
5 days
The PondCast
5 days
RSL Revival
5 days
Maru vs SHIN
MaNa vs MaxPax
RSL Revival
6 days
Reynor vs Astrea
Classic vs sOs
Liquipedia Results

Completed

CSL Season 18: Qualifier 1
WardiTV Summer 2025
HCC Europe

Ongoing

Copa Latinoamericana 4
BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21 Qualifiers
ASL Season 20
Acropolis #4 - TS1
CSL Season 18: Qualifier 2
SEL Season 2 Championship
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025

Upcoming

CSL 2025 AUTUMN (S18)
LASL Season 20
BSL Season 21
BSL 21 Team A
Chzzk MurlocKing SC1 vs SC2 Cup #2
RSL Revival: Season 2
Maestros of the Game
EC S1
Sisters' Call Cup
Skyesports Masters 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
MESA Nomadic Masters Fall
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.