• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 18:00
CET 23:00
KST 07:00
  • 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
Intel X Team Liquid Seoul event: Showmatches and Meet the Pros9[ASL20] Finals Preview: Arrival13TL.net Map Contest #21: Voting10[ASL20] Ro4 Preview: Descent11Team TLMC #5: Winners Announced!3
Community News
Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win52025 RSL Offline Finals Dates + Ticket Sales!10BSL21 Open Qualifiers Week & CONFIRM PARTICIPATION2Crank Gathers Season 2: SC II Pro Teams10Merivale 8 Open - LAN - Stellar Fest5
StarCraft 2
General
Weekly Cups (Oct 13-19): Clem Goes for Four DreamHack Open 2013 revealed RotterdaM "Serral is the GOAT, and it's not close" Intel X Team Liquid Seoul event: Showmatches and Meet the Pros Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win
Tourneys
Merivale 8 Open - LAN - Stellar Fest SC4ALL $6,000 Open LAN in Philadelphia Kirktown Chat Brawl #9 $50 8:30PM EST 2025 RSL Offline Finals Dates + Ticket Sales! Crank Gathers Season 2: SC II Pro Teams
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 497 Battle Haredened Mutation # 496 Endless Infection Mutation # 495 Rest In Peace Mutation # 494 Unstable Environment
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ Ladder Map Matchup Stats Map pack for 3v3/4v4/FFA games BW General Discussion SnOw's ASL S20 Finals Review
Tourneys
[ASL20] Grand Finals BSL21 Open Qualifiers Week & CONFIRM PARTICIPATION Small VOD Thread 2.0 The Casual Games of the Week Thread
Strategy
How to stay on top of macro? PvZ map balance Current Meta Soma's 9 hatch build from ASL Game 2
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Path of Exile The Perfect Game Beyond All Reason
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
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
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Canadian Politics Mega-thread The Big Programming Thread
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
Anime Discussion Thread Movie Discussion! [Manga] One Piece Korean Music Discussion Series you have seen recently...
Sports
TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion MLB/Baseball 2023 2024 - 2026 Football Thread NBA General Discussion
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
more word salad -- pay no h…
Peanutsc
Career Paths and Skills for …
TrAiDoS
Reality "theory" prov…
perfectspheres
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1822 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 States24725 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
BSL 21
19:00
Open Quali #3
LiquipediaDiscussion
SC4ALL
14:00
SC4ALL - Day 1
Artosis745
RotterdaM628
ComeBackTV 601
IndyStarCraft 242
SteadfastSC152
CranKy Ducklings137
LiquipediaDiscussion
Epic.LAN
12:00
Epic.LAN 46 Playoffs Stage
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Artosis 745
RotterdaM 628
IndyStarCraft 242
SteadfastSC 152
ProTech93
CosmosSc2 75
StarCraft: Brood War
ZZZero.O 131
NaDa 26
Terrorterran 17
Dota 2
LuMiX1
Counter-Strike
Stewie2K1637
Heroes of the Storm
Liquid`Hasu389
Khaldor205
Other Games
FrodaN4077
Grubby3557
Beastyqt961
ToD250
Pyrionflax236
KnowMe225
Skadoodle83
Mew2King43
nookyyy 38
Dewaltoss17
Organizations
Other Games
gamesdonequick1823
StarCraft 2
angryscii 34
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 23 non-featured ]
StarCraft 2
• Hupsaiya 23
• HeavenSC 16
• musti20045 6
• intothetv
• LaughNgamezSOOP
• sooper7s
• IndyKCrew
• AfreecaTV YouTube
• Migwel
• Kozan
StarCraft: Brood War
• Azhi_Dahaki40
• FirePhoenix6
• ZZZeroYoutube
• BSLYoutube
• STPLYoutube
Dota 2
• masondota2991
• Ler53
League of Legends
• Doublelift3761
• HappyZerGling70
Other Games
• imaqtpie1148
• Scarra692
• WagamamaTV365
• Shiphtur164
Upcoming Events
BSL Team A[vengers]
16h
Cross vs Sobenz
Sziky vs IcaruS
SC4ALL
17h
SC4ALL
17h
BSL 21
21h
Replay Cast
1d 11h
Wardi Open
1d 14h
Monday Night Weeklies
1d 19h
Replay Cast
2 days
Sparkling Tuna Cup
2 days
WardiTV Korean Royale
2 days
[ Show More ]
Replay Cast
3 days
WardiTV Korean Royale
3 days
The PondCast
4 days
Korean StarCraft League
6 days
CranKy Ducklings
6 days
IPSL
6 days
dxtr13 vs OldBoy
Napoleon vs Doodle
Liquipedia Results

Completed

CSL 2025 AUTUMN (S18)
CranK Gathers Season 2: SC II Pro Teams
Eternal Conflict S1

Ongoing

BSL 21 Points
BSL 21 Team A
C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
SC4ALL: Brood War
SC4ALL: StarCraft II
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025

Upcoming

YSL S2
BSL Season 21
SLON Tour Season 2
BSL 21 Non-Korean Championship
HSC XXVIII
RSL Offline Finals
WardiTV 2025
RSL Revival: Season 3
Stellar Fest
META Madness #9
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 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.