• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 00:51
CEST 06:51
KST 13:51
  • 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
[ASL19] Finals Recap: Standing Tall9HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
Flash Announces Hiatus From ASL50Weekly Cups (June 23-29): Reynor in world title form?12FEL Cracov 2025 (July 27) - $8000 live event16Esports World Cup 2025 - Final Player Roster16Weekly Cups (June 16-22): Clem strikes back1
StarCraft 2
General
The GOAT ranking of GOAT rankings The SCII GOAT: A statistical Evaluation Statistics for vetoed/disliked maps Esports World Cup 2025 - Final Player Roster How does the number of casters affect your enjoyment of esports?
Tourneys
RSL: Revival, a new crowdfunded tournament series [GSL 2025] Code S: Season 2 - Semi Finals & Finals $5,100+ SEL Season 2 Championship (SC: Evo) FEL Cracov 2025 (July 27) - $8000 live event HomeStory Cup 27 (June 27-29)
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma Mutation # 477 Slow and Steady
Brood War
General
Player “Jedi” cheat on CSL Help: rep cant save Flash Announces Hiatus From ASL BGH Auto Balance -> http://bghmmr.eu/ [ASL19] Finals Recap: Standing Tall
Tourneys
[Megathread] Daily Proleagues Small VOD Thread 2.0 [BSL20] GosuLeague RO16 - Tue & Wed 20:00+CET The Casual Games of the Week Thread
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Stormgate/Frost Giant Megathread Nintendo Switch Thread Path of Exile What do you want from future RTS games? Beyond All Reason
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 Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Trading/Investing Thread The Games Industry And ATVI
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
2024 - 2025 Football Thread NBA General Discussion Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
Blogs
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
Blog #2
tankgirl
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 626 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 States24666 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 States9103 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 States9103 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 5h 9m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Nina 254
NeuroSwarm 252
ProTech53
StarCraft: Brood War
Noble 62
Zeus 58
Aegong 57
Icarus 10
Dota 2
monkeys_forever448
League of Legends
JimRising 847
Other Games
summit1g8318
shahzam1294
Organizations
Other Games
BasetradeTV72
StarCraft: Brood War
UltimateBattle 6
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 17 non-featured ]
StarCraft 2
• Berry_CruncH105
• practicex 39
• Sammyuel 24
• Kozan
• AfreecaTV YouTube
• sooper7s
• intothetv
• IndyKCrew
• LaughNgamezSOOP
• Migwel
StarCraft: Brood War
• Diggity32
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
League of Legends
• Lourlo1313
• Rush756
• Stunt458
Upcoming Events
RSL Revival
5h 9m
herO vs SHIN
Reynor vs Cure
OSC
8h 9m
WardiTV European League
11h 9m
Scarlett vs Percival
Jumy vs ArT
YoungYakov vs Shameless
uThermal vs Fjant
Nicoract vs goblin
Harstem vs Gerald
FEL
11h 9m
Big Brain Bouts
11h 9m
Korean StarCraft League
22h 9m
CranKy Ducklings
1d 5h
RSL Revival
1d 5h
FEL
1d 11h
RSL Revival
2 days
[ Show More ]
FEL
2 days
BSL: ProLeague
2 days
Dewalt vs Bonyth
Replay Cast
3 days
Sparkling Tuna Cup
4 days
The PondCast
5 days
Replay Cast
5 days
RSL Revival
6 days
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2025-06-28
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL 2v2 Season 3
BSL Season 20
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025

Upcoming

2025 ACS Season 2: Qualifier
CSLPRO Last Chance 2025
2025 ACS Season 2
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
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.