Digital inputs converted to analog value

Looking to use 10 digital inputs to give an analog value for a Teensy 3.0. Going to use it as a joystick input for a little project I am doing.

The digital truth table looks like this -

0 1 2 3 4 5 6 7 8 9 Analog
1 0 0 0 0 0 0 0 0 0 1023
1 1 0 0 0 0 0 0 0 0 921
0 1 1 0 0 0 0 0 0 0 819
0 0 1 1 0 0 0 0 0 0 717
0 0 0 1 1 0 0 0 0 0 615
0 0 0 0 1 1 0 0 0 0 513
0 0 0 0 0 1 1 0 0 0 411
0 0 0 0 0 0 1 1 0 0 309
0 0 0 0 0 0 0 1 1 0 207
0 0 0 0 0 0 0 0 1 1 105
0 0 0 0 0 0 0 0 0 1 0

So pretty straight forward.
I just need to put that value into Joystick.X(value); and I am unsure of the cleanest way to do it.
In case it's not blindingly obvious, I am pretty new to code but not new to electronics so would appreciate long explanations where possible.

I just need to put that value into Joystick.X(value);

What class is joystick an instance of? Does it's X() method actually take a value? Typically, joysticks are input devices, not output devices.

Using bitWrite() would remove the need for a truth table.

switch statement springs to mind. Combine the digital inputs into a single int,
then select on its value.

Thanks for the replies gents.

Normally on the teensy board it uses Joystick.X(analogRead(0)); for the X axis and when it is connected to a PC, it registers as a gamepad and will adjust the x axis according the the input on pin 0

Problem is I am looking to change that from an analog value on pin zero to the analog value generated from 10 digital inputs on the truth table above. I hope that clarifies it a little.