• 0 Posts
  • 43 Comments
Joined 2 years ago
cake
Cake day: July 13th, 2023

help-circle















  • I believe the intended purpose is to reduce the overall acidity of your body, which it will do (negligibly, maybe even immeasuably). Your stomach acid will compensate regardless, but, in doing so, it uses acidic compounds in the process to do so. Whether that is even beneficial in general is debatable at best, though likely not. But mixing in other acids does negate at least some of the alkalinity, which would defeat the entire point, if there is any effect from it.

    Edit: Clarified my position a bit. I’m not suggesting that alkaline water is effective at doing anything at all, nor even that its intended purpose would be a health benefit.


  • No, but it does reveal a distinct lack of understanding on her her part as to what these pseudoscientific health products even are that are supposedly doing things for her. Like saying “I always drink decaf coffee and pop a shot of 5 hour energy in the morning.” “I drink skim milk with a splash of double cream.” “I love honey on my keto toast.” Like, even if it’s not enough acidity to completely negate the alkalinity, it’s literally antithetical to the supposed goal.



  • But anyway, I kind of like goto too much. I find it more intuitive to just jump around and re-use parts rather than think about how to do loops without too much nesting.

    Might I introduce you to functions?

    Need to write a prompt to the console and get an input? That could be a function. Need to check if a character matches some option(s)? That’s could be a function. Need to run a specific conditional subroutine? That could be a function. And function names, done correctly, are their own documentation too.

    You main function loop could look almost like pseudo code if you do it right.

    #include <stdio.h>
    #include <stdlib.h>
    #include <stdbool.h>
    #include <string.h>
    
    char* prompt_for_input(const char* prompt_message) {
        char temp[100];
        printf(prompt_message);
        fgets(temp, 100, stdin);
        temp[strlen(temp)-1] = '\0';
        char* input = malloc(strlen(temp));
        strcpy(input,temp);
        return input;
    }
    
    int string_to_int(char* input) {
        return (int)strtol(input, NULL, 10);
    }
    
    int prompt_for_loop_count() {
        char *input = prompt_for_input("\nI'll loop over this many times: ");
        int loop_count = string_to_int(input);
        free(input);
        return loop_count;
    }
    
    bool prompt_to_do_again(){
        char *input = prompt_for_input("Let's do that again!\nShallow we? (y/n): ");
        bool do_again = (strcmp(input, "y") == 0 || strcmp(input, "Y") == 0);
        free(input);
        return do_again;
    }
    
    void print_and_decrement_counter(int loops_remaining) {
        do {
            printf("Current = %d\n", loops_remaining);
            loops_remaining--;
        } while (loops_remaining > 0);
    }
    
    int main() {
        bool need_to_get_loop_count = true;
        printf("Hello.");
        while(need_to_get_loop_count) {
            int loops_remaining = prompt_for_loop_count();
            print_and_decrement_counter(loops_remaining);
            need_to_get_loop_count = prompt_to_do_again();
        }
        printf("\nBye\n\n");
    }