LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-25-2017, 12:28 PM   #31
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242

Quote:
Originally Posted by rtmistler View Post
@BW-userx I feel that you are spot on with a key core concept, which is to understand the logic behind what to do within your program, as opposed to worrying about how to write it as well as the choice of language.

I fully understand the concept of experimenting with code. You are asking the correct questions, for instance when you identify a questionable warning or error in compilation, it is a good idea to determine what the cause of it is. And per your original question, you were attempting to properly understand how passing arguments and pointers work within the language.
thanks.
I just figured C would be the easier then C++
though one might be able to use objects. I never put that to thought because I do not see any need to use an object in this project. Like I just told the other under your post before I got to it. I might even be able to use BASH Script to do this.

it is the logic that needs to be gotten in how to make it do it that needs to be accomplished. that too can be done side by side in learning the language one is using to do it.

but if I just jump into it like that. Then the order gets mixed up. because of the line of thought while trying to figure it out as I go is now almost random.

doing one thing then the thought oh I need to do this too, oops I should have done that first. now I got rethink everything then comes into play and I already have everything written out now I got a make changes. effect takes place.

it has to have order to it.

Last edited by BW-userx; 04-25-2017 at 12:33 PM.
 
Old 04-25-2017, 12:30 PM   #32
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
All I seem to be able to find are the "Yahtzee" dice games. Are you sure about the spelling?
 
Old 04-25-2017, 12:35 PM   #33
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
Quote:
Originally Posted by BW-userx View Post
thanks.
I just figured C would be the easier then C++
Actually, C++ can be easier than C, but it also is much more powerful and you can really screw up with it unless you really are good at object-oriented design.

Objective-C is simpler (i.e. no multiple inheritance, no friends, no operator overloading, no templates, etc.) but is mostly used just on Apple products, but the basic language is available for most platforms.

Last edited by Laserbeak; 04-25-2017 at 12:41 PM.
 
Old 04-25-2017, 12:44 PM   #34
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Laserbeak View Post
I'm not familiar with this game, maybe I'll try to download it to my iPhone, is it free?

Anyway, maybe someday you'll want to start programming your iPhone. It's pretty fun and if you get a good idea for an app you can make lots of money!
you never played yachee before?
What country are you from? is it banned there?

yes its free- the name is yachee deluxe by Rubicon that one as there is a bucket load of them. Just type in yachee and look for it.

99 cents a pop that does not even get you penny candy any more.
along with everything has already been done before. it is hard to get an original now days. it is all recaps of what was already done.

Last edited by BW-userx; 04-25-2017 at 12:45 PM.
 
Old 04-25-2017, 12:53 PM   #35
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Laserbeak View Post
Actually, C++ can be easier than C, but it also is much more powerful and you can really screw up with it unless you really are good at object-oriented design.

Objective-C is simpler (i.e. no multiple inheritance, no friends, no operator overloading, no templates, etc.) but is mostly used just on Apple products, but the basic language is available for most platforms.
yeah over loading -- yeah over loading functions! I took C++ then when I was done they changed the standardization. Like two days after the classes where over.

I looked at it, and to me one now has to write more to get the same thing done, cout << is now std::cout << I never put time into it to relearn it. then fell away from programming. no real big loss.

I just find it fun to do and only use it when I need to. With Linux I find that a Bash script suffices.

I just thought I'd use C because that is a subset of C++ and it is basically the same without having to learn off of that syntax of C++ NAMESPACE declarations and what not's they now have within C++ or it will not work? I donno I left it behind.


between teaching ones self and going to a College and having someone show you, and guild you is a lot difference. and this is just for a self knowledge not really that big of a deal in the realm of things I am doing.

I'm not looking to get a job doing this.

Last edited by BW-userx; 04-25-2017 at 12:58 PM.
 
Old 04-25-2017, 01:24 PM   #36
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Laserbeak View Post
All I seem to be able to find are the "Yahtzee" dice games. Are you sure about the spelling?
yes that is the game I am talking about, it uses logic and reasoning some how. my other post on this to you tells you exactly what and who made it so you get the right one. you got to observe its behavior for a while. then perhaps you'll see what I am talking about.
 
Old 04-25-2017, 01:24 PM   #37
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
Quote:
Originally Posted by BW-userx View Post
you never played yachee before?
What country are you from? is it banned there?

yes its free- the name is yachee deluxe by Rubicon that one as there is a bucket load of them. Just type in yachee and look for it.

99 cents a pop that does not even get you penny candy any more.
along with everything has already been done before. it is hard to get an original now days. it is all recaps of what was already done.
I live in New York City in the good old USA! I must be doing something wrong:

http://imagizer.imageshack.us/v2/xq90/923/EWn8f6.png
 
Old 04-25-2017, 01:34 PM   #38
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
Ok, I think I got it, but what does that have to do with programming?
 
Old 04-25-2017, 01:48 PM   #39
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
Well now I'm totally confused...

But I am working on a blackjack program for the iPhone and right now it's just in text mode. I had another one and got pretty far, but I lost it due to a hard drive crash.

I was doing the logic and data processing, etc. at the same time. This time, I'm waiting to do the GUI stuff until I have it working on the command line as an alternate ViewController. Then I'll work on the GUI interface.

You just have to follow the rules of the game. In blackjack, there are several strategies, right now I only have the dealer strategy (which is easy) done.

Last edited by Laserbeak; 04-25-2017 at 01:53 PM.
 
Old 04-25-2017, 02:24 PM   #40
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Laserbeak View Post
I live in New York City in the good old USA! I must be doing something wrong:

http://imagizer.imageshack.us/v2/xq90/923/EWn8f6.png
ha New Yorkers. too many lights maybe? lol
us here too, I looked on my phone typed in yachee and went down the list until I found it, try using the name of the programmer or that makers name by who ever it was for a search word

Last edited by BW-userx; 04-25-2017 at 02:25 PM.
 
Old 04-25-2017, 02:27 PM   #41
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Laserbeak View Post
Ok, I think I got it, but what does that have to do with programming?
what does what have to do with programming? yachee?

it is already a programmed game soooooo how they get that cpu to pick and know when to change its "mind" and get rid of what it already has to select something completely different?
 
Old 04-25-2017, 02:33 PM   #42
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Laserbeak View Post
Well now I'm totally confused...

But I am working on a blackjack program for the iPhone and right now it's just in text mode. I had another one and got pretty far, but I lost it due to a hard drive crash.

I was doing the logic and data processing, etc. at the same time. This time, I'm waiting to do the GUI stuff until I have it working on the command line as an alternate ViewController. Then I'll work on the GUI interface.

You just have to follow the rules of the game. In blackjack, there are several strategies, right now I only have the dealer strategy (which is easy) done.
yeah but I am working with a dry board. my brain

I have not put to thought the strategies yet. nor looked them up even. Just starting the how to get input then go to next step keeping it in a loop so the game keeps running -

roll
pick numbers
store numbers
roll again
pick numbers
store numbers
ask question here and there within it as well
ect
then display everything in a nice fashion.
It is not so much to get it to decide what to pick But when to change its mind when it has a good "hand"

Yachee has more to calculate then five cards. just saying.


with GUI what are you using?

that too may require being an artist if you got a draw the pictures to be used. then put them in an array maybe.

blackjack is 21 so yeah that is an easy strategie, if 17 and above and not over 21 hold. else hit. else bust.

Code:
if ( num >= 17 )
hold
else
hit

if ( num > 21 )
bust

if ( num == 21 )
win

Last edited by BW-userx; 04-25-2017 at 02:37 PM.
 
Old 04-25-2017, 02:40 PM   #43
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
Quote:
Originally Posted by BW-userx View Post
with GUI what are you using?

that too may require being an artist if you got a draw the pictures to be used. then put them in an array maybe.

blackjack is 21 so yeah that is an easy strategie, if 17 and above if not over 21 hold. else hit.
I'll be using the built-in Cocoa GUI for the iPhone. Maybe the slightly different one for an OS X version.

That's the dealer strategy, but player strategies are more complex. They depend on what the dealer has up (if they have a weak card up like 5 or 6, you might want to stand on 14 for example hoping the dealer will bust). Plus the player can do things the dealer can't like double-down and split. And it gets even more complex if you count cards.
 
Old 04-25-2017, 02:51 PM   #44
Laserbeak
Member
 
Registered: Jan 2017
Location: Manhattan, NYC NY
Distribution: Mac OS X, iOS, Solaris
Posts: 508

Rep: Reputation: 143Reputation: 143
Quote:
Originally Posted by BW-userx View Post
Code:
if ( num >= 17 )
hold
else
hit

if ( num > 21 )
bust

if ( num == 21 )
win
It's a bit more difficult than that! What about Aces that can be 1 or 11? Plus you don't just win if you get 21, you have a value that the dealer compares with each player and can lose, win, or push. You can also get a natural blackjack (A and 10 or face card) then the dealer wins except against players that also have a natural blackjack, then they push.

Oh there are public domain card images available.

Last edited by Laserbeak; 04-25-2017 at 02:55 PM.
 
Old 04-25-2017, 03:48 PM   #45
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Original Poster
Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
Quote:
Originally Posted by Laserbeak View Post
It's a bit more difficult than that! What about Aces that can be 1 or 11? Plus you don't just win if you get 21, you have a value that the dealer compares with each player and can lose, win, or push. You can also get a natural blackjack (A and 10 or face card) then the dealer wins except against players that also have a natural blackjack, then they push.

Oh there are public domain card images available.
well I am not going to do all of it .. lol -- that was just a taste of the logic minus the dealers hand comparison and everything else.

besides I got a figure mine out - you are already working on yours. lmao.

yeah and as far as the pictures of cards -- yeah what you said.


may be JUST maybe I'll switch and do 21 in Lazarus free pascal. I got a little more experience in that. and it is GUI then we can compare just cuz ..

oh and NO And it gets even more complex if you count cards.

that is like do not get caught in a casino doing that.

Last edited by BW-userx; 04-25-2017 at 03:55 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] argc and argv confusion atlantis43 Programming 4 09-28-2013 10:42 AM
C programming linux copying argv to wchar_t argv babbab Programming 1 08-09-2012 05:32 AM
[SOLVED] why char *argv[] declaration is ok in main arg, but not in body? hppyhjh Programming 5 09-13-2010 08:36 PM
main(int argc, char **argv) Longinus Programming 4 06-12-2004 07:22 AM
argc argv linuxanswer Programming 8 10-25-2003 07:54 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:53 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration