[Community Puzzle] Retro Typewriter Art

You are on the right path.

Remember that not every chunk will contain a “character”. For example 123 and 27

I suggest you Google this: python print multiple characters

1 Like

Thank you very much Lisa for the hint.
The guy in the video doing art typewriting is very talented…
Nice challenge

1 Like

Thanks Nicola,
I had hard times with your tips but i’ll find out what that means…

It’s a cool puzzle, alright, and I’m not much of a fan of ASCII art. I do have to say, though, that testcase 4 is messing with my childhood. Yogi was always after picnic (er, “pic-a-nic”) baskets. It was Winnie the Pooh who was into “Hunny”. :slight_smile:

1 Like

Haha… you’re so right!!! I just changed it.
(It’s obviously been too long since my own childhood.)

Thank you for the puzzle, it’s just fantastic ,He helped us to use our head :slight_smile

1 Like

Hi Everyone,

Thanks to Lisa-has-ideas and Nicola’s help, i came to a Python script which work in some cases. I arrive to draw the cat, the alien, part of other drawings.
My code is a beginner code, long, plenty of for loops and if statements.

To really “succeed” the challenge, there is one case i need to resolve : where the string is at least two figures followed by a character, e.g. “12z” or “10a”.

So far i put the stand-alone number in a variable “number” that i could use to multiply the character. However, if the number is 12, then 1 and 2 either adds “number +=” or 2 replace 1. But i cannot arrive to have a string 12.

I thought about splitting the string “12z”, but i cannot split figures from letters as i would need to use regex probably. Hence, i am looking for a solution with some variables, for loops…perhaps…to build into a variable, a string like var = 1+2 = 12 that i could multiply the character by.

I would be happy If anyone has a suggestion as i fear that solutions from the community would all be a 3-line code using regex and others advanced methods !!

Thank you very much.

Use "12z"[-1] and "12z"[:-1].

1 Like

A few thoughts:
Write pseudo-code first. What in plain English are you trying to do? Literally type it out.
Then google that with the word python after it

Perhaps you want to go thru each character in a chunk. If it’s a digit, then add that to a Digits-List. If it’s not a digit, then add it Other-List. That would be one way to separate. And then you just have to deal with the special case (such as “123” or “27”) that are all just digits.

Not all solutions will be fancy.

Keep at it. It’s all about the learning-process :slight_smile:

Am I stupid? :crazy_face:

I started learning C from scratch about 4 weeks ago as my first programming language.
For solving @Lisa-Has-Idea 's very nice puzzle it took me 12 hours!!!
I solved it with 100%, but 12 hours can’t be normal, can it?
Now I feel a bit stupid and would be happy to read your honest opinion.

Should I stop learning programming languages?
Or are there any tips on how to get programming skills faster and better into my almost 50 year old brain?

Don’t worry too much about how much time it took! The main point is that you solved it!
It was a non-trivial puzzle and C is not easy to deal with as a first programming language.

I dare you that your next (same difficulty) puzzle will take less time.
And your 10th or 20th puzzle will take MUCH less time.

I don’t think if there is a golden way, just reading a good book/tutorial, then practicing a lot. After you finish a puzzle. it also makes sense to check and see how some other people solved the same problem in the same language.

So are you stupid? No, only if you decide to stop learning programming languages! :wink:

2 Likes

Hi Snippet –

Thank you for playing my puzzle :slight_smile:
12-hours is not great, but one puzzle cannot tell the full story. What was you time with other Classic Easy puzzles? If you enjoy programming, keep doing it and you will get better.
I would say the fact that you stuck with it for 12 hours is the headline here!!

Why are you learning C, instead of a newer/easier languages, like Python?

Why are you starting to program at age 50? Are you looking for a career change and people told you “programming is a good career”? If “Am I stupid” is really your way of asking “Am I going to be able to have a career in programming?” there are some aptitude tests you can take that might help you answer that.

For some people, programming is not a natural fit; it does not mean you are stupid, but it might mean your efforts might be more fruitful elsewhere.

1 Like

You’ve just started to learn (4 weeks is nothing !!!), so don’t worry about the time it tooks you. And C is not the easier language to solve this puzzle :wink:

1 Like

Cool Puzzle, I suggest adding a Testcase on which you would have an Input like 88, 66 or 777. I think in the validators, there is but not in the testcases. You’re code could work totally fine with inputs like 78 or 59 but maybe not if they are the same.

1 Like

After thinking about your post for a bit… I have other questions for you:
What did you do in those 12 hours…
Like:
(a) Did you not understand the puzzle goal? You just couldn’t visualize what I was asking?
(b) Was it the logic that took you 10 hours to understand? (And then you coded it in 2 hour)
(c) Were you able to understand the logic and write the pseudo-code within an hour? (And then just couldn’t figure out the exact coding-syntax despite your best googling)
(d) Did you have code that worked mostly within 2 hours and spent the other 10 hours finding and fixing a bug?

In my opinion:
(a) That just happens. Maybe I used a phrase that just confused you. I black-out like that sometimes with puzzles involving weapons. I wouldn’t be too worried, as long as you are better with most other puzzles.
(b) This would be the most concerning scenario. The logic in this is pretty straight forward. If you could not pseudo-code this I would see that as a sign that maybe programming is not a natural fit for you.
(c) This is normal. Googling skills become much much better over time. If it was this, I wouldn’t be worried at all.
(d) This is a good sign. It shows perseverance, and you’ll never make that particular goof again (maybe).

I hope this was helpful.

And even if you “are stupid” (to use your words), practice will make you better.
And you don’t have to be a great-programmer to get a job programming.
And you don’t even have to be a good-programmer to enjoy it as a hobby.

1 Like

Hi Keve –
This is a good suggestion.
I few coders noted they were able to solve “Foundation of 8’s” Test but not its validator (“Lots of 8’s”) – which is exactly the same except the 8’s are “7” and “6” in the Validator, so there would be a “66” in it)

And I couldn’t for the life of me figure out why on earth and I bet this is why.
I have now added another layer on “Foundation of 8’s” test that includes “88”.

If you have it, I would be interested to see code that works for 78 but not for 88 (for example).

Thanks for the good suggestion and for playing my puzzle :slight_smile:

Hi Lisa,
thanks for your respond and your great thoughts.

a/b)
So far, I never had problems, understanding the goals of puzzles or bot programming.
Same with pseudo-code. I first write it as comments, then do the coding. At last, I delete the pseudo-code or shorten it to comment my code.

c) and d) are definitely a thing. The first raw functions were coded in a relatively short time but I got stuck in a loop logic. Usually, my first code is too complicated and longer than it has to be.

In general, comparing my code with the best solutions, I have to realise that there are much simpler and shorter ways reaching the goals.

It’s like having not all possible tools. If I would know much more about the different library functions or which approaches are the most efficient, I could write better and shorter code.

I decided to learn C because I read about it, that it would be one of the best foundational programming languages to learn.

At the moment, it’s not my main goal to get a job as a developer. But I am interested in cyber security / CISO, forensics and database development. So, a widely understanding of different programming languages could be helpful, I think.

Thanks again for your support.

The problem was, after I extracted the number part, i removed that as a substring from the original command. So for the example of 88, i would print 8 times nothing. Hope it’s ok, to post the link to the solution, i think its only visible if the puzzle was completet:

I made a comment which line you have to remove for the bug to appear.

Edit: Tested you’re modified testcase, with my old code which was able to pass them all but not the validators. Failed now on testcase “Foundation of 8s”, so that worked well.

Thanks, Remi!
I chose C as a foundational language and I really hope that this quite hard start makes it easier for me, learning other programming languages afterwards.
At the moment, I often stick with “when to choose which” statement, loop or function. So, my code has to have better code-alternatives to get the same result with easier and shorter code.