• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 12:08
CET 18:08
KST 02:08
  • 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
SC2 All-Star Invitational: Jan 17-181Weekly Cups (Dec 22-28): Classic & MaxPax win, Percival surprises0Weekly Cups (Dec 15-21): Classic wins big, MaxPax & Clem take weeklies3ComeBackTV's documentary on Byun's Career !11Weekly Cups (Dec 8-14): MaxPax, Clem, Cure win4
StarCraft 2
General
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 ComeBackTV's documentary on Byun's Career ! Team TLMC #5: Winners Announced!
Tourneys
OSC Season 13 World Championship $5,000+ WardiTV 2025 Championship $100 Prize Pool - Winter Warp Gate Masters Showdow Sparkling Tuna Cup - Weekly Open Tournament Winter Warp Gate Amateur Showdown #1
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 506 Warp Zone Mutation # 505 Rise From Ashes Mutation # 504 Retribution Mutation # 503 Fowl Play
Brood War
General
What are former legends up to these days? BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion How soO Began His ProGaming Dreams Klaucher discontinued / in-game color settings
Tourneys
[Megathread] Daily Proleagues [BSL21] LB SemiFinals - Saturday 21:00 CET [BSL21] WB & LB Finals - Sunday 21:00 CET Small VOD Thread 2.0
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers Game Theory for Starcraft Current Meta
Other Games
General Games
Nintendo Switch Thread Mechabellum Stormgate/Frost Giant Megathread Beyond All Reason Path of Exile
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
Mafia Game Mode Feedback/Ideas Survivor II: The Amazon Sengoku Mafia TL Mafia Community Thread
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread Has Anyone Tried Kamagra Chewable for ED? 12 Days of Starcraft The Games Industry And ATVI
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 Where to ask questions and add stream?
Blogs
National Diversity: A Challe…
TrAiDoS
I decided to write a webnov…
DjKniteX
James Bond movies ranking - pa…
Topin
Saturation point
Uldridge
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1873 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
Next event in 22m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Lowko502
Harstem 381
RotterdaM 313
Livibee 137
UpATreeSC 59
trigger 49
RushiSC 29
DivinesiaTV 20
StarCraft: Brood War
Jaedong 2235
Stork 843
Larva 710
Mini 598
Soma 492
ZerO 372
Snow 272
Rush 199
Aegong 183
Sharp 164
[ Show more ]
Shuttle 146
sorry 112
BeSt 110
Hyun 79
EffOrt 51
910 35
Terrorterran 27
Mind 26
ToSsGirL 24
Sexy 22
JYJ 22
soO 17
Movie 14
Shine 6
Dota 2
qojqva3315
syndereN515
420jenkins381
BananaSlamJamma43
League of Legends
C9.Mang093
Counter-Strike
allub233
edward209
Heroes of the Storm
Khaldor201
Other Games
Grubby4975
singsing2118
hiko962
FrodaN677
Mlord569
B2W.Neo354
Fuzer 329
Hui .216
Liquid`VortiX164
ArmadaUGS140
QueenE122
Mew2King84
BRAT_OK 65
Trikslyr38
ZerO(Twitch)19
MindelVK12
Organizations
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• StrangeGG 52
• naamasc238
• poizon28 36
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV646
• lizZardDota265
Other Games
• imaqtpie194
Upcoming Events
RotterdaM Event
22m
OSC
18h 52m
Solar vs MaxPax
ByuN vs Krystianer
Spirit vs TBD
OSC
3 days
Korean StarCraft League
4 days
OSC
4 days
OSC
5 days
OSC
5 days
uThermal 2v2 Circuit
5 days
Replay Cast
6 days
Liquipedia Results

Completed

CSL Season 19: Qualifier 2
WardiTV 2025
META Madness #9

Ongoing

C-Race Season 1
IPSL Winter 2025-26
BSL Season 21
eXTREMESLAND 2025
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025

Upcoming

CSL 2025 WINTER (S19)
Escore Tournament S1: W2
Escore Tournament S1: W3
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Thunderfire SC2 All-star 2025
Big Gabe Cup #3
OSC Championship Season 13
Nations Cup 2026
Underdog Cup #3
NA Kuram Kup
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 © 2025 TLnet. All Rights Reserved.