You are not logged in.

Announcement

  • Index
  •  » Games
  •  » Raspberries VS Strawberries - Part 218

#201 2014-09-07 12:37:43

angelfire
Members
From: The world I created in my head
Registered: 2010-08-12
Posts: 21425
Website

Re: Raspberries VS Strawberries - Part 218

121
Saw you're post on the RP, Darky, what happened?


http://i.imgur.com/TYm0f7i.png
Twitter|Tumblr|Howrse|MCL|dA: angelfire2197          Wysp|YouTube|Elitedollz: angelfire
Art Portfolio: livininart.tumblr                                   Tumblr: askmyocsstuff
 

#202 2014-09-07 15:02:03

darkelfqueen
The Mod Squad
From: Where everything else meets
Registered: 2012-03-21
Posts: 51772

Re: Raspberries VS Strawberries - Part 218

22 Don't worry little sis. It was nothing major. A bit exhausting buuut...nothing painful or anything, lol. I don't even know why I was dragged into it.

Quoting from the RP page:

((Don't worry :) A fight erupted between friends and all of a sudden I got dragged into it. It's not thing major really and in my opinion it was very silly. I don't even remember what they were fighting about, LOL. Anyways, it lasted longer than I would have preferred and I was kinda exhausted afterwards. Silly, right?))

 

#203 2014-09-07 16:01:07

angelfire
Members
From: The world I created in my head
Registered: 2010-08-12
Posts: 21425
Website

Re: Raspberries VS Strawberries - Part 218

23
Okay cool ;)
I know how those things work ^^


http://i.imgur.com/TYm0f7i.png
Twitter|Tumblr|Howrse|MCL|dA: angelfire2197          Wysp|YouTube|Elitedollz: angelfire
Art Portfolio: livininart.tumblr                                   Tumblr: askmyocsstuff
 

#204 2014-09-07 16:22:19

xemoxrockerx
Members
From: Land of Storms and Sunshine
Registered: 2010-05-15
Posts: 4092
Website

Re: Raspberries VS Strawberries - Part 218

22

ahh, I was worried for a bit Darky :< But it's good that nothing major happened. It's hard if ur friends fight D:


http://4.bp.blogspot.com/-DUQ5qc0D02A/VFrBeTyyrxI/AAAAAAAACG8/_w5ujDpgwR4/s1600/Emorocker1-sig-01.png
|Older Art. Updated: 10/17/14| Instagram : p2ionics |
| Twitter : psionic_nerd | Tumblr Writing Blog : under-latest-nostalgia |
Thanks for the ava/sig shadowchild03!
 

#205 2014-09-07 17:01:37

darkelfqueen
The Mod Squad
From: Where everything else meets
Registered: 2012-03-21
Posts: 51772

Re: Raspberries VS Strawberries - Part 218

23 Yeeeah but all is well now. And it was silly silly silly :P

 

#206 2014-09-07 19:39:19

angelfire
Members
From: The world I created in my head
Registered: 2010-08-12
Posts: 21425
Website

Re: Raspberries VS Strawberries - Part 218

24
So...My teeth are dying.
I got actual braces yesterday and the expanders got off. This I guess is so so much better than expanders though.


http://i.imgur.com/TYm0f7i.png
Twitter|Tumblr|Howrse|MCL|dA: angelfire2197          Wysp|YouTube|Elitedollz: angelfire
Art Portfolio: livininart.tumblr                                   Tumblr: askmyocsstuff
 

#207 2014-09-07 21:34:08

rukia131
Members
From: Some Pokeball
Registered: 2010-11-30
Posts: 15659

Re: Raspberries VS Strawberries - Part 218

25
Finally home after 2 months. The internet is magic here.

 

#208 2014-09-07 23:32:33

darkelfqueen
The Mod Squad
From: Where everything else meets
Registered: 2012-03-21
Posts: 51772

Re: Raspberries VS Strawberries - Part 218

26 wow!!! Congrats!

 

#209 2014-09-07 23:43:43

angelfire
Members
From: The world I created in my head
Registered: 2010-08-12
Posts: 21425
Website

Re: Raspberries VS Strawberries - Part 218

27
Welcome back to good internet ^^ Were you at the camp this whole time though?


http://i.imgur.com/TYm0f7i.png
Twitter|Tumblr|Howrse|MCL|dA: angelfire2197          Wysp|YouTube|Elitedollz: angelfire
Art Portfolio: livininart.tumblr                                   Tumblr: askmyocsstuff
 

#210 2014-09-09 02:33:53

darkelfqueen
The Mod Squad
From: Where everything else meets
Registered: 2012-03-21
Posts: 51772

Re: Raspberries VS Strawberries - Part 218

28 God this place is so deserted...i so missed Bloodsy, Malu and Amary :( :(

Girls, I don't know if you check the boards, but if you do, good luck with the new school year and we missed you!!!

 

#211 2014-09-09 02:55:01

angelfire
Members
From: The world I created in my head
Registered: 2010-08-12
Posts: 21425
Website

Re: Raspberries VS Strawberries - Part 218

29

Oh yeah
Damn. I forgot to wish everyone a happy school year. Twin, it's your last year, good luck!!

So darky...what's up?


http://i.imgur.com/TYm0f7i.png
Twitter|Tumblr|Howrse|MCL|dA: angelfire2197          Wysp|YouTube|Elitedollz: angelfire
Art Portfolio: livininart.tumblr                                   Tumblr: askmyocsstuff
 

#212 2014-09-09 12:16:57

xemoxrockerx
Members
From: Land of Storms and Sunshine
Registered: 2010-05-15
Posts: 4092
Website

Re: Raspberries VS Strawberries - Part 218

28

@ruki - home, where your wifi connects automatically :D

and ahhh, yeah, it seems so mellowed out :< hope they can come back some day unu
Good luck with studies and stuff everyone :)


http://4.bp.blogspot.com/-DUQ5qc0D02A/VFrBeTyyrxI/AAAAAAAACG8/_w5ujDpgwR4/s1600/Emorocker1-sig-01.png
|Older Art. Updated: 10/17/14| Instagram : p2ionics |
| Twitter : psionic_nerd | Tumblr Writing Blog : under-latest-nostalgia |
Thanks for the ava/sig shadowchild03!
 

#213 2014-09-09 15:15:43

rukia131
Members
From: Some Pokeball
Registered: 2010-11-30
Posts: 15659

Re: Raspberries VS Strawberries - Part 218

Lol wasn't it 129?

@Angel : nope I've been there only for 2 weeks at the start of August but after that I went straight to my granny's place and that is some kind of mountain area.

School starts next week so I have one more week of laziness. How old are you guys again?

 

#214 2014-09-09 15:15:54

darkelfqueen
The Mod Squad
From: Where everything else meets
Registered: 2012-03-21
Posts: 51772

Re: Raspberries VS Strawberries - Part 218

29 Nothing much Angel. Same as always. All of my classes are online now. I'm taking things pretty slow so I have time for work.


ooh btw. Found out that you can get the tools needed to make an XBox game for free <3 and I'm trying to learn that. It's very very very easy so far. I need to teach myself to make sprites, though :(

 

#215 2014-09-09 15:23:03

xemoxrockerx
Members
From: Land of Storms and Sunshine
Registered: 2010-05-15
Posts: 4092
Website

Re: Raspberries VS Strawberries - Part 218

oh chiz, apparently

128

@ruki: Luuucky D: School re-started (we had term break last week) just yesterday for me. I'm 16 but that's college age in my country so here I am in college :<

@darky: oooh! that's so cool! I'm learning more about Arrays and Dynamic Allocation this term. We have a "textbook" but I'm still slightly confused about things.hypn


http://4.bp.blogspot.com/-DUQ5qc0D02A/VFrBeTyyrxI/AAAAAAAACG8/_w5ujDpgwR4/s1600/Emorocker1-sig-01.png
|Older Art. Updated: 10/17/14| Instagram : p2ionics |
| Twitter : psionic_nerd | Tumblr Writing Blog : under-latest-nostalgia |
Thanks for the ava/sig shadowchild03!
 

#216 2014-09-09 15:33:59

darkelfqueen
The Mod Squad
From: Where everything else meets
Registered: 2012-03-21
Posts: 51772

Re: Raspberries VS Strawberries - Part 218

129 Aaaaah. For a good reason. Arrays can be easily explained if a person put their mind to it. Dynamic allocations are somewhat harder to explain...Need help? I could try to explain those.

 

#217 2014-09-09 15:49:22

xemoxrockerx
Members
From: Land of Storms and Sunshine
Registered: 2010-05-15
Posts: 4092
Website

Re: Raspberries VS Strawberries - Part 218

128

Yes, please @n@ I don't need really complex stuff, just basic stuff. I'm kind of getting it but im not sure so couldya just explain best you can so I know if I understand correctly? intr


http://4.bp.blogspot.com/-DUQ5qc0D02A/VFrBeTyyrxI/AAAAAAAACG8/_w5ujDpgwR4/s1600/Emorocker1-sig-01.png
|Older Art. Updated: 10/17/14| Instagram : p2ionics |
| Twitter : psionic_nerd | Tumblr Writing Blog : under-latest-nostalgia |
Thanks for the ava/sig shadowchild03!
 

#218 2014-09-09 16:01:54

darkelfqueen
The Mod Squad
From: Where everything else meets
Registered: 2012-03-21
Posts: 51772

Re: Raspberries VS Strawberries - Part 218

129 Which language are you using? So I could explain dynamic allocation?

For arrays, basically it's like this. Whenever you need a collection of things of the same type, you create an array for them. The name of the array would be the name you use to refer to the collection.

For now, we'll use an array of integers, okay?

If I have an array called arrayA and it has 5 integers, then to be able to use each individual integer in there, I have to specify which one exactly I want. The way you do it is basically you say I want the first integer. Or I want the second integer. Or so on. That order we specify is referred to as 'index'.


Most languages have those indices starting from 0. So the first element would have index 0.

So, if this is my array.

arrayA = {5,3,7,4,7}

arrayA[0]  would return 5.

With me so far?

 

#219 2014-09-09 16:08:59

xemoxrockerx
Members
From: Land of Storms and Sunshine
Registered: 2010-05-15
Posts: 4092
Website

Re: Raspberries VS Strawberries - Part 218

128

C language! :)

Also, yeah, I get arrays and how they work and stuff; I learned them before in Java so I needed a refresher, but I do have a question about it; what if you want someone's string input to be an array? Like I'm pretty sure there's anly char variable in C so what if you need a string from someone?


http://4.bp.blogspot.com/-DUQ5qc0D02A/VFrBeTyyrxI/AAAAAAAACG8/_w5ujDpgwR4/s1600/Emorocker1-sig-01.png
|Older Art. Updated: 10/17/14| Instagram : p2ionics |
| Twitter : psionic_nerd | Tumblr Writing Blog : under-latest-nostalgia |
Thanks for the ava/sig shadowchild03!
 

#220 2014-09-09 16:18:22

darkelfqueen
The Mod Squad
From: Where everything else meets
Registered: 2012-03-21
Posts: 51772

Re: Raspberries VS Strawberries - Part 218

129 oh ok. Let's see. Let's start with C Strings.

True. There's only char in C. Basically Strings in C are arrays of characters.

So if I want a string for "Cat".
It would be

char catString[4];
catString[0] = 'C';
catString[1] = 'a';
catString[2] = 't';
catString[3] = 0;

Notice how we had to terminate with a 0? That's because C needs to know where the end of the String is. That's very important and many of the bugs result from it. So basically a string is an array of size (number of characters + 1).

To get a string say from the user, you use a function called scanf. For example:

char S1[MAX_STRING_LEN]; // You specify how long the string is allowed to be
scanf("%s",S1);

FYI, scanf returns a -1 if it failed to read. Otherwise it returns the number of characters it read from the user.

To get the length of  string, you use strlen:
int l = strlen(S1);

Is that what you were asking?

 

#221 2014-09-09 16:24:57

xemoxrockerx
Members
From: Land of Storms and Sunshine
Registered: 2010-05-15
Posts: 4092
Website

Re: Raspberries VS Strawberries - Part 218

128

ohhhh, okay so let's say I want the user to input 'stew'
so i have to have

char s1[5];

scanf("%s", s1[5]);

with this, once the program runs and the user inputs "stew" will s1[0] automatically be 's' s1[1] will be 't' and so on and so forth?


http://4.bp.blogspot.com/-DUQ5qc0D02A/VFrBeTyyrxI/AAAAAAAACG8/_w5ujDpgwR4/s1600/Emorocker1-sig-01.png
|Older Art. Updated: 10/17/14| Instagram : p2ionics |
| Twitter : psionic_nerd | Tumblr Writing Blog : under-latest-nostalgia |
Thanks for the ava/sig shadowchild03!
 

#222 2014-09-09 16:31:33

darkelfqueen
The Mod Squad
From: Where everything else meets
Registered: 2012-03-21
Posts: 51772

Re: Raspberries VS Strawberries - Part 218

129 when you're passing it to scanf, you only pass in the name of the array so,
it should be scanf("%s",s1) not scanf("%s",s1[5]).

s1[5] is a character after all.

But yeah, that should be it.

Just remember, it's better to manually set the last character to 0 yourself or you don't know what the memory might have in there for you. believe me you do not want to go into that. So after reading from the user. Change the last character s1[4] to 0.

OH And you'll need to do add this to the top of your code to get that code to run:

#include<stdio.h>
#include<string.h>

Oh and look what I found! Some of the notes I had from when I was studying this:

Program 2: Arrays of Characters

#include<stdio.h>
#include<string.h>

#define MAX_STRING_LEN 80

int main() {
 
  /* strings are array of characters
   * terminated by the NULL character
   * which is different from '0' */
 
  char S[MAX_STRING_LEN];
  int l, i;
 
  S[0] = 'a';
  S[1] = 'b';
  S[2] = 'c';
  S[3] = 'd';
  S[4] = 'e';
  S[5] = 'g';
  S[6] = '0';
  S[7] = 0;

  l = strlen(S);

  printf("S:\t%s\n",S);
  printf("length:\t%d\n",l);
 
  /* print characters in S */
 
  printf("forward\n");
  for (i = 0; i < l; ++i)
    printf("A[%d] = %c\n",i,S[i]);
 
  /* print characters in S backwards */
 
  printf("\nbackward\n");
  for (i = l-1; i >= 0; --i)
    printf("A[%d] = %c\n",i,S[i]);
}

Program 3: String IO

#include<stdio.h>
#include<string.h>

#define MAX_STRING_LEN 80

int main() {
 
  /* strings can be read using scanf with %s
   * string.h contains many useful functions
   * for working with strings:
   *   strcmp for string comparisons
   *   strcpy to copy strings
   *   ...
   *
   * Check what happens if your input contains
   * spaces, tabs, etc
   *
   */

  char S1[MAX_STRING_LEN];
  char S2[MAX_STRING_LEN];
 
  int i, l;

  printf("String:\t");
  scanf("%s",S1);

  /* we need to copy all the characters, and
   * the final NULL character!
   */

  l = strlen(S1);
  /* rather than writing this loop
     we could also write strcpy(S2,S1) */

  for (i = 0; i < l+1; ++i)
    S2[i] = S1[i];


  /* change original S1 */
  S1[0] = S1[1] = S1[2] = '*';
  S1[3] = 0;

  /* print both strings */
  printf("S1:\t%s\n",S1);
  printf("S2:\t%s\n",S2);

}

I think I had gotten that from a website somewhere.


P.S: I need to be offline for like 30 - 45 mins and then gonna come back.

Last edited by darkelfqueen (2014-09-09 16:34:17)

 

#223 2014-09-09 16:42:54

xemoxrockerx
Members
From: Land of Storms and Sunshine
Registered: 2010-05-15
Posts: 4092
Website

Re: Raspberries VS Strawberries - Part 218

128

Ahhh.. right 'course. S[ <a number> ] would be a character and S would be the set of characters aka. the string.

So like if the string has 6 characters, S[0] - S[5] would be taken up by the characters and I should set S[6] to 0?

And yeah, no problem. Thanks for the help! Your notes are rlly helpful too :>


http://4.bp.blogspot.com/-DUQ5qc0D02A/VFrBeTyyrxI/AAAAAAAACG8/_w5ujDpgwR4/s1600/Emorocker1-sig-01.png
|Older Art. Updated: 10/17/14| Instagram : p2ionics |
| Twitter : psionic_nerd | Tumblr Writing Blog : under-latest-nostalgia |
Thanks for the ava/sig shadowchild03!
 

#224 2014-09-09 16:53:33

darkelfqueen
The Mod Squad
From: Where everything else meets
Registered: 2012-03-21
Posts: 51772

Re: Raspberries VS Strawberries - Part 218

129 quick answer before logging off.

Yep. S[6] = 0. Note how I didn't do S[6]= '0'? Because the latter puts the character 0 in the string. The first one is just plain old zero meaning it's the end of the string.

AND I'm BACK!

Last edited by darkelfqueen (2014-09-09 17:25:06)

 

#225 2014-09-10 01:56:49

angelfire
Members
From: The world I created in my head
Registered: 2010-08-12
Posts: 21425
Website

Re: Raspberries VS Strawberries - Part 218

130
Wow o.o Words.
Hey darky, are you continuing with the javascript? I finished the first lesson and have constantly been checking for more :>


http://i.imgur.com/TYm0f7i.png
Twitter|Tumblr|Howrse|MCL|dA: angelfire2197          Wysp|YouTube|Elitedollz: angelfire
Art Portfolio: livininart.tumblr                                   Tumblr: askmyocsstuff
 
  • Index
  •  » Games
  •  » Raspberries VS Strawberries - Part 218
 

Board footer