i think my picture will make people run for the hills ;)
and i dropped the green, in accordance to the rules .. i want to play nice :)
i think my picture will make people run for the hills ;)
and i dropped the green, in accordance to the rules .. i want to play nice :)
I got this code (written when sleepy, sorry for lack of "expertness")
#include <stdio.h>
#include<time.h>
int card1; int card2; int card3;
int total;
int other;
srand(time(NULL));
card1=(rand()%22)+1;
card2=(rand()%22)+1;
other=(rand()%22)+1;
total=card1+card2;
int main()
{
printf("Hey, welcome to HBK's Twist or bust game. Lets begin\n");
printf("Your cards are: %d and %d\n", card1, card2);
printf("total is: %d\n", total);
if(total<21)
{ turn(); }
else if (total>21);
{ printf("BUST! play again?\n"); }
return 0;
}
#include<stdio.h>
void turn();
void turn()
{ char ans;
printf("Twist or bust (t/b)\n");
ans = getchar();
switch(ans)
{ case 't' : draw(); break;
case 'b' : neg(); break;
}
}
#include <stdio.h>
void neg();
void neg()
{
if(total > other)
{ printf("you won! play again?\n"); }
else if (other > total)
{printf("damn nice try. play again?\n"); }
}
#include<stdio.h>
void draw();
void draw()
{
srand(time(NULL));
card3=(rand()%22)+1;
total+=card3;
}
it's a card game (twist or bust). so two random numbers are drawn, if they're over 21, you lose, under and you can take another card. if the three cards are over 21 you lose, if not anohter card.. so the total is always changing, how can i pass the value of "total" between the functions? i know there's a way in java placing the variable name in the () of the method, (well i think. it didn't work but i'm new at all of this). any pointers would be appriciated, but like i said, sleepy when i wrote it :confused:
fair point.. you know what i mean ;)
tech phone calls are genius
ok i got:
int main()
{ char name[50];
char mood;
printf("hey there, .. whats your name?\n");
gets(name);
printf("%s is it? Well how are you today?\n a.Good\n b.Ok\n c.Bad\n", name);
mood = getchar(); while (getchar() != '\n');
switch(mood)
{
case 'a' : getnum(); break;
case 'c' : bad(); break;
case 'b' : printf("aw, cool \n"); break;
default : printf("please choose good bad or ok in lower case 'cause i'm lazy\n");
}
return 0;
}
and
void bad()
{ char text, neg;
char pos[500];
fputs("oh no, want to tell me about it? Y or N?\n", stdout);
text =getchar(); while (getchar() != '\n');
switch(text)
{case 'Y' : fputs("go ahead..\n", stdout); fgets(pos, 500, stdin); break;
case 'N' : printf("ok well feel like a sum?\n"); neg =getchar(); while (getchar() != '\n'); break;
default : printf("please enter Y or N\n");}
}
and it worked! waho, thanks for the help :)
I'm sorry, but don't you see anything wrong with this line?
Told ya i didn't know anything of java.. and i have no idea how it changed then *shruggs* but thanks anyway.
and oi wee i heard that ;)
that screwed it up completly. now the first menu doesn't even work.
printf("%s is it? Well how are you today?\n a.Good\n b.Ok\n c.Bad\n", name);
getchar(); while (getchar() != '\n');
switch(mood)
/\ /\ which bit did i screw up? should there be an &mood in the ()?
i used that tutorial before and same problem still..
i'm wrting a basic C program which the user "talks" to the program, you know the sort. well my main menu looks like this:
int main()
{ char name[50];
char mood;
printf("hey there, .. whats your name?\n");
gets(name);
printf("%s is it? Well how are you today?\n a.Good\n b.Ok\n c.Bad\n", name);
scanf("%c", &mood);
switch(mood)
{
case 'a' : getnum(); break;
case 'c' : bad(); break;
case 'b' : printf("aw, cool \n"); break;
default : printf("please choose good bad or ok in lower case 'cause i'm lazy\n");
}
return 0;
}
that works fine, asks the persons name, displays their input, then goes to the menu. the switch on this works and if you chose a. then it goes to the sum function
void getnum()
{
int num;
printf("yay! me too! want to do a sum? enter a number: ");
scanf("%d", &num);
printf("%d squared is %d\n", num, square(num) );
printf("nice chatting to ya!\n");
}
if you chose c. (bad) it goes to the bad file, prints the "reply oh no, want to tell me about it? Y or N?\n". now after that i've tried manya differnet techniques to scan the input (as it did for the previous questions), from scanf then a switch. to fgets and using a if.. else statement.. but it always cuts out and finishes, completly ignores the next part of the coding.
a different program i wrote (using coding out of a book) using switch statements had the same problem, just stops after the first …
ok, thanks. sorry for the dead link, didn't realise. specially as i was using it about 2 hours ago
http://www.daniweb.com/techtalkforums/showthread.php?t=68640&highlight=card+game
odd 'cause it works when i copy and paste. but anywho, told ya i didn't know what i was doing :)
where would you advise starting for making a card game? i know C, HTML, XML, (the realitvly easy ones, and am reading up on using Visual Basic Express 05). but want to branch out anyway, so what language would be suitable for that sort of thing?
am i the only one that can see the green clear here anyway? it's almost the same as the black..
and fair point with the arabic *evil stare* ;)
where do i look for it? i got the three files that are in the thread i linked to.. if i take that line out there's way more errors
ok, i don't know anything of java and somehow managed to DL NetBeans the sun program that creates Java apps... apprently.. (wasn't what i intended to DL but hey :mrgreen: )
A friend wants a card game made, so i searched these forums and found http://www.daniweb.com/techtalkforums/showthread.php?t=68640&highlight=card+game
i took the coding and edits from there and put it into NetBeans and kep coming back with the following errors:
Compiling 3 source files to C:\Documents and Settings\kim\card\build\classes
C:\Documents and Settings\kim\card\src\card\driver.java:24: 'class' or 'interface' expected
package class card;
C:\Documents and Settings\kim\card\src\card\driver.java:24: '{' expected
package class card;
C:\Documents and Settings\kim\card\src\card\driver.java:79: '}' expected
3 errors
at first there were about 20 errors these are the line it says is wrong:
package class card;
I added a { } where it says to, so what does "class" or "interface" expected mean? i see a class...
and if anyone has any other ideas for how to create a card game, in another language or better software i'm all ears :cheesy:
pretty sweet8, even if my IE blocked the WMP active x to start with ;)
but... it's a tradition :( ... if there was a black background you'd see it sweet8.. it's just a way when i re-enter a thread i can see where i posted
i was 17 recently. its much the same as 16
aye, except you can DRIVE! and when you're 16... you're still at school... 17 is like on ya own mate! :cheesy:
i'm 16 ... 17 soon. can't wait... 17 sounds so much older than 16..
(Many) Girls are smart. I mean, I believe statistics show that boys\men are pushed more than females to focus on Math and the sciences (hence, mostly men in IT\Programming) but I know female scientists. programmers, engineers, etc. They are incredibly intelligent. My girlfriend is higly intelligent and I love this about her! I learn so much from her. She does not "paint her nails" or wear make-up (I detest make-up on women :evil: )She is also a big nerd which is lovely. :cheesy:
-- By the way, I am a male. ;):lol:
Matty
marry me
hehe, good stuffs. hows about some smartass?
BEST SMART ASS ANSWERS OF 2006
SMART ASS ANSWER #6
It was mealtime during a flight on Hooters Airline.
"Would you like dinner?" the flight attendant asked John, seated in front.
"What are my choices?" John asked.
"Yes or no," she replied.
SMART ASS ANSWER #5
A flight attendant was stationed at the departure gate to check tickets.
As a man approached, she extended her hand for the ticket and he opened his trench coat and flashed her. Without missing a beat, she said, "Sir, I need to see your ticket not your stub."
SMART ASS ANSWER #4
A lady was picking through the frozen turkeys at the grocery store but she couldn't find one big enough for her family.
She asked a stock boy, "Do these turkeys get any bigger?"
The stock boy replied, "No ma'am, they're dead."
SMART ASS ANSWER #3
The cop got out of his car and the kid who was stopped for speeding rolled down his window.
"I've been waiting for you all day," the cop said.
The kid replied, "Yeah, well I got here as fast as I could."
When the cop finally stopped laughing, he sent the kid on his way without a ticket.
SMART ASS ANSWER #2
A truck driver was driving along on the freeway. A sign comes up that
reads, …
hash all the way baby...
anyway...
my favourite keyboard? the one thats attached to my laptop. my old top had the shfit shape enter key, taken months to get used to the big enter again.
mouse? PCLine WN01 - a tiny little laptop mouse, with blue scroll wheel and laser not ball. it fits perfectly in my little hands. :)
page loading isnt a problem for me, takes normal time and i'm running on wireless internet and a 1.6ghz processor... all be it dual core :)
i have zee myspace www.myspace.com/roomforthedead
why? because my brother told me to. then because a friend (Ape) posts his blogs which were (and sometimes still are) pretty good. haven't edited it for about ... months... hate people who have music that starts straight off.. I HAVE MY OWN MUSIC PLAYING THANK YOU VERY MUCH! some pages are way over gimmiked.
only met one wierd person, and he wasn't too bad.
a couple ol' school friends found me through there too.. so it does have some use.. speaking of which, i'm going to go log in :)
also, i know everyone on my list from either "real life" or outside internet sources, aside from the bands. but I DL their music so it's only fair i'm their friend :D
haha brilliant.
i start driving in 2 months
So i signed up here a while ago, looking for some work to help me with mine (College - BTEC National IT). I'm kim - or hbk as the internet knows me. whats hbk you ask? Heart Break Kid, Shawn Micheals. Yup, check my profile. I likes that rassin' :cheesy: don't be afraid though, i'm cool. A slight hyper oddball but cool nonetheless :mrgreen:
currently listening to: Nickleback - Someone that you're with (WMP is full of Linkin Park, Limp Bizkit, Nickleback, Panic! at the disco! Saliva etc)
currently surrounded by: A psychology revision book, a c-programming book, a visual basic book, a couple wrestling autobiographies, a mug i won at a pancake flippin' contest at work (Good ol' Tesco), an UnderTaker teddy bear (see me and him here: http://i3.photobucket.com/albums/y69/hbk619/me/teddy.jpg ) and an IT revision book.
machine i'm using: http://i3.photobucket.com/albums/y69/hbk619/me/acerlaptop.jpg that site jacknife500.proboards57.com - Wolfies Den is my second home :cool:
i'm sure you're all backing away slowly now, but this is what happens when you give me free speech :twisted: , also i post in green. would be gren (lime green) but the background is pretty light on here and i want people to be able to read me!
I also like playing with PaintShopPro.. when i have a spare minute...
laptops... beautiful when they work... piles of useless carp when they don't!!! ;)
(yes there's a huge long story behind laptops and me)
Troy's post gets a tumbs up *raises thumb* :)
i started with html, because my brother was doing it in college, then xml. Which bother give a nice simple intro into how prgramming languages work (which you already have with the c/c++ knowledge). then c-programming.
now onto using Visual Basic software. heading for Javascript (which i have some understanding of), Java and it seems by what i've seen here.. php :)
i hate php, from the little experience with php message boards i have had anyway :)
other languages to know:
xhtml
javascript
sofware:
dreamweaver
photoshop
flash
as for databases.. SQL.. visual Basic.. that sort of thing?
serunson is right. It is a pretty much a doss. i barely do any work at home and am coming out with disctinctions
I'm doing BTEC National Diploma in ICT (three a levels) at the moment.. guess what software we've used? Word, Excel, and are about to use.. you guessed it Access!
We have done a web developing unit, involving frontpage and very briefly Macromedia Flash. And are also learning binary. but there is alot of stuff which seems to be repeated from GCSE (which i did vocational in, aka double).
Don't get your hopes up for the a level. A degree would definitly be more detailed, shame there's two years before that
http://www.javascriptkit.com/script/script2/soundlink.shtml
don't forget to do a onmouseout=stop or it'll carry on going
all depends on the software being used to block it. My college uses Novell Board manager.
googling the site, then hitting the cache will give the most -basic- view of the site (and sometimes noting at all, but what do you expect? college's have been dealing with students trying to get round filters since IT started)