- Go Systems Programming
- Mihalis Tsoukalos
- 248字
- 2021-07-02 18:08:00
Exercises
- Browse the Go documentation site: https://golang.org/doc/.
- Write a Go program that keeps reading integers until you give the number 0 as input, then it prints the minimum and maximum integer in the input.
- Write the same Go program as before, but this time, you will get your input using command-line arguments. Which version do you think is better? Why?
- Write a Go program that supports two command-line options (-i and -k) in random order using if statements. Now change your program to support three command-line arguments. As you will see, the complexity of the latter program is just too much to handle using if statements.
- If the indices of a map were natural numbers, are there any cases that it would be wise and efficient to use a map instead of an array?
- Try to put the functionality of array2map.go into a separate function.
- Try to develop your own random number generator in Go that will still use the current time as a seed but not the math/rand package.
- Learn how to create a slice from an existing array. What happens when you make changes to the slice?
- Use the copy() function to make a copy of an existing slice. What happens when the destination slice is smaller than the source slice? What happens when the destination slice is bigger than the source slice?
- Try to write an interface for supporting points in 3D space. Then, use this interface to support points that reside on the x-axis.
推薦閱讀
- Cocos2d Cross-Platform Game Development Cookbook(Second Edition)
- 軟件架構:Python語言實現
- C語言程序設計
- 可解釋機器學習:模型、方法與實踐
- 零基礎輕松學SQL Server 2016
- Frank Kane's Taming Big Data with Apache Spark and Python
- 大話Java:程序設計從入門到精通
- Hadoop 2.X HDFS源碼剖析
- Java程序設計基礎(第6版)
- Ext JS 4 Plugin and Extension Development
- 從零開始學UI:概念解析、實戰提高、突破規則
- Python Social Media Analytics
- 金融商業數據分析:基于Python和SAS
- 面向物聯網的Android應用開發與實踐
- 零基礎入門學習C語言:帶你學C帶你飛