- 🎮Indie game dev
- 💬Adding content to the fediverse
Non-work account
posting things i find interesting in the 90 rss feeds I follow
- 157 Posts
- 18 Comments
mac@programming.devto
Programming@programming.dev•Why does the for loop repeat in this recursion?
8·3 years agoThis code has a recursive call (function calls itself) within the function so that has to be taken into account when tracing it
This would make the function execute multiple times so the for loop would end up executing multiple times.
Lets say main calls draw with a height value of 10 (draw(10)). First it sees that n is greater than 0 so it keeps going. Then it calls the draw function with a value of 10 - 1 aka 9. Now its executing in the draw(9) function. Greater than 0 so continues and calls draw(8). etc. all the way down to draw(0) where it sees that n is equal to 0 so returns out of the function due to the return statement.
Now that draw(0) finished executing draw(1) can keep going and goes to the for loop. Here it prints 1 # and then prints a new line (and then returns since it hit the end of the function). Now that draw(1) is done draw(2) can keep going and prints 2 #'s and then prints a new line (and then returns). This keeps going all the way up to the initial draw call, draw(10) which prints 10 #'s and then a new line, returns, and then the main function keeps going but theres nothing after that so it returns and the execution ends.
The effect from coming back after the recursive calls makes it seem like n is increasing but its just different calls to the same function. i is taken into account for but printing the amount of #'s since thats whats within that loop
Letting you know, the download and github links on the git.rela.dev site navbar dont work
Its probably set as a private repository



mac@programming.devto
Programming Horror@programming.dev•God I wish there was an easier way to do this
22·3 years agowho needs modulo when you can get less characters out of
while (number > 1) { number -= 2; } return number;very efficient
edit: or theres the trusty iseven api
mac@programming.devto
Programming@programming.dev•Introducing Wikifunctions: first Wikimedia project to launch in a decade creates new forms of knowledge – Wikimedia Foundation
11·3 years agoYeah active is currently the default sort in programming.dev until scaled sort comes out so commenting helps the most out of everything here
mac@programming.devOPto
Programming@programming.dev•GitHub: Can no longer search code without being logged in
62·3 years agosearching across all of github was made to be logged in then
repository level searching though is relatively recent. Heres the blog post about the change dated in June this year https://github.blog/changelog/2023-06-07-code-search-now-requires-login/
This comment by an employee in the thread also calls out it was in 2023 and links to the blog post

mac@programming.devto
Programmer Humor@programming.dev•Welcome to the wonderful world of code obfuscation
202·3 years agoImage Transcription: Meme
[Paneled meme with a brain that gets increasingly glowing]
[The brain is smaller than the skull]
if dayOfWeek.name == "Sunday" || dayOfWeek.name == "Saturday" weekend = true
[The brain is glowing in some areas]
if dayOfWeek < 2 || dayOfWeek > 6 weekend = true
[The brain is shooting out rays of light]
weekend = !((dayOfWeek - 1) % 6)
I am a human volunteer who transcribes posts to improve accessibility on programming.dev and you could be one too! !transcribing@programming.dev
mac@programming.devOPto
Game Development@programming.dev•Unity apologizes to devs, reveals updated Runtime Fee policy
1·3 years agoUpdated the link to link to the official unity post
Heres what I had originally posted: https://www.gamedeveloper.com/business/unity-apologizes-to-devs-reveals-updated-runtime-fee-policy
mac@programming.devOPto
Game Development@programming.dev•Unity tweaks new install fees as developers threaten to jump ship
17·3 years agoGodot and Bevy are both FOSS. Godot is built in C++ and allows using GdScript and C++, or C#. Bevy is built in Rust and allows using Rust
mac@programming.devOPto
Game Development@programming.dev•Unity tweaks new install fees as developers threaten to jump ship
40·3 years agoThey removed charging again for deleting and reinstalling but are still charging for installing on a different device. So they just realized that there’s no way to enforce the former without people abusing it
just upscaled it so shouldnt be blurry anymore
Yeah in this it would be one smoke puff. For example in this image theres the top right smoke puff highlighted in a bunch of the images and it shows that from the start to the end. So you would do that one first spriting it going through all those steps, then move to another one and repeat
And yeah not the creator. The creator is miniboss who has made a ton of various great pixel art tutorials
Probably just a lemmy-ui bug then
For some reason doesnt seem to be animating on lemmy (from the 4 instances I tried looking at it from), trying to fix. Shows fine on kbin
You can also see it animating from following the link I did in the post
Edit: Added another version of the image to the post and that one seems to be fine
Figured out how to get it to show as a gif on lemmy (before was only animating on kbin) so should be animating now
seems like it loads when I look at it from programming.dev and lemmy.world but not lemmyloves.art
mac@programming.devOPto
Game Development@programming.dev•Apple’s Vision Pro: what will it do for the gaming industry?
6·3 years agohuh second time someone said that for a post, ive tested it and it works fine on my end
What client are you using
Weird, heres the content in it

It is with immense sadness that we must share with you the news of the loss of our friend, our leader, and our mentor, Kris Nóva.
It was Nóva who inspired us to come together to build Hachyderm, whose vision created Nivenly, and whose mission we continue to carry forward. In her working life beyond Nivenly, she has left behind a legacy of professionalism and strength of vision, and we all miss her terribly.
This is very fresh and raw for us in the Nivenly community right now, so we ask for patience while we figure out how we move forward. But move forward we will, as we know that is what Nóva would want.













When the draw function calls itself it yields control to that new function its calling. When that function ends it takes back control and continues doing what it was doing.
This means all of the for loops in all of the functions will execute. Draw(1) will do the for loop and then return as it hits the end of the function (standard behaviour when you reach the end of a function even if theres no return statement). Then draw(2) will do the for loop as it gets back control now that draw(1) is done and then return, etc. all the way up
All parts of a function are recursive, theres no such thing as a non recursive part