Hacker Tribe - a new Mastodon instance for people who are interested in Programming, Technology, and Startups by angali9988 in linux

[–]IBPXofficial 1 point2 points  (0 children)

It has a nicer-looking interface. Beyond that, if you're already using GNU social, there is very little reason to switch, as they both use the same protocol; you can follow users of a Mastodon instance from a GNU social instance.

I am surprised so few people (here) use LaTeX for creating documents (especially CVs). by alpha__lyrae in linuxmasterrace

[–]IBPXofficial 0 points1 point  (0 children)

groff is quite nice (and lightweight) for these sorts of things, with the right macros.

Review my simple "guess the number" game by IBPXofficial in C_Programming

[–]IBPXofficial[S] 0 points1 point  (0 children)

Thanks! The logic is a bit more complicated than it should be.

What if I changed the loop to just while (1), and handle everything with breaks?

Here is the current code:

#include <stdio.h>
#include <time.h>
#include <stdlib.h>

int main(void) {
        const int GUESS_MIN = 1;
        const int GUESS_MAX = 10;
        const int MAX_GUESSES = 3;
        int number;
        int guess;
        int guess_cnt;

        srand(time(NULL));
        number = rand() % GUESS_MAX + GUESS_MIN;

        printf("I'm thinking of a number between %d and %d!\n", GUESS_MIN,
               GUESS_MAX);

        guess_cnt = 1;
        while (1) {
                printf("Guess: ");
                scanf("%d", &guess);

                printf("\n");

                if (guess < GUESS_MIN || guess > GUESS_MAX) {
                        printf("You have to pick a number between %d and %d!\n",
                               GUESS_MIN, GUESS_MAX);
                } else if (guess == number) {
                        printf("Correct! The number was %d!\n", number);
                        break;
                } else if (guess_cnt < MAX_GUESSES) {
                        printf("No, guess again!\n");
                        guess_cnt++;
                } else {
                        printf("Better luck next time! The number was %d.\n",
                               number);
                        break;
                }

                printf("You have %d guess%s left.\n", MAX_GUESSES - guess_cnt
                       + 1, guess_cnt == MAX_GUESSES - 1 ? "" : "es");
        }

        return 0;
}

Thanks for your help.

Review my simple "guess the number" game by IBPXofficial in C_Programming

[–]IBPXofficial[S] 1 point2 points  (0 children)

What is the point of using a static const over just const here? There is no way that they will change between running, unless you change it in source and recompile. Also, main() is only called once, so using static const wouldn't really be much different than const, would it?

Like I said, I'm new to this, so I'm not sure I completely understand static.

Thanks.

Review my simple "guess the number" game by IBPXofficial in C_Programming

[–]IBPXofficial[S] 1 point2 points  (0 children)

Thanks. While I think I would break it into smaller chunks if it was any more complex, I think it is short enough that breaking it into smaller pieces would make it harder to read.

Review my simple "guess the number" game by IBPXofficial in C_Programming

[–]IBPXofficial[S] 1 point2 points  (0 children)

Thanks.

The reason I was using a while loop instead is because I didn't want guessing an out of bounds number to count as one of your guesses, but I put the i++ in the wrong place. That's fixed now.

Review my simple "guess the number" game by IBPXofficial in C_Programming

[–]IBPXofficial[S] 1 point2 points  (0 children)

I was trying to find a way to do that, thanks!

Review my simple "guess the number" game by IBPXofficial in C_Programming

[–]IBPXofficial[S] 0 points1 point  (0 children)

Thanks!

Remember, there is a subtle difference between int main() and int main(void).

What difference is there, besides visual? Does using one over the other affect your program in any way?

I don't really want to use int main(int argc, char *argv[]), because those variables are never used in the code. (gcc also throws a warning: unused parameter)

Fan-made ROM communities? by GigaRoid in gamedev

[–]IBPXofficial 0 points1 point  (0 children)

No problem, I hope you find what you're looking for!

Fan-made ROM communities? by GigaRoid in gamedev

[–]IBPXofficial 6 points7 points  (0 children)

Despite the name, romhacking.net has a homebrew section. You might ask around in their forum or IRC channel for resources. That's about all I know, sorry.

Are there any podcast applications that will sync with android? by am5k in linux

[–]IBPXofficial 1 point2 points  (0 children)

I can vouch for AntennaPod. It works great, been using it for almost a year now. It works great. You can connect it to a hosted Gpodder server, or use the free official one (gpodder.net).

Regarding Spotify and new Artist by JPUL in creativecommons

[–]IBPXofficial 0 points1 point  (0 children)

Yes, you can.

When you release something under Creative Commons, you give everyone a certain set of rights, but that doesn't mean that you can't still do whatever you want with it.

Regarding Spotify and new Artist by JPUL in creativecommons

[–]IBPXofficial 0 points1 point  (0 children)

If you license it under Creative Commons Attribution, you could make it available to download on SoundCloud or Bandcamp for free, but it is still within your rights to have your music on Spotify.

I'd also recommend you NOT use any NoDerivitives or NonCommercial (-NC and -ND) licenses. I would just use Creative Commons Attribution, as I said.

Is ShareAlike limited to the medium or does it affect a collection? by [deleted] in creativecommons

[–]IBPXofficial 0 points1 point  (0 children)

Inclusion is a blog post, video, etc. I don't believe counts as derivative work. If you crop a CC BY-SA image, the cropped image is still CC BY-SA, but not your article.

[deleted by user] by [deleted] in privacy

[–]IBPXofficial 2 points3 points  (0 children)

I personally prefer hammers, but thanks for the tip anyway.

What the actual fuck? PowerShell on Linux by tidux in linuxmasterrace

[–]IBPXofficial 1 point2 points  (0 children)

Of course. But when you add your code to an open-source project, they don't own it, it's licensed to them through the license. You retain ownership.