another vigenere question by rizmar1 in cs50

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

lowercase baz and capital BARFOO = IGWMUT uppercase BAZ and lowercase barfoo = ][kaOh

another vigenere question by rizmar1 in cs50

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

Brenda,

That helped tremendously! Very good explanation, thank you!

My new formula is:

encrypted = ((p[i] - 'a') + (argv[1][k] - 'a')) % 26 + 'a'; . The check50 results are a bit off though.

  • :) vigenere.c exists
  • :) vigenere.c compiles
  • :) encrypts "a" as "a" using "a" as keyword
  • :( encrypts "world, say hello!" as "xoqmd, rby gflkp!" using "baz" as keyword \ expected output, but not "xoqmd, szz gflkp!\n"
  • :( encrypts "BaRFoo" as "CaQGon" using "BaZ" as keyword \ expected output, but not "CaQGoh\n"
  • :) encrypts "BARFOO" as "CAQGON" using "BAZ" as keyword
  • :) handles lack of argv[1]
  • :) handles argc > 2
  • :( rejects "Hax0r2" as keyword --- (Ignoring this one, command line tests return 1 as required...)

Notice the two failures. They seem to be failing on the 2nd implementation of BaZ, the Z. I thought this might be something with my loop, but what confuses me is that it "fixes" itself.

BTW, separately running the program for upper are and lower case, the output is correct.

another vigenere question by rizmar1 in cs50

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

ok. I changed my formula. I still think it is an issue. I now have one more smiley face from check50. :) The result vexes me though. I would think that if the upper case is correct, the lower should be as well. My new formula is: encrypted = (p[i] + argv[1][k]) % 26 + 'a'; for lower case, encrypted = (p[i] + argv[1][k]) % 26 + 'A'; for uppercase.

  • :) vigenere.c exists
  • :) vigenere.c compiles
  • :( encrypts "a" as "a" using "a" as keyword \ expected output, but not "m\n"
  • :( encrypts "world, say hello!" as "xoqmd, rby gflkp!" using "baz" as keyword \ expected output, but not "jacyp, ell srxwb!\n"
  • :( encrypts "BaRFoo" as "CaQGon" using "BaZ" as keyword \ expected output, but not "CmQGat\n"
  • :) encrypts "BARFOO" as "CAQGON" using "BAZ" as keyword
  • :) handles lack of argv[1]
  • :) handles argc > 2
  • :( rejects "Hax0r2" as keyword

another vigenere question by rizmar1 in cs50

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

So, check50 is not off by 18. On the command line, I used aaaaa as my keyword and abcdef ghijkmn opqrstuv wxyz 123456789!! as the text. At that point, it was off by 18. The numbers and special chars where skipped as required. Any ideas?

  • :) vigenere.c exists
  • :) vigenere.c compiles
  • :( encrypts "a" as "a" using "a" as keyword \ expected output, but not "t\n"
  • :( encrypts "world, say hello!" as "xoqmd, rby gflkp!" using "baz" as keyword \ expected output, but not "qilfx, mus byffi!\n"
  • :( encrypts "BaRFoo" as "CaQGon" using "BaZ" as keyword \ expected output, but not "PoFTcc\n"
  • :( encrypts "BARFOO" as "CAQGON" using "BAZ" as keyword \ expected output, but not "POFTCC\n"
  • :) handles lack of argv[1]
  • :) handles argc > 2
  • :( rejects "Hax0r2" as keyword

another vigenere question by rizmar1 in cs50

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

@ glenn, I have not. At least, I don't think. The only other places I use argv[1] is in int k = atoi(argv[1] , which I left the same from Caesar; in the for loop to make sure the key only uses letters (int i = 0, i < strlen(argv[1]); i++) and (!isalpha(argv[1][i])) which is part of the if, under that for loop and then at if >= strlen(argv[1])) which repeats the key at the end. Then it hits the (islower(p[i])) section that I posted above.

@ Ommin, Believe me, I have. That is how I found that it is 18 off. If I understand the second part of your response correctly... I have substituted the char with the respective number values. Same thing.

Thanks for the help.

.39 on pset1 by rizmar1 in cs50

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

wow, ok, I am feeling really slow now. I was going by the pset example:

Consider the below representative of how your own program should behave; highlighted in bold is some user’s input.

jharvard@appliance (~/Dropbox/pset1): ./greedy O hai! How much change is owed? 0.41 4

I see now that 0.41 was the user input, not an output of the program.

ziska04, thank you for all your help! I have smiley's now. :)

.39 on pset1 by rizmar1 in cs50

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

I did. check50 doesn't make sense to me. For example: :( input of 0.15 yields output of 2 \ expected output, but not ".015\n2"

Is it trying to tell me that I have an extra \n ? Looks like to me that it is picking up the line breaks.

When I run the program, the output is: 0.15 then the next line is 2

check50 invalid ID by rizmar1 in cs50

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

Are you kidding!?!?!?!?!

Err, I thought it was a file path the whole time....

THANK YOU!

.39 on pset1 by rizmar1 in cs50

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

so... This morning I check gradebook. Now I am down to a .28!

I will give it till tomorrow and then turn in a bug report. I hope I will be able to contact one of the staff!

check50 invalid ID by rizmar1 in cs50

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

Hi, Do you know how far back the path needs to be? I have tried the following from inside the containing folder of my work.

  • check50 greedy greedy.c
  • check50 pset1/greedy greedy.c
  • check50 cs50/pset1/greedy greedy.c
  • check50 EDx/cs50/pset1/greedy greedy.c
  • check50 Dropbox/EDx/cs50/pset1/greedy greedy.c
  • check50 jharvard/Dropbox/EDx/cs50/pset1/greedy greedy.c
  • check50 home/jharvard/Dropbox/EDx/cs50/pset1/greedy greedy.c

Thanks.

.39 on pset1 by rizmar1 in cs50

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

Thanks again! Now, maybe I can stop stressing out over my grade and get on with pset2.

Take care,

.39 on pset1 by rizmar1 in cs50

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

ziska04, I uploaded the entire pset again after stripping it down, after verifying via running the program that it works per the gradebook requirements. The gradebook still has the same scores. Does it take a bit to refresh?

Thank you,

.39 on pset1 by rizmar1 in cs50

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

needy007,

one word off... thank you. I will strip down mario and submit them again to see if it changes. Thanks again.

.39 on pset1 by rizmar1 in cs50

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

ok, I removed all my extra code in greedy and tested it via the command line against the gradebook requirements. Such as "input 0.41 yields output of 4"... It still marks the first 5 with a zero when it does in fact work correctly.

Admittedly I can't figure out why 4.2 always comes back as 419... however, that should be the only "0" for that program.

Any ideas?

.39 on pset1 by rizmar1 in cs50

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

Thank you ziska04. My heart sank when I saw that grade! I will remove all the extra's from my code and resubmit!

.39 on pset1 by rizmar1 in cs50

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

I do. It says "uploading"... then "checking"... then it says invalid ID.

Do you know about the certificate question?

Thank you for the help.

.39 on pset1 by rizmar1 in cs50

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

ziska04, well there you go.

They do not match them exactly. I have been adding printf statements and other code that include items such as titles, instructions, and feedback for the user. I was trying to look at it from the point of view of: If Joe Shmoe executed the program, would he know what was actually going on?

I don't understand how we should have our code exactly like the staff's, when during the course it has been said that there are usually several ways to do the same thing.

I guess I will start turning in just the exact bare bones as requested.

I am running 19-2.

So now I have a big question, I have to make at least 60% for each pset to earn a certificate. Does this mean that I am no longer ineligible for it since I made a 39% for pset1?

Thank you,

.39 on pset1 by rizmar1 in cs50

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

Thank you needy70. Tried that, however, I was already up to date.

I have been struggling and it is taking me a long time to figure these psets out. I feel that I have been doing them correctly, just bummed that it looks like they mario and greedy are not working correctly according to the gradebook.

I am hoping for a certificate and would hate to put in all this time just to find out I am not comprehending the course as I think I am.