2022年5月30日

strerror vs. perror

Question:

 

Use an example to show the difference between strerror and perror.

 

[OpenGL] Fractal Fern V1.1 with Multi-Colors

任務說明

 

  • 幫蕨葉碎形圖塗上五彩繽紛的顏色。

 

[OpenGL] Fractal Fern V1.0

任務說明

 

  • 畫出蕨葉的碎形圖。

 

a216: 數數愛明明

Question:

 

https://zerojudge.tw/ShowProblem?problemid=a216

 

a215: 明明愛數數

Question:

 

https://zerojudge.tw/ShowProblem?problemid=a215

 

a149: 乘乘樂

Question:

 

https://zerojudge.tw/ShowProblem?problemid=a149

 

a147: Print it all

Question:

 

https://zerojudge.tw/ShowProblem?problemid=a147

 

a016: 數獨(SUDOKU)

Question:

 

https://zerojudge.tw/ShowProblem?problemid=a016

 

a015: 矩陣的翻轉

Question:

 

https://zerojudge.tw/ShowProblem?problemid=a015

 

2022年5月28日

[OpenGL] The Big Dipper V1.2 using Shaders

任務說明

 

  • 改用 shaders 來進行渲染。

 

[OpenGL] Import InitShader() Function Call

任務說明

 

  • 匯入《Interactive Computer Graphics: A Top-Down Approach with Shader-Based OpenGL》中的 InitShader() 函式以供後續使用。

 

[OpenGL] The Big Dipper V2.1 with Buffer Object

任務說明

 

  • 改用 buffer object 來傳輸頂點數據。

 

[OpenGL] The Big Dipper V1.1 with Buffer Object

任務說明

 

  • 改用 buffer object 來傳輸頂點數據。

 

a012: 10055 - Hashmat the Brave Warrior

Question:

 

https://zerojudge.tw/ShowProblem?problemid=a012

 

a011: 00494 - Kindergarten Counting Game

Question:

 

https://zerojudge.tw/ShowProblem?problemid=a011

 

a009: 解碼器

Question:

 

https://zerojudge.tw/ShowProblem?problemid=a009

 

a008: 中文大寫數字

Question:

 

https://zerojudge.tw/ShowProblem?problemid=a008

 

a007: 判斷質數

Question:

 

https://zerojudge.tw/ShowProblem?problemid=a007

 

a006: 一元二次方程式

Question:

 

https://zerojudge.tw/ShowProblem?problemid=a006

 

[OpenGL] The Big Dipper V2.0

任務說明

 

  • 在天空背景上點綴幾顆星星。

 

2022年5月27日

[OpenGL] The Big Dipper V1.0

任務說明

 

  • 在視窗中,繪製北斗七星的七個頂點。
  • 將七個頂點用線段串聯起來。

 

[OpenGL] Hello, Teapot

任務說明

 

  • 在視窗中,繪製一個鏤空的茶壺。

 

[OpenGL] Create First Window

任務說明

 

  • 開啟一個視窗,並將視窗背景清除為黃色。
  • 這個程式使用到 FreeGLUT 和 GLEW,請先參考前面幾篇文章說明完成設定。

 

a005: Eva 的回家作業

Question:

 

https://zerojudge.tw/ShowProblem?problemid=a005

 

a002: 簡易加法

Question:

 

https://zerojudge.tw/ShowProblem?problemid=a002

 

String Library Implementation - split

Question:

 

Implement Python string function split() with C in your own way.

 

String Library Implementation - strtol

Question:

 

Implement the existing string function strtol() in your own way. The usage of the function should be the same with the standard version, including the return value.

 

long int mystrtol(const char *nptr, char **endptr, int base);

 

Text Replacement

Question:

 

Input a string and replace the keyword with the new word. The keyword search is case-insensitive.

 

2022年5月26日

Reverse Bit Order Encoding of ASCII

Question:

 

Input a hex string and print its string according to the reverse bit order encoding of ASCII. The hex string should be ended with 00.

 

2022年5月20日

[Windows] GLEW Troubleshooting

問題描述與解決方法

 

  1. 問題:'glewInit': identifier not found


解法:

  • 檢查是否有添加 #include <GL/glew.h>
  • 檢查 glew.h 是否放置到正確的 include 路徑下。

[Windows] 編譯與配置 GLEW

下載與編譯 GLEW 原始碼

 

  1. 在 GLEW 官網,到 Downloads 選擇 Source: ZIP,會自動下載最新版本,目前為 glew-2.1.0.zip。

 

  1. 將下載的壓縮檔解開之後,可以得到一個 glew-2.1.0 目錄。

 

  1. 到 glew-2.1.0\build\vc12 路徑下,使用 Visual Studio 開啟 glew.sln 文件。

 

  1. 若使用的 Visual Studio 版本較新,會出現 Retarget Projects 的對話框,直接點選 OK。

 

2022年5月19日

[Windows] 編譯與配置 FreeGLUT

下載與編譯 FreeGLUT 原始碼

 

  1. 到 FreeGLUT 官網,點選 Download。下載 2022 年最新釋出的版本 freeglut 3.2.2。

 

  1. 將下載的壓縮檔解開之後,可以得到一個 freeglut-3.2.2 目錄。

 

  1. 開啟 CMake GUI:
    • 在 source code 路徑設定中,選擇 freeglut-3.2.2 目錄。
    • 在 freeglut-3.2.2 目錄下,建立一個 build 目錄。
    • 在 build the binaries 路徑設定中,選擇剛剛在 freeglut-3.2.2 下新增的 build 目錄。
    • 點擊 Configure 選擇編譯平台,例如:Visual Studio 17 2022,設定完成點擊 Finish。
    • 點擊 Generate 生成配置文件。
    • 點擊 Open Project 自動開啟 Visual Studio 專案。

 

2022年5月9日

Discriminant

Question:

 

Given a quadratic polynomial, please determine whether the polynomial has two distinct real roots, one real root or no real roots.

 

2022年5月8日

Flip a Hex Number

Question:

 

Input an unsigned 16-bits integer and flip the number’s hex form.

 

Two Three-digits Addition

Question:

 

Input two three-digits non-negative integers and print the calculation process.

 

2022年5月2日

[Windows] pygame.error: Failed loading libmpg123-0.dll: 找不到指定的模組

問題描述

 

  • 執行 pygame.mixer.music.load("music.mp3") 時,出現錯誤訊息:

 

pygame.error: Failed loading libmpg123-0.dll: 找不到指定的模組。

 

和我聯絡

姓名

電子郵件 *

訊息 *