X-Gen
Posts: 87
Joined: Fri Dec 06, 2019 12:08 pm

Coding book, from beginning to intermediate

Sat Feb 01, 2020 6:21 am

Would be nice to have some code book ramp up from the basics (installation, syntaxis) into some intermediate stuff (assembly optimizations)...

start with a hello world, (probably in python), as well as code some classic games in a variety of languages; ending the book in a few examples on how to optimize games in assembly language for the Pi.

Most online tutorials are starting slow, but then ramp up drastically, to the point where regular people can no longer figure out what happened, and have to discontinue (or pay a fee).

Python, Assembly, and perhaps a few other of the most popular languages.

User avatar
DougieLawson
Posts: 37763
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Coding book, from beginning to intermediate

Sat Feb 01, 2020 9:43 am

It already exists in 90 chapters with a new chapter published monthly.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
Gavinmc42
Posts: 4341
Joined: Wed Aug 28, 2013 3:31 am

Re: Coding book, from beginning to intermediate

Sat Feb 01, 2020 10:58 am

Wireframe and some of the Pi tutorials require PC's.
Of course coding games is probably the most complex things that can be coded.
Optimising games or AI in assembler is complex, going to take years?
I'm refusing to learn that in Arm6/7 and I'm only going to learn ARMv8 assembly.
Even then it might be too hard and I'll move to RISC-V :lol:
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
lucyhattersley
Posts: 27
Joined: Tue Aug 04, 2015 5:05 pm

Re: Coding book, from beginning to intermediate

Mon Feb 03, 2020 3:05 pm

Raspberry Pi Press has recently released a couple of books you might like

Code The Classics has Python source code for a range of classic games
https://store.rpipress.cc/products/code-the-classics

And

Build your own First Person Shooter in Unity
https://store.rpipress.cc/products/buil ... r-in-unity

I haven't read the Unity one yet, but am planning to go through it.

User avatar
Gavinmc42
Posts: 4341
Joined: Wed Aug 28, 2013 3:31 am

Re: Coding book, from beginning to intermediate

Mon Feb 03, 2020 11:35 pm

I got Godot 3.2-stable going.
There is probably some tutorials for that?
Plenty of examples, but I only had a short play with one.
Still a pretty steep learning curve.

There are some game engines around that can be used to make games.
Learning how to make game engines is coding too.
Now it looks like we might have to learn Vulkan coding, perhaps this year?
Vulkan is probably the most future proof and transferable bit of graphics coding we could learn on Pi's.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

X-Gen
Posts: 87
Joined: Fri Dec 06, 2019 12:08 pm

Re: Coding book, from beginning to intermediate

Fri Feb 07, 2020 9:17 am

Gavinmc42 wrote:
Sat Feb 01, 2020 10:58 am
Wireframe and some of the Pi tutorials require PC's.
Of course coding games is probably the most complex things that can be coded.
Optimising games or AI in assembler is complex, going to take years?
I'm refusing to learn that in Arm6/7 and I'm only going to learn ARMv8 assembly.
Even then it might be too hard and I'll move to RISC-V :lol:
It takes years to learn just about any language.
Assembly is not a language to learn to code in, but to learn to read, and modify.
Learning tricks for optimizing assembly is interesting, but come to think of it, most languages convert human programming languages pretty well into machine code nowadays (assembly>>machine code); so it's pretty tough to get much optimized any further.
Yet, it's interesting to see how hackers can develop demos (remember 4k demo scenes for PCs at the time?), by optimizing and streamlining code in assembly.

It kind of reminds me on how a web page, created by MS WORD could be 1,7MB in size, and with a lot of trimming, can be made to look 85-90% identical, with nearly the same functionality, at a mere 6kB of size (or trim it down to HTML0, get 80% of the functionality, in a mere few hundreds of bytes).

User avatar
DougieLawson
Posts: 37763
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: Coding book, from beginning to intermediate

Fri Feb 07, 2020 10:15 am

X-Gen wrote:
Fri Feb 07, 2020 9:17 am
It takes years to learn just about any language.
Assembly is not a language to learn to code in, but to learn to read, and modify.
Been doing it 40 years, still learning.

I started on machine code, hand assembled and POKE'd into ZX80 memory from a BASIC program. When I got my Microtan 6502 based machine I didn't have an assembler (or BASIC for that matter - both the assembler stuff & BASIC came on a ROM on the TANEX board at my next birthday).

There's nothing wrong to starting with assembler. The ARM assembler is so much like IBM S/370 that I find it easy to use, but C/C++ gets more done in fewer lines of code than assembler. Assembler gives you fast code but takes a long time to write.

NatWest Bank (this was back in 1982) started all of their programmers on IBM S/370 assembler. The ones who caused trouble by telling them they weren't covering the whole subject got to work in the Systems Programming dept. The ones who did OK but didn't complain got to work on applications written in assembler. The ones who sat back and played dead (because they weren't interested in any low level stuff) got taught COBOL & PL/1 and ended up working in the Application Programming depts. This was a good thing because it meant most of the application folks could get started with reading their post-mortem dumps (and didn't have to disturb me for help). I've only ever written six lines of code in a commercial application program (read & modify as a urgent bug fix after we broke something for an external customer). I've spent most of my 37 years doing lots of Systems Programming code in assembler in tools programs, in the operating system and in hierarchical & SQL database systems.

I dabble in COBOL and learned more in a week last year working with a guy who's done COBOL for 35+ years. There again I'm still learning. This week he was learning the 64-bit differences in IBM assembler and how to read post-mortem dumps from me.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Brian Beuken
Posts: 215
Joined: Fri Jan 29, 2016 12:51 pm

Re: Coding book, from beginning to intermediate

Mon Feb 17, 2020 11:45 am

Try my bookie wookie, its aimed at game progammers and does base most of the methods on usig a PC, but you can also use the methods on a raspberry with code:blocks or other IDE
Is based on C++ though, I don't reccomend assembler for beginners, and python isn't the best way to fully get a handle on what the Raspberry is having to do to get things on screen. A good understanding of how things work and can be manipulated needs C++.

https://www.amazon.co.uk/Fundamentals-G ... op?ie=UTF8
Very old computer game programmer, now teaching very young computer game programmers, some very bad habits.
Wrote some book about coding Pi's and SBC's, it's out now...go get it!
http://www.scratchpadgames.net/

Pytha
Posts: 9
Joined: Tue Jan 21, 2020 2:23 pm

Re: Coding book, from beginning to intermediate

Wed Feb 19, 2020 8:00 am

DougieLawson wrote:
Fri Feb 07, 2020 10:15 am
X-Gen wrote:
Fri Feb 07, 2020 9:17 am
It takes years to learn just about any language.
Assembly is not a language to learn to code in, but to learn to read, and modify.
Been doing it 40 years, still learning.

I started on machine code, hand assembled and POKE'd into ZX80 memory from a BASIC program. When I got my Microtan 6502 based machine I didn't have an assembler (or BASIC for that matter - both the assembler stuff & BASIC came on a ROM on the TANEX board at my next birthday).
Well done! Same did I . FORTRAN on an University Computer, then assembler, more than 600 commands for Z80 in head, my first "computer" had
hex display and 256 (!) bytes.

User avatar
Gavinmc42
Posts: 4341
Joined: Wed Aug 28, 2013 3:31 am

Re: Coding book, from beginning to intermediate

Wed Feb 19, 2020 8:10 am

I'm taking a leaf from the kid and now watching YT's.
Very educational in a non detailed basic way.
Plenty of github example code around too.

Hard to find non Windows/Unity/Unreal examples.

Not sure if only 12weeks of a Z80 TAFE course in the 1980's set me up as a future Computer Software Engineer?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
rpdom
Posts: 16398
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Coding book, from beginning to intermediate

Wed Feb 19, 2020 8:12 am

X-Gen wrote:
Fri Feb 07, 2020 9:17 am
It takes years to learn just about any language.
COBOL took me 10 days (of a 15 day training course).
Z80 Assembler took me a while. I used to read "Programming the Z80" every night for ages.
6502 didn't take too long.
ARM was fun. So few instructions with so many options.
BASIC varied. I learnt many versions, often with really weird syntax.
The list continues...

pianoman
Posts: 1
Joined: Thu Mar 12, 2020 6:10 pm

This is really off topic but on topic for a sec: Although a Ph.D. in P chemistry I have kept an interest in computers

Thu Mar 12, 2020 6:21 pm

I have dabbled in various computer languages for some time and written a book on LISP. I have used several computer languages starting with FORTRAN and taught a few. I just acquired my first Raspberry Pi and have it in a fan-cooled box with an external breadboard. I am now trying to get Mathematica up on my Pi, starting by downloading the Wolfram Pi version to my LINUX-OS desktop which was successful except that now I need to use a password to get it to work. From whom can I obtain such a password?

Giga_Pi
Posts: 66
Joined: Mon May 20, 2019 9:48 am

Re: Coding book, from beginning to intermediate

Fri Mar 20, 2020 5:08 pm

The default password is "raspberry"
As soon as the DM smiles, you know it's too late...

Return to “The MagPi”