• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 07:33
CET 13:33
KST 21:33
  • 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
RSL Revival - 2025 Season Finals Preview8RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns5[BSL21] Non-Korean Championship - Starts Jan 103SC2 All-Star Invitational: Jan 17-1822Weekly Cups (Dec 22-28): Classic & MaxPax win, Percival surprises3Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies3
StarCraft 2
General
Weekly Cups (Dec 29-Jan 4): Protoss rolls, 2v2 returns SC2 All-Star Invitational: Jan 17-18 Weekly Cups (Dec 22-28): Classic & MaxPax win, Percival surprises Chinese SC2 server to reopen; live all-star event in Hangzhou Starcraft 2 Zerg Coach
Tourneys
SC2 AI Tournament 2026 WardiTV Winter Cup OSC Season 13 World Championship uThermal 2v2 Circuit WardiTV Mondays
Strategy
Simple Questions Simple Answers
Custom Maps
Map Editor closed ?
External Content
Mutation # 507 Well Trained Mutation # 506 Warp Zone Mutation # 505 Rise From Ashes Mutation # 504 Retribution
Brood War
General
StarCraft & BroodWar Campaign Speedrun Quest BGH Auto Balance -> http://bghmmr.eu/ I would like to say something about StarCraft Data analysis on 70 million replays Empty tournaments section on Liquipedia
Tourneys
[Megathread] Daily Proleagues [BSL21] Grand Finals - Sunday 21:00 CET [BSL21] Non-Korean Championship - Starts Jan 10 SLON Grand Finals – Season 2
Strategy
Simple Questions, Simple Answers Game Theory for Starcraft Current Meta [G] How to get started on ladder as a new Z player
Other Games
General Games
Stormgate/Frost Giant Megathread General RTS Discussion Thread Nintendo Switch Thread Awesome Games Done Quick 2026! Should offensive tower rushing be viable in RTS games?
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
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas Survivor II: The Amazon Sengoku Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Trading/Investing Thread The Big Programming Thread Canadian Politics Mega-thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List TL+ Announced
Blogs
How do archons sleep?
8882
Psychological Factors That D…
TrAiDoS
James Bond movies ranking - pa…
Topin
StarCraft improvement
iopq
GOAT of Goats list
BisuDagger
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1384 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 States24751 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 States9105 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 States9105 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
OSC
12:00
Season 13 World Championship
ArT vs MindelVKLIVE!
Cham vs sebesdes
Shameless vs Jumy
Nicoract vs Krystianer
WardiTV363
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
uThermal 317
BRAT_OK 77
MindelVK 28
LamboSC2 17
SC2Nice 11
StarCraft: Brood War
Britney 65059
Rain 5233
Jaedong 1308
Horang2 582
Hyuk 565
EffOrt 453
Stork 408
Larva 400
Shuttle 366
BeSt 287
[ Show more ]
ZerO 277
Light 269
Snow 250
Rush 246
Sharp 149
Mong 126
Leta 72
JYJ 60
Mind 53
ToSsGirL 51
sorry 50
NotJumperer 46
Barracks 45
Killer 45
Aegong 35
Icarus 24
zelot 16
Sacsri 13
soO 13
Noble 13
Bale 13
Terrorterran 12
HiyA 11
Sea 0
Dota 2
XaKoH 798
XcaliburYe171
League of Legends
C9.Mang0497
Counter-Strike
olofmeister2436
x6flipin770
Other Games
singsing1877
Gorgc1659
B2W.Neo1293
JimRising 397
Pyrionflax352
crisheroes247
Fuzer 214
Mew2King98
ZerO(Twitch)8
Organizations
Other Games
gamesdonequick29485
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 12 non-featured ]
StarCraft 2
• StrangeGG 82
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos3119
Upcoming Events
OSC
1d 1h
SOOP
2 days
SHIN vs GuMiho
Cure vs Creator
The PondCast
2 days
Sparkling Tuna Cup
3 days
IPSL
4 days
DragOn vs Sziky
Replay Cast
4 days
Wardi Open
4 days
Monday Night Weeklies
5 days
Liquipedia Results

Completed

Proleague 2026-01-06
WardiTV 2025
META Madness #9

Ongoing

C-Race Season 1
IPSL Winter 2025-26
OSC Championship Season 13
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025

Upcoming

Escore Tournament S1: W3
BSL 21 Non-Korean Championship
CSL 2025 WINTER (S19)
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Thunderfire SC2 All-star 2025
Big Gabe Cup #3
Nations Cup 2026
Underdog Cup #3
NA Kuram Kup
BLAST Open Spring 2026
ESL Pro League Season 23
ESL Pro League Season 23
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
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 © 2026 TLnet. All Rights Reserved.