From 6ec941e536a99b737f43e750296e685ae99ad7ec Mon Sep 17 00:00:00 2001 From: Mwaniki Njagi <46248187+MwanikiNjagi@users.noreply.github.com> Date: Sun, 7 Aug 2022 17:51:07 +0300 Subject: [PATCH] p001_basic_neuron_3_inputs for Carbon --- Carbon/p001_basic_neuron_3_inputs.carbon | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Carbon/p001_basic_neuron_3_inputs.carbon diff --git a/Carbon/p001_basic_neuron_3_inputs.carbon b/Carbon/p001_basic_neuron_3_inputs.carbon new file mode 100644 index 0000000..58812af --- /dev/null +++ b/Carbon/p001_basic_neuron_3_inputs.carbon @@ -0,0 +1,25 @@ +// CHECK: result: 34 +//This is a basic neuron with 3 int inputs +//Associated tutorial by Sentdex:https://www.youtube.com/watch?v=Wo5dMEP_BbI + + +package ExplorerTest api; + + +fn Main()-> i32 { + + var inputs: [i32; 3] = (1, 2, 3); + var weights: [i32; 3] = (3, 2, 8); + var bias: i32 = 3; + + var output: i32 = inputs[0] * weights[0] + + inputs[1] * weights[1] + + inputs[2] * weights[2] + + bias; + Print("The output is:{0}", output); + return 0; + +} + + +